@codexhost/cli-win32-arm64 0.26.1 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +1010 -592
  4. package/app/console-web.js +1861 -1498
  5. package/app/desktop-controller.mjs +488 -245
  6. package/app/host-runtime.mjs +9177 -4006
  7. package/app/plugins/antigravity/plugin.mjs +9055 -548
  8. package/app/plugins/claude-code/plugin.mjs +1117 -423
  9. package/app/plugins/codebuddy/plugin.mjs +599 -261
  10. package/app/plugins/codex-usage/plugin.mjs +1808 -1357
  11. package/app/plugins/copilot/plugin.mjs +491 -235
  12. package/app/plugins/cursor-cli/plugin.mjs +487 -232
  13. package/app/plugins/deepseek-harness/plugin.mjs +493 -235
  14. package/app/plugins/devin/plugin.mjs +467 -232
  15. package/app/plugins/grok/plugin.mjs +547 -253
  16. package/app/plugins/hermes/plugin.mjs +468 -232
  17. package/app/plugins/kimi-code/plugin.mjs +762 -439
  18. package/app/plugins/kiro-cli/plugin.mjs +466 -232
  19. package/app/plugins/omp/plugin.mjs +1705 -1356
  20. package/app/plugins/opencode/manifest.json +1 -1
  21. package/app/plugins/opencode/plugin.mjs +544 -250
  22. package/app/plugins/pi/plugin.mjs +761 -364
  23. package/app/plugins/qoder/plugin.mjs +540 -246
  24. package/app/plugins/qoder-cn/plugin.mjs +540 -246
  25. package/app/plugins/qwen-code/plugin.mjs +466 -232
  26. package/app/plugins/workbuddy/plugin.mjs +594 -273
  27. package/app/plugins/zcode/plugin.mjs +468 -232
  28. package/app/renderer-extension.js +2653 -657
  29. package/app/web/assets/index-DBPgg32z.css +1 -0
  30. package/app/web/assets/index-DWxiVzuS.js +204 -0
  31. package/app/web/codexhost-settings.js +101 -66
  32. package/app/web/index.html +2 -2
  33. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +65 -65
  34. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +69 -69
  35. package/app/web/plugins/deepseek-ai__dsh-client-shortcuts/client.js +2 -2
  36. package/app/web/plugins/deepseek-ai__dsh-client-ui-approval/client.js +4 -1
  37. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +75 -75
  38. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +73 -73
  39. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +19 -19
  40. package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
  41. package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +1 -1
  42. package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +5 -5
  43. package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
  44. package/app/web/plugins/deepseek-ai__dsh-client-ui-shortcuts/client.js +1 -1
  45. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +1 -1
  46. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.pdf.js +2 -2
  47. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-right/client.js +2 -2
  48. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
  49. package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +4 -4
  50. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +71 -71
  51. package/app/web/plugins.json +2 -1
  52. package/app/web-modules/server.mjs +5065 -1964
  53. package/bin/codexhost.exe +0 -0
  54. package/libexec/codexhost-node-repl.exe +0 -0
  55. package/libexec/codexhost-shell.exe +0 -0
  56. package/libexec/codexhost-shim.exe +0 -0
  57. package/libexec/codexhost-updater.exe +0 -0
  58. package/package.json +1 -1
  59. package/app/web/assets/index-CR4Y8Ndj.css +0 -1
  60. package/app/web/assets/index-Dw-yHAxN.js +0 -196
