getborg 0.0.118 → 0.0.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FetchHttpClient-C-jciW95.mjs → FetchHttpClient-DkBX_tvM.mjs} +814 -814
- package/dist/{FileSystem-NX0EtGtm.mjs → FileSystem-B8SvsKCB.mjs} +87 -18
- package/dist/{Mime-C6O17O_3.mjs → Mime-mwjBDTG5.mjs} +945 -945
- package/dist/{NodeHttpIncomingMessage-CylGKvlB.mjs → NodeHttpIncomingMessage-Caou0eJc.mjs} +3 -3
- package/dist/{NodeHttpServer-EarHJJzn.mjs → NodeHttpServer-CiwRW4qX.mjs} +7 -7
- package/dist/{NodePtyAdapter-C6ioPYk6.mjs → NodePtyAdapter-DCy0YCxP.mjs} +2 -2
- package/dist/{NodeServices-C18DO3cx.mjs → NodeServices-KA4IGVlf.mjs} +4 -4
- package/dist/{NodeSqliteClient-CWkKfsSo.mjs → NodeSqliteClient-y7W-gFvl.mjs} +3 -3
- package/dist/{NodeStream-1N7oXzTp.mjs → NodeStream-Cwt3mZYs.mjs} +2 -2
- package/dist/{SqlClient-Cusaqpaw.mjs → SqlClient-D-oF89aw.mjs} +2 -2
- package/dist/bin.mjs +27760 -18891
- package/dist/{borgTelemetryNode-CHLcRFOW.mjs → borgTelemetryNode-BTLPaUwA.mjs} +5 -5
- package/dist/client/.vite/manifest.json +396 -320
- package/dist/client/assets/{ArrowRight-CgvCTAzu.js → ArrowRight-D8u8fAtz.js} +2 -2
- package/dist/client/assets/{ArrowSquareOut-C1CwJQ7R.js → ArrowSquareOut-B_f6YUhV.js} +2 -2
- package/dist/client/assets/{ArrowsClockwise-CBwAQTtQ.js → ArrowsClockwise-DQYZ1Xbo.js} +2 -2
- package/dist/client/assets/{CaretLeft-Bk0n02vc.js → CaretLeft-CfrkuxuJ.js} +2 -2
- package/dist/client/assets/ChatMarkdown-Ch9PipMk.js +249 -0
- package/dist/client/assets/CircleNotch-BcVOnWaH.js +2 -0
- package/dist/client/assets/DesignWorkspace-CrijZIpE.js +3 -0
- package/dist/client/assets/DiffPanel-Bbs-arXF.js +2 -0
- package/dist/client/assets/DiffWorkerPoolProvider-B-AH2sbL.js +10 -0
- package/dist/client/assets/{DocxPreview-DHnzhQMX.js → DocxPreview-HXde7oD1.js} +4 -4
- package/dist/client/assets/FilePreviewPanel-DkspqFyX.js +2237 -0
- package/dist/client/assets/HtmlPreview-pfh_hRgS.js +2 -0
- package/dist/client/assets/{PdfPreview-CjWrZkCM.js → PdfPreview-VSGe6F9I.js} +3 -3
- package/dist/client/assets/PptxPreview-CZZ5e7rI.js +3 -0
- package/dist/client/assets/PreviewPanel-C_WqPJu_.js +2 -0
- package/dist/client/assets/PullRequestCodeTab-DLajHhi9.js +6 -0
- package/dist/client/assets/PullRequestReactions-BJ4eU_08.js +12 -0
- package/dist/client/assets/{RightPanelResizeHandle-DBci-Ee2.js → RightPanelResizeHandle-XlC9gY5e.js} +2 -2
- package/dist/client/assets/VirtualizedFile-qiRlyNDc.js +2 -0
- package/dist/client/assets/XlsxPreview-BPtt3tW-.js +3 -0
- package/dist/client/assets/accountData-BKyjOPQm.js +16 -0
- package/dist/client/assets/assetUrls-33nMWFnF.js +2 -0
- package/dist/client/assets/assets-1BW7ZJgz.js +2 -0
- package/dist/client/assets/{browserHistoryStore-CIr_OQCq.js → browserHistoryStore-CEVJXGfr.js} +3 -3
- package/dist/client/assets/browserRecording-BavNt16V.js +2 -0
- package/dist/client/assets/clientAnalytics-ChPHl8_D.js +1 -0
- package/dist/client/assets/clientPersistenceStorage-CeJLSpQl.js +2 -0
- package/dist/client/assets/combobox-CQHB5X6j.js +2 -0
- package/dist/client/assets/composerMentionDrag-CdTT1rUK.js +2 -0
- package/dist/client/assets/designCanvas.logic-DduGt5E7.js +8 -0
- package/dist/client/assets/{designOpenFileContext-DCJpUleA.js → designOpenFileContext-CMKir5dG.js} +2 -2
- package/dist/client/assets/{diffFileContents-CFjzWK4l.js → diffFileContents-CHRsIT6_.js} +3 -3
- package/dist/client/assets/{empty-tcpR9LH8.js → empty-DUUjhkFh.js} +2 -2
- package/dist/client/assets/entities-BtD3_L53.js +2 -0
- package/dist/client/assets/followUpQueuePersistence-C_pFQCnT.js +1 -0
- package/dist/client/assets/{index-DraeEDbf.js → index-DrITfTBh.js} +3 -3
- package/dist/client/assets/{input-BRLXkmUH.js → input-CyCAHFxI.js} +2 -2
- package/dist/client/assets/{lib-ay4Y8Jpt.js → lib-BRpsbmNP.js} +2 -2
- package/dist/client/assets/main-Bi6AoLeM.js +167 -0
- package/dist/client/assets/main-C0iNAqq8.css +2 -0
- package/dist/client/assets/{pdf-BH4RlEy2.js → pdf-C3xMIdpt.js} +2 -2
- package/dist/client/assets/popover-BXSj56CI.js +2 -0
- package/dist/client/assets/pptxDocument-BnTLF4HV.js +3 -0
- package/dist/client/assets/projectFilesQueryState-Cs5skZOc.js +2 -0
- package/dist/client/assets/queries-BevoHPqY.js +2 -0
- package/dist/client/assets/{scroll-area-j6QV0udq.js → scroll-area-DAaT-DGF.js} +36 -36
- package/dist/client/assets/session-Dmu9Hk5C.js +68 -0
- package/dist/client/assets/spinner-K3N_kbJr.js +2 -0
- package/dist/client/assets/textarea-BT0tVWKM.js +2 -0
- package/dist/client/assets/{toggle-DwBa6pBo.js → toggle-Sui8J_p3.js} +2 -2
- package/dist/client/assets/toggle-group-BDgfPfOF.js +2 -0
- package/dist/client/assets/useSettings-GEQSU1F5.js +5 -0
- package/dist/client/assets/{useWorkspaceMutationRefresh-DLI4brDf.js → useWorkspaceMutationRefresh-ApasU6PB.js} +2 -2
- package/dist/client/assets/utils-ClZ5OxbV.js +30 -0
- package/dist/client/assets/xlsxDocument-SRKfhPKH.js +2 -0
- package/dist/client/index.html +1 -1
- package/dist/service-launcher.mjs +1 -1
- package/package.json +2 -2
- package/dist/client/assets/ChatMarkdown-BhfpBJaq.js +0 -249
- package/dist/client/assets/DesignWorkspace-okkekyBu.js +0 -3
- package/dist/client/assets/DiffPanel-Dn_Or9fx.js +0 -2
- package/dist/client/assets/DiffWorkerPoolProvider-Hp3trMBG.js +0 -10
- package/dist/client/assets/FilePreviewPanel-KOVwBhPe.js +0 -2231
- package/dist/client/assets/HtmlPreview-I3xV5YgS.js +0 -2
- package/dist/client/assets/PptxPreview-D4YsFq_s.js +0 -3
- package/dist/client/assets/PreviewPanel-CKieJ-9L.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-DbUx3FWB.js +0 -6
- package/dist/client/assets/PullRequestReactions-BSI_Qt4L.js +0 -12
- package/dist/client/assets/VirtualizedFile-VSzhLWFM.js +0 -2
- package/dist/client/assets/XlsxPreview-BnnrdNes.js +0 -3
- package/dist/client/assets/accountData-C4ZvicpJ.js +0 -16
- package/dist/client/assets/assetUrls-C2vkiSgX.js +0 -2
- package/dist/client/assets/browserRecording-BmG6q-H4.js +0 -2
- package/dist/client/assets/clientPersistenceStorage-BlYjZvCd.js +0 -2
- package/dist/client/assets/combobox-uXzVxkLc.js +0 -2
- package/dist/client/assets/composerMentionDrag-DTGN7WcV.js +0 -2
- package/dist/client/assets/designCanvas.logic-DtK3Ht6X.js +0 -8
- package/dist/client/assets/entities-Da-AvwsX.js +0 -2
- package/dist/client/assets/main-Bn8Ylf8R.js +0 -161
- package/dist/client/assets/main-YscGsfgO.css +0 -2
- package/dist/client/assets/popover-DTprsoPQ.js +0 -2
- package/dist/client/assets/pptxDocument-ifTk53yH.js +0 -3
- package/dist/client/assets/projectFilesQueryState-CD_JXBj5.js +0 -2
- package/dist/client/assets/queries-D1AwaR_5.js +0 -2
- package/dist/client/assets/session-BaysTZDD.js +0 -67
- package/dist/client/assets/spinner-DHhZaoFg.js +0 -2
- package/dist/client/assets/textarea-BB3euU4O.js +0 -5
- package/dist/client/assets/toggle-group-BU7-0DcW.js +0 -2
- package/dist/client/assets/utils-DgzD4MA_.js +0 -30
- package/dist/client/assets/xlsxDocument-DwhEMpfP.js +0 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{o as e,t}from"./rolldown-runtime-DAXXjFlN.js";import{$ as n,$a as r,$i as i,$r as a,$s as o,$t as s,Al as c,As as l,At as u,Ba as d,Bi as f,Bt as p,Bu as m,Cn as h,Co as g,Ct as _,Da as v,Dn as y,Dr as b,Dt as x,Ea as S,Ed as C,En as w,Et as T,Fc as E,Fi as D,Fo as O,Ft as k,Ga as A,Gd as j,Gl as M,Gt as N,Hd as P,Ho as F,Hs as I,Ht as ee,Il as te,Io as ne,It as re,Ja as L,Ji as ie,Jn as ae,Js as R,Jt as z,Ka as oe,Kd as se,Ko as ce,Kt as le,Lc as ue,Ll as de,Lo as fe,Lt as pe,No as me,Nt as he,Ol as ge,Oo as _e,Ot as ve,Po as ye,Ps as be,Pt as xe,Q as Se,Qa as Ce,Qd as we,Qi as Te,Ql as Ee,Qo as De,Qs as Oe,Qt as ke,Qu as Ae,Ra as je,Rd as Me,Rt as Ne,Sn as Pe,So as Fe,Tc as Ie,Tl as Le,Tn as Re,To as ze,Tt as Be,Ut as Ve,Vi as He,Vl as Ue,Vo as We,Vs as Ge,Wa as Ke,Wo as qe,Wt as Je,Xd as Ye,Xr as Xe,Xt as Ze,Xu as Qe,Yl as $e,Ys as et,Za as tt,Zd as nt,Zr as rt,Zt as it,_f as at,_o as ot,_s as st,aa as ct,ad as lt,af as ut,an as dt,ao as ft,ar as pt,au as mt,bc as ht,bn as gt,bo as _t,cd as vt,cl as yt,co as bt,df as xt,do as B,dt as St,du as Ct,ef as wt,ei as Tt,fd as Et,ff as Dt,ft as Ot,gl as kt,hc as At,hf as jt,hl as Mt,i as Nt,ia as Pt,id as Ft,in as It,jl as Lt,jt as Rt,lo as zt,lu as Bt,m as Vt,mf as Ht,ml as Ut,ms as Wt,mt as Gt,nd as Kt,nf as qt,nl as Jt,nn as Yt,ns as Xt,nt as Zt,oc as Qt,od as $t,on as en,oo as tn,os as nn,pf as rn,pl as an,po as on,ps as sn,pt as cn,pu as ln,qa as un,qo as dn,qs as fn,rd as pn,rf as mn,rl as hn,rn as gn,rr as _n,rt as vn,so as yn,sr as bn,ss as xn,tf as Sn,ti as Cn,tl as wn,tn as Tn,to as En,ts as Dn,ul as On,uo as kn,ut as An,v as jn,vd as Mn,vf as Nn,vl as Pn,vo as Fn,wi as In,wn as Ln,wo as Rn,wt as zn,xf as Bn,xi as Vn,xn as Hn,y as Un,yd as Wn,yf as Gn,yl as Kn,za as qn,zl as Jn,zs as Yn}from"./accountData-BKyjOPQm.js";var Xn=e=>()=>{let t=ze(yn(e));return Pt((e,n)=>wn(et(e,e=>t(e))))},Zn={"~effect/Ref":{_A:Gn},...wt,toJSON(){return{_id:`Ref`,ref:this.ref}}},Qn=e=>{let t=Object.create(Zn);return t.ref=S(e),t},$n=e=>hn(()=>Qn(e)),er=e=>hn(()=>e.ref.current),tr=at(2,(e,t)=>hn(()=>v(e.ref,t))),nr=at(2,(e,t)=>hn(()=>{let n=e.ref.current;return e.ref.current=t,n})),rr=at(2,(e,t)=>hn(()=>{let[n,r]=t(e.ref.current);return e.ref.current=r,n})),ir=at(2,(e,t)=>hn(()=>{e.ref.current=t(e.ref.current)})),ar=`~effect/http/HttpClient`,or=Wn(`effect/HttpClient`),sr=at(2,(e,t)=>lr(n=>t(e.postprocess(n)),e.preprocess)),cr=sr(et(zn)),lr=(e,t)=>{let n=Object.create(ur);return n.preprocess=t,n.postprocess=e,n.execute=function(n){return e(t(n))},n},ur={[ar]:ar,pipe(){return Bn(this,arguments)},...qt,toJSON(){return{_id:`effect/HttpClient`}},...Object.fromEntries(w.map(([e,t])=>[t,function(t,n){return this.execute(Rt(e)(t,n))}]))},dr=e=>lr(t=>et(t,t=>Pn(n=>{let r=xr.get(t),i=r??new AbortController,a=pe(t.url,t.urlParams,Me(t.hash));if($t(a))return fn(new p({reason:new ee({request:t,cause:a.failure})}));let o=a.success;if(n.getRef(m)||n.getRef(hr)(t)){let a=e(t,o,i.signal,n);return r?a:an(e=>ht(e(a),{onSuccess(e){return br.register(e,i),wn(new Sr(e,i))},onFailure(e){return M(e)&&i.abort(),R(e)}}))}return Mt(n.getRef(vr)(t),{kind:`client`},a=>{a.attribute(`http.request.method`,t.method),a.attribute(`server.address`,o.origin),o.port!==``&&a.attribute(`server.port`,+o.port),a.attribute(`url.full`,o.toString()),a.attribute(`url.path`,o.pathname),a.attribute(`url.scheme`,o.protocol.slice(0,-1));let s=o.search.slice(1);s!==``&&a.attribute(`url.query`,s);let c=n.getRef(le),l=n.getRef(gr),u=it(t.headers,c);for(let e in u)l(e,`request`)&&a.attribute(`http.request.header.${e}`,String(u[e]));return t=n.getRef(_r)?k(t,Gt(a)):t,an(s=>s(e(t,o,i.signal,n)).pipe(Kn(a,{captureStackTrace:!1}),ht({onSuccess:e=>{a.attribute(`http.response.status_code`,e.status);let t=it(e.headers,c);for(let e in t)l(e,`response`)&&a.attribute(`http.response.header.${e}`,String(t[e]));return r?wn(e):(br.register(e,i),wn(new Sr(e,i)))},onFailure(e){return!r&&M(e)&&i.abort(),R(e)}})))})})),wn),fr=at(2,(e,t)=>lr(e.postprocess,n=>At(e.preprocess(n),t))),pr=at(2,(e,t)=>lr(e.postprocess,n=>et(e.preprocess(n),t))),mr=at(2,(e,t)=>{let n=Le(t),r=n?`errors-and-responses`:t.retryOn??`errors-and-responses`,i=n?t:t.schedule,a=i&&ge(i),o=n?void 0:t.times;return sr(e,Nn(r===`errors-only`?Gn:E({schedule:a,times:o,while:Tr}),r===`response-only`?Gn:ue({while:n||t.while===void 0?Cr:rn(Cr,t.while),schedule:i,times:o})))}),hr=Mn(`effect/http/HttpClient/TracerDisabledWhen`,{defaultValue:()=>Ht}),gr=Mn(`effect/http/HttpClient/TracerHeaderFilter`,{defaultValue:()=>jt}),_r=Mn(`effect/HttpClient/TracerPropagationEnabled`,{defaultValue:jt}),vr=Mn(`effect/http/HttpClient/SpanNameGenerator`,{defaultValue:()=>e=>`http.client ${e.method}`}),yr=e=>mt(or)(I(t=>At(e,e=>sr(e,Ut(e=>C(t,e)))))),br=(()=>{if(`FinalizationRegistry`in globalThis&&globalThis.FinalizationRegistry){let e=new FinalizationRegistry(e=>{e.abort()});return{register(t,n){e.register(t,n,t)},unregister(t){e.unregister(t)}}}let e=new Map;return{register(t,n){e.set(t,setTimeout(()=>n.abort(),5e3))},unregister(t){let n=e.get(t);n!==void 0&&(clearTimeout(n),e.delete(t))}}})(),xr=new WeakMap,Sr=class{original;controller;constructor(e,t){this.original=e,this.controller=t}[_]=_;[x]=x;applyInterrupt(e){return Jt(()=>(br.unregister(this.original),Ie(e,()=>hn(()=>{this.controller.abort()}))))}get request(){return this.original.request}get status(){return this.original.status}get headers(){return this.original.headers}get cookies(){return this.original.cookies}get remoteAddress(){return this.original.remoteAddress}get formData(){return this.applyInterrupt(this.original.formData)}get text(){return this.applyInterrupt(this.original.text)}get json(){return this.applyInterrupt(this.original.json)}get urlParamsBody(){return this.applyInterrupt(this.original.urlParamsBody)}get arrayBuffer(){return this.applyInterrupt(this.original.arrayBuffer)}get stream(){return ie(()=>(br.unregister(this.original),In(this.original.stream,hn(()=>{this.controller.abort()}))))}toJSON(){return this.original.toJSON()}[mn](){return this.original[mn]()}pipe(){return Bn(this,arguments)}},Cr=e=>Ee(e)||wr(e),wr=e=>N(e)&&(e.reason._tag===`TransportError`||e.reason._tag===`StatusCodeError`&&Tr(e.reason.response)),Tr=e=>e.status===408||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504,Er=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Dr=t(((e,t)=>{t.exports=Er()})),Or=t((e=>{var t=Un();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),kr=t(((e,t)=>{t.exports=Or()})),Ar=t((e=>{var t=Un(),n=kr();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),jr=t(((e,t)=>{t.exports=Ar()})),Mr=t((e=>{var t=Un();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),Nr=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Mr()})),Pr=`~effect/encoding/Sse/SseError`,Fr=class extends de(`EventTooLarge`){get message(){return`Pending SSE event exceeded the maximum size of ${this.maxEventSize}`}},Ir=class extends de(`SseError`){[Pr]=Pr;get message(){return this.reason.message}},Lr=10*1024*1024,Rr=e=>Pt((t,n)=>hn(()=>{let n=[],r,i=Br(e=>{e._tag===`Retry`?r=e:n.push(e)},e),a=et(t,e=>{for(let t=0;t<e.length;t++){let n=i.feed(e[t]);if(n!==void 0)return fn(n)}return kt});return Jt(function e(){if(Ae(n)){let e=n;return n=[],wn(e)}else if(r)return fn(r);return et(a,e)})})),zr=(e,t)=>ct(Rr(t),Xn(Ur.pipe(_e(e)))());function Br(e,t){let n=t?.maxEventSize??Lr,r,i,a,o,s,c,l,u;return d(),{feed:f,reset:d};function d(){r=!0,i=``,a=0,o=-1,s=void 0,l=void 0,u=``}function f(e){i=i?i+e:e,r&&Hr(i)&&(i=i.slice(Vr.length)),r=!1;let t=i.length,s=0,c=!1;for(;s<t;){c&&=(i[s]===`
|
|
2
|
+
`&&++s,!1);let e=-1,n=o,r;for(let o=a;e<0&&o<t;++o)r=i[o],r===`:`&&n<0?n=o-s:r===`\r`?(c=!0,e=o-s):r===`
|
|
3
|
+
`&&(e=o-s);if(e<0){a=t-s,o=n;break}else a=0,o=-1;p(i,s,n,e),s+=e+1}if(s===t?i=``:s>0&&(i=i.slice(s)),i.length+u.length>n){let e=new Ir({reason:new Fr({maxEventSize:n})});return d(),e}}function p(t,n,r,i){if(i===0){u.length>0&&(e({_tag:`Event`,id:s,event:l??`message`,data:u.slice(0,-1)}),u=``,s=void 0),l=void 0;return}let a=r<0,o=t.slice(n,n+(a?i:r)),d=0;d=a?i:t[n+r+1]===` `?r+2:r+1;let f=n+d,p=i-d,m=t.slice(f,f+p).toString();if(o===`data`)u+=m?`${m}\n`:`
|
|
4
|
+
`;else if(o===`event`)l=m;else if(o===`id`&&!m.includes(`\0`))s=m,c=m;else if(o===`retry`){let t=parseInt(m,10);Number.isNaN(t)||e(new Gr({duration:Et(t),lastEventId:c}))}}}var Vr=[239,187,191];function Hr(e){return Vr.every((t,n)=>e.charCodeAt(n)===t)}var Ur=on({id:We(B),event:B,data:B}),Wr=`~effect/encoding/Sse/Retry`,Gr=class e extends te(`Retry`){[Wr]=Wr;static is(e){return xt(e,Wr)}static filter(t){return e.is(t)?vt(t):Ft(t)}},Kr=(e,t)=>Qt(function*(){let n=yield*Ge(),r=t.httpClient.pipe(t?.baseUrl===void 0?Gn:fr(he(t.baseUrl.toString())));function i(e,t,a,o,s){if(s===-1)return r.execute(a);let c=n.mapUnsafe.get(o[s]);return c===void 0?i(e,t,a,o,s-1):c({endpoint:t,group:e,request:a,next(n){return i(e,t,n,o,s-1)}})}St(e,{predicate:t?.predicate,onGroup(e){t.onGroup?.(e)},onEndpoint(e){let{group:n,endpoint:r,errors:a,successes:s}=e,c=Zr(r.path),l={orElse:pi},d=T(l),f=new Map;for(let[e,t]of a.entries()){let n=ti(t);for(let[t,r]of n.entries())$r(f,e,t,Qr(r))}for(let[e,t]of f.entries()){let n=ei(t);l[e]=e=>et(be(n(e),t=>R(Jn(Ue(new p({reason:new Ve({request:e.request,response:e})})),t))),fn)}let m=new Map;for(let[e,t]of s.entries()){let n=ti(t);for(let[t,r]of n.entries())$r(m,e,t,Qr(r))}for(let e of ii(r))$r(m,Pe(e),e.contentType,ai(e));for(let[e,t]of m.entries())l[e]=ei(t);let h=dn(r.params,ye),g=Ot(r),_=Ae(g)?y(r.method)?ye(hi(g,r.method)):ye(_t(g)):void 0,v=dn(r.headers,ye),b=dn(r.query,ye),x=Array.from(e.middleware,e=>`${e.key}/Client`),S=o(function*(e){let a=Rt(r.method)(r.path);if(e!==void 0){if(h!==void 0){let t=yield*h(e.params);a=re(a,c(t))}if(_!==void 0)if(y(r.method))if(e.payload instanceof FormData)a=u(a,e.payload);else{let t=yield*_(e.payload);a=xe(a,t)}else{let t=yield*_(e.payload);a=ve(a,t)}if(v!==void 0){let t=yield*v(e.headers);a=k(a,t)}if(b!==void 0){let t=yield*b(e.query);a=ve(a,t)}}let o=yield*i(n,r,a,x,x.length-1);if(e?.responseMode===`response-only`)return o;let s=yield*t.transformResponse===void 0?d(o):t.transformResponse(d(o));return e?.responseMode===`decoded-and-response`?[s,o]:s});t.onEndpoint({...e,endpointFn:S})}})}),qr=(e,t)=>et(or,n=>Jr(e,{...t,httpClient:t?.transformClient?t.transformClient(n):n})),Jr=(e,t)=>{let n={};return Kr(e,{...t,onGroup({group:e}){e.topLevel||Sn(n,e.identifier,{})},onEndpoint({endpoint:e,endpointFn:t,group:r}){Sn(r.topLevel?n:n[r.identifier],e.identifier,t)}}).pipe(l(n))},Yr=(e,t)=>{let n={};return St(e,{onGroup({group:e}){e.topLevel||Sn(n,e.identifier,{})},onEndpoint({group:e,endpoint:r}){let i=Zr(r.path),a=r.params===void 0?void 0:me(r.params),o=r.query===void 0?void 0:me(r.query);Sn(e.topLevel?n:n[e.identifier],r.identifier,e=>{let n=e?.params,s=n===void 0?r.path:i(a===void 0?n:a(n)),c=e?.query===void 0?void 0:o===void 0?e.query:o(e.query),l=c===void 0?``:en(It(c)),u=l===``?s:`${s}?${l}`;return t?.baseUrl===void 0?u:new URL(u,t.baseUrl.toString()).toString()})}}),n},Xr=/(\/?):(\w+)(\?)?/g,Zr=e=>Xr.test(e)?(Xr.lastIndex=0,t=>(Xr.lastIndex=0,e.replace(Xr,(e,n,r,i)=>{let a=t[r];if(a===void 0){if(i!==void 0)return``;throw Error(`Missing path parameter: ${r}`)}return`${n}${encodeURIComponent(a)}`}))):t=>e;function Qr(e){let t=ze(fi(e));return e=>et(e.arrayBuffer,t)}function $r(e,t,n,r){let i=cn(n),a=e.get(t);a===void 0?e.set(t,[{contentType:i,decode:r}]):a.push({contentType:i,decode:r})}function ei(e){let t=e[0];return e.length===1&&t!==void 0?t.decode:t=>{let n=cn(t.headers[`content-type`]??``),r=e.find(e=>e.contentType===n);return r===void 0?ni(t,n,e):r.decode(t)}}function ti(e){let t=new Map;for(let n of e){let e=h(n.ast)?``:cn(Hn(n.ast).contentType),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}return t}function ni(e,t,n){let r=Array.from(new Set(n.map(e=>e.contentType))).join(`, `);return fn(new p({reason:new Ne({request:e.request,response:e,description:`Unsupported response content-type for status ${e.status}: ${t||`<missing>`}. Expected one of: ${r}`})}))}var ri=`effect/httpapi/stream/failure`;function ii(e){let t=[];for(let n of e.success)Ln(n)&&t.push(n);return t}function ai(e){let t=Re(e)?void 0:{declaration:e,decoder:oi(e)};return e=>At(Ge(),n=>He(t===void 0?e.stream:si(e.stream,t.declaration,t.decoder),n))}function oi(e){return zr(_t([on({event:ft(ri),data:O(qe(r(e.error,En())))}),e.events]))}function si(e,t,n){let r=i(e.pipe(Vn,f(n)),e=>hn(()=>{let t;return Jt(()=>t===void 0?et(e,e=>{for(let n=0;n<e.length;n++){let r=e[n];if(r.event===ri&&$e(r.data)){if(n===0)return R(r.data);t=r.data,e=e.slice(0,n);break}}return wn(e)}):R(t))}));return t.sseMode===`data`?D(r,e=>e.data):r}var ci=ne(globalThis.ArrayBuffer,{expected:`ArrayBuffer`}),li=ci.pipe(_e(ot,nn({decode(e){return new Uint8Array(e)},encode(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}}))),ui=ci.pipe(_e(B,nn({decode(e){return new TextDecoder().decode(e)},encode(e){let t=new TextEncoder().encode(e);return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}}))),di=ui.pipe(_e(_t([ft(``).pipe(_e(Fn,nn({decode:()=>void 0,encode:()=>``}))),Fe])));function fi(e){return _t(e.map(t));function t(e){switch(Hn(e.ast)._tag){case`Json`:{let t=Dn(Xt(e.ast));return di.pipe(_e(e,t?nn({decode:e=>e===void 0?null:e,encode:e=>e===null?void 0:e}):void 0))}case`FormUrlEncoded`:return ui.pipe(_e(dt),_e(e));case`Uint8Array`:return li.pipe(_e(e));case`Text`:return ui.pipe(_e(e))}}}var pi=e=>fn(new p({reason:new Ne({request:e.request,response:e})})),mi=Rn(s);function hi(e,t){return _t(e.map(e=>_i(e,t)))}var gi=new WeakMap;function _i(e,t){let n=e.ast,r=gi.get(n);if(r!==void 0)return r;let i=gt(n,t),a=mi.pipe(_e(e,xn({decode(){return fn(new sn({message:`Encode only schema`}))},encode(e){switch(i._tag){case`Multipart`:return fn(new sn({message:`Payload must be a FormData`}));case`Json`:try{return wn(Tn(JSON.stringify(e),i.contentType))}catch{return fn(new Wt({message:`Expected a JSON-serializable request body`}))}case`Text`:return typeof e==`string`?wn(Tn(e,i.contentType)):fn(new Wt({message:`Expected a string`}));case`FormUrlEncoded`:return Dt(e)?wn(gn(It(e),i.contentType)):fn(new Wt({message:`Expected a record`}));case`Uint8Array`:return e instanceof Uint8Array?wn(Yt(e,i.contentType)):fn(new Wt({message:`Expected a Uint8Array`}))}}})));return gi.set(n,a),a}function vi(e){let t=e.replace(/\/+$/u,``);return t===``?`/`:`${t}/`}function yi(e){let t=new URL(e);if(t.protocol===`ws:`?t.protocol=`http:`:t.protocol===`wss:`&&(t.protocol=`https:`),t.protocol!==`http:`&&t.protocol!==`https:`)throw Error(`Endpoint must use HTTP or HTTPS. Received ${t.protocol}`);return t.pathname=vi(t.pathname),t.search=``,t.hash=``,t.toString()}function bi(e){let t=new URL(yi(e));return t.protocol=t.protocol===`https:`?`wss:`:`ws:`,t.toString()}var xi=(e,t)=>{let n=new URL(e);n.pathname=n.pathname.replace(/\/+$/u,``)+`/`,n.search=``,n.hash=``;let r=t.replace(/^\/+/u,``);return new URL(r,n).toString()},Si=e=>{let t=new URL(xi(e,`/ws`));return t.search=``,t.hash=``,t.toString()},Ci=mt(le,At(le,e=>[...e,`dpop`])),wi=Mn(`effect/http/FetchHttpClient/Fetch`,{defaultValue:()=>globalThis.fetch}),Ti=class extends Wn()(`effect/http/FetchHttpClient/RequestInit`){},Ei=yr(wn(dr((e,t,n,r)=>{let i=r.getRef(wi),a=r.context.mapUnsafe.get(Ti.key)??{},o=a.headers?Ze(z(a.headers),e.headers):e.headers;o[`content-length`]&&(o=ke(o,`content-length`));let s=r=>At(On({try:()=>i(t,{...a,method:e.method,headers:o,body:r,duplex:e.body._tag===`Stream`?`half`:void 0,signal:n}),catch:t=>new p({reason:new Je({request:e,cause:t})})}),t=>Be(e,t));switch(e.body._tag){case`Raw`:case`Uint8Array`:return s(e.body.body);case`FormData`:return s(e.body.formData);case`Stream`:return et(Te(e.body.stream),s)}return s(void 0)}))),Di=fe(vn),Oi=class extends de(`RemoteEnvironmentAuthFetchError`){},ki=class extends de(`RemoteEnvironmentAuthInvalidJsonError`){},Ai=class extends de(`RemoteEnvironmentAuthUndeclaredStatusError`){constructor(e,t){super({message:`Remote environment endpoint ${e} returned undeclared status ${t}.`,requestUrl:e,status:t})}},ji=class extends de(`RemoteEnvironmentAuthTimeoutError`){constructor(e,t){super({message:`Remote environment endpoint ${e} timed out after ${t}ms.`,requestUrl:e,timeoutMs:t})}},Mi=e=>(t,n)=>{let r=n?.headers;if(r===void 0||r instanceof Headers||Array.isArray(r)||!(`b3`in r))return e(t,n);let{b3:i,...a}=r;return e(t,{...n,headers:a})},Ni=e=>Bt(Ei.pipe(Ct(ln(wi,Mi(e)))),Ci),Pi=e=>{let t=new URL(e);return t.pathname=t.pathname.replace(/\/+$/u,``)+`/`,t.search=``,t.hash=``,t.toString()},Fi=e=>qr(Zt,{baseUrl:Pi(e)}),Ii=e=>Yr(Zt,{baseUrl:Pi(e)}),Li=(e,t)=>{if(t instanceof ji||Di(t))return fn(t);if(De(t))return fn(new ki({message:`Remote environment endpoint returned an invalid response from ${e}.`,cause:t}));if(N(t)&&t.response!==void 0){let n=t.response;return n.status<200||n.status>=300?fn(new Ai(e,n.status)):fn(new ki({message:`Remote environment endpoint returned an invalid response from ${e}.`,cause:t}))}return fn(new Oi({message:`Failed to fetch remote environment endpoint ${e} (${String(t)}).`,cause:t}))},Ri=(e,t,n)=>n.pipe(yt(Et(t)),et(P({onNone:()=>fn(new ji(e,t)),onSome:wn})),Yn(t=>Li(e,t))),zi=1e4,Bi=6e4,Vi=1e3,Hi=60,Ui=new Set([404,502,503,504]),Wi=e=>e._tag===`RemoteEnvironmentAuthFetchError`?!0:e._tag===`RemoteEnvironmentAuthUndeclaredStatusError`&&typeof e.status==`number`&&Ui.has(e.status),Gi=Oe(`clientRuntime.environment.fetchRemoteEnvironmentDescriptor`)(function*(e){let t=yield*Fi(e.httpBaseUrl),n=Ri(xi(e.httpBaseUrl,`/.well-known/borg/environment`),e.timeoutMs??zi,t.metadata.descriptor());return e.awaitRouting===!0?yield*n.pipe(ue({while:Wi,schedule:c(Vi).pipe(Lt({duration:Bi,times:Hi}))})):yield*n}),V=e(Un(),1),Ki=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),qi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),Ji=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M209.88,69.83A115.19,115.19,0,0,0,128,36h-.41C63.85,36.22,12,88.76,12,153.13V176a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V152A115.25,115.25,0,0,0,209.88,69.83ZM220,172H127.32l46.44-65A12,12,0,1,0,154.24,93L97.82,172H36V153.13c0-1.72,0-3.43.14-5.13H56a12,12,0,0,0,0-24H40.62c10.91-33.39,40-58.52,75.38-63.21V80a12,12,0,0,0,24,0V60.8A92,92,0,0,1,215.66,124H200a12,12,0,0,0,0,24h19.9c.06,1.33.1,2.66.1,4Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M232,152v24a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V153.13C24,95.65,70.15,48.2,127.63,48A104,104,0,0,1,232,152Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M240,152v24a16,16,0,0,1-16,16H115.93a4,4,0,0,1-3.24-6.35L174.27,101a8.21,8.21,0,0,0-1.37-11.3,8,8,0,0,0-11.37,1.61l-72,99.06A4,4,0,0,1,86.25,192H32a16,16,0,0,1-16-16V153.13c0-1.79,0-3.57.13-5.33a4,4,0,0,1,4-3.8H48a8,8,0,0,0,8-8.53A8.17,8.17,0,0,0,47.73,128H23.92a4,4,0,0,1-3.87-5c12-43.84,49.66-77.13,95.52-82.28a4,4,0,0,1,4.43,4V72a8,8,0,0,0,8.53,8A8.17,8.17,0,0,0,136,71.73V44.67a4,4,0,0,1,4.43-4A112.18,112.18,0,0,1,236.23,123a4,4,0,0,1-3.88,5H208.27a8.17,8.17,0,0,0-8.25,7.47,8,8,0,0,0,8,8.53h27.92a4,4,0,0,1,4,3.86C240,149.23,240,150.61,240,152Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M205.65,74.08A109.26,109.26,0,0,0,128,42h-.39C67.17,42.21,18,92.06,18,153.13V176a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V152A109.3,109.3,0,0,0,205.65,74.08ZM226,176a2,2,0,0,1-2,2H115.78l57.07-78.47a6,6,0,0,0-9.7-7.06L100.94,178H32a2,2,0,0,1-2-2V153.13A102.36,102.36,0,0,1,30.62,142H56a6,6,0,0,0,0-12H32.71C42.6,88.4,78.53,56.86,122,54.19V80a6,6,0,0,0,12,0V54.19A98.05,98.05,0,0,1,223.53,130H200a6,6,0,0,0,0,12h25.5c.33,3.3.5,6.64.5,10Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M204.23,75.5A107.37,107.37,0,0,0,127.62,44C68.28,44.21,20,93.16,20,153.13V176a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V152A107.25,107.25,0,0,0,204.23,75.5ZM228,176a4,4,0,0,1-4,4H111.85l59.38-81.65a4,4,0,1,0-6.46-4.7L102,180H32a4,4,0,0,1-4-4V153.13A103.42,103.42,0,0,1,28.84,140H56a4,4,0,0,0,0-8H30.21C39.59,87.66,77.84,53.93,124,52.09V80a4,4,0,0,0,8,0V52.08A100.08,100.08,0,0,1,226,132H200a4,4,0,0,0,0,8h27.29a101.6,101.6,0,0,1,.71,12Z`}))]]),Yi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M96,240l16-80L48,136,160,16,144,96l64,24Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z`}))]]),Xi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z`}))]]),Zi=(0,V.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),Qi=Object.defineProperty,$i=Object.getOwnPropertySymbols,ea=Object.prototype.hasOwnProperty,ta=Object.prototype.propertyIsEnumerable,na=(e,t,n)=>t in e?Qi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ra=(e,t)=>{for(var n in t||={})ea.call(t,n)&&na(e,n,t[n]);if($i)for(var n of $i(t))ta.call(t,n)&&na(e,n,t[n]);return e},ia=(e,t)=>{var n={};for(var r in e)ea.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$i)for(var r of $i(e))t.indexOf(r)<0&&ta.call(e,r)&&(n[r]=e[r]);return n},aa=(0,V.forwardRef)((e,t)=>{let n=e,{alt:r,color:i,size:a,weight:o,mirrored:s,children:c,weights:l}=n,u=ia(n,[`alt`,`color`,`size`,`weight`,`mirrored`,`children`,`weights`]),d=(0,V.useContext)(Zi),{color:f=`currentColor`,size:p,weight:m=`regular`,mirrored:h=!1}=d,g=ia(d,[`color`,`size`,`weight`,`mirrored`]);return V.createElement(`svg`,ra(ra({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a??p,height:a??p,fill:i??f,viewBox:`0 0 256 256`,transform:s||h?`scale(-1, 1)`:void 0},g),u),!!r&&V.createElement(`title`,null,r),c,l.get(o??m))});aa.displayName=`IconBase`;var oa=aa,sa=Object.defineProperty,ca=Object.defineProperties,la=Object.getOwnPropertyDescriptors,ua=Object.getOwnPropertySymbols,da=Object.prototype.hasOwnProperty,fa=Object.prototype.propertyIsEnumerable,pa=(e,t,n)=>t in e?sa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ma=(e,t)=>{for(var n in t||={})da.call(t,n)&&pa(e,n,t[n]);if(ua)for(var n of ua(t))fa.call(t,n)&&pa(e,n,t[n]);return e},ha=(e,t)=>ca(e,la(t)),ga=(0,V.forwardRef)((e,t)=>V.createElement(oa,ha(ma({ref:t},e),{weights:Ki})));ga.displayName=`CaretDown`;var _a=Object.defineProperty,va=Object.defineProperties,ya=Object.getOwnPropertyDescriptors,ba=Object.getOwnPropertySymbols,xa=Object.prototype.hasOwnProperty,Sa=Object.prototype.propertyIsEnumerable,Ca=(e,t,n)=>t in e?_a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wa=(e,t)=>{for(var n in t||={})xa.call(t,n)&&Ca(e,n,t[n]);if(ba)for(var n of ba(t))Sa.call(t,n)&&Ca(e,n,t[n]);return e},Ta=(e,t)=>va(e,ya(t)),Ea=(0,V.forwardRef)((e,t)=>V.createElement(oa,Ta(wa({ref:t},e),{weights:qi})));Ea.displayName=`CaretRight`;var Da=Object.defineProperty,Oa=Object.defineProperties,ka=Object.getOwnPropertyDescriptors,Aa=Object.getOwnPropertySymbols,ja=Object.prototype.hasOwnProperty,Ma=Object.prototype.propertyIsEnumerable,Na=(e,t,n)=>t in e?Da(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pa=(e,t)=>{for(var n in t||={})ja.call(t,n)&&Na(e,n,t[n]);if(Aa)for(var n of Aa(t))Ma.call(t,n)&&Na(e,n,t[n]);return e},Fa=(e,t)=>Oa(e,ka(t)),Ia=(0,V.forwardRef)((e,t)=>V.createElement(oa,Fa(Pa({ref:t},e),{weights:Ji})));Ia.displayName=`Gauge`;var La=Object.defineProperty,Ra=Object.defineProperties,za=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertySymbols,Va=Object.prototype.hasOwnProperty,Ha=Object.prototype.propertyIsEnumerable,Ua=(e,t,n)=>t in e?La(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wa=(e,t)=>{for(var n in t||={})Va.call(t,n)&&Ua(e,n,t[n]);if(Ba)for(var n of Ba(t))Ha.call(t,n)&&Ua(e,n,t[n]);return e},Ga=(e,t)=>Ra(e,za(t)),Ka=(0,V.forwardRef)((e,t)=>V.createElement(oa,Ga(Wa({ref:t},e),{weights:Yi})));Ka.displayName=`Lightning`;var qa=Object.defineProperty,Ja=Object.defineProperties,Ya=Object.getOwnPropertyDescriptors,Xa=Object.getOwnPropertySymbols,Za=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,$a=(e,t,n)=>t in e?qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eo=(e,t)=>{for(var n in t||={})Za.call(t,n)&&$a(e,n,t[n]);if(Xa)for(var n of Xa(t))Qa.call(t,n)&&$a(e,n,t[n]);return e},to=(e,t)=>Ja(e,Ya(t)),no=(0,V.forwardRef)((e,t)=>V.createElement(oa,to(eo({ref:t},e),{weights:Xi})));no.displayName=`SidebarSimple`;var ro=jn(),H=Dr(),io=(0,V.forwardRef)(function(e,t){let n=(0,ro.c)(3),r;return n[0]!==e||n[1]!==t?(r=(0,H.jsx)(no,{ref:t,mirrored:!0,...e}),n[0]=e,n[1]=t,n[2]=r):r=n[2],r});function ao(e,t){return{environmentId:e,projectId:t}}function oo(e,t){return{environmentId:e,threadId:t}}function so(e){let t=`projectId`in e?e.projectId:e.threadId;return`${e.environmentId}:${t}`}function co(e){return so(e)}function lo(e){return so(e)}function uo(e){let t=e.indexOf(`:`);return t<=0||t>=e.length-1?null:{environmentId:A.make(e.slice(0,t)),localId:e.slice(t+1)}}function fo(e){let t=uo(e);return t?{environmentId:t.environmentId,projectId:un.make(t.localId)}:null}function po(e){let t=uo(e);return t?{environmentId:t.environmentId,threadId:L.make(t.localId)}:null}function mo(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=mo(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function ho(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=mo(e))&&(r&&(r+=` `),r+=t);return r}var go=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,_o=ho,vo=(e,t)=>n=>{if(t?.variants==null)return _o(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=go(t)||go(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return _o(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},yo=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},bo=(e,t)=>({classGroupId:e,validator:t}),xo=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),So=`-`,Co=[],wo=`arbitrary..`,To=e=>{let t=Oo(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Do(e);let n=e.split(So);return Eo(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?yo(i,t):t:i||Co}return n[e]||Co}}},Eo=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Eo(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(So):e.slice(t).join(So),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Do=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?wo+r:void 0})(),Oo=e=>{let{theme:t,classGroups:n}=e;return ko(n,t)},ko=(e,t)=>{let n=xo();for(let r in e){let i=e[r];Ao(i,n,r,t)}return n},Ao=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];jo(i,t,n,r)}},jo=(e,t,n,r)=>{if(typeof e==`string`){Mo(e,t,n);return}if(typeof e==`function`){No(e,t,n,r);return}Po(e,t,n,r)},Mo=(e,t,n)=>{let r=e===``?t:Fo(t,e);r.classGroupId=n},No=(e,t,n,r)=>{if(Io(e)){Ao(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(bo(n,e))},Po=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Ao(o,Fo(t,a),n,r)}},Fo=(e,t)=>{let n=e,r=t.split(So),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=xo(),n.nextPart.set(t,i)),n=i}return n},Io=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Lo=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Ro=`!`,zo=`:`,Bo=[],Vo=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ho=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===zo){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Ro)?(c=s.slice(0,-1),l=!0):s.startsWith(Ro)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Vo(t,l,c,u)};if(t){let e=t+zo,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Vo(Bo,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Uo=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Wo=e=>({cache:Lo(e.cacheSize),parseClassName:Ho(e),sortModifiers:Uo(e),postfixLookupClassGroupIds:Go(e),...To(e)}),Go=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Ko=/\s+/,qo=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Ko),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Ro:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Jo=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Yo(n))&&(i&&(i+=` `),i+=r);return i},Yo=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Yo(e[r]))&&(n&&(n+=` `),n+=t);return n},Xo=(e,...t)=>{let n,r,i,a,o=o=>(n=Wo(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=qo(e,n);return i(e,a),a};return a=o,(...e)=>a(Jo(...e))},Zo=[],Qo=e=>{let t=t=>t[e]||Zo;return t.isThemeGetter=!0,t},$o=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,es=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ts=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ns=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rs=/\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$/,is=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,as=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,os=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ss=e=>ts.test(e),U=e=>!!e&&!Number.isNaN(Number(e)),cs=e=>!!e&&Number.isInteger(Number(e)),ls=e=>e.endsWith(`%`)&&U(e.slice(0,-1)),us=e=>ns.test(e),ds=()=>!0,fs=e=>rs.test(e)&&!is.test(e),ps=()=>!1,ms=e=>as.test(e),hs=e=>os.test(e),gs=e=>!W(e)&&!G(e),_s=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),vs=e=>Ns(e,Ls,ps),W=e=>$o.test(e),ys=e=>Ns(e,Rs,fs),bs=e=>Ns(e,zs,U),xs=e=>Ns(e,Vs,ds),Ss=e=>Ns(e,Bs,ps),Cs=e=>Ns(e,Fs,ps),ws=e=>Ns(e,Is,hs),Ts=e=>Ns(e,Hs,ms),G=e=>es.test(e),Es=e=>Ps(e,Rs),Ds=e=>Ps(e,Bs),Os=e=>Ps(e,Fs),ks=e=>Ps(e,Ls),As=e=>Ps(e,Is),js=e=>Ps(e,Hs,!0),Ms=e=>Ps(e,Vs,!0),Ns=(e,t,n)=>{let r=$o.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ps=(e,t,n=!1)=>{let r=es.exec(e);return r?r[1]?t(r[1]):n:!1},Fs=e=>e===`position`||e===`percentage`,Is=e=>e===`image`||e===`url`,Ls=e=>e===`length`||e===`size`||e===`bg-size`,Rs=e=>e===`length`,zs=e=>e===`number`,Bs=e=>e===`family-name`,Vs=e=>e===`number`||e===`weight`,Hs=e=>e===`shadow`,Us=Xo(()=>{let e=Qo(`color`),t=Qo(`font`),n=Qo(`text`),r=Qo(`font-weight`),i=Qo(`tracking`),a=Qo(`leading`),o=Qo(`breakpoint`),s=Qo(`container`),c=Qo(`spacing`),l=Qo(`radius`),u=Qo(`shadow`),d=Qo(`inset-shadow`),f=Qo(`text-shadow`),p=Qo(`drop-shadow`),m=Qo(`blur`),h=Qo(`perspective`),g=Qo(`aspect`),_=Qo(`ease`),v=Qo(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),G,W],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[G,W,c],T=()=>[ss,`full`,`auto`,...w()],E=()=>[cs,`none`,`subgrid`,G,W],D=()=>[`auto`,{span:[`full`,cs,G,W]},cs,G,W],O=()=>[cs,`auto`,G,W],k=()=>[`auto`,`min`,`max`,`fr`,G,W],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ss,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[ss,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[ss,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,G,W],ee=()=>[...b(),Os,Cs,{position:[G,W]}],te=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ne=()=>[`auto`,`cover`,`contain`,ks,vs,{size:[G,W]}],re=()=>[ls,Es,ys],L=()=>[``,`none`,`full`,l,G,W],ie=()=>[``,U,Es,ys],ae=()=>[`solid`,`dashed`,`dotted`,`double`],R=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],z=()=>[U,ls,Os,Cs],oe=()=>[``,`none`,m,G,W],se=()=>[`none`,U,G,W],ce=()=>[`none`,U,G,W],le=()=>[U,G,W],ue=()=>[ss,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[us],breakpoint:[us],color:[ds],container:[us],"drop-shadow":[us],ease:[`in`,`out`,`in-out`],font:[gs],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[us],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[us],shadow:[us],spacing:[`px`,U],text:[us],"text-shadow":[us],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ss,W,G,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,G,W]}],"container-named":[_s],columns:[{columns:[U,W,G,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[cs,`auto`,G,W]}],basis:[{basis:[ss,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[U,ss,`auto`,`initial`,`none`,W]}],grow:[{grow:[``,U,G,W]}],shrink:[{shrink:[``,U,G,W]}],order:[{order:[cs,`first`,`last`,`none`,G,W]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Es,ys]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ms,xs]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ls,W]}],"font-family":[{font:[Ds,Ss,t]}],"font-features":[{"font-features":[W]}],"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:[i,G,W]}],"line-clamp":[{"line-clamp":[U,`none`,G,bs]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,G,W]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,G,W]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ae(),`wavy`]}],"text-decoration-thickness":[{decoration:[U,`from-font`,`auto`,G,ys]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[U,`auto`,G,W]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[cs,G,W]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,G,W]}],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`,G,W]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},cs,G,W],radial:[``,G,W],conic:[cs,G,W]},As,ws]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ae(),`hidden`,`none`]}],"divide-style":[{divide:[...ae(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...ae(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[U,G,W]}],"outline-w":[{outline:[``,U,Es,ys]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,js,Ts]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,js,Ts]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:ie()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[U,ys]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,js,Ts]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[U,G,W]}],"mix-blend":[{"mix-blend":[...R(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":R()}],"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":[U]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[G,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"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":b()}],"mask-image-conic-pos":[{"mask-conic":[U]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,G,W]}],filter:[{filter:[``,`none`,G,W]}],blur:[{blur:oe()}],brightness:[{brightness:[U,G,W]}],contrast:[{contrast:[U,G,W]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,js,Ts]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,U,G,W]}],"hue-rotate":[{"hue-rotate":[U,G,W]}],invert:[{invert:[``,U,G,W]}],saturate:[{saturate:[U,G,W]}],sepia:[{sepia:[``,U,G,W]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,G,W]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[U,G,W]}],"backdrop-contrast":[{"backdrop-contrast":[U,G,W]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,U,G,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[U,G,W]}],"backdrop-invert":[{"backdrop-invert":[``,U,G,W]}],"backdrop-opacity":[{"backdrop-opacity":[U,G,W]}],"backdrop-saturate":[{"backdrop-saturate":[U,G,W]}],"backdrop-sepia":[{"backdrop-sepia":[``,U,G,W]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,G,W]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[U,`initial`,G,W]}],ease:[{ease:[`linear`,`initial`,_,G,W]}],delay:[{delay:[U,G,W]}],animate:[{animate:[`none`,v,G,W]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,G,W]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":[`scale-3d`],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[G,W,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":[`translate-none`],zoom:[{zoom:[cs,G,W]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"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`,G,W]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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`,G,W]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[U,Es,ys,bs]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`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`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`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-bs`,`border-w-be`,`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-bs`,`border-color-be`,`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-mbs`,`scroll-mbe`,`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-pbs`,`scroll-pbe`,`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`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}}),Ws=je.make(`searchatlasGateway`);function Gs(e){return e.replace(/^Atlas (Fusion|Max)\b/iu,`Borg $1`)}var Ks=`borg-fusion`,qs=`atlas-fusion`,Js=/(^|\/)atlas-fusion(?:-borg-fusion)?(?=$|[-#])/u;function Ys(e){return e.replace(Js,`$1${Ks}`)}function Xs(e){return{optionDescriptors:e.optionDescriptors.map($s)}}function Zs(e,t){return e?.find(e=>e.id===t)?.value}function Qs(e,t){let n=fc(t);return n?e.options.length===0?n:e.promptInjectedValues?.includes(n)&&e.options.some(e=>e.id===n)?e.options.find(e=>e.isDefault)?.id:e.options.some(e=>e.id===n)?n:e.currentValue??e.options.find(e=>e.isDefault)?.id:e.currentValue??e.options.find(e=>e.isDefault)?.id}function $s(e){return e.type===`select`?{...e,options:[...e.options],...e.promptInjectedValues?{promptInjectedValues:[...e.promptInjectedValues]}:{}}:{...e}}function ec(e){return{...e}}function tc(e,t){if(e.type===`boolean`)return typeof t==`boolean`?{...e,currentValue:t}:e;let n=typeof t==`string`?Qs(e,t):Qs(e,e.currentValue);if(!n){let{currentValue:t,...n}=e;return n}return{...e,currentValue:n}}function nc(e){let{caps:t,selections:n}=e;return(t.optionDescriptors??[]).map($s).map(e=>tc(e,Zs(n,e.id)??e.currentValue))}function rc(e){if(e)return e.type===`boolean`||e.currentValue?e.currentValue:e.options.find(e=>e.isDefault)?.id}function ic(e){if(!e)return;if(e.type===`boolean`)return typeof e.currentValue==`boolean`?e.currentValue?`On`:`Off`:void 0;let t=rc(e);if(typeof t==`string`)return e.options.find(e=>e.id===t)?.label}function ac(e){if(!e||e.length===0)return;let t=[];for(let n of e){let e=rc(n);(typeof e==`string`||typeof e==`boolean`)&&t.push({id:n.id,value:e})}return t.length>0?t:void 0}function oc(e){return typeof e==`string`&&/\bultrathink\b/i.test(e)}function sc(e,t=Ws){let n=cc(e);if(!n)return null;let r=Tt[t]??{},i=Object.prototype.hasOwnProperty.call(r,n)?r[n]:void 0,a=typeof i==`string`?i:n;return t===Ws?Ys(a):a}function cc(e){return typeof e==`string`&&e.trim()||null}function lc(e,t,n=[]){let r=t.filter(e=>!e.isLegacy&&!e.isUnavailable),i=n.find(e=>r.some(t=>t.slug===e));if(i)return i;if(e===`searchatlasGateway`){let e=r.find(e=>e.slug===`auto`&&e.isDefault);if(e)return e.slug;let t=[Xe,`searchatlas-gateway/${qs}#medium`,`searchatlas-gateway/${Ks}`,`searchatlas-gateway/${qs}`].find(e=>r.some(t=>t.slug===e));if(t)return t}let a=r.filter(e=>!e.searchOnly);return a.find(e=>e.isDefault)?.slug??a.find(e=>!e.isCustom)?.slug??a[0]?.slug}function uc(e,t){let n;for(let r of e)t&&(r.environmentId!==t.environmentId||r.projectId!==t.projectId)||(!n||r.updatedAt>n.updatedAt)&&(n=r);return n?.modelSelection??null}function dc(e,t,n){if(typeof t!=`string`)return null;let r=t.trim();if(!r)return null;let i=n.find(e=>e.slug===r);if(i)return i.slug;let a=n.find(e=>e.name.toLowerCase()===r.toLowerCase());if(a)return a.slug;let o=n.find(e=>e.aliases?.some(e=>e.toLowerCase()===r.toLowerCase()));if(o)return o.slug;let s=sc(r,e);if(!s)return null;let c=n.find(e=>e.slug===s);return c?c.slug:null}function fc(e){return typeof e==`string`&&e.trim()||null}function pc(e){return e.map(ec)}function mc(e,t,n){let r=n?pc(n):[],i={instanceId:e,model:t};return r.length>0?{...i,options:r}:i}function hc(e,t){let n=fc(t);if(!n)return null;let r=nc({caps:e});for(let e of r)if(e.type===`select`&&e.promptInjectedValues?.includes(n))return n;return null}function gc(e,t){let n=e.trim();return!n||t!==`ultrathink`||/^\/[^\s/]+(?:\s|$)/u.test(n)||n.startsWith(`Ultrathink:`)?n:`Ultrathink:\n${n}`}var _c=Xs({optionDescriptors:[]}),vc=je.make(`searchatlasGateway`);function yc(e){return e.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase())}function bc(e,t){return xc(e,t)?.models??[]}function xc(e,t){let n=d(t);return e.find(e=>e.instanceId===n)}function Sc(e,t){let n=e.find(e=>e.instanceId===t);return n?.enabled?n.driver:e.find(e=>e.enabled)?.driver??vc}function Cc(e,t,n){let r=dc(n,t,e);return e.find(e=>e.slug===r)?.capabilities??_c}function wc(e,t){return lc(t,bc(e,t))??rt[t]??`searchatlas-gateway/borg-fusion#medium`}function Tc(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Ec=Tc(`https://base-ui.com/production-error`,`Base UI`),Dc=V.createContext(void 0);function Oc(e){let t=V.useContext(Dc);if(t===void 0&&!e)throw Error(Ec(33));return t}var kc=V.createContext(void 0);function Ac(e){let t=V.useContext(kc);if(t===void 0&&!e)throw Error(Ec(36));return t}var jc={};function Mc(e,t){let n=V.useRef(jc);return n.current===jc&&(n.current=e(t)),n}function Nc(e,t,n,r){let i=Mc(Fc).current;return Ic(i,e,t,n,r)&&Rc(i,[e,t,n,r]),i.callback}function Pc(e){let t=Mc(Fc).current;return Lc(t,e)&&Rc(t,e),t.callback}function Fc(){return{callback:null,cleanup:null,refs:[]}}function Ic(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Lc(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Rc(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var zc=19;function Bc(e){return zc>=e}function Vc(e){if(!V.isValidElement(e))return null;let t=e,n=t.props;return(Bc(19)?n?.ref:t.ref)??null}function Hc(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Uc(){}var Wc=Object.freeze([]),Gc=Object.freeze({});function Kc(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function qc(e,t){return typeof e==`function`?e(t):e}function Jc(e,t){return typeof e==`function`?e(t):e}var Yc={};function Xc(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Qc(t);let a=Qc(e);return t&&(a=$c(a,t)),n&&(a=$c(a,n)),r&&(a=$c(a,r)),i&&(a=$c(a,i)),a}function Zc(e){if(e.length===0)return Yc;if(e.length===1)return Qc(e[0]);let t=Qc(e[0]);for(let n=1;n<e.length;n+=1)t=$c(t,e[n]);return t}function Qc(e){return rl(e)?{...il(e,Yc)}:el(e)}function $c(e,t){return rl(t)?il(t,e):tl(e,t)}function el(e){let t={...e};for(let e in t){let n=t[e];nl(e,n)&&(t[e]=ol(n))}return t}function tl(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Hc(e.style,r);break;case`className`:e[n]=cl(e.className,r);break;default:nl(n,r)?e[n]=al(e[n],r):e[n]=r}}return e}function nl(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function rl(e){return typeof e==`function`}function il(e,t){return rl(e)?e(t):e??Yc}function al(e,t){return t?e?(...n)=>{let r=n[0];if(ll(r)){let i=r;sl(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:ol(t):e}function ol(e){return e&&((...t)=>{let n=t[0];return ll(n)&&sl(n),e(...t)})}function sl(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function cl(e,t){return t?e?t+` `+e:t:e}function ll(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function ul(e,t,n={}){let r=t.render,i=dl(t,n);return n.enabled===!1?null:ml(e,r,i,n.state??Gc)}function dl(e,t={}){let{className:n,style:r,render:i}=e,{state:a=Gc,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?qc(n,a):void 0,d=l?Jc(r,a):void 0,f=l?Kc(a,c):Gc,p=l&&s?fl(s):void 0,m=l?Hc(f,p)??{}:Gc;return typeof document<`u`&&(l?Array.isArray(o)?m.ref=Pc([m.ref,Vc(i),...o]):m.ref=Nc(m.ref,Vc(i),o):Nc(null,null)),l?(u!==void 0&&(m.className=cl(m.className,u)),d!==void 0&&(m.style=Hc(m.style,d)),m):Gc}function fl(e){return Array.isArray(e)?Zc(e):Xc(void 0,e)}var pl=Symbol.for(`react.lazy`);function ml(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Xc(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===pl&&(i=V.Children.toArray(t)[0]),V.cloneElement(i,e)}if(e&&typeof e==`string`)return hl(e,n);throw Error(Ec(8))}function hl(e,t){return e===`button`?(0,V.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,V.createElement)(`img`,{alt:``,...t,key:t.key}):V.createElement(e,t)}var gl=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),_l={[gl.startingStyle]:``},vl={[gl.endingStyle]:``},yl={transitionStatus(e){return e===`starting`?_l:e===`ending`?vl:null}},bl=kr(),xl=jr(),Sl=e(Nr()),Cl=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=gl.startingStyle]=`startingStyle`,e[e.endingStyle=gl.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),wl=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),Tl={[wl.popupOpen]:``},El={[wl.popupOpen]:``,[wl.pressed]:``},Dl={[Cl.open]:``},Ol={[Cl.closed]:``},kl={[Cl.anchorHidden]:``},Al={open(e){return e?Tl:null}},jl={open(e){return e?El:null}},Ml={open(e){return e?Dl:Ol},anchorHidden(e){return e?kl:null}},Nl=V.createContext(void 0);function Pl(e=!0){let t=V.useContext(Nl);if(t===void 0&&!e)throw Error(Ec(25));return t}var Fl=`none`,Il=`trigger-press`,Ll=`trigger-hover`,Rl=`trigger-focus`,zl=`outside-press`,Bl=`item-press`,Vl=`close-press`,Hl=`clear-press`,Ul=`increment-press`,Wl=`decrement-press`,Gl=`input-change`,Kl=`input-clear`,ql=`input-blur`,Jl=`input-paste`,Yl=`input-press`,Xl=`focus-out`,Zl=`escape-key`,Ql=`list-navigation`,$l=`keyboard`,eu=`pointer`,tu=`cancel-open`,nu=`sibling-open`,ru=`disabled`,iu=`missing`,au=`initial`,ou=`imperative-action`,su=`window-resize`;function cu({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=V.useRef(e!==void 0),[a,o]=V.useState(t);return[i?e:a,V.useCallback(e=>{i||o(e)},[])]}var lu=V.createContext(void 0);function uu(){let e=V.useContext(lu);if(e===void 0)throw Error(Ec(30));return e}function du(){return typeof window<`u`}function fu(e){return hu(e)?(e.nodeName||``).toLowerCase():`#document`}function pu(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mu(e){return((hu(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function hu(e){return du()?e instanceof Node||e instanceof pu(e).Node:!1}function K(e){return du()?e instanceof Element||e instanceof pu(e).Element:!1}function gu(e){return du()?e instanceof HTMLElement||e instanceof pu(e).HTMLElement:!1}function _u(e){return!du()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof pu(e).ShadowRoot}function vu(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ku(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function yu(e){return/^(table|td|th)$/.test(fu(e))}function bu(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var xu=/transform|translate|scale|rotate|perspective|filter/,Su=/paint|layout|strict|content/,Cu=e=>!!e&&e!==`none`,wu;function Tu(e){let t=K(e)?ku(e):e;return Cu(t.transform)||Cu(t.translate)||Cu(t.scale)||Cu(t.rotate)||Cu(t.perspective)||!Du()&&(Cu(t.backdropFilter)||Cu(t.filter))||xu.test(t.willChange||``)||Su.test(t.contain||``)}function Eu(e){let t=ju(e);for(;gu(t)&&!Ou(t);){if(Tu(t))return t;if(bu(t))return null;t=ju(t)}return null}function Du(){return wu??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),wu}function Ou(e){return/^(html|body|#document)$/.test(fu(e))}function ku(e){return pu(e).getComputedStyle(e)}function Au(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ju(e){if(fu(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||_u(e)&&e.host||mu(e);return _u(t)?t.host:t}function Mu(e){let t=ju(e);return Ou(t)?e.ownerDocument?e.ownerDocument.body:e.body:gu(t)&&vu(t)?t:Mu(t)}function Nu(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Mu(e),i=r===e.ownerDocument?.body,a=pu(r);if(i){let e=Pu(a);return t.concat(a,a.visualViewport||[],vu(r)?r:[],e&&n?Nu(e):[])}else return t.concat(r,Nu(r,[],n))}function Pu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Fu={...V},Iu=Fu.useInsertionEffect,Lu=Iu&&Iu!==Fu.useLayoutEffect?Iu:e=>e();function q(e){let t=Mc(Ru).current;return t.next=e,Lu(t.effect),t.trampoline}function Ru(){let e={next:void 0,callback:zu,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function zu(){}var J=typeof document<`u`?V.useLayoutEffect:()=>{},Bu=V.createContext(void 0);function Vu(e=!1){let t=V.useContext(Bu);if(t===void 0&&!e)throw Error(Ec(16));return t}function Hu(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:V.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Uu(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=V.useRef(null),s=Vu(!0),c=a??s!==void 0,{props:l}=Hu({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=V.useCallback(()=>{let e=o.current;Wu(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return J(u,[u]),{getButtonProps:V.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Xc({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(sl(e),o?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,a=e.currentTarget,s=Wu(a),l=!i&&Gu(a),u=r&&(i?s:!l),d=e.key===`Enter`,f=e.key===` `,p=a.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&c&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),l||i&&s?(a.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!i&&(f||d)&&e.preventDefault(),!i&&d&&n?.(e))},onKeyUp(e){if(!t){if(sl(e),a?.(e),e.target===e.currentTarget&&i&&c&&Wu(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:q(e=>{o.current=e,u()})}}function Wu(e){return gu(e)&&e.tagName===`BUTTON`}function Gu(e){return!!(e?.tagName===`A`&&e?.href)}var Ku=typeof navigator<`u`,qu=rd(),Ju=ad(),Yu=id(),Xu=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),Zu=qu.platform===`MacIntel`&&qu.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(qu.platform),Qu=Ku&&/firefox/i.test(Yu),$u=Ku&&/apple/i.test(navigator.vendor);Ku&&/Edg/i.test(Yu);var ed=Ku&&/android/i.test(Ju)||/android/i.test(Yu),td=Ku&&Ju.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,nd=Yu.includes(`jsdom/`);function rd(){if(!Ku)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function id(){if(!Ku)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function ad(){if(!Ku)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}function od(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=Pl(!0),d=u!==void 0;return V.useMemo(()=>({id:r,role:`menuitem`,tabIndex:n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:Bl})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,d&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||d&&!td&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!d||e.button===2)&&(!c||c.type===`regular-item`)&&s.current.click()}}),[t,n,r,l,i,a,o,s,u,d,c])}var sd={type:`regular-item`};function cd(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=V.useRef(null),{getButtonProps:d,buttonRef:f}=Uu({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=od({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=V.useCallback(e=>Xc(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=Nc(u,f);return V.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var ld=V.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function ud(){return V.useContext(ld)}var dd=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function fd(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=ud(),f=V.useRef(-1),[p,m]=V.useState(a??(i===dd.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=V.useRef(null),g=V.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return J(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),J(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),V.useMemo(()=>({ref:g,index:p}),[p,g])}var pd=0;function md(e,t=`mui`){let[n,r]=V.useState(e),i=e||n;return V.useEffect(()=>{n??(pd+=1,r(`${t}-${pd}`))},[n,t]),i}var hd=Fu.useId;function gd(e,t){if(hd!==void 0){let n=hd();return e??(t?`${t}-${n}`:n)}return md(e,t)}function _d(e){return gd(e,`base-ui`)}var vd=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.highlighted=`data-highlighted`,e}({}),yd={checked(e){return e?{[vd.checked]:``}:{[vd.unchecked]:``}},...yl};function bd(e,t,n,r){let i=!1,a=!1,o=r??Gc;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function xd(e,t,n){let r=n??Gc;return{reason:e,event:t??new Event(`base-ui`),...r}}var Sd=V.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l,defaultChecked:u,onCheckedChange:d,style:f,...p}=e,m=fd({label:a}),h=Oc(!0),g=_d(i),{store:_}=Ac(),v=_.useState(`isActive`,m.index),y=_.useState(`itemProps`),[b,x]=cu({controlled:l,default:u??!1,name:`MenuCheckboxItem`,state:`checked`}),{getItemProps:S,itemRef:C}=cd({closeOnClick:c,disabled:s,highlighted:v,id:g,store:_,nativeButton:o,nodeId:h?.context.nodeId,itemMetadata:sd}),w=V.useMemo(()=>({disabled:s,highlighted:v,checked:b}),[s,v,b]);function T(e){let t=bd(Bl,e.nativeEvent,void 0,{preventUnmountOnClose(){}});d?.(!b,t),!t.isCanceled&&x(e=>!e)}let E=ul(`div`,e,{state:w,stateAttributesMapping:yd,props:[y,{role:`menuitemcheckbox`,"aria-checked":b,onClick:T},p,S],ref:[C,t,m.ref]});return(0,H.jsx)(lu.Provider,{value:w,children:E})}),Cd=[];function wd(e){V.useEffect(e,Cd)}var Td=null;globalThis.requestAnimationFrame;var Ed=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Dd=class e{static create(){return new e}static request(e){return Ed.request(e)}static cancel(e){return Ed.cancel(e)}currentId=Td;request(e){this.cancel(),this.currentId=Ed.request(()=>{this.currentId=Td,e()})}cancel=()=>{this.currentId!==Td&&(Ed.cancel(this.currentId),this.currentId=Td)};disposeEffect=()=>this.cancel};function Od(){let e=Mc(Dd.create).current;return wd(e.disposeEffect),e}function kd(e,t=!1,n=!1){let[r,i]=V.useState(e&&t?`idle`:void 0),[a,o]=V.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),J(()=>{if(!e&&a&&r!==`ending`&&n){let e=Dd.request(()=>{i(`ending`)});return()=>{Dd.cancel(e)}}},[e,a,r,n]),J(()=>{if(!e||t)return;let n=Dd.request(()=>{i(void 0)});return()=>{Dd.cancel(n)}},[t,e]),J(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Dd.request(()=>{i(`idle`)});return()=>{Dd.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function Ad(e){return e==null?e:`current`in e?e.current:e}function jd(e,t=!1,n=!0){let r=Od();return q((i,a=null)=>{r.cancel();let o=Ad(e);if(o==null)return;let s=o,c=()=>{Sl.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()}).catch(()=>{if(n){a?.aborted||c();return}let e=s.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=gl.startingStyle;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function Md(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=q(i),o=jd(r,n,!1);V.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var Nd=V.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=uu(),c=V.useRef(null),{transitionStatus:l,setMounted:u}=kd(s.checked);return Md({open:s.checked,ref:c,onComplete(){s.checked||u(!1)}}),ul(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},ref:[t,c],stateAttributesMapping:yd,props:{"aria-hidden":!0,...o},enabled:a||s.checked})}),Pd=V.createContext(void 0);function Fd(){let e=V.useContext(Pd);if(e===void 0)throw Error(Ec(31));return e}var Id=V.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=V.useState(void 0),c=ul(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,H.jsx)(Pd.Provider,{value:s,children:c})}),Ld=V.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=_d(a),c=Fd();return J(()=>(c(s),()=>{c(void 0)}),[c,s]),ul(`div`,e,{ref:t,props:{id:s,role:`presentation`,...o}})}),Rd=V.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=fd({label:a}),f=Oc(!0),p=_d(i),{store:m}=Ac(),h=m.useState(`isActive`,d.index),g=m.useState(`itemProps`),{getItemProps:_,itemRef:v}=cd({closeOnClick:c,disabled:s,highlighted:h,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:sd});return ul(`div`,e,{state:{disabled:s,highlighted:h},props:[g,u,_],ref:[v,t,d.ref]})}),zd=0,Bd=class e{static create(){return new e}currentId=zd;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=zd,t()},e)}isStarted(){return this.currentId!==zd}clear=()=>{this.currentId!==zd&&(clearTimeout(this.currentId),this.currentId=zd)};disposeEffect=()=>this.clear};function Vd(){let e=Mc(Bd.create).current;return wd(e.disposeEffect),e}function Hd(e){e.preventDefault(),e.stopPropagation()}function Ud(e){return`nativeEvent`in e}function Wd(e){return e.pointerType===``&&e.isTrusted?!0:ed&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Gd(e){return nd?!1:!ed&&e.width===0&&e.height===0||ed&&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 Kd(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function qd(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Jd=`data-base-ui-focusable`,Yd=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Xd=`ArrowLeft`,Zd=`ArrowRight`,Qd=`ArrowUp`,$d=`ArrowDown`;function ef(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Y(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&_u(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function tf(e){return`composedPath`in e?e.composedPath()[0]:e.target}function nf(e,t){if(!K(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Y(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function rf(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function af(e){return e.matches(`html,body`)}function of(e){return gu(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function sf(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Yd}`)!=null}function cf(e){return e?e.getAttribute(`role`)===`combobox`&&of(e):!1}function lf(e){if(!e||nd)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function uf(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function df(e,t){return t!=null&&!Kd(t)?0:typeof e==`function`?e():e}function ff(e,t,n){let r=df(e,n);return typeof r==`number`?r:r?.[t]}function pf(e){return typeof e==`function`?e():e}function mf(e,t){return t||e===`click`||e===`mousedown`}function hf(e){return e?.includes(`mouse`)&&e!==`mousedown`}function X(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function gf(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function _f(e){let t=Mc(vf,e).current;return t.next=e,J(t.effect),t}function vf(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Z(e){return e?.ownerDocument||document}var yf={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},bf={...yf,position:`fixed`,top:0,left:0},xf={...yf,position:`absolute`},Sf=V.forwardRef(function(e,t){let[n,r]=V.useState();J(()=>{$u&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,H.jsx)(`span`,{...e,ref:t,style:bf,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})}),Cf=[`top`,`right`,`bottom`,`left`],wf=Math.min,Tf=Math.max,Ef=Math.round,Df=Math.floor,Of=e=>({x:e,y:e}),kf={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Af(e,t,n){return Tf(e,wf(t,n))}function jf(e,t){return typeof e==`function`?e(t):e}function Mf(e){return e.split(`-`)[0]}function Nf(e){return e.split(`-`)[1]}function Pf(e){return e===`x`?`y`:`x`}function Ff(e){return e===`y`?`height`:`width`}function If(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Lf(e){return Pf(If(e))}function Rf(e,t,n){n===void 0&&(n=!1);let r=Nf(e),i=Lf(e),a=Ff(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=qf(o)),[o,qf(o)]}function zf(e){let t=qf(e);return[Bf(e),t,Bf(t)]}function Bf(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Vf=[`left`,`right`],Hf=[`right`,`left`],Uf=[`top`,`bottom`],Wf=[`bottom`,`top`];function Gf(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Hf:Vf:t?Vf:Hf;case`left`:case`right`:return t?Uf:Wf;default:return[]}}function Kf(e,t,n,r){let i=Nf(e),a=Gf(Mf(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Bf)))),a}function qf(e){let t=Mf(e);return kf[t]+e.slice(t.length)}function Jf(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yf(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Jf(e)}function Xf(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Zf(e,t,n){return Math.floor(e/t)!==n}function Qf(e,t){return t<0||t>=e.length}function $f(e,t){return tp(e.current,{disabledIndices:t})}function ep(e,t){return tp(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function tp(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&op(e,a,r));return a}function np(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!op(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Df(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!op(e,r,s))return r}};d&&Hd(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=tp(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=tp(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}Qf(e,f)&&(f=u)}if(n===`both`){let n=Df(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&Hd(t),u%o===o-1?r&&(f=tp(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=tp(e,{startingIndex:u,disabledIndices:s}),r&&Zf(f,o,n)&&(f=tp(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Zf(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&Hd(t),u%o===0?r&&(f=tp(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=tp(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Zf(f,o,n)&&(f=tp(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Zf(f,o,n)&&(f=u));let c=Df(l/o)===n;Qf(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:tp(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function rp(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function ip(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function ap(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function op(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?cp(r)?!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!0:!1}function sp(e){return e.visibility===`hidden`||e.visibility===`collapse`}function cp(e,t=e?ku(e):null){return!e||!e.isConnected||!t||sp(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var lp=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function up(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return _u(n)?n.host:null}function dp(e){for(let t of Array.from(e.children))if(fu(t)===`summary`)return t;return null}function fp(e,t){let n=dp(t);return!!n&&(e===n||Y(n,e))}function pp(e){let t=e?fu(e):``;return e!=null&&e.matches(lp)&&(t!==`summary`||e.parentElement!=null&&fu(e.parentElement)===`details`&&dp(e.parentElement)===e)&&(t!==`details`||dp(e)==null)&&(t!==`input`||e.type!==`hidden`)}function mp(e){if(!pp(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=up(t)){let n=t!==e,r=fu(t)===`slot`;if(t.hasAttribute(`inert`)||n&&fu(t)===`details`&&!t.open&&!fp(e,t)||t.hasAttribute(`hidden`)||!r&&!hp(t,n))return!1}return!0}function hp(e,t){let n=ku(e);return t?n.display!==`none`:cp(e,n)}function gp(e){let t=e.tabIndex;if(t<0){let t=fu(e);if(t===`details`||t===`audio`||t===`video`||gu(e)&&e.isContentEditable)return 0}return t}function _p(e){if(fu(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function vp(e,t){let n=_p(e);if(!n)return!0;let r=t.find(e=>{let t=_p(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=_p(e);return t?.name===n.name&&t.form===n.form})===n}function yp(e){if(gu(e)&&fu(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return gu(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function bp(e,t){yp(e).forEach(e=>{pp(e)&&t.push(e),bp(e,t)})}function xp(e,t,n){yp(e).forEach(e=>{gu(e)&&e.matches(t)&&n.push(e),xp(e,t,n)})}function Sp(e){return mp(e)&&gp(e)>=0}function Cp(e){let t=[];return bp(e,t),t.filter(mp)}function wp(e){let t=Cp(e);return t.filter(e=>gp(e)>=0&&vp(e,t))}function Tp(e,t){let n=wp(e),r=n.length;if(r===0)return;let i=ef(Z(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ep(e){return Tp(Z(e).body,1)||e}function Dp(e){return Tp(Z(e).body,-1)||e}function Op(e,t){if(!e)return null;let n=wp(Z(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function kp(e){return Op(e,1)}function Ap(e){return Op(e,-1)}function jp(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Y(n,r)}function Mp(e){wp(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Np(e){let t=[];xp(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Pp(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Pp(e,t.id,n)])}function Fp(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Ip(e){return`data-base-ui-${e}`}var Lp=0;function Rp(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Lp);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),Uc;let o=requestAnimationFrame(a);return Lp=o,()=>{Lp===o&&(cancelAnimationFrame(o),Lp=0)}}var zp={inert:new WeakMap,"aria-hidden":new WeakMap},Bp=`data-base-ui-inert`,Vp={inert:new WeakSet,"aria-hidden":new WeakSet},Hp=new WeakMap,Up=0;function Wp(e){return Vp[e]}function Gp(e){return e?_u(e)?e.host:Gp(e.parentNode):null}var Kp=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Gp(t);return e.contains(n)?n:null}).filter(e=>e!=null),qp=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Jp=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{fu(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Yp(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=Kp(t,e),u=i?Kp(t,a):[],d=new Set(u),f=i?Jp(t,qp(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=zp[o],n=Wp(o);c=n,s=e;let r=Kp(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);Jp(t,qp(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(Hp.get(e)||0)+1;Hp.set(e,t),m.push(e),t===1&&e.setAttribute(Bp,``)}),Up+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(Hp.get(e)||0)-1;Hp.set(e,t),t||e.removeAttribute(Bp)}),--Up,Up||(zp.inert=new WeakMap,zp[`aria-hidden`]=new WeakMap,Vp.inert=new WeakSet,Vp[`aria-hidden`]=new WeakSet,Hp=new WeakMap)}}function Xp(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=Z(e[0]).body;return Yp(e,o,n,r,{mark:i,markerIgnoreElements:a})}var Zp={style:{transition:`none`}},Qp=`data-base-ui-click-trigger`,$p=`data-base-ui-swipe-ignore`,em=`data-swipe-ignore`,tm=`[${$p}]`,nm=`[${em}]`,rm={fallbackAxisSide:`none`},im={fallbackAxisSide:`end`},am={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},om=V.createContext(null),sm=()=>V.useContext(om),cm=Ip(`portal`);function lm(e={}){let{ref:t,container:n,componentProps:r=Gc,elementProps:i}=e,a=gd(),o=sm()?.portalNode,[s,c]=V.useState(null),[l,u]=V.useState(null),d=q(e=>{e!==null&&u(e)}),f=V.useRef(null);J(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}if(a==null)return;let e=(n&&(hu(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o,a]);let p=ul(`div`,r,{ref:[t,d],props:[{id:a,[cm]:``},i]});return{portalNode:l,portalSubtree:s&&p?Sl.createPortal(p,s):null}}var um=V.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,renderGuards:s,...c}=e,{portalNode:l,portalSubtree:u}=lm({container:o,ref:t,componentProps:e,elementProps:c}),d=V.useRef(null),f=V.useRef(null),p=V.useRef(null),m=V.useRef(null),[h,g]=V.useState(null),_=V.useRef(!1),v=h?.modal,y=h?.open,b=typeof s==`boolean`?s:!!h&&!h.modal&&h.open&&!!l;V.useEffect(()=>{if(!l||v)return;function e(e){l&&e.relatedTarget&&jp(e)&&(e.type===`focusin`?_.current&&=(Np(l),!1):(Mp(l),_.current=!0))}return gf(X(l,`focusin`,e,!0),X(l,`focusout`,e,!0))},[l,v]),V.useEffect(()=>{!l||y!==!1||(Np(l),_.current=!1)},[y,l]);let x=V.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:g}),[l]);return(0,H.jsxs)(V.Fragment,{children:[u,(0,H.jsxs)(om.Provider,{value:x,children:[b&&l&&(0,H.jsx)(Sf,{"data-type":`outside`,ref:d,onFocus:e=>{jp(e,l)?p.current?.focus():Dp(h?h.domReference:null)?.focus()}}),b&&l&&(0,H.jsx)(`span`,{"aria-owns":l.id,style:am}),l&&Sl.createPortal(a,l),b&&l&&(0,H.jsx)(Sf,{"data-type":`outside`,ref:f,onFocus:e=>{jp(e,l)?m.current?.focus():(Ep(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,bd(`focus-out`,e.nativeEvent)))}})]})]})});function dm(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var fm=class{nodesRef={current:[]};events=dm();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},pm=V.createContext(null),mm=V.createContext(null),hm=()=>V.useContext(pm)?.id||null,gm=e=>{let t=V.useContext(mm);return e??t};function _m(e){let t=gd(),n=gm(e),r=hm();return J(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function vm(e){let{children:t,id:n}=e,r=hm();return(0,H.jsx)(pm.Provider,{value:V.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function ym(e){let{children:t,externalTree:n}=e,r=Mc(()=>n??new fm).current;return(0,H.jsx)(mm.Provider,{value:r,children:t})}function bm(e,t){let n=pu(tf(e));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`):``}var xm=20,Sm=[];function Cm(){Sm=Sm.filter(e=>e.deref()?.isConnected)}function wm(e){Cm(),e&&fu(e)!==`body`&&(Sm.push(new WeakRef(e)),Sm.length>xm&&(Sm=Sm.slice(-20)))}function Tm(){return Cm(),Sm[Sm.length-1]?.deref()}function Em(e){return e?Sp(e)?e:wp(e)[0]||e:null}function Dm(e,t){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=Cp(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Sp(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);t.current.includes(`floating`)||n.length===0?r!==`0`&&e.setAttribute(`tabindex`,`0`):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Om(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=q(()=>b.current.floatingContext?.nodeId),S=i===!1,C=cf(_)&&S,w=V.useRef([`content`]),T=_f(i),E=_f(a),D=_f(l),O=gm(p),k=sm(),A=V.useRef(!1),j=V.useRef(!1),M=V.useRef(!1),N=V.useRef(null),P=V.useRef(``),F=V.useRef(``),I=V.useRef(null),ee=V.useRef(null),te=Nc(I,f,k?.beforeInsideRef),ne=Nc(ee,k?.afterInsideRef),re=Vd(),L=Vd(),ie=Od(),ae=k!=null,R=uf(v),z=q((e=R)=>e?wp(e):[]),oe=q(()=>m?.().filter(e=>e!=null)??[]);V.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&Y(R,ef(Z(R)))&&z().length===0&&!C&&Hd(e)}return X(Z(R),`keydown`,e)},[r,R,s,C,z]),V.useEffect(()=>{if(r||!g)return;let e=Z(R);function t(){M.current=!1}function n(e){let t=tf(e),n=oe(),r=Y(v,t)||Y(_,t)||Y(k?.portalNode,t)||n.some(e=>e===t||Y(e,t));M.current=!r,F.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0)}function i(){F.current=`keyboard`}return gf(X(e,`pointerdown`,n,!0),X(e,`pointerup`,t,!0),X(e,`pointercancel`,t,!0),X(e,`keydown`,i,!0))},[r,v,_,R,g,k,oe]),V.useEffect(()=>{if(r||!c)return;let e=Z(R);function t(){j.current=!0,L.start(0,()=>{j.current=!1})}function n(e){let t=tf(e);Sp(t)&&(N.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=tf(t);queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=oe(),f=n?.hasAttribute(Ip(`focus-guard`))&&[I.current,ee.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,Ad(d),Ad(u)].includes(n),p=!(Y(_,n)||Y(v,n)||Y(n,v)||Y(k?.portalNode,n)||l.some(e=>e===n||Y(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>Y(e,n))||f||O&&(Pp(O.nodesRef.current,a).find(e=>Y(e.context?.elements.floating,n)||Y(e.context?.elements.domReference,n))||Fp(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,uf(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&R&&Dm(R,w),o&&r!==_&&!cp(i)&&ef(e)===e.body){if(gu(R)&&(R.focus(),o===`popup`)){ie.request(()=>{R.focus()});return}let e=z(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||R;gu(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!j.current&&(C||n!==Tm())&&(A.current=!0,h.setOpen(!1,bd(Xl,t)))})}function a(){M.current||(b.current.insideReactTree=!0,re.start(0,()=>{b.current.insideReactTree=!1}))}let l=gu(_)?_:null;if(!(!v&&!l))return gf(l&&X(l,`focusout`,i),l&&X(l,`pointerdown`,t),v&&X(v,`focusin`,n),v&&X(v,`focusout`,i),v&&k&&X(v,`focusout`,a,!0))},[r,_,v,R,s,O,k,h,c,o,z,C,x,w,b,re,L,ie,u,d,oe]),V.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${Ip(`portal`)}]`)||[]),t=(O?Fp(O.nodesRef.current,x()):[]).find(e=>cf(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Xp([v,...e,I.current,ee.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...oe(),t,Ad(d),Ad(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=Xp([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,k,C,O,x,u,d,oe]),J(()=>{if(!g||r||!gu(R))return;let e=Z(R),t=ef(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Y(R,t))return;let i=null,a=()=>(i??=z(R),i[0]||R),o;o=r===!0||r===null?a():Ad(r),o||=a();let s=Y(R,ef(e));Rp(o,{preventScroll:o===R,shouldFocus(){if(s)return!0;let t=ef(e);return!(t!==o&&Y(R,t))}})})},[r,g,R,z,T,D]),J(()=>{if(r||!R)return;let e=Z(R);wm(ef(e));function t(e){if(e.open||(P.current=bm(e.nativeEvent,F.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`)if(e.nested)A.current=!1;else if(Wd(e.nativeEvent)||Gd(e.nativeEvent))A.current=!1;else{let e=!1;Z(R).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}y.on(`openchange`,t);function n(){let e=E.current,t=typeof e==`function`?e(P.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`)return _?.isConnected?_:Tm()||null;let n=_?.isConnected?_:Tm();return Ad(t)||n||null}return()=>{y.off(`openchange`,t);let r=ef(e),i=oe(),a=Y(v,r)||i.some(e=>e===r||Y(e,r))||O&&Pp(O.nodesRef.current,x(),!1).some(e=>Y(e.context?.elements.floating,r)),o=E.current,s=n();queueMicrotask(()=>{let t=Em(s),n=typeof o!=`boolean`;o&&!A.current&&gu(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),A.current=!1})}},[r,v,R,E,y,O,_,x,oe]),J(()=>{if(!Xu||g||!v)return;let e=ef(Z(v));!gu(e)||!of(e)||Y(v,e)&&e.blur()},[g,v]),J(()=>{if(!(r||!k))return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{k.setFocusManagerState(null)}},[r,k,s,g,h,c,_]),J(()=>{if(!(r||!R))return Dm(R,w),()=>{queueMicrotask(Cm)}},[r,R,w]);let se=!r&&(s?!C:!0)&&(ae||s);return(0,H.jsxs)(V.Fragment,{children:[se&&(0,H.jsx)(Sf,{"data-type":`inside`,ref:te,onFocus:e=>{if(s){let e=z();Rp(e[e.length-1])}else k?.portalNode&&(A.current=!1,jp(e,k.portalNode)?Ep(_)?.focus():Ad(d??k.beforeOutsideRef)?.focus())}}),n,se&&(0,H.jsx)(Sf,{"data-type":`inside`,ref:ne,onFocus:e=>{s?Rp(z()[0]):k?.portalNode&&(c&&(A.current=!0),jp(e,k.portalNode)?Dp(_)?.focus():Ad(u??k.afterOutsideRef)?.focus())}})]})}function km(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Il}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=V.useRef(void 0),f=Od(),p=Vd(),m=V.useMemo(()=>{function e(e,t,n,r){let i=bd(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||Kd(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=tf(o);if(of(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}Kd(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return V.useMemo(()=>n?{reference:m}:Gc,[n,m])}var Am={intentional:`onClick`,sloppy:`onPointerDown`};function jm(){return!1}function Mm(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Nm(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=jm,referencePressEvent:s=`sloppy`,bubbles:c,externalTree:l}=t,u=`rootStore`in e?e.rootStore:e,d=u.useState(`open`),f=u.useState(`floatingElement`),{dataRef:p}=u.context,m=gm(l),h=q(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=q(()=>a),{escapeKey:y,outsidePress:b}=Mm(c),x=V.useRef(!1),S=V.useRef(!1),C=V.useRef(!1),w=V.useRef(!1),T=V.useRef(``),E=V.useRef(null),D=Vd(),O=Vd(),k=q(()=>{O.clear(),p.current.insideReactTree=!1}),A=q(e=>{let t=p.current.floatingContext?.nodeId;return(m?Pp(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),j=q(e=>rf(e,u.select(`floatingElement`))||rf(e,u.select(`domReferenceElement`))),M=q(e=>{o()&&u.setOpen(!1,bd(Il,e.nativeEvent))}),N=q(e=>{if(!d||!n||!r||e.key!==`Escape`||w.current||!y&&A(`__escapeKeyBubbles`))return;let t=bd(Zl,Ud(e)?e.nativeEvent:e);u.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),P=q(()=>{p.current.insideReactTree=!0,O.start(0,k)}),F=q(e=>{if(!d||!n||e.button!==0)return;let t=tf(e.nativeEvent);Y(u.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),I=q(e=>{!d||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});V.useEffect(()=>{if(!d||!n)return;p.current.__escapeKeyBubbles=y,p.current.__outsidePressBubbles=b;let e=new Bd,t=new Bd;function i(){e.clear(),w.current=!0}function a(){e.start(Du()?5:0,()=>{w.current=!1})}function o(){C.current=!0,t.start(0,()=>{C.current=!1})}function s(){x.current=!1,S.current=!1}function c(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function l(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=p.current.floatingContext?.nodeId,n=m&&Pp(m.nodesRef.current,t).some(t=>rf(e,t.context?.elements.floating));return j(e)||n}function O(e){if(l(e)){e.type!==`click`&&!j(e)&&(t.clear(),C.current=!1),k();return}if(p.current.insideReactTree){k();return}let n=tf(e),r=`[${Ip(`inert`)}]`,i=K(n)?n.getRootNode():null,a=Array.from((_u(i)?i:Z(u.select(`floatingElement`))).querySelectorAll(r)),o=u.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Y(e,n))))return;let s=K(n)?n:null;for(;s&&!Ou(s);){let e=ju(s);if(Ou(e)||!K(e))break;s=e}if(!(a.length&&K(n)&&!af(n)&&!Y(n,u.select(`floatingElement`))&&a.every(e=>!Y(s,e)))){if(gu(n)&&!(`touches`in e)){let t=Ou(n),r=ku(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!h(e)){if(c()===`intentional`&&C.current){t.clear(),C.current=!1;return}typeof g==`function`&&!g(e)||A(`__outsidePressBubbles`)||(u.setOpen(!1,bd(zl,e)),k())}}}function M(e){c()!==`sloppy`||e.pointerType===`touch`||!u.select(`open`)||!n||j(e)||O(e)}function P(e){if(c()!==`sloppy`||!u.select(`open`)||!n||j(e))return;let t=e.touches[0];t&&(E.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=tf(e);if(!n)return;let r=X(n,e.type,()=>{t(e),r()})}function I(e){T.current=`touch`,F(e,P)}function ee(e){D.clear(),e.type===`pointerdown`&&(T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?M(e):O(e)})}function te(e){if(!x.current)return;let n=S.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!h(e)){if(n){o();return}typeof g==`function`&&!g(e)||(t.clear(),C.current=!0,k())}}}function ne(e){if(c()!==`sloppy`||!E.current||j(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(O(e),D.clear(),E.current=null)}function re(e){F(e,ne)}function L(e){c()!==`sloppy`||!E.current||j(e)||(E.current.dismissOnTouchEnd&&O(e),D.clear(),E.current=null)}function ie(e){F(e,L)}let ae=Z(f),R=gf(r&&gf(X(ae,`keydown`,N),X(ae,`compositionstart`,i),X(ae,`compositionend`,a)),_&&gf(X(ae,`click`,ee,!0),X(ae,`pointerdown`,ee,!0),X(ae,`pointerup`,te,!0),X(ae,`pointercancel`,te,!0),X(ae,`mousedown`,ee,!0),X(ae,`mouseup`,te,!0),X(ae,`touchstart`,I,!0),X(ae,`touchmove`,re,!0),X(ae,`touchend`,ie,!0)));return()=>{R(),e.clear(),t.clear(),s(),C.current=!1}},[p,f,r,_,g,d,n,y,b,N,k,v,A,j,m,u,D]),V.useEffect(k,[g,k]);let ee=V.useMemo(()=>({onKeyDown:N,[Am[s]]:M,...s!==`intentional`&&{onClick:M}}),[N,M,s]),te=V.useMemo(()=>({onKeyDown:N,onPointerDown:I,onMouseDown:I,onClickCapture:P,onMouseDownCapture(e){P(),F(e)},onPointerDownCapture(e){P(),F(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[N,P,F,I]);return V.useMemo(()=>n?{reference:ee,floating:te,trigger:ee}:{},[n,ee,te])}function Pm(e,t,n){let{reference:r,floating:i}=e,a=If(t),o=Lf(t),s=Ff(o),c=Mf(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Nf(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Fm(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=jf(t,e),p=Yf(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Xf(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Xf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Im=50,Lm=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Fm},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Pm(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Im&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Pm(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Rm=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=jf(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Mf(r),_=If(o),v=Mf(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[qf(o)]:zf(o)),x=p!==`none`;!d&&x&&b.push(...Kf(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Rf(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==If(t))||T.every(e=>If(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=If(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function zm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bm(e){return Cf.some(t=>e[t]>=0)}var Vm=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=jf(e,t);switch(i){case`referenceHidden`:{let e=zm(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Bm(e)}}}case`escaped`:{let e=zm(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Bm(e)}}}default:return{}}}}},Hm=new Set([`left`,`top`]);async function Um(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Mf(n),s=Nf(n),c=If(n)===`y`,l=Hm.has(o)?-1:1,u=a&&c?-1:1,d=jf(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Wm=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Um(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Gm=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=jf(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=If(Mf(i)),p=Pf(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Af(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Af(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Km=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=jf(e,t),u={x:n,y:r},d=If(i),f=Pf(d),p=u[f],m=u[d],h=jf(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Hm.has(Mf(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},qm=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=jf(e,t),u=await o.detectOverflow(t,l),d=Mf(i),f=Nf(i),p=If(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=wf(h-u[g],v),x=wf(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Tf(u.left,0),t=Tf(u.right,0),n=Tf(u.top,0),r=Tf(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Tf(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Tf(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Jm(e){let t=ku(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=gu(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ef(n)!==a||Ef(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ym(e){return K(e)?e:e.contextElement}function Xm(e){let t=Ym(e);if(!gu(t))return Of(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Jm(t),o=(a?Ef(n.width):n.width)/r,s=(a?Ef(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Zm=Of(0);function Qm(e){let t=pu(e);return!Du()||!t.visualViewport?Zm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $m(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pu(e)?!1:t}function eh(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ym(e),o=Of(1);t&&(r?K(r)&&(o=Xm(r)):o=Xm(e));let s=$m(a,n,r)?Qm(a):Of(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=pu(a),t=r&&K(r)?pu(r):r,n=e,i=Pu(n);for(;i&&r&&t!==n;){let e=Xm(i),t=i.getBoundingClientRect(),r=ku(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=pu(i),i=Pu(n)}}return Xf({width:u,height:d,x:c,y:l})}function th(e,t){let n=Au(e).scrollLeft;return t?t.left+n:eh(mu(e)).left+n}function nh(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-th(e,n),y:n.top+t.scrollTop}}function rh(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=mu(r),s=t?bu(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Of(1),u=Of(0),d=gu(r);if((d||!d&&!a)&&((fu(r)!==`body`||vu(o))&&(c=Au(r)),d)){let e=eh(r);l=Xm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?nh(o,c):Of(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ih(e){return Array.from(e.getClientRects())}function ah(e){let t=mu(e),n=Au(e),r=e.ownerDocument.body,i=Tf(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Tf(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+th(e),s=-n.scrollTop;return ku(r).direction===`rtl`&&(o+=Tf(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var oh=25;function sh(e,t){let n=pu(e),r=mu(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Du();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=th(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=oh&&(a-=o)}else l<=oh&&(a+=l);return{width:a,height:o,x:s,y:c}}function ch(e,t){let n=eh(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=gu(e)?Xm(e):Of(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function lh(e,t,n){let r;if(t===`viewport`)r=sh(e,n);else if(t===`document`)r=ah(mu(e));else if(K(t))r=ch(t,n);else{let n=Qm(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Xf(r)}function uh(e,t){let n=ju(e);return n===t||!K(n)||Ou(n)?!1:ku(n).position===`fixed`||uh(n,t)}function dh(e,t){let n=t.get(e);if(n)return n;let r=Nu(e,[],!1).filter(e=>K(e)&&fu(e)!==`body`),i=null,a=ku(e).position===`fixed`,o=a?ju(e):e;for(;K(o)&&!Ou(o);){let t=ku(o),n=Tu(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||vu(o)&&!n&&uh(e,o))?r=r.filter(e=>e!==o):i=t,o=ju(o)}return t.set(e,r),r}function fh(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?bu(t)?[]:dh(t,this._c):[].concat(n),r],o=lh(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=lh(t,a[e],i);s=Tf(n.top,s),c=wf(n.right,c),l=wf(n.bottom,l),u=Tf(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ph(e){let{width:t,height:n}=Jm(e);return{width:t,height:n}}function mh(e,t,n){let r=gu(t),i=mu(t),a=n===`fixed`,o=eh(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Of(0);function l(){c.x=th(i)}if(r||!r&&!a)if((fu(t)!==`body`||vu(i))&&(s=Au(t)),r){let e=eh(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?nh(i,s):Of(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function hh(e){return ku(e).position===`static`}function gh(e,t){if(!gu(e)||ku(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return mu(e)===n&&(n=n.ownerDocument.body),n}function _h(e,t){let n=pu(e);if(bu(e))return n;if(!gu(e)){let t=ju(e);for(;t&&!Ou(t);){if(K(t)&&!hh(t))return t;t=ju(t)}return n}let r=gh(e,t);for(;r&&yu(r)&&hh(r);)r=gh(r,t);return r&&Ou(r)&&hh(r)&&!Tu(r)?n:r||Eu(e)||n}var vh=async function(e){let t=this.getOffsetParent||_h,n=this.getDimensions,r=await n(e.floating);return{reference:mh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yh(e){return ku(e).direction===`rtl`}var bh={convertOffsetParentRelativeRectToViewportRelativeRect:rh,getDocumentElement:mu,getClippingRect:fh,getOffsetParent:_h,getElementRects:vh,getClientRects:ih,getDimensions:ph,getScale:Xm,isElement:K,isRTL:yh};function xh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Sh(e,t){let n=null,r,i=mu(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Df(d),h=Df(i.clientWidth-(u+f)),g=Df(i.clientHeight-(d+p)),_=Df(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Tf(0,wf(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!xh(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ch(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ym(e),u=i||a?[...l?Nu(l):[],...t?Nu(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Sh(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?eh(e):null;c&&g();function g(){let t=eh(e);h&&!xh(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var wh=Wm,Th=Gm,Eh=Rm,Dh=qm,Oh=Vm,kh=Km,Ah=(e,t,n)=>{let r=new Map,i={platform:bh,...n},a={...i.platform,_c:r};return Lm(e,t,{...i,platform:a})},jh=typeof document<`u`?V.useLayoutEffect:function(){};function Mh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Mh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Mh(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Nh(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ph(e,t){let n=Nh(e);return Math.round(t*n)/n}function Fh(e){let t=V.useRef(e);return jh(()=>{t.current=e}),t}function Ih(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=V.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=V.useState(r);Mh(f,r)||p(r);let[m,h]=V.useState(null),[g,_]=V.useState(null),v=V.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=V.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=V.useRef(null),C=V.useRef(null),w=V.useRef(u),T=c!=null,E=Fh(c),D=Fh(i),O=Fh(l),k=V.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Ah(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Mh(w.current,t)&&(w.current=t,Sl.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);jh(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=V.useRef(!1);jh(()=>(A.current=!0,()=>{A.current=!1}),[]),jh(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=V.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=V.useMemo(()=>({reference:b,floating:x}),[b,x]),N=V.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Ph(M.floating,u.x),r=Ph(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Nh(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return V.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Lh=(e,t)=>{let n=wh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rh=(e,t)=>{let n=Th(e);return{name:n.name,fn:n.fn,options:[e,t]}},zh=(e,t)=>({fn:kh(e).fn,options:[e,t]}),Bh=(e,t)=>{let n=Eh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vh=(e,t)=>{let n=Dh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hh=(e,t)=>{let n=Oh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Q=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(Ec(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},Uh=[],Wh=void 0;function Gh(){return Wh}function Kh(e){Uh.push(e)}function qh(e){let t=(t,n)=>{let r=Mc(Yh).current,i;try{Wh=r;for(let e of Uh)e.before(r);i=e(t,n);for(let e of Uh)e.after(r);r.didInitialize=!0}finally{Wh=void 0}return i};return t.displayName=e.displayName||e.name,t}function Jh(e){return V.forwardRef(qh(e))}function Yh(){return{didInitialize:!1}}var Xh=Bc(19)?$h:eg;function Zh(e,t,n,r,i){return Xh(e,t,n,r,i)}function Qh(e,t,n,r,i){let a=V.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,bl.useSyncExternalStore)(e.subscribe,a,a)}Kh({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){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,bl.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function $h(e,t,n,r,i){let a=Gh();if(!a)return Qh(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function eg(e,t,n,r,i){return(0,xl.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var tg=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Zh(this,e,t,n,r)}},ng=class extends tg{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){V.useDebugValue(e);let n=this;J(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;J(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;J(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){V.useDebugValue(e);let n=this,r=t!==void 0;J(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return V.useDebugValue(e),Zh(this,this.selectors[e],t,n,r)}useContextCallback(e,t){V.useDebugValue(e);let n=q(t??Uc);this.context[e]=n}useStateSetter(e){let t=V.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},rg={open:Q(e=>e.open),transitionStatus:Q(e=>e.transitionStatus),domReferenceElement:Q(e=>e.domReferenceElement),referenceElement:Q(e=>e.positionReference??e.referenceElement),floatingElement:Q(e=>e.floatingElement),floatingId:Q(e=>e.floatingId)},ig=class extends ng{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:dm(),nested:n,triggerElements:i},rg),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&qd(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function ag(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=V.useRef(null);r===void 0&&f.current===null&&(f.current=new ig({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),J(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};K(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}var og={tabIndex:-1,[Jd]:``};function sg(e,t,n=!1){let r=gd(),i=hm()!=null,a=V.useRef(null);e===void 0&&a.current===null&&(a.current=t(r,i));let o=e??a.current;return ag({popupStore:o,treatPopupAsFloatingElement:n,floatingRootContext:o.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:o.setOpen}),{store:o,internalStore:a.current}}function cg(e,t){let n=V.useRef(null),r=V.useRef(null);return V.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function lg(e,t,n){let r=n?.id??null;(r||t)&&(e.activeTriggerId=r,e.activeTriggerElement=n??null)}function ug(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=cg(e,n),o=q(t=>{if(a(t),!t)return;let i=n.select(`open`),o=n.select(`activeTriggerId`);if(o===e){n.update({activeTriggerElement:t,...i?r:null});return}o==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return J(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function dg(e){let t=e.useState(`open`);J(()=>{if(!t){e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let n=e.context.triggerElements.size,r={};if(e.state.triggerCount!==n&&(r.triggerCount=n),!e.select(`activeTriggerId`)&&n===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;r.activeTriggerId=e,r.activeTriggerElement=n}}(r.triggerCount!==void 0||r.activeTriggerId!==void 0)&&e.update(r)},[t,e,e.useState(`triggerCount`)])}function fg(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=kd(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=q(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),s=t.useState(`preventUnmountingOnClose`);return Md({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}function pg(e,t){e.useSyncedValues(t),J(()=>()=>{e.update({activeTriggerProps:Gc,inactiveTriggerProps:Gc,popupProps:Gc})},[e])}function mg(e,t){J(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),J(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var hg=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function gg(){return new ig({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new hg,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function _g(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:gg(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Gc,inactiveTriggerProps:Gc,popupProps:Gc}}function vg(e,t,n=!1){return new ig({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var yg=Q(e=>e.triggerIdProp??e.activeTriggerId),bg=Q(e=>e.openProp??e.open),xg=Q(e=>(e.popupElement?.id??e.floatingId)||void 0);function Sg(e,t){return t!==void 0&&bg(e)&&yg(e)===t}function Cg(e,t){return Sg(e,t)?!0:t!==void 0&&bg(e)&&yg(e)==null&&e.triggerCount===1}var wg={open:bg,mounted:Q(e=>e.mounted),transitionStatus:Q(e=>e.transitionStatus),floatingRootContext:Q(e=>e.floatingRootContext),triggerCount:Q(e=>e.triggerCount),preventUnmountingOnClose:Q(e=>e.preventUnmountingOnClose),payload:Q(e=>e.payload),activeTriggerId:yg,activeTriggerElement:Q(e=>e.mounted?e.activeTriggerElement:null),popupId:xg,isTriggerActive:Q((e,t)=>t!==void 0&&yg(e)===t),isOpenedByTrigger:Q((e,t)=>Sg(e,t)),isMountedByTrigger:Q((e,t)=>t!==void 0&&yg(e)===t&&e.mounted),triggerProps:Q((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:Q((e,t)=>Cg(e,t)?xg(e):void 0),popupProps:Q(e=>e.popupProps),popupElement:Q(e=>e.popupElement),positionerElement:Q(e=>e.positionerElement)};function Tg(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=gd(),a=hm()!=null,o=Mc(()=>new ig({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new hg,floatingId:i,syncOnly:!1,nested:a})).current;return J(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=K(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function Eg(e={}){let{nodeId:t,externalTree:n}=e,r=Tg(e),i=e.rootContext||r,a=i.useState(`referenceElement`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.useState(`open`),l=i.useState(`floatingId`),[u,d]=V.useState(null),[f,p]=V.useState(void 0),[m,h]=V.useState(void 0),g=V.useRef(null),_=gm(n),v=V.useMemo(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),y=Ih({...e,elements:{...v,...u&&{reference:u}}}),b=K(f)?f:null,x=m===void 0?i.state.floatingElement:m;i.useSyncedValue(`referenceElement`,f??null),i.useSyncedValue(`domReferenceElement`,f===void 0?s:b),i.useSyncedValue(`floatingElement`,x);let S=V.useCallback(e=>{let t=K(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),y.refs.setReference(t)},[y.refs]),C=V.useCallback(e=>{(K(e)||e===null)&&(g.current=e,p(e)),(K(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!K(e))&&y.refs.setReference(e)},[y.refs,p]),w=V.useCallback(e=>{h(e),y.refs.setFloating(e)},[y.refs]),T=V.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:g}),[y.refs,C,w,S]),E=V.useMemo(()=>({...y.elements,domReference:s}),[y.elements,s]),D=V.useMemo(()=>({...y,dataRef:i.context.dataRef,open:c,onOpenChange:i.setOpen,events:i.context.events,floatingId:l,refs:T,elements:E,nodeId:t,rootStore:i}),[y,T,E,t,i,c,l]);return J(()=>{s&&(g.current=s)},[s]),J(()=>{i.context.dataRef.current.floatingContext=D;let e=_?.nodesRef.current.find(e=>e.id===t);e&&(e.context=D)}),V.useMemo(()=>({...y,context:D,refs:T,elements:E,rootStore:i}),[y,T,E,D,i])}var Dg=td&&$u;function Og(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=V.useRef(!1),c=V.useRef(null),l=V.useRef(!0),u=Vd();V.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=pu(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&gu(e)&&e===ef(Z(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return gf(X(t,`blur`,r),Dg&&X(t,`keydown`,a,!0),Dg&&X(t,`pointerdown`,o,!0))},[i,n]),V.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);K(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=V.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=tf(t.nativeEvent);if(K(a)){if(Dg&&!t.relatedTarget){if(!l.current&&!of(a))return}else if(!lf(a))return}let o=nf(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,bd(Rl,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,bd(Rl,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=K(n)&&n.hasAttribute(Ip(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=ef(Z(e));!n&&t===e||Y(o.current.floatingContext?.refs.floating.current,t)||Y(e,t)||a||nf(n??t,i.context.triggerElements)||i.setOpen(!1,bd(Rl,r))})}}},[o,r,i,u]);return V.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var kg=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Bd,this.restTimeout=new Bd,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Ag=new WeakMap;function jg(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Ag.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Ag.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Mg(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Ag.get(n);a&&a!==e&&jg(a),jg(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Ag.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Ng(e){let t=e.context.dataRef.current,n=Mc(()=>t.hoverInteractionState??kg.create()).current;return t.hoverInteractionState||=n,wd(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Pg(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=gm(),d=hm(),f=Ng(a),p=Vd(),m=q(()=>mf(l.current.openEvent?.type,f.interactedInside)),h=q(()=>hf(l.current.openEvent?.type)),g=q(()=>{jg(f)});J(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),V.useEffect(()=>g,[g]),J(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&K(c)&&s){let e=c,t=s,n=Z(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return Mg(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),V.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&Pp(u.nodesRef.current,d).length>0)}function t(e){let t=ff(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,bd(Ll,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=tf(e);if(!sf(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,_),g()}function h(n){if(e()&&u){u.events.on(`floating.closed`,_);return}if(nf(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&K(o)&&Pp(u.nodesRef.current,r,!1).some(e=>Y(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),m()||t(n)}}function _(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,_),a.setOpen(!1,bd(Ll,t)),u.events.emit(`floating.closed`,t)})}let v=s;return gf(v&&X(v,`mouseenter`,c),v&&X(v,`mouseleave`,h),v&&X(v,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,_)})},[n,s,a,l,r,i,m,g,f,u,d,p])}var Fg={current:null};function Ig(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Fg,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p}=t,m=`rootStore`in e?e.rootStore:e,{dataRef:h,events:g}=m.context,_=gm(l),v=Ng(m),y=V.useRef(!1),b=_f(i),x=_f(r),S=_f(o),C=_f(n),w=_f(p),T=_f(f),E=q(()=>mf(h.current.openEvent?.type,v.interactedInside)),D=q(()=>w.current?.()!==!1),O=q((e,t,n)=>{let r=m.context.triggerElements;if(r.hasElement(t))return!e||!Y(e,t);if(!K(n))return!1;let i=n;return r.hasMatchingElement(e=>Y(e,i))&&(!e||!Y(e,i))}),k=q(()=>{v.handler&&=(Z(m.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=q(()=>{jg(v)});return u&&(v.handleCloseOptions=b.current?.__options),V.useEffect(()=>k,[k]),V.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===Ll,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),V.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=ff(x.current,`close`,v.pointerType);n?v.openChangeTimeout.start(n,()=>{m.setOpen(!1,bd(Ll,e)),_?.events.emit(`floating.closed`,e)}):t&&(v.openChangeTimeout.clear(),m.setOpen(!1,bd(Ll,e)),_?.events.emit(`floating.closed`,e))}let t=c.current??(u?m.select(`domReferenceElement`):null);if(!K(t))return;function r(e){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!Kd(v.pointerType))return;let t=pf(S.current),n=ff(x.current,`open`,v.pointerType),r=tf(e),i=e.currentTarget??null,o=m.select(`domReferenceElement`),s=i;if(K(r)&&!m.context.triggerElements.hasElement(r)){for(let e of m.context.triggerElements.elements())if(Y(e,r)){s=e;break}}K(i)&&K(o)&&!m.context.triggerElements.hasElement(i)&&Y(i,o)&&(s=o);let c=s==null?!1:O(o,s,r),l=m.select(`open`),u=T.current?.()??m.select(`transitionStatus`)===`ending`,d=!l&&u&&y.current,f=!c&&K(s)&&K(o)&&Y(o,s)&&d,p=t>0&&!n,h=c&&(l||d)||f,g=!l||c;if(h){D()&&m.setOpen(!0,bd(Ll,e,s));return}p||(n?v.openChangeTimeout.start(n,()=>{g&&D()&&m.setOpen(!0,bd(Ll,e,s))}):g&&D()&&m.setOpen(!0,bd(Ll,e,s)))}function i(t){if(E()){A();return}k();let n=Z(m.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let r=h.current.floatingContext??d?.();if(!nf(t.relatedTarget,m.context.triggerElements)){if(b.current&&r){m.select(`open`)||v.openChangeTimeout.clear();let i=c.current;v.handler=b.current({...r,tree:_,x:t.clientX,y:t.clientY,onClose(){A(),k(),C.current&&!E()&&i===m.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,v.handler),v.handler(t);return}(v.pointerType!==`touch`||!Y(m.select(`floatingElement`),t.relatedTarget))&&e(t)}}return s?gf(X(t,`mousemove`,r,{once:!0}),X(t,`mouseenter`,r),X(t,`mouseleave`,i)):gf(X(t,`mouseenter`,r),X(t,`mouseleave`,i))},[k,A,h,x,m,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D]),V.useMemo(()=>{if(!n)return;function e(e){v.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=m.select(`domReferenceElement`),i=m.select(`open`),o=O(r,n,e.target);if(a&&!Kd(v.pointerType))return;if(i&&o&&v.handleCloseOptions?.blockPointerEvents){let e=m.select(`floatingElement`);if(e){let t=v.handleCloseOptions?.getScope?.()??n.ownerDocument.body;Mg(v,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=pf(S.current);if(i&&!o||s===0||!o&&v.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;v.restTimeout.clear();function c(){if(v.restTimeoutPending=!1,E())return;let e=m.select(`open`);!v.blockMouseMove&&(!e||o)&&D()&&m.setOpen(!0,bd(Ll,t,n))}v.pointerType===`touch`?Sl.flushSync(()=>{c()}):o&&i?c():(v.restTimeoutPending=!0,v.restTimeout.start(s,c))}}},[n,v,E,O,a,m,S,D])}var Lg=`Escape`;function Rg(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function zg(e,t){return Rg(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Bg(e,t,n){return Rg(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Vg(e,t,n){return Rg(t,n?e===Xd:e===Zd,e===$d)}function Hg(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===Lg:Rg(t,n?e===Zd:e===Xd,e===Qd)}function Ug(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,cols:v=1,id:y,resetOnPointerLeave:b=!0,externalTree:x}=t,S=`rootStore`in e?e.rootStore:e,C=S.useState(`open`),w=S.useState(`floatingElement`),T=S.useState(`domReferenceElement`),E=S.context.dataRef,D=uf(w),O=cf(T),k=_f(D),A=hm(),j=gm(x),M=V.useRef(f),N=V.useRef(o??-1),P=V.useRef(null),F=V.useRef(!0),I=q(e=>{i(N.current===-1?null:N.current,e)}),ee=V.useRef(I),te=V.useRef(!!w),ne=V.useRef(C),re=V.useRef(!1),L=V.useRef(!1),ie=V.useRef(null),ae=_f(h),R=_f(C),z=_f(o),oe=_f(b),se=Od(),ce=Od(),le=q(()=>{function e(e){d?j?.events.emit(`virtualfocus`,e):ie.current=Rp(e,{sync:re.current,preventScroll:!0})}let t=n.current[N.current],r=L.current;t&&e(t),(re.current?e=>e():e=>se.request(e))(()=>{let i=n.current[N.current]||t;i&&(t||e(i),he&&(r||!F.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});J(()=>{E.current.orientation=g},[E,g]),J(()=>{a&&(C&&w?(N.current=o??-1,M.current&&o!=null&&(L.current=!0,I())):te.current&&(N.current=-1,ee.current()))},[a,C,w,o,I]),J(()=>{if(a){if(!C){re.current=!1;return}if(w)if(r==null){if(re.current=!1,z.current!=null)return;if(te.current&&(N.current=-1,le()),(!ne.current||!te.current)&&M.current&&(P.current!=null||M.current===!0&&P.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ce.request(e):queueMicrotask)(t),e+=1):(N.current=P.current==null||Bg(P.current,g,u)||l?$f(n):ep(n),P.current=null,I())};t()}}else Qf(n.current,r)||(N.current=r,le(),L.current=!1)}},[a,C,w,r,z,l,n,g,u,I,le,ce]),J(()=>{if(!a||w||!j||d||!te.current)return;let e=j.nodesRef.current,t=e.find(e=>e.id===A)?.context?.elements.floating,n=ef(Z(w)),r=e.some(e=>e.context&&Y(e.context.elements.floating,n));t&&!r&&F.current&&t.focus({preventScroll:!0})},[a,w,j,A,d]),J(()=>{ee.current=I,ne.current=C,te.current=!!w}),J(()=>{C||(P.current=null,M.current=f)},[C,f]);let ue=r!=null,de=q(e=>{if(!R.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(N.current!==t||r!==t)&&(N.current=t,I(e))}),fe=q(()=>_??j?.nodesRef.current.find(e=>e.id===A)?.context?.dataRef?.current.orientation),pe=q(()=>$f(n,ae.current)),me=q(e=>{if(F.current=!1,re.current=!0,e.which===229||!R.current&&e.currentTarget===k.current)return;if(l&&Hg(e.key,g,u,v)){zg(e.key,fe())||Hd(e),S.setOpen(!1,bd(Ql,e.nativeEvent)),gu(T)&&(d?j?.events.emit(`virtualfocus`,T):T.focus());return}let t=N.current,r=$f(n,h),i=ep(n,h);if(O||(e.key===`Home`&&(Hd(e),N.current=r,I(e)),e.key===`End`&&(Hd(e),N.current=i,I(e))),v>1){let t=Array.from({length:n.current.length},()=>({width:1,height:1})),a=rp(t,v,!1),o=a.findIndex(e=>e!=null&&!op(n.current,e,h)),s=a.reduce((e,t,r)=>t!=null&&!op(n.current,t,h)?r:e,-1),l=a[np(a.map(e=>e==null?null:n.current[e]),{event:e,orientation:g,loopFocus:c,rtl:u,cols:v,disabledIndices:ap([...(typeof h==`function`?null:h)||n.current.map((e,t)=>op(n.current,t,h)?t:void 0),void 0],a),minIndex:o,maxIndex:s,prevIndex:ip(N.current>i?r:N.current,t,a,v,e.key===`ArrowDown`?`bl`:e.key===(u?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(l!=null&&(N.current=l,I(e)),g===`both`)return}if(zg(e.key,g)){if(Hd(e),C&&!d&&ef(e.currentTarget.ownerDocument)===e.currentTarget){N.current=Bg(e.key,g,u)?r:i,I(e);return}Bg(e.key,g,u)?c?t>=i?s&&t!==n.current.length?N.current=-1:(re.current=!1,N.current=r):N.current=tp(n.current,{startingIndex:t,disabledIndices:h}):N.current=Math.min(i,tp(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?N.current=n.current.length:(re.current=!1,N.current=i):N.current=tp(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):N.current=Math.max(r,tp(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),Qf(n.current,N.current)&&(N.current=-1),I(e)}}),he=V.useMemo(()=>({onFocus(e){re.current=!0,de(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){re.current=!0,L.current=!1,p&&de(e)},onPointerLeave(e){if(!R.current||!F.current||e.pointerType===`touch`)return;re.current=!0;let t=e.relatedTarget;if(!(!p||n.current.includes(t))&&oe.current&&(ie.current?.(),ie.current=null,N.current=-1,I(e),!d)){let e=k.current,t=ef(Z(e));e&&Y(e,t)&&e.focus({preventScroll:!0})}}}),[de,R,k,p,n,I,oe,d]),ge=V.useMemo(()=>d&&C&&ue&&{"aria-activedescendant":`${y}-${r}`},[d,C,ue,y,r]),_e=V.useMemo(()=>({"aria-orientation":g===`both`?void 0:g,...O?{}:ge,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&C&&!d){let t=tf(e.nativeEvent);if(t&&!Y(k.current,t))return;Hd(e),S.setOpen(!1,bd(Xl,e.nativeEvent)),gu(T)&&T.focus();return}me(e)},onPointerMove(){F.current=!0}}),[ge,me,k,g,O,S,C,d,T]),ve=V.useMemo(()=>{function e(e){S.setOpen(!0,bd(Ql,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&Wd(e.nativeEvent)&&(M.current=!d)}function n(e){M.current=f,f===`auto`&&Gd(e.nativeEvent)&&(M.current=!0)}return{onKeyDown(t){let n=S.select(`open`);F.current=!1;let r=t.key.startsWith(`Arrow`),i=Vg(t.key,fe(),u),a=zg(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return me(t);if(!(!n&&!m&&r)){if(o){let e=zg(t.key,fe());P.current=l&&e?null:t.key}if(l){i&&(Hd(t),n?(N.current=pe(),I(t)):e(t));return}a&&(z.current!=null&&(N.current=z.current),Hd(t),!n&&m?e(t):me(t),n&&I(t))}},onFocus(e){S.select(`open`)&&!d&&(N.current=-1,I(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[me,f,pe,l,I,S,m,g,fe,u,z,d]),ye=V.useMemo(()=>({...ge,...ve}),[ge,ve]);return V.useMemo(()=>a?{reference:ye,floating:_e,item:he,trigger:ve}:{},[a,ye,_e,ve,he])}function Wg(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,onTyping:o,enabled:s=!0,resetMs:c=750,selectedIndex:l=null}=t,u=`rootStore`in e?e.rootStore:e,d=u.useState(`open`),f=Vd(),p=V.useRef(``),m=V.useRef(l??i??-1),h=V.useRef(null),g=q(e=>{function t(e){let t=r?.current[e];return!t||cp(t)}function s(e,n,r=0){if(e.length===0)return-1;let i=(r%e.length+e.length)%e.length,a=n.toLocaleLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length;if(!(!e[r]?.toLocaleLowerCase().startsWith(a)||!t(r)))return r}return-1}let u=n.current;if(p.current.length>0&&e.key===` `&&(Hd(e),o?.(!0)),p.current.length>0&&p.current[0]!==` `&&s(u,p.current)===-1&&e.key!==` `&&o?.(!1),u==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;d&&e.key!==` `&&(Hd(e),o?.(!0));let g=p.current===``;g&&(m.current=l??i??-1),u.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&p.current===e.key&&(p.current=``,m.current=h.current),p.current+=e.key,f.start(c,()=>{p.current=``,m.current=h.current,o?.(!1)});let _=((g?l??i??-1:m.current)??0)+1,v=s(u,p.current,_);v===-1?e.key!==` `&&(p.current=``,o?.(!1)):(a?.(v),h.current=v)}),_=q(e=>{let t=e.relatedTarget,n=u.select(`domReferenceElement`),r=u.select(`floatingElement`);Y(n,t)||Y(r,t)||(f.clear(),p.current=``,m.current=h.current,o?.(!1))});J(()=>{!d&&l!==null||(f.clear(),h.current=null,p.current!==``&&(p.current=``))},[d,l,f]),J(()=>{d&&p.current===``&&(m.current=l??i??-1)},[d,l,i]);let v=V.useMemo(()=>({onKeyDown:g,onBlur:_}),[g,_]);return V.useMemo(()=>s?{reference:v,floating:v}:{},[s,v])}var Gg=.1,Kg=Gg*Gg,qg=.5;function Jg(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Yg(e,t,n,r,i,a,o,s,c,l){let u=!1;return Jg(e,t,n,r,i,a)&&(u=!u),Jg(e,t,i,a,o,s)&&(u=!u),Jg(e,t,o,s,c,l)&&(u=!u),Jg(e,t,c,l,n,r)&&(u=!u),u}function Xg(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Zg(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Qg(e={}){let{blockPointerEvents:t=!1}=e,n=new Bd,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Kg;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=tf(r),g=r.type===`mouseleave`,_=Y(u,h),v=Y(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&K(r.relatedTarget)&&Y(u,r.relatedTarget))return;function y(){return!!(s&&Pp(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Zg(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Zg(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Zg(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Zg(d,f,x.right-1,A,S.left+1,k);break;default:}if(j)return;if(l&&!Xg(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?qg/2:qg*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+qg+1,o=C||T?S.bottom-qg:S.top,s=C?T?S.bottom-qg:S.top:S.bottom-qg;M=Yg(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?qg/2:qg*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-qg,o=C||T?S.top+qg:S.bottom,s=C?T?S.top+qg:S.bottom:S.top+qg;M=Yg(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?qg/2:qg*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+qg+1,o=w||E?S.right-qg:S.left,s=w?E?S.right-qg:S.left:S.right-qg;M=Yg(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?qg/2:qg*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-qg,o=w||E?S.left+qg:S.right,s=w?E?S.left+qg:S.right:S.left+qg;M=Yg(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var $g=V.createContext(void 0);function e_(e){let t=V.useContext($g);if(t===void 0&&!e)throw Error(Ec(69));return t}var t_=`ArrowUp`,n_=`ArrowDown`,r_=`ArrowLeft`,i_=`ArrowRight`,a_=`Home`,o_=new Set([r_,i_]),s_=new Set([r_,i_,a_,`End`]),c_=new Set([t_,n_]),l_=new Set([t_,n_,a_,`End`]),u_=new Set([...o_,...c_]),d_=new Set([...u_,a_,`End`]),f_=`Shift`,p_=new Set([f_,`Control`,`Alt`,`Meta`]);function m_(e){return gu(e)&&e.tagName===`INPUT`}function h_(e){return!!(m_(e)&&e.selectionStart!=null||gu(e)&&e.tagName===`TEXTAREA`)}function g_(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=__(e,t,`left`),a=v_(e),o=v_(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=__(e,t,`top`),r=v_(e),i=v_(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function __(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function v_(e){let 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}}function y_(e){return e===`starting`?Zp:Gc}var b_={...Ml,...yl},x_=V.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=Ac(),{side:c,align:l}=Oc(),u=e_(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`activeTriggerElement`),w=s.useState(`hoverEnabled`),T=s.useState(`disabled`),E=_.type===`context-menu`;Md({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),V.useEffect(()=>{function e(e){s.setOpen(!1,bd(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),Pg(b,{enabled:w&&!T&&!E&&_.type!==`menubar`,closeDelay:S});let D=V.useCallback(e=>{s.set(`popupElement`,e)},[s]),O=ul(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,D],stateAttributesMapping:b_,props:[p,{onKeyDown(e){u&&d_.has(e.key)&&e.stopPropagation()}},y_(f),o,{"data-rootownerid":y}]}),k=_.type===void 0||E;return(g||_.type===`menubar`&&v!==`outside-press`)&&(k=!0),(0,H.jsx)(Om,{context:b,modal:E,disabled:!m,returnFocus:a===void 0?k:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:C,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:O})}),S_=V.createContext(void 0);function C_(){let e=V.useContext(S_);if(e===void 0)throw Error(Ec(32));return e}var w_=V.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Ac();return i.useState(`mounted`)||n?(0,H.jsx)(S_.Provider,{value:n,children:(0,H.jsx)(um,{ref:t,...r})}):null});function T_(e){return Bc(19)?e:e?`true`:void 0}var E_=V.createContext(void 0);function D_(){return V.useContext(E_)?.direction??`ltr`}var O_=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=jf(e,t)||{};if(l==null)return{};let f=Yf(u),p={x:n,y:r},m=Lf(i),h=Ff(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Af(k,j,A),N=!c.arrow&&Nf(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),k_=(e,t)=>({...O_(e),options:[e,t]}),A_={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Hh().fn(e)).data?.referenceHidden||a}}}},j_={sideX:`left`,sideY:`top`},M_={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=pu(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:j_};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=Z(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Mf(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:j_.sideX,g=f===`top`?`bottom`:j_.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function N_(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function P_(e,t,n){let{rects:r,placement:i}=e;return{side:N_(t,Mf(i),n),align:Nf(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function F_(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,inline:f,keepMounted:p=!1,floatingRootContext:m,mounted:h,collisionAvoidance:g,shiftCrossAxis:_=!1,nodeId:v,adaptiveOrigin:y,lazyFlip:b=!1,externalTree:x}=e,[S,C]=V.useState(null);!h&&S!==null&&C(null);let w=g.side||`flip`,T=g.align||`flip`,E=g.fallbackAxisSide||`end`,D=typeof t==`function`?t:void 0,O=q(D),k=D?O:t,A=_f(t),j=_f(h),M=D_()===`rtl`,N=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":M?`left`:`right`,"inline-start":M?`right`:`left`}[r],P=a===`center`?N:`${N}-${a}`,F=c,I=+(r===`bottom`),ee=+(r===`top`),te=+(r===`right`),ne=+(r===`left`);typeof F==`number`?F={top:F+I,right:F+ne,bottom:F+ee,left:F+te}:F&&={top:(F.top||0)+I,right:(F.right||0)+ne,bottom:(F.bottom||0)+ee,left:(F.left||0)+te};let re={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:F},L=V.useRef(null),ie=_f(i),ae=_f(o),R=typeof i==`function`?0:i,z=typeof o==`function`?0:o,oe=[];f&&oe.push(f),oe.push(Lh(e=>{let t=P_(e,r,M),n=typeof ie.current==`function`?ie.current(t):ie.current,i=typeof ae.current==`function`?ae.current(t):ae.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[R,z,M,r]));let se=T===`none`&&w!==`shift`,ce=!se&&(l||_||w===`shift`),le=w===`none`?null:Bh({...re,padding:{top:F.top+1,right:F.right+1,bottom:F.bottom+1,left:F.left+1},mainAxis:!_&&w===`flip`,crossAxis:T===`flip`?`alignment`:!1,fallbackAxisSideDirection:E}),ue=se?null:Rh(e=>{let t=Z(e.elements.floating).documentElement;return{...re,rootBoundary:_?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:T!==`none`,crossAxis:ce,limiter:l||_?void 0:zh(e=>{if(!L.current)return{};let{width:t,height:n}=L.current.getBoundingClientRect(),r=If(Mf(e.placement)),i=r===`y`?t:n,a=r===`y`?F.left+F.right:F.top+F.bottom;return{offset:i/2+a/2}})}},[re,l,_,F,T]);w===`shift`||T===`shift`||a===`center`?oe.push(ue,le):oe.push(le,ue),oe.push(Vh({...re,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!j.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=pu(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),k_(e=>({element:L.current||Z(e.elements.floating).createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Mf(a),l=If(c),u=L.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(P_(e,r,M)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,ce&&l===`y`&&b?S:x),{}}},A_,y),J(()=>{!h&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[h,m]);let de=V.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:fe,elements:pe,x:me,y:he,middlewareData:ge,update:_e,placement:ve,context:ye,isPositioned:be,floatingStyles:xe}=Eg({rootContext:m,open:p?h:void 0,placement:P,middleware:oe,strategy:n,whileElementsMounted:p?void 0:(...e)=>Ch(...e,de),nodeId:v,externalTree:x}),{sideX:Se,sideY:Ce}=ge.adaptiveOrigin||j_,we=be?n:`fixed`,Te=V.useMemo(()=>{let e=y?{position:we,[Se]:me,[Ce]:he}:{position:we,...xe};return be||(e.opacity=0),e},[y,we,Se,me,Ce,he,xe,be]),Ee=V.useRef(null);J(()=>{if(!h)return;let e=A.current,t=typeof e==`function`?e():e,n=(I_(t)?t.current:t)||null;n!==Ee.current&&(fe.setPositionReference(n),Ee.current=n)},[h,fe,k,A]),V.useEffect(()=>{if(!h)return;let e=A.current;typeof e!=`function`&&I_(e)&&e.current!==Ee.current&&(fe.setPositionReference(e.current),Ee.current=e.current)},[h,fe,k,A]),V.useEffect(()=>{if(p&&h&&pe.domReference&&pe.floating)return Ch(pe.domReference,pe.floating,_e,de)},[p,h,pe,_e,de]);let De=Mf(ve),Oe=N_(r,De,M),ke=Nf(ve)||`center`,Ae=!!ge.hide?.referenceHidden;J(()=>{b&&h&&be&&C(De)},[b,h,be,De]);let je=V.useMemo(()=>({position:`absolute`,top:ge.arrow?.y,left:ge.arrow?.x}),[ge.arrow]),Me=ge.arrow?.centerOffset!==0;return V.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:L,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:fe,context:ye,isPositioned:be,update:_e}),[Te,je,L,Me,Oe,ke,De,Ae,fe,ye,be,_e])}function I_(e){return e!=null&&`current`in e}function L_(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=q(i),o=V.useRef(0),s=Mc(z_).current,c=Mc(R_).current,[l,u]=V.useState(0),d=V.useRef(l),f=q((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=q(e=>{c.delete(e),d.current+=1,u(d.current)}),m=V.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(B_).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);J(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),J(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),J(()=>()=>{n.current=[]},[n]),J(()=>()=>{r&&(r.current=[])},[r]);let h=q(e=>(s.add(e),()=>{s.delete(e)}));J(()=>{s.forEach(e=>e(m))},[s,m]);let g=V.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,H.jsx)(ld.Provider,{value:g,children:t})}function R_(){return new Map}function z_(){return new Set}function B_(e,t){let 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}var V_=V.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,H.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function H_(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),ul(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},y_(r),i],stateAttributesMapping:Ml})}var U_={},W_={},G_=``;function K_(e){if(typeof document>`u`)return!1;let t=Z(e);return pu(t).innerWidth-t.documentElement.clientWidth>0}function q_(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Z(e),n=t.documentElement,r=t.body,i=vu(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function J_(e){let t=Z(e),n=t.documentElement,r=t.body,i=vu(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Y_(e){let t=Z(e),n=t.documentElement,r=t.body,i=pu(n),a=0,o=0,s=!1,c=Dd.create();if(Xu&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,U_={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},G_=n.style.scrollBehavior,W_={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=vu(n)?n:r;if(s=q_(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,U_),Object.assign(r.style,W_),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=G_)}function d(){u(),c.request(l)}l();let f=X(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var X_=new class{lockCount=0;restore=null;timeoutLock=Bd.create();timeoutUnlock=Bd.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Z(e).documentElement,n=pu(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=Uc;return}let r=Zu||!K_(e);this.restore=r?J_(e):Y_(e)}};function Z_(e=!0,t=null){J(()=>{if(e)return X_.acquire(t)},[e,t])}var Q_=20;function $_(e,t,n,r){let[i,a]=V.useState(!1);J(()=>{if(!e||!t||n==null){a(!1);return}let r=Z(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Q_)},[e,t,n]),Z_(e&&(!t||i),r)}var ev=V.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=rm,style:g,..._}=e,{store:v}=Ac(),y=C_(),b=Pl(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`activeTriggerElement`),k=v.useState(`transitionStatus`),A=v.useState(`positionerElement`),j=v.useState(`instantType`),M=v.useState(`hasViewport`),N=v.useState(`lastOpenChangeReason`),P=v.useState(`floatingNodeId`),F=v.useState(`floatingParentNodeId`),I=S.useState(`domReferenceElement`),ee=V.useRef(null),te=jd(A,!1,!1),ne=n,re=c,L=l,ie=s,ae=h;x.type===`context-menu`&&(ne=n??x.context?.anchor,ie??=`start`,!o&&ie!==`center`&&(L=e.alignOffset??2,re=e.sideOffset??-5));let R=o,z=ie;x.type===`menu`?(R??=`inline-end`,z??=`start`,ae=e.collisionAvoidance??im):x.type===`menubar`&&(R??=`bottom`,z??=`start`);let oe=x.type===`context-menu`,se=F_({anchor:ne,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:R,sideOffset:re,align:z,alignOffset:L,arrowPadding:oe?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:P,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:ae,shiftCrossAxis:oe&&!(`side`in ae&&ae.side===`flip`),externalTree:C,adaptiveOrigin:M?M_:void 0});V.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===P&&v.set(`hoverEnabled`,!1),e.nodeId!==P&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,bd(nu)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,P]),V.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,bd(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let ce=Vd();V.useEffect(()=>{T||ce.clear()},[T,ce]),V.useEffect(()=>{function e(e){if(!(!T||e.nodeId!==v.select(`floatingParentNodeId`)))if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?ce.isStarted()||ce.start(e,()=>{v.setOpen(!1,bd(nu))}):v.setOpen(!1,bd(nu))}else ce.clear()}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,O,v,ce]),V.useEffect(()=>{let e={open:T,nodeId:P,parentNodeId:F,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,P,F]),J(()=>{let e=I,t=ee.current;if(e&&(ee.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return te(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,te,v]);let le={open:T,side:se.side,align:se.align,anchorHidden:se.anchorHidden,nested:x.type===`menu`,instant:j},ue=x.type===`menubar`&&x.context.modal;$_(T&&(ue||E&&N!==`trigger-hover`),D===`touch`,A,O);let de=H_(e,le,{styles:se.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),fe=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&N!==`trigger-hover`||x.type===`menubar`&&x.context.modal),pe=null;return x.type===`menubar`?pe=x.context.contentElement:x.type===void 0&&(pe=O),(0,H.jsxs)(Dc.Provider,{value:se,children:[fe&&(0,H.jsx)(V_,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:T_(!T),cutout:pe}),(0,H.jsx)(vm,{id:P,children:(0,H.jsx)(L_,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:de})})]})}),tv=V.createContext(void 0);function nv(){let e=V.useContext(tv);if(e===void 0)throw Error(Ec(34));return e}var rv=V.memo(V.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,style:c,"aria-labelledby":l,...u}=e,[d,f]=V.useState(void 0),[p,m]=cu({controlled:i,default:a,name:`MenuRadioGroup`}),h=q((e,t)=>{o?.(e,t),!t.isCanceled&&m(e)}),g=ul(`div`,e,{state:{disabled:s},ref:t,props:{role:`group`,"aria-labelledby":l??d,"aria-disabled":s||void 0,...u}}),_=V.useMemo(()=>({value:p,setValue:h,disabled:s}),[p,h,s]);return(0,H.jsx)(Pd.Provider,{value:f,children:(0,H.jsx)(tv.Provider,{value:_,children:g})})})),iv=V.createContext(void 0),av=V.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,value:l,style:u,...d}=e,f=fd({label:a}),p=Oc(!0),m=_d(i),{store:h}=Ac(),g=h.useState(`isActive`,f.index),_=h.useState(`itemProps`),{value:v,setValue:y,disabled:b}=nv(),x=b||s,S=v===l,{getItemProps:C,itemRef:w}=cd({closeOnClick:c,disabled:x,highlighted:g,id:m,store:h,nativeButton:o,nodeId:p?.context.nodeId,itemMetadata:sd}),T=V.useMemo(()=>({disabled:x,highlighted:g,checked:S}),[x,g,S]);function E(e){let t=bd(Bl,e.nativeEvent,void 0,{preventUnmountOnClose(){}});y(l,t)}let D=ul(`div`,e,{state:T,stateAttributesMapping:yd,props:[_,{role:`menuitemradio`,"aria-checked":S,onClick:E},d,C],ref:[w,t,f.ref]});return(0,H.jsx)(iv.Provider,{value:T,children:D})});function ov(e){let t=V.useRef(!0);t.current&&(t.current=!1,e())}var sv=V.createContext(null);function cv(e){let t=V.useContext(sv);if(t===null&&!e)throw Error(Ec(5));return t}function lv(e){let t=V.useRef(``),n=V.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:V.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function uv(e,t){let n=V.useRef(e),r=q(t);J(()=>{n.current!==e&&r(n.current)},[e,r]),J(()=>{n.current=e},[e])}function dv(e,t){let{onClick:n,onPointerDown:r}=lv(q((n,r)=>{(typeof e==`function`?e():e)||t(r||(Zu?`touch`:``))}));return V.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function fv(e){let[t,n]=V.useState(null),r=dv(e,n);return uv(e,t=>{t&&!e&&n(null)}),V.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var pv={...wg,disabled:Q(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:Q(e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0)),openMethod:Q(e=>e.openMethod),allowMouseEnter:Q(e=>e.allowMouseEnter),stickIfOpen:Q(e=>e.stickIfOpen),parent:Q(e=>e.parent),rootId:Q(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:Q(e=>e.activeIndex),isActive:Q((e,t)=>e.activeIndex===t),hoverEnabled:Q(e=>e.hoverEnabled),instantType:Q(e=>e.instantType),lastOpenChangeReason:Q(e=>e.openChangeReason),floatingTreeRoot:Q(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:Q(e=>e.floatingNodeId),floatingParentNodeId:Q(e=>e.floatingParentNodeId),itemProps:Q(e=>e.itemProps),closeDelay:Q(e=>e.closeDelay),hasViewport:Q(e=>e.hasViewport),keyboardEventRelay:Q(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})},mv=class e extends ng{constructor(e){super({...hv(),...e},{positionerRef:V.createRef(),popupRef:V.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:V.createRef(),beforeContentFocusGuardRef:V.createRef(),onOpenChangeComplete:void 0,triggerElements:new hg},pv),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);t===i&&n===a&&r===o||(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){let r=Mc(()=>new e(n)).current;return t??r}unsubscribeParentListener=null};function hv(){return{..._g(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new fm,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Gc,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}var gv=V.createContext(void 0);function _v(){return V.useContext(gv)}var vv=qh(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=Pl(!0),_=Ac(!0),v=cv(!0),y=_v(),b=V.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=mv.useStore(f?.store,{open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b});ov(()=>{n===void 0&&x.state.open===!1&&a===!0&&x.update({open:!0,activeTriggerId:m})}),x.useControlledProp(`openProp`,n),x.useControlledProp(`triggerIdProp`,p),x.useContextCallback(`onOpenChangeComplete`,i);let S=gd(),C=gd(),w=x.useState(`floatingTreeRoot`),T=_m(w),E=hm(),D=x.useState(`open`),O=x.useState(`activeTriggerElement`),k=x.useState(`positionerElement`),A=x.useState(`hoverEnabled`),j=x.useState(`disabled`),M=x.useState(`lastOpenChangeReason`),N=x.useState(`parent`),P=x.useState(`activeIndex`),F=x.useState(`payload`),I=x.useState(`floatingParentNodeId`),ee=V.useRef(null),te=V.useRef(N.type!==`context-menu`),ne=Vd(),re=V.useRef(!0),L=Vd(),ie=I!=null,{openMethod:ae,triggerProps:R}=fv(D);x.useSyncedValues({disabled:o,modal:N.type===void 0?s:void 0,openMethod:ae,rootId:S}),dg(x);let{forceUnmount:z}=fg(D,x,()=>{x.update({allowMouseEnter:!1,stickIfOpen:!0})});J(()=>{g&&!_?x.update({parent:{type:`context-menu`,context:g},floatingNodeId:T,floatingParentNodeId:E}):_&&x.update({floatingNodeId:T,floatingParentNodeId:E})},[g,_,T,E,x]),V.useEffect(()=>{if(D||(ee.current=null),N.type===`context-menu`){if(!D){ne.clear(),te.current=!1;return}ne.start(500,()=>{te.current=!0})}},[ne,D,N.type]),J(()=>{!D&&!A&&x.set(`hoverEnabled`,!0)},[D,A,x]);let oe=q((e,t)=>{let n=t.reason;if(D===e&&t.trigger===O&&M===n||(t.preventUnmountOnClose=()=>{x.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&(t.trigger=O??void 0),r?.(e,t),t.isCanceled))return;x.state.floatingRootContext.dispatchOpenChange(e,t);let i=t.event;if(e===!1&&i?.type===`click`&&i.pointerType===`touch`&&!re.current)return;if(!e&&P!==null){let e=x.context.itemDomElements.current[P];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}e&&n===`trigger-focus`?(re.current=!1,L.start(300,()=>{re.current=!0})):(re.current=!0,L.clear());let a=(n===`trigger-press`||n===`item-press`)&&i.detail===0&&i?.isTrusted,o=!e&&(n===`escape-key`||n==null),s={open:e,openChangeReason:n};ee.current=t.event??null;let c=t.trigger?.id??null;(c||e)&&(s.activeTriggerId=c,s.activeTriggerElement=t.trigger??null),x.update(s),N.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?x.set(`instantType`,`group`):a||o?x.set(`instantType`,a?`click`:`dismiss`):x.set(`instantType`,void 0)}),se=ag({popupStore:x,floatingId:C,nested:E!=null,onOpenChange:oe}),ce=se.context.events;V.useEffect(()=>{let e=({open:e,eventDetails:t})=>oe(e,t);return ce.on(`setOpen`,e),()=>{ce?.off(`setOpen`,e)}},[ce,oe]);let le=V.useCallback(()=>{x.setOpen(!1,bd(ou))},[x]);V.useImperativeHandle(u,()=>({unmount:z,close:le}),[z,le]);let ue;N.type===`context-menu`&&(ue=N.context),V.useImperativeHandle(ue?.positionerRef,()=>k,[k]),V.useImperativeHandle(ue?.actionsRef,()=>({setOpen:oe}),[oe]);let de=Nm(se,{enabled:!j,bubbles:{escapeKey:d&&N.type===`menu`},outsidePress(){return N.type!==`context-menu`||ee.current?.type===`contextmenu`?!0:te.current},externalTree:ie?w:void 0}),fe=D_(),pe=V.useCallback(e=>{x.select(`activeIndex`)!==e&&x.set(`activeIndex`,e)},[x]),me=Ug(se,{enabled:!j,listRef:x.context.itemDomElements,activeIndex:P,nested:N.type!==void 0,loopFocus:c,orientation:l,parentOrientation:N.type===`menubar`?N.context.orientation:void 0,rtl:fe===`rtl`,disabledIndices:Wc,onNavigate:pe,openOnArrowKeyDown:N.type!==`context-menu`,externalTree:ie?w:void 0,focusItemOnHover:h}),he=V.useCallback(e=>{x.context.typingRef.current=e},[x]),ge=Wg(se,{listRef:x.context.itemLabels,elementsRef:x.context.itemDomElements,activeIndex:P,resetMs:500,onMatch:e=>{D&&e!==P&&x.set(`activeIndex`,e)},onTyping:he});pg(x,{floatingRootContext:se,activeTriggerProps:V.useMemo(()=>{let e=Xc(ge.reference,me.reference,de.reference,{onMouseMove(){x.set(`allowMouseEnter`,!0)}},R);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=D,e},[x,ge.reference,me.reference,de.reference,R,D]),inactiveTriggerProps:V.useMemo(()=>{let e=Xc(me.trigger,de.trigger,R);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[me.trigger,de.trigger,R]),popupProps:V.useMemo(()=>Xc(og,{id:C,role:`menu`,"aria-labelledby":O?.id,onMouseMove(){x.set(`allowMouseEnter`,!0),N.type===`menu`&&x.set(`hoverEnabled`,!1)},onClick(){x.select(`hoverEnabled`)&&x.set(`hoverEnabled`,!1)},onKeyDown(e){let t=x.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},ge.floating,me.floating,de.floating),[O,C,N.type,x,ge.floating,me.floating,de.floating]),itemProps:me.item??Gc});let _e=V.useMemo(()=>({store:x,parent:b}),[x,b]),ve=(0,H.jsx)(kc.Provider,{value:_e,children:typeof t==`function`?t({payload:F}):t});return N.type===void 0||N.type===`context-menu`?(0,H.jsx)(ym,{externalTree:w,children:ve}):ve});function yv(e){let t=Ac().store,n=V.useMemo(()=>({parentMenu:t}),[t]);return(0,H.jsx)(gv.Provider,{value:n,children:(0,H.jsx)(vv,{...e})})}function bv(e){let t=e.getBoundingClientRect(),n=pu(e),r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||i.content!==`none`))return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function xv(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Vu(),{ref:i,index:a}=fd(e),o=n===a,s=V.useRef(null),c=Nc(i,s);return{compositeProps:V.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}}),[o,r,a,t]),compositeRef:c,index:a}}function Sv(e){let{render:t,className:n,style:r,state:i=Gc,props:a=Wc,refs:o=Wc,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=xv({metadata:s});return ul(l,e,{state:i,ref:[...o,f],props:[d,...a,u],stateAttributesMapping:c})}function Cv(e){if(gu(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`)??void 0;if(!Ou(e))return Cv(ju(e))}function wv(e,t){let n=V.useRef(null);function r(t){Sl.flushSync(()=>{e.setOpen(!1,bd(Xl,t.nativeEvent,t.currentTarget))}),Ap(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&jp(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{Sl.flushSync(()=>{e.setOpen(!1,bd(Xl,n.nativeEvent,n.currentTarget))});let i=kp(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&Y(r,i);){let e=i;if(i=Ep(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Tv(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=V.useRef(!1);return V.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Z(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Gc,[t,n,r])}var Ev=2,Dv=Jh(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=Ac(!0),h=d?.store??m?.store;if(!h)throw Error(Ec(85));let g=_d(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=V.useRef(null),S=kv(),C=Vu(!0),w=gm(),T=V.useMemo(()=>w??new fm,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=ug(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:_m(T),floatingParentNodeId:hm(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=Uu({disabled:A,native:o});V.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=V.useRef(null),P=Vd(),F=q(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(Y(N.current,t)||Y(h.select(`positionerElement`),t)||t===N.current||t!=null&&Cv(t)===h.select(`rootId`))return;let n=bv(N.current);e.clientX>=n.left-Ev&&e.clientX<=n.right+Ev&&e.clientY>=n.top-Ev&&e.clientY<=n.bottom+Ev||T.events.emit(`close`,{domEvent:e,reason:tu})});V.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&Z(N.current).addEventListener(`mouseup`,F,{once:!0})},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,ee=Ig(v,{enabled:(c??I)&&!A&&S.type!==`context-menu`&&(!O||I&&!D),handleClose:Qg({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),te=Ov(y,h.select(`lastOpenChangeReason`)),ne=km(v,{enabled:!A&&S.type!==`context-menu`,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0?te:!1}),re=Og(v,{enabled:!A&&I}),L=Tv({open:y,enabled:O,mouseDownAction:`open`}),ie=V.useMemo(()=>Xc(re.reference,ne.reference),[re.reference,ne.reference]),ae=h.useState(`triggerProps`,D),{preFocusGuardRef:R,handlePreFocusGuardFocus:z,handleFocusTargetFocus:oe}=wv(h,x),se={disabled:A,open:y},ce=[N,t,M,E,x],le=[ie,ee??Gc,ae,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Z(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},O?{role:`menuitem`}:{},L,p,j],ue=ul(`button`,e,{enabled:!O,stateAttributesMapping:jl,state:se,ref:ce,props:le});return O?(0,H.jsx)(Sv,{tag:`button`,render:n,className:r,style:i,state:se,refs:ce,props:le,stateAttributesMapping:jl}):y?(0,H.jsxs)(V.Fragment,{children:[(0,H.jsx)(Sf,{ref:R,onFocus:z},`${g}-pre-focus-guard`),(0,H.jsx)(V.Fragment,{children:ue},g),(0,H.jsx)(Sf,{ref:h.context.triggerFocusTargetRef,onFocus:oe},`${g}-post-focus-guard`)]}):(0,H.jsx)(V.Fragment,{children:ue},g)});function Ov(e,t){let n=Vd(),[r,i]=V.useState(!1);return J(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function kv(){let e=Pl(!0),t=Ac(!0),n=cv(!0);return V.useMemo(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}var Av=V.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return ul(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function jv(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var Mv=V.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:l=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=fd(),m=Oc(),{store:h}=Ac(),g=_d(o),_=h.useState(`open`),v=h.useState(`floatingRootContext`),y=h.useState(`floatingTreeRoot`),b=h.useState(`triggerPopupId`,g),x=cg(g,h),S=V.useCallback(e=>{let t=x(e);return e!==null&&h.select(`open`)&&h.select(`activeTriggerId`)==null&&h.update({activeTriggerId:g,activeTriggerElement:e,closeDelay:u}),t},[x,u,h,g]),C=V.useRef(null),w=V.useCallback(e=>{C.current=e,h.set(`activeTriggerElement`,e)},[h]),T=_v();if(!T?.parentMenu)throw Error(Ec(37));h.useSyncedValue(`closeDelay`,u);let E=T.parentMenu,D=E.useState(`itemProps`),O=E.useState(`isActive`,p.index),k=V.useMemo(()=>({type:`submenu-trigger`,setActive(){E.set(`activeIndex`,p.index)}}),[E,p.index]),A=h.useState(`disabled`),j=d||A,{getItemProps:M,itemRef:N}=cd({closeOnClick:!1,disabled:j,highlighted:O,id:g,store:h,typingRef:E.context.typingRef,nativeButton:s,itemMetadata:k,nodeId:m?.context.nodeId}),P=h.useState(`hoverEnabled`),F=E.useState(`allowMouseEnter`),I=Ig(v,{enabled:P&&c&&!j,handleClose:Qg({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:F?{open:l,close:u}:0,triggerElementRef:C,externalTree:y,isClosing:()=>h.select(`transitionStatus`)===`ending`}),ee=km(v,{enabled:!j,event:`mousedown`,toggle:!c,ignoreMouse:c,stickIfOpen:!1}).reference??Gc,te=h.useState(`triggerProps`,!0);return delete te.id,ul(`div`,e,{state:{disabled:j,highlighted:O,open:_},stateAttributesMapping:Al,props:[ee,I,te,D,{"aria-controls":b,tabIndex:_||O?0:-1,onBlur(){O&&E.set(`activeIndex`,null)}},f,M],ref:[t,p.ref,N,S,w]})}),Nv=vv;function Pv(e){let t=(0,ro.c)(8),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,H.jsx)(Dv,{className:r,"data-slot":`menu-trigger`,...i,children:n}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Fv(e){let t=(0,ro.c)(27),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({children:i,className:a,sideOffset:s,align:c,alignOffset:n,side:l,anchor:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=s===void 0?4:s,d=c===void 0?`center`:c,f=l===void 0?`bottom`:l,p;t[9]===a?p=t[10]:(p=typeof a==`string`&&a.split(/\s+/).some(Iv),t[9]=a,t[10]=p);let m=!p&&`min-w-32`,h;t[11]!==a||t[12]!==m?(h=JT(`dropdown-glass relative flex origin-(--transform-origin) rounded-control outline-none focus:outline-none`,m,a),t[11]=a,t[12]=m,t[13]=h):h=t[13];let g;t[14]===i?g=t[15]:(g=(0,H.jsx)(`div`,{className:`max-h-(--available-height) w-full overflow-y-auto p-1`,children:i}),t[14]=i,t[15]=g);let _;t[16]!==o||t[17]!==h||t[18]!==g?(_=(0,H.jsx)(x_,{className:h,"data-slot":`menu-popup`,...o,children:g}),t[16]=o,t[17]=h,t[18]=g,t[19]=_):_=t[19];let v;return t[20]!==d||t[21]!==n||t[22]!==r||t[23]!==f||t[24]!==u||t[25]!==_?(v=(0,H.jsx)(w_,{children:(0,H.jsx)(ev,{align:d,alignOffset:n,anchor:r,className:`z-[130]`,"data-slot":`menu-positioner`,side:f,sideOffset:u,children:_})}),t[20]=d,t[21]=n,t[22]=r,t[23]=f,t[24]=u,t[25]=_,t[26]=v):v=t[26],v}function Iv(e){let t=e.split(`:`).at(-1)??e;return/^(?:min-|max-)?w-/.test(t)}function Lv(e){let t=(0,ro.c)(2),n;return t[0]===e?n=t[1]:(n=(0,H.jsx)(Id,{"data-slot":`menu-group`,...e}),t[0]=e,t[1]=n),n}function Rv(e){let t=(0,ro.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=JT(`[&>svg]:-mx-0.5 flex min-h-8 cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1 text-base text-foreground outline-none data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-highlighted:bg-accent data-inset:ps-8 data-[variant=destructive]:text-destructive-foreground data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&>svg:not([class*='opacity-'])]:opacity-80 [&>svg:not([class*='size-'])]:size-4.5 sm:[&>svg:not([class*='size-'])]:size-4 [&>svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:[&>svg:not([class*='text-'])]:text-current [&>svg]:pointer-events-none [&>svg]:shrink-0`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,H.jsx)(Rd,{className:s,"data-inset":r,"data-slot":`menu-item`,"data-variant":o,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function zv(e){let t=(0,ro.c)(17),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:i,children:r,checked:n,variant:o,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=o===void 0?`default`:o,c=s===`switch`?`grid-cols-[1fr_auto] gap-4 pe-1.5`:`grid-cols-[1rem_1fr] pe-4`,l;t[6]!==i||t[7]!==c?(l=JT(`grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-pointer items-center gap-2 rounded-small py-1 ps-2.5 text-base text-body outline-none data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-highlighted:bg-selection data-highlighted:text-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,c,i),t[6]=i,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==r||t[10]!==s?(u=s===`switch`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`col-start-1`,children:r}),(0,H.jsx)(Nd,{className:`inset-shadow-[0_1px_--theme(--color-black/4%)] inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200 [--thumb-size:--spacing(4)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:opacity-64 sm:[--thumb-size:--spacing(3)]`,keepMounted:!0,children:(0,H.jsx)(`span`,{className:`pointer-events-none block aspect-square h-full in-[[data-slot=menu-checkbox-item][data-checked]]:origin-[var(--thumb-size)_50%] origin-left in-[[data-slot=menu-checkbox-item][data-checked]]:translate-x-[calc(var(--thumb-size)-4px)] in-[[data-slot=menu-checkbox-item]:active]:not-data-disabled:scale-x-110 in-[[data-slot=menu-checkbox-item]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.10)] rounded-(--thumb-size) bg-background shadow-sm/5 will-change-transform [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s]`})})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Nd,{className:`col-start-1`,children:(0,H.jsx)(`svg`,{fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,H.jsx)(`path`,{d:`M5.252 12.7 10.2 18.63 18.748 5.37`})})}),(0,H.jsx)(`span`,{className:`col-start-2`,children:r})]}),t[9]=r,t[10]=s,t[11]=u):u=t[11];let d;return t[12]!==n||t[13]!==a||t[14]!==l||t[15]!==u?(d=(0,H.jsx)(Sd,{checked:n,className:l,"data-slot":`menu-checkbox-item`,...a,children:u}),t[12]=n,t[13]=a,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function Bv(e){let t=(0,ro.c)(2),n;return t[0]===e?n=t[1]:(n=(0,H.jsx)(rv,{"data-slot":`menu-radio-group`,...e}),t[0]=e,t[1]=n),n}function Vv(e){let t=(0,ro.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,hideIndicator:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=JT(`[&_svg]:-mx-0.5 flex min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-pointer items-center rounded-sm px-2 py-1 text-base text-foreground outline-none data-checked:bg-foreground/[0.08] data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,r),t[5]=r,t[6]=o);let s;t[7]===n?s=t[8]:(s=(0,H.jsx)(`span`,{className:`min-w-0 flex-1`,children:n}),t[7]=n,t[8]=s);let c;return t[9]!==i||t[10]!==o||t[11]!==s?(c=(0,H.jsx)(av,{className:o,"data-slot":`menu-radio-item`,...i,children:s}),t[9]=i,t[10]=o,t[11]=s,t[12]=c):c=t[12],c}function Hv(e){let t=(0,ro.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=JT(`px-2.5 py-1.5 text-muted-foreground text-[11px] data-inset:ps-9 sm:data-inset:ps-8`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,H.jsx)(Ld,{className:a,"data-inset":r,"data-slot":`menu-label`,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function Uv(e){let t=(0,ro.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=JT(`mx-2 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,H.jsx)(Av,{className:i,"data-slot":`menu-separator`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Wv(e){let t=(0,ro.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=JT(`ms-auto font-sans text-muted-foreground text-[11px] tracking-wide`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,H.jsx)(`kbd`,{className:i,"data-slot":`menu-shortcut`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Gv(e){let t=(0,ro.c)(2),n;return t[0]===e?n=t[1]:(n=(0,H.jsx)(yv,{"data-slot":`menu-sub`,...e}),t[0]=e,t[1]=n),n}function Kv(e){let t=(0,ro.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=JT(`flex min-h-8 items-center gap-2 rounded-small px-2.5 py-1 text-base text-body outline-none data-disabled:pointer-events-none data-highlighted:bg-selection data-popup-open:bg-selection data-inset:ps-8 data-highlighted:text-foreground data-popup-open:text-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,H.jsx)(Ea,{className:`-me-0.5 ms-auto opacity-80`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,H.jsxs)(Mv,{className:o,"data-inset":i,"data-slot":`menu-sub-trigger`,...a,children:[n,s]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function qv(e){let t=(0,ro.c)(12),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,sideOffset:a,alignOffset:n,align:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?0:a,c=o===void 0?`start`:o,l=n??(c===`center`?void 0:-5),u;return t[6]!==c||t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==l?(u=(0,H.jsx)(Fv,{align:c,alignOffset:l,className:r,"data-slot":`menu-sub-content`,side:`inline-end`,sideOffset:s,...i}),t[6]=c,t[7]=r,t[8]=i,t[9]=s,t[10]=l,t[11]=u):u=t[11],u}function Jv(e){return ul(e.defaultTagName??`div`,e,e)}var Yv=vo(`relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-[6px] border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-3.5 sm:[&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button&,a&]:cursor-pointer [button&,a&]:pointer-coarse:after:absolute [button&,a&]:pointer-coarse:after:size-full [button&,a&]:pointer-coarse:after:min-h-11 [button&,a&]:pointer-coarse:after:min-w-11`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-5.5 min-w-5.5 px-[calc(--spacing(1)-1px)] text-sm sm:h-4.5 sm:min-w-4.5 sm:text-xs`,lg:`h-6.5 min-w-6.5 px-[calc(--spacing(1.5)-1px)] text-base sm:h-5.5 sm:min-w-5.5 sm:text-sm`,sm:`h-5 min-w-5 rounded-[5px] px-[calc(--spacing(1)-1px)] text-xs sm:h-4 sm:min-w-4 sm:text-[.625rem]`},variant:{default:`bg-selection text-brand-ink [button&,a&]:hover:bg-brand/18`,destructive:`bg-destructive text-white [button&,a&]:hover:bg-destructive/90`,error:`bg-destructive/8 text-destructive-foreground dark:bg-destructive/16`,info:`bg-info/8 text-info-foreground dark:bg-info/16`,outline:`border-line bg-transparent text-body [button&,a&]:hover:bg-accent`,secondary:`bg-secondary text-body [button&,a&]:hover:bg-accent`,success:`bg-success/8 text-success-foreground dark:bg-success/16`,warning:`bg-warning/8 text-warning-foreground dark:bg-warning/16`}}});function Xv(e){let t=(0,ro.c)(9),n,r,i,a;if(t[0]!==e){let{className:o,variant:s,size:c,render:l,...u}=e;n=l;let d={className:JT(Yv({className:o,size:c,variant:s})),"data-slot":`badge`};a=Jv,r=`span`,i=Xc(d,u),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a}else n=t[1],r=t[2],i=t[3],a=t[4];let o;return t[5]!==n||t[6]!==r||t[7]!==i?(o={defaultTagName:r,props:i,render:n},t[5]=n,t[6]=r,t[7]=i,t[8]=o):o=t[8],a(o)}var Zv=V.createContext(void 0);function Qv(){let e=V.useContext(Zv);if(e===void 0)throw Error(Ec(63));return e}var $v=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}({}),ey={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ty={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},ny={disabled:!1,...ty},ry={valid(e){return e===null?null:e?{[$v.valid]:``}:{[$v.invalid]:``}}},iy=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}({}),ay={...ry,checked(e){return e?{[iy.checked]:``}:{[iy.unchecked]:``}}},oy={invalid:void 0,name:void 0,validityData:{state:ey,errors:[],error:``,value:``,initialValue:null},setValidityData:Uc,disabled:void 0,touched:ty.touched,setTouched:Uc,dirty:ty.dirty,setDirty:Uc,filled:ty.filled,setFilled:Uc,focused:ty.focused,setFocused:Uc,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:ny,markedDirtyRef:{current:!1},registerFieldControl:Uc,validation:{getValidationProps:(e=Gc)=>e,getInputValidationProps:(e=Gc)=>e,inputRef:{current:null},commit:async()=>{}}},sy=V.createContext(oy);function cy(e=!0){let t=V.useContext(sy);if(t.setValidityData===Uc&&!e)throw Error(Ec(28));return t}function ly(e,t,n,r,i=!0){let{registerFieldControl:a}=cy(),o=V.useRef(null);o.current||=Symbol(),J(()=>{let s=o.current;if(!(!s||!i))return a(s,{controlRef:e,getValue:r,id:t,value:n}),()=>{a(s,void 0)}},[e,i,r,t,a,n])}var uy=V.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Uc,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function dy(){return V.useContext(uy)}var fy=V.createContext({controlId:void 0,registerControlId:Uc,labelId:void 0,setLabelId:Uc,messageIds:[],setMessageIds:Uc,getDescriptionProps:e=>e});function py(){return V.useContext(fy)}function my(e,t,n,r=!0,i){let[a,o]=V.useState(),s=_d(i?`${i}-label`:void 0),c=e??t??a;return J(()=>{let i=e||t||!r?void 0:hy(n.current,s);a!==i&&o(i)}),c}function hy(e,t){let n=gy(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function gy(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function _y(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=py(),o=_d(t),s=n?i:void 0,c=Mc(()=>Symbol(`labelable-control`)),l=V.useRef(!1),u=V.useRef(t!=null),d=q(()=>{!l.current||a===Uc||(l.current=!1,a(c.current,void 0))});return J(()=>{if(a===Uc)return;let e;if(n){let n=r?.current;e=K(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),V.useEffect(()=>d,[d]),i??o}var vy=V.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...y}=e,{clearErrors:b}=dy(),{state:x,setTouched:S,setDirty:C,validityData:w,setFilled:T,setFocused:E,shouldValidateOnChange:D,validationMode:O,disabled:k,name:A,validation:j}=cy(),{labelId:M}=py(),N=k||m,P=A??l,F=V.useRef(null),I=Nc(F,c,j.inputRef),ee=V.useRef(null),te=_d(),ne=_y({id:s,implicit:!1,controlRef:ee}),re=u?void 0:ne,[L,ie]=cu({controlled:n,default:!!i,name:`Switch`,state:`checked`});ly(ee,te,L),J(()=>{F.current&&T(F.current.checked)},[F,T]),uv(L,()=>{b(P),C(L!==w.initialValue),T(L),D()?j.commit(L):j.commit(L,!0)});let{getButtonProps:ae,buttonRef:R}=Uu({disabled:N,native:u}),z=my(a,M,F,!u,re),oe={id:u?ne:te,role:`switch`,"aria-checked":L,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":z,onFocus(){N||E(!0)},onBlur(){let e=F.current;!e||N||(S(!0),E(!1),O===`onBlur`&&j.commit(e.checked))},onClick(e){if(f||N)return;e.preventDefault();let t=F.current;t&&t.dispatchEvent(new(pu(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},se=Xc({checked:L,disabled:N,form:o,id:re,name:P,required:p,style:P?xf:bf,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:I,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=bd(Fl,e.nativeEvent);d?.(t,n),!n.isCanceled&&ie(t)},onFocus(){ee.current?.focus()}},j.getInputValidationProps,_===void 0?Gc:{value:_}),ce=V.useMemo(()=>({...x,checked:L,disabled:N,readOnly:f,required:p}),[x,L,N,f,p]),le=ul(`span`,e,{state:ce,ref:[t,ee,R],props:[oe,j.getValidationProps,y,ae],stateAttributesMapping:ay});return(0,H.jsxs)(Zv.Provider,{value:ce,children:[le,!L&&P&&g!==void 0&&(0,H.jsx)(`input`,{type:`hidden`,form:o,name:P,value:g}),(0,H.jsx)(`input`,{...se,suppressHydrationWarning:!0})]})}),yy=V.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return ul(`span`,e,{state:Qv(),ref:t,stateAttributesMapping:ay,props:a})});function by(e){let t=(0,ro.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=JT(`inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 cursor-pointer items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200 [--thumb-size:--spacing(5)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-brand-ink data-unchecked:bg-strong-line data-disabled:cursor-not-allowed data-disabled:opacity-64 sm:[--thumb-size:--spacing(4)]`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,H.jsx)(yy,{className:JT(`pointer-events-none block aspect-square h-full origin-left in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:scale-x-110 in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.1)] rounded-(--thumb-size) bg-white shadow-[0_1px_3px_rgb(0_0_0/12%)] will-change-transform [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s] data-checked:origin-[var(--thumb-size)_50%] data-checked:translate-x-[calc(var(--thumb-size)-4px)]`),"data-slot":`switch-thumb`}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,H.jsx)(vy,{className:i,"data-slot":`switch`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function xy(e){let t=(0,ro.c)(38),{options:n,value:r,disabled:i,onValueChange:a}=e,o=(0,V.useId)(),s;if(t[0]!==n||t[1]!==r){let e;t[3]===r?e=t[4]:(e=e=>e.id===r,t[3]=r,t[4]=e),s=n.findIndex(e),t[0]=n,t[1]=r,t[2]=s}else s=t[2];let c=Math.max(0,s),l=n.length>1?c/(n.length-1):0,u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,H.jsx)(Ia,{className:`size-4 text-muted-foreground`}),t[5]=u):u=t[5];let d;t[6]===o?d=t[7]:(d=(0,H.jsxs)(`label`,{htmlFor:o,className:`flex items-center gap-2 text-xs font-medium text-foreground`,children:[u,`Effort`]}),t[6]=o,t[7]=d);let f=n[c]?.label,p;t[8]!==o||t[9]!==f?(p=(0,H.jsx)(`output`,{htmlFor:o,className:`text-xs font-medium capitalize text-muted-foreground`,children:f}),t[8]=o,t[9]=f,t[10]=p):p=t[10];let m;t[11]!==d||t[12]!==p?(m=(0,H.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[d,p]}),t[11]=d,t[12]=p,t[13]=m):m=t[13];let h=n[c]?.label,g=Math.max(0,n.length-1),_=i||n.length<2,v=`${l*100}%`,y=`${.5-l}rem`,b;t[14]!==v||t[15]!==y?(b={"--settings-slider-progress":v,"--settings-slider-fill-offset":y},t[14]=v,t[15]=y,t[16]=b):b=t[16];let x=b,S;t[17]!==a||t[18]!==n?(S=e=>{let t=n[Number(e.currentTarget.value)];t&&a(t.id)},t[17]=a,t[18]=n,t[19]=S):S=t[19];let C;t[20]!==o||t[21]!==c||t[22]!==x||t[23]!==S||t[24]!==h||t[25]!==g||t[26]!==_?(C=(0,H.jsx)(`input`,{id:o,"aria-label":`Model effort`,"aria-valuetext":h,className:`settings-slider w-full disabled:opacity-50`,type:`range`,min:0,max:g,step:1,value:c,disabled:_,style:x,onChange:S,onKeyDown:Cy}),t[20]=o,t[21]=c,t[22]=x,t[23]=S,t[24]=h,t[25]=g,t[26]=_,t[27]=C):C=t[27];let w;t[28]===n?w=t[29]:(w=n.length<=3?n:[n[0],n[n.length-1]],t[28]=n,t[29]=w);let T;t[30]===w?T=t[31]:(T=w.map(Sy),t[30]=w,t[31]=T);let E;t[32]===T?E=t[33]:(E=(0,H.jsx)(`div`,{"aria-hidden":!0,className:`mt-0.5 flex justify-between text-[10px] capitalize text-muted-foreground/70`,children:T}),t[32]=T,t[33]=E);let D;return t[34]!==C||t[35]!==E||t[36]!==m?(D=(0,H.jsxs)(`div`,{children:[m,C,E]}),t[34]=C,t[35]=E,t[36]=m,t[37]=D):D=t[37],D}function Sy(e){return e?(0,H.jsx)(`span`,{children:e.label},e.id):null}function Cy(e){e.key!==`Escape`&&e.stopPropagation()}var wy=vo(`[--control-icon-color:currentColor] [&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-full border border-transparent font-[550] text-base outline-none transition-[background-color,border-color,color,box-shadow,transform] duration-150 pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background not-disabled:active:scale-[0.98] disabled:pointer-events-none disabled:opacity-42 sm:text-sm [&_svg:not([class*='text-'])]:text-[var(--control-icon-color)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{compact:`h-7 gap-1 px-[calc(--spacing(2.5)-1px)] text-xs [&_svg:not([class*='size-'])]:size-3.5`,default:`h-9 px-[calc(--spacing(3.5)-1px)] sm:h-8`,icon:`size-9 sm:size-8`,"icon-lg":`size-10 sm:size-9`,"icon-micro":`size-5 p-0 [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 sm:size-7`,"icon-xl":`size-11 sm:size-10 [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5`,"icon-xs":`size-7 sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-3.5`,lg:`h-10 px-[calc(--spacing(4)-1px)] sm:h-9`,micro:`h-5 gap-1 px-[calc(--spacing(2)-1px)] text-[11px] sm:text-[11px] [&_svg:not([class*='size-'])]:size-3 sm:[&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 px-[calc(--spacing(3)-1px)] sm:h-7`,xl:`h-11 px-[calc(--spacing(4.5)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5`,xs:`h-7 gap-1 px-[calc(--spacing(2.5)-1px)] text-sm sm:h-6 sm:text-xs [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5`},variant:{default:`border-primary bg-primary text-primary-foreground [:hover,[data-pressed]]:border-[var(--primary-hover)] [:hover,[data-pressed]]:bg-[var(--primary-hover)]`,destructive:`border-destructive bg-destructive text-white [:hover,[data-pressed]]:bg-destructive/90`,"destructive-outline":`border-input bg-transparent text-destructive-foreground [:hover,[data-pressed]]:border-destructive/40 [:hover,[data-pressed]]:bg-destructive/6`,ghost:`[--control-icon-color:var(--contrast-muted-foreground)] border-transparent text-body data-pressed:bg-accent [:hover,[data-pressed]]:bg-accent [:hover,[data-pressed]]:text-foreground`,"ghost-muted":`[--control-icon-color:var(--contrast-muted-foreground)] border-transparent text-muted-foreground data-pressed:bg-accent [:hover,[data-pressed]]:bg-accent [:hover,[data-pressed]]:text-foreground`,glass:`surface-glass [--control-icon-color:var(--contrast-muted-foreground)] border-transparent text-foreground shadow-glass [:hover,[data-pressed]]:bg-card`,link:`border-transparent underline-offset-4 [:hover,[data-pressed]]:underline`,outline:`[--control-icon-color:var(--contrast-muted-foreground)] border-input bg-transparent text-body [:hover,[data-pressed]]:bg-accent [:hover,[data-pressed]]:text-foreground`,secondary:`border-transparent bg-secondary text-secondary-foreground [:hover,[data-pressed]]:bg-[color-mix(in_srgb,var(--secondary),var(--foreground)_5%)]`}}});function Ty(e){let t=(0,ro.c)(9),n,r,i,a;if(t[0]!==e){let{className:o,variant:s,size:c,render:l,...u}=e;n=l;let d=n?void 0:`button`,f={className:JT(wy({className:o,size:c,variant:s})),"data-slot":`button`,type:d};a=Jv,r=`button`,i=Xc(f,u),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a}else n=t[1],r=t[2],i=t[3],a=t[4];let o;return t[5]!==n||t[6]!==r||t[7]!==i?(o={defaultTagName:r,props:i,render:n},t[5]=n,t[6]=r,t[7]=i,t[8]=o):o=t[8],a(o)}var Ey=`h-7 min-h-7 gap-1.5 rounded-[var(--control-radius)] px-2.5 text-secondary-label transition-none hover:text-foreground [&_svg[data-composer-control-icon]]:mx-0 [&_svg[data-composer-control-chevron]]:-mx-0.5`;function Dy(e){let t=(0,ro.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,size:i,variant:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`sm`:i,s=a===void 0?`ghost`:a,c;t[5]===n?c=t[6]:(c=JT(Ey,n),t[5]=n,t[6]=c);let l;return t[7]!==r||t[8]!==o||t[9]!==c||t[10]!==s?(l=(0,H.jsx)(Ty,{className:c,size:o,variant:s,...r}),t[7]=r,t[8]=o,t[9]=c,t[10]=s,t[11]=l):l=t[11],l}function Oy(e){let t=(0,ro.c)(6),{icon:n,className:r,opticalSize:i}=e,a=(i===void 0?`default`:i)===`large`?`size-4.5`:`size-4`,o;t[0]!==r||t[1]!==a?(o=JT(`shrink-0`,a,r),t[0]=r,t[1]=a,t[2]=o):o=t[2];let s;return t[3]!==n||t[4]!==o?(s=(0,H.jsx)(n,{"aria-hidden":`true`,className:o,"data-composer-control-icon":!0}),t[3]=n,t[4]=o,t[5]=s):s=t[5],s}function ky(e){let t=(0,ro.c)(6),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{className:r}=n,i;t[2]===r?i=t[3]:(i=JT(`-mx-0.5 size-3.5 shrink-0 text-icon-muted`,r),t[2]=r,t[3]=i);let a;return t[4]===i?a=t[5]:(a=(0,H.jsx)(ga,{"aria-hidden":`true`,className:i,"data-composer-control-chevron":!0,weight:`bold`}),t[4]=i,t[5]=a),a}function Ay(e){let t=(0,ro.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=JT(`min-w-0 shrink gap-1.5 font-medium text-secondary-label transition-none [&_svg[data-composer-control-chevron]]:size-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,H.jsx)(Ty,{variant:`ghost`,size:`xs`,"data-composer-context-control":!0,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function jy(e){let t=(0,ro.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,H.jsx)(`span`,{"data-composer-label":!0,className:`min-w-0 max-w-[240px] group-data-[compact]/composer-context:max-w-0`,children:(0,H.jsx)(`span`,{"data-composer-label-motion":!0,className:`block w-full min-w-0 max-w-[240px] origin-left truncate transition-[opacity,transform] duration-180 ease-[cubic-bezier(0.32,0.72,0,1)] group-data-[compact]/composer-context:[transform:translateX(-0.25rem)_scaleX(0.95)] group-data-[compact]/composer-context:opacity-0 motion-reduce:transform-none motion-reduce:transition-opacity`,children:n})}),t[0]=n,t[1]=r),r}var My={agent:`Agent`,effort:`Effort`,reasoningEffort:`Reasoning effort`,variant:`Variant`};function Ny(e){return My[e]??e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase())}function Py(e){return(e??[]).map(e=>typeof e.value==`boolean`?{id:e.id,label:Ny(e.id),type:`boolean`,currentValue:e.value}:{id:e.id,label:Ny(e.id),type:`select`,options:[{id:e.value,label:e.value}],currentValue:e.value})}var Fy=`Ultrathink:
|
|
5
|
+
`;function Iy(){let e=(0,ro.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,H.jsx)(Xv,{variant:`outline`,className:`inline-flex h-4 w-fit min-w-0 items-center justify-center gap-0 border-border/70 bg-muted/60 px-1.5 py-0 font-semibold text-[10px] text-muted-foreground leading-none sm:h-4`,children:`Default`}),e[0]=t):t=e[0],t}function Ly(e,t,n){return e.map(e=>e.id===t?e.type===`boolean`?{...e,...typeof n==`boolean`?{currentValue:n}:{}}:{...e,...typeof n==`string`?{currentValue:n}:{}}:e)}function Ry(e){if(!e)return null;let t=rc(e);return typeof t==`string`?t:null}function zy(e,t,n,r,i,a){let o=Cc(t,n,e),s=e===`searchatlasGateway`&&!t.some(t=>t.slug===n||t.slug===sc(n,e)),c=s?Py(i):nc({caps:o,selections:i}),l=c.filter(e=>e.type===`select`),u=c.filter(e=>e.type===`boolean`),d=l[0]??null,f=l.find(e=>e.id===`contextWindow`)??null,p=u.find(e=>e.id===`fastMode`)??null,m=u.find(e=>e.id===`thinking`)??null,h=a&&(d?.promptInjectedValues?.length??0)>0&&oc(r),g=h&&oc(r.replace(/^Ultrathink:\s*/i,``));return{caps:o,descriptors:c,selectDescriptors:l,booleanDescriptors:u,primarySelectDescriptor:d,contextWindowDescriptor:f,fastModeDescriptor:p,thinkingDescriptor:m,effort:(h?`ultrathink`:Ry(d))??null,thinkingEnabled:typeof m?.currentValue==`boolean`?m.currentValue:null,contextWindow:Ry(f),ultrathinkPromptControlled:h,ultrathinkInBodyText:g,modelIsUnavailable:s}}function By(e){let t=zy(e.provider,e.models,e.model,e.prompt,e.modelOptions,e.allowPromptInjectedEffort??!0),n=t.primarySelectDescriptor!==null,r=t.thinkingDescriptor!==null,i=t.fastModeDescriptor!==null,a=t.contextWindowDescriptor!==null;return{...t,showEffort:n,showThinking:r,showFastMode:i,showContextWindow:a,hasAnyControls:n||r||i||a||t.modelIsUnavailable&&t.descriptors.length>0}}function Vy(e){return By(e).hasAnyControls}var Hy=(0,V.memo)(function(e){let t=(0,ro.c)(34),n,r,i,a,o,s,c,l,u,d;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10]):({provider:l,instanceId:n,models:a,model:r,prompt:c,onPromptChange:o,modelOptions:i,allowPromptInjectedEffort:u,presentation:d,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=d);let f=u===void 0?!0:u,p=d===void 0?`menu`:d,m=NT(Gy),h;t[11]!==n||t[12]!==r||t[13]!==s||t[14]!==l||t[15]!==m?(h=e=>{if(`onModelOptionsChange`in s){s.onModelOptionsChange(e);return}let t=s.threadRef??s.draftId;t&&m(t,l,e,{...n?{instanceId:n}:{},model:r,persistSticky:!0})},t[11]=n,t[12]=r,t[13]=s,t[14]=l,t[15]=m,t[16]=h):h=t[16];let g=h,_,v,y;if(t[17]!==f||t[18]!==r||t[19]!==i||t[20]!==a||t[21]!==o||t[22]!==p||t[23]!==c||t[24]!==l||t[25]!==g){y=Symbol.for(`react.early_return_sentinel`);bb0:{let{descriptors:e,selectDescriptors:n,booleanDescriptors:s,primarySelectDescriptor:u,ultrathinkPromptControlled:d,ultrathinkInBodyText:m,hasAnyControls:h,modelIsUnavailable:b}=By({provider:l,models:a,model:r,prompt:c,modelOptions:i,allowPromptInjectedEffort:f}),x;t[29]===g?x=t[30]:(x=e=>{g(ac(e))},t[29]=g,t[30]=x);let S=x,C=(t,n)=>{if(n){if(t.promptInjectedValues?.includes(n)){let e=c.trim().length===0?Fy:gc(c,`ultrathink`);o(e);return}if(!(m&&t.id===u?.id)){if(d&&t.id===u?.id){let e=c.replace(/^Ultrathink:\s*/i,``);o(e)}S(Ly(e,t.id,n))}}};if(!h){y=null;break bb0}if(p===`panel`){let t=n.filter(Ky);if(t.length===0&&s.length===0){y=null;break bb0}y=(0,H.jsxs)(`div`,{className:`space-y-3 border-t border-border/70 bg-popover px-3 py-3`,onKeyDown:qy,children:[t.map(e=>{let t=d&&e.id===u?.id?`ultrathink`:Ry(e)??``,n=m&&e.id===u?.id;return(0,H.jsxs)(`div`,{children:[e.id===`effort`||e.id===`reasoningEffort`?(0,H.jsx)(xy,{options:e.options,value:t,disabled:b||n,onValueChange:t=>C(e,t)}):(0,H.jsxs)(`label`,{className:`flex items-center justify-between gap-3 text-xs text-muted-foreground`,children:[e.label,(0,H.jsx)(`select`,{"aria-label":e.label,value:t,disabled:b||n,className:`h-7 min-w-0 max-w-44 rounded-sm border border-border bg-popover px-2 text-xs text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring`,onChange:t=>C(e,t.currentTarget.value),children:e.options.map(Jy)})]}),n?(0,H.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Remove “ultrathink” from your prompt to change effort.`}):null]},e.id)}),s.map(t=>(0,H.jsxs)(`label`,{className:`flex items-center justify-between gap-3 text-xs text-muted-foreground`,children:[t.label,(0,H.jsx)(by,{"aria-label":t.label,checked:t.currentValue===!0,disabled:b,onCheckedChange:n=>S(Ly(e,t.id,n))})]},t.id))]});break bb0}if(b){y=(0,H.jsx)(H.Fragment,{children:e.map(Yy)});break bb0}_=n.map((e,t)=>{let n=d&&e.id===u?.id?`ultrathink`:Ry(e)??``;return(0,H.jsxs)(`div`,{children:[t>0?(0,H.jsx)(Uv,{}):null,(0,H.jsxs)(Lv,{children:[(0,H.jsx)(`div`,{className:`px-2 pt-1.5 pb-1 font-medium text-muted-foreground text-xs`,children:e.label}),m&&e.id===u?.id?(0,H.jsx)(`div`,{className:`px-2 pb-1.5 text-muted-foreground/80 text-xs`,children:`Your prompt contains "ultrathink" in the text. Remove it to change this option.`}):null,(0,H.jsx)(Bv,{value:n,onValueChange:t=>C(e,t),children:e.options.map(t=>(0,H.jsx)(Vv,{value:t.id,hideIndicator:!0,closeOnClick:!0,disabled:m&&e.id===u?.id,children:(0,H.jsxs)(`span`,{className:`flex w-full min-w-0 flex-col`,children:[(0,H.jsx)(`span`,{className:`flex w-full min-w-0 items-center justify-between gap-3`,children:(0,H.jsxs)(`span`,{className:`min-w-0 truncate`,children:[t.label,t.isDefault?(0,H.jsxs)(H.Fragment,{children:[` `,(0,H.jsx)(Iy,{})]}):null]})}),t.description?(0,H.jsx)(`span`,{className:`max-w-56 text-pretty text-muted-foreground/80 text-xs`,children:t.description}):null]})},t.id))})]})]},e.id)}),v=s.map((t,r)=>{let i=t.currentValue===!0?`on`:`off`;return(0,H.jsxs)(`div`,{children:[r>0||n.length>0?(0,H.jsx)(Uv,{}):null,(0,H.jsxs)(Lv,{children:[(0,H.jsx)(`div`,{className:`px-2 py-1.5 font-medium text-muted-foreground text-xs`,children:t.label}),(0,H.jsx)(Bv,{value:i,onValueChange:n=>{S(Ly(e,t.id,n===`on`))},children:[`on`,`off`].map(Xy)})]})]},t.id)})}t[17]=f,t[18]=r,t[19]=i,t[20]=a,t[21]=o,t[22]=p,t[23]=c,t[24]=l,t[25]=g,t[26]=_,t[27]=v,t[28]=y}else _=t[26],v=t[27],y=t[28];if(y!==Symbol.for(`react.early_return_sentinel`))return y;let b;return t[31]!==_||t[32]!==v?(b=(0,H.jsxs)(H.Fragment,{children:[_,v]}),t[31]=_,t[32]=v,t[33]=b):b=t[33],b});function Uy(e){let t=(0,ro.c)(2),n;return t[0]===e?n=t[1]:(n=(0,H.jsx)(Hy,{...e,presentation:`panel`}),t[0]=e,t[1]=n),n}function Wy(e){let t=null,n=!1,r=[];for(let i of e.descriptors){if(i.id===`fastMode`&&i.type===`boolean`){n=i.currentValue===!0,t=n?`Fast`:`Normal`;continue}let a=e.ultrathinkPromptControlled&&i.id===e.primarySelectDescriptorId?`Ultrathink`:i.type===`boolean`?`${i.label} ${i.currentValue===!0?`On`:`Off`}`:ic(i);typeof a==`string`&&a.length>0&&r.push(a)}return r.length===0&&t!==null?{label:t,showFastModeIcon:!1}:{label:r.join(` · `),showFastModeIcon:n}}(0,V.memo)(function(e){let t=(0,ro.c)(51),n,r,i,a,o,s,c,l,u,d,f;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11]):({provider:l,instanceId:n,models:a,model:r,prompt:c,onPromptChange:o,modelOptions:i,allowPromptInjectedEffort:u,triggerVariant:f,triggerClassName:d,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=f);let p=u===void 0?!0:u,[m,h]=(0,V.useState)(!1),g,_;if(t[12]!==p||t[13]!==r||t[14]!==i||t[15]!==a||t[16]!==c||t[17]!==l){_=Symbol.for(`react.early_return_sentinel`);bb0:{let{descriptors:e,primarySelectDescriptor:t,ultrathinkPromptControlled:n}=By({provider:l,models:a,model:r,prompt:c,modelOptions:i,allowPromptInjectedEffort:p});if(!Vy({provider:l,models:a,model:r,prompt:c,modelOptions:i,allowPromptInjectedEffort:p})){_=null;break bb0}g=Wy({provider:l,descriptors:e,primarySelectDescriptorId:t?.id??null,ultrathinkPromptControlled:n})}t[12]=p,t[13]=r,t[14]=i,t[15]=a,t[16]=c,t[17]=l,t[18]=g,t[19]=_}else g=t[18],_=t[19];if(_!==Symbol.for(`react.early_return_sentinel`))return _;let{label:v,showFastModeIcon:y}=g,b;t[20]===y?b=t[21]:(b=y?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Oy,{icon:Ka,className:`fill-current text-foreground opacity-80`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Fast mode on`})]}):null,t[20]=y,t[21]=b);let x=b,S;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{h(e)},t[22]=S):S=t[22];let C=f??`ghost`,w;t[23]===d?w=t[24]:(w=JT(`shrink-0 whitespace-nowrap`,d),t[23]=d,t[24]=w);let T;t[25]!==C||t[26]!==w?(T=(0,H.jsx)(Dy,{variant:C,className:w}),t[25]=C,t[26]=w,t[27]=T):T=t[27];let E;t[28]===v?E=t[29]:(E=(0,H.jsx)(`span`,{children:v}),t[28]=v,t[29]=E);let D;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,H.jsx)(ky,{}),t[30]=D):D=t[30];let O;t[31]!==x||t[32]!==T||t[33]!==E?(O=(0,H.jsxs)(Pv,{render:T,children:[x,E,D]}),t[31]=x,t[32]=T,t[33]=E,t[34]=O):O=t[34];let k;t[35]===n?k=t[36]:(k=n?{instanceId:n}:{},t[35]=n,t[36]=k);let A;t[37]!==p||t[38]!==r||t[39]!==i||t[40]!==a||t[41]!==o||t[42]!==s||t[43]!==c||t[44]!==l||t[45]!==k?(A=(0,H.jsx)(Fv,{align:`start`,children:(0,H.jsx)(Hy,{provider:l,...k,models:a,model:r,prompt:c,onPromptChange:o,modelOptions:i,allowPromptInjectedEffort:p,...s})}),t[37]=p,t[38]=r,t[39]=i,t[40]=a,t[41]=o,t[42]=s,t[43]=c,t[44]=l,t[45]=k,t[46]=A):A=t[46];let j;return t[47]!==m||t[48]!==O||t[49]!==A?(j=(0,H.jsxs)(Nv,{open:m,onOpenChange:S,children:[O,A]}),t[47]=m,t[48]=O,t[49]=A,t[50]=j):j=t[50],j});function Gy(e){return e.setProviderModelOptions}function Ky(e){return e.id!==`contextWindow`&&e.id!==`serviceTier`}function qy(e){e.key!==`Escape`&&e.stopPropagation()}function Jy(e){return(0,H.jsx)(`option`,{value:e.id,children:e.label},e.id)}function Yy(e,t){let n=ic(e);return n?(0,H.jsxs)(`div`,{children:[t>0?(0,H.jsx)(Uv,{}):null,(0,H.jsxs)(Lv,{children:[(0,H.jsx)(`div`,{className:`px-2 pt-1.5 pb-1 font-medium text-muted-foreground text-xs`,children:e.label}),(0,H.jsx)(`div`,{className:`px-2 pb-1.5 text-muted-foreground/80 text-xs`,children:n})]})]},e.id):null}function Xy(e){return(0,H.jsx)(Vv,{value:e,hideIndicator:!0,closeOnClick:!0,children:(0,H.jsx)(`span`,{className:`flex w-full min-w-0 items-center justify-between gap-3`,children:(0,H.jsx)(`span`,{children:e===`on`?`On`:`Off`})})},e)}function Zy(e){return oc(e)?`ultrathink`:`none`}function Qy(e){let{provider:t,model:n,models:r,modelOptions:i,promptInjectionState:a=`none`}=e;if(t===`searchatlasGateway`){let e=sc(n,t);if(!r.some(t=>t.slug===n||t.slug===e))return{provider:t,promptEffort:null,modelOptionsForDispatch:i&&i.length>0?i:void 0}}let o=nc({caps:Cc(r,n,t),selections:i}),s=o.find(e=>e.type===`select`),c=rc(s??null),l=typeof c==`string`?c:null,u=(s?.promptInjectedValues?.length??0)>0&&a===`ultrathink`;return{provider:t,promptEffort:l,modelOptionsForDispatch:ac(o),...u?{composerFrameClassName:`ultrathink-frame`,composerSurfaceClassName:`shadow-[0_0_0_1px_rgba(255,255,255,0.07)_inset]`,modelPickerIconClassName:`ultrathink-chroma`}:{}}}function $y(e,t){let{provider:n,instanceId:r,threadRef:i,draftId:a,model:o,models:s,modelOptions:c,prompt:l,onPromptChange:u}=t;return!(i!==void 0||a!==void 0)||!Vy({provider:n,models:s,model:o,modelOptions:c,prompt:l})?null:(0,H.jsx)(e,{provider:n,...r?{instanceId:r}:{},models:s,...i?{threadRef:i}:{},...a?{draftId:a}:{},model:o,modelOptions:c,prompt:l,onPromptChange:u})}function eb(e){return $y(Uy,e)}var tb={instanceId:qn.make(`borgcode_no_provider`),model:``};function nb(e){return e.enabled&&e.isAvailable&&e.status===`ready`}function rb(e){return e.enabled}function ib(e){let t=[];for(let n of e.replace(/[_-]+/g,` `).replace(/([a-z])([A-Z])/g,`$1 $2`).split(` `))n.length!==0&&t.push(n.charAt(0).toUpperCase()+n.slice(1));return t.join(` `)}function ab(e){return Cn[e]??yc(e)}function ob(e,t){if(e.accentColor)return!0;let n=0;for(let r of t)if(r.driverKind===e.driverKind&&++n>1)return!0;return!1}function sb(e){let t=e?.trim();if(t)return/^#[0-9a-fA-F]{6}$/u.test(t)?t:void 0}function cb(e,t,n,r){let i=e.displayName?.trim(),a=ab(n);if(i&&i!==a)return i;if(!r){let e=ib(t);if(e.length>0)return e}return i||a}function lb(e){return e.map(e=>{let t=e.instanceId,n=e.driver,r=t===d(n);return{instanceId:t,driverKind:n,displayName:cb(e,t,n,r),accentColor:sb(e.accentColor),continuationGroupKey:e.continuation?.groupKey,enabled:e.enabled,installed:e.installed,status:e.status,isDefault:r,isAvailable:e.availability!==`unavailable`,snapshot:e,models:e.models}})}function ub(e){let t=new Map;for(let[n,r]of e)t.set(n,new Map(lb(r).map(e=>[e.instanceId,e])));return t}function db(e,t){let n=t.providers;return e.map(e=>{let r=t.providerInstances?.[e.instanceId],i=r?ae(r):e.isDefault?n[e.driverKind]?.enabled??e.enabled:!1;return i===e.enabled?e:{...e,enabled:i}})}function fb(e){let t=new Map;for(let n of e){let e=t.get(n.driverKind);e?e.push(n):t.set(n.driverKind,[n])}let n=[],r=[...t.keys()].sort((e,t)=>Number(t===`searchatlasGateway`)-Number(e===`searchatlasGateway`));for(let e of r){let r=t.get(e),i=r.filter(e=>e.isDefault),a=r.filter(e=>!e.isDefault);n.push(...i,...a)}return n}function pb(e,t){return lb(e).find(e=>e.instanceId===t)}function mb(e,t){let n=pb(e,t);if(n)return lc(n.driverKind,n.models)??rt[n.driverKind]}var hb=e=>e.enabled&&e.isAvailable;function gb(e,t){if(t!==void 0){let n=e.find(e=>e.instanceId===t);if(n&&hb(n))return n}return e.find(nb)??e.find(e=>hb(e)&&e.status!==`error`)}function _b(e,t){return gb(lb(e),t)?.instanceId}function vb(e,t){let n=_b(e,t?.instanceId);if(n===void 0)return null;if(t?.instanceId===n)return t;let r=mb(e,n);return r?{instanceId:n,model:r}:null}function yb(e,t,n){let r=e.find(e=>e.instanceId===n);if(r)return r.driverKind}function bb(e,t){let n=Number(t.driverKind===`searchatlasGateway`)-Number(e.driverKind===`searchatlasGateway`)||Number(t.slug===`auto`)-Number(e.slug===`auto`)||Number(t.badge===`fusion`)-Number(e.badge===`fusion`);return n<0?-1:+(n>0)}function xb(e,t){return`${e}:${t}`}function Sb(e){return new Map(Kt(e,(e,t)=>[e,t]))}function Cb(e){return e instanceof Set?e:new Set(e??[])}function wb(e){return we(se,t=>e(t)??1/0)}function Tb(e){return we(nt(j),e)}function Eb(e,t){let n=t?.modelOrder??[],r=Cb(t?.favoriteModels),i=Sb(n),a=Sb(Kt(e,e=>e.slug));return pn(e,Ye([Tb(e=>e.slug===`auto`&&!i.has(e.slug)),Tb(e=>e.badge===`fusion`&&!i.has(e.slug)),...t?.groupFavorites===!0?[Tb(e=>r.has(e.slug))]:[],wb(e=>i.get(e.slug)),wb(e=>a.get(e.slug))]))}function Db(e,t){let n=Cb(t?.favoriteModelKeys),r=new Map(Kt(t?.instanceOrder??[],(e,t)=>[e,t])),i=Sb(Kt(e,e=>xb(e.instanceId,e.slug)));return pn(e,Ye([bb,...t?.groupFavorites===!0?[Tb(e=>n.has(xb(e.instanceId,e.slug)))]:[],wb(e=>r.get(e.instanceId)),wb(e=>i.get(xb(e.instanceId,e.slug)))]))}var Ob=32,kb=qn.make(`searchatlasGateway`);function Ab(e,t,n){let r=e.providerInstances?.[t]?.config;if(typeof r==`object`&&r){let e=r.customModels;if(Array.isArray(e))return e.filter(e=>typeof e==`string`)}return t===d(n)?e.providers[n]?.customModels??[]:[]}function jb(e,t){return e.unlisted?!1:!e.searchOnly||t.showAllGatewayModels}function Mb(e,t,n,r,i){if(n!==`searchatlasGateway`)return e;let a=cc(r);if(!a||a===`auto`)return e;let o=sc(a,n)??a,s=e=>e===a||e===o;return t.some(e=>s(e.slug))||i.some(s)||e.some(e=>s(e.slug))?e:[...e,{slug:a,name:a,isCustom:!1,isUnavailable:!0}]}function Nb(e){let t={slug:e.slug,name:Gs(e.name),isCustom:e.isCustom};return e.shortName&&(t.shortName=Gs(e.shortName)),e.subProvider&&(t.subProvider=e.subProvider),e.aliases&&(t.aliases=e.aliases),e.badge&&(t.badge=e.badge),e.isDefault&&(t.isDefault=!0),e.isLegacy&&(t.isLegacy=!0),t}function Pb(e,t){return e.providerModelPreferences?.[t]??{hiddenModels:[],modelOrder:[]}}function Fb(e,t){let n=new Set(t.hiddenModels);return Eb(e.filter(e=>e.isCustom||!n.has(e.slug)),{modelOrder:t.modelOrder})}function Ib(e,t){let n=[],r=new Set;for(let i of e){let e=cc(i);if(!(!e||e.length>256||t.has(e)||r.has(e))&&(r.add(e),n.push(e),n.length>=Ob))break}return n}function Lb(e,t,n,r){let i=bc(t,n),a=i.filter(t=>jb(t,e)).map(Nb),o=new Set(a.map(e=>e.slug)),s=new Set(Qe(bc(t,n),e=>e.isCustom?lt:vt(e.slug))),c=d(n),l=Ab(e,c,n);for(let e of Ib(l,s))o.has(e)||(o.add(e),a.push({slug:e,name:e,isCustom:!0}));let u=Pb(e,c);return Mb(Fb(a,u),i,n,r,u.hiddenModels)}function Rb(e,t,n){let r=t.models.filter(t=>jb(t,e)).map(Nb),i=new Set(r.map(e=>e.slug)),a=new Set(Qe(t.models,e=>e.isCustom?lt:vt(e.slug))),o=Ab(e,t.instanceId,t.driverKind);for(let e of Ib(o,a))i.has(e)||(i.add(e),r.push({slug:e,name:e,isCustom:!0}));let s=Pb(e,t.instanceId);return Mb(Fb(r,s),t.models,t.driverKind,n,s.hiddenModels)}function zb(e,t,n,r){let i=Sc(n,e),a=Lb(t,n,i,r);return dc(i,r,a)??lc(i,a,t.favorites.filter(e=>e.provider===d(i)).map(e=>e.model))??wc(n,i)}function Bb(e,t,n,r,i){let a=lb(n).find(t=>t.instanceId===e);if(!a)return null;let o=Rb(t,a,i?.preserveUnavailableSelection?r:null),s=dc(a.driverKind,r,o);if(s)return s;if(i?.preserveUnavailableSelection&&a.driverKind===`searchatlasGateway`){let e=cc(r),n=Pb(t,a.instanceId).hiddenModels,i=a.models.some(n=>n.slug===e&&!jb(n,t));if(e&&e!==`auto`&&!n.includes(e)&&!i)return e}return lc(a.driverKind,o,t.favorites.filter(t=>t.provider===e).map(e=>e.model))??lc(a.driverKind,a.models)??null}function Vb(e,t,n,r){let i=new Map;for(let a of lb(t))i.set(a.instanceId,Rb(e,a,a.instanceId===n?r:null));return i}function Hb(e,t){let n=e.textGenerationModelSelection??{instanceId:kb,model:`searchatlas-gateway/borg-fusion#medium`},r=lb(t),i=r.find(e=>e.instanceId===n.instanceId&&e.enabled&&e.isAvailable),o=i??r.find(e=>e.enabled&&e.isAvailable);if(o){let r=i?n.model:null,s=Bb(o.instanceId,e,t,r)??o.models[0]?.slug??a[o.driverKind];if(!s)return mc(o.instanceId,``,[]);let c=o.driverKind,{modelOptionsForDispatch:l}=Qy({provider:c,model:s,models:o.models,modelOptions:i?n.options:void 0});return mc(o.instanceId,s,l)}let s=Sc(t,null),c=zb(s,e,t,null),{modelOptionsForDispatch:l}=Qy({provider:s,model:c,models:bc(t,s),modelOptions:void 0});return mc(d(s),c,l)}var Ub=new Map([[`avi`,`video/x-msvideo`],[`m4v`,`video/mp4`],[`mkv`,`video/x-matroska`],[`mov`,`video/quicktime`],[`mp4`,`video/mp4`],[`ogv`,`video/ogg`],[`webm`,`video/webm`]]);function Wb(e){let t=e.mimeType.split(`;`,1)[0]?.trim().toLowerCase()??``;if(t.startsWith(`video/`))return t;let n=e.name.lastIndexOf(`.`);return n<0?null:Ub.get(e.name.slice(n+1).toLowerCase())??null}var Gb=`full-access`,Kb=`code`,qb=`term-1`;function Jb(e){return e.type===`image`}function Yb(e){return e.type===`file`}function Xb(e){return Wb(e)!==null}var Zb=4e3,Qb=4e3,$b=24,ex=/\n*<element_context>\n([\s\S]*?)\n<\/element_context>\s*$/;function tx(e,t){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}function nx(e){return e.replace(/\r\n/g,`
|
|
6
|
+
`).replace(/^\n+|\n+$/g,``)}function rx(e){let t=e.pageUrl.trim(),n=e.tagName.trim().toLowerCase();if(t.length===0||n.length===0)return null;let r=e.source??e.stack[0]??null;return{pageUrl:t,pageTitle:e.pageTitle?.trim()??null,tagName:n,selector:e.selector?.trim()||null,htmlPreview:tx(nx(e.htmlPreview),Zb),componentName:e.componentName?.trim()||null,source:r?{functionName:r.functionName?.trim()||null,fileName:r.fileName?.trim()||null,lineNumber:r.lineNumber??null,columnNumber:r.columnNumber??null}:null,styles:tx(nx(e.styles),Qb)}}function ix(e){return[e.pageUrl,e.selector??``,e.tagName,e.componentName??``].join(`|`).toLowerCase()}function ax(e){return e.length<=$b?e:`${e.slice(0,$b-1)}…`}function ox(e){return e.componentName?`<${e.componentName}>`:`<${ax(e.tagName)}>`}function sx(e){let t=e.split(/[\\/]/);return t[t.length-1]??e}function cx(e){let t=e.source;if(!t?.fileName)return null;let n=sx(t.fileName);return t.lineNumber==null?n:`${n}:${t.lineNumber}`}function lx(e){let t=ox(e),n=cx(e);return n?`${t} (${n})`:t}function ux(e){return e.split(`
|
|
7
|
+
`).map(e=>` ${e}`)}function dx(e){let t=[];if(t.push(`- ${lx(e)}:`),e.pageUrl.length>0&&t.push(` url: ${e.pageUrl}`),e.selector&&t.push(` selector: ${e.selector}`),e.source?.fileName){let{fileName:n,lineNumber:r,columnNumber:i}=e.source,a=r==null?n:`${n}:${r}${i==null?``:`:${i}`}`;t.push(` source: ${a}`)}let n=e.htmlPreview.trim();n.length>0&&(t.push(` html:`),t.push(...ux(n)));let r=e.styles.trim();return r.length>0&&(t.push(` styles:`),t.push(...ux(r))),t}function fx(e){if(e.length===0)return``;let t=[];for(let n=0;n<e.length;n+=1){let r=e[n];t.push(...dx(r)),n<e.length-1&&t.push(``)}return[`<element_context>`,...t,`</element_context>`].join(`
|
|
8
|
+
`)}function px(e,t){let n=fx(t);if(n.length===0)return e;let r=e.trim();return r.length>0?`${r}\n\n${n}`:n}var mx=`el_`,hx=0;function gx(){return hx+=1,`${mx}${hx.toString(36)}`}function _x(e){let t=ex.exec(e);if(!t)return{promptText:e,contextCount:0,contexts:[]};let n=e.slice(0,t.index).replace(/\n+$/,``),r=vx(t[1]??``);return{promptText:n,contextCount:r.length,contexts:r}}function vx(e){let t=[],n=null,r=()=>{n&&=(t.push({header:n.header,body:n.bodyLines.join(`
|
|
9
|
+
`).trimEnd()}),null)};for(let t of e.split(`
|
|
10
|
+
`)){let e=/^- (.+):$/.exec(t);if(e){r(),n={header:e[1],bodyLines:[]};continue}n&&(t.startsWith(` `)?n.bodyLines.push(t.slice(2)):t.length===0&&n.bodyLines.push(``))}return r(),t}var yx=/\n*<terminal_context>\n([\s\S]*?)\n<\/terminal_context>\s*$/;function bx(e){return e.replace(/\r\n/g,`
|
|
11
|
+
`).replace(/^\n+|\n+$/g,``)}function xx(e){return bx(e.text).length>0}function Sx(e){return!xx(e)}function Cx(e){return e.filter(e=>xx(e))}function wx(e){let t=bx(e.text),n=e.terminalId.trim(),r=e.terminalLabel.trim();if(t.length===0||n.length===0||r.length===0)return null;let i=Math.max(1,Math.floor(e.lineStart));return{terminalId:n,terminalLabel:r,lineStart:i,lineEnd:Math.max(i,Math.floor(e.lineEnd)),text:t}}function Tx(e){return e.lineStart===e.lineEnd?`line ${e.lineStart}`:`lines ${e.lineStart}-${e.lineEnd}`}function Ex(e){return`${e.terminalLabel} ${Tx(e)}`}function Dx(e){return`@${e.terminalLabel.trim().toLowerCase().replace(/\s+/g,`-`)}:${e.lineStart===e.lineEnd?`${e.lineStart}`:`${e.lineStart}-${e.lineEnd}`}`}function Ox(e){return bx(e.text).split(`
|
|
12
|
+
`).map((t,n)=>` ${e.lineStart+n} | ${t}`)}function kx(e){let t=[];for(let n of e){let e=wx(n);e!==null&&t.push(e)}if(t.length===0)return``;let n=[];for(let e=0;e<t.length;e+=1){let r=t[e];n.push(`- ${Ex(r)}:`),n.push(...Ox(r)),e<t.length-1&&n.push(``)}return[`<terminal_context>`,...n,`</terminal_context>`].join(`
|
|
13
|
+
`)}function Ax(e,t){let n=0,r=``;for(let i of e){if(i!==``){r+=i;continue}let e=t[n]??null;n+=1,e&&(r+=Dx(e))}return r}function jx(e,t){let n=Ax(e,t).trim(),r=kx(t);return r.length===0?n:n.length>0?`${n}\n\n${r}`:r}function Mx(e){let t=yx.exec(e);if(!t)return{promptText:e,contextCount:0,previewTitle:null,contexts:[]};let n=e.slice(0,t.index).replace(/\n+$/,``),r=Px(t[1]??``);return{promptText:n,contextCount:r.length,previewTitle:r.length>0?r.map(({header:e,body:t})=>t.length>0?`${e}\n${t}`:e).join(`
|
|
14
|
+
|
|
15
|
+
`):null,contexts:r}}function Nx(e){let t=_x(e),n=Mx(t.promptText);return{visibleText:n.promptText,copyText:e,contextCount:n.contextCount,previewTitle:n.previewTitle,contexts:n.contexts,elementContexts:t.contexts}}function Px(e){let t=[],n=null,r=()=>{n&&=(t.push({header:n.header,body:n.bodyLines.join(`
|
|
16
|
+
`).trimEnd()}),null)};for(let t of e.split(`
|
|
17
|
+
`)){let e=/^- (.+):$/.exec(t);if(e){r(),n={header:e[1],bodyLines:[]};continue}if(n){if(t.startsWith(` `)){n.bodyLines.push(t.slice(2));continue}t.length===0&&n.bodyLines.push(``)}}return r(),t}function Fx(e){let t=0;for(let n of e)n===``&&(t+=1);return t}function Ix(e,t){let n=t-Fx(e);return n<=0?e:`${``.repeat(n)}${e}`}function Lx(e){return e===void 0||e===` `||e===`
|
|
18
|
+
`||e===` `||e===`\r`}function Rx(e,t){let n=Math.max(0,Math.min(e.length,Math.floor(t))),r=`${Lx(e[n-1])?``:` `} `,i=e[n]===` `?n+1:n;return{prompt:`${e.slice(0,n)}${r}${e.slice(i)}`,cursor:n+r.length,contextIndex:Fx(e.slice(0,n))}}function zx(e){return e.replaceAll(``,``)}function Bx(e,t){if(t<0)return{prompt:e,cursor:e.length};let n=0;for(let r=0;r<e.length;r+=1)if(e[r]===``){if(n===t)return{prompt:e.slice(0,r)+e.slice(r+1),cursor:r};n+=1}return{prompt:e,cursor:e.length}}var Vx=new Map,Hx=new Map,Ux=null;function Wx(e){Ux=e}async function Gx(e){let t=await Ux?.load(e);return t?(Vx.set(e,t.revision),t.body):null}function Kx(e,t){let n=Hx.get(e);n&&clearTimeout(n),Hx.set(e,setTimeout(()=>{Hx.delete(e);let n=Ux;if(!n)return;let r=Vx.get(e)??0;n.save(e,t,r).then(t=>Vx.set(e,t.revision)).catch(()=>{})},500))}var qx=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Jx=(e=>e?qx(e):qx),Yx=e=>e;function Xx(e,t=Yx){let n=V.useSyncExternalStore(e.subscribe,V.useCallback(()=>t(e.getState()),[e,t]),V.useCallback(()=>t(e.getInitialState()),[e,t]));return V.useDebugValue(n),n}var Zx=e=>{let t=Jx(e),n=e=>Xx(t,e);return Object.assign(n,t),n},Qx=(e=>e?Zx(e):Zx);function $x(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var eS=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return eS(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return eS(t)(e)}}}},tS=(e,t)=>(n,r,i)=>{let a={storage:$x(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>(f(e,t),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return eS(u.getItem.bind(u))(a.name).then(e=>{if(e)if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state];return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p},nS=e=>Symbol.iterator in e,rS=e=>`entries`in e,iS=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},aS=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function oS(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:nS(e)&&nS(t)?rS(e)&&rS(t)?iS(e,t):aS(e,t):iS({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function sS(e){let t=V.useRef(void 0);return n=>{let r=e(n);return oS(t.current,r)?t.current:t.current=r}}function cS(e){return typeof e==`function`}function lS(e,...t){return cS(e)?e(...t):e}var uS=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},dS=class extends uS{constructor(e){super({pluginId:`pacer`,debug:e?.debug})}},fS=(e,t)=>{t.key&&pS.emit(e,t)},pS=new dS,mS=new WeakMap,hS=new WeakMap,gS={current:[]},_S=!1,vS=0,yS=new Set,bS=new Map;function xS(e){let t=Array.from(e).sort((e,t)=>e instanceof DS&&e.options.deps.includes(t)?1:t instanceof DS&&t.options.deps.includes(e)?-1:0);for(let e of t){if(gS.current.includes(e))continue;gS.current.push(e),e.recompute();let t=hS.get(e);if(t)for(let e of t){let t=mS.get(e);t&&xS(t)}}}function SS(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function CS(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function wS(e){if(vS>0&&!bS.has(e)&&bS.set(e,e.prevState),yS.add(e),!(vS>0)&&!_S)try{for(_S=!0;yS.size>0;){let e=Array.from(yS);yS.clear();for(let t of e)t.prevState=bS.get(t)??t.prevState,SS(t);for(let t of e){let e=mS.get(t);e&&(gS.current.push(t),xS(e))}for(let t of e){let e=mS.get(t);if(e)for(let t of e)CS(t)}}}finally{_S=!1,gS.current=[],bS.clear()}}function TS(e){return typeof e==`function`}var ES=class{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t;this.listeners.add(e);let n=((t=this.options)?.onSubscribe)?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,n;this.prevState=this.state,this.options?.updateFn?this.state=this.options.updateFn(this.prevState)(e):TS(e)?this.state=e(this.prevState):this.state=e,(n=(t=this.options)?.onUpdate)==null||n.call(t),wS(this)}},DS=class e{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{let e=this.options.deps.length,t=Array(e),n=Array(e);for(let r=0;r<e;r++){let e=this.options.deps[r];t[r]=e.prevState,n[r]=e.state}return this.lastSeenDepValues=n,{prevDepVals:t,currDepVals:n,prevVal:this.prevState??void 0}},this.recompute=()=>{var e,t;this.prevState=this.state;let n=this.getDepVals();this.state=this.options.fn(n),(t=(e=this.options).onUpdate)==null||t.call(e)},this.checkIfRecalculationNeededDeeply=()=>{for(let t of this.options.deps)t instanceof e&&t.checkIfRecalculationNeededDeeply();let t=!1,n=this.lastSeenDepValues,{currDepVals:r}=this.getDepVals();for(let e=0;e<r.length;e++)if(r[e]!==n[e]){t=!0;break}t&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(let e of this._subscriptions)e()}),this.subscribe=e=>{var t;this.listeners.add(e);let n=(t=this.options).onSubscribe?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(let n of t)if(n instanceof e)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof ES){let e=mS.get(n);e||(e=new Set,mS.set(n,e)),e.add(this);let t=hS.get(this);t||(t=new Set,hS.set(this,t)),t.add(n)}}unregisterFromGraph(t=this.options.deps){for(let n of t)if(n instanceof e)this.unregisterFromGraph(n.options.deps);else if(n instanceof ES){let e=mS.get(n);e&&e.delete(this);let t=hS.get(this);t&&t.delete(n)}}};function OS(){return{canLeadingExecute:!0,executionCount:0,isPending:!1,lastArgs:void 0,status:`idle`,maybeExecuteCount:0}}var kS={enabled:!0,leading:!1,trailing:!0,wait:0},AS=class{#e;constructor(e,t){this.fn=e,this.store=new ES(OS()),this.setOptions=e=>{this.options={...this.options,...e},this.#n()||this.cancel()},this.maybeExecute=(...e)=>{if(!this.#n())return;this.#t({maybeExecuteCount:this.store.state.maybeExecuteCount+1});let t=!1;this.options.leading&&this.store.state.canLeadingExecute&&(this.#t({canLeadingExecute:!1}),t=!0,this.#i(...e)),this.options.trailing&&this.#t({isPending:!0,lastArgs:e}),this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{this.#t({canLeadingExecute:!0}),this.options.trailing&&!t&&this.#i(...e)},this.#r())},this.flush=()=>{this.store.state.isPending&&this.store.state.lastArgs&&(this.#a(),this.#i(...this.store.state.lastArgs))},this.cancel=()=>{this.#a(),this.#t({canLeadingExecute:!0,isPending:!1})},this.reset=()=>{this.#t(OS())},this.key=t.key,this.options={...kS,...t},this.#t(this.options.initialState??{}),this.key&&pS.on(`d-Debouncer`,e=>{e.payload.key===this.key&&(this.#t(e.payload.store.state),this.setOptions(e.payload.options))})}#t=e=>{this.store.setState(t=>{let n={...t,...e},{isPending:r}=n;return{...n,status:this.#n()?r?`pending`:`idle`:`disabled`}}),fS(`Debouncer`,this)};#n=()=>!!lS(this.options.enabled,this);#r=()=>lS(this.options.wait,this);#i=(...e)=>{this.#n()&&(this.fn(...e),this.#t({executionCount:this.store.state.executionCount+1,isPending:!1,lastArgs:void 0}),this.options.onExecute?.(e,this))};#a=()=>{this.#e&&=(clearTimeout(this.#e),void 0)}};function jS(){let e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,n)=>{e.set(t,n)},removeItem:t=>{e.delete(t)}}}function MS(e){return e!=null&&typeof e.getItem==`function`&&typeof e.setItem==`function`&&typeof e.removeItem==`function`}function NS(e){return MS(e)?e:jS()}function PS(e,t=300){let n=NS(e),r=new AS((e,t)=>{n.setItem(e,t)},{wait:t});return{getItem:e=>n.getItem(e),setItem:(e,t)=>{r.maybeExecute(e,t)},removeItem:e=>{r.cancel(),n.removeItem(e)},flush:()=>{r.flush()}}}function FS(e){if(e===null)return null;try{let t=JSON.parse(e);return typeof t==`object`&&t&&typeof t.version==`number`&&t.state!==null&&typeof t.state==`object`?t:null}catch{return null}}function IS(e,t){let n=e?.state[t];return typeof n==`object`&&n?n:{}}function LS(e){return JSON.stringify(e,(e,t)=>typeof t==`object`&&t&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>e<t?-1:+(e>t))):t)}function RS(e,t){return e===void 0||t===void 0?e===t:LS(e)===LS(t)}function zS(e){let t=FS(e.ours),n=FS(e.theirs);if(t===null||n===null||n.version!==t.version)return null;let r=FS(e.synced);return{ours:t,theirs:n,synced:r?.version===t.version?r:null}}function BS(e){let t=zS(e);if(t===null)return e.ours;let n={...t.ours.state};for(let r of e.fields){let e=IS(t.ours,r),i=IS(t.theirs,r),a=IS(t.synced,r),o={};for(let t of new Set([...Object.keys(e),...Object.keys(i)])){let n=RS(e[t],a[t])?i[t]:e[t];n!==void 0&&(o[t]=n)}n[r]=o}return JSON.stringify({...t.ours,state:n})}function VS(e){let t=zS(e);if(t===null)return null;let n={},r=!1;for(let i of e.fields){let e=IS(t.ours,i),a=IS(t.theirs,i),o=IS(t.synced,i);for(let t of new Set([...Object.keys(a),...Object.keys(o)]))!RS(a[t],o[t])&&RS(e[t],o[t])&&!RS(e[t],a[t])&&((n[i]??={})[t]=a[t],r=!0)}return r?n:null}function HS(e,t){let n=new Map;return{getItem:t=>{let r=e.getItem(t);return n.set(t,r),r},setItem:(r,i)=>{let a=e.getItem(r),o=BS({synced:n.get(r)??null,ours:i,theirs:a,fields:t});n.set(r,i),o!==a&&e.setItem(r,o)},removeItem:t=>{n.delete(t),e.removeItem(t)},synced:e=>n.get(e)??null,recordOwnEntries:(e,r,i)=>{let a=FS(n.get(e)??null),o=a?.version===r?a:null,s={...o?.state};for(let e of t){let t=i[e];if(typeof t!=`object`||!t)continue;let n={...IS(o,e)};for(let[e,r]of Object.entries(t))r===void 0?delete n[e]:n[e]=r;s[e]=n}n.set(e,JSON.stringify({state:s,version:r}))}}}var US=`local:`;function WS(e){return`${US}${e}`}function GS(e){return e._tag===`BearerConnectionTarget`&&e.connectionId.startsWith(`local:`)}function KS(e){return GS(e)?e.connectionId.slice(6):null}function qS(e){let t=[],n=()=>{let n=e();if(n===void 0)return t=[],{_tag:`Success`,bootstraps:t};try{return t=n.getLocalEnvironmentBootstraps().filter(e=>e.id!==Se),{_tag:`Success`,bootstraps:t}}catch(e){return{_tag:`Failure`,cause:e}}};return{readResult:n,readSnapshot:()=>{let e=n();return e._tag===`Success`?e.bootstraps:t}}}var JS=qS(()=>window.desktopBridge);function YS(){return JS.readResult()}function XS(){return JS.readSnapshot()}function ZS(e){return`connectionId`in e?e.connectionId:void 0}function QS(e){let t=e.replace(/^\[|\]$/g,``).toLowerCase();return t===`localhost`||t.endsWith(`.localhost`)||t===`::1`||/^127(?:\.\d{1,3}){3}$/.test(t)}function $S(e){return e.isDesktop||e.pageHostname===``||QS(e.pageHostname)?`Runs on this computer`:`Runs on ${e.pageHostname.replace(/^\[|\]$/g,``)}`}function eC(e){return e.isDesktop||e.hasLocalEnvironment===!0?`local`:`cloud`}var tC=[`local`,`cloud`,`remote`];function nC(e){return typeof e==`string`&&tC.includes(e)}function rC(e){return e.target===`local`?e.isDesktop||e.hasLocalEnvironment===!0?{enabled:!0}:{enabled:!1,unavailableReason:`A browser cannot run sessions on the computer showing it. Open the Borg desktop app on that machine, or reach it with Remote.`}:e.target===`remote`?e.hasRemoteEnvironment?e.hasOnlineRemoteEnvironment===!1?{enabled:!1,unavailableReason:`Your other machines are offline. Wake one and open Borg on it, and it will show up here.`}:{enabled:!0}:{enabled:!1,unavailableReason:`No other machine available yet. Pair one through Borg, add it over SSH, or connect by URL in Settings → Connections.`}:{enabled:!0}}function iC(e,t){return e===void 0?null:e===`CloudConnectionTarget`?`cloud`:e===`PrimaryConnectionTarget`||e===`BearerConnectionTarget`&&t!==void 0&&t.startsWith(`local:`)?`local`:`remote`}function aC(e){return!nC(e.value)||!rC({target:e.value,isDesktop:e.isDesktop,hasLocalEnvironment:e.hasLocalEnvironment,hasRemoteEnvironment:e.hasRemoteEnvironment,...e.hasOnlineRemoteEnvironment===void 0?{}:{hasOnlineRemoteEnvironment:e.hasOnlineRemoteEnvironment}}).enabled?{kind:`ignored`}:{kind:`target`,target:e.value}}var oC={cloud:`Cloud`,local:`Local`,remote:`Remote`};function sC(e){if(!e.isDefault)return e.title;let t=iC(e.environmentTargetTag,e.environmentConnectionId);return t?oC[t]:e.title}var cC=on({start:zt,side:tn([`additions`,`deletions`]),end:zt,endSide:tn([`additions`,`deletions`])}),lC=on({id:B,sectionId:B,sectionTitle:B,filePath:B,startIndex:zt,endIndex:zt,rangeLabel:B,text:B,diff:B,fenceLanguage:We(B),selection:We(cC)}),uC=/<review_comment\b([^>]*)>\s*([\s\S]*?)<\/review_comment>/g,dC=/([a-zA-Z][a-zA-Z0-9_-]*)="([^"]*)"/g,fC=/(`{3,})([^\s`]*)[^\n]*\n([\s\S]*?)\n\1/g;function pC(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function mC(e){return e.replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/&/g,`&`)}function hC(e){let t={};for(let n of e.matchAll(dC))t[n[1]]=mC(n[2]??``);return t}function gC(e){return e===void 0||!/^\d+$/.test(e)?null:Number(e)}function _C(e){let t=Array.from(e.matchAll(fC)).at(-1),n=t?.index;return{text:e.slice(0,n??e.length).trim(),language:t?.[2]?.trim()||`diff`,contents:t?.[3]??``}}function vC(e,t,n){let r=hC(e),i=gC(r.startIndex),a=gC(r.endIndex),o=r.filePath?.trim(),s=r.sectionId?.trim();if(!o||!s||i===null||a===null)return null;let c=_C(t);return{id:`review-comment:${n}:${s}:${o}:${i}:${a}`,sectionId:s,sectionTitle:r.sectionTitle?.trim()||`Review`,filePath:o,startIndex:Math.min(i,a),endIndex:Math.max(i,a),rangeLabel:r.rangeLabel?.trim()||`line`,text:c.text,diff:c.contents,fenceLanguage:c.language}}function yC(e){let t=[],n=0,r=0;for(let i of e.matchAll(uC)){let a=i.index??0,o=e.slice(n,a);o.length>0&&t.push({kind:`text`,id:`review-comment-text:${n}`,text:o});let s=vC(i[1]??``,i[2]??``,r);s?(t.push({kind:`review-comment`,comment:s}),r+=1):t.push({kind:`text`,id:`review-comment-invalid:${a}`,text:i[0]}),n=a+i[0].length}let i=e.slice(n);return i.length>0&&t.push({kind:`text`,id:`review-comment-text:${n}`,text:i}),t}function bC(e,t){let n=Math.max(0,...Array.from(t.matchAll(/`+/g),e=>e[0].length)),r="`".repeat(Math.max(3,n+1));return[`${r}${e}`,t.trimEnd(),r].join(`
|
|
19
|
+
`)}function xC(e){return e.replace(/<(?=\/?review_comment\b)/giu,`<`)}function SC(e){return[[`<review_comment`,` sectionId="${pC(e.sectionId)}"`,` sectionTitle="${pC(e.sectionTitle)}"`,` filePath="${pC(e.filePath)}"`,` startIndex="${e.startIndex}"`,` endIndex="${e.endIndex}"`,` rangeLabel="${pC(e.rangeLabel)}"`,`>`].join(``),xC(e.text.trim()),bC(e.fenceLanguage??`diff`,e.diff),`</review_comment>`].join(`
|
|
20
|
+
`)}function CC(e,t){let n=t.map(SC);if(n.length===0)return e;let r=e.trim();return r.length>0?`${r}\n\n${n.join(`
|
|
21
|
+
|
|
22
|
+
`)}`:n.join(`
|
|
23
|
+
|
|
24
|
+
`)}function wC(e){let t=Math.max(1,Math.min(e.startLine,e.endLine)),n=Math.max(t,Math.max(e.startLine,e.endLine)),r=e.contents.split(`
|
|
25
|
+
`).slice(t-1,n);return{id:e.id,sectionId:`file:${e.filePath}`,sectionTitle:`File comment`,filePath:e.filePath,startIndex:t-1,endIndex:n-1,rangeLabel:t===n?`L${t}`:`L${t} to L${n}`,text:e.text.trim(),diff:r.join(`
|
|
26
|
+
`),fenceLanguage:TC(e.filePath)}}function TC(e){let t=e.replaceAll(`\\`,`/`),n=t.slice(t.lastIndexOf(`/`)+1).toLowerCase(),r=n.lastIndexOf(`.`);return r>0&&r<n.length-1?n.slice(r+1):n.startsWith(`.`)&&n.length>1?n.slice(1):`text`}function EC(e){return e.endsWith(`
|
|
27
|
+
`)?e.slice(0,-1):e}function DC(e,t,n){let r=[],i=0,a=1,o=1,s=e=>{(!n||i>=n.startIndex&&i<=n.endIndex)&&r.push(e),i+=1},c=(t,a,o)=>{let s=Math.max(0,o),c=n?Math.max(0,n.startIndex-i):0,l=n?Math.min(s-1,n.endIndex-i):s-1;for(let n=c;n<=l;n+=1)r.push({change:`context`,oldLineNumber:t+n,newLineNumber:a+n,content:EC(e.additionLines[a+n-1]??``)});i+=s};for(let n of e.hunks){if(t){let e=n.deletionStart+ +(n.deletionCount===0),t=n.additionStart+ +(n.additionCount===0),r=Math.min(e-a,t-o);c(a,o,r)}let r=n.deletionStart,i=n.additionStart,l=n.deletionLineIndex,u=n.additionLineIndex;for(let t of n.hunkContent){if(t.type===`context`){for(let n=0;n<t.lines;n+=1)s({change:`context`,oldLineNumber:r,newLineNumber:i,content:EC(e.additionLines[u]??e.deletionLines[l]??``)}),r+=1,i+=1,l+=1,u+=1;continue}for(let n=0;n<t.deletions;n+=1)s({change:`delete`,oldLineNumber:r,newLineNumber:null,content:EC(e.deletionLines[l]??``)}),r+=1,l+=1;for(let n=0;n<t.additions;n+=1)s({change:`add`,oldLineNumber:null,newLineNumber:i,content:EC(e.additionLines[u]??``)}),i+=1,u+=1}a=n.deletionStart+n.deletionCount,o=n.additionStart+n.additionCount,n.deletionCount===0&&(a+=1),n.additionCount===0&&(o+=1)}if(t){let t=Math.min(e.deletionLines.length-a+1,e.additionLines.length-o+1);c(a,o,t)}return r}function OC(e){return e.change===`delete`&&e.oldLineNumber!==null?{lineNumber:e.oldLineNumber,side:`deletions`}:e.newLineNumber===null?e.oldLineNumber===null?null:{lineNumber:e.oldLineNumber,side:`deletions`}:{lineNumber:e.newLineNumber,side:`additions`}}function kC(e,t){if(t.selection)return t.selection;let n=!e.isPartial,r=DC(e,n,{startIndex:t.startIndex,endIndex:t.startIndex})[0],i=t.endIndex===t.startIndex?r:DC(e,n,{startIndex:t.endIndex,endIndex:t.endIndex})[0];if(!r||!i)return null;let a=OC(r),o=OC(i);return!a||!o?null:{start:a.lineNumber,side:a.side,end:o.lineNumber,endSide:o.side}}function AC(e,t,n,r=!e.isPartial){let i=n=>{let i=0,a=1,o=1,s=(e,r,a)=>{let o=Math.max(0,a),s=t-(n===`left`?e:r);return s>=0&&s<o?i+s:-1};for(let c of e.hunks){if(r){let e=c.deletionStart+ +(c.deletionCount===0),t=c.additionStart+ +(c.additionCount===0),n=Math.min(e-a,t-o),r=s(a,o,n);if(r>=0)return r;i+=Math.max(0,n)}let e=c.deletionStart,l=c.additionStart;for(let r of c.hunkContent){if(r.type===`context`){let t=s(e,l,r.lines);if(t>=0)return t;i+=r.lines,e+=r.lines,l+=r.lines;continue}if(n===`left`&&t>=e&&t<e+r.deletions)return i+t-e;if(i+=r.deletions,e+=r.deletions,n===`right`&&t>=l&&t<l+r.additions)return i+t-l;i+=r.additions,l+=r.additions}a=c.deletionStart+c.deletionCount,o=c.additionStart+c.additionCount,c.deletionCount===0&&(a+=1),c.additionCount===0&&(o+=1)}if(!r)return-1;let c=Math.min(e.deletionLines.length-a+1,e.additionLines.length-o+1);return s(a,o,c)},a=n===`deletions`?`left`:`right`,o=i(a);return o>=0?o:i(a===`left`?`right`:`left`)}function jC(e,t,n){let r=AC(e,t,n);if(r<0)return null;let i=DC(e,!e.isPartial,{startIndex:r,endIndex:r})[0];if(i===void 0)return null;switch(i.change){case`add`:return i.newLineNumber===null?null:{kind:`added`,newLine:i.newLineNumber};case`delete`:return i.oldLineNumber===null?null:{kind:`deleted`,oldLine:i.oldLineNumber};case`context`:return i.oldLineNumber===null||i.newLineNumber===null?null:{kind:`context`,oldLine:i.oldLineNumber,newLine:i.newLineNumber,side:n===`deletions`?`left`:`right`}}}function MC(e,t){let n=e.filter(e=>e[t]!==null);return{start:n[0]?.[t]??0,count:n.length}}function NC(e){return e===`add`?`+`:e===`delete`?`-`:` `}function PC(e){let t=e[0],n=e.at(-1);if(!t||!n)return`line`;let r=t.newLineNumber??t.oldLineNumber,i=n.newLineNumber??n.oldLineNumber;if(r===null||i===null)return e.length===1?`line`:`${e.length} lines`;let a=NC(t.change).trim(),o=a.length>0&&e.every(e=>e.change===t.change)?a:``;return r===i?`${o}${r}`:`${o}${r} to ${o}${i}`}function FC(e){let t=!e.fileDiff.isPartial,n=AC(e.fileDiff,e.range.start,e.range.side,t),r=AC(e.fileDiff,e.range.end,e.range.endSide??e.range.side,t);if(n<0||r<0)return null;let i=Math.min(n,r),a=Math.max(n,r),o=DC(e.fileDiff,t,{startIndex:i,endIndex:a}),s=MC(o,`oldLineNumber`),c=MC(o,`newLineNumber`);return{id:e.id,sectionId:e.sectionId,sectionTitle:e.sectionTitle,filePath:e.filePath,startIndex:i,endIndex:a,rangeLabel:PC(o),text:e.text.trim(),diff:[`@@ -${s.start},${s.count} +${c.start},${c.count} @@`,...o.map(e=>`${NC(e.change)}${e.content}`)].join(`
|
|
28
|
+
`),fenceLanguage:`diff`,selection:{start:e.range.start,side:e.range.side??`additions`,end:e.range.end,endSide:e.range.endSide??e.range.side??`additions`}}}function IC(e){if((e.fenceLanguage??`diff`)!==`diff`)return``;let t=e.diff.trim();if(t.length===0)return``;if(t.startsWith(`diff --git `))return t;let n=e.filePath.replaceAll(`\\`,`/`);return[`diff --git a/${n} b/${n}`,`--- a/${n}`,`+++ b/${n}`,t].join(`
|
|
29
|
+
`)}var LC=fe(b),RC=fe(_n),zC=fe(je),BC=fe(lC),VC=fe(n),HC=Nt(`borgcode:composer-drafts:v1`),UC=11,WC=tn([`local`,`worktree`]),GC=B.pipe(g(`DraftId`)),KC=`borg-`;function qC(e){return GC.make(`${KC}${e}`)}function JC(e){return e.startsWith(KC)&&e.slice(5)||null}var YC=300,XC=[`draftsByThreadKey`,`draftThreadsByThreadKey`,`logicalProjectDraftThreadKeyByLogicalProjectKey`],ZC=HS(typeof localStorage<`u`?localStorage:jS(),XC),QC=PS(ZC,YC);typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`beforeunload`,()=>{QC.flush()});var $C=on({id:B,name:B,mimeType:B,sizeBytes:zt,dataUrl:B});function ew(e){return e.file===null&&e.uploadedAttachmentId===void 0}function tw(e,t){let n=!1,r=e.files.map(e=>{if(e.uploadedAttachmentId===void 0&&e.uploadEnvironmentId===void 0||e.uploadEnvironmentId===t)return e;n=!0;let r={...e};return delete r.uploadedAttachmentId,delete r.uploadEnvironmentId,r});return n?{...e,files:r}:e}var nw=on({id:B,name:B,mimeType:B,sizeBytes:zt,attachmentId:B,environmentId:A}),rw=on({id:B,name:B,mimeType:B,sizeBytes:zt,attachmentId:F(B),environmentId:F(A)}),iw=fe(rw),aw=on({id:B,threadId:L,createdAt:B,terminalId:B,terminalLabel:B,lineStart:zt,lineEnd:zt}),ow=on({functionName:bt(B),fileName:bt(B),lineNumber:bt(zt),columnNumber:bt(zt)}),sw=on({id:B,threadId:L,pickedAt:B,pageUrl:B,pageTitle:bt(B),tagName:B,selector:bt(B),htmlPreview:B,componentName:bt(B),source:bt(ow),styles:B}),cw=on({prompt:B,attachments:tt($C),files:F(tt(rw)),terminalContexts:F(tt(aw)),elementContexts:F(tt(sw)),previewAnnotations:F(tt(n)),reviewComments:F(tt(lC)),modelSelectionByProvider:F(kn(qn,bn)),activeProvider:F(bt(qn)),modelSelectionExplicit:F(Ce),runtimeMode:F(b),agent:F(_n),designSystemId:F(B),borgProfileId:F(B)}),lw=on({repository:An,connectionId:B,destinationPath:bt(B),branch:F(B)});function uw(e){if(!e||typeof e!=`object`)return null;let t=e,n=t.repository;if(!n||typeof n!=`object`)return null;let r=n;return r.provider!==`github`&&r.provider!==`gitlab`||[r.id,r.nameWithOwner,r.url,r.cloneUrl,t.connectionId].some(e=>typeof e!=`string`||e.trim().length===0)||r.updatedAt!==null&&typeof r.updatedAt!=`string`||t.destinationPath!==null&&typeof t.destinationPath!=`string`||t.branch!==void 0&&typeof t.branch!=`string`?null:e}var dw=on({threadId:L,environmentId:bt(B),projectId:bt(un),logicalProjectKey:F(bt(B)),executionTarget:F(tn([`local`,`cloud`,`remote`])),remoteDeviceId:F(B),runtimeKey:F(B),createdAt:B,runtimeMode:b,agent:_n,designSystemId:B.pipe(ce(wn(pt))),branch:bt(B),worktreePath:bt(B),envMode:WC,startFromOrigin:Ce.pipe(ce(wn(!1))),promotedTo:F(bt(on({environmentId:B,threadId:B}))),selectedRepository:F(lw)}),fw=on({version:zt,state:on({draftsByThreadKey:kn(B,cw),draftThreadsByThreadKey:kn(B,dw),logicalProjectDraftThreadKeyByLogicalProjectKey:kn(B,B),stickyModelSelectionByProvider:F(kn(qn,bn)),stickyActiveProvider:F(bt(qn))})});function pw(e){return e?e.prompt.trim().length>0||e.images.length>0||e.files.length>0||e.persistedAttachments.length>0||e.terminalContexts.length>0||e.elementContexts.length>0||e.previewAnnotations.length>0||e.reviewComments.length>0:!1}function mw(e){return e!=null&&e.environmentId!==null&&e.projectId!==null}function hw(e){if(!e)return null;let t=e.options;return!t||t.length===0?null:{[e.instanceId]:t}}function gw(e){if(!e)return null;let t={};for(let[n,r]of Object.entries(e))r?.options&&r.options.length>0&&(t[n]=r.options);return Object.keys(t).length>0?t:null}function _w(e){return{...e,...e.options?{options:e.options.map(e=>({...e}))}:{}}}function vw(e){let t=[];for(let[n,r]of Object.entries(e))r!==void 0&&t.push([n,_w(r)]);return Object.fromEntries(t)}var yw=Object.freeze({draftsByThreadKey:{},draftThreadsByThreadKey:{},logicalProjectDraftThreadKeyByLogicalProjectKey:{},stickyModelSelectionByProvider:{},stickyActiveProvider:null}),bw=[],xw=[],Sw=[],Cw=[],ww=[],Tw=[],Ew=[],Dw=[];Object.freeze(bw),Object.freeze(xw),Object.freeze(Sw),Object.freeze(Cw),Object.freeze(Tw),Object.freeze(Ew),Object.freeze(Dw);var Ow=Object.freeze({}),kw=Object.freeze({activeProvider:null,modelSelectionByProvider:Ow}),Aw=Object.freeze({prompt:``,images:bw,files:xw,nonPersistedImageIds:Sw,persistedAttachments:Cw,terminalContexts:ww,elementContexts:Tw,previewAnnotations:Ew,reviewComments:Dw,modelSelectionByProvider:Ow,activeProvider:null,runtimeMode:null,agent:null,designSystemId:null});function jw(){return{prompt:``,images:[],files:[],nonPersistedImageIds:[],persistedAttachments:[],terminalContexts:[],elementContexts:[],previewAnnotations:[],reviewComments:[],modelSelectionByProvider:{},activeProvider:null,runtimeMode:null,agent:null,designSystemId:null}}function Mw(e){return`${e.mimeType}\u0000${e.sizeBytes}\u0000${e.name}`}function Nw(e){return`${e.mimeType}\u0000${e.sizeBytes}\u0000${e.name}`}function Pw(e,t){if(e.name!==t.name||e.sizeBytes!==t.sizeBytes)return!1;if(e.mimeType===t.mimeType)return!0;let n=e.mimeType.toLowerCase();return(n===``||n===`application/octet-stream`)&&Wb(e)!==null&&Wb(t)!==null}function Fw(e){return`${e.terminalId}\u0000${e.lineStart}\u0000${e.lineEnd}`}function Iw(e,t){let n=t.terminalId.trim(),r=t.terminalLabel.trim();if(n.length===0||r.length===0)return null;let i=Math.max(1,Math.floor(t.lineStart)),a=Math.max(i,Math.floor(t.lineEnd));return{...t,threadId:e,terminalId:n,terminalLabel:r,lineStart:i,lineEnd:a,text:bx(t.text)}}function Lw(e,t){let n=new Set,r=new Set,i=[];for(let a of t){let t=Iw(e,a);if(!t)continue;let o=Fw(t);n.has(t.id)||r.has(o)||(i.push(t),n.add(t.id),r.add(o))}return i}function Rw(e){return e.prompt.length===0&&e.images.length===0&&e.files.length===0&&e.persistedAttachments.length===0&&e.terminalContexts.length===0&&e.elementContexts.length===0&&e.previewAnnotations.length===0&&e.reviewComments.length===0&&Object.keys(e.modelSelectionByProvider).length===0&&e.activeProvider===null&&e.runtimeMode===null&&e.agent===null&&(e.borgProfileId??null)===null}function zw(e){return zC(e)?e:null}var Bw=/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/;function Vw(e){return typeof e!=`string`||!Bw.test(e)?null:e}function Hw(e){if(Array.isArray(e)){let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n,r=e.id,i=e.value;typeof r!=`string`||r.length===0||(typeof i==`string`||typeof i==`boolean`)&&t.push({id:r,value:i})}return t.length>0?t:void 0}if(e&&typeof e==`object`){let t=e,n=[];for(let[e,r]of Object.entries(t))(typeof r==`string`||typeof r==`boolean`)&&n.push({id:e,value:r});return n.length>0?n:void 0}}function Uw(e,t,n){let r=e&&typeof e==`object`?e:null,i={};for(let e of[`codex`,`claudeAgent`,`cursor`,`opencode`]){let t=Hw(r?.[e]);t&&(i[e]=t)}if(t===`codex`&&n){let e=[];if(typeof n.effort==`string`&&n.effort.length>0&&e.push({id:`reasoningEffort`,value:n.effort}),(n.codexFastMode===!0||typeof n.serviceTier==`string`&&n.serviceTier===`fast`)&&e.push({id:`fastMode`,value:!0}),e.length>0){let t=i.codex??[],n=new Set(t.map(e=>e.id)),r=[...t];for(let t of e)n.has(t.id)||r.push(t);i.codex=r}}return Object.keys(i).length>0?i:null}function Ww(e,t){let n=e&&typeof e==`object`?e:null,r=Vw(n?.instanceId??n?.provider??t?.provider);if(r===null)return null;let i=n?.model??t?.model;if(typeof i!=`string`)return null;let a=sc(i,zw(n?.provider??t?.provider)??je.make(`codex`));if(!a)return null;if(Array.isArray(n?.options))return mc(r,a,Hw(n.options));let o=zw(r),s=o?Uw(n?.options?{[o]:n.options}:t?.modelOptions,o,o===`codex`?t?.legacyCodex:void 0):null;return mc(r,a,o?s?.[o]:void 0)}function Gw(e,t){if(e===null)return null;let n=zw(e.instanceId),r=n?t?.[n]:void 0;return mc(e.instanceId,e.model,r)}function Kw(e,t){if(!e?.options||e.options.length===0)return Uw(t);let n=zw(e.instanceId);return n?qw(Uw(t),n,e.options):Uw(t)}function qw(e,t,n){let{[t]:r,...i}=e??{},a={...i};return n&&n.length>0&&(a[t]=n),Object.keys(a).length>0?a:null}function Jw(e,t){let n={};if(t)for(let r of[`codex`,`claudeAgent`,`cursor`,`opencode`]){let i=t[r];if(i&&i.length>0){let t=je.make(r),a=d(t);n[a]=mc(a,e?.instanceId===a?e.model:rt[t]??`searchatlas-gateway/borg-fusion#medium`,i)}}return e&&(n[e.instanceId]=e),n}function Yw(e){let t=e.threadModelSelection?.model??e.projectModelSelection?.model??null,n=e.selectedInstanceId!==null&&e.selectedInstanceId!==void 0&&e.threadModelSelection?.instanceId===e.selectedInstanceId,r=(e.selectedInstanceId?Bb(e.selectedInstanceId,e.settings,e.providers,t,{preserveUnavailableSelection:n}):null)??zb(e.selectedProvider,e.settings,e.providers,t)??sc(t,e.selectedProvider)??wc(e.providers,e.selectedProvider),i=e.selectedInstanceId?e.draft?.modelSelectionByProvider?.[e.selectedInstanceId]:void 0,a=e.draft?.modelSelectionByProvider?.[qn.make(e.selectedProvider)],o=i??a,s=i?e.selectedInstanceId??qn.make(e.selectedProvider):qn.make(e.selectedProvider);return{selectedModel:o?.model?Bb(s,e.settings,e.providers,o.model,{preserveUnavailableSelection:!0})??zb(e.selectedProvider,e.settings,e.providers,o.model):r,modelOptions:gw(e.draft?.modelSelectionByProvider)??hw(e.threadModelSelection)??hw(e.projectModelSelection)??null}}function Xw(e){typeof URL>`u`||e.startsWith(`blob:`)&&URL.revokeObjectURL(e)}function Zw(e){if(e)for(let t of e.images)Xw(t.previewUrl)}function Qw(e){if(!e||typeof e!=`object`)return null;let t=e,n=t.id,r=t.name,i=t.mimeType,a=t.sizeBytes,o=t.dataUrl;return typeof n!=`string`||typeof r!=`string`||typeof i!=`string`||typeof a!=`number`||!Number.isFinite(a)||typeof o!=`string`||n.length===0||o.length===0?null:{id:n,name:r,mimeType:i,sizeBytes:a,dataUrl:o}}function $w(e){if(!e||typeof e!=`object`)return null;let t=e,n=t.id,r=t.threadId,i=t.pickedAt,a=t.pageUrl,o=t.tagName;if(typeof n!=`string`||n.length===0||typeof r!=`string`||r.length===0||typeof i!=`string`||i.length===0||typeof a!=`string`||a.length===0||typeof o!=`string`||o.length===0)return null;let s=t.source,c=null;if(s&&typeof s==`object`){let e=s;c={functionName:typeof e.functionName==`string`?e.functionName:null,fileName:typeof e.fileName==`string`?e.fileName:null,lineNumber:typeof e.lineNumber==`number`&&Number.isFinite(e.lineNumber)?e.lineNumber:null,columnNumber:typeof e.columnNumber==`number`&&Number.isFinite(e.columnNumber)?e.columnNumber:null}}return{id:n,threadId:r,pickedAt:i,pageUrl:a,pageTitle:typeof t.pageTitle==`string`?t.pageTitle:null,tagName:o,selector:typeof t.selector==`string`?t.selector:null,htmlPreview:typeof t.htmlPreview==`string`?t.htmlPreview:``,componentName:typeof t.componentName==`string`?t.componentName:null,source:c,styles:typeof t.styles==`string`?t.styles:``}}function eT(e){if(!e||typeof e!=`object`)return null;let t=e,n=t.id,r=t.threadId,i=t.createdAt,a=t.lineStart,o=t.lineEnd;if(typeof n!=`string`||n.length===0||typeof r!=`string`||r.length===0||typeof i!=`string`||i.length===0||typeof a!=`number`||!Number.isFinite(a)||typeof o!=`number`||!Number.isFinite(o))return null;let s=typeof t.terminalId==`string`?t.terminalId.trim():``,c=typeof t.terminalLabel==`string`?t.terminalLabel.trim():``;if(s.length===0||c.length===0)return null;let l=Math.max(1,Math.floor(a));return{id:n,threadId:r,createdAt:i,terminalId:s,terminalLabel:c,lineStart:l,lineEnd:Math.max(l,Math.floor(o))}}function tT(e,t){return e===`local`||e===`worktree`?e:t?`worktree`:`local`}function nT(e){return co(e)}function rT(e){return e.trim()}function iT(e){return typeof e==`string`?e.trim():lo(e)}function aT(e,t){let n=po(e);return n?iT(n):t?.environmentId?iT(oo(t.environmentId,e)):e}function oT(e){return po(e)}function sT(e,t){if(typeof t==`string`){let e=t.trim();return e.length>0?GC.make(e):null}return t}function $(e,t){let n=sT(e,t);if(!n)return null;if(typeof n!=`string`){let t=iT(n);if(e.draftsByThreadKey[t])return t;for(let[t,r]of Object.entries(e.draftThreadsByThreadKey))if(r.environmentId===n.environmentId&&r.threadId===n.threadId)return t;return t}let r=iT(n);return r.length>0?r:null}function cT(e,t){let n=sT(e,t);return n?typeof n==`string`?e.draftThreadsByThreadKey[n]?.threadId??null:n.threadId:null}function lT(e,t){let n=$(e,t);return n?e.draftsByThreadKey[n]??null:null}function uT(e,t){return Object.values(e).includes(t)}function dT(e,t){return{draftId:e,...t}}function fT(e,t,n,r,i){let a=r!==void 0&&(r.environmentId!==e.environmentId||r.projectId!==e.projectId),o=i?.worktreePath===void 0?a?null:r?.worktreePath??null:i.worktreePath??null,s=i?.branch===void 0?a?null:r?.branch??null:i.branch??null,c=i?.startFromOrigin===void 0?r?.startFromOrigin??!1:i.startFromOrigin;return{threadId:t,environmentId:e.environmentId,projectId:e.projectId,logicalProjectKey:n,executionTarget:i?.executionTarget??r?.executionTarget??`local`,remoteDeviceId:r?.remoteDeviceId??null,runtimeKey:r?.runtimeKey??null,createdAt:i?.createdAt??r?.createdAt??new Date().toISOString(),runtimeMode:i?.runtimeMode??r?.runtimeMode??`full-access`,agent:i?.agent??r?.agent??`code`,designSystemId:r?.designSystemId??`auto`,branch:s,worktreePath:o,envMode:i?.envMode??(o?`worktree`:r?.envMode??`local`),startFromOrigin:c,promotedTo:null}}function pT(e,t){return!e||!t?e===t:e.environmentId===t.environmentId&&e.threadId===t.threadId}function mT(e){return e?.promotedTo!==null&&e?.promotedTo!==void 0}function hT(e,t){return!!e&&e.threadId===t.threadId&&e.environmentId===t.environmentId&&e.projectId===t.projectId&&e.logicalProjectKey===t.logicalProjectKey&&e.createdAt===t.createdAt&&e.runtimeMode===t.runtimeMode&&e.agent===t.agent&&e.designSystemId===t.designSystemId&&e.branch===t.branch&&e.worktreePath===t.worktreePath&&e.envMode===t.envMode&&e.runtimeKey===t.runtimeKey&&e.startFromOrigin===t.startFromOrigin&&e.selectedRepository?.repository.id===t.selectedRepository?.repository.id&&e.selectedRepository?.connectionId===t.selectedRepository?.connectionId&&e.selectedRepository?.destinationPath===t.selectedRepository?.destinationPath&&e.selectedRepository?.branch===t.selectedRepository?.branch&&pT(e.promotedTo,t.promotedTo)}function gT(e,t,n){let r=Object.fromEntries(Object.entries(e.logicalProjectDraftThreadKeyByLogicalProjectKey).filter(([,e])=>e!==t)),{[t]:i,...a}=e.draftThreadsByThreadKey,{[t]:o,...s}=e.draftsByThreadKey;return n&&o?s[iT(n)]=o:Zw(o),{draftsByThreadKey:s,draftThreadsByThreadKey:a,logicalProjectDraftThreadKeyByLogicalProjectKey:r}}function _T(e,t){let n={},r=new Map;if(t&&typeof t==`object`)for(let[e,n]of Object.entries(t)){if(typeof n!=`string`||n.length===0)continue;let t=fo(e);if(!t)continue;let i=po(n);if(i){r.set(i.threadId,i.environmentId);continue}r.set(n,t.environmentId)}if(e&&typeof e==`object`)for(let[t,i]of Object.entries(e)){if(typeof t!=`string`||t.length===0||!i||typeof i!=`object`)continue;let e=i,a=po(t),o=aT(t),s=a?.threadId??(typeof e.threadId==`string`&&e.threadId.length>0?e.threadId:t),c=a?.environmentId??(typeof e.environmentId==`string`&&e.environmentId.length>0?e.environmentId:r.get(t)),l=e.projectId,u=e.createdAt,d=e.branch,f=e.worktreePath,p=e.startFromOrigin===!0,m=typeof f==`string`?f:null,h=e.promotedTo,g=h&&typeof h==`object`?h:null,_=g&&typeof g.environmentId==`string`&&g.environmentId.length>0&&typeof g.threadId==`string`&&g.threadId.length>0?oo(g.environmentId,g.threadId):null,v=e.environmentId===null&&e.projectId===null;if(!v&&(typeof l!=`string`||l.length===0||c===void 0))continue;let y=v?null:c,b=uw(e.selectedRepository);n[o]={threadId:s,environmentId:y,projectId:v?null:l,executionTarget:e.executionTarget===`cloud`||e.executionTarget===`remote`?e.executionTarget:`local`,logicalProjectKey:v?null:typeof e.logicalProjectKey==`string`&&e.logicalProjectKey.length>0?e.logicalProjectKey:a?nT(ao(y,l)):t,createdAt:typeof u==`string`&&u.length>0?u:new Date().toISOString(),runtimeMode:LC(e.runtimeMode)?e.runtimeMode:Gb,agent:RC(e.agent)?e.agent:Kb,designSystemId:typeof e.designSystemId==`string`&&e.designSystemId.length>0?e.designSystemId:pt,...nC(e.executionTarget)?{executionTarget:e.executionTarget}:{},...typeof e.remoteDeviceId==`string`&&e.remoteDeviceId.length>0?{remoteDeviceId:e.remoteDeviceId}:{},...typeof e.runtimeKey==`string`&&e.runtimeKey.length>0?{runtimeKey:e.runtimeKey}:{},branch:typeof d==`string`?d:null,worktreePath:m,envMode:tT(e.envMode,m),startFromOrigin:p,...b?{selectedRepository:b}:{},promotedTo:_}}let i={};if(t&&typeof t==`object`)for(let[e,a]of Object.entries(t)){if(typeof a!=`string`||a.length===0)continue;let t=fo(e),o=po(a),s=aT(a);i[e]=s;let c=n[s];if(o&&r.set(o.threadId,o.environmentId),c?.logicalProjectKey!==e){if(!t){c&&(n[s]={...c,logicalProjectKey:e});continue}c?(c.projectId!==t.projectId||c.environmentId!==t.environmentId)&&(n[s]={...c,threadId:c.threadId,environmentId:t.environmentId,projectId:t.projectId,logicalProjectKey:e}):n[s]={threadId:o?.threadId??s,environmentId:t.environmentId,projectId:t.projectId,logicalProjectKey:e,createdAt:new Date().toISOString(),runtimeMode:Gb,agent:Kb,designSystemId:pt,branch:null,worktreePath:null,envMode:`local`,startFromOrigin:!1,promotedTo:null}}}return{draftThreadsByThreadKey:n,logicalProjectDraftThreadKeyByLogicalProjectKey:i}}function vT(e,t){if(!e||typeof e!=`object`)return{};let n=new Map;for(let[e,r]of Object.entries(t)){let t=oT(e);t&&n.set(t.threadId,r.environmentId)}let r={};for(let[i,a]of Object.entries(e)){if(typeof i!=`string`||i.length===0||!a||typeof a!=`object`)continue;let e=a,o=typeof e.prompt==`string`?e.prompt:``,s=Array.isArray(e.attachments)?e.attachments.flatMap(e=>{let t=Qw(e);return t?[t]:[]}):[],c=Array.isArray(e.files)?e.files.filter(iw):[],l=Array.isArray(e.terminalContexts)?e.terminalContexts.flatMap(e=>{let t=eT(e);return t?[t]:[]}):[],u=Array.isArray(e.elementContexts)?e.elementContexts.flatMap(e=>{let t=$w(e);return t?[t]:[]}):[],d=Array.isArray(e.previewAnnotations)?e.previewAnnotations.filter(VC):[],f=Array.isArray(e.reviewComments)?e.reviewComments.filter(BC):[],p=LC(e.runtimeMode)?e.runtimeMode:null,m=RC(e.agent)?e.agent:null,h=typeof e.designSystemId==`string`&&e.designSystemId.length>0?e.designSystemId:null,g=typeof e.borgProfileId==`string`&&e.borgProfileId.length>0?e.borgProfileId:null,_=Ix(o,l.length),v=a,y={},b=null,x;if(e.modelSelectionByProvider&&typeof e.modelSelectionByProvider==`object`)y=e.modelSelectionByProvider,b=Vw(e.activeProvider),x=e.modelSelectionExplicit===!0?!0:void 0;else{let e=Uw(v.modelOptions,void 0,v)??null,t=Ww(v.modelSelection,{provider:v.provider,model:v.model,modelOptions:e??v.modelOptions,legacyCodex:v}),n=Kw(t,e),r=Gw(t,n);y=Jw(r,n),b=r?.instanceId??null}let S=Object.keys(y).length>0||b!==null;if(o.length===0&&s.length===0&&c.length===0&&l.length===0&&u.length===0&&d.length===0&&f.length===0&&!S&&!p&&!m&&!g)continue;let C=po(i)===null?t[i]===void 0?(()=>{let e=n.get(i);return e?aT(i,{environmentId:e}):i})():i:aT(i);r[C]={prompt:_,attachments:s,...c.length>0?{files:c}:{},...l.length>0?{terminalContexts:l}:{},...u.length>0?{elementContexts:u}:{},...d.length>0?{previewAnnotations:d}:{},...f.length>0?{reviewComments:f}:{},...S?{modelSelectionByProvider:vw(y),activeProvider:b,...x?{modelSelectionExplicit:!0}:{}}:{},...p?{runtimeMode:p}:{},...m?{agent:m}:{},...h?{designSystemId:h}:{},...g?{borgProfileId:g}:{}}}return r}function yT(e){return e?e.prompt.trim().length>0||e.attachments.length>0||(e.files?.length??0)>0||(e.terminalContexts?.length??0)>0||(e.elementContexts?.length??0)>0||(e.previewAnnotations?.length??0)>0||(e.reviewComments?.length??0)>0:!1}function bT(e,t){return Object.fromEntries(Object.entries(e).flatMap(([e,n])=>{if(t[e]===void 0||n.modelSelectionExplicit===!0||yT(n))return[[e,n]];let{activeProvider:r,modelSelectionByProvider:i,modelSelectionExplicit:a,...o}=n;return o.runtimeMode||o.agent?[[e,o]]:[]}))}var xT=10;function ST(e){let t=Object.entries(e.draftThreadsByThreadKey).filter(([,e])=>e.environmentId==null||e.projectId==null),n=new Set(t.filter(([t,n])=>n.selectedRepository===void 0&&n.runtimeKey===void 0&&!yT(e.draftsByThreadKey[t])).map(([e])=>e)),r=t.filter(([e,t])=>!n.has(e)&&t.promotedTo==null&&JC(e)===null).sort(([e,t],[n,r])=>r.createdAt.localeCompare(t.createdAt)||e.localeCompare(n));for(let[e]of r.slice(xT))n.add(e);if(n.size===0)return e;let i=Object.fromEntries(Object.entries(e.draftThreadsByThreadKey).filter(([e])=>!n.has(e))),a=Object.fromEntries(Object.entries(e.draftsByThreadKey).filter(([e])=>!n.has(e))),o=Object.fromEntries(Object.entries(e.logicalProjectDraftThreadKeyByLogicalProjectKey).filter(([,e])=>!n.has(e)));return{...e,draftThreadsByThreadKey:i,draftsByThreadKey:a,logicalProjectDraftThreadKeyByLogicalProjectKey:o}}function CT(e){let t=TT(e);return ST({...t,draftsByThreadKey:bT(t.draftsByThreadKey,t.draftThreadsByThreadKey)})}function wT(e){let t=new Set(Object.values(e.logicalProjectDraftThreadKeyByLogicalProjectKey)),n=new Set(Object.entries(e.draftThreadsByThreadKey).filter(([n,r])=>mw(r)&&t.has(n)||mT(r)||r.selectedRepository!==void 0||r.runtimeKey!==null||pw(e.draftsByThreadKey[n])).map(([e])=>e)),r={};for(let[t,i]of Object.entries(e.draftsByThreadKey)){if(typeof t!=`string`||t.length===0||e.draftThreadsByThreadKey[t]!==void 0&&!n.has(t))continue;let a=Object.keys(i.modelSelectionByProvider).length>0||i.activeProvider!==null;if(i.prompt.length===0&&i.persistedAttachments.length===0&&i.images.length===0&&i.files.length===0&&i.terminalContexts.length===0&&i.elementContexts.length===0&&i.previewAnnotations.length===0&&i.reviewComments.length===0&&!a&&i.runtimeMode===null&&i.agent===null&&!i.borgProfileId)continue;let o=new Set(i.persistedAttachments.map(e=>e.id)),s=i.images.filter(e=>!o.has(e.id)).map(e=>({id:e.id,name:e.name,mimeType:e.mimeType,sizeBytes:e.sizeBytes}));r[t]={prompt:i.prompt,attachments:i.persistedAttachments,...i.files.length>0||s.length>0?{files:[...i.files.map(e=>({id:e.id,name:e.name,mimeType:e.mimeType,sizeBytes:e.sizeBytes,...e.uploadedAttachmentId&&e.uploadEnvironmentId?{attachmentId:e.uploadedAttachmentId,environmentId:e.uploadEnvironmentId}:{}})),...s]}:{},...i.terminalContexts.length>0?{terminalContexts:i.terminalContexts.map(e=>({id:e.id,threadId:e.threadId,createdAt:e.createdAt,terminalId:e.terminalId,terminalLabel:e.terminalLabel,lineStart:e.lineStart,lineEnd:e.lineEnd}))}:{},...i.elementContexts.length>0?{elementContexts:i.elementContexts.map(e=>({id:e.id,threadId:e.threadId,pickedAt:e.pickedAt,pageUrl:e.pageUrl,pageTitle:e.pageTitle,tagName:e.tagName,selector:e.selector,htmlPreview:e.htmlPreview,componentName:e.componentName,source:e.source,styles:e.styles}))}:{},...i.previewAnnotations.length>0?{previewAnnotations:i.previewAnnotations.map(e=>({...e}))}:{},...i.reviewComments.length>0?{reviewComments:i.reviewComments.map(e=>({...e}))}:{},...a?{modelSelectionByProvider:vw(i.modelSelectionByProvider),activeProvider:i.activeProvider,...i.modelSelectionExplicit?{modelSelectionExplicit:!0}:{}}:{},...i.runtimeMode?{runtimeMode:i.runtimeMode}:{},...i.agent?{agent:i.agent}:{},...i.designSystemId?{designSystemId:i.designSystemId}:{},...i.borgProfileId?{borgProfileId:i.borgProfileId}:{}}}let i={};for(let[t,r]of Object.entries(e.draftThreadsByThreadKey)){if(!n.has(t))continue;let{remoteDeviceId:e,runtimeKey:a,selectedRepository:o,...s}=r;i[t]={...s,...e===null?{}:{remoteDeviceId:e},...a===null?{}:{runtimeKey:a},...o===void 0?{}:{selectedRepository:o}}}return{draftsByThreadKey:r,draftThreadsByThreadKey:i,logicalProjectDraftThreadKeyByLogicalProjectKey:e.logicalProjectDraftThreadKeyByLogicalProjectKey,stickyModelSelectionByProvider:vw(e.stickyModelSelectionByProvider),stickyActiveProvider:e.stickyActiveProvider}}function TT(e){if(!e||typeof e!=`object`)return yw;let t=e,{draftThreadsByThreadKey:n,logicalProjectDraftThreadKeyByLogicalProjectKey:r}=_T(t.draftThreadsByThreadKey??t.draftThreadsByThreadId,t.logicalProjectDraftThreadKeyByLogicalProjectKey??t.projectDraftThreadKeyByProjectKey??t.projectDraftThreadIdByProjectKey??t.projectDraftThreadIdByProjectId),i={},a=null;if(t.stickyModelSelectionByProvider&&typeof t.stickyModelSelectionByProvider==`object`)i=t.stickyModelSelectionByProvider,a=Vw(t.stickyActiveProvider);else{let e=Uw(t.stickyModelOptions)??{},n=Ww(t.stickyModelSelection,{provider:t.stickyProvider??`codex`,model:t.stickyModel,modelOptions:e}),r=Kw(n,e);i=Jw(Gw(n,r),r),a=Vw(t.stickyProvider)}return{draftsByThreadKey:vT(t.draftsByThreadKey??t.draftsByThreadId,n),draftThreadsByThreadKey:n,logicalProjectDraftThreadKeyByLogicalProjectKey:r,stickyModelSelectionByProvider:vw(i),stickyActiveProvider:a}}function ET(e){if(e.length===0)return[];try{let t=Vt(HC,fw);return!t||t.version!==UC?[]:(t.state.draftsByThreadKey[e]?.attachments??[]).map(e=>e.id)}catch{return[]}}function DT(e,t,n){let r=new Set;try{QC.flush(),r=new Set(ET(e))}catch{r=new Set}n(n=>{let i=n.draftsByThreadKey[e];if(!i)return n;let a=new Set(i.images.map(e=>e.id)),o=t.filter(e=>a.has(e.id)&&r.has(e.id)),s=[];for(let e of i.images)r.has(e.id)||s.push(e.id);let c={...i,persistedAttachments:o,nonPersistedImageIds:s},l={...n.draftsByThreadKey};return Rw(c)?delete l[e]:l[e]=c,{draftsByThreadKey:l}})}function OT(e){let t=e.dataUrl.indexOf(`,`),n=t===-1?e.dataUrl:e.dataUrl.slice(0,t),r=t===-1?``:e.dataUrl.slice(t+1);if(r.length===0)return null;try{if(!n.includes(`;base64`)){let t=decodeURIComponent(r),i=n.startsWith(`data:`)&&n.includes(`;`)?n.slice(5,n.indexOf(`;`)):e.mimeType;return new File([t],e.name,{type:i||e.mimeType})}let t=atob(r),i=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)i[e]=t.charCodeAt(e);return new File([i],e.name,{type:e.mimeType})}catch{return null}}function kT(e){return e.flatMap(e=>{let t=OT(e);return t?[{type:`image`,id:e.id,name:e.name,mimeType:e.mimeType,sizeBytes:e.sizeBytes,previewUrl:e.dataUrl,file:t}]:[]})}function AT(e){let t=e.modelSelectionByProvider??{},n=Vw(e.activeProvider)??null;return{prompt:e.prompt,images:kT(e.attachments),files:e.files?.map(e=>({type:`file`,id:e.id,name:e.name,mimeType:e.mimeType,sizeBytes:e.sizeBytes,file:null,...e.attachmentId!==void 0&&e.environmentId!==void 0?{uploadedAttachmentId:e.attachmentId,uploadEnvironmentId:e.environmentId}:{}}))??[],nonPersistedImageIds:[],persistedAttachments:[...e.attachments],terminalContexts:e.terminalContexts?.map(e=>({...e,text:``}))??[],elementContexts:e.elementContexts?.map(e=>({...e}))??[],previewAnnotations:e.previewAnnotations?.map(e=>({...e}))??[],reviewComments:e.reviewComments?.map(e=>({...e}))??[],modelSelectionByProvider:t,activeProvider:n,...e.modelSelectionExplicit?{modelSelectionExplicit:!0}:{},runtimeMode:e.runtimeMode??null,agent:e.agent??null,designSystemId:e.designSystemId??null,...e.borgProfileId?{borgProfileId:e.borgProfileId}:{}}}function jT(e){let t=e.environmentId,n=e.projectId;return{threadId:e.threadId,environmentId:t,projectId:n,executionTarget:e.executionTarget??`local`,remoteDeviceId:e.remoteDeviceId??null,runtimeKey:e.runtimeKey??null,logicalProjectKey:e.logicalProjectKey??(t&&n?nT(ao(t,n)):null),createdAt:e.createdAt,runtimeMode:e.runtimeMode,agent:e.agent,designSystemId:e.designSystemId,branch:e.branch,worktreePath:e.worktreePath,envMode:e.envMode,startFromOrigin:e.startFromOrigin,...e.selectedRepository?{selectedRepository:e.selectedRepository}:{},promotedTo:e.promotedTo?oo(e.promotedTo.environmentId,e.promotedTo.threadId):null}}var MT=Qx()(tS((e,t)=>{let n=e;return{draftsByThreadKey:{},draftThreadsByThreadKey:{},logicalProjectDraftThreadKeyByLogicalProjectKey:{},backgroundSubmissionThreadKeys:{},cloudResumeSendsByThreadId:{},stickyModelSelectionByProvider:{},stickyActiveProvider:null,getComposerDraft:e=>lT(t(),e),getDraftThreadByLogicalProjectKey:e=>t().getDraftSessionByLogicalProjectKey(e),getDraftSessionByLogicalProjectKey:e=>{let n=rT(e);if(n.length===0)return null;let r=t().logicalProjectDraftThreadKeyByLogicalProjectKey[n];if(!r)return null;let i=t().draftThreadsByThreadKey[r];return!i||mT(i)?null:dT(GC.make(r),i)},getDraftThreadByProjectRef:e=>t().getDraftSessionByProjectRef(e),getDraftSessionByProjectRef:e=>{let n=t();for(let t of Object.values(n.logicalProjectDraftThreadKeyByLogicalProjectKey)){let r=n.draftThreadsByThreadKey[t];if(!(!r||mT(r))&&r.projectId===e.projectId&&r.environmentId===e.environmentId)return dT(GC.make(t),r)}for(let[t,r]of Object.entries(n.draftThreadsByThreadKey))if(!mT(r)&&r.projectId===e.projectId&&r.environmentId===e.environmentId)return dT(GC.make(t),r);return null},getDraftSession:e=>t().draftThreadsByThreadKey[e]??null,getDraftSessionByRef:e=>{for(let n of Object.values(t().draftThreadsByThreadKey))if(n.environmentId===e.environmentId&&n.threadId===e.threadId)return n;return null},getDraftThread:e=>typeof e==`string`?t().getDraftSession(GC.make(e)):t().getDraftSessionByRef(e),getDraftThreadByRef:e=>t().getDraftSessionByRef(e),listDraftThreadKeys:()=>Object.values(t().draftThreadsByThreadKey).filter(mw).map(e=>lo(oo(e.environmentId,e.threadId))),hasDraftThreadsInEnvironment:e=>Object.values(t().draftThreadsByThreadKey).some(t=>t.environmentId===e),createUnboundDraft:({executionTarget:e,draftId:t,threadId:r})=>(n(n=>({...n,draftThreadsByThreadKey:{...n.draftThreadsByThreadKey,[t]:{threadId:r,environmentId:null,projectId:null,logicalProjectKey:null,executionTarget:e,remoteDeviceId:null,runtimeKey:null,createdAt:new Date().toISOString(),runtimeMode:Gb,agent:Kb,designSystemId:pt,branch:null,worktreePath:null,envMode:`local`,startFromOrigin:!1,promotedTo:null}}})),{draftId:t,threadId:r}),setExecutionTarget:(e,t)=>{n(n=>{let r=n.draftThreadsByThreadKey[e];return!r||r.executionTarget===t?n:{draftThreadsByThreadKey:{...n.draftThreadsByThreadKey,[e]:{...r,executionTarget:t,selectedRepository:void 0,remoteDeviceId:null,runtimeKey:null,branch:null,worktreePath:null,envMode:`local`,startFromOrigin:!1}}}})},unbindDraftSession:(e,t)=>{n(n=>{let r=n.draftThreadsByThreadKey[e];return!r||mT(r)||!mw(r)&&r.executionTarget===t?n:{draftThreadsByThreadKey:{...n.draftThreadsByThreadKey,[e]:{...r,environmentId:null,projectId:null,logicalProjectKey:null,executionTarget:t,selectedRepository:void 0,remoteDeviceId:t===`remote`?r.remoteDeviceId:null,runtimeKey:t===r.executionTarget&&t!==`cloud`?r.runtimeKey:null,branch:null,worktreePath:null,envMode:`local`,startFromOrigin:!1}},logicalProjectDraftThreadKeyByLogicalProjectKey:Object.fromEntries(Object.entries(n.logicalProjectDraftThreadKeyByLogicalProjectKey).filter(([,t])=>t!==e))}})},setRuntimeKey:(e,t)=>{n(n=>{let r=n.draftThreadsByThreadKey[e];return!r||r.runtimeKey===t||r.executionTarget===`cloud`?n:{draftThreadsByThreadKey:{...n.draftThreadsByThreadKey,[e]:{...r,runtimeKey:t,selectedRepository:void 0,remoteDeviceId:t?.startsWith(`device:`)?t.slice(7):null,branch:null,worktreePath:null,envMode:`local`,startFromOrigin:!1}}}})},setRemoteDeviceId:(e,t)=>{n(n=>{let r=n.draftThreadsByThreadKey[e];return!r||r.remoteDeviceId===t?n:{draftThreadsByThreadKey:{...n.draftThreadsByThreadKey,[e]:{...r,remoteDeviceId:t,runtimeKey:t?`device:${t}`:null,selectedRepository:void 0,branch:null,worktreePath:null,envMode:`local`,startFromOrigin:!1,...t===null?{}:{executionTarget:`remote`}}}}})},setSelectedRepository:(e,t)=>{n(n=>{let r=n.draftThreadsByThreadKey[e];return!r||mT(r)?n:{draftThreadsByThreadKey:{...n.draftThreadsByThreadKey,[e]:{...r,selectedRepository:t??void 0}}}})},bindDraftSession:(e,n,r)=>{let i=rT(r??nT(n));if(i.length===0)return;let a=t().draftThreadsByThreadKey[e];a===void 0||mw(a)||t().setLogicalProjectDraftThreadId(i,n,e,{threadId:a.threadId,createdAt:a.createdAt,runtimeMode:a.runtimeMode,agent:a.agent,executionTarget:a.executionTarget})},setLogicalProjectDraftThreadId:(e,t,r,i)=>{let a=rT(e);a.length===0||r.length===0||n(e=>{let n=e.draftThreadsByThreadKey[r],o=e.logicalProjectDraftThreadKeyByLogicalProjectKey[a],s=fT(t,i?.threadId??n?.threadId??L.make(r),a,n,i),c=o===r,l=Object.entries(e.logicalProjectDraftThreadKeyByLogicalProjectKey).every(([e,t])=>t!==r||e===a);if(c&&l&&hT(n,s))return e;let u=Object.fromEntries(Object.entries(e.logicalProjectDraftThreadKeyByLogicalProjectKey).filter(([e,t])=>t!==r||e===a));u[a]=r;let d={...e.draftThreadsByThreadKey,[r]:s},f=e.draftsByThreadKey[r],p=e.draftsByThreadKey;if(n&&n.environmentId!==t.environmentId&&f!==void 0){let n=tw(f,t.environmentId);n!==f&&(p={...e.draftsByThreadKey,[r]:n})}let m=o===void 0?void 0:d[o];return o&&o!==r&&!uT(u,o)&&!mT(m)&&!pw(e.draftsByThreadKey[o])&&(delete d[o],e.draftsByThreadKey[o]!==void 0&&(p={...p},delete p[o])),{draftsByThreadKey:p,draftThreadsByThreadKey:d,logicalProjectDraftThreadKeyByLogicalProjectKey:u}})},setProjectDraftThreadId:(e,n,r)=>{t().setLogicalProjectDraftThreadId(nT(e),e,n,r)},setDraftThreadContext:(e,r)=>{let i=$(t(),e)??``;i.length!==0&&n(e=>{let t=e.draftThreadsByThreadKey[i];if(!t||!mw(t)&&r.projectRef===void 0)return e;let n=r.projectRef??{environmentId:t.environmentId,projectId:t.projectId};if(n.projectId===null||n.environmentId===null||n.projectId.length===0||n.environmentId.length===0)return e;let a=n.environmentId!==t.environmentId||n.projectId!==t.projectId,o=r.worktreePath===void 0?a?null:t.worktreePath:r.worktreePath??null,s=r.branch===void 0?a?null:t.branch:r.branch??null,c=r.startFromOrigin===void 0?t.startFromOrigin:r.startFromOrigin,l={threadId:t.threadId,environmentId:n.environmentId,projectId:n.projectId,logicalProjectKey:t.logicalProjectKey,executionTarget:t.executionTarget,remoteDeviceId:t.remoteDeviceId,runtimeKey:t.runtimeKey,createdAt:r.createdAt===void 0?t.createdAt:r.createdAt||t.createdAt,runtimeMode:r.runtimeMode??t.runtimeMode,agent:r.agent??t.agent,designSystemId:t.designSystemId,branch:s,worktreePath:o,envMode:r.envMode??(o?`worktree`:t.envMode??`local`),startFromOrigin:c,promotedTo:t.promotedTo??null};return l.environmentId===t.environmentId&&l.projectId===t.projectId&&l.logicalProjectKey===t.logicalProjectKey&&l.createdAt===t.createdAt&&l.runtimeMode===t.runtimeMode&&l.agent===t.agent&&l.branch===t.branch&&l.worktreePath===t.worktreePath&&l.envMode===t.envMode&&l.startFromOrigin===t.startFromOrigin&&pT(l.promotedTo,t.promotedTo)?e:{draftThreadsByThreadKey:{...e.draftThreadsByThreadKey,[i]:l}}})},clearProjectDraftThreadId:e=>{n(t=>{let n=Object.entries(t.draftThreadsByThreadKey).filter(([,t])=>t.projectId===e.projectId&&t.environmentId===e.environmentId).map(([e])=>e);if(n.length===0)return t;let r={draftsByThreadKey:t.draftsByThreadKey,draftThreadsByThreadKey:t.draftThreadsByThreadKey,logicalProjectDraftThreadKeyByLogicalProjectKey:t.logicalProjectDraftThreadKeyByLogicalProjectKey};for(let e of n)r=gT(r,e);return r})},clearProjectDraftThreadById:(e,r)=>{let i=$(t(),r)??``;i.length!==0&&n(t=>{let n=t.draftThreadsByThreadKey[i];return!n||n.projectId!==e.projectId||n.environmentId!==e.environmentId?t:gT(t,i)})},markDraftThreadPromoting:(e,r)=>{let i=$(t(),e);i&&n(e=>{let t=e.draftThreadsByThreadKey[i];if(!t||r===void 0&&!mw(t))return e;let n=r??oo(t.environmentId,t.threadId);return pT(t.promotedTo,n)?e:{draftThreadsByThreadKey:{...e.draftThreadsByThreadKey,[i]:{...t,promotedTo:n}}}})},finalizePromotedDraftThread:e=>{let r=$(t(),e)??``;r.length!==0&&n(e=>{let t=e.draftThreadsByThreadKey[r];return!t||!mT(t)?e:gT(e,r,t.promotedTo??void 0)})},clearDraftThread:e=>{let r=$(t(),e)??``;r.length!==0&&n(e=>{let t=e.draftThreadsByThreadKey[r]!==void 0,n=Object.values(e.logicalProjectDraftThreadKeyByLogicalProjectKey).includes(r),i=e.draftsByThreadKey[r]!==void 0;return!t&&!n&&!i?e:gT(e,r)})},setStickyModelSelection:e=>{let t=Ww(e);n(e=>{if(!t)return e;let n={...e.stickyModelSelectionByProvider,[t.instanceId]:t};return ut(e.stickyModelSelectionByProvider,n)?e.stickyActiveProvider===t.instanceId?e:{stickyActiveProvider:t.instanceId}:{stickyModelSelectionByProvider:n,stickyActiveProvider:t.instanceId}})},applyStickyState:e=>{let r=$(t(),e)??``;r.length!==0&&n(e=>{let t=e.stickyModelSelectionByProvider,n=e.stickyActiveProvider,i=e.draftsByThreadKey[r]??jw(),a=vw(t);if(ut(i.modelSelectionByProvider,a)&&i.activeProvider===n&&i.modelSelectionExplicit===void 0)return e;let{modelSelectionExplicit:o,...s}=i,c={...s,modelSelectionByProvider:a,activeProvider:n},l={...e.draftsByThreadKey};return Rw(c)?delete l[r]:l[r]=c,{draftsByThreadKey:l}})},setPrompt:(e,r)=>{let i=$(t(),e)??``,a=cT(t(),e);i.length!==0&&(n(e=>{let t={...e.draftsByThreadKey[i]??jw(),prompt:r},n={...e.draftsByThreadKey};return Rw(t)?delete n[i]:n[i]=t,{draftsByThreadKey:n}}),a&&Kx(a,r))},setTerminalContexts:(e,r)=>{let i=$(t(),e),a=cT(t(),e);if(!i||!a)return;let o=Lw(a,r);n(e=>{let t=e.draftsByThreadKey[i]??jw(),n={...t,prompt:Ix(t.prompt,o.length),terminalContexts:o},r={...e.draftsByThreadKey};return Rw(n)?delete r[i]:r[i]=n,{draftsByThreadKey:r}})},setModelSelection:(e,r,i)=>{let a=$(t(),e)??``;if(a.length===0)return;let o=Ww(r);n(e=>{let t=e.draftsByThreadKey[a];if(!t&&o===null)return e;let n=t??jw(),r={...n.modelSelectionByProvider};if(o){let e=r[o.instanceId];o.options!==void 0||i?.replaceOptions?r[o.instanceId]=o:r[o.instanceId]=mc(o.instanceId,o.model,e?.options)}let s=o?.instanceId??n.activeProvider;if(ut(n.modelSelectionByProvider,r)&&n.activeProvider===s&&(n.modelSelectionExplicit??!1)===(i?.explicit===!0))return e;let{modelSelectionExplicit:c,...l}=n,u={...l,modelSelectionByProvider:r,activeProvider:s,...i?.explicit===!0?{modelSelectionExplicit:!0}:{}},d={...e.draftsByThreadKey};return Rw(u)?delete d[a]:d[a]=u,{draftsByThreadKey:d}})},setModelOptions:(e,r)=>{let i=$(t(),e)??``;i.length!==0&&n(e=>{let t=e.draftsByThreadKey[i];if(!t&&(!r||Object.keys(r).length===0))return e;let n=t??jw(),a={...n.modelSelectionByProvider};for(let e of[`codex`,`claudeAgent`,`cursor`,`opencode`]){if(!r||!(e in r))continue;let t=r[e],n=je.make(e),i=d(n),o=a[i];if(t&&t.length>0)a[i]=mc(i,o?.model??rt[n]??`searchatlas-gateway/borg-fusion#medium`,t);else if(o?.options){let{options:e,...t}=o;a[i]=t}}if(ut(n.modelSelectionByProvider,a))return e;let o={...n,modelSelectionByProvider:a},s={...e.draftsByThreadKey};return Rw(o)?delete s[i]:s[i]=o,{draftsByThreadKey:s}})},setProviderModelOptions:(e,r,i,a)=>{let o=$(t(),e)??``;if(o.length===0)return;let s=zw(r);if(s===null)return;let c=a?.instanceId??d(s),l=sc(a?.model,s)??rt[s]??`searchatlas-gateway/borg-fusion#medium`,u=i&&i.length>0?i:void 0;n(e=>{let t=e.draftsByThreadKey[o]??jw(),n={...t.modelSelectionByProvider},r=n[c];if(u)n[c]=mc(c,r?.model??l,u);else if(r&&(r.options?.length??0)>0){let{options:e,...t}=r;n[c]=t}let i=e.stickyModelSelectionByProvider,s=e.stickyActiveProvider;if(a?.persistSticky===!0){i={...e.stickyModelSelectionByProvider};let n=i[c]??t.modelSelectionByProvider[c]??mc(c,l);if(u)i[c]=mc(c,n.model,u);else if((n.options?.length??0)>0){let{options:e,...t}=n;i[c]=t}s=a.instanceId?c:t.activeProvider??c}if(ut(t.modelSelectionByProvider,n)&&ut(e.stickyModelSelectionByProvider,i)&&e.stickyActiveProvider===s)return e;let{modelSelectionExplicit:d,...f}=t,p={...f,...a?.instanceId?{activeProvider:c}:{},modelSelectionByProvider:n,modelSelectionExplicit:!0},m={...e.draftsByThreadKey};return Rw(p)?delete m[o]:m[o]=p,{draftsByThreadKey:m,...a?.persistSticky===!0?{stickyModelSelectionByProvider:i,stickyActiveProvider:s}:{}}})},setRuntimeMode:(e,r)=>{let i=$(t(),e)??``;if(i.length===0)return;let a=LC(r)?r:null;n(e=>{let t=e.draftsByThreadKey[i];if(!t&&a===null)return e;let n=t??jw();if(n.runtimeMode===a)return e;let r={...n,runtimeMode:a},o={...e.draftsByThreadKey};return Rw(r)?delete o[i]:o[i]=r,{draftsByThreadKey:o}})},setDesignSystemId:(e,r)=>{let i=$(t(),e)??``;if(i.length===0)return;let a=r?.trim()||null;n(e=>{let t=e.draftsByThreadKey[i];if(!t&&a===null)return e;let n=t??jw();if(n.designSystemId===a)return e;let r={...n,designSystemId:a},o={...e.draftsByThreadKey};return Rw(r)?delete o[i]:o[i]=r,{draftsByThreadKey:o}})},setBorgProfileId:(e,r)=>{let i=$(t(),e)??``;if(i.length===0)return;let a=r?.trim()||null;n(e=>{let t=e.draftsByThreadKey[i];if(!t&&a===null)return e;let n=t??jw();if((n.borgProfileId??null)===a)return e;let r={...n,borgProfileId:a},o={...e.draftsByThreadKey};return Rw(r)?delete o[i]:o[i]=r,{draftsByThreadKey:o}})},setAgent:(e,r)=>{let i=$(t(),e)??``;if(i.length===0)return;let a=RC(r)?r:null;n(e=>{let t=e.draftsByThreadKey[i];if(!t&&a===null)return e;let n=t??jw();if(n.agent===a)return e;let r={...n,agent:a},o={...e.draftsByThreadKey};return Rw(r)?delete o[i]:o[i]=r,{draftsByThreadKey:o}})},addImage:(e,n)=>{let r=$(t(),e),i=cT(t(),e);!r||!i||t().addImages(typeof e==`string`?GC.make(r):e,[n])},addImages:(e,r)=>{let i=$(t(),e)??``;i.length===0||r.length===0||n(e=>{let t=e.draftsByThreadKey[i]??jw(),n=new Set(t.images.map(e=>e.id)),a=new Set(t.images.map(e=>Mw(e))),o=new Set(t.images.map(e=>e.previewUrl)),s=[],c=new Set;for(let e of r){let r=Mw(e);if(n.has(e.id)||a.has(r)){o.has(e.previewUrl)||Xw(e.previewUrl);continue}let i=t.files.find(t=>ew(t)&&!c.has(t.id)&&t.name===e.name&&t.mimeType===e.mimeType&&t.sizeBytes===e.sizeBytes);if(t.images.length+t.files.length-c.size-+!!i+s.length>=8){o.has(e.previewUrl)||Xw(e.previewUrl);continue}s.push(e),i&&c.add(i.id),n.add(e.id),a.add(r),o.add(e.previewUrl)}return s.length===0?e:{draftsByThreadKey:{...e.draftsByThreadKey,[i]:{...t,images:[...t.images,...s],files:t.files.filter(e=>!c.has(e.id))}}}})},removeImage:(e,r)=>{let i=$(t(),e)??``;if(i.length===0)return;let a=t().draftsByThreadKey[i];if(!a)return;let o=a.images.find(e=>e.id===r);o&&Xw(o.previewUrl),n(e=>{let t=e.draftsByThreadKey[i];if(!t)return e;let n={...t,images:t.images.filter(e=>e.id!==r),nonPersistedImageIds:t.nonPersistedImageIds.filter(e=>e!==r),persistedAttachments:t.persistedAttachments.filter(e=>e.id!==r)},a={...e.draftsByThreadKey};return Rw(n)?delete a[i]:a[i]=n,{draftsByThreadKey:a}})},addFiles:(e,r)=>{let i=$(t(),e)??``;i.length===0||r.length===0||n(e=>{let t=e.draftsByThreadKey[i]??jw(),n=new Set(t.files.map(e=>e.id)),a=new Map(t.files.map(e=>[Nw(e),e])),o=[],s=new Map;for(let e of r){let r=Nw(e);if(n.has(e.id))continue;let i=a.get(r)??t.files.find(t=>ew(t)&&!s.has(t.id)&&Pw(t,e));if(i){ew(i)&&!s.has(i.id)&&(s.set(i.id,e),n.add(e.id),a.set(r,e));continue}if(t.images.length+t.files.length+o.length>=8)break;o.push(e),n.add(e.id),a.set(r,e)}if(o.length===0&&s.size===0)return e;let c=t.files.map(e=>s.get(e.id)??e);return{draftsByThreadKey:{...e.draftsByThreadKey,[i]:{...t,files:[...c,...o]}}}})},removeFile:(e,r)=>{let i=$(t(),e)??``;i.length!==0&&n(e=>{let t=e.draftsByThreadKey[i];if(!t?.files.some(e=>e.id===r))return e;let n={...t,files:t.files.filter(e=>e.id!==r)},a={...e.draftsByThreadKey};return Rw(n)?delete a[i]:a[i]=n,{draftsByThreadKey:a}})},setFileUpload:(e,r,i,a)=>{let o=$(t(),e)??``;o.length!==0&&n(e=>{let t=e.draftsByThreadKey[o],n=t?.files.find(e=>e.id===r);return!t||!n||n.uploadEnvironmentId===i&&n.uploadedAttachmentId===a?e:{draftsByThreadKey:{...e.draftsByThreadKey,[o]:{...t,files:t.files.map(e=>e.id===r?{...e,uploadedAttachmentId:a,uploadEnvironmentId:i}:e)}}}})},markFileUploadMissing:(e,r,i,a)=>{let o=$(t(),e)??``;if(o.length===0)return!1;let s=!1;return n(e=>{let t=e.draftsByThreadKey[o],n=t?.files.find(e=>e.id===r);return!t||!n||n.file!==null||n.uploadEnvironmentId!==i||n.uploadedAttachmentId!==a?e:(s=!0,{draftsByThreadKey:{...e.draftsByThreadKey,[o]:{...t,files:t.files.map(e=>{if(e.id!==r)return e;let t={...e};return delete t.uploadedAttachmentId,delete t.uploadEnvironmentId,t})}}})}),s},insertTerminalContext:(e,r,i,a)=>{let o=$(t(),e),s=cT(t(),e);if(!o||!s)return!1;let c=!1;return n(e=>{let t=e.draftsByThreadKey[o]??jw(),n=Iw(s,i);if(!n)return e;let l=Fw(n);if(t.terminalContexts.some(e=>e.id===n.id)||t.terminalContexts.some(e=>Fw(e)===l))return e;c=!0;let u=Math.max(0,Math.min(t.terminalContexts.length,a)),d={...t,prompt:r,terminalContexts:[...t.terminalContexts.slice(0,u),n,...t.terminalContexts.slice(u)]};return{draftsByThreadKey:{...e.draftsByThreadKey,[o]:d}}}),c},addTerminalContext:(e,n)=>{let r=$(t(),e),i=cT(t(),e);!r||!i||t().addTerminalContexts(typeof e==`string`?GC.make(r):e,[n])},addTerminalContexts:(e,r)=>{let i=$(t(),e),a=cT(t(),e);!i||!a||r.length===0||n(e=>{let t=e.draftsByThreadKey[i]??jw(),n=Lw(a,[...t.terminalContexts,...r]).slice(t.terminalContexts.length);return n.length===0?e:{draftsByThreadKey:{...e.draftsByThreadKey,[i]:{...t,prompt:Ix(t.prompt,t.terminalContexts.length+n.length),terminalContexts:[...t.terminalContexts,...n]}}}})},removeTerminalContext:(e,r)=>{let i=$(t(),e)??``;i.length===0||r.length===0||n(e=>{let t=e.draftsByThreadKey[i];if(!t)return e;let n={...t,terminalContexts:t.terminalContexts.filter(e=>e.id!==r)},a={...e.draftsByThreadKey};return Rw(n)?delete a[i]:a[i]=n,{draftsByThreadKey:a}})},clearTerminalContexts:e=>{let r=$(t(),e)??``;r.length!==0&&n(e=>{let t=e.draftsByThreadKey[r];if(!t||t.terminalContexts.length===0)return e;let n={...t,terminalContexts:[]},i={...e.draftsByThreadKey};return Rw(n)?delete i[r]:i[r]=n,{draftsByThreadKey:i}})},addElementContext:(e,r)=>{let i=$(t(),e),a=cT(t(),e);if(!i||!a)return!1;let o=!1;return n(e=>{let t=e.draftsByThreadKey[i]??jw(),n=ix(r);if(t.elementContexts.some(e=>ix(e)===n))return e;o=!0;let s={...r,id:gx(),threadId:a,pickedAt:new Date().toISOString()};return{draftsByThreadKey:{...e.draftsByThreadKey,[i]:{...t,elementContexts:[...t.elementContexts,s]}}}}),o},setElementContexts:(e,r)=>{let i=$(t(),e);i&&n(e=>{let t={...e.draftsByThreadKey[i]??jw(),elementContexts:[...r]},n={...e.draftsByThreadKey};return Rw(t)?delete n[i]:n[i]=t,{draftsByThreadKey:n}})},removeElementContext:(e,r)=>{let i=$(t(),e)??``;i.length===0||r.length===0||n(e=>{let t=e.draftsByThreadKey[i];if(!t)return e;let n=t.elementContexts.filter(e=>e.id!==r);if(n.length===t.elementContexts.length)return e;let a={...t,elementContexts:n},o={...e.draftsByThreadKey};return Rw(a)?delete o[i]:o[i]=a,{draftsByThreadKey:o}})},clearElementContexts:e=>{let r=$(t(),e)??``;r.length!==0&&n(e=>{let t=e.draftsByThreadKey[r];if(!t||t.elementContexts.length===0)return e;let n={...t,elementContexts:[]},i={...e.draftsByThreadKey};return Rw(n)?delete i[r]:i[r]=n,{draftsByThreadKey:i}})},addPreviewAnnotation:(e,r)=>{let i=$(t(),e);i&&n(e=>{let t=e.draftsByThreadKey[i]??jw(),n=t.previewAnnotations.filter(e=>e.id!==r.id),a={...r,screenshot:r.screenshot?{...r.screenshot,dataUrl:``}:null};return{draftsByThreadKey:{...e.draftsByThreadKey,[i]:{...t,previewAnnotations:[...n,a]}}}})},setPreviewAnnotations:(e,r)=>{let i=$(t(),e);i&&n(e=>{let t=e.draftsByThreadKey[i]??jw();return{draftsByThreadKey:{...e.draftsByThreadKey,[i]:{...t,previewAnnotations:[...r]}}}})},removePreviewAnnotation:(e,r)=>{let i=$(t(),e);!i||!r||n(e=>{let t=e.draftsByThreadKey[i];if(!t)return e;let n=t.previewAnnotations.filter(e=>e.id!==r);if(n.length===t.previewAnnotations.length)return e;let a={...t,previewAnnotations:n,images:t.images.filter(e=>e.id!==r),persistedAttachments:t.persistedAttachments.filter(e=>e.id!==r),nonPersistedImageIds:t.nonPersistedImageIds.filter(e=>e!==r)},o={...e.draftsByThreadKey};return Rw(a)?delete o[i]:o[i]=a,{draftsByThreadKey:o}})},addReviewComment:(e,r)=>{let i=$(t(),e);!i||!BC(r)||n(e=>{let t=e.draftsByThreadKey[i]??jw(),n=t.reviewComments.filter(e=>e.id!==r.id);return{draftsByThreadKey:{...e.draftsByThreadKey,[i]:{...t,reviewComments:[...n,{...r}]}}}})},setReviewComments:(e,r)=>{let i=$(t(),e);if(!i)return;let a=r.filter(BC).map(e=>({...e}));n(e=>{let t={...e.draftsByThreadKey[i]??jw(),reviewComments:a},n={...e.draftsByThreadKey};return Rw(t)?delete n[i]:n[i]=t,{draftsByThreadKey:n}})},removeReviewComment:(e,r)=>{let i=$(t(),e);!i||!r||n(e=>{let t=e.draftsByThreadKey[i];if(!t)return e;let n=t.reviewComments.filter(e=>e.id!==r);if(n.length===t.reviewComments.length)return e;let a={...t,reviewComments:n},o={...e.draftsByThreadKey};return Rw(a)?delete o[i]:o[i]=a,{draftsByThreadKey:o}})},clearPersistedAttachments:e=>{let r=$(t(),e)??``;r.length!==0&&n(e=>{let t=e.draftsByThreadKey[r];if(!t)return e;let n={...t,persistedAttachments:[],nonPersistedImageIds:[]},i={...e.draftsByThreadKey};return Rw(n)?delete i[r]:i[r]=n,{draftsByThreadKey:i}})},syncPersistedAttachments:(e,r)=>{let i=$(t(),e);if(!i)return;let a=new Set(r.map(e=>e.id));n(e=>{let t=e.draftsByThreadKey[i];if(!t)return e;let n={...t,persistedAttachments:r,nonPersistedImageIds:t.nonPersistedImageIds.filter(e=>!a.has(e))},o={...e.draftsByThreadKey};return Rw(n)?delete o[i]:o[i]=n,{draftsByThreadKey:o}}),Promise.resolve().then(()=>{DT(i,r,n)})},clearComposerContent:e=>{let r=$(t(),e)??``;r.length!==0&&n(e=>{let t=e.draftsByThreadKey[r];if(!t)return e;let n={...t,prompt:``,images:[],files:[],nonPersistedImageIds:[],persistedAttachments:[],terminalContexts:[],elementContexts:[],previewAnnotations:[],reviewComments:[]},i={...e.draftsByThreadKey};return Rw(n)?delete i[r]:i[r]=n,{draftsByThreadKey:i}})},clearComposerPromptAndImages:e=>{let r=$(t(),e)??``;r.length!==0&&n(e=>{let t=e.draftsByThreadKey[r];if(!t)return e;for(let e of t.images)Xw(e.previewUrl);let n={...t,prompt:Ix(``,t.terminalContexts.length),images:[],files:[],nonPersistedImageIds:[],persistedAttachments:[]},i={...e.draftsByThreadKey};return Rw(n)?delete i[r]:i[r]=n,{draftsByThreadKey:i}})}}},{name:HC,version:UC,storage:$x(()=>QC),migrate:CT,partialize:wT,onRehydrateStorage:()=>e=>{e&&ZC.recordOwnEntries(HC,UC,wT(e))},merge:(e,t)=>{let n=ST(TT(e)),r=Object.fromEntries(Object.entries(n.draftsByThreadKey).map(([e,t])=>[e,AT(t)])),i=Object.fromEntries(Object.entries(n.draftThreadsByThreadKey).map(([e,t])=>[e,jT(t)]));return{...t,draftsByThreadKey:r,draftThreadsByThreadKey:i,logicalProjectDraftThreadKeyByLogicalProjectKey:n.logicalProjectDraftThreadKeyByLogicalProjectKey,stickyModelSelectionByProvider:n.stickyModelSelectionByProvider??{},stickyActiveProvider:n.stickyActiveProvider??null}}})),NT=MT;function PT(e){let t=FT(VS({synced:ZC.synced(HC),ours:JSON.stringify({state:wT(MT.getState()),version:UC}),theirs:e,fields:XC}));if(t===null||e===null)return;let n=TT(JSON.parse(e).state);MT.setState(e=>{let r={...e.draftsByThreadKey};for(let e of Object.keys(t.draftsByThreadKey??{})){let t=n.draftsByThreadKey[e];Zw(r[e]),t===void 0?delete r[e]:r[e]=AT(t)}let i={...e.draftThreadsByThreadKey};for(let e of Object.keys(t.draftThreadsByThreadKey??{})){let t=n.draftThreadsByThreadKey[e];t===void 0?delete i[e]:i[e]=jT(t)}let a={...e.logicalProjectDraftThreadKeyByLogicalProjectKey};for(let e of Object.keys(t.logicalProjectDraftThreadKeyByLogicalProjectKey??{})){let t=n.logicalProjectDraftThreadKeyByLogicalProjectKey[e];t===void 0?delete a[e]:a[e]=t}return{draftsByThreadKey:r,draftThreadsByThreadKey:i,logicalProjectDraftThreadKeyByLogicalProjectKey:a}});let r=wT(MT.getState());ZC.recordOwnEntries(HC,UC,Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Object.fromEntries(Object.keys(t).map(t=>[t,r[e][t]]))])))}function FT(e){if(e===null)return null;let t=e=>typeof e==`string`&&JC(e)!==null,n=MT.getState().logicalProjectDraftThreadKeyByLogicalProjectKey,r={};for(let[i,a]of Object.entries(e)){let e=Object.entries(a).filter(([e,r])=>i===`logicalProjectDraftThreadKeyByLogicalProjectKey`?!t(r)&&!t(n[e]):!t(e));e.length>0&&(r[i]=Object.fromEntries(e))}return Object.keys(r).length>0?r:null}typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`storage`,e=>{e.key===HC&&PT(e.newValue)});function IT(e){let t=lo(e);NT.setState(e=>e.backgroundSubmissionThreadKeys[t]?e:{backgroundSubmissionThreadKeys:{...e.backgroundSubmissionThreadKeys,[t]:!0}})}function LT(e){let t=lo(e);NT.setState(e=>{if(!e.backgroundSubmissionThreadKeys[t])return e;let n={...e.backgroundSubmissionThreadKeys};return delete n[t],{backgroundSubmissionThreadKeys:n}})}function RT(e){let t=(0,ro.c)(4),n;t[0]===e?n=t[1]:(n=e?lo(e):null,t[0]=e,t[1]=n);let r=n,i;return t[2]===r?i=t[3]:(i=e=>r!==null&&e.backgroundSubmissionThreadKeys[r]===!0,t[2]=r,t[3]=i),NT(i)}function zT(e,t){NT.setState(n=>{let r=n.cloudResumeSendsByThreadId[e.threadId];if(t===null&&r?.environmentId!==e.environmentId)return n;let{[e.threadId]:i,...a}=n.cloudResumeSendsByThreadId;return{cloudResumeSendsByThreadId:t===null?a:{...a,[e.threadId]:{...e,implementPlanId:t.implementPlanId}}}})}function BT(e,t,n){let r=Object.entries(e),i=r.filter(([e])=>t(e)===e),a=r.filter(([e])=>t(e)!==e).map(([r,i])=>{let a=t(r),o=e[a];if(pw(o)&&pw(i))throw Error(`The resumed thread already has an unsent draft. Both drafts were kept.`);return[a,o&&pw(o)?o:tw(i,n)]});return Object.fromEntries([...i,...a])}function VT(e,t){if(e===t)return;let n=n=>{let r=po(n);return r?.environmentId===e?lo(oo(t,r.threadId)):n},r=n=>{let r=n===null?null:fo(n);return r?.environmentId===e?co(ao(t,r.projectId)):n};NT.setState(i=>({draftsByThreadKey:BT(i.draftsByThreadKey,n,t),draftThreadsByThreadKey:Object.fromEntries(Object.entries(i.draftThreadsByThreadKey).map(([i,a])=>[n(i),a.environmentId===e?{...a,environmentId:t,logicalProjectKey:r(a.logicalProjectKey)}:a])),logicalProjectDraftThreadKeyByLogicalProjectKey:Object.fromEntries(Object.entries(i.logicalProjectDraftThreadKeyByLogicalProjectKey).map(([e,t])=>[r(e),n(t)])),backgroundSubmissionThreadKeys:Object.fromEntries(Object.entries(i.backgroundSubmissionThreadKeys).map(([e,t])=>[n(e),t])),cloudResumeSendsByThreadId:Object.fromEntries(Object.entries(i.cloudResumeSendsByThreadId).map(([n,r])=>[n,r.environmentId===e?{...r,environmentId:t}:r]))})),QC.flush()}function HT(e,t){if(t!==void 0){VT(e,t);return}NT.setState(t=>{let n=new Set;for(let[r,i]of Object.entries(t.draftThreadsByThreadKey))i.environmentId===e&&n.add(r);for(let r of Object.keys(t.draftsByThreadKey))po(r)?.environmentId===e&&n.add(r);for(let[r,i]of Object.entries(t.logicalProjectDraftThreadKeyByLogicalProjectKey))fo(r)?.environmentId===e&&n.add(i);let r=Object.fromEntries(Object.entries(t.logicalProjectDraftThreadKeyByLogicalProjectKey).filter(([t,r])=>fo(t)?.environmentId!==e&&!n.has(r))),i=Object.fromEntries(Object.entries(t.draftThreadsByThreadKey).filter(([t,r])=>r.environmentId!==e&&!n.has(t)));return{draftsByThreadKey:Object.fromEntries(Object.entries(t.draftsByThreadKey).filter(([e,t])=>n.has(e)?(Zw(t),!1):!0)),draftThreadsByThreadKey:i,logicalProjectDraftThreadKeyByLogicalProjectKey:r,backgroundSubmissionThreadKeys:Object.fromEntries(Object.entries(t.backgroundSubmissionThreadKeys).filter(([t])=>po(t)?.environmentId!==e)),cloudResumeSendsByThreadId:Object.fromEntries(Object.entries(t.cloudResumeSendsByThreadId).filter(([,t])=>t.environmentId!==e))}}),QC.flush()}function UT(e){let t=(0,ro.c)(2),n;return t[0]===e?n=t[1]:(n=t=>lT(t,e)??Aw,t[0]=e,t[1]=n),NT(n)}function WT(e){let t=(0,ro.c)(2),n;return t[0]===e?n=t[1]:(n=t=>{let n=lT(t,e);return n?{activeProvider:n.activeProvider,modelSelectionByProvider:n.modelSelectionByProvider}:kw},t[0]=e,t[1]=n),NT(sS(n))}function GT(e){let t=(0,ro.c)(11),n;t[0]!==e.draftId||t[1]!==e.threadRef?(n=e.threadRef??e.draftId??GC.make(``),t[0]=e.draftId,t[1]=e.threadRef,t[2]=n):n=t[2];let r=WT(n),i;return t[3]!==r||t[4]!==e.projectModelSelection||t[5]!==e.providers||t[6]!==e.selectedInstanceId||t[7]!==e.selectedProvider||t[8]!==e.settings||t[9]!==e.threadModelSelection?(i=Yw({draft:r,providers:e.providers,selectedProvider:e.selectedProvider,selectedInstanceId:e.selectedInstanceId,threadModelSelection:e.threadModelSelection,projectModelSelection:e.projectModelSelection,settings:e.settings}),t[3]=r,t[4]=e.projectModelSelection,t[5]=e.providers,t[6]=e.selectedInstanceId,t[7]=e.selectedProvider,t[8]=e.settings,t[9]=e.threadModelSelection,t[10]=i):i=t[10],i}function KT(e){let t=NT.getState();for(let[n,r]of Object.entries(t.draftThreadsByThreadKey))r.environmentId===e.environmentId&&r.threadId===e.threadId&&t.markDraftThreadPromoting(GC.make(n),e)}function qT(e){let t=NT.getState();for(let[n,r]of Object.entries(t.draftThreadsByThreadKey)){let i=r.promotedTo;if(i?i.environmentId===e.environmentId&&i.threadId===e.threadId:r.environmentId===e.environmentId&&r.threadId===e.threadId){let r=GC.make(n);t.markDraftThreadPromoting(r,e),t.finalizePromotedDraftThread(r)}}LT(e)}function JT(...e){return Us(_o(e))}function YT(e){return/mac|iphone|ipad|ipod/i.test(e)}function XT(e){return/^win(dows)?/i.test(e)}function ZT(e){return e.normalize(`NFKD`).replace(/\p{M}/gu,``).toLowerCase().replace(/\s+/g,` `).trim()}function QT(e){return YT(e)?`Finder`:XT(e)?`Explorer`:`Files`}function $T(e){return st(globalThis.crypto.getRandomValues(new Uint8Array(e)))}function eE(){let e=globalThis.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=st(e);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}var tE=()=>Ke.make(eE()),nE=()=>un.make(eE()),rE=()=>L.make(eE()),iE=()=>GC.make(eE()),aE=()=>oe.make(eE());export{$S as $,Uc as $a,gd as $i,uv as $n,$n as $o,Q as $r,vb as $t,mw as A,Bl as Aa,_f as Ai,Jv as An,Fi as Ao,Ug as Ar,_x as At,FC as B,su as Ba,Wd as Bi,Wv as Bn,jr as Bo,og as Br,Wb as Bt,pw as C,Ul as Ca,op as Ci,oy as Cn,Ia as Co,c_ as Cr,Ex as Ct,iT as D,Kl as Da,bf as Di,ey as Dn,Gi as Do,e_ as Dr,zx as Dt,ew as E,Gl as Ea,Sf as Ei,ty as En,oa as Eo,g_ as Er,Bx as Et,NT as F,zl as Fa,lf as Fi,Rv as Fn,xi as Fo,Tg as Fr,Gb as Ft,yC as G,Al as Ga,jd as Gi,jv as Gn,_r as Go,mg as Gr,xb as Gt,IC as H,wl as Ha,Bd as Hi,qv as Hn,Dr as Ho,dg as Hr,Vb as Ht,UT as I,eu as Ia,ef as Ii,Fv as In,Si as Io,_g as Ir,qb as It,tC as J,ul as Ja,Od as Ji,Sv as Jn,pr as Jo,ng as Jr,db as Jt,jC as K,gl as Ka,kd as Ki,Av as Kn,cr as Ko,sg as Kr,Db as Kt,GT as L,Rl as La,Y as Li,Bv as Ln,bi as Lo,vg as Lr,Yb as Lt,Xw as M,Ql as Ma,X as Mi,zv as Mn,Ni as Mo,Pg as Mr,cx as Mt,zT as N,iu as Na,ff as Ni,Lv as Nn,Ti as No,Ng as Nr,rx as Nt,qT as O,Jl as Oa,xf as Oi,ry as On,Oi as Oo,Qg as Or,px as Ot,RT as P,Fl as Pa,uf as Pi,Hv as Pn,Ei as Po,Og as Pr,Kb as Pt,QS as Q,Gc as Qa,_d as Qi,dv as Qn,nr as Qo,Jh as Qr,rb as Qt,lC as R,Ll as Ra,tf as Ri,Vv as Rn,yi as Ro,wg as Rr,Jb as Rt,HT as S,ou as Sa,Qf as Si,ly as Sn,Ka as So,f_ as Sr,Dx as St,Pw as T,ql as Ta,Ef as Ti,cy as Tn,ga as To,h_ as Tr,Sx as Tt,bC as U,Ml as Ua,Vd as Ui,Kv as Un,or as Uo,fg as Ur,Bb as Ut,wC as V,Cl as Va,Hd as Vi,Gv as Vn,kr as Vo,lg as Vr,Rb as Vt,TC as W,jl as Wa,Md as Wi,Pv as Wn,hr as Wo,pg as Wr,Hb as Wt,ZS as X,Jc as Xa,bd as Xi,bv as Xn,sr as Xo,Zh as Xr,lb as Xt,oC as Y,Xc as Ya,wd as Yi,xv as Yn,mr as Yo,tg as Yr,ub as Yt,eC as Z,Wc as Za,xd as Zi,fv as Zn,er as Zo,qh as Zr,nb as Zt,sw as _,Vl as _a,ip as _i,_y as _n,oo as _o,d_ as _r,Gx as _t,tE as a,Xu as aa,ym as ai,Qy as an,Sc as ao,V_ as ar,KS as at,JC as b,Zl as ba,ep as bi,py as bn,io as bo,s_ as br,Nx as bt,nE as c,J as ca,um as ci,Dy as cn,Ys as co,M_ as cr,XS as ct,$T as d,pu as da,Qp as di,Ay as dn,sc as do,y_ as dr,NS as dt,dd as ea,bh as ei,yb as en,Nc as eo,ov as er,rr as es,aC as et,eE as f,K as fa,rm as fi,jy as fn,hc as fo,n_ as fr,AS as ft,$C as g,Hl as ga,tp as gi,by as gn,ao as go,t_ as gr,Qx as gt,nw as h,tu as ha,rp as hi,xy as hn,po as ho,i_ as hr,tS as ht,XT as i,Zu as ia,vm as ii,Zy as in,Cc as io,H_ as ir,US as it,KT as j,$l as ja,gf as ji,Nv as jn,Ii as jo,Ig as jr,ox as jt,kT as k,Yl as ka,Z as ki,Xv as kn,Ri as ko,Wg as kr,fx as kt,rE as l,q as la,lm as li,ky as ln,Gs as lo,D_ as lr,YS as lt,rw as m,cu as ma,im as mi,wy as mn,vo as mo,r_ as mr,$x as mt,QT as n,ed as na,km as ni,ob as nn,Ec as no,$_ as nr,ir as ns,rC as nt,iE as o,Uu as oa,_m as oi,eb as on,gc as oo,L_ as or,WS as ot,GC as p,gu as pa,nm as pi,Ty as pn,dc as po,u_ as pr,sS as pt,kC as q,yl as qa,Dd as qi,wv as qn,dr as qo,ug as qr,tb as qt,YT as r,Qu as ra,Om as ri,fb as rn,yc as ro,Z_ as rr,iC as rt,aE as s,Bu as sa,hm as si,Uy as sn,mc as so,F_ as sr,GS as st,JT as t,fd as ta,Nm as ti,gb as tn,Mc as to,av as tr,tr as ts,sC as tt,ZT as u,ku as ua,tm as ui,Oy as un,uc as uo,T_ as ur,jS as ut,IT as v,Wl as va,ap as vi,my as vn,co as vo,a_ as vr,Wx as vt,Nw as w,au as wa,Xf as wi,sy as wn,Ea as wo,l_ as wr,Rx as wt,LT as x,Xl as xa,$f as xi,dy as xn,no as xo,p_ as xr,Cx as xt,qC as y,ru as ya,np as yi,fy as yn,lo as yo,o_ as yr,jx as yt,CC as z,Il as za,Kd as zi,Uv as zn,Nr as zo,hg as zr,Xb as zt};
|
|
30
|
+
//# sourceMappingURL=utils-ClZ5OxbV.js.map
|