ryco-cli 0.1.6 → 0.1.7
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/{AzureDevOpsSourceControlProvider-6holYS_D.cjs → AzureDevOpsSourceControlProvider-5exivY-1.cjs} +2 -2
- package/dist/{AzureDevOpsSourceControlProvider-CC2_COxP.mjs → AzureDevOpsSourceControlProvider-CF5LuCHp.mjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-a0IsNFyG.cjs → BitbucketSourceControlProvider-1GWENqcl.cjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-CYR_BD1d.mjs → BitbucketSourceControlProvider-CKH09tfT.mjs} +2 -2
- package/dist/{ClaudeDriver-C6tQNEWO.cjs → ClaudeDriver-BXLdjrht.cjs} +177 -4
- package/dist/{ClaudeDriver-D3nsxwH9.mjs → ClaudeDriver-WwWFTu61.mjs} +178 -5
- package/dist/{CodexDriver-BILrJG8o.mjs → CodexDriver-93-TmCrO.mjs} +6 -5
- package/dist/{CodexDriver-ms_YgFD7.cjs → CodexDriver-BboMT9uk.cjs} +5 -4
- package/dist/{CodexTextGeneration-CHEgoANm.cjs → CodexTextGeneration-0pRbJji3.cjs} +2 -2
- package/dist/{CodexTextGeneration-BIKHl7E3.mjs → CodexTextGeneration-BU9Myn87.mjs} +3 -3
- package/dist/{CopilotDriver-CmD3Ffyl.mjs → CopilotDriver-BASi8pJ0.mjs} +4 -4
- package/dist/{CopilotDriver-B0--ZwIK.cjs → CopilotDriver-DCsv-17W.cjs} +3 -3
- package/dist/{CursorDriver-DTVPXZ-R.cjs → CursorDriver-BTSiM3A8.cjs} +161 -14
- package/dist/{CursorDriver-CbeaIbdb.mjs → CursorDriver-D5LvIqUk.mjs} +162 -15
- package/dist/{ForgejoSourceControlProvider-DwAog76b.cjs → ForgejoSourceControlProvider-BTXRDCGB.cjs} +2 -2
- package/dist/{ForgejoSourceControlProvider-DX6d9gvz.mjs → ForgejoSourceControlProvider-e-4hvvZ_.mjs} +2 -2
- package/dist/{GitHubSourceControlProvider-C-LGwho3.mjs → GitHubSourceControlProvider-26IofDAO.mjs} +2 -2
- package/dist/{GitHubSourceControlProvider-9lJFzjsu.cjs → GitHubSourceControlProvider-DWmwkA_y.cjs} +2 -2
- package/dist/{GitLabSourceControlProvider-CvKA74lg.cjs → GitLabSourceControlProvider-D-YHnxRe.cjs} +2 -2
- package/dist/{GitLabSourceControlProvider-CkeT2aEx.mjs → GitLabSourceControlProvider-DePct78W.mjs} +2 -2
- package/dist/{OpenCodeDriver-ClWtCk0j.mjs → OpenCodeDriver-BhvLOmvn.mjs} +325 -38
- package/dist/{OpenCodeDriver-CXUsnl5o.cjs → OpenCodeDriver-CVeZ4n9-.cjs} +324 -37
- package/dist/{SourceControlProviderDiscoveryCatalog-_rg0mc1o.cjs → SourceControlProviderDiscoveryCatalog-DeFR5xH3.cjs} +1 -64
- package/dist/{SourceControlProviderDiscoveryCatalog-yMDer_Yh.mjs → SourceControlProviderDiscoveryCatalog-mJV_Xitr.mjs} +3 -48
- package/dist/bin.cjs +1280 -519
- package/dist/bin.mjs +1234 -474
- package/dist/client/assets/{AnimatedHeight-DgItDSis.js → AnimatedHeight-BSU0lzYs.js} +1 -1
- package/dist/client/assets/AppearanceSettings-D7q0ujGK.js +1 -0
- package/dist/client/assets/{BranchToolbar.logic-C_xHEt9C.js → BranchToolbar.logic-CZIFSvhd.js} +1 -1
- package/dist/client/assets/ChatRightPanel-CWHOIuiQ.js +188 -0
- package/dist/client/assets/{ChatThreadRouteView-CV6ETYG5.js → ChatThreadRouteView-bA7xWXzc.js} +1 -1
- package/dist/client/assets/{CommandPaletteDialog-C_H7R8S5.js → CommandPaletteDialog-DNYaVOZO.js} +1 -1
- package/dist/client/assets/CompositeRoot-B_KEfCUE.js +1 -0
- package/dist/client/assets/ConnectionsSettings-CLZPbx_K.js +1 -0
- package/dist/client/assets/{DiagnosticsSettings-B340S_mq.js → DiagnosticsSettings-DtzPCb6N.js} +1 -1
- package/dist/client/assets/{DialogHandle-BJY7cHCV.js → DialogHandle-DuHnmWoE.js} +1 -1
- package/dist/client/assets/{DialogRoot-Ej1FVk-_.js → DialogRoot-BV25qAcA.js} +1 -1
- package/dist/client/assets/DialogTitle-DQsi-RTa.js +1 -0
- package/dist/client/assets/DialogTrigger-D0fA01C6.js +1 -0
- package/dist/client/assets/{DialogViewport-DvjAl76K.js → DialogViewport-CMV_BePU.js} +1 -1
- package/dist/client/assets/{DraftChatThreadRouteView-pOkyeKPS.js → DraftChatThreadRouteView-BoiKnrii.js} +1 -1
- package/dist/client/assets/{JetBrainsIcons-DTTF47I0.js → JetBrainsIcons-BcPxJlMf.js} +1 -1
- package/dist/client/assets/{KeybindingsSettings-CW3RRi-7.js → KeybindingsSettings-LuI98pdF.js} +1 -1
- package/dist/client/assets/McpServersSettings-BFMuWYVV.js +6 -0
- package/dist/client/assets/{NoActiveThreadState-DVHwrkCp.js → NoActiveThreadState-C2q_O1kP.js} +1 -1
- package/dist/client/assets/{OpinionatedPluginsSettings-Cjj23Fs4.js → OpinionatedPluginsSettings-Bqwct37O.js} +1 -1
- package/dist/client/assets/{ProjectFavicon-TDP7HRfn.js → ProjectFavicon-D2imiJ8M.js} +1 -1
- package/dist/client/assets/{ProviderUpdateLaunchNotification.logic-6TpFsmiI.js → ProviderUpdateLaunchNotification.logic-CJgA--nK.js} +1 -1
- package/dist/client/assets/ProvidersSettingsPanel-B97vbeu6.js +1 -0
- package/dist/client/assets/{RedactedSensitiveText-BfoVjPsE.js → RedactedSensitiveText-B2GFTyfq.js} +1 -1
- package/dist/client/assets/RootAppShell-C1xTR98P.js +12 -0
- package/dist/client/assets/SettingsDialog-Q0Q8O5oH.js +2 -0
- package/dist/client/assets/SourceControlSettings-KAvoPTNi.js +1 -0
- package/dist/client/assets/StatisticsPanel-BzsQ444K.js +64 -0
- package/dist/client/assets/{ThreadStatusIndicators-B0leIJGD.js → ThreadStatusIndicators-Cw_jLVQf.js} +1 -1
- package/dist/client/assets/{ThreadTerminalDrawer-COq2Fk17.js → ThreadTerminalDrawer-D1WnSemH.js} +17 -17
- package/dist/client/assets/ThreadWorkspacePanel-L4qCPTOA.js +166 -0
- package/dist/client/assets/{alert-dialog-lMfKpG2t.js → alert-dialog-CNmKa0BK.js} +1 -1
- package/dist/client/assets/chart-column-BWSKYZ_a.js +1 -0
- package/dist/client/assets/{chatThreadActions-PPyTj_x0.js → chatThreadActions-TtDsiwDC.js} +1 -1
- package/dist/client/assets/chevron-up-zopJ_99l.js +1 -0
- package/dist/client/assets/{clamp-JiD4IZ0Z.js → clamp-Ds6WJu8j.js} +1 -1
- package/dist/client/assets/{clipboard-copy-CYBLSG2q.js → clipboard-copy-BoJGpdmJ.js} +1 -1
- package/dist/client/assets/clock-CzUHThzk.js +1 -0
- package/dist/client/assets/{commandPaletteStore-uVfCD7zE.js → commandPaletteStore-KebG835b.js} +1 -1
- package/dist/client/assets/composerDraftStore-DpPEQ6BN.js +21 -0
- package/dist/client/assets/{desktopUpdateAtoms-X6uM5SoD.js → desktopUpdateAtoms-BQ0GGEfM.js} +1 -1
- package/dist/client/assets/{download-DLBlpp4h.js → download-CUiRE0N9.js} +1 -1
- package/dist/client/assets/{draft-input-dLlVMl5P.js → draft-input-CwpGDtoT.js} +1 -1
- package/dist/client/assets/editorPreferences-jN7DKbyt.js +1 -0
- package/dist/client/assets/{empty-DlLY-Hhj.js → empty-CBuXePtg.js} +1 -1
- package/dist/client/assets/{group-zDBPF7rR.js → group-BpZvxjG5.js} +1 -1
- package/dist/client/assets/{index-Dq8sT2lF.js → index-BKzXTNJ_.js} +2 -2
- package/dist/client/assets/{input-B9-RWT56.js → input-CgDawd6k.js} +1 -1
- package/dist/client/assets/kbd-QYSL97CK.js +1 -0
- package/dist/client/assets/{keybindings-Dx4Nc1vY.js → keybindings-CUTRYI_A.js} +1 -1
- package/dist/client/assets/{keyboard-DDTWQkr0.js → keyboard-DFFiI7JY.js} +1 -1
- package/dist/client/assets/{keyedQuery-Ds4OGhX2.js → keyedQuery-DiOCbGH0.js} +0 -0
- package/dist/client/assets/{main-DxfpmoKJ.js → main-BgFGju3e.js} +3 -3
- package/dist/client/assets/main-D0UFdwts.css +2 -0
- package/dist/client/assets/{palette-BQcz-ZYV.js → palette-BXCL909c.js} +1 -1
- package/dist/client/assets/{play-QloDGe4R.js → play-DI2LZohg.js} +1 -1
- package/dist/client/assets/plus-DzgIfHUF.js +1 -0
- package/dist/client/assets/projectAtoms-DXXpuERK.js +1 -0
- package/dist/client/assets/providerDriverMeta-CRNNp0q3.js +1 -0
- package/dist/client/assets/providerIconUtils-D-DFhem2.js +47 -0
- package/dist/client/assets/radio-group-_PPYg3YY.js +1 -0
- package/dist/client/assets/{refresh-cw-DkBMGllm.js → refresh-cw-BsQTNBXl.js} +1 -1
- package/dist/client/assets/{resolveAriaLabelledBy-DDfIbj05.js → resolveAriaLabelledBy-CRHo_s16.js} +1 -1
- package/dist/client/assets/{rightPanelRouteSearch-DfuWVvXN.js → rightPanelRouteSearch-CfmZ7osj.js} +1 -1
- package/dist/client/assets/{scale-BActunFu.js → scale-DDEJ-tvn.js} +1 -1
- package/dist/client/assets/{scroll-area-D-YOUG02.js → scroll-area-HgsI-ErG.js} +1 -1
- package/dist/client/assets/{separator-TInKeIDo.js → separator-ClnL4mUB.js} +1 -1
- package/dist/client/assets/{server-BtEG3NAw.js → server-Bbs3L-6_.js} +1 -1
- package/dist/client/assets/{session-logic-DNf1aXq_.js → session-logic-CKQkgIwo.js} +1 -1
- package/dist/client/assets/settingsDialogStore-SG-W1q0A.js +1 -0
- package/dist/client/assets/{settingsLayout-D22Mm0u3.js → settingsLayout-G5xVm-ZT.js} +1 -1
- package/dist/client/assets/sidebar-_u7SGgmC.js +1 -0
- package/dist/client/assets/sidebarStatusText-BTYnwflG.js +1 -0
- package/dist/client/assets/{skeleton-DWaac_qp.js → skeleton-CmUvhZGP.js} +1 -1
- package/dist/client/assets/{storeSelectors-Cx1IYPA4.js → storeSelectors-DhJRpdiw.js} +1 -1
- package/dist/client/assets/threadSelectionStore-ygmA4DNA.js +1 -0
- package/dist/client/assets/toast-DmA_ziPT.js +1 -0
- package/dist/client/assets/toggle-DGS7tKuj.js +1 -0
- package/dist/client/assets/{toggle-group-CnLjaHSL.js → toggle-group-Dtv1ZUFW.js} +1 -1
- package/dist/client/assets/{tokenModePresentation-BSYdIvBm.js → tokenModePresentation-Dor1DnBx.js} +1 -1
- package/dist/client/assets/{trash-2-BI5xcbsm.js → trash-2-C2G3VGoV.js} +1 -1
- package/dist/client/assets/{triangle-alert-DJef_Uvh.js → triangle-alert-Bpz3xGu5.js} +1 -1
- package/dist/client/assets/{undo-2-DeZ2cMGS.js → undo-2-C3rtxuqZ.js} +1 -1
- package/dist/client/assets/{useHandleNewThread-XB82O6SA.js → useHandleNewThread-ypSbzG0P.js} +1 -1
- package/dist/client/assets/useLabelableId-Bc7KEnHU.js +1 -0
- package/dist/client/assets/{useNavigate-B2tgshhW.js → useNavigate-_4hWGSey.js} +1 -1
- package/dist/client/assets/useTheme-HcKmBfpF.js +1 -0
- package/dist/client/assets/{vscode-icons-DM9qFoEr.js → vscode-icons-DdSTtxYd.js} +1 -1
- package/dist/client/assets/{wrench-je4QOyG-.js → wrench-C4jdis40.js} +1 -1
- package/dist/client/assets/x-CG2WU63t.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/{collectUint8StreamText-C2z5Y8tF.mjs → collectUint8StreamText-Lv4GGI79.mjs} +269 -14
- package/dist/{collectUint8StreamText-TCG6xW_P.cjs → collectUint8StreamText-uNXVRHOf.cjs} +291 -12
- package/dist/{makeManagedServerProvider-DPFw9gV_.cjs → makeManagedServerProvider-3SD-Q5xh.cjs} +1 -1
- package/dist/{makeManagedServerProvider-BXO8QvzC.mjs → makeManagedServerProvider-CkPEptun.mjs} +1 -1
- package/package.json +1 -1
- package/dist/client/assets/AppearanceSettings-BlsMFBvJ.js +0 -1
- package/dist/client/assets/ChatRightPanel-CThudBb1.js +0 -188
- package/dist/client/assets/CompositeRoot-DjnzUIwC.js +0 -1
- package/dist/client/assets/ConnectionsSettings-hArR4Oe3.js +0 -1
- package/dist/client/assets/DialogTitle-H1yIMmA9.js +0 -1
- package/dist/client/assets/DialogTrigger-BHMq_K2G.js +0 -1
- package/dist/client/assets/McpServersSettings-dQ3BzOWY.js +0 -6
- package/dist/client/assets/ProvidersSettingsPanel-D15EeWAq.js +0 -1
- package/dist/client/assets/RootAppShell-CWBPSA2w.js +0 -12
- package/dist/client/assets/SettingsDialog-oJCE5foT.js +0 -2
- package/dist/client/assets/SourceControlSettings-CPnlMxNm.js +0 -1
- package/dist/client/assets/ThreadWorkspacePanel-qF9y6QT9.js +0 -166
- package/dist/client/assets/composerDraftStore-D12lUSfh.js +0 -21
- package/dist/client/assets/editorPreferences-BLeEBSD_.js +0 -1
- package/dist/client/assets/folder-open-DMjz0lpx.js +0 -1
- package/dist/client/assets/kbd-aeSsjiPI.js +0 -1
- package/dist/client/assets/main-C57RhHZ_.css +0 -2
- package/dist/client/assets/plus-4Oy56d-3.js +0 -1
- package/dist/client/assets/projectAtoms-DUEBb7Zz.js +0 -1
- package/dist/client/assets/providerDriverMeta-Dwi6Zqgd.js +0 -1
- package/dist/client/assets/providerIconUtils-uhWb4bdg.js +0 -47
- package/dist/client/assets/radio-group-DHyQlLeX.js +0 -1
- package/dist/client/assets/settingsDialogStore-BINi7pdD.js +0 -1
- package/dist/client/assets/sidebar-DHwNQmWp.js +0 -1
- package/dist/client/assets/threadSelectionStore-C0ig4405.js +0 -1
- package/dist/client/assets/toast-DE7a4wkW.js +0 -1
- package/dist/client/assets/toggle-BIW4AyPY.js +0 -1
- package/dist/client/assets/useLabelableId-DBAgv9qQ.js +0 -1
- package/dist/client/assets/useTheme-Dv42Z8uy.js +0 -1
- package/dist/client/assets/x-fI9snvD3.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-PSPkXoKo.js";import{t as n}from"./compiler-runtime-BNrXlsa1.js";import{cn as r,sn as i}from"./projectAtoms-DUEBb7Zz.js";import{$ as a,A as o,Br as s,Gn as c,Hr as l,In as u,Jr as d,M as f,Ni as p,Nr as m,Pn as h,Sn as g,Sr as _,Un as v,Vr as y,Wr as b,X as x,Xn as S,Xr as C,Yn as w,_ as T,br as E,bt as D,cr as ee,h as te,j as ne,k as O,ki as re,nn as k,qr as A,rn as j,yr as M}from"./composerDraftStore-D12lUSfh.js";import{Gn as N,O as P,S as ie,Sr as F,b as I,c as L,i as ae,ir as R,l as z,ln as B,n as V,o as H,r as U,s as oe,t as W,u as se,x as G}from"./providerIconUtils-uhWb4bdg.js";import{t as K}from"./kbd-aeSsjiPI.js";import{g as ce,h as le,m as ue,p as de}from"./keybindings-Dx4Nc1vY.js";import{c as fe}from"./resolveAriaLabelledBy-DDfIbj05.js";import{a as pe,i as me,n as q,r as he,s as J,t as ge}from"./useLabelableId-DBAgv9qQ.js";import{t as _e}from"./scroll-area-D-YOUG02.js";import{t as ve}from"./modelPickerOpenState-BJxsqvdg.js";import{n as ye,t as be}from"./CompositeRoot-DjnzUIwC.js";var Y=C(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),xe=n(),X=p(),Z=e(t()),Q=Z.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function Se(e=!1){let t=Z.useContext(Q);if(!t&&!e)throw Error(b(86));return t}var Ce=Z.createContext({disabled:!1});function we(){return Z.useContext(Ce)}var Te=360,Ee=10080,De=360;function Oe(e){return!Number.isFinite(e)||e<0?0:e>100?100:e}function ke(e){return 100-Oe(e)}function Ae(e){let t=e.windowDurationMins;if(typeof t!=`number`||!Number.isFinite(t)||t<=0)return{label:`Window`,bucket:`other`};if(t<=Te)return{label:`${Math.max(1,Math.round(t/60))}h`,bucket:`short`};if(t>=Ee-De)return{label:`Weekly`,bucket:`week`};let n=Math.round(t/1440);return n>=1?{label:`${n}d`,bucket:`other`}:{label:`${Math.max(1,Math.round(t/60))}h`,bucket:`other`}}function je(e){return typeof e!=`number`||!Number.isFinite(e)||e<=0?null:N(new Date(e*1e3).toISOString())}function Me(e){let t=je(e);return t===null?null:t===`Expired`?`expired`:`resets in ${t.replace(/ left$/,``)}`}var Ne=(0,Z.memo)(function(e){let t=(0,xe.c)(45),n=W[e.driverKind]??null,r=e.model.subProvider?`${e.providerDisplayName} · ${e.model.subProvider}`:e.providerDisplayName,i=e.index,a=`${e.instanceId}:${e.model.slug}`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=_(`w-full cursor-pointer rounded px-3 py-2 transition-colors group`,`data-highlighted:bg-muted data-selected:bg-accent data-selected:text-foreground`),t[0]=s):s=t[0];let c;t[1]===e?c=t[2]:(c=t=>{t.stopPropagation(),e.onToggleFavorite()},t[1]=e,t[2]=c);let l=e.isFavorite?`Remove from favorites`:`Add to favorites`,u=e.isFavorite&&`fill-current text-yellow-500`,d;t[3]===u?d=t[4]:(d=_(`size-4`,u),t[3]=u,t[4]=d);let p;t[5]===d?p=t[6]:(p=(0,X.jsx)(Y,{className:d}),t[5]=d,t[6]=p);let m;t[7]!==c||t[8]!==l||t[9]!==p?(m=(0,X.jsx)(f,{render:(0,X.jsx)(`button`,{className:`mt-0.5 shrink-0 cursor-pointer opacity-40 transition-opacity group-hover:opacity-100`,onClick:c,onKeyDown:Pe,type:`button`,"aria-label":l,children:p})}),t[7]=c,t[8]=l,t[9]=p,t[10]=m):m=t[10];let h=e.isFavorite?`Remove from favorites`:`Add to favorites`,g;t[11]===h?g=t[12]:(g=(0,X.jsx)(o,{side:`top`,align:`center`,children:h}),t[11]=h,t[12]=g);let v;t[13]!==g||t[14]!==m?(v=(0,X.jsxs)(O,{children:[m,g]}),t[13]=g,t[14]=m,t[15]=v):v=t[15];let y;t[16]!==e.model||t[17]!==e.preferShortName||t[18]!==e.useTriggerLabel?(y=e.useTriggerLabel?U(e.model):V(e.model,e.preferShortName?{preferShortName:!0}:void 0),t[16]=e.model,t[17]=e.preferShortName,t[18]=e.useTriggerLabel,t[19]=y):y=t[19];let b;t[20]===y?b=t[21]:(b=(0,X.jsx)(`span`,{className:`truncate`,children:y}),t[20]=y,t[21]=b);let x;t[22]===e.showNewBadge?x=t[23]:(x=e.showNewBadge?(0,X.jsx)(`span`,{className:`shrink-0 rounded border border-amber-500/35 bg-amber-500/15 px-0.5 py-px text-[10px] font-bold uppercase leading-none tracking-wide text-amber-800 dark:border-amber-400/30 dark:bg-amber-400/12 dark:text-amber-200`,"aria-label":`New model`,children:`New`}):null,t[22]=e.showNewBadge,t[23]=x);let S;t[24]!==b||t[25]!==x?(S=(0,X.jsxs)(`div`,{className:`text-xs font-medium leading-snug flex items-center gap-2 min-w-0`,children:[b,x]}),t[24]=b,t[25]=x,t[26]=S):S=t[26];let C;t[27]===e.jumpLabel?C=t[28]:(C=e.jumpLabel?(0,X.jsx)(K,{className:`h-4 min-w-0 shrink-0 rounded-sm px-1.5 text-[10px]`,children:e.jumpLabel}):null,t[27]=e.jumpLabel,t[28]=C);let w;t[29]!==S||t[30]!==C?(w=(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2 min-w-0`,children:[S,C]}),t[29]=S,t[30]=C,t[31]=w):w=t[31];let T;t[32]!==n||t[33]!==e.providerAccentColor||t[34]!==e.showProvider||t[35]!==r?(T=e.showProvider&&(0,X.jsxs)(`div`,{className:`flex items-center gap-1 mt-0.5`,children:[n?(0,X.jsx)(n,{className:`size-3 shrink-0`}):null,e.providerAccentColor?(0,X.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full`,style:{backgroundColor:e.providerAccentColor},"aria-hidden":!0}):null,(0,X.jsx)(`span`,{className:`text-xs font-normal leading-snug text-muted-foreground/70 truncate`,children:r})]}),t[32]=n,t[33]=e.providerAccentColor,t[34]=e.showProvider,t[35]=r,t[36]=T):T=t[36];let E;t[37]!==w||t[38]!==T?(E=(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 text-left`,children:[w,T]}),t[37]=w,t[38]=T,t[39]=E):E=t[39];let D;return t[40]!==e.index||t[41]!==a||t[42]!==v||t[43]!==E?(D=(0,X.jsxs)(z,{hideIndicator:!0,index:i,value:a,contentClassName:`flex w-full items-start gap-2`,className:s,children:[v,E]}),t[40]=e.index,t[41]=a,t[42]=v,t[43]=E,t[44]=D):D=t[44],D});function Pe(e){e.stopPropagation()}function Fe(e){let t=e.replace(/[_-]+/g,` `).split(/\s+/u).filter(Boolean);return t.length===0?``:t.length===1?t[0].slice(0,2).toUpperCase():t.slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``)}var Ie=(0,Z.memo)(function(e){let t=(0,xe.c)(22),n=W[e.driverKind]??null,r;t[0]===e.accentColor?r=t[1]:(r=e.accentColor?{"--provider-accent":e.accentColor}:void 0,t[0]=e.accentColor,t[1]=r);let i=r,a;t[2]===e.className?a=t[3]:(a=_(`relative isolate inline-flex shrink-0 items-center justify-center`,e.className),t[2]=e.className,t[3]=a);let o;t[4]!==n||t[5]!==e.displayName||t[6]!==e.iconClassName?(o=n?(0,X.jsx)(n,{className:_(`size-5 shrink-0`,e.iconClassName),"aria-hidden":!0}):(0,X.jsx)(`span`,{className:_(`text-[10px] font-semibold leading-none`,e.iconClassName),children:Fe(e.displayName)}),t[4]=n,t[5]=e.displayName,t[6]=e.iconClassName,t[7]=o):o=t[7];let s;t[8]===e.statusDotClassName?s=t[9]:(s=e.statusDotClassName?(0,X.jsx)(`span`,{className:_(`pointer-events-none absolute -left-0.5 -top-0.5 size-2 rounded-full ring-2 ring-background`,e.statusDotClassName),"aria-hidden":!0}):null,t[8]=e.statusDotClassName,t[9]=s);let c;t[10]!==e.accentColor||t[11]!==e.badgeClassName||t[12]!==e.displayName||t[13]!==e.showBadge?(c=e.showBadge?(0,X.jsx)(`span`,{className:_(`pointer-events-none absolute right-0 bottom-0 flex h-3.5 min-w-3.5 items-center justify-center rounded-full border border-background px-0.5 text-[8px] font-semibold leading-none shadow-sm`,e.accentColor?`bg-[var(--provider-accent)] text-white`:`bg-muted text-muted-foreground`,e.badgeClassName),"aria-hidden":!0,children:Fe(e.displayName)}):null,t[10]=e.accentColor,t[11]=e.badgeClassName,t[12]=e.displayName,t[13]=e.showBadge,t[14]=c):c=t[14];let l;return t[15]!==i||t[16]!==e.accentColor||t[17]!==a||t[18]!==o||t[19]!==s||t[20]!==c?(l=(0,X.jsxs)(`span`,{className:a,style:i,"data-provider-accent-color":e.accentColor,children:[o,s,c]}),t[15]=i,t[16]=e.accentColor,t[17]=a,t[18]=o,t[19]=s,t[20]=c,t[21]=l):l=t[21],l});function Le(e){let t=e.displayName;if(e.status===`ready`)return t;let n=e.status===`error`?`Unavailable`:e.status===`warning`?`Limited`:e.status===`disabled`?`Disabled in settings`:`Not ready`,r=e.snapshot.message?.trim();return r?`${t} — ${n}. ${r}`:`${t} — ${n}.`}var Re=`bg-background text-foreground shadow-sm`,ze=`pointer-events-none absolute -right-1 top-1/2 z-10 h-5 w-0.5 -translate-y-1/2 rounded-l-full bg-primary`,Be=`pointer-events-none absolute -right-0.5 top-0.5 z-10 flex size-3.5 items-center justify-center rounded-full bg-transparent shadow-sm `,Ve=`${Be} text-amber-600 dark:text-amber-300 `,He=`${Be} text-muted-foreground `,Ue=`left`,We=`max-w-64 text-balance font-normal leading-snug`,Ge=(0,Z.memo)(function(e){let t=(0,xe.c)(25),n;t[0]===e?n=t[1]:(n=t=>{e.onSelectInstance(t)},t[0]=e,t[1]=n);let r=n,i=e.showFavorites??!0,a=e.showComingSoon??!0,s;if(t[2]!==e.instanceEntries){s=new Map;for(let t of e.instanceEntries)s.set(t.driverKind,(s.get(t.driverKind)??0)+1);t[2]=e.instanceEntries,t[3]=s}else s=t[3];let c=s,l;t[4]!==r||t[5]!==e.selectedInstanceId||t[6]!==i?(l=i?(0,X.jsx)(`div`,{className:`pb-1 mb-1 border-b`,children:(0,X.jsxs)(`div`,{className:`relative w-full`,children:[e.selectedInstanceId===`favorites`&&(0,X.jsx)(`div`,{className:ze}),(0,X.jsxs)(O,{children:[(0,X.jsx)(f,{render:(0,X.jsx)(`button`,{className:_(`relative isolate flex w-full cursor-pointer aspect-square items-center justify-center rounded transition-colors hover:bg-muted`,e.selectedInstanceId===`favorites`&&Re),onClick:()=>r(`favorites`),type:`button`,"data-model-picker-provider":`favorites`,"aria-label":`Favorites`,children:(0,X.jsx)(Y,{className:`size-5 fill-current shrink-0`,"aria-hidden":!0})})}),(0,X.jsx)(o,{side:Ue,align:`center`,className:We,children:`Favorites`})]})]})}):null,t[4]=r,t[5]=e.selectedInstanceId,t[6]=i,t[7]=l):l=t[7];let u;if(t[8]!==c||t[9]!==r||t[10]!==e.instanceEntries||t[11]!==e.newBadgeInstanceIds||t[12]!==e.selectedInstanceId){let n;t[14]!==c||t[15]!==r||t[16]!==e.newBadgeInstanceIds||t[17]!==e.selectedInstanceId?(n=t=>{let n=!t.isAvailable||t.status!==`ready`,i=e.selectedInstanceId===t.instanceId,a=e.newBadgeInstanceIds?.has(t.instanceId)??!1,s=!!t.accentColor||(c.get(t.driverKind)??0)>1,l=n?Le(t):a?`${t.displayName} — New`:t.displayName,u=(0,X.jsxs)(`button`,{"data-model-picker-provider":t.instanceId,className:_(`relative isolate flex w-full cursor-pointer aspect-square items-center justify-center rounded transition-colors hover:bg-muted`,i&&Re,n&&`opacity-50 cursor-not-allowed hover:bg-transparent`),"data-provider-accent-color":t.accentColor,onClick:()=>!n&&r(t.instanceId),disabled:n,type:`button`,"aria-label":n?l:a?`${t.displayName}, new`:t.displayName,children:[(0,X.jsx)(Ie,{driverKind:t.driverKind,displayName:t.displayName,accentColor:t.accentColor,showBadge:s,className:`size-6`,iconClassName:`size-5`}),a?(0,X.jsx)(`span`,{className:Ve,"aria-hidden":!0,children:(0,X.jsx)(A,{className:`size-2`})}):null]});return(0,X.jsxs)(`div`,{className:`relative w-full`,children:[i&&(0,X.jsx)(`div`,{className:ze}),(0,X.jsxs)(O,{children:[(0,X.jsx)(f,{render:n?(0,X.jsx)(`span`,{className:`relative block w-full`,children:u}):u}),(0,X.jsx)(o,{side:Ue,align:`center`,className:We,children:l})]})]},t.instanceId)},t[14]=c,t[15]=r,t[16]=e.newBadgeInstanceIds,t[17]=e.selectedInstanceId,t[18]=n):n=t[18],u=e.instanceEntries.map(n),t[8]=c,t[9]=r,t[10]=e.instanceEntries,t[11]=e.newBadgeInstanceIds,t[12]=e.selectedInstanceId,t[13]=u}else u=t[13];let d;t[19]===a?d=t[20]:(d=a?(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(O,{children:[(0,X.jsx)(f,{render:(0,X.jsx)(`span`,{className:`relative block w-full`,children:(0,X.jsxs)(`button`,{className:_(`relative isolate flex w-full aspect-square items-center justify-center rounded opacity-50 cursor-not-allowed transition-colors hover:bg-transparent`),disabled:!0,type:`button`,"data-model-picker-provider":`gemini-coming-soon`,"aria-label":`Gemini — coming soon`,children:[(0,X.jsx)(B,{className:`size-5 text-muted-foreground/85`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:He,"aria-hidden":!0,children:(0,X.jsx)(F,{className:`size-2`})})]})})}),(0,X.jsx)(o,{side:Ue,align:`center`,className:We,children:`Gemini — Coming soon`})]})}):null,t[19]=a,t[20]=d);let p;return t[21]!==l||t[22]!==u||t[23]!==d?(p=(0,X.jsx)(_e,{hideScrollbars:!0,scrollFade:!0,className:`w-12 shrink-0 border-r bg-muted/30`,"data-model-picker-sidebar":`true`,children:(0,X.jsxs)(`div`,{className:`flex min-h-full flex-col gap-1 p-1`,children:[l,u,d]})}),t[21]=l,t[22]=u,t[23]=d,t[24]=p):p=t[24],p}),Ke=new Set;function qe(e,t){return Ke.has(`${e}:${t}`)}function $(e,t){let n=e.trim();return n?t?.trimLeadingPattern?n.replace(t.trimLeadingPattern,``).toLowerCase():n.toLowerCase():``}function Je(e,t){if(!t)return 0;let n=0,r=-1,i=-1,a=0;for(let o=0;o<e.length;o+=1)if(e[o]===t[n]&&(r===-1&&(r=o),i!==-1&&(a+=o-i-1),i=o,n+=1,n===t.length)){let n=o-r+1-t.length,i=Math.min(64,e.length-t.length);return r*2+a*3+n+i}return null}function Ye(e,t){return Math.min(64,Math.max(0,e.length-t.length))}function Xe(e,t,n){let r=null;for(let i of n){let n=e.indexOf(`${i}${t}`);if(n===-1)continue;let a=n+i.length;(r===null||a<r)&&(r=a)}return r}function Ze(e){let{value:t,query:n}=e;if(!t||!n)return null;if(t===n)return e.exactBase;if(e.prefixBase!==void 0&&t.startsWith(n))return e.prefixBase+Ye(t,n);if(e.boundaryBase!==void 0){let r=Xe(t,n,e.boundaryMarkers??[` `,`-`,`_`,`/`]);if(r!==null)return e.boundaryBase+r*2+Ye(t,n)}if(e.includesBase!==void 0){let r=t.indexOf(n);if(r!==-1)return e.includesBase+r*2+Ye(t,n)}if(e.fuzzyBase!==void 0){let r=Je(t,n);if(r!==null)return e.fuzzyBase+r}return null}function Qe(e,t){let n=e.score-t.score;return n===0?e.tieBreaker.localeCompare(t.tieBreaker):n}function $e(e,t){let n=0,r=e.length;for(;n<r;){let i=n+Math.floor((r-n)/2),a=e[i];if(!a)break;Qe(t,a)<0?r=i:n=i+1}return n}function et(e,t,n){if(n<=0)return;let r=$e(e,t);if(e.length<n){e.splice(r,0,t);return}r>=n||(e.splice(r,0,t),e.pop())}var tt=24;function nt(e){return[$(e.name),...e.shortName?[$(e.shortName)]:[],...e.subProvider?[$(e.subProvider)]:[],$(e.driverKind),$(e.providerDisplayName),it(e)]}function rt(e,t,n){return Ze({value:e,query:t,exactBase:n,prefixBase:n+2,boundaryBase:n+4,includesBase:n+6,...t.length>=3?{fuzzyBase:n+100}:{}})}function it(e){return $([e.name,e.shortName,e.subProvider,e.driverKind,e.providerDisplayName].filter(e=>typeof e==`string`&&e.length>0).join(` `))}function at(e,t){let n=$(t).split(/\s+/u).filter(e=>e.length>0);if(n.length===0)return 0;let r=nt(e),i=0;for(let e of n){let t=r.map((t,n)=>rt(t,e,n*10)).filter(e=>e!==null);if(t.length===0)return null;i+=Math.min(...t)}return e.isFavorite?i-tt:i}var ot=new Map;function st(e){let t=e.indexOf(`:`);return t===-1?{instanceId:e,slug:``}:{instanceId:e.slice(0,t),slug:e.slice(t+1)}}var ct=(0,Z.memo)(function(e){let t=(0,xe.c)(140),{keybindings:n,modelOptionsByInstance:a,instanceEntries:o,onInstanceModelChange:s}=e,[c,l]=(0,Z.useState)(``),u=(0,Z.useRef)(null),d=(0,Z.useRef)(null),f=(0,Z.useRef)(null),p=i(lt),m;t[0]!==p.length||t[1]!==e.activeInstanceId||t[2]!==e.lockedProvider?(m=()=>e.lockedProvider===null&&p.length>0?`favorites`:e.activeInstanceId,t[0]=p.length,t[1]=e.activeInstanceId,t[2]=e.lockedProvider,t[3]=m):m=t[3];let[h,g]=(0,Z.useState)(m),v;t[4]===n?v=t[5]:(v=n??[],t[4]=n,t[5]=v);let y=v,{updateSettings:b}=r(),x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{u.current?.focus({preventScroll:!0})},t[6]=x):x=t[6];let S=x,C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{g(e),window.requestAnimationFrame(()=>{S()})},t[7]=C):C=t[7];let w=C,E,D;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{S();let e=window.requestAnimationFrame(()=>{S()}),t=window.setTimeout(()=>{S()},0);return()=>{window.cancelAnimationFrame(e),window.clearTimeout(t)}},D=[S],t[8]=E,t[9]=D):(E=t[8],D=t[9]),(0,Z.useLayoutEffect)(E,D);let ee;t[10]===p?ee=t[11]:(ee=new Set(p.map(ut)),t[10]=p,t[11]=ee);let O=ee,k;t[12]===o?k=t[13]:(k=new Map(o.map(dt)),t[12]=o,t[13]=k);let A=k,j;t[14]!==e.lockedContinuationGroupKey||t[15]!==e.lockedProvider?(j=t=>e.lockedProvider===null?!0:t.driverKind===e.lockedProvider?e.lockedContinuationGroupKey?t.continuationGroupKey===e.lockedContinuationGroupKey:!0:!1,t[14]=e.lockedContinuationGroupKey,t[15]=e.lockedProvider,t[16]=j):j=t[16];let M=j,N;if(t[17]!==o){N=new Set;for(let e of o)e.status===`ready`&&N.add(e.instanceId);t[17]=o,t[18]=N}else N=t[18];let P=N,ie;if(t[19]!==A||t[20]!==a||t[21]!==P){ie=[];for(let[e,t]of a){let n=A.get(e);if(n&&P.has(e))for(let r of t)ie.push({slug:r.slug,name:r.name,...r.shortName?{shortName:r.shortName}:{},...r.subProvider?{subProvider:r.subProvider}:{},instanceId:e,driverKind:n.driverKind,instanceDisplayName:n.displayName,...n.accentColor?{instanceAccentColor:n.accentColor}:{},...n.continuationGroupKey?{continuationGroupKey:n.continuationGroupKey}:{}})}t[19]=A,t[20]=a,t[21]=P,t[22]=ie}else ie=t[22];let F=ie,I=e.lockedProvider!==null,ae;t[23]===c?ae=t[24]:(ae=c.trim(),t[23]=c,t[24]=ae);let z=ae.length>0,B;t[25]!==o||t[26]!==M||t[27]!==e.lockedProvider?(B=e.lockedProvider?o.filter(e=>M(e)):[],t[25]=o,t[26]=M,t[27]=e.lockedProvider,t[28]=B):B=t[28];let V=B,U=I&&V.length>1,G=!z&&(!I||U),K=U?V:o,fe;t[29]===o?fe=t[30]:(fe=o.map(ft),t[29]=o,t[30]=fe);let pe=fe,me;if(t[31]!==O||t[32]!==F||t[33]!==pe||t[34]!==M||t[35]!==e.lockedProvider||t[36]!==c||t[37]!==h||t[38]!==U){bb0:{let t=F;if(c.trim()){let n=t.map(e=>({model:e,score:at({name:e.name,...e.shortName?{shortName:e.shortName}:{},...e.subProvider?{subProvider:e.subProvider}:{},driverKind:e.driverKind,providerDisplayName:e.instanceDisplayName,isFavorite:O.has(te(e.instanceId,e.slug))},c),isFavorite:O.has(te(e.instanceId,e.slug)),tieBreaker:it({name:e.name,...e.shortName?{shortName:e.shortName}:{},...e.subProvider?{subProvider:e.subProvider}:{},driverKind:e.driverKind,providerDisplayName:e.instanceDisplayName})})).filter(pt);if(e.lockedProvider!==null){me=n.filter(e=>M(e.model)).toSorted(mt).map(ht);break bb0}me=n.toSorted(gt).map(_t);break bb0}e.lockedProvider===null?t=h===`favorites`?t.filter(e=>O.has(te(e.instanceId,e.slug))):t.filter(e=>e.instanceId===h):(t=t.filter(e=>M(e)),U&&(t=t.filter(e=>e.instanceId===h))),me=T(t,{favoriteModelKeys:O,groupFavorites:h!==`favorites`,instanceOrder:h===`favorites`?pe:[]})}t[31]=O,t[32]=F,t[33]=pe,t[34]=M,t[35]=e.lockedProvider,t[36]=c,t[37]=h,t[38]=U,t[39]=me}else me=t[39];let q=me,he;t[40]!==A||t[41]!==a||t[42]!==s?(he=(e,t)=>{let n=a.get(t);if(!n)return;let r=A.get(t);if(!r)return;let i=re(r.driverKind,e,n);i&&s(t,i)},t[40]=A,t[41]=a,t[42]=s,t[43]=he):he=t[43];let J=he,ge;t[44]!==p||t[45]!==b?(ge=(e,t)=>{let n=[...p],r=n.findIndex(n=>n.provider===e&&n.model===t);r>=0?n.splice(r,1):n.push({provider:e,model:t}),b({favorites:n})},t[44]=p,t[45]=b,t[46]=ge):ge=t[46];let _e=ge,ve=I&&e.lockedProvider?W[e.lockedProvider]:null,ye;if(t[47]!==o||t[48]!==I||t[49]!==M||t[50]!==e.activeInstanceId||t[51]!==e.lockedProvider){bb1:{if(!I||!e.lockedProvider){ye=null;break bb1}let n;t[53]===M?n=t[54]:(n=e=>M(e),t[53]=M,t[54]=n);let r=o.filter(n);if(r.length===0){ye=null;break bb1}let i;t[55]===e.activeInstanceId?i=t[56]:(i=t=>t.instanceId===e.activeInstanceId,t[55]=e.activeInstanceId,t[56]=i),ye=(r.find(i)??r[0])?.displayName??null}t[47]=o,t[48]=I,t[49]=M,t[50]=e.activeInstanceId,t[51]=e.lockedProvider,t[52]=ye}else ye=t[52];let be=ye,Y;if(t[57]!==q){bb2:{let e=new Map;for(let[t,n]of q.entries()){let r=de(t);if(!r){Y=e;break bb2}e.set(`${n.instanceId}:${n.slug}`,r)}Y=e}t[57]=q,t[58]=Y}else Y=t[58];let Q=Y,Se;t[59]===Q?Se=t[60]:(Se=[...Q.keys()],t[59]=Q,t[60]=Se);let Ce=Se,we;t[61]===F?we=t[62]:(we=F.map(vt),t[61]=F,t[62]=we);let Te=we,Ee;t[63]===q?Ee=t[64]:(Ee=q.map(yt),t[63]=q,t[64]=Ee);let De=Ee,Oe;t[65]===q?Oe=t[66]:(Oe=new Map(q.map(bt)),t[65]=q,t[66]=Oe);let ke=Oe,Ae;t[67]===e.terminalOpen?Ae=t[68]:(Ae={terminalFocus:!1,terminalOpen:e.terminalOpen,modelPickerOpen:!0},t[67]=e.terminalOpen,t[68]=Ae);let je=Ae,Me;bb3:{if(Q.size===0){Me=ot;break bb3}let e;if(t[69]!==y||t[70]!==Q||t[71]!==je){let n={platform:navigator.platform,context:je};e=new Map;for(let[t,r]of Q){let i=ce(y,r,n);i&&e.set(t,i)}t[69]=y,t[70]=Q,t[71]=je,t[72]=e}else e=t[72];Me=e.size>0?e:ot}let Pe=Me,Fe,Ie;t[73]!==J||t[74]!==y||t[75]!==Ce||t[76]!==je?(Fe=()=>{let e=e=>{if(e.defaultPrevented||e.repeat)return;let t=ue(le(e,y,{platform:navigator.platform,context:je})??``);if(t===null)return;let n=Ce[t];if(!n)return;let{instanceId:r,slug:i}=st(n);e.preventDefault(),e.stopPropagation(),J(i,r)};return window.addEventListener(`keydown`,e,!0),()=>{window.removeEventListener(`keydown`,e,!0)}},Ie=[J,y,Ce,je],t[73]=J,t[74]=y,t[75]=Ce,t[76]=je,t[77]=Fe,t[78]=Ie):(Fe=t[77],Ie=t[78]),(0,Z.useEffect)(Fe,Ie);let Le;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(Le=()=>{let e=d.current;if(!e)return;let t=!1,n=0,r=0,i=0,a=()=>{if(t)return;let n=e.querySelector(`[data-slot="scroll-area-viewport"]`);if(!n||n.scrollHeight<=n.clientHeight)return;let r=n.scrollTop,i=n.scrollHeight-n.clientHeight;i<=0||(n.scrollTop=Math.min(r+1,i),n.scrollTop=r)};return queueMicrotask(a),n=window.requestAnimationFrame(()=>{a(),r=window.requestAnimationFrame(a)}),i=window.setTimeout(a,0),()=>{t=!0,window.cancelAnimationFrame(n),window.cancelAnimationFrame(r),window.clearTimeout(i)}},t[79]=Le):Le=t[79];let Re;t[80]===De?Re=t[81]:(Re=[De],t[80]=De,t[81]=Re),(0,Z.useLayoutEffect)(Le,Re);let ze=I&&!U?`flex-col`:`flex-row`,Be;t[82]===ze?Be=t[83]:(Be=_(`selection-glass-surface relative flex h-screen max-h-96 w-screen max-w-100 overflow-hidden rounded-lg border text-popover-foreground`,ze),t[82]=ze,t[83]=Be);let Ve;t[84]!==ve||t[85]!==I||t[86]!==be||t[87]!==U?(Ve=I&&!U&&ve&&be&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 border-b`,children:[(0,X.jsx)(ve,{className:`size-5 shrink-0`}),(0,X.jsx)(`span`,{className:`font-medium text-sm`,children:be})]}),t[84]=ve,t[85]=I,t[86]=be,t[87]=U,t[88]=Ve):Ve=t[88];let He;t[89]!==I||t[90]!==h||t[91]!==G||t[92]!==K?(He=G&&(0,X.jsx)(Ge,{selectedInstanceId:h,onSelectInstance:w,instanceEntries:K,showFavorites:!I,showComingSoon:!I}),t[89]=I,t[90]=h,t[91]=G,t[92]=K,t[93]=He):He=t[93];let Ue=`${e.activeInstanceId}:${e.model}`,We;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(We=e=>{f.current=typeof e==`string`?e:null},t[94]=We):We=t[94];let Ke;t[95]===J?Ke=t[96]:(Ke=e=>{if(typeof e!=`string`)return;let{instanceId:t,slug:n}=st(e);J(n,t)},t[95]=J,t[96]=Ke);let $=I&&!U?`min-w-0`:G&&`border-l`,Je;t[97]===$?Je=t[98]:(Je=_(`flex min-h-0 flex-1 flex-col overflow-hidden`,$),t[97]=$,t[98]=Je);let Ye;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=(0,X.jsx)(R,{className:`size-4 shrink-0 text-muted-foreground/50`}),t[99]=Ye):Ye=t[99];let Xe;t[100]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=e=>l(e.target.value),t[100]=Xe):Xe=t[100];let Ze;t[101]!==J||t[102]!==e?(Ze=t=>{if(t.key===`Escape`){t.preventDefault(),t.stopPropagation(),e.onRequestClose?.();return}if(t.key===`Enter`&&f.current){t.preventBaseUIHandler?.(),t.preventDefault(),t.stopPropagation();let{instanceId:e,slug:n}=st(f.current);J(n,e);return}t.stopPropagation()},t[101]=J,t[102]=e,t[103]=Ze):Ze=t[103];let Qe;t[104]!==c||t[105]!==Ze?(Qe=(0,X.jsx)(`div`,{className:`border-b px-3 py-2`,children:(0,X.jsx)(L,{ref:u,className:`[&_input]:font-sans rounded-md`,inputClassName:`border-0 shadow-none ring-0 focus-visible:ring-0`,placeholder:`Search models...`,showTrigger:!1,startAddon:Ye,value:c,onChange:Xe,onKeyDown:Ze,onMouseDown:xt,onTouchStart:St,size:`sm`})}),t[104]=c,t[105]=Ze,t[106]=Qe):Qe=t[106];let $e;if(t[107]!==O||t[108]!==ke||t[109]!==De||t[110]!==I||t[111]!==Pe||t[112]!==U||t[113]!==_e){let e;t[115]!==O||t[116]!==ke||t[117]!==I||t[118]!==Pe||t[119]!==U||t[120]!==_e?(e=(e,t)=>{let n=ke.get(e);return n?(0,X.jsx)(Ne,{index:t,model:n,instanceId:n.instanceId,driverKind:n.driverKind,providerDisplayName:n.instanceDisplayName,providerAccentColor:n.instanceAccentColor,isFavorite:O.has(e),showProvider:!I||U,preferShortName:!I,useTriggerLabel:I&&!U,showNewBadge:qe(n.driverKind,n.slug),jumpLabel:Pe.get(e)??null,onToggleFavorite:()=>_e(n.instanceId,n.slug)},e):null},t[115]=O,t[116]=ke,t[117]=I,t[118]=Pe,t[119]=U,t[120]=_e,t[121]=e):e=t[121],$e=De.map(e),t[107]=O,t[108]=ke,t[109]=De,t[110]=I,t[111]=Pe,t[112]=U,t[113]=_e,t[114]=$e}else $e=t[114];let et;t[122]===$e?et=t[123]:(et=(0,X.jsx)(`div`,{ref:d,className:`relative min-h-0 flex-1 before:pointer-events-none before:absolute before:inset-0 before:bg-muted/40`,children:(0,X.jsx)(se,{className:`model-picker-list size-full divide-y px-2 py-1`,children:$e})}),t[122]=$e,t[123]=et);let tt;t[124]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,X.jsx)(oe,{className:`not-empty:py-6 empty:h-0 text-xs font-normal leading-snug`,children:`No models found`}),t[124]=tt):tt=t[124];let nt;t[125]!==Je||t[126]!==Qe||t[127]!==et?(nt=(0,X.jsxs)(`div`,{className:Je,children:[Qe,et,tt]}),t[125]=Je,t[126]=Qe,t[127]=et,t[128]=nt):nt=t[128];let rt;t[129]!==Te||t[130]!==De||t[131]!==Ue||t[132]!==Ke||t[133]!==nt?(rt=(0,X.jsx)(H,{inline:!0,items:Te,filteredItems:De,filter:null,autoHighlight:!0,open:!0,value:Ue,onItemHighlighted:We,onValueChange:Ke,children:nt}),t[129]=Te,t[130]=De,t[131]=Ue,t[132]=Ke,t[133]=nt,t[134]=rt):rt=t[134];let ct;return t[135]!==Be||t[136]!==Ve||t[137]!==He||t[138]!==rt?(ct=(0,X.jsx)(ne,{delay:0,children:(0,X.jsxs)(`div`,{className:Be,children:[Ve,He,rt]})}),t[135]=Be,t[136]=Ve,t[137]=He,t[138]=rt,t[139]=ct):ct=t[139],ct});function lt(e){return e.favorites??[]}function ut(e){return te(e.provider,e.model)}function dt(e){return[e.instanceId,e]}function ft(e){return e.instanceId}function pt(e){return e.score!==null}function mt(e,t){let n=e.score-t.score;return n===0?e.isFavorite===t.isFavorite?e.tieBreaker.localeCompare(t.tieBreaker):e.isFavorite?-1:1:n}function ht(e){return e.model}function gt(e,t){let n=e.score-t.score;return n===0?e.isFavorite===t.isFavorite?e.tieBreaker.localeCompare(t.tieBreaker):e.isFavorite?-1:1:n}function _t(e){return e.model}function vt(e){return`${e.instanceId}:${e.slug}`}function yt(e){return`${e.instanceId}:${e.slug}`}function bt(e){return[`${e.instanceId}:${e.slug}`,e]}function xt(e){return e.stopPropagation()}function St(e){return e.stopPropagation()}var Ct=(0,Z.memo)(function(e){let t=(0,xe.c)(82),[n,r]=(0,Z.useState)(!1),i=e.open??n,a;t[0]!==e.activeInstanceId||t[1]!==e.instanceEntries?(a=e.instanceEntries.find(t=>t.instanceId===e.activeInstanceId)??null,t[0]=e.activeInstanceId,t[1]=e.instanceEntries,t[2]=a):a=t[2];let s=a,c=e.activeInstanceId,l,u,p;if(t[3]!==c||t[4]!==e.model||t[5]!==e.modelOptionsByInstance){let n=e.modelOptionsByInstance.get(c)??[],r=n.find(t=>t.slug===e.model)??n[0];p=r?ae(r):e.model,u=r?.subProvider,l=r?U(r):e.model,t[3]=c,t[4]=e.model,t[5]=e.modelOptionsByInstance,t[6]=l,t[7]=u,t[8]=p}else l=t[6],u=t[7],p=t[8];let m=l,h;if(t[9]!==s||t[10]!==e.instanceEntries){let n;t[12]===s?n=t[13]:(n=e=>s!==null&&e.driverKind===s.driverKind,t[12]=s,t[13]=n),h=e.instanceEntries.filter(n),t[9]=s,t[10]=e.instanceEntries,t[11]=h}else h=t[11];let g=h.length,v=!!s?.accentColor||g>1,y;t[14]===e?y=t[15]:(y=t=>{e.onOpenChange?.(t),e.open===void 0&&r(t)},t[14]=e,t[15]=y);let b=y,x,S;t[16]===i?(x=t[17],S=t[18]):(x=()=>(ve(i),wt),S=[i],t[16]=i,t[17]=x,t[18]=S),(0,Z.useEffect)(x,S);let C;t[19]!==e||t[20]!==b?(C=(t,n)=>{e.disabled||(e.onInstanceModelChange(t,n),b(!1))},t[19]=e,t[20]=b,t[21]=C):C=t[21];let w=C,T;t[22]!==e.disabled||t[23]!==b?(T=t=>{if(e.disabled){b(!1);return}b(t)},t[22]=e.disabled,t[23]=b,t[24]=T):T=t[24];let D=e.triggerSize??`sm`,ee=e.triggerVariant??`ghost`,te=e.compact?`max-w-38 shrink-0 sm:max-w-40`:`max-w-44 shrink sm:max-w-52 sm:px-2`,ne;t[25]!==e.triggerClassName||t[26]!==te?(ne=_(`min-w-0 justify-start overflow-hidden whitespace-nowrap px-1.5 text-muted-foreground/70 hover:text-foreground/80 [&_svg]:mx-0`,te,e.triggerClassName),t[25]=e.triggerClassName,t[26]=te,t[27]=ne):ne=t[27];let re;t[28]!==e.disabled||t[29]!==ne||t[30]!==D||t[31]!==ee?(re=(0,X.jsx)(E,{size:D,variant:ee,"data-chat-provider-model-picker":`true`,className:ne,disabled:e.disabled}),t[28]=e.disabled,t[29]=ne,t[30]=D,t[31]=ee,t[32]=re):re=t[32];let k=e.compact?`max-w-34 sm:pl-0.5`:void 0,A;t[33]===k?A=t[34]:(A=_(`flex min-w-0 w-full box-border items-center gap-1.5 overflow-hidden`,k),t[33]=k,t[34]=A);let j;t[35]!==s||t[36]!==e.activeProviderIconClassName||t[37]!==v?(j=s?(0,X.jsx)(Ie,{driverKind:s.driverKind,displayName:s.displayName,accentColor:s.accentColor,showBadge:v,className:v?`size-5`:`size-4`,iconClassName:_(`size-4`,e.activeProviderIconClassName),badgeClassName:`right-[-0.125rem] bottom-[-0.125rem] h-3 min-w-3 text-[7px]`}):null,t[35]=s,t[36]=e.activeProviderIconClassName,t[37]=v,t[38]=j):j=t[38];let M=u?`grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-1`:`truncate`,N;t[39]===M?N=t[40]:(N=_(`min-w-0 flex-1 overflow-hidden`,M),t[39]=M,t[40]=N);let P;t[41]===N?P=t[42]:(P=(0,X.jsx)(`span`,{className:N}),t[41]=N,t[42]=P);let F;t[43]!==u||t[44]!==p?(F=u?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:u}),(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 opacity-60`,children:`·`}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:p})]}):p,t[43]=u,t[44]=p,t[45]=F):F=t[45];let L;t[46]!==P||t[47]!==F?(L=(0,X.jsx)(f,{render:P,children:F}),t[46]=P,t[47]=F,t[48]=L):L=t[48];let R;t[49]===m?R=t[50]:(R=(0,X.jsx)(o,{side:`top`,children:m}),t[49]=m,t[50]=R);let z;t[51]!==L||t[52]!==R?(z=(0,X.jsxs)(O,{children:[L,R]}),t[51]=L,t[52]=R,t[53]=z):z=t[53];let B;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,X.jsx)(d,{"aria-hidden":`true`,className:`size-3 shrink-0 opacity-60`}),t[54]=B):B=t[54];let V;t[55]!==A||t[56]!==j||t[57]!==z?(V=(0,X.jsxs)(`span`,{className:A,children:[j,z,B]}),t[55]=A,t[56]=j,t[57]=z,t[58]=V):V=t[58];let H;t[59]!==re||t[60]!==V?(H=(0,X.jsx)(ie,{render:re,children:V}),t[59]=re,t[60]=V,t[61]=H):H=t[61];let oe=e.lockedContinuationGroupKey??null,W;t[62]===e.keybindings?W=t[63]:(W=e.keybindings?{keybindings:e.keybindings}:{},t[62]=e.keybindings,t[63]=W);let se=e.terminalOpen??!1,K;t[64]===b?K=t[65]:(K=()=>b(!1),t[64]=b,t[65]=K);let ce;t[66]!==c||t[67]!==w||t[68]!==e.instanceEntries||t[69]!==e.lockedProvider||t[70]!==e.model||t[71]!==e.modelOptionsByInstance||t[72]!==oe||t[73]!==W||t[74]!==se||t[75]!==K?(ce=(0,X.jsx)(G,{align:`start`,className:`border-0 bg-transparent p-0 shadow-none before:hidden [--viewport-inline-padding:0] *:data-[slot=popover-viewport]:p-0`,children:(0,X.jsx)(ct,{activeInstanceId:c,model:e.model,lockedProvider:e.lockedProvider,lockedContinuationGroupKey:oe,instanceEntries:e.instanceEntries,...W,modelOptionsByInstance:e.modelOptionsByInstance,terminalOpen:se,onRequestClose:K,onInstanceModelChange:w})}),t[66]=c,t[67]=w,t[68]=e.instanceEntries,t[69]=e.lockedProvider,t[70]=e.model,t[71]=e.modelOptionsByInstance,t[72]=oe,t[73]=W,t[74]=se,t[75]=K,t[76]=ce):ce=t[76];let le;return t[77]!==i||t[78]!==H||t[79]!==ce||t[80]!==T?(le=(0,X.jsxs)(I,{open:i,onOpenChange:T,children:[H,ce]}),t[77]=i,t[78]=H,t[79]=ce,t[80]=T,t[81]=le):le=t[81],le});function wt(){ve(!1)}var Tt=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}({}),Et={checked(e){return e?{[Tt.checked]:``}:{[Tt.unchecked]:``}},...M,...J},Dt=Z.createContext(void 0);function Ot(){return Z.useContext(Dt)}var kt=Z.createContext(void 0),At=Z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,readOnly:a=!1,required:o=!1,"aria-labelledby":d,value:f,inputRef:p,nativeButton:g=!1,id:_,...b}=e,C=Ot(),{disabled:w,readOnly:T,required:E,checkedValue:D,touched:te=!1,validation:ne,name:O}=C??{},re=C?.setCheckedValue??y,A=C?.setTouched??y,M=C?.registerControlRef??y,N=C?.registerInputRef??y,{setDirty:ie,validityData:F,setTouched:I,setFilled:L,state:ae,disabled:R}=pe(),z=we(),{labelId:B,getDescriptionProps:V}=q(),H=R||z.disabled||w||i,U=T||a,oe=E||o,W=C?D===f:f===``,se=Z.useMemo(()=>fe(f),[f]),G=Z.useRef(null),K=Z.useRef(null),ce=S(e=>{e&&M(e,H)}),le=l(p,K,N);c(()=>{K.current?.checked&&L(!0)},[L]),c(()=>{if(K.current){if(H&&W){N(null);return}G.current&&M(G.current,H),N(K.current)}},[W,H,M,N]);let ue=u(),de=ge({id:_,implicit:!1,controlRef:G}),me=g?void 0:de,he=P(d,B,K,!g,me),J={role:`radio`,"aria-checked":W,"aria-required":oe||void 0,"aria-readonly":U||void 0,"aria-labelledby":he,[ye]:W?``:void 0,id:g?de:ue,onKeyDown(e){e.key===`Enter`&&e.preventDefault()},onClick(e){e.defaultPrevented||H||U||(e.preventDefault(),K.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))},onFocus(e){e.defaultPrevented||H||U||!te||(K.current?.click(),A(!1))}},{getButtonProps:_e,buttonRef:ve}=v({disabled:H,native:g}),be={type:`radio`,ref:le,id:me,name:O,tabIndex:-1,style:O?j:k,"aria-hidden":!0,...f===void 0?s:{value:se},disabled:H,checked:W,required:oe,readOnly:U,onChange(e){if(e.nativeEvent.defaultPrevented||H||U||f===void 0)return;let t=h(ee,e.nativeEvent);t.isCanceled||(I(!0),ie(f!==F.initialValue),L(!0),re(f,t))},onFocus(){G.current?.focus()}},Y=Z.useMemo(()=>({...ae,required:oe,disabled:H,readOnly:U,checked:W}),[ae,H,U,W,oe]),xe=Y,Q=C!==void 0,Se=[t,G,ve,ce],Ce=[J,V,ne?.getValidationProps??s,b,_e],Te=m(`span`,e,{enabled:!Q,state:Y,ref:Se,props:Ce,stateAttributesMapping:Et});return(0,X.jsxs)(kt.Provider,{value:xe,children:[Q?(0,X.jsx)(x,{tag:`span`,render:n,className:r,state:Y,refs:Se,props:Ce,stateAttributesMapping:Et}):Te,(0,X.jsx)(`input`,{...be})]})}),jt=[D],Mt=Z.forwardRef(function(e,t){let{render:n,className:r,disabled:i,readOnly:o,required:s,onValueChange:c,value:l,defaultValue:d,name:f,inputRef:p,id:m,...h}=e,{setTouched:_,setFocused:v,shouldValidateOnChange:y,validationMode:b,name:x,disabled:C,state:T,validation:E,setDirty:D,setFilled:ee,validityData:te}=pe(),{labelId:ne}=q(),{clearErrors:O}=me(),re=Se(!0),k=C||i,A=x??f,j=u(m),[M,N]=w({controlled:l,default:d,name:`RadioGroup`,state:`value`}),P=S(c),ie=S((e,t)=>{P(e,t),!t.isCanceled&&N(e)}),F=Z.useRef(null),I=Z.useRef(null),L=Z.useRef(null);function ae(e){let t;return p&&(typeof p==`function`?t=p(e):p.current=e),I.current=e,E.inputRef.current=e,t}let R=S((e,t=!1)=>{if(e){if(t){F.current===e&&(F.current=null);return}F.current??=e}}),z=S(e=>{if(!e||e.disabled)return;L.current||=e;let t=I.current;if(e.checked||t==null||t.disabled)return ae(e)});he({id:j,commit:E.commit,value:M,controlRef:F,name:A,getValue:()=>M??null}),a(M,()=>{O(A),D(M!==te.initialValue),ee(M!=null),y()?E.commit(M):E.commit(M,!0);let e=L.current;M==null&&e&&!e.disabled&&ae(e)});let[B,V]=Z.useState(!1),H=h[`aria-labelledby`]??ne??re?.legendId,U={...T,disabled:k??!1,required:s??!1,readOnly:o??!1},oe=Z.useMemo(()=>({...T,checkedValue:M,disabled:k,validation:E,name:A,onValueChange:P,readOnly:o,registerControlRef:R,registerInputRef:z,required:s,setCheckedValue:ie,setTouched:V,touched:B}),[M,k,E,T,A,P,o,R,z,s,ie,V,B]),W={role:`radiogroup`,"aria-required":s||void 0,"aria-disabled":k||void 0,"aria-readonly":o||void 0,"aria-labelledby":H,onFocus(){v(!0)},onBlur(e){g(e.currentTarget,e.relatedTarget)||(_(!0),v(!1),b===`onBlur`&&E.commit(M))},onKeyDownCapture(e){e.key.startsWith(`Arrow`)&&(_(!0),V(!0),v(!0))}};return(0,X.jsx)(Dt.Provider,{value:oe,children:(0,X.jsx)(be,{render:n,className:r,state:U,props:[W,E.getValidationProps,h],refs:[t],stateAttributesMapping:J,enableHomeAndEndKeys:!1,modifierKeys:jt})})});function Nt(e){let t=(0,xe.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=_(`flex flex-col gap-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Mt,{className:i,"data-slot":`radio-group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{$ as a,ke as c,Me as d,we as f,et as i,Oe as l,At as n,Ze as o,Y as p,Ct as r,Ie as s,Nt as t,Ae as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-PSPkXoKo.js";import{t as n}from"./compiler-runtime-BNrXlsa1.js";import{t as r}from"./react-CjD7iThp.js";import{Sr as i}from"./composerDraftStore-D12lUSfh.js";import{c as a,o,s}from"./storeSelectors-Cx1IYPA4.js";import{p as c}from"./session-logic-DNf1aXq_.js";var l=n(),u=e(t(),1),d=`[data-thread-item], [data-thread-selection-safe]`;function f(e){if(e.manualBucket!==null)return e.manualBucket;switch(e.statusPill?.label){case`Working`:case`Connecting`:return`in_progress`;case`Plan Ready`:case`Pending Approval`:case`Awaiting Input`:return`review`;case`Completed`:return`done`;default:return`idle`}}function p(e){return e.includes(`in_progress`)?`in_progress`:e.includes(`review`)?`review`:e.length>0&&e.every(e=>e===`done`)?`done`:`idle`}var m=10080*60*1e3;function h(e){if(e.buckets.length===0||!e.buckets.every(e=>e===`done`)||!e.latestUpdatedAt)return!1;let t=Date.parse(e.latestUpdatedAt);return!Number.isNaN(t)&&e.nowMs-t>=m}function g(e){return e.latestUserMessageAt!==null}function _(e){return e.latestUserMessageAt!==null}function v(e){return e.confirmThreadDelete&&_(e.thread)}function y(e){for(let t of e.threads)if(t&&v({confirmThreadDelete:e.confirmThreadDelete,thread:t}))return!0;return!1}function b(e){return e.archiveAvailable&&e.confirmThreadArchive}var x={"Pending Approval":5,"Awaiting Input":4,Working:3,Connecting:3,"Plan Ready":2,Completed:1};function S(e){let t=e.setTimeoutFn??globalThis.setTimeout,n=e.clearTimeoutFn??globalThis.clearTimeout,r=!1,i=null,a=()=>{i!==null&&(n(i),i=null)};return{sync:n=>{if(!n){a(),r&&(r=!1,e.onVisibilityChange(!1));return}r||i!==null||(i=t(()=>{i=null,r=!0,e.onVisibilityChange(!0)},e.delayMs))},dispose:()=>{a()}}}function C(){let e=(0,l.c)(5),[t,n]=u.useState(!1),r=u.useRef(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=S({delayMs:100,onVisibilityChange:e=>{n(e)},setTimeoutFn:window.setTimeout.bind(window),clearTimeoutFn:window.clearTimeout.bind(window)});return r.current=e,()=>{e.dispose(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),u.useEffect(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{r.current?.sync(e)},e[2]=o):o=e[2];let s=o,c;return e[3]===t?c=e[4]:(c={showThreadJumpHints:t,updateThreadJumpHintsVisibility:s},e[3]=t,e[4]=c),c}function w(e){if(!e.latestTurn?.completedAt)return!1;let t=Date.parse(e.latestTurn.completedAt);if(Number.isNaN(t))return!1;if(!e.lastVisitedAt)return!0;let n=Date.parse(e.lastVisitedAt);return Number.isNaN(n)?!0:t>n}function T(e){return e===null?!0:!e.closest(d)}function E(e){return e.requestedEnvMode??e.defaultEnvMode}function D(e){return e.defaultEnvMode===`worktree`?{envMode:`worktree`}:e.activeDraftThread?.projectId===e.projectId?{branch:e.activeDraftThread.branch,worktreePath:e.activeDraftThread.worktreePath,envMode:e.activeDraftThread.envMode}:e.activeThread?.projectId===e.projectId?{branch:e.activeThread.branch,worktreePath:e.activeThread.worktreePath,envMode:e.activeThread.worktreePath?`worktree`:`local`}:{envMode:e.defaultEnvMode}}function O(e){let{getId:t,items:n,preferredIds:r}=e;if(r.length===0)return[...n];let i=new Map(n.map(e=>[t(e),e])),a=new Set(r),o=new Set,s=r.flatMap(e=>{if(o.has(e))return[];let t=i.get(e);return t?(o.add(e),[t]):[]}),c=n.filter(e=>!a.has(t(e)));return[...s,...c]}function k(e,t=10){return e.slice(0,Math.max(0,t))}function A(e){return e<=80}function j(e){return e.projectCount<=80&&e.visibleThreadCount<=120}function M(e){return e.explorerOpen||e.projectVisible}function N(e,t){let n=null;for(let r of e){let e=t(r);if(e!==null){if(n===null){n=e;continue}if(n.environmentId!==e.environmentId||n.cwd!==e.cwd)return{kind:`mixed`}}}return n===null?{kind:`none`}:{kind:`shared`,target:n}}function P(e){let{currentThreadId:t,direction:n,threadIds:r}=e;if(r.length===0)return null;if(t===null)return n===`previous`?r.at(-1)??null:r[0]??null;let i=r.indexOf(t);return i===-1?null:n===`previous`?i>0?r[i-1]??null:null:i<r.length-1?r[i+1]??null:null}function F(e){return e.button===2?!0:e.isMac&&e.button===0&&e.ctrlKey}function I(e){let t=`h-7 w-full translate-x-0 cursor-pointer justify-start px-2 text-left select-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring`;return e.isSelected&&e.isActive?i(t,`bg-primary/22 text-foreground font-medium hover:bg-primary/26 hover:text-foreground dark:bg-primary/30 dark:hover:bg-primary/36`):e.isSelected?i(t,`bg-primary/15 text-foreground hover:bg-primary/19 hover:text-foreground dark:bg-primary/22 dark:hover:bg-primary/28`):e.isActive?i(t,`bg-accent/85 text-foreground font-medium hover:bg-accent hover:text-foreground dark:bg-accent/55 dark:hover:bg-accent/70`):i(t,`text-muted-foreground hover:bg-accent hover:text-foreground`)}function L(e){let{thread:t}=e;return t.hasPendingApprovals?{label:`Pending Approval`,colorClass:`text-amber-600 dark:text-amber-300/90`,dotClass:`bg-amber-500 dark:bg-amber-300/90`,pulse:!1}:t.hasPendingUserInput?{label:`Awaiting Input`,colorClass:`text-indigo-600 dark:text-indigo-300/90`,dotClass:`bg-indigo-500 dark:bg-indigo-300/90`,pulse:!1}:t.session?.status===`running`?{label:`Working`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:t.session?.status===`connecting`?{label:`Connecting`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:!t.hasPendingUserInput&&t.interactionMode===`plan`&&c(t.latestTurn,t.session)&&t.hasActionableProposedPlan?{label:`Plan Ready`,colorClass:`text-violet-600 dark:text-violet-300/90`,dotClass:`bg-violet-500 dark:bg-violet-300/90`,pulse:!1}:w(t)?{label:`Completed`,colorClass:`text-emerald-600 dark:text-emerald-300/90`,dotClass:`bg-emerald-500 dark:bg-emerald-300/90`,pulse:!1}:null}function R(e){let t=null;for(let n of e)n!==null&&(t===null||x[n.label]>x[t.label])&&(t=n);return t}function z(e){let{deletedThreadId:t,deletedThreadIds:n,sortOrder:r,threads:i}=e,a=i.find(e=>e.id===t);if(!a)return null;let o=i.filter(e=>e.id!==t&&!n?.has(e.id));return s(o.filter(e=>e.projectId===a.projectId),r)[0]?.id??s(o,r)[0]?.id??null}function B(e,t,n){return t.length>0?t.reduce((e,t)=>Math.max(e,o(t,n)),-1/0):n===`created_at`?a(e.createdAt)??-1/0:a(e.updatedAt??e.createdAt)??-1/0}function V(e,t,n){if(n===`manual`)return[...e];let r=new Map;for(let e of t){let t=r.get(e.projectId)??[];t.push(e),r.set(e.projectId,t)}return[...e].toSorted((e,t)=>{let i=B(t,r.get(t.id)??[],n),a=B(e,r.get(e.id)??[],n),o=i===a?0:i>a?1:-1;return o===0?e.name.localeCompare(t.name)||e.id.localeCompare(t.id):o})}var H=r(e=>({open:!1,section:`general`,openSettings:t=>e(e=>({open:!0,section:t??e.section})),closeSettings:()=>e({open:!1}),setSection:t=>e({section:t})}));export{h as C,M as S,C as T,j as _,z as a,v as b,O as c,N as d,E as f,A as g,L as h,f as i,P as l,I as m,p as n,k as o,D as p,g as r,F as s,H as t,R as u,T as v,V as w,y as x,b as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-PSPkXoKo.js";import{t as n}from"./compiler-runtime-BNrXlsa1.js";import{V as r}from"./react-CjD7iThp.js";import{A as i,Gr as a,M as o,Mr as s,Ni as c,Si as l,Sr as u,Xr as d,br as f,jr as p,k as m,xi as h}from"./composerDraftStore-D12lUSfh.js";import{t as g}from"./x-fI9snvD3.js";import{a as _,i as v,o as y,t as b}from"./DialogViewport-DvjAl76K.js";import{n as x,r as S,t as C}from"./DialogTitle-H1yIMmA9.js";import{t as w}from"./DialogRoot-Ej1FVk-_.js";import"./input-B9-RWT56.js";import{t as T}from"./scroll-area-D-YOUG02.js";import{t as E}from"./separator-TInKeIDo.js";import"./skeleton-DWaac_qp.js";var D=d(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),O=d(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]);function k(){let e=document.activeElement;return!(e instanceof HTMLElement)||!e.isConnected?!1:e.classList.contains(`xterm-helper-textarea`)?!0:e.closest(`.thread-terminal-drawer .xterm`)!==null}var A=c(),j=n(),M=e(t(),1),N={"2xl":1536,"3xl":1600,"4xl":2e3,lg:1024,md:768,sm:640,xl:1280};function P(e){return`(min-width: ${typeof e==`number`?e:N[e]}px)`}function F(e){return`(max-width: ${(typeof e==`number`?e:N[e])-1}px)`}function I(e){if(typeof e!=`string`){let t=[];return e.min!=null&&t.push(P(e.min)),e.max!=null&&t.push(F(e.max)),e.pointer===`coarse`&&t.push(`(pointer: coarse)`),e.pointer===`fine`&&t.push(`(pointer: fine)`),t.length===0?`(min-width: 0px)`:t.join(` and `)}if(e.startsWith(`(`))return e;let t=[];for(let n of e.split(`:`))if(n.startsWith(`max-`)){let e=n.slice(4);e in N&&t.push(F(e))}else n in N&&t.push(P(n));return t.length>0?t.join(` and `):e}function L(){return!1}function R(e){let t=(0,j.c)(6),n;t[0]===e?n=t[1]:(n=I(e),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i=e=>{if(typeof window>`u`)return z;let t=window.matchMedia(r);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},t[2]=r,t[3]=i);let a=i,o;return t[4]===r?o=t[5]:(o=()=>typeof window>`u`?!1:window.matchMedia(r).matches,t[4]=r,t[5]=o),(0,M.useSyncExternalStore)(a,o,L)}function z(){}function B(){return R(`max-md`)}var V=w,H=v;function U(e){let t=(0,j.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=u(`app-sheet-backdrop fixed inset-0 z-50 backdrop-blur-sm transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(y,{className:i,"data-slot":`sheet-backdrop`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function W(e){let t=(0,j.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,side:i,variant:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s=i===`bottom`&&`grid grid-rows-[1fr_auto] pt-12`,c=i===`top`&&`grid grid-rows-[auto_1fr] pb-12`,l=i===`left`&&`flex justify-start`,d=i===`right`&&`flex justify-end`,f=o===`inset`&&`sm:p-4`,p;t[5]!==n||t[6]!==s||t[7]!==c||t[8]!==l||t[9]!==d||t[10]!==f?(p=u(`pointer-events-auto fixed inset-0 z-50 grid`,s,c,l,d,f,n),t[5]=n,t[6]=s,t[7]=c,t[8]=l,t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==r||t[13]!==p?(m=(0,A.jsx)(b,{className:p,"data-slot":`sheet-viewport`,...r}),t[12]=r,t[13]=p,t[14]=m):m=t[14],m}function G(e){let t=(0,j.c)(34),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]):({className:r,children:n,onKeyDown:i,showCloseButton:o,keepMounted:s,side:c,variant:l,...a}=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 d=o===void 0?!0:o,p=s===void 0?!1:s,m=c===void 0?`right`:c,h=l===void 0?`default`:l,v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,A.jsx)(U,{}),t[9]=v):v=t[9];let y=m===`bottom`&&`row-start-2 border-t data-ending-style:translate-y-8 data-starting-style:translate-y-8`,b=m===`top`&&`data-ending-style:-translate-y-8 data-starting-style:-translate-y-8 border-b`,x=m===`left`&&`data-ending-style:-translate-x-8 data-starting-style:-translate-x-8 w-[calc(100%-(--spacing(12)))] max-w-md border-e`,C=m===`right`&&`col-start-2 w-[calc(100%-(--spacing(12)))] max-w-md border-s data-ending-style:translate-x-8 data-starting-style:translate-x-8`,w=h===`inset`&&`before:hidden sm:rounded-2xl sm:border sm:before:rounded-[calc(var(--radius-2xl)-1px)] sm:**:data-[slot=sheet-footer]:rounded-b-[calc(var(--radius-2xl)-1px)]`,T;t[10]!==r||t[11]!==w||t[12]!==y||t[13]!==b||t[14]!==x||t[15]!==C?(T=u(`app-surface pointer-events-auto relative flex max-h-full min-h-0 w-full min-w-0 flex-col not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 transition-[opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:opacity-0 data-starting-style:opacity-0 max-sm:before:hidden dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,y,b,x,C,w,r),t[10]=r,t[11]=w,t[12]=y,t[13]=b,t[14]=x,t[15]=C,t[16]=T):T=t[16];let E;t[17]===i?E=t[18]:(E=e=>{i?.(e),e.stopPropagation()},t[17]=i,t[18]=E);let D;t[19]===d?D=t[20]:(D=d&&(0,A.jsx)(S,{"aria-label":`Close`,className:`absolute end-2 top-2 z-20`,render:(0,A.jsx)(f,{size:`icon`,variant:`ghost`}),children:(0,A.jsx)(g,{})}),t[19]=d,t[20]=D);let O;t[21]!==n||t[22]!==a||t[23]!==T||t[24]!==E||t[25]!==D?(O=(0,A.jsxs)(_,{className:T,"data-slot":`sheet-popup`,onKeyDown:E,...a,children:[n,D]}),t[21]=n,t[22]=a,t[23]=T,t[24]=E,t[25]=D,t[26]=O):O=t[26];let k;t[27]!==m||t[28]!==O||t[29]!==h?(k=(0,A.jsx)(W,{side:m,variant:h,children:O}),t[27]=m,t[28]=O,t[29]=h,t[30]=k):k=t[30];let M;return t[31]!==p||t[32]!==k?(M=(0,A.jsxs)(H,{keepMounted:p,children:[v,k]}),t[31]=p,t[32]=k,t[33]=M):M=t[33],M}function ee(e){let t=(0,j.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=u(`flex flex-col gap-2 p-6 in-[[data-slot=sheet-popup]:has([data-slot=sheet-panel])]:pb-3 max-sm:pb-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(`div`,{className:i,"data-slot":`sheet-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function te(e){let t=(0,j.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=u(`font-heading font-semibold text-xl leading-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(C,{className:i,"data-slot":`sheet-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ne(e){let t=(0,j.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=u(`text-muted-foreground text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(x,{className:i,"data-slot":`sheet-description`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var re=`sidebar_state`,ie=3600*24*7,K=`16rem`,q=`calc(100vw - var(--spacing(3)))`,J=`3rem`,ae=256,Y=M.createContext(null),X=M.createContext(null);function Z(){let e=M.useContext(Y);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function oe(e){let t=(0,j.c)(33),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({defaultOpen:c,open:i,onOpenChange:o,className:r,style:s,children:n,...a}=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);let l=c===void 0?!0:c,d=B(),[f,p]=M.useState(!1),[m,h]=M.useState(l),g=i??m,_;t[8]!==g||t[9]!==o?(_=async e=>{let t=typeof e==`function`?e(g):e;o?o(t):h(t),await cookieStore.set({expires:Date.now()+ie*1e3,name:re,path:`/`,value:String(t)})},t[8]=g,t[9]=o,t[10]=_):_=t[10];let v=_,y;t[11]!==d||t[12]!==v?(y=()=>d?p(ce):v(se),t[11]=d,t[12]=v,t[13]=y):y=t[13];let b=y,x=g?`expanded`:`collapsed`,S;t[14]!==d||t[15]!==g||t[16]!==f||t[17]!==v||t[18]!==x||t[19]!==b?(S={isMobile:d,open:g,openMobile:f,setOpen:v,setOpenMobile:p,state:x,toggleSidebar:b},t[14]=d,t[15]=g,t[16]=f,t[17]=v,t[18]=x,t[19]=b,t[20]=S):S=t[20];let C=S,w;t[21]===r?w=t[22]:(w=u(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),t[21]=r,t[22]=w);let T;t[23]===s?T=t[24]:(T={"--sidebar-width":K,"--sidebar-width-icon":J,...s},t[23]=s,t[24]=T);let E=T,D;t[25]!==n||t[26]!==a||t[27]!==w||t[28]!==E?(D=(0,A.jsx)(`div`,{className:w,"data-slot":`sidebar-wrapper`,style:E,...a,children:n}),t[25]=n,t[26]=a,t[27]=w,t[28]=E,t[29]=D):D=t[29];let O;return t[30]!==C||t[31]!==D?(O=(0,A.jsx)(Y.Provider,{value:C,children:D}),t[30]=C,t[31]=D,t[32]=O):O=t[32],O}function se(e){return!e}function ce(e){return!e}function le(e){let t=(0,j.c)(77),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({side:a,variant:o,collapsible:s,resizable:c,className:r,children:n,...i}=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);let l=a===void 0?`left`:a,d=o===void 0?`sidebar`:o,f=s===void 0?`offcanvas`:s,p=c===void 0?!1:c,{isMobile:m,state:h,openMobile:g,setOpenMobile:_}=Z(),v;bb0:{if(m||f===`none`||!p){v=null;break bb0}let e;t[8]===p?e=t[9]:(e=typeof p==`boolean`?{}:p,t[8]=p,t[9]=e);let n=e,r=n.maxWidth??1/0,i=n.minWidth??ae,a=n.storageKey??null,o;t[10]===n.onResize?o=t[11]:(o=n.onResize?{onResize:n.onResize}:{},t[10]=n.onResize,t[11]=o);let s;t[12]===n.shouldAcceptWidth?s=t[13]:(s=n.shouldAcceptWidth?{shouldAcceptWidth:n.shouldAcceptWidth}:{},t[12]=n.shouldAcceptWidth,t[13]=s);let c;t[14]!==o||t[15]!==s||t[16]!==r||t[17]!==i||t[18]!==a?(c={maxWidth:r,minWidth:i,storageKey:a,...o,...s},t[14]=o,t[15]=s,t[16]=r,t[17]=i,t[18]=a,t[19]=c):c=t[19],v=c}let y=v,b;t[20]!==y||t[21]!==l?(b={side:l,resizable:y},t[20]=y,t[21]=l,t[22]=b):b=t[22];let x=b;if(f===`none`){let e;t[23]===r?e=t[24]:(e=u(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),t[23]=r,t[24]=e);let a;t[25]!==n||t[26]!==i||t[27]!==e?(a=(0,A.jsx)(`div`,{className:e,"data-slot":`sidebar`,...i,children:n}),t[25]=n,t[26]=i,t[27]=e,t[28]=a):a=t[28];let o;return t[29]!==x||t[30]!==a?(o=(0,A.jsx)(X.Provider,{value:x,children:a}),t[29]=x,t[30]=a,t[31]=o):o=t[31],o}if(m){let e;t[32]===r?e=t[33]:(e=u(`w-(--sidebar-width) max-w-none bg-sidebar p-0 text-sidebar-foreground`,r),t[32]=r,t[33]=e);let a;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(a={"--sidebar-width":q},t[34]=a):a=t[34];let o;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,A.jsxs)(ee,{className:`sr-only`,children:[(0,A.jsx)(te,{children:`Sidebar`}),(0,A.jsx)(ne,{children:`Displays the mobile sidebar.`})]}),t[35]=o):o=t[35];let s=l===`left`?`pl-safe`:`pr-safe`,c;t[36]===s?c=t[37]:(c=u(`flex h-full w-full flex-col pb-safe pt-safe`,s),t[36]=s,t[37]=c);let d;t[38]!==n||t[39]!==c?(d=(0,A.jsx)(`div`,{className:c,children:n}),t[38]=n,t[39]=c,t[40]=d):d=t[40];let f;t[41]!==l||t[42]!==d||t[43]!==e?(f=(0,A.jsxs)(G,{className:e,"data-mobile":`true`,"data-sidebar":`sidebar`,"data-slot":`sidebar`,showCloseButton:!1,side:l,style:a,children:[o,d]}),t[41]=l,t[42]=d,t[43]=e,t[44]=f):f=t[44];let p;t[45]!==g||t[46]!==i||t[47]!==_||t[48]!==f?(p=(0,A.jsx)(V,{onOpenChange:_,open:g,...i,children:f}),t[45]=g,t[46]=i,t[47]=_,t[48]=f,t[49]=p):p=t[49];let m;return t[50]!==x||t[51]!==p?(m=(0,A.jsx)(X.Provider,{value:x,children:p}),t[50]=x,t[51]=p,t[52]=m):m=t[52],m}let S=h===`collapsed`?f:``,C=d===`floating`||d===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,w;t[53]===C?w=t[54]:(w=u(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,C),t[53]=C,t[54]=w);let T;t[55]===w?T=t[56]:(T=(0,A.jsx)(`div`,{className:w,"data-slot":`sidebar-gap`}),t[55]=w,t[56]=T);let E=l===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,D=d===`floating`||d===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,O;t[57]!==r||t[58]!==E||t[59]!==D?(O=u(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,E,D,r),t[57]=r,t[58]=E,t[59]=D,t[60]=O):O=t[60];let k;t[61]===n?k=t[62]:(k=(0,A.jsx)(`div`,{className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm/5`,"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,children:n}),t[61]=n,t[62]=k);let M;t[63]!==i||t[64]!==O||t[65]!==k?(M=(0,A.jsx)(`div`,{className:O,"data-slot":`sidebar-container`,...i,children:k}),t[63]=i,t[64]=O,t[65]=k,t[66]=M):M=t[66];let N;t[67]!==l||t[68]!==h||t[69]!==T||t[70]!==M||t[71]!==S||t[72]!==d?(N=(0,A.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-collapsible":S,"data-side":l,"data-slot":`sidebar`,"data-state":h,"data-variant":d,children:[T,M]}),t[67]=l,t[68]=h,t[69]=T,t[70]=M,t[71]=S,t[72]=d,t[73]=N):N=t[73];let P;return t[74]!==x||t[75]!==N?(P=(0,A.jsx)(X.Provider,{value:x,children:N}),t[74]=x,t[75]=N,t[76]=P):P=t[76],P}function ue(e){let t=(0,j.c)(17),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{toggleSidebar:a,openMobile:o}=Z(),s;t[4]===n?s=t[5]:(s=u(`size-7`,n),t[4]=n,t[5]=s);let c;t[6]!==r||t[7]!==a?(c=e=>{r?.(e),a()},t[6]=r,t[7]=a,t[8]=c):c=t[8];let l;t[9]===o?l=t[10]:(l=o?(0,A.jsx)(D,{}):(0,A.jsx)(O,{}),t[9]=o,t[10]=l);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,A.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`}),t[11]=d):d=t[11];let p;return t[12]!==i||t[13]!==s||t[14]!==c||t[15]!==l?(p=(0,A.jsxs)(f,{className:s,"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,onClick:c,size:`icon`,variant:`ghost`,...i,children:[l,d]}),t[12]=i,t[13]=s,t[14]=c,t[15]=l,t[16]=p):p=t[16],p}function Q(e,t){return Math.max(t.minWidth,Math.min(e,t.maxWidth))}function de(e){let t=(0,j.c)(48),n,i,a,o,s,c,d;t[0]===e?(n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],d=t[7]):({className:n,onClick:i,onPointerCancel:a,onPointerDown:o,onPointerMove:s,onPointerUp:c,...d}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=d);let{open:f,toggleSidebar:p}=Z(),m=M.useContext(X),g=M.useRef(null),_=M.useRef(!1),v=M.useRef(null),y=m?.resizable??null,b=y!==null&&f,x=b?`Resize Sidebar`:`Toggle Sidebar`,S=b?`Drag to resize sidebar`:`Toggle Sidebar`,C;t[8]===y?C=t[9]:(C=e=>{let t=v.current;t&&(t.rafId!==null&&window.cancelAnimationFrame(t.rafId),t.transitionTargets.forEach(he),y?.storageKey&&typeof window<`u`&&l(y.storageKey,t.width,r),y?.onResize?.(t.width),v.current=null,t.rail.hasPointerCapture(e)&&t.rail.releasePointerCapture(e),document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`))},t[8]=y,t[9]=C);let w=C,T;t[10]!==o||t[11]!==f||t[12]!==y||t[13]!==m?.side?(T=e=>{if(o?.(e),e.defaultPrevented||!y||!f||e.button!==0)return;let t=e.currentTarget.closest(`[data-slot='sidebar-wrapper']`),n=e.currentTarget.closest(`[data-slot='sidebar']`);if(!t||!n)return;let r=n.querySelector(`[data-slot='sidebar-container']`);if(!r)return;let i=r.getBoundingClientRect().width,a=Q(i,y),s=[n.querySelector(`[data-slot='sidebar-gap']`),n.querySelector(`[data-slot='sidebar-container']`)].filter(me);s.forEach(pe),e.preventDefault(),e.stopPropagation(),v.current={moved:!1,pointerId:e.pointerId,pendingWidth:a,rail:e.currentTarget,rafId:null,sidebarRoot:n,side:m?.side??`left`,startWidth:a,startX:e.clientX,transitionTargets:s,width:a,wrapper:t},t.style.setProperty(`--sidebar-width`,`${a}px`),e.currentTarget.setPointerCapture(e.pointerId),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},t[10]=o,t[11]=f,t[12]=y,t[13]=m?.side,t[14]=T):T=t[14],m?.side;let E=T,D;t[15]!==s||t[16]!==y?(D=e=>{if(s?.(e),e.defaultPrevented)return;let t=v.current;if(!t||t.pointerId!==e.pointerId||!y)return;e.preventDefault();let n=t.side===`right`?t.startX-e.clientX:e.clientX-t.startX;Math.abs(n)>2&&(t.moved=!0),t.pendingWidth=Q(t.startWidth+n,y),t.rafId===null&&(t.rafId=window.requestAnimationFrame(()=>{let e=v.current;if(!e||!y)return;e.rafId=null;let t=e.pendingWidth;(y.shouldAcceptWidth?.({currentWidth:e.width,nextWidth:t,rail:e.rail,side:e.side,sidebarRoot:e.sidebarRoot,wrapper:e.wrapper})??!0)&&(e.wrapper.style.setProperty(`--sidebar-width`,`${t}px`),e.width=t)}))},t[15]=s,t[16]=y,t[17]=D):D=t[17];let O=D,k;t[18]===w?k=t[19]:(k=e=>{let t=v.current;!t||t.pointerId!==e.pointerId||(e.preventDefault(),_.current=t.moved,w(e.pointerId))},t[18]=w,t[19]=k);let N=k,P;t[20]!==N||t[21]!==c?(P=e=>{c?.(e),!e.defaultPrevented&&N(e)},t[20]=N,t[21]=c,t[22]=P):P=t[22];let F=P,I;t[23]!==N||t[24]!==a?(I=e=>{a?.(e),!e.defaultPrevented&&N(e)},t[23]=N,t[24]=a,t[25]=I):I=t[25];let L=I,R;t[26]!==i||t[27]!==f||t[28]!==y||t[29]!==p?(R=e=>{if(i?.(e),!e.defaultPrevented){if(_.current){_.current=!1,e.preventDefault();return}if(y&&f){e.preventDefault();return}p()}},t[26]=i,t[27]=f,t[28]=y,t[29]=p,t[30]=R):R=t[30];let z=R,B,V;t[31]===y?(B=t[32],V=t[33]):(B=()=>{if(!y?.storageKey||typeof window>`u`)return;let e=g.current;if(!e)return;let t=e.closest(`[data-slot='sidebar-wrapper']`);if(!t)return;let n=h(y.storageKey,r);if(n===null)return;let i=Q(n,y);t.style.setProperty(`--sidebar-width`,`${i}px`),y.onResize?.(i)},V=[y],t[31]=y,t[32]=B,t[33]=V),M.useEffect(B,V);let H,U;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>()=>{let e=v.current;e?.rafId!=null&&window.cancelAnimationFrame(e.rafId),e?.transitionTargets.forEach(fe),document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`)},U=[],t[34]=H,t[35]=U):(H=t[34],U=t[35]),M.useEffect(H,U);let W;t[36]===n?W=t[37]:(W=u(`-translate-x-1/2 group-data-[side=left]:-right-4 absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=right]:left-0 sm:flex [[data-collapsible=offcanvas][data-state=collapsed]_&]:pointer-events-none`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:after:left-full`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,n),t[36]=n,t[37]=W);let G;return t[38]!==z||t[39]!==L||t[40]!==E||t[41]!==O||t[42]!==F||t[43]!==d||t[44]!==x||t[45]!==S||t[46]!==W?(G=(0,A.jsx)(`button`,{"aria-label":x,className:W,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,onClick:z,onPointerCancel:L,onPointerDown:E,onPointerMove:O,onPointerUp:F,ref:g,tabIndex:-1,title:S,type:`button`,...d}),t[38]=z,t[39]=L,t[40]=E,t[41]=O,t[42]=F,t[43]=d,t[44]=x,t[45]=S,t[46]=W,t[47]=G):G=t[47],G}function fe(e){e.style.removeProperty(`transition-duration`)}function pe(e){e.style.setProperty(`transition-duration`,`0ms`)}function me(e){return e!==null}function he(e){e.style.removeProperty(`transition-duration`)}function ge(e){let t=(0,j.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=u(`relative flex min-w-0 w-full flex-1 flex-col bg-background`,`md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm/5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(`main`,{className:i,"data-slot":`sidebar-inset`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _e(e){let t=(0,j.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=u(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(`div`,{className:i,"data-sidebar":`header`,"data-slot":`sidebar-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ve(e){let t=(0,j.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=u(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(`div`,{className:i,"data-sidebar":`footer`,"data-slot":`sidebar-footer`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ye(e){let t=(0,j.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=u(`mx-2 w-auto bg-sidebar-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(E,{className:i,"data-sidebar":`separator`,"data-slot":`sidebar-separator`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function be(e){let t=(0,j.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=u(`flex w-full min-w-0 flex-col gap-2 group-data-[collapsible=icon]:overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(T,{hideScrollbars:!0,scrollFade:!0,className:`h-auto min-h-0 flex-1`,children:(0,A.jsx)(`div`,{className:i,"data-sidebar":`content`,"data-slot":`sidebar-content`,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function xe(e){let t=(0,j.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=u(`relative flex w-full min-w-0 flex-col p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(`div`,{className:i,"data-sidebar":`group`,"data-slot":`sidebar-group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $(e){let t=(0,j.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=u(`flex w-full min-w-0 flex-col gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(`ul`,{className:i,"data-sidebar":`menu`,"data-slot":`sidebar-menu`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Se(e){let t=(0,j.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=u(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(`li`,{className:i,"data-sidebar":`menu-item`,"data-slot":`sidebar-menu-item`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Ce=p(`peer/menu-button flex w-full cursor-pointer items-center gap-2 overflow-hidden rounded-lg p-2 text-left text-sm outline-hidden ring-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pe-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-8 text-sm`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`,sm:`h-7 text-xs`},variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`}}});function we(e){let t=(0,j.c)(13),{isActive:n,variant:r,size:c,tooltip:l,className:d,render:f,...p}=e,h=n===void 0?!1:n,g=r===void 0?`default`:r,_=c===void 0?`default`:c,{isMobile:v,state:y}=Z(),b=a({className:u(Ce({size:_,variant:g}),d),"data-active":h,"data-sidebar":`menu-button`,"data-size":_,"data-slot":`sidebar-menu-button`},p),x;t[0]!==b||t[1]!==f?(x={defaultTagName:`button`,props:b,render:f},t[0]=b,t[1]=f,t[2]=x):x=t[2];let S=s(x);if(!l)return S;if(typeof l==`string`){let e;t[3]===l?e=t[4]:(e={children:l},t[3]=l,t[4]=e),l=e}let C=S,w;t[5]===C?w=t[6]:(w=(0,A.jsx)(o,{render:C}),t[5]=C,t[6]=w);let T=y!==`collapsed`||v,E;t[7]!==T||t[8]!==l?(E=(0,A.jsx)(i,{align:`center`,hidden:T,side:`right`,...l}),t[7]=T,t[8]=l,t[9]=E):E=t[9];let D;return t[10]!==w||t[11]!==E?(D=(0,A.jsxs)(m,{children:[w,E]}),t[10]=w,t[11]=E,t[12]=D):D=t[12],D}function Te(e){let t=(0,j.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=u(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-sidebar-border border-l px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(`ul`,{className:i,"data-sidebar":`menu-sub`,"data-slot":`sidebar-menu-sub`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ee(e){let t=(0,j.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=u(`group/menu-sub-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,A.jsx)(`li`,{className:i,"data-sidebar":`menu-sub-item`,"data-slot":`sidebar-menu-sub-item`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function De(e){let t=(0,j.c)(9),n,r,i,o;if(t[0]!==e){let{size:c,isActive:l,className:d,render:f,...p}=e;n=f;let m=c===void 0?`md`:c,h=l===void 0?!1:l,g={className:u(`-translate-x-px flex h-7 min-w-0 cursor-pointer items-center gap-2 overflow-hidden rounded-lg px-2 text-sidebar-foreground outline-hidden ring-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,m===`sm`&&`text-xs`,m===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,d),"data-active":h,"data-sidebar":`menu-sub-button`,"data-size":m,"data-slot":`sidebar-menu-sub-button`};o=s,r=`a`,i=a(g,p),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o}else n=t[1],r=t[2],i=t[3],o=t[4];let c;return t[5]!==n||t[6]!==r||t[7]!==i?(c={defaultTagName:r,props:i,render:n},t[5]=n,t[6]=r,t[7]=i,t[8]=c):c=t[8],o(c)}export{Z as _,_e as a,R as b,we as c,De as d,Ee as f,ue as g,ye as h,xe as i,Se as l,de as m,be as n,ge as o,oe as p,ve as r,$ as s,le as t,Te as u,V as v,k as x,G as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-PSPkXoKo.js";import{t as n}from"./react-CjD7iThp.js";import{Ai as r,Ni as i}from"./composerDraftStore-D12lUSfh.js";import{n as a,r as o}from"./useNavigate-B2tgshhW.js";import{A as s,C as c,D as l,E as u,F as d,I as f,L as p,M as m,N as h,O as g,P as _,S as v,T as y,b,j as x,k as S,x as C}from"./toast-DE7a4wkW.js";function w(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var T=4,E=5;function D(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function O(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=D(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function k(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=O(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=j(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=j(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=te(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=te(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=te(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=j(n.fullPath??n.from);e.kind=E,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=j(n.fullPath??n.from);e.kind=T,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)k(e,t,r,s,i,a,o)}function ee(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function A(e){if(e.pathless)for(let t of e.pathless)A(t);if(e.static)for(let t of e.static.values())A(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())A(t);if(e.dynamic?.length){e.dynamic.sort(ee);for(let t of e.dynamic)A(t)}if(e.optional?.length){e.optional.sort(ee);for(let t of e.optional)A(t)}if(e.wildcard?.length){e.wildcard.sort(ee);for(let t of e.wildcard)A(t)}}function j(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function te(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function ne(e,t){let n=j(`/`),r=new Uint16Array(6);for(let t of e)k(!1,r,t,1,n,0);A(n),t.masksTree=n,t.flatCache=w(1e3)}function re(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=ce(e,t.masksTree);return t.flatCache.set(e,r),r}function ie(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=j(`/`),k(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),ce(r,o,n)}function ae(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=ce(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=ue(a.route)),t.matchCache.set(r,a),a}function oe(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function se(e,t=!1,n){let r=j(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return k(t,i,e,1,r,0,e=>{if(n?.(e,s),y(!(e.id in a),`Duplicate routes found with id: ${String(e.id)}`),a[e.id]=e,s!==0&&e.path){let t=oe(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),A(r),{processedTree:{segmentTree:r,singleCache:w(1e3),matchCache:w(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function ce(e,t,n=!1){let r=e.split(`/`),i=fe(e,r,t,n);if(!i)return null;let[a]=le(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function le(e,t,n){let r=de(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===T)break;if(u.kind===E){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function ue(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function de(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function fe(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!d(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!pe(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==T&&M(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&&M(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(pe(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;M(u,n)&&(u=n)}}if(i.wildcard&&M(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!pe(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return M(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function pe(e,t,n){try{let[r,i]=le(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function M(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===T)>(e.node.kind===T)||t.node.kind===T==(e.node.kind===T)&&t.depth>e.depth))):!0}function N(e){return P(e.filter(e=>e!==void 0).join(`/`))}function P(e){return e.replace(/\/{2,}/g,`/`)}function me(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function F(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function I(e){return F(me(e))}function he(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function ge(e,t,n){return he(e,n)===he(t,n)}function _e({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&d(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(d(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=O(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=P(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function ve(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function L(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>be(e,n)).join(`/`):be(r,n):r}function ye({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=O(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=L(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=L(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=L(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function be(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function R(e){return!!e?.isNotFound}function xe(){try{if(typeof window<`u`&&typeof window.sessionStorage==`object`)return window.sessionStorage}catch{}}var z=`tsr-scroll-restoration-v1_3`,Se=(e,t)=>{let n;return(...r)=>{n||=setTimeout(()=>{e(...r),n=null},t)}};function B(){let e=xe();if(!e)return null;let t=e.getItem(z),n=t?JSON.parse(t):{};return{state:n,set:t=>{n=m(t,n)||n;try{e.setItem(z,JSON.stringify(n))}catch{console.warn(`[ts-router] Could not persist scroll restoration state to sessionStorage.`)}}}}var V=B(),H=e=>e.state.__TSR_key||e.href;function Ce(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var U=!1;function we({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||`{}`)}catch(e){console.error(e);return}let s=t||window.history.state?.__TSR_key,c=o[s];U=!0;scroll:{if(r&&c&&Object.keys(c).length>0){for(let e in c){let t=c[e];if(e===`window`)window.scrollTo({top:t.scrollY,left:t.scrollX,behavior:n});else if(e){let n=document.querySelector(e);n&&(n.scrollLeft=t.scrollX,n.scrollTop=t.scrollY)}}break scroll}let e=(a??window.location).hash.split(`#`,2)[1];if(e){let t=window.history.state?.__hashScrollIntoViewOptions??!0;if(t){let n=document.getElementById(e);n&&n.scrollIntoView(t)}break scroll}let t={top:0,left:0,behavior:n};if(window.scrollTo(t),i)for(let e of i){if(e===`window`)continue;let n=typeof e==`function`?e():document.querySelector(e);n&&n.scrollTo(t)}}U=!1}function Te(e,t){if(!V||((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!V))return;e.isScrollRestorationSetup=!0,U=!1;let n=e.options.getScrollRestorationKey||H;window.history.scrollRestoration=`manual`,typeof document<`u`&&document.addEventListener(`scroll`,Se(t=>{if(U||!e.isScrollRestoring)return;let r=``;if(t.target===document||t.target===window)r=`window`;else{let e=t.target.getAttribute(`data-scroll-restoration-id`);r=e?`[data-scroll-restoration-id="${e}"]`:Ce(t.target)}let i=n(e.state.location);V.set(e=>{let t=e[i]||={},n=t[r]||={};if(r===`window`)n.scrollX=window.scrollX||0,n.scrollY=window.scrollY||0;else if(r){let e=document.querySelector(r);e&&(n.scrollX=e.scrollLeft||0,n.scrollY=e.scrollTop||0)}return e})},100),!0),e.subscribe(`onRendered`,t=>{let r=n(t.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation})||(we({storageKey:z,key:r,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&V.set(e=>(e[r]||={},e)))})}function Ee(e){if(typeof document<`u`&&document.querySelector){let t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==``){let n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function De(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Oe(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function ke(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Oe(r):Array.isArray(t)?t.push(Oe(r)):n[e]=[t,Oe(r)]}return n}var Ae=Me(JSON.parse),je=Ne(JSON.stringify,JSON.parse);function Me(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=ke(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Ne(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=De(e,r);return t?`?${t}`:``}}var Pe=`__root__`;function Fe(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function W(e){return e instanceof Response&&!!e.options}function Ie(e){return{input:({url:t})=>{for(let n of e)t=Re(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=ze(e[n],t);return t}}}function Le(e){let t=I(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=N([`/`,t,e.pathname]),e)}}function Re(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ze(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}var G=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(G||{});function Be({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}var Ve=0,K=0,He=0,q=[],{link:Ue,unlink:We,propagate:Ge,checkDirty:Ke,shallowPropagate:qe}=Be({update(e){return e.depsTail===void 0?Qe(e):Ze(e)},notify(e){let t=He,n=t;do if(q[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(He=t;n<--t;){let e=q[n];q[n++]=q[t],q[t]=e}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,nt(e)):tt.call(e)}});function Je(){return Ve}function Ye(){++Ve}function Xe(){--Ve||et()}function Ze(e){e.depsTail=void 0,e.flags=5;try{let t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,nt(e)}}function Qe(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function $e(e){let t=e.flags;if(t&16||t&32&&Ke(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,nt(e)}}else e.flags=2}function et(){try{for(;K<He;){let e=q[K];q[K++]=void 0,$e(e)}}finally{for(;K<He;){let e=q[K];q[K++]=void 0,e.flags|=10}K=0,He=0}}function tt(){this.depsTail=void 0,this.flags=0,nt(this);let e=this.subs;e!==void 0&&We(e)}function nt(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=We(n,e)}function rt(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var it=[],at=0,{link:ot,unlink:st,propagate:ct,checkDirty:lt,shallowPropagate:ut}=Be({update(e){return e._update()},notify(e){it[ft++]=e,e.flags&=~G.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=G.Mutable|G.Dirty,pt(e))}}),dt=0,ft=0,J;function pt(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=st(n,e)}function mt(){if(!(Je()>0)){for(;dt<ft;){let e=it[dt];it[dt++]=void 0,e.notify()}dt=0,ft=0}}function ht(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?G.None:G.Mutable,get(){return J!==void 0&&ot(i,J,at),i._snapshot},subscribe(e){let t=rt(e),n={current:!1},r=gt(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=J,o=t?.compare??Object.is;if(n)J=i,++at,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=G.Mutable|G.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{J=a,n&&(i.flags&=~G.RecursedCheck),pt(i)}}};return n?(i.flags=G.Mutable|G.Dirty,i.get=function(){let e=i.flags;if(e&G.Dirty||e&G.Pending&<(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&ut(e)}}else e&G.Pending&&(i.flags=e&~G.Pending);return J!==void 0&&ot(i,J,at),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(ct(e),ut(e),mt())}},i}function gt(e){let t=()=>{let t=J;J=n,++at,n.depsTail=void 0,n.flags=G.Watching|G.RecursedCheck;try{return e()}finally{J=t,n.flags&=~G.RecursedCheck,pt(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:G.Watching|G.RecursedCheck,notify(){let e=this.flags;e&G.Dirty||e&G.Pending&<(this.deps,this)?t():this.flags=G.Watching},stop(){this.flags=G.None,this.depsTail=void 0,pt(this)}};return t(),n}var _t=class{constructor(e){this.atom=ht(e)}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(rt(e))}},vt=class{constructor(e){this.atom=ht(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(rt(e))}};function yt(e){return typeof e==`function`?new vt(e):new _t(e)}function bt(e){try{Ye(),e()}finally{Xe(),mt()}}function xt(e){let t;return bt(()=>{t=e()}),t}var St=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ct=(e,t)=>!!(e.preload&&!e.router.state.matches.some(e=>e.id===t)),Y=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},wt=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},X=(e,t,n)=>{if(!(!W(n)&&!R(n)))throw W(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:W(n)?`redirected`:r.status===`pending`?`success`:r.status,context:Y(e,t.index),isFetching:!1,error:n})),R(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),W(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Tt=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Et=(e,t,n)=>{let r=Y(e,n);e.updateMatch(t,e=>({...e,context:r}))},Dt=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,X(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,X(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!W(n)&&!R(n)&&(e.serialError??=n)},Ot=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ct(e,t)&&(n.options.loader||n.options.beforeLoad||zt(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{St(e)},i);r._nonReactive.pendingTimeout=t}},kt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Ot(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&X(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},At=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=l(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Dt(e,n,o,`PARSE_PARAMS`),s&&Dt(e,n,s,`VALIDATE_SEARCH`),Ot(e,t,r,i);let c=new AbortController,u=!1,d=()=>{u||(u=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},f=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){xt(()=>{d(),f()});return}i._nonReactive.beforeLoadPromise=l();let p={...Y(e,n,!1),...i.__routeContext},{search:m,params:h,cause:g}=i,v=Ct(e,t),y={search:m,abortController:c,params:h,preload:v,context:p,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?`preload`:g,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},b=r=>{if(r===void 0){xt(()=>{d(),f()});return}(W(r)||R(r))&&(d(),Dt(e,n,r,`BEFORE_LOAD`)),xt(()=>{d(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),f()})},x;try{if(x=r.options.beforeLoad(y),_(x))return d(),x.catch(t=>{Dt(e,n,t,`BEFORE_LOAD`)}).then(b)}catch(t){d(),Dt(e,n,t,`BEFORE_LOAD`)}b(x)},jt=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>At(e,n,t,i),s=()=>{if(Tt(e,n))return;let t=kt(e,n,i);return _(t)?t.then(o):o()};return a()},Mt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Nt=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=Y(e,r),d=Ct(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Pt=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{Rt(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Nt(e,t,n,r,i)),l=!!s&&_(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;X(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:Y(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:Y(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,R(t)&&await i.options.notFoundComponent?.preload?.(),X(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,X(e,e.router.getMatch(n),t)}!W(o)&&!R(o)&&await Rt(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:Y(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),X(e,r,t)}},Ft=async(e,t,n)=>{async function r(r,a,c,l,u){let f=Date.now()-a.updatedAt,p=r?u.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.router.options.defaultStaleTime??0,m=u.options.shouldReload,h=typeof m==`function`?m(Nt(e,t,i,n,u)):m,{status:g,invalid:_}=l,v=f>p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&u.options.preload===!1||(o&&!e.sync&&d?(s=!0,(async()=>{try{await Pt(e,t,i,n,u);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){W(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await Pt(e,t,i,n,u):Et(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],u=c.options.loader,d=((typeof u==`function`?void 0:u?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Tt(e,i)){if(!e.router.getMatch(i))return e.matches[n];Et(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(e=>e.routeId===a)?.id,s=Ct(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&d)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&X(e,n,a),n.status===`pending`&&await r(s,t,o,n,c)}else{let n=s&&!e.router.state.matches.some(e=>e.id===i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=l(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(s,t,o,a,c)}}let f=e.router.getMatch(i);s||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,s||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;let p=s?f.isFetching:!1;return p!==f.isFetching||f.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:p,invalid:!1})),e.router.getMatch(i)):f};async function It(e){let t=e,n=[];t.router.state.matches.some(e=>e._forcePending)&&St(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=jt(t,e);_(n)&&await n}catch(e){if(W(e))throw e;if(R(e))r=e;else if(!t.preload)throw e;break}if(t.serialError)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?wt(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(Ft(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(W(e))throw e;R(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!l&&r&&t.preload)return t.matches;if(l){let e=wt(t,l);y(e!==void 0,`Could not find match for notFound boundary`);let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await Rt(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Rt(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Mt(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=St(t);if(_(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Lt(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Rt(e,t=Bt){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===Bt?(()=>{if(e._componentsPromise===void 0){let t=Lt(e,Bt);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Lt(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function zt(e){for(let t of Bt)if(e.options[t]?.preload)return!0;return!1}var Bt=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],Z=`__TSR_index`,Vt=`popstate`,Ht=`beforeunload`;function Ut(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Jt(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Z];i=Wt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Z];i=Wt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Z]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Wt(e,t){t||={};let n=Yt();return{...t,key:n,__TSR_key:n,[Z]:e}}function Gt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Jt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Yt();t.history.replaceState({[Z]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Jt(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[Z]-l.state[Z],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Ut({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ht,S,{capture:!0}),t.removeEventListener(Vt,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Ht,S,{capture:!0}),t.addEventListener(Vt,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Kt(e){let t=e?.window??(typeof document<`u`?window:void 0);return Gt({window:t,parseLocation:()=>{let e=t.location.hash.split(`#`).slice(1),n=e[0]??`/`,r=t.location.search,i=e.slice(1);return Jt(`${n}${r}${i.length===0?``:`#${i.join(`#`)}`}`,t.history.state)},createHref:e=>`${t.location.pathname}${t.location.search}#${e}`})}function qt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Jt(e,t){let n=qt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Yt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Z]:0,key:a,__TSR_key:a}}}function Yt(){return(Math.random()+1).toString(36).substring(7)}function Xt(e){let t=e.resolvedLocation,n=e.location;return{fromLocation:t,toLocation:n,pathChanged:t?.pathname!==n.pathname,hrefChanged:t?.href!==n.href,hashChanged:t?.hash!==n.hash}}function Zt(e){let t=e.filter(e=>e.status!==`redirected`);return t.length===e.length?e:t}var Qt=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=ve(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Gt()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=w(1e3),e=this.buildRouteTree(),this.setRoutes(e)}!this.__store&&this.latestLocation&&(this.__store=yt(tn(this.latestLocation)),Te(this));let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=I(o);t&&t!==`/`&&e.push(Le({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Ie(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&this.__store.setState(e=>({...e,location:this.latestLocation})),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=se(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&ne(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let o=this.options.parseSearch(n),s=this.options.stringifySearch(o);return{href:e+s+r,publicHref:i,pathname:g(e).path,external:!1,searchStr:s,search:f(t?.search,o),hash:g(r.slice(1)).path,state:p(t?.state,a)}}let o=new URL(i,this.origin),s=Re(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:g(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:f(t?.search,c),hash:g(s.hash.slice(1)).path,state:p(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>_e({base:e,to:P(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>rn({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{let e=this.state.matches.filter(e=>e.status===`pending`),t=this.state.matches.filter(e=>e.isFetching===`loader`);new Set([...this.state.pendingMatches??[],...e,...t]).forEach(e=>{this.cancelMatch(e.id)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,c=Object.assign(Object.create(null),r.params),l=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?c:Object.assign(c,m(t.params,c)),d=this.getMatchedRoutes(l),h=d.matchedRoutes;if((!d.foundRoute||d.foundRoute.path!==`/`&&d.routeParams[`**`])&&this.options.notFoundRoute&&(h=[...h,this.options.notFoundRoute]),Object.keys(u).length>0)for(let e of h){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let _=e.leaveParams?l:g(ye({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,v=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};h.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,nn(t.options.validateSearch,{...e,...v}))}catch{}}),v=e}v=an({search:v,dest:t,destRoutes:h,_includeValidateSearch:e._includeValidateSearch}),v=f(o,v);let y=this.options.stringifySearch(v),b=t.hash===!0?n.hash:t.hash?m(t.hash,n.hash):void 0,x=b?`#${b}`:``,S=t.state===!0?n.state:t.state?m(t.state,n.state):{};S=p(n.state,S);let C=`${_}${y}${x}`,w,T,E=!1;if(this.rewrite){let e=new URL(C,this.origin),t=ze(this.rewrite,e);w=e.href.replace(e.origin,``),t.origin===this.origin?T=t.pathname+t.search+t.hash:(T=t.href,E=!0)}else w=s(C),T=w;return{publicHref:T,href:w,pathname:_,search:v,searchStr:y,state:S,hash:b??``,external:E,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=re(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,m(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=S(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=F(this.latestLocation.href)===F(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=l(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Jt(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Re(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(h(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation);this.__store.setState(t=>({...t,status:`pending`,statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:t.cachedMatches.filter(t=>!e.some(e=>e.id===t.id))}))},this.load=async e=>{let t,n,r,i=this.state.resolvedLocation??this.state.location;for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.state.resolvedLocation;this.state.redirect||this.emit({type:`onBeforeNavigate`,...Xt({resolvedLocation:n,location:t})}),this.emit({type:`onBeforeLoad`,...Xt({resolvedLocation:n,location:t})}),await It({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.state.pendingMatches,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=[],t=[],n=[],r=[];xt(()=>{this.__store.setState(i=>{let a=i.matches,o=i.pendingMatches||i.matches;return e=a.filter(e=>!o.some(t=>t.id===e.id)),t=a.filter(e=>!o.some(t=>t.routeId===e.routeId)),n=o.filter(e=>!a.some(t=>t.routeId===e.routeId)),r=o.filter(e=>a.some(t=>t.routeId===e.routeId)),{...i,isLoading:!1,loadedAt:Date.now(),matches:o,pendingMatches:void 0,cachedMatches:[...i.cachedMatches,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]}}),this.clearExpiredCache()}),[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]].forEach(([e,t])=>{e.forEach(e=>{this.looseRoutesById[e.routeId].options[t]?.(e)})})})})}})}catch(e){W(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):R(e)&&(n=e),this.__store.setState(e=>({...e,statusCode:t?t.status:n?404:e.matches.some(e=>e.status===`error`)?500:200,redirect:t}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.__store.setState(e=>({...e,statusCode:a}))},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.state.resolvedLocation,a=typeof t.types==`function`?t.types(Xt({resolvedLocation:i,location:r})):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.state.pendingMatches?.some(t=>t.id===e)?`pendingMatches`:this.state.matches.some(t=>t.id===e)?`matches`:this.state.cachedMatches.some(t=>t.id===e)?`cachedMatches`:``;n&&(n===`cachedMatches`?this.__store.setState(n=>({...n,cachedMatches:Zt(n.cachedMatches.map(n=>n.id===e?t(n):n))})):this.__store.setState(r=>({...r,[n]:r[n]?.map(n=>n.id===e?t(n):n)})))})},this.getMatch=e=>{let t=t=>t.id===e;return this.state.cachedMatches.find(t)??this.state.pendingMatches?.find(t)??this.state.matches.find(t)},this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.__store.setState(e=>({...e,matches:e.matches.map(t),cachedMatches:e.cachedMatches.map(t),pendingMatches:e.pendingMatches?.map(t)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&h(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.__store.setState(e=>({...e,cachedMatches:[]})):this.__store.setState(e=>({...e,cachedMatches:e.cachedMatches.filter(e=>!t(e))}))},this.clearExpiredCache=()=>{this.clearCache({filter:e=>{let t=this.looseRoutesById[e.routeId];if(!t.options.loader)return!0;let n=(e.preload?t.options.preloadGcTime??this.options.defaultPreloadGcTime:t.options.gcTime??this.options.defaultGcTime)??300*1e3;return e.status===`error`?!0:Date.now()-e.updatedAt>=n}})},this.loadRouteChunk=Rt,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(e=>e.id)),i=new Set([...r,...this.state.cachedMatches.map(e=>e.id)]);xt(()=>{n.forEach(e=>{i.has(e.id)||this.__store.setState(t=>({...t,cachedMatches:[...t.cachedMatches,e]}))})});try{return n=await It({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(W(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});R(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.state.status!==`pending`)return!1;let i=(t?.pending===void 0?!this.state.isLoading:t.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=ie(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!S(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?S(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status===`notFound`||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??je,parseSearch:e.parseSearch??Ae,protocolAllowlist:e.protocolAllowlist??u}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:F(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?sn(this.options.notFoundMode,o):void 0,u=Array(o.length),d=new Map(this.state.matches.map(e=>[e.routeId,e]));for(let n=0;n<o.length;n++){let r=o[n],s=u[n-1],m,h,g;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=nn(r.options.validateSearch,{...n})??void 0;m={...n,...e},h={...i,...e},g=void 0}catch(e){let r=e;if(e instanceof $t||(r=new $t(e.message,{cause:e})),t?.throwOnError)throw r;m=n,h={},g=r}}let _=r.options.loaderDeps?.({search:m})??``,v=_?JSON.stringify(_):``,{interpolatedPath:y,usedParams:b}=ye({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),x=r.id+y+v,S=this.getMatch(x),C=d.get(r.id),w=S?._strictParams??b,T;if(!S)try{cn(r,b,a,w)}catch(e){if(T=R(e)||W(e)?e:new en(e.message,{cause:e}),t?.throwOnError)throw T}Object.assign(i,w);let E=C?`stay`:`enter`,D;if(S)D={...S,cause:E,params:C?.params??i,_strictParams:w,search:f(C?C.search:S.search,m),_strictSearch:h};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||zt(r)?`pending`:`success`;D={id:x,ssr:r.options.ssr,index:n,routeId:r.id,params:C?.params??i,_strictParams:w,pathname:y,updatedAt:Date.now(),search:C?f(C.search,m):m,_strictSearch:h,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:T,__routeContext:void 0,_nonReactive:{loadPromise:l()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:E,loaderDeps:C?p(C.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(D.globalNotFound=c===r.id),D.searchError=g;let O=this.getParentContext(s);D.context={...O,...D.__routeContext,...D.__beforeLoadContext},u[n]=D}for(let t=0;t<u.length;t++){let n=u[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=d.get(n.routeId);if(n.params=o?f(o.params,i):i,!a){let i=u[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:u,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return u}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=d(t),a={...e.search};for(let e of t)try{Object.assign(a,nn(e.options.validateSearch,a))}catch{}let o=d(this.state.matches),s=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let i of t)try{cn(i,n,r??{},e)}catch{}c=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:c}}},$t=class extends Error{},en=class extends Error{};function tn(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function nn(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new $t(`Async validation not supported`);if(n.issues)throw new $t(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function rn({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=F(e),a,o,s=ae(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function an({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return on(n)(e,t,r??!1)}function on(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...nn(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:m(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function sn(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Pe}function cn(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var ln=`Error preloading route! ☝️`,Q=e(t(),1),$=i();function un(e){let t=e.errorComponent??fn;return(0,$.jsx)(dn,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?Q.createElement(t,{error:n,reset:r}):e.children})}var dn=class extends Q.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey===this.props.getResetKey()?this.state.error:null,reset:()=>{this.reset()}})}};function fn({error:e}){let[t,n]=Q.useState(!1);return(0,$.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,$.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,$.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,$.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,$.jsx)(`div`,{children:(0,$.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,$.jsx)(`code`,{children:e.message}):null})}):null]})}function pn({children:e,fallback:t=null}){return mn()?(0,$.jsx)(Q.Fragment,{children:e}):(0,$.jsx)(Q.Fragment,{children:t})}function mn(){return Q.useSyncExternalStore(hn,()=>!0,()=>!1)}function hn(){return()=>{}}var gn=e(r(),1);function _n(e,t){let n=v(),r=a(t),{activeProps:i,inactiveProps:s,activeOptions:c,to:l,preload:u,preloadDelay:d,hashScrollIntoView:f,replace:p,startTransition:g,resetScroll:_,viewTransition:y,children:b,target:x,disabled:w,style:T,className:E,onClick:D,onBlur:O,onFocus:k,onMouseEnter:ee,onMouseLeave:A,onTouchStart:j,ignoreBlocker:te,params:ne,search:re,hash:ie,state:ae,mask:oe,reloadDocument:se,unsafeRelative:ce,from:le,_fromLocation:ue,...de}=e,fe=mn(),pe=C({select:e=>{let t=e.matches[e.matches.length-1];return{search:t?.search,hash:e.location.hash,path:t?.pathname}},structuralSharing:!0}),M=e.from,N=Q.useMemo(()=>({...e,from:M}),[n,pe,M,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),P=Q.useMemo(()=>n.buildLocation({...N}),[n,N]),me=P.maskedLocation?P.maskedLocation.publicHref:P.publicHref,F=P.maskedLocation?P.maskedLocation.external:P.external,I=Q.useMemo(()=>En(me,F,n.history,w),[w,F,me,n.history]),_e=Q.useMemo(()=>{if(I?.external)return h(I.href,n.protocolAllowlist)?void 0:I.href;if(!Dn(l)&&!(typeof l!=`string`||l.indexOf(`:`)===-1))try{return new URL(l),h(l,n.protocolAllowlist)?void 0:l}catch{}},[l,I,n.protocolAllowlist]),ve=C({select:e=>{if(_e)return!1;if(c?.exact){if(!ge(e.location.pathname,P.pathname,n.basepath))return!1}else{let t=he(e.location.pathname,n.basepath),r=he(P.pathname,n.basepath);if(!(t.startsWith(r)&&(t.length===r.length||t[r.length]===`/`)))return!1}return(c?.includeSearch??!0)&&!S(e.location.search,P.search,{partial:!c?.exact,ignoreUndefined:!c?.explicitUndefined})?!1:c?.includeHash?fe&&e.location.hash===P.hash:!0}}),L=ve?m(i,{})??yn:vn,ye=ve?vn:m(s,{})??vn,be=[E,L.className,ye.className].filter(Boolean).join(` `),R=(T||L.style||ye.style)&&{...T,...L.style,...ye.style},[xe,z]=Q.useState(!1),Se=Q.useRef(!1),B=e.reloadDocument||_e?!1:u??n.options.defaultPreload,V=d??n.options.defaultPreloadDelay??0,H=Q.useCallback(()=>{n.preloadRoute({...N,_builtLocation:P}).catch(e=>{console.warn(e),console.warn(ln)})},[n,N,P]);o(r,Q.useCallback(e=>{e?.isIntersecting&&H()},[H]),wn,{disabled:!!w||B!==`viewport`}),Q.useEffect(()=>{Se.current||!w&&B===`render`&&(H(),Se.current=!0)},[w,H,B]);let Ce=e=>{let t=e.currentTarget.getAttribute(`target`),r=x===void 0?t:x;if(!w&&!kn(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,gn.flushSync)(()=>{z(!0)});let t=n.subscribe(`onResolved`,()=>{t(),z(!1)});n.navigate({...N,replace:p,resetScroll:_,hashScrollIntoView:f,startTransition:g,viewTransition:y,ignoreBlocker:te})}};if(_e)return{...de,ref:r,href:_e,...b&&{children:b},...x&&{target:x},...w&&{disabled:w},...T&&{style:T},...E&&{className:E},...D&&{onClick:D},...O&&{onBlur:O},...k&&{onFocus:k},...ee&&{onMouseEnter:ee},...A&&{onMouseLeave:A},...j&&{onTouchStart:j}};let U=e=>{if(w||B!==`intent`)return;if(!V){H();return}let t=e.currentTarget;if(Cn.has(t))return;let n=setTimeout(()=>{Cn.delete(t),H()},V);Cn.set(t,n)},we=e=>{w||B!==`intent`||H()},Te=e=>{if(w||!B||!V)return;let t=e.currentTarget,n=Cn.get(t);n&&(clearTimeout(n),Cn.delete(t))};return{...de,...L,...ye,href:I?.href,ref:r,onClick:Tn([D,Ce]),onBlur:Tn([O,Te]),onFocus:Tn([k,U]),onMouseEnter:Tn([ee,U]),onMouseLeave:Tn([A,Te]),onTouchStart:Tn([j,we]),disabled:!!w,target:x,...R&&{style:R},...be&&{className:be},...w&&bn,...ve&&xn,...fe&&xe&&Sn}}var vn={},yn={className:`active`},bn={role:`link`,"aria-disabled":!0},xn={"data-status":`active`,"aria-current":`page`},Sn={"data-transitioning":`transitioning`},Cn=new WeakMap,wn={rootMargin:`100px`},Tn=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function En(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Dn(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var On=Q.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=_n(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return Q.createElement(`a`,t,o)}return Q.createElement(n,a,o)});function kn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function An(e){let t=C({select:e=>`not-found-${e.location.pathname}-${e.status}`});return(0,$.jsx)(un,{getResetKey:()=>t,onCatch:(t,n)=>{if(R(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(R(t))return e.fallback?.(t);throw t},children:e.children})}function jn(){return(0,$.jsx)(`p`,{children:`Not Found`})}function Mn({children:e}){return v(),null}function Nn(e){return(0,$.jsx)($.Fragment,{children:e.children})}function Pn(e,t,n){return t.options.notFoundComponent?(0,$.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,$.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,$.jsx)(jn,{})}function Fn(){let e=v();if(!e.isScrollRestoring||!0)return null;let t=(e.options.getScrollRestorationKey||H)(e.latestLocation),n=t===H(e.latestLocation)?void 0:t,r={storageKey:z,shouldScrollRestoration:!0};return n&&(r.key=n),(0,$.jsx)(Mn,{children:`(${we.toString()})(${x(JSON.stringify(r))})`})}var In=Q.memo(function({matchId:e}){let t=v(),n=C({select:t=>{let n=t.matches.findIndex(t=>t.id===e),r=t.matches[n];return y(r,`Could not find match for matchId "${e}". Please file an issue!`),{routeId:r.routeId,ssr:r.ssr,_displayPending:r._displayPending,resetKey:t.loadedAt,parentRouteId:t.matches[n-1]?.routeId}},structuralSharing:!0}),r=t.routesById[n.routeId],i=r.options.pendingComponent??t.options.defaultPendingComponent,a=i?(0,$.jsx)(i,{}):null,o=r.options.errorComponent??t.options.defaultErrorComponent,s=r.options.onCatch??t.options.defaultOnCatch,l=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,u=n.ssr===!1||n.ssr===`data-only`,d=(!r.isRoot||r.options.wrapInSuspense||u)&&(r.options.wrapInSuspense??i??(r.options.errorComponent?.preload||u))?Q.Suspense:Nn,f=o?un:Nn,p=l?An:Nn;return(0,$.jsxs)(r.isRoot?r.options.shellComponent??Nn:Nn,{children:[(0,$.jsx)(b.Provider,{value:e,children:(0,$.jsx)(d,{fallback:a,children:(0,$.jsx)(f,{getResetKey:()=>n.resetKey,errorComponent:o||fn,onCatch:(t,n)=>{if(R(t))throw t;c(!1,`Error in route match: ${e}`),s?.(t,n)},children:(0,$.jsx)(p,{fallback:e=>{if(!l||e.routeId&&e.routeId!==n.routeId||!e.routeId&&!r.isRoot)throw e;return Q.createElement(l,e)},children:u||n._displayPending?(0,$.jsx)(pn,{fallback:a,children:(0,$.jsx)(Rn,{matchId:e})}):(0,$.jsx)(Rn,{matchId:e})})})})}),n.parentRouteId===`__root__`&&t.options.scrollRestoration?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ln,{}),(0,$.jsx)(Fn,{})]}):null]})});function Ln(){let e=v(),t=Q.useRef(void 0);return(0,$.jsx)(`script`,{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:`onRendered`,...Xt(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Rn=Q.memo(function({matchId:e}){let t=v(),{match:n,key:r,routeId:i}=C({select:n=>{let r=n.matches.find(t=>t.id===e),i=r.routeId,a=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:r.loaderDeps,params:r._strictParams,search:r._strictSearch});return{key:a?JSON.stringify(a):void 0,routeId:i,match:{id:r.id,status:r.status,error:r.error,_forcePending:r._forcePending,_displayPending:r._displayPending}}},structuralSharing:!0}),a=t.routesById[i],o=Q.useMemo(()=>{let e=a.options.component??t.options.defaultComponent;return e?(0,$.jsx)(e,{},r):(0,$.jsx)(zn,{})},[r,a.options.component,t.options.defaultComponent]);if(n._displayPending)throw t.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw t.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status===`pending`){let e=a.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let r=t.getMatch(n.id);if(r&&!r._nonReactive.minPendingPromise){let t=l();r._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),r._nonReactive.minPendingPromise=void 0},e)}}throw t.getMatch(n.id)?._nonReactive.loadPromise}if(n.status===`notFound`)return y(R(n.error),`Expected a notFound error`),Pn(t,a,n.error);if(n.status===`redirected`)throw y(W(n.error),`Expected a redirect error`),t.getMatch(n.id)?._nonReactive.loadPromise;if(n.status===`error`)throw n.error;return o}),zn=Q.memo(function(){let e=v(),t=Q.useContext(b),n=C({select:e=>e.matches.find(e=>e.id===t)?.routeId}),r=e.routesById[n],i=C({select:e=>{let n=e.matches.find(e=>e.id===t);return y(n,`Could not find parent match for matchId "${t}"`),n.globalNotFound}}),a=C({select:e=>{let n=e.matches;return n[n.findIndex(e=>e.id===t)+1]?.id}}),o=e.options.defaultPendingComponent?(0,$.jsx)(e.options.defaultPendingComponent,{}):null;if(i)return Pn(e,r,void 0);if(!a)return null;let s=(0,$.jsx)(In,{matchId:a});return n===`__root__`?(0,$.jsx)(Q.Suspense,{fallback:o,children:s}):s});function Bn(e){return C({select:t=>e?.select?e.select(t.location):t.location})}var Vn=new Set,Hn=n((e,t)=>({selectedThreadKeys:Vn,anchorThreadKey:null,toggleThread:t=>{e(e=>{let n=new Set(e.selectedThreadKeys);return n.has(t)?n.delete(t):n.add(t),{selectedThreadKeys:n,anchorThreadKey:n.has(t)?t:e.anchorThreadKey}})},rangeSelectTo:(t,n)=>{e(e=>{let r=e.anchorThreadKey;if(r===null){let n=new Set(e.selectedThreadKeys);return n.add(t),{selectedThreadKeys:n,anchorThreadKey:t}}let i=n.indexOf(r),a=n.indexOf(t);if(i===-1||a===-1){let n=new Set(e.selectedThreadKeys);return n.add(t),{selectedThreadKeys:n,anchorThreadKey:t}}let o=Math.min(i,a),s=Math.max(i,a),c=new Set(e.selectedThreadKeys);for(let e=o;e<=s;e++){let t=n[e];t!==void 0&&c.add(t)}return{selectedThreadKeys:c,anchorThreadKey:r}})},clearSelection:()=>{let n=t();n.selectedThreadKeys.size===0&&n.anchorThreadKey===null||e({selectedThreadKeys:Vn,anchorThreadKey:null})},setAnchor:n=>{t().anchorThreadKey!==n&&e({anchorThreadKey:n})},removeFromSelection:t=>{e(e=>{let n=new Set(t),r=!1,i=new Set;for(let t of e.selectedThreadKeys)n.has(t)?r=!0:i.add(t);return r?{selectedThreadKeys:i,anchorThreadKey:e.anchorThreadKey!==null&&n.has(e.anchorThreadKey)?null:e.anchorThreadKey}:e})},hasSelection:()=>t().selectedThreadKeys.size>0}));export{me as _,Nn as a,fn as c,Gt as d,Kt as f,N as g,Ee as h,zn as i,Qt as l,Pe as m,Bn as n,On as o,Fe as p,In as r,un as s,Hn as t,Xt as u,F as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t,t as n}from"./react-PSPkXoKo.js";import{t as r}from"./compiler-runtime-BNrXlsa1.js";import{ro as i}from"./react-CjD7iThp.js";import{Ai as a,Br as o,Dn as s,En as c,Gn as l,Gt as u,Jr as d,Kn as f,Ln as p,Lr as m,N as h,Ni as g,Nn as _,Nr as v,On as y,Pr as b,Pt as x,Rr as S,Sn as C,Sr as w,Tn as T,Un as E,Ur as D,Vr as O,Vt as k,Wr as A,Wt as j,Xn as ee,Xr as M,ct as N,hr as P,it as te,ji as F,l as I,ln as L,nn as R,qn as z,st as ne,tn as B,wn as re,xn as ie,xr as V,yr as ae}from"./composerDraftStore-D12lUSfh.js";import{t as oe}from"./triangle-alert-DJef_Uvh.js";import{t as se}from"./x-fI9snvD3.js";function ce(e){return e[e.length-1]}function H(e){return typeof e==`function`}function le(e,t){return H(e)?e(t):e}var ue=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable,fe=()=>Object.create(null),pe=(e,t)=>U(e,t,fe);function U(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=he(e)&&he(i);if(!a&&!(W(e)&&W(i)))return i;let o=a?e:me(e);if(!o)return i;let s=a?i:me(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:ue.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=U(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function me(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!de.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!de.call(e,t))return!1;r.push(t)}return r}function W(e){if(!G(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!G(n)||!n.hasOwnProperty(`isPrototypeOf`))}function G(e){return Object.prototype.toString.call(e)===`[object Object]`}function he(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function K(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!K(e[r],t[r],n))return!1;return!0}if(W(e)&&W(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!K(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!K(e[o],t[o],n)))return!1;return i===a}return!1}function ge(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function _e(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function ve(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function ye(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return ve(t)}var be=[`http:`,`https:`,`mailto:`,`tel:`];function xe(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var Se={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Ce=/[&><\u2028\u2029]/g;function we(e){return e.replace(Ce,e=>Se[e])}function Te(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=ye(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=ye(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function Ee(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var q=e(n(),1),De=!0,Oe=`Invariant failed`;function ke(e,t){if(!e){if(De)throw Error(Oe);var n=typeof t==`function`?t():t,r=n?`${Oe}: ${n}`:Oe;throw Error(r)}}var Ae=q.createContext(null),je=!0;function Me(e,t){if(!je){if(e)return;var n=`Warning: `+t;typeof console<`u`&&console.warn(n);try{throw Error(n)}catch{}}}function Ne(e){let t=q.useContext(Ae);return Me(!((e?.warn??!0)&&!t),`useRouter must be used inside a <RouterProvider> component!`),t}var Pe=F();function Fe(e,t){return e===t}function Ie(e,t,n=Fe){let r=(0,q.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,q.useCallback)(()=>e?.get(),[e]);return(0,Pe.useSyncExternalStoreWithSelector)(r,i,i,t,n)}function Le(e){let t=Ne({warn:e?.router===void 0}),n=e?.router||t,r=(0,q.useRef)(void 0);return Ie(n.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=U(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var Re=q.createContext(void 0),ze=q.createContext(void 0);function Be(e){let t=q.useContext(e.from?ze:Re);return Le({select:n=>{let r=n.matches.find(n=>e.from?e.from===n.routeId:n.id===t);if(ke(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:`a nearest match!`}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function Ve(e){return Be({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}var He=M(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Ue=M(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),We=M(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Ge=M(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ke=M(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),qe=M(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Je=M(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),J=r(),Y=g(),Ye=e(a());function Xe(e){return{environmentId:e.environmentId,threadId:e.threadId}}function Ze(e){return{draftId:e}}function Qe(e){return!e.environmentId||!e.threadId?null:i(e.environmentId,e.threadId)}function $e(e){return e.environmentId&&e.threadId?{kind:`server`,threadRef:i(e.environmentId,e.threadId)}:e.draftId?{kind:`draft`,draftId:e.draftId}:null}var et=q.createContext(void 0);function tt(){let e=q.useContext(et);if(!e)throw Error(A(73));return e}var nt=0;function rt(e){return nt+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${nt}`}function it(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}var at=u(e=>e.toasts,e=>{let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}),X={toasts:j(e=>e.toasts),isEmpty:j(e=>e.toasts.length===0),toast:j(at,(e,t)=>e.get(t)?.value),toastIndex:j(at,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:j(at,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:j(at,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:j(e=>e.hovering),focused:j(e=>e.focused),expanded:j(e=>e.hovering||e.focused),expandedOrOutOfFocus:j(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:j(e=>e.prevFocusElement)},ot=class extends k{timers=new Map;areTimersPaused=!1;constructor(e){super(e,{},X)}setFocused(e){this.set(`focused`,e)}setHovering(e){this.set(`hovering`,e)}setIsWindowFocused(e){this.set(`isWindowFocused`,e)}setPrevFocusElement(e){this.set(`prevFocusElement`,e)}setViewport=e=>{this.set(`viewport`,e)};disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e){let t=X.toastIndex(this.state,e);if(t===-1)return;this.state.toasts[t]?.onRemove?.();let n=[...this.state.toasts];n.splice(t,1),this.setToasts(n)}addToast=e=>{let{toasts:t,timeout:n,limit:r}=this.state,i=e.id||rt(`toast`),a={...e,id:i,transitionStatus:`starting`},o=[a,...t],s=o.filter(e=>e.transitionStatus!==`ending`);if(s.length>r){let e=s.length-r,t=s.slice(-e),n=new Set(t.map(e=>e.id));this.setToasts(o.map(e=>{let t=n.has(e.id);return e.limited===t?e:{...e,limited:t}}))}else this.setToasts(o.map(e=>e.limited?{...e,limited:!1}:e));let c=a.timeout??n;return a.type!==`loading`&&c>0&&this.scheduleTimer(i,c,()=>this.closeToast(i)),X.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),i};updateToast=(e,t)=>{this.updateToastInternal(e,t)};updateToastInternal=(e,t)=>{let{timeout:n,toasts:r}=this.state,i=X.toast(this.state,e)??null;if(!i||i.transitionStatus===`ending`)return;let a={...i,...t};this.setToasts(r.map(n=>n.id===e?{...n,...t}:n));let o=a.timeout??n,s=i?.timeout??n,c=Object.hasOwn(t,`timeout`),l=a.transitionStatus!==`ending`&&a.type!==`loading`&&o>0,u=this.timers.has(e),d=s!==o,f=i?.type===`loading`;if(!l&&u){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e);return}if(l&&(!u||d||c||f)){let t=this.timers.get(e);t&&(t.timeout?.clear(),this.timers.delete(e)),this.scheduleTimer(e,o,()=>this.closeToast(e)),X.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear();else{let t=X.toast(this.state,e);if(!t)return;i=[t];let n=this.timers.get(e);n?.timeout&&(n.timeout.clear(),this.timers.delete(e))}let a=0,o={toasts:r.map(r=>{if(t||r.id===e)return{...r,transitionStatus:`ending`,height:0};if(r.transitionStatus===`ending`)return r;let i=a>=n;return a+=1,r.limited===i?r:{...r,limited:i}})};(t||r.length===1)&&(o.hovering=!1,o.focused=!1),this.update(o),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=it(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=it(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=it(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{if(e.timeout){e.timeout.clear();let t=Date.now()-e.start,n=e.delay-t;e.remaining=n>0?n:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=c.create(),e.timeout.start(e.remaining,()=>{this.timers.delete(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=re(e);C(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=!X.expandedOrOutOfFocus(this.state),a=i?c.create():void 0;a?.start(t,()=>{this.timers.delete(e),n()}),this.timers.set(e,{timeout:a,start:i?r:0,delay:t,remaining:t,callback:n})}setToasts(e){let t={toasts:e};e.length===0&&(t.hovering=!1,t.focused=!1),this.update(t)}handleFocusManagement(e){let t=ie(L(this.state.viewport));if(!this.state.viewport||!C(this.state.viewport,t)||!T(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=X.toasts(this.state),r=X.toastIndex(this.state,e),i=null,a=r+1;for(;a<n.length;){if(n[a].transitionStatus!==`ending`){i=n[a];break}a+=1}if(!i)for(a=r-1;a>=0;){if(n[a].transitionStatus!==`ending`){i=n[a];break}--a}i?i.ref?.current?.focus():this.restoreFocusToPrevElement()}},st=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=D(()=>new ot({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return _(a.disposeEffect),q.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t):e===`close`?a.closeToast(n):a.addToast(t)})},[a,n,i]),a.useSyncedValues({timeout:n,limit:r}),(0,Y.jsx)(et.Provider,{value:a,children:t})},ct=function(e){return e.frontmostHeight=`--toast-frontmost-height`,e}({}),lt=q.forwardRef(function(e,t){let{render:n,className:r,children:i,...a}=e,o=tt(),c=s(),l=q.useRef(!1),u=q.useRef(!1),d=o.useState(`isEmpty`),p=o.useState(`toasts`),m=o.useState(`focused`),h=o.useState(`expanded`),g=o.useState(`prevFocusElement`),_=p[0]?.height??0,y=q.useMemo(()=>p.some(e=>e.transitionStatus===`ending`),[p]);q.useEffect(()=>{let e=o.state.viewport;if(!e)return;function t(t){d||t.key===`F6`&&t.target!==e&&(t.preventDefault(),o.setPrevFocusElement(ie(L(e))),e?.focus({preventScroll:!0}),o.pauseTimers(),o.setFocused(!0))}let n=f(e);return n.addEventListener(`keydown`,t),()=>{n.removeEventListener(`keydown`,t)}},[o,d]),q.useEffect(()=>{let e=o.state.viewport;if(!e||d)return;let t=f(e);function n(e){e.target===t&&(o.setIsWindowFocused(!1),o.pauseTimers())}function r(n){if(n.relatedTarget||n.target===t)return;let r=re(n),i=ie(L(e));(!C(e,r)||!T(i))&&o.resumeTimers(),c.start(0,()=>o.setIsWindowFocused(!0))}return t.addEventListener(`blur`,n,!0),t.addEventListener(`focus`,r,!0),()=>{t.removeEventListener(`blur`,n,!0),t.removeEventListener(`focus`,r,!0)}},[o,c,d]),q.useEffect(()=>{let e=o.state.viewport;if(!e||d)return;let t=L(e);return t.addEventListener(`pointerdown`,o.handleDocumentPointerDown,!0),()=>{t.removeEventListener(`pointerdown`,o.handleDocumentPointerDown,!0)}},[d,o]);function b(e){let t=o.state.viewport;t&&(l.current=!0,e.relatedTarget===t?p[0]?.ref?.current?.focus():o.restoreFocusToPrevElement())}function x(e){e.key===`Tab`&&e.shiftKey&&e.target===o.state.viewport&&(e.preventDefault(),o.restoreFocusToPrevElement(),o.resumeTimers())}q.useEffect(()=>{!o.state.isWindowFocused||y||!u.current||(o.resumeTimers(),o.setHovering(!1),u.current=!1)},[y,o]);function S(){o.pauseTimers(),o.setHovering(!0),u.current=!1}function w(){y?u.current=!0:(o.resumeTimers(),o.setHovering(!1))}function E(){if(l.current){l.current=!1;return}m||T(L(o.state.viewport).activeElement)&&(o.setFocused(!0),o.pauseTimers())}function D(e){!m||C(o.state.viewport,e.relatedTarget)||(o.setFocused(!1),o.resumeTimers())}let O={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:S,onMouseMove:S,onMouseLeave:w,onFocus:E,onBlur:D,onKeyDown:x,onClick:E},k={expanded:h},A=v(`div`,e,{ref:[t,o.setViewport],state:k,props:[O,{style:{[ct.frontmostHeight]:_?`${_}px`:void 0}},a,{children:(0,Y.jsxs)(q.Fragment,{children:[!d&&g&&(0,Y.jsx)(B,{onFocus:b}),i,!d&&g&&(0,Y.jsx)(B,{onFocus:b})]})}]}),j=q.useMemo(()=>p.filter(e=>e.priority===`high`),[p]);return(0,Y.jsxs)(q.Fragment,{children:[!d&&g&&(0,Y.jsx)(B,{onFocus:b}),A,!m&&j.length>0&&(0,Y.jsx)(`div`,{style:R,children:j.map(e=>(0,Y.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,Y.jsx)(`div`,{children:e.title}),(0,Y.jsx)(`div`,{children:e.description})]},e.id))})]})}),ut=q.createContext(void 0);function Z(){let e=q.useContext(ut);if(!e)throw Error(A(66));return e}var Q=function(e){return e.index=`--toast-index`,e.offsetY=`--toast-offset-y`,e.height=`--toast-height`,e.swipeMovementX=`--toast-swipe-movement-x`,e.swipeMovementY=`--toast-swipe-movement-y`,e}({}),dt={...ae,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},ft=40,pt=10,$=.5,mt=1,ht=`${b},${m}`;function gt(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function _t(e){let t=window.getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}var vt=q.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],...o}=e,s=n.positionerProps?.anchor!==void 0,c=[];s||(c=Array.isArray(a)?a:[a]);let u=c.length>0,d=tt(),[f,p]=q.useState(void 0),[m,h]=q.useState(!1),[g,_]=q.useState(!1),[b,x]=q.useState(!1),[S,w]=q.useState({x:0,y:0}),[T,E]=q.useState({x:0,y:0,scale:1}),[D,O]=q.useState(),[k,A]=q.useState(),[j,M]=q.useState(null),N=q.useRef(null),P=q.useRef({x:0,y:0}),te=q.useRef({x:0,y:0,scale:1}),F=q.useRef(void 0),I=q.useRef(0),R=q.useRef(!1),z=q.useRef({x:0,y:0}),B=q.useRef(!1),V=d.useState(`toastIndex`,n.id),ae=d.useState(`toastVisibleIndex`,n.id),oe=d.useState(`toastOffsetY`,n.id),se=d.useState(`focused`),ce=d.useState(`expanded`);y({open:n.transitionStatus!==`ending`,ref:N,onComplete(){n.transitionStatus===`ending`&&d.removeToast(n.id)}});let H=ee((e=!1)=>{let t=N.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){d.updateToastInternal(n.id,{ref:N,height:i,...n.transitionStatus===`starting`?{transitionStatus:void 0}:{}})}e?Ye.flushSync(a):a()});l(H,[H]);function le(e,t){let n=e,r=t;return!c.includes(`left`)&&!c.includes(`right`)?n=e>0?e**$:-(Math.abs(e)**$):(!c.includes(`right`)&&e>0&&(n=e**$),!c.includes(`left`)&&e<0&&(n=-(Math.abs(e)**$))),!c.includes(`up`)&&!c.includes(`down`)?r=t>0?t**$:-(Math.abs(t)**$):(!c.includes(`down`)&&t>0&&(r=t**$),!c.includes(`up`)&&t<0&&(r=-(Math.abs(t)**$))),{x:n,y:r}}function ue(e){if(e.button!==0)return;e.pointerType===`touch`&&d.pauseTimers();let t=re(e.nativeEvent);if(!(t&&t.closest(`button,a,input,textarea,[role="button"],${ht}`))){if(R.current=!1,F.current=void 0,I.current=0,P.current={x:e.clientX,y:e.clientY},z.current=P.current,N.current){let e=_t(N.current);te.current=e,E(e),w({x:e.x,y:e.y})}d.setHovering(!0),h(!0),_(!1),M(null),B.current=!0,N.current?.setPointerCapture(e.pointerId)}}function de(e){if(!m)return;e.preventDefault(),B.current&&=(P.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>z.current.y||i>0&&t<z.current.y)&&(z.current={x:z.current.x,y:t}),(r<0&&n>z.current.x||r>0&&n<z.current.x)&&(z.current={x:n,y:z.current.y});let a=n-P.current.x,o=t-P.current.y,s=t-z.current.y,l=n-z.current.x;if(!g&&Math.sqrt(a*a+o*o)>=mt&&(_(!0),j===null)){let e=c.includes(`left`)||c.includes(`right`),t=c.includes(`up`)||c.includes(`down`);e&&t&&M(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let u;if(!F.current)j===`vertical`?o>0?u=`down`:o<0&&(u=`up`):j===`horizontal`?a>0?u=`right`:a<0&&(u=`left`):u=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,u&&c.includes(u)&&(F.current=u,I.current=gt(u,a,o),p(u));else{let e=F.current,t=gt(e,l,s);t>ft?(R.current=!1,p(e)):!(c.includes(`left`)&&c.includes(`right`))&&!(c.includes(`up`)&&c.includes(`down`))&&I.current-t>=pt&&(R.current=!0)}let d=le(a,o),f=te.current.x,h=te.current.y;j===`horizontal`?(c.includes(`left`)||c.includes(`right`))&&(f+=d.x):(j===`vertical`||(c.includes(`left`)||c.includes(`right`))&&(f+=d.x),(c.includes(`up`)||c.includes(`down`))&&(h+=d.y)),w({x:f,y:h})}function fe(e){if(!m)return;if(h(!1),_(!1),M(null),N.current?.releasePointerCapture(e.pointerId),R.current){w({x:T.x,y:T.y}),p(void 0);return}let t=!1,r=S.x-T.x,i=S.y-T.y,a;for(let e of c){switch(e){case`right`:r>ft&&(t=!0,a=`right`);break;case`left`:r<-40&&(t=!0,a=`left`);break;case`down`:i>ft&&(t=!0,a=`down`);break;case`up`:i<-40&&(t=!0,a=`up`);break;default:break}if(t)break}t?(p(a),x(!0),d.closeToast(n.id)):(w({x:T.x,y:T.y}),p(void 0))}function pe(e){if(e.key===`Escape`){if(!N.current||!C(N.current,ie(L(N.current))))return;d.closeToast(n.id)}}q.useEffect(()=>{if(!u)return;let e=N.current;if(!e)return;function t(t){C(e,t.target)&&t.preventDefault()}return e.addEventListener(`touchmove`,t,{passive:!1}),()=>{e.removeEventListener(`touchmove`,t)}},[u]);function U(){if(!m&&S.x===T.x&&S.y===T.y&&!b)return{[Q.swipeMovementX]:`0px`,[Q.swipeMovementY]:`0px`};let e=S.x-T.x,t=S.y-T.y;return{transition:m?`none`:void 0,transform:m?`translateX(${S.x}px) translateY(${S.y}px) scale(${T.scale})`:void 0,[Q.swipeMovementX]:`${e}px`,[Q.swipeMovementY]:`${t}px`}}let me=n.priority===`high`,W={role:me?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":D,"aria-describedby":k,"aria-hidden":me&&!se?!0:void 0,onPointerDown:u?ue:void 0,onPointerMove:u?de:void 0,onPointerUp:u?fe:void 0,onKeyDown:pe,inert:ne(n.limited),style:{...U(),[Q.index]:n.transitionStatus===`ending`?V:ae,[Q.offsetY]:`${oe}px`,[Q.height]:n.height?`${n.height}px`:void 0}},G=q.useMemo(()=>({rootRef:N,toast:n,titleId:D,setTitleId:O,descriptionId:k,setDescriptionId:A,swiping:m,swipeDirection:f,recalculateHeight:H,index:V,visibleIndex:ae,expanded:ce}),[n,D,k,m,f,H,V,ae,ce]),he={transitionStatus:n.transitionStatus,expanded:ce,limited:n.limited||!1,type:n.type,swiping:G.swiping,swipeDirection:G.swipeDirection},K=v(`div`,e,{ref:[t,G.rootRef],state:he,stateAttributesMapping:dt,props:[W,o]});return(0,Y.jsx)(ut.Provider,{value:G,children:K})}),yt=q.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{visibleIndex:a,expanded:o,recalculateHeight:s}=Z(),c=q.useRef(null);return l(()=>{let e=c.current;if(!e||(s(),typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`))return;let t=new ResizeObserver(()=>s(!0)),n=new MutationObserver(()=>s(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[s]),v(`div`,e,{ref:[t,c],state:{expanded:o,behind:a>0},props:i})}),bt=q.forwardRef(function(e,t){let{render:n,className:r,id:i,children:a,...o}=e,{toast:s,setDescriptionId:c}=Z(),u=a??s.description,d=!!u,f=p(i);l(()=>{if(d)return c(f),()=>{c(void 0)}},[d,f,c]);let m=v(`p`,e,{ref:t,state:{type:s.type},props:{...o,id:f,children:u}});return d?m:null}),xt=q.forwardRef(function(e,t){let{render:n,className:r,id:i,children:a,...o}=e,{toast:s,setTitleId:c}=Z(),u=a??s.title,d=!!u,f=p(i);l(()=>{if(d)return c(f),()=>{c(void 0)}},[d,f,c]);let m=v(`h2`,e,{ref:t,state:{type:s.type},props:{...o,id:f,children:u}});return d?m:null}),St=q.forwardRef(function(e,t){let{render:n,className:r,disabled:i,nativeButton:a=!0,...o}=e,s=tt(),{toast:c}=Z(),l=s.useState(`expanded`),[u,d]=q.useState(!1),{getButtonProps:f,buttonRef:p}=E({disabled:i,native:a}),m={type:c.type};return v(`button`,e,{ref:[t,p],state:m,props:[{"aria-hidden":!l&&!u,onClick(){s.closeToast(c.id)},onFocus(){d(!0)},onBlur(){d(!1)}},o,f]})}),Ct=q.forwardRef(function(e,t){let{render:n,className:r,disabled:i,nativeButton:a=!0,...o}=e,{toast:s}=Z(),c=s.actionProps?.children??o.children,l=!!c,{getButtonProps:u,buttonRef:d}=E({disabled:i,native:a}),f={type:s.type},p=v(`button`,e,{ref:[t,d],state:f,props:[o,s.actionProps,u,{children:c}]});return l?p:null}),wt=h,Tt=q.createContext(void 0);function Et(){let e=q.useContext(Tt);if(e===void 0)throw Error(A(84));return e}var Dt=q.forwardRef(function(e,t){let{toast:n,...r}=e,i=tt(),a=n.positionerProps??o,{render:s,className:c,anchor:l=a.anchor,positionMethod:u=a.positionMethod??`absolute`,side:d=a.side??`top`,align:f=a.align??`center`,sideOffset:p=a.sideOffset??0,alignOffset:m=a.alignOffset??0,collisionBoundary:h=a.collisionBoundary??`clipping-ancestors`,collisionPadding:g=a.collisionPadding??5,arrowPadding:_=a.arrowPadding??5,sticky:y=a.sticky??!1,disableAnchorTracking:b=a.disableAnchorTracking??!1,collisionAvoidance:C=a.collisionAvoidance??S,...w}=r,[T,E]=q.useState(null),D=i.useState(`toastIndex`,n.id),k=i.useState(`toastVisibleIndex`,n.id),A=z(l)?l:null,j=te({anchor:A,positionMethod:u,floatingRootContext:x({open:!0,onOpenChange:O,elements:{floating:T,reference:A}}),mounted:!0,side:d,sideOffset:p,align:f,alignOffset:m,collisionBoundary:h,collisionPadding:g,sticky:y,arrowPadding:_,disableAnchorTracking:b,keepMounted:!0,collisionAvoidance:C}),ee=q.useMemo(()=>{let e={};return{role:`presentation`,style:{...j.positionerStyles,...e,[Q.index]:n.transitionStatus===`ending`?D:k}}},[j.positionerStyles,n.transitionStatus,D,k]),M=q.useMemo(()=>({side:j.side,align:j.align,anchorHidden:j.anchorHidden}),[j.side,j.align,j.anchorHidden]),F=q.useMemo(()=>({...M,arrowRef:j.arrowRef,arrowStyles:j.arrowStyles,arrowUncentered:j.arrowUncentered}),[M,j.arrowRef,j.arrowStyles,j.arrowUncentered]),I=v(`div`,e,{state:M,props:[ee,N(n.transitionStatus),w],ref:[t,E],stateAttributesMapping:P});return(0,Y.jsx)(Tt.Provider,{value:F,children:I})}),Ot=q.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{arrowRef:a,side:o,align:s,arrowUncentered:c,arrowStyles:l}=Et();return v(`div`,e,{state:{side:o,align:s,uncentered:c},ref:[t,a],props:[{style:l,"aria-hidden":!0},i]})});function kt(){let e=q.useContext(et);if(!e)throw Error(A(73));let t=e.useState(`toasts`);return q.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function At(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||rt(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var jt=t({Action:()=>Ct,Arrow:()=>Ot,Close:()=>St,Content:()=>yt,Description:()=>bt,Portal:()=>wt,Positioner:()=>Dt,Provider:()=>st,Root:()=>vt,Title:()=>xt,Viewport:()=>lt,createToastManager:()=>At,useToastManager:()=>kt});function Mt({timeout:e=2e3,onCopy:t,onError:n}={}){let[r,i]=q.useState(!1),a=q.useRef(null),o=q.useRef(t),s=q.useRef(n),c=q.useRef(e);o.current=t,s.current=n,c.current=e;let l=q.useCallback((e,t)=>{if(typeof window>`u`||!navigator.clipboard?.writeText){s.current?.(Error(`Clipboard API unavailable.`),t);return}e&&navigator.clipboard.writeText(e).then(()=>{a.current&&clearTimeout(a.current),i(!0),o.current?.(t),c.current!==0&&(a.current=setTimeout(()=>{i(!1),a.current=null},c.current))},e=>{s.current?s.current(e,t):console.error(e)})},[]);return q.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),{copyToClipboard:l,isCopied:r}}function Nt(e,t){return t<=1?!1:e>0}function Pt(e){let t=0,n=0,r=0,i=0,a=e.map(e=>{let a=Ft(e.height);if(e.transitionStatus===`ending`){let r={toast:e,visibleIndex:t,offsetY:n};return n+=a,t+=1,r}let o={toast:e,visibleIndex:r,offsetY:i};return n+=a,t+=1,i+=a,r+=1,o});return{frontmostHeight:Ft(e.find(e=>e.transitionStatus!==`ending`)?.height),items:a}}function Ft(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function It(e,t){if(e?.threadRef)return t!==null&&e.threadRef.environmentId===t.environmentId&&e.threadRef.threadId===t.threadId;let n=e?.threadId;return n?t?.threadId===n:!0}function Lt(e){let{type:t,title:n,description:r,timeout:i,priority:a,actionProps:o,actionVariant:s,data:c}=e,l={...c===void 0?{}:c,actionLayout:`stacked-end`};s!==void 0&&(l.actionVariant=s);let u={type:t,title:n,data:l};return r!==void 0&&(u.description=r),i!==void 0&&(u.timeout=i),a!==void 0&&(u.priority=a),o!==void 0&&(u.actionProps=o),u}var Rt=At(),zt=At(),Bt=new Map,Vt={error:We,info:qe,loading:Je,success:Ge,warning:oe},Ht=180;function Ut(e,t){if(!(e!==`error`||typeof t!=`string`)&&!(t.length<Ht))return`line-clamp-4`}var Wt=`absolute z-20 -top-1.5 -right-1.5`,Gt=w(`app-surface inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border border-border/60 text-muted-foreground shadow-sm outline-none backdrop-blur-sm`,`transition-[color,background-color,box-shadow] hover:text-foreground`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`);function Kt(e,t,n){n?.(),e.close(t)}function qt(e){let t=(0,J.c)(8),{text:n}=e,{copyToClipboard:r,isCopied:i}=Mt(),a;t[0]!==r||t[1]!==n?(a=()=>r(n),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=i?(0,Y.jsx)(He,{className:`size-3 text-success`}):(0,Y.jsx)(Ke,{className:`size-3`}),t[3]=i,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s=(0,Y.jsx)(`button`,{className:`inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-md p-0 text-muted-foreground/80 transition-colors hover:text-muted-foreground`,onClick:a,title:`Copy error`,type:`button`,children:o}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var Jt=`mt-2 max-h-40 min-h-0 overflow-y-auto overscroll-contain pr-0.5 select-text`;function Yt(e){let t=(0,J.c)(13),{children:n,labels:r}=e,[i,a]=(0,q.useState)(!1),o=r.expand??`Show details`,s=r.collapse??`Hide details`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>a(Xt),t[0]=c):c=t[0];let l;t[1]===i?l=t[2]:(l=i?(0,Y.jsx)(Ue,{className:`size-3.5 shrink-0 opacity-80`,strokeWidth:2.25}):(0,Y.jsx)(d,{className:`size-3.5 shrink-0 opacity-80`,strokeWidth:2.25}),t[1]=i,t[2]=l);let u=i?s:o,f;t[3]!==i||t[4]!==l||t[5]!==u?(f=(0,Y.jsxs)(`button`,{"aria-expanded":i,className:`inline-flex cursor-pointer items-center gap-1 rounded-md py-0.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,onClick:c,type:`button`,children:[l,u]}),t[3]=i,t[4]=l,t[5]=u,t[6]=f):f=t[6];let p;t[7]!==n||t[8]!==i?(p=i?(0,Y.jsx)(`div`,{className:Jt,children:n}):null,t[7]=n,t[8]=i,t[9]=p):p=t[9];let m;return t[10]!==f||t[11]!==p?(m=(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[f,p]}),t[10]=f,t[11]=p,t[12]=m):m=t[12],m}function Xt(e){return!e}function Zt(e){let t=(0,J.c)(36),{toastData:n,toastDescription:r,toastType:i}=e,a=n?.expandableContent,o;t[0]===n?.expandableLabels?o=t[1]:(o=n?.expandableLabels??{},t[0]=n?.expandableLabels,t[1]=o);let s=o,c=n?.expandableDescriptionTrigger??!1,l;t[2]!==r||t[3]!==i?(l=w(`min-w-0 select-text wrap-break-word text-muted-foreground`,Ut(i,r)),t[2]=r,t[3]=i,t[4]=l):l=t[4];let u=l,[f,p]=(0,q.useState)(!1);if(!a){let e;return t[5]===u?e=t[6]:(e=(0,Y.jsx)(bt,{className:u,"data-slot":`toast-description`}),t[5]=u,t[6]=e),e}if(!c){let e;t[7]===u?e=t[8]:(e=(0,Y.jsx)(bt,{className:u,"data-slot":`toast-description`}),t[7]=u,t[8]=e);let n;t[9]!==a||t[10]!==s?(n=(0,Y.jsx)(Yt,{labels:s,children:a}),t[9]=a,t[10]=s,t[11]=n):n=t[11];let r;return t[12]!==e||t[13]!==n?(r=(0,Y.jsxs)(Y.Fragment,{children:[e,n]}),t[12]=e,t[13]=n,t[14]=r):r=t[14],r}let m=s.expand??`Show details`,h=s.collapse??`Hide details`,g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>p(Qt),t[15]=g):g=t[15];let _=g,v;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_())},t[16]=v):v=t[16];let y=v,b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=w(`group flex min-w-0 w-full cursor-pointer select-none items-start gap-1.5 rounded-sm text-left outline-none ring-offset-background`,`transition-colors hover:bg-muted/40`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`),t[17]=b):b=t[17];let x=f?h:m,S;t[18]!==r||t[19]!==i?(S=w(`min-w-0 select-none wrap-break-word text-muted-foreground`,Ut(i,r),`underline-offset-2 decoration-muted-foreground/60 group-hover:underline`),t[18]=r,t[19]=i,t[20]=S):S=t[20];let C;t[21]===S?C=t[22]:(C=(0,Y.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Y.jsx)(bt,{className:S,"data-slot":`toast-description`})}),t[21]=S,t[22]=C);let T;t[23]===f?T=t[24]:(T=f?(0,Y.jsx)(Ue,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground opacity-80`,strokeWidth:2.25}):(0,Y.jsx)(d,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground opacity-80`,strokeWidth:2.25}),t[23]=f,t[24]=T);let E;t[25]!==f||t[26]!==x||t[27]!==C||t[28]!==T?(E=(0,Y.jsxs)(`div`,{"aria-expanded":f,className:b,onClick:_,onKeyDown:y,role:`button`,tabIndex:0,title:x,children:[C,T]}),t[25]=f,t[26]=x,t[27]=C,t[28]=T,t[29]=E):E=t[29];let D;t[30]!==a||t[31]!==f?(D=f?(0,Y.jsx)(`div`,{className:Jt,children:a}):null,t[30]=a,t[31]=f,t[32]=D):D=t[32];let O;return t[33]!==E||t[34]!==D?(O=(0,Y.jsxs)(Y.Fragment,{children:[E,D]}),t[33]=E,t[34]=D,t[35]=O):O=t[35],O}function Qt(e){return!e}function $t(e){let t=e.type?Vt[e.type]:null,n=e.actionProps!==void 0&&e.data?.actionLayout===`stacked-end`,r=e.data?.actionVariant??`default`,i=e.data?.secondaryActionVariant??`outline`,a=e.type===`error`&&typeof e.description==`string`&&!e.data?.hideCopyButton?e.description:null,o=e.data?.secondaryActionProps!==void 0,s=a!==null||e.actionProps!==void 0||o;return{Icon:t,stackedActionLayout:n,actionVariant:r,secondaryActionVariant:i,copyErrorText:a,hasTrailingControls:s,inlineContentEndPad:s?`pr-6`:`pr-10`}}function en(e){let t=(0,J.c)(37),{stackedActionLayout:n,Icon:r,copyErrorText:i,actionProps:a,actionVariant:o,secondaryActionVariant:s,hasTrailingControls:c,toastData:l,toastDescription:u,toastType:d}=e,f=l?.secondaryActionProps,p=l?.leadingIcon,m;t[0]===f?m=t[1]:(m=f??{},t[0]=f,t[1]=m);let h,g;t[2]===m?(h=t[3],g=t[4]):({className:h,...g}=m,t[2]=m,t[3]=h,t[4]=g);let _=!n&&`flex-1`,v;t[5]===_?v=t[6]:(v=w(`flex min-w-0 gap-2`,_),t[5]=_,t[6]=v);let y;t[7]!==r||t[8]!==p?(y=p?(0,Y.jsx)(`div`,{className:`flex h-lh w-4 shrink-0 items-center justify-center`,"data-slot":`toast-icon`,children:p}):r?(0,Y.jsx)(`div`,{className:`[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,"data-slot":`toast-icon`,children:(0,Y.jsx)(r,{className:`in-data-[type=loading]:animate-spin in-data-[type=error]:text-destructive in-data-[type=info]:text-info in-data-[type=success]:text-success in-data-[type=warning]:text-warning in-data-[type=loading]:opacity-80`})}):null,t[7]=r,t[8]=p,t[9]=y):y=t[9];let b=n&&`pr-5`,x;t[10]===b?x=t[11]:(x=w(`flex min-h-0 min-w-0 flex-1 flex-col gap-0.5`,b),t[10]=b,t[11]=x);let S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Y.jsx)(xt,{className:`min-w-0 wrap-break-word font-medium`,"data-slot":`toast-title`}),t[12]=S):S=t[12];let C;t[13]!==l||t[14]!==u||t[15]!==d?(C=(0,Y.jsx)(Zt,{toastData:l,toastDescription:u,toastType:d}),t[13]=l,t[14]=u,t[15]=d,t[16]=C):C=t[16];let T;t[17]!==x||t[18]!==C?(T=(0,Y.jsxs)(`div`,{className:x,children:[S,C]}),t[17]=x,t[18]=C,t[19]=T):T=t[19];let E;t[20]!==v||t[21]!==y||t[22]!==T?(E=(0,Y.jsxs)(`div`,{className:v,children:[y,T]}),t[20]=v,t[21]=y,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==a||t[25]!==o||t[26]!==i||t[27]!==c||t[28]!==h||t[29]!==f||t[30]!==g||t[31]!==s||t[32]!==n?(D=c?(0,Y.jsxs)(`div`,{className:w(`flex items-center gap-1.5`,n?`w-full justify-end`:`shrink-0`),children:[i===null?null:(0,Y.jsx)(qt,{text:i}),f?(0,Y.jsx)(`button`,{...g,className:w(V({size:`xs`,variant:s}),h),type:`button`}):null,a?(0,Y.jsx)(Ct,{className:w(V({size:`xs`,variant:o}),`shrink-0`),"data-slot":`toast-action`,children:a.children}):null]}):null,t[24]=a,t[25]=o,t[26]=i,t[27]=c,t[28]=h,t[29]=f,t[30]=g,t[31]=s,t[32]=n,t[33]=D):D=t[33];let O;return t[34]!==E||t[35]!==D?(O=(0,Y.jsxs)(Y.Fragment,{children:[E,D]}),t[34]=E,t[35]=D,t[36]=O):O=t[36],O}function tn(){let e=(0,J.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={strict:!1,select:nn},e[0]=t):t=e[0];let n=Ve(t),r;e[1]===n?r=e[2]:(r=e=>n?.kind===`draft`?e.getDraftSession(n.draftId):null,e[1]=n,e[2]=r);let i=I(r),a;bb0:{if(n?.kind===`server`){a=n.threadRef;break bb0}if(n?.kind===`draft`&&i){let t;e[3]!==i.environmentId||e[4]!==i.threadId?(t={environmentId:i.environmentId,threadId:i.threadId},e[3]=i.environmentId,e[4]=i.threadId,e[5]=t):t=e[5],a=t;break bb0}a=null}return a}function nn(e){return $e(e)}function rn(e){let t=(0,J.c)(4),{toastId:n,dismissAfterVisibleMs:r}=e,i,a;return t[0]!==r||t[1]!==n?(i=()=>{if(!r||r<=0||typeof window>`u`||typeof document>`u`)return;let e=Bt.get(n)??r,t=null,i=null,a=!1,o=()=>{i!==null&&(window.clearTimeout(i),i=null)},s=()=>{a||(a=!0,Bt.delete(n),Rt.close(n))},c=()=>{t!==null&&(e=Math.max(0,e-(Date.now()-t)),t=null,o(),Bt.set(n,e))},l=()=>{if(!(a||t!==null)){if(e<=0){s();return}t=Date.now(),o(),i=window.setTimeout(()=>{e=0,t=null,s()},e)}},u=()=>{if(document.visibilityState===`visible`&&document.hasFocus()){l();return}c()};return u(),document.addEventListener(`visibilitychange`,u),window.addEventListener(`focus`,u),window.addEventListener(`blur`,u),()=>{document.removeEventListener(`visibilitychange`,u),window.removeEventListener(`focus`,u),window.removeEventListener(`blur`,u),c(),o()}},a=[r,n],t[0]=r,t[1]=n,t[2]=i,t[3]=a):(i=t[2],a=t[3]),(0,q.useEffect)(i,a),null}function an(e){let t=(0,J.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,position:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`top-right`:i,o;t[4]===a?o=t[5]:(o=(0,Y.jsx)(on,{position:a}),t[4]=a,t[5]=o);let s;return t[6]!==n||t[7]!==r||t[8]!==o?(s=(0,Y.jsxs)(st,{toastManager:Rt,...r,children:[n,o]}),t[6]=n,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function on(e){let t=(0,J.c)(19),{position:n}=e,r=n===void 0?`top-right`:n,{toasts:i}=kt(),a=tn(),o;t[0]===r?o=t[1]:(o=r.startsWith(`top`),t[0]=r,t[1]=o);let s=o,c;t[2]===a?c=t[3]:(c=e=>It(e.data,a),t[2]=a,t[3]=c);let l=Pt(i.filter(c)),u,d;t[4]===i?(u=t[5],d=t[6]):(u=()=>{let e=new Set(i.map(sn));for(let t of Bt.keys())e.has(t)||Bt.delete(t)},d=[i],t[4]=i,t[5]=u,t[6]=d),(0,q.useEffect)(u,d);let f=jt,p=jt,m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=w(`fixed z-100 mx-auto flex w-[calc(100%-var(--toast-inset)*2)] max-w-90 [--toast-header-offset:52px] [--toast-inset:--spacing(4)] sm:[--toast-inset:--spacing(8)]`,`data-[position*=top]:top-[calc(var(--toast-inset)+var(--toast-header-offset))]`,`data-[position*=bottom]:bottom-(--toast-inset)`,`data-[position*=left]:left-(--toast-inset)`,`data-[position*=right]:right-(--toast-inset)`,`data-[position*=center]:-translate-x-1/2 data-[position*=center]:left-1/2`),t[7]=m):m=t[7];let h=`${l.frontmostHeight}px`,g;t[8]===h?g=t[9]:(g={"--toast-frontmost-height":h},t[8]=h,t[9]=g);let _=g,v=l.items.map(e=>{let{toast:t,visibleIndex:n,offsetY:i}=e,a=Nt(n,l.items.length),o=$t(t),{stackedActionLayout:c,inlineContentEndPad:u}=o;return(0,Y.jsxs)(vt,{className:w(`app-surface absolute z-[calc(9999-var(--toast-index))] w-full overflow-visible select-none rounded-lg border not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 [transition:transform_.5s_cubic-bezier(.22,1,.36,1),opacity_.5s,height_.15s] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,`data-[position*=right]:right-0 data-[position*=right]:left-auto`,`data-[position*=left]:right-auto data-[position*=left]:left-0`,`data-[position*=center]:right-0 data-[position*=center]:left-0`,`data-[position*=top]:top-0 data-[position*=top]:bottom-auto data-[position*=top]:origin-top`,`data-[position*=bottom]:top-auto data-[position*=bottom]:bottom-0 data-[position*=bottom]:origin-bottom`,`after:absolute after:left-0 after:h-[calc(var(--toast-gap)+1px)] after:w-full`,`data-[position*=top]:after:top-full`,`data-[position*=bottom]:after:bottom-full`,n>0?`not-data-expanded:[--toast-calc-height:var(--toast-frontmost-height)] data-expanded:[--toast-calc-height:max(var(--toast-frontmost-height,var(--toast-height)),var(--toast-height))]`:`[--toast-calc-height:max(var(--toast-frontmost-height,var(--toast-height)),var(--toast-height))]`,`[--toast-gap:--spacing(3)] [--toast-peek:--spacing(3)] [--toast-scale:calc(max(0,1-(var(--toast-index)*.1)))] [--toast-shrink:calc(1-var(--toast-scale))]`,n>0?`not-data-expanded:h-(--toast-calc-height) data-expanded:h-auto`:`h-auto`,`data-[position*=top]:[--toast-calc-offset-y:calc(var(--toast-offset-y)+var(--toast-index)*var(--toast-gap)+var(--toast-swipe-movement-y))]`,`data-[position*=bottom]:[--toast-calc-offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--toast-gap)*-1+var(--toast-swipe-movement-y))]`,`data-[position*=top]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--toast-peek))+(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]`,`data-[position*=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--toast-peek))-(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]`,`data-limited:opacity-0`,`data-position:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--toast-calc-offset-y))]`,`data-[position*=top]:data-starting-style:transform-[translateY(calc(-100%-var(--toast-inset)))]`,`data-[position*=bottom]:data-starting-style:transform-[translateY(calc(100%+var(--toast-inset)))]`,`data-[position*=top]:data-[position*=right]:data-starting-style:transform-[translateX(calc(100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:opacity-0`,`data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(100%+var(--toast-inset)))]`,`data-[position*=top]:data-[position*=right]:data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateX(calc(100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]`,`data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]`,`data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]`,`data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]`),"data-position":r,style:{"--toast-index":n,"--toast-offset-y":`${i}px`},swipeDirection:r.includes(`center`)?[s?`up`:`down`]:r.includes(`left`)?[`left`,s?`up`:`down`]:[`right`,s?`up`:`down`],toast:t,children:[(0,Y.jsx)(rn,{dismissAfterVisibleMs:t.data?.dismissAfterVisibleMs,toastId:t.id}),(0,Y.jsx)(`div`,{className:Wt,children:(0,Y.jsx)(`button`,{"aria-label":`Dismiss notification`,className:Gt,"data-slot":`toast-close`,onClick:()=>Kt(Rt,t.id,t.data?.onClose),type:`button`,children:(0,Y.jsx)(se,{className:`size-3`,strokeWidth:2.25})})}),(0,Y.jsx)(yt,{className:w(`pointer-events-auto min-h-0 overflow-y-visible pl-3.5 text-sm transition-opacity duration-250 [overflow-x:clip] data-expanded:opacity-100`,c?`flex flex-col gap-2 py-2.5 pr-3.5`:w(`py-3`,`flex items-center justify-between gap-1.5`,u),a&&`not-data-expanded:pointer-events-none not-data-expanded:opacity-0`),children:(0,Y.jsx)(en,{...o,actionProps:t.actionProps,toastData:t.data,toastDescription:t.description,toastType:t.type})})]},t.id)}),y;t[10]!==r||t[11]!==_||t[12]!==v||t[13]!==p.Viewport||t[14]!==m?(y=(0,Y.jsx)(p.Viewport,{className:m,"data-position":r,"data-slot":`toast-viewport`,style:_,children:v}),t[10]=r,t[11]=_,t[12]=v,t[13]=p.Viewport,t[14]=m,t[15]=y):y=t[15];let b;return t[16]!==y||t[17]!==f.Portal?(b=(0,Y.jsx)(f.Portal,{"data-slot":`toast-portal`,children:y}),t[16]=y,t[17]=f.Portal,t[18]=b):b=t[18],b}function sn(e){return e.id}function cn(e){let t=(0,J.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(ln,{}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,Y.jsxs)(st,{toastManager:zt,...r,children:[n,i]}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function ln(){let e=(0,J.c)(7),{toasts:t}=kt(),n=tn(),r;if(e[0]!==n||e[1]!==t){let i;e[3]===n?i=e[4]:(i=e=>It(e.data,n),e[3]=n,e[4]=i),r=t.filter(i).map(un),e[0]=n,e[1]=t,e[2]=r}else r=e[2];let i;return e[5]===r?i=e[6]:(i=(0,Y.jsx)(wt,{"data-slot":`toast-portal-anchored`,children:(0,Y.jsx)(lt,{className:`outline-none`,"data-slot":`toast-viewport-anchored`,children:r})}),e[5]=r,e[6]=i),i}function un(e){let t=e.data?.tooltipStyle??!1,n=e.positionerProps,r=$t(e),{stackedActionLayout:i,inlineContentEndPad:a}=r;return n?.anchor?(0,Y.jsx)(Dt,{className:`z-100 max-w-[min(--spacing(64),var(--available-width))]`,"data-slot":`toast-positioner`,sideOffset:n.sideOffset??4,toast:e,children:(0,Y.jsx)(vt,{className:w(`app-surface relative overflow-visible text-balance border not-dark:bg-clip-padding text-popover-foreground text-xs transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,t?`rounded-md shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]`:`rounded-lg shadow-lg/5 before:rounded-[calc(var(--radius-lg)-1px)]`),"data-slot":`toast-popup`,toast:e,children:t?(0,Y.jsx)(yt,{className:`pointer-events-auto px-2 py-1`,children:(0,Y.jsx)(xt,{"data-slot":`toast-title`})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:Wt,children:(0,Y.jsx)(`button`,{"aria-label":`Dismiss notification`,className:Gt,"data-slot":`toast-close`,onClick:()=>Kt(zt,e.id,e.data?.onClose),type:`button`,children:(0,Y.jsx)(se,{className:`size-3`,strokeWidth:2.25})})}),(0,Y.jsx)(yt,{className:w(`pointer-events-auto min-h-0 overflow-y-visible pl-3.5 text-sm [overflow-x:clip]`,i?`flex flex-col gap-2 py-2.5 pr-3.5`:w(`py-3`,`flex items-center justify-between gap-1.5`,a)),children:(0,Y.jsx)(en,{...r,actionProps:e.actionProps,toastData:e.data,toastDescription:e.description,toastType:e.type})})]})})},e.id):null}export{Ee as A,Me as C,ge as D,be as E,ce as F,pe as I,U as L,le as M,xe as N,Te as O,_e as P,Ne as S,ke as T,He as _,Lt as a,Re as b,Xe as c,Je as d,qe as f,Ue as g,We as h,Rt as i,we as j,K as k,Qe as l,Ge as m,an as n,Mt as o,Ke as p,zt as r,Ze as s,cn as t,$e as u,Ve as v,Ae as w,Le as x,Be as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-PSPkXoKo.js";import{t as n}from"./compiler-runtime-BNrXlsa1.js";import{In as r,Ni as i,Nr as a,Pn as o,Sr as s,Un as c,Wr as l,X as u,Xn as d,Yn as f,cr as p,jr as m}from"./composerDraftStore-D12lUSfh.js";var h=e(t()),g=h.createContext(void 0);function _(e=!0){let t=h.useContext(g);if(t===void 0&&!e)throw Error(l(7));return t}var v=i(),y=h.forwardRef(function(e,t){let{className:n,defaultPressed:i=!1,disabled:s=!1,form:l,onPressedChange:m,pressed:h,render:g,type:y,value:b,nativeButton:x=!0,...S}=e,C=r(b||void 0),w=_(),T=w?.value??[],E=w?void 0:i,D=(s||w?.disabled)??!1,[O,k]=f({controlled:w?C!==void 0&&T.indexOf(C)>-1:h,default:E,name:`Toggle`,state:`pressed`}),A=d((e,t)=>{C&&w?.setGroupValue?.(C,e,t),m?.(e,t)}),{getButtonProps:j,buttonRef:M}=c({disabled:D,native:x}),N={disabled:D,pressed:O},P=[M,t],F=[{"aria-pressed":O,onClick(e){let t=!O,n=o(p,e.nativeEvent);A(t,n),!n.isCanceled&&k(t)}},S,j],I=a(`button`,e,{enabled:!w,state:N,ref:P,props:F});return w?(0,v.jsx)(u,{tag:`button`,render:g,className:n,state:N,refs:P,props:F}):I}),b=n(),x=m(`[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer select-none items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base text-foreground outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent 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 data-pressed:bg-input/64 data-pressed:text-accent-foreground sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_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:{default:`h-9 min-w-9 px-[calc(--spacing(2)-1px)] sm:h-8 sm:min-w-8`,lg:`h-10 min-w-10 px-[calc(--spacing(2.5)-1px)] sm:h-9 sm:min-w-9`,sm:`h-8 min-w-8 px-[calc(--spacing(1.5)-1px)] sm:h-7 sm:min-w-7`,xs:`h-7 min-w-7 px-[calc(--spacing(1)-1px)] sm:h-6 sm:min-w-6 rounded-md`},variant:{default:`border-transparent`,outline:`border-input bg-background not-dark:bg-clip-padding shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:data-pressed:bg-input dark:hover:bg-input/64 dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] dark:not-disabled:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/2%)] [:disabled,:active,[data-pressed]]:shadow-none`}}});function S(e){let t=(0,b.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:a,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]!==n||t[6]!==i||t[7]!==a?(o=s(x({className:n,size:i,variant:a})),t[5]=n,t[6]=i,t[7]=a,t[8]=o):o=t[8];let c;return t[9]!==r||t[10]!==o?(c=(0,v.jsx)(y,{className:o,"data-slot":`toggle`,...r}),t[9]=r,t[10]=o,t[11]=c):c=t[11],c}export{g as n,S as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-PSPkXoKo.js";import{Ai as n,Br as r,Gn as i,In as a,Ur as o,Vr as s,Wr as c,Xn as l,qn as u}from"./composerDraftStore-D12lUSfh.js";var d=e(t()),f=e(n()),p=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}({}),m={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},h={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},g={disabled:!1,...h},_={valid(e){return e===null?null:e?{[p.valid]:``}:{[p.invalid]:``}}},v=d.createContext({invalid:void 0,name:void 0,validityData:{state:m,errors:[],error:``,value:``,initialValue:null},setValidityData:s,disabled:void 0,touched:h.touched,setTouched:s,dirty:h.dirty,setDirty:s,filled:h.filled,setFilled:s,focused:h.focused,setFocused:s,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:g,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=r)=>e,getInputValidationProps:(e=r)=>e,inputRef:{current:null},commit:async()=>{}}});function y(e=!0){let t=d.useContext(v);if(t.setValidityData===s&&!e)throw Error(c(28));return t}function b(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}var x=d.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:s,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function S(){return d.useContext(x)}function C(e){let{enabled:t=!0,value:n,id:r,name:a,controlRef:o,commit:s}=e,{formRef:c}=S(),{invalid:u,markedDirtyRef:d,validityData:p,setValidityData:m}=y(),h=l(e.getValue);i(()=>{if(!t)return;let e=n;e===void 0&&(e=h()),p.initialValue===null&&e!==null&&m(t=>({...t,initialValue:e}))},[t,m,n,p.initialValue,h]),i(()=>{!t||!r||c.current.fields.set(r,{getValue:h,name:a,controlRef:o,validityData:b(p,u),validate(e=!0){let t=n;t===void 0&&(t=h()),d.current=!0,e?f.flushSync(()=>s(t)):s(t)}})},[s,o,t,c,h,r,u,d,a,p,n]),i(()=>{let e=c.current.fields;return()=>{r&&e.delete(r)}},[c,r])}var w=d.createContext({controlId:void 0,registerControlId:s,labelId:void 0,setLabelId:s,messageIds:[],setMessageIds:s,getDescriptionProps:e=>e});function T(){return d.useContext(w)}function E(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:c,registerControlId:f}=T(),p=a(t),m=n?c:void 0,h=o(()=>Symbol(`labelable-control`)),g=d.useRef(!1),_=d.useRef(t!=null),v=l(()=>{!g.current||f===s||(g.current=!1,f(h.current,void 0))});return i(()=>{if(f===s)return;let e;if(n){let n=r?.current;e=u(n)&&n.closest(`label`)!=null?t??null:m??p}else if(t!=null)_.current=!0,e=t;else if(_.current)e=p;else{v();return}if(e===void 0){v();return}g.current=!0,f(h.current,e)},[t,r,m,f,n,p,h,v]),d.useEffect(()=>v,[v]),c??p}export{y as a,S as i,T as n,h as o,C as r,_ as s,E as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t,t as n}from"./react-PSPkXoKo.js";import{t as r}from"./compiler-runtime-BNrXlsa1.js";var i=e(n(),1),a=r(),o=`ryco:appearance-preferences`,s=`ryco-appearance-preferences`,c=`ryco:appearance-preferences-change`,l=[`fontFamilySans`,`fontFamilyMono`,`fontSizeBase`,`radius`,`primaryColorMode`,`primaryColor`,`surfaceTransparency`],u=[{value:`"DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,label:`DM Sans`,description:`Default`},{value:`"Geist", "Geist Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,label:`Geist`,description:`Modern`},{value:`"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,label:`Inter`,description:`Neutral`},{value:`"IBM Plex Sans", "Helvetica Neue", Arial, sans-serif`,label:`IBM Plex`,description:`Technical`},{value:`"Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif`,label:`Atkinson`,description:`Readable`},{value:`-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,label:`System UI`,description:`Native`}],d=[{value:`"SF Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace`,label:`SF Mono`,description:`Default`},{value:`"Geist Mono", "SF Mono", "SFMono-Regular", Consolas, monospace`,label:`Geist Mono`,description:`Modern`},{value:`"JetBrains Mono", "SF Mono", "SFMono-Regular", Consolas, monospace`,label:`JetBrains`,description:`Editor`},{value:`"Fira Code", "SF Mono", "SFMono-Regular", Consolas, monospace`,label:`Fira Code`,description:`Ligatures`},{value:`"IBM Plex Mono", "SF Mono", "SFMono-Regular", Consolas, monospace`,label:`IBM Plex`,description:`Technical`},{value:`"Source Code Pro", "SF Mono", "SFMono-Regular", Consolas, monospace`,label:`Source Code`,description:`Adobe`}],ee=[{value:`14px`,label:`Compact`,description:`14 px`},{value:`15px`,label:`Small`,description:`15 px`},{value:`16px`,label:`Default`,description:`16 px`},{value:`17px`,label:`Roomy`,description:`17 px`},{value:`18px`,label:`Large`,description:`18 px`},{value:`20px`,label:`Display`,description:`20 px`}],f=[{value:`0rem`,label:`Square`,description:`0 px`},{value:`0.375rem`,label:`Tight`,description:`6 px`},{value:`0.625rem`,label:`Default`,description:`10 px`},{value:`0.875rem`,label:`Soft`,description:`14 px`},{value:`1.125rem`,label:`Round`,description:`18 px`}],p=[{value:`default`,label:`Solid`,description:`0%`},{value:`light`,label:`Light`,description:`8%`},{value:`medium`,label:`Medium`,description:`16%`},{value:`high`,label:`High`,description:`22%`},{value:`glass`,label:`Glass`,description:`28%`}],te=[{value:`theme`,label:`Theme`,description:`Use palette`},{value:`custom`,label:`Custom`,description:`Override`}],m=[{value:`#4f46e5`,label:`Indigo`,description:`Default`},{value:`#0ea5e9`,label:`Sky`,description:`Clear`},{value:`#14b8a6`,label:`Teal`,description:`Calm`},{value:`#22c55e`,label:`Green`,description:`Active`},{value:`#f59e0b`,label:`Amber`,description:`Warm`},{value:`#f43f5e`,label:`Rose`,description:`Bright`},{value:`#a855f7`,label:`Violet`,description:`Sharp`}],ne={fontFamilySans:u[0].value,fontFamilyMono:d[0].value,fontSizeBase:`16px`,radius:`0.625rem`,primaryColorMode:`theme`,primaryColor:m[0].value,surfaceTransparency:`default`},re={sm:-4,md:-2,lg:0,xl:4,"2xl":8,"3xl":12,"4xl":16},ie={fontFamilySans:new Set(u.map(e=>e.value)),fontFamilyMono:new Set(d.map(e=>e.value)),fontSizeBase:new Set(ee.map(e=>e.value)),radius:new Set(f.map(e=>e.value)),primaryColorMode:new Set(te.map(e=>e.value)),primaryColor:new Set(m.map(e=>e.value)),surfaceTransparency:new Set(p.map(e=>e.value))},ae={default:0,light:.08,medium:.16,high:.22,glass:.28};function oe(){return typeof localStorage<`u`}function h(){if(!oe())return{};let e=localStorage.getItem(o);if(!e)return{};try{let t=JSON.parse(e);if(!t||typeof t!=`object`)return{};let n=t,r={};for(let e of l)if(ce(e,n[e])){let t=e===`primaryColor`?v(n[e]):n[e];typeof t==`string`&&(r[e]=t)}return r}catch{return{}}}function se(e){if(oe()){if(Object.keys(e).length===0){localStorage.removeItem(o);return}localStorage.setItem(o,JSON.stringify(e))}}function ce(e,t){return typeof t==`string`?e===`primaryColor`?v(t)!==null:ie[e].has(t):!1}function g(){return{...ne,...h()}}function le(e){return h()[e]!==void 0}function ue(e,t){if(!ce(e,t))return;let n=e===`primaryColor`?v(t):t;if(!n)return;let r=h();n===ne[e]?delete r[e]:r[e]=n,se(r)}function de(e){let t=h();delete t[e],se(t)}function _(){if(typeof document>`u`||typeof document.getElementById!=`function`)return;let e=g(),t=ve();t.textContent=`:root { --font-family-sans: ${e.fontFamilySans}; --font-family-mono: ${e.fontFamilyMono}; --font-size-base: ${e.fontSizeBase}; ${fe(e.radius)} ${he(e.surfaceTransparency)} }${ge(e)}`,ye()}function v(e){if(typeof e!=`string`)return null;let t=e.trim(),n=/^#?([0-9a-f]{3})$/i.exec(t);if(n?.[1])return`#${n[1].split(``).map(e=>`${e}${e}`).join(``).toLowerCase()}`;let r=/^#?([0-9a-f]{6})$/i.exec(t);return r?.[1]?`#${r[1].toLowerCase()}`:null}function fe(e){return`--radius: ${e}; ${Object.entries(re).map(([t,n])=>`--radius-${t}: ${pe(e,n)} !important;`).join(` `)}`}function pe(e,t){if(e===`0rem`)return`0px`;let n=Number.parseFloat(e);return Number.isFinite(n)?me(Math.max(0,n*16+t)/16):e}function me(e){return e===0?`0px`:`${Number(e.toFixed(4))}rem`}function he(e){let t=ae[e]??0,n=100-t*100;return[[`--app-surface-opacity`,y(n)],[`--app-muted-surface-opacity`,y(100-t*75)],[`--app-dialog-viewport-light-alpha`,y(Math.max(34,48-t*50))],[`--app-dialog-viewport-dark-alpha`,y(Math.max(16,28-t*36))],[`--app-sheet-backdrop-alpha`,y(Math.max(18,32-t*42))],[`--app-command-backdrop-opacity`,y(Math.max(38,60-t*60))],[`--app-glass-light-start-alpha`,y(t*75)],[`--app-glass-light-end-alpha`,y(t*32)],[`--app-glass-foreground-alpha`,y(t*18)],[`--app-glass-light-popover-alpha`,y(n)],[`--app-glass-dark-start-alpha`,y(t*18)],[`--app-glass-dark-end-alpha`,y(t*5)],[`--app-glass-dark-popover-alpha`,y(n)]].map(([e,t])=>`${e}: ${t};`).join(` `)}function ge(e){if(e.primaryColorMode!==`custom`)return``;let t=v(e.primaryColor);return t?` :root, :root.dark { --primary: ${t}; --ring: ${t}; --primary-foreground: ${_e(t)}; }`:``}function _e(e){let t=v(e);if(!t)return`#ffffff`;let n=[Number.parseInt(t.slice(1,3),16),Number.parseInt(t.slice(3,5),16),Number.parseInt(t.slice(5,7),16)].map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*n[0]+.7152*n[1]+.0722*n[2]>.46?`#0f172a`:`#ffffff`}function y(e){return`${Number(e.toFixed(2))}%`}function ve(){let e=document.getElementById(s);if(e instanceof HTMLStyleElement)return document.head.append(e),e;let t=document.createElement(`style`);return t.id=s,document.head.append(t),t}function ye(){typeof window>`u`||typeof window.dispatchEvent!=`function`||window.dispatchEvent(new Event(c))}var b=`default`,x={id:b,name:`Default`,description:`The built-in Ryco light & dark palette.`,builtIn:!0,light:{background:`var(--color-white)`,"app-chrome-background":`var(--background)`,foreground:`var(--color-neutral-800)`,card:`var(--color-white)`,"card-foreground":`var(--color-neutral-800)`,popover:`var(--color-white)`,"popover-foreground":`var(--color-neutral-800)`,primary:`oklch(0.488 0.217 264)`,"primary-foreground":`var(--color-white)`,secondary:`--alpha(var(--color-black) / 4%)`,"secondary-foreground":`var(--color-neutral-800)`,muted:`--alpha(var(--color-black) / 4%)`,"muted-foreground":`color-mix(in srgb, var(--color-neutral-500) 90%, var(--color-black))`,accent:`--alpha(var(--color-black) / 4%)`,"accent-foreground":`var(--color-neutral-800)`,destructive:`var(--color-red-500)`,"destructive-foreground":`var(--color-red-700)`,border:`--alpha(var(--color-black) / 8%)`,input:`--alpha(var(--color-black) / 10%)`,ring:`oklch(0.488 0.217 264)`,info:`var(--color-blue-500)`,"info-foreground":`var(--color-blue-700)`,success:`var(--color-emerald-500)`,"success-foreground":`var(--color-emerald-700)`,warning:`var(--color-amber-500)`,"warning-foreground":`var(--color-amber-700)`,"scrollbar-thumb":`rgba(0, 0, 0, 0.15)`,"scrollbar-thumb-hover":`rgba(0, 0, 0, 0.25)`,"scrollbar-thumb-thin":`rgba(0, 0, 0, 0.1)`,"scrollbar-thumb-thin-hover":`rgba(0, 0, 0, 0.2)`,"noise-opacity":`0.035`},dark:{background:`color-mix(in srgb, var(--color-neutral-950) 95%, var(--color-white))`,"app-chrome-background":`var(--background)`,foreground:`var(--color-neutral-100)`,card:`color-mix(in srgb, var(--background) 98%, var(--color-white))`,"card-foreground":`var(--color-neutral-100)`,popover:`color-mix(in srgb, var(--background) 98%, var(--color-white))`,"popover-foreground":`var(--color-neutral-100)`,primary:`oklch(0.588 0.217 264)`,"primary-foreground":`var(--color-white)`,secondary:`--alpha(var(--color-white) / 4%)`,"secondary-foreground":`var(--color-neutral-100)`,muted:`--alpha(var(--color-white) / 4%)`,"muted-foreground":`color-mix(in srgb, var(--color-neutral-500) 90%, var(--color-white))`,accent:`--alpha(var(--color-white) / 4%)`,"accent-foreground":`var(--color-neutral-100)`,destructive:`color-mix(in srgb, var(--color-red-500) 90%, var(--color-white))`,"destructive-foreground":`var(--color-red-400)`,border:`--alpha(var(--color-white) / 6%)`,input:`--alpha(var(--color-white) / 8%)`,ring:`oklch(0.588 0.217 264)`,info:`var(--color-blue-500)`,"info-foreground":`var(--color-blue-400)`,success:`var(--color-emerald-500)`,"success-foreground":`var(--color-emerald-400)`,warning:`var(--color-amber-500)`,"warning-foreground":`var(--color-amber-400)`,"scrollbar-thumb":`rgba(255, 255, 255, 0.1)`,"scrollbar-thumb-hover":`rgba(255, 255, 255, 0.18)`,"scrollbar-thumb-thin":`rgba(255, 255, 255, 0.08)`,"scrollbar-thumb-thin-hover":`rgba(255, 255, 255, 0.15)`}};function S(e){let t=e.scrollbarForeground??e.foreground;return{background:e.background,"app-chrome-background":e.chrome,foreground:e.foreground,card:e.card,"card-foreground":e.foreground,popover:e.popover??e.card,"popover-foreground":e.foreground,primary:e.primary,"primary-foreground":e.primaryForeground,secondary:e.secondary,"secondary-foreground":e.foreground,muted:e.muted,"muted-foreground":e.mutedForeground,accent:e.accent,"accent-foreground":e.accentForeground,destructive:e.destructive,"destructive-foreground":e.destructiveForeground,border:e.border,input:e.input,ring:e.ring??e.primary,info:e.info,"info-foreground":e.info,success:e.success,"success-foreground":e.success,warning:e.warning,"warning-foreground":e.warning,"scrollbar-thumb":C(t,.18),"scrollbar-thumb-hover":C(t,.32),"scrollbar-thumb-thin":C(t,.12),"scrollbar-thumb-thin-hover":C(t,.24)}}function C(e,t){let n=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!n||n[1]===void 0)return e;let r=n[1];return`rgba(${Number.parseInt(r.slice(0,2),16)}, ${Number.parseInt(r.slice(2,4),16)}, ${Number.parseInt(r.slice(4,6),16)}, ${t})`}var be={id:`nord`,name:`Nord`,description:`Cool arctic blues inspired by the Nord palette by Arctic Ice Studio.`,builtIn:!0,dark:{background:`#2e3440`,"app-chrome-background":`#2e3440`,foreground:`#d8dee9`,card:`#3b4252`,"card-foreground":`#e5e9f0`,popover:`#3b4252`,"popover-foreground":`#e5e9f0`,primary:`#88c0d0`,"primary-foreground":`#2e3440`,secondary:`#434c5e`,"secondary-foreground":`#e5e9f0`,muted:`#3b4252`,"muted-foreground":`#7b8794`,accent:`#434c5e`,"accent-foreground":`#eceff4`,destructive:`#bf616a`,"destructive-foreground":`#eceff4`,border:`rgba(216, 222, 233, 0.1)`,input:`rgba(216, 222, 233, 0.14)`,ring:`#88c0d0`,info:`#81a1c1`,"info-foreground":`#8fbcbb`,success:`#a3be8c`,"success-foreground":`#a3be8c`,warning:`#ebcb8b`,"warning-foreground":`#ebcb8b`,"scrollbar-thumb":`rgba(216, 222, 233, 0.16)`,"scrollbar-thumb-hover":`rgba(216, 222, 233, 0.28)`,"scrollbar-thumb-thin":`rgba(216, 222, 233, 0.12)`,"scrollbar-thumb-thin-hover":`rgba(216, 222, 233, 0.22)`}},xe={id:`high-contrast`,name:`High Contrast`,description:`Maximum-contrast monochrome with yellow accents for accessibility.`,builtIn:!0,light:{background:`#ffffff`,"app-chrome-background":`#ffffff`,foreground:`#000000`,card:`#ffffff`,"card-foreground":`#000000`,popover:`#ffffff`,"popover-foreground":`#000000`,primary:`#0000ee`,"primary-foreground":`#ffffff`,secondary:`#f5f5f5`,"secondary-foreground":`#000000`,muted:`#f0f0f0`,"muted-foreground":`#1a1a1a`,accent:`#ffeb3b`,"accent-foreground":`#000000`,destructive:`#cc0000`,"destructive-foreground":`#ffffff`,border:`#000000`,input:`#000000`,ring:`#0000ee`,info:`#0000ee`,"info-foreground":`#0000aa`,success:`#006400`,"success-foreground":`#003200`,warning:`#996600`,"warning-foreground":`#664400`,"scrollbar-thumb":`rgba(0, 0, 0, 0.55)`,"scrollbar-thumb-hover":`rgba(0, 0, 0, 0.8)`,"scrollbar-thumb-thin":`rgba(0, 0, 0, 0.45)`,"scrollbar-thumb-thin-hover":`rgba(0, 0, 0, 0.7)`,"noise-opacity":`0`},dark:{background:`#000000`,"app-chrome-background":`#000000`,foreground:`#ffffff`,card:`#000000`,"card-foreground":`#ffffff`,popover:`#000000`,"popover-foreground":`#ffffff`,primary:`#ffff00`,"primary-foreground":`#000000`,secondary:`#1a1a1a`,"secondary-foreground":`#ffffff`,muted:`#0d0d0d`,"muted-foreground":`#e6e6e6`,accent:`#ffff00`,"accent-foreground":`#000000`,destructive:`#ff5555`,"destructive-foreground":`#000000`,border:`#ffffff`,input:`#ffffff`,ring:`#ffff00`,info:`#5fd7ff`,"info-foreground":`#5fd7ff`,success:`#5fff5f`,"success-foreground":`#5fff5f`,warning:`#ffff5f`,"warning-foreground":`#ffff5f`,"scrollbar-thumb":`rgba(255, 255, 255, 0.55)`,"scrollbar-thumb-hover":`rgba(255, 255, 255, 0.85)`,"scrollbar-thumb-thin":`rgba(255, 255, 255, 0.4)`,"scrollbar-thumb-thin-hover":`rgba(255, 255, 255, 0.7)`,"noise-opacity":`0`}},w=[x,{id:`midnight-graphite`,name:`Midnight Graphite`,description:`A near-black graphite palette with neutral grey actions.`,builtIn:!0,dark:{...S({background:`#040404`,chrome:`#020202`,foreground:`#e7e7e7`,card:`#0a0a0a`,popover:`#0d0d0d`,primary:`#d4d4d4`,primaryForeground:`#030303`,secondary:`#111111`,muted:`#0d0d0d`,mutedForeground:`#777777`,accent:`#151515`,accentForeground:`#eeeeee`,destructive:`#ef4444`,destructiveForeground:`#f87171`,border:`rgba(255, 255, 255, 0.075)`,input:`rgba(255, 255, 255, 0.11)`,ring:`#b8b8b8`,info:`#b0b0b0`,success:`#22c55e`,warning:`#c4a760`,scrollbarForeground:`#d4d4d4`}),"noise-opacity":`0.012`}},be,xe,{id:`one-dark-pro`,name:`One Dark Pro`,description:`Atom's One Dark palette adapted from the popular VS Code theme.`,builtIn:!0,dark:S({background:`#282c34`,chrome:`#21252b`,foreground:`#abb2bf`,card:`#30333d`,primary:`#61afef`,primaryForeground:`#ffffff`,secondary:`#30333d`,muted:`#2c313c`,mutedForeground:`#636b78`,accent:`#3e4452`,accentForeground:`#abb2bf`,destructive:`#e06c75`,destructiveForeground:`#ffffff`,border:`#3e4452`,input:`#1d1f23`,info:`#56b6c2`,success:`#98c379`,warning:`#e5c07b`})},{id:`dracula`,name:`Dracula`,description:`A dark purple workbench inspired by the Dracula VS Code theme.`,builtIn:!0,dark:S({background:`#282A36`,chrome:`#21222C`,foreground:`#F8F8F2`,card:`#343746`,primary:`#BD93F9`,primaryForeground:`#282A36`,secondary:`#44475A`,muted:`#44475A`,mutedForeground:`#6272A4`,accent:`#FF79C6`,accentForeground:`#282A36`,destructive:`#FF5555`,destructiveForeground:`#282A36`,border:`#191A21`,input:`#191A21`,ring:`#6272A4`,info:`#8BE9FD`,success:`#50FA7B`,warning:`#FFB86C`})},{id:`github`,name:`GitHub`,description:`GitHub Light and Dark palettes adapted from the official VS Code theme.`,builtIn:!0,light:S({background:`#ffffff`,chrome:`#f6f8fa`,foreground:`#1f2328`,card:`#ffffff`,primary:`#0969da`,primaryForeground:`#ffffff`,secondary:`#f6f8fa`,muted:`#f6f8fa`,mutedForeground:`#656d76`,accent:`#dbeafe`,accentForeground:`#0969da`,destructive:`#cf222e`,destructiveForeground:`#ffffff`,border:`#d0d7de`,input:`#d0d7de`,info:`#0969da`,success:`#1f883d`,warning:`#9a6700`,scrollbarForeground:`#1f2328`}),dark:S({background:`#0d1117`,chrome:`#010409`,foreground:`#e6edf3`,card:`#161b22`,primary:`#2f81f7`,primaryForeground:`#ffffff`,secondary:`#21262d`,muted:`#21262d`,mutedForeground:`#7d8590`,accent:`#1f6feb`,accentForeground:`#ffffff`,destructive:`#f85149`,destructiveForeground:`#ffffff`,border:`#30363d`,input:`#30363d`,info:`#2f81f7`,success:`#3fb950`,warning:`#d29922`})},{id:`catppuccin`,name:`Catppuccin`,description:`Catppuccin Latte and Mocha palettes with a mauve accent.`,builtIn:!0,light:S({background:`#eff1f5`,chrome:`#e6e9ef`,foreground:`#4c4f69`,card:`#ffffff`,primary:`#8839ef`,primaryForeground:`#ffffff`,secondary:`#ccd0da`,muted:`#dce0e8`,mutedForeground:`#6c6f85`,accent:`#bcc0cc`,accentForeground:`#4c4f69`,destructive:`#d20f39`,destructiveForeground:`#ffffff`,border:`#bcc0cc`,input:`#bcc0cc`,info:`#1e66f5`,success:`#40a02b`,warning:`#df8e1d`}),dark:S({background:`#1e1e2e`,chrome:`#181825`,foreground:`#cdd6f4`,card:`#313244`,primary:`#cba6f7`,primaryForeground:`#1e1e2e`,secondary:`#313244`,muted:`#313244`,mutedForeground:`#a6adc8`,accent:`#45475a`,accentForeground:`#cdd6f4`,destructive:`#f38ba8`,destructiveForeground:`#1e1e2e`,border:`#45475a`,input:`#45475a`,info:`#89b4fa`,success:`#a6e3a1`,warning:`#f9e2af`})},{id:`tokyo-night`,name:`Tokyo Night`,description:`A deep blue workbench inspired by Enkia's Tokyo Night theme.`,builtIn:!0,dark:S({background:`#1a1b26`,chrome:`#16161e`,foreground:`#a9b1d6`,card:`#202330`,primary:`#7aa2f7`,primaryForeground:`#ffffff`,secondary:`#202330`,muted:`#1c1d29`,mutedForeground:`#787c99`,accent:`#3d59a1`,accentForeground:`#ffffff`,destructive:`#db4b4b`,destructiveForeground:`#ffffff`,border:`#101014`,input:`#14141b`,info:`#2ac3de`,success:`#9ece6a`,warning:`#e0af68`})}],T=`background.app-chrome-background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.secondary.secondary-foreground.muted.muted-foreground.accent.accent-foreground.destructive.destructive-foreground.border.input.ring.info.info-foreground.success.success-foreground.warning.warning-foreground.scrollbar-thumb.scrollbar-thumb-hover.scrollbar-thumb-thin.scrollbar-thumb-thin-hover.noise-opacity.radius.font-family-sans.font-family-mono.font-size-base`.split(`.`),E={background:{kind:`color`},"app-chrome-background":{kind:`color`},foreground:{kind:`color`},card:{kind:`color`},"card-foreground":{kind:`color`},popover:{kind:`color`},"popover-foreground":{kind:`color`},primary:{kind:`color`},"primary-foreground":{kind:`color`},secondary:{kind:`color`},"secondary-foreground":{kind:`color`},muted:{kind:`color`},"muted-foreground":{kind:`color`},accent:{kind:`color`},"accent-foreground":{kind:`color`},destructive:{kind:`color`},"destructive-foreground":{kind:`color`},border:{kind:`color`},input:{kind:`color`},ring:{kind:`color`},info:{kind:`color`},"info-foreground":{kind:`color`},success:{kind:`color`},"success-foreground":{kind:`color`},warning:{kind:`color`},"warning-foreground":{kind:`color`},"scrollbar-thumb":{kind:`color`},"scrollbar-thumb-hover":{kind:`color`},"scrollbar-thumb-thin":{kind:`color`},"scrollbar-thumb-thin-hover":{kind:`color`},"noise-opacity":{kind:`opacity`},radius:{kind:`length`},"font-family-sans":{kind:`font-family`},"font-family-mono":{kind:`font-family`},"font-size-base":{kind:`length`}};function D(e){return e in E?E[e].kind:null}var Se=new Set(T),O=`ryco:custom-themes`,Ce=`ryco:active-theme`,k=`ryco-active-theme`,A=`custom-`,j=/(?:javascript:|expression\s*\(|<script|url\s*\(\s*['"]?\s*javascript:)/i,we=new Set([`font-family-sans`,`font-family-mono`,`font-size-base`,`radius`]);function M(e){return w.some(t=>t.id===e)}function Te(e){if(typeof e!=`string`)return!1;let t=e.trim();return t.length===0||t.length>200?!1:!j.test(t)}var Ee=[`px`,`rem`,`em`];function N(e){if(typeof e!=`string`)return null;let t=/^(-?\d*\.?\d+)\s*([a-z%]+)$/i.exec(e.trim());if(!t||t[1]===void 0||t[2]===void 0)return null;let n=Number(t[1]);return Number.isFinite(n)?{number:n,unit:t[2].toLowerCase()}:null}function P(e,t){if(typeof t!=`string`)return!1;let n=t.trim();if(n.length===0||n.length>200||j.test(n))return!1;switch(e){case`color`:return!0;case`opacity`:{let e=Number(n);return Number.isFinite(e)&&e>=0&&e<=1}case`length`:return N(n)!==null;case`font-family`:return!0}}function F(e){let t=e.startsWith(A)?e:`${A}${e}`,n=new Set(B().map(e=>e.id));if(!n.has(t))return t;let r=2;for(;n.has(`${t}-${r}`);)r+=1;return`${t}-${r}`}function I(e){if(typeof e!=`string`||!e.includes(`--alpha(`))return e;let t=``,n=0;for(;n<e.length;){let r=e.indexOf(`--alpha(`,n);if(r===-1){t+=e.slice(n);break}t+=e.slice(n,r);let i=1,a=r+8;for(;a<e.length&&i>0;){let t=e[a];t===`(`?i+=1:t===`)`&&--i,i>0&&(a+=1)}if(i!==0){t+=e.slice(r);break}let o=e.slice(r+8,a).trim(),s=o.lastIndexOf(`/`);if(s===-1)t+=e.slice(r,a+1);else{let e=o.slice(0,s).trim(),n=o.slice(s+1).trim();t+=`color-mix(in srgb, ${e} ${n}, transparent)`}n=a+1}return t}function L(e){let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=I(r));return t}function De(e){let t={id:F(e.id),name:`${e.name} (Copy)`,builtIn:!1};return e.description&&(t.description=e.description),e.id==="default"?t:(e.light&&(t.light=L(e.light)),e.dark&&(t.dark=L(e.dark)),t)}function Oe(e){z([...R(),e])}function ke(e,t){if(e!==t.id&&B().some(e=>e.id===t.id))throw Error(`Theme id "${t.id}" already exists`);let n=R(),r=n.findIndex(t=>t.id===e);if(r===-1)return;let i={...t,builtIn:!1};z([...n.slice(0,r),i,...n.slice(r+1)]),V()===e&&e!==t.id&&H(t.id)}function Ae(e){M(e)||(z(R().filter(t=>t.id!==e)),V()===e&&(H(b),U(x)))}function R(){if(typeof localStorage>`u`)return[];let e=localStorage.getItem(O);if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(Le):[]}catch{return[]}}function z(e){typeof localStorage>`u`||localStorage.setItem(O,JSON.stringify(e))}function B(){return[...w,...R()]}function je(e){return e?B().find(t=>t.id===e)??x:x}function Me(){let e=V();return B().some(t=>t.id===e)?e:b}function V(){return typeof localStorage>`u`?b:localStorage.getItem(`ryco:active-theme`)??`default`}function H(e){typeof localStorage>`u`||localStorage.setItem(Ce,e)}function Ne(e,t){let n=(t===`dark`?x.dark:x.light)??{},r=(t===`dark`?e.dark:e.light)??{};return{...n,...r}}function Pe(e){return Object.entries(e).filter(([e,t])=>{if(we.has(e)||!Se.has(e)||typeof t!=`string`||t.length===0||t.includes(`;`)||t.includes(`}`))return!1;let n=D(e);return n?P(n,t):!1}).map(([e,t])=>`--${e}: ${t};`).join(` `)}function U(e){if(typeof document>`u`||typeof document.getElementById!=`function`)return;if(e.id==="default"){Ie();return}let t=Fe();t.textContent=`:root { ${Pe(L(Ne(e,`light`)))} } :root.dark { ${Pe(L(Ne(e,`dark`)))} }`}function Fe(){let e=document.getElementById(k);if(e instanceof HTMLStyleElement)return e;let t=document.createElement(`style`);return t.id=k,document.head.append(t),t}function Ie(){document.getElementById(k)?.remove()}function Le(e){if(!e||typeof e!=`object`)return!1;let t=e;return!(typeof t.id!=`string`||t.id.length===0||typeof t.name!=`string`||t.name.length===0||t.light!==void 0&&!Re(t.light)||t.dark!==void 0&&!Re(t.dark))}function Re(e){return!e||typeof e!=`object`?!1:Object.values(e).every(e=>typeof e==`string`)}var ze=t({syncBrowserChromeTheme:()=>qe,useTheme:()=>$}),W=`ryco:theme`,Be=`(prefers-color-scheme: dark)`,G={theme:`system`,systemDark:!1,activeThemeId:b},Ve=`theme-color`,He=`meta[name="${Ve}"][data-dynamic-theme-color="true"]`,K=[],q=null,J=null;function Y(){for(let e of K)e()}function X(){return typeof window<`u`&&typeof localStorage<`u`}function Ue(){return typeof window<`u`&&window.matchMedia(Be).matches}function Z(){if(!X())return G.theme;let e=localStorage.getItem(W);return e===`light`||e===`dark`||e===`system`?e:G.theme}function We(){let e=document.querySelector(He);return e||(e=document.createElement(`meta`),e.name=Ve,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function Ge(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function Ke(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function qe(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=Ge(getComputedStyle(Ke()).backgroundColor),t=Ge(getComputedStyle(document.body).backgroundColor),n=e??t;n&&(document.documentElement.style.backgroundColor=n,document.body.style.backgroundColor=n,We().setAttribute(`content`,n))}function Q(e,t=!1){if(typeof document>`u`||typeof window>`u`)return;t&&document.documentElement.classList.add(`no-transitions`);let n=e===`dark`||e===`system`&&Ue();document.documentElement.classList.toggle(`dark`,n),U(je(Me())),_(),qe(),Je(e),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}function Je(e){if(typeof window>`u`)return;let t=window.desktopBridge;!t||J===e||(J=e,t.setTheme(e).catch(()=>{J===e&&(J=null)}))}typeof document<`u`&&X()&&Q(Z());function Ye(){if(!X())return G;let e=Z(),t=e===`system`?Ue():!1,n=Me();return q&&q.theme===e&&q.systemDark===t&&q.activeThemeId===n||(q={theme:e,systemDark:t,activeThemeId:n}),q}function Xe(){return G}function Ze(e){if(typeof window>`u`)return()=>{};K.push(e);let t=window.matchMedia(Be),n=()=>{Z()===`system`&&Q(`system`,!0),Y()};t.addEventListener(`change`,n);let r=e=>{(e.key===W||e.key===`ryco:active-theme`||e.key===`ryco:custom-themes`||e.key===`ryco:appearance-preferences`)&&(Q(Z(),!0),Y())};return window.addEventListener(`storage`,r),()=>{K=K.filter(t=>t!==e),t.removeEventListener(`change`,n),window.removeEventListener(`storage`,r)}}function $(){let e=(0,a.c)(7),t=(0,i.useSyncExternalStore)(Ze,Ye,Xe),n=t.theme,r=t.activeThemeId,o=n===`system`?t.systemDark?`dark`:`light`:n,s=$e,c=Qe,l,u;e[0]===n?(l=e[1],u=e[2]):(l=()=>{Q(n)},u=[n],e[0]=n,e[1]=l,e[2]=u),(0,i.useEffect)(l,u);let d;return e[3]!==r||e[4]!==o||e[5]!==n?(d={theme:n,setTheme:s,resolvedTheme:o,activeThemeId:r,setActiveTheme:c},e[3]=r,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function Qe(e){X()&&(H(e),Q(Z(),!0),Y())}function $e(e){X()&&(localStorage.setItem(W,e),Q(e,!0),Y())}export{_ as A,o as C,m as D,ee as E,le as M,de as N,f as O,ue as P,c as S,u as T,H as _,U as a,D as b,je as c,M as d,Te as f,N as g,I as h,Oe as i,g as j,p as k,F as l,P as m,ze as n,Ae as o,Le as p,Ee as r,De as s,$ as t,B as u,ke as v,d as w,x,T as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Xr as e}from"./composerDraftStore-D12lUSfh.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|