@@ -1,4 +1,4 @@
1
- window.__ModuleLoader__.load({id:`@deepseek-ai/dsh-client-ui-sidebar-right`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule||!c.call(e,`default`)?i(n,`default`,{value:e,enumerable:!0}):n,e));let f=e("@deepseek-ai/dsh-client-ui-primitives"),p=e("react/jsx-runtime"),m=e("react"),h=e("@deepseek-ai/dsh-client-ui-dockkit"),g=e("@deepseek-ai/dsh-client-store"),_=e("react-dom");function v(e,t,n,r){if(e===null||!e.isConnected||e.closest(`[data-sidebar-right-session]`)?.dataset.sidebarRightSession!==t)return;let i=e.closest(`[data-dockkit-pane], [data-dockkit-float]`),a=i?.dataset.dockkitPane??i?.dataset.dockkitFloat;if(a===void 0||i?.closest(`[hidden], [aria-hidden="true"]`)!==null)return;let o=n.nodes[a];if(o?.kind!==`pane`||o.host===`dock`&&!n.expanded)return;let s=e.closest(`[data-dockkit-tab], [data-sidebar-right-tab]`),c=s?.dataset.dockkitTab??s?.dataset.sidebarRightTab??o.activeTabId;if(c!==void 0&&(!o.tabs.includes(c)||n.tabs[c]===void 0))return;let l=c===void 0?void 0:r(c),u=e.closest(`[data-sidebar-right-occurrence]`)??s?.querySelector(`[data-sidebar-right-occurrence]`);if(u==null||u.dataset.sidebarRightOccurrence===l?.id)return{sessionId:t,paneId:a,host:o.host,tabId:c,occurrence:l,navigationRevision:l?.navigation.getSnapshot().revision}}function y(e,t,n){let r=[...e.querySelectorAll(`[data-dockkit-pane], [data-dockkit-float]`)].filter(e=>{let n=e.closest(`[data-sidebar-right-session]`);return n?.dataset.sidebarRightSession===t&&e.closest(`[hidden], [aria-hidden="true"]`)===null&&(e.hasAttribute(`data-dockkit-float`)||n.hasAttribute(`data-sidebar-right-open`))});return r.find(e=>(e.dataset.dockkitPane??e.dataset.dockkitFloat)===n)??r.find(e=>e.hasAttribute(`data-dockkit-pane-active`)||e.hasAttribute(`data-dockkit-float-active`))??r[0]}function b(e){let t=!0,n,r=new MutationObserver(()=>{if(n===void 0||n.element.isConnected)return;let t=n;if(n=void 0,r.disconnect(),e.activeElement!==e.body)return;let i=t.occurrence===void 0?void 0:[...e.querySelectorAll(`[data-sidebar-right-occurrence]`)].find(e=>e.dataset.sidebarRightOccurrence===t.occurrence)?.closest(`[data-dockkit-pane], [data-dockkit-float]`),a=i?.dataset.dockkitPane??i?.dataset.dockkitFloat;y(e,t.sessionId,a??t.paneId)?.focus({preventScroll:!0})}),i=()=>{r.disconnect(),n=void 0;let t=e.activeElement,i=t?.closest(`[data-dockkit-pane], [data-dockkit-float]`);if(t===null||i==null)return;let a=i.closest(`[data-sidebar-right-session]`),o=a?.dataset.sidebarRightSession,s=i.dataset.dockkitPane??i.dataset.dockkitFloat;if(a===null||o===void 0||s===void 0)return;let c=t.closest(`[data-dockkit-tab]`)??i.querySelector(`[role="tab"][aria-selected="true"], [data-dockkit-float-title]`);n={element:t,sessionId:o,paneId:s,occurrence:(t.closest(`[data-sidebar-right-occurrence]`)??c?.querySelector(`[data-sidebar-right-occurrence]`))?.dataset.sidebarRightOccurrence},r.observe(a,{childList:!0,subtree:!0}),a.parentElement!==null&&r.observe(a.parentElement,{childList:!0})},a=e=>{e.relatedTarget===null&&n?.element.isConnected&&(n=void 0,r.disconnect())},o=e=>{let t=e.composedPath().find(e=>e instanceof Element);if(!(t instanceof Element))return;let i=t.closest(`[data-sidebar-right-session] [data-dockkit-pane], [data-sidebar-right-session] [data-dockkit-float]`);i===null&&(n=void 0,r.disconnect());let a=t.closest(`button, input, textarea, select, a, [contenteditable], [tabindex], iframe`);i!==null&&(a===null||a===i)&&i.focus({preventScroll:!0})},s=()=>{queueMicrotask(()=>{t&&i()})};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),e.addEventListener(`pointerdown`,o,!0),e.defaultView?.addEventListener(`blur`,s),e.defaultView?.addEventListener(`focus`,i),i(),()=>{t=!1,r.disconnect(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a),e.removeEventListener(`pointerdown`,o,!0),e.defaultView?.removeEventListener(`blur`,s),e.defaultView?.removeEventListener(`focus`,i)}}function x(e,t,n,r){let i=(e,r)=>{if(e===`split`){let e=t.splitBlock(r);return e===void 0?null:n(`command.${e}`)}return r.host===`float`?n(`command.float`):null},a=[e.register({id:`sidebar.right.toggle`,label:()=>n(`command.toggle`),aliases:[`right sidebar`,`toggle right panel`],defaults:{"desktop:macos":{code:`KeyB`,modifiers:[`primary`,`alt`]},"desktop:windows":{code:`KeyB`,modifiers:[`primary`,`alt`]},"desktop:linux":{code:`KeyB`,modifiers:[`primary`,`alt`]},"web:macos":{code:`KeyB`,modifiers:[`primary`,`shift`]},"web:windows":{code:`KeyB`,modifiers:[`primary`,`shift`]}},regions:[`page`,`editable`,`terminal`],modals:[],resolve:()=>{let e=t.commandTarget(null);return e===void 0?{status:`blocked`,reason:n(`command.noSession`)}:{status:`handled`,run:()=>{t.isTargetCurrent(e)&&t.toggleExpanded()}}}})];for(let r of[`split`,`fullscreen`]){let o=r===`split`?{code:`Backslash`,modifiers:[`primary`]}:{code:`Enter`,modifiers:[`primary`,`alt`]};a.push(e.register({id:r===`split`?`pane.split`:`pane.fullscreen.toggle`,label:()=>n(r===`split`?`dock.splitPane`:`command.fullscreen`),aliases:[r,`panel`],defaults:{"desktop:macos":o,"desktop:windows":o,"desktop:linux":o,"web:macos":o,"web:windows":o},regions:[`page`,`editable`,`terminal`],modals:[],resolve:({target:e})=>{let a=t.focusedTarget(e);if(a===void 0)return{status:`blocked`,reason:n(`command.noFocus`)};let o=i(r,a);return o===null?{status:`handled`,run:()=>{t.isTargetCurrent(a)&&(r===`split`?t.split(a.paneId):t.toggleFullscreen(a))}}:{status:`blocked`,reason:o}}}))}for(let i of[`close`,`refresh`]){let o={code:i===`close`?`KeyW`:`KeyR`,modifiers:[`primary`]},s={...o,modifiers:[`primary`,`alt`]};a.push(e.register({id:`page.${i}`,label:()=>n(`command.${i}`),aliases:[i,`page`],defaults:{"desktop:macos":o,"desktop:windows":o,"desktop:linux":o,"web:windows":s,...i===`close`?{"web:macos":s}:{}},regions:[`page`,`editable`,`terminal`],modals:i===`close`?[`settings`,`shortcuts`,`other`]:[],resolve:({target:a,source:o,modal:s})=>{if(i===`close`&&s!==null)return{status:`handled`,run:()=>{(0,f.closeTopModal)(document)}};let c=t.focusedTarget(a);if(c===void 0&&(o===`iframe`||a?.closest(`[data-sidebar-right-session]`)))return{status:`blocked`,reason:n(`command.stale`)};if(i===`refresh`){let e=c?.occurrence?.commands.refresh;return c===void 0||e===void 0?{status:`blocked`,reason:n(`command.noRefresh`)}:{status:`handled`,run:()=>{t.isTargetCurrent(c)&&c.occurrence?.commands.refresh===e&&e()}}}return c!==void 0&&t.canCloseTarget(c)?{status:`handled`,run:()=>{t.closeTarget(c)}}:e.runtime===`desktop`?{status:`handled`,run:()=>{(c===void 0||t.isTargetCurrent(c))&&r()}}:{status:`blocked`,reason:n(`command.noFocus`)}}}))}return()=>{for(let e of a.reverse())e()}}let S=`@deepseek-ai/dsh-client-ui-sidebar-right/GuideBody.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(S)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-sidebar-right`,e.dataset.pluginCss=S,e.textContent=`.yPLWxW_guide{--dsl-guide-entry-radius:var(--dsw-radius-xl);box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;gap:14px;min-height:100%;padding:0 24px;display:flex}.yPLWxW_guide:after{content:"";flex:0 10%}.yPLWxW_hero{color:var(--dsw-static-neutral-200);margin-bottom:16px;display:flex}body[data-ds-dark-theme] .yPLWxW_hero{color:var(--dsw-static-neutral-700)}.yPLWxW_entry{box-sizing:border-box;width:380px;max-width:100%;min-height:56px;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;background:var(--dsw-alias-bg-layer-1);border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsl-guide-entry-radius);cursor:pointer;align-items:center;gap:14px;padding:14px 20px;display:flex}.yPLWxW_entry:hover{background:var(--dsw-alias-interactive-bg-hover)}.yPLWxW_entryIcon{width:26px;height:26px;color:var(--dsw-alias-label-secondary);flex:none;justify-content:center;align-items:center;display:flex}.yPLWxW_placeholderInk{color:var(--dsw-alias-label-tertiary)}.yPLWxW_entryText{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.yPLWxW_entryTitle{white-space:nowrap;text-overflow:ellipsis;font-size:14px;line-height:1.4;overflow:hidden}.yPLWxW_entryDescription{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;line-height:1.4;overflow:hidden}.yPLWxW_titleIcon{color:var(--dsw-alias-label-tertiary);flex:none}.yPLWxW_entryCell{width:380px;max-width:100%}`,document.head.appendChild(e)}var C={entry:`yPLWxW_entry`,entryCell:`yPLWxW_entryCell`,entryDescription:`yPLWxW_entryDescription`,entryIcon:`yPLWxW_entryIcon`,entryText:`yPLWxW_entryText`,entryTitle:`yPLWxW_entryTitle`,guide:`yPLWxW_guide`,hero:`yPLWxW_hero`,placeholderInk:`yPLWxW_placeholderInk`,titleIcon:`yPLWxW_titleIcon`};function w({size:e=16,className:t}){return/* @__PURE__ */ (0,p.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:t,children:[/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z`,stroke:`currentColor`}),/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M10.6101 5.39014L8.99014 8.99014L5.39014 10.6101L7.01014 7.01014L10.6101 5.39014Z`,fill:`currentColor`})]})}function ee({size:e=16,className:t}){return/* @__PURE__ */ (0,p.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:t,children:[/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M7.99998 2.5L12.9 5.2V10.8L7.99998 13.5L3.09998 10.8V5.2L7.99998 2.5Z`,stroke:`currentColor`,strokeLinejoin:`round`}),/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M3.09998 5.19995L7.99998 7.89995M7.99998 7.89995L12.9 5.19995M7.99998 7.89995V13.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function T({useTabInfo:e}){let{tab:t}=e();return/* @__PURE__ */ (0,p.jsxs)(p.Fragment,{children:[/* @__PURE__ */ (0,p.jsx)(w,{className:C.titleIcon}),t.title]})}function E({entry:e,described:t,onPick:n,shortcut:r}){let i=e.icon??ee,a=t?e.description?.():void 0;return/* @__PURE__ */ (0,p.jsxs)(`button`,{type:`button`,className:C.entry,"data-sidebar-right-guide-entry":e.kind,"aria-keyshortcuts":r?.aria,onClick:()=>{n(e)},children:[/* @__PURE__ */ (0,p.jsx)(`span`,{className:C.entryIcon,children:/* @__PURE__ */ (0,p.jsx)(i,{size:a===void 0?22:26,className:e.icon===void 0?C.placeholderInk:void 0})}),/* @__PURE__ */ (0,p.jsxs)(`span`,{className:C.entryText,children:[/* @__PURE__ */ (0,p.jsx)(`span`,{className:C.entryTitle,children:e.title()}),a!==void 0&&/* @__PURE__ */ (0,p.jsx)(`span`,{className:C.entryDescription,children:a})]}),r!==void 0&&r.keys.length>0&&/* @__PURE__ */ (0,p.jsx)(f.ShortcutKeys,{keys:r.keys})]})}function D({children:e}){return/* @__PURE__ */ (0,p.jsxs)(`div`,{className:C.guide,"data-sidebar-right-guide":!0,children:[/* @__PURE__ */ (0,p.jsx)(`span`,{className:C.hero,"aria-hidden":`true`,children:/* @__PURE__ */ (0,p.jsx)(w,{size:56})}),e]})}function O({useTabInfo:e,useGuideEntries:t,renderSlot:n,renderSlotChain:r,useShortcuts:i}){let a=i(e=>e),{tab:o}=e(),s=t(e=>e);return r(`sidebar.right.tab.guide`,{},{hookContext:e,fallback:/* @__PURE__ */ (0,p.jsx)(D,{children:s.map(t=>{let r=s.length<=4,i=r?t.description?.():void 0;return/* @__PURE__ */ (0,p.jsx)(`div`,{className:C.entryCell,children:n(`sidebar.right.tab.guide.entry`,{entryId:t.id,kind:t.kind,title:t.title(),...i===void 0?{}:{description:i}},{entryKey:t.providerId,hookContext:e,fallback:/* @__PURE__ */ (0,p.jsx)(E,{entry:t,described:r,shortcut:a.find(e=>e.id===t.commandId),onPick:e=>{o.actions.openTab(e.kind,{replaceTab:!0})}})})},JSON.stringify([t.providerId,t.id]))})})})}let te=`@deepseek-ai/dsh-client-ui-sidebar-right/ExpandButton.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(te)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-sidebar-right`,e.dataset.pluginCss=te,e.textContent=`.KIG6Lq_button{width:28px;color:var(--dsw-alias-label-secondary);flex:none;padding:0}.KIG6Lq_button svg{width:15px;height:15px}.KIG6Lq_expanded{visibility:hidden}.KIG6Lq_icon{transform:scaleX(-1)}[data-phone] .KIG6Lq_button{corner-shape:round;width:34px;height:34px;color:var(--dsw-alias-label-primary);-webkit-tap-highlight-color:transparent;background:0 0;border-radius:9999px;transition:transform .14s,background-color .14s;position:relative}[data-phone] .KIG6Lq_button:after{content:"";position:absolute;inset:-5px -1px}[data-phone] .KIG6Lq_button svg{width:17px;height:17px}[data-phone] .KIG6Lq_button:hover:not(:disabled){background:0 0}[data-phone] .KIG6Lq_button:active:not(:disabled){background:color-mix(in srgb, var(--dsw-alias-label-primary) 9%, transparent);transform:scale(.92)}[data-phone] .KIG6Lq_button:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}@media (prefers-reduced-motion:reduce){[data-phone] .KIG6Lq_button{transition:none}[data-phone] .KIG6Lq_button:active:not(:disabled){transform:none}}@media (forced-colors:active){[data-phone] .KIG6Lq_button{color:buttontext}[data-phone] .KIG6Lq_button:focus-visible{outline-color:highlight}}`,document.head.appendChild(e)}var ne={button:`KIG6Lq_button`,expanded:`KIG6Lq_expanded`,icon:`KIG6Lq_icon`};function k({sessionId:e,useStore:t,actions:n,t:r,useShortcuts:i}){let a=i(e=>e.find(e=>e.id===`sidebar.right.toggle`)),o=t(t=>t.bySession[e]?.layout.expanded??!1);return o&&!(0,f.isMobileDevice)()?null:/* @__PURE__ */ (0,p.jsx)(f.Tooltip,{label:r(`chrome.expand`),shortcutKeys:a?.keys,side:`bottom`,delayMs:500,disabled:o,children:/* @__PURE__ */ (0,p.jsx)(f.Button,{size:`sm`,className:o?`${ne.button} ${ne.expanded}`:ne.button,disabled:o,"aria-label":r(`chrome.expandAria`),"aria-keyshortcuts":a?.aria,"data-sidebar-right-expand":!0,onClick:()=>{n.setExpanded(e,!0)},children:/* @__PURE__ */ (0,p.jsx)(f.IconPanelLeftOutlineRegular,{className:ne.icon})})})}function re(e){let[t,...n]=e.guide(),r=t!==void 0&&n.length===0?t.kind:ie,i=e.get(r);if(i===void 0)throw Error(`sidebarRight: default tab kind "${r}" is not registered`);return{kind:r,title:i.title(A(r))}}let ie=`guide`;function A(e){return`sidebar://${e}`}function j(e,t,n){return{emptyPane:e(`dock.emptyPane`),splitPane:e(`dock.splitPane`),splitPaneShortcut:t?.aria,splitPaneKeys:t?.keys,splitPaneDisabled:e(`dock.splitPaneDisabled`),splitPaneNarrow:e(`dock.splitPaneNarrow`),closeTab:e(`dock.closeTab`),closeTabShortcut:n?.aria,closeTabKeys:n?.keys,addTab:e(`dock.addTab`),dockFloat:e(`dock.dockFloat`),closeFloat:e(`dock.closeFloat`),dropZone:{center:e(`dock.drop.center`),left:e(`dock.drop.left`),right:e(`dock.drop.right`),top:e(`dock.drop.top`),bottom:e(`dock.drop.bottom`)}}}function M(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function N(e,t=`|`){return e.map(e=>ye(e)).join(t)}function P(e,t){return typeof t==`bigint`?t.toString():t}var ae=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function F(e){return new ae(e)}function I(e){return e==null}function L(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function R(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function z(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function B(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function V(e){return B(e._zod.def)??e._zod.def.shape}function oe(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return z(this,t,e),e},enumerable:!0,configurable:!0})}function se(e,t,n){t in e?z(e,t,n):e[t]=n}function H(e,t,n,r){let i=V(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?oe(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):se(e,a,r?r(n.value,a):n.value))}}function ce(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?oe(e,n,()=>t[n]):se(e,n,r.value))}}function U(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function le(e){return JSON.stringify(e)}function ue(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}let de=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function fe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let pe=/* @__PURE__*/ F(()=>{if(st.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function me(e){if(fe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return fe(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function he(e){return me(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let ge=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function _e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ve(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function W(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ye(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function be(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}let xe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Se={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function Ce(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return H(i,e,we(e,t)),ve(e,U(n,{shape:i,checks:[]}))}function we(e,t){let n=V(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Te(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(we(e,t)),a={};return H(a,e,Reflect.ownKeys(V(e)).filter(e=>!i.has(e))),ve(e,U(n,{shape:a,checks:[]}))}function Ee(e,t){if(!me(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=V(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ve(e,U(e._zod.def,{shape:De(e,t)}))}function De(e,t){let n={};return H(n,e,Reflect.ownKeys(V(e))),ce(n,t),n}function Oe(e,t){if(!me(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return ve(e,U(e._zod.def,{shape:De(e,t)}))}function ke(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return H(n,e,Reflect.ownKeys(V(e))),H(n,t,Reflect.ownKeys(V(t))),ve(e,U(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ae(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(we(t,n)):void 0,o={};return H(o,t,Reflect.ownKeys(V(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),ve(t,U(t._zod.def,{shape:o,checks:[]}))}function je(e,t,n){let r=n?new Set(we(t,n)):void 0,i={};return H(i,t,Reflect.ownKeys(V(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),ve(t,U(t._zod.def,{shape:i}))}function Me(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ne(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Pe(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Fe(e){return typeof e==`string`?e:e?.message}function Ie(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Le(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Re(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Fe(e.inst?._zod.def?.error?.(e))??Fe(a?.(e))??Fe(t?.error?.(e))??Fe(n.customError?.(e))??Fe(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}let ze=/[\uD800-\uDBFF]/;function Be(e){let t=e.length;if(!ze.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Ve(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function He(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Ue(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function We(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Je(e,n,r.value)}}function Ge(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ke(e,t,n){return Ge(e,t,n,!1)}function qe(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Ge(this,n,r(this))},set(e){Ge(this,n,e)}})}return t}function Je(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Ge(this,t,n.bind(this))},set(e){Ge(this,t,e)}})}function Ye(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let Xe,Ze=!1,Qe={configurable:!0,get(){Ze=!0}};function G(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Xe!==e._zod?Xe=void 0:(Xe=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Qe);let e=Ze;Ze=!1;try{let r=n(this);return Ze?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Ze||=e,r}catch(n){throw delete this[t],Ze||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function $e(e,t,n,r){let i=Ye(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function et(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var tt;let nt={value:void 0,enumerable:!1},rt=`captureStackTrace`in Error?Error:null;function it(e){let t=rt;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return rt=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function K(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){nt.value=new a(r);try{Object.defineProperty(n,"_zod",nt)}finally{nt.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),We(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?it(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var at=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ot=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(tt=globalThis).__zod_globalConfig??(tt.__zod_globalConfig={});let st=globalThis.__zod_globalConfig;function ct(e){return e&&Object.assign(st,e),st}function lt(){let e=this._zod;return e.message??=JSON.stringify(e.def,P,2),e.message}function ut(e){this._zod.message=e}let dt={get:lt,set:ut,enumerable:!0,configurable:!0},ft={value:void 0,enumerable:!1},pt=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),mt=(e,t)=>{e.name=`$ZodError`,ft.value=t,Object.defineProperty(e,"issues",ft),ft.value=void 0,Object.defineProperty(e,"message",dt);let n=Object.getPrototypeOf(e);pt.has(n)||(pt.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},ht=K(`$ZodError`,mt);K(`$ZodError`,mt,void 0,{Parent:Error});function gt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function _t(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?gt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function vt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function yt(e,t){return{callee:t?.callee??e,Err:t?.Err}}let bt=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new at;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Re(e,o,ct())));throw de(n,a?.callee??t),n}return s.value};return t},xt=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Re(e,o,ct())));throw de(n,a?.callee??t),n}return s.value};return t},St=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new at;return a.issues.length?Ct(e,a.issues,i):{success:!0,data:a.value}};function Ct(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Re(e,n,ct()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}let wt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Ct(e,a.issues,i):{success:!0,data:a.value}},Tt=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),Et=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),Dt=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Tt)return!0;if(r.definite===!0&&n===void 0)return!1}return Ot(e,t,n)});function Ot(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Et]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new at;return a.issues.length===0}let kt=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},At=e=>{let t=bt(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,yt(n,a))};return n},jt=e=>{let t=bt(e),n=(e,r,i,a)=>t(e,r,i,yt(n,a));return n},Mt=e=>{let t=xt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,yt(n,a))};return n},Nt=e=>{let t=xt(e),n=async(e,r,i,a)=>await t(e,r,i,yt(n,a));return n},Pt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return St(e)(t,n,i)},Ft=e=>(t,n,r)=>St(e)(t,n,r),It=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return wt(e)(t,n,i)},Lt=e=>async(t,n,r)=>wt(e)(t,n,r),Rt=/^[cC][0-9a-z]{6,}$/,zt=/^[0-9a-z]+$/,Bt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Vt=/^[0-9a-vA-V]{20}$/,Ht=/^[A-Za-z0-9]{27}$/,Ut=/^[a-zA-Z0-9_-]{21}$/;function Wt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let Gt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Kt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,qt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Jt=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Yt(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}let Xt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Qt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,$t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,en=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,nn=/^https?$/,rn=/^\+[1-9]\d{6,14}$/,an=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function on(e){return RegExp(`^${e}$`)}let sn=/*@__PURE__*/ on(an);function cn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ln(e){return RegExp(`^${cn(e)}$`)}function un(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${cn({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${cn({precision:e.precision})}`:n;return RegExp(`^${an}T(?:${r})$`)}let dn=/^[\s\S]{0,}$/,fn=/^-?\d+$/,pn=/^-?\d+(?:\.\d+)?$/,mn=/^(?:true|false)$/i,hn=/^[^A-Z]*$/,gn=/^[^a-z]*$/,_n=/*@__PURE__*/ K(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vn=e=>{let t=e.value;return!I(t)&&t.length!==void 0},yn={number:`number`,bigint:`bigint`,object:`date`},bn=/*@__PURE__*/ K(`$ZodCheckLessThan`,(e,t)=>{_n.init(e,t);let n=yn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:yn[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xn=/*@__PURE__*/ K(`$ZodCheckGreaterThan`,(e,t)=>{_n.init(e,t);let n=yn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:yn[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Sn=/*@__PURE__*/ K(`$ZodCheckMultipleOf`,(e,t)=>{_n.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):R(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Cn=/*@__PURE__*/ K(`$ZodCheckNumberFormat`,(e,t)=>{_n.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=xe[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),wn=/*@__PURE__*/ K(`$ZodCheckMaxLength`,(e,t)=>{var n;_n.init(e,t),(n=e._zod.def).when??(n.when=vn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Be(r):i)<=t.maximum)return;let a=Ve(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Tn=/*@__PURE__*/ K(`$ZodCheckMinLength`,(e,t)=>{var n;_n.init(e,t),(n=e._zod.def).when??(n.when=vn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Be(r):i)>=t.minimum)return;let a=Ve(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),En=/*@__PURE__*/ K(`$ZodCheckLengthEquals`,(e,t)=>{var n;_n.init(e,t),(n=e._zod.def).when??(n.when=vn),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Be(r):i;if(a===t.length)return;let o=Ve(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Dn=/*@__PURE__*/ K(`$ZodCheckStringFormat`,(e,t)=>{var n,r;_n.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),On=/*@__PURE__*/ K(`$ZodCheckRegex`,(e,t)=>{Dn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),kn=/*@__PURE__*/ K(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=hn,Dn.init(e,t)}),An=/*@__PURE__*/ K(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=gn,Dn.init(e,t)}),jn=/*@__PURE__*/ K(`$ZodCheckIncludes`,(e,t)=>{_n.init(e,t);let n=_e(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Mn=/*@__PURE__*/ K(`$ZodCheckStartsWith`,(e,t)=>{_n.init(e,t);let n=RegExp(`^${_e(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Nn=/*@__PURE__*/ K(`$ZodCheckEndsWith`,(e,t)=>{_n.init(e,t);let n=RegExp(`.*${_e(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Pn=/*@__PURE__*/ K(`$ZodCheckOverwrite`,(e,t)=>{_n.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Fn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
1
+ window.__ModuleLoader__.load({id:`@deepseek-ai/dsh-client-ui-sidebar-right`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule||!c.call(e,`default`)?i(n,`default`,{value:e,enumerable:!0}):n,e));let f=e("@deepseek-ai/dsh-client-ui-primitives"),p=e("react/jsx-runtime"),m=e("react"),h=e("@deepseek-ai/dsh-client-ui-dockkit"),g=e("@deepseek-ai/dsh-client-store"),_=e("react-dom");function v(e,t,n,r){if(e===null||!e.isConnected||e.closest(`[data-sidebar-right-session]`)?.dataset.sidebarRightSession!==t)return;let i=e.closest(`[data-dockkit-pane], [data-dockkit-float]`),a=i?.dataset.dockkitPane??i?.dataset.dockkitFloat;if(a===void 0||i?.closest(`[hidden], [aria-hidden="true"]`)!==null)return;let o=n.nodes[a];if(o?.kind!==`pane`||o.host===`dock`&&!n.expanded)return;let s=e.closest(`[data-dockkit-tab], [data-sidebar-right-tab]`),c=s?.dataset.dockkitTab??s?.dataset.sidebarRightTab??o.activeTabId;if(c!==void 0&&(!o.tabs.includes(c)||n.tabs[c]===void 0))return;let l=c===void 0?void 0:r(c),u=e.closest(`[data-sidebar-right-occurrence]`)??s?.querySelector(`[data-sidebar-right-occurrence]`);if(u==null||u.dataset.sidebarRightOccurrence===l?.id)return{sessionId:t,paneId:a,host:o.host,tabId:c,occurrence:l,navigationRevision:l?.navigation.getSnapshot().revision}}function y(e,t,n){let r=[...e.querySelectorAll(`[data-dockkit-pane], [data-dockkit-float]`)].filter(e=>{let n=e.closest(`[data-sidebar-right-session]`);return n?.dataset.sidebarRightSession===t&&e.closest(`[hidden], [aria-hidden="true"]`)===null&&(e.hasAttribute(`data-dockkit-float`)||n.hasAttribute(`data-sidebar-right-open`))});return r.find(e=>(e.dataset.dockkitPane??e.dataset.dockkitFloat)===n)??r.find(e=>e.hasAttribute(`data-dockkit-pane-active`)||e.hasAttribute(`data-dockkit-float-active`))??r[0]}function b(e){let t=!0,n,r=new MutationObserver(()=>{if(n===void 0||n.element.isConnected)return;let t=n;if(n=void 0,r.disconnect(),e.activeElement!==e.body)return;let i=t.occurrence===void 0?void 0:[...e.querySelectorAll(`[data-sidebar-right-occurrence]`)].find(e=>e.dataset.sidebarRightOccurrence===t.occurrence)?.closest(`[data-dockkit-pane], [data-dockkit-float]`),a=i?.dataset.dockkitPane??i?.dataset.dockkitFloat;y(e,t.sessionId,a??t.paneId)?.focus({preventScroll:!0})}),i=()=>{r.disconnect(),n=void 0;let t=e.activeElement,i=t?.closest(`[data-dockkit-pane], [data-dockkit-float]`);if(t===null||i==null)return;let a=i.closest(`[data-sidebar-right-session]`),o=a?.dataset.sidebarRightSession,s=i.dataset.dockkitPane??i.dataset.dockkitFloat;if(a===null||o===void 0||s===void 0)return;let c=t.closest(`[data-dockkit-tab]`)??i.querySelector(`[role="tab"][aria-selected="true"], [data-dockkit-float-title]`);n={element:t,sessionId:o,paneId:s,occurrence:(t.closest(`[data-sidebar-right-occurrence]`)??c?.querySelector(`[data-sidebar-right-occurrence]`))?.dataset.sidebarRightOccurrence},r.observe(a,{childList:!0,subtree:!0}),a.parentElement!==null&&r.observe(a.parentElement,{childList:!0})},a=e=>{e.relatedTarget===null&&n?.element.isConnected&&(n=void 0,r.disconnect())},o=e=>{let t=e.composedPath().find(e=>e instanceof Element);if(!(t instanceof Element))return;let i=t.closest(`[data-sidebar-right-session] [data-dockkit-pane], [data-sidebar-right-session] [data-dockkit-float]`);i===null&&(n=void 0,r.disconnect());let a=t.closest(`button, input, textarea, select, a, [contenteditable], [tabindex], iframe`);i!==null&&(a===null||a===i)&&i.focus({preventScroll:!0})},s=()=>{queueMicrotask(()=>{t&&i()})};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),e.addEventListener(`pointerdown`,o,!0),e.defaultView?.addEventListener(`blur`,s),e.defaultView?.addEventListener(`focus`,i),i(),()=>{t=!1,r.disconnect(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a),e.removeEventListener(`pointerdown`,o,!0),e.defaultView?.removeEventListener(`blur`,s),e.defaultView?.removeEventListener(`focus`,i)}}function x(e,t,n,r){let i=(e,r)=>{if(e===`split`){let e=t.splitBlock(r);return e===void 0?null:n(`command.${e}`)}return r.host===`float`?n(`command.float`):null},a=[e.register({id:`sidebar.right.toggle`,label:()=>n(`command.toggle`),aliases:[`right sidebar`,`toggle right panel`],defaults:{"desktop:macos":{code:`KeyB`,modifiers:[`primary`,`alt`]},"desktop:windows":{code:`KeyB`,modifiers:[`primary`,`alt`]},"desktop:linux":{code:`KeyB`,modifiers:[`primary`,`alt`]},"web:macos":{code:`KeyB`,modifiers:[`primary`,`shift`]},"web:windows":{code:`KeyB`,modifiers:[`primary`,`shift`]}},regions:[`page`,`editable`,`terminal`],modals:[],resolve:()=>{let e=t.commandTarget(null);return e===void 0?{status:`blocked`,reason:n(`command.noSession`)}:{status:`handled`,run:()=>{t.isTargetCurrent(e)&&t.toggleExpanded()}}}})];for(let r of[`split`,`fullscreen`]){let o=r===`split`?{code:`Backslash`,modifiers:[`primary`]}:{code:`Enter`,modifiers:[`primary`,`alt`]};a.push(e.register({id:r===`split`?`pane.split`:`pane.fullscreen.toggle`,label:()=>n(r===`split`?`dock.splitPane`:`command.fullscreen`),aliases:[r,`panel`],defaults:{"desktop:macos":o,"desktop:windows":o,"desktop:linux":o,"web:macos":o,"web:windows":o},regions:[`page`,`editable`,`terminal`],modals:[],resolve:({target:e})=>{let a=t.focusedTarget(e);if(a===void 0)return{status:`blocked`,reason:n(`command.noFocus`)};let o=i(r,a);return o===null?{status:`handled`,run:()=>{t.isTargetCurrent(a)&&(r===`split`?t.split(a.paneId):t.toggleFullscreen(a))}}:{status:`blocked`,reason:o}}}))}for(let i of[`close`,`refresh`]){let o={code:i===`close`?`KeyW`:`KeyR`,modifiers:[`primary`]},s={...o,modifiers:[`primary`,`alt`]};a.push(e.register({id:`page.${i}`,label:()=>n(`command.${i}`),aliases:[i,`page`],defaults:{"desktop:macos":o,"desktop:windows":o,"desktop:linux":o,"web:windows":s,...i===`close`?{"web:macos":s}:{}},regions:[`page`,`editable`,`terminal`],modals:i===`close`?[`settings`,`shortcuts`,`other`]:[],resolve:({target:a,source:o,modal:s})=>{if(i===`close`&&s!==null)return{status:`handled`,run:()=>{(0,f.closeTopModal)(document)}};let c=t.focusedTarget(a);if(c===void 0&&(o===`iframe`||a?.closest(`[data-sidebar-right-session]`)))return{status:`blocked`,reason:n(`command.stale`)};if(i===`refresh`){let e=c?.occurrence?.commands.refresh;return c===void 0||e===void 0?{status:`blocked`,reason:n(`command.noRefresh`)}:{status:`handled`,run:()=>{t.isTargetCurrent(c)&&c.occurrence?.commands.refresh===e&&e()}}}return c!==void 0&&t.canCloseTarget(c)?{status:`handled`,run:()=>{t.closeTarget(c)}}:e.runtime===`desktop`?{status:`handled`,run:()=>{(c===void 0||t.isTargetCurrent(c))&&r()}}:{status:`blocked`,reason:n(`command.noFocus`)}}}))}return()=>{for(let e of a.reverse())e()}}let S=`@deepseek-ai/dsh-client-ui-sidebar-right/GuideBody.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(S)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-sidebar-right`,e.dataset.pluginCss=S,e.textContent=`.yPLWxW_guide{--dsl-guide-entry-radius:var(--dsw-radius-xl);box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;gap:14px;min-height:100%;padding:0 24px;display:flex}.yPLWxW_guide:after{content:"";flex:0 10%}.yPLWxW_hero{color:var(--dsw-static-neutral-200);margin-bottom:16px;display:flex}body[data-ds-dark-theme] .yPLWxW_hero{color:var(--dsw-static-neutral-700)}.yPLWxW_entry{box-sizing:border-box;width:380px;max-width:100%;min-height:56px;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;background:var(--dsw-alias-bg-layer-1);border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsl-guide-entry-radius);cursor:pointer;align-items:center;gap:14px;padding:14px 20px;display:flex}.yPLWxW_entry:hover{background:var(--dsw-alias-interactive-bg-hover)}.yPLWxW_entryIcon{width:26px;height:26px;color:var(--dsw-alias-label-secondary);flex:none;justify-content:center;align-items:center;display:flex}.yPLWxW_placeholderInk{color:var(--dsw-alias-label-tertiary)}.yPLWxW_entryText{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.yPLWxW_entryTitle{white-space:nowrap;text-overflow:ellipsis;font-size:14px;line-height:1.4;overflow:hidden}.yPLWxW_entryDescription{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;line-height:1.4;overflow:hidden}.yPLWxW_titleIcon{color:var(--dsw-alias-label-tertiary);flex:none}.yPLWxW_entryCell{width:380px;max-width:100%}`,document.head.appendChild(e)}var C={entry:`yPLWxW_entry`,entryCell:`yPLWxW_entryCell`,entryDescription:`yPLWxW_entryDescription`,entryIcon:`yPLWxW_entryIcon`,entryText:`yPLWxW_entryText`,entryTitle:`yPLWxW_entryTitle`,guide:`yPLWxW_guide`,hero:`yPLWxW_hero`,placeholderInk:`yPLWxW_placeholderInk`,titleIcon:`yPLWxW_titleIcon`};function w({size:e=16,className:t}){return/* @__PURE__ */ (0,p.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:t,children:[/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z`,stroke:`currentColor`}),/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M10.6101 5.39014L8.99014 8.99014L5.39014 10.6101L7.01014 7.01014L10.6101 5.39014Z`,fill:`currentColor`})]})}function ee({size:e=16,className:t}){return/* @__PURE__ */ (0,p.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:t,children:[/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M7.99998 2.5L12.9 5.2V10.8L7.99998 13.5L3.09998 10.8V5.2L7.99998 2.5Z`,stroke:`currentColor`,strokeLinejoin:`round`}),/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M3.09998 5.19995L7.99998 7.89995M7.99998 7.89995L12.9 5.19995M7.99998 7.89995V13.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function T({useTabInfo:e}){let{tab:t}=e();return/* @__PURE__ */ (0,p.jsxs)(p.Fragment,{children:[/* @__PURE__ */ (0,p.jsx)(w,{className:C.titleIcon}),t.title]})}function E({entry:e,described:t,onPick:n,shortcut:r}){let i=e.icon??ee,a=t?e.description?.():void 0;return/* @__PURE__ */ (0,p.jsxs)(`button`,{type:`button`,className:C.entry,"data-sidebar-right-guide-entry":e.kind,"aria-keyshortcuts":r?.aria,onClick:()=>{n(e)},children:[/* @__PURE__ */ (0,p.jsx)(`span`,{className:C.entryIcon,children:/* @__PURE__ */ (0,p.jsx)(i,{size:a===void 0?22:26,className:e.icon===void 0?C.placeholderInk:void 0})}),/* @__PURE__ */ (0,p.jsxs)(`span`,{className:C.entryText,children:[/* @__PURE__ */ (0,p.jsx)(`span`,{className:C.entryTitle,children:e.title()}),a!==void 0&&/* @__PURE__ */ (0,p.jsx)(`span`,{className:C.entryDescription,children:a})]}),r!==void 0&&r.keys.length>0&&/* @__PURE__ */ (0,p.jsx)(f.ShortcutKeys,{keys:r.keys})]})}function D({children:e}){return/* @__PURE__ */ (0,p.jsxs)(`div`,{className:C.guide,"data-sidebar-right-guide":!0,children:[/* @__PURE__ */ (0,p.jsx)(`span`,{className:C.hero,"aria-hidden":`true`,children:/* @__PURE__ */ (0,p.jsx)(w,{size:56})}),e]})}function O({useTabInfo:e,useGuideEntries:t,renderSlot:n,renderSlotChain:r,useShortcuts:i}){let a=i(e=>e),{tab:o}=e(),s=t(e=>e);return r(`sidebar.right.tab.guide`,{},{hookContext:e,fallback:/* @__PURE__ */ (0,p.jsx)(D,{children:s.map(t=>{let r=s.length<=4,i=r?t.description?.():void 0;return/* @__PURE__ */ (0,p.jsx)(`div`,{className:C.entryCell,children:n(`sidebar.right.tab.guide.entry`,{entryId:t.id,kind:t.kind,title:t.title(),...i===void 0?{}:{description:i}},{entryKey:t.providerId,hookContext:e,fallback:/* @__PURE__ */ (0,p.jsx)(E,{entry:t,described:r,shortcut:a.find(e=>e.id===t.commandId),onPick:e=>{o.actions.openTab(e.kind,{replaceTab:!0})}})})},JSON.stringify([t.providerId,t.id]))})})})}let te=`@deepseek-ai/dsh-client-ui-sidebar-right/ExpandButton.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(te)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-sidebar-right`,e.dataset.pluginCss=te,e.textContent=`.KIG6Lq_button{corner-shape:round;width:28px;color:color-mix(in srgb, var(--dsw-alias-label-secondary) 82%, transparent);border-radius:50%;flex:none;padding:0;transition:background-color .14s,color .14s}.KIG6Lq_button:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.KIG6Lq_button svg{width:16px;height:16px}.KIG6Lq_expanded{visibility:hidden}.KIG6Lq_icon{transform:scaleX(-1)}[data-phone] .KIG6Lq_button{corner-shape:round;width:34px;height:34px;color:var(--dsw-alias-label-primary);-webkit-tap-highlight-color:transparent;background:0 0;border-radius:9999px;transition:transform .14s,background-color .14s;position:relative}[data-phone] .KIG6Lq_button:after{content:"";position:absolute;inset:-5px -1px}[data-phone] .KIG6Lq_button svg{width:17px;height:17px}[data-phone] .KIG6Lq_button:hover:not(:disabled){background:0 0}[data-phone] .KIG6Lq_button:active:not(:disabled){background:color-mix(in srgb, var(--dsw-alias-label-primary) 9%, transparent);transform:scale(.92)}[data-phone] .KIG6Lq_button:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}@media (prefers-reduced-motion:reduce){[data-phone] .KIG6Lq_button{transition:none}[data-phone] .KIG6Lq_button:active:not(:disabled){transform:none}}@media (forced-colors:active){[data-phone] .KIG6Lq_button{color:buttontext}[data-phone] .KIG6Lq_button:focus-visible{outline-color:highlight}}`,document.head.appendChild(e)}var ne={button:`KIG6Lq_button`,expanded:`KIG6Lq_expanded`,icon:`KIG6Lq_icon`};function k({sessionId:e,useStore:t,actions:n,t:r,useShortcuts:i}){let a=i(e=>e.find(e=>e.id===`sidebar.right.toggle`)),o=t(t=>t.bySession[e]?.layout.expanded??!1);return o&&!(0,f.isMobileDevice)()?null:/* @__PURE__ */ (0,p.jsx)(f.Tooltip,{label:r(`chrome.expand`),shortcutKeys:a?.keys,side:`bottom`,delayMs:500,disabled:o,children:/* @__PURE__ */ (0,p.jsx)(f.Button,{size:`sm`,className:o?`${ne.button} ${ne.expanded}`:ne.button,disabled:o,"aria-label":r(`chrome.expandAria`),"aria-keyshortcuts":a?.aria,"data-sidebar-right-expand":!0,onClick:()=>{n.setExpanded(e,!0)},children:/* @__PURE__ */ (0,p.jsx)(f.IconPanelLeftOutlineRegular,{className:ne.icon})})})}function re(e){let[t,...n]=e.guide(),r=t!==void 0&&n.length===0?t.kind:ie,i=e.get(r);if(i===void 0)throw Error(`sidebarRight: default tab kind "${r}" is not registered`);return{kind:r,title:i.title(A(r))}}let ie=`guide`;function A(e){return`sidebar://${e}`}function j(e,t,n){return{emptyPane:e(`dock.emptyPane`),splitPane:e(`dock.splitPane`),splitPaneShortcut:t?.aria,splitPaneKeys:t?.keys,splitPaneDisabled:e(`dock.splitPaneDisabled`),splitPaneNarrow:e(`dock.splitPaneNarrow`),closeTab:e(`dock.closeTab`),closeTabShortcut:n?.aria,closeTabKeys:n?.keys,addTab:e(`dock.addTab`),dockFloat:e(`dock.dockFloat`),closeFloat:e(`dock.closeFloat`),dropZone:{center:e(`dock.drop.center`),left:e(`dock.drop.left`),right:e(`dock.drop.right`),top:e(`dock.drop.top`),bottom:e(`dock.drop.bottom`)}}}function M(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function N(e,t=`|`){return e.map(e=>ye(e)).join(t)}function P(e,t){return typeof t==`bigint`?t.toString():t}var ae=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function F(e){return new ae(e)}function I(e){return e==null}function L(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function R(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function z(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function B(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function V(e){return B(e._zod.def)??e._zod.def.shape}function oe(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return z(this,t,e),e},enumerable:!0,configurable:!0})}function se(e,t,n){t in e?z(e,t,n):e[t]=n}function H(e,t,n,r){let i=V(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?oe(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):se(e,a,r?r(n.value,a):n.value))}}function ce(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?oe(e,n,()=>t[n]):se(e,n,r.value))}}function U(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function le(e){return JSON.stringify(e)}function ue(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}let de=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function fe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let pe=/* @__PURE__*/ F(()=>{if(st.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function me(e){if(fe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return fe(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function he(e){return me(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let ge=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function _e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ve(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function W(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ye(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function be(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}let xe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Se={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function Ce(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return H(i,e,we(e,t)),ve(e,U(n,{shape:i,checks:[]}))}function we(e,t){let n=V(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Te(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(we(e,t)),a={};return H(a,e,Reflect.ownKeys(V(e)).filter(e=>!i.has(e))),ve(e,U(n,{shape:a,checks:[]}))}function Ee(e,t){if(!me(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=V(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ve(e,U(e._zod.def,{shape:De(e,t)}))}function De(e,t){let n={};return H(n,e,Reflect.ownKeys(V(e))),ce(n,t),n}function Oe(e,t){if(!me(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return ve(e,U(e._zod.def,{shape:De(e,t)}))}function ke(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return H(n,e,Reflect.ownKeys(V(e))),H(n,t,Reflect.ownKeys(V(t))),ve(e,U(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ae(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(we(t,n)):void 0,o={};return H(o,t,Reflect.ownKeys(V(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),ve(t,U(t._zod.def,{shape:o,checks:[]}))}function je(e,t,n){let r=n?new Set(we(t,n)):void 0,i={};return H(i,t,Reflect.ownKeys(V(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),ve(t,U(t._zod.def,{shape:i}))}function Me(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ne(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Pe(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Fe(e){return typeof e==`string`?e:e?.message}function Ie(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Le(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Re(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Fe(e.inst?._zod.def?.error?.(e))??Fe(a?.(e))??Fe(t?.error?.(e))??Fe(n.customError?.(e))??Fe(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}let ze=/[\uD800-\uDBFF]/;function Be(e){let t=e.length;if(!ze.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Ve(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function He(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Ue(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function We(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Je(e,n,r.value)}}function Ge(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ke(e,t,n){return Ge(e,t,n,!1)}function qe(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Ge(this,n,r(this))},set(e){Ge(this,n,e)}})}return t}function Je(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Ge(this,t,n.bind(this))},set(e){Ge(this,t,e)}})}function Ye(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let Xe,Ze=!1,Qe={configurable:!0,get(){Ze=!0}};function G(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Xe!==e._zod?Xe=void 0:(Xe=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Qe);let e=Ze;Ze=!1;try{let r=n(this);return Ze?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Ze||=e,r}catch(n){throw delete this[t],Ze||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function $e(e,t,n,r){let i=Ye(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function et(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var tt;let nt={value:void 0,enumerable:!1},rt=`captureStackTrace`in Error?Error:null;function it(e){let t=rt;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return rt=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function K(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){nt.value=new a(r);try{Object.defineProperty(n,"_zod",nt)}finally{nt.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),We(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?it(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var at=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ot=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(tt=globalThis).__zod_globalConfig??(tt.__zod_globalConfig={});let st=globalThis.__zod_globalConfig;function ct(e){return e&&Object.assign(st,e),st}function lt(){let e=this._zod;return e.message??=JSON.stringify(e.def,P,2),e.message}function ut(e){this._zod.message=e}let dt={get:lt,set:ut,enumerable:!0,configurable:!0},ft={value:void 0,enumerable:!1},pt=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),mt=(e,t)=>{e.name=`$ZodError`,ft.value=t,Object.defineProperty(e,"issues",ft),ft.value=void 0,Object.defineProperty(e,"message",dt);let n=Object.getPrototypeOf(e);pt.has(n)||(pt.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},ht=K(`$ZodError`,mt);K(`$ZodError`,mt,void 0,{Parent:Error});function gt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function _t(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?gt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function vt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function yt(e,t){return{callee:t?.callee??e,Err:t?.Err}}let bt=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new at;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Re(e,o,ct())));throw de(n,a?.callee??t),n}return s.value};return t},xt=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Re(e,o,ct())));throw de(n,a?.callee??t),n}return s.value};return t},St=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new at;return a.issues.length?Ct(e,a.issues,i):{success:!0,data:a.value}};function Ct(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Re(e,n,ct()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}let wt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Ct(e,a.issues,i):{success:!0,data:a.value}},Tt=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),Et=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),Dt=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Tt)return!0;if(r.definite===!0&&n===void 0)return!1}return Ot(e,t,n)});function Ot(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Et]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new at;return a.issues.length===0}let kt=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},At=e=>{let t=bt(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,yt(n,a))};return n},jt=e=>{let t=bt(e),n=(e,r,i,a)=>t(e,r,i,yt(n,a));return n},Mt=e=>{let t=xt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,yt(n,a))};return n},Nt=e=>{let t=xt(e),n=async(e,r,i,a)=>await t(e,r,i,yt(n,a));return n},Pt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return St(e)(t,n,i)},Ft=e=>(t,n,r)=>St(e)(t,n,r),It=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return wt(e)(t,n,i)},Lt=e=>async(t,n,r)=>wt(e)(t,n,r),Rt=/^[cC][0-9a-z]{6,}$/,zt=/^[0-9a-z]+$/,Bt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Vt=/^[0-9a-vA-V]{20}$/,Ht=/^[A-Za-z0-9]{27}$/,Ut=/^[a-zA-Z0-9_-]{21}$/;function Wt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let Gt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Kt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,qt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Jt=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Yt(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}let Xt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Qt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,$t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,en=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,nn=/^https?$/,rn=/^\+[1-9]\d{6,14}$/,an=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function on(e){return RegExp(`^${e}$`)}let sn=/*@__PURE__*/ on(an);function cn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ln(e){return RegExp(`^${cn(e)}$`)}function un(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${cn({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${cn({precision:e.precision})}`:n;return RegExp(`^${an}T(?:${r})$`)}let dn=/^[\s\S]{0,}$/,fn=/^-?\d+$/,pn=/^-?\d+(?:\.\d+)?$/,mn=/^(?:true|false)$/i,hn=/^[^A-Z]*$/,gn=/^[^a-z]*$/,_n=/*@__PURE__*/ K(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vn=e=>{let t=e.value;return!I(t)&&t.length!==void 0},yn={number:`number`,bigint:`bigint`,object:`date`},bn=/*@__PURE__*/ K(`$ZodCheckLessThan`,(e,t)=>{_n.init(e,t);let n=yn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:yn[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xn=/*@__PURE__*/ K(`$ZodCheckGreaterThan`,(e,t)=>{_n.init(e,t);let n=yn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:yn[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Sn=/*@__PURE__*/ K(`$ZodCheckMultipleOf`,(e,t)=>{_n.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):R(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Cn=/*@__PURE__*/ K(`$ZodCheckNumberFormat`,(e,t)=>{_n.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=xe[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),wn=/*@__PURE__*/ K(`$ZodCheckMaxLength`,(e,t)=>{var n;_n.init(e,t),(n=e._zod.def).when??(n.when=vn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Be(r):i)<=t.maximum)return;let a=Ve(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Tn=/*@__PURE__*/ K(`$ZodCheckMinLength`,(e,t)=>{var n;_n.init(e,t),(n=e._zod.def).when??(n.when=vn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Be(r):i)>=t.minimum)return;let a=Ve(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),En=/*@__PURE__*/ K(`$ZodCheckLengthEquals`,(e,t)=>{var n;_n.init(e,t),(n=e._zod.def).when??(n.when=vn),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Be(r):i;if(a===t.length)return;let o=Ve(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Dn=/*@__PURE__*/ K(`$ZodCheckStringFormat`,(e,t)=>{var n,r;_n.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),On=/*@__PURE__*/ K(`$ZodCheckRegex`,(e,t)=>{Dn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),kn=/*@__PURE__*/ K(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=hn,Dn.init(e,t)}),An=/*@__PURE__*/ K(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=gn,Dn.init(e,t)}),jn=/*@__PURE__*/ K(`$ZodCheckIncludes`,(e,t)=>{_n.init(e,t);let n=_e(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Mn=/*@__PURE__*/ K(`$ZodCheckStartsWith`,(e,t)=>{_n.init(e,t);let n=RegExp(`^${_e(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Nn=/*@__PURE__*/ K(`$ZodCheckEndsWith`,(e,t)=>{_n.init(e,t);let n=RegExp(`.*${_e(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Pn=/*@__PURE__*/ K(`$ZodCheckOverwrite`,(e,t)=>{_n.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Fn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
2
2
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
3
3
  `)}\n};`)(...Object.values(this.closed))}};let In={major:4,minor:6,patch:7},q=/*@__PURE__*/ K(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=In;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Me(t),a;for(let o of n){if(o._zod.def.when){if(Ne(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new at;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Le(t.issues,n,e),i||=Me(t,n))});else{if(t.issues.length===n)continue;Le(t.issues,n,e),i||=Me(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Me(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new at;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new at;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Ke(this,`~standard`,zn(this))},set"~standard"(e){Ge(this,`~standard`,e)}}),Ln=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Re(e,t,ct()))}:{value:e.value};async function Rn(e,t){let n={async:!0};return Ln(await e._zod.run({value:t,issues:[]},n),n)}function zn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Ln(r,n)}catch{}return Rn(e,t)},vendor:`zod`,version:1}}let Bn=/*@__PURE__*/ K(`$ZodString`,(e,t)=>{q.init(e,t),e._zod.pattern=t.pattern??dn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),J=/*@__PURE__*/ K(`$ZodStringFormat`,(e,t)=>{Dn.init(e,t),Bn.init(e,t)}),Vn=/*@__PURE__*/ K(`$ZodGUID`,(e,t)=>{t.pattern??=Kt,J.init(e,t)}),Hn=/*@__PURE__*/ K(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=qt(e)}else t.pattern??=qt();J.init(e,t)}),Un=/*@__PURE__*/ K(`$ZodEmail`,(e,t)=>{t.pattern??=Jt,J.init(e,t)});function Wn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Gn(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Wn(e)||2:Kn(e,t)}function Kn(e,t){if(!t.normalize&&t.protocol?.source===nn.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}let qn=/[\t\n\r]/g;function Jn(e){return e.replace(qn,``)}function Yn(e,t){return t.lastIndex=0,t.test(e.hostname)}function Xn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}let Zn=/*@__PURE__*/ K(`$ZodURL`,(e,t)=>{J.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Gn(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Jn(r);return}t.hostname&&!Yn(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Xn(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Jn(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Qn=/*@__PURE__*/ K(`$ZodEmoji`,(e,t)=>{t.pattern??=Yt(),J.init(e,t)}),$n=/*@__PURE__*/ K(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Ut:Wt(t.length),J.init(e,t)}),er=/*@__PURE__*/ K(`$ZodCUID`,(e,t)=>{t.pattern??=Rt,J.init(e,t)}),tr=/*@__PURE__*/ K(`$ZodCUID2`,(e,t)=>{t.pattern??=zt,J.init(e,t)}),nr=/*@__PURE__*/ K(`$ZodULID`,(e,t)=>{t.pattern??=Bt,J.init(e,t)}),rr=/*@__PURE__*/ K(`$ZodXID`,(e,t)=>{t.pattern??=Vt,J.init(e,t)}),ir=/*@__PURE__*/ K(`$ZodKSUID`,(e,t)=>{t.pattern??=Ht,J.init(e,t)}),ar=/*@__PURE__*/ K(`$ZodISODateTime`,(e,t)=>{t.pattern??=un(t),J.init(e,t)}),or=/*@__PURE__*/ K(`$ZodISODate`,(e,t)=>{t.pattern??=sn,J.init(e,t)}),sr=/*@__PURE__*/ K(`$ZodISOTime`,(e,t)=>{t.pattern??=ln(t),J.init(e,t)}),cr=/*@__PURE__*/ K(`$ZodISODuration`,(e,t)=>{t.pattern??=Gt,J.init(e,t)}),lr=/*@__PURE__*/ K(`$ZodIPv4`,(e,t)=>{t.pattern??=Xt,J.init(e,t)}),ur=/^[0-9a-fA-F:.]+$/;function dr(e){return ur.test(e)?Wn(`http://[${e}]`):!1}let fr=/*@__PURE__*/ K(`$ZodIPv6`,(e,t)=>{t.pattern??=Zt,J.init(e,t),e._zod.check=n=>{dr(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),pr=/*@__PURE__*/ K(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Qt,J.init(e,t)});function mr(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:dr(n)}let hr=/*@__PURE__*/ K(`$ZodCIDRv6`,(e,t)=>{t.pattern??=$t,J.init(e,t),e._zod.check=n=>{mr(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function gr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let _r=/^[0-9a-zA-Z+/]*={0,2}$/,vr=/*@__PURE__*/ K(`$ZodBase64`,(e,t)=>{t.pattern??=_r,J.init(e,t),e._zod.check=n=>{gr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),yr=/^[A-Za-z0-9_-]*$/;function br(e){if(!yr.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return gr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}let xr=/*@__PURE__*/ K(`$ZodBase64URL`,(e,t)=>{t.pattern??=yr,J.init(e,t),e._zod.check=n=>{br(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Sr=/*@__PURE__*/ K(`$ZodE164`,(e,t)=>{t.pattern??=rn,J.init(e,t)});function Cr(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}let wr=/*@__PURE__*/ K(`$ZodJWT`,(e,t)=>{J.init(e,t),e._zod.check=n=>{Cr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Tr=/*@__PURE__*/ K(`$ZodNumber`,(e,t)=>{q.init(e,t),e._zod.pattern=pn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Er=/*@__PURE__*/ K(`$ZodNumberFormat`,(e,t)=>{Cn.init(e,t),Tr.init(e,t)}),Dr=/*@__PURE__*/ K(`$ZodBoolean`,(e,t)=>{q.init(e,t),e._zod.pattern=mn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Or=/*@__PURE__*/ K(`$ZodUnknown`,(e,t)=>{q.init(e,t),e._zod.parse=e=>e}),kr=/*@__PURE__*/ K(`$ZodNever`,(e,t)=>{q.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Ar(e,t){let n=Ie(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Ie(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Le(n.issues,t,e),n}}return i(n,a)}}let jr=e=>Array.isArray(e)?e.length:-1;function Mr(e,t,n){e.issues.length&&t.issues.push(...Pe(n,e.issues)),t.value[n]=e.value}let Nr=/*@__PURE__*/ K(`$ZodArray`,(e,t)=>{q.init(e,t);let n=st.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Mr(t,r,e)));else if(Mr(c,r,e),s&&c.issues.length!==0&&Me(c))break}return o.length?Promise.all(o).then(()=>r):r},Ar(e,jr)});function Pr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Pe(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}let Fr=[];function Ir(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Fr,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=be(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Lr(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Me(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Pr(e,n,i,t,d,f))):Pr(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}let Rr=/*@__PURE__*/ K(`$ZodObject`,(e,t)=>{q.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=F(()=>Ir(t));G(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||z(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=fe,o=t.catchall,s,c=st.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Me(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Pr(n,t,e,r,a,o))):Pr(s,t,e,r,a,o)}return o?Lr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),zr=/*@__PURE__*/ K(`$ZodObjectJIT`,(e,t)=>{Rr.init(e,t);let n=e._zod.parse,r=F(()=>Ir(t)),i=st.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Fn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
4
4
  let ${e}_ab = false;
@@ -110,4 +110,4 @@ function Ia(e,t){let n=new _n({check:`custom`,...W(t)});return n._zod.check=e,n}
110
110
 
111
111
  Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ha(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ha(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}let Ua=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Wa=[`oneOf`,`anyOf`];function Ga(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ka(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ua.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ga(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}z(n,r,e.length===1?e[0]:Ka(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ga(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function qa(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ua)if(t in e)return;let n=t.filter(e=>Wa.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ka(t);else{let e=n[0],i=Wa.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ka([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,La(e,r))}function Ja(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):La(i,s),La(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ha(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])qa(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}La(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,z(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Za(t,`input`,e.processors),output:Za(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Ya(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Ya(r.element,n);if(r.type===`set`)return Ya(r.valueType,n);if(r.type===`lazy`)return Ya(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Ya(r.innerType,n);if(r.type===`intersection`)return Ya(r.left,n)||Ya(r.right,n);if(r.type===`record`||r.type===`map`)return Ya(r.keyType,n)||Ya(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Ya(r.in,n)||Ya(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Ya(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Ya(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Ya(e,n))return!0;return!!(r.rest&&Ya(r.rest,n))}return!1}let Xa=(e,t={})=>n=>{let r=Ra({...n,processors:t});return Y(e,r),Va(r,e),Ja(r,e)},Za=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ra({...i??{},target:a,io:t,processors:n});return Y(e,o),Va(o,e),Ja(o,e)},Qa=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},$a=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},eo=(e,t)=>{Qa(e,`minimum`,t),$a(e,`maximum`,t)},to=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},no=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},ro=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},io=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},ao=(e,t)=>Qa(e,`minimum`,t.minimum),oo=(e,t)=>$a(e,`maximum`,t.maximum),so=e=>(t,n)=>{io(t,n.format);let[r,i]=e[n.format];Qa(t,`minimum`,r),$a(t,`maximum`,i)},co={greater_than:(e,t)=>Qa(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>$a(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>to(e,t.value),number_format:so(xe),bigint_format:so(Se),min_length:ao,max_length:oo,length_equals:(e,t)=>eo(e,t.length),min_size:ao,max_size:oo,size_equals:(e,t)=>eo(e,t.size),string_format:(e,t)=>{io(e,t.format),t.pattern&&no(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>ro(e,t.mime)};function lo(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)co[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Qa(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Qa(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&$a(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&$a(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&to(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&ro(t,i.mime);for(let e of i.patterns??[])no(t,e);return t}let uo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},fo=/* @__PURE__ */ new Map([[_r,en],[yr,tn]]),po=e=>fo.get(e)??e,mo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=lo(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=uo[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(po);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ho=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=lo(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):za(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},go=(e,t,n,r)=>{n.type=`boolean`},_o=(e,t,n,r)=>{n.not={}},vo=(e,t,n,r)=>{let i=e._zod.def,a=M(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},yo=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(za(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(za(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},bo=(e,t,n,r)=>{za(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},xo=(e,t,n,r)=>{za(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},So=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=lo(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Y(a.element,t,{...r,path:[...r.path,`items`]})};function Co(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Co(t.out):t.type===`catch`?Co(t.innerType):e._zod.optin}let wo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&za(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)z(i.properties,e,Y(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Co(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Y(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},To=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Y(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Eo=(e,t,n,r)=>{let i=e._zod.def,a=Y(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Y(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Do(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Do(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Do(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?pn:fn).source)),p}let Oo=/* @__PURE__ */ new WeakMap;function ko(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of Oo.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Do(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}let Ao=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=lo(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Y(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)z(i.patternProperties,po(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Y(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Oo.get(t);n||(n=[],Oo.set(t,n),t.deferred.push(()=>ko(t))),n.push(e)}i.additionalProperties=Y(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Co(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},jo=(e,t,n,r)=>{let i=e._zod.def,a=Y(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Mo=(e,t,n,r)=>{let i=e._zod.def;Y(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},No=Symbol();function Po(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(za(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),No):JSON.parse(o)}let Fo=(e,t,n,r)=>{let i=e._zod.def;Y(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Po(i.defaultValue,e,t,n,r);o!==No&&(n.default=o)},Io=(e,t,n,r)=>{let i=e._zod.def;Y(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Po(i.defaultValue,e,t,n,r);o!==No&&(n._prefault=o)},Lo=(e,t,n,r)=>{let i=e._zod.def;Y(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{za(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Ro=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Y(o,t,r);let s=t.seen.get(e);s.ref=o},zo=(e,t,n,r)=>{let i=e._zod.def;Y(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Bo=(e,t,n,r)=>{let i=e._zod.def;Y(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Vo=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function Ho(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let Uo=/*@__PURE__*/ K(`ZodError`,(e,t)=>{ht.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Vo.has(n)||(Vo.add(n),Ho(n,`format`,e=>t=>vt(e,t)),Ho(n,`flatten`,e=>t=>_t(e,t)),Ho(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,P,2)}),Ho(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,P,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Wo=/* @__PURE__ */ bt(Uo),Go=/* @__PURE__ */ xt(Uo),Ko=/* @__PURE__ */ St(Uo),qo=/* @__PURE__ */ wt(Uo),Jo=/* @__PURE__ */ At(Uo),Yo=/* @__PURE__ */ jt(Uo),Xo=/* @__PURE__ */ Mt(Uo),Zo=/* @__PURE__ */ Nt(Uo),Qo=/* @__PURE__ */ Pt(Uo),$o=/* @__PURE__ */ Ft(Uo),es=/* @__PURE__ */ It(Uo),ts=/* @__PURE__ */ Lt(Uo);function ns(){st.localeError||ct(ki())}function rs(){st.memoizer||ct({memoizer:Ei()})}let X=/*@__PURE__*/ K(`ZodType`,(e,t)=>(ns(),q.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(U(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ve(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Cc(e,t))},superRefine(e,t){return this.check(wc(e,t))},overwrite(e){return this.check(/* @__PURE__ */ Da(e))},optional(){return ac(this)},exactOptional(){return sc(this)},nullable(){return lc(this)},nullish(){return ac(lc(this))},nonoptional(e){return hc(this,e)},array(){return Vs(this)},or(e){return Gs([this,e])},and(e){return Ys(this,e)},transform(e){return yc(this,rc(e))},default(e){return dc(this,e)},prefault(e){return pc(this,e)},catch(e){return _c(this,e)},pipe(e){return yc(this,e)},readonly(){return xc(this)},describe(e){let t=this.clone();return Ni.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ni.get(this);let t=this.clone();return Ni.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ke(this,`~standard`,{...zn(this),jsonSchema:{input:Za(this,`input`),output:Za(this,`output`)}})},set"~standard"(e){Ge(this,`~standard`,e)},parse:function e(t,n){return Wo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Go(this,t,n,{callee:e})},safeParse(e,t){return Ko(this,e,t)},async safeParseAsync(e,t){return qo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ge(this,`spa`,e)},validate(e,t){return Dt(this,e,t)},validateAsync(e,t){return kt(this,e,t)},encode:function e(t,n){return Jo(this,t,n,{callee:e})},decode:function e(t,n){return Yo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Xo(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Zo(this,t,n,{callee:e})},safeEncode(e,t){return Qo(this,e,t)},safeDecode(e,t){return $o(this,e,t)},async safeEncodeAsync(e,t){return es(this,e,t)},async safeDecodeAsync(e,t){return ts(this,e,t)},toJSONSchema(e){return Xa(this,{})(e)},get description(){return Ni.get(this)?.description},get _def(){return this._zod.def}}),is=/*@__PURE__*/ K(`_ZodString`,(e,t)=>{Bn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r)},/*@__PURE__*/ qe({format:e=>lo(e).format??null,minLength:e=>lo(e).minimum??null,maxLength:e=>lo(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ xa(...e))},includes(...e){return this.check(/* @__PURE__ */ wa(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Ta(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Ea(...e))},min(...e){return this.check(/* @__PURE__ */ ya(...e))},max(...e){return this.check(/* @__PURE__ */ va(...e))},length(...e){return this.check(/* @__PURE__ */ ba(...e))},nonempty(...e){return this.check(/* @__PURE__ */ ya(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Sa(e))},uppercase(e){return this.check(/* @__PURE__ */ Ca(e))},trim(){return this.check(/* @__PURE__ */ ka())},normalize(...e){return this.check(/* @__PURE__ */ Oa(...e))},toLowerCase(){return this.check(/* @__PURE__ */ Aa())},toUpperCase(){return this.check(/* @__PURE__ */ ja())},slugify(){return this.check(/* @__PURE__ */ Ma())}})),as=/*@__PURE__*/ K(`ZodString`,(e,t)=>{Bn.init(e,t),is.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Ii(ds,e))},url(e){return this.check(/* @__PURE__ */ Hi(ms,e))},jwt(e){return this.check(/* @__PURE__ */ ra(ks,e))},emoji(e){return this.check(/* @__PURE__ */ Ui(hs,e))},guid(e){return this.check(/* @__PURE__ */ Li(fs,e))},uuid(e){return this.check(/* @__PURE__ */ Ri(ps,e))},uuidv4(e){return this.check(/* @__PURE__ */ zi(ps,e))},uuidv6(e){return this.check(/* @__PURE__ */ Bi(ps,e))},uuidv7(e){return this.check(/* @__PURE__ */ Vi(ps,e))},nanoid(e){return this.check(/* @__PURE__ */ Wi(gs,e))},cuid(e){return this.check(/* @__PURE__ */ Gi(_s,e))},cuid2(e){return this.check(/* @__PURE__ */ Ki(vs,e))},ulid(e){return this.check(/* @__PURE__ */ qi(ys,e))},base64(e){return this.check(/* @__PURE__ */ ea(Es,e))},base64url(e){return this.check(/* @__PURE__ */ ta(Ds,e))},xid(e){return this.check(/* @__PURE__ */ Ji(bs,e))},ksuid(e){return this.check(/* @__PURE__ */ Yi(xs,e))},ipv4(e){return this.check(/* @__PURE__ */ Xi(Ss,e))},ipv6(e){return this.check(/* @__PURE__ */ Zi(Cs,e))},cidrv4(e){return this.check(/* @__PURE__ */ Qi(ws,e))},cidrv6(e){return this.check(/* @__PURE__ */ $i(Ts,e))},e164(e){return this.check(/* @__PURE__ */ na(Os,e))},datetime(e){return this.check(/* @__PURE__ */ ia(ss,e))},date(e){return this.check(/* @__PURE__ */ aa(cs,e))},time(e){return this.check(/* @__PURE__ */ oa(ls,e))},duration(e){return this.check(/* @__PURE__ */ sa(us,e))}});function os(e){return/* @__PURE__ */ Fi(as,e)}let Z=/*@__PURE__*/ K(`ZodStringFormat`,(e,t)=>{J.init(e,t),is.init(e,t)}),ss=/*@__PURE__*/ K(`ZodISODateTime`,(e,t)=>{ar.init(e,t),Z.init(e,t)}),cs=/*@__PURE__*/ K(`ZodISODate`,(e,t)=>{or.init(e,t),Z.init(e,t)}),ls=/*@__PURE__*/ K(`ZodISOTime`,(e,t)=>{sr.init(e,t),Z.init(e,t)}),us=/*@__PURE__*/ K(`ZodISODuration`,(e,t)=>{cr.init(e,t),Z.init(e,t)}),ds=/*@__PURE__*/ K(`ZodEmail`,(e,t)=>{Un.init(e,t),Z.init(e,t)}),fs=/*@__PURE__*/ K(`ZodGUID`,(e,t)=>{Vn.init(e,t),Z.init(e,t)}),ps=/*@__PURE__*/ K(`ZodUUID`,(e,t)=>{Hn.init(e,t),Z.init(e,t)}),ms=/*@__PURE__*/ K(`ZodURL`,(e,t)=>{Zn.init(e,t),Z.init(e,t)}),hs=/*@__PURE__*/ K(`ZodEmoji`,(e,t)=>{Qn.init(e,t),Z.init(e,t)}),gs=/*@__PURE__*/ K(`ZodNanoID`,(e,t)=>{$n.init(e,t),Z.init(e,t)}),_s=/*@__PURE__*/ K(`ZodCUID`,(e,t)=>{er.init(e,t),Z.init(e,t)}),vs=/*@__PURE__*/ K(`ZodCUID2`,(e,t)=>{tr.init(e,t),Z.init(e,t)}),ys=/*@__PURE__*/ K(`ZodULID`,(e,t)=>{nr.init(e,t),Z.init(e,t)}),bs=/*@__PURE__*/ K(`ZodXID`,(e,t)=>{rr.init(e,t),Z.init(e,t)}),xs=/*@__PURE__*/ K(`ZodKSUID`,(e,t)=>{ir.init(e,t),Z.init(e,t)}),Ss=/*@__PURE__*/ K(`ZodIPv4`,(e,t)=>{lr.init(e,t),Z.init(e,t)}),Cs=/*@__PURE__*/ K(`ZodIPv6`,(e,t)=>{fr.init(e,t),Z.init(e,t)}),ws=/*@__PURE__*/ K(`ZodCIDRv4`,(e,t)=>{pr.init(e,t),Z.init(e,t)}),Ts=/*@__PURE__*/ K(`ZodCIDRv6`,(e,t)=>{hr.init(e,t),Z.init(e,t)}),Es=/*@__PURE__*/ K(`ZodBase64`,(e,t)=>{vr.init(e,t),Z.init(e,t)}),Ds=/*@__PURE__*/ K(`ZodBase64URL`,(e,t)=>{xr.init(e,t),Z.init(e,t)}),Os=/*@__PURE__*/ K(`ZodE164`,(e,t)=>{Sr.init(e,t),Z.init(e,t)}),ks=/*@__PURE__*/ K(`ZodJWT`,(e,t)=>{wr.init(e,t),Z.init(e,t)}),As=/*@__PURE__*/ K(`ZodNumber`,(e,t)=>{Tr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ho(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ qe({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=lo(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=lo(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=lo(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>lo(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ ha(e,t))},gte(e,t){return this.check(/* @__PURE__ */ ga(e,t))},min(e,t){return this.check(/* @__PURE__ */ ga(e,t))},lt(e,t){return this.check(/* @__PURE__ */ pa(e,t))},lte(e,t){return this.check(/* @__PURE__ */ ma(e,t))},max(e,t){return this.check(/* @__PURE__ */ ma(e,t))},int(e){return this.check(Ns(e))},safe(e){return this.check(Ns(e))},positive(e){return this.check(/* @__PURE__ */ ha(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ ga(0,e))},negative(e){return this.check(/* @__PURE__ */ pa(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ ma(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ _a(e,t))},step(e,t){return this.check(/* @__PURE__ */ _a(e,t))},finite(){return this}}));function js(e){return/* @__PURE__ */ ca(As,e)}let Ms=/*@__PURE__*/ K(`ZodNumberFormat`,(e,t)=>{Er.init(e,t),As.init(e,t)});function Ns(e){return/* @__PURE__ */ la(Ms,e)}let Ps=/*@__PURE__*/ K(`ZodBoolean`,(e,t)=>{Dr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r)});function Fs(e){return/* @__PURE__ */ ua(Ps,e)}let Is=/*@__PURE__*/ K(`ZodUnknown`,(e,t)=>{Or.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ls(){return/* @__PURE__ */ da(Is)}let Rs=/*@__PURE__*/ K(`ZodNever`,(e,t)=>{kr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r)});function zs(e){return/* @__PURE__ */ fa(Rs,e)}let Bs=/*@__PURE__*/ K(`ZodArray`,(e,t)=>{rs(),Nr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ ya(e,t))},nonempty(e){return this.check(/* @__PURE__ */ ya(1,e))},max(e,t){return this.check(/* @__PURE__ */ va(e,t))},length(e,t){return this.check(/* @__PURE__ */ ba(e,t))},unwrap(){return this.element}});function Vs(e,t){return/* @__PURE__ */ Na(Bs,e,t)}let Hs=/*@__PURE__*/ K(`ZodObject`,(e,t)=>{rs(),zr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r),$e(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return $s(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(U(this._zod.def,{catchall:e}))},passthrough(){return this.clone(U(this._zod.def,{catchall:Ls()}))},loose(){return this.clone(U(this._zod.def,{catchall:Ls()}))},strict(){return this.clone(U(this._zod.def,{catchall:zs()}))},strip(){return this.clone(U(this._zod.def,{catchall:void 0}))},extend(e){return Ee(this,e)},safeExtend(e){return Oe(this,e)},merge(e){return ke(this,e)},pick(e){return Ce(this,e)},omit(e){return Te(this,e)},partial(...e){return Ae(ic,this,e[0])},exactPartial(...e){return Ae(oc,this,e[0],`exactPartial`)},required(...e){return je(mc,this,e[0])}});function Us(e,t){let n={type:`object`,shape:e??{},...W(t)};return new Hs(n)}let Ws=/*@__PURE__*/ K(`ZodUnion`,(e,t)=>{Vr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r),e.options=t.options});function Gs(e,t){return new Ws({type:`union`,options:e,...W(t)})}let Ks=/*@__PURE__*/ K(`ZodDiscriminatedUnion`,(e,t)=>{Ws.init(e,t),Ur.init(e,t)});function qs(e,t,n){return new Ks({type:`union`,options:t,discriminator:e,...W(n)})}let Js=/*@__PURE__*/ K(`ZodIntersection`,(e,t)=>{Wr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r)});function Ys(e,t){return new Js({type:`intersection`,left:e,right:t})}let Xs=/*@__PURE__*/ K(`ZodRecord`,(e,t)=>{rs(),qr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Zs(e,t,n){return!t||!t._zod?new Xs({type:`record`,keyType:os(),valueType:e,...W(t)}):new Xs({type:`record`,keyType:e,valueType:t,...W(n)})}let Qs=/*@__PURE__*/ K(`ZodEnum`,(e,t)=>{Jr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Qs({...t,checks:[],...W(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Qs({...t,checks:[],...W(r),entries:i})}});function $s(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Qs({type:`enum`,entries:n,...W(t)})}let ec=/*@__PURE__*/ K(`ZodLiteral`,(e,t)=>{Yr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function tc(e,t){return new ec({type:`literal`,values:Array.isArray(e)?e:[e],...W(t)})}let nc=/*@__PURE__*/ K(`ZodTransform`,(e,t)=>{rs(),Xr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ot(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ue(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ue(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function rc(e){return new nc({type:`transform`,transform:e})}let ic=/*@__PURE__*/ K(`ZodOptional`,(e,t)=>{Qr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ac(e){return new ic({type:`optional`,innerType:e})}let oc=/*@__PURE__*/ K(`ZodExactOptional`,(e,t)=>{$r.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sc(e){return new oc({type:`optional`,innerType:e})}let cc=/*@__PURE__*/ K(`ZodNullable`,(e,t)=>{ei.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lc(e){return new cc({type:`nullable`,innerType:e})}let uc=/*@__PURE__*/ K(`ZodDefault`,(e,t)=>{ti.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dc(e,t){return new uc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():he(t)}})}let fc=/*@__PURE__*/ K(`ZodPrefault`,(e,t)=>{ri.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pc(e,t){return new fc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():he(t)}})}let mc=/*@__PURE__*/ K(`ZodNonOptional`,(e,t)=>{ii.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hc(e,t){return new mc({type:`nonoptional`,innerType:e,...W(t)})}let gc=/*@__PURE__*/ K(`ZodCatch`,(e,t)=>{si.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function _c(e,t){return new gc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:et(t)})}let vc=/*@__PURE__*/ K(`ZodPipe`,(e,t)=>{ci.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.in=t.in,e.out=t.out});function yc(e,t){return new vc({type:`pipe`,in:e,out:t})}let bc=/*@__PURE__*/ K(`ZodReadonly`,(e,t)=>{ui.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xc(e){return new bc({type:`readonly`,innerType:e})}let Sc=/*@__PURE__*/ K(`ZodCustom`,(e,t)=>{fi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r)});function Cc(e,t={}){return/* @__PURE__ */ Pa(Sc,e,t)}function wc(e,t){return/* @__PURE__ */ Fa(e,t)}let Tc=`dsh.sidebar-right.v1`,Ec=os().regex(/^(?:pane|float)[1-9][0-9]*$/u),Dc=os().regex(/^split[1-9][0-9]*$/u),Oc=os().regex(/^tab[1-9][0-9]*$/u),kc=Gs([Ec,Dc]),Ac=Us({x:js(),y:js(),width:js().positive(),height:js().positive()}),jc=Us({layout:Us({nodes:Zs(kc,qs(`kind`,[Us({kind:tc(`pane`),id:Ec,host:$s([`dock`,`float`]),tabs:Vs(Oc),activeTabId:Oc.optional(),rect:Ac.optional()}),Us({kind:tc(`split`),id:Dc,axis:$s([`row`,`column`]),children:Vs(kc).min(2),sizes:Vs(js().positive()).min(2)})])),tabs:Zs(Oc,Us({id:Oc,kind:os().min(1),contentId:os().min(1),title:os()})),rootId:kc,floats:Vs(Ec),activePaneId:Ec,expanded:Fs(),mode:$s([`push`,`fullscreen`])}),minted:Ns().nonnegative()}),Mc=Us({bySession:Zs(os(),Ls())});function Nc(e){let{layout:t,minted:n}=e,r=()=>{throw Error(`Invalid saved sidebar layout references`)},i=/* @__PURE__ */ new Set,a=/* @__PURE__ */ new Set,o=[{id:t.rootId,host:`dock`},...t.floats.map(e=>({id:e,host:`float`}))];for(let[e,i]of[...Object.entries(t.nodes),...Object.entries(t.tabs)])(i.id!==e||Number(e.replace(/^[a-z]+/u,``))>n)&&r();for(let{id:e,host:n}of o){let s=t.nodes[e];if((i.has(e)||s===void 0)&&r(),i.add(e),s.kind===`split`)(n!==`dock`||e!==t.rootId||s.axis!==`row`||s.children.length!==2||s.children.length!==s.sizes.length||Math.abs(s.sizes.reduce((e,t)=>e+t,0)-1)>1e-9)&&r(),o.push(...s.children.map(e=>({id:e,host:n})));else{(s.host!==n||(n===`float`?s.rect===void 0||s.tabs.length!==1:s.rect!==void 0))&&r(),(s.tabs.length===0?s.activeTabId!==void 0:!s.tabs.includes(s.activeTabId??``))&&r();for(let e of s.tabs)(a.has(e)||t.tabs[e]===void 0)&&r(),a.add(e)}}(i.size!==Object.keys(t.nodes).length||a.size!==Object.keys(t.tabs).length||t.nodes[t.activePaneId]?.kind!==`pane`)&&r()}function Pc(e){if(typeof localStorage>`u`)return;let t;try{t=localStorage.getItem(`${Tc}.${e}`)}catch{return}if(t!==null)try{let n=Mc.parse(JSON.parse(t)).bySession[e];if(n===void 0)return;let r=jc.parse(n);return Nc(r),{layout:r.layout,minted:r.minted,history:h.EMPTY_HISTORY}}catch{Ic(e);return}}function Fc(e,t){if(typeof localStorage>`u`)return;let n={bySession:{[e]:{layout:t.layout,minted:t.minted}}};try{localStorage.setItem(`${Tc}.${e}`,JSON.stringify(n))}catch(e){console.error(`Sidebar layout persistence failed:`,e)}}function Ic(e){if(typeof localStorage<`u`)try{localStorage.removeItem(`${Tc}.${e}`)}catch{}}function Lc(e,t){let n=e.layout.tabs[t];return n!==void 0&&!(n.kind===`guide`&&Uc(e.layout,t))}function Rc(e,t){let n=t();return{id:e,kind:n.kind,title:n.title,contentId:A(n.kind)}}function zc(e){let t=e;return{mint:(e=>(t+=1,`${e}${t}`)),used:()=>t}}function Bc(){let e=zc(0);return{layout:(0,h.createInitialState)({next:e.mint}),history:h.EMPTY_HISTORY,minted:e.used()}}function Vc(e,t,n){return(0,h.findPaneContentTab)(e,t,A(n),n)}function Hc(e,t){let n=e.tabs[t];return n!==void 0&&n.contentId===A(n.kind)?n.kind:void 0}function Uc(e,t){let n=(0,h.findTabPane)(e,t);return n.host===`dock`&&n.tabs.length===1&&(0,h.dockPaneIds)(e).length===1}function Wc(e,t){let n=(0,h.findTabPane)(e,t);return n.activeTabId===t&&e.activePaneId===n.id?[]:[{type:`focusTab`,tabId:t}]}function Gc(e,t){return e.activePaneId===t?[]:[{type:`focusPane`,paneId:t}]}function Kc(e,t,n,r){let i=Hc(e,t);if(i===void 0)return r();let a=Vc(e,n,i);return a===void 0||a===t?r():[{type:`closeTab`,tabId:t},{type:`focusTab`,tabId:a}]}function Q(e,t,n){let r=zc(e.minted),i=e=>Rc(e,n),a=t(e.layout,r.mint,i);if(a.length===0)return e;let o=(0,h.replay)(e.layout,a),s=(0,h.planSettle)(o,r.mint,o.expanded?i:void 0),c=(0,h.record)(e.history,e.layout,[...a,...s]);return{layout:c.state,history:c.history,minted:r.used()}}function $(e,t,n){let r=e.bySession[t],i=n(r??Bc());return i===r?e.bySession:{...e.bySession,[t]:i}}function qc(e,t){let n=t(e.history,e.layout);return n===void 0?e:{...e,layout:n.state,history:n.history}}function Jc(e){let t=(0,g.defineStore)({init:()=>({bySession:{}}),actions:{open:(e,t)=>{e.bySession=$(e,t,e=>e)},setExpanded:(t,n,r)=>{t.bySession=$(t,n,t=>Q(t,e=>(0,h.planSetExpanded)(e,r),e))},toggleExpanded:(t,n)=>{t.bySession=$(t,n,t=>Q(t,e=>(0,h.planSetExpanded)(e,!e.expanded),e))},setMode:(t,n,r)=>{t.bySession=$(t,n,t=>Q(t,e=>(0,h.planSetMode)(e,r),e))},splitPane:(t,n,r,i)=>{t.bySession=$(t,n,t=>{let n=Q(t,(e,t,n)=>(0,h.dockPaneIds)(e).length>=2||(0,h.getPane)(e,r??(0,h.activeDockPaneId)(e)).tabs.length===0?[]:(0,h.planSplitPane)(e,t,r,n),e);if(i!==void 0&&n!==t){let e=new Set((0,h.dockPaneIds)(t.layout));for(let t of(0,h.dockPaneIds)(n.layout))e.has(t)||i(t)}return n})},openContent:(t,n,r,i)=>{t.bySession=$(t,n,t=>Q(t,(e,t)=>{let{kind:n,contentId:a,title:o,replaceTab:s}=r,c=[...(0,h.planSetExpanded)(e,!0)],l=s===void 0?void 0:(0,h.findTabPane)(e,s),u=s!==void 0&&l!==void 0&&l.host===`dock`?l:void 0,d=u?.id??r.paneId,f=u===void 0||s===void 0?void 0:u.tabs.indexOf(s),p=a===A(n),m=p?Vc(e,d??(0,h.activeDockPaneId)(e),n):void 0,g=p?m:r.revealIfOpened===!1?void 0:(0,h.findContentTab)(e,a,n),_,v=r.preferNewPane===!0&&s===void 0&&g===void 0?(0,h.planSplitPane)(e,t,d,e=>(_=e,{id:e,kind:n,contentId:a,title:o})):[],y=g===void 0?_===void 0?(0,h.planOpenContent)(e,t,{kind:n,contentId:a,title:o,...d===void 0?{}:{paneId:d},...f===void 0?{}:{index:f},...p?{revealIfOpened:!1}:r.revealIfOpened===void 0?{}:{revealIfOpened:r.revealIfOpened}}):{ops:v,tabId:_}:{ops:[{type:`focusTab`,tabId:g}],tabId:g};return c.push(...y.ops),s!==void 0&&s!==y.tabId&&c.push({type:`closeTab`,tabId:s}),i(y.tabId),c},e))},duplicateTab:(t,n,r)=>{t.bySession=$(t,n,t=>Q(t,(e,t)=>Hc(e,r)===void 0?(0,h.planDuplicateTab)(e,t,r).ops:[],e))},closeTab:(t,n,r)=>{t.bySession=$(t,n,t=>Q(t,e=>Lc(t,r)?Uc(e,r)?[{type:`closeTab`,tabId:r},...(0,h.planSetMode)(e,`push`),...(0,h.planSetExpanded)(e,!1)]:[{type:`closeTab`,tabId:r}]:[],e))},focusTab:(t,n,r)=>{t.bySession=$(t,n,t=>Q(t,e=>Wc(e,r),e))},focusPane:(t,n,r)=>{t.bySession=$(t,n,t=>Q(t,e=>Gc(e,r),e))},placeTab:(t,n,r,i,a)=>{t.bySession=$(t,n,t=>Q(t,e=>Kc(e,r,i,()=>(0,h.planPlaceTab)(e,r,i,a)),e))},dropTab:(t,n,r,i,a)=>{t.bySession=$(t,n,t=>Q(t,(e,t,n)=>{if(a===`top`||a===`bottom`||a!==`center`&&(0,h.dockPaneIds)(e).length>=2)return[];let o=()=>(0,h.planDropTab)(e,t,r,i,a,n);return a===`center`?Kc(e,r,i,o):o()},e))},floatTab:(t,n,r,i)=>{t.bySession=$(t,n,t=>Q(t,(e,t)=>(0,h.planFloatTab)(e,t,r,i).ops,e))},unfloatPane:(t,n,r)=>{t.bySession=$(t,n,t=>Q(t,e=>{let t=(0,h.getPane)(e,r).tabs[0],n=()=>(0,h.planUnfloatPane)(e,r);
112
112
  /* v8 ignore next -- a floating pane holds exactly one tab. */
113
- return t===void 0?n():Kc(e,t,(0,h.activeDockPaneId)(e),n)},e))},moveFloat:(t,n,r,i,a)=>{t.bySession=$(t,n,t=>Q(t,()=>[{type:`moveFloat`,paneId:r,x:i,y:a}],e))},resizeFloat:(t,n,r,i)=>{t.bySession=$(t,n,t=>Q(t,()=>[{type:`resizeFloat`,paneId:r,rect:i}],e))},resizeSplit:(t,n,r,i)=>{t.bySession=$(t,n,t=>Q(t,()=>(0,h.planResizeSplit)(r,i,.2),e))},undo:(e,t)=>{e.bySession=$(e,t,e=>qc(e,h.stepBack))},redo:(e,t)=>{e.bySession=$(e,t,e=>qc(e,h.stepForward))}}});return{...t,create(e){let n=t.create(e);if(e===void 0)return n;let r=Pc(e);return r!==void 0&&n.store.set({bySession:{[e]:r}}),n.subscribe(()=>{let t=n.getSnapshot().bySession[e];t!==void 0&&Fc(e,t)}),{...n,clearPersisted:()=>{Ic(e)}}}}}let Yc=`@deepseek-ai/dsh-client-ui-sidebar-right/SidebarRight.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Yc)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-sidebar-right`,e.dataset.pluginCss=Yc,e.textContent=`.qJjNiG_session{display:contents}.qJjNiG_session[hidden]{display:none}.qJjNiG_panel{--dsh-dockkit-dock-layer:10;--dsh-dockkit-float-layer:60;pointer-events:none;flex-direction:column;min-width:0;display:flex;position:absolute;top:0;bottom:0;right:0}.qJjNiG_panel [data-dockkit-host=dock],.qJjNiG_panel [data-dockkit-empty],.qJjNiG_panel [data-dockkit-divider]{transform:translateX(var(--dsh-sidebar-width));visibility:hidden;transition:transform var(--ds-transition-duration-slow) var(--ds-ease-in-out), visibility 0s linear var(--ds-transition-duration-slow)}.qJjNiG_panel[data-sidebar-right-open] [data-dockkit-host=dock],.qJjNiG_panel[data-sidebar-right-open] [data-dockkit-empty],.qJjNiG_panel[data-sidebar-right-open] [data-dockkit-divider]{visibility:visible;transition:transform var(--ds-transition-duration-slow) var(--ds-ease-in-out);transform:none}@starting-style{.qJjNiG_panel[data-sidebar-right-opening] [data-dockkit-host=dock],.qJjNiG_panel[data-sidebar-right-opening] [data-dockkit-empty],.qJjNiG_panel[data-sidebar-right-opening] [data-dockkit-divider]{transform:translateX(var(--dsh-sidebar-width))}}.qJjNiG_panel[data-sidebar-right-phone-motion] [data-dockkit-host=dock],.qJjNiG_panel[data-sidebar-right-phone-motion] [data-dockkit-empty],.qJjNiG_panel[data-sidebar-right-phone-motion] [data-dockkit-divider]{transform:translateX(var(--dsh-rightbar-phone-x));visibility:var(--dsh-rightbar-phone-visibility);transition:none}.qJjNiG_panel[data-sidebar-right-phone-motion] [data-dockkit-host=dock],.qJjNiG_panel[data-sidebar-right-phone-motion] [data-dockkit-empty]{pointer-events:auto}.qJjNiG_panel[data-sidebar-right-panel=fullscreen]{--dsh-dockkit-dock-layer:40}[data-windows-titlebar] .qJjNiG_panel[data-sidebar-right-panel=fullscreen]{max-width:calc(100vw - var(--dsh-windows-sidebar-width))}[data-windows-titlebar] .qJjNiG_panel[data-sidebar-right-panel=fullscreen] [data-dockkit-column="0"][data-dockkit-pane]{border-radius:var(--dsh-windows-content-radius) 0 0 0;corner-shape:round}[data-platform=darwin] .qJjNiG_panel[data-sidebar-right-panel=fullscreen] [data-dockkit-host=dock][data-dockkit-column="0"]{--dsh-dockkit-strip-inline-start:88px}[data-platform=darwin] .qJjNiG_panel[data-sidebar-right-panel=fullscreen] [data-dockkit-host=dock][data-dockkit-column="1"]{--dsh-dockkit-strip-inline-start:10px}[data-platform=darwin][data-fullscreen] .qJjNiG_panel[data-sidebar-right-panel=fullscreen] [data-dockkit-host=dock][data-dockkit-column="0"]{--dsh-dockkit-strip-inline-start:10px}@media (prefers-reduced-motion:reduce){.qJjNiG_panel [data-dockkit-host=dock],.qJjNiG_panel [data-dockkit-empty],.qJjNiG_panel [data-dockkit-divider],.qJjNiG_panel[data-sidebar-right-open] [data-dockkit-host=dock],.qJjNiG_panel[data-sidebar-right-open] [data-dockkit-empty],.qJjNiG_panel[data-sidebar-right-open] [data-dockkit-divider]{transition:none}}.qJjNiG_iconButton{width:28px;height:28px;color:var(--dsw-alias-label-secondary);border-radius:var(--dsw-radius-sm);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:6px;line-height:1;display:inline-flex}.qJjNiG_iconButton svg{width:15px;height:15px}@media (hover:hover){.qJjNiG_iconButton:hover{background:var(--dsw-alias-interactive-bg-hover)}}.qJjNiG_collapseGlyph{transform:scaleX(-1)}.qJjNiG_panelBody{flex:auto;min-height:0;display:flex}@media (pointer:coarse){.qJjNiG_panelBody [data-dockkit-split-control]:has(>[data-dockkit-split-blocked]){visibility:hidden}}.qJjNiG_unavailable{color:var(--dsw-alias-label-tertiary);font-size:var(--dsh-content-font-size-secondary,13px);margin:0;padding:12px}.qJjNiG_tabTitle{display:contents}.qJjNiG_tabBody{flex-direction:column;min-width:0;height:100%;min-height:0;display:flex;overflow:hidden}`,document.head.appendChild(e)}var Xc={collapseGlyph:`qJjNiG_collapseGlyph`,iconButton:`qJjNiG_iconButton`,panel:`qJjNiG_panel`,panelBody:`qJjNiG_panelBody`,session:`qJjNiG_session`,tabBody:`qJjNiG_tabBody`,tabTitle:`qJjNiG_tabTitle`,unavailable:`qJjNiG_unavailable`};function Zc(e,t){return(0,h.findPaneContentTab)(e,t,A(ie),ie)}function Qc(e,t,n,r,i){return{focusTab:n=>{t.focusTab(e,n)},focusPane:n=>{t.focusPane(e,n)},splitPane:i??(n=>{t.splitPane(e,n)}),addTab:e=>{n(ie,{paneId:e,revealIfOpened:!1})},closeTab:r??(n=>{t.closeTab(e,n)}),duplicateTab:n=>{t.duplicateTab(e,n)},floatTab:(n,r)=>{t.floatTab(e,n,r)},unfloatPane:n=>{t.unfloatPane(e,n)},placeTab:(n,r,i)=>{t.placeTab(e,n,r,i)},dropTab:(n,r,i)=>{t.dropTab(e,n,r,i)},moveFloat:(n,r,i)=>{t.moveFloat(e,n,r,i)},resizeFloat:(n,r)=>{t.resizeFloat(e,n,r)},resizeSplit:(n,r)=>{t.resizeSplit(e,n,r)}}}function $c({renderSlot:e,occurrence:t,useTabTypes:n,useTabNavigation:r,useStore:i,fullscreen:a,shortcuts:o,active:s,retainTab:c,tab:l,seat:u,fallback:d}){let{id:f,signal:h,tabActions:g}=t(l),_=n(e=>e.find(e=>e.kind===l.kind)),v=u===`sidebar.right.pane.tab`&&_?.keepMounted===!0;(0,m.useLayoutEffect)(()=>v?c(l.id,h):void 0,[v,c,l.id,h]);let y=(0,m.useMemo)(()=>({tabId:l.id,shortcuts:o,title:u===`sidebar.right.pane.tab.title`,fullscreen:a,active:s,signal:h,actions:g,useStore:i,useTabNavigation:r}),[l.id,u,a,s,h,g,i,r,o]),b=e(u,{},{entryKey:_?.id??l.kind,fallback:d,hookContext:y});return u===`sidebar.right.pane.tab.title`?/* @__PURE__ */ (0,p.jsx)(`span`,{className:Xc.tabTitle,"data-sidebar-right-tab":l.id,"data-sidebar-right-occurrence":f,children:b},f):/* @__PURE__ */ (0,p.jsx)(`div`,{className:Xc.tabBody,"data-sidebar-right-tab":l.id,"data-sidebar-right-occurrence":f,children:b},f)}function el(e){let{t,...n}=e;return e=>/* @__PURE__ */ (0,p.jsx)($c,{...n,tab:e,seat:`sidebar.right.pane.tab`,fallback:/* @__PURE__ */ (0,p.jsx)(`p`,{className:Xc.unavailable,"data-sidebar-right-unavailable":!0,children:t(`tab.unavailable`)})},e.id)}function tl(e){return t=>/* @__PURE__ */ (0,p.jsx)($c,{...e,tab:t,seat:`sidebar.right.pane.tab.title`,fallback:t.title},t.id)}function nl(){return/* @__PURE__ */ (0,p.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M2.33203 10.4054V13.1681C2.33229 13.444 2.55605 13.6681 2.83203 13.6681H5.49512V14.6681H2.83203C2.00376 14.6681 1.33229 13.9963 1.33203 13.1681V10.4054H2.33203ZM14.6689 13.1681C14.6687 13.996 13.9968 14.6676 13.1689 14.6681H10.4951V13.6681H13.1689C13.4445 13.6676 13.6687 13.4437 13.6689 13.1681V10.4054H14.6689V13.1681ZM13.1689 1.33118C13.9969 1.33163 14.6688 2.00315 14.6689 2.83118V5.4054H13.6689V2.83118C13.6688 2.55544 13.4446 2.33162 13.1689 2.33118H10.4951V1.33118H13.1689ZM5.49512 2.33118H2.83203C2.55598 2.33118 2.33218 2.55516 2.33203 2.83118V5.4054H1.33203V2.83118C1.33218 2.00288 2.00369 1.33118 2.83203 1.33118H5.49512V2.33118Z`,fill:`currentColor`})})}function rl(){return/* @__PURE__ */ (0,p.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M9 2.5V6C9 6.26522 9.10536 6.51957 9.29289 6.70711C9.48043 6.89464 9.73478 7 10 7H13.5`,stroke:`currentColor`}),/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M7 13.5V10C7 9.73478 6.89464 9.48043 6.70711 9.29289C6.51957 9.10536 6.26522 9 6 9H2.5`,stroke:`currentColor`})]})}function il({sessionId:e,fullscreen:t,actions:n,t:r,shortcuts:i,toggleFullscreen:a}){let o=t?`push`:`fullscreen`,s=r(t?`chrome.exitFullscreen`:`chrome.toFullscreen`),c=i.find(e=>e.id===`pane.fullscreen.toggle`),l=i.find(e=>e.id===`sidebar.right.toggle`);return/* @__PURE__ */ (0,p.jsxs)(p.Fragment,{children:[/* @__PURE__ */ (0,p.jsx)(f.Tooltip,{label:s,shortcutKeys:c?.keys,side:`bottom`,delayMs:500,children:/* @__PURE__ */ (0,p.jsx)(`button`,{type:`button`,className:Xc.iconButton,"aria-label":s,"aria-keyshortcuts":c?.aria,"data-sidebar-right-mode":o,onClick:a,children:t?/* @__PURE__ */ (0,p.jsx)(rl,{}):/* @__PURE__ */ (0,p.jsx)(nl,{})})}),/* @__PURE__ */ (0,p.jsx)(f.Tooltip,{label:r(`chrome.collapse`),shortcutKeys:l?.keys,side:`bottom`,delayMs:500,children:/* @__PURE__ */ (0,p.jsx)(`button`,{type:`button`,className:Xc.iconButton,"aria-label":r(`chrome.collapseAria`),"aria-keyshortcuts":l?.aria,"data-sidebar-right-toggle":!0,onClick:()=>{n.toggleExpanded(e)},children:/* @__PURE__ */ (0,p.jsx)(f.IconPanelLeftOutlineRegular,{className:Xc.collapseGlyph})})})]})}function al(e){let{sessionId:t,surface:n,actions:r,t:i,renderSlot:a,openTab:o,width:s,reportRoom:c,fullscreen:l,panelRef:u}=e,{expanded:d}=n.layout,f=(0,m.useRef)(d),g=d&&!f.current;(0,m.useLayoutEffect)(()=>{f.current=d},[d]);let _=e.useTabTypes(e=>e);return/* @__PURE__ */ (0,p.jsx)(`div`,{ref:u,className:Xc.panel,style:{width:l?`100vw`:s,"--dsh-sidebar-width":l?`100vw`:`${s}px`},"data-sidebar-right-session":t,"data-sidebar-right-panel":l?`fullscreen`:`push`,"data-sidebar-right-open":d||void 0,"data-sidebar-right-opening":g||void 0,"aria-hidden":!d&&n.layout.floats.length===0||void 0,children:/* @__PURE__ */ (0,p.jsx)(`div`,{className:Xc.panelBody,children:/* @__PURE__ */ (0,p.jsx)(h.DockLayout,{state:n.layout,canSplit:(0,h.canSplit)(n.layout)&&(0,h.dockPaneIds)(n.layout).length<2,dropZones:`horizontal`,minPaneFraction:.2,canAddTab:e=>Zc(n.layout,e)===void 0,canCloseTab:e=>Lc(n,e),intents:Qc(t,r,o,e.closeTab,e.splitPane),labels:j(i,e.shortcuts.find(e=>e.id===`pane.split`),e.shortcuts.find(e=>e.id===`page.close`)),renderTab:el(e),renderTabTitle:tl(e),active:e.active,keepMounted:e=>_.find(t=>t.kind===e.kind)?.keepMounted===!0,renderTabMenuItems:(e,t)=>a(`sidebar.right.tab.menu.item`,{tab:e,dismiss:t}),chrome:/* @__PURE__ */ (0,p.jsx)(il,{sessionId:t,fullscreen:l,actions:r,t:i,shortcuts:e.shortcuts,toggleFullscreen:e.toggleFullscreen}),onRoom:c})})})}function ol({sessionId:e,width:t,viewportWidth:n,canShow:r,bindSwipeNavigation:i,setExpandedFromSwipe:a,useStore:o,actions:s,t:c,renderSlot:l,syncPresentation:u,measureRoom:d,reportAutoFullscreen:f,openTab:h,closeTab:g,useTabTypes:_,useTabNavigation:v,occurrence:y,retainTab:b,active:x,useShortcuts:S,splitPane:C,toggleFullscreen:w}){let ee=S(e=>e),T=o(t=>t.bySession[e]),E=x&&T!==void 0&&T.layout.expanded,D=n<768,O=D||T?.layout.mode===`fullscreen`,te=(0,m.useRef)(null),ne=(0,m.useRef)(null),k=T?.layout.expanded??!1,re=(0,m.useRef)(k);re.current=k;let ie=T!==void 0;(0,m.useLayoutEffect)(()=>{let e=te.current;if(!x||!ie||e===null)return;let t=i({element:e,expanded:re.current,onExpandedChange:a,paint:(t,n)=>{t===null?(e.removeAttribute(`data-sidebar-right-phone-motion`),e.style.removeProperty(`--dsh-rightbar-phone-x`),e.style.removeProperty(`--dsh-rightbar-phone-visibility`)):(e.style.setProperty(`--dsh-rightbar-phone-x`,`${t}px`),e.style.setProperty(`--dsh-rightbar-phone-visibility`,n?`visible`:`hidden`),e.setAttribute(`data-sidebar-right-phone-motion`,``));for(let n of e.querySelectorAll(`[data-dockkit-empty] > *`))n.inert=t!==null&&!re.current}});return ne.current=t,()=>{ne.current=null,t.dispose()}},[x,ie,i,a]),(0,m.useLayoutEffect)(()=>{ne.current?.setExpanded(k)},[k]);let A=(0,m.useCallback)(e=>{d(t=>e.get(t)?.row!==!1)},[d]),j=E&&!D;return(0,m.useEffect)(()=>{x&&T===void 0&&s.open(e)},[s,e,T,x]),(0,m.useLayoutEffect)(()=>{E&&!O&&!r&&s.setExpanded(e,!1)},[s,e,E,O,r]),(0,m.useLayoutEffect)(()=>{f(D)},[f,D]),(0,m.useLayoutEffect)(()=>{if(!x)return;let e=!1,t=()=>{if(e)return;let n=E&&O?te.current.getAnimations({subtree:!0}).filter(e=>`transitionProperty`in e&&e.transitionProperty===`transform`&&e.playState!==`finished`&&e.playState!==`idle`):[];n.length===0?u({shown:E,track:j,fullscreen:O}):Promise.allSettled(n.map(e=>e.finished)).then(t)};return t(),()=>{e=!0}},[e,E,j,O,u,x]),(0,m.useLayoutEffect)(()=>x?()=>{u({shown:!1,track:!1,fullscreen:!1})}:void 0,[u,x]),T===void 0?null:/* @__PURE__ */ (0,p.jsx)(al,{sessionId:e,actions:s,t:c,renderSlot:l,surface:T,openTab:h,closeTab:g,useTabTypes:_,useTabNavigation:v,useStore:o,occurrence:y,fullscreen:O,autoFullscreen:D,reportRoom:A,active:x,retainTab:b,shortcuts:ee,splitPane:C,toggleFullscreen:w,width:t,panelRef:te})}function sl(e,t,n){let r;(0,_.flushSync)(()=>{r=n()}),r!==void 0&&y(e,t,r)?.focus({preventScroll:!0})}function cl(e,t,n,r){let i=e.activeElement,a=i?.closest(`[data-sidebar-right-session]`),o=i?.closest(`[data-dockkit-pane], [data-dockkit-float]`),s=a?.dataset.sidebarRightSession===t&&(o?.dataset.dockkitPane??o?.dataset.dockkitFloat)===n;(0,_.flushSync)(r),!(!s||e.activeElement!==e.body&&e.activeElement!==i)&&y(e,t,n)?.focus({preventScroll:!0})}function ll({view:e,visible:t,SessionProvider:n,renderSlot:r,mountView:i,width:a,viewportWidth:o,bindSwipeNavigation:s,setExpandedFromSwipe:c,canShow:l}){(0,m.useLayoutEffect)(()=>i(e.reference),[i,e.reference]);let u=t&&e.selected,d=(0,m.useCallback)(t=>c(e.sessionId,t),[c,e.sessionId]);return/* @__PURE__ */ (0,p.jsx)(`div`,{className:Xc.session,hidden:!u,"data-sidebar-right-session":e.sessionId,children:/* @__PURE__ */ (0,p.jsx)(n,{session:e.reference,children:r(`rightbar.session`,{width:a,viewportWidth:o,bindSwipeNavigation:s,setExpandedFromSwipe:d,canShow:l,active:u,retainTab:e.retainTab})})})}function ul({usePanelInfo:e,useViews:t,...n}){let r=e(e=>e.activePanelId===null),i=t(e=>e);return/* @__PURE__ */ (0,p.jsx)(p.Fragment,{children:i.map(e=>/* @__PURE__ */ (0,p.jsx)(ll,{...n,view:e,visible:r},e.sessionId))})}var dl=class{sessionId;onDispose;onTabRelease;reference;tabs=/* @__PURE__ */ new Map;mounts=0;retired=!1;disposed=!1;constructor(e,t,n,r){this.sessionId=e,this.onDispose=n,this.onTabRelease=r,this.reference=t.retain(e,{source:`sidebarView`}),this.reference.ready.catch(e=>{console.error(`Sidebar Session opening failed:`,e)})}get hasRetainedTabs(){return this.tabs.size>0}mount(){return this.mounts+=1,()=>{--this.mounts,this.retired&&this.mounts===0&&this.dispose()}}retainTab=(e,t)=>{if(t.aborted||this.disposed)return()=>{};this.tabs.set(e,(this.tabs.get(e)??0)+1);let n=!0,r=()=>{if(!n)return;n=!1,t.removeEventListener(`abort`,r);let i=this.tabs.get(e);i===1?this.tabs.delete(e):this.tabs.set(e,i-1),this.onTabRelease(this)};return t.addEventListener(`abort`,r,{once:!0}),r};retire(){this.retired=!0,this.mounts===0&&this.dispose()}dispose(){this.disposed||(this.disposed=!0,this.retired=!0,this.onDispose(this),this.reference.release())}},fl=class{sessions;source=(0,g.createSnapshotStore)([]);views=/* @__PURE__ */ new Map;viewsByReference=/* @__PURE__ */ new Map;selected;closed=!1;constructor(e){this.sessions=e}select(e){if(!(this.closed||this.selected===e)){if(this.selected=e,e!==void 0&&!this.views.has(e)){let t=new dl(e,this.sessions,e=>{this.viewsByReference.delete(e.reference)},e=>{this.prune(e)});this.views.set(e,t),this.viewsByReference.set(t.reference,t)}for(let e of this.views.values())this.prune(e);this.publish()}}mount(e){let t=this.viewsByReference.get(e);if(t===void 0){if(this.closed)return()=>{};throw Error(`Sidebar Session view reference is no longer owned`)}return t.mount()}dispose(){this.closed=!0,this.views.clear(),this.source.set([]);for(let e of this.viewsByReference.values())e.dispose()}prune(e){e.sessionId===this.selected||e.hasRetainedTabs||this.views.get(e.sessionId)!==e||(this.views.delete(e.sessionId),this.publish(),e.retire())}publish(){this.source.set([...this.views.values()].sort((e,t)=>e.sessionId.localeCompare(t.sessionId)).map(e=>({sessionId:e.sessionId,reference:e.reference,selected:e.sessionId===this.selected,retainTab:e.retainTab})))}};function pl(){let e=globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16)),t=Array.from(e,(e,t)=>(t===6?e&15|64:t===8?e&63|128:e).toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}var ml=class{navigator;pin;bySession=/* @__PURE__ */ new Map;constructor(e,t){this.navigator=e,this.pin=t}sync(e,t){let n=this.session(e);for(let[e,r]of n)t.tabs[e]===void 0&&(n.delete(e),r.controller.abort());for(let r of Object.values(t.tabs)){let i=n.get(r.id)??this.hold(e,r.id,{address:r.contentId,params:void 0,revision:0}),a=(0,h.findTabPane)(t,r.id);i.paneId=a.host===`dock`?a.id:void 0,!i.pinned&&(i.pinned=!0,this.pin(i.navigation.getSnapshot().address,i.signal))}}occurrence(e,t){let n=this.bySession.get(e)?.get(t.id);if(n===void 0)throw Error(`sidebarRight: tab "${t.id}" has no committed occurrence in session "${e}"`);return n}navigate(e,t,n){let r=this.session(e).get(t);r===void 0?this.hold(e,t,{...n,revision:1}):r.navigation.set({...n,revision:r.navigation.getSnapshot().revision+1})}dispose(){for(let e of this.bySession.values())for(let t of e.values())t.controller.abort();this.bySession.clear()}session(e){let t=this.bySession.get(e);return t===void 0&&(t=/* @__PURE__ */ new Map,this.bySession.set(e,t)),t}hold(e,t,n){let r=new AbortController,{navigator:i}=this,a=e=>({...e.replaceTab===!0?{replaceTab:t}:o.paneId===void 0?{}:{paneId:o.paneId},...e.paneId===void 0?{}:{paneId:e.paneId},...e.preferNewPane===void 0?{}:{preferNewPane:e.preferNewPane},...e.revealIfOpened===void 0?{}:{revealIfOpened:e.revealIfOpened}}),o={id:pl(),sessionId:e,tabId:t,controller:r,commands:{},signal:r.signal,navigation:(0,g.createSnapshotStore)(n),paneId:void 0,pinned:!1,tabActions:{bindCommands:e=>{if(r.signal.aborted)return()=>{};o.commands=e;let t=()=>{o.commands===e&&(o.commands={}),r.signal.removeEventListener(`abort`,t)};return r.signal.addEventListener(`abort`,t,{once:!0}),t},openResource:(t,n={})=>{i.openResourceIn(e,t,{...a(n),params:n.params})},openTab:(t,n={})=>{i.openTabIn(e,t,{...a(n),params:n.params})},close:()=>{i.closeIn(e,t)}}};return this.session(e).set(t,o),o}},hl=class{sessions=/* @__PURE__ */ new Map;snapshot=(0,g.createSnapshotStore)([]);source=this.snapshot;constructor(){try{if(typeof localStorage>`u`)return;let e=Array.from({length:localStorage.length},(e,t)=>localStorage.key(t));for(let t of e){if(t===null||!t.startsWith(`dsh.sidebar-right.v1.`))continue;let e=t.slice(21),n=Pc(e);n!==void 0&&this.sessions.set(e,Object.values(n.layout.tabs).map(t=>({sessionId:e,tabId:t.id,kind:t.kind,contentId:t.contentId})))}this.publish()}catch{}}update(e,t){this.sessions.set(e,t.map(t=>({sessionId:e,tabId:t.id,kind:t.kind,contentId:t.contentId}))),this.publish()}remove(e){this.sessions.delete(e),this.publish()}publish(){let e=[...this.sessions.values()].flat();JSON.stringify(e)!==JSON.stringify(this.snapshot.getSnapshot())&&this.snapshot.set(e)}};function gl(e,t,n){let r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=(0,g.createSnapshotStore)(void 0),o=new hl,s=new _l(e,t,n,{adopted:r,rooms:i,onScreen:a,openTabs:o.source});return{controller:s,forget:e=>{o.remove(e),i.delete(e)},show:e=>{a.getSnapshot()!==e&&a.set(e)},measure:(e,t)=>{i.set(e,t)},adopt(e,t){r.get(e)?.unsubscribe();let n=()=>{let n=t.getSnapshot().bySession[e];o.update(e,Object.values(n?.layout.tabs??{})),n!==void 0&&s.tabDomain.sync(e,n.layout)},i={store:t,unsubscribe:t.subscribe(n)};return r.set(e,i),n(),()=>{i.unsubscribe(),r.get(e)===i&&r.delete(e)}}}}var _l=class{tabs;host;openTabs;mounted;adopted;rooms;closeHandlers=/* @__PURE__ */ new Map;registerCloseHandler(e,t){if(this.closeHandlers.has(e))throw Error(`sidebarRight: close handler already registered for ${e}`);return this.closeHandlers.set(e,t),()=>{this.closeHandlers.get(e)===t&&this.closeHandlers.delete(e)}}tabDomain;constructor(e,t,n,r){this.tabs=e,this.host=n,this.adopted=r.adopted,this.rooms=r.rooms,this.mounted=r.onScreen,this.openTabs=r.openTabs,this.tabDomain=new ml(this,t)}tabsIn(e){return Object.values(this.adopted.get(e)?.store.getSnapshot().bySession[e]?.layout.tabs??{})}openResource(e,t={}){let{sessionId:n,actions:r}=this.require();this.placeResource(n,r,e,t)}openTab(e,t={}){let{sessionId:n,actions:r}=this.require();this.placeTab(n,r,e,t)}openResourceIn(e,t,n={}){let r=this.actionsFor(e);r!==void 0&&this.placeResource(e,r,t,n)}openTabIn(e,t,n={}){let r=this.actionsFor(e);r!==void 0&&this.placeTab(e,r,t,n)}closeIn(e,t){let n=this.actionsFor(e),r=this.adopted.get(e)?.store.getSnapshot().bySession[e];if(n===void 0||r===void 0)return;let i=r.layout.tabs[t];i!==void 0&&Lc(r,t)&&this.removeAfterCleanup(e,i,()=>{n.closeTab(e,t)})}removeAfterCleanup(e,t,n){this.closeHandlers.get(t.kind)?.(e,t),n()}placeResource(e,t,n,r){if(!n.startsWith(`dsh-resource://`))throw Error(`sidebarRight: no registered tab type claims "${n}"`);this.place(e,t,this.tabs.claim(n,r.kind),n,r,r.params)}placeTab(e,t,n,r){let i=this.tabs.get(n);if(i===void 0)throw Error(`sidebarRight: no tab type is registered as "${n}"`);let a=i.multiple===!0?`${A(n)}/${pl()}`:A(n);this.place(e,t,{kind:n,contentId:a,title:i.title(a)},a,r,r.params)}place(e,t,n,r,i,a){let o=this.adopted.get(e)?.store.getSnapshot().bySession[e],s=o===void 0?void 0:i.paneId??(0,h.activeDockPaneId)(o.layout),c=s===void 0?void 0:o?.layout.nodes[s],l=i.preferNewPane===!0&&i.replaceTab===void 0&&o!==void 0&&c?.kind===`pane`&&c.host===`dock`&&c.tabs.length>0&&(0,h.canSplit)(o.layout)&&(0,h.dockPaneIds)(o.layout).length<2&&this.mounted.getSnapshot()===e&&this.canSplitPane(e,c.id),u=()=>{t.openContent(e,{kind:n.kind,contentId:n.contentId,title:n.title,...i.paneId===void 0?{}:{paneId:i.paneId},...l?{preferNewPane:!0}:{},...i.replaceTab===void 0?{}:{replaceTab:i.replaceTab},...i.revealIfOpened===void 0?{}:{revealIfOpened:i.revealIfOpened}},t=>{this.tabDomain.navigate(e,t,{address:r,params:a})})},d=o?.layout,f=i.replaceTab===void 0?void 0:d?.tabs[i.replaceTab],p=f===void 0||d===void 0?void 0:(0,h.findTabPane)(d,f.id),m=d===void 0?void 0:n.contentId===A(n.kind)?(0,h.findPaneContentTab)(d,p?.host===`dock`?p.id:i.paneId??(0,h.activeDockPaneId)(d),n.contentId,n.kind):i.revealIfOpened===!1?void 0:(0,h.findContentTab)(d,n.contentId,n.kind);f===void 0||f.id===m?u():this.removeAfterCleanup(e,f,u)}close(e){this.closeIn(this.require().sessionId,e)}active(){let e=this.mountedSurface()?.layout;if(e===void 0)return;let{activeTabId:t}=(0,h.getPane)(e,e.activePaneId);return Object.values(e.tabs).find(e=>e.id===t)}isExpanded(){return this.mountedSurface()?.layout.expanded??!1}toggleExpanded(){let{sessionId:e,actions:t}=this.require();this.host.openWithFocus(e,()=>{t.toggleExpanded(e);let n=this.mountedSurface()?.layout;return n?.expanded?(0,h.activeDockPaneId)(n):void 0})}focus(e){let{sessionId:t,actions:n}=this.require();this.mountedSurface()?.layout.tabs[e]!==void 0&&n.focusTab(t,e)}focusedTarget(e=document.activeElement){let t=this.screen();return t===void 0?void 0:v(e,t.sessionId,t.surface.layout,e=>this.tabDomain.occurrence(t.sessionId,{id:e}))}commandTarget(e=document.activeElement){let t=this.focusedTarget(e);if(t!==void 0||e?.closest(`[data-sidebar-right-session]`))return t;let n=this.screen();if(n===void 0)return;let{sessionId:r,surface:{layout:i}}=n,a=(0,h.getPane)(i,(0,h.activeDockPaneId)(i)),o=a.activeTabId,s=o===void 0?void 0:this.tabDomain.occurrence(r,{id:o});return{sessionId:r,paneId:a.id,host:a.host,tabId:o,occurrence:s,navigationRevision:s?.navigation.getSnapshot().revision}}openTabFromTarget(e,t){if(!this.isTargetCurrent(t))return;let{sessionId:n,actions:r}=this.require();this.host.openWithFocus(n,()=>{let i=t.tabId===void 0?void 0:this.mountedSurface()?.layout.tabs[t.tabId];return t.host===`float`&&i?.kind===e&&this.tabs.get(e)?.multiple!==!0?(r.setExpanded(n,!0),this.focus(i.id)):this.openTab(e,{...t.host===`dock`?{paneId:t.paneId}:{},...i?.kind===`guide`?{replaceTab:i.id}:{}}),this.mountedSurface()?.layout.activePaneId})}canCloseTarget(e){return this.isTargetCurrent(e)&&e.tabId!==void 0}closeTarget(e){if(!this.isTargetCurrent(e))return`stale`;let t=this.mountedSurface();if(t===void 0||e.tabId===void 0)return`unavailable`;let n=e.tabId,{sessionId:r,actions:i}=this.require();return this.host.closeWithFocus(r,e.paneId,()=>{Lc(t,n)?this.close(n):i.setExpanded(r,!1)}),`closed`}isTargetCurrent(e){if(this.mounted.getSnapshot()!==e.sessionId)return!1;let t=this.mountedSurface()?.layout,n=t?.nodes[e.paneId];if(n?.kind!==`pane`||n.host!==e.host)return!1;if(e.tabId===void 0)return n.activeTabId===void 0;if(!n.tabs.includes(e.tabId)||t?.tabs[e.tabId]===void 0)return!1;let r=this.tabDomain.occurrence(e.sessionId,{id:e.tabId});return r===e.occurrence&&!r.signal.aborted&&r.navigation.getSnapshot().revision===e.navigationRevision}splitBlock(e){let t=this.mountedSurface();if(t===void 0||!this.isTargetCurrent(e))return`stale`;let{layout:n}=t;if(e.host===`float`)return`float`;if(!n.expanded)return`collapsed`;if((0,h.getPane)(n,e.paneId).tabs.length===0)return`empty`;if(!(0,h.canSplit)(n)||(0,h.dockPaneIds)(n).length>=2)return`budget`;if(!this.canSplitPane(e.sessionId,e.paneId))return`width`}toggleFullscreen(e){if(!this.isTargetCurrent(e)||e.host===`float`||!this.isExpanded())return;let{sessionId:t,actions:n}=this.require(),r=this.host.autoFullscreen(),i=r||this.mountedSurface()?.layout.mode===`fullscreen`;i&&r&&n.setExpanded(t,!1),n.setMode(t,i?`push`:`fullscreen`)}split(e){let{sessionId:t,actions:n}=this.require(),r=this.mountedSurface()?.layout;if(r===void 0)return;let i=e??(0,h.activeDockPaneId)(r),a=r.nodes[i];if(a===void 0||a.kind!==`pane`||a.host!==`dock`||!(0,h.canSplit)(r)||(0,h.dockPaneIds)(r).length>=2||!this.canSplitPane(t,i))return;let o;return this.host.openWithFocus(t,()=>(n.splitPane(t,i,e=>{o=e}),o)),o}float(e,t){let{sessionId:n,actions:r}=this.require(),i=this.mountedSurface()?.layout;i!==void 0&&i.tabs[e]!==void 0&&(0,h.findTabPane)(i,e).host===`dock`&&r.floatTab(n,e,t)}dock(e){let{sessionId:t,actions:n}=this.require(),r=this.mountedSurface()?.layout.nodes[e];r!==void 0&&r.kind===`pane`&&r.host===`float`&&n.unfloatPane(t,e)}_undo(){let{sessionId:e,actions:t}=this.require();t.undo(e)}_redo(){let{sessionId:e,actions:t}=this.require();t.redo(e)}screen(){let e=this.mounted.getSnapshot();if(e===void 0)return;let t=this.adopted.get(e)?.store.getSnapshot().bySession[e];return t===void 0?void 0:{sessionId:e,surface:t}}mountedSurface(){return this.screen()?.surface}canSplitPane(e,t){return this.rooms.get(e)?.(t)??!0}actionsFor(e){return this.adopted.get(e)?.store.actions}require(){let e=this.mounted.getSnapshot(),t=e===void 0?void 0:this.actionsFor(e);if(e===void 0||t===void 0)throw Error(`sidebarRight: no session surface is mounted`);return{sessionId:e,actions:t}}},vl=/* @__PURE__ */ l(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),yl=/* @__PURE__ */ l((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=vl();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),bl=/* @__PURE__ */ l(((e,t)=>{let n=yl(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=vl(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],ee=[],T=e,E=-1,D=0,O=0,te=!1,ne=!1,k=!1,re=!1,ie=!1,A=!1,j=!1,M=!1,N=!1,P=!1,ae=0,F,I,L={value:``,depth:0,isGlob:!1},R=()=>E>=x,z=()=>T.charCodeAt(E+1),B=()=>(F=I,T.charCodeAt(++E));for(;E<x;){I=B();let e;if(I===a)j=L.backslashes=!0,I=B(),I===u&&(A=!0);else{if(A===!0||I===u){for(ae++;R()!==!0&&(I=B());)if(I===a)j=L.backslashes=!0,B();else if(I===u)ae++;else{if(A!==!0&&I===s&&(I=B())===s||A!==!0&&I===o){if(te=L.isBrace=!0,k=L.isGlob=!0,P=!0,S===!0)continue;break}if(I===h&&(ae--,ae===0)){A=!1,te=L.isBrace=!0,P=!0;break}}if(S===!0)continue;break}if(I===l){if(C.push(E),w.push(L),L={value:``,depth:0,isGlob:!1},P===!0)continue;if(F===s&&E===D+1){D+=2;continue}O=E+1}else{if(b.noext!==!0&&(I===p||I===i||I===r||I===m||I===c)&&z()===d){if(k=L.isGlob=!0,re=L.isExtglob=!0,P=!0,I===c&&E===D&&(N=!0),S===!0){for(;R()!==!0&&(I=B());)if(I===a)j=L.backslashes=!0,I=B();else if(I===g){k=L.isGlob=!0,P=!0;break}continue}break}if(I===r){if(F===r&&(ie=L.isGlobstar=!0),k=L.isGlob=!0,P=!0,S===!0)continue;break}if(I===m){if(k=L.isGlob=!0,P=!0,S===!0)continue;break}if(I===f){for(;R()!==!0&&(e=B());)if(e===a)j=L.backslashes=!0,B();else if(e===_){ne=L.isBracket=!0,k=L.isGlob=!0,P=!0;break}if(S===!0)continue;break}if(b.nonegate!==!0&&I===c&&E===D)M=L.negated=!0,D++;else{if(b.noparen!==!0&&I===d){if(k=L.isGlob=!0,S===!0){for(;R()!==!0&&(I=B());)if(I===d)j=L.backslashes=!0,I=B();else if(I===g){P=!0;break}continue}break}if(k===!0){if(P=!0,S===!0)continue;break}}}}}b.noext===!0&&(re=!1,k=!1);let V=T,oe=``,se=``;D>0&&(oe=T.slice(0,D),T=T.slice(D),O-=D),V&&k===!0&&O>0?(V=T.slice(0,O),se=T.slice(O)):k===!0?(V=``,se=T):V=T,V&&V!==``&&V!==`/`&&V!==T&&v(V.charCodeAt(V.length-1))&&(V=V.slice(0,-1)),b.unescape===!0&&(se&&=n.removeBackslashes(se),V&&j===!0&&(V=n.removeBackslashes(V)));let H={prefix:oe,input:e,start:D,base:V,glob:se,isBrace:te,isBracket:ne,isGlob:k,isExtglob:re,isGlobstar:ie,negated:M,negatedExtglob:N};if(b.tokens===!0&&(H.maxDepth=0,v(I)||w.push(L),H.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:D,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&D!==0?(w[n].isPrefix=!0,w[n].value=oe):w[n].value=a,y(w[n]),H.maxDepth+=w[n].depth),(n!==0||a!==``)&&ee.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);ee.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),H.maxDepth+=w[w.length-1].depth)}H.slashes=C,H.parts=ee}return H}})),xl=/* @__PURE__ */ l(((e,t)=>{let n=vl(),r=yl(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e)if(o===!0)a+=s,o=!1;else if(s===`\\`)a+=s,o=!0;else if(s===`"`)i=i===1?0:1,a+=s;else{if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e)if(t===!0)t=!1;else if(n===`\\`)t=!0;else if(/[?*+@!()[\]{}]/.test(n))return!1;return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(a&&r===a.repeat(r.length)&&i===a.repeat(i.length)&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0)a=!1;else if(s===`\\`)a=!0;else if(s===`"`)i=i===1?0:1;else if(i!==1){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(!(n>0)){if(s===`(`)r++;else if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1)a.push(n);else if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:ee,NO_DOT:T,NO_DOT_SLASH:E,NO_DOTS_SLASH:D,QMARK:O,QMARK_NO_DOT:te,STAR:ne,START_ANCHOR:k}=_,re=e=>`(${g}(?:(?!${k}${e.dot?ee:x}).)*?)`,ie=d.dot?``:T,A=d.dot?O:te,j=d.bash===!0?re(d):ne;d.capture&&(j=`(${j})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let M={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,M),p=e.length;let N=[],P=[],ae=[],F=m,I,L=()=>M.index===p-1,R=M.peek=(t=1)=>e[M.index+t],z=M.advance=()=>e[++M.index]||``,B=()=>e.slice(M.index+1),V=(e=``,t=0)=>{M.consumed+=e,M.index+=t},oe=e=>{M.output+=e.output==null?e.value:e.output,V(e.value)},se=()=>{let e=1;for(;R()===`!`&&(R(2)!==`(`||R(3)===`?`);)z(),M.start++,e++;return e%2!=0&&(M.negated=!0,M.start++,!0)},H=e=>{M[e]++,ae.push(e)},ce=e=>{M[e]--,ae.pop()},U=e=>{if(F.type===`globstar`){let t=M.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||N.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(M.output=M.output.slice(0,-F.output.length),F.type=`star`,F.value=`*`,F.output=j,M.output+=F.output)}N.length&&e.type!==`paren`&&(N[N.length-1].inner+=e.value),(e.value||e.output)&&oe(e),F&&F.type===`text`&&e.type===`text`?(F.output=(F.output||F.value)+e.value,F.value+=e.value):(e.prev=F,h.push(e),F=e)},le=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=F,n.parens=M.parens,n.output=M.output,n.startIndex=M.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;H(`parens`),U({type:e,value:t,output:M.output?``:w}),U({type:`paren`,extglob:!0,value:z(),output:r}),N.push(n)},ue=n=>{let i=e.slice(n.startIndex,M.index+1),a=e.slice(n.startIndex+2,M.index),o=y(a,d);if((n.type===`plus`||n.type===`star`)&&o.risky){let e=o.safeOutput?(n.output?``:w)+(d.capture?`(${o.safeOutput})`:o.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;M.output=n.output+t.output,M.backtrack=!0,U({type:`paren`,extglob:!0,value:I,output:``}),ce(`parens`);return}let s=n.close+(d.capture?`)`:``),c;if(n.type===`negate`){let e=j;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=re(d)),(e!==j||L()||/^\)+$/.test(B()))&&(s=n.close=`)$))${e}`),n.inner.includes(`*`)&&(c=B())&&/^\.[^\\/.]+$/.test(c)&&(s=n.close=`)${b(c,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(M.negatedExtglob=!0)}U({type:`paren`,extglob:!0,value:I,output:s}),ce(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?O.repeat(a.length):``):o===0?A+(a?O.repeat(a.length):``):O.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?j:``):j:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(M.output=e,M):(M.output=r.wrapOutput(i,M,t),M)}for(;!L();){if(I=z(),I===`\0`)continue;if(I===`\\`){let e=R();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){I+=`\\`,U({type:`text`,value:I});continue}let t=/^\\+/.exec(B()),n=0;if(t&&t[0].length>2&&(n=t[0].length,M.index+=n,n%2!=0&&(I+=`\\`)),d.unescape===!0?I=z():I+=z(),M.brackets===0){U({type:`text`,value:I});continue}}if(M.brackets>0&&(I!==`]`||F.value===`[`||F.value===`[^`)){if(d.posix!==!1&&I===`:`){let e=F.value.slice(1);if(e.includes(`[`)&&(F.posix=!0,e.includes(`:`))){let e=F.value.lastIndexOf(`[`),t=F.value.slice(0,e),n=F.value.slice(e+2),r=a[n];if(r){F.value=t+r,M.backtrack=!0,z(),!m.output&&h.indexOf(F)===1&&(m.output=w);continue}}}(I===`[`&&R()!==`:`||I===`-`&&R()===`]`)&&(I=`\\${I}`),I===`]`&&(F.value===`[`||F.value===`[^`)&&(I=`\\${I}`),d.posix===!0&&I===`!`&&F.value===`[`&&(I=`^`),F.value+=I,oe({value:I});continue}if(M.quotes===1&&I!==`"`){I=r.escapeRegex(I),F.value+=I,oe({value:I});continue}if(I===`"`){M.quotes=M.quotes===1?0:1,d.keepQuotes===!0&&U({type:`text`,value:I});continue}if(I===`(`){H(`parens`),U({type:`paren`,value:I});continue}if(I===`)`){if(M.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=N[N.length-1];if(e&&M.parens===e.parens+1){ue(N.pop());continue}U({type:`paren`,value:I,output:M.parens?`)`:`\\)`}),ce(`parens`);continue}if(I===`[`){if(d.nobracket===!0||!B().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));I=`\\${I}`}else H(`brackets`);U({type:`bracket`,value:I});continue}if(I===`]`){if(d.nobracket===!0||F&&F.type===`bracket`&&F.value.length===1){U({type:`text`,value:I,output:`\\${I}`});continue}if(M.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));U({type:`text`,value:I,output:`\\${I}`});continue}ce(`brackets`);let e=F.value.slice(1);if(F.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(I=`/${I}`),F.value+=I,oe({value:I}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(F.value);if(M.output=M.output.slice(0,-F.value.length),d.literalBrackets===!0){M.output+=t,F.value=t;continue}F.value=`(${g}${t}|${F.value})`,M.output+=F.value;continue}if(I===`{`&&d.nobrace!==!0){H(`braces`);let e={type:`brace`,value:I,output:`(`,outputIndex:M.output.length,tokensIndex:M.tokens.length};P.push(e),U(e);continue}if(I===`}`){let e=P[P.length-1];if(d.nobrace===!0||!e){U({type:`text`,value:I,output:I});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),M.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=M.output.slice(0,e.outputIndex),r=M.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,I=t=`\\}`,M.output=n;for(let e of r)M.output+=e.output||e.value}U({type:`brace`,value:I,output:t}),ce(`braces`),P.pop();continue}if(I===`|`){N.length>0&&N[N.length-1].conditions++,U({type:`text`,value:I});continue}if(I===`,`){let e=I,t=P[P.length-1];t&&ae[ae.length-1]===`braces`&&(t.comma=!0,e=`|`),U({type:`comma`,value:I,output:e});continue}if(I===`/`){if(F.type===`dot`&&M.index===M.start+1){M.start=M.index+1,M.consumed=``,M.output=``,h.pop(),F=m;continue}U({type:`slash`,value:I,output:C});continue}if(I===`.`){if(M.braces>0&&F.type===`dot`){F.value===`.`&&(F.output=x);let e=P[P.length-1];F.type=`dots`,F.output+=I,F.value+=I,e.dots=!0;continue}if(M.braces+M.parens===0&&F.type!==`bos`&&F.type!==`slash`){U({type:`text`,value:I,output:x});continue}U({type:`dot`,value:I,output:x});continue}if(I===`?`){if(!(F&&F.value===`(`)&&d.noextglob!==!0&&R()===`(`&&R(2)!==`?`){le(`qmark`,I);continue}if(F&&F.type===`paren`){let e=R(),t=I;(F.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(B()))&&(t=`\\${I}`),U({type:`text`,value:I,output:t});continue}if(d.dot!==!0&&(F.type===`slash`||F.type===`bos`)){U({type:`qmark`,value:I,output:te});continue}U({type:`qmark`,value:I,output:O});continue}if(I===`!`){if(d.noextglob!==!0&&R()===`(`&&(R(2)!==`?`||!/[!=<:]/.test(R(3)))){le(`negate`,I);continue}if(d.nonegate!==!0&&M.index===0){se();continue}}if(I===`+`){if(d.noextglob!==!0&&R()===`(`&&R(2)!==`?`){le(`plus`,I);continue}if(F&&F.value===`(`||d.regex===!1){U({type:`plus`,value:I,output:S});continue}if(F&&(F.type===`bracket`||F.type===`paren`||F.type===`brace`)||M.parens>0){U({type:`plus`,value:I});continue}U({type:`plus`,value:S});continue}if(I===`@`){if(d.noextglob!==!0&&R()===`(`&&R(2)!==`?`){U({type:`at`,extglob:!0,value:I,output:``});continue}U({type:`text`,value:I});continue}if(I!==`*`){(I===`$`||I===`^`)&&(I=`\\${I}`);let e=o.exec(B());e&&(I+=e[0],M.index+=e[0].length),U({type:`text`,value:I});continue}if(F&&(F.type===`globstar`||F.star===!0)){F.type=`star`,F.star=!0,F.value+=I,F.output=j,M.backtrack=!0,M.globstar=!0,V(I);continue}let t=B();if(d.noextglob!==!0&&/^\([^?]/.test(t)){le(`star`,I);continue}if(F.type===`star`){if(d.noglobstar===!0){V(I);continue}let n=F.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){U({type:`star`,value:I,output:``});continue}let o=M.braces>0&&(n.type===`comma`||n.type===`brace`),s=N.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){U({type:`star`,value:I,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[M.index+4];if(n&&n!==`/`)break;t=t.slice(3),V(`/**`,3)}if(n.type===`bos`&&L()){F.type=`globstar`,F.value+=I,F.output=re(d),M.output=F.output,M.globstar=!0,V(I);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&L()){M.output=M.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type=`globstar`,F.output=re(d)+(d.strictSlashes?`)`:`|$)`),F.value+=I,M.globstar=!0,M.output+=n.output+F.output,V(I);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;M.output=M.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type=`globstar`,F.output=`${re(d)}${C}|${C}${e})`,F.value+=I,M.output+=n.output+F.output,M.globstar=!0,V(I+z()),U({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){F.type=`globstar`,F.value+=I,F.output=`(?:^|${C}|${re(d)}${C})`,M.output=F.output,M.globstar=!0,V(I+z()),U({type:`slash`,value:`/`,output:``});continue}M.output=M.output.slice(0,-F.output.length),F.type=`globstar`,F.output=re(d),F.value+=I,M.output+=F.output,M.globstar=!0,V(I);continue}let n={type:`star`,value:I,output:j};d.bash===!0?(n.output=`.*?`,(F.type===`bos`||F.type===`slash`)&&(n.output=ie+n.output),U(n)):F&&(F.type===`bracket`||F.type===`paren`)&&d.regex===!0?(n.output=I,U(n)):((M.index===M.start||F.type===`slash`||F.type===`dot`)&&(F.type===`dot`?(M.output+=E,F.output+=E):d.dot===!0?(M.output+=D,F.output+=D):(M.output+=ie,F.output+=ie),R()!==`*`&&(M.output+=w,F.output+=w)),U(n))}for(;M.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));M.output=r.escapeLast(M.output,`[`),ce(`brackets`)}for(;M.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));M.output=r.escapeLast(M.output,`(`),ce(`parens`)}for(;M.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));M.output=r.escapeLast(M.output,`{`),ce(`braces`)}if(d.strictSlashes!==!0&&(F.type===`star`||F.type===`bracket`)&&U({type:`maybe_slash`,value:``,output:`${C}?`}),M.backtrack===!0){M.output=``;for(let e of M.tokens)M.output+=e.output==null?e.value:e.output,e.suffix&&(M.output+=e.suffix)}return M};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},ee=w(r.removePrefix(e,x));return ee&&a.strictSlashes!==!0&&(ee+=`${u}?`),ee},t.exports=b})),Sl=/* @__PURE__ */ l(((e,t)=>{let n=bl(),r=xl(),i=yl(),a=vl(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),!r||p)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),Cl=/* @__PURE__ */ d((/* @__PURE__ */ l(((e,t)=>{t.exports=Sl()})))(),1);let wl={extension:3,builtin:2,fallback:1};function Tl(e,t){return t!==`fallback`&&e.inForce.band!==`fallback`&&e.inForce.band!==t&&e.shadowed===void 0}function El(e){try{return new URL(e).pathname}catch{return}}function Dl(e){let t=e.includes(`:`),n=(0,Cl.default)(e,{nocase:!0,dot:!0,...t?{}:{basename:!0}});return e=>{if(t)return n(e);let r=El(e);return r!==void 0&&n(r)}}var Ol=class{ctx;kinds=/* @__PURE__ */ new Map;ids=/* @__PURE__ */ new Set;listeners=/* @__PURE__ */ new Set;registrations=0;cached=[];guideEntries=[];constructor(e){this.ctx=e}register(e){let{id:t,kind:n}=e,r=e.guide??[];if(new Set(r.map(e=>e.id)).size!==r.length)throw Error(`sidebarRight: duplicate guide entry id in "${t}"`);let i=e.priority??`extension`;if(this.ids.has(t))throw Error(`sidebarRight: tab type id "${t}" is already registered`);let a=this.kinds.get(n);if(a!==void 0&&!Tl(a,i))throw Error(`sidebarRight: tab kind "${n}" is already registered (${a.inForce.band})`);this.registrations+=1;let o={definition:e,band:i,matchers:(e.patterns??[]).map(e=>({pattern:e,test:Dl(e)})),order:this.registrations},s=this.ctx.effect(()=>{this.ids.add(t);let e=this.enter(n,o);return this.refresh(),()=>{this.ids.delete(t),this.leave(n,e,o),this.refresh()}},`sidebarRight.tabs.register(${JSON.stringify(t)})`);return()=>{s()}}enter(e,t){let n=this.kinds.get(e);if(n===void 0){let n={inForce:t,shadowed:void 0};return this.kinds.set(e,n),n}return wl[t.band]>wl[n.inForce.band]?(n.shadowed=n.inForce,n.inForce=t):n.shadowed=t,n}leave(e,t,n){t.inForce===n?t.shadowed===void 0?this.kinds.delete(e):(t.inForce=t.shadowed,t.shadowed=void 0):t.shadowed=void 0}active(){return[...this.kinds.values()].map(e=>e.inForce).sort((e,t)=>e.order-t.order)}entries(){return this.cached}guide(){return this.guideEntries}get(e){return this.kinds.get(e)?.inForce.definition}candidates(e){let t=[];for(let{definition:n,band:r,matchers:i,order:a}of this.active()){let o=-1;for(let t of i)t.test(e)&&t.pattern.length>o&&(o=t.pattern.length);o<0||(n.canOpen===void 0||n.canOpen(e))&&t.push({definition:n,rank:wl[r],length:o,order:a})}return t.sort((e,t)=>t.rank-e.rank||t.length-e.length||e.order-t.order),t.map(e=>e.definition)}claim(e,t){if(t!==void 0){let n=this.get(t);if(n===void 0)throw Error(`sidebarRight: no tab type is registered as "${t}"`);if(n.canOpen!==void 0&&!n.canOpen(e))throw Error(`sidebarRight: tab type "${t}" refuses "${e}"`);return{kind:t,contentId:e,title:n.title(e)}}let[n]=this.candidates(e);if(n===void 0)throw Error(`sidebarRight: no registered tab type claims "${e}"`);return{kind:n.kind,contentId:e,title:n.title(e)}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}refresh(){this.cached=this.active().map(e=>e.definition),this.guideEntries=this.cached.flatMap(e=>(e.guide??[]).map(t=>({...t,kind:e.kind,providerId:e.id}))).sort((e,t)=>e.order-t.order),(0,g.notifySubscribers)(this.listeners,`[ui-sidebar-right] tab registry`)}};let kl={"command.close":`关闭当前页面/窗口`,"command.refresh":`刷新当前页面`,"command.noRefresh":`当前页面不支持刷新`,"command.toggle":`展开/收起右侧栏`,"command.fullscreen":`面板全屏/退出全屏`,"command.noSession":`请先选择会话`,"command.noFocus":`请先聚焦右侧面板`,"command.stale":`页面已切换,请重新聚焦`,"command.collapsed":`请先展开右侧栏`,"command.float":`浮动面板不支持此操作`,"command.empty":`请先打开页面`,"command.budget":`已达两格上限`,"command.width":`栏宽不足,拖宽侧边栏后再分栏`,"chrome.expand":`打开侧边栏`,"chrome.expandAria":`打开右侧边栏`,"chrome.collapse":`收起侧边栏`,"chrome.collapseAria":`收起右侧边栏`,"chrome.toFullscreen":`全屏`,"chrome.exitFullscreen":`退出全屏`,"dock.emptyPane":`空面板`,"dock.splitPane":`分栏`,"dock.splitPaneDisabled":`已达两格上限`,"dock.splitPaneNarrow":`栏宽不足,拖宽侧边栏后再分栏`,"dock.closeTab":`关闭`,"dock.addTab":`新标签页`,"dock.dockFloat":`收回到侧边栏`,"dock.closeFloat":`关闭`,"dock.drop.center":`移到这里`,"dock.drop.left":`左分栏`,"dock.drop.right":`右分栏`,"dock.drop.top":`上分栏`,"dock.drop.bottom":`下分栏`,"tab.guide.title":`开始`,"tab.unavailable":`这类内容还没有可用的查看方式。`},Al={"command.close":`Close current page or window`,"command.refresh":`Refresh current page`,"command.noRefresh":`This page cannot be refreshed`,"command.toggle":`Toggle right sidebar`,"command.fullscreen":`Toggle panel fullscreen`,"command.noSession":`Select a session first`,"command.noFocus":`Focus a right sidebar pane first`,"command.stale":`The page changed; focus it again`,"command.collapsed":`Expand the right sidebar first`,"command.float":`This action is unavailable in a floating panel`,"command.empty":`Open a page first`,"command.budget":`Two panes is the limit`,"command.width":`Not enough width to split, widen the sidebar`,"chrome.expand":`Open sidebar`,"chrome.expandAria":`Open right sidebar`,"chrome.collapse":`Collapse sidebar`,"chrome.collapseAria":`Collapse right sidebar`,"chrome.toFullscreen":`Fullscreen`,"chrome.exitFullscreen":`Exit fullscreen`,"dock.emptyPane":`Empty pane`,"dock.splitPane":`Split`,"dock.splitPaneDisabled":`Two panes is the limit`,"dock.splitPaneNarrow":`Not enough width to split, widen the sidebar`,"dock.closeTab":`Close`,"dock.addTab":`New tab`,"dock.dockFloat":`Send back to the sidebar`,"dock.closeFloat":`Close`,"dock.drop.center":`Move here`,"dock.drop.left":`Add left split`,"dock.drop.right":`Add right split`,"dock.drop.top":`Add top split`,"dock.drop.bottom":`Add bottom split`,"tab.guide.title":`Start`,"tab.unavailable":`Nothing here can view this kind of content yet.`},jl=`@deepseek-ai/dsh-client-ui-sidebar-right/guide`;function Ml(e){return{id:jl,kind:ie,priority:`builtin`,title:()=>e(`tab.guide.title`)}}let Nl=(e,t)=>{let{sessionId:n}=e,{tabId:r,title:i,fullscreen:a,active:o,signal:s,actions:c,useStore:l,useTabNavigation:u,shortcuts:d}=t;return function(){let e=l(e=>e.bySession[n]?.layout),t=u(r);return(0,m.useMemo)(()=>{let l=e?.tabs[r];if(e===void 0||l===void 0||t===void 0)throw Error(`sidebarRight: tab "${r}" is not committed in session "${n}"`);let u=(0,h.findTabPane)(e,r);return{sidebar:{expanded:e.expanded,fullscreen:a},panel:{id:u.id},tab:{...l,visible:o&&(u.host===`float`||e.expanded&&(i||u.activeTabId===r)),navigation:t,signal:s,actions:c,refreshShortcut:d.find(e=>e.id===`page.refresh`)}}},[e,t,r,i,a,o,s,c,d])}},Pl=(e,t)=>t,Fl=`sidebarRight`,Il=[`slots`,`layout`,`locale`,`resources`,`sessions`,`uiSession`,`shortcuts`];function Ll(e){let t=e.locale.bind(Fl),n=new Ol(e),r=new fl(e.sessions);e.effect(()=>{let t=e.uiSession.adapter.current,n=()=>{r.select(t.getSnapshot().key)},i=t.subscribe(n);return n(),()=>{i(),r.dispose()}},`ui-sidebar-right: retained Session views`);let i=e.layout,a=!1,{controller:o,adopt:s,forget:c,show:l,measure:u}=gl(n,(t,n)=>{e.resources.pin(t,n)},{autoFullscreen:()=>a,openWithFocus:(e,t)=>{sl(document,e,t)},closeWithFocus:(e,t,n)=>{cl(document,e,t,n)}});e.effect(()=>{let e=()=>{let e=r.source.getSnapshot().find(e=>e.selected);l(i.panelInfo.getSnapshot().activePanelId===null?e?.sessionId:void 0)},t=r.source.subscribe(e),n=i.panelInfo.subscribe(e);return e(),()=>{t(),n(),l(void 0)}},`ui-sidebar-right: on-screen Session`);let d=e.reflect.provide(`sidebarRightTabs`,n),f=e.reflect.provide(`sidebarRight`,o);e.effect(()=>()=>{o.tabDomain.dispose(),f(),d()},`ui-sidebar-right: service faces`),e.effect(()=>e.locale.register(Fl,{zh:kl,en:Al}),`ui-sidebar-right: dictionaries`),e.effect(()=>x(e.shortcuts,o,t,()=>{e.shortcuts.closeWindow().catch(e=>{console.error(`Window close failed`,e)})}),`ui-sidebar-right: shortcuts`),typeof document<`u`&&e.effect(()=>b(document),`ui-sidebar-right: focus`),e.effect(()=>{let l=Jc(()=>re(n)),d=/* @__PURE__ */ new Map,f={...l,create:e=>{let t=l.create(e);if(e!==void 0){let n=e;d.get(n)?.(),d.set(n,s(n,t))}return{...t,clearPersisted(){t.clearPersisted(),e!==void 0&&c(e)}}}},p={syncPresentation({shown:e,track:t,fullscreen:n}){e?i.openRightbar(t,n):i.closeRightbar()},reportAutoFullscreen:e=>{a=e},splitPane:e=>{o.split(e)},toggleFullscreen:()=>{let e=o.commandTarget();e!==void 0&&o.toggleFullscreen(e)},openTab:(e,t)=>{o.openTab(e,t)},hooks:{shortcuts:e.shortcuts.catalog,tabTypes:{subscribe:e=>n.subscribe(e),getSnapshot:()=>n.entries()}}},m=[n.register(Ml(t))],h=e.slots.inject(`rightbar`,function*(){yield e.slots.register({name:`rightbar`,children:{"rightbar.session":{kind:`single`,scope:`session`}},inject:()=>({hooks:{views:r.source},mountView:e=>r.mount(e),setExpandedFromSwipe:(e,t)=>{o.commandTarget(null)?.sessionId===e&&o.isExpanded()!==t&&o.toggleExpanded()}})},ul),yield e.slots.register({name:`rightbar.session`,locale:Fl,children:{"sidebar.right.pane.tab":{kind:`keyed`,scope:`session`,inject:{hooks:{tabInfo:Nl}}},"sidebar.right.pane.tab.title":{kind:`keyed`,scope:`session`,inject:{hooks:{tabInfo:Nl}}},"sidebar.right.tab.menu.item":{kind:`list`,scope:`session`}},store:f,inject:e=>({...p,measureRoom:t=>{u(e,t)},closeTab:t=>{try{o.closeIn(e,t)}catch(e){console.error(`Sidebar tab close failed:`,e)}},keyedHooks:{tabNavigation:t=>o.tabDomain.occurrence(e,{id:t}).navigation},occurrence:t=>o.tabDomain.occurrence(e,t)})},ol)}),g=e.slots.inject(`conversation.session.header.corner`,()=>e.slots.register({name:`conversation.session.header.corner`,locale:Fl,store:f,inject:()=>({hooks:{shortcuts:e.shortcuts.catalog}})},k)),_={hooks:{shortcuts:e.shortcuts.catalog,guideEntries:{subscribe:e=>n.subscribe(e),getSnapshot:()=>n.guide()}}},v=e.slots.inject(`sidebar.right.pane.tab`,()=>e.slots.register({name:`sidebar.right.pane.tab`,key:jl,children:{"sidebar.right.tab.guide.entry":{kind:`keyed`,scope:`session`,inject:{hooks:{tabInfo:Pl}}},"sidebar.right.tab.guide":{kind:`chain`,scope:`session`,inject:{hooks:{tabInfo:Pl}}}},inject:()=>_},O)),y=e.slots.inject(`sidebar.right.pane.tab.title`,()=>e.slots.register({name:`sidebar.right.pane.tab.title`,key:jl},T));return()=>{y(),v(),g(),h();for(let e of m.reverse())e();for(let e of d.values())e();d.clear()}},`ui-sidebar-right: seats and shipped tab type`)}return n.apply=Ll,n.inject=Il,t.exports}});
113
+ return t===void 0?n():Kc(e,t,(0,h.activeDockPaneId)(e),n)},e))},moveFloat:(t,n,r,i,a)=>{t.bySession=$(t,n,t=>Q(t,()=>[{type:`moveFloat`,paneId:r,x:i,y:a}],e))},resizeFloat:(t,n,r,i)=>{t.bySession=$(t,n,t=>Q(t,()=>[{type:`resizeFloat`,paneId:r,rect:i}],e))},resizeSplit:(t,n,r,i)=>{t.bySession=$(t,n,t=>Q(t,()=>(0,h.planResizeSplit)(r,i,.2),e))},undo:(e,t)=>{e.bySession=$(e,t,e=>qc(e,h.stepBack))},redo:(e,t)=>{e.bySession=$(e,t,e=>qc(e,h.stepForward))}}});return{...t,create(e){let n=t.create(e);if(e===void 0)return n;let r=Pc(e);return r!==void 0&&n.store.set({bySession:{[e]:r}}),n.subscribe(()=>{let t=n.getSnapshot().bySession[e];t!==void 0&&Fc(e,t)}),{...n,clearPersisted:()=>{Ic(e)}}}}}let Yc=`@deepseek-ai/dsh-client-ui-sidebar-right/SidebarRight.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Yc)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-sidebar-right`,e.dataset.pluginCss=Yc,e.textContent=`.qJjNiG_session{display:contents}.qJjNiG_session[hidden]{display:none}.qJjNiG_panel{--dsh-dockkit-dock-layer:10;--dsh-dockkit-float-layer:60;pointer-events:none;flex-direction:column;min-width:0;display:flex;position:absolute;top:0;bottom:0;right:0}.qJjNiG_panel [data-dockkit-host=dock],.qJjNiG_panel [data-dockkit-empty],.qJjNiG_panel [data-dockkit-divider]{transform:translateX(var(--dsh-sidebar-width));visibility:hidden;transition:transform var(--ds-transition-duration-slow) var(--ds-ease-in-out), visibility 0s linear var(--ds-transition-duration-slow)}.qJjNiG_panel[data-sidebar-right-open] [data-dockkit-host=dock],.qJjNiG_panel[data-sidebar-right-open] [data-dockkit-empty],.qJjNiG_panel[data-sidebar-right-open] [data-dockkit-divider]{visibility:visible;transition:transform var(--ds-transition-duration-slow) var(--ds-ease-in-out);transform:none}@starting-style{.qJjNiG_panel[data-sidebar-right-opening] [data-dockkit-host=dock],.qJjNiG_panel[data-sidebar-right-opening] [data-dockkit-empty],.qJjNiG_panel[data-sidebar-right-opening] [data-dockkit-divider]{transform:translateX(var(--dsh-sidebar-width))}}.qJjNiG_panel[data-sidebar-right-phone-motion] [data-dockkit-host=dock],.qJjNiG_panel[data-sidebar-right-phone-motion] [data-dockkit-empty],.qJjNiG_panel[data-sidebar-right-phone-motion] [data-dockkit-divider]{transform:translateX(var(--dsh-rightbar-phone-x));visibility:var(--dsh-rightbar-phone-visibility);transition:none}.qJjNiG_panel[data-sidebar-right-phone-motion] [data-dockkit-host=dock],.qJjNiG_panel[data-sidebar-right-phone-motion] [data-dockkit-empty]{pointer-events:auto}.qJjNiG_panel[data-sidebar-right-panel=fullscreen]{--dsh-dockkit-dock-layer:40}[data-windows-titlebar] .qJjNiG_panel[data-sidebar-right-panel=fullscreen]{max-width:calc(100vw - var(--dsh-windows-sidebar-width))}[data-windows-titlebar] .qJjNiG_panel[data-sidebar-right-panel=fullscreen] [data-dockkit-column="0"][data-dockkit-pane]{border-radius:var(--dsh-windows-content-radius) 0 0 0;corner-shape:round}[data-platform=darwin] .qJjNiG_panel[data-sidebar-right-panel=fullscreen] [data-dockkit-host=dock][data-dockkit-column="0"]{--dsh-dockkit-strip-inline-start:calc(var(--dsh-mac-lights-end,68px) + 20px)}[data-platform=darwin] .qJjNiG_panel[data-sidebar-right-panel=fullscreen] [data-dockkit-host=dock][data-dockkit-column="1"]{--dsh-dockkit-strip-inline-start:10px}[data-platform=darwin][data-fullscreen] .qJjNiG_panel[data-sidebar-right-panel=fullscreen] [data-dockkit-host=dock][data-dockkit-column="0"]{--dsh-dockkit-strip-inline-start:10px}@media (prefers-reduced-motion:reduce){.qJjNiG_panel [data-dockkit-host=dock],.qJjNiG_panel [data-dockkit-empty],.qJjNiG_panel [data-dockkit-divider],.qJjNiG_panel[data-sidebar-right-open] [data-dockkit-host=dock],.qJjNiG_panel[data-sidebar-right-open] [data-dockkit-empty],.qJjNiG_panel[data-sidebar-right-open] [data-dockkit-divider]{transition:none}}.qJjNiG_iconButton{width:28px;height:28px;color:color-mix(in srgb, var(--dsw-alias-label-secondary) 82%, transparent);corner-shape:round;cursor:pointer;background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:6px;line-height:1;transition:background-color .14s,color .14s;display:inline-flex}.qJjNiG_iconButton svg{width:16px;height:16px}@media (hover:hover){.qJjNiG_iconButton:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}}.qJjNiG_collapseGlyph{transform:scaleX(-1)}.qJjNiG_panelBody{flex:auto;min-height:0;display:flex}@media (pointer:coarse){.qJjNiG_panelBody [data-dockkit-split-control]:has(>[data-dockkit-split-blocked]){visibility:hidden}}.qJjNiG_unavailable{color:var(--dsw-alias-label-tertiary);font-size:var(--dsh-content-font-size-secondary,13px);margin:0;padding:12px}.qJjNiG_tabTitle{display:contents}.qJjNiG_tabBody{flex-direction:column;min-width:0;height:100%;min-height:0;display:flex;overflow:hidden}`,document.head.appendChild(e)}var Xc={collapseGlyph:`qJjNiG_collapseGlyph`,iconButton:`qJjNiG_iconButton`,panel:`qJjNiG_panel`,panelBody:`qJjNiG_panelBody`,session:`qJjNiG_session`,tabBody:`qJjNiG_tabBody`,tabTitle:`qJjNiG_tabTitle`,unavailable:`qJjNiG_unavailable`};function Zc(e,t){return(0,h.findPaneContentTab)(e,t,A(ie),ie)}function Qc(e,t,n,r,i){return{focusTab:n=>{t.focusTab(e,n)},focusPane:n=>{t.focusPane(e,n)},splitPane:i??(n=>{t.splitPane(e,n)}),addTab:e=>{n(ie,{paneId:e,revealIfOpened:!1})},closeTab:r??(n=>{t.closeTab(e,n)}),duplicateTab:n=>{t.duplicateTab(e,n)},floatTab:(n,r)=>{t.floatTab(e,n,r)},unfloatPane:n=>{t.unfloatPane(e,n)},placeTab:(n,r,i)=>{t.placeTab(e,n,r,i)},dropTab:(n,r,i)=>{t.dropTab(e,n,r,i)},moveFloat:(n,r,i)=>{t.moveFloat(e,n,r,i)},resizeFloat:(n,r)=>{t.resizeFloat(e,n,r)},resizeSplit:(n,r)=>{t.resizeSplit(e,n,r)}}}function $c({renderSlot:e,occurrence:t,useTabTypes:n,useTabNavigation:r,useStore:i,fullscreen:a,shortcuts:o,active:s,retainTab:c,tab:l,seat:u,fallback:d}){let{id:f,signal:h,tabActions:g}=t(l),_=n(e=>e.find(e=>e.kind===l.kind)),v=u===`sidebar.right.pane.tab`&&_?.keepMounted===!0;(0,m.useLayoutEffect)(()=>v?c(l.id,h):void 0,[v,c,l.id,h]);let y=(0,m.useMemo)(()=>({tabId:l.id,shortcuts:o,title:u===`sidebar.right.pane.tab.title`,fullscreen:a,active:s,signal:h,actions:g,useStore:i,useTabNavigation:r}),[l.id,u,a,s,h,g,i,r,o]),b=e(u,{},{entryKey:_?.id??l.kind,fallback:d,hookContext:y});return u===`sidebar.right.pane.tab.title`?/* @__PURE__ */ (0,p.jsx)(`span`,{className:Xc.tabTitle,"data-sidebar-right-tab":l.id,"data-sidebar-right-occurrence":f,children:b},f):/* @__PURE__ */ (0,p.jsx)(`div`,{className:Xc.tabBody,"data-sidebar-right-tab":l.id,"data-sidebar-right-occurrence":f,children:b},f)}function el(e){let{t,...n}=e;return e=>/* @__PURE__ */ (0,p.jsx)($c,{...n,tab:e,seat:`sidebar.right.pane.tab`,fallback:/* @__PURE__ */ (0,p.jsx)(`p`,{className:Xc.unavailable,"data-sidebar-right-unavailable":!0,children:t(`tab.unavailable`)})},e.id)}function tl(e){return t=>/* @__PURE__ */ (0,p.jsx)($c,{...e,tab:t,seat:`sidebar.right.pane.tab.title`,fallback:t.title},t.id)}function nl(){return/* @__PURE__ */ (0,p.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M2.33203 10.4054V13.1681C2.33229 13.444 2.55605 13.6681 2.83203 13.6681H5.49512V14.6681H2.83203C2.00376 14.6681 1.33229 13.9963 1.33203 13.1681V10.4054H2.33203ZM14.6689 13.1681C14.6687 13.996 13.9968 14.6676 13.1689 14.6681H10.4951V13.6681H13.1689C13.4445 13.6676 13.6687 13.4437 13.6689 13.1681V10.4054H14.6689V13.1681ZM13.1689 1.33118C13.9969 1.33163 14.6688 2.00315 14.6689 2.83118V5.4054H13.6689V2.83118C13.6688 2.55544 13.4446 2.33162 13.1689 2.33118H10.4951V1.33118H13.1689ZM5.49512 2.33118H2.83203C2.55598 2.33118 2.33218 2.55516 2.33203 2.83118V5.4054H1.33203V2.83118C1.33218 2.00288 2.00369 1.33118 2.83203 1.33118H5.49512V2.33118Z`,fill:`currentColor`})})}function rl(){return/* @__PURE__ */ (0,p.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M9 2.5V6C9 6.26522 9.10536 6.51957 9.29289 6.70711C9.48043 6.89464 9.73478 7 10 7H13.5`,stroke:`currentColor`}),/* @__PURE__ */ (0,p.jsx)(`path`,{d:`M7 13.5V10C7 9.73478 6.89464 9.48043 6.70711 9.29289C6.51957 9.10536 6.26522 9 6 9H2.5`,stroke:`currentColor`})]})}function il({sessionId:e,fullscreen:t,actions:n,t:r,shortcuts:i,toggleFullscreen:a}){let o=t?`push`:`fullscreen`,s=r(t?`chrome.exitFullscreen`:`chrome.toFullscreen`),c=i.find(e=>e.id===`pane.fullscreen.toggle`),l=i.find(e=>e.id===`sidebar.right.toggle`);return/* @__PURE__ */ (0,p.jsxs)(p.Fragment,{children:[/* @__PURE__ */ (0,p.jsx)(f.Tooltip,{label:s,shortcutKeys:c?.keys,side:`bottom`,delayMs:500,children:/* @__PURE__ */ (0,p.jsx)(`button`,{type:`button`,className:Xc.iconButton,"aria-label":s,"aria-keyshortcuts":c?.aria,"data-sidebar-right-mode":o,onClick:a,children:t?/* @__PURE__ */ (0,p.jsx)(rl,{}):/* @__PURE__ */ (0,p.jsx)(nl,{})})}),/* @__PURE__ */ (0,p.jsx)(f.Tooltip,{label:r(`chrome.collapse`),shortcutKeys:l?.keys,side:`bottom`,delayMs:500,children:/* @__PURE__ */ (0,p.jsx)(`button`,{type:`button`,className:Xc.iconButton,"aria-label":r(`chrome.collapseAria`),"aria-keyshortcuts":l?.aria,"data-sidebar-right-toggle":!0,onClick:()=>{n.toggleExpanded(e)},children:/* @__PURE__ */ (0,p.jsx)(f.IconPanelLeftOutlineRegular,{className:Xc.collapseGlyph})})})]})}function al(e){let{sessionId:t,surface:n,actions:r,t:i,renderSlot:a,openTab:o,width:s,reportRoom:c,fullscreen:l,panelRef:u}=e,{expanded:d}=n.layout,f=(0,m.useRef)(d),g=d&&!f.current;(0,m.useLayoutEffect)(()=>{f.current=d},[d]);let _=e.useTabTypes(e=>e);return/* @__PURE__ */ (0,p.jsx)(`div`,{ref:u,className:Xc.panel,style:{width:l?`100vw`:s,"--dsh-sidebar-width":l?`100vw`:`${s}px`},"data-sidebar-right-session":t,"data-sidebar-right-panel":l?`fullscreen`:`push`,"data-sidebar-right-open":d||void 0,"data-sidebar-right-opening":g||void 0,"aria-hidden":!d&&n.layout.floats.length===0||void 0,children:/* @__PURE__ */ (0,p.jsx)(`div`,{className:Xc.panelBody,children:/* @__PURE__ */ (0,p.jsx)(h.DockLayout,{state:n.layout,canSplit:(0,h.canSplit)(n.layout)&&(0,h.dockPaneIds)(n.layout).length<2,dropZones:`horizontal`,minPaneFraction:.2,canAddTab:e=>Zc(n.layout,e)===void 0,canCloseTab:e=>Lc(n,e),intents:Qc(t,r,o,e.closeTab,e.splitPane),labels:j(i,e.shortcuts.find(e=>e.id===`pane.split`),e.shortcuts.find(e=>e.id===`page.close`)),renderTab:el(e),renderTabTitle:tl(e),active:e.active,keepMounted:e=>_.find(t=>t.kind===e.kind)?.keepMounted===!0,renderTabMenuItems:(e,t)=>a(`sidebar.right.tab.menu.item`,{tab:e,dismiss:t}),chrome:/* @__PURE__ */ (0,p.jsx)(il,{sessionId:t,fullscreen:l,actions:r,t:i,shortcuts:e.shortcuts,toggleFullscreen:e.toggleFullscreen}),onRoom:c})})})}function ol({sessionId:e,width:t,viewportWidth:n,canShow:r,bindSwipeNavigation:i,setExpandedFromSwipe:a,useStore:o,actions:s,t:c,renderSlot:l,syncPresentation:u,measureRoom:d,reportAutoFullscreen:f,openTab:h,closeTab:g,useTabTypes:_,useTabNavigation:v,occurrence:y,retainTab:b,active:x,useShortcuts:S,splitPane:C,toggleFullscreen:w}){let ee=S(e=>e),T=o(t=>t.bySession[e]),E=x&&T!==void 0&&T.layout.expanded,D=n<768,O=D||T?.layout.mode===`fullscreen`,te=(0,m.useRef)(null),ne=(0,m.useRef)(null),k=T?.layout.expanded??!1,re=(0,m.useRef)(k);re.current=k;let ie=T!==void 0;(0,m.useLayoutEffect)(()=>{let e=te.current;if(!x||!ie||e===null)return;let t=i({element:e,expanded:re.current,onExpandedChange:a,paint:(t,n)=>{t===null?(e.removeAttribute(`data-sidebar-right-phone-motion`),e.style.removeProperty(`--dsh-rightbar-phone-x`),e.style.removeProperty(`--dsh-rightbar-phone-visibility`)):(e.style.setProperty(`--dsh-rightbar-phone-x`,`${t}px`),e.style.setProperty(`--dsh-rightbar-phone-visibility`,n?`visible`:`hidden`),e.setAttribute(`data-sidebar-right-phone-motion`,``));for(let n of e.querySelectorAll(`[data-dockkit-empty] > *`))n.inert=t!==null&&!re.current}});return ne.current=t,()=>{ne.current=null,t.dispose()}},[x,ie,i,a]),(0,m.useLayoutEffect)(()=>{ne.current?.setExpanded(k)},[k]);let A=(0,m.useCallback)(e=>{d(t=>e.get(t)?.row!==!1)},[d]),j=E&&!D;return(0,m.useEffect)(()=>{x&&T===void 0&&s.open(e)},[s,e,T,x]),(0,m.useLayoutEffect)(()=>{E&&!O&&!r&&s.setExpanded(e,!1)},[s,e,E,O,r]),(0,m.useLayoutEffect)(()=>{f(D)},[f,D]),(0,m.useLayoutEffect)(()=>{if(!x)return;let e=!1,t=()=>{if(e)return;let n=E&&O?te.current.getAnimations({subtree:!0}).filter(e=>`transitionProperty`in e&&e.transitionProperty===`transform`&&e.playState!==`finished`&&e.playState!==`idle`):[];n.length===0?u({shown:E,track:j,fullscreen:O}):Promise.allSettled(n.map(e=>e.finished)).then(t)};return t(),()=>{e=!0}},[e,E,j,O,u,x]),(0,m.useLayoutEffect)(()=>x?()=>{u({shown:!1,track:!1,fullscreen:!1})}:void 0,[u,x]),T===void 0?null:/* @__PURE__ */ (0,p.jsx)(al,{sessionId:e,actions:s,t:c,renderSlot:l,surface:T,openTab:h,closeTab:g,useTabTypes:_,useTabNavigation:v,useStore:o,occurrence:y,fullscreen:O,autoFullscreen:D,reportRoom:A,active:x,retainTab:b,shortcuts:ee,splitPane:C,toggleFullscreen:w,width:t,panelRef:te})}function sl(e,t,n){let r;(0,_.flushSync)(()=>{r=n()}),r!==void 0&&y(e,t,r)?.focus({preventScroll:!0})}function cl(e,t,n,r){let i=e.activeElement,a=i?.closest(`[data-sidebar-right-session]`),o=i?.closest(`[data-dockkit-pane], [data-dockkit-float]`),s=a?.dataset.sidebarRightSession===t&&(o?.dataset.dockkitPane??o?.dataset.dockkitFloat)===n;(0,_.flushSync)(r),!(!s||e.activeElement!==e.body&&e.activeElement!==i)&&y(e,t,n)?.focus({preventScroll:!0})}function ll({view:e,visible:t,SessionProvider:n,renderSlot:r,mountView:i,width:a,viewportWidth:o,bindSwipeNavigation:s,setExpandedFromSwipe:c,canShow:l}){(0,m.useLayoutEffect)(()=>i(e.reference),[i,e.reference]);let u=t&&e.selected,d=(0,m.useCallback)(t=>c(e.sessionId,t),[c,e.sessionId]);return/* @__PURE__ */ (0,p.jsx)(`div`,{className:Xc.session,hidden:!u,"data-sidebar-right-session":e.sessionId,children:/* @__PURE__ */ (0,p.jsx)(n,{session:e.reference,children:r(`rightbar.session`,{width:a,viewportWidth:o,bindSwipeNavigation:s,setExpandedFromSwipe:d,canShow:l,active:u,retainTab:e.retainTab})})})}function ul({usePanelInfo:e,useViews:t,...n}){let r=e(e=>e.activePanelId===null),i=t(e=>e);return/* @__PURE__ */ (0,p.jsx)(p.Fragment,{children:i.map(e=>/* @__PURE__ */ (0,p.jsx)(ll,{...n,view:e,visible:r},e.sessionId))})}var dl=class{sessionId;onDispose;onTabRelease;reference;tabs=/* @__PURE__ */ new Map;mounts=0;retired=!1;disposed=!1;constructor(e,t,n,r){this.sessionId=e,this.onDispose=n,this.onTabRelease=r,this.reference=t.retain(e,{source:`sidebarView`}),this.reference.ready.catch(e=>{console.error(`Sidebar Session opening failed:`,e)})}get hasRetainedTabs(){return this.tabs.size>0}mount(){return this.mounts+=1,()=>{--this.mounts,this.retired&&this.mounts===0&&this.dispose()}}retainTab=(e,t)=>{if(t.aborted||this.disposed)return()=>{};this.tabs.set(e,(this.tabs.get(e)??0)+1);let n=!0,r=()=>{if(!n)return;n=!1,t.removeEventListener(`abort`,r);let i=this.tabs.get(e);i===1?this.tabs.delete(e):this.tabs.set(e,i-1),this.onTabRelease(this)};return t.addEventListener(`abort`,r,{once:!0}),r};retire(){this.retired=!0,this.mounts===0&&this.dispose()}dispose(){this.disposed||(this.disposed=!0,this.retired=!0,this.onDispose(this),this.reference.release())}},fl=class{sessions;source=(0,g.createSnapshotStore)([]);views=/* @__PURE__ */ new Map;viewsByReference=/* @__PURE__ */ new Map;selected;closed=!1;constructor(e){this.sessions=e}select(e){if(!(this.closed||this.selected===e)){if(this.selected=e,e!==void 0&&!this.views.has(e)){let t=new dl(e,this.sessions,e=>{this.viewsByReference.delete(e.reference)},e=>{this.prune(e)});this.views.set(e,t),this.viewsByReference.set(t.reference,t)}for(let e of this.views.values())this.prune(e);this.publish()}}mount(e){let t=this.viewsByReference.get(e);if(t===void 0){if(this.closed)return()=>{};throw Error(`Sidebar Session view reference is no longer owned`)}return t.mount()}dispose(){this.closed=!0,this.views.clear(),this.source.set([]);for(let e of this.viewsByReference.values())e.dispose()}prune(e){e.sessionId===this.selected||e.hasRetainedTabs||this.views.get(e.sessionId)!==e||(this.views.delete(e.sessionId),this.publish(),e.retire())}publish(){this.source.set([...this.views.values()].sort((e,t)=>e.sessionId.localeCompare(t.sessionId)).map(e=>({sessionId:e.sessionId,reference:e.reference,selected:e.sessionId===this.selected,retainTab:e.retainTab})))}};function pl(){let e=globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16)),t=Array.from(e,(e,t)=>(t===6?e&15|64:t===8?e&63|128:e).toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}var ml=class{navigator;pin;bySession=/* @__PURE__ */ new Map;constructor(e,t){this.navigator=e,this.pin=t}sync(e,t){let n=this.session(e);for(let[e,r]of n)t.tabs[e]===void 0&&(n.delete(e),r.controller.abort());for(let r of Object.values(t.tabs)){let i=n.get(r.id)??this.hold(e,r.id,{address:r.contentId,params:void 0,revision:0}),a=(0,h.findTabPane)(t,r.id);i.paneId=a.host===`dock`?a.id:void 0,!i.pinned&&(i.pinned=!0,this.pin(i.navigation.getSnapshot().address,i.signal))}}occurrence(e,t){let n=this.bySession.get(e)?.get(t.id);if(n===void 0)throw Error(`sidebarRight: tab "${t.id}" has no committed occurrence in session "${e}"`);return n}navigate(e,t,n){let r=this.session(e).get(t);r===void 0?this.hold(e,t,{...n,revision:1}):r.navigation.set({...n,revision:r.navigation.getSnapshot().revision+1})}dispose(){for(let e of this.bySession.values())for(let t of e.values())t.controller.abort();this.bySession.clear()}session(e){let t=this.bySession.get(e);return t===void 0&&(t=/* @__PURE__ */ new Map,this.bySession.set(e,t)),t}hold(e,t,n){let r=new AbortController,{navigator:i}=this,a=e=>({...e.replaceTab===!0?{replaceTab:t}:o.paneId===void 0?{}:{paneId:o.paneId},...e.paneId===void 0?{}:{paneId:e.paneId},...e.preferNewPane===void 0?{}:{preferNewPane:e.preferNewPane},...e.revealIfOpened===void 0?{}:{revealIfOpened:e.revealIfOpened}}),o={id:pl(),sessionId:e,tabId:t,controller:r,commands:{},signal:r.signal,navigation:(0,g.createSnapshotStore)(n),paneId:void 0,pinned:!1,tabActions:{bindCommands:e=>{if(r.signal.aborted)return()=>{};o.commands=e;let t=()=>{o.commands===e&&(o.commands={}),r.signal.removeEventListener(`abort`,t)};return r.signal.addEventListener(`abort`,t,{once:!0}),t},openResource:(t,n={})=>{i.openResourceIn(e,t,{...a(n),params:n.params})},openTab:(t,n={})=>{i.openTabIn(e,t,{...a(n),params:n.params})},close:()=>{i.closeIn(e,t)}}};return this.session(e).set(t,o),o}},hl=class{sessions=/* @__PURE__ */ new Map;snapshot=(0,g.createSnapshotStore)([]);source=this.snapshot;constructor(){try{if(typeof localStorage>`u`)return;let e=Array.from({length:localStorage.length},(e,t)=>localStorage.key(t));for(let t of e){if(t===null||!t.startsWith(`dsh.sidebar-right.v1.`))continue;let e=t.slice(21),n=Pc(e);n!==void 0&&this.sessions.set(e,Object.values(n.layout.tabs).map(t=>({sessionId:e,tabId:t.id,kind:t.kind,contentId:t.contentId})))}this.publish()}catch{}}update(e,t){this.sessions.set(e,t.map(t=>({sessionId:e,tabId:t.id,kind:t.kind,contentId:t.contentId}))),this.publish()}remove(e){this.sessions.delete(e),this.publish()}publish(){let e=[...this.sessions.values()].flat();JSON.stringify(e)!==JSON.stringify(this.snapshot.getSnapshot())&&this.snapshot.set(e)}};function gl(e,t,n){let r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=(0,g.createSnapshotStore)(void 0),o=new hl,s=new _l(e,t,n,{adopted:r,rooms:i,onScreen:a,openTabs:o.source});return{controller:s,forget:e=>{o.remove(e),i.delete(e)},show:e=>{a.getSnapshot()!==e&&a.set(e)},measure:(e,t)=>{i.set(e,t)},adopt(e,t){r.get(e)?.unsubscribe();let n=()=>{let n=t.getSnapshot().bySession[e];o.update(e,Object.values(n?.layout.tabs??{})),n!==void 0&&s.tabDomain.sync(e,n.layout)},i={store:t,unsubscribe:t.subscribe(n)};return r.set(e,i),n(),()=>{i.unsubscribe(),r.get(e)===i&&r.delete(e)}}}}var _l=class{tabs;host;openTabs;mounted;adopted;rooms;closeHandlers=/* @__PURE__ */ new Map;registerCloseHandler(e,t){if(this.closeHandlers.has(e))throw Error(`sidebarRight: close handler already registered for ${e}`);return this.closeHandlers.set(e,t),()=>{this.closeHandlers.get(e)===t&&this.closeHandlers.delete(e)}}tabDomain;constructor(e,t,n,r){this.tabs=e,this.host=n,this.adopted=r.adopted,this.rooms=r.rooms,this.mounted=r.onScreen,this.openTabs=r.openTabs,this.tabDomain=new ml(this,t)}tabsIn(e){return Object.values(this.adopted.get(e)?.store.getSnapshot().bySession[e]?.layout.tabs??{})}openResource(e,t={}){let{sessionId:n,actions:r}=this.require();this.placeResource(n,r,e,t)}openTab(e,t={}){let{sessionId:n,actions:r}=this.require();this.placeTab(n,r,e,t)}openResourceIn(e,t,n={}){let r=this.actionsFor(e);r!==void 0&&this.placeResource(e,r,t,n)}openTabIn(e,t,n={}){let r=this.actionsFor(e);r!==void 0&&this.placeTab(e,r,t,n)}closeIn(e,t){let n=this.actionsFor(e),r=this.adopted.get(e)?.store.getSnapshot().bySession[e];if(n===void 0||r===void 0)return;let i=r.layout.tabs[t];i!==void 0&&Lc(r,t)&&this.removeAfterCleanup(e,i,()=>{n.closeTab(e,t)})}removeAfterCleanup(e,t,n){this.closeHandlers.get(t.kind)?.(e,t),n()}placeResource(e,t,n,r){if(!n.startsWith(`dsh-resource://`))throw Error(`sidebarRight: no registered tab type claims "${n}"`);this.place(e,t,this.tabs.claim(n,r.kind),n,r,r.params)}placeTab(e,t,n,r){let i=this.tabs.get(n);if(i===void 0)throw Error(`sidebarRight: no tab type is registered as "${n}"`);let a=i.multiple===!0?`${A(n)}/${pl()}`:A(n);this.place(e,t,{kind:n,contentId:a,title:i.title(a)},a,r,r.params)}place(e,t,n,r,i,a){let o=this.adopted.get(e)?.store.getSnapshot().bySession[e],s=o===void 0?void 0:i.paneId??(0,h.activeDockPaneId)(o.layout),c=s===void 0?void 0:o?.layout.nodes[s],l=i.preferNewPane===!0&&i.replaceTab===void 0&&o!==void 0&&c?.kind===`pane`&&c.host===`dock`&&c.tabs.length>0&&(0,h.canSplit)(o.layout)&&(0,h.dockPaneIds)(o.layout).length<2&&this.mounted.getSnapshot()===e&&this.canSplitPane(e,c.id),u=()=>{t.openContent(e,{kind:n.kind,contentId:n.contentId,title:n.title,...i.paneId===void 0?{}:{paneId:i.paneId},...l?{preferNewPane:!0}:{},...i.replaceTab===void 0?{}:{replaceTab:i.replaceTab},...i.revealIfOpened===void 0?{}:{revealIfOpened:i.revealIfOpened}},t=>{this.tabDomain.navigate(e,t,{address:r,params:a})})},d=o?.layout,f=i.replaceTab===void 0?void 0:d?.tabs[i.replaceTab],p=f===void 0||d===void 0?void 0:(0,h.findTabPane)(d,f.id),m=d===void 0?void 0:n.contentId===A(n.kind)?(0,h.findPaneContentTab)(d,p?.host===`dock`?p.id:i.paneId??(0,h.activeDockPaneId)(d),n.contentId,n.kind):i.revealIfOpened===!1?void 0:(0,h.findContentTab)(d,n.contentId,n.kind);f===void 0||f.id===m?u():this.removeAfterCleanup(e,f,u)}close(e){this.closeIn(this.require().sessionId,e)}active(){let e=this.mountedSurface()?.layout;if(e===void 0)return;let{activeTabId:t}=(0,h.getPane)(e,e.activePaneId);return Object.values(e.tabs).find(e=>e.id===t)}isExpanded(){return this.mountedSurface()?.layout.expanded??!1}toggleExpanded(){let{sessionId:e,actions:t}=this.require();this.host.openWithFocus(e,()=>{t.toggleExpanded(e);let n=this.mountedSurface()?.layout;return n?.expanded?(0,h.activeDockPaneId)(n):void 0})}focus(e){let{sessionId:t,actions:n}=this.require();this.mountedSurface()?.layout.tabs[e]!==void 0&&n.focusTab(t,e)}focusedTarget(e=document.activeElement){let t=this.screen();return t===void 0?void 0:v(e,t.sessionId,t.surface.layout,e=>this.tabDomain.occurrence(t.sessionId,{id:e}))}commandTarget(e=document.activeElement){let t=this.focusedTarget(e);if(t!==void 0||e?.closest(`[data-sidebar-right-session]`))return t;let n=this.screen();if(n===void 0)return;let{sessionId:r,surface:{layout:i}}=n,a=(0,h.getPane)(i,(0,h.activeDockPaneId)(i)),o=a.activeTabId,s=o===void 0?void 0:this.tabDomain.occurrence(r,{id:o});return{sessionId:r,paneId:a.id,host:a.host,tabId:o,occurrence:s,navigationRevision:s?.navigation.getSnapshot().revision}}openTabFromTarget(e,t){if(!this.isTargetCurrent(t))return;let{sessionId:n,actions:r}=this.require();this.host.openWithFocus(n,()=>{let i=t.tabId===void 0?void 0:this.mountedSurface()?.layout.tabs[t.tabId];return t.host===`float`&&i?.kind===e&&this.tabs.get(e)?.multiple!==!0?(r.setExpanded(n,!0),this.focus(i.id)):this.openTab(e,{...t.host===`dock`?{paneId:t.paneId}:{},...i?.kind===`guide`?{replaceTab:i.id}:{}}),this.mountedSurface()?.layout.activePaneId})}canCloseTarget(e){return this.isTargetCurrent(e)&&e.tabId!==void 0}closeTarget(e){if(!this.isTargetCurrent(e))return`stale`;let t=this.mountedSurface();if(t===void 0||e.tabId===void 0)return`unavailable`;let n=e.tabId,{sessionId:r,actions:i}=this.require();return this.host.closeWithFocus(r,e.paneId,()=>{Lc(t,n)?this.close(n):i.setExpanded(r,!1)}),`closed`}isTargetCurrent(e){if(this.mounted.getSnapshot()!==e.sessionId)return!1;let t=this.mountedSurface()?.layout,n=t?.nodes[e.paneId];if(n?.kind!==`pane`||n.host!==e.host)return!1;if(e.tabId===void 0)return n.activeTabId===void 0;if(!n.tabs.includes(e.tabId)||t?.tabs[e.tabId]===void 0)return!1;let r=this.tabDomain.occurrence(e.sessionId,{id:e.tabId});return r===e.occurrence&&!r.signal.aborted&&r.navigation.getSnapshot().revision===e.navigationRevision}splitBlock(e){let t=this.mountedSurface();if(t===void 0||!this.isTargetCurrent(e))return`stale`;let{layout:n}=t;if(e.host===`float`)return`float`;if(!n.expanded)return`collapsed`;if((0,h.getPane)(n,e.paneId).tabs.length===0)return`empty`;if(!(0,h.canSplit)(n)||(0,h.dockPaneIds)(n).length>=2)return`budget`;if(!this.canSplitPane(e.sessionId,e.paneId))return`width`}toggleFullscreen(e){if(!this.isTargetCurrent(e)||e.host===`float`||!this.isExpanded())return;let{sessionId:t,actions:n}=this.require(),r=this.host.autoFullscreen(),i=r||this.mountedSurface()?.layout.mode===`fullscreen`;i&&r&&n.setExpanded(t,!1),n.setMode(t,i?`push`:`fullscreen`)}split(e){let{sessionId:t,actions:n}=this.require(),r=this.mountedSurface()?.layout;if(r===void 0)return;let i=e??(0,h.activeDockPaneId)(r),a=r.nodes[i];if(a===void 0||a.kind!==`pane`||a.host!==`dock`||!(0,h.canSplit)(r)||(0,h.dockPaneIds)(r).length>=2||!this.canSplitPane(t,i))return;let o;return this.host.openWithFocus(t,()=>(n.splitPane(t,i,e=>{o=e}),o)),o}float(e,t){let{sessionId:n,actions:r}=this.require(),i=this.mountedSurface()?.layout;i!==void 0&&i.tabs[e]!==void 0&&(0,h.findTabPane)(i,e).host===`dock`&&r.floatTab(n,e,t)}dock(e){let{sessionId:t,actions:n}=this.require(),r=this.mountedSurface()?.layout.nodes[e];r!==void 0&&r.kind===`pane`&&r.host===`float`&&n.unfloatPane(t,e)}_undo(){let{sessionId:e,actions:t}=this.require();t.undo(e)}_redo(){let{sessionId:e,actions:t}=this.require();t.redo(e)}screen(){let e=this.mounted.getSnapshot();if(e===void 0)return;let t=this.adopted.get(e)?.store.getSnapshot().bySession[e];return t===void 0?void 0:{sessionId:e,surface:t}}mountedSurface(){return this.screen()?.surface}canSplitPane(e,t){return this.rooms.get(e)?.(t)??!0}actionsFor(e){return this.adopted.get(e)?.store.actions}require(){let e=this.mounted.getSnapshot(),t=e===void 0?void 0:this.actionsFor(e);if(e===void 0||t===void 0)throw Error(`sidebarRight: no session surface is mounted`);return{sessionId:e,actions:t}}},vl=/* @__PURE__ */ l(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),yl=/* @__PURE__ */ l((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=vl();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),bl=/* @__PURE__ */ l(((e,t)=>{let n=yl(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=vl(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],ee=[],T=e,E=-1,D=0,O=0,te=!1,ne=!1,k=!1,re=!1,ie=!1,A=!1,j=!1,M=!1,N=!1,P=!1,ae=0,F,I,L={value:``,depth:0,isGlob:!1},R=()=>E>=x,z=()=>T.charCodeAt(E+1),B=()=>(F=I,T.charCodeAt(++E));for(;E<x;){I=B();let e;if(I===a)j=L.backslashes=!0,I=B(),I===u&&(A=!0);else{if(A===!0||I===u){for(ae++;R()!==!0&&(I=B());)if(I===a)j=L.backslashes=!0,B();else if(I===u)ae++;else{if(A!==!0&&I===s&&(I=B())===s||A!==!0&&I===o){if(te=L.isBrace=!0,k=L.isGlob=!0,P=!0,S===!0)continue;break}if(I===h&&(ae--,ae===0)){A=!1,te=L.isBrace=!0,P=!0;break}}if(S===!0)continue;break}if(I===l){if(C.push(E),w.push(L),L={value:``,depth:0,isGlob:!1},P===!0)continue;if(F===s&&E===D+1){D+=2;continue}O=E+1}else{if(b.noext!==!0&&(I===p||I===i||I===r||I===m||I===c)&&z()===d){if(k=L.isGlob=!0,re=L.isExtglob=!0,P=!0,I===c&&E===D&&(N=!0),S===!0){for(;R()!==!0&&(I=B());)if(I===a)j=L.backslashes=!0,I=B();else if(I===g){k=L.isGlob=!0,P=!0;break}continue}break}if(I===r){if(F===r&&(ie=L.isGlobstar=!0),k=L.isGlob=!0,P=!0,S===!0)continue;break}if(I===m){if(k=L.isGlob=!0,P=!0,S===!0)continue;break}if(I===f){for(;R()!==!0&&(e=B());)if(e===a)j=L.backslashes=!0,B();else if(e===_){ne=L.isBracket=!0,k=L.isGlob=!0,P=!0;break}if(S===!0)continue;break}if(b.nonegate!==!0&&I===c&&E===D)M=L.negated=!0,D++;else{if(b.noparen!==!0&&I===d){if(k=L.isGlob=!0,S===!0){for(;R()!==!0&&(I=B());)if(I===d)j=L.backslashes=!0,I=B();else if(I===g){P=!0;break}continue}break}if(k===!0){if(P=!0,S===!0)continue;break}}}}}b.noext===!0&&(re=!1,k=!1);let V=T,oe=``,se=``;D>0&&(oe=T.slice(0,D),T=T.slice(D),O-=D),V&&k===!0&&O>0?(V=T.slice(0,O),se=T.slice(O)):k===!0?(V=``,se=T):V=T,V&&V!==``&&V!==`/`&&V!==T&&v(V.charCodeAt(V.length-1))&&(V=V.slice(0,-1)),b.unescape===!0&&(se&&=n.removeBackslashes(se),V&&j===!0&&(V=n.removeBackslashes(V)));let H={prefix:oe,input:e,start:D,base:V,glob:se,isBrace:te,isBracket:ne,isGlob:k,isExtglob:re,isGlobstar:ie,negated:M,negatedExtglob:N};if(b.tokens===!0&&(H.maxDepth=0,v(I)||w.push(L),H.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:D,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&D!==0?(w[n].isPrefix=!0,w[n].value=oe):w[n].value=a,y(w[n]),H.maxDepth+=w[n].depth),(n!==0||a!==``)&&ee.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);ee.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),H.maxDepth+=w[w.length-1].depth)}H.slashes=C,H.parts=ee}return H}})),xl=/* @__PURE__ */ l(((e,t)=>{let n=vl(),r=yl(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e)if(o===!0)a+=s,o=!1;else if(s===`\\`)a+=s,o=!0;else if(s===`"`)i=i===1?0:1,a+=s;else{if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e)if(t===!0)t=!1;else if(n===`\\`)t=!0;else if(/[?*+@!()[\]{}]/.test(n))return!1;return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(a&&r===a.repeat(r.length)&&i===a.repeat(i.length)&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0)a=!1;else if(s===`\\`)a=!0;else if(s===`"`)i=i===1?0:1;else if(i!==1){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(!(n>0)){if(s===`(`)r++;else if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1)a.push(n);else if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:ee,NO_DOT:T,NO_DOT_SLASH:E,NO_DOTS_SLASH:D,QMARK:O,QMARK_NO_DOT:te,STAR:ne,START_ANCHOR:k}=_,re=e=>`(${g}(?:(?!${k}${e.dot?ee:x}).)*?)`,ie=d.dot?``:T,A=d.dot?O:te,j=d.bash===!0?re(d):ne;d.capture&&(j=`(${j})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let M={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,M),p=e.length;let N=[],P=[],ae=[],F=m,I,L=()=>M.index===p-1,R=M.peek=(t=1)=>e[M.index+t],z=M.advance=()=>e[++M.index]||``,B=()=>e.slice(M.index+1),V=(e=``,t=0)=>{M.consumed+=e,M.index+=t},oe=e=>{M.output+=e.output==null?e.value:e.output,V(e.value)},se=()=>{let e=1;for(;R()===`!`&&(R(2)!==`(`||R(3)===`?`);)z(),M.start++,e++;return e%2!=0&&(M.negated=!0,M.start++,!0)},H=e=>{M[e]++,ae.push(e)},ce=e=>{M[e]--,ae.pop()},U=e=>{if(F.type===`globstar`){let t=M.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||N.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(M.output=M.output.slice(0,-F.output.length),F.type=`star`,F.value=`*`,F.output=j,M.output+=F.output)}N.length&&e.type!==`paren`&&(N[N.length-1].inner+=e.value),(e.value||e.output)&&oe(e),F&&F.type===`text`&&e.type===`text`?(F.output=(F.output||F.value)+e.value,F.value+=e.value):(e.prev=F,h.push(e),F=e)},le=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=F,n.parens=M.parens,n.output=M.output,n.startIndex=M.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;H(`parens`),U({type:e,value:t,output:M.output?``:w}),U({type:`paren`,extglob:!0,value:z(),output:r}),N.push(n)},ue=n=>{let i=e.slice(n.startIndex,M.index+1),a=e.slice(n.startIndex+2,M.index),o=y(a,d);if((n.type===`plus`||n.type===`star`)&&o.risky){let e=o.safeOutput?(n.output?``:w)+(d.capture?`(${o.safeOutput})`:o.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;M.output=n.output+t.output,M.backtrack=!0,U({type:`paren`,extglob:!0,value:I,output:``}),ce(`parens`);return}let s=n.close+(d.capture?`)`:``),c;if(n.type===`negate`){let e=j;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=re(d)),(e!==j||L()||/^\)+$/.test(B()))&&(s=n.close=`)$))${e}`),n.inner.includes(`*`)&&(c=B())&&/^\.[^\\/.]+$/.test(c)&&(s=n.close=`)${b(c,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(M.negatedExtglob=!0)}U({type:`paren`,extglob:!0,value:I,output:s}),ce(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?O.repeat(a.length):``):o===0?A+(a?O.repeat(a.length):``):O.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?j:``):j:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(M.output=e,M):(M.output=r.wrapOutput(i,M,t),M)}for(;!L();){if(I=z(),I===`\0`)continue;if(I===`\\`){let e=R();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){I+=`\\`,U({type:`text`,value:I});continue}let t=/^\\+/.exec(B()),n=0;if(t&&t[0].length>2&&(n=t[0].length,M.index+=n,n%2!=0&&(I+=`\\`)),d.unescape===!0?I=z():I+=z(),M.brackets===0){U({type:`text`,value:I});continue}}if(M.brackets>0&&(I!==`]`||F.value===`[`||F.value===`[^`)){if(d.posix!==!1&&I===`:`){let e=F.value.slice(1);if(e.includes(`[`)&&(F.posix=!0,e.includes(`:`))){let e=F.value.lastIndexOf(`[`),t=F.value.slice(0,e),n=F.value.slice(e+2),r=a[n];if(r){F.value=t+r,M.backtrack=!0,z(),!m.output&&h.indexOf(F)===1&&(m.output=w);continue}}}(I===`[`&&R()!==`:`||I===`-`&&R()===`]`)&&(I=`\\${I}`),I===`]`&&(F.value===`[`||F.value===`[^`)&&(I=`\\${I}`),d.posix===!0&&I===`!`&&F.value===`[`&&(I=`^`),F.value+=I,oe({value:I});continue}if(M.quotes===1&&I!==`"`){I=r.escapeRegex(I),F.value+=I,oe({value:I});continue}if(I===`"`){M.quotes=M.quotes===1?0:1,d.keepQuotes===!0&&U({type:`text`,value:I});continue}if(I===`(`){H(`parens`),U({type:`paren`,value:I});continue}if(I===`)`){if(M.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=N[N.length-1];if(e&&M.parens===e.parens+1){ue(N.pop());continue}U({type:`paren`,value:I,output:M.parens?`)`:`\\)`}),ce(`parens`);continue}if(I===`[`){if(d.nobracket===!0||!B().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));I=`\\${I}`}else H(`brackets`);U({type:`bracket`,value:I});continue}if(I===`]`){if(d.nobracket===!0||F&&F.type===`bracket`&&F.value.length===1){U({type:`text`,value:I,output:`\\${I}`});continue}if(M.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));U({type:`text`,value:I,output:`\\${I}`});continue}ce(`brackets`);let e=F.value.slice(1);if(F.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(I=`/${I}`),F.value+=I,oe({value:I}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(F.value);if(M.output=M.output.slice(0,-F.value.length),d.literalBrackets===!0){M.output+=t,F.value=t;continue}F.value=`(${g}${t}|${F.value})`,M.output+=F.value;continue}if(I===`{`&&d.nobrace!==!0){H(`braces`);let e={type:`brace`,value:I,output:`(`,outputIndex:M.output.length,tokensIndex:M.tokens.length};P.push(e),U(e);continue}if(I===`}`){let e=P[P.length-1];if(d.nobrace===!0||!e){U({type:`text`,value:I,output:I});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),M.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=M.output.slice(0,e.outputIndex),r=M.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,I=t=`\\}`,M.output=n;for(let e of r)M.output+=e.output||e.value}U({type:`brace`,value:I,output:t}),ce(`braces`),P.pop();continue}if(I===`|`){N.length>0&&N[N.length-1].conditions++,U({type:`text`,value:I});continue}if(I===`,`){let e=I,t=P[P.length-1];t&&ae[ae.length-1]===`braces`&&(t.comma=!0,e=`|`),U({type:`comma`,value:I,output:e});continue}if(I===`/`){if(F.type===`dot`&&M.index===M.start+1){M.start=M.index+1,M.consumed=``,M.output=``,h.pop(),F=m;continue}U({type:`slash`,value:I,output:C});continue}if(I===`.`){if(M.braces>0&&F.type===`dot`){F.value===`.`&&(F.output=x);let e=P[P.length-1];F.type=`dots`,F.output+=I,F.value+=I,e.dots=!0;continue}if(M.braces+M.parens===0&&F.type!==`bos`&&F.type!==`slash`){U({type:`text`,value:I,output:x});continue}U({type:`dot`,value:I,output:x});continue}if(I===`?`){if(!(F&&F.value===`(`)&&d.noextglob!==!0&&R()===`(`&&R(2)!==`?`){le(`qmark`,I);continue}if(F&&F.type===`paren`){let e=R(),t=I;(F.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(B()))&&(t=`\\${I}`),U({type:`text`,value:I,output:t});continue}if(d.dot!==!0&&(F.type===`slash`||F.type===`bos`)){U({type:`qmark`,value:I,output:te});continue}U({type:`qmark`,value:I,output:O});continue}if(I===`!`){if(d.noextglob!==!0&&R()===`(`&&(R(2)!==`?`||!/[!=<:]/.test(R(3)))){le(`negate`,I);continue}if(d.nonegate!==!0&&M.index===0){se();continue}}if(I===`+`){if(d.noextglob!==!0&&R()===`(`&&R(2)!==`?`){le(`plus`,I);continue}if(F&&F.value===`(`||d.regex===!1){U({type:`plus`,value:I,output:S});continue}if(F&&(F.type===`bracket`||F.type===`paren`||F.type===`brace`)||M.parens>0){U({type:`plus`,value:I});continue}U({type:`plus`,value:S});continue}if(I===`@`){if(d.noextglob!==!0&&R()===`(`&&R(2)!==`?`){U({type:`at`,extglob:!0,value:I,output:``});continue}U({type:`text`,value:I});continue}if(I!==`*`){(I===`$`||I===`^`)&&(I=`\\${I}`);let e=o.exec(B());e&&(I+=e[0],M.index+=e[0].length),U({type:`text`,value:I});continue}if(F&&(F.type===`globstar`||F.star===!0)){F.type=`star`,F.star=!0,F.value+=I,F.output=j,M.backtrack=!0,M.globstar=!0,V(I);continue}let t=B();if(d.noextglob!==!0&&/^\([^?]/.test(t)){le(`star`,I);continue}if(F.type===`star`){if(d.noglobstar===!0){V(I);continue}let n=F.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){U({type:`star`,value:I,output:``});continue}let o=M.braces>0&&(n.type===`comma`||n.type===`brace`),s=N.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){U({type:`star`,value:I,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[M.index+4];if(n&&n!==`/`)break;t=t.slice(3),V(`/**`,3)}if(n.type===`bos`&&L()){F.type=`globstar`,F.value+=I,F.output=re(d),M.output=F.output,M.globstar=!0,V(I);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&L()){M.output=M.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type=`globstar`,F.output=re(d)+(d.strictSlashes?`)`:`|$)`),F.value+=I,M.globstar=!0,M.output+=n.output+F.output,V(I);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;M.output=M.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type=`globstar`,F.output=`${re(d)}${C}|${C}${e})`,F.value+=I,M.output+=n.output+F.output,M.globstar=!0,V(I+z()),U({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){F.type=`globstar`,F.value+=I,F.output=`(?:^|${C}|${re(d)}${C})`,M.output=F.output,M.globstar=!0,V(I+z()),U({type:`slash`,value:`/`,output:``});continue}M.output=M.output.slice(0,-F.output.length),F.type=`globstar`,F.output=re(d),F.value+=I,M.output+=F.output,M.globstar=!0,V(I);continue}let n={type:`star`,value:I,output:j};d.bash===!0?(n.output=`.*?`,(F.type===`bos`||F.type===`slash`)&&(n.output=ie+n.output),U(n)):F&&(F.type===`bracket`||F.type===`paren`)&&d.regex===!0?(n.output=I,U(n)):((M.index===M.start||F.type===`slash`||F.type===`dot`)&&(F.type===`dot`?(M.output+=E,F.output+=E):d.dot===!0?(M.output+=D,F.output+=D):(M.output+=ie,F.output+=ie),R()!==`*`&&(M.output+=w,F.output+=w)),U(n))}for(;M.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));M.output=r.escapeLast(M.output,`[`),ce(`brackets`)}for(;M.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));M.output=r.escapeLast(M.output,`(`),ce(`parens`)}for(;M.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));M.output=r.escapeLast(M.output,`{`),ce(`braces`)}if(d.strictSlashes!==!0&&(F.type===`star`||F.type===`bracket`)&&U({type:`maybe_slash`,value:``,output:`${C}?`}),M.backtrack===!0){M.output=``;for(let e of M.tokens)M.output+=e.output==null?e.value:e.output,e.suffix&&(M.output+=e.suffix)}return M};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},ee=w(r.removePrefix(e,x));return ee&&a.strictSlashes!==!0&&(ee+=`${u}?`),ee},t.exports=b})),Sl=/* @__PURE__ */ l(((e,t)=>{let n=bl(),r=xl(),i=yl(),a=vl(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),!r||p)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),Cl=/* @__PURE__ */ d((/* @__PURE__ */ l(((e,t)=>{t.exports=Sl()})))(),1);let wl={extension:3,builtin:2,fallback:1};function Tl(e,t){return t!==`fallback`&&e.inForce.band!==`fallback`&&e.inForce.band!==t&&e.shadowed===void 0}function El(e){try{return new URL(e).pathname}catch{return}}function Dl(e){let t=e.includes(`:`),n=(0,Cl.default)(e,{nocase:!0,dot:!0,...t?{}:{basename:!0}});return e=>{if(t)return n(e);let r=El(e);return r!==void 0&&n(r)}}var Ol=class{ctx;kinds=/* @__PURE__ */ new Map;ids=/* @__PURE__ */ new Set;listeners=/* @__PURE__ */ new Set;registrations=0;cached=[];guideEntries=[];constructor(e){this.ctx=e}register(e){let{id:t,kind:n}=e,r=e.guide??[];if(new Set(r.map(e=>e.id)).size!==r.length)throw Error(`sidebarRight: duplicate guide entry id in "${t}"`);let i=e.priority??`extension`;if(this.ids.has(t))throw Error(`sidebarRight: tab type id "${t}" is already registered`);let a=this.kinds.get(n);if(a!==void 0&&!Tl(a,i))throw Error(`sidebarRight: tab kind "${n}" is already registered (${a.inForce.band})`);this.registrations+=1;let o={definition:e,band:i,matchers:(e.patterns??[]).map(e=>({pattern:e,test:Dl(e)})),order:this.registrations},s=this.ctx.effect(()=>{this.ids.add(t);let e=this.enter(n,o);return this.refresh(),()=>{this.ids.delete(t),this.leave(n,e,o),this.refresh()}},`sidebarRight.tabs.register(${JSON.stringify(t)})`);return()=>{s()}}enter(e,t){let n=this.kinds.get(e);if(n===void 0){let n={inForce:t,shadowed:void 0};return this.kinds.set(e,n),n}return wl[t.band]>wl[n.inForce.band]?(n.shadowed=n.inForce,n.inForce=t):n.shadowed=t,n}leave(e,t,n){t.inForce===n?t.shadowed===void 0?this.kinds.delete(e):(t.inForce=t.shadowed,t.shadowed=void 0):t.shadowed=void 0}active(){return[...this.kinds.values()].map(e=>e.inForce).sort((e,t)=>e.order-t.order)}entries(){return this.cached}guide(){return this.guideEntries}get(e){return this.kinds.get(e)?.inForce.definition}candidates(e){let t=[];for(let{definition:n,band:r,matchers:i,order:a}of this.active()){let o=-1;for(let t of i)t.test(e)&&t.pattern.length>o&&(o=t.pattern.length);o<0||(n.canOpen===void 0||n.canOpen(e))&&t.push({definition:n,rank:wl[r],length:o,order:a})}return t.sort((e,t)=>t.rank-e.rank||t.length-e.length||e.order-t.order),t.map(e=>e.definition)}claim(e,t){if(t!==void 0){let n=this.get(t);if(n===void 0)throw Error(`sidebarRight: no tab type is registered as "${t}"`);if(n.canOpen!==void 0&&!n.canOpen(e))throw Error(`sidebarRight: tab type "${t}" refuses "${e}"`);return{kind:t,contentId:e,title:n.title(e)}}let[n]=this.candidates(e);if(n===void 0)throw Error(`sidebarRight: no registered tab type claims "${e}"`);return{kind:n.kind,contentId:e,title:n.title(e)}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}refresh(){this.cached=this.active().map(e=>e.definition),this.guideEntries=this.cached.flatMap(e=>(e.guide??[]).map(t=>({...t,kind:e.kind,providerId:e.id}))).sort((e,t)=>e.order-t.order),(0,g.notifySubscribers)(this.listeners,`[ui-sidebar-right] tab registry`)}};let kl={"command.close":`关闭当前页面/窗口`,"command.refresh":`刷新当前页面`,"command.noRefresh":`当前页面不支持刷新`,"command.toggle":`展开/收起右侧栏`,"command.fullscreen":`面板全屏/退出全屏`,"command.noSession":`请先选择会话`,"command.noFocus":`请先聚焦右侧面板`,"command.stale":`页面已切换,请重新聚焦`,"command.collapsed":`请先展开右侧栏`,"command.float":`浮动面板不支持此操作`,"command.empty":`请先打开页面`,"command.budget":`已达两格上限`,"command.width":`栏宽不足,拖宽侧边栏后再分栏`,"chrome.expand":`打开侧边栏`,"chrome.expandAria":`打开右侧边栏`,"chrome.collapse":`收起侧边栏`,"chrome.collapseAria":`收起右侧边栏`,"chrome.toFullscreen":`全屏`,"chrome.exitFullscreen":`退出全屏`,"dock.emptyPane":`空面板`,"dock.splitPane":`分栏`,"dock.splitPaneDisabled":`已达两格上限`,"dock.splitPaneNarrow":`栏宽不足,拖宽侧边栏后再分栏`,"dock.closeTab":`关闭`,"dock.addTab":`新标签页`,"dock.dockFloat":`收回到侧边栏`,"dock.closeFloat":`关闭`,"dock.drop.center":`移到这里`,"dock.drop.left":`左分栏`,"dock.drop.right":`右分栏`,"dock.drop.top":`上分栏`,"dock.drop.bottom":`下分栏`,"tab.guide.title":`开始`,"tab.unavailable":`这类内容还没有可用的查看方式。`},Al={"command.close":`Close current page or window`,"command.refresh":`Refresh current page`,"command.noRefresh":`This page cannot be refreshed`,"command.toggle":`Toggle right sidebar`,"command.fullscreen":`Toggle panel fullscreen`,"command.noSession":`Select a session first`,"command.noFocus":`Focus a right sidebar pane first`,"command.stale":`The page changed; focus it again`,"command.collapsed":`Expand the right sidebar first`,"command.float":`This action is unavailable in a floating panel`,"command.empty":`Open a page first`,"command.budget":`Two panes is the limit`,"command.width":`Not enough width to split, widen the sidebar`,"chrome.expand":`Open sidebar`,"chrome.expandAria":`Open right sidebar`,"chrome.collapse":`Collapse sidebar`,"chrome.collapseAria":`Collapse right sidebar`,"chrome.toFullscreen":`Fullscreen`,"chrome.exitFullscreen":`Exit fullscreen`,"dock.emptyPane":`Empty pane`,"dock.splitPane":`Split`,"dock.splitPaneDisabled":`Two panes is the limit`,"dock.splitPaneNarrow":`Not enough width to split, widen the sidebar`,"dock.closeTab":`Close`,"dock.addTab":`New tab`,"dock.dockFloat":`Send back to the sidebar`,"dock.closeFloat":`Close`,"dock.drop.center":`Move here`,"dock.drop.left":`Add left split`,"dock.drop.right":`Add right split`,"dock.drop.top":`Add top split`,"dock.drop.bottom":`Add bottom split`,"tab.guide.title":`Start`,"tab.unavailable":`Nothing here can view this kind of content yet.`},jl=`@deepseek-ai/dsh-client-ui-sidebar-right/guide`;function Ml(e){return{id:jl,kind:ie,priority:`builtin`,title:()=>e(`tab.guide.title`)}}let Nl=(e,t)=>{let{sessionId:n}=e,{tabId:r,title:i,fullscreen:a,active:o,signal:s,actions:c,useStore:l,useTabNavigation:u,shortcuts:d}=t;return function(){let e=l(e=>e.bySession[n]?.layout),t=u(r);return(0,m.useMemo)(()=>{let l=e?.tabs[r];if(e===void 0||l===void 0||t===void 0)throw Error(`sidebarRight: tab "${r}" is not committed in session "${n}"`);let u=(0,h.findTabPane)(e,r);return{sidebar:{expanded:e.expanded,fullscreen:a},panel:{id:u.id},tab:{...l,visible:o&&(u.host===`float`||e.expanded&&(i||u.activeTabId===r)),navigation:t,signal:s,actions:c,refreshShortcut:d.find(e=>e.id===`page.refresh`)}}},[e,t,r,i,a,o,s,c,d])}},Pl=(e,t)=>t,Fl=`sidebarRight`,Il=[`slots`,`layout`,`locale`,`resources`,`sessions`,`uiSession`,`shortcuts`];function Ll(e){let t=e.locale.bind(Fl),n=new Ol(e),r=new fl(e.sessions);e.effect(()=>{let t=e.uiSession.adapter.current,n=()=>{r.select(t.getSnapshot().key)},i=t.subscribe(n);return n(),()=>{i(),r.dispose()}},`ui-sidebar-right: retained Session views`);let i=e.layout,a=!1,{controller:o,adopt:s,forget:c,show:l,measure:u}=gl(n,(t,n)=>{e.resources.pin(t,n)},{autoFullscreen:()=>a,openWithFocus:(e,t)=>{sl(document,e,t)},closeWithFocus:(e,t,n)=>{cl(document,e,t,n)}});e.effect(()=>{let e=()=>{let e=r.source.getSnapshot().find(e=>e.selected);l(i.panelInfo.getSnapshot().activePanelId===null?e?.sessionId:void 0)},t=r.source.subscribe(e),n=i.panelInfo.subscribe(e);return e(),()=>{t(),n(),l(void 0)}},`ui-sidebar-right: on-screen Session`);let d=e.reflect.provide(`sidebarRightTabs`,n),f=e.reflect.provide(`sidebarRight`,o);e.effect(()=>()=>{o.tabDomain.dispose(),f(),d()},`ui-sidebar-right: service faces`),e.effect(()=>e.locale.register(Fl,{zh:kl,en:Al}),`ui-sidebar-right: dictionaries`),e.effect(()=>x(e.shortcuts,o,t,()=>{e.shortcuts.closeWindow().catch(e=>{console.error(`Window close failed`,e)})}),`ui-sidebar-right: shortcuts`),typeof document<`u`&&e.effect(()=>b(document),`ui-sidebar-right: focus`),e.effect(()=>{let l=Jc(()=>re(n)),d=/* @__PURE__ */ new Map,f={...l,create:e=>{let t=l.create(e);if(e!==void 0){let n=e;d.get(n)?.(),d.set(n,s(n,t))}return{...t,clearPersisted(){t.clearPersisted(),e!==void 0&&c(e)}}}},p={syncPresentation({shown:e,track:t,fullscreen:n}){e?i.openRightbar(t,n):i.closeRightbar()},reportAutoFullscreen:e=>{a=e},splitPane:e=>{o.split(e)},toggleFullscreen:()=>{let e=o.commandTarget();e!==void 0&&o.toggleFullscreen(e)},openTab:(e,t)=>{o.openTab(e,t)},hooks:{shortcuts:e.shortcuts.catalog,tabTypes:{subscribe:e=>n.subscribe(e),getSnapshot:()=>n.entries()}}},m=[n.register(Ml(t))],h=e.slots.inject(`rightbar`,function*(){yield e.slots.register({name:`rightbar`,children:{"rightbar.session":{kind:`single`,scope:`session`}},inject:()=>({hooks:{views:r.source},mountView:e=>r.mount(e),setExpandedFromSwipe:(e,t)=>{o.commandTarget(null)?.sessionId===e&&o.isExpanded()!==t&&o.toggleExpanded()}})},ul),yield e.slots.register({name:`rightbar.session`,locale:Fl,children:{"sidebar.right.pane.tab":{kind:`keyed`,scope:`session`,inject:{hooks:{tabInfo:Nl}}},"sidebar.right.pane.tab.title":{kind:`keyed`,scope:`session`,inject:{hooks:{tabInfo:Nl}}},"sidebar.right.tab.menu.item":{kind:`list`,scope:`session`}},store:f,inject:e=>({...p,measureRoom:t=>{u(e,t)},closeTab:t=>{try{o.closeIn(e,t)}catch(e){console.error(`Sidebar tab close failed:`,e)}},keyedHooks:{tabNavigation:t=>o.tabDomain.occurrence(e,{id:t}).navigation},occurrence:t=>o.tabDomain.occurrence(e,t)})},ol)}),g=e.slots.inject(`conversation.session.header.corner`,()=>e.slots.register({name:`conversation.session.header.corner`,locale:Fl,store:f,inject:()=>({hooks:{shortcuts:e.shortcuts.catalog}})},k)),_={hooks:{shortcuts:e.shortcuts.catalog,guideEntries:{subscribe:e=>n.subscribe(e),getSnapshot:()=>n.guide()}}},v=e.slots.inject(`sidebar.right.pane.tab`,()=>e.slots.register({name:`sidebar.right.pane.tab`,key:jl,children:{"sidebar.right.tab.guide.entry":{kind:`keyed`,scope:`session`,inject:{hooks:{tabInfo:Pl}}},"sidebar.right.tab.guide":{kind:`chain`,scope:`session`,inject:{hooks:{tabInfo:Pl}}}},inject:()=>_},O)),y=e.slots.inject(`sidebar.right.pane.tab.title`,()=>e.slots.register({name:`sidebar.right.pane.tab.title`,key:jl},T));return()=>{y(),v(),g(),h();for(let e of m.reverse())e();for(let e of d.values())e();d.clear()}},`ui-sidebar-right: seats and shipped tab type`)}return n.apply=Ll,n.inject=Il,t.exports}});