sliccy 6.71.0 → 6.72.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 (80) hide show
  1. package/README.md +3 -2
  2. package/dist/ui/assets/{account-store-DFQ8Dgj9.js → account-store-BGgapOqM.js} +1 -1
  3. package/dist/ui/assets/{account-store-yQMPeovo.js → account-store-iHtMDYZF.js} +1 -1
  4. package/dist/ui/assets/{adobe-t02nptZw.js → adobe-Zc7Eyed7.js} +1 -1
  5. package/dist/ui/assets/{adobe-C0N_GiSE.js → adobe-oizTYfDl.js} +1 -1
  6. package/dist/ui/assets/{apply-layout-BIMv75Rh.js → apply-layout-12q9RrRr.js} +1 -1
  7. package/dist/ui/assets/{apps-N_cHAFMa.js → apps--wWNQP2K.js} +1 -1
  8. package/dist/ui/assets/{azure-openai-DCgUdhkV.js → azure-openai-Bx2BnyQH.js} +1 -1
  9. package/dist/ui/assets/{azure-openai-DITUdhKw.js → azure-openai-D4kxJ3gG.js} +1 -1
  10. package/dist/ui/assets/{cerebras-DXvruR-f.js → cerebras-BlMl7nlT.js} +1 -1
  11. package/dist/ui/assets/{cerebras-BKsOcNmK.js → cerebras-D1WDsYbu.js} +1 -1
  12. package/dist/ui/assets/{connect-surface-BxkxiSNH.js → connect-surface-OIMianve.js} +1 -1
  13. package/dist/ui/assets/{fs-DDemTXw8.js → fs-C0cX_P2D.js} +2 -2
  14. package/dist/ui/assets/{fs-mfTn4f6R.js → fs-DtHl1BTl.js} +1 -1
  15. package/dist/ui/assets/{github-D3_RDWlR.js → github-DcSH2_9B.js} +1 -1
  16. package/dist/ui/assets/{github-Cj9EgGkZ.js → github-DeOAHe_r.js} +2 -2
  17. package/dist/ui/assets/{github-copilot-Dblzr8C1.js → github-copilot-BSBEHX76.js} +1 -1
  18. package/dist/ui/assets/{github-copilot-DBMMN7nj.js → github-copilot-D6cnQZx4.js} +1 -1
  19. package/dist/ui/assets/{github-install-S3gH1LN1.js → github-install-D-qYA6oL.js} +1 -1
  20. package/dist/ui/assets/{github-zip-w452Q-_E.js → github-zip-CmFOTm1q.js} +1 -1
  21. package/dist/ui/assets/{js-realm-worker-kzfHhxZE.js → js-realm-worker-BCmp7aOj.js} +1 -1
  22. package/dist/ui/assets/{kernel-worker-CKJO9mkv.js → kernel-worker-0Totg3A4.js} +25 -25
  23. package/dist/ui/assets/{local-llm-CKMcrybN.js → local-llm-BZBzyZhe.js} +1 -1
  24. package/dist/ui/assets/{local-llm-bBO3kMGG.js → local-llm-DtjD8w3y.js} +1 -1
  25. package/dist/ui/assets/{main-NDI7TUj5.js → main-DT2PwvUH.js} +3 -3
  26. package/dist/ui/assets/{mount-DT8z_PVy.js → mount-DSS18gbH.js} +2 -2
  27. package/dist/ui/assets/{mount-C9lbsxh0.js → mount-DUfqMR7N.js} +1 -1
  28. package/dist/ui/assets/{mount-recovery-mi1lXBvI.js → mount-recovery-BhGJRk0L.js} +1 -1
  29. package/dist/ui/assets/{new-session-B4NDvbFN.js → new-session-D8YNK42w.js} +2 -2
  30. package/dist/ui/assets/{oauth-bootstrap-BTERUpnb.js → oauth-bootstrap-BSzXSCUJ.js} +2 -2
  31. package/dist/ui/assets/{openai-codex-Tm1Y39dv.js → openai-codex-CVZBg9cm.js} +1 -1
  32. package/dist/ui/assets/{openai-codex-YzN0-rk7.js → openai-codex-Z1lL6fT7.js} +1 -1
  33. package/dist/ui/assets/{openrouter-DT4yW9JI.js → openrouter-BJs8BjRN.js} +1 -1
  34. package/dist/ui/assets/{openrouter-L1Z1bzso.js → openrouter-DOH_9gEl.js} +1 -1
  35. package/dist/ui/assets/{openrouter-oauth-BbRCDNH_.js → openrouter-oauth-CeLh7v23.js} +1 -1
  36. package/dist/ui/assets/{openrouter-oauth-BNIfHZiC.js → openrouter-oauth-DNFXraId.js} +1 -1
  37. package/dist/ui/assets/{panel-rpc-handlers-DvZFQHmG.js → panel-rpc-handlers-D-I95j4E.js} +2 -2
  38. package/dist/ui/assets/{panelize-shell-BusmMR6B.js → panelize-shell-BuwzGhwR.js} +1 -1
  39. package/dist/ui/assets/{provider-CR0TbkfA.js → provider-BX_XNpoZ.js} +2 -2
  40. package/dist/ui/assets/{provider-DcNunfGw.js → provider-Bo6uW5vD.js} +1 -1
  41. package/dist/ui/assets/{provider-settings-uQZPJpQ-.js → provider-settings-DCjokX3w.js} +1 -1
  42. package/dist/ui/assets/{provider-settings-CmFmQOKw.js → provider-settings-DuMJVSU3.js} +1 -1
  43. package/dist/ui/assets/provider-store-access-C1ZWRiw6.js +1 -0
  44. package/dist/ui/assets/{provider-store-access-D39HNRa8.js → provider-store-access-Cs1o2DPs.js} +2 -2
  45. package/dist/ui/assets/{providers-CpDGMO7m.js → providers-DdpSaPOK.js} +1 -1
  46. package/dist/ui/assets/{providers-CVxe90mP.js → providers-DjBc2Tmu.js} +2 -2
  47. package/dist/ui/assets/{quick-llm-Ct6grxEh.js → quick-llm-BBqKKxsq.js} +1 -1
  48. package/dist/ui/assets/{recovery-screen-BtyCzv9Q.js → recovery-screen-ByHX7_KQ.js} +1 -1
  49. package/dist/ui/assets/{redirect-uri-Cs2XQJRH.js → redirect-uri-B6NgEOlm.js} +1 -1
  50. package/dist/ui/assets/{session-freezer-Bv1AQxPg.js → session-freezer-JT2_qyqS.js} +3 -3
  51. package/dist/ui/assets/{setup-feature-flags-remote-BqAkCaPE.js → setup-feature-flags-remote-C2IPMY_Q.js} +1 -1
  52. package/dist/ui/assets/{setup-standalone-prelude-EvR5fr1C.js → setup-standalone-prelude-CCFh12ns.js} +1 -1
  53. package/dist/ui/assets/{setup-sudo-Ba1ZKNJf.js → setup-sudo-BVYVcn5F.js} +2 -2
  54. package/dist/ui/assets/{skills-BLthDf6N.js → skills-CKC6knJt.js} +1 -1
  55. package/dist/ui/assets/slicc-version-BJ8vuJH5.js +1 -0
  56. package/dist/ui/assets/{src-BXAvZ-ei.js → src-C1dIx3UV.js} +189 -142
  57. package/dist/ui/assets/{store-DdWTmm3h.js → store-C6JqWWYW.js} +1 -1
  58. package/dist/ui/assets/{store-B-jkwqm-.js → store-hs-fjUoK.js} +1 -1
  59. package/dist/ui/assets/{sudo-BeUuC0o9.js → sudo-B6EyhWhN.js} +1 -1
  60. package/dist/ui/assets/{upgrade-detection-f52RtdSL.js → upgrade-detection-qW4qvW5A.js} +1 -1
  61. package/dist/ui/assets/{wc-attach-Cs2JeOdI.js → wc-attach-DDaQOa8_.js} +2 -2
  62. package/dist/ui/assets/{wc-extension-BI4I-KdP.js → wc-extension-DASy0DKg.js} +2 -2
  63. package/dist/ui/assets/{wc-follower-4iPR_Tul.js → wc-follower-Egi9mkfF.js} +3 -3
  64. package/dist/ui/assets/wc-live-DZ8JQMwW.js +8 -0
  65. package/dist/ui/assets/{wc-nav-B5V0ZfKc.js → wc-nav-COdLdTwW.js} +2 -2
  66. package/dist/ui/assets/{wc-onboarding-YcNmsJ75.js → wc-onboarding-BnKXeXf-.js} +2 -2
  67. package/dist/ui/assets/{wc-placeholder-DNzomi1i.js → wc-placeholder-QoCSCfPQ.js} +2 -2
  68. package/dist/ui/assets/{wc-settings--zuiJWUa.js → wc-settings-BlPzHxwH.js} +2 -2
  69. package/dist/ui/assets/wc-shell-DfslNU_R.js +117 -0
  70. package/dist/ui/assets/{wc-sprinkles-CcJhUBxA.js → wc-sprinkles-D8VUY-jR.js} +2 -2
  71. package/dist/ui/assets/{wc-tray-9TbX3W4_.js → wc-tray-ggci63Lw.js} +2 -2
  72. package/dist/ui/assets/{xai-grok-DjZBl8MI.js → xai-grok-3sJfnokt.js} +1 -1
  73. package/dist/ui/assets/{xai-grok-QgmTZ127.js → xai-grok-SLa2T0v9.js} +1 -1
  74. package/dist/ui/index.html +6 -6
  75. package/dist/ui/packages/webapp/index.html +6 -6
  76. package/package.json +1 -1
  77. package/dist/ui/assets/provider-store-access-DG1MMrgG.js +0 -1
  78. package/dist/ui/assets/slicc-version-BOhPSJSS.js +0 -1
  79. package/dist/ui/assets/wc-live-AqeIm2i0.js +0 -8
  80. package/dist/ui/assets/wc-shell-Db9tKR47.js +0 -117
@@ -694,7 +694,7 @@ slicc-agent-message .dots i:nth-child(3) { animation-delay: .32s; }
694
694
  @keyframes slicc-am-bdot { 0%, 75%, 100% { transform: translateY(0); opacity: .45; } 38% { transform: translateY(-8px); opacity: 1; } }
695
695
  slicc-agent-message .tw-caret { display: inline-block; width: 2px; height: 1.05em; vertical-align: -2px; margin-left: 1px; background: var(--ink); animation: slicc-am-cblink .9s steps(1) infinite; }
696
696
  @keyframes slicc-am-cblink { 50% { opacity: 0; } }
697
- `,Ue=`slicc-agent-message-style`;function We(e){if(e.getElementById(Ue))return;let t=e.createElement(`style`);t.id=Ue,t.textContent=He,(e.head??e.documentElement).appendChild(t)}var Ge=[`#f43f5e`,`#06b6d4`,`#8b5cf6`],Ke=new Set([``,`r`,`cy`,`vi`,`am`]);function qe(){let e=j(`div`,{class:`dots`,part:`dots`,"aria-hidden":`true`});for(let t of Ge)e.append(j(`i`,{style:`--d:${t}`}));return e}function Je(e){let t=j(`ul`,{class:`plan`,part:`plan`});for(let n of e)t.append(j(`li`,null,n));return t}function Ye(e){let t=j(`ul`,{class:`check`,part:`check`});for(let n of e){let e=n.variant&&Ke.has(n.variant)?n.variant:``,r=e?`ck ${e}`:`ck`,i=n.glyph??`✓`;t.append(j(`li`,null,j(`span`,{class:r},i),j(`span`,{class:`ctext`},n.text)))}return t}A(`slicc-agent-message`,class extends HTMLElement{static observedAttributes=[`thinking`,`streaming`,`progress`,`timestamp`];#e;#t=null;#n=null;#r=null;#i=!1;connectedCallback(){We(this.ownerDocument),this.#o(),this.#s(),this.#l()}attributeChangedCallback(e,t,n){t===n||!this.isConnected||(e===`thinking`?(this.#s(),this.dispatchEvent(new CustomEvent(`slicc-agent-message-thinking`,{bubbles:!0,composed:!0,detail:{thinking:n!==null}}))):e===`progress`?this.#c():e===`streaming`?(this.#l(),this.dispatchEvent(new CustomEvent(`slicc-agent-message-streaming`,{bubbles:!0,composed:!0,detail:{streaming:n!==null}}))):e===`timestamp`&&this.#u())}get thinking(){return this.hasAttribute(`thinking`)}set thinking(e){e?this.setAttribute(`thinking`,``):this.removeAttribute(`thinking`)}get streaming(){return this.hasAttribute(`streaming`)}set streaming(e){e?this.setAttribute(`streaming`,``):this.removeAttribute(`streaming`)}get progress(){return this.getAttribute(`progress`)}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,e)}get body(){return this.#o(),this.#e}setBodyHtml(e){this.#o();let t=this.ownerDocument.createRange();t.selectNodeContents(this.#e),this.#a(t.createContextualFragment(e))}setPlan(e){this.#a(Je(e))}setCheck(e){this.#a(Ye(e))}#a(e){this.#o(),this.#e.replaceChildren(e),this.#l()}#o(){if(this.#i)return;this.#i=!0,this.classList.add(`msg`,`bot`);let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`body`))),t=this.getAttribute(`timestamp`);if(t){let e=this.ownerDocument.createElement(`span`);e.className=`msg-ts`,e.setAttribute(`part`,`timestamp`),e.textContent=t,this.appendChild(e)}this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`body`,this.#e.setAttribute(`part`,`body`);for(let t of e)this.#e.appendChild(t);this.appendChild(this.#e)}#s(){let e=this.thinking;this.classList.toggle(`thinkrow`,e),e?(this.#e.style.display=`none`,this.#t||(this.#t=this.ownerDocument.createElement(`div`),this.#t.className=`thinkrow-row`,this.#t.appendChild(qe()),this.insertBefore(this.#t,this.#e)),this.#c()):(this.#e.style.removeProperty(`display`),this.#t&&(this.#t.remove(),this.#t=null,this.#n=null))}#c(){if(!this.#t)return;let e=this.progress;e?(this.#n||(this.#n=this.ownerDocument.createElement(`span`),this.#n.className=`progress`,this.#n.setAttribute(`part`,`progress`),this.#n.setAttribute(`aria-live`,`polite`),this.#t.appendChild(this.#n)),this.#n.textContent=e):this.#n&&=(this.#n.remove(),null)}#l(){this.streaming?this.#r?.isConnected?this.#e.appendChild(this.#r):(this.#r=this.ownerDocument.createElement(`span`),this.#r.className=`tw-caret`,this.#r.setAttribute(`part`,`caret`),this.#r.setAttribute(`aria-hidden`,`true`),this.#e.appendChild(this.#r)):this.#r&&=(this.#r.remove(),null)}#u(){let e=this.querySelector(`.msg-ts`),t=this.getAttribute(`timestamp`);if(t)if(e)e.textContent=t;else{let e=this.ownerDocument.createElement(`span`);e.className=`msg-ts`,e.setAttribute(`part`,`timestamp`),e.textContent=t,this.insertBefore(e,this.#e)}else e?.remove()}});var Xe=`
697
+ `,Ue=`slicc-agent-message-style`;function We(e){if(e.getElementById(Ue))return;let t=e.createElement(`style`);t.id=Ue,t.textContent=He,(e.head??e.documentElement).appendChild(t)}var Ge=[`#f43f5e`,`#06b6d4`,`#8b5cf6`],Ke=new Set([``,`r`,`cy`,`vi`,`am`]);function qe(){let e=j(`div`,{class:`dots`,part:`dots`,"aria-hidden":`true`});for(let t of Ge)e.append(j(`i`,{style:`--d:${t}`}));return e}function Je(e){let t=j(`ul`,{class:`plan`,part:`plan`});for(let n of e)t.append(j(`li`,null,n));return t}function P(e){let t=j(`ul`,{class:`check`,part:`check`});for(let n of e){let e=n.variant&&Ke.has(n.variant)?n.variant:``,r=e?`ck ${e}`:`ck`,i=n.glyph??`✓`;t.append(j(`li`,null,j(`span`,{class:r},i),j(`span`,{class:`ctext`},n.text)))}return t}A(`slicc-agent-message`,class extends HTMLElement{static observedAttributes=[`thinking`,`streaming`,`progress`,`timestamp`];#e;#t=null;#n=null;#r=null;#i=!1;connectedCallback(){We(this.ownerDocument),this.#o(),this.#s(),this.#l()}attributeChangedCallback(e,t,n){t===n||!this.isConnected||(e===`thinking`?(this.#s(),this.dispatchEvent(new CustomEvent(`slicc-agent-message-thinking`,{bubbles:!0,composed:!0,detail:{thinking:n!==null}}))):e===`progress`?this.#c():e===`streaming`?(this.#l(),this.dispatchEvent(new CustomEvent(`slicc-agent-message-streaming`,{bubbles:!0,composed:!0,detail:{streaming:n!==null}}))):e===`timestamp`&&this.#u())}get thinking(){return this.hasAttribute(`thinking`)}set thinking(e){e?this.setAttribute(`thinking`,``):this.removeAttribute(`thinking`)}get streaming(){return this.hasAttribute(`streaming`)}set streaming(e){e?this.setAttribute(`streaming`,``):this.removeAttribute(`streaming`)}get progress(){return this.getAttribute(`progress`)}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,e)}get body(){return this.#o(),this.#e}setBodyHtml(e){this.#o();let t=this.ownerDocument.createRange();t.selectNodeContents(this.#e),this.#a(t.createContextualFragment(e))}setPlan(e){this.#a(Je(e))}setCheck(e){this.#a(P(e))}#a(e){this.#o(),this.#e.replaceChildren(e),this.#l()}#o(){if(this.#i)return;this.#i=!0,this.classList.add(`msg`,`bot`);let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`body`))),t=this.getAttribute(`timestamp`);if(t){let e=this.ownerDocument.createElement(`span`);e.className=`msg-ts`,e.setAttribute(`part`,`timestamp`),e.textContent=t,this.appendChild(e)}this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`body`,this.#e.setAttribute(`part`,`body`);for(let t of e)this.#e.appendChild(t);this.appendChild(this.#e)}#s(){let e=this.thinking;this.classList.toggle(`thinkrow`,e),e?(this.#e.style.display=`none`,this.#t||(this.#t=this.ownerDocument.createElement(`div`),this.#t.className=`thinkrow-row`,this.#t.appendChild(qe()),this.insertBefore(this.#t,this.#e)),this.#c()):(this.#e.style.removeProperty(`display`),this.#t&&(this.#t.remove(),this.#t=null,this.#n=null))}#c(){if(!this.#t)return;let e=this.progress;e?(this.#n||(this.#n=this.ownerDocument.createElement(`span`),this.#n.className=`progress`,this.#n.setAttribute(`part`,`progress`),this.#n.setAttribute(`aria-live`,`polite`),this.#t.appendChild(this.#n)),this.#n.textContent=e):this.#n&&=(this.#n.remove(),null)}#l(){this.streaming?this.#r?.isConnected?this.#e.appendChild(this.#r):(this.#r=this.ownerDocument.createElement(`span`),this.#r.className=`tw-caret`,this.#r.setAttribute(`part`,`caret`),this.#r.setAttribute(`aria-hidden`,`true`),this.#e.appendChild(this.#r)):this.#r&&=(this.#r.remove(),null)}#u(){let e=this.querySelector(`.msg-ts`),t=this.getAttribute(`timestamp`);if(t)if(e)e.textContent=t;else{let e=this.ownerDocument.createElement(`span`);e.className=`msg-ts`,e.setAttribute(`part`,`timestamp`),e.textContent=t,this.insertBefore(e,this.#e)}else e?.remove()}});var Ye=`
698
698
  slicc-chat-table { display: block; }
699
699
  slicc-chat-table > .ctable {
700
700
  width: 100%;
@@ -735,7 +735,7 @@ slicc-chat-table > .ctable code {
735
735
  overflow-wrap: anywhere;
736
736
  word-break: break-word;
737
737
  }
738
- `,Ze=`slicc-chat-table-style`;function Qe(e){if(e.getElementById(Ze))return;let t=e.createElement(`style`);t.id=Ze,t.textContent=Xe,(e.head??e.documentElement).appendChild(t)}function $e(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}A(`slicc-chat-table`,class extends HTMLElement{static observedAttributes=[`headers`];#e;#t;#n;#r=!1;connectedCallback(){Qe(this.ownerDocument),this.#i()}attributeChangedCallback(e,t,n){e===`headers`&&t!==n&&(this.#r&&this.#a(),this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-chat-table-change`,{bubbles:!0,composed:!0,detail:{headers:this.headers}})))}get headers(){let e=this.getAttribute(`headers`);return e?$e(e):[]}set headers(e){e==null?this.removeAttribute(`headers`):Array.isArray(e)?this.setAttribute(`headers`,e.join(`,`)):this.setAttribute(`headers`,e)}#i(){if(this.#r)return;this.#r=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLTableElement&&e.classList.contains(`ctable`)));this.#e=this.ownerDocument.createElement(`table`),this.#e.className=`ctable`,this.#e.setAttribute(`part`,`table`),this.#t=this.ownerDocument.createElement(`thead`),this.#t.setAttribute(`part`,`head`),this.#n=this.ownerDocument.createElement(`tbody`),this.#n.setAttribute(`part`,`body`),this.#e.append(this.#t,this.#n);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`head`?this.#t.appendChild(t):this.#n.appendChild(t);this.#a(),this.appendChild(this.#e)}#a(){if(!this.#r)return;let e=this.#t.querySelector(`tr`);if(e&&!e.hasAttribute(`data-slicc-generated`))return;let t=this.headers;if(t.length===0){this.#t.replaceChildren();return}let n=j(`tr`,{"data-slicc-generated":``});for(let e of t)n.append(j(`th`,null,e));this.#t.replaceChildren(n)}});function et(e){if(typeof window>`u`||!window.location)return null;try{return new URLSearchParams(window.location.search).get(e)}catch{return null}}function tt(e,t,n={}){if(!(typeof window>`u`||!window.history?.replaceState))try{let r=new URL(window.location.href),i=r.searchParams.get(e);if(i===t||i===null&&(t===null||t===``))return;t==null||t===``?r.searchParams.delete(e):r.searchParams.set(e,t),n.push?window.history.pushState(window.history.state,``,r):window.history.replaceState(window.history.state,``,r)}catch{}}var nt=`
738
+ `,Xe=`slicc-chat-table-style`;function Ze(e){if(e.getElementById(Xe))return;let t=e.createElement(`style`);t.id=Xe,t.textContent=Ye,(e.head??e.documentElement).appendChild(t)}function Qe(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}A(`slicc-chat-table`,class extends HTMLElement{static observedAttributes=[`headers`];#e;#t;#n;#r=!1;connectedCallback(){Ze(this.ownerDocument),this.#i()}attributeChangedCallback(e,t,n){e===`headers`&&t!==n&&(this.#r&&this.#a(),this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-chat-table-change`,{bubbles:!0,composed:!0,detail:{headers:this.headers}})))}get headers(){let e=this.getAttribute(`headers`);return e?Qe(e):[]}set headers(e){e==null?this.removeAttribute(`headers`):Array.isArray(e)?this.setAttribute(`headers`,e.join(`,`)):this.setAttribute(`headers`,e)}#i(){if(this.#r)return;this.#r=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLTableElement&&e.classList.contains(`ctable`)));this.#e=this.ownerDocument.createElement(`table`),this.#e.className=`ctable`,this.#e.setAttribute(`part`,`table`),this.#t=this.ownerDocument.createElement(`thead`),this.#t.setAttribute(`part`,`head`),this.#n=this.ownerDocument.createElement(`tbody`),this.#n.setAttribute(`part`,`body`),this.#e.append(this.#t,this.#n);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`head`?this.#t.appendChild(t):this.#n.appendChild(t);this.#a(),this.appendChild(this.#e)}#a(){if(!this.#r)return;let e=this.#t.querySelector(`tr`);if(e&&!e.hasAttribute(`data-slicc-generated`))return;let t=this.headers;if(t.length===0){this.#t.replaceChildren();return}let n=j(`tr`,{"data-slicc-generated":``});for(let e of t)n.append(j(`th`,null,e));this.#t.replaceChildren(n)}});function $e(e){if(typeof window>`u`||!window.location)return null;try{return new URLSearchParams(window.location.search).get(e)}catch{return null}}function et(e,t,n={}){if(!(typeof window>`u`||!window.history?.replaceState))try{let r=new URL(window.location.href),i=r.searchParams.get(e);if(i===t||i===null&&(t===null||t===``))return;t==null||t===``?r.searchParams.delete(e):r.searchParams.set(e,t),n.push?window.history.pushState(window.history.state,``,r):window.history.replaceState(window.history.state,``,r)}catch{}}var tt=`
739
739
  slicc-chat-thread {
740
740
  flex: 1 1 auto;
741
741
  display: block;
@@ -833,7 +833,7 @@ slicc-chat-thread[open] > .slicc-thread__inner {
833
833
  padding: 16px 14px;
834
834
  }
835
835
  }
836
- `,rt=`slicc-chat-thread-style`,it=120;function at(e){if(e.getElementById(rt))return;let t=e.createElement(`style`);t.id=rt,t.textContent=nt,(e.head??e.documentElement).appendChild(t)}A(`slicc-chat-thread`,class e extends HTMLElement{static observedAttributes=[`open`,`context`,`accent`,`url-state`];#e;#t=!1;#n=null;#r=null;#i=null;#a=!1;#o=!1;#s=0;#c=null;#l=null;#u=null;#d=null;#f=null;#p=()=>{this.#d=null,this.#f=performance.now(),tt(`at`,String(Math.round(this.scrollTop)))};#m=()=>{if(!this.urlState)return;let e=this.#f==null?it:performance.now()-this.#f;if(e>=it){this.#d!=null&&clearTimeout(this.#d),this.#p();return}this.#d??=setTimeout(this.#p,it-e)};#h=()=>{if(!this.urlState)return;let e=et(`ctx`);if(e&&e!==this.context)this.dispatchEvent(new CustomEvent(`slicc-url-context`,{bubbles:!0,composed:!0,detail:{context:e}}));else{let e=et(`at`);e!=null&&(this.scrollTop=Number.parseInt(e,10)||0)}};#g=null;#_=new Map;connectedCallback(){at(this.ownerDocument),this.#E(),this.#T(),this.#b(),this.scrollToBottom(),this.urlState&&(this.#r=et(`at`),this.#i=et(`ctx`),this.addEventListener(`scroll`,this.#m,{passive:!0}),window.addEventListener(`popstate`,this.#h))}disconnectedCallback(){this.#n&&=(this.#e?.removeEventListener(`click`,this.#n),null),this.removeEventListener(`scroll`,this.#m),window.removeEventListener(`popstate`,this.#h),this.#d!=null&&(clearTimeout(this.#d),this.#d=null),this.#f=null,this.#u?.disconnect(),this.#u=null,this.#C()}attributeChangedCallback(e,t,n){t!==n&&(e===`accent`&&this.#t&&this.#T(),e===`open`&&this.#t&&this.isConnected&&this.#x(),e===`context`&&this.urlState&&n!=null&&this.isConnected&&(n!==this.#i&&(this.#r=null),tt(`ctx`,n,{push:!0})))}get urlState(){return this.hasAttribute(`url-state`)}set urlState(e){this.toggleAttribute(`url-state`,e)}get urlContext(){return this.urlState?et(`ctx`):null}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get context(){return this.getAttribute(`context`)}set context(e){e==null?this.removeAttribute(`context`):this.setAttribute(`context`,e)}get accent(){return this.getAttribute(`accent`)}set accent(e){e==null?this.removeAttribute(`accent`):this.setAttribute(`accent`,e)}get inner(){return this.#E(),this.#e}switchContext(e){this.#E();let t=this.context;if(e===t)return;t!=null&&this.#_.set(t,this.#w());let n=this.#_.get(e);this.#e.replaceChildren(...n?Array.from(n.cloneNode(!0).childNodes):[]),this.context=e,this.removeAttribute(`has-new`),this.dispatchEvent(new CustomEvent(`slicc-context-change`,{bubbles:!0,composed:!0,detail:{context:e,previous:t}})),this.scrollToBottom()}append(...e){this.#E(),e.length>0&&(this.#r=null),this.#e.append(...e),this.requestFollow()}static FOLLOW_SLACK=80;#v(){return this.scrollHeight-this.scrollTop-this.clientHeight<=e.FOLLOW_SLACK}requestFollow(){this.#E(),this.#a?(this.#S(this.scrollHeight),this.removeAttribute(`has-new`)):this.setAttribute(`has-new`,``)}#y=()=>{if(this.#o&&Math.abs(this.scrollTop-this.#s)<=1){this.#C();return}this.#C(),this.#a=this.#v(),this.#a&&this.removeAttribute(`has-new`)};replaceContent(...e){this.#E(),this.#e.replaceChildren(...e),this.removeAttribute(`has-new`),this.scrollToBottom();let t=this.#r;t!=null&&e.length>0&&requestAnimationFrame(()=>{this.#r===t&&(this.#a=!1,this.#S(Number.parseInt(t,10)||0),this.#a=this.#v())})}scrollToBottom(){this.#a=!0,this.removeAttribute(`has-new`),this.#S(this.scrollHeight)}#b(){this.#u?.disconnect(),typeof ResizeObserver==`function`&&(this.#u=new ResizeObserver(()=>this.#x()),this.#u.observe(this.#e))}#x(){if(!this.#a)return;let t=this.#s-this.scrollTop;this.#o&&t>e.FOLLOW_SLACK||this.#S(this.scrollHeight)}#S(e){this.#o=!0,this.scrollTop=e,this.#s=this.scrollTop,this.#c!=null&&cancelAnimationFrame(this.#c),this.#l!=null&&clearTimeout(this.#l),`onscrollend`in HTMLElement.prototype?this.#l=setTimeout(()=>this.#C(),100):this.#c=requestAnimationFrame(()=>this.#C())}#C(){this.#o=!1,this.#c!=null&&cancelAnimationFrame(this.#c),this.#c=null,this.#l!=null&&clearTimeout(this.#l),this.#l=null}#w(){let e=this.ownerDocument.createDocumentFragment();for(let t of Array.from(this.#e.childNodes))e.appendChild(t.cloneNode(!0));return e}#T(){let e=this.accent;e?this.style.setProperty(`--ctx`,e):this.style.removeProperty(`--ctx`)}#E(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-thread__inner`);if(e instanceof HTMLElement)this.#e=e;else{let e=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-thread__inner`,this.#e.setAttribute(`part`,`inner`);for(let t of e)this.#e.appendChild(t);this.appendChild(this.#e)}this.#g=this.ownerDocument.createElement(`div`),this.#g.className=`slicc-thread__follow`;let t=this.ownerDocument.createElement(`button`);t.type=`button`;let r=n(`chevron-down`,{size:14,strokeWidth:2});t.append(`New messages`,r),t.addEventListener(`click`,()=>{this.scrollToBottom()}),this.#g.append(t),this.appendChild(this.#g),this.addEventListener(`scroll`,this.#y,{passive:!0}),this.addEventListener(`scrollend`,()=>this.#C(),{passive:!0}),this.#n=e=>{let t=e.target;t instanceof HTMLElement&&this.dispatchEvent(new CustomEvent(`slicc-thread-action`,{bubbles:!0,composed:!0,detail:{target:t}}))},this.#e.addEventListener(`click`,this.#n)}});var ot=M(`
836
+ `,nt=`slicc-chat-thread-style`,rt=120;function it(e){if(e.getElementById(nt))return;let t=e.createElement(`style`);t.id=nt,t.textContent=tt,(e.head??e.documentElement).appendChild(t)}A(`slicc-chat-thread`,class e extends HTMLElement{static observedAttributes=[`open`,`context`,`accent`,`url-state`];#e;#t=!1;#n=null;#r=null;#i=null;#a=!1;#o=!1;#s=0;#c=null;#l=null;#u=null;#d=null;#f=null;#p=()=>{this.#d=null,this.#f=performance.now(),et(`at`,String(Math.round(this.scrollTop)))};#m=()=>{if(!this.urlState)return;let e=this.#f==null?rt:performance.now()-this.#f;if(e>=rt){this.#d!=null&&clearTimeout(this.#d),this.#p();return}this.#d??=setTimeout(this.#p,rt-e)};#h=()=>{if(!this.urlState)return;let e=$e(`ctx`);if(e&&e!==this.context)this.dispatchEvent(new CustomEvent(`slicc-url-context`,{bubbles:!0,composed:!0,detail:{context:e}}));else{let e=$e(`at`);e!=null&&(this.scrollTop=Number.parseInt(e,10)||0)}};#g=null;#_=new Map;connectedCallback(){it(this.ownerDocument),this.#E(),this.#T(),this.#b(),this.scrollToBottom(),this.urlState&&(this.#r=$e(`at`),this.#i=$e(`ctx`),this.addEventListener(`scroll`,this.#m,{passive:!0}),window.addEventListener(`popstate`,this.#h))}disconnectedCallback(){this.#n&&=(this.#e?.removeEventListener(`click`,this.#n),null),this.removeEventListener(`scroll`,this.#m),window.removeEventListener(`popstate`,this.#h),this.#d!=null&&(clearTimeout(this.#d),this.#d=null),this.#f=null,this.#u?.disconnect(),this.#u=null,this.#C()}attributeChangedCallback(e,t,n){t!==n&&(e===`accent`&&this.#t&&this.#T(),e===`open`&&this.#t&&this.isConnected&&this.#x(),e===`context`&&this.urlState&&n!=null&&this.isConnected&&(n!==this.#i&&(this.#r=null),et(`ctx`,n,{push:!0})))}get urlState(){return this.hasAttribute(`url-state`)}set urlState(e){this.toggleAttribute(`url-state`,e)}get urlContext(){return this.urlState?$e(`ctx`):null}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get context(){return this.getAttribute(`context`)}set context(e){e==null?this.removeAttribute(`context`):this.setAttribute(`context`,e)}get accent(){return this.getAttribute(`accent`)}set accent(e){e==null?this.removeAttribute(`accent`):this.setAttribute(`accent`,e)}get inner(){return this.#E(),this.#e}switchContext(e){this.#E();let t=this.context;if(e===t)return;t!=null&&this.#_.set(t,this.#w());let n=this.#_.get(e);this.#e.replaceChildren(...n?Array.from(n.cloneNode(!0).childNodes):[]),this.context=e,this.removeAttribute(`has-new`),this.dispatchEvent(new CustomEvent(`slicc-context-change`,{bubbles:!0,composed:!0,detail:{context:e,previous:t}})),this.scrollToBottom()}append(...e){this.#E(),e.length>0&&(this.#r=null),this.#e.append(...e),this.requestFollow()}static FOLLOW_SLACK=80;#v(){return this.scrollHeight-this.scrollTop-this.clientHeight<=e.FOLLOW_SLACK}requestFollow(){this.#E(),this.#a?(this.#S(this.scrollHeight),this.removeAttribute(`has-new`)):this.setAttribute(`has-new`,``)}#y=()=>{if(this.#o&&Math.abs(this.scrollTop-this.#s)<=1){this.#C();return}this.#C(),this.#a=this.#v(),this.#a&&this.removeAttribute(`has-new`)};replaceContent(...e){this.#E(),this.#e.replaceChildren(...e),this.removeAttribute(`has-new`),this.scrollToBottom();let t=this.#r;t!=null&&e.length>0&&requestAnimationFrame(()=>{this.#r===t&&(this.#a=!1,this.#S(Number.parseInt(t,10)||0),this.#a=this.#v())})}scrollToBottom(){this.#a=!0,this.removeAttribute(`has-new`),this.#S(this.scrollHeight)}#b(){this.#u?.disconnect(),typeof ResizeObserver==`function`&&(this.#u=new ResizeObserver(()=>this.#x()),this.#u.observe(this.#e))}#x(){if(!this.#a)return;let t=this.#s-this.scrollTop;this.#o&&t>e.FOLLOW_SLACK||this.#S(this.scrollHeight)}#S(e){this.#o=!0,this.scrollTop=e,this.#s=this.scrollTop,this.#c!=null&&cancelAnimationFrame(this.#c),this.#l!=null&&clearTimeout(this.#l),`onscrollend`in HTMLElement.prototype?this.#l=setTimeout(()=>this.#C(),100):this.#c=requestAnimationFrame(()=>this.#C())}#C(){this.#o=!1,this.#c!=null&&cancelAnimationFrame(this.#c),this.#c=null,this.#l!=null&&clearTimeout(this.#l),this.#l=null}#w(){let e=this.ownerDocument.createDocumentFragment();for(let t of Array.from(this.#e.childNodes))e.appendChild(t.cloneNode(!0));return e}#T(){let e=this.accent;e?this.style.setProperty(`--ctx`,e):this.style.removeProperty(`--ctx`)}#E(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-thread__inner`);if(e instanceof HTMLElement)this.#e=e;else{let e=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-thread__inner`,this.#e.setAttribute(`part`,`inner`);for(let t of e)this.#e.appendChild(t);this.appendChild(this.#e)}this.#g=this.ownerDocument.createElement(`div`),this.#g.className=`slicc-thread__follow`;let t=this.ownerDocument.createElement(`button`);t.type=`button`;let r=n(`chevron-down`,{size:14,strokeWidth:2});t.append(`New messages`,r),t.addEventListener(`click`,()=>{this.scrollToBottom()}),this.#g.append(t),this.appendChild(this.#g),this.addEventListener(`scroll`,this.#y,{passive:!0}),this.addEventListener(`scrollend`,()=>this.#C(),{passive:!0}),this.#n=e=>{let t=e.target;t instanceof HTMLElement&&this.dispatchEvent(new CustomEvent(`slicc-thread-action`,{bubbles:!0,composed:!0,detail:{target:t}}))},this.#e.addEventListener(`click`,this.#n)}});var at=M(`
837
837
  :host {
838
838
  display: flex;
839
839
  align-items: center;
@@ -871,7 +871,7 @@ code {
871
871
  overflow-wrap: anywhere;
872
872
  word-break: break-word;
873
873
  }
874
- `),st=[`feed`,`scoop`,`drop`,`sprinkle`],ct={feed:`arrow-right`,scoop:`circle-plus`,drop:`circle-check`,sprinkle:`sparkles`},lt={feed:`Delegated to`,scoop:`Spun up`,drop:`Wrapped up`,sprinkle:``},ut={feed_scoop:`Delegated to`,scoop_scoop:`Spun up`,drop_scoop:`Wrapped up`,"sprinkle-opened":`Opened`};function P(e){return ut[e]??e}function F(e){return st.includes(e??``)?e:`feed`}function dt(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}A(`slicc-delegation-line`,class extends HTMLElement{static observedAttributes=[`kind`,`hue`,`verb`,`scoop`,`label`,`args`,`source`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ot]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get kind(){return F(this.getAttribute(`kind`))}set kind(e){this.setAttribute(`kind`,F(e))}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get verb(){return this.getAttribute(`verb`)}set verb(e){e==null?this.removeAttribute(`verb`):this.setAttribute(`verb`,e)}get scoop(){return this.getAttribute(`scoop`)}set scoop(e){e==null?this.removeAttribute(`scoop`):this.setAttribute(`scoop`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get args(){return this.getAttribute(`args`)}set args(e){e==null?this.removeAttribute(`args`):this.setAttribute(`args`,e)}get source(){return this.hasAttribute(`source`)}set source(e){this.toggleAttribute(`source`,e)}#t(){let e=this.kind,t=this.hue,r=this.verb,i=r==null?lt[e]:P(r),a=this.scoop,o=this.label,s=this.args?dt(this.args):[];t?this.style.setProperty(`--c`,t):this.style.removeProperty(`--c`);let c=j(`span`,{class:`darrow`,part:`arrow`},j(`slot`,{name:`arrow`},n(ct[e],{size:13}))),l=j(`slot`,{name:`label`});i&&l.append(j(`span`,{class:`verb`},i)),a&&l.append(j(`b`,{class:`scoop`,part:`scoop`,style:t?`color:${t}`:void 0},a)),o&&l.append(j(`span`,{class:`prose`},o));let u=j(`span`,{class:`label`,part:`label`},l),d=j(`slot`,{name:`args`});for(let e of s)d.append(j(`code`,{part:`code`},e));this.#e.replaceChildren(c,u,d)}});var ft=M(`
874
+ `),ot=[`feed`,`scoop`,`drop`,`sprinkle`],st={feed:`arrow-right`,scoop:`circle-plus`,drop:`circle-check`,sprinkle:`sparkles`},ct={feed:`Delegated to`,scoop:`Spun up`,drop:`Wrapped up`,sprinkle:``},lt={feed_scoop:`Delegated to`,scoop_scoop:`Spun up`,drop_scoop:`Wrapped up`,"sprinkle-opened":`Opened`};function F(e){return lt[e]??e}function I(e){return ot.includes(e??``)?e:`feed`}function ut(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}A(`slicc-delegation-line`,class extends HTMLElement{static observedAttributes=[`kind`,`hue`,`verb`,`scoop`,`label`,`args`,`source`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[at]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get kind(){return I(this.getAttribute(`kind`))}set kind(e){this.setAttribute(`kind`,I(e))}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get verb(){return this.getAttribute(`verb`)}set verb(e){e==null?this.removeAttribute(`verb`):this.setAttribute(`verb`,e)}get scoop(){return this.getAttribute(`scoop`)}set scoop(e){e==null?this.removeAttribute(`scoop`):this.setAttribute(`scoop`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get args(){return this.getAttribute(`args`)}set args(e){e==null?this.removeAttribute(`args`):this.setAttribute(`args`,e)}get source(){return this.hasAttribute(`source`)}set source(e){this.toggleAttribute(`source`,e)}#t(){let e=this.kind,t=this.hue,r=this.verb,i=r==null?ct[e]:F(r),a=this.scoop,o=this.label,s=this.args?ut(this.args):[];t?this.style.setProperty(`--c`,t):this.style.removeProperty(`--c`);let c=j(`span`,{class:`darrow`,part:`arrow`},j(`slot`,{name:`arrow`},n(st[e],{size:13}))),l=j(`slot`,{name:`label`});i&&l.append(j(`span`,{class:`verb`},i)),a&&l.append(j(`b`,{class:`scoop`,part:`scoop`,style:t?`color:${t}`:void 0},a)),o&&l.append(j(`span`,{class:`prose`},o));let u=j(`span`,{class:`label`,part:`label`},l),d=j(`slot`,{name:`args`});for(let e of s)d.append(j(`code`,{part:`code`},e));this.#e.replaceChildren(c,u,d)}});var dt=M(`
875
875
  :host {
876
876
  display: block;
877
877
  border: 1px solid var(--line);
@@ -897,7 +897,7 @@ code {
897
897
  /* palette chips carry inline-style light backgrounds — tone them down for dark mode */
898
898
  :host-context(.dark) .ch,
899
899
  :host-context([data-theme="dark"]) .ch { filter: brightness(.55) saturate(.85); }
900
- `);A(`slicc-palette-cell`,class extends HTMLElement{static observedAttributes=[`color`,`label`,`group`,`selected`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ft]}connectedCallback(){this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`),this.setAttribute(`role`,`button`),this.#o(),this.#i()}disconnectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#o()}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get group(){return this.getAttribute(`group`)}set group(e){e==null?this.removeAttribute(`group`):this.setAttribute(`group`,e)}get selected(){return this.hasAttribute(`selected`)}set selected(e){this.toggleAttribute(`selected`,e)}select(){this.#r(),this.selected=!0,this.dispatchEvent(new CustomEvent(`palette-select`,{bubbles:!0,composed:!0,detail:{color:this.color,label:this.label,group:this.group}}))}#r(){let e=this.group;if(!e)return;let t=this.getRootNode().querySelectorAll(`slicc-palette-cell[group="${CSS.escape(e)}"][selected]`);for(let e of t)e!==this&&(e.selected=!1)}#i(){this.#t||(this.#t=()=>this.select(),this.#n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.select())},this.addEventListener(`click`,this.#t),this.addEventListener(`keydown`,this.#n))}#a(){this.#t&&this.removeEventListener(`click`,this.#t),this.#n&&this.removeEventListener(`keydown`,this.#n),this.#t=null,this.#n=null}#o(){this.setAttribute(`aria-pressed`,this.selected?`true`:`false`);let e=this.color??`transparent`,t=this.label,n=j(`div`,{class:`ch`,part:`chip`,style:`background:${e}`}),r=j(`div`,{class:`cl`,part:`label`},t??j(`slot`));this.#e.replaceChildren(n,r)}});var pt=[`#f43f5e`,`#f59e0b`,`#06b6d4`,`#8b5cf6`,`#ec4899`,`#22c55e`],mt=46,ht=72,gt=6.283185;function _t(e,t){return e+Math.random()*(t-e)}var vt=[{color:`#faf6f1`,label:`paper`},{color:`#fff7ed`,label:`cream`},{color:`#f5f3ff`,label:`lilac`},{color:`#fef2f2`,label:`blush`}],yt=[{color:`#8b5cf6`,label:`violet`},{color:`#f43f5e`,label:`rose`},{color:`#06b6d4`,label:`cyan`},{color:`#ef7000`,label:`cone`}],I=0,bt=M(`
900
+ `);A(`slicc-palette-cell`,class extends HTMLElement{static observedAttributes=[`color`,`label`,`group`,`selected`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[dt]}connectedCallback(){this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`),this.setAttribute(`role`,`button`),this.#o(),this.#i()}disconnectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#o()}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get group(){return this.getAttribute(`group`)}set group(e){e==null?this.removeAttribute(`group`):this.setAttribute(`group`,e)}get selected(){return this.hasAttribute(`selected`)}set selected(e){this.toggleAttribute(`selected`,e)}select(){this.#r(),this.selected=!0,this.dispatchEvent(new CustomEvent(`palette-select`,{bubbles:!0,composed:!0,detail:{color:this.color,label:this.label,group:this.group}}))}#r(){let e=this.group;if(!e)return;let t=this.getRootNode().querySelectorAll(`slicc-palette-cell[group="${CSS.escape(e)}"][selected]`);for(let e of t)e!==this&&(e.selected=!1)}#i(){this.#t||(this.#t=()=>this.select(),this.#n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.select())},this.addEventListener(`click`,this.#t),this.addEventListener(`keydown`,this.#n))}#a(){this.#t&&this.removeEventListener(`click`,this.#t),this.#n&&this.removeEventListener(`keydown`,this.#n),this.#t=null,this.#n=null}#o(){this.setAttribute(`aria-pressed`,this.selected?`true`:`false`);let e=this.color??`transparent`,t=this.label,n=j(`div`,{class:`ch`,part:`chip`,style:`background:${e}`}),r=j(`div`,{class:`cl`,part:`label`},t??j(`slot`));this.#e.replaceChildren(n,r)}});var ft=[`#f43f5e`,`#f59e0b`,`#06b6d4`,`#8b5cf6`,`#ec4899`,`#22c55e`],pt=46,mt=72,ht=6.283185;function gt(e,t){return e+Math.random()*(t-e)}var _t=[{color:`#faf6f1`,label:`paper`},{color:`#fff7ed`,label:`cream`},{color:`#f5f3ff`,label:`lilac`},{color:`#fef2f2`,label:`blush`}],vt=[{color:`#8b5cf6`,label:`violet`},{color:`#f43f5e`,label:`rose`},{color:`#06b6d4`,label:`cyan`},{color:`#ef7000`,label:`cone`}],L=0,yt=M(`
901
901
  :host {
902
902
  position: relative;
903
903
  display: block;
@@ -984,7 +984,7 @@ canvas.sprk {
984
984
  @media (prefers-reduced-motion: reduce) {
985
985
  canvas.sprk { display: none; }
986
986
  }
987
- `);A(`slicc-dip`,class extends HTMLElement{static observedAttributes=[`name`,`hue`,`prompt`];#e;#t=`d${++I}`;#n=null;#r=null;#i=0;#a=null;#o=[];#s=0;#c=0;#l=-999;#u=-999;#d=null;#f=null;#p=null;#m=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[bt]}connectedCallback(){this.#v(),this.#b(),this.#w()}disconnectedCallback(){this.#T(),this.#x()}attributeChangedCallback(){this.isConnected&&(this.#v(),this.#b(),this.#w())}get name(){return this.getAttribute(`name`)??`palette.shtml`}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get prompt(){return this.getAttribute(`prompt`)}set prompt(e){e==null?this.removeAttribute(`prompt`):this.setAttribute(`prompt`,e)}get selectedCanvas(){return this.#h(`canvas:${this.#t}`)}get selectedAccent(){return this.#h(`accent:${this.#t}`)}#h(e){let t=this.querySelector(`slicc-palette-cell[group="${CSS.escape(e)}"][selected]`);return t?{color:t.getAttribute(`color`)??``,label:t.getAttribute(`label`)??``}:null}#g(e,t,n){let r=e.startsWith(`canvas`)?`canvas`:`accent`;if(!this.querySelector(`slicc-palette-cell[slot="${r}"]`))for(let i of t){let t=this.ownerDocument.createElement(`slicc-palette-cell`);t.setAttribute(`slot`,r),t.setAttribute(`color`,i.color),t.setAttribute(`label`,i.label),t.setAttribute(`group`,e),i.label===n&&t.setAttribute(`selected`,``),this.appendChild(t)}}#_(){return[document.createTextNode(`Tune the hero’s `),j(`b`,null,`canvas`),document.createTextNode(` & `),j(`b`,null,`accent`),document.createTextNode(`, then apply:`)]}#v(){let e=this.hue,t=e?`--c:${e}`:void 0,r=j(`slot`,{name:`prompt`});this.prompt?r.append(this.prompt):r.append(...this.#_()),this.#e.replaceChildren(j(`canvas`,{class:`sprk`,part:`field`,"aria-hidden":`true`}),j(`div`,{class:`dh`,part:`header`,style:t},j(`span`,{class:`sg`,part:`glyph`},n(`sparkles`,{size:12})),j(`span`,{class:`nm`,part:`name`},this.name),j(`span`,{class:`tag`,part:`tag`},`sprinkle · dip`)),j(`div`,{class:`dbody`,part:`body`,style:t},j(`p`,{class:`dprompt`,part:`prompt`},r),j(`div`,{class:`pgrid canvas`,part:`grid-canvas`},j(`slot`,{name:`canvas`})),j(`div`,{class:`pgrid accent`,part:`grid-accent`},j(`slot`,{name:`accent`})),j(`div`,{class:`dfoot`},j(`button`,{class:`dapply`,part:`apply`,type:`button`},`Apply to hero →`),j(`span`,{class:`dnote`,part:`note`})))),this.#g(`canvas:${this.#t}`,vt,`paper`),this.#g(`accent:${this.#t}`,yt,`cone`),this.#y()}#y(){let e=this.#e.querySelector(`.dnote`);e&&(e.textContent=`${this.selectedCanvas?.label??`paper`} · ${this.selectedAccent?.label??`violet`}`)}#b(){this.#p||(this.#p=()=>this.#y(),this.addEventListener(`palette-select`,this.#p)),this.#m||=()=>this.#S(),this.#e.querySelector(`.dapply`)?.addEventListener(`click`,this.#m)}#x(){this.#p&&=(this.removeEventListener(`palette-select`,this.#p),null),this.#m=null}#S(){this.#y(),this.dispatchEvent(new CustomEvent(`slicc-dip-apply`,{bubbles:!0,composed:!0,detail:{canvas:this.selectedCanvas,accent:this.selectedAccent}}))}#C(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}#w(){if(this.#T(),this.#C())return;let e=this.#e.querySelector(`canvas.sprk`),t=e?.getContext(`2d`)??null;!e||!t||(this.#n=e,this.#r=t,this.#o=[],this.#E(),typeof ResizeObserver==`function`&&(this.#a=new ResizeObserver(()=>this.#E()),this.#a.observe(this)),this.#d=e=>{let t=this.getBoundingClientRect();this.#l=e.clientX-t.left,this.#u=e.clientY-t.top},this.#f=()=>{this.#l=-999,this.#u=-999},this.addEventListener(`pointermove`,this.#d),this.addEventListener(`pointerleave`,this.#f),this.#i=requestAnimationFrame(()=>this.#O()))}#T(){this.#i&&cancelAnimationFrame(this.#i),this.#i=0,this.#a?.disconnect(),this.#a=null,this.#d&&this.removeEventListener(`pointermove`,this.#d),this.#f&&this.removeEventListener(`pointerleave`,this.#f),this.#d=null,this.#f=null}#E(){let e=this.#n,t=this.#r;if(!e||!t)return;let n=this.getBoundingClientRect(),r=Math.min(typeof devicePixelRatio==`number`?devicePixelRatio:1,2);if(this.#s=n.width,this.#c=n.height||90,e.width=Math.max(1,Math.round(this.#s*r)),e.height=Math.max(1,Math.round(this.#c*r)),t.setTransform(r,0,0,r,0,0),!this.#o.length)for(let e=0;e<mt;e++)this.#o.push({x:_t(0,this.#s),y:_t(0,this.#c),vx:_t(-.1,.1),vy:_t(-.08,.08),rot:_t(0,gt),rv:_t(-.014,.014),s:_t(1.2,2.2),col:pt[e%pt.length]})}#D(e,t,n,r,i){let a=this.#r;a&&(a.roundRect?(a.beginPath(),a.roundRect(e,t,n,r,i)):(a.beginPath(),a.moveTo(e+i,t),a.arcTo(e+n,t,e+n,t+r,i),a.arcTo(e+n,t+r,e,t+r,i),a.arcTo(e,t+r,e,t,i),a.arcTo(e,t,e+n,t,i),a.closePath()))}#O(){let e=this.#r;if(e){e.clearRect(0,0,this.#s,this.#c);for(let t of this.#o){let n=t.x-this.#l,r=t.y-this.#u,i=n*n+r*r;if(i<5184){let e=Math.sqrt(i)||1,a=(ht-e)/ht*.5;t.vx+=n/e*a,t.vy+=r/e*a}t.vx*=.95,t.vy*=.95,t.x+=t.vx+.04,t.y+=t.vy,t.rot+=t.rv,t.x<-6&&(t.x=this.#s+6),t.x>this.#s+6&&(t.x=-6),t.y<-6&&(t.y=this.#c+6),t.y>this.#c+6&&(t.y=-6);let a=t.s*4,o=t.s*1.55;e.save(),e.translate(t.x,t.y),e.rotate(t.rot),e.globalAlpha=.5,e.fillStyle=t.col,this.#D(-a/2,-o/2,a,o,o/2),e.fill(),e.globalAlpha=.85,e.fillStyle=`#fff`,this.#D(-a/2+o*.3,-o*.34,a-o*.6,o*.3,o*.15),e.fill(),e.restore(),e.globalAlpha=1}this.#i=requestAnimationFrame(()=>this.#O())}}});var L=14,xt=12,St=`Something went wrong`,Ct={retry:`Try again`,settings:`Open Settings`,"change-model":`Change model`,login:`Log in again`},wt={retry:`rotate-ccw`,settings:`settings`,"change-model":`sparkles`,login:`log-in`},Tt=M(`
987
+ `);A(`slicc-dip`,class extends HTMLElement{static observedAttributes=[`name`,`hue`,`prompt`];#e;#t=`d${++L}`;#n=null;#r=null;#i=0;#a=null;#o=[];#s=0;#c=0;#l=-999;#u=-999;#d=null;#f=null;#p=null;#m=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[yt]}connectedCallback(){this.#v(),this.#b(),this.#w()}disconnectedCallback(){this.#T(),this.#x()}attributeChangedCallback(){this.isConnected&&(this.#v(),this.#b(),this.#w())}get name(){return this.getAttribute(`name`)??`palette.shtml`}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get prompt(){return this.getAttribute(`prompt`)}set prompt(e){e==null?this.removeAttribute(`prompt`):this.setAttribute(`prompt`,e)}get selectedCanvas(){return this.#h(`canvas:${this.#t}`)}get selectedAccent(){return this.#h(`accent:${this.#t}`)}#h(e){let t=this.querySelector(`slicc-palette-cell[group="${CSS.escape(e)}"][selected]`);return t?{color:t.getAttribute(`color`)??``,label:t.getAttribute(`label`)??``}:null}#g(e,t,n){let r=e.startsWith(`canvas`)?`canvas`:`accent`;if(!this.querySelector(`slicc-palette-cell[slot="${r}"]`))for(let i of t){let t=this.ownerDocument.createElement(`slicc-palette-cell`);t.setAttribute(`slot`,r),t.setAttribute(`color`,i.color),t.setAttribute(`label`,i.label),t.setAttribute(`group`,e),i.label===n&&t.setAttribute(`selected`,``),this.appendChild(t)}}#_(){return[document.createTextNode(`Tune the hero’s `),j(`b`,null,`canvas`),document.createTextNode(` & `),j(`b`,null,`accent`),document.createTextNode(`, then apply:`)]}#v(){let e=this.hue,t=e?`--c:${e}`:void 0,r=j(`slot`,{name:`prompt`});this.prompt?r.append(this.prompt):r.append(...this.#_()),this.#e.replaceChildren(j(`canvas`,{class:`sprk`,part:`field`,"aria-hidden":`true`}),j(`div`,{class:`dh`,part:`header`,style:t},j(`span`,{class:`sg`,part:`glyph`},n(`sparkles`,{size:12})),j(`span`,{class:`nm`,part:`name`},this.name),j(`span`,{class:`tag`,part:`tag`},`sprinkle · dip`)),j(`div`,{class:`dbody`,part:`body`,style:t},j(`p`,{class:`dprompt`,part:`prompt`},r),j(`div`,{class:`pgrid canvas`,part:`grid-canvas`},j(`slot`,{name:`canvas`})),j(`div`,{class:`pgrid accent`,part:`grid-accent`},j(`slot`,{name:`accent`})),j(`div`,{class:`dfoot`},j(`button`,{class:`dapply`,part:`apply`,type:`button`},`Apply to hero →`),j(`span`,{class:`dnote`,part:`note`})))),this.#g(`canvas:${this.#t}`,_t,`paper`),this.#g(`accent:${this.#t}`,vt,`cone`),this.#y()}#y(){let e=this.#e.querySelector(`.dnote`);e&&(e.textContent=`${this.selectedCanvas?.label??`paper`} · ${this.selectedAccent?.label??`violet`}`)}#b(){this.#p||(this.#p=()=>this.#y(),this.addEventListener(`palette-select`,this.#p)),this.#m||=()=>this.#S(),this.#e.querySelector(`.dapply`)?.addEventListener(`click`,this.#m)}#x(){this.#p&&=(this.removeEventListener(`palette-select`,this.#p),null),this.#m=null}#S(){this.#y(),this.dispatchEvent(new CustomEvent(`slicc-dip-apply`,{bubbles:!0,composed:!0,detail:{canvas:this.selectedCanvas,accent:this.selectedAccent}}))}#C(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}#w(){if(this.#T(),this.#C())return;let e=this.#e.querySelector(`canvas.sprk`),t=e?.getContext(`2d`)??null;!e||!t||(this.#n=e,this.#r=t,this.#o=[],this.#E(),typeof ResizeObserver==`function`&&(this.#a=new ResizeObserver(()=>this.#E()),this.#a.observe(this)),this.#d=e=>{let t=this.getBoundingClientRect();this.#l=e.clientX-t.left,this.#u=e.clientY-t.top},this.#f=()=>{this.#l=-999,this.#u=-999},this.addEventListener(`pointermove`,this.#d),this.addEventListener(`pointerleave`,this.#f),this.#i=requestAnimationFrame(()=>this.#O()))}#T(){this.#i&&cancelAnimationFrame(this.#i),this.#i=0,this.#a?.disconnect(),this.#a=null,this.#d&&this.removeEventListener(`pointermove`,this.#d),this.#f&&this.removeEventListener(`pointerleave`,this.#f),this.#d=null,this.#f=null}#E(){let e=this.#n,t=this.#r;if(!e||!t)return;let n=this.getBoundingClientRect(),r=Math.min(typeof devicePixelRatio==`number`?devicePixelRatio:1,2);if(this.#s=n.width,this.#c=n.height||90,e.width=Math.max(1,Math.round(this.#s*r)),e.height=Math.max(1,Math.round(this.#c*r)),t.setTransform(r,0,0,r,0,0),!this.#o.length)for(let e=0;e<pt;e++)this.#o.push({x:gt(0,this.#s),y:gt(0,this.#c),vx:gt(-.1,.1),vy:gt(-.08,.08),rot:gt(0,ht),rv:gt(-.014,.014),s:gt(1.2,2.2),col:ft[e%ft.length]})}#D(e,t,n,r,i){let a=this.#r;a&&(a.roundRect?(a.beginPath(),a.roundRect(e,t,n,r,i)):(a.beginPath(),a.moveTo(e+i,t),a.arcTo(e+n,t,e+n,t+r,i),a.arcTo(e+n,t+r,e,t+r,i),a.arcTo(e,t+r,e,t,i),a.arcTo(e,t,e+n,t,i),a.closePath()))}#O(){let e=this.#r;if(e){e.clearRect(0,0,this.#s,this.#c);for(let t of this.#o){let n=t.x-this.#l,r=t.y-this.#u,i=n*n+r*r;if(i<5184){let e=Math.sqrt(i)||1,a=(mt-e)/mt*.5;t.vx+=n/e*a,t.vy+=r/e*a}t.vx*=.95,t.vy*=.95,t.x+=t.vx+.04,t.y+=t.vy,t.rot+=t.rv,t.x<-6&&(t.x=this.#s+6),t.x>this.#s+6&&(t.x=-6),t.y<-6&&(t.y=this.#c+6),t.y>this.#c+6&&(t.y=-6);let a=t.s*4,o=t.s*1.55;e.save(),e.translate(t.x,t.y),e.rotate(t.rot),e.globalAlpha=.5,e.fillStyle=t.col,this.#D(-a/2,-o/2,a,o,o/2),e.fill(),e.globalAlpha=.85,e.fillStyle=`#fff`,this.#D(-a/2+o*.3,-o*.34,a-o*.6,o*.3,o*.15),e.fill(),e.restore(),e.globalAlpha=1}this.#i=requestAnimationFrame(()=>this.#O())}}});var R=14,bt=12,xt=`Something went wrong`,St={retry:`Try again`,settings:`Open Settings`,"change-model":`Change model`,login:`Log in again`},Ct={retry:`rotate-ccw`,settings:`settings`,"change-model":`sparkles`,login:`log-in`},wt=M(`
988
988
  :host{
989
989
  /* Error cards sit in the assistant column (left-aligned). Tokens default to
990
990
  the light palette and flip in dark mode via the library's outer scopes
@@ -1043,7 +1043,7 @@ canvas.sprk {
1043
1043
  .retry:hover{filter:brightness(1.08);}
1044
1044
  .retry:focus-visible{outline:2px solid color-mix(in srgb,var(--err-btn-bg) 60%,var(--ink));outline-offset:2px;}
1045
1045
  .retry svg{display:block;}
1046
- `);A(`slicc-error-card`,class extends HTMLElement{static observedAttributes=[`label`,`message`,`button-label`,`message-id`,`action`,`theme`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Tt]}connectedCallback(){this.#n()}disconnectedCallback(){this.#i()}attributeChangedCallback(){this.isConnected&&this.#n()}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get message(){return this.getAttribute(`message`)}set message(e){e==null?this.removeAttribute(`message`):this.setAttribute(`message`,e)}get buttonLabel(){return this.getAttribute(`button-label`)}set buttonLabel(e){e==null?this.removeAttribute(`button-label`):this.setAttribute(`button-label`,e)}get messageId(){return this.getAttribute(`message-id`)}set messageId(e){e==null?this.removeAttribute(`message-id`):this.setAttribute(`message-id`,e)}get action(){let e=this.getAttribute(`action`);return e===`settings`||e===`change-model`||e===`login`?e:`retry`}set action(e){e==null?this.removeAttribute(`action`):this.setAttribute(`action`,e)}get theme(){let e=this.getAttribute(`theme`);return e===`light`||e===`dark`?e:null}set theme(e){e==null?this.removeAttribute(`theme`):this.setAttribute(`theme`,e)}retry(){this.dispatchEvent(new CustomEvent(`slicc-error-retry`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}openSettings(){this.dispatchEvent(new CustomEvent(`slicc-error-open-settings`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}changeModel(){this.dispatchEvent(new CustomEvent(`slicc-error-change-model`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}login(){this.dispatchEvent(new CustomEvent(`slicc-error-login`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}#n(){let e=this.action,t=this.label??St,r=this.message,i=this.buttonLabel??Ct[e],a=wt[e],o=j(`span`,{class:`ic`,part:`icon`,"aria-hidden":!0});o.append(n(`triangle-alert`,{size:L}));let s=j(`div`,{class:`err`,part:`card`},j(`div`,{class:`eh`,part:`header`},o,j(`span`,{class:`lbl`,part:`label`},t)),j(`div`,{class:`eb`,part:`body`},r??j(`slot`)),j(`div`,{class:`foot`},j(`button`,{type:`button`,class:`retry`,part:`button`,"aria-label":i},n(a,{size:xt}),i)));this.#e.replaceChildren(s),this.#r()}#r(){this.#i();let e=this.#e.querySelector(`.retry`);if(!e)return;let t=this.action;this.#t=()=>{t===`settings`?this.openSettings():t===`change-model`?this.changeModel():t===`login`?this.login():this.retry()},e.addEventListener(`click`,this.#t)}#i(){let e=this.#e.querySelector(`.retry`);e&&this.#t&&e.removeEventListener(`click`,this.#t),this.#t=null}});var Et=9,Dt=3,Ot=45,kt=M(`
1046
+ `);A(`slicc-error-card`,class extends HTMLElement{static observedAttributes=[`label`,`message`,`button-label`,`message-id`,`action`,`theme`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[wt]}connectedCallback(){this.#n()}disconnectedCallback(){this.#i()}attributeChangedCallback(){this.isConnected&&this.#n()}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get message(){return this.getAttribute(`message`)}set message(e){e==null?this.removeAttribute(`message`):this.setAttribute(`message`,e)}get buttonLabel(){return this.getAttribute(`button-label`)}set buttonLabel(e){e==null?this.removeAttribute(`button-label`):this.setAttribute(`button-label`,e)}get messageId(){return this.getAttribute(`message-id`)}set messageId(e){e==null?this.removeAttribute(`message-id`):this.setAttribute(`message-id`,e)}get action(){let e=this.getAttribute(`action`);return e===`settings`||e===`change-model`||e===`login`?e:`retry`}set action(e){e==null?this.removeAttribute(`action`):this.setAttribute(`action`,e)}get theme(){let e=this.getAttribute(`theme`);return e===`light`||e===`dark`?e:null}set theme(e){e==null?this.removeAttribute(`theme`):this.setAttribute(`theme`,e)}retry(){this.dispatchEvent(new CustomEvent(`slicc-error-retry`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}openSettings(){this.dispatchEvent(new CustomEvent(`slicc-error-open-settings`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}changeModel(){this.dispatchEvent(new CustomEvent(`slicc-error-change-model`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}login(){this.dispatchEvent(new CustomEvent(`slicc-error-login`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}#n(){let e=this.action,t=this.label??xt,r=this.message,i=this.buttonLabel??St[e],a=Ct[e],o=j(`span`,{class:`ic`,part:`icon`,"aria-hidden":!0});o.append(n(`triangle-alert`,{size:R}));let s=j(`div`,{class:`err`,part:`card`},j(`div`,{class:`eh`,part:`header`},o,j(`span`,{class:`lbl`,part:`label`},t)),j(`div`,{class:`eb`,part:`body`},r??j(`slot`)),j(`div`,{class:`foot`},j(`button`,{type:`button`,class:`retry`,part:`button`,"aria-label":i},n(a,{size:bt}),i)));this.#e.replaceChildren(s),this.#r()}#r(){this.#i();let e=this.#e.querySelector(`.retry`);if(!e)return;let t=this.action;this.#t=()=>{t===`settings`?this.openSettings():t===`change-model`?this.changeModel():t===`login`?this.login():this.retry()},e.addEventListener(`click`,this.#t)}#i(){let e=this.#e.querySelector(`.retry`);e&&this.#t&&e.removeEventListener(`click`,this.#t),this.#t=null}});var Tt=9,Et=3,Dt=45,Ot=M(`
1047
1047
  :host {
1048
1048
  display: inline-flex;
1049
1049
  align-items: center;
@@ -1124,7 +1124,7 @@ canvas.sprk {
1124
1124
  @media (prefers-reduced-motion: reduce) {
1125
1125
  :host([blink]) .eye { animation: none; }
1126
1126
  }
1127
- `);A(`slicc-googly-eyes`,class extends HTMLElement{static observedAttributes=[`inverted`,`tracking`,`blink`,`eyes`,`size`];#e;#t=[];#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[kt]}connectedCallback(){this.#r(),this.#i()}disconnectedCallback(){this.#o()}attributeChangedCallback(e,t,n){this.isConnected&&(e===`size`||e===`eyes`?(this.#r(),this.#i()):e===`tracking`&&this.#i())}get inverted(){return this.hasAttribute(`inverted`)}set inverted(e){this.toggleAttribute(`inverted`,e)}get tracking(){return this.getAttribute(`tracking`)!==`off`}set tracking(e){e?this.setAttribute(`tracking`,`on`):this.setAttribute(`tracking`,`off`)}get blink(){return this.hasAttribute(`blink`)}set blink(e){this.toggleAttribute(`blink`,e)}get eyes(){return this.getAttribute(`eyes`)===`dead`?`dead`:`open`}set eyes(e){this.setAttribute(`eyes`,e===`dead`?`dead`:`open`)}get size(){let e=Number.parseFloat(this.getAttribute(`size`)??``);return Number.isFinite(e)&&e>0?e:Et}set size(e){this.setAttribute(`size`,String(e))}#r(){let e=this.size,t=1.3/Et*e,n=this.eyes===`dead`,r=e=>j(`span`,{class:`eye`,part:e},n?j(`span`,{class:`x`,"aria-hidden":`true`},`×`):null),i=j(`span`,{class:`eyes`,part:`eyes`,style:`--_eye:${e}px;--_border:${t}px`,role:`img`,"aria-label":n?`dead eyes`:`googly eyes`},r(`eye eye-left`),j(`slot`),r(`eye eye-right`));this.#e.replaceChildren(i),this.#t=Array.from(this.#e.querySelectorAll(`.eye`)),this.#s()}#i(){this.tracking&&this.eyes===`open`?this.#a():(this.#o(),this.#s())}#a(){this.#n||(this.#n=e=>this.#c(e),document.addEventListener(`mousemove`,this.#n))}#o(){this.#n&&=(document.removeEventListener(`mousemove`,this.#n),null)}#s(){for(let e of this.#t)e.style.setProperty(`--px`,`0px`),e.style.setProperty(`--py`,`0px`)}#c(e){for(let t of this.#t){let n=t.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2,a=Math.atan2(e.clientY-i,e.clientX-r),o=Math.min(Dt,Math.hypot(e.clientX-r,e.clientY-i)/Ot);t.style.setProperty(`--px`,`${(Math.cos(a)*o).toFixed(2)}px`),t.style.setProperty(`--py`,`${(Math.sin(a)*o).toFixed(2)}px`)}}});var At=M(`
1127
+ `);A(`slicc-googly-eyes`,class extends HTMLElement{static observedAttributes=[`inverted`,`tracking`,`blink`,`eyes`,`size`];#e;#t=[];#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ot]}connectedCallback(){this.#r(),this.#i()}disconnectedCallback(){this.#o()}attributeChangedCallback(e,t,n){this.isConnected&&(e===`size`||e===`eyes`?(this.#r(),this.#i()):e===`tracking`&&this.#i())}get inverted(){return this.hasAttribute(`inverted`)}set inverted(e){this.toggleAttribute(`inverted`,e)}get tracking(){return this.getAttribute(`tracking`)!==`off`}set tracking(e){e?this.setAttribute(`tracking`,`on`):this.setAttribute(`tracking`,`off`)}get blink(){return this.hasAttribute(`blink`)}set blink(e){this.toggleAttribute(`blink`,e)}get eyes(){return this.getAttribute(`eyes`)===`dead`?`dead`:`open`}set eyes(e){this.setAttribute(`eyes`,e===`dead`?`dead`:`open`)}get size(){let e=Number.parseFloat(this.getAttribute(`size`)??``);return Number.isFinite(e)&&e>0?e:Tt}set size(e){this.setAttribute(`size`,String(e))}#r(){let e=this.size,t=1.3/Tt*e,n=this.eyes===`dead`,r=e=>j(`span`,{class:`eye`,part:e},n?j(`span`,{class:`x`,"aria-hidden":`true`},`×`):null),i=j(`span`,{class:`eyes`,part:`eyes`,style:`--_eye:${e}px;--_border:${t}px`,role:`img`,"aria-label":n?`dead eyes`:`googly eyes`},r(`eye eye-left`),j(`slot`),r(`eye eye-right`));this.#e.replaceChildren(i),this.#t=Array.from(this.#e.querySelectorAll(`.eye`)),this.#s()}#i(){this.tracking&&this.eyes===`open`?this.#a():(this.#o(),this.#s())}#a(){this.#n||(this.#n=e=>this.#c(e),document.addEventListener(`mousemove`,this.#n))}#o(){this.#n&&=(document.removeEventListener(`mousemove`,this.#n),null)}#s(){for(let e of this.#t)e.style.setProperty(`--px`,`0px`),e.style.setProperty(`--py`,`0px`)}#c(e){for(let t of this.#t){let n=t.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2,a=Math.atan2(e.clientY-i,e.clientX-r),o=Math.min(Et,Math.hypot(e.clientX-r,e.clientY-i)/Dt);t.style.setProperty(`--px`,`${(Math.cos(a)*o).toFixed(2)}px`),t.style.setProperty(`--py`,`${(Math.sin(a)*o).toFixed(2)}px`)}}});var kt=M(`
1128
1128
  :host{display:block;font-family:var(--ui);}
1129
1129
  :host([hidden]){display:none;}
1130
1130
  .handoff{border:1px solid var(--line);border-radius:13px;padding:13px 15px;margin:2px 0 18px;}
@@ -1144,7 +1144,7 @@ canvas.sprk {
1144
1144
  .opened .sg{width:20px;height:20px;border-radius:6px;display:grid;place-items:center;color:#fff;background:var(--rainbow);flex:0 0 auto;}
1145
1145
  .opened .sg svg{display:block;}
1146
1146
  .opened b{color:var(--ink);font-weight:600;}
1147
- `),jt=`Handoff request from`;A(`slicc-handoff-card`,class extends HTMLElement{static observedAttributes=[`variant`,`name`,`pre`,`text`,`eyes`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[At]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get variant(){return this.getAttribute(`variant`)===`opened`?`opened`:`handoff`}set variant(e){this.setAttribute(`variant`,e===`opened`?`opened`:`handoff`)}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get pre(){return this.getAttribute(`pre`)}set pre(e){e==null?this.removeAttribute(`pre`):this.setAttribute(`pre`,e)}get text(){return this.getAttribute(`text`)}set text(e){e==null?this.removeAttribute(`text`):this.setAttribute(`text`,e)}get eyes(){return this.getAttribute(`eyes`)===`dead`?`dead`:`open`}set eyes(e){this.setAttribute(`eyes`,e===`dead`?`dead`:`open`)}#t(){this.variant===`opened`?this.#i():this.#r()}#n(){let e=this.text;return e==null?j(`slot`):document.createTextNode(e)}#r(){let e=this.pre??jt,t=this.name,r=j(`slicc-googly-eyes`,{class:`eyes`});this.eyes===`dead`&&r.setAttribute(`eyes`,`dead`);let i=j(`div`,{class:`top`,part:`top`},j(`span`,{class:`av`,part:`avatar`},r),j(`span`,{class:`lbl2`,part:`label`},j(`span`,{class:`hand`,part:`hand`,"aria-hidden":`true`},n(`hand`,{size:13})),j(`span`,{class:`pre`},e),` `,t==null?null:j(`b`,{part:`name`},t))),a=j(`p`,{part:`text`},this.#n());this.#e.replaceChildren(j(`div`,{class:`handoff`,part:`card`},i,a))}#i(){let e=this.name,t=j(`span`,{class:`sg`,part:`glyph`,"aria-hidden":`true`},n(`sparkles`,{size:12})),r=j(`span`,{part:`text`},e==null?null:j(`b`,{part:`name`},e),e==null?null:` `,this.#n());this.#e.replaceChildren(j(`div`,{class:`opened`,part:`card`},t,r))}});var Mt=14,Nt=`event`,Pt={webhook:`webhook`,cron:`clock`,workflow:`workflow`,bash:`square-terminal`,"session-reload":`rotate-ccw`,navigate:`compass`,discovery:`radar`,upgrade:`circle-arrow-up`,sprinkle:`sparkles`,fswatch:`eye`,"scoop-notify":`bell-ring`,"scoop-idle":`moon`,"scoop-wait":`hourglass`,"sudo-request":`key-round`},Ft=`bell`;function It(e){return e&&Pt[e.toLowerCase()]||Ft}var Lt={confirmed:`circle-check`,dismissed:`circle-x`},Rt=M(`
1147
+ `),At=`Handoff request from`;A(`slicc-handoff-card`,class extends HTMLElement{static observedAttributes=[`variant`,`name`,`pre`,`text`,`eyes`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[kt]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get variant(){return this.getAttribute(`variant`)===`opened`?`opened`:`handoff`}set variant(e){this.setAttribute(`variant`,e===`opened`?`opened`:`handoff`)}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get pre(){return this.getAttribute(`pre`)}set pre(e){e==null?this.removeAttribute(`pre`):this.setAttribute(`pre`,e)}get text(){return this.getAttribute(`text`)}set text(e){e==null?this.removeAttribute(`text`):this.setAttribute(`text`,e)}get eyes(){return this.getAttribute(`eyes`)===`dead`?`dead`:`open`}set eyes(e){this.setAttribute(`eyes`,e===`dead`?`dead`:`open`)}#t(){this.variant===`opened`?this.#i():this.#r()}#n(){let e=this.text;return e==null?j(`slot`):document.createTextNode(e)}#r(){let e=this.pre??At,t=this.name,r=j(`slicc-googly-eyes`,{class:`eyes`});this.eyes===`dead`&&r.setAttribute(`eyes`,`dead`);let i=j(`div`,{class:`top`,part:`top`},j(`span`,{class:`av`,part:`avatar`},r),j(`span`,{class:`lbl2`,part:`label`},j(`span`,{class:`hand`,part:`hand`,"aria-hidden":`true`},n(`hand`,{size:13})),j(`span`,{class:`pre`},e),` `,t==null?null:j(`b`,{part:`name`},t))),a=j(`p`,{part:`text`},this.#n());this.#e.replaceChildren(j(`div`,{class:`handoff`,part:`card`},i,a))}#i(){let e=this.name,t=j(`span`,{class:`sg`,part:`glyph`,"aria-hidden":`true`},n(`sparkles`,{size:12})),r=j(`span`,{part:`text`},e==null?null:j(`b`,{part:`name`},e),e==null?null:` `,this.#n());this.#e.replaceChildren(j(`div`,{class:`opened`,part:`card`},t,r))}});var jt=14,Mt=`event`,Nt={webhook:`webhook`,cron:`clock`,workflow:`workflow`,bash:`square-terminal`,"session-reload":`rotate-ccw`,navigate:`compass`,discovery:`radar`,upgrade:`circle-arrow-up`,sprinkle:`sparkles`,fswatch:`eye`,"scoop-notify":`bell-ring`,"scoop-idle":`moon`,"scoop-wait":`hourglass`,"sudo-request":`key-round`},Pt=`bell`;function Ft(e){return e&&Nt[e.toLowerCase()]||Pt}var It={confirmed:`circle-check`,dismissed:`circle-x`},Lt=M(`
1148
1148
  :host{
1149
1149
  /* Licks are right-aligned in the chat column (mirroring the lickIn slide-in
1150
1150
  from the right): the host is a full-width flex row that pushes the card to
@@ -1232,7 +1232,7 @@ canvas.sprk {
1232
1232
  :host([collapsed]) .lb{display:none;}
1233
1233
 
1234
1234
  @keyframes lickIn{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}
1235
- `),zt=`·`;A(`slicc-lick-card`,class extends HTMLElement{static observedAttributes=[`kind`,`event-label`,`body`,`count`,`no-animate`,`collapsible`,`collapsed`,`theme`,`hue`,`state`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Rt]}connectedCallback(){this.#r()}disconnectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#r()}get kind(){return this.getAttribute(`kind`)}set kind(e){e==null?this.removeAttribute(`kind`):this.setAttribute(`kind`,e)}get eventLabel(){return this.getAttribute(`event-label`)}set eventLabel(e){e==null?this.removeAttribute(`event-label`):this.setAttribute(`event-label`,e)}get body(){return this.getAttribute(`body`)}set body(e){e==null?this.removeAttribute(`body`):this.setAttribute(`body`,e)}get count(){let e=Number.parseInt(this.getAttribute(`count`)??``,10);return Number.isFinite(e)&&e>0?e:1}set count(e){e>1?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`)}get noAnimate(){return this.hasAttribute(`no-animate`)}set noAnimate(e){this.toggleAttribute(`no-animate`,e)}get collapsible(){return this.hasAttribute(`collapsible`)}set collapsible(e){this.toggleAttribute(`collapsible`,e)}get collapsed(){return this.hasAttribute(`collapsed`)}set collapsed(e){this.toggleAttribute(`collapsed`,e)}get theme(){let e=this.getAttribute(`theme`);return e===`light`||e===`dark`?e:null}set theme(e){e==null?this.removeAttribute(`theme`):this.setAttribute(`theme`,e)}get state(){let e=this.getAttribute(`state`);return e===`confirmed`||e===`dismissed`?e:`pending`}set state(e){e==null||e===`pending`?this.removeAttribute(`state`):this.setAttribute(`state`,e)}toggle(){this.collapsible&&(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent(`slicc-lick-toggle`,{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0})))}#r(){let e=this.kind??``,t=this.count,r=this.getAttribute(`hue`);r?(this.style.setProperty(`--lick-pill`,r),this.style.setProperty(`--lick-pill-ink`,`#fff`)):(this.style.removeProperty(`--lick-pill`),this.style.removeProperty(`--lick-pill-ink`));let i=this.eventLabel??Nt,a=t>1?`${i} ×${t}`:i,o=this.body,s=this.collapsible,c=e?`lick ${zt} ${e}`:`lick ${zt}`,l=j(`span`,{class:`bell`,part:`bell`,"aria-hidden":!0});l.append(n(It(e),{size:Mt}));let u={class:`lh`,part:`header`};s&&(u.tabindex=`0`,u.role=`button`,u[`aria-expanded`]=this.collapsed?`false`:`true`);let d=j(`div`,u,l,` `,j(`span`,{class:`kind`,part:`kind`},`${c} `),j(`span`,{class:`lk`,part:`event`},a)),f=this.state;if(f!==`pending`){let e=j(`span`,{class:`status`,part:`status`,"aria-hidden":!0});e.append(n(Lt[f],{size:Mt})),d.append(e)}let p=j(`div`,{class:`lick`,part:`card`},d,j(`div`,{class:`lb`,part:`body`},o??j(`slot`)));this.#e.replaceChildren(p),this.#i()}#i(){if(this.#a(),!this.collapsible)return;let e=this.#e.querySelector(`.lh`);e&&(this.#t=()=>this.toggle(),this.#n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.toggle())},e.addEventListener(`click`,this.#t),e.addEventListener(`keydown`,this.#n))}#a(){let e=this.#e.querySelector(`.lh`);e&&this.#t&&e.removeEventListener(`click`,this.#t),e&&this.#n&&e.removeEventListener(`keydown`,this.#n),this.#t=null,this.#n=null}});var Bt=`
1235
+ `),Rt=`·`;A(`slicc-lick-card`,class extends HTMLElement{static observedAttributes=[`kind`,`event-label`,`body`,`count`,`no-animate`,`collapsible`,`collapsed`,`theme`,`hue`,`state`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Lt]}connectedCallback(){this.#r()}disconnectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#r()}get kind(){return this.getAttribute(`kind`)}set kind(e){e==null?this.removeAttribute(`kind`):this.setAttribute(`kind`,e)}get eventLabel(){return this.getAttribute(`event-label`)}set eventLabel(e){e==null?this.removeAttribute(`event-label`):this.setAttribute(`event-label`,e)}get body(){return this.getAttribute(`body`)}set body(e){e==null?this.removeAttribute(`body`):this.setAttribute(`body`,e)}get count(){let e=Number.parseInt(this.getAttribute(`count`)??``,10);return Number.isFinite(e)&&e>0?e:1}set count(e){e>1?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`)}get noAnimate(){return this.hasAttribute(`no-animate`)}set noAnimate(e){this.toggleAttribute(`no-animate`,e)}get collapsible(){return this.hasAttribute(`collapsible`)}set collapsible(e){this.toggleAttribute(`collapsible`,e)}get collapsed(){return this.hasAttribute(`collapsed`)}set collapsed(e){this.toggleAttribute(`collapsed`,e)}get theme(){let e=this.getAttribute(`theme`);return e===`light`||e===`dark`?e:null}set theme(e){e==null?this.removeAttribute(`theme`):this.setAttribute(`theme`,e)}get state(){let e=this.getAttribute(`state`);return e===`confirmed`||e===`dismissed`?e:`pending`}set state(e){e==null||e===`pending`?this.removeAttribute(`state`):this.setAttribute(`state`,e)}toggle(){this.collapsible&&(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent(`slicc-lick-toggle`,{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0})))}#r(){let e=this.kind??``,t=this.count,r=this.getAttribute(`hue`);r?(this.style.setProperty(`--lick-pill`,r),this.style.setProperty(`--lick-pill-ink`,`#fff`)):(this.style.removeProperty(`--lick-pill`),this.style.removeProperty(`--lick-pill-ink`));let i=this.eventLabel??Mt,a=t>1?`${i} ×${t}`:i,o=this.body,s=this.collapsible,c=e?`lick ${Rt} ${e}`:`lick ${Rt}`,l=j(`span`,{class:`bell`,part:`bell`,"aria-hidden":!0});l.append(n(Ft(e),{size:jt}));let u={class:`lh`,part:`header`};s&&(u.tabindex=`0`,u.role=`button`,u[`aria-expanded`]=this.collapsed?`false`:`true`);let d=j(`div`,u,l,` `,j(`span`,{class:`kind`,part:`kind`},`${c} `),j(`span`,{class:`lk`,part:`event`},a)),f=this.state;if(f!==`pending`){let e=j(`span`,{class:`status`,part:`status`,"aria-hidden":!0});e.append(n(It[f],{size:jt})),d.append(e)}let p=j(`div`,{class:`lick`,part:`card`},d,j(`div`,{class:`lb`,part:`body`},o??j(`slot`)));this.#e.replaceChildren(p),this.#i()}#i(){if(this.#a(),!this.collapsible)return;let e=this.#e.querySelector(`.lh`);e&&(this.#t=()=>this.toggle(),this.#n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.toggle())},e.addEventListener(`click`,this.#t),e.addEventListener(`keydown`,this.#n))}#a(){let e=this.#e.querySelector(`.lh`);e&&this.#t&&e.removeEventListener(`click`,this.#t),e&&this.#n&&e.removeEventListener(`keydown`,this.#n),this.#t=null,this.#n=null}});var zt=`
1236
1236
  slicc-tool-cluster {
1237
1237
  display: block;
1238
1238
  margin: -2px 0 16px;
@@ -1308,7 +1308,7 @@ slicc-tool-cluster[open] .slicc-cluster__body {
1308
1308
  slicc-tool-cluster .slicc-cluster__body slicc-action-row {
1309
1309
  margin-bottom: 4px;
1310
1310
  }
1311
- `,Vt=`slicc-tool-cluster-style`;function Ht(e){if(e.getElementById(Vt))return;let t=e.createElement(`style`);t.id=Vt,t.textContent=Bt,(e.head??e.documentElement).appendChild(t)}var Ut=`A few quick steps`;A(`slicc-tool-cluster`,class extends HTMLElement{static observedAttributes=[`open`,`label`,`count`];#e;#t;#n;#r;#i=!1;#a=()=>{this.open=!this.open};connectedCallback(){Ht(this.ownerDocument),this.#o(),this.#s(),this.#e?.addEventListener(`click`,this.#a)}disconnectedCallback(){this.#e?.removeEventListener(`click`,this.#a)}attributeChangedCallback(e,t,n){t===n||!this.#i||(e===`open`?(this.#e.setAttribute(`aria-expanded`,String(n!==null)),this.dispatchEvent(new CustomEvent(`slicc-tool-cluster-toggle`,{bubbles:!0,composed:!0,detail:{open:n!==null}}))):this.#s())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get label(){return this.getAttribute(`label`)??Ut}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get count(){let e=Number.parseInt(this.getAttribute(`count`)??``,10);return Number.isFinite(e)&&e>0?e:0}set count(e){e>0?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`)}get body(){return this.#o(),this.#r}append(...e){this.#o(),this.#r.append(...e),this.#s()}#o(){if(this.#i)return;this.#i=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-cluster__head`))&&!(e instanceof HTMLElement&&e.classList.contains(`slicc-cluster__body`)));this.#e=this.ownerDocument.createElement(`button`),this.#e.type=`button`,this.#e.className=`slicc-cluster__head`,this.#e.setAttribute(`part`,`head`),this.#t=j(`span`,{class:`slicc-cluster__label`,part:`label`}),this.#n=j(`span`,{class:`slicc-cluster__count`,part:`count`}),we(this.#e,[j(`span`,{class:`slicc-cluster__ic`,part:`icon`},n(`layers`,{size:12})),this.#t,this.#n,j(`span`,{class:`slicc-cluster__chev`,part:`chevron`,"aria-hidden":`true`},`▸`)]),this.#r=this.ownerDocument.createElement(`div`),this.#r.className=`slicc-cluster__body`,this.#r.setAttribute(`part`,`body`);for(let t of e)this.#r.appendChild(t);this.replaceChildren(this.#e,this.#r),this.#e.addEventListener(`click`,this.#a)}#s(){if(!this.#i)return;this.#t.textContent=this.label;let e=this.count||this.#r.children.length;this.#n.textContent=e>0?`${e} steps`:``,this.#e.setAttribute(`aria-expanded`,String(this.open))}});var Wt=400,Gt=M(`
1311
+ `,Bt=`slicc-tool-cluster-style`;function Vt(e){if(e.getElementById(Bt))return;let t=e.createElement(`style`);t.id=Bt,t.textContent=zt,(e.head??e.documentElement).appendChild(t)}var Ht=`A few quick steps`;A(`slicc-tool-cluster`,class extends HTMLElement{static observedAttributes=[`open`,`label`,`count`];#e;#t;#n;#r;#i=!1;#a=()=>{this.open=!this.open};connectedCallback(){Vt(this.ownerDocument),this.#o(),this.#s(),this.#e?.addEventListener(`click`,this.#a)}disconnectedCallback(){this.#e?.removeEventListener(`click`,this.#a)}attributeChangedCallback(e,t,n){t===n||!this.#i||(e===`open`?(this.#e.setAttribute(`aria-expanded`,String(n!==null)),this.dispatchEvent(new CustomEvent(`slicc-tool-cluster-toggle`,{bubbles:!0,composed:!0,detail:{open:n!==null}}))):this.#s())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get label(){return this.getAttribute(`label`)??Ht}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get count(){let e=Number.parseInt(this.getAttribute(`count`)??``,10);return Number.isFinite(e)&&e>0?e:0}set count(e){e>0?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`)}get body(){return this.#o(),this.#r}append(...e){this.#o(),this.#r.append(...e),this.#s()}#o(){if(this.#i)return;this.#i=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-cluster__head`))&&!(e instanceof HTMLElement&&e.classList.contains(`slicc-cluster__body`)));this.#e=this.ownerDocument.createElement(`button`),this.#e.type=`button`,this.#e.className=`slicc-cluster__head`,this.#e.setAttribute(`part`,`head`),this.#t=j(`span`,{class:`slicc-cluster__label`,part:`label`}),this.#n=j(`span`,{class:`slicc-cluster__count`,part:`count`}),we(this.#e,[j(`span`,{class:`slicc-cluster__ic`,part:`icon`},n(`layers`,{size:12})),this.#t,this.#n,j(`span`,{class:`slicc-cluster__chev`,part:`chevron`,"aria-hidden":`true`},`▸`)]),this.#r=this.ownerDocument.createElement(`div`),this.#r.className=`slicc-cluster__body`,this.#r.setAttribute(`part`,`body`);for(let t of e)this.#r.appendChild(t);this.replaceChildren(this.#e,this.#r),this.#e.addEventListener(`click`,this.#a)}#s(){if(!this.#i)return;this.#t.textContent=this.label;let e=this.count||this.#r.children.length;this.#n.textContent=e>0?`${e} steps`:``,this.#e.setAttribute(`aria-expanded`,String(this.open))}});var Ut=400,Wt=M(`
1312
1312
  :host{position:fixed;inset:0;z-index:1000;display:none;}
1313
1313
  :host([open]){display:block;}
1314
1314
  .overlay{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;cursor:pointer;}
@@ -1316,7 +1316,7 @@ slicc-tool-cluster .slicc-cluster__body slicc-action-row {
1316
1316
  .overlay.visible .backdrop{opacity:1;}
1317
1317
  .overlay.closing .backdrop{opacity:0;}
1318
1318
  .image{position:absolute;border-radius:6px;box-shadow:0 20px 60px rgba(0,0,0,.4),0 8px 20px rgba(0,0,0,.3);max-width:90vw;max-height:90vh;object-fit:contain;transform-origin:center center;will-change:transform;transition:transform .35s cubic-bezier(.2,0,.13,1),border-radius .35s cubic-bezier(.2,0,.13,1);}
1319
- `),Kt=null,qt=class extends HTMLElement{#e;#t=null;#n=null;#r=null;#i=null;#a=!1;#o=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Gt]}disconnectedCallback(){this.#l(),Kt===this&&(Kt=null)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get isOpen(){return this.hasAttribute(`open`)}open(e,t){Kt&&Kt!==this&&Kt.#s(),this.#l(),this.#a=!1,this.src=e,this.setAttribute(`open`,``),Kt=this,this.#r=t??this;let n=document.createElement(`div`);n.className=`overlay`,n.setAttribute(`part`,`overlay`);let r=document.createElement(`div`);r.className=`backdrop`,r.setAttribute(`part`,`backdrop`),n.appendChild(r);let i=document.createElement(`img`);i.className=`image`,i.setAttribute(`part`,`image`),i.src=e,i.alt=`Image preview`,n.appendChild(i),this.#e.appendChild(n),this.#t=n,this.#n=i;let a=this.#r.getBoundingClientRect(),o=()=>{let e=window.innerWidth,t=window.innerHeight,r=e*.9,o=t*.9,s=i.naturalWidth||a.width*4,c=i.naturalHeight||a.height*4,l=Math.min(r/s,o/c,1),u=s*l,d=c*l,f=(e-u)/2,p=(t-d)/2,m=a.width/u,h=a.height/d,g=a.left+a.width/2,_=a.top+a.height/2,v=f+u/2,y=p+d/2,b=g-v,x=_-y;i.style.position=`absolute`,i.style.width=`${u}px`,i.style.height=`${d}px`,i.style.left=`${f}px`,i.style.top=`${p}px`,i.style.transform=`translate(${b}px, ${x}px) scale(${m}, ${h})`,i.style.borderRadius=`${6/Math.min(m,h)}px`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.style.transform=`translate(0, 0) scale(1, 1)`,i.style.borderRadius=`6px`,n.classList.add(`visible`)})})};i.complete&&i.naturalWidth>0?o():(i.onload=()=>o(),i.onerror=()=>this.#s()),this.#i=e=>{e.key===`Escape`&&this.close()},n.addEventListener(`click`,()=>this.close()),document.addEventListener(`keydown`,this.#i),this.dispatchEvent(new CustomEvent(`slicc-image-preview-open`,{bubbles:!0,composed:!0,detail:{src:e}}))}close(){let e=this.#t,t=this.#n;if(this.#a||!e||!t||Kt!==this)return;this.#a=!0,e.classList.add(`closing`),e.classList.remove(`visible`);let n=this.#r,r=n?n.getBoundingClientRect():null;if(r&&r.width>0&&r.height>0){let e=t.getBoundingClientRect(),n=r.width/e.width,i=r.height/e.height,a=r.left+r.width/2,o=r.top+r.height/2,s=e.left+e.width/2,c=e.top+e.height/2,l=a-s,u=o-c;t.style.transform=`translate(${l}px, ${u}px) scale(${n}, ${i})`,t.style.borderRadius=`${6/Math.min(n,i)}px`}this.dispatchEvent(new CustomEvent(`slicc-image-preview-close`,{bubbles:!0,composed:!0,detail:{src:this.src}}));let i=()=>this.#c();this.#o=setTimeout(i,Wt),e.addEventListener(`transitionend`,e=>{e.propertyName===`transform`&&(this.#o&&clearTimeout(this.#o),i())})}#s(){this.#l()}#c(){this.#l()}#l(){this.#o&&=(clearTimeout(this.#o),null),this.#i&&=(document.removeEventListener(`keydown`,this.#i),null),this.#t&&=(this.#t.remove(),null),this.#n=null,this.#r=null,this.removeAttribute(`open`),this.removeAttribute(`src`),Kt===this&&(Kt=null)}static show(e,t){let n=document.querySelector(`slicc-image-preview[data-shared]`);return n||(n=document.createElement(`slicc-image-preview`),n.setAttribute(`data-shared`,``),document.body.appendChild(n)),n.open(e,t),()=>n.close()}};A(`slicc-image-preview`,qt);var Jt=M(`
1319
+ `),Gt=null,Kt=class extends HTMLElement{#e;#t=null;#n=null;#r=null;#i=null;#a=!1;#o=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Wt]}disconnectedCallback(){this.#l(),Gt===this&&(Gt=null)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get isOpen(){return this.hasAttribute(`open`)}open(e,t){Gt&&Gt!==this&&Gt.#s(),this.#l(),this.#a=!1,this.src=e,this.setAttribute(`open`,``),Gt=this,this.#r=t??this;let n=document.createElement(`div`);n.className=`overlay`,n.setAttribute(`part`,`overlay`);let r=document.createElement(`div`);r.className=`backdrop`,r.setAttribute(`part`,`backdrop`),n.appendChild(r);let i=document.createElement(`img`);i.className=`image`,i.setAttribute(`part`,`image`),i.src=e,i.alt=`Image preview`,n.appendChild(i),this.#e.appendChild(n),this.#t=n,this.#n=i;let a=this.#r.getBoundingClientRect(),o=()=>{let e=window.innerWidth,t=window.innerHeight,r=e*.9,o=t*.9,s=i.naturalWidth||a.width*4,c=i.naturalHeight||a.height*4,l=Math.min(r/s,o/c,1),u=s*l,d=c*l,f=(e-u)/2,p=(t-d)/2,m=a.width/u,h=a.height/d,g=a.left+a.width/2,_=a.top+a.height/2,v=f+u/2,y=p+d/2,b=g-v,x=_-y;i.style.position=`absolute`,i.style.width=`${u}px`,i.style.height=`${d}px`,i.style.left=`${f}px`,i.style.top=`${p}px`,i.style.transform=`translate(${b}px, ${x}px) scale(${m}, ${h})`,i.style.borderRadius=`${6/Math.min(m,h)}px`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.style.transform=`translate(0, 0) scale(1, 1)`,i.style.borderRadius=`6px`,n.classList.add(`visible`)})})};i.complete&&i.naturalWidth>0?o():(i.onload=()=>o(),i.onerror=()=>this.#s()),this.#i=e=>{e.key===`Escape`&&this.close()},n.addEventListener(`click`,()=>this.close()),document.addEventListener(`keydown`,this.#i),this.dispatchEvent(new CustomEvent(`slicc-image-preview-open`,{bubbles:!0,composed:!0,detail:{src:e}}))}close(){let e=this.#t,t=this.#n;if(this.#a||!e||!t||Gt!==this)return;this.#a=!0,e.classList.add(`closing`),e.classList.remove(`visible`);let n=this.#r,r=n?n.getBoundingClientRect():null;if(r&&r.width>0&&r.height>0){let e=t.getBoundingClientRect(),n=r.width/e.width,i=r.height/e.height,a=r.left+r.width/2,o=r.top+r.height/2,s=e.left+e.width/2,c=e.top+e.height/2,l=a-s,u=o-c;t.style.transform=`translate(${l}px, ${u}px) scale(${n}, ${i})`,t.style.borderRadius=`${6/Math.min(n,i)}px`}this.dispatchEvent(new CustomEvent(`slicc-image-preview-close`,{bubbles:!0,composed:!0,detail:{src:this.src}}));let i=()=>this.#c();this.#o=setTimeout(i,Ut),e.addEventListener(`transitionend`,e=>{e.propertyName===`transform`&&(this.#o&&clearTimeout(this.#o),i())})}#s(){this.#l()}#c(){this.#l()}#l(){this.#o&&=(clearTimeout(this.#o),null),this.#i&&=(document.removeEventListener(`keydown`,this.#i),null),this.#t&&=(this.#t.remove(),null),this.#n=null,this.#r=null,this.removeAttribute(`open`),this.removeAttribute(`src`),Gt===this&&(Gt=null)}static show(e,t){let n=document.querySelector(`slicc-image-preview[data-shared]`);return n||(n=document.createElement(`slicc-image-preview`),n.setAttribute(`data-shared`,``),document.body.appendChild(n)),n.open(e,t),()=>n.close()}};A(`slicc-image-preview`,Kt);var qt=M(`
1320
1320
  :host{display:block;margin-bottom:18px;font-family:var(--ui);font-size:15px;line-height:1.5;}
1321
1321
  :host([hidden]){display:none;}
1322
1322
  .msg{display:flex;justify-content:flex-end;}
@@ -1357,7 +1357,7 @@ slicc-tool-cluster .slicc-cluster__body slicc-action-row {
1357
1357
  :host([queued]) .b{opacity:.62;}
1358
1358
  .queued-tag{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;color:var(--txt-3);}
1359
1359
  .queued-tag svg{display:block;}
1360
- `),Yt={image:`image`,text:`file-text`,file:`file`};function Xt(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}A(`slicc-user-message`,class extends HTMLElement{static observedAttributes=[`text`,`queued`,`timestamp`];#e;#t=null;#n=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Jt]}connectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#a()}get text(){return this.getAttribute(`text`)}set text(e){e==null?this.removeAttribute(`text`):this.setAttribute(`text`,e)}get queued(){return this.hasAttribute(`queued`)}set queued(e){this.toggleAttribute(`queued`,e)}setBodyHtml(e){this.#t=e,this.#a()}setAttachments(e){this.#n=e.slice(),this.#a()}#r(){if(this.#t!=null)return this.ownerDocument.createRange().createContextualFragment(this.#t);let e=this.text;return e==null?j(`slot`):this.ownerDocument.createTextNode(e)}#i(e){let t=e.kind??`file`,r=j(`span`,{class:`attachment-chip__visual`});if(t===`image`&&e.src){let t=j(`img`,{src:e.src,alt:e.name||`Attached image`});t.addEventListener(`click`,n=>{n.stopPropagation(),qt.show(e.src,t)}),r.append(t)}else r.append(n(Yt[t],{size:16}));let i=e.size==null?e.mime:`${e.mime||`file`} · ${Xt(e.size)}`,a=j(`span`,{class:`attachment-chip__body`},j(`span`,{class:`attachment-chip__name`},e.name),i?j(`span`,{class:`attachment-chip__meta`},i):null);return j(`div`,{class:`attachment-chip attachment-chip--${t}`},r,a)}#a(){let e=this.#n.length>0,t=this.text!=null||this.#t!=null,r=this.childNodes.length>0,i=t||r||!e,a=j(`div`,{class:`stack`,part:`stack`}),o=this.getAttribute(`timestamp`);if(o&&a.append(j(`span`,{class:`ts`,part:`timestamp`},o)),e){let e=j(`div`,{class:`attachments`,part:`attachments`});for(let t of this.#n)e.append(this.#i(t));a.append(e)}i&&a.append(j(`div`,{class:`b`,part:`bubble`},this.#r())),this.queued&&a.append(j(`span`,{class:`queued-tag`,part:`queued`},n(`clock`,{size:11}),`queued`));let s=j(`div`,{class:`msg user`,part:`message`},a);this.#e.replaceChildren(s)}});var Zt=`
1360
+ `),Jt={image:`image`,text:`file-text`,file:`file`};function Yt(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}A(`slicc-user-message`,class extends HTMLElement{static observedAttributes=[`text`,`queued`,`timestamp`];#e;#t=null;#n=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[qt]}connectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#a()}get text(){return this.getAttribute(`text`)}set text(e){e==null?this.removeAttribute(`text`):this.setAttribute(`text`,e)}get queued(){return this.hasAttribute(`queued`)}set queued(e){this.toggleAttribute(`queued`,e)}setBodyHtml(e){this.#t=e,this.#a()}setAttachments(e){this.#n=e.slice(),this.#a()}#r(){if(this.#t!=null)return this.ownerDocument.createRange().createContextualFragment(this.#t);let e=this.text;return e==null?j(`slot`):this.ownerDocument.createTextNode(e)}#i(e){let t=e.kind??`file`,r=j(`span`,{class:`attachment-chip__visual`});if(t===`image`&&e.src){let t=j(`img`,{src:e.src,alt:e.name||`Attached image`});t.addEventListener(`click`,n=>{n.stopPropagation(),Kt.show(e.src,t)}),r.append(t)}else r.append(n(Jt[t],{size:16}));let i=e.size==null?e.mime:`${e.mime||`file`} · ${Yt(e.size)}`,a=j(`span`,{class:`attachment-chip__body`},j(`span`,{class:`attachment-chip__name`},e.name),i?j(`span`,{class:`attachment-chip__meta`},i):null);return j(`div`,{class:`attachment-chip attachment-chip--${t}`},r,a)}#a(){let e=this.#n.length>0,t=this.text!=null||this.#t!=null,r=this.childNodes.length>0,i=t||r||!e,a=j(`div`,{class:`stack`,part:`stack`}),o=this.getAttribute(`timestamp`);if(o&&a.append(j(`span`,{class:`ts`,part:`timestamp`},o)),e){let e=j(`div`,{class:`attachments`,part:`attachments`});for(let t of this.#n)e.append(this.#i(t));a.append(e)}i&&a.append(j(`div`,{class:`b`,part:`bubble`},this.#r())),this.queued&&a.append(j(`span`,{class:`queued-tag`,part:`queued`},n(`clock`,{size:11}),`queued`));let s=j(`div`,{class:`msg user`,part:`message`},a);this.#e.replaceChildren(s)}});var Xt=`
1361
1361
  slicc-composer {
1362
1362
  flex: 0 0 auto;
1363
1363
  display: block;
@@ -1679,7 +1679,7 @@ slicc-composer .slicc-composer__ptt.is-picking {
1679
1679
  animation-name: none;
1680
1680
  }
1681
1681
  }
1682
- `,Qt=`slicc-composer-style`;function $t(e){if(e.getElementById(Qt))return;let t=e.createElement(`style`);t.id=Qt,t.textContent=Zt,(e.head??e.documentElement).appendChild(t)}var en=1e3,tn=60,nn=1e4,rn=45e3,an=1500;function on(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>i(n),t);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e instanceof Error?e:Error(String(e)))})})}var sn=`slicc-composer:mic-device`;function cn(){try{return typeof localStorage>`u`?null:localStorage.getItem(sn)}catch{return null}}function ln(e){try{if(typeof localStorage>`u`)return;e?localStorage.setItem(sn,e):localStorage.removeItem(sn)}catch{}}function un(e){return e==null||!Number.isFinite(e)?``:e<60?`~${Math.max(1,Math.round(e))}s`:`~${Math.floor(e/60)}m ${Math.round(e%60)}s`}A(`slicc-composer`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=!1;#n=null;#r=`idle`;#i=!1;#a=0;#o=null;#s=null;#c=null;#l=null;#u=null;#d=`unknown`;#f=cn();#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=null;#w=[];connectedCallback(){$t(this.ownerDocument),this.#T(),this.addEventListener(`pointerdown`,this.#E)}disconnectedCallback(){this.removeEventListener(`pointerdown`,this.#E),this.#c?.cancel(),this.#c=null,this.#j(),this.#i=!1,this.#o=null,this.#a++,this.#z(),this.#L(),this.#m&&clearTimeout(this.#m),this.#m=null,this.#R(),this.#G(),this.#ee()}attributeChangedCallback(){}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get speech(){return this.#u??=s(),this.#u}set speech(e){this.#u=e,this.#d=`unknown`}get device(){return this.#f}set device(e){this.#f=e,ln(e)}get inner(){return this.#T(),this.#e}append(...e){this.#T(),this.#e.append(...e)}#T(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-composer__inner`);if(e instanceof HTMLElement){this.#e=e;return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-composer__inner`,this.#e.setAttribute(`part`,`inner`);for(let e of t)this.#e.appendChild(e);this.appendChild(this.#e)}#E=e=>{if(!this.hasAttribute(`ptt`)||!e.isPrimary||this.#i||e.button!==0||this.#r===`finalizing`||this.#r===`picking`)return;let t=e.target?.closest?.(`textarea`);if(!(t instanceof HTMLTextAreaElement)||!this.contains(t)||t.value!==``)return;this.#i=!0,this.#a++,this.#o=t,this.#s=e.pointerId;try{this.setPointerCapture(e.pointerId)}catch{}let n=this.ownerDocument;n.addEventListener(`pointerup`,this.#M),this.addEventListener(`pointercancel`,this.#N),n.addEventListener(`selectionchange`,this.#D);let r=this.#a;this.#h=setTimeout(()=>{this.#L(),this.#O(this.speech,r)},400)};#D=()=>{if(!this.#h)return;let e=this.ownerDocument.getSelection();!e||e.isCollapsed||e.toString()===``||(this.#i=!1,this.#a++,this.#o=null,this.#L(),this.#z(),this.#R())};async#O(e,t){let n=await Promise.race([e.permission().then(e=>(this.#d=e,e)),new Promise(e=>setTimeout(()=>e(`pending`),tn))]);if(!(t!==this.#a||!this.#i)){if(n===`granted`){this.#A(e,t);return}if(n===`denied`){this.#q(`denied`);return}this.#q(`enable`),this.#m=setTimeout(()=>{this.#m=null,this.#k(e,t)},en),n===`pending`&&e.permission().then(n=>{this.#d=n,!(t!==this.#a||!this.#i||this.#r!==`enable`)&&(n===`granted`?(this.#I(),this.#A(e,t)):n===`denied`&&(this.#I(),this.#q(`denied`)))})}}#k(e,t){t!==this.#a||!this.#i||this.#r!==`enable`||(this.#v=null,this.#q(`prompting`),on(e.requestPermission(),nn,Error(`Microphone didn't respond. Check your mic, then hold again.`)).then(n=>{this.#d=n?`granted`:`denied`,n&&e.warmup(),t===this.#a&&(n&&this.#i?this.#A(e,t):n?this.#ee():this.#i?this.#q(`denied`):this.#ee())}).catch(e=>{this.#d=`denied`,t===this.#a&&(this.#i?(this.#v=e instanceof Error?e.message:String(e),this.#q(`denied`)):this.#ee())}))}#A(e,t){this.#r=`recording`,this.#q(`recording`),e.warmup(),this.#g?.(),this.#g=e.onStatus(e=>{this.#_=e,this.#Q()});let n=e.microphones();n.then(e=>{t===this.#a&&(this.#f??(this.#p=o(e)),i(e)&&this.#$(e))}).catch(()=>{});let r=(this.#f==null?on(n,an,Error(`microphone enumeration timed out`)).then(e=>o(e)).catch(()=>null):Promise.resolve(this.#f)).then(n=>e.start({deviceId:n??void 0,onPartial:e=>{t===this.#a&&this.#Z(e)},onError:e=>{t===this.#a&&this.#Z(e,!0)}}));this.#l=r,r.then(e=>{if(this.#l===r){if(this.#l=null,t!==this.#a||this.#r!==`recording`){e.cancel();return}this.#c=e}}).catch(e=>{this.#l===r&&(this.#l=null,t===this.#a&&this.#Z(e instanceof Error?e.message:String(e),!0))})}#j(){let e=this.#l;this.#l=null,e!==null&&e.then(e=>e.cancel(),()=>{})}#M=e=>{if(!this.#i||this.#s!=null&&e.pointerId!==this.#s)return;let t=this.#S,n=!1;if(this.#r===`recording`&&t&&!t.hidden)if(e.composedPath().includes(t))n=!0;else{let r=this.ownerDocument.elementFromPoint(e.clientX,e.clientY);n=r!=null&&t.contains(r)}if(n){this.#i=!1,this.#z(),this.#R(),this.#c?.cancel(),this.#c=null,this.#j(),this.#o=null,this.#B();return}this.#P(!0)};#N=e=>{(this.#s==null||e.pointerId===this.#s)&&this.#P(!1)};#P(e){if(!this.#i)return;switch(this.#i=!1,this.#L(),this.#z(),this.#R(),this.#r){case`enable`:this.#I(),this.#o=null,this.#ee();return;case`prompting`:this.#o=null;return;case`denied`:this.#o=null,this.#ee();return;case`recording`:break;default:this.#o=null,this.#ee();return}let t=this.#c;this.#c=null;let n=this.#l;if(this.#l=null,!e){t?.cancel(),n!==null&&n.then(e=>e.cancel(),()=>{}),this.#o=null,this.#ee();return}if(!t&&n===null){this.#o=null,this.#ee();return}this.#r=`finalizing`,this.#Z(`Transcribing…`);let r=this.#a;on((t?Promise.resolve(t):n).then(e=>e.stop()),rn,Error(`finalize timed out`)).then(e=>{r===this.#a&&(this.#ee(),this.#F(e))}).catch(()=>{r===this.#a&&(this.#ee(),this.#o=null)})}#F(e){let t=this.#o;if(this.#o=null,!t)return;let n=e.trim();if(!n){t.focus();return}t.value=t.value?/\s$/.test(t.value)?t.value+n:`${t.value} ${n}`:n,t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.focus();let r=t.closest(`slicc-input-card`);r&&typeof r.submit==`function`?r.submit(`dictation`):t.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:t.value,source:`dictation`}}))}#I(){this.#m&&clearTimeout(this.#m),this.#m=null}#L(){this.#h&&clearTimeout(this.#h),this.#h=null,this.ownerDocument.removeEventListener(`selectionchange`,this.#D)}#R(){this.ownerDocument.removeEventListener(`pointerup`,this.#M),this.removeEventListener(`pointercancel`,this.#N)}#z(){let e=this.#s;if(this.#s=null,e!=null)try{this.releasePointerCapture(e)}catch{}}#B(){this.#r=`picking`,this.#X(`picking`),this.#y&&(this.#y.textContent=`Choose a microphone`),this.#b&&(this.#b.hidden=!0),this.#V();let e=this.ownerDocument;e.addEventListener(`pointerdown`,this.#U,!0),e.addEventListener(`keydown`,this.#W,!0)}#V(){let e=this.#S;if(!e||this.#C)return;let t=j(`div`,{class:`slicc-composer__ptt-device-menu`,role:`menu`}),r=null,i=this.#f??this.#p;for(let e of this.#w){let a=e.deviceId===i,o=j(`button`,{type:`button`,class:`slicc-composer__ptt-device-item`,role:`menuitemradio`,"aria-checked":a?`true`:`false`,"data-device-id":e.deviceId},e.label,j(`span`,{class:`tick`},n(`check`,{size:14})));o.addEventListener(`click`,()=>{this.device=e.deviceId,this.#K()}),(a||!r)&&(r=o),t.appendChild(o)}this.#C=t,e.appendChild(t),this.#H(t,e),r?.focus()}#H(e,t){let n=t.getBoundingClientRect(),r=(window.innerHeight||document.documentElement.clientHeight)-n.bottom-6-8,i=n.top-6-8,a=e.offsetHeight>r&&i>r;e.classList.toggle(`slicc-composer__ptt-device-menu--up`,a);let o=Math.max(a?i:r,0);e.style.maxHeight=`${Math.min(320,o)}px`}#U=e=>{this.#S&&e.composedPath().includes(this.#S)||this.#K()};#W=e=>{e.key===`Escape`&&(e.stopPropagation(),this.#K())};#G(){let e=this.ownerDocument;e.removeEventListener(`pointerdown`,this.#U,!0),e.removeEventListener(`keydown`,this.#W,!0)}#K(){this.#G(),this.#ee()}#q(e){switch(this.#r=e,this.#n||(this.#n=j(`div`,{class:`slicc-composer__ptt`,"data-ptt":!0,role:`button`}),this.appendChild(this.#n)),this.#X(e),e){case`enable`:this.#J(n(`mic`,{size:28}),`Hold to enable push to talk`,this.#Y(`Requesting microphone access when the bar fills`)),this.#n.setAttribute(`aria-label`,`Hold to enable push to talk`);break;case`prompting`:this.#J(n(`mic`,{size:28}),`Allow microphone access in the browser prompt`,this.#Y(`Waiting for permission…`)),this.#n.setAttribute(`aria-label`,`Waiting for microphone permission`);break;case`denied`:{let e=this.#v?`Microphone unavailable`:`Microphone access is blocked`,t=this.#v??`Enable the microphone for this site in your browser settings, then hold again.`;this.#J(n(`mic-off`,{size:28}),e,j(`div`,{class:`slicc-composer__ptt-load-text`},t)),this.#n.setAttribute(`aria-label`,e);break}case`recording`:{this.#S=j(`div`,{class:`slicc-composer__ptt-device`,hidden:!0}),this.#b=j(`div`,{class:`slicc-composer__ptt-caption`,"aria-live":`polite`,hidden:!0}),this.#x=j(`div`,{class:`slicc-composer__ptt-status`,hidden:!0});let e=j(`div`,{class:`slicc-composer__ptt-microw`},j(`div`,{class:`slicc-composer__ptt-mic`},n(`mic`,{size:28})),this.#S);this.#y=j(`div`,{class:`slicc-composer__ptt-label`},`Listening — release to send`),this.#n.replaceChildren(e,this.#y,this.#b,this.#x),this.#n.setAttribute(`aria-label`,`Listening — release to send`),this.#Q();break}}}#J(e,t,n){this.#n&&(this.#y=j(`div`,{class:`slicc-composer__ptt-label`},t),this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=[],this.#n.replaceChildren(j(`div`,{class:`slicc-composer__ptt-mic`},e),this.#y,n))}#Y(e){return j(`div`,{class:`slicc-composer__ptt-load`},j(`span`,{class:`slicc-composer__ptt-load-text`},e),j(`div`,{class:`slicc-composer__ptt-bar`},j(`div`,{class:`slicc-composer__ptt-bar-fill`})))}#X(e){this.#n&&(this.#n.classList.remove(`is-enable`,`is-prompting`,`is-denied`,`is-recording`,`is-finalizing`,`is-picking`),e!==`idle`&&this.#n.classList.add(`is-${e}`))}#Z(e,t=!1){let n=this.#b;if(!n)return;let r=e.trim().split(/\s+/).filter(Boolean);if(r.length===0){n.hidden=!0;return}n.textContent=r.slice(-8).join(` `),n.classList.toggle(`is-error`,t),n.hidden=!1}#Q(){let e=this.#x;if(!e)return;let t=this.#_;if(t?.state===`downloading`){if(t.download){let n=un(t.download.etaSeconds??null);e.textContent=n?`Better speech recognition downloading · ready in ${n}`:`Better speech recognition downloading…`}else e.textContent=`Preparing enhanced speech…`;e.classList.remove(`is-error`),e.hidden=!1}else t?.state===`ready`&&t.engine===`enhanced`?(e.textContent=`Enhanced speech recognition`,e.classList.remove(`is-error`),e.hidden=!1):t?.state===`unavailable`&&t.message?(e.textContent=t.message,e.classList.add(`is-error`),e.hidden=!1):(e.classList.remove(`is-error`),e.hidden=!0)}#$(e){let t=this.#S;if(!t)return;this.#w=e;let r=j(`button`,{type:`button`,class:`slicc-composer__ptt-device-btn`,"aria-label":`Choose a microphone`,"aria-haspopup":`menu`,title:`Choose a microphone`},n(`chevron-down`,{size:12}));r.addEventListener(`pointerdown`,e=>e.stopPropagation()),t.replaceChildren(r),t.hidden=!1}#ee(){this.#g?.(),this.#g=null,this.#n?.remove(),this.#n=null,this.#y=null,this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=[],this.#p=null,this.#v=null,this.#r=`idle`}});var dn=`
1682
+ `,Zt=`slicc-composer-style`;function Qt(e){if(e.getElementById(Zt))return;let t=e.createElement(`style`);t.id=Zt,t.textContent=Xt,(e.head??e.documentElement).appendChild(t)}var $t=1e3,en=60,tn=1e4,nn=45e3,rn=1500;function an(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>i(n),t);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e instanceof Error?e:Error(String(e)))})})}var on=`slicc-composer:mic-device`;function sn(){try{return typeof localStorage>`u`?null:localStorage.getItem(on)}catch{return null}}function cn(e){try{if(typeof localStorage>`u`)return;e?localStorage.setItem(on,e):localStorage.removeItem(on)}catch{}}function ln(e){return e==null||!Number.isFinite(e)?``:e<60?`~${Math.max(1,Math.round(e))}s`:`~${Math.floor(e/60)}m ${Math.round(e%60)}s`}A(`slicc-composer`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=!1;#n=null;#r=`idle`;#i=!1;#a=0;#o=null;#s=null;#c=null;#l=null;#u=null;#d=`unknown`;#f=sn();#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=null;#w=[];connectedCallback(){Qt(this.ownerDocument),this.#T(),this.addEventListener(`pointerdown`,this.#E)}disconnectedCallback(){this.removeEventListener(`pointerdown`,this.#E),this.#c?.cancel(),this.#c=null,this.#j(),this.#i=!1,this.#o=null,this.#a++,this.#z(),this.#L(),this.#m&&clearTimeout(this.#m),this.#m=null,this.#R(),this.#G(),this.#ee()}attributeChangedCallback(){}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get speech(){return this.#u??=s(),this.#u}set speech(e){this.#u=e,this.#d=`unknown`}get device(){return this.#f}set device(e){this.#f=e,cn(e)}get inner(){return this.#T(),this.#e}append(...e){this.#T(),this.#e.append(...e)}#T(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-composer__inner`);if(e instanceof HTMLElement){this.#e=e;return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-composer__inner`,this.#e.setAttribute(`part`,`inner`);for(let e of t)this.#e.appendChild(e);this.appendChild(this.#e)}#E=e=>{if(!this.hasAttribute(`ptt`)||!e.isPrimary||this.#i||e.button!==0||this.#r===`finalizing`||this.#r===`picking`)return;let t=e.target?.closest?.(`textarea`);if(!(t instanceof HTMLTextAreaElement)||!this.contains(t)||t.value!==``)return;this.#i=!0,this.#a++,this.#o=t,this.#s=e.pointerId;try{this.setPointerCapture(e.pointerId)}catch{}let n=this.ownerDocument;n.addEventListener(`pointerup`,this.#M),this.addEventListener(`pointercancel`,this.#N),n.addEventListener(`selectionchange`,this.#D);let r=this.#a;this.#h=setTimeout(()=>{this.#L(),this.#O(this.speech,r)},400)};#D=()=>{if(!this.#h)return;let e=this.ownerDocument.getSelection();!e||e.isCollapsed||e.toString()===``||(this.#i=!1,this.#a++,this.#o=null,this.#L(),this.#z(),this.#R())};async#O(e,t){let n=await Promise.race([e.permission().then(e=>(this.#d=e,e)),new Promise(e=>setTimeout(()=>e(`pending`),en))]);if(!(t!==this.#a||!this.#i)){if(n===`granted`){this.#A(e,t);return}if(n===`denied`){this.#q(`denied`);return}this.#q(`enable`),this.#m=setTimeout(()=>{this.#m=null,this.#k(e,t)},$t),n===`pending`&&e.permission().then(n=>{this.#d=n,!(t!==this.#a||!this.#i||this.#r!==`enable`)&&(n===`granted`?(this.#I(),this.#A(e,t)):n===`denied`&&(this.#I(),this.#q(`denied`)))})}}#k(e,t){t!==this.#a||!this.#i||this.#r!==`enable`||(this.#v=null,this.#q(`prompting`),an(e.requestPermission(),tn,Error(`Microphone didn't respond. Check your mic, then hold again.`)).then(n=>{this.#d=n?`granted`:`denied`,n&&e.warmup(),t===this.#a&&(n&&this.#i?this.#A(e,t):n?this.#ee():this.#i?this.#q(`denied`):this.#ee())}).catch(e=>{this.#d=`denied`,t===this.#a&&(this.#i?(this.#v=e instanceof Error?e.message:String(e),this.#q(`denied`)):this.#ee())}))}#A(e,t){this.#r=`recording`,this.#q(`recording`),e.warmup(),this.#g?.(),this.#g=e.onStatus(e=>{this.#_=e,this.#Q()});let n=e.microphones();n.then(e=>{t===this.#a&&(this.#f??(this.#p=o(e)),i(e)&&this.#$(e))}).catch(()=>{});let r=(this.#f==null?an(n,rn,Error(`microphone enumeration timed out`)).then(e=>o(e)).catch(()=>null):Promise.resolve(this.#f)).then(n=>e.start({deviceId:n??void 0,onPartial:e=>{t===this.#a&&this.#Z(e)},onError:e=>{t===this.#a&&this.#Z(e,!0)}}));this.#l=r,r.then(e=>{if(this.#l===r){if(this.#l=null,t!==this.#a||this.#r!==`recording`){e.cancel();return}this.#c=e}}).catch(e=>{this.#l===r&&(this.#l=null,t===this.#a&&this.#Z(e instanceof Error?e.message:String(e),!0))})}#j(){let e=this.#l;this.#l=null,e!==null&&e.then(e=>e.cancel(),()=>{})}#M=e=>{if(!this.#i||this.#s!=null&&e.pointerId!==this.#s)return;let t=this.#S,n=!1;if(this.#r===`recording`&&t&&!t.hidden)if(e.composedPath().includes(t))n=!0;else{let r=this.ownerDocument.elementFromPoint(e.clientX,e.clientY);n=r!=null&&t.contains(r)}if(n){this.#i=!1,this.#z(),this.#R(),this.#c?.cancel(),this.#c=null,this.#j(),this.#o=null,this.#B();return}this.#P(!0)};#N=e=>{(this.#s==null||e.pointerId===this.#s)&&this.#P(!1)};#P(e){if(!this.#i)return;switch(this.#i=!1,this.#L(),this.#z(),this.#R(),this.#r){case`enable`:this.#I(),this.#o=null,this.#ee();return;case`prompting`:this.#o=null;return;case`denied`:this.#o=null,this.#ee();return;case`recording`:break;default:this.#o=null,this.#ee();return}let t=this.#c;this.#c=null;let n=this.#l;if(this.#l=null,!e){t?.cancel(),n!==null&&n.then(e=>e.cancel(),()=>{}),this.#o=null,this.#ee();return}if(!t&&n===null){this.#o=null,this.#ee();return}this.#r=`finalizing`,this.#Z(`Transcribing…`);let r=this.#a;an((t?Promise.resolve(t):n).then(e=>e.stop()),nn,Error(`finalize timed out`)).then(e=>{r===this.#a&&(this.#ee(),this.#F(e))}).catch(()=>{r===this.#a&&(this.#ee(),this.#o=null)})}#F(e){let t=this.#o;if(this.#o=null,!t)return;let n=e.trim();if(!n){t.focus();return}t.value=t.value?/\s$/.test(t.value)?t.value+n:`${t.value} ${n}`:n,t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.focus();let r=t.closest(`slicc-input-card`);r&&typeof r.submit==`function`?r.submit(`dictation`):t.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:t.value,source:`dictation`}}))}#I(){this.#m&&clearTimeout(this.#m),this.#m=null}#L(){this.#h&&clearTimeout(this.#h),this.#h=null,this.ownerDocument.removeEventListener(`selectionchange`,this.#D)}#R(){this.ownerDocument.removeEventListener(`pointerup`,this.#M),this.removeEventListener(`pointercancel`,this.#N)}#z(){let e=this.#s;if(this.#s=null,e!=null)try{this.releasePointerCapture(e)}catch{}}#B(){this.#r=`picking`,this.#X(`picking`),this.#y&&(this.#y.textContent=`Choose a microphone`),this.#b&&(this.#b.hidden=!0),this.#V();let e=this.ownerDocument;e.addEventListener(`pointerdown`,this.#U,!0),e.addEventListener(`keydown`,this.#W,!0)}#V(){let e=this.#S;if(!e||this.#C)return;let t=j(`div`,{class:`slicc-composer__ptt-device-menu`,role:`menu`}),r=null,i=this.#f??this.#p;for(let e of this.#w){let a=e.deviceId===i,o=j(`button`,{type:`button`,class:`slicc-composer__ptt-device-item`,role:`menuitemradio`,"aria-checked":a?`true`:`false`,"data-device-id":e.deviceId},e.label,j(`span`,{class:`tick`},n(`check`,{size:14})));o.addEventListener(`click`,()=>{this.device=e.deviceId,this.#K()}),(a||!r)&&(r=o),t.appendChild(o)}this.#C=t,e.appendChild(t),this.#H(t,e),r?.focus()}#H(e,t){let n=t.getBoundingClientRect(),r=(window.innerHeight||document.documentElement.clientHeight)-n.bottom-6-8,i=n.top-6-8,a=e.offsetHeight>r&&i>r;e.classList.toggle(`slicc-composer__ptt-device-menu--up`,a);let o=Math.max(a?i:r,0);e.style.maxHeight=`${Math.min(320,o)}px`}#U=e=>{this.#S&&e.composedPath().includes(this.#S)||this.#K()};#W=e=>{e.key===`Escape`&&(e.stopPropagation(),this.#K())};#G(){let e=this.ownerDocument;e.removeEventListener(`pointerdown`,this.#U,!0),e.removeEventListener(`keydown`,this.#W,!0)}#K(){this.#G(),this.#ee()}#q(e){switch(this.#r=e,this.#n||(this.#n=j(`div`,{class:`slicc-composer__ptt`,"data-ptt":!0,role:`button`}),this.appendChild(this.#n)),this.#X(e),e){case`enable`:this.#J(n(`mic`,{size:28}),`Hold to enable push to talk`,this.#Y(`Requesting microphone access when the bar fills`)),this.#n.setAttribute(`aria-label`,`Hold to enable push to talk`);break;case`prompting`:this.#J(n(`mic`,{size:28}),`Allow microphone access in the browser prompt`,this.#Y(`Waiting for permission…`)),this.#n.setAttribute(`aria-label`,`Waiting for microphone permission`);break;case`denied`:{let e=this.#v?`Microphone unavailable`:`Microphone access is blocked`,t=this.#v??`Enable the microphone for this site in your browser settings, then hold again.`;this.#J(n(`mic-off`,{size:28}),e,j(`div`,{class:`slicc-composer__ptt-load-text`},t)),this.#n.setAttribute(`aria-label`,e);break}case`recording`:{this.#S=j(`div`,{class:`slicc-composer__ptt-device`,hidden:!0}),this.#b=j(`div`,{class:`slicc-composer__ptt-caption`,"aria-live":`polite`,hidden:!0}),this.#x=j(`div`,{class:`slicc-composer__ptt-status`,hidden:!0});let e=j(`div`,{class:`slicc-composer__ptt-microw`},j(`div`,{class:`slicc-composer__ptt-mic`},n(`mic`,{size:28})),this.#S);this.#y=j(`div`,{class:`slicc-composer__ptt-label`},`Listening — release to send`),this.#n.replaceChildren(e,this.#y,this.#b,this.#x),this.#n.setAttribute(`aria-label`,`Listening — release to send`),this.#Q();break}}}#J(e,t,n){this.#n&&(this.#y=j(`div`,{class:`slicc-composer__ptt-label`},t),this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=[],this.#n.replaceChildren(j(`div`,{class:`slicc-composer__ptt-mic`},e),this.#y,n))}#Y(e){return j(`div`,{class:`slicc-composer__ptt-load`},j(`span`,{class:`slicc-composer__ptt-load-text`},e),j(`div`,{class:`slicc-composer__ptt-bar`},j(`div`,{class:`slicc-composer__ptt-bar-fill`})))}#X(e){this.#n&&(this.#n.classList.remove(`is-enable`,`is-prompting`,`is-denied`,`is-recording`,`is-finalizing`,`is-picking`),e!==`idle`&&this.#n.classList.add(`is-${e}`))}#Z(e,t=!1){let n=this.#b;if(!n)return;let r=e.trim().split(/\s+/).filter(Boolean);if(r.length===0){n.hidden=!0;return}n.textContent=r.slice(-8).join(` `),n.classList.toggle(`is-error`,t),n.hidden=!1}#Q(){let e=this.#x;if(!e)return;let t=this.#_;if(t?.state===`downloading`){if(t.download){let n=ln(t.download.etaSeconds??null);e.textContent=n?`Better speech recognition downloading · ready in ${n}`:`Better speech recognition downloading…`}else e.textContent=`Preparing enhanced speech…`;e.classList.remove(`is-error`),e.hidden=!1}else t?.state===`ready`&&t.engine===`enhanced`?(e.textContent=`Enhanced speech recognition`,e.classList.remove(`is-error`),e.hidden=!1):t?.state===`unavailable`&&t.message?(e.textContent=t.message,e.classList.add(`is-error`),e.hidden=!1):(e.classList.remove(`is-error`),e.hidden=!0)}#$(e){let t=this.#S;if(!t)return;this.#w=e;let r=j(`button`,{type:`button`,class:`slicc-composer__ptt-device-btn`,"aria-label":`Choose a microphone`,"aria-haspopup":`menu`,title:`Choose a microphone`},n(`chevron-down`,{size:12}));r.addEventListener(`pointerdown`,e=>e.stopPropagation()),t.replaceChildren(r),t.hidden=!1}#ee(){this.#g?.(),this.#g=null,this.#n?.remove(),this.#n=null,this.#y=null,this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=[],this.#p=null,this.#v=null,this.#r=`idle`}});var un=`
1683
1683
  slicc-composer-capture {
1684
1684
  position: relative;
1685
1685
  display: block;
@@ -1883,7 +1883,7 @@ slicc-composer-capture .slicc-capture__timer {
1883
1883
  slicc-composer-capture .slicc-capture__timer[hidden] {
1884
1884
  display: none;
1885
1885
  }
1886
- `,fn=`slicc-composer-capture-style`;function pn(e){if(e.getElementById(fn))return;let t=e.createElement(`style`);t.id=fn,t.textContent=dn,(e.head??e.documentElement).appendChild(t)}var mn=`photo`,hn=[`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`,`video/webm`];function gn(){if(typeof MediaRecorder>`u`)return`video/webm`;for(let e of hn)if(MediaRecorder.isTypeSupported?.(e))return e;return`video/webm`}function _n(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}A(`slicc-composer-capture`,class extends HTMLElement{static observedAttributes=[`mode`,`preferred-device`,`preferred-audio-device`];media=null;recorderFactory=null;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=!1;#u=null;#d=null;#f=null;#p=[];#m=0;#h=null;#g=null;#_=e=>{e.key===`Escape`&&this.#g&&this.#L()};connectedCallback(){pn(this.ownerDocument),this.#H(),this.ownerDocument.addEventListener(`keydown`,this.#_)}disconnectedCallback(){if(this.ownerDocument.removeEventListener(`keydown`,this.#_),this.#N(),this.#P(),this.#I(),this.#g){let e=this.#g;this.#g=null,e(null)}}attributeChangedCallback(e,t,n){e===`mode`&&this.#l&&this.#z(n??mn)}get mode(){return this.getAttribute(`mode`)===`video`?`video`:`photo`}set mode(e){e==null?this.removeAttribute(`mode`):this.setAttribute(`mode`,e)}get preferredDevice(){return this.getAttribute(`preferred-device`)}set preferredDevice(e){e==null?this.removeAttribute(`preferred-device`):this.setAttribute(`preferred-device`,e)}get preferredAudioDevice(){return this.getAttribute(`preferred-audio-device`)}set preferredAudioDevice(e){e==null?this.removeAttribute(`preferred-audio-device`):this.setAttribute(`preferred-audio-device`,e)}#v(){return this.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}#y(e,t){return this.recorderFactory?this.recorderFactory(e,t):new MediaRecorder(e,t)}async open(e){this.#H(),e&&(this.mode=e),this.#z(this.mode);let t=this.#v();if(!t)return null;try{this.#u=await this.#b(t,this.preferredDevice,this.preferredAudioDevice,this.mode)}catch{return null}return this.#S(),this.#C(this.#u),await this.#w(t),await this.#T(t),this.hidden=!1,new Promise(e=>{this.#g=e})}async#b(e,t,n,r){let i=await this.#x(e,n,r);if(t)try{return await e.getUserMedia({video:{deviceId:{exact:t}},audio:i})}catch{}try{return await e.getUserMedia({video:!0,audio:i})}catch(t){if(i===!1)throw t;return this.#r.textContent=`Microphone unavailable — recording video only.`,e.getUserMedia({video:!0,audio:!1})}}async#x(e,t,n){if(n!==`video`)return!1;if(t)return{deviceId:{exact:t}};let r=[];try{r=(await e.enumerateDevices()).filter(e=>e.kind===`audioinput`)}catch{r=[]}let i=o(a(r,`microphone`));return!i||{deviceId:{exact:i}}}#S(){this.#d=this.#u?.getAudioTracks()[0]??null}#C(e){this.#e.srcObject=e,this.#e.muted=!0,this.#e.play?.()?.catch(()=>void 0);let t=e.getVideoTracks()[0]?.getSettings?.().facingMode;this.#e.toggleAttribute(`data-mirrored`,t!==`environment`)}async#w(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`videoinput`)}catch{t=[]}let n=a(t,`camera`);this.#t.replaceChildren(...n.map(e=>j(`option`,{value:e.deviceId},e.label)));let r=this.#u?.getVideoTracks()[0]?.getSettings?.().deviceId;r&&(this.#t.value=r),this.#t.toggleAttribute(`hidden`,!i(n))}async#T(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`audioinput`)}catch{t=[]}let n=a(t,`microphone`);this.#n.replaceChildren(...n.map(e=>j(`option`,{value:e.deviceId},e.label)));let r=this.#d?.getSettings?.().deviceId??this.preferredAudioDevice??o(n);r&&n.some(e=>e.deviceId===r)&&(this.#n.value=r),this.#E()}#E(){if(!this.#n)return;let e=this.#n.options.length>=2,t=this.mode===`video`&&e;this.#n.toggleAttribute(`hidden`,!t)}async#D(e){let t=this.#v();if(t){this.#r.textContent=``;try{let n=await t.getUserMedia({video:{deviceId:{exact:e}}});this.#F();let r=n;if(this.mode===`video`&&this.#d&&this.#d.readyState===`live`)r.addTrack(this.#d);else if(this.mode===`video`)try{let e=await t.getUserMedia({audio:await this.#x(t,this.preferredAudioDevice,`video`)});for(let t of e.getAudioTracks())this.#d=t,r.addTrack(t)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}this.#u=r,this.#C(r),this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`camera`},bubbles:!0,composed:!0}))}catch{this.#r.textContent=`Could not switch camera — keeping the current one.`}}}async#O(e){let t=this.#v();if(!t||!this.#u)return;this.#r.textContent=``;let n;try{n=await t.getUserMedia({audio:{deviceId:{exact:e}}})}catch{this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}let r=n.getAudioTracks()[0];if(!r){this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}if(this.#d){try{this.#u.removeTrack(this.#d)}catch{}this.#d.stop()}this.#u.addTrack(r),this.#d=r,this.preferredAudioDevice=e,this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`microphone`},bubbles:!0,composed:!0}))}#k(){let e=this.ownerDocument.createElement(`canvas`);if(e.width=this.#e.videoWidth,e.height=this.#e.videoHeight,e.width===0||e.height===0){this.#r.textContent=`No frame yet — give the camera a moment.`;return}e.getContext(`2d`)?.drawImage(this.#e,0,0);let t=`image/png`,n=e.toDataURL(t);this.#R({kind:`image`,dataUrl:n,mimeType:t,width:e.width,height:e.height})}#A(){if(!this.#u||this.#f)return;this.#p=[];let e=gn(),t;try{t=this.#y(this.#u,{mimeType:e})}catch{this.#r.textContent=`Recording is not supported in this browser.`;return}t.ondataavailable=e=>{e.data&&e.data.size>0&&this.#p.push(e.data)},t.onstop=()=>this.#M(e);try{t.start()}catch{this.#r.textContent=`Could not start recording.`;return}this.#f=t,this.#m=Date.now(),this.#n.disabled=!0,this.#t.disabled=!0,this.#i.hidden=!1,this.#i.textContent=_n(0),this.#h=setInterval(()=>{this.#i.textContent=_n(Date.now()-this.#m)},250),this.#B()}#j(){let e=this.#f;if(e)try{e.state!==`inactive`&&e.stop()}catch{this.#M(e.mimeType||`video/webm`)}}#M(e){let t=this.#m?Date.now()-this.#m:0;this.#N();let n=this.#f?.mimeType||e||`video/webm`,r=new Blob(this.#p,{type:n});this.#p=[],this.#f=null,this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1);let i=typeof URL<`u`?URL.createObjectURL(r):void 0;this.#R({kind:`video`,blob:r,dataUrl:i,mimeType:n,width:this.#e.videoWidth,height:this.#e.videoHeight,durationMs:t})}#N(){this.#h!=null&&(clearInterval(this.#h),this.#h=null),this.#i.hidden=!0,this.#i.textContent=``,this.#m=0}#P(){let e=this.#f;if(this.#f=null,this.#p=[],this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1),e){e.ondataavailable=null,e.onstop=null;try{e.state!==`inactive`&&e.stop()}catch{}}}#F(){for(let e of this.#u?.getVideoTracks()??[])e.stop()}#I(){for(let e of this.#u?.getTracks()??[])e.stop();this.#u=null,this.#d=null,this.#e&&(this.#e.srcObject=null)}#L(){this.dispatchEvent(new CustomEvent(`slicc-capture-cancel`,{bubbles:!0,composed:!0})),this.#R(null)}#R(e){e&&this.dispatchEvent(new CustomEvent(`slicc-capture`,{detail:e,bubbles:!0,composed:!0})),this.#N(),this.#P(),this.#I();let t=this.#g;this.#g=null,this.hidden=!0,t?.(e)}#z(e){let t=e===`video`;this.#s.setAttribute(`aria-pressed`,String(!t)),this.#c.setAttribute(`aria-pressed`,String(t)),this.#r.textContent=t?`Mic on — video will record audio.`:``,this.#B(),this.#E()}#B(){let e=this.#a;if(e.replaceChildren(),this.mode===`photo`){e.className=`slicc-capture__btn slicc-capture__btn--primary`,e.setAttribute(`part`,`snap`),e.setAttribute(`aria-label`,`Snap photo`),e.append(n(`camera`,{size:14}),document.createTextNode(` Snap`));return}this.#f?(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`stop`),e.setAttribute(`aria-label`,`Stop recording`),e.append(j(`span`,{class:`slicc-capture__square`}),document.createTextNode(` Stop`))):(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`record`),e.setAttribute(`aria-label`,`Start recording`),e.append(j(`span`,{class:`slicc-capture__dot`}),document.createTextNode(` Record`)))}#V(){if(this.mode===`photo`){this.#k();return}this.#f?this.#j():this.#A()}#H(){if(this.#l)return;this.#l=!0,this.#e=j(`video`,{class:`slicc-capture__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#e.muted=!0,this.#r=j(`div`,{class:`slicc-capture__status`}),this.#t=j(`select`,{class:`slicc-capture__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#t.addEventListener(`change`,()=>{this.#D(this.#t.value)}),this.#n=j(`select`,{class:`slicc-capture__select`,part:`audio-picker`,"aria-label":`Microphone`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#O(this.#n.value)}),this.#s=j(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`true`,"aria-label":`Photo`},n(`image`,{size:14})),this.#s.addEventListener(`click`,()=>{this.mode=`photo`}),this.#c=j(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`false`,"aria-label":`Video`},n(`video`,{size:14})),this.#c.addEventListener(`click`,()=>{this.#U()});let e=j(`div`,{class:`slicc-capture__mode`,role:`group`,"aria-label":`Capture mode`},this.#s,this.#c);this.#i=j(`span`,{class:`slicc-capture__timer`,hidden:!0}),this.#o=j(`button`,{type:`button`,class:`slicc-capture__close`,part:`cancel`,"aria-label":`Cancel`},n(`x`,{size:14})),this.#o.addEventListener(`click`,()=>this.#L()),this.#a=j(`button`,{type:`button`,class:`slicc-capture__btn slicc-capture__btn--primary`,part:`snap`,"aria-label":`Snap photo`}),this.#a.addEventListener(`click`,()=>this.#V());let t=j(`div`,{class:`slicc-capture__bar`},this.#t,this.#n,j(`span`,{class:`slicc-capture__spacer`}),this.#i,this.#a,e);this.replaceChildren(this.#e,this.#r,t,this.#o),this.#z(this.mode)}async#U(){if(this.mode=`video`,!this.#u||this.#u.getAudioTracks().length>0)return;let e=this.#v();if(!e)return;let t=this.#u.getVideoTracks()[0]?.getSettings?.().deviceId??this.preferredDevice??null,n=await this.#x(e,this.preferredAudioDevice,`video`);try{let r=t?await e.getUserMedia({video:{deviceId:{exact:t}},audio:n}):await e.getUserMedia({video:!0,audio:n});this.#I(),this.#u=r,this.#S(),this.#C(r),await this.#T(e)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}}});var vn=[`off`,`low`,`medium`,`high`,`xhigh`,`max`],yn={off:{label:`Secco`,gloss:`bone dry — not a drop (ask any prosecco)`,tint:`var(--txt-3)`},low:{label:`Goccia`,gloss:`one drop — bar-speak: «macchiato, solo una goccia»`,tint:`color-mix(in srgb, var(--violet) 20%, var(--txt-3))`},medium:{label:`Bagnato`,gloss:`properly wet`,tint:`color-mix(in srgb, var(--violet) 40%, var(--txt-3))`},high:{label:`Affogato`,gloss:`drowned — the menu item itself`,tint:`color-mix(in srgb, var(--violet) 60%, var(--txt-3))`},xhigh:{label:`Inzuppato`,gloss:`soaked through, biscotto-style`,tint:`color-mix(in srgb, var(--violet) 80%, var(--txt-3))`},max:{label:`Sprofondato`,gloss:`sunk to the bottom`,tint:`var(--violet)`}},bn=`max`,xn=`Opus 4.8`,Sn=[{name:`Opus 4.8`,provider:`Anthropic`,id:`claude-opus-4-8`},{name:`Sonnet 4.6`,provider:`Anthropic`,id:`claude-sonnet-4-6`},{name:`Haiku 4.5`,provider:`Anthropic`,id:`claude-haiku-4-5`}],Cn=8;function wn(e){let t=typeof e==`string`?{name:e}:e;return{...t,name:t.name,id:t.id??t.name}}var Tn=`max`,En=13;function Dn(){return n(`sparkles`,{size:En,class:`ic`,part:`model-icon`})}function On(){return n(`brain`,{size:En,class:`brain`,part:`brain`})}function kn(){return n(`chevron-down`,{size:11,part:`caret`})}var An=`http://www.w3.org/2000/svg`;function jn(){let e=document.createElementNS(An,`svg`);e.setAttribute(`width`,`0`),e.setAttribute(`height`,`0`),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`style`,`position:absolute`);let t=document.createElementNS(An,`defs`),n=document.createElementNS(An,`linearGradient`);n.setAttribute(`id`,`meta-rainbow`),n.setAttribute(`x1`,`0`),n.setAttribute(`y1`,`0`),n.setAttribute(`x2`,`1`),n.setAttribute(`y2`,`0`);for(let[e,t]of[[`0%`,`#f43f5e`],[`28%`,`#f59e0b`],[`64%`,`#06b6d4`],[`100%`,`#8b5cf6`]]){let r=document.createElementNS(An,`stop`);r.setAttribute(`offset`,e),r.setAttribute(`stop-color`,t),n.appendChild(r)}return t.appendChild(n),e.appendChild(t),e}var Mn=M(`
1886
+ `,dn=`slicc-composer-capture-style`;function fn(e){if(e.getElementById(dn))return;let t=e.createElement(`style`);t.id=dn,t.textContent=un,(e.head??e.documentElement).appendChild(t)}var pn=`photo`,mn=[`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`,`video/webm`];function hn(){if(typeof MediaRecorder>`u`)return`video/webm`;for(let e of mn)if(MediaRecorder.isTypeSupported?.(e))return e;return`video/webm`}function gn(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}A(`slicc-composer-capture`,class extends HTMLElement{static observedAttributes=[`mode`,`preferred-device`,`preferred-audio-device`];media=null;recorderFactory=null;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=!1;#u=null;#d=null;#f=null;#p=[];#m=0;#h=null;#g=null;#_=e=>{e.key===`Escape`&&this.#g&&this.#L()};connectedCallback(){fn(this.ownerDocument),this.#H(),this.ownerDocument.addEventListener(`keydown`,this.#_)}disconnectedCallback(){if(this.ownerDocument.removeEventListener(`keydown`,this.#_),this.#N(),this.#P(),this.#I(),this.#g){let e=this.#g;this.#g=null,e(null)}}attributeChangedCallback(e,t,n){e===`mode`&&this.#l&&this.#z(n??pn)}get mode(){return this.getAttribute(`mode`)===`video`?`video`:`photo`}set mode(e){e==null?this.removeAttribute(`mode`):this.setAttribute(`mode`,e)}get preferredDevice(){return this.getAttribute(`preferred-device`)}set preferredDevice(e){e==null?this.removeAttribute(`preferred-device`):this.setAttribute(`preferred-device`,e)}get preferredAudioDevice(){return this.getAttribute(`preferred-audio-device`)}set preferredAudioDevice(e){e==null?this.removeAttribute(`preferred-audio-device`):this.setAttribute(`preferred-audio-device`,e)}#v(){return this.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}#y(e,t){return this.recorderFactory?this.recorderFactory(e,t):new MediaRecorder(e,t)}async open(e){this.#H(),e&&(this.mode=e),this.#z(this.mode);let t=this.#v();if(!t)return null;try{this.#u=await this.#b(t,this.preferredDevice,this.preferredAudioDevice,this.mode)}catch{return null}return this.#S(),this.#C(this.#u),await this.#w(t),await this.#T(t),this.hidden=!1,new Promise(e=>{this.#g=e})}async#b(e,t,n,r){let i=await this.#x(e,n,r);if(t)try{return await e.getUserMedia({video:{deviceId:{exact:t}},audio:i})}catch{}try{return await e.getUserMedia({video:!0,audio:i})}catch(t){if(i===!1)throw t;return this.#r.textContent=`Microphone unavailable — recording video only.`,e.getUserMedia({video:!0,audio:!1})}}async#x(e,t,n){if(n!==`video`)return!1;if(t)return{deviceId:{exact:t}};let r=[];try{r=(await e.enumerateDevices()).filter(e=>e.kind===`audioinput`)}catch{r=[]}let i=o(a(r,`microphone`));return!i||{deviceId:{exact:i}}}#S(){this.#d=this.#u?.getAudioTracks()[0]??null}#C(e){this.#e.srcObject=e,this.#e.muted=!0,this.#e.play?.()?.catch(()=>void 0);let t=e.getVideoTracks()[0]?.getSettings?.().facingMode;this.#e.toggleAttribute(`data-mirrored`,t!==`environment`)}async#w(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`videoinput`)}catch{t=[]}let n=a(t,`camera`);this.#t.replaceChildren(...n.map(e=>j(`option`,{value:e.deviceId},e.label)));let r=this.#u?.getVideoTracks()[0]?.getSettings?.().deviceId;r&&(this.#t.value=r),this.#t.toggleAttribute(`hidden`,!i(n))}async#T(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`audioinput`)}catch{t=[]}let n=a(t,`microphone`);this.#n.replaceChildren(...n.map(e=>j(`option`,{value:e.deviceId},e.label)));let r=this.#d?.getSettings?.().deviceId??this.preferredAudioDevice??o(n);r&&n.some(e=>e.deviceId===r)&&(this.#n.value=r),this.#E()}#E(){if(!this.#n)return;let e=this.#n.options.length>=2,t=this.mode===`video`&&e;this.#n.toggleAttribute(`hidden`,!t)}async#D(e){let t=this.#v();if(t){this.#r.textContent=``;try{let n=await t.getUserMedia({video:{deviceId:{exact:e}}});this.#F();let r=n;if(this.mode===`video`&&this.#d&&this.#d.readyState===`live`)r.addTrack(this.#d);else if(this.mode===`video`)try{let e=await t.getUserMedia({audio:await this.#x(t,this.preferredAudioDevice,`video`)});for(let t of e.getAudioTracks())this.#d=t,r.addTrack(t)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}this.#u=r,this.#C(r),this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`camera`},bubbles:!0,composed:!0}))}catch{this.#r.textContent=`Could not switch camera — keeping the current one.`}}}async#O(e){let t=this.#v();if(!t||!this.#u)return;this.#r.textContent=``;let n;try{n=await t.getUserMedia({audio:{deviceId:{exact:e}}})}catch{this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}let r=n.getAudioTracks()[0];if(!r){this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}if(this.#d){try{this.#u.removeTrack(this.#d)}catch{}this.#d.stop()}this.#u.addTrack(r),this.#d=r,this.preferredAudioDevice=e,this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`microphone`},bubbles:!0,composed:!0}))}#k(){let e=this.ownerDocument.createElement(`canvas`);if(e.width=this.#e.videoWidth,e.height=this.#e.videoHeight,e.width===0||e.height===0){this.#r.textContent=`No frame yet — give the camera a moment.`;return}e.getContext(`2d`)?.drawImage(this.#e,0,0);let t=`image/png`,n=e.toDataURL(t);this.#R({kind:`image`,dataUrl:n,mimeType:t,width:e.width,height:e.height})}#A(){if(!this.#u||this.#f)return;this.#p=[];let e=hn(),t;try{t=this.#y(this.#u,{mimeType:e})}catch{this.#r.textContent=`Recording is not supported in this browser.`;return}t.ondataavailable=e=>{e.data&&e.data.size>0&&this.#p.push(e.data)},t.onstop=()=>this.#M(e);try{t.start()}catch{this.#r.textContent=`Could not start recording.`;return}this.#f=t,this.#m=Date.now(),this.#n.disabled=!0,this.#t.disabled=!0,this.#i.hidden=!1,this.#i.textContent=gn(0),this.#h=setInterval(()=>{this.#i.textContent=gn(Date.now()-this.#m)},250),this.#B()}#j(){let e=this.#f;if(e)try{e.state!==`inactive`&&e.stop()}catch{this.#M(e.mimeType||`video/webm`)}}#M(e){let t=this.#m?Date.now()-this.#m:0;this.#N();let n=this.#f?.mimeType||e||`video/webm`,r=new Blob(this.#p,{type:n});this.#p=[],this.#f=null,this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1);let i=typeof URL<`u`?URL.createObjectURL(r):void 0;this.#R({kind:`video`,blob:r,dataUrl:i,mimeType:n,width:this.#e.videoWidth,height:this.#e.videoHeight,durationMs:t})}#N(){this.#h!=null&&(clearInterval(this.#h),this.#h=null),this.#i.hidden=!0,this.#i.textContent=``,this.#m=0}#P(){let e=this.#f;if(this.#f=null,this.#p=[],this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1),e){e.ondataavailable=null,e.onstop=null;try{e.state!==`inactive`&&e.stop()}catch{}}}#F(){for(let e of this.#u?.getVideoTracks()??[])e.stop()}#I(){for(let e of this.#u?.getTracks()??[])e.stop();this.#u=null,this.#d=null,this.#e&&(this.#e.srcObject=null)}#L(){this.dispatchEvent(new CustomEvent(`slicc-capture-cancel`,{bubbles:!0,composed:!0})),this.#R(null)}#R(e){e&&this.dispatchEvent(new CustomEvent(`slicc-capture`,{detail:e,bubbles:!0,composed:!0})),this.#N(),this.#P(),this.#I();let t=this.#g;this.#g=null,this.hidden=!0,t?.(e)}#z(e){let t=e===`video`;this.#s.setAttribute(`aria-pressed`,String(!t)),this.#c.setAttribute(`aria-pressed`,String(t)),this.#r.textContent=t?`Mic on — video will record audio.`:``,this.#B(),this.#E()}#B(){let e=this.#a;if(e.replaceChildren(),this.mode===`photo`){e.className=`slicc-capture__btn slicc-capture__btn--primary`,e.setAttribute(`part`,`snap`),e.setAttribute(`aria-label`,`Snap photo`),e.append(n(`camera`,{size:14}),document.createTextNode(` Snap`));return}this.#f?(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`stop`),e.setAttribute(`aria-label`,`Stop recording`),e.append(j(`span`,{class:`slicc-capture__square`}),document.createTextNode(` Stop`))):(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`record`),e.setAttribute(`aria-label`,`Start recording`),e.append(j(`span`,{class:`slicc-capture__dot`}),document.createTextNode(` Record`)))}#V(){if(this.mode===`photo`){this.#k();return}this.#f?this.#j():this.#A()}#H(){if(this.#l)return;this.#l=!0,this.#e=j(`video`,{class:`slicc-capture__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#e.muted=!0,this.#r=j(`div`,{class:`slicc-capture__status`}),this.#t=j(`select`,{class:`slicc-capture__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#t.addEventListener(`change`,()=>{this.#D(this.#t.value)}),this.#n=j(`select`,{class:`slicc-capture__select`,part:`audio-picker`,"aria-label":`Microphone`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#O(this.#n.value)}),this.#s=j(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`true`,"aria-label":`Photo`},n(`image`,{size:14})),this.#s.addEventListener(`click`,()=>{this.mode=`photo`}),this.#c=j(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`false`,"aria-label":`Video`},n(`video`,{size:14})),this.#c.addEventListener(`click`,()=>{this.#U()});let e=j(`div`,{class:`slicc-capture__mode`,role:`group`,"aria-label":`Capture mode`},this.#s,this.#c);this.#i=j(`span`,{class:`slicc-capture__timer`,hidden:!0}),this.#o=j(`button`,{type:`button`,class:`slicc-capture__close`,part:`cancel`,"aria-label":`Cancel`},n(`x`,{size:14})),this.#o.addEventListener(`click`,()=>this.#L()),this.#a=j(`button`,{type:`button`,class:`slicc-capture__btn slicc-capture__btn--primary`,part:`snap`,"aria-label":`Snap photo`}),this.#a.addEventListener(`click`,()=>this.#V());let t=j(`div`,{class:`slicc-capture__bar`},this.#t,this.#n,j(`span`,{class:`slicc-capture__spacer`}),this.#i,this.#a,e);this.replaceChildren(this.#e,this.#r,t,this.#o),this.#z(this.mode)}async#U(){if(this.mode=`video`,!this.#u||this.#u.getAudioTracks().length>0)return;let e=this.#v();if(!e)return;let t=this.#u.getVideoTracks()[0]?.getSettings?.().deviceId??this.preferredDevice??null,n=await this.#x(e,this.preferredAudioDevice,`video`);try{let r=t?await e.getUserMedia({video:{deviceId:{exact:t}},audio:n}):await e.getUserMedia({video:!0,audio:n});this.#I(),this.#u=r,this.#S(),this.#C(r),await this.#T(e)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}}});var _n=[`off`,`low`,`medium`,`high`,`xhigh`,`max`],vn={off:{label:`Secco`,gloss:`bone dry — not a drop (ask any prosecco)`,tint:`var(--txt-3)`},low:{label:`Goccia`,gloss:`one drop — bar-speak: «macchiato, solo una goccia»`,tint:`color-mix(in srgb, var(--violet) 20%, var(--txt-3))`},medium:{label:`Bagnato`,gloss:`properly wet`,tint:`color-mix(in srgb, var(--violet) 40%, var(--txt-3))`},high:{label:`Affogato`,gloss:`drowned — the menu item itself`,tint:`color-mix(in srgb, var(--violet) 60%, var(--txt-3))`},xhigh:{label:`Inzuppato`,gloss:`soaked through, biscotto-style`,tint:`color-mix(in srgb, var(--violet) 80%, var(--txt-3))`},max:{label:`Sprofondato`,gloss:`sunk to the bottom`,tint:`var(--violet)`}},yn=`max`,bn=`Opus 4.8`,xn=[{name:`Opus 4.8`,provider:`Anthropic`,id:`claude-opus-4-8`},{name:`Sonnet 4.6`,provider:`Anthropic`,id:`claude-sonnet-4-6`},{name:`Haiku 4.5`,provider:`Anthropic`,id:`claude-haiku-4-5`}],Sn=8;function Cn(e){let t=typeof e==`string`?{name:e}:e;return{...t,name:t.name,id:t.id??t.name}}var wn=`max`,Tn=13;function En(){return n(`sparkles`,{size:Tn,class:`ic`,part:`model-icon`})}function Dn(){return n(`brain`,{size:Tn,class:`brain`,part:`brain`})}function On(){return n(`chevron-down`,{size:11,part:`caret`})}var kn=`http://www.w3.org/2000/svg`;function An(){let e=document.createElementNS(kn,`svg`);e.setAttribute(`width`,`0`),e.setAttribute(`height`,`0`),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`style`,`position:absolute`);let t=document.createElementNS(kn,`defs`),n=document.createElementNS(kn,`linearGradient`);n.setAttribute(`id`,`meta-rainbow`),n.setAttribute(`x1`,`0`),n.setAttribute(`y1`,`0`),n.setAttribute(`x2`,`1`),n.setAttribute(`y2`,`0`);for(let[e,t]of[[`0%`,`#f43f5e`],[`28%`,`#f59e0b`],[`64%`,`#06b6d4`],[`100%`,`#8b5cf6`]]){let r=document.createElementNS(kn,`stop`);r.setAttribute(`offset`,e),r.setAttribute(`stop-color`,t),n.appendChild(r)}return t.appendChild(n),e.appendChild(t),e}var jn=M(`
1887
1887
  :host{display:block;}
1888
1888
  *{box-sizing:border-box;}
1889
1889
  .meta{display:flex;align-items:center;gap:8px;max-width:680px;margin:11px auto 0;font-family:var(--ui);}
@@ -1940,7 +1940,7 @@ slicc-composer-capture .slicc-capture__timer[hidden] {
1940
1940
  /* Narrow / extension-sidebar: the ⏎ / ⇧⏎ keyboard hints don't fit (and touch
1941
1941
  users have no keyboard) — drop them regardless of the narrow-chat attribute. */
1942
1942
  @media (max-width: 560px){ .hint{display:none;} }
1943
- `);A(`slicc-composer-meta`,class extends HTMLElement{static observedAttributes=[`model`,`thinking`,`narrow`,`no-thinking`];#e;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=null;#c=null;#l=!1;#u=!1;#d=``;#f=e=>{let t=e.composedPath();this.#l&&!t.includes(this)&&this.#S(),this.#u&&!t.includes(this)&&this.#D()};#p=e=>{e.key===`Escape`&&(this.#l&&(e.stopPropagation(),this.#S(),this.#r?.focus()),this.#u&&(e.stopPropagation(),this.#D(),this.#i?.focus()))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Mn]}connectedCallback(){this.#g()}disconnectedCallback(){this.#y(),document.removeEventListener(`mousedown`,this.#f),document.removeEventListener(`keydown`,this.#p,!0)}attributeChangedCallback(){this.isConnected&&this.#g()}get model(){return this.getAttribute(`model`)??xn}set model(e){e==null?this.removeAttribute(`model`):this.setAttribute(`model`,e)}get models(){return(this.#c??[...Sn]).map(e=>typeof e==`string`?e:{...e})}set models(e){this.#c=Array.isArray(e)?e.slice():null,this.isConnected&&this.#g()}get#m(){return(this.#c??Sn).map(wn)}get#h(){return this.#c!==null&&this.#c.length===0}get thinking(){let e=this.getAttribute(`thinking`);return vn.includes(e??``)?e:Tn}set thinking(e){this.setAttribute(`thinking`,e)}get narrow(){return this.hasAttribute(`narrow`)}set narrow(e){this.toggleAttribute(`narrow`,e)}get noThinking(){return this.hasAttribute(`no-thinking`)}set noThinking(e){this.toggleAttribute(`no-thinking`,e)}get accented(){return this.thinking===bn}#g(){this.#y();let e=this.model,t=this.thinking,r=yn[t],i=t===bn,a=this.#h,o=a?j(`button`,{type:`button`,class:`ctl msel`,part:`model`},Dn(),` `,`Add AI`):j(`button`,{type:`button`,class:`ctl msel`,part:`model`,"aria-haspopup":`menu`,"aria-expanded":`false`},Dn(),` `,e,` `,j(`span`,{class:`cx`},kn())),s=j(`div`,{class:`menu`,part:`model-menu`,role:`menu`});if(this.#m.length>Cn){let e=j(`input`,{class:`msearch`,part:`model-search`,type:`text`,placeholder:`Search models…`,"aria-label":`Search models`});e.value=this.#d,e.addEventListener(`input`,()=>{this.#d=e.value,this.#_()}),e.addEventListener(`click`,e=>e.stopPropagation()),s.append(e)}this.#s=j(`div`,{class:`mlist`,role:`none`}),s.append(this.#s);let c=j(`div`,{class:`mwrap`},o,s),l=!this.noThinking&&!a,u=null;if(l){let e=On();e.style.color=r.tint;let a=j(`button`,{type:`button`,class:`ctl tsel${i?` x`:``}`,part:`thinking`,title:r.gloss,"aria-haspopup":`menu`,"aria-expanded":`false`},e,` `,j(`span`,{class:`tlabel`},r.label),` `,j(`span`,{class:`cx`},kn()));a.style.setProperty(`--tw`,r.tint);let o=j(`div`,{class:`menu tmenu`,part:`thinking-menu`,role:`menu`}),s=j(`div`,{class:`mlist`,role:`none`});for(let e of vn){let r=yn[e],i=j(`button`,{type:`button`,class:`mitem titem`,role:`menuitemradio`,"data-level":e,"aria-selected":e===t?`true`:`false`,title:r.gloss},j(`span`,{class:`mname`},r.label),j(`span`,{class:`tick`},n(`check`,{size:14})));i.addEventListener(`click`,()=>this.#k(e)),s.append(i)}o.append(s),u=j(`div`,{class:`twrap`},a,o)}let d=j(`slot`,{name:`hint`});we(d,[j(`span`,{class:`kbd`},`⏎`),` send `,j(`span`,{class:`sep`}),` `,j(`span`,{class:`kbd`},`⇧⏎`),` newline`]);let f=j(`div`,{class:`meta`,part:`meta`},c,u??!1,j(`div`,{class:`mspacer`}),j(`span`,{class:`hint`,part:`hint`},d));this.#e.replaceChildren(jn(),f),this.#a=c,this.#o=this.#e.querySelector(`.twrap`),this.#r=this.#e.querySelector(`.msel`),this.#i=this.#e.querySelector(`.tsel`),this.#_(),this.#C(),this.#O(),this.#v()}#_(){let e=this.#s;if(!e)return;let t=this.#d.trim().toLowerCase(),r=this.#m.filter(e=>!t||`${e.name} ${e.provider??``}`.toLowerCase().includes(t)),i=this.model,a=[];for(let e of r){let t=e.name===i,r=j(`button`,{type:`button`,class:`mitem`,role:`menuitemradio`,"data-id":e.id,"aria-selected":t?`true`:`false`},j(`span`,{class:`mname`},e.name),e.provider?j(`span`,{class:`mprov`},e.provider):!1,j(`span`,{class:`tick`},n(`check`,{size:14})));r.addEventListener(`click`,()=>this.#w(e.id)),a.push(r)}e.replaceChildren(...a.length?a:[j(`div`,{class:`mempty`},`No models match.`)])}#v(){this.#r&&(this.#t=e=>{if(e.stopPropagation(),this.#h){this.dispatchEvent(new CustomEvent(`add-ai`,{bubbles:!0,composed:!0}));return}this.#b()},this.#r.addEventListener(`click`,this.#t)),this.#i&&(this.#n=()=>this.#T(),this.#i.addEventListener(`click`,this.#n))}#y(){this.#r&&this.#t&&this.#r.removeEventListener(`click`,this.#t),this.#i&&this.#n&&this.#i.removeEventListener(`click`,this.#n),this.#t=null,this.#n=null,this.#r=null,this.#i=null,this.#a=null,this.#o=null,this.#s=null}get menuOpen(){return this.#l}openMenu(){this.#h||this.#x()}#b(){this.#l?this.#S():this.#x()}#x(){if(this.#l)return;this.#D(),this.#l=!0,this.#d=``,this.#_(),this.#C();let e=this.#e.querySelector(`.msearch`);e&&(e.value=``,requestAnimationFrame(()=>e.focus())),document.addEventListener(`mousedown`,this.#f),document.addEventListener(`keydown`,this.#p,!0)}#S(){this.#l&&(this.#l=!1,this.#C(),this.#u||(document.removeEventListener(`mousedown`,this.#f),document.removeEventListener(`keydown`,this.#p,!0)))}#C(){this.#a?.classList.toggle(`open`,this.#l),this.#r?.setAttribute(`aria-expanded`,this.#l?`true`:`false`)}#w(e){let t=this.#m.find(t=>t.id===e)??{name:e,id:e,provider:void 0};this.#S(),t.name!==this.model&&(this.model=t.name),this.dispatchEvent(new CustomEvent(`model-change`,{detail:{model:t.name,provider:t.provider,id:t.id},bubbles:!0,composed:!0}))}#T(){this.#u?this.#D():this.#E()}#E(){this.#u||(this.#S(),this.#u=!0,this.#O(),document.addEventListener(`mousedown`,this.#f),document.addEventListener(`keydown`,this.#p,!0))}#D(){this.#u&&(this.#u=!1,this.#O(),this.#l||(document.removeEventListener(`mousedown`,this.#f),document.removeEventListener(`keydown`,this.#p,!0)))}#O(){this.#o?.classList.toggle(`open`,this.#u),this.#i?.setAttribute(`aria-expanded`,this.#u?`true`:`false`)}#k(e){this.#D(),this.thinking=e,this.dispatchEvent(new CustomEvent(`thinking-change`,{detail:{thinking:e,label:yn[e].label,accented:e===bn},bubbles:!0,composed:!0}))}});async function Nn(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function Pn(e,t={}){let n=(e??``).trim().toLowerCase();if(n===``)return null;let r=await Nn(n),i=t.size??80,a=t.fallback??`mp`;return`https://www.gravatar.com/avatar/${r}?s=${i}&d=${encodeURIComponent(a)}`}var Fn=M(`
1943
+ `);A(`slicc-composer-meta`,class extends HTMLElement{static observedAttributes=[`model`,`thinking`,`narrow`,`no-thinking`];#e;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=null;#c=null;#l=!1;#u=!1;#d=``;#f=e=>{let t=e.composedPath();this.#l&&!t.includes(this)&&this.#S(),this.#u&&!t.includes(this)&&this.#D()};#p=e=>{e.key===`Escape`&&(this.#l&&(e.stopPropagation(),this.#S(),this.#r?.focus()),this.#u&&(e.stopPropagation(),this.#D(),this.#i?.focus()))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[jn]}connectedCallback(){this.#g()}disconnectedCallback(){this.#y(),document.removeEventListener(`mousedown`,this.#f),document.removeEventListener(`keydown`,this.#p,!0)}attributeChangedCallback(){this.isConnected&&this.#g()}get model(){return this.getAttribute(`model`)??bn}set model(e){e==null?this.removeAttribute(`model`):this.setAttribute(`model`,e)}get models(){return(this.#c??[...xn]).map(e=>typeof e==`string`?e:{...e})}set models(e){this.#c=Array.isArray(e)?e.slice():null,this.isConnected&&this.#g()}get#m(){return(this.#c??xn).map(Cn)}get#h(){return this.#c!==null&&this.#c.length===0}get thinking(){let e=this.getAttribute(`thinking`);return _n.includes(e??``)?e:wn}set thinking(e){this.setAttribute(`thinking`,e)}get narrow(){return this.hasAttribute(`narrow`)}set narrow(e){this.toggleAttribute(`narrow`,e)}get noThinking(){return this.hasAttribute(`no-thinking`)}set noThinking(e){this.toggleAttribute(`no-thinking`,e)}get accented(){return this.thinking===yn}#g(){this.#y();let e=this.model,t=this.thinking,r=vn[t],i=t===yn,a=this.#h,o=a?j(`button`,{type:`button`,class:`ctl msel`,part:`model`},En(),` `,`Add AI`):j(`button`,{type:`button`,class:`ctl msel`,part:`model`,"aria-haspopup":`menu`,"aria-expanded":`false`},En(),` `,e,` `,j(`span`,{class:`cx`},On())),s=j(`div`,{class:`menu`,part:`model-menu`,role:`menu`});if(this.#m.length>Sn){let e=j(`input`,{class:`msearch`,part:`model-search`,type:`text`,placeholder:`Search models…`,"aria-label":`Search models`});e.value=this.#d,e.addEventListener(`input`,()=>{this.#d=e.value,this.#_()}),e.addEventListener(`click`,e=>e.stopPropagation()),s.append(e)}this.#s=j(`div`,{class:`mlist`,role:`none`}),s.append(this.#s);let c=j(`div`,{class:`mwrap`},o,s),l=!this.noThinking&&!a,u=null;if(l){let e=Dn();e.style.color=r.tint;let a=j(`button`,{type:`button`,class:`ctl tsel${i?` x`:``}`,part:`thinking`,title:r.gloss,"aria-haspopup":`menu`,"aria-expanded":`false`},e,` `,j(`span`,{class:`tlabel`},r.label),` `,j(`span`,{class:`cx`},On()));a.style.setProperty(`--tw`,r.tint);let o=j(`div`,{class:`menu tmenu`,part:`thinking-menu`,role:`menu`}),s=j(`div`,{class:`mlist`,role:`none`});for(let e of _n){let r=vn[e],i=j(`button`,{type:`button`,class:`mitem titem`,role:`menuitemradio`,"data-level":e,"aria-selected":e===t?`true`:`false`,title:r.gloss},j(`span`,{class:`mname`},r.label),j(`span`,{class:`tick`},n(`check`,{size:14})));i.addEventListener(`click`,()=>this.#k(e)),s.append(i)}o.append(s),u=j(`div`,{class:`twrap`},a,o)}let d=j(`slot`,{name:`hint`});we(d,[j(`span`,{class:`kbd`},`⏎`),` send `,j(`span`,{class:`sep`}),` `,j(`span`,{class:`kbd`},`⇧⏎`),` newline`]);let f=j(`div`,{class:`meta`,part:`meta`},c,u??!1,j(`div`,{class:`mspacer`}),j(`span`,{class:`hint`,part:`hint`},d));this.#e.replaceChildren(An(),f),this.#a=c,this.#o=this.#e.querySelector(`.twrap`),this.#r=this.#e.querySelector(`.msel`),this.#i=this.#e.querySelector(`.tsel`),this.#_(),this.#C(),this.#O(),this.#v()}#_(){let e=this.#s;if(!e)return;let t=this.#d.trim().toLowerCase(),r=this.#m.filter(e=>!t||`${e.name} ${e.provider??``}`.toLowerCase().includes(t)),i=this.model,a=[];for(let e of r){let t=e.name===i,r=j(`button`,{type:`button`,class:`mitem`,role:`menuitemradio`,"data-id":e.id,"aria-selected":t?`true`:`false`},j(`span`,{class:`mname`},e.name),e.provider?j(`span`,{class:`mprov`},e.provider):!1,j(`span`,{class:`tick`},n(`check`,{size:14})));r.addEventListener(`click`,()=>this.#w(e.id)),a.push(r)}e.replaceChildren(...a.length?a:[j(`div`,{class:`mempty`},`No models match.`)])}#v(){this.#r&&(this.#t=e=>{if(e.stopPropagation(),this.#h){this.dispatchEvent(new CustomEvent(`add-ai`,{bubbles:!0,composed:!0}));return}this.#b()},this.#r.addEventListener(`click`,this.#t)),this.#i&&(this.#n=()=>this.#T(),this.#i.addEventListener(`click`,this.#n))}#y(){this.#r&&this.#t&&this.#r.removeEventListener(`click`,this.#t),this.#i&&this.#n&&this.#i.removeEventListener(`click`,this.#n),this.#t=null,this.#n=null,this.#r=null,this.#i=null,this.#a=null,this.#o=null,this.#s=null}get menuOpen(){return this.#l}openMenu(){this.#h||this.#x()}#b(){this.#l?this.#S():this.#x()}#x(){if(this.#l)return;this.#D(),this.#l=!0,this.#d=``,this.#_(),this.#C();let e=this.#e.querySelector(`.msearch`);e&&(e.value=``,requestAnimationFrame(()=>e.focus())),document.addEventListener(`mousedown`,this.#f),document.addEventListener(`keydown`,this.#p,!0)}#S(){this.#l&&(this.#l=!1,this.#C(),this.#u||(document.removeEventListener(`mousedown`,this.#f),document.removeEventListener(`keydown`,this.#p,!0)))}#C(){this.#a?.classList.toggle(`open`,this.#l),this.#r?.setAttribute(`aria-expanded`,this.#l?`true`:`false`)}#w(e){let t=this.#m.find(t=>t.id===e)??{name:e,id:e,provider:void 0};this.#S(),t.name!==this.model&&(this.model=t.name),this.dispatchEvent(new CustomEvent(`model-change`,{detail:{model:t.name,provider:t.provider,id:t.id},bubbles:!0,composed:!0}))}#T(){this.#u?this.#D():this.#E()}#E(){this.#u||(this.#S(),this.#u=!0,this.#O(),document.addEventListener(`mousedown`,this.#f),document.addEventListener(`keydown`,this.#p,!0))}#D(){this.#u&&(this.#u=!1,this.#O(),this.#l||(document.removeEventListener(`mousedown`,this.#f),document.removeEventListener(`keydown`,this.#p,!0)))}#O(){this.#o?.classList.toggle(`open`,this.#u),this.#i?.setAttribute(`aria-expanded`,this.#u?`true`:`false`)}#k(e){this.#D(),this.thinking=e,this.dispatchEvent(new CustomEvent(`thinking-change`,{detail:{thinking:e,label:vn[e].label,accented:e===yn},bubbles:!0,composed:!0}))}});async function Mn(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function Nn(e,t={}){let n=(e??``).trim().toLowerCase();if(n===``)return null;let r=await Mn(n),i=t.size??80,a=t.fallback??`mp`;return`https://www.gravatar.com/avatar/${r}?s=${i}&d=${encodeURIComponent(a)}`}var Pn=M(`
1944
1944
  :host { display: inline-flex; }
1945
1945
  :host([hidden]) { display: none; }
1946
1946
 
@@ -2143,7 +2143,7 @@ slicc-composer-capture .slicc-capture__timer[hidden] {
2143
2143
  }
2144
2144
  .glyph.is-press { transform: none; }
2145
2145
  }
2146
- `),In=18,Ln=72,Rn=`http://www.w3.org/2000/svg`,zn=15,Bn=.25;function Vn(e){let t=document.createElementNS(Rn,`svg`);t.setAttribute(`width`,`36`),t.setAttribute(`height`,`36`),t.setAttribute(`viewBox`,`0 0 36 36`),t.setAttribute(`fill`,`none`),t.setAttribute(`aria-hidden`,`true`);let n=2*Math.PI*zn,r=e=>{let t=document.createElementNS(Rn,`circle`);return t.setAttribute(`cx`,`18`),t.setAttribute(`cy`,`18`),t.setAttribute(`r`,String(zn)),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke-width`,`2.5`),t.setAttribute(`stroke-linecap`,`round`),t.setAttribute(`class`,e),t};t.appendChild(r(`ring-track`));let i=r(`ring-arc`),a=e==null?Bn:Math.max(0,Math.min(1,e));return i.setAttribute(`stroke-dasharray`,`${n*a} ${n}`),e!=null&&i.setAttribute(`transform`,`rotate(-90 18 18)`),t.appendChild(i),t}function Hn(e){return e===`tool`?`tool`:`thinking`}function Un(e){if(e==null||e.trim()===``)return null;let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}A(`slicc-send-button`,class extends HTMLElement{static observedAttributes=[`disabled`,`busy`,`phase`,`progress`,`email`,`src`,`label`];#e;#t=null;#n=0;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Fn]}connectedCallback(){this.#d()}attributeChangedCallback(){this.isConnected&&this.#d()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}get busy(){return this.hasAttribute(`busy`)}set busy(e){this.toggleAttribute(`busy`,!!e)}get phase(){return Hn(this.getAttribute(`phase`))}set phase(e){this.setAttribute(`phase`,Hn(e))}get progress(){return Un(this.getAttribute(`progress`))}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,String(e))}get email(){return this.getAttribute(`email`)}set email(e){e==null?this.removeAttribute(`email`):this.setAttribute(`email`,e)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#r=()=>{if(!this.disabled){if(this.busy){this.dispatchEvent(new CustomEvent(`stop`,{bubbles:!0,composed:!0}));return}this.#l(),this.dispatchEvent(new CustomEvent(`send`,{bubbles:!0,composed:!0}))}};#i(){return this.#e.querySelector(`.glyph`)}#a=()=>{this.disabled||this.busy||this.#i()?.classList.add(`is-hover`)};#o=()=>{this.#i()?.classList.remove(`is-hover`,`is-press`)};#s=()=>{if(this.disabled||this.busy)return;let e=this.#i();e?.classList.add(`is-press`),e?.classList.remove(`is-hover`)};#c=()=>{this.#i()?.classList.remove(`is-press`)};#l(){let e=this.#e.querySelector(`.glyph`);e&&(e.classList.remove(`is-whoosh`),e.offsetWidth,e.classList.add(`is-whoosh`),e.addEventListener(`animationend`,()=>e.classList.remove(`is-whoosh`),{once:!0}))}#u(){let e=++this.#n;if(!this.#t)return;let t=t=>{if(e!==this.#n)return;let n=this.#t;if(n)if(n.querySelector(`.face`)?.remove(),t){let e=document.createElement(`img`);e.className=`face`,e.setAttribute(`part`,`face`),e.alt=``,e.src=t,n.prepend(e),n.classList.add(`has-face`)}else n.classList.remove(`has-face`)},n=this.src;if(n){t(n);return}let r=this.email;if(!r||r.trim()===``){t(null);return}t(null),Pn(r,{size:Ln}).then(t).catch(()=>t(null))}#d(){let e=this.busy,t=this.disabled,r=e&&this.phase===`tool`,i=this.label??(e?`Stop`:`Send`),a;if(r){let e=this.progress,t=e==null;a=j(`slot`,{name:`busy`},j(`span`,{class:`stop`,part:`stop`},n(`square`,{size:In})),j(`span`,{class:`spinner${t?` is-indeterminate`:``}`,part:`spinner`},Vn(e)))}else a=e?j(`slot`,{name:`busy`},j(`span`,{class:`stop`,part:`stop`},n(`square`,{size:In}),j(`span`,{class:`stop-fill`},n(`square`,{size:In})))):j(`slot`,null,j(`span`,{class:`glyph`,part:`glyph`},n(`arrow-up`,{size:In})));let o=j(`button`,{part:`button`,class:`send${e?` is-busy`:``}${r?` is-tool`:``}`,type:`button`,title:i,"aria-label":i,disabled:t||void 0},a);this.#e.replaceChildren(o),this.#t=o,this.#t.addEventListener(`click`,this.#r),this.#t.addEventListener(`pointerenter`,this.#a),this.#t.addEventListener(`pointerleave`,this.#o),this.#t.addEventListener(`pointerdown`,this.#s),this.#t.addEventListener(`pointerup`,this.#c),this.#u()}});var Wn=`
2146
+ `),Fn=18,In=72,Ln=`http://www.w3.org/2000/svg`,Rn=15,zn=.25;function Bn(e){let t=document.createElementNS(Ln,`svg`);t.setAttribute(`width`,`36`),t.setAttribute(`height`,`36`),t.setAttribute(`viewBox`,`0 0 36 36`),t.setAttribute(`fill`,`none`),t.setAttribute(`aria-hidden`,`true`);let n=2*Math.PI*Rn,r=e=>{let t=document.createElementNS(Ln,`circle`);return t.setAttribute(`cx`,`18`),t.setAttribute(`cy`,`18`),t.setAttribute(`r`,String(Rn)),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke-width`,`2.5`),t.setAttribute(`stroke-linecap`,`round`),t.setAttribute(`class`,e),t};t.appendChild(r(`ring-track`));let i=r(`ring-arc`),a=e==null?zn:Math.max(0,Math.min(1,e));return i.setAttribute(`stroke-dasharray`,`${n*a} ${n}`),e!=null&&i.setAttribute(`transform`,`rotate(-90 18 18)`),t.appendChild(i),t}function Vn(e){return e===`tool`?`tool`:`thinking`}function Hn(e){if(e==null||e.trim()===``)return null;let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}A(`slicc-send-button`,class extends HTMLElement{static observedAttributes=[`disabled`,`busy`,`phase`,`progress`,`email`,`src`,`label`];#e;#t=null;#n=0;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Pn]}connectedCallback(){this.#d()}attributeChangedCallback(){this.isConnected&&this.#d()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}get busy(){return this.hasAttribute(`busy`)}set busy(e){this.toggleAttribute(`busy`,!!e)}get phase(){return Vn(this.getAttribute(`phase`))}set phase(e){this.setAttribute(`phase`,Vn(e))}get progress(){return Hn(this.getAttribute(`progress`))}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,String(e))}get email(){return this.getAttribute(`email`)}set email(e){e==null?this.removeAttribute(`email`):this.setAttribute(`email`,e)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#r=()=>{if(!this.disabled){if(this.busy){this.dispatchEvent(new CustomEvent(`stop`,{bubbles:!0,composed:!0}));return}this.#l(),this.dispatchEvent(new CustomEvent(`send`,{bubbles:!0,composed:!0}))}};#i(){return this.#e.querySelector(`.glyph`)}#a=()=>{this.disabled||this.busy||this.#i()?.classList.add(`is-hover`)};#o=()=>{this.#i()?.classList.remove(`is-hover`,`is-press`)};#s=()=>{if(this.disabled||this.busy)return;let e=this.#i();e?.classList.add(`is-press`),e?.classList.remove(`is-hover`)};#c=()=>{this.#i()?.classList.remove(`is-press`)};#l(){let e=this.#e.querySelector(`.glyph`);e&&(e.classList.remove(`is-whoosh`),e.offsetWidth,e.classList.add(`is-whoosh`),e.addEventListener(`animationend`,()=>e.classList.remove(`is-whoosh`),{once:!0}))}#u(){let e=++this.#n;if(!this.#t)return;let t=t=>{if(e!==this.#n)return;let n=this.#t;if(n)if(n.querySelector(`.face`)?.remove(),t){let e=document.createElement(`img`);e.className=`face`,e.setAttribute(`part`,`face`),e.alt=``,e.src=t,n.prepend(e),n.classList.add(`has-face`)}else n.classList.remove(`has-face`)},n=this.src;if(n){t(n);return}let r=this.email;if(!r||r.trim()===``){t(null);return}t(null),Nn(r,{size:In}).then(t).catch(()=>t(null))}#d(){let e=this.busy,t=this.disabled,r=e&&this.phase===`tool`,i=this.label??(e?`Stop`:`Send`),a;if(r){let e=this.progress,t=e==null;a=j(`slot`,{name:`busy`},j(`span`,{class:`stop`,part:`stop`},n(`square`,{size:Fn})),j(`span`,{class:`spinner${t?` is-indeterminate`:``}`,part:`spinner`},Bn(e)))}else a=e?j(`slot`,{name:`busy`},j(`span`,{class:`stop`,part:`stop`},n(`square`,{size:Fn}),j(`span`,{class:`stop-fill`},n(`square`,{size:Fn})))):j(`slot`,null,j(`span`,{class:`glyph`,part:`glyph`},n(`arrow-up`,{size:Fn})));let o=j(`button`,{part:`button`,class:`send${e?` is-busy`:``}${r?` is-tool`:``}`,type:`button`,title:i,"aria-label":i,disabled:t||void 0},a);this.#e.replaceChildren(o),this.#t=o,this.#t.addEventListener(`click`,this.#r),this.#t.addEventListener(`pointerenter`,this.#a),this.#t.addEventListener(`pointerleave`,this.#o),this.#t.addEventListener(`pointerdown`,this.#s),this.#t.addEventListener(`pointerup`,this.#c),this.#u()}});var Un=`
2147
2147
  slicc-input-card {
2148
2148
  display: block;
2149
2149
  }
@@ -2197,7 +2197,7 @@ slicc-input-card .toolbar slicc-add-menu {
2197
2197
  flex: 1;
2198
2198
  min-width: 0;
2199
2199
  }
2200
- `,Gn=`slicc-input-card-style`;function Kn(e){if(e.getElementById(Gn))return;let t=e.createElement(`style`);t.id=Gn,t.textContent=Wn,(e.head??e.documentElement).appendChild(t)}var qn=`Ask sliccy, or describe a change…`;A(`slicc-input-card`,class extends HTMLElement{static observedAttributes=[`value`,`placeholder`,`suggestion`,`disabled`];#e;#t;#n;#r=!1;connectedCallback(){Kn(this.ownerDocument),this.#i(),this.#a(),this.#u()}attributeChangedCallback(e,t,n){!this.#r||t===n||(this.#a(),e===`value`&&this.#u())}get value(){return this.#r?this.#t.value:this.getAttribute(`value`)??``}set value(e){let t=e??``;this.#r&&(this.#t.value=t,this.#u()),t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t)}get placeholder(){return this.getAttribute(`placeholder`)??qn}set placeholder(e){e==null?this.removeAttribute(`placeholder`):this.setAttribute(`placeholder`,e)}get suggestion(){return this.getAttribute(`suggestion`)}set suggestion(e){e==null||e===``?this.removeAttribute(`suggestion`):this.setAttribute(`suggestion`,e)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}focus(e){this.#i(),this.#t.focus(e)}clear(){this.value=``}#i(){if(this.#r)return;this.#r=!0;let e=this.ownerDocument,t=Array.from(this.children).filter(e=>e.getAttribute(`slot`)===`toolbar`);if(this.replaceChildren(),this.#e=e.createElement(`div`),this.#e.className=`slicc-input-card__card`,this.#e.setAttribute(`part`,`card`),this.#t=e.createElement(`textarea`),this.#t.className=`ta`,this.#t.setAttribute(`part`,`textarea`),this.#t.rows=1,this.#n=e.createElement(`div`),this.#n.className=`toolbar`,this.#n.setAttribute(`part`,`toolbar`),t.length>0)for(let e of t)this.#n.appendChild(e);else this.#n.append(j(`slicc-add-menu`),j(`slicc-send-button`));this.#e.append(this.#t,this.#n),this.appendChild(this.#e),this.#t.addEventListener(`input`,this.#o),this.#t.addEventListener(`keydown`,this.#s),this.#n.addEventListener(`send`,this.#c)}#a(){if(!this.#r)return;let e=this.#t;e.placeholder=this.suggestion??this.placeholder,e.disabled=this.disabled;let t=this.getAttribute(`value`)??``;e.value!==t&&(e.value=t)}#o=e=>{e.stopPropagation();let t=this.#t.value;t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t),this.#u(),this.dispatchEvent(new CustomEvent(`input`,{bubbles:!0,composed:!0,detail:{value:t}}))};#s=e=>{if(e.isComposing)return;if(e.key===`Enter`&&!e.shiftKey&&!e.altKey){e.preventDefault(),this.#l(void 0,e.ctrlKey||e.metaKey);return}if(e.key===`Tab`&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey){let t=this.suggestion;if(t&&this.#t.value===``){e.preventDefault(),this.removeAttribute(`suggestion`);let n=this.#t;n.value=t,n.setSelectionRange(t.length,t.length),n.dispatchEvent(new Event(`input`,{bubbles:!0}))}return}let t=this.#t,n=t.selectionStart===t.selectionEnd;e.key===`ArrowUp`&&n&&t.selectionStart===0?(e.preventDefault(),this.dispatchEvent(new CustomEvent(`history-up`,{bubbles:!0,composed:!0}))):e.key===`ArrowDown`&&n&&t.selectionStart===t.value.length&&this.dispatchEvent(new CustomEvent(`history-down`,{bubbles:!0,composed:!0}))};#c=e=>{e.stopPropagation(),this.#l()};submit(e){this.#i(),this.#l(e)}focusEnd(){if(!this.#r)return;let e=this.#t;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}#l(e,t){if(this.disabled)return;let n=this.#t.value;n.trim()!==``&&(this.removeAttribute(`suggestion`),this.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:n,...e?{source:e}:{},...t?{steer:!0}:{}}})))}#u(){if(!this.#r)return;let e=this.#t;e.style.height=`auto`;let t=e.scrollHeight;e.style.height=`${Math.min(t,140)}px`,e.style.overflowY=t>140?`auto`:`hidden`}});var Jn=M(`
2200
+ `,Wn=`slicc-input-card-style`;function Gn(e){if(e.getElementById(Wn))return;let t=e.createElement(`style`);t.id=Wn,t.textContent=Un,(e.head??e.documentElement).appendChild(t)}var Kn=`Ask sliccy, or describe a change…`;A(`slicc-input-card`,class extends HTMLElement{static observedAttributes=[`value`,`placeholder`,`suggestion`,`disabled`];#e;#t;#n;#r=!1;connectedCallback(){Gn(this.ownerDocument),this.#i(),this.#a(),this.#u()}attributeChangedCallback(e,t,n){!this.#r||t===n||(this.#a(),e===`value`&&this.#u())}get value(){return this.#r?this.#t.value:this.getAttribute(`value`)??``}set value(e){let t=e??``;this.#r&&(this.#t.value=t,this.#u()),t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t)}get placeholder(){return this.getAttribute(`placeholder`)??Kn}set placeholder(e){e==null?this.removeAttribute(`placeholder`):this.setAttribute(`placeholder`,e)}get suggestion(){return this.getAttribute(`suggestion`)}set suggestion(e){e==null||e===``?this.removeAttribute(`suggestion`):this.setAttribute(`suggestion`,e)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}focus(e){this.#i(),this.#t.focus(e)}clear(){this.value=``}#i(){if(this.#r)return;this.#r=!0;let e=this.ownerDocument,t=Array.from(this.children).filter(e=>e.getAttribute(`slot`)===`toolbar`);if(this.replaceChildren(),this.#e=e.createElement(`div`),this.#e.className=`slicc-input-card__card`,this.#e.setAttribute(`part`,`card`),this.#t=e.createElement(`textarea`),this.#t.className=`ta`,this.#t.setAttribute(`part`,`textarea`),this.#t.rows=1,this.#n=e.createElement(`div`),this.#n.className=`toolbar`,this.#n.setAttribute(`part`,`toolbar`),t.length>0)for(let e of t)this.#n.appendChild(e);else this.#n.append(j(`slicc-add-menu`),j(`slicc-send-button`));this.#e.append(this.#t,this.#n),this.appendChild(this.#e),this.#t.addEventListener(`input`,this.#o),this.#t.addEventListener(`keydown`,this.#s),this.#n.addEventListener(`send`,this.#c)}#a(){if(!this.#r)return;let e=this.#t;e.placeholder=this.suggestion??this.placeholder,e.disabled=this.disabled;let t=this.getAttribute(`value`)??``;e.value!==t&&(e.value=t)}#o=e=>{e.stopPropagation();let t=this.#t.value;t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t),this.#u(),this.dispatchEvent(new CustomEvent(`input`,{bubbles:!0,composed:!0,detail:{value:t}}))};#s=e=>{if(e.isComposing)return;if(e.key===`Enter`&&!e.shiftKey&&!e.altKey){e.preventDefault(),this.#l(void 0,e.ctrlKey||e.metaKey);return}if(e.key===`Tab`&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey){let t=this.suggestion;if(t&&this.#t.value===``){e.preventDefault(),this.removeAttribute(`suggestion`);let n=this.#t;n.value=t,n.setSelectionRange(t.length,t.length),n.dispatchEvent(new Event(`input`,{bubbles:!0}))}return}let t=this.#t,n=t.selectionStart===t.selectionEnd;e.key===`ArrowUp`&&n&&t.selectionStart===0?(e.preventDefault(),this.dispatchEvent(new CustomEvent(`history-up`,{bubbles:!0,composed:!0}))):e.key===`ArrowDown`&&n&&t.selectionStart===t.value.length&&this.dispatchEvent(new CustomEvent(`history-down`,{bubbles:!0,composed:!0}))};#c=e=>{e.stopPropagation(),this.#l()};submit(e){this.#i(),this.#l(e)}focusEnd(){if(!this.#r)return;let e=this.#t;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}#l(e,t){if(this.disabled)return;let n=this.#t.value;n.trim()!==``&&(this.removeAttribute(`suggestion`),this.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:n,...e?{source:e}:{},...t?{steer:!0}:{}}})))}#u(){if(!this.#r)return;let e=this.#t;e.style.height=`auto`;let t=e.scrollHeight;e.style.height=`${Math.min(t,140)}px`,e.style.overflowY=t>140?`auto`:`hidden`}});var qn=M(`
2201
2201
  :host{display:block;font-family:var(--ui);}
2202
2202
  :host(:not([count])),:host([count="0"]),:host([count="-0"]){display:none;}
2203
2203
  .wrap{display:flex;flex-direction:column;align-items:stretch;gap:6px;}
@@ -2218,7 +2218,7 @@ slicc-input-card .toolbar slicc-add-menu {
2218
2218
  :host-context(body.dark) .dismiss:hover,:host-context(body.dark) .dismiss:focus-visible,
2219
2219
  :host-context(.dark) .dismiss:hover,:host-context(.dark) .dismiss:focus-visible,
2220
2220
  :host-context([data-theme="dark"]) .dismiss:hover,:host-context([data-theme="dark"]) .dismiss:focus-visible{background:color-mix(in srgb,#0a0a0a 14%,transparent);}
2221
- `),Yn=[{rot:0,x:0,y:0},{rot:-2,x:-3,y:-2},{rot:2,x:3,y:-4},{rot:-3,x:-5,y:-6},{rot:3,x:5,y:-8},{rot:-1,x:-2,y:-10},{rot:1,x:2,y:-12}];function Xn(e){return Yn[Math.min(e,Yn.length-1)]??Yn[0]}A(`slicc-queued-stack`,class extends HTMLElement{#e;#t=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Jn]}connectedCallback(){this.#i()}get count(){return this.#t.length}setMessages(e){this.#t=e.slice(),this.setAttribute(`count`,String(this.#t.length)),this.#i()}#n(e){this.dispatchEvent(new CustomEvent(`slicc-queued-remove`,{detail:{id:e},bubbles:!0,composed:!0}))}#r(e,t,r,i){let{rot:a,x:o,y:s}=Xn(t),c=r?`none`:`translate(${o}px, ${s}px) rotate(${a}deg)`,l=`card${r?` is-front`:``}${t===0?``:t===1?` is-back`:` is-deep`}`,u=r?`card front`:`card`,d=`transform:${c};z-index:${i};`,f=[j(`span`,{class:`bubble`},e.text)];if(e.attachments&&e.attachments>0&&f.push(j(`span`,{class:`attach`},`+${e.attachments}`)),r){let t=j(`button`,{type:`button`,class:`dismiss`,part:`dismiss`,"aria-label":`Remove queued message`},n(`x`,{size:14}));t.addEventListener(`click`,t=>{t.stopPropagation(),this.#n(e.id)}),f.push(t)}return j(`div`,{class:l,part:u,style:d},...f)}#i(){if(this.#t.length===0){this.#e.replaceChildren();return}let e=this.#t.length,t=[];for(let n=e-1;n>=0;n--){let r=e-1-n,i=r===0,a=n+1,o=this.#t[n];o&&t.push(this.#r(o,r,i,a))}let r=j(`div`,{class:`stack`,part:`stack`},...t),i=j(`div`,{class:`wrap`},j(`span`,{class:`badge`,part:`badge`},n(`clock`,{size:11}),`${e} queued`),r);this.#e.replaceChildren(i)}});var Zn=1e3;function Qn(e,t){let n=t.longPressMs??1e3,r=t.modifierClickAsLongPress??!0,i=null,a=!1,o=()=>{t.onPressEnd?.()},s=()=>{i!==null&&(clearTimeout(i),i=null),o()},c=e=>{e.button===0&&(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(a=!1,s(),t.onPressStart?.(e),i=setTimeout(()=>{a=!0,o(),i=null,t.onLongPress()},n)))},l=()=>s(),u=()=>s(),d=()=>s(),f=()=>s(),p=e=>{if(a){a=!1,e.preventDefault();return}if((e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)&&r){e.preventDefault(),t.onLongPress();return}t.onShortClick(e)};return e.addEventListener(`mousedown`,c),e.addEventListener(`mouseup`,l),e.addEventListener(`mouseleave`,u),e.addEventListener(`blur`,d),e.addEventListener(`contextmenu`,f),e.addEventListener(`click`,p),{destroy:()=>{s(),e.removeEventListener(`mousedown`,c),e.removeEventListener(`mouseup`,l),e.removeEventListener(`mouseleave`,u),e.removeEventListener(`blur`,d),e.removeEventListener(`contextmenu`,f),e.removeEventListener(`click`,p)}}}var $n=M(`
2221
+ `),Jn=[{rot:0,x:0,y:0},{rot:-2,x:-3,y:-2},{rot:2,x:3,y:-4},{rot:-3,x:-5,y:-6},{rot:3,x:5,y:-8},{rot:-1,x:-2,y:-10},{rot:1,x:2,y:-12}];function Yn(e){return Jn[Math.min(e,Jn.length-1)]??Jn[0]}A(`slicc-queued-stack`,class extends HTMLElement{#e;#t=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[qn]}connectedCallback(){this.#i()}get count(){return this.#t.length}setMessages(e){this.#t=e.slice(),this.setAttribute(`count`,String(this.#t.length)),this.#i()}#n(e){this.dispatchEvent(new CustomEvent(`slicc-queued-remove`,{detail:{id:e},bubbles:!0,composed:!0}))}#r(e,t,r,i){let{rot:a,x:o,y:s}=Yn(t),c=r?`none`:`translate(${o}px, ${s}px) rotate(${a}deg)`,l=`card${r?` is-front`:``}${t===0?``:t===1?` is-back`:` is-deep`}`,u=r?`card front`:`card`,d=`transform:${c};z-index:${i};`,f=[j(`span`,{class:`bubble`},e.text)];if(e.attachments&&e.attachments>0&&f.push(j(`span`,{class:`attach`},`+${e.attachments}`)),r){let t=j(`button`,{type:`button`,class:`dismiss`,part:`dismiss`,"aria-label":`Remove queued message`},n(`x`,{size:14}));t.addEventListener(`click`,t=>{t.stopPropagation(),this.#n(e.id)}),f.push(t)}return j(`div`,{class:l,part:u,style:d},...f)}#i(){if(this.#t.length===0){this.#e.replaceChildren();return}let e=this.#t.length,t=[];for(let n=e-1;n>=0;n--){let r=e-1-n,i=r===0,a=n+1,o=this.#t[n];o&&t.push(this.#r(o,r,i,a))}let r=j(`div`,{class:`stack`,part:`stack`},...t),i=j(`div`,{class:`wrap`},j(`span`,{class:`badge`,part:`badge`},n(`clock`,{size:11}),`${e} queued`),r);this.#e.replaceChildren(i)}});var Xn=1e3;function Zn(e,t){let n=t.longPressMs??1e3,r=t.modifierClickAsLongPress??!0,i=null,a=!1,o=()=>{t.onPressEnd?.()},s=()=>{i!==null&&(clearTimeout(i),i=null),o()},c=e=>{e.button===0&&(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(a=!1,s(),t.onPressStart?.(e),i=setTimeout(()=>{a=!0,o(),i=null,t.onLongPress()},n)))},l=()=>s(),u=()=>s(),d=()=>s(),f=()=>s(),p=e=>{if(a){a=!1,e.preventDefault();return}if((e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)&&r){e.preventDefault(),t.onLongPress();return}t.onShortClick(e)};return e.addEventListener(`mousedown`,c),e.addEventListener(`mouseup`,l),e.addEventListener(`mouseleave`,u),e.addEventListener(`blur`,d),e.addEventListener(`contextmenu`,f),e.addEventListener(`click`,p),{destroy:()=>{s(),e.removeEventListener(`mousedown`,c),e.removeEventListener(`mouseup`,l),e.removeEventListener(`mouseleave`,u),e.removeEventListener(`blur`,d),e.removeEventListener(`contextmenu`,f),e.removeEventListener(`click`,p)}}}var Qn=M(`
2222
2222
  :host { display: inline-grid; }
2223
2223
  :host([hidden]) { display: none; }
2224
2224
 
@@ -2300,7 +2300,7 @@ slicc-input-card .toolbar slicc-add-menu {
2300
2300
 
2301
2301
  .glyph { display: grid; place-items: center; line-height: 1; }
2302
2302
  .glyph svg { display: block; }
2303
- `),er=`square`,tr=18;A(`slicc-dock-item`,class extends HTMLElement{static observedAttributes=[`item-id`,`kind`,`hue`,`icon`,`tip`,`active`,`lit`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[$n]}disconnectedCallback(){this.#t?.destroy(),this.#t=null}connectedCallback(){this.#n()}attributeChangedCallback(){this.isConnected&&this.#n()}get itemId(){return this.getAttribute(`item-id`)}set itemId(e){e==null?this.removeAttribute(`item-id`):this.setAttribute(`item-id`,e)}get kind(){return this.getAttribute(`kind`)===`sprinkle`?`sprinkle`:`tool`}set kind(e){this.setAttribute(`kind`,e===`sprinkle`?`sprinkle`:`tool`)}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get icon(){return this.getAttribute(`icon`)??er}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get tip(){return this.getAttribute(`tip`)}set tip(e){e==null?this.removeAttribute(`tip`):this.setAttribute(`tip`,e)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,!!e)}get lit(){return this.hasAttribute(`lit`)}set lit(e){this.toggleAttribute(`lit`,!!e)}#n(){let e=[`di`];this.kind===`sprinkle`&&e.push(`sp`),this.active&&e.push(`on`),this.lit&&e.push(`lit`);let t=this.tip,r=n(this.icon,{size:tr,part:`icon`}),i=t??this.itemId??`dock item`,a=j(`button`,{type:`button`,part:`button`,class:e.join(` `),"aria-label":i,"aria-pressed":this.active?`true`:`false`},j(`span`,{class:`glyph`,part:`glyph`},j(`slot`,null,r)),t?j(`span`,{class:`tip`,part:`tip`},t):null),o=this.hue;o&&a.style.setProperty(`--h`,o),this.#t?.destroy(),this.#t=Qn(a,{onShortClick:this.#r,onLongPress:()=>this.#i(`longpress`)}),this.#e.replaceChildren(a)}#r=()=>{this.#i(this.active?`collapse`:`select`)};#i(e){this.dispatchEvent(new CustomEvent(e,{detail:{id:this.itemId},bubbles:!0,composed:!0}))}});var nr=[{id:`browser`,icon:`globe`,label:`Browser · CDP`,kind:`tool`},{id:`files`,icon:`folder`,label:`Files · VFS`,kind:`tool`},{id:`term`,icon:`square-terminal`,label:`Terminal`,kind:`tool`},{id:`memory`,icon:`brain`,label:`Memory`,kind:`tool`},{id:`monitor`,icon:`activity`,label:`Monitor`,kind:`tool`}],rr={id:`new`,icon:`plus`,label:`New sprinkle`,kind:`sprinkle`},ir=`
2303
+ `),$n=`square`,er=18;A(`slicc-dock-item`,class extends HTMLElement{static observedAttributes=[`item-id`,`kind`,`hue`,`icon`,`tip`,`active`,`lit`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Qn]}disconnectedCallback(){this.#t?.destroy(),this.#t=null}connectedCallback(){this.#n()}attributeChangedCallback(){this.isConnected&&this.#n()}get itemId(){return this.getAttribute(`item-id`)}set itemId(e){e==null?this.removeAttribute(`item-id`):this.setAttribute(`item-id`,e)}get kind(){return this.getAttribute(`kind`)===`sprinkle`?`sprinkle`:`tool`}set kind(e){this.setAttribute(`kind`,e===`sprinkle`?`sprinkle`:`tool`)}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get icon(){return this.getAttribute(`icon`)??$n}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get tip(){return this.getAttribute(`tip`)}set tip(e){e==null?this.removeAttribute(`tip`):this.setAttribute(`tip`,e)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,!!e)}get lit(){return this.hasAttribute(`lit`)}set lit(e){this.toggleAttribute(`lit`,!!e)}#n(){let e=[`di`];this.kind===`sprinkle`&&e.push(`sp`),this.active&&e.push(`on`),this.lit&&e.push(`lit`);let t=this.tip,r=n(this.icon,{size:er,part:`icon`}),i=t??this.itemId??`dock item`,a=j(`button`,{type:`button`,part:`button`,class:e.join(` `),"aria-label":i,"aria-pressed":this.active?`true`:`false`},j(`span`,{class:`glyph`,part:`glyph`},j(`slot`,null,r)),t?j(`span`,{class:`tip`,part:`tip`},t):null),o=this.hue;o&&a.style.setProperty(`--h`,o),this.#t?.destroy(),this.#t=Zn(a,{onShortClick:this.#r,onLongPress:()=>this.#i(`longpress`)}),this.#e.replaceChildren(a)}#r=()=>{this.#i(this.active?`collapse`:`select`)};#i(e){this.dispatchEvent(new CustomEvent(e,{detail:{id:this.itemId},bubbles:!0,composed:!0}))}});var tr=[{id:`browser`,icon:`globe`,label:`Browser · CDP`,kind:`tool`},{id:`files`,icon:`folder`,label:`Files · VFS`,kind:`tool`},{id:`term`,icon:`square-terminal`,label:`Terminal`,kind:`tool`},{id:`memory`,icon:`brain`,label:`Memory`,kind:`tool`},{id:`monitor`,icon:`activity`,label:`Monitor`,kind:`tool`}],nr={id:`new`,icon:`plus`,label:`New sprinkle`,kind:`sprinkle`},rr=`
2304
2304
  .slicc-dock {
2305
2305
  flex: 0 0 48px;
2306
2306
  box-sizing: border-box;
@@ -2321,7 +2321,7 @@ slicc-input-card .toolbar slicc-add-menu {
2321
2321
  margin: 2px 0;
2322
2322
  }
2323
2323
  .slicc-dock .grow { flex: 1; }
2324
- `,ar=`slicc-dock-style`;function or(e){if(e.getElementById(ar))return;let t=e.createElement(`style`);t.id=ar,t.textContent=ir,(e.head??e.documentElement).appendChild(t)}function sr(e){return e===`sprinkle`?`sprinkle`:`tool`}A(`slicc-dock`,class extends HTMLElement{static get observedAttributes(){return[`active`,`system-tools`]}#e=[];#t=null;#n=null;#r=null;#i=!1;connectedCallback(){or(this.ownerDocument),this.classList.add(`slicc-dock`),this.setAttribute(`part`,`rail`),this.setAttribute(`role`,`toolbar`),this.setAttribute(`aria-orientation`,`vertical`),this.#i||=(this.#a(),!0),this.#t||(this.#t=e=>this.#u(e),this.#n=e=>this.#d(e),this.#r=e=>this.#f(e),this.addEventListener(`select`,this.#t),this.addEventListener(`collapse`,this.#n),this.addEventListener(`longpress`,this.#r)),this.#c()}disconnectedCallback(){this.#t&&=(this.removeEventListener(`select`,this.#t),null),this.#n&&=(this.removeEventListener(`collapse`,this.#n),null),this.#r&&=(this.removeEventListener(`longpress`,this.#r),null)}attributeChangedCallback(e){this.#i&&(e===`active`?this.#l():e===`system-tools`&&this.#c())}get items(){return this.#e.map(e=>({...e}))}set items(e){this.#e=Array.isArray(e)?e.map(e=>({...e})):[],this.#i&&this.isConnected&&this.#c()}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}get systemTools(){return this.hasAttribute(`system-tools`)}set systemTools(e){this.toggleAttribute(`system-tools`,!!e)}selectItem(e){this.active=e,this.dispatchEvent(new CustomEvent(`slicc-dock-select`,{detail:{id:e,kind:this.#o(e)},bubbles:!0,composed:!0}))}clearActive(){this.active=null}collapse(){let e=this.active;this.active=null,e!=null&&this.dispatchEvent(new CustomEvent(`slicc-dock-collapse`,{detail:{id:e},bubbles:!0,composed:!0}))}#a(){let e=[...this.querySelectorAll(`slicc-dock-item`)];if(e.length===0)return;let t=[];for(let n of e){let e=sr(n.getAttribute(`kind`)),r=n.getAttribute(`item-id`)??n.dataset.t??n.getAttribute(`tip`)??``;e!==`tool`&&r!==`new`&&r!==``&&t.push({id:r,icon:n.getAttribute(`icon`)??void 0,label:n.getAttribute(`tip`)??void 0,kind:`sprinkle`,hue:n.getAttribute(`hue`)??void 0})}for(let t of e)t.remove();this.#e.length===0&&(this.#e=t)}#o(e){return nr.some(t=>t.id===e)?`tool`:e===rr.id?`sprinkle`:this.#e.find(t=>t.id===e)?.kind??`tool`}#s(e,t){let n=e.id,r=sr(e.kind),i=e.icon??``,a=e.label??n,o=t!=null&&t===n,s=e.hue;return j(`slicc-dock-item`,{"data-t":n,"item-id":n,kind:r,icon:i||!1,tip:a,hue:s||!1,active:o})}#c(){let e=this.active,t=[];for(let n of this.#e)sr(n.kind)===`sprinkle`&&t.push(this.#s(n,e));if(t.push(this.#s(rr,e)),t.push(j(`div`,{class:`grow`})),this.systemTools){t.push(j(`div`,{class:`div`}));for(let n of nr)t.push(this.#s(n,e))}this.replaceChildren(),we(this,t)}#l(){let e=this.active;for(let t of this.querySelectorAll(`slicc-dock-item`))t.toggleAttribute(`active`,t.dataset.t===e)}#u(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.selectItem(t))}#d(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.active!==t&&(this.active=t),this.collapse())}#f(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.active!==t&&this.selectItem(t),this.dispatchEvent(new CustomEvent(`slicc-dock-longpress`,{detail:{id:t,kind:this.#o(t)},bubbles:!0,composed:!0})))}#p(e){let t=e.detail;if(t&&typeof t.id==`string`)return t.id;let n=e.target?.closest(`slicc-dock-item`);return n&&this.contains(n)?n.dataset.t??null:null}});var cr=M(`
2324
+ `,ir=`slicc-dock-style`;function ar(e){if(e.getElementById(ir))return;let t=e.createElement(`style`);t.id=ir,t.textContent=rr,(e.head??e.documentElement).appendChild(t)}function or(e){return e===`sprinkle`?`sprinkle`:`tool`}A(`slicc-dock`,class extends HTMLElement{static get observedAttributes(){return[`active`,`system-tools`]}#e=[];#t=null;#n=null;#r=null;#i=!1;connectedCallback(){ar(this.ownerDocument),this.classList.add(`slicc-dock`),this.setAttribute(`part`,`rail`),this.setAttribute(`role`,`toolbar`),this.setAttribute(`aria-orientation`,`vertical`),this.#i||=(this.#a(),!0),this.#t||(this.#t=e=>this.#u(e),this.#n=e=>this.#d(e),this.#r=e=>this.#f(e),this.addEventListener(`select`,this.#t),this.addEventListener(`collapse`,this.#n),this.addEventListener(`longpress`,this.#r)),this.#c()}disconnectedCallback(){this.#t&&=(this.removeEventListener(`select`,this.#t),null),this.#n&&=(this.removeEventListener(`collapse`,this.#n),null),this.#r&&=(this.removeEventListener(`longpress`,this.#r),null)}attributeChangedCallback(e){this.#i&&(e===`active`?this.#l():e===`system-tools`&&this.#c())}get items(){return this.#e.map(e=>({...e}))}set items(e){this.#e=Array.isArray(e)?e.map(e=>({...e})):[],this.#i&&this.isConnected&&this.#c()}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}get systemTools(){return this.hasAttribute(`system-tools`)}set systemTools(e){this.toggleAttribute(`system-tools`,!!e)}selectItem(e){this.active=e,this.dispatchEvent(new CustomEvent(`slicc-dock-select`,{detail:{id:e,kind:this.#o(e)},bubbles:!0,composed:!0}))}clearActive(){this.active=null}collapse(){let e=this.active;this.active=null,e!=null&&this.dispatchEvent(new CustomEvent(`slicc-dock-collapse`,{detail:{id:e},bubbles:!0,composed:!0}))}#a(){let e=[...this.querySelectorAll(`slicc-dock-item`)];if(e.length===0)return;let t=[];for(let n of e){let e=or(n.getAttribute(`kind`)),r=n.getAttribute(`item-id`)??n.dataset.t??n.getAttribute(`tip`)??``;e!==`tool`&&r!==`new`&&r!==``&&t.push({id:r,icon:n.getAttribute(`icon`)??void 0,label:n.getAttribute(`tip`)??void 0,kind:`sprinkle`,hue:n.getAttribute(`hue`)??void 0})}for(let t of e)t.remove();this.#e.length===0&&(this.#e=t)}#o(e){return tr.some(t=>t.id===e)?`tool`:e===nr.id?`sprinkle`:this.#e.find(t=>t.id===e)?.kind??`tool`}#s(e,t){let n=e.id,r=or(e.kind),i=e.icon??``,a=e.label??n,o=t!=null&&t===n,s=e.hue;return j(`slicc-dock-item`,{"data-t":n,"item-id":n,kind:r,icon:i||!1,tip:a,hue:s||!1,active:o})}#c(){let e=this.active,t=[];for(let n of this.#e)or(n.kind)===`sprinkle`&&t.push(this.#s(n,e));if(t.push(this.#s(nr,e)),t.push(j(`div`,{class:`grow`})),this.systemTools){t.push(j(`div`,{class:`div`}));for(let n of tr)t.push(this.#s(n,e))}this.replaceChildren(),we(this,t)}#l(){let e=this.active;for(let t of this.querySelectorAll(`slicc-dock-item`))t.toggleAttribute(`active`,t.dataset.t===e)}#u(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.selectItem(t))}#d(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.active!==t&&(this.active=t),this.collapse())}#f(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.active!==t&&this.selectItem(t),this.dispatchEvent(new CustomEvent(`slicc-dock-longpress`,{detail:{id:t,kind:this.#o(t)},bubbles:!0,composed:!0})))}#p(e){let t=e.detail;if(t&&typeof t.id==`string`)return t.id;let n=e.target?.closest(`slicc-dock-item`);return n&&this.contains(n)?n.dataset.t??null:null}});var sr=M(`
2325
2325
  :host { display: none; }
2326
2326
  :host([open]) { display: block; }
2327
2327
  .overlay {
@@ -2408,7 +2408,7 @@ slicc-input-card .toolbar slicc-add-menu {
2408
2408
  color: rgba(255,255,255,.7); font-family: var(--ui); font-size: 14px;
2409
2409
  }
2410
2410
  @media (prefers-reduced-motion: reduce) { .overlay, .card { transition: none; } }
2411
- `),lr=`Open tabs`;A(`slicc-tab-overlay`,class extends HTMLElement{static observedAttributes=[`open`,`heading`];#e;#t=[];#n=null;#r=null;#i=e=>{e.key===`Escape`&&this.open&&(e.stopPropagation(),this.#u(`escape`))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[cr]}connectedCallback(){this.#s(),this.#c()}disconnectedCallback(){document.removeEventListener(`keydown`,this.#i,!0)}attributeChangedCallback(e){this.isConnected&&(e===`open`?this.#c():this.#s())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get heading(){return this.getAttribute(`heading`)??lr}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get tabs(){return this.#t.map(e=>({...e}))}set tabs(e){this.#t=Array.isArray(e)?e.map(e=>({...e})):[],this.isConnected&&this.#s()}show(){this.open||=!0}hide(){this.open&&this.#u(`api`)}#a(){let e=j(`button`,{class:`close`,part:`close`,type:`button`,"aria-label":`Close tabs overlay`},n(`x`,{size:18}));return e.addEventListener(`click`,()=>this.#u(`close-button`)),e}#o(e){let t=e.title??e.id,r=e.screenshot?j(`img`,{class:`shot`,part:`shot`,src:e.screenshot,alt:t,loading:`lazy`}):j(`div`,{class:`shot ph`,part:`shot`},n(`globe`,{size:28})),i=j(`button`,{class:`x`,part:`card-close`,type:`button`,"aria-label":`Close ${t}`},n(`x`,{size:14}));i.addEventListener(`click`,t=>{t.stopPropagation(),this.#l(`tab-close`,e.id)});let a=j(`div`,{class:`label`},j(`span`,{class:`name`,part:`title`},t),e.url?j(`span`,{class:`url`},e.url):null),o=j(`div`,{class:e.active?`card on`:`card`,part:`card`,role:`button`,tabindex:`0`,"data-tab-id":e.id,"aria-label":t,"aria-current":e.active?`true`:!1},r,j(`div`,{class:`meta`},a,i));return o.addEventListener(`click`,()=>this.#l(`tab-activate`,e.id)),o.addEventListener(`keydown`,t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),this.#l(`tab-activate`,e.id))}),o}#s(){let e=j(`div`,{class:`bar`,part:`bar`},j(`span`,{class:`title`},this.heading),j(`span`,{class:`count`},String(this.#t.length)),j(`span`,{class:`grow`}),this.#a()),t;if(this.#t.length===0)t=j(`div`,{class:`empty`},`No open tabs.`);else{t=j(`div`,{class:`grid`,part:`grid`,role:`list`});for(let e of this.#t)t.appendChild(this.#o(e))}this.#n=j(`div`,{class:`overlay`,part:`overlay`},e,t),this.#n.addEventListener(`mousedown`,e=>{e.target===this.#n&&this.#u(`backdrop`)}),this.#e.replaceChildren(this.#n)}#c(){this.open?(this.#r=this.getRootNode().activeElement,document.addEventListener(`keydown`,this.#i,!0),requestAnimationFrame(()=>this.#n?.querySelector(`.close`)?.focus())):(document.removeEventListener(`keydown`,this.#i,!0),this.#r?.focus?.(),this.#r=null)}#l(e,t){this.dispatchEvent(new CustomEvent(e,{detail:{id:t},bubbles:!0,composed:!0}))}#u(e){this.open=!1,this.dispatchEvent(new CustomEvent(`overlay-close`,{detail:{reason:e},bubbles:!0,composed:!0}))}});var ur=`#3b6cb2`,dr=`
2411
+ `),cr=`Open tabs`;A(`slicc-tab-overlay`,class extends HTMLElement{static observedAttributes=[`open`,`heading`];#e;#t=[];#n=null;#r=null;#i=e=>{e.key===`Escape`&&this.open&&(e.stopPropagation(),this.#u(`escape`))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[sr]}connectedCallback(){this.#s(),this.#c()}disconnectedCallback(){document.removeEventListener(`keydown`,this.#i,!0)}attributeChangedCallback(e){this.isConnected&&(e===`open`?this.#c():this.#s())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get heading(){return this.getAttribute(`heading`)??cr}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get tabs(){return this.#t.map(e=>({...e}))}set tabs(e){this.#t=Array.isArray(e)?e.map(e=>({...e})):[],this.isConnected&&this.#s()}show(){this.open||=!0}hide(){this.open&&this.#u(`api`)}#a(){let e=j(`button`,{class:`close`,part:`close`,type:`button`,"aria-label":`Close tabs overlay`},n(`x`,{size:18}));return e.addEventListener(`click`,()=>this.#u(`close-button`)),e}#o(e){let t=e.title??e.id,r=e.screenshot?j(`img`,{class:`shot`,part:`shot`,src:e.screenshot,alt:t,loading:`lazy`}):j(`div`,{class:`shot ph`,part:`shot`},n(`globe`,{size:28})),i=j(`button`,{class:`x`,part:`card-close`,type:`button`,"aria-label":`Close ${t}`},n(`x`,{size:14}));i.addEventListener(`click`,t=>{t.stopPropagation(),this.#l(`tab-close`,e.id)});let a=j(`div`,{class:`label`},j(`span`,{class:`name`,part:`title`},t),e.url?j(`span`,{class:`url`},e.url):null),o=j(`div`,{class:e.active?`card on`:`card`,part:`card`,role:`button`,tabindex:`0`,"data-tab-id":e.id,"aria-label":t,"aria-current":e.active?`true`:!1},r,j(`div`,{class:`meta`},a,i));return o.addEventListener(`click`,()=>this.#l(`tab-activate`,e.id)),o.addEventListener(`keydown`,t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),this.#l(`tab-activate`,e.id))}),o}#s(){let e=j(`div`,{class:`bar`,part:`bar`},j(`span`,{class:`title`},this.heading),j(`span`,{class:`count`},String(this.#t.length)),j(`span`,{class:`grow`}),this.#a()),t;if(this.#t.length===0)t=j(`div`,{class:`empty`},`No open tabs.`);else{t=j(`div`,{class:`grid`,part:`grid`,role:`list`});for(let e of this.#t)t.appendChild(this.#o(e))}this.#n=j(`div`,{class:`overlay`,part:`overlay`},e,t),this.#n.addEventListener(`mousedown`,e=>{e.target===this.#n&&this.#u(`backdrop`)}),this.#e.replaceChildren(this.#n)}#c(){this.open?(this.#r=this.getRootNode().activeElement,document.addEventListener(`keydown`,this.#i,!0),requestAnimationFrame(()=>this.#n?.querySelector(`.close`)?.focus())):(document.removeEventListener(`keydown`,this.#i,!0),this.#r?.focus?.(),this.#r=null)}#l(e,t){this.dispatchEvent(new CustomEvent(e,{detail:{id:t},bubbles:!0,composed:!0}))}#u(e){this.open=!1,this.dispatchEvent(new CustomEvent(`overlay-close`,{detail:{reason:e},bubbles:!0,composed:!0}))}});var lr=`#3b6cb2`,ur=`
2412
2412
  .slicc-freezer {
2413
2413
  position: fixed;
2414
2414
  left: 0;
@@ -2510,12 +2510,12 @@ slicc-input-card .toolbar slicc-add-menu {
2510
2510
 
2511
2511
  /* ice-blue accent while a freezer context is active (prototype _ctxAccent) —
2512
2512
  tints the toggle + the new-chat icon; cards keep their snow palette. */
2513
- .slicc-freezer[ctx] .fztgl { color: var(--fz-ctx, ${ur}); border-color: color-mix(in srgb, var(--fz-ctx, ${ur}) 40%, var(--line)); }
2513
+ .slicc-freezer[ctx] .fztgl { color: var(--fz-ctx, ${lr}); border-color: color-mix(in srgb, var(--fz-ctx, ${lr}) 40%, var(--line)); }
2514
2514
  .slicc-freezer[ctx] ::part(new-icon),
2515
2515
  .slicc-freezer[ctx] slicc-freezer-new::part(new-icon) {
2516
- background: color-mix(in srgb, var(--fz-ctx, ${ur}) 14%, var(--canvas));
2517
- border-color: color-mix(in srgb, var(--fz-ctx, ${ur}) 40%, var(--line));
2518
- color: var(--fz-ctx, ${ur});
2516
+ background: color-mix(in srgb, var(--fz-ctx, ${lr}) 14%, var(--canvas));
2517
+ border-color: color-mix(in srgb, var(--fz-ctx, ${lr}) 40%, var(--line));
2518
+ color: var(--fz-ctx, ${lr});
2519
2519
  }
2520
2520
 
2521
2521
  /* match-hidden: search filtered a session row out (only meaningful when open,
@@ -2523,7 +2523,7 @@ slicc-input-card .toolbar slicc-add-menu {
2523
2523
  prototype .fzcard row. */
2524
2524
  .slicc-freezer[open] slicc-freezer-card.match-hidden,
2525
2525
  .slicc-freezer[open] .fzcard.match-hidden { display: none; }
2526
- `,fr=`slicc-freezer-style`;function pr(e){if(e.getElementById(fr))return;let t=e.createElement(`style`);t.id=fr,t.textContent=dr,(e.head??e.documentElement).appendChild(t)}var mr=`http://www.w3.org/2000/svg`;function hr(){let e=document.createElementNS(mr,`svg`);for(let[t,n]of[[`width`,`14`],[`height`,`14`],[`viewBox`,`0 0 16 16`],[`fill`,`none`],[`stroke`,`currentColor`],[`stroke-width`,`1.6`],[`stroke-linecap`,`round`],[`stroke-linejoin`,`round`],[`aria-hidden`,`true`]])e.setAttribute(t,n);let t=document.createElementNS(mr,`rect`);for(let[e,n]of[[`x`,`2.5`],[`y`,`3.5`],[`width`,`11`],[`height`,`9`],[`rx`,`1.5`]])t.setAttribute(e,n);let n=document.createElementNS(mr,`line`);for(let[e,t]of[[`x1`,`6`],[`y1`,`3.5`],[`x2`,`6`],[`y2`,`12.5`]])n.setAttribute(e,t);let r=document.createElementNS(mr,`polyline`);return r.setAttribute(`points`,`9,6.5 10.5,8 9,9.5`),e.append(t,n,r),e}A(`slicc-freezer`,class extends HTMLElement{static observedAttributes=[`open`,`ctx`,`search-placeholder`];#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){pr(this.ownerDocument),this.classList.add(`slicc-freezer`),this.setAttribute(`part`,`freezer`),this.hasAttribute(`aria-label`)||this.setAttribute(`aria-label`,`Past sessions (freezer)`),this.#s(),this.#l(),this.#u()}disconnectedCallback(){this.#a&&this.#t&&(this.#t.removeEventListener(`click`,this.#a),this.#a=null),this.#o&&this.#n&&(this.#n.removeEventListener(`input`,this.#o),this.#o=null)}attributeChangedCallback(e,t,n){this.#i&&(e===`open`?(this.#l(),this.#u()):e===`search-placeholder`&&(this.#n.placeholder=n??`search past sessions`))}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get ctx(){return this.hasAttribute(`ctx`)}set ctx(e){this.toggleAttribute(`ctx`,e)}get searchPlaceholder(){return this.getAttribute(`search-placeholder`)??`search past sessions`}set searchPlaceholder(e){e==null?this.removeAttribute(`search-placeholder`):this.setAttribute(`search-placeholder`,e)}get query(){return this.#i?this.#n.value:``}set query(e){this.#s(),this.#n.value=e,this.#d()}get rail(){return this.#s(),this.#r}toggle(e){let t=e??!this.open;t===this.open&&this.#l(),this.open=t,this.#l(),this.#u(),this.dispatchEvent(new CustomEvent(`freezer-toggle`,{detail:{open:t},bubbles:!0,composed:!0}))}append(...e){this.#s(),this.#r.append(...e),this.#u()}#s(){if(this.#i)return;let e=this.querySelector(`:scope > .fzh`),t=this.querySelector(`:scope > .fzrail`);if(e instanceof HTMLElement&&t instanceof HTMLElement){this.#c(e,t);return}let n=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&(e.classList.contains(`fzh`)||e.classList.contains(`fzrail`)))),r=this.ownerDocument,i=r.createElement(`div`);i.className=`fzh`,i.setAttribute(`part`,`header`);let a=r.createElement(`button`);a.className=`fztgl`,a.type=`button`,a.setAttribute(`part`,`toggle`),a.setAttribute(`aria-label`,`Toggle freezer`),a.append(hr());let o=r.createElement(`input`);o.className=`fzsearch`,o.type=`text`,o.setAttribute(`part`,`search`),o.placeholder=this.searchPlaceholder,o.setAttribute(`aria-label`,`Search past sessions`),i.append(a,o);let s=r.createElement(`div`);s.className=`fzrail`,s.setAttribute(`part`,`rail`);for(let e of n)s.appendChild(e);this.replaceChildren(i,s),this.#c(i,s)}#c(e,t){this.#i=!0,this.#e=e,this.#r=t;let n=e.querySelector(`.fztgl`),r=e.querySelector(`.fzsearch`);n&&(this.#t=n),r&&(this.#n=r),this.#t&&!this.#a&&(this.#a=()=>this.toggle(),this.#t.addEventListener(`click`,this.#a)),this.#n&&!this.#o&&(this.#o=()=>this.#d(),this.#n.addEventListener(`input`,this.#o))}#l(){if(!this.#t)return;let e=this.open;this.#t.setAttribute(`aria-expanded`,e?`true`:`false`),this.#t.title=e?`Collapse freezer`:`Expand freezer`}#u(){if(!this.#i)return;let e=this.open,t=this.#r.querySelectorAll(`slicc-freezer-card, slicc-freezer-new`);for(let n of t)n.toggleAttribute(`expanded`,e)}#d(){let e=this.#n.value.trim().toLowerCase(),t=this.#r.querySelectorAll(`slicc-freezer-card, .fzcard`);for(let n of t){let t=(n.textContent??``).toLowerCase();n.classList.toggle(`match-hidden`,e.length>0&&!t.includes(e))}}});var gr=14,_r=M(`
2526
+ `,dr=`slicc-freezer-style`;function fr(e){if(e.getElementById(dr))return;let t=e.createElement(`style`);t.id=dr,t.textContent=ur,(e.head??e.documentElement).appendChild(t)}var pr=`http://www.w3.org/2000/svg`;function mr(){let e=document.createElementNS(pr,`svg`);for(let[t,n]of[[`width`,`14`],[`height`,`14`],[`viewBox`,`0 0 16 16`],[`fill`,`none`],[`stroke`,`currentColor`],[`stroke-width`,`1.6`],[`stroke-linecap`,`round`],[`stroke-linejoin`,`round`],[`aria-hidden`,`true`]])e.setAttribute(t,n);let t=document.createElementNS(pr,`rect`);for(let[e,n]of[[`x`,`2.5`],[`y`,`3.5`],[`width`,`11`],[`height`,`9`],[`rx`,`1.5`]])t.setAttribute(e,n);let n=document.createElementNS(pr,`line`);for(let[e,t]of[[`x1`,`6`],[`y1`,`3.5`],[`x2`,`6`],[`y2`,`12.5`]])n.setAttribute(e,t);let r=document.createElementNS(pr,`polyline`);return r.setAttribute(`points`,`9,6.5 10.5,8 9,9.5`),e.append(t,n,r),e}A(`slicc-freezer`,class extends HTMLElement{static observedAttributes=[`open`,`ctx`,`search-placeholder`];#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){fr(this.ownerDocument),this.classList.add(`slicc-freezer`),this.setAttribute(`part`,`freezer`),this.hasAttribute(`aria-label`)||this.setAttribute(`aria-label`,`Past sessions (freezer)`),this.#s(),this.#l(),this.#u()}disconnectedCallback(){this.#a&&this.#t&&(this.#t.removeEventListener(`click`,this.#a),this.#a=null),this.#o&&this.#n&&(this.#n.removeEventListener(`input`,this.#o),this.#o=null)}attributeChangedCallback(e,t,n){this.#i&&(e===`open`?(this.#l(),this.#u()):e===`search-placeholder`&&(this.#n.placeholder=n??`search past sessions`))}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get ctx(){return this.hasAttribute(`ctx`)}set ctx(e){this.toggleAttribute(`ctx`,e)}get searchPlaceholder(){return this.getAttribute(`search-placeholder`)??`search past sessions`}set searchPlaceholder(e){e==null?this.removeAttribute(`search-placeholder`):this.setAttribute(`search-placeholder`,e)}get query(){return this.#i?this.#n.value:``}set query(e){this.#s(),this.#n.value=e,this.#d()}get rail(){return this.#s(),this.#r}toggle(e){let t=e??!this.open;t===this.open&&this.#l(),this.open=t,this.#l(),this.#u(),this.dispatchEvent(new CustomEvent(`freezer-toggle`,{detail:{open:t},bubbles:!0,composed:!0}))}append(...e){this.#s(),this.#r.append(...e),this.#u()}#s(){if(this.#i)return;let e=this.querySelector(`:scope > .fzh`),t=this.querySelector(`:scope > .fzrail`);if(e instanceof HTMLElement&&t instanceof HTMLElement){this.#c(e,t);return}let n=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&(e.classList.contains(`fzh`)||e.classList.contains(`fzrail`)))),r=this.ownerDocument,i=r.createElement(`div`);i.className=`fzh`,i.setAttribute(`part`,`header`);let a=r.createElement(`button`);a.className=`fztgl`,a.type=`button`,a.setAttribute(`part`,`toggle`),a.setAttribute(`aria-label`,`Toggle freezer`),a.append(mr());let o=r.createElement(`input`);o.className=`fzsearch`,o.type=`text`,o.setAttribute(`part`,`search`),o.placeholder=this.searchPlaceholder,o.setAttribute(`aria-label`,`Search past sessions`),i.append(a,o);let s=r.createElement(`div`);s.className=`fzrail`,s.setAttribute(`part`,`rail`);for(let e of n)s.appendChild(e);this.replaceChildren(i,s),this.#c(i,s)}#c(e,t){this.#i=!0,this.#e=e,this.#r=t;let n=e.querySelector(`.fztgl`),r=e.querySelector(`.fzsearch`);n&&(this.#t=n),r&&(this.#n=r),this.#t&&!this.#a&&(this.#a=()=>this.toggle(),this.#t.addEventListener(`click`,this.#a)),this.#n&&!this.#o&&(this.#o=()=>this.#d(),this.#n.addEventListener(`input`,this.#o))}#l(){if(!this.#t)return;let e=this.open;this.#t.setAttribute(`aria-expanded`,e?`true`:`false`),this.#t.title=e?`Collapse freezer`:`Expand freezer`}#u(){if(!this.#i)return;let e=this.open,t=this.#r.querySelectorAll(`slicc-freezer-card, slicc-freezer-new`);for(let n of t)n.toggleAttribute(`expanded`,e)}#d(){let e=this.#n.value.trim().toLowerCase(),t=this.#r.querySelectorAll(`slicc-freezer-card, .fzcard`);for(let n of t){let t=(n.textContent??``).toLowerCase();n.classList.toggle(`match-hidden`,e.length>0&&!t.includes(e))}}});var hr=14,gr=M(`
2527
2527
  :host {
2528
2528
  display: inline-grid;
2529
2529
  place-items: center;
@@ -2559,7 +2559,7 @@ slicc-input-card .toolbar slicc-add-menu {
2559
2559
  nothing is slotted */
2560
2560
  ::slotted(*), .ic { line-height: 1; }
2561
2561
  .ic { display: block; }
2562
- `);A(`slicc-snowflake`,class extends HTMLElement{static observedAttributes=[`thawed`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[_r];let e=j(`span`,{class:`snow`,part:`badge`},j(`slot`,null,n(`snowflake`,{size:gr,part:`glyph`,class:`ic`})));this.#e.replaceChildren(e)}get thawed(){return this.hasAttribute(`thawed`)}set thawed(e){this.toggleAttribute(`thawed`,e)}});var vr=`
2562
+ `);A(`slicc-snowflake`,class extends HTMLElement{static observedAttributes=[`thawed`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[gr];let e=j(`span`,{class:`snow`,part:`badge`},j(`slot`,null,n(`snowflake`,{size:hr,part:`glyph`,class:`ic`})));this.#e.replaceChildren(e)}get thawed(){return this.hasAttribute(`thawed`)}set thawed(e){this.toggleAttribute(`thawed`,e)}});var _r=`
2563
2563
  slicc-freezer-card {
2564
2564
  position: relative;
2565
2565
  display: flex;
@@ -2652,7 +2652,7 @@ slicc-freezer-card .slicc-fzcard__meta {
2652
2652
  slicc-freezer-card[thawed] {
2653
2653
  background: color-mix(in srgb, var(--rose) 12%, transparent);
2654
2654
  }
2655
- `,yr=`slicc-freezer-card-style`;function br(e){if(e.getElementById(yr))return;let t=e.createElement(`style`);t.id=yr,t.textContent=vr,(e.head??e.documentElement).appendChild(t)}var xr=1400,Sr=14;A(`slicc-freezer-card`,class extends HTMLElement{static observedAttributes=[`title`,`meta`,`slug`,`icon`,`thawed`];#e;#t;#n;#r;#i=null;#a=null;#o=!1;#s=null;#c=()=>this.#u();#l=()=>{if(!this.#i)return;let e=this.getBoundingClientRect();this.#i.style.setProperty(`--tip-x`,`${e.right+8}px`),this.#i.style.setProperty(`--tip-y`,`${e.top+e.height/2}px`)};connectedCallback(){br(this.ownerDocument),this.#d(),this.#f()}disconnectedCallback(){this.removeEventListener(`click`,this.#c),this.removeEventListener(`pointerenter`,this.#l),this.removeEventListener(`focusin`,this.#l),this.#s!=null&&(clearTimeout(this.#s),this.#s=null)}attributeChangedCallback(e,t,n){t===n||!this.#o||(e===`thawed`?this.#e.toggleAttribute(`thawed`,n!==null):e===`icon`?this.#p():this.#f())}get title(){return this.getAttribute(`title`)??``}set title(e){e==null?this.removeAttribute(`title`):this.setAttribute(`title`,e)}get meta(){return this.getAttribute(`meta`)??``}set meta(e){e==null?this.removeAttribute(`meta`):this.setAttribute(`meta`,e)}get slug(){return this.getAttribute(`slug`)??``}set slug(e){e==null?this.removeAttribute(`slug`):this.setAttribute(`slug`,e)}get icon(){return this.getAttribute(`icon`)}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}get thawed(){return this.hasAttribute(`thawed`)}set thawed(e){this.toggleAttribute(`thawed`,e)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){this.toggleAttribute(`hidden`,e)}get badge(){return this.#d(),this.#e}#u(){this.dispatchEvent(new CustomEvent(`freezer-card-select`,{bubbles:!0,composed:!0,detail:{slug:this.slug}})),this.flashThaw()}flashThaw(e=xr){this.#s!=null&&clearTimeout(this.#s),this.thawed=!0,this.#s=setTimeout(()=>{this.thawed=!1,this.#s=null},e)}#d(){if(this.#o)return;this.#o=!0;let e=this.querySelector(`:scope > .slicc-fzcard__text`);if(e instanceof HTMLElement){this.#t=e,this.#n=e.querySelector(`.slicc-fzcard__title`),this.#r=e.querySelector(`.slicc-fzcard__meta`),this.#e=this.querySelector(`:scope > slicc-snowflake`),this.#i=this.querySelector(`:scope > .slicc-fzcard__tip`),this.addEventListener(`click`,this.#c),this.addEventListener(`pointerenter`,this.#l),this.addEventListener(`focusin`,this.#l);return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`slicc-snowflake`),this.#e.setAttribute(`part`,`badge`),this.#n=j(`div`,{class:`slicc-fzcard__title`,part:`title`}),this.#r=j(`div`,{class:`slicc-fzcard__meta`,part:`meta`}),this.#t=j(`div`,{class:`slicc-fzcard__text`,part:`text`},this.#n,this.#r);for(let e of t)this.#n.appendChild(e);this.#i=j(`span`,{class:`slicc-fzcard__tip`,part:`tip`,"aria-hidden":`true`}),this.replaceChildren(this.#e,this.#t,this.#i),this.addEventListener(`click`,this.#c),this.addEventListener(`pointerenter`,this.#l),this.addEventListener(`focusin`,this.#l)}#f(){if(!this.#o)return;let e=this.getAttribute(`title`);e!=null&&(this.#n.textContent=e),this.#r.textContent=this.meta,this.#i&&(this.#i.textContent=e??(this.#n.textContent||``)),this.#e.toggleAttribute(`thawed`,this.thawed),this.#p()}#p(){if(!this.#o)return;let e=this.getAttribute(`icon`);if(e){let t=n(e,{size:Sr,class:`ic`,part:`icon`});this.#a?this.#a.replaceWith(t):this.#e.appendChild(t),this.#a=t}else this.#a&&=(this.#a.remove(),null)}});var Cr=`square-pen`,wr=`loader-circle`,Tr=16,Er=`New chat`,Dr=350,Or=[[`save`,`archive`,`Save & start new`],[`skip`,`fast-forward`,`New chat — skip memory`],[`erase`,`trash-2`,`Erase & start new`]],kr=M(`
2655
+ `,vr=`slicc-freezer-card-style`;function yr(e){if(e.getElementById(vr))return;let t=e.createElement(`style`);t.id=vr,t.textContent=_r,(e.head??e.documentElement).appendChild(t)}var br=1400,xr=14;A(`slicc-freezer-card`,class extends HTMLElement{static observedAttributes=[`title`,`meta`,`slug`,`icon`,`thawed`];#e;#t;#n;#r;#i=null;#a=null;#o=!1;#s=null;#c=()=>this.#u();#l=()=>{if(!this.#i)return;let e=this.getBoundingClientRect();this.#i.style.setProperty(`--tip-x`,`${e.right+8}px`),this.#i.style.setProperty(`--tip-y`,`${e.top+e.height/2}px`)};connectedCallback(){yr(this.ownerDocument),this.#d(),this.#f()}disconnectedCallback(){this.removeEventListener(`click`,this.#c),this.removeEventListener(`pointerenter`,this.#l),this.removeEventListener(`focusin`,this.#l),this.#s!=null&&(clearTimeout(this.#s),this.#s=null)}attributeChangedCallback(e,t,n){t===n||!this.#o||(e===`thawed`?this.#e.toggleAttribute(`thawed`,n!==null):e===`icon`?this.#p():this.#f())}get title(){return this.getAttribute(`title`)??``}set title(e){e==null?this.removeAttribute(`title`):this.setAttribute(`title`,e)}get meta(){return this.getAttribute(`meta`)??``}set meta(e){e==null?this.removeAttribute(`meta`):this.setAttribute(`meta`,e)}get slug(){return this.getAttribute(`slug`)??``}set slug(e){e==null?this.removeAttribute(`slug`):this.setAttribute(`slug`,e)}get icon(){return this.getAttribute(`icon`)}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}get thawed(){return this.hasAttribute(`thawed`)}set thawed(e){this.toggleAttribute(`thawed`,e)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){this.toggleAttribute(`hidden`,e)}get badge(){return this.#d(),this.#e}#u(){this.dispatchEvent(new CustomEvent(`freezer-card-select`,{bubbles:!0,composed:!0,detail:{slug:this.slug}})),this.flashThaw()}flashThaw(e=br){this.#s!=null&&clearTimeout(this.#s),this.thawed=!0,this.#s=setTimeout(()=>{this.thawed=!1,this.#s=null},e)}#d(){if(this.#o)return;this.#o=!0;let e=this.querySelector(`:scope > .slicc-fzcard__text`);if(e instanceof HTMLElement){this.#t=e,this.#n=e.querySelector(`.slicc-fzcard__title`),this.#r=e.querySelector(`.slicc-fzcard__meta`),this.#e=this.querySelector(`:scope > slicc-snowflake`),this.#i=this.querySelector(`:scope > .slicc-fzcard__tip`),this.addEventListener(`click`,this.#c),this.addEventListener(`pointerenter`,this.#l),this.addEventListener(`focusin`,this.#l);return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`slicc-snowflake`),this.#e.setAttribute(`part`,`badge`),this.#n=j(`div`,{class:`slicc-fzcard__title`,part:`title`}),this.#r=j(`div`,{class:`slicc-fzcard__meta`,part:`meta`}),this.#t=j(`div`,{class:`slicc-fzcard__text`,part:`text`},this.#n,this.#r);for(let e of t)this.#n.appendChild(e);this.#i=j(`span`,{class:`slicc-fzcard__tip`,part:`tip`,"aria-hidden":`true`}),this.replaceChildren(this.#e,this.#t,this.#i),this.addEventListener(`click`,this.#c),this.addEventListener(`pointerenter`,this.#l),this.addEventListener(`focusin`,this.#l)}#f(){if(!this.#o)return;let e=this.getAttribute(`title`);e!=null&&(this.#n.textContent=e),this.#r.textContent=this.meta,this.#i&&(this.#i.textContent=e??(this.#n.textContent||``)),this.#e.toggleAttribute(`thawed`,this.thawed),this.#p()}#p(){if(!this.#o)return;let e=this.getAttribute(`icon`);if(e){let t=n(e,{size:xr,class:`ic`,part:`icon`});this.#a?this.#a.replaceWith(t):this.#e.appendChild(t),this.#a=t}else this.#a&&=(this.#a.remove(),null)}});var Sr=`square-pen`,Cr=`loader-circle`,wr=16,Tr=`New chat`,Er=350,Dr=[[`save`,`archive`,`Save & start new`],[`skip`,`fast-forward`,`New chat — skip memory`],[`erase`,`trash-2`,`Erase & start new`]],Or=M(`
2656
2656
  :host { display: block; }
2657
2657
  :host([hidden]) { display: none; }
2658
2658
  *{ box-sizing: border-box; }
@@ -2797,18 +2797,18 @@ slicc-freezer-card[thawed] {
2797
2797
  .fznew, .nlbl { transition: none; }
2798
2798
  .fznew-spinner svg { animation: none; }
2799
2799
  }
2800
- `);A(`slicc-freezer-new`,class extends HTMLElement{static observedAttributes=[`expanded`,`label`,`busy`,`progress`,`no-skip`];#e;#t=null;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[kr]}connectedCallback(){this.#a()}disconnectedCallback(){this.#n?.destroy(),this.#n=null,this.#c()}attributeChangedCallback(e){e===`progress`&&this.#i()||this.isConnected&&this.#a()}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}get label(){return this.getAttribute(`label`)??Er}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get noSkip(){return this.hasAttribute(`no-skip`)}set noSkip(e){this.toggleAttribute(`no-skip`,e)}get busy(){return this.hasAttribute(`busy`)}set busy(e){this.toggleAttribute(`busy`,e)}get progress(){let e=this.getAttribute(`progress`);if(e==null)return null;let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1,Math.max(0,t)):null}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,String(Math.min(1,Math.max(0,e))))}#i(){let e=this.#e.querySelector(`.fznew-ring`);return!e||!this.busy||!this.hasAttribute(`progress`)?!1:(e.style.setProperty(`--fznew-progress`,String(this.progress??0)),!0)}#a(){let e=this.label,t=this.busy,r=t&&this.hasAttribute(`progress`),i=j(`span`,{class:`nico`,part:`badge`},t?j(`span`,{class:`fznew-spinner`,part:`spinner`},r?j(`span`,{class:`fznew-ring`,part:`ring`,style:`--fznew-progress:${this.progress??0}`}):null,n(wr,{size:Tr,part:`icon`})):j(`slot`,{name:`icon`},n(Cr,{size:Tr,part:`icon`}))),a=j(`span`,{class:`nlbl`,part:`label`},j(`slot`,null,e)),o=j(`button`,{class:`fznew`,part:`button`,type:`button`,"aria-label":e,title:e,"aria-busy":t?`true`:void 0},i,a);this.#t=o,this.#s(o),this.#e.replaceChildren(o,this.#o())}#o(){let e=j(`div`,{class:`fznew-options`,part:`options`}),t=this.noSkip?Or.filter(([e])=>e!==`skip`):Or;for(let[r,i,a]of t){let t=j(`button`,{class:`fznew-opt fznew-opt--${r}`,part:`option-${r}`,type:`button`},n(i,{size:13}),j(`span`,{class:`fznew-opt__text`},a));t.addEventListener(`click`,()=>this.#l(r)),e.appendChild(t)}return e}#s(e){this.#n?.destroy(),this.#c(),this.#n=Qn(e,{onLongPress:()=>{if(this.#r!==null){this.#c(),this.#l(`skip`);return}this.#l(`erase`)},onShortClick:()=>{if(this.noSkip){this.#l(`save`);return}if(this.#r!==null){this.#c(),this.#l(`skip`);return}this.#r=setTimeout(()=>{this.#r=null,this.#l(`save`)},Dr)}})}#c(){this.#r!==null&&(clearTimeout(this.#r),this.#r=null)}#l(e){e===`save`&&(this.busy=!0),this.dispatchEvent(new CustomEvent(`new-chat-${e}`,{bubbles:!0,composed:!0}))}});var Ar=1e3/15;function jr(e,t,n){return n?!0:e-t>=62.66666666666667}function Mr(e,t,n){if(n||!Number.isFinite(t))return e;let r=t+Ar;return e-r>66.66666666666667?e:r}var Nr=`attribute vec2 a_pos; void main(){ gl_Position = vec4(a_pos,0.0,1.0); }`,Pr=`precision highp float;
2800
+ `);A(`slicc-freezer-new`,class extends HTMLElement{static observedAttributes=[`expanded`,`label`,`busy`,`progress`,`no-skip`];#e;#t=null;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Or]}connectedCallback(){this.#a()}disconnectedCallback(){this.#n?.destroy(),this.#n=null,this.#c()}attributeChangedCallback(e){e===`progress`&&this.#i()||this.isConnected&&this.#a()}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}get label(){return this.getAttribute(`label`)??Tr}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get noSkip(){return this.hasAttribute(`no-skip`)}set noSkip(e){this.toggleAttribute(`no-skip`,e)}get busy(){return this.hasAttribute(`busy`)}set busy(e){this.toggleAttribute(`busy`,e)}get progress(){let e=this.getAttribute(`progress`);if(e==null)return null;let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1,Math.max(0,t)):null}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,String(Math.min(1,Math.max(0,e))))}#i(){let e=this.#e.querySelector(`.fznew-ring`);return!e||!this.busy||!this.hasAttribute(`progress`)?!1:(e.style.setProperty(`--fznew-progress`,String(this.progress??0)),!0)}#a(){let e=this.label,t=this.busy,r=t&&this.hasAttribute(`progress`),i=j(`span`,{class:`nico`,part:`badge`},t?j(`span`,{class:`fznew-spinner`,part:`spinner`},r?j(`span`,{class:`fznew-ring`,part:`ring`,style:`--fznew-progress:${this.progress??0}`}):null,n(Cr,{size:wr,part:`icon`})):j(`slot`,{name:`icon`},n(Sr,{size:wr,part:`icon`}))),a=j(`span`,{class:`nlbl`,part:`label`},j(`slot`,null,e)),o=j(`button`,{class:`fznew`,part:`button`,type:`button`,"aria-label":e,title:e,"aria-busy":t?`true`:void 0},i,a);this.#t=o,this.#s(o),this.#e.replaceChildren(o,this.#o())}#o(){let e=j(`div`,{class:`fznew-options`,part:`options`}),t=this.noSkip?Dr.filter(([e])=>e!==`skip`):Dr;for(let[r,i,a]of t){let t=j(`button`,{class:`fznew-opt fznew-opt--${r}`,part:`option-${r}`,type:`button`},n(i,{size:13}),j(`span`,{class:`fznew-opt__text`},a));t.addEventListener(`click`,()=>this.#l(r)),e.appendChild(t)}return e}#s(e){this.#n?.destroy(),this.#c(),this.#n=Zn(e,{onLongPress:()=>{if(this.#r!==null){this.#c(),this.#l(`skip`);return}this.#l(`erase`)},onShortClick:()=>{if(this.noSkip){this.#l(`save`);return}if(this.#r!==null){this.#c(),this.#l(`skip`);return}this.#r=setTimeout(()=>{this.#r=null,this.#l(`save`)},Er)}})}#c(){this.#r!==null&&(clearTimeout(this.#r),this.#r=null)}#l(e){e===`save`&&(this.busy=!0),this.dispatchEvent(new CustomEvent(`new-chat-${e}`,{bubbles:!0,composed:!0}))}});var kr=1e3/15;function Ar(e,t,n){return n?!0:e-t>=62.66666666666667}function jr(e,t,n){if(n||!Number.isFinite(t))return e;let r=t+kr;return e-r>66.66666666666667?e:r}var Mr=`attribute vec2 a_pos; void main(){ gl_Position = vec4(a_pos,0.0,1.0); }`,Nr=`precision highp float;
2801
2801
  uniform vec2 u_res; uniform float u_time; uniform float u_energy;
2802
2802
  uniform vec2 u_center; uniform vec3 u_evt; uniform float u_freeze; uniform float u_dark;
2803
2803
  uniform float u_falloff; uniform float u_life; uniform vec3 u_tint; uniform float u_scroll;
2804
2804
  uniform float u_brightness; uniform float u_contrast; uniform float u_noise; uniform float u_blur;
2805
- vec3 themeBg(){ return mix(vec3(0.97,0.95,0.89), vec3(0.09,0.08,0.06), u_dark); }`,Fr=`
2805
+ vec3 themeBg(){ return mix(vec3(0.97,0.95,0.89), vec3(0.09,0.08,0.06), u_dark); }`,Pr=`
2806
2806
  float hash21(vec2 p){ p=fract(p*vec2(123.34,456.21)); p+=dot(p,p+45.32); return fract(p.x*p.y); }
2807
2807
  float vnoise(vec2 p){ vec2 i=floor(p),f=fract(p);
2808
2808
  float a=hash21(i),b=hash21(i+vec2(1.,0.)),c=hash21(i+vec2(0.,1.)),d=hash21(i+vec2(1.,1.));
2809
2809
  vec2 u=f*f*(3.-2.*f); return mix(mix(a,b,u.x),mix(c,d,u.x),u.y); }
2810
2810
  float fbm(vec2 p){ float v=0.,a=0.5; for(int i=0;i<5;i++){ v+=a*vnoise(p); p=p*2.02+vec2(7.1,3.7); a*=0.5;} return v; }
2811
- vec2 warp(vec2 p, float t){ float a=fbm(p+vec2(0.0,1.7)+t*0.10); float b=fbm(p+vec2(5.2,1.3)-t*0.08); return p+0.85*vec2(a,b); }`,Ir=`${Pr}${Fr}
2811
+ vec2 warp(vec2 p, float t){ float a=fbm(p+vec2(0.0,1.7)+t*0.10); float b=fbm(p+vec2(5.2,1.3)-t*0.08); return p+0.85*vec2(a,b); }`,Fr=`${Nr}${Pr}
2812
2812
  vec3 pal(float t){ vec3 strawberry=vec3(1.0,0.45,0.62); vec3 vanilla=vec3(1.0,0.95,0.82);
2813
2813
  vec3 pistachio=vec3(0.60,0.86,0.52);
2814
2814
  vec3 col=mix(strawberry,vanilla,smoothstep(0.0,0.5,t)); col=mix(col,pistachio,smoothstep(0.5,1.0,t)); return col; }
@@ -2827,7 +2827,7 @@ void main(){
2827
2827
  ice*=0.95+0.08*sin(u_time*0.4); float mask=smoothstep(0.62,0.0,r);
2828
2828
  vec3 col=mix(bg,ice,clamp(mask,0.0,1.0)*0.80); col+=ice*mask*hl*0.12;
2829
2829
  gl_FragColor=vec4(col,1.0);
2830
- }`,Lr=`${Pr}${Fr}
2830
+ }`,Ir=`${Nr}${Pr}
2831
2831
  /* Inside-of-a-freezer ground: icy WHITE in light mode (never the warm theme
2832
2832
  canvas — blue-on-beige read as sand, not frost), cold blue-black in dark. */
2833
2833
  vec3 freezerBg(){ return mix(vec3(0.965,0.98,1.0), vec3(0.05,0.08,0.13), u_dark); }
@@ -2854,7 +2854,7 @@ void main(){
2854
2854
  deviation budget the cone glass uses. */
2855
2855
  col=mix(freezerBg(),col,0.22);
2856
2856
  gl_FragColor=vec4(col,1.0);
2857
- }`,Rr=`${Pr}${Fr}
2857
+ }`,Lr=`${Nr}${Pr}
2858
2858
  uniform float u_speed;
2859
2859
  vec2 sugarHash(vec2 p){ p=vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3))); return fract(sin(p)*43758.5453123); }
2860
2860
  vec3 sugarVoronoi(vec2 p,float t){
@@ -2933,20 +2933,20 @@ void main(){
2933
2933
  col+=u_noise*grain; col=(col-0.5)*u_contrast+0.5; col*=u_brightness; col=clamp(col,0.0,1.0);
2934
2934
  col=clamp(col,max(bg-vec3(0.20),vec3(0.0)),min(bg+vec3(0.20),vec3(1.0)));
2935
2935
  gl_FragColor=vec4(col,1.0);
2936
- }`,zr={caramel:{mode:`cone`,tint:`#d08a3c`,brightness:1.1,contrast:1.1,noise:.025,blur:.14,coverage:.28,speed:.0625},"caramel-soft":{mode:`cone`,tint:`#d08a3c`,brightness:1.2,contrast:.75,noise:.025,blur:.14,coverage:.28,speed:1},frosted:{mode:`cone`,tint:`#ead9bd`,brightness:1,contrast:.55,noise:.005,blur:.9,coverage:.08,speed:1},brittle:{mode:`cone`,tint:`#ffd089`,brightness:.96,contrast:1.2,noise:.055,blur:.02,coverage:.68,speed:1},"waffle-glass":{mode:`cone`,tint:`#d3a15f`,brightness:1,contrast:.9,noise:.02,blur:.08,coverage:.9,speed:1}},Br={cone:Rr,scoop:Ir,freezer:Lr},Vr=new Set([`cone`,`scoop`,`freezer`]),Hr={cone:`radial-gradient(120% 120% at 35% 45%, color-mix(in srgb,#d08a3c 20%,var(--bg)) 0%, var(--bg) 70%)`,scoop:`radial-gradient(120% 120% at 40% 50%, color-mix(in srgb,#ff9bc0 40%,var(--bg)) 0%, var(--bg) 62%)`,freezer:`radial-gradient(120% 120% at 0% 100%, color-mix(in srgb,#7fb0e6 55%,var(--bg)) 0%, var(--bg) 70%)`},Ur=M(`
2936
+ }`,Rr={caramel:{mode:`cone`,tint:`#d08a3c`,brightness:1.1,contrast:1.1,noise:.025,blur:.14,coverage:.28,speed:.0625},"caramel-soft":{mode:`cone`,tint:`#d08a3c`,brightness:1.2,contrast:.75,noise:.025,blur:.14,coverage:.28,speed:1},frosted:{mode:`cone`,tint:`#ead9bd`,brightness:1,contrast:.55,noise:.005,blur:.9,coverage:.08,speed:1},brittle:{mode:`cone`,tint:`#ffd089`,brightness:.96,contrast:1.2,noise:.055,blur:.02,coverage:.68,speed:1},"waffle-glass":{mode:`cone`,tint:`#d3a15f`,brightness:1,contrast:.9,noise:.02,blur:.08,coverage:.9,speed:1}},zr={cone:Lr,scoop:Fr,freezer:Ir},Br=new Set([`cone`,`scoop`,`freezer`]),Vr={cone:`radial-gradient(120% 120% at 35% 45%, color-mix(in srgb,#d08a3c 20%,var(--bg)) 0%, var(--bg) 70%)`,scoop:`radial-gradient(120% 120% at 40% 50%, color-mix(in srgb,#ff9bc0 40%,var(--bg)) 0%, var(--bg) 62%)`,freezer:`radial-gradient(120% 120% at 0% 100%, color-mix(in srgb,#7fb0e6 55%,var(--bg)) 0%, var(--bg) 70%)`},Hr=M(`
2937
2937
  :host { position: relative; display: block; pointer-events: none; }
2938
2938
  .canvas, .fallback { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
2939
2939
  .fallback { display: none; }
2940
2940
  :host([no-webgl]) .canvas { display: none; }
2941
- :host([no-webgl]) .fallback { display: block; }`),Wr=1,Gr=.5,Kr=2,qr=.35,Jr=[`u_res`,`u_scroll`,`u_time`,`u_energy`,`u_center`,`u_evt`,`u_freeze`,`u_dark`,`u_falloff`,`u_life`,`u_tint`,`u_brightness`,`u_contrast`,`u_noise`,`u_blur`,`u_speed`];function Yr(e,t,n,r){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):r}function Xr(e,t){if(!e||typeof getComputedStyle!=`function`)return t;let n=document.createElement(`span`);n.style.color=e,n.style.display=`none`,document.body.appendChild(n);let r=getComputedStyle(n).color;n.remove();let i=r.match(/[\d.]+/g)?.map(Number);return!i||i.length<3?t:[i[0]/255,i[1]/255,i[2]/255]}var Zr=class extends HTMLElement{static observedAttributes=[`mode`,`tint`,`coverage`,`intensity`,`scroll`,`brightness`,`contrast`,`noise`,`blur`,`speed`,`dpr`];#e;#t=null;#n=null;#r=null;#i={};#a=null;#o={};#s=-1;#c=0;#l=0;#u=0;#d=-1/0;#f=0;#p=!1;#m=null;#h=!1;#g=[.816,.541,.235];#_=[.957,.247,.369];#v=0;#y=null;#b=null;#x=null;#S=null;#C=null;#w=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ur];let e=j(`canvas`,{class:`canvas`,part:`canvas`}),t=j(`div`,{class:`fallback`,part:`fallback`,"aria-hidden":`true`});this.#e.replaceChildren(e,t),this.#t=e}connectedCallback(){if(this.#h=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,this.#T(),!this.#j()){this.setAttribute(`no-webgl`,``);return}if(this.removeAttribute(`no-webgl`),typeof ResizeObserver<`u`){let e=!0;this.#m=new ResizeObserver(()=>{let t=e;e=!1,this.#z({burst:!t})}),this.#m.observe(this)}this.#E(),this.#D(),this.#l=performance.now()/1e3,this.#d=-1/0,this.#p=!1,this.#z()}disconnectedCallback(){this.#V(),this.#m?.disconnect(),this.#m=null,this.#y?.disconnect(),this.#y=null,this.#b&&this.#x&&this.#b.removeEventListener(`change`,this.#x),this.#b=null,this.#x=null,this.#H()}attributeChangedCallback(e){if(this.isConnected){if((e===`tint`||e===`mode`)&&this.#E(),e===`mode`&&this.#n&&this.mode!==this.#S&&this.#A()){this.#L(),this.#d=performance.now(),this.#T(),this.#z();return}this.#T(),this.#z({burst:!0})}}get mode(){let e=this.getAttribute(`mode`);return e&&Vr.has(e)?e:`cone`}set mode(e){this.setAttribute(`mode`,e)}get coverage(){let e=this.mode===`cone`?zr.caramel.coverage:.66;return Yr(Number.parseFloat(this.getAttribute(`coverage`)??``),0,1,e)}set coverage(e){this.setAttribute(`coverage`,String(e))}get intensity(){return Yr(Number.parseFloat(this.getAttribute(`intensity`)??``),0,4,1)}set intensity(e){this.setAttribute(`intensity`,String(e))}get scrollOffset(){let e=Number.parseFloat(this.getAttribute(`scroll`)??``);return Number.isFinite(e)?e:0}set scrollOffset(e){this.setAttribute(`scroll`,String(e))}get brightness(){return Yr(Number.parseFloat(this.getAttribute(`brightness`)??``),.5,1.5,zr.caramel.brightness)}set brightness(e){this.setAttribute(`brightness`,String(e))}get contrast(){return Yr(Number.parseFloat(this.getAttribute(`contrast`)??``),.5,2,zr.caramel.contrast)}set contrast(e){this.setAttribute(`contrast`,String(e))}get noise(){return Yr(Number.parseFloat(this.getAttribute(`noise`)??``),0,.3,zr.caramel.noise)}set noise(e){this.setAttribute(`noise`,String(e))}get blurAmount(){return Yr(Number.parseFloat(this.getAttribute(`blur`)??``),0,1,zr.caramel.blur)}set blurAmount(e){this.setAttribute(`blur`,String(e))}get speed(){return Yr(Number.parseFloat(this.getAttribute(`speed`)??``),0,2,zr.caramel.speed)}set speed(e){this.setAttribute(`speed`,String(e))}get dpr(){return Yr(Number.parseFloat(this.getAttribute(`dpr`)??``),Gr,Kr,Wr)}set dpr(e){this.setAttribute(`dpr`,String(e))}get noWebgl(){return this.hasAttribute(`no-webgl`)}pulse(e=1){Number.isFinite(e)&&(this.#u=Math.min(1.4,Math.max(0,this.#u+e)),this.#z({burst:!0}))}#T(){let e=this.#e.querySelector(`.fallback`);e&&(e.style.background=Hr[this.mode])}#E(){let e=this.getAttribute(`tint`)??(this.mode===`cone`?zr.caramel.tint:``);this.#g=Xr(e,[.545,.361,.965]),this.#_=Xr(e,[.957,.247,.369]),this.#v=this.#I()}#D(){let e=()=>{this.#E(),this.#z({burst:!0})};if(typeof MutationObserver<`u`){this.#y=new MutationObserver(e);for(let e of[document.documentElement,document.body])e&&this.#y.observe(e,{attributes:!0,attributeFilter:[`class`,`data-theme`]})}typeof matchMedia==`function`&&(this.#b=matchMedia(`(prefers-color-scheme: dark)`),this.#x=e,this.#b.addEventListener(`change`,this.#x))}#O(e,t,n){let r=e.createShader(t);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(e.deleteShader(r),null)):null}#k(e){let t=this.#n;if(!t)return null;let n=this.#O(t,t.VERTEX_SHADER,Nr),r=this.#O(t,t.FRAGMENT_SHADER,Br[e]);if(!n||!r)return n&&t.deleteShader(n),r&&t.deleteShader(r),null;let i=t.createProgram();if(!i)return t.deleteShader(n),t.deleteShader(r),null;if(t.attachShader(i,n),t.attachShader(i,r),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))return t.deleteProgram(i),t.deleteShader(n),t.deleteShader(r),null;let a=t.getAttribLocation(i,`a_pos`),o={};for(let e of Jr)o[e]=t.getUniformLocation(i,e);return{program:i,vs:n,fs:r,aPos:a,loc:o}}#A(){let e=this.#n;if(!e)return!1;let t=this.mode,n=this.#i[t];if(!n){let e=this.#k(t);if(!e)return!1;this.#i[t]=e,n=e}return this.#r=n.program,this.#s=n.aPos,this.#o=n.loc,e.useProgram(n.program),this.#S=t,!0}#j(){let e=this.#t;if(!e)return!1;let t={premultipliedAlpha:!0,alpha:!0,antialias:!0},n=null;try{n=e.getContext(`webgl`,t)??e.getContext(`experimental-webgl`,t)}catch{n=null}return n?(this.#n=n,this.#N(e),this.#M()?!0:(this.#H(),!1)):!1}#M(){let e=this.#n;if(!e||!this.#A())return!1;let t=e.createBuffer();return t?(this.#a=t,e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),e.STATIC_DRAW),!0):!1}#N(e){this.#P(e),this.#C=e=>{e.preventDefault(),this.#p=!0,this.#V(),this.#i={},this.#r=null,this.#S=null,this.#o={},this.#a=null},this.#w=()=>{if(!(!this.isConnected||!this.#n)){if(this.#i={},!this.#M()){this.#p=!1,console.error(`[slicc-shader] GL restore failed; falling back to CSS gradient`),this.setAttribute(`no-webgl`,``),this.#H();return}this.#p=!1,this.#l=performance.now()/1e3,this.#d=-1/0,this.#z()}},e.addEventListener(`webglcontextlost`,this.#C,!1),e.addEventListener(`webglcontextrestored`,this.#w,!1)}#P(e){this.#C&&e.removeEventListener(`webglcontextlost`,this.#C),this.#w&&e.removeEventListener(`webglcontextrestored`,this.#w),this.#C=null,this.#w=null}#F(){let e=this.#t;if(!e)return;let t=Math.min(this.dpr,typeof window<`u`&&window.devicePixelRatio||1),n=Math.max(1,e.clientWidth*t|0),r=Math.max(1,e.clientHeight*t|0);(e.width!==n||e.height!==r)&&(e.width=n,e.height=r)}#I(){if(typeof getComputedStyle!=`function`)return 0;let e=getComputedStyle(this).getPropertyValue(`--ink`).trim();if(!e)return 0;let[t,n,r]=Xr(e,[0,0,0]);return+(.2126*t+.7152*n+.0722*r>.5)}#L(){let e=this.#n,t=this.#t,n=this.#r;if(!e||!t||!n||!this.#a)return;this.#F();let r=performance.now()/1e3-this.#l,i=.5+.5*Math.sin(r*.12),a=.5+.5*Math.sin(r*.097+1),o=.2*(1-i)+.46*i,s=.74*(1-a)+.3*a,c=this.#v,l=this.#g,u=this.#_;e.viewport(0,0,t.width,t.height),e.useProgram(n),e.bindBuffer(e.ARRAY_BUFFER,this.#a),e.enableVertexAttribArray(this.#s),e.vertexAttribPointer(this.#s,2,e.FLOAT,!1,0,0);let d=this.#o;e.uniform2f(d.u_res??null,t.width,t.height),e.uniform1f(d.u_time??null,r),e.uniform1f(d.u_energy??null,this.#u),e.uniform2f(d.u_center??null,o,s),e.uniform3f(d.u_evt??null,u[0],u[1],u[2]),e.uniform1f(d.u_freeze??null,Yr(this.coverage*this.intensity,0,1,.66)*2.2),e.uniform1f(d.u_dark??null,c),e.uniform1f(d.u_scroll??null,this.scrollOffset*qr/Math.max(1,t.clientHeight||t.height)),e.uniform1f(d.u_falloff??null,.3),e.uniform1f(d.u_life??null,.35),e.uniform3f(d.u_tint??null,l[0],l[1],l[2]),e.uniform1f(d.u_brightness??null,this.brightness),e.uniform1f(d.u_contrast??null,this.contrast),e.uniform1f(d.u_noise??null,this.noise),e.uniform1f(d.u_blur??null,this.blurAmount),e.uniform1f(d.u_speed??null,this.speed),e.drawArrays(e.TRIANGLES,0,3),this.#u*=.95,this.#u<.001&&(this.#u=0)}#R(){return!(this.#h||this.mode===`cone`&&this.speed===0)}#z(e={}){e.burst&&(this.#f=performance.now()+800),!(this.#c||!this.#n||this.#p)&&(this.#c=requestAnimationFrame(this.#B))}#B=e=>{this.#c=0;let t=e<this.#f||this.#u>0;jr(e,this.#d,t)&&(this.#d=Mr(e,this.#d,t),this.#L()),!(this.#h||!this.#R()&&this.#u===0)&&(this.#c=requestAnimationFrame(this.#B))};#V(){this.#c&&cancelAnimationFrame(this.#c),this.#c=0}#H(){let e=this.#n,t=this.#t;if(t&&this.#P(t),e){this.#a&&e.deleteBuffer(this.#a);for(let t of Object.values(this.#i))t&&(e.deleteProgram(t.program),e.deleteShader(t.vs),e.deleteShader(t.fs));e.getExtension(`WEBGL_lose_context`)?.loseContext()}this.#n=null,this.#r=null,this.#i={},this.#o={},this.#a=null,this.#S=null}};A(`slicc-shader`,Zr),A(`slicc-frost-shader`,class extends Zr{connectedCallback(){this.getAttribute(`mode`)!==`freezer`&&this.setAttribute(`mode`,`freezer`),super.connectedCallback()}});var Qr=`# Memory
2941
+ :host([no-webgl]) .fallback { display: block; }`),Ur=1,Wr=.5,Gr=2,Kr=.35,qr=[`u_res`,`u_scroll`,`u_time`,`u_energy`,`u_center`,`u_evt`,`u_freeze`,`u_dark`,`u_falloff`,`u_life`,`u_tint`,`u_brightness`,`u_contrast`,`u_noise`,`u_blur`,`u_speed`];function Jr(e,t,n,r){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):r}function Yr(e,t){if(!e||typeof getComputedStyle!=`function`)return t;let n=document.createElement(`span`);n.style.color=e,n.style.display=`none`,document.body.appendChild(n);let r=getComputedStyle(n).color;n.remove();let i=r.match(/[\d.]+/g)?.map(Number);return!i||i.length<3?t:[i[0]/255,i[1]/255,i[2]/255]}var Xr=class extends HTMLElement{static observedAttributes=[`mode`,`tint`,`coverage`,`intensity`,`scroll`,`brightness`,`contrast`,`noise`,`blur`,`speed`,`dpr`];#e;#t=null;#n=null;#r=null;#i={};#a=null;#o={};#s=-1;#c=0;#l=0;#u=0;#d=-1/0;#f=0;#p=!1;#m=null;#h=!1;#g=[.816,.541,.235];#_=[.957,.247,.369];#v=0;#y=null;#b=null;#x=null;#S=null;#C=null;#w=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Hr];let e=j(`canvas`,{class:`canvas`,part:`canvas`}),t=j(`div`,{class:`fallback`,part:`fallback`,"aria-hidden":`true`});this.#e.replaceChildren(e,t),this.#t=e}connectedCallback(){if(this.#h=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,this.#T(),!this.#j()){this.setAttribute(`no-webgl`,``);return}if(this.removeAttribute(`no-webgl`),typeof ResizeObserver<`u`){let e=!0;this.#m=new ResizeObserver(()=>{let t=e;e=!1,this.#z({burst:!t})}),this.#m.observe(this)}this.#E(),this.#D(),this.#l=performance.now()/1e3,this.#d=-1/0,this.#p=!1,this.#z()}disconnectedCallback(){this.#V(),this.#m?.disconnect(),this.#m=null,this.#y?.disconnect(),this.#y=null,this.#b&&this.#x&&this.#b.removeEventListener(`change`,this.#x),this.#b=null,this.#x=null,this.#H()}attributeChangedCallback(e){if(this.isConnected){if((e===`tint`||e===`mode`)&&this.#E(),e===`mode`&&this.#n&&this.mode!==this.#S&&this.#A()){this.#L(),this.#d=performance.now(),this.#T(),this.#z();return}this.#T(),this.#z({burst:!0})}}get mode(){let e=this.getAttribute(`mode`);return e&&Br.has(e)?e:`cone`}set mode(e){this.setAttribute(`mode`,e)}get coverage(){let e=this.mode===`cone`?Rr.caramel.coverage:.66;return Jr(Number.parseFloat(this.getAttribute(`coverage`)??``),0,1,e)}set coverage(e){this.setAttribute(`coverage`,String(e))}get intensity(){return Jr(Number.parseFloat(this.getAttribute(`intensity`)??``),0,4,1)}set intensity(e){this.setAttribute(`intensity`,String(e))}get scrollOffset(){let e=Number.parseFloat(this.getAttribute(`scroll`)??``);return Number.isFinite(e)?e:0}set scrollOffset(e){this.setAttribute(`scroll`,String(e))}get brightness(){return Jr(Number.parseFloat(this.getAttribute(`brightness`)??``),.5,1.5,Rr.caramel.brightness)}set brightness(e){this.setAttribute(`brightness`,String(e))}get contrast(){return Jr(Number.parseFloat(this.getAttribute(`contrast`)??``),.5,2,Rr.caramel.contrast)}set contrast(e){this.setAttribute(`contrast`,String(e))}get noise(){return Jr(Number.parseFloat(this.getAttribute(`noise`)??``),0,.3,Rr.caramel.noise)}set noise(e){this.setAttribute(`noise`,String(e))}get blurAmount(){return Jr(Number.parseFloat(this.getAttribute(`blur`)??``),0,1,Rr.caramel.blur)}set blurAmount(e){this.setAttribute(`blur`,String(e))}get speed(){return Jr(Number.parseFloat(this.getAttribute(`speed`)??``),0,2,Rr.caramel.speed)}set speed(e){this.setAttribute(`speed`,String(e))}get dpr(){return Jr(Number.parseFloat(this.getAttribute(`dpr`)??``),Wr,Gr,Ur)}set dpr(e){this.setAttribute(`dpr`,String(e))}get noWebgl(){return this.hasAttribute(`no-webgl`)}pulse(e=1){Number.isFinite(e)&&(this.#u=Math.min(1.4,Math.max(0,this.#u+e)),this.#z({burst:!0}))}#T(){let e=this.#e.querySelector(`.fallback`);e&&(e.style.background=Vr[this.mode])}#E(){let e=this.getAttribute(`tint`)??(this.mode===`cone`?Rr.caramel.tint:``);this.#g=Yr(e,[.545,.361,.965]),this.#_=Yr(e,[.957,.247,.369]),this.#v=this.#I()}#D(){let e=()=>{this.#E(),this.#z({burst:!0})};if(typeof MutationObserver<`u`){this.#y=new MutationObserver(e);for(let e of[document.documentElement,document.body])e&&this.#y.observe(e,{attributes:!0,attributeFilter:[`class`,`data-theme`]})}typeof matchMedia==`function`&&(this.#b=matchMedia(`(prefers-color-scheme: dark)`),this.#x=e,this.#b.addEventListener(`change`,this.#x))}#O(e,t,n){let r=e.createShader(t);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(e.deleteShader(r),null)):null}#k(e){let t=this.#n;if(!t)return null;let n=this.#O(t,t.VERTEX_SHADER,Mr),r=this.#O(t,t.FRAGMENT_SHADER,zr[e]);if(!n||!r)return n&&t.deleteShader(n),r&&t.deleteShader(r),null;let i=t.createProgram();if(!i)return t.deleteShader(n),t.deleteShader(r),null;if(t.attachShader(i,n),t.attachShader(i,r),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))return t.deleteProgram(i),t.deleteShader(n),t.deleteShader(r),null;let a=t.getAttribLocation(i,`a_pos`),o={};for(let e of qr)o[e]=t.getUniformLocation(i,e);return{program:i,vs:n,fs:r,aPos:a,loc:o}}#A(){let e=this.#n;if(!e)return!1;let t=this.mode,n=this.#i[t];if(!n){let e=this.#k(t);if(!e)return!1;this.#i[t]=e,n=e}return this.#r=n.program,this.#s=n.aPos,this.#o=n.loc,e.useProgram(n.program),this.#S=t,!0}#j(){let e=this.#t;if(!e)return!1;let t={premultipliedAlpha:!0,alpha:!0,antialias:!0},n=null;try{n=e.getContext(`webgl`,t)??e.getContext(`experimental-webgl`,t)}catch{n=null}return n?(this.#n=n,this.#N(e),this.#M()?!0:(this.#H(),!1)):!1}#M(){let e=this.#n;if(!e||!this.#A())return!1;let t=e.createBuffer();return t?(this.#a=t,e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),e.STATIC_DRAW),!0):!1}#N(e){this.#P(e),this.#C=e=>{e.preventDefault(),this.#p=!0,this.#V(),this.#i={},this.#r=null,this.#S=null,this.#o={},this.#a=null},this.#w=()=>{if(!(!this.isConnected||!this.#n)){if(this.#i={},!this.#M()){this.#p=!1,console.error(`[slicc-shader] GL restore failed; falling back to CSS gradient`),this.setAttribute(`no-webgl`,``),this.#H();return}this.#p=!1,this.#l=performance.now()/1e3,this.#d=-1/0,this.#z()}},e.addEventListener(`webglcontextlost`,this.#C,!1),e.addEventListener(`webglcontextrestored`,this.#w,!1)}#P(e){this.#C&&e.removeEventListener(`webglcontextlost`,this.#C),this.#w&&e.removeEventListener(`webglcontextrestored`,this.#w),this.#C=null,this.#w=null}#F(){let e=this.#t;if(!e)return;let t=Math.min(this.dpr,typeof window<`u`&&window.devicePixelRatio||1),n=Math.max(1,e.clientWidth*t|0),r=Math.max(1,e.clientHeight*t|0);(e.width!==n||e.height!==r)&&(e.width=n,e.height=r)}#I(){if(typeof getComputedStyle!=`function`)return 0;let e=getComputedStyle(this).getPropertyValue(`--ink`).trim();if(!e)return 0;let[t,n,r]=Yr(e,[0,0,0]);return+(.2126*t+.7152*n+.0722*r>.5)}#L(){let e=this.#n,t=this.#t,n=this.#r;if(!e||!t||!n||!this.#a)return;this.#F();let r=performance.now()/1e3-this.#l,i=.5+.5*Math.sin(r*.12),a=.5+.5*Math.sin(r*.097+1),o=.2*(1-i)+.46*i,s=.74*(1-a)+.3*a,c=this.#v,l=this.#g,u=this.#_;e.viewport(0,0,t.width,t.height),e.useProgram(n),e.bindBuffer(e.ARRAY_BUFFER,this.#a),e.enableVertexAttribArray(this.#s),e.vertexAttribPointer(this.#s,2,e.FLOAT,!1,0,0);let d=this.#o;e.uniform2f(d.u_res??null,t.width,t.height),e.uniform1f(d.u_time??null,r),e.uniform1f(d.u_energy??null,this.#u),e.uniform2f(d.u_center??null,o,s),e.uniform3f(d.u_evt??null,u[0],u[1],u[2]),e.uniform1f(d.u_freeze??null,Jr(this.coverage*this.intensity,0,1,.66)*2.2),e.uniform1f(d.u_dark??null,c),e.uniform1f(d.u_scroll??null,this.scrollOffset*Kr/Math.max(1,t.clientHeight||t.height)),e.uniform1f(d.u_falloff??null,.3),e.uniform1f(d.u_life??null,.35),e.uniform3f(d.u_tint??null,l[0],l[1],l[2]),e.uniform1f(d.u_brightness??null,this.brightness),e.uniform1f(d.u_contrast??null,this.contrast),e.uniform1f(d.u_noise??null,this.noise),e.uniform1f(d.u_blur??null,this.blurAmount),e.uniform1f(d.u_speed??null,this.speed),e.drawArrays(e.TRIANGLES,0,3),this.#u*=.95,this.#u<.001&&(this.#u=0)}#R(){return!(this.#h||this.mode===`cone`&&this.speed===0)}#z(e={}){e.burst&&(this.#f=performance.now()+800),!(this.#c||!this.#n||this.#p)&&(this.#c=requestAnimationFrame(this.#B))}#B=e=>{this.#c=0;let t=e<this.#f||this.#u>0;Ar(e,this.#d,t)&&(this.#d=jr(e,this.#d,t),this.#L()),!(this.#h||!this.#R()&&this.#u===0)&&(this.#c=requestAnimationFrame(this.#B))};#V(){this.#c&&cancelAnimationFrame(this.#c),this.#c=0}#H(){let e=this.#n,t=this.#t;if(t&&this.#P(t),e){this.#a&&e.deleteBuffer(this.#a);for(let t of Object.values(this.#i))t&&(e.deleteProgram(t.program),e.deleteShader(t.vs),e.deleteShader(t.fs));e.getExtension(`WEBGL_lose_context`)?.loseContext()}this.#n=null,this.#r=null,this.#i={},this.#o={},this.#a=null,this.#S=null}};A(`slicc-shader`,Xr),A(`slicc-frost-shader`,class extends Xr{connectedCallback(){this.getAttribute(`mode`)!==`freezer`&&this.setAttribute(`mode`,`freezer`),super.connectedCallback()}});var Zr=`# Memory
2942
2942
 
2943
- `,$r=[`**Evidence first:** inspect the smallest relevant surface before editing and record the observed state.`,`**Narrow plans:** keep one measurable outcome, one implementation pass, and one verification pass.`,`**Runtime state:** prefer browser-owned storage and keep the relay stateless whenever practical.`,`**Failure boundaries:** external work needs a timeout, a useful error category, and an explicit retry decision.`,"**Keyboard parity:** interactive rows remain focusable and respond to both `Enter` and `Space`.",`**Memory rendering:** preserve Markdown meaning while sanitizing untrusted tags at the DOM boundary.`,`**Cross-runtime parity:** shared events need matching page, worker, extension, and follower handling.`,`**Verification records:** report the exact command, outcome, and scope instead of writing only “tests pass”.`,`**Synthetic data:** use neutral paths, reserved domains, and conspicuously invented identifiers in fixtures.`,`**Collaboration:** coordinate public-barrel edits before overlapping with another active implementation.`],ei=["Keep the durable rule beside `packages/example.ts` so later work can reproduce the decision without a transcript.",`Preserve selection, expansion, and scroll state when a refresh replaces visible children.`,`Run the focused regression first; broaden to package and repository gates only after the hypothesis holds.`,'Treat A & B, “quoted labels”, arrows →, and `<preview mode="safe">` as text rather than executable markup.',`Prefer a reversible patch over a destructive command when the target was inferred rather than supplied.`,`Stop exploring when another read no longer changes the hypothesis; switch to a test or focused question.`,`Document the invalidation trigger when cached data can become stale, and retain a correctness bypass.`,`Release every listener, timer, observer, channel, and object URL during the matching teardown path.`,`Keep logs to operation name, duration, status, and a synthetic correlation label; omit payload contents.`],ti=$r.flatMap(e=>ei.map(t=>`- ${e} ${t}`)),ni=[`- Keep diffs small.`,`- Prefer native APIs.`,`- Ship docs with code.`,`- No surprise deploys.`,"- **Continuation stress:** preserve one logical memory across source lines,\n carrying `inline-code`, emphasis, and an arrow → without creating another row.",'- **Escaping stress:** render `<preview mode="safe">`, A & B, “quotes”, and `score > threshold` as inert content.',`- **Reserved link:** [the synthetic reference](https://example.invalid/memory) exists only to exercise link rendering.`,`- **Medium tail:** before rebuilding a filtered collection, capture the query, focused control, selected row, group expansion, and scroll anchor; restore only state that still refers to surviving items.`,`- **Long tail:** ${`A long-lived panel decision was reviewed in sequence: a compact sample initially hid scale problems; a larger dataset exposed discarded provenance and summaries cut mid-phrase; Markdown stress then revealed literal markers; keyboard review found pointer-only activation; narrow layouts showed metadata competing with the primary text; refresh testing exposed lost search, focus, expansion, and scroll state; cross-runtime review found a missing follower path; failure testing identified an unbounded request; cleanup testing found a retained observer; and final verification required the focused test, package suite, coverage gate, and build. `.repeat(2).trim()}`,`- **Folded long tail:** a remote action keeps one event contract and preserves error categories across serialization,
2943
+ `,Qr=[`**Evidence first:** inspect the smallest relevant surface before editing and record the observed state.`,`**Narrow plans:** keep one measurable outcome, one implementation pass, and one verification pass.`,`**Runtime state:** prefer browser-owned storage and keep the relay stateless whenever practical.`,`**Failure boundaries:** external work needs a timeout, a useful error category, and an explicit retry decision.`,"**Keyboard parity:** interactive rows remain focusable and respond to both `Enter` and `Space`.",`**Memory rendering:** preserve Markdown meaning while sanitizing untrusted tags at the DOM boundary.`,`**Cross-runtime parity:** shared events need matching page, worker, extension, and follower handling.`,`**Verification records:** report the exact command, outcome, and scope instead of writing only “tests pass”.`,`**Synthetic data:** use neutral paths, reserved domains, and conspicuously invented identifiers in fixtures.`,`**Collaboration:** coordinate public-barrel edits before overlapping with another active implementation.`],$r=["Keep the durable rule beside `packages/example.ts` so later work can reproduce the decision without a transcript.",`Preserve selection, expansion, and scroll state when a refresh replaces visible children.`,`Run the focused regression first; broaden to package and repository gates only after the hypothesis holds.`,'Treat A & B, “quoted labels”, arrows →, and `<preview mode="safe">` as text rather than executable markup.',`Prefer a reversible patch over a destructive command when the target was inferred rather than supplied.`,`Stop exploring when another read no longer changes the hypothesis; switch to a test or focused question.`,`Document the invalidation trigger when cached data can become stale, and retain a correctness bypass.`,`Release every listener, timer, observer, channel, and object URL during the matching teardown path.`,`Keep logs to operation name, duration, status, and a synthetic correlation label; omit payload contents.`],ei=Qr.flatMap(e=>$r.map(t=>`- ${e} ${t}`)),ti=[`- Keep diffs small.`,`- Prefer native APIs.`,`- Ship docs with code.`,`- No surprise deploys.`,"- **Continuation stress:** preserve one logical memory across source lines,\n carrying `inline-code`, emphasis, and an arrow → without creating another row.",'- **Escaping stress:** render `<preview mode="safe">`, A & B, “quotes”, and `score > threshold` as inert content.',`- **Reserved link:** [the synthetic reference](https://example.invalid/memory) exists only to exercise link rendering.`,`- **Medium tail:** before rebuilding a filtered collection, capture the query, focused control, selected row, group expansion, and scroll anchor; restore only state that still refers to surviving items.`,`- **Long tail:** ${`A long-lived panel decision was reviewed in sequence: a compact sample initially hid scale problems; a larger dataset exposed discarded provenance and summaries cut mid-phrase; Markdown stress then revealed literal markers; keyboard review found pointer-only activation; narrow layouts showed metadata competing with the primary text; refresh testing exposed lost search, focus, expansion, and scroll state; cross-runtime review found a missing follower path; failure testing identified an unbounded request; cleanup testing found a retained observer; and final verification required the focused test, package suite, coverage gate, and build. `.repeat(2).trim()}`,`- **Folded long tail:** a remote action keeps one event contract and preserves error categories across serialization,
2944
2944
  terminates pending requests on disconnect, and verifies timeout plus malformed-response behavior,
2945
- while this third source line remains part of the same bullet and contains “quotes”, A & B, and <angle brackets>.`],ri=[...ti,...ni],ii=[[`2099-01-03`,`compaction`],[`2099-01-10`,`new-session`],[`2099-01-18`,`compaction`],[`2099-02-02`,`pending-enrichment`],[`2099-02-14`,`new-session`],[`2099-03-01`,`compaction`],[`2099-03-21`,`pending-enrichment`],[`2099-04-05`,`compaction`],[`2099-04-19`,`new-session`],[`2099-05-07`,`compaction`]];function ai(e,t,n){return`## Auto-extracted (${e}, ${t})\n\n${n.join(`
2946
- `)}\n`}Qr+ii.map(([e,t],n)=>ai(e,t,ri.slice(n*10,n*10+10))).join(`
2947
- `),`${Qr}${ri.join(`
2945
+ while this third source line remains part of the same bullet and contains “quotes”, A & B, and <angle brackets>.`],ni=[...ei,...ti],ri=[[`2099-01-03`,`compaction`],[`2099-01-10`,`new-session`],[`2099-01-18`,`compaction`],[`2099-02-02`,`pending-enrichment`],[`2099-02-14`,`new-session`],[`2099-03-01`,`compaction`],[`2099-03-21`,`pending-enrichment`],[`2099-04-05`,`compaction`],[`2099-04-19`,`new-session`],[`2099-05-07`,`compaction`]];function ii(e,t,n){return`## Auto-extracted (${e}, ${t})\n\n${n.join(`
2946
+ `)}\n`}Zr+ri.map(([e,t],n)=>ii(e,t,ni.slice(n*10,n*10+10))).join(`
2947
+ `),`${Zr}${ni.join(`
2948
2948
  `)}`,[`# Project Northstar`,``,`Role: Kestrel (primary engineering agent)`,`Workspace: /workspaces/northstar`,`Snapshot: 2032-04-18T14:15:51.712Z`,``,`## Operating agreements`,"- **Keep Northstar changes reviewable:** issue #501 requires one concern per branch in `packages/northstar-shell/src/` with fixtures under `/workspaces/northstar/testdata/`; run `keel verify --scope shell` before asking Mina Kestrel for `review_ready` status. The branch note in `packages/northstar-shell/reviews/` explains the user-visible outcome, the measured baseline, and the exact rollback point so another engineer can judge the change without reconstructing the session.","- **Prefer evidence before edits:** issue #502 starts with traces from `packages/telemetry/src/` and a reproduction in `/workspaces/northstar/repros/`; record the failing `trace_id` and the smallest useful `fixture_seed` before changing code. The supporting report in `packages/telemetry/reports/` separates observed behavior from a proposed cause and includes the command, expected result, actual result, and environment assumptions.","- **Use the native release path:** issue #503 sends text-only patches through `packages/release-tools/src/` and stores large binary fixtures in `/workspaces/northstar/artifacts/`; invoke `keel publish --dry-run` and confirm `release_manifest_v3` before upload. The release record in `packages/release-tools/records/` names every artifact, its content digest, the verification run that produced it, and the person who approved promotion.","- **Never merge on assumption:** issue #504 leaves the candidate in `packages/change-gate/src/` until `/workspaces/northstar/reviews/` contains an explicit approval; use `keel review status` and preserve the requested `merge_strategy`. The decision log in `packages/change-gate/decisions/` states whether history must remain linear and whether a reviewer requested a merge commit for audit context.",``,`## Repository and release workflow`,"- **Branch from the verified base:** issue #505 creates work in `packages/release-tools/branches/` and writes the base proof to `/workspaces/northstar/checkpoints/`; `keel branch create` must report the expected `base_oid`. The branch receipt in `packages/release-tools/receipts/` also captures the remote name and fetch time, which makes stale-base failures obvious during review.","- **Rebase only when linear history is required:** issue #506 keeps merge-preserving work in `packages/change-gate/policies/` and conflict notes in `/workspaces/northstar/reviews/`; choose `merge_commit` or `linear_rebase` from the recorded policy, never from habit. Guidance under packages/change-gate/guides/rebase/ requires a fresh verification run after conflict resolution because a clean textual rebase does not prove unchanged behavior.","- **Treat remote deletion as a gated operation:** issue #507 resolves the exact ref through `packages/release-tools/refs/` and snapshots it in `/workspaces/northstar/checkpoints/`; call `keel ref delete --confirm` only after `ref_guard` matches. The recovery note under packages/release-tools/guides/restore/ retains the deleted object identifier and a tested restore command until the review window closes.",``,`## Aurora renderer bootstrap — desktop preview (Session April 02)`,"- **Create the preview shell:** issue #508 keeps the host in `packages/aurora-preview/src/` and its deterministic scene data in `/workspaces/northstar/fixtures/aurora/`; start `keel preview aurora` with `scene_seed_2048`. A walkthrough under packages/aurora-preview/guides/startup/ lists the expected loading, ready, degraded, and failed states so reviewers know whether the shell or renderer owns a defect.","- **Load the renderer through its public package:** issue #509 imports `@northstar/aurora` from `/workspaces/northstar/apps/desktop/` and pins `aurora_protocol_v6`; the preview must not reach the private `renderer_singleton`. Contract notes under packages/aurora-preview/guides/contracts/ describe the mount lifecycle and require the host to release observers, workers, and object URLs during teardown.","- **Keep browser and desktop entry points equivalent:** issue #510 compares `packages/aurora-preview/browser/` with `/workspaces/northstar/apps/desktop/`; both expose `mountAuroraPreview` and accept `preview_transport`. Parity evidence under packages/aurora-preview/reviews/parity/ records the same scene, viewport, theme, keyboard path, and frame checksum for each host.","- **Pass viewer identity without personal data:** issue #511 reads `packages/aurora-preview/config/` and `/workspaces/northstar/fixtures/viewers/`; use `viewer_alpha` plus `tenant_sandbox`, never an account copied from production. The fixture catalog under packages/aurora-preview/fixtures/viewers/ explains each synthetic role and deliberately omits names, credentials, message history, and customer content.","- **Document the development-only compositor:** the guide in `packages/aurora-preview/docs/` points to `/workspaces/northstar/examples/compositor/`; `keel preview --inspect` exposes `frame_budget_ms` for local diagnosis. The inspector reports dropped frames, long tasks, active workers, and selected fallback mode without changing the scheduling decisions being measured.","- **Bundle Aurora without runtime network fetches:** build `packages/aurora-preview/bundle/` into `/workspaces/northstar/artifacts/aurora/` with `rook bundle --target desktop`; the output registers `aurora_bundle_hash` and embeds shader tables, icon atlases, locale data, fallback fonts, protocol schemas, worker bootstrap code, source labels, feature defaults, accessibility metadata, safe demo accounts, and the exact scene seed used by review. The host imports one local module, validates the manifest before evaluation, rejects unknown capabilities, records a structured startup trace, and keeps every optional adapter behind a capability check. When the packager rewrites an external import, inspect the emitted dependency map rather than adding a global shim. The accepted bundle must boot with the network disabled, survive a renderer restart, restore the selected scene, preserve focus order, report missing GPU features as a visible diagnostic, and produce the same frame checksum in Chromium and the desktop shell. Store the checksum beside the manifest, not in application code, so a fixture update is reviewable without touching runtime behavior.","- **Aurora offline recovery drill for the desktop preview** uses `packages/aurora-preview/fallback/` and `/workspaces/northstar/apps/desktop/assets/` with `aurora_fallback_entry` after `gpu_probe_result` records unsupported adapter evidence then the host verifies the local manifest restores the selected scene preserves keyboard focus retains the review viewport loads bundled fonts rejects network requests emits a visible diagnostic stores the frame checksum beside the artifact compares browser and desktop output keeps the original trace identifier and leaves the normal renderer untouched for the next controlled restart",``,`## Signal audio service — capture and transcription pipeline`,"- **Keep voice fixtures synthetic:** write generated samples to `packages/signal-audio/fixtures/` and metadata to `/workspaces/northstar/testdata/audio/`; select `signal_voice_cedar` with `sample_rate_24000`. The catalog under packages/signal-audio/guides/fixtures/ states how each sample was generated and which timing, silence, overlap, and clipping cases it is meant to exercise.","- **Resolve credentials through the fixture broker:** configure `packages/signal-audio/auth/` from `/workspaces/northstar/config/local/`; `keel secret lease signal` returns `signal_lease_ref` without exposing token material. The runbook under packages/signal-audio/guides/auth/ distinguishes a missing lease, an expired lease, provider denial, and an unavailable broker so recovery remains specific.","- **Use the streaming endpoint for long utterances:** send chunks from `packages/signal-audio/stream/` through `/workspaces/northstar/repros/audio/`; the client tracks `utterance_seq` and rejects a stale `transcript_epoch`. Evidence under packages/signal-audio/reviews/streaming/ includes chunk timing and final ordering, making dropped, duplicated, and late frames visible without retaining spoken content.","- **Preserve binary audio until decoding succeeds:** `packages/signal-audio/codecs/` writes to `/workspaces/northstar/artifacts/audio/`; `signal_decode_pcm` returns `decoded_frame_count` before text normalization. Notes under packages/signal-audio/guides/codecs/ require the original byte length, channel count, sample rate, and decoder warning before any waveform is discarded.",``,`## Harbor control-plane CLI (Session April 05, #401)`,"- **Define Harbor as a thin API client:** keep commands in `packages/harbor-cli/src/` and contract fixtures in `/workspaces/northstar/testdata/harbor/`; `harbor project list` emits `harbor_result_v2`. This boundary keeps command behavior easy to inspect, lets the service remain the source of truth, and gives every failure one clear place for diagnosis.","- **Store only a broker reference:** `packages/harbor-cli/auth/` reads `/workspaces/northstar/config/local/`; `harbor auth login` persists `credential_handle`, never a bearer value. A later command can ask the broker for a short lease while the terminal, history, trace, and saved configuration remain free of secret material.","- **Normalize boolean flags at the boundary:** `packages/harbor-cli/args/` tests `/workspaces/northstar/repros/harbor/`; `--include-paused=false` becomes `include_paused` rather than a truthy string. The same rule covers an omitted flag, an explicit true value, and a false value so script behavior does not depend on parser accident.","- **Do not edit remote files with shell redirection:** fetch through `packages/harbor-cli/files/` into `/workspaces/northstar/checkpoints/`; `harbor file replace` validates `remote_etag` before committing. The client first writes a complete local draft, shows a compact difference, and sends the whole document only after the expected revision still matches.","- **Read structured responses before printing:** `packages/harbor-cli/output/` stores schemas under `/workspaces/northstar/testdata/schemas/`; `harbor --format json` preserves `error_code` and nested causes. Human output may become shorter, but machine output must retain every field needed for retry, support, audit, and a later automated decision.","- **Refresh expired leases once:** `packages/harbor-cli/retry/` records attempts in `/workspaces/northstar/traces/`; `harbor_lease_expired` may trigger one `credential_refresh`, not a loop. A second denial is returned with the first request identity and lease age so the operator sees a stable failure rather than repeated login work.","- **Map provider failures to actionable hints:** `packages/harbor-cli/errors/` uses `/workspaces/northstar/docs/runbooks/`; `deployment_policy_denied` points to `harbor deployment inspect`. Each hint names the blocked resource, the required capability, and a safe read-only command that can confirm policy state before any new request.",``,`## Atlas runtime and plugin packaging (Session April 07, #418)`,"- **Build Atlas from a readable entry module:** `packages/atlas-runtime/src/` produces `/workspaces/northstar/artifacts/atlas/`; `rook build atlas` keeps `atlas_entrypoint` stable. The entry names each adapter and capability in one visible table, which makes bundle review possible without following generated glue across many small files.","- **Install plugins into an isolated sandbox:** `packages/atlas-runtime/plugins/` expands under `/workspaces/northstar/sandboxes/atlas/`; `atlas plugin inspect` verifies `plugin_manifest_v4`. Extraction rejects parent traversal, absolute names, duplicate entries, and unsupported links before any plugin code can observe the host or write outside its assigned directory.","- **Share filesystem adapters across hosts:** `packages/atlas-runtime/adapters/` is tested against `/workspaces/northstar/testdata/files/`; `atlas_read_bytes` and `atlas_write_atomic` retain binary data. Browser and desktop implementations must agree on path normalization, missing file behavior, atomic replacement, permission denial, and the byte count returned after a write.","- **Externalize host-owned modules:** `packages/atlas-runtime/build/` writes `/workspaces/northstar/artifacts/maps/`; `rook bundle --external host` marks `host_module_table` in the manifest. The loader resolves only names declared by that table and reports an absent host module before plugin startup rather than after partial state has changed.","- **Preserve integer field types during schema conversion:** `packages/atlas-runtime/schema/` compares `/workspaces/northstar/testdata/events/`; `packet_sequence` stays numeric in `atlas_event_v3`. The conversion test also covers zero, the largest safe value, a missing optional field, and an invalid string so type loss cannot hide in ordinary data.","- **Treat unknown extensions as data:** `packages/atlas-runtime/loader/` copies `/workspaces/northstar/fixtures/plugins/`; `atlas_load_module` uses `declared_media_type` instead of filename guessing. This permits a host to choose the correct evaluator while an untrusted plugin cannot change execution mode by selecting a familiar suffix.","- **Verify large artifacts through content hashes:** `packages/atlas-runtime/cache/` indexes `/workspaces/northstar/artifacts/atlas/`; `atlas artifact verify` checks `sha256_digest` before activation. Size and digest are checked after download and again before load, with one clear error that names which step observed an unexpected value.","- **Detect build drift against one canonical artifact:** `packages/atlas-runtime/ci/` reads `/workspaces/northstar/checkpoints/builds/`; `keel drift atlas` compares `canonical_bundle_id` rather than tool banners. A green result means the committed artifact matches the verified build output, not merely that two tools printed a similar version name.",``,`## Relay deployment automation (Session April 09, #433)`,"- **Acquire deployment credentials per operation:** `packages/relay-deploy/auth/` resolves `/workspaces/northstar/config/relay/`; `relay credential lease` returns `relay_lease_id`. The lease is bound to one provider and action, expires quickly, and can be revoked without changing local configuration or any unrelated deployment session.","- **Use immutable release descriptors:** `packages/relay-deploy/manifests/` publishes `/workspaces/northstar/artifacts/releases/`; `relay deploy plan` pins `release_descriptor_sha`. Review therefore covers the exact image, configuration, migration, and rollback input that promotion will consume rather than a mutable branch or floating tag.","- **Model provider capabilities explicitly:** `packages/relay-deploy/providers/` tests `/workspaces/northstar/testdata/providers/`; `provider_capability_set` prevents unsupported preview creation. A plan can explain which feature is absent and offer a compatible path before it asks a remote service to begin work.","- **Write remote documents atomically:** `packages/relay-deploy/files/` stages `/workspaces/northstar/checkpoints/remote/`; `relay file put` requires `expected_revision`. This prevents a short replacement from leaving stale tail content and prevents a concurrent operator from losing a newer remote change.","- **Keep retry policy narrow:** `packages/relay-deploy/retry/` reads `/workspaces/northstar/docs/runbooks/`; `relay_retryable_error` excludes policy denials and invalid manifests. Delay includes a firm attempt limit and a stable request identity so a temporary transport fault cannot become duplicate provider work.","- **Promote the artifact already tested:** `packages/relay-deploy/promote/` selects `/workspaces/northstar/artifacts/releases/`; `relay promote` verifies `tested_artifact_sha`. The command refuses a rebuild during promotion because even an equivalent source revision can yield a different dependency graph or bundle digest.",``,`## Orbit browser collaboration (Session April 11, #447)`,"- **Represent each shared tab as an Orbit room:** `packages/orbit-collab/rooms/` persists `/workspaces/northstar/testdata/orbit/`; `orbit room create` returns `room_epoch` and `participant_slot`. Room identity stays stable across transport replacement, while a new epoch makes every participant reject late state from a connection that no longer owns the session.","- **Send cursor updates as replaceable state:** `packages/orbit-collab/presence/` replays `/workspaces/northstar/fixtures/presence/`; `orbit_presence_v5` coalesces superseded coordinates. Presence may be lost without harming the document because the next update replaces it, which keeps interaction smooth under delay without building an unbounded queue.","- **Keep durable messages separate from presence:** `packages/orbit-collab/messages/` writes `/workspaces/northstar/checkpoints/orbit/`; `orbit message append` assigns `message_sequence`. A message is acknowledged only after durable storage, and replay begins after the highest sequence already seen so reconnect cannot create a duplicate conversation entry.","- **Recover from a stale browser execution context:** `packages/orbit-collab/browser/` logs `/workspaces/northstar/traces/orbit/`; `orbit context renew` increments `context_generation`. The old context is detached before a new observer is added, preventing both generations from sending navigation and focus events for the same visible tab.","- **Capture collaboration evidence through the public surface:** `packages/orbit-collab/qa/` stores `/workspaces/northstar/artifacts/screens/`; `keel orbit snapshot` records `active_room_id`. Review uses the same controls available to a person, then records visible member state, selected room, pending draft, and transport health beside the image.","- **Preserve pending input during reconnect:** `packages/orbit-collab/drafts/` tests `/workspaces/northstar/repros/reconnect/`; `draft_revision` survives one `transport_rebind`. The draft remains local until send succeeds, and a successful acknowledgement clears only the revision that was actually delivered rather than newer text still being edited.",``,`## Incident review — reconnect storm (Session April 12)`,"- **Root cause was competing transport owners:** `packages/orbit-collab/transport/` and `/workspaces/northstar/repros/reconnect/` both advanced `room_epoch`; the fix elects one `transport_owner`. The incident began when a browser wake event and a network return event each created a connection before either could observe the other.","- **The retry loop hid the first useful error:** `packages/orbit-collab/retry/` now records `/workspaces/northstar/traces/incidents/`; `first_failure_code` is retained in `reconnect_report`. Later timeout noise remains available in the trace, but the summary leads with the event that first moved the room away from healthy state.","- **Recovery must preserve the draft and selected room:** `packages/orbit-collab/state/` replays `/workspaces/northstar/fixtures/recovery/`; `orbit_recover_state` restores `active_room_id`. The acceptance check covers unsent text, keyboard focus, scroll position, participant order, and exactly one successful delivery after transport recovery.",``,`## Mobile companion sync (Session April 14, #462)`,"- **Pair the companion with an ephemeral code:** `packages/mobile-sync/pairing/` verifies `/workspaces/northstar/testdata/pairing/`; `mobile_pair_code` expires with `pairing_epoch`. Approval shows the synthetic device name and requested capability before either side accepts, and cancellation invalidates the code immediately rather than waiting for normal expiry.","- `packages/mobile-sync/outbox/` mirrors `/workspaces/northstar/fixtures/offline/`; `mobile_outbox_flush` preserves ordering after a network transition. Each item carries a local sequence and stable identity, so a retry can continue after the last acknowledgement without losing or repeating an action.","- `packages/mobile-sync/media/` writes `/workspaces/northstar/artifacts/mobile/`; `mobile_media_chunk` carries a checksum before upload. The receiver verifies every chunk before assembly and reports the first damaged range, which permits a narrow retry instead of sending the complete recording again.","- `packages/mobile-sync/notifications/` reads `/workspaces/northstar/testdata/push/`; `notification_dedupe_key` prevents duplicate alerts after resume. Foreground delivery updates visible state without another banner, while background delivery presents one alert that opens the exact room named by the event.","- `packages/mobile-sync/state/` compares `/workspaces/northstar/checkpoints/mobile/`; `mobile_state_merge` rejects an older `device_epoch`. Merge keeps local draft content, accepts newer durable state, and records a conflict when both sides changed the same preference after their common revision.","- `packages/mobile-sync/diagnostics/` exports `/workspaces/northstar/traces/mobile/`; `mobile_diag_bundle` removes payload text but keeps timing. The bundle includes version, platform, connection change, queue depth, retry count, and state generation so support can reason about order without reading user content.","- `packages/mobile-sync/accessibility/` tests `/workspaces/northstar/fixtures/a11y/`; `focus_restore_target` survives a view rebuild. The check follows pairing, room choice, draft entry, send, background, and resume with a keyboard so focus order is verified through a complete task.","- `packages/mobile-sync/release/` stages `/workspaces/northstar/artifacts/mobile/`; `mobile_release_channel` defaults to the review track. Promotion requires the same signed archive that passed device smoke review, with no rebuild or configuration change between approval and publication.","- `packages/mobile-sync/qa/` records `/workspaces/northstar/reviews/mobile/`; `mobile_smoke_matrix` covers offline launch, resume, and re-pairing. Each case states the initial network and account state, the exact action, the visible result, and the durable state expected after another launch.",``,`## Release readiness (Session April 16)`,"- `packages/release-checks/lint/` scans `/workspaces/northstar/checkpoints/release/`; `keel verify lint` writes `lint_run_id` for the candidate. Review links that identity rather than a copied summary so any warning, formatter change, or excluded file remains visible in its original context.","- `packages/release-checks/types/` scans `/workspaces/northstar/checkpoints/release/`; `keel verify types` records `type_graph_hash`. A later source or dependency change invalidates that graph and requires another check before the candidate can share the earlier result.","- `packages/release-checks/tests/` reads `/workspaces/northstar/testdata/`; `keel verify tests` stores `test_matrix_id`. The matrix names every package, host, browser, and fixture group that ran, making an omitted surface as visible as a failed assertion.","- `packages/release-checks/coverage/` reads `/workspaces/northstar/artifacts/coverage/`; `keel verify coverage` compares `coverage_floor_set`.","- `packages/release-checks/build/` emits `/workspaces/northstar/artifacts/builds/`; `keel verify build` stamps `bundle_manifest_sha`.","- `packages/release-checks/smoke/` stores `/workspaces/northstar/reviews/smoke/`; `keel verify smoke` requires `reviewer_ack`.",``,`## Durable project reference`,``,`### People and product context`,"- Mina Kestrel leads Northstar product engineering; the synthetic team directory lives in `packages/project-context/people/` and uses `mina_kestrel` plus `product_lead`.","- Oren Vale owns the Aurora renderer; notes in `packages/project-context/people/` use `oren_vale` and `rendering_owner`.","- Jules Rowan owns Harbor and Relay; entries in `packages/project-context/people/` use `jules_rowan` and `control_plane_owner`.","- Nia Ember owns Signal audio; records in `packages/project-context/people/` use `nia_ember` and `audio_owner`.","- Kestrel is the primary engineering agent; `/workspaces/northstar/agents/` maps `agent_kestrel` to `northstar_generalist`.","- Northstar is a fictional collaborative desktop environment; `/workspaces/northstar/docs/` defines `northstar_product` and `desktop_collaboration`.","- Aurora renders local workspaces and review scenes; `/workspaces/northstar/docs/` defines `aurora_renderer` and `scene_protocol_v6`.","- Atlas hosts sandboxed extensions; `/workspaces/northstar/docs/` defines `atlas_runtime` and `plugin_manifest_v4`.","- Harbor manages control-plane resources; `/workspaces/northstar/docs/` defines `harbor_cli` and `harbor_result_v2`.","- Relay promotes verified artifacts; `/workspaces/northstar/docs/` defines `relay_deploy` and `release_descriptor_sha`.","- Orbit synchronizes shared browser state; `/workspaces/northstar/docs/` defines `orbit_collab` and `room_epoch`.","- Signal captures and transcribes synthetic audio; `/workspaces/northstar/docs/` defines `signal_audio` and `utterance_seq`.","- Keel is the repository and verification CLI; `/workspaces/northstar/docs/` defines `keel_cli` and `verification_run`.","- Rook is the deterministic package builder; `/workspaces/northstar/docs/` defines `rook_builder` and `bundle_manifest`.","- The demo tenant is always synthetic; `/workspaces/northstar/fixtures/` uses `tenant_sandbox` and `viewer_alpha`.","- Review accounts use the reserved invalid domain; `/workspaces/northstar/fixtures/` stores `mina@example.invalid` and `oren@example.invalid`.","- Dates and identifiers describe an invented future project; `/workspaces/northstar/docs/` labels `fixture_provenance` and `synthetic_only`.","- Product decisions favor understandable failure states; `/workspaces/northstar/docs/` records `visible_diagnostics` and `recoverable_actions`.",``,`### Engineering preferences`,"- Keep each review branch narrow; `/workspaces/northstar/reviews/` records `change_scope` and `review_owner`.","- Prefer native text patches for source changes; `/workspaces/northstar/checkpoints/` records `patch_digest` and `base_oid`.","- Wait on CI through the supported command; `/workspaces/northstar/checkpoints/` stores `verification_run` and `final_status`.","- Never commit credential material; `/workspaces/northstar/config/` contains `credential_handle` and `lease_expiry` only.","- Require explicit confirmation before production promotion; `/workspaces/northstar/reviews/` stores `promotion_approval` and `rollback_plan`.","- Reproduce failures before changing a workaround; `/workspaces/northstar/repros/` stores `fixture_seed` and `first_failure_code`.","- Diagnose invisible failures with traffic and state metrics; `/workspaces/northstar/traces/` tracks `request_count` and `state_generation`.","- Use exact units instead of ambiguous shorthand; `/workspaces/northstar/docs/` prefers `approximately` and `milliseconds`.","- Keep secrets inside the broker boundary; `/workspaces/northstar/config/` exposes `credential_handle` and `provider_scope`.","- Report regressions with measured before and after values; `/workspaces/northstar/reviews/` records `baseline_metric` and `candidate_metric`.",``,`### Repository and verification map`,"- The monorepo root is `/workspaces/northstar/`; `packages/northstar-shell` contains the desktop host and `keel verify shell` is its focused gate.","- Aurora lives in `/workspaces/northstar/packages/`; `@northstar/aurora` is the public package and `aurora_protocol_v6` is the renderer contract.","- Atlas lives in `/workspaces/northstar/packages/`; `@northstar/atlas-runtime` owns plugin loading and `plugin_manifest_v4` is its schema.","- Harbor and Relay live in `/workspaces/northstar/packages/`; `@northstar/harbor-cli` owns commands and `release_descriptor_sha` identifies promotion input.","- Orbit and Signal live in `/workspaces/northstar/packages/`; `@northstar/orbit-collab` owns shared state and `utterance_seq` orders audio text.","- All synthetic fixtures live in `/workspaces/northstar/testdata/`; `keel verify fixtures` checks privacy and `fixture_provenance` marks their source.",``,`### Infrastructure and operations`,"- The local control plane uses `/workspaces/northstar/config/`; `harbor_local_profile` selects the sandbox and `credential_handle` references broker state.","- Preview artifacts use `/workspaces/northstar/artifacts/`; `aurora_bundle_hash` identifies the renderer and `canonical_bundle_id` drives drift checks.","- Deployment manifests use `/workspaces/northstar/artifacts/`; `release_descriptor_sha` pins content and `tested_artifact_sha` gates promotion.","- Collaboration traces use `/workspaces/northstar/traces/`; `room_epoch` identifies a session and `context_generation` identifies browser renewal.","- Mobile diagnostics use `/workspaces/northstar/traces/`; `mobile_diag_bundle` strips content and `device_epoch` orders state.","- Incident runbooks use `/workspaces/northstar/docs/`; `first_failure_code` names the initiating fault and `rollback_plan` names recovery.","- Review evidence uses `/workspaces/northstar/reviews/`; `baseline_metric` and `candidate_metric` keep UI judgments quantitative.","- Production promotion remains disabled in this fixture; `/workspaces/northstar/config/` sets `production_enabled` false and `tenant_sandbox` as the only tenant."].join(`
2949
- `)+``;var oi=new Set([`user`,`feedback`,`project`]),si={user:{hue:`--rose`,label:`user`},feedback:{hue:`--cyan`,label:`feedback`},project:{hue:`--violet`,label:`project`}};function ci(e){return e===`feedback`||e===`project`?e:`user`}var li=M(`
2949
+ `)+``;var ai=new Set([`user`,`feedback`,`project`]),oi={user:{hue:`--rose`,label:`user`},feedback:{hue:`--cyan`,label:`feedback`},project:{hue:`--violet`,label:`project`}};function si(e){return e===`feedback`||e===`project`?e:`user`}var ci=M(`
2950
2950
  :host {
2951
2951
  display: inline-flex;
2952
2952
  vertical-align: middle;
@@ -2968,13 +2968,13 @@ void main(){
2968
2968
  background: color-mix(in srgb, var(--mtag-hue, var(--rose)) var(--mtag-fill), var(--canvas));
2969
2969
  border: 1px solid color-mix(in srgb, var(--mtag-hue, var(--rose)) var(--mtag-border), var(--line));
2970
2970
  }
2971
- `),ui=`slicc-memtag-dark`,di=`
2971
+ `),li=`slicc-memtag-dark`,ui=`
2972
2972
  .dark slicc-memtag,
2973
2973
  [data-theme="dark"] slicc-memtag {
2974
2974
  --mtag-fill: 22%;
2975
2975
  --mtag-border: 38%;
2976
2976
  }
2977
- `;function fi(e){if(e.getElementById(ui))return;let t=e.createElement(`style`);t.id=ui,t.textContent=di,(e.head??e.documentElement).appendChild(t)}A(`slicc-memtag`,class extends HTMLElement{static observedAttributes=[`type`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[li]}connectedCallback(){fi(this.ownerDocument),this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get type(){return ci(this.getAttribute(`type`))}set type(e){this.setAttribute(`type`,oi.has(e)?e:`user`)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let{hue:e,label:t}=si[this.type],n=this.label??j(`slot`,null,t),r=j(`span`,{class:`mtag`,part:`tag`,style:`--mtag-hue:var(${e})`},n);this.#e.replaceChildren(r)}});var pi=`
2977
+ `;function di(e){if(e.getElementById(li))return;let t=e.createElement(`style`);t.id=li,t.textContent=ui,(e.head??e.documentElement).appendChild(t)}A(`slicc-memtag`,class extends HTMLElement{static observedAttributes=[`type`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ci]}connectedCallback(){di(this.ownerDocument),this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get type(){return si(this.getAttribute(`type`))}set type(e){this.setAttribute(`type`,ai.has(e)?e:`user`)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let{hue:e,label:t}=oi[this.type],n=this.label??j(`slot`,null,t),r=j(`span`,{class:`mtag`,part:`tag`,style:`--mtag-hue:var(${e})`},n);this.#e.replaceChildren(r)}});var fi=`
2978
2978
  slicc-memrow {
2979
2979
  display: block;
2980
2980
  border: 1px solid var(--line);
@@ -3081,7 +3081,7 @@ slicc-memrow.fresh {
3081
3081
  background: color-mix(in srgb, var(--violet) 22%, var(--canvas));
3082
3082
  border-color: color-mix(in srgb, var(--violet) 38%, var(--line));
3083
3083
  }
3084
- `,mi=`slicc-memrow-style`,hi=96,gi=12;function _i(e,t){if(e.length<=hi)return{heading:e,summary:t};let n=e.slice(0,97).lastIndexOf(` `),r=n>=gi?n:hi,i=e.slice(r).trim();return{heading:e.slice(0,r).trim(),summary:[i,t].filter(Boolean).join(` `)}}function vi(e){if(e.getElementById(mi))return;let t=e.createElement(`style`);t.id=mi,t.textContent=pi,(e.head??e.documentElement).appendChild(t)}function yi(e){return e===`feedback`||e===`project`?e:`user`}A(`slicc-memrow`,class extends HTMLElement{static get observedAttributes(){return[`heading`,`summary`,`tag`,`fresh`,`expanded`]}#e=!1;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=0;#c=!1;#l=!1;#u=null;#d=null;#f=null;connectedCallback(){vi(this.ownerDocument),this.#e||this.#p(),this.#m(),this.#y(),this.#h()}disconnectedCallback(){this.#b(),this.#o?.disconnect(),this.#o=null,this.#s&&cancelAnimationFrame(this.#s),this.#s=0}attributeChangedCallback(){this.#e&&this.#m()}get heading(){return this.getAttribute(`heading`)??``}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get summary(){return this.getAttribute(`summary`)??``}set summary(e){e==null?this.removeAttribute(`summary`):this.setAttribute(`summary`,e)}get tag(){return yi(this.getAttribute(`tag`))}set tag(e){this.setAttribute(`tag`,e)}get fresh(){return this.hasAttribute(`fresh`)}set fresh(e){this.toggleAttribute(`fresh`,e)}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}setHeadingContent(e){this.#c=!0,this.#n?this.#n.replaceChildren(e):this.#u=e}setBodyContent(e){this.#l=!0,this.#i?this.#i.replaceChildren(e):this.#d=e,this.#g()}#p(){this.#e=!0;let e=this.ownerDocument.createElement(`button`);e.className=`mt`,e.type=`button`;let t=this.ownerDocument.createElement(`b`),n=this.ownerDocument.createElement(`slicc-memtag`);e.append(t,n);let r=this.ownerDocument.createElement(`div`);for(r.className=`ms`;this.firstChild;)r.appendChild(this.firstChild);this.#u&&t.replaceChildren(this.#u),this.#d&&r.replaceChildren(this.#d),this.#u=null,this.#d=null,this.append(e,r),this.#t=e,this.#n=t,this.#r=n,this.#i=r}#m(){let e=this.#n,t=this.#r,n=this.#i;if(!e||!t||!n)return;let r=_i(this.heading,this.summary);this.#c||(e.textContent=r.heading);let i=this.tag;if(t.className=``,t.hidden=!this.hasAttribute(`tag`),t.setAttribute(`type`,i),t.textContent=``,!this.#l){let e=n.firstChild,t=r.summary;e&&e.nodeType===Node.TEXT_NODE?e.textContent=t:t&&n.insertBefore(this.ownerDocument.createTextNode(t),e)}this.classList.toggle(`fresh`,this.fresh),this.#v(),this.#g()}#h(){let e=this.#i;!e||this.#o||(this.#o=new ResizeObserver(()=>this.#g()),this.#o.observe(e),this.#g())}#g(){!this.isConnected||this.expanded||(this.#s&&cancelAnimationFrame(this.#s),this.#s=requestAnimationFrame(()=>{this.#s=0;let e=this.#i;!e||this.expanded||(e.scrollHeight>e.clientHeight+1?this.#_():this.#a?.remove(),this.#v())}))}#_(){if(!this.#a){let e=this.ownerDocument.createElement(`button`);e.className=`mexpand`,e.type=`button`,e.addEventListener(`click`,e=>{e.stopPropagation(),this.expanded=!this.expanded}),this.#a=e}this.#a.isConnected||this.append(this.#a)}#v(){let e=this.#a;if(!e?.isConnected)return;let t=this.expanded;e.textContent=t?`Show less`:`Show more`,e.setAttribute(`aria-expanded`,String(t))}#y(){this.#f||(this.#f=e=>this.#x(e),this.addEventListener(`click`,this.#f))}#b(){this.#f&&=(this.removeEventListener(`click`,this.#f),null)}#x(e){this.dispatchEvent(new CustomEvent(`select`,{bubbles:!0,composed:!0,detail:{heading:this.heading,summary:this.summary,tag:this.tag,sourceEvent:e}}))}});var bi=`
3084
+ `,pi=`slicc-memrow-style`,mi=96,hi=12;function gi(e,t){if(e.length<=mi)return{heading:e,summary:t};let n=e.slice(0,97).lastIndexOf(` `),r=n>=hi?n:mi,i=e.slice(r).trim();return{heading:e.slice(0,r).trim(),summary:[i,t].filter(Boolean).join(` `)}}function _i(e){if(e.getElementById(pi))return;let t=e.createElement(`style`);t.id=pi,t.textContent=fi,(e.head??e.documentElement).appendChild(t)}function vi(e){return e===`feedback`||e===`project`?e:`user`}A(`slicc-memrow`,class extends HTMLElement{static get observedAttributes(){return[`heading`,`summary`,`tag`,`fresh`,`expanded`]}#e=!1;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=0;#c=!1;#l=!1;#u=null;#d=null;#f=null;connectedCallback(){_i(this.ownerDocument),this.#e||this.#p(),this.#m(),this.#y(),this.#h()}disconnectedCallback(){this.#b(),this.#o?.disconnect(),this.#o=null,this.#s&&cancelAnimationFrame(this.#s),this.#s=0}attributeChangedCallback(){this.#e&&this.#m()}get heading(){return this.getAttribute(`heading`)??``}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get summary(){return this.getAttribute(`summary`)??``}set summary(e){e==null?this.removeAttribute(`summary`):this.setAttribute(`summary`,e)}get tag(){return vi(this.getAttribute(`tag`))}set tag(e){this.setAttribute(`tag`,e)}get fresh(){return this.hasAttribute(`fresh`)}set fresh(e){this.toggleAttribute(`fresh`,e)}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}setHeadingContent(e){this.#c=!0,this.#n?this.#n.replaceChildren(e):this.#u=e}setBodyContent(e){this.#l=!0,this.#i?this.#i.replaceChildren(e):this.#d=e,this.#g()}#p(){this.#e=!0;let e=this.ownerDocument.createElement(`button`);e.className=`mt`,e.type=`button`;let t=this.ownerDocument.createElement(`b`),n=this.ownerDocument.createElement(`slicc-memtag`);e.append(t,n);let r=this.ownerDocument.createElement(`div`);for(r.className=`ms`;this.firstChild;)r.appendChild(this.firstChild);this.#u&&t.replaceChildren(this.#u),this.#d&&r.replaceChildren(this.#d),this.#u=null,this.#d=null,this.append(e,r),this.#t=e,this.#n=t,this.#r=n,this.#i=r}#m(){let e=this.#n,t=this.#r,n=this.#i;if(!e||!t||!n)return;let r=gi(this.heading,this.summary);this.#c||(e.textContent=r.heading);let i=this.tag;if(t.className=``,t.hidden=!this.hasAttribute(`tag`),t.setAttribute(`type`,i),t.textContent=``,!this.#l){let e=n.firstChild,t=r.summary;e&&e.nodeType===Node.TEXT_NODE?e.textContent=t:t&&n.insertBefore(this.ownerDocument.createTextNode(t),e)}this.classList.toggle(`fresh`,this.fresh),this.#v(),this.#g()}#h(){let e=this.#i;!e||this.#o||(this.#o=new ResizeObserver(()=>this.#g()),this.#o.observe(e),this.#g())}#g(){!this.isConnected||this.expanded||(this.#s&&cancelAnimationFrame(this.#s),this.#s=requestAnimationFrame(()=>{this.#s=0;let e=this.#i;!e||this.expanded||(e.scrollHeight>e.clientHeight+1?this.#_():this.#a?.remove(),this.#v())}))}#_(){if(!this.#a){let e=this.ownerDocument.createElement(`button`);e.className=`mexpand`,e.type=`button`,e.addEventListener(`click`,e=>{e.stopPropagation(),this.expanded=!this.expanded}),this.#a=e}this.#a.isConnected||this.append(this.#a)}#v(){let e=this.#a;if(!e?.isConnected)return;let t=this.expanded;e.textContent=t?`Show less`:`Show more`,e.setAttribute(`aria-expanded`,String(t))}#y(){this.#f||(this.#f=e=>this.#x(e),this.addEventListener(`click`,this.#f))}#b(){this.#f&&=(this.removeEventListener(`click`,this.#f),null)}#x(e){this.dispatchEvent(new CustomEvent(`select`,{bubbles:!0,composed:!0,detail:{heading:this.heading,summary:this.summary,tag:this.tag,sourceEvent:e}}))}});var yi=`
3085
3085
  slicc-memory-panel{display:flex;flex-direction:column;min-height:0;overflow:hidden;background:var(--canvas);color:var(--ink);font-family:var(--ui)}
3086
3086
  slicc-memory-panel .mp-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:12px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--canvas) 94%,var(--violet))}
3087
3087
  slicc-memory-panel .mp-search{display:flex;align-items:center;min-width:0;border:1px solid var(--line);border-radius:10px;background:var(--canvas);padding:0 10px}
@@ -3114,7 +3114,7 @@ slicc-memory-panel .mp-rows{padding:0;border-top:0}
3114
3114
  slicc-memory-panel slicc-memrow{border:0;border-radius:0;border-top:1px solid var(--line);margin:0;padding:7px 12px}
3115
3115
  slicc-memory-panel slicc-memrow .mt b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
3116
3116
  slicc-memory-panel slicc-memrow .ms{-webkit-line-clamp:1;margin-top:2px;font-size:11px}
3117
- `,xi=`slicc-memory-panel-style`;function Si(e){if(e.getElementById(xi))return;let t=e.createElement(`style`);t.id=xi,t.textContent=bi,(e.head??e.documentElement).append(t)}function Ci(e){return e.getAttribute(`section`)?.trim()||`General`}function wi(e){let t=new Map;for(let n of e){let e=Ci(n),r=t.get(e)??[];r.push(n),t.set(e,r)}return t}var Ti=2,Ei=[`user`,`feedback`,`project`];function Di(e){for(let t of Ei)if(e.filter(e=>e.getAttribute(`tag`)===t).length*2>e.length)return t;return null}function Oi(e,t){let n=Di(t);n&&e.setAttribute(`data-suppress-${n}`,``)}function ki(e){let t=/^Auto-extracted \((?:(\d{4})-(\d{2})-(\d{2}),\s*)?([^)]+)\)$/.exec(e);if(!t){let t=/\(([^)]*\bsessions?\b[^)]*)\)/i.exec(e);return t?{name:`${e.slice(0,t.index)} ${e.slice(t.index+t[0].length)}`.replace(/\s+[—–-]\s*$/,``).replace(/\s+/g,` `).trim()||`Session memory`,source:t[1]}:{name:e,source:``}}let[,n,r,i,a]=t;if(!n||!r||!i)return{name:`Auto-extracted`,source:a};let o=new Date(Date.UTC(Number(n),Number(r)-1,Number(i)));return{name:new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}).format(o),source:a.replaceAll(`-`,` `)}}A(`slicc-memory-panel`,class extends HTMLElement{#e=[];#t=null;#n=null;#r=null;#i=null;#a=``;#o=`all`;#s=new Set;#c=!1;connectedCallback(){Si(this.ownerDocument),this.#c||this.#u(),this.#h()}setRows(e){let t=new Set(wi(this.#e).keys());this.#e=e.filter(e=>e.matches(`slicc-memrow`)),this.#l();let n=[...wi(this.#e).keys()],r=new Set;for(let e of n)(!t.has(e)||this.#s.has(e))&&r.add(e);this.#s=r,this.#c&&this.#h()}#l(){let e=this.#i;if(e){for(let t of e.options){if(t.value===`all`)continue;let e=!this.#e.some(e=>e.getAttribute(`tag`)===t.value);t.hidden=e,t.disabled=e}e.value=this.#o}}#u(){this.#c=!0;let e=j(`input`,{type:`search`,placeholder:`Search memories…`,"aria-label":`Search memories`}),t=j(`select`,{class:`mp-filter`,"aria-label":`Filter memories by tag`},j(`option`,{value:`all`},`All tags`),j(`option`,{value:`user`},`User`),j(`option`,{value:`feedback`},`Feedback`),j(`option`,{value:`project`},`Project`)),n=j(`div`,{class:`mp-count`,role:`status`,"aria-live":`polite`}),r=j(`div`,{class:`mp-toolbar`},j(`label`,{class:`mp-search`},e),t,n),i=j(`div`,{class:`mp-body`});e.addEventListener(`input`,()=>{this.#a=e.value.trim().toLowerCase(),this.#h()}),t.addEventListener(`change`,()=>{this.#o=t.value,this.#h()}),this.replaceChildren(r,i),this.#t=i,this.#n=n,this.#r=e,this.#i=t,this.#l()}#d(){return this.#e.filter(e=>this.#o!==`all`&&e.getAttribute(`tag`)!==this.#o?!1:!this.#a||[e.getAttribute(`heading`),e.getAttribute(`summary`),e.getAttribute(`section`),e.getAttribute(`tag`),e.textContent].filter(Boolean).join(` `).toLowerCase().includes(this.#a))}#f(e){return j(`div`,{class:`mp-empty`},j(`strong`,null,e?`No matching memories`:`No memories yet`),j(`span`,null,e?`Try a different search or tag.`:`Memories extracted from conversations will appear here.`))}#p(e,t){let n=ki(e),r=j(`details`,{class:`mp-group`},j(`summary`,{class:`mp-section`},j(`span`,{class:`mp-section-name`},n.name),...n.source?[j(`span`,{class:`mp-section-source`},n.source)]:[],j(`span`,{class:`mp-section-count`},`${t.length}`)),j(`div`,{class:`mp-rows`},...t));return r.open=this.#a?!0:this.#s.has(e),r.addEventListener(`toggle`,()=>{r.open?this.#s.add(e):this.#s.delete(e)}),Oi(r,t),r}#m(e){let t=j(`div`,{class:`mp-flat`},...e);return Oi(t,e),t}#h(){let e=this.#t;if(!e)return;let t=this.#d();if(this.#r&&(this.#r.placeholder=`Search ${this.#e.length} memories…`),this.#n&&(this.#n.textContent=`${t.length} of ${this.#e.length} memories`),this.#e.length===0){e.replaceChildren(this.#f(!1));return}if(t.length===0){e.replaceChildren(this.#f(!0));return}let n=wi(t);if(n.size<Ti){e.replaceChildren(this.#m(t));return}e.replaceChildren(...[...n].map(([e,t])=>this.#p(e,t)))}});var Ai=`
3117
+ `,bi=`slicc-memory-panel-style`;function xi(e){if(e.getElementById(bi))return;let t=e.createElement(`style`);t.id=bi,t.textContent=yi,(e.head??e.documentElement).append(t)}function Si(e){return e.getAttribute(`section`)?.trim()||`General`}function Ci(e){let t=new Map;for(let n of e){let e=Si(n),r=t.get(e)??[];r.push(n),t.set(e,r)}return t}var wi=2,Ti=[`user`,`feedback`,`project`];function Ei(e){for(let t of Ti)if(e.filter(e=>e.getAttribute(`tag`)===t).length*2>e.length)return t;return null}function Di(e,t){let n=Ei(t);n&&e.setAttribute(`data-suppress-${n}`,``)}function Oi(e){let t=/^Auto-extracted \((?:(\d{4})-(\d{2})-(\d{2}),\s*)?([^)]+)\)$/.exec(e);if(!t){let t=/\(([^)]*\bsessions?\b[^)]*)\)/i.exec(e);return t?{name:`${e.slice(0,t.index)} ${e.slice(t.index+t[0].length)}`.replace(/\s+[—–-]\s*$/,``).replace(/\s+/g,` `).trim()||`Session memory`,source:t[1]}:{name:e,source:``}}let[,n,r,i,a]=t;if(!n||!r||!i)return{name:`Auto-extracted`,source:a};let o=new Date(Date.UTC(Number(n),Number(r)-1,Number(i)));return{name:new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}).format(o),source:a.replaceAll(`-`,` `)}}A(`slicc-memory-panel`,class extends HTMLElement{#e=[];#t=null;#n=null;#r=null;#i=null;#a=``;#o=`all`;#s=new Set;#c=!1;connectedCallback(){xi(this.ownerDocument),this.#c||this.#u(),this.#h()}setRows(e){let t=new Set(Ci(this.#e).keys());this.#e=e.filter(e=>e.matches(`slicc-memrow`)),this.#l();let n=[...Ci(this.#e).keys()],r=new Set;for(let e of n)(!t.has(e)||this.#s.has(e))&&r.add(e);this.#s=r,this.#c&&this.#h()}#l(){let e=this.#i;if(e){for(let t of e.options){if(t.value===`all`)continue;let e=!this.#e.some(e=>e.getAttribute(`tag`)===t.value);t.hidden=e,t.disabled=e}e.value=this.#o}}#u(){this.#c=!0;let e=j(`input`,{type:`search`,placeholder:`Search memories…`,"aria-label":`Search memories`}),t=j(`select`,{class:`mp-filter`,"aria-label":`Filter memories by tag`},j(`option`,{value:`all`},`All tags`),j(`option`,{value:`user`},`User`),j(`option`,{value:`feedback`},`Feedback`),j(`option`,{value:`project`},`Project`)),n=j(`div`,{class:`mp-count`,role:`status`,"aria-live":`polite`}),r=j(`div`,{class:`mp-toolbar`},j(`label`,{class:`mp-search`},e),t,n),i=j(`div`,{class:`mp-body`});e.addEventListener(`input`,()=>{this.#a=e.value.trim().toLowerCase(),this.#h()}),t.addEventListener(`change`,()=>{this.#o=t.value,this.#h()}),this.replaceChildren(r,i),this.#t=i,this.#n=n,this.#r=e,this.#i=t,this.#l()}#d(){return this.#e.filter(e=>this.#o!==`all`&&e.getAttribute(`tag`)!==this.#o?!1:!this.#a||[e.getAttribute(`heading`),e.getAttribute(`summary`),e.getAttribute(`section`),e.getAttribute(`tag`),e.textContent].filter(Boolean).join(` `).toLowerCase().includes(this.#a))}#f(e){return j(`div`,{class:`mp-empty`},j(`strong`,null,e?`No matching memories`:`No memories yet`),j(`span`,null,e?`Try a different search or tag.`:`Memories extracted from conversations will appear here.`))}#p(e,t){let n=Oi(e),r=j(`details`,{class:`mp-group`},j(`summary`,{class:`mp-section`},j(`span`,{class:`mp-section-name`},n.name),...n.source?[j(`span`,{class:`mp-section-source`},n.source)]:[],j(`span`,{class:`mp-section-count`},`${t.length}`)),j(`div`,{class:`mp-rows`},...t));return r.open=this.#a?!0:this.#s.has(e),r.addEventListener(`toggle`,()=>{r.open?this.#s.add(e):this.#s.delete(e)}),Di(r,t),r}#m(e){let t=j(`div`,{class:`mp-flat`},...e);return Di(t,e),t}#h(){let e=this.#t;if(!e)return;let t=this.#d();if(this.#r&&(this.#r.placeholder=`Search ${this.#e.length} memories…`),this.#n&&(this.#n.textContent=`${t.length} of ${this.#e.length} memories`),this.#e.length===0){e.replaceChildren(this.#f(!1));return}if(t.length===0){e.replaceChildren(this.#f(!0));return}let n=Ci(t);if(n.size<wi){e.replaceChildren(this.#m(t));return}e.replaceChildren(...[...n].map(([e,t])=>this.#p(e,t)))}});var ki=`
3118
3118
  slicc-palette-grid {
3119
3119
  display: block;
3120
3120
  flex: 1;
@@ -3133,7 +3133,7 @@ slicc-palette-grid .palgrid {
3133
3133
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
3134
3134
  gap: 10px;
3135
3135
  }
3136
- `,ji=`slicc-palette-grid-style`;function Mi(e){if(e.getElementById(ji))return;let t=e.createElement(`style`);t.id=ji,t.textContent=Ai,(e.head??e.documentElement).appendChild(t)}var Ni=[{label:`canvas #faf6f1`,color:`#faf6f1`},{label:`cone #ef7000`,color:`#ef7000`},{label:`scoop #8b5cf6`,color:`#8b5cf6`},{label:`scoop #06b6d4`,color:`#06b6d4`},{label:`scoop #f43f5e`,color:`#f43f5e`},{label:`ink #0a0a0a`,color:`#0a0a0a`}],Pi=`brand palette · tokens`;A(`slicc-palette-grid`,class extends HTMLElement{static get observedAttributes(){return[`heading`]}#e=!1;#t=null;#n=null;#r=[];#i=null;#a=null;connectedCallback(){Mi(this.ownerDocument),this.#e||this.#o(),this.#s(),this.#l()}disconnectedCallback(){this.#u()}attributeChangedCallback(){this.#e&&this.#s()}get heading(){return this.getAttribute(`heading`)??Pi}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get tokens(){return(this.#i??Ni).map(e=>({...e}))}set tokens(e){this.#i=Array.isArray(e)?e.map(e=>({label:String(e.label??``),color:String(e.color??``)})):null,this.#e&&this.#c()}#o(){for(this.#e=!0,this.#r=[];this.firstChild;)this.#r.push(this.firstChild),this.removeChild(this.firstChild);let e=this.ownerDocument.createElement(`h4`),t=this.ownerDocument.createElement(`div`);t.className=`palgrid`,this.append(e,t),this.#t=e,this.#n=t,this.#c()}#s(){this.#t&&(this.#t.textContent=this.heading)}#c(){let e=this.#n;if(e){e.replaceChildren();for(let t of this.#r)e.appendChild(t);for(let t of this.tokens){let n=this.ownerDocument.createElement(`slicc-palette-cell`);n.setAttribute(`color`,t.color),n.setAttribute(`label`,t.label),e.appendChild(n)}}}#l(){this.#a||(this.#a=e=>{let t=e.detail??{};this.dispatchEvent(new CustomEvent(`select`,{bubbles:!0,composed:!0,detail:{label:t.label??``,color:t.color??``,sourceEvent:e}}))},this.addEventListener(`palette-select`,this.#a))}#u(){this.#a&&=(this.removeEventListener(`palette-select`,this.#a),null)}});var Fi=M(`
3136
+ `,Ai=`slicc-palette-grid-style`;function ji(e){if(e.getElementById(Ai))return;let t=e.createElement(`style`);t.id=Ai,t.textContent=ki,(e.head??e.documentElement).appendChild(t)}var Mi=[{label:`canvas #faf6f1`,color:`#faf6f1`},{label:`cone #ef7000`,color:`#ef7000`},{label:`scoop #8b5cf6`,color:`#8b5cf6`},{label:`scoop #06b6d4`,color:`#06b6d4`},{label:`scoop #f43f5e`,color:`#f43f5e`},{label:`ink #0a0a0a`,color:`#0a0a0a`}],Ni=`brand palette · tokens`;A(`slicc-palette-grid`,class extends HTMLElement{static get observedAttributes(){return[`heading`]}#e=!1;#t=null;#n=null;#r=[];#i=null;#a=null;connectedCallback(){ji(this.ownerDocument),this.#e||this.#o(),this.#s(),this.#l()}disconnectedCallback(){this.#u()}attributeChangedCallback(){this.#e&&this.#s()}get heading(){return this.getAttribute(`heading`)??Ni}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get tokens(){return(this.#i??Mi).map(e=>({...e}))}set tokens(e){this.#i=Array.isArray(e)?e.map(e=>({label:String(e.label??``),color:String(e.color??``)})):null,this.#e&&this.#c()}#o(){for(this.#e=!0,this.#r=[];this.firstChild;)this.#r.push(this.firstChild),this.removeChild(this.firstChild);let e=this.ownerDocument.createElement(`h4`),t=this.ownerDocument.createElement(`div`);t.className=`palgrid`,this.append(e,t),this.#t=e,this.#n=t,this.#c()}#s(){this.#t&&(this.#t.textContent=this.heading)}#c(){let e=this.#n;if(e){e.replaceChildren();for(let t of this.#r)e.appendChild(t);for(let t of this.tokens){let n=this.ownerDocument.createElement(`slicc-palette-cell`);n.setAttribute(`color`,t.color),n.setAttribute(`label`,t.label),e.appendChild(n)}}}#l(){this.#a||(this.#a=e=>{let t=e.detail??{};this.dispatchEvent(new CustomEvent(`select`,{bubbles:!0,composed:!0,detail:{label:t.label??``,color:t.color??``,sourceEvent:e}}))},this.addEventListener(`palette-select`,this.#a))}#u(){this.#a&&=(this.removeEventListener(`palette-select`,this.#a),null)}});var Pi=M(`
3137
3137
  :host { display: inline-block; position: relative; font-family: var(--ui); }
3138
3138
  .trigger {
3139
3139
  display: inline-flex; align-items: center; justify-content: center;
@@ -3174,7 +3174,7 @@ slicc-palette-grid .palgrid {
3174
3174
  .item .ic { flex: 0 0 auto; display: flex; color: var(--txt-2, #505050); }
3175
3175
  .item.danger .ic { color: var(--rose, #f43f5e); }
3176
3176
  @media (prefers-reduced-motion: reduce) { .pop { transition: none; } }
3177
- `);A(`slicc-avatar-menu`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t;#n;#r=[];#i=null;#a=e=>{this.open&&!e.composedPath().includes(this)&&this.hide()};#o=e=>{e.key===`Escape`&&this.open&&(this.hide(),this.#t.focus())};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Fi],this.#t=j(`button`,{class:`trigger`,part:`trigger`,type:`button`,"aria-haspopup":`menu`,"aria-expanded":`false`},j(`slot`)),this.#n=j(`div`,{class:`pop`,part:`popover`,role:`menu`}),this.#e.replaceChildren(this.#t,this.#n),this.#t.addEventListener(`click`,()=>this.toggle())}connectedCallback(){this.#c()}disconnectedCallback(){document.removeEventListener(`mousedown`,this.#a),document.removeEventListener(`keydown`,this.#o)}attributeChangedCallback(e){if(e===`open`){let e=this.open;this.#t.setAttribute(`aria-expanded`,e?`true`:`false`),e?(document.addEventListener(`mousedown`,this.#a),document.addEventListener(`keydown`,this.#o)):(document.removeEventListener(`mousedown`,this.#a),document.removeEventListener(`keydown`,this.#o))}}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get user(){return this.#i}set user(e){this.#i=e,this.#c()}get items(){return this.#r.map(e=>({...e}))}set items(e){this.#r=Array.isArray(e)?e.map(e=>({...e})):[],this.#c()}show(){this.open||(this.open=!0,this.#s())}hide(){this.open&&(this.open=!1,this.#s())}toggle(){this.open?this.hide():this.show()}#s(){this.dispatchEvent(new CustomEvent(`slicc-avatar-menu-toggle`,{detail:{open:this.open},bubbles:!0,composed:!0}))}#c(){let e=[];if(this.#i){let t=j(`div`,{class:`user`},j(`div`,{class:`name`},this.#i.name));this.#i.provider&&t.append(j(`div`,{class:`prov`},this.#i.provider)),e.push(t)}for(let t of this.#r)if(t.kind===`separator`)e.push(j(`div`,{class:`sep`,role:`separator`}));else if(t.kind===`caption`)e.push(j(`div`,{class:`cap`},t.label??``));else{let r=j(`button`,{class:`item${t.danger?` danger`:``}`,part:`item`,type:`button`,role:`menuitem`,"data-id":t.id??``,disabled:t.disabled?!0:void 0});t.icon&&r.append(j(`span`,{class:`ic`},n(t.icon,{size:16}))),r.append(j(`span`,{class:`lb`},t.label??``)),t.disabled||r.addEventListener(`click`,()=>this.#l(t.id??``)),e.push(r)}this.#n.replaceChildren(...e)}#l(e){this.dispatchEvent(new CustomEvent(`slicc-avatar-action`,{detail:{id:e},bubbles:!0,composed:!0})),this.hide()}});var Ii=`
3177
+ `);A(`slicc-avatar-menu`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t;#n;#r=[];#i=null;#a=e=>{this.open&&!e.composedPath().includes(this)&&this.hide()};#o=e=>{e.key===`Escape`&&this.open&&(this.hide(),this.#t.focus())};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Pi],this.#t=j(`button`,{class:`trigger`,part:`trigger`,type:`button`,"aria-haspopup":`menu`,"aria-expanded":`false`},j(`slot`)),this.#n=j(`div`,{class:`pop`,part:`popover`,role:`menu`}),this.#e.replaceChildren(this.#t,this.#n),this.#t.addEventListener(`click`,()=>this.toggle())}connectedCallback(){this.#c()}disconnectedCallback(){document.removeEventListener(`mousedown`,this.#a),document.removeEventListener(`keydown`,this.#o)}attributeChangedCallback(e){if(e===`open`){let e=this.open;this.#t.setAttribute(`aria-expanded`,e?`true`:`false`),e?(document.addEventListener(`mousedown`,this.#a),document.addEventListener(`keydown`,this.#o)):(document.removeEventListener(`mousedown`,this.#a),document.removeEventListener(`keydown`,this.#o))}}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get user(){return this.#i}set user(e){this.#i=e,this.#c()}get items(){return this.#r.map(e=>({...e}))}set items(e){this.#r=Array.isArray(e)?e.map(e=>({...e})):[],this.#c()}show(){this.open||(this.open=!0,this.#s())}hide(){this.open&&(this.open=!1,this.#s())}toggle(){this.open?this.hide():this.show()}#s(){this.dispatchEvent(new CustomEvent(`slicc-avatar-menu-toggle`,{detail:{open:this.open},bubbles:!0,composed:!0}))}#c(){let e=[];if(this.#i){let t=j(`div`,{class:`user`},j(`div`,{class:`name`},this.#i.name));this.#i.provider&&t.append(j(`div`,{class:`prov`},this.#i.provider)),e.push(t)}for(let t of this.#r)if(t.kind===`separator`)e.push(j(`div`,{class:`sep`,role:`separator`}));else if(t.kind===`caption`)e.push(j(`div`,{class:`cap`},t.label??``));else{let r=j(`button`,{class:`item${t.danger?` danger`:``}`,part:`item`,type:`button`,role:`menuitem`,"data-id":t.id??``,disabled:t.disabled?!0:void 0});t.icon&&r.append(j(`span`,{class:`ic`},n(t.icon,{size:16}))),r.append(j(`span`,{class:`lb`},t.label??``)),t.disabled||r.addEventListener(`click`,()=>this.#l(t.id??``)),e.push(r)}this.#n.replaceChildren(...e)}#l(e){this.dispatchEvent(new CustomEvent(`slicc-avatar-action`,{detail:{id:e},bubbles:!0,composed:!0})),this.hide()}});var Fi=`
3178
3178
  .slicc-nav {
3179
3179
  display: flex;
3180
3180
  align-items: center;
@@ -3204,7 +3204,7 @@ slicc-palette-grid .palgrid {
3204
3204
  width, not the viewport, so embedded and Storybook frames behave like the
3205
3205
  real sidebar. */
3206
3206
  .slicc-nav[data-narrow] { gap: 8px; padding: 0 10px; }
3207
- `,Li=`slicc-nav-style`;function Ri(e){if(e.getElementById(Li))return;let t=e.createElement(`style`);t.id=Li,t.textContent=Ii,(e.head??e.documentElement).appendChild(t)}A(`slicc-nav`,class extends HTMLElement{static observedAttributes=[`accent`];#e=!1;#t=null;connectedCallback(){Ri(this.ownerDocument),this.classList.add(`slicc-nav`),this.setAttribute(`part`,`bar`),this.#n(),this.#r(this.getAttribute(`accent`)),typeof ResizeObserver<`u`&&(this.#t=new ResizeObserver(()=>this.#i()),this.#t.observe(this)),this.#i()}disconnectedCallback(){this.#t?.disconnect(),this.#t=null}attributeChangedCallback(e,t,n){e===`accent`&&t!==n&&this.isConnected&&(this.#r(n),this.dispatchEvent(new CustomEvent(`slicc-nav-accent-change`,{detail:{accent:n},bubbles:!0,composed:!0})))}get accent(){return this.getAttribute(`accent`)}set accent(e){e==null?this.removeAttribute(`accent`):this.setAttribute(`accent`,e)}get spacer(){return this.#n(),this.querySelector(`:scope > .slicc-nav__spacer, :scope > .spacer`)}#n(){if(this.#e||(this.#e=!0,this.querySelector(`:scope > .slicc-nav__spacer, :scope > .spacer`)))return;let e=this.ownerDocument.createElement(`div`);e.className=`slicc-nav__spacer`,e.setAttribute(`part`,`spacer`),e.setAttribute(`aria-hidden`,`true`);let t=this.querySelector(`:scope > slicc-floatbar, :scope > slicc-theme-toggle, :scope > slicc-avatar`);t?this.insertBefore(e,t):this.appendChild(e)}#r(e){e==null||e.trim()===``?this.style.removeProperty(`--ctx`):this.style.setProperty(`--ctx`,e)}#i(){this.toggleAttribute(`data-narrow`,this.getBoundingClientRect().width<=560)}});var zi=M(`
3207
+ `,Ii=`slicc-nav-style`;function Li(e){if(e.getElementById(Ii))return;let t=e.createElement(`style`);t.id=Ii,t.textContent=Fi,(e.head??e.documentElement).appendChild(t)}A(`slicc-nav`,class extends HTMLElement{static observedAttributes=[`accent`];#e=!1;#t=null;connectedCallback(){Li(this.ownerDocument),this.classList.add(`slicc-nav`),this.setAttribute(`part`,`bar`),this.#n(),this.#r(this.getAttribute(`accent`)),typeof ResizeObserver<`u`&&(this.#t=new ResizeObserver(()=>this.#i()),this.#t.observe(this)),this.#i()}disconnectedCallback(){this.#t?.disconnect(),this.#t=null}attributeChangedCallback(e,t,n){e===`accent`&&t!==n&&this.isConnected&&(this.#r(n),this.dispatchEvent(new CustomEvent(`slicc-nav-accent-change`,{detail:{accent:n},bubbles:!0,composed:!0})))}get accent(){return this.getAttribute(`accent`)}set accent(e){e==null?this.removeAttribute(`accent`):this.setAttribute(`accent`,e)}get spacer(){return this.#n(),this.querySelector(`:scope > .slicc-nav__spacer, :scope > .spacer`)}#n(){if(this.#e||(this.#e=!0,this.querySelector(`:scope > .slicc-nav__spacer, :scope > .spacer`)))return;let e=this.ownerDocument.createElement(`div`);e.className=`slicc-nav__spacer`,e.setAttribute(`part`,`spacer`),e.setAttribute(`aria-hidden`,`true`);let t=this.querySelector(`:scope > slicc-floatbar, :scope > slicc-theme-toggle, :scope > slicc-avatar`);t?this.insertBefore(e,t):this.appendChild(e)}#r(e){e==null||e.trim()===``?this.style.removeProperty(`--ctx`):this.style.setProperty(`--ctx`,e)}#i(){this.toggleAttribute(`data-narrow`,this.getBoundingClientRect().width<=560)}});var Ri=M(`
3208
3208
  :host {
3209
3209
  position: fixed;
3210
3210
  z-index: 110;
@@ -3242,7 +3242,7 @@ slicc-palette-grid .palgrid {
3242
3242
  .item.destructive {
3243
3243
  color: var(--red, #e53e3e);
3244
3244
  }
3245
- `),Bi=null,Vi=null,Hi=null,Ui=class e extends HTMLElement{#e;#t=void 0;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[zi]}connectedCallback(){this.#e.addEventListener(`click`,this.#i)}disconnectedCallback(){this.#e.removeEventListener(`click`,this.#i)}#i=t=>{let n=t.target.closest(`[data-action]`);if(!n)return;let r=n.dataset.action;(this.#r??this.#n??this).dispatchEvent(new CustomEvent(`overflow-action`,{bubbles:!0,composed:!0,detail:{action:r,context:this.#t}})),e.hide()};static show(t){e.hide();let r=document.createElement(`slicc-overflow-menu`);r.#t=t.context,r.#n=t.anchor,r.#r=t.dispatchTarget??null;let i=t.items.filter(e=>e.visible!==!1),a=j(`div`,{class:`menu`});for(let e of i){let t=e.destructive?`item destructive`:`item`,r=[];e.icon&&r.push(n(e.icon,{size:14})),r.push(e.label);let i=j(`button`,{class:t,"data-action":e.id},...r);a.appendChild(i)}r.#e.appendChild(a),document.body.appendChild(r),Bi=r;let o=t.anchor.getBoundingClientRect(),s=r.getBoundingClientRect(),c=o.bottom+4;c+s.height>window.innerHeight&&(c=o.top-s.height-4);let l=o.right-s.width;l<4&&(l=o.left),r.style.top=`${c}px`,r.style.left=`${l}px`,Vi=t=>{t.key===`Escape`&&e.hide()},Hi=n=>{let i=n.composedPath();!i.includes(r)&&!i.includes(t.anchor)&&e.hide()},document.addEventListener(`keydown`,Vi),document.addEventListener(`pointerdown`,Hi,{capture:!0})}static hide(){Bi&&=(Bi.remove(),null),Vi&&=(document.removeEventListener(`keydown`,Vi),null),Hi&&=(document.removeEventListener(`pointerdown`,Hi,{capture:!0}),null)}};A(`slicc-overflow-menu`,Ui);var Wi=M(`
3245
+ `),zi=null,Bi=null,Vi=null,Hi=class e extends HTMLElement{#e;#t=void 0;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ri]}connectedCallback(){this.#e.addEventListener(`click`,this.#i)}disconnectedCallback(){this.#e.removeEventListener(`click`,this.#i)}#i=t=>{let n=t.target.closest(`[data-action]`);if(!n)return;let r=n.dataset.action;(this.#r??this.#n??this).dispatchEvent(new CustomEvent(`overflow-action`,{bubbles:!0,composed:!0,detail:{action:r,context:this.#t}})),e.hide()};static show(t){e.hide();let r=document.createElement(`slicc-overflow-menu`);r.#t=t.context,r.#n=t.anchor,r.#r=t.dispatchTarget??null;let i=t.items.filter(e=>e.visible!==!1),a=j(`div`,{class:`menu`});for(let e of i){let t=e.destructive?`item destructive`:`item`,r=[];e.icon&&r.push(n(e.icon,{size:14})),r.push(e.label);let i=j(`button`,{class:t,"data-action":e.id},...r);a.appendChild(i)}r.#e.appendChild(a),document.body.appendChild(r),zi=r;let o=t.anchor.getBoundingClientRect(),s=r.getBoundingClientRect(),c=o.bottom+4;c+s.height>window.innerHeight&&(c=o.top-s.height-4);let l=o.right-s.width;l<4&&(l=o.left),r.style.top=`${c}px`,r.style.left=`${l}px`,Bi=t=>{t.key===`Escape`&&e.hide()},Vi=n=>{let i=n.composedPath();!i.includes(r)&&!i.includes(t.anchor)&&e.hide()},document.addEventListener(`keydown`,Bi),document.addEventListener(`pointerdown`,Vi,{capture:!0})}static hide(){zi&&=(zi.remove(),null),Bi&&=(document.removeEventListener(`keydown`,Bi),null),Vi&&=(document.removeEventListener(`pointerdown`,Vi,{capture:!0}),null)}};A(`slicc-overflow-menu`,Hi);var Ui=M(`
3246
3246
  :host { display: none; }
3247
3247
  :host([open]) { display: block; }
3248
3248
  .overlay {
@@ -3287,7 +3287,7 @@ slicc-palette-grid .palgrid {
3287
3287
  @media (prefers-reduced-motion: reduce) {
3288
3288
  .overlay, .dialog { transition: none; }
3289
3289
  }
3290
- `);A(`slicc-dialog`,class extends HTMLElement{static observedAttributes=[`open`,`heading`,`description`,`no-close-button`];#e;#t;#n;#r;#i;#a;#o=null;#s=e=>{e.key===`Escape`&&this.open&&(e.stopPropagation(),this.#c(`escape`))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Wi],this.#r=j(`div`,{class:`title`,part:`title`,id:`slicc-dialog-title`}),this.#i=j(`div`,{class:`desc`,part:`description`}),this.#a=j(`button`,{class:`x`,part:`close`,type:`button`,"aria-label":`Close`},n(`x`,{size:18}));let e=j(`div`,{class:`body`},j(`slot`)),t=j(`div`,{class:`footer`},j(`slot`,{name:`footer`}));this.#n=j(`div`,{class:`dialog`,part:`dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`slicc-dialog-title`,tabindex:`-1`},this.#a,this.#r,this.#i,e,t),this.#t=j(`div`,{class:`overlay`,part:`overlay`},this.#n),this.#e.replaceChildren(this.#t),this.#a.addEventListener(`click`,()=>this.#c(`close-button`)),this.#t.addEventListener(`mousedown`,e=>{e.target===this.#t&&!this.persistent&&this.#c(`backdrop`)})}connectedCallback(){this.#u()}disconnectedCallback(){document.removeEventListener(`keydown`,this.#s,!0)}attributeChangedCallback(e){e===`open`?this.#u():this.#l()}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get heading(){return this.getAttribute(`heading`)}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get description(){return this.getAttribute(`description`)}set description(e){e==null?this.removeAttribute(`description`):this.setAttribute(`description`,e)}get persistent(){return this.hasAttribute(`persistent`)}set persistent(e){this.toggleAttribute(`persistent`,e)}show(){this.open||=!0}hide(){this.open&&this.#c(`api`)}#c(e){this.open=!1,this.dispatchEvent(new CustomEvent(`slicc-dialog-close`,{detail:{reason:e},bubbles:!0,composed:!0}))}#l(){this.#r.textContent=this.heading??``,this.#r.style.display=this.heading?``:`none`,this.#i.textContent=this.description??``,this.#i.style.display=this.description?``:`none`,this.#a.style.display=this.hasAttribute(`no-close-button`)?`none`:``}#u(){this.#l(),this.open?(this.#o=this.getRootNode().activeElement,document.addEventListener(`keydown`,this.#s,!0),requestAnimationFrame(()=>this.#n.focus())):(document.removeEventListener(`keydown`,this.#s,!0),this.#o?.focus?.(),this.#o=null)}});var Gi=`
3290
+ `);A(`slicc-dialog`,class extends HTMLElement{static observedAttributes=[`open`,`heading`,`description`,`no-close-button`];#e;#t;#n;#r;#i;#a;#o=null;#s=e=>{e.key===`Escape`&&this.open&&(e.stopPropagation(),this.#c(`escape`))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ui],this.#r=j(`div`,{class:`title`,part:`title`,id:`slicc-dialog-title`}),this.#i=j(`div`,{class:`desc`,part:`description`}),this.#a=j(`button`,{class:`x`,part:`close`,type:`button`,"aria-label":`Close`},n(`x`,{size:18}));let e=j(`div`,{class:`body`},j(`slot`)),t=j(`div`,{class:`footer`},j(`slot`,{name:`footer`}));this.#n=j(`div`,{class:`dialog`,part:`dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`slicc-dialog-title`,tabindex:`-1`},this.#a,this.#r,this.#i,e,t),this.#t=j(`div`,{class:`overlay`,part:`overlay`},this.#n),this.#e.replaceChildren(this.#t),this.#a.addEventListener(`click`,()=>this.#c(`close-button`)),this.#t.addEventListener(`mousedown`,e=>{e.target===this.#t&&!this.persistent&&this.#c(`backdrop`)})}connectedCallback(){this.#u()}disconnectedCallback(){document.removeEventListener(`keydown`,this.#s,!0)}attributeChangedCallback(e){e===`open`?this.#u():this.#l()}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get heading(){return this.getAttribute(`heading`)}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get description(){return this.getAttribute(`description`)}set description(e){e==null?this.removeAttribute(`description`):this.setAttribute(`description`,e)}get persistent(){return this.hasAttribute(`persistent`)}set persistent(e){this.toggleAttribute(`persistent`,e)}show(){this.open||=!0}hide(){this.open&&this.#c(`api`)}#c(e){this.open=!1,this.dispatchEvent(new CustomEvent(`slicc-dialog-close`,{detail:{reason:e},bubbles:!0,composed:!0}))}#l(){this.#r.textContent=this.heading??``,this.#r.style.display=this.heading?``:`none`,this.#i.textContent=this.description??``,this.#i.style.display=this.description?``:`none`,this.#a.style.display=this.hasAttribute(`no-close-button`)?`none`:``}#u(){this.#l(),this.open?(this.#o=this.getRootNode().activeElement,document.addEventListener(`keydown`,this.#s,!0),requestAnimationFrame(()=>this.#n.focus())):(document.removeEventListener(`keydown`,this.#s,!0),this.#o?.focus?.(),this.#o=null)}});var Wi=`
3291
3291
  slicc-camera-dialog slicc-dialog::part(dialog) {
3292
3292
  width: min(560px, 92vw);
3293
3293
  }
@@ -3354,7 +3354,7 @@ slicc-camera-dialog .slicc-camera__btn--snap {
3354
3354
  slicc-camera-dialog .slicc-camera__btn--snap:hover {
3355
3355
  background: color-mix(in srgb, var(--ink) 85%, var(--canvas));
3356
3356
  }
3357
- `,Ki=`slicc-camera-dialog-style`;function qi(e){if(e.getElementById(Ki))return;let t=e.createElement(`style`);t.id=Ki,t.textContent=Gi,(e.head??e.documentElement).appendChild(t)}var Ji=`Take a photo`;A(`slicc-camera-dialog`,class extends HTMLElement{static observedAttributes=[`heading`,`preferred-device`];media=null;#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){qi(this.ownerDocument),this.#h()}disconnectedCallback(){this.#m()}attributeChangedCallback(e){e===`heading`&&this.#i&&this.#e.setAttribute(`heading`,this.heading)}get heading(){return this.getAttribute(`heading`)??Ji}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get preferredDevice(){return this.getAttribute(`preferred-device`)}set preferredDevice(e){e==null?this.removeAttribute(`preferred-device`):this.setAttribute(`preferred-device`,e)}#s(){return this.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}async open(){this.#h();let e=this.#s();if(!e)return null;try{this.#a=await this.#c(e,this.preferredDevice)}catch{return null}return this.#l(this.#a),await this.#u(e),this.#e.setAttribute(`heading`,this.heading),this.#e.show?.(),new Promise(e=>{this.#o=e})}async#c(e,t){if(t)try{return await e.getUserMedia({video:{deviceId:{exact:t}}})}catch{}return e.getUserMedia({video:!0})}#l(e){this.#t.srcObject=e,this.#t.play?.()?.catch(()=>void 0);let t=e.getVideoTracks()[0]?.getSettings?.().facingMode;this.#t.toggleAttribute(`data-mirrored`,t!==`environment`)}async#u(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`videoinput`)}catch{t=[]}this.#n.replaceChildren(...t.map((e,t)=>j(`option`,{value:e.deviceId},e.label||`Camera ${t+1}`)));let n=this.#a?.getVideoTracks()[0]?.getSettings?.().deviceId;n&&(this.#n.value=n),this.#n.toggleAttribute(`hidden`,t.length<2)}async#d(e){let t=this.#s();if(t){this.#r.textContent=``;try{let n=await t.getUserMedia({video:{deviceId:{exact:e}}});this.#m(),this.#a=n,this.#l(n),this.dispatchEvent(new CustomEvent(`slicc-camera-device-change`,{detail:{deviceId:e},bubbles:!0,composed:!0}))}catch{this.#r.textContent=`Could not switch camera — keeping the current one.`}}}#f(){let e=this.ownerDocument.createElement(`canvas`);if(e.width=this.#t.videoWidth,e.height=this.#t.videoHeight,e.width===0||e.height===0){this.#r.textContent=`No frame yet — give the camera a moment.`;return}e.getContext(`2d`)?.drawImage(this.#t,0,0);let t=e.toDataURL(`image/png`);this.dispatchEvent(new CustomEvent(`slicc-camera-capture`,{detail:{dataUrl:t},bubbles:!0,composed:!0})),this.#p(t)}#p(e){this.#m();let t=this.#o;this.#o=null,this.#e.hide?.(),t?.(e)}#m(){for(let e of this.#a?.getTracks()??[])e.stop();this.#a=null,this.#t&&(this.#t.srcObject=null)}#h(){if(this.#i)return;this.#i=!0,this.#t=j(`video`,{class:`slicc-camera__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#n=j(`select`,{class:`slicc-camera__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#d(this.#n.value)}),this.#r=j(`div`,{class:`slicc-camera__status`});let e=j(`button`,{type:`button`,class:`slicc-camera__btn`,part:`cancel`,slot:`footer`},`Cancel`);e.addEventListener(`click`,()=>this.#p(null));let t=j(`button`,{type:`button`,class:`slicc-camera__btn slicc-camera__btn--snap`,part:`snap`,slot:`footer`},n(`camera`,{size:14}),` Snap`);t.addEventListener(`click`,()=>this.#f());let r=j(`div`,{class:`slicc-camera__body`},this.#t,this.#n,this.#r);this.#e=this.ownerDocument.createElement(`slicc-dialog`),this.#e.setAttribute(`heading`,this.heading),this.#e.append(r,e,t),this.#e.addEventListener(`slicc-dialog-close`,()=>{this.#o&&this.#p(null)}),this.append(this.#e)}});var Yi={debug(e,t){t===void 0?console.debug(`[slicc-permissions] ${e}`):console.debug(`[slicc-permissions] ${e}`,t)},error(e,t){t===void 0?console.error(`[slicc-permissions] ${e}`):console.error(`[slicc-permissions] ${e}`,t)}},Xi=new Set([`microphone`,`camera`]);function Zi(e){return typeof navigator>`u`||!navigator.permissions?.query?Promise.resolve(`prompt`):navigator.permissions.query({name:e}).then(e=>e.state)}var Qi=`
3357
+ `,Gi=`slicc-camera-dialog-style`;function Ki(e){if(e.getElementById(Gi))return;let t=e.createElement(`style`);t.id=Gi,t.textContent=Wi,(e.head??e.documentElement).appendChild(t)}var qi=`Take a photo`;A(`slicc-camera-dialog`,class extends HTMLElement{static observedAttributes=[`heading`,`preferred-device`];media=null;#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){Ki(this.ownerDocument),this.#h()}disconnectedCallback(){this.#m()}attributeChangedCallback(e){e===`heading`&&this.#i&&this.#e.setAttribute(`heading`,this.heading)}get heading(){return this.getAttribute(`heading`)??qi}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get preferredDevice(){return this.getAttribute(`preferred-device`)}set preferredDevice(e){e==null?this.removeAttribute(`preferred-device`):this.setAttribute(`preferred-device`,e)}#s(){return this.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}async open(){this.#h();let e=this.#s();if(!e)return null;try{this.#a=await this.#c(e,this.preferredDevice)}catch{return null}return this.#l(this.#a),await this.#u(e),this.#e.setAttribute(`heading`,this.heading),this.#e.show?.(),new Promise(e=>{this.#o=e})}async#c(e,t){if(t)try{return await e.getUserMedia({video:{deviceId:{exact:t}}})}catch{}return e.getUserMedia({video:!0})}#l(e){this.#t.srcObject=e,this.#t.play?.()?.catch(()=>void 0);let t=e.getVideoTracks()[0]?.getSettings?.().facingMode;this.#t.toggleAttribute(`data-mirrored`,t!==`environment`)}async#u(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`videoinput`)}catch{t=[]}this.#n.replaceChildren(...t.map((e,t)=>j(`option`,{value:e.deviceId},e.label||`Camera ${t+1}`)));let n=this.#a?.getVideoTracks()[0]?.getSettings?.().deviceId;n&&(this.#n.value=n),this.#n.toggleAttribute(`hidden`,t.length<2)}async#d(e){let t=this.#s();if(t){this.#r.textContent=``;try{let n=await t.getUserMedia({video:{deviceId:{exact:e}}});this.#m(),this.#a=n,this.#l(n),this.dispatchEvent(new CustomEvent(`slicc-camera-device-change`,{detail:{deviceId:e},bubbles:!0,composed:!0}))}catch{this.#r.textContent=`Could not switch camera — keeping the current one.`}}}#f(){let e=this.ownerDocument.createElement(`canvas`);if(e.width=this.#t.videoWidth,e.height=this.#t.videoHeight,e.width===0||e.height===0){this.#r.textContent=`No frame yet — give the camera a moment.`;return}e.getContext(`2d`)?.drawImage(this.#t,0,0);let t=e.toDataURL(`image/png`);this.dispatchEvent(new CustomEvent(`slicc-camera-capture`,{detail:{dataUrl:t},bubbles:!0,composed:!0})),this.#p(t)}#p(e){this.#m();let t=this.#o;this.#o=null,this.#e.hide?.(),t?.(e)}#m(){for(let e of this.#a?.getTracks()??[])e.stop();this.#a=null,this.#t&&(this.#t.srcObject=null)}#h(){if(this.#i)return;this.#i=!0,this.#t=j(`video`,{class:`slicc-camera__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#n=j(`select`,{class:`slicc-camera__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#d(this.#n.value)}),this.#r=j(`div`,{class:`slicc-camera__status`});let e=j(`button`,{type:`button`,class:`slicc-camera__btn`,part:`cancel`,slot:`footer`},`Cancel`);e.addEventListener(`click`,()=>this.#p(null));let t=j(`button`,{type:`button`,class:`slicc-camera__btn slicc-camera__btn--snap`,part:`snap`,slot:`footer`},n(`camera`,{size:14}),` Snap`);t.addEventListener(`click`,()=>this.#f());let r=j(`div`,{class:`slicc-camera__body`},this.#t,this.#n,this.#r);this.#e=this.ownerDocument.createElement(`slicc-dialog`),this.#e.setAttribute(`heading`,this.heading),this.#e.append(r,e,t),this.#e.addEventListener(`slicc-dialog-close`,()=>{this.#o&&this.#p(null)}),this.append(this.#e)}});var Ji={debug(e,t){t===void 0?console.debug(`[slicc-permissions] ${e}`):console.debug(`[slicc-permissions] ${e}`,t)},error(e,t){t===void 0?console.error(`[slicc-permissions] ${e}`):console.error(`[slicc-permissions] ${e}`,t)}},Yi=new Set([`microphone`,`camera`]);function Xi(e){return typeof navigator>`u`||!navigator.permissions?.query?Promise.resolve(`prompt`):navigator.permissions.query({name:e}).then(e=>e.state)}var Zi=`
3358
3358
  slicc-permissions {
3359
3359
  /* Invisible host by default — only the drop overlay paints, and only
3360
3360
  while a folder drag is in flight. Hosts can give the element a fixed
@@ -3525,7 +3525,7 @@ slicc-permissions .slicc-permissions__prompt-btn:disabled {
3525
3525
  transform: translateX(-50%) translateY(0);
3526
3526
  }
3527
3527
  }
3528
- `,$i=`slicc-permissions-style`;function ea(e){if(e.getElementById($i))return;let t=e.createElement(`style`);t.id=$i,t.textContent=Qi,(e.head??e.documentElement).appendChild(t)}function ta(e){let t=e.dataTransfer?.types;if(!t)return!1;for(let e=0;e<t.length;e++)if(t[e]===`Files`)return!0;return!1}var na=class extends HTMLElement{providers={};permissionQuery=null;#e;#t=!1;#n=0;#r=null;connectedCallback(){ea(this.ownerDocument),this.#C();let e=this.ownerDocument;e.addEventListener(`dragenter`,this.#v),e.addEventListener(`dragover`,this.#y),e.addEventListener(`dragleave`,this.#b),e.addEventListener(`drop`,this.#x)}disconnectedCallback(){let e=this.ownerDocument;e.removeEventListener(`dragenter`,this.#v),e.removeEventListener(`dragover`,this.#y),e.removeEventListener(`dragleave`,this.#b),e.removeEventListener(`drop`,this.#x),this.#n=0,this.removeAttribute(`data-dropping`),this.#r&&this.#r.cancel()}async request(e,t){switch(e){case`camera`:return this.#o(t);case`microphone`:return this.#s(t);case`screenshare`:return this.#l(t);case`usb`:return this.#u(t);case`hid`:return this.#d(t);case`serial`:return this.#f(t);case`filesystem`:return this.#p();case`popup`:return this.#m(t);default:return null}}async prompt(e){if(!e.kinds.length)return{status:`granted`,grants:[]};if(e.skipIfGranted){let t=await this.#i(e);if(t)return t}return this.#r&&this.#r.cancel(),new Promise(t=>{this.#w(e,t)})}async#i(e){if(!e.kinds.every(e=>Xi.has(e)))return Yi.debug(`prompt: showing dialog (a gesture-bound kind was requested)`,{kinds:e.kinds}),null;let t=this.permissionQuery??Zi,n;try{n=await Promise.all(e.kinds.map(e=>t(e)))}catch(e){return Yi.error(`prompt: permission query threw; showing dialog`,e),null}if(Yi.debug(`prompt: queried permission state`,{kinds:e.kinds,states:n}),!n.every(e=>e===`granted`))return Yi.debug(`prompt: not all kinds granted; showing dialog`),null;let r=[];for(let t of e.kinds){let n=await this.request(t,e.requestOptions?.[t]);if(!n)return Yi.error(`prompt: acquisition failed after granted state`,{kind:t}),{status:`error`,grants:r,reason:`error`};r.push(n)}return Yi.debug(`prompt: short-circuited dialog (already granted)`,{kinds:e.kinds}),{status:`granted`,grants:r}}#a(){return this.providers.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}async#o(e){let t=this.#a();if(!t)return this.#g(`camera`,`unavailable`,`mediaDevices unavailable`);try{let n=await t.getUserMedia(e?.constraints??{video:!0});return this.#h({kind:`camera`,stream:n})}catch(e){return this.#_(`camera`,e)}}async#s(e){let t=this.#a();if(!t)return this.#g(`microphone`,`unavailable`,`mediaDevices unavailable`);try{let n=await t.getUserMedia(e?.constraints??{audio:!0});return this.#h({kind:`microphone`,stream:n})}catch(e){return this.#_(`microphone`,e)}}#c(){if(this.providers.screenshare)return this.providers.screenshare;let e=typeof navigator<`u`?navigator.mediaDevices:void 0;return e&&typeof e.getDisplayMedia==`function`?{getDisplayMedia:t=>e.getDisplayMedia(t)}:null}async#l(e){let t=this.#c();if(!t)return this.#g(`screenshare`,`unavailable`,`getDisplayMedia unavailable`);try{let n=await t.getDisplayMedia(e?.constraints??{video:!0});return this.#h({kind:`screenshare`,stream:n})}catch(e){return this.#_(`screenshare`,e)}}async#u(e){let t=this.providers.usb??globalThis.navigator?.usb??null;if(!t?.requestDevice)return this.#g(`usb`,`unavailable`,`WebUSB unavailable`);try{let n=await t.requestDevice({filters:e?.filters??[]});return n?this.#h({kind:`usb`,device:n}):this.#g(`usb`,`cancelled`)}catch(e){return this.#_(`usb`,e)}}async#d(e){let t=this.providers.hid??globalThis.navigator?.hid??null;if(!t?.requestDevice)return this.#g(`hid`,`unavailable`,`WebHID unavailable`);try{let n=await t.requestDevice({filters:e?.filters??[]}),r=Array.isArray(n)?n:n?[n]:[];return r.length===0?this.#g(`hid`,`cancelled`):this.#h({kind:`hid`,device:r[0],devices:r})}catch(e){return this.#_(`hid`,e)}}async#f(e){let t=this.providers.serial??globalThis.navigator?.serial??null;if(!t?.requestPort)return this.#g(`serial`,`unavailable`,`Web Serial unavailable`);try{let n=await t.requestPort(e?.filters?.length?{filters:e.filters}:{});return n?this.#h({kind:`serial`,port:n}):this.#g(`serial`,`cancelled`)}catch(e){return this.#_(`serial`,e)}}async#p(){let e=this.providers.filesystem??(typeof window<`u`&&`showDirectoryPicker`in window&&window||null);if(!e?.showDirectoryPicker)return this.#g(`filesystem`,`unavailable`,`showDirectoryPicker unavailable`);try{let t=await e.showDirectoryPicker({mode:`readwrite`});return this.#h({kind:`filesystem`,handle:t,source:`picker`,permission:`granted`})}catch(e){return this.#_(`filesystem`,e)}}#m(e){let t=e?.url;if(!t)return this.#g(`popup`,`error`,`popup request missing url`);let n=e?.features??`width=500,height=700,popup=yes`,r=this.providers.popup??(typeof window<`u`?{open:(e,t)=>window.open(e,`_blank`,t)}:null);if(!r)return this.#g(`popup`,`unavailable`,`window.open unavailable`);let i;try{i=r.open(t,n)}catch(e){return this.#_(`popup`,e)}return i?this.#h({kind:`popup`,window:i}):this.#g(`popup`,`error`,`window.open returned null (popup blocked?)`)}#h(e){return this.dispatchEvent(new CustomEvent(`slicc-permission-grant`,{detail:e,bubbles:!0,composed:!0})),e}#g(e,t,n){return this.dispatchEvent(new CustomEvent(`slicc-permission-deny`,{detail:{kind:e,reason:t,message:n},bubbles:!0,composed:!0})),null}#_(e,t){return t instanceof Error&&(t.name===`AbortError`||t.name===`NotFoundError`)?this.#g(e,`cancelled`):this.#g(e,`error`,t instanceof Error?t.message:String(t))}#v=e=>{ta(e)&&(e.preventDefault(),this.#n++,this.setAttribute(`data-dropping`,``))};#y=e=>{ta(e)&&e.preventDefault()};#b=e=>{ta(e)&&(this.#n=Math.max(0,this.#n-1),this.#n===0&&this.removeAttribute(`data-dropping`))};#x=e=>{if(!ta(e))return;e.preventDefault(),this.#n=0,this.removeAttribute(`data-dropping`);let t=e.dataTransfer?.items;if(!t?.length)return;let n=[];for(let e=0;e<t.length;e++){let r=t[e];r.kind===`file`&&typeof r.getAsFileSystemHandle==`function`&&n.push(r.getAsFileSystemHandle())}n.length!==0&&this.#S(n)};async#S(e){let t;try{t=await Promise.all(e)}catch(e){this.#g(`filesystem`,`error`,e instanceof Error?e.message:String(e));return}let n=t.find(e=>e?.kind===`directory`);if(!n){this.#g(`filesystem`,`cancelled`,`no directory in drop`);return}let r=n,i;if(r.requestPermission)try{i=await r.requestPermission({mode:`readwrite`})}catch(e){this.#g(`filesystem`,`error`,e instanceof Error?e.message:String(e));return}else i=`granted`;if(i!==`granted`){this.#g(`filesystem`,`cancelled`,`permission ${i}`);return}this.#h({kind:`filesystem`,handle:n,source:`drop`,permission:i})}#C(){if(this.#t)return;this.#t=!0;let e=j(`div`,{class:`slicc-permissions__drop-inner`},n(`folder-up`,{size:32}),j(`div`,null,`Drop a folder to mount it (read-write)`));this.#e=j(`div`,{class:`slicc-permissions__drop`,part:`drop`,"aria-hidden":`true`},e),this.append(this.#e)}#w(e,t){let r=e.heading??aa(e.kinds),i=e.grantLabel??`Allow`,a=e.cancelLabel??`Cancel`,o=`slicc-permissions__heading-${Math.random().toString(36).slice(2,8)}`,s=`slicc-permissions__desc-${Math.random().toString(36).slice(2,8)}`,c=j(`button`,{type:`button`,class:`slicc-permissions__prompt-btn`,"data-variant":`ghost`,part:`prompt-cancel`},a),l=j(`button`,{type:`button`,class:`slicc-permissions__prompt-btn`,"data-variant":`primary`,part:`prompt-grant`},i),u=j(`div`,{class:`slicc-permissions__prompt-icons`,"aria-hidden":`true`},...e.kinds.map(e=>j(`span`,{class:`slicc-permissions__prompt-icon`},n(ra(e),{size:22})))),d=j(`div`,{class:`slicc-permissions__prompt`,part:`prompt`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":o,"aria-describedby":s,tabindex:`-1`,popover:`manual`},u,j(`h2`,{class:`slicc-permissions__prompt-heading`,id:o},r),j(`p`,{class:`slicc-permissions__prompt-desc`,id:s},e.description),j(`div`,{class:`slicc-permissions__prompt-actions`},c,l));this.append(d);let f=d;if(typeof f.showPopover==`function`)try{f.showPopover()}catch{}let p=!1,m=this.ownerDocument.activeElement??null,h=()=>{if(d.removeEventListener(`keydown`,_),d.remove(),m&&typeof m.focus==`function`)try{m.focus()}catch{}this.#r=null},g=(n,r)=>{if(!p){p=!0;for(let t of e.kinds)this.#g(t,n,r);h(),t({status:`cancelled`,grants:[],reason:n,message:r})}},_=e=>{if(e.key===`Escape`){e.preventDefault(),g(`cancelled`);return}if(e.key===`Tab`){let t=[c,l],n=this.ownerDocument.activeElement,r=t.indexOf(n);if(r===-1){t[0].focus(),e.preventDefault();return}(e.shiftKey?t[(r-1+t.length)%t.length]:t[(r+1)%t.length]).focus(),e.preventDefault()}};c.addEventListener(`click`,()=>g(`cancelled`)),l.addEventListener(`click`,async()=>{if(p)return;p=!0,l.disabled=!0,c.disabled=!0;let n=[],r=null;for(let t of e.kinds){let i=await this.request(t,e.requestOptions?.[t]);if(i)n.push(i);else{r={kind:t,reason:`cancelled`};break}}let i=r?e.kinds.indexOf(r.kind):-1;if(r&&i>=0)for(let t=i+1;t<e.kinds.length;t++)this.#g(e.kinds[t],`cancelled`);h(),t(r?{status:`cancelled`,grants:n,reason:`cancelled`}:{status:`granted`,grants:n})}),d.addEventListener(`keydown`,_),this.#r={cancel:()=>g(`cancelled`)},requestAnimationFrame(()=>{d.setAttribute(`data-open`,``),l.focus()})}};function ra(e){switch(e){case`camera`:return`camera`;case`microphone`:return`mic`;case`screenshare`:return`monitor-up`;case`usb`:return`usb`;case`hid`:return`keyboard`;case`serial`:return`cable`;case`filesystem`:return`folder`;case`popup`:return`external-link`}}function ia(e){switch(e){case`camera`:return`camera`;case`microphone`:return`microphone`;case`screenshare`:return`screen`;case`usb`:return`USB device`;case`hid`:return`HID device`;case`serial`:return`serial port`;case`filesystem`:return`folder`;case`popup`:return`sign-in window`}}function aa(e){if(e.length===1)return`Allow access to your ${ia(e[0])}?`;let t=e.map(ia),n=t.pop();return`Allow access to your ${t.join(`, `)} and ${n}?`}A(`slicc-permissions`,na);var oa=new Set([`top`,`bottom`,`left`,`right`]),sa=M(`
3528
+ `,Qi=`slicc-permissions-style`;function $i(e){if(e.getElementById(Qi))return;let t=e.createElement(`style`);t.id=Qi,t.textContent=Zi,(e.head??e.documentElement).appendChild(t)}function ea(e){let t=e.dataTransfer?.types;if(!t)return!1;for(let e=0;e<t.length;e++)if(t[e]===`Files`)return!0;return!1}var ta=class extends HTMLElement{providers={};permissionQuery=null;#e;#t=!1;#n=0;#r=null;connectedCallback(){$i(this.ownerDocument),this.#C();let e=this.ownerDocument;e.addEventListener(`dragenter`,this.#v),e.addEventListener(`dragover`,this.#y),e.addEventListener(`dragleave`,this.#b),e.addEventListener(`drop`,this.#x)}disconnectedCallback(){let e=this.ownerDocument;e.removeEventListener(`dragenter`,this.#v),e.removeEventListener(`dragover`,this.#y),e.removeEventListener(`dragleave`,this.#b),e.removeEventListener(`drop`,this.#x),this.#n=0,this.removeAttribute(`data-dropping`),this.#r&&this.#r.cancel()}async request(e,t){switch(e){case`camera`:return this.#o(t);case`microphone`:return this.#s(t);case`screenshare`:return this.#l(t);case`usb`:return this.#u(t);case`hid`:return this.#d(t);case`serial`:return this.#f(t);case`filesystem`:return this.#p();case`popup`:return this.#m(t);default:return null}}async prompt(e){if(!e.kinds.length)return{status:`granted`,grants:[]};if(e.skipIfGranted){let t=await this.#i(e);if(t)return t}return this.#r&&this.#r.cancel(),new Promise(t=>{this.#w(e,t)})}async#i(e){if(!e.kinds.every(e=>Yi.has(e)))return Ji.debug(`prompt: showing dialog (a gesture-bound kind was requested)`,{kinds:e.kinds}),null;let t=this.permissionQuery??Xi,n;try{n=await Promise.all(e.kinds.map(e=>t(e)))}catch(e){return Ji.error(`prompt: permission query threw; showing dialog`,e),null}if(Ji.debug(`prompt: queried permission state`,{kinds:e.kinds,states:n}),!n.every(e=>e===`granted`))return Ji.debug(`prompt: not all kinds granted; showing dialog`),null;let r=[];for(let t of e.kinds){let n=await this.request(t,e.requestOptions?.[t]);if(!n)return Ji.error(`prompt: acquisition failed after granted state`,{kind:t}),{status:`error`,grants:r,reason:`error`};r.push(n)}return Ji.debug(`prompt: short-circuited dialog (already granted)`,{kinds:e.kinds}),{status:`granted`,grants:r}}#a(){return this.providers.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}async#o(e){let t=this.#a();if(!t)return this.#g(`camera`,`unavailable`,`mediaDevices unavailable`);try{let n=await t.getUserMedia(e?.constraints??{video:!0});return this.#h({kind:`camera`,stream:n})}catch(e){return this.#_(`camera`,e)}}async#s(e){let t=this.#a();if(!t)return this.#g(`microphone`,`unavailable`,`mediaDevices unavailable`);try{let n=await t.getUserMedia(e?.constraints??{audio:!0});return this.#h({kind:`microphone`,stream:n})}catch(e){return this.#_(`microphone`,e)}}#c(){if(this.providers.screenshare)return this.providers.screenshare;let e=typeof navigator<`u`?navigator.mediaDevices:void 0;return e&&typeof e.getDisplayMedia==`function`?{getDisplayMedia:t=>e.getDisplayMedia(t)}:null}async#l(e){let t=this.#c();if(!t)return this.#g(`screenshare`,`unavailable`,`getDisplayMedia unavailable`);try{let n=await t.getDisplayMedia(e?.constraints??{video:!0});return this.#h({kind:`screenshare`,stream:n})}catch(e){return this.#_(`screenshare`,e)}}async#u(e){let t=this.providers.usb??globalThis.navigator?.usb??null;if(!t?.requestDevice)return this.#g(`usb`,`unavailable`,`WebUSB unavailable`);try{let n=await t.requestDevice({filters:e?.filters??[]});return n?this.#h({kind:`usb`,device:n}):this.#g(`usb`,`cancelled`)}catch(e){return this.#_(`usb`,e)}}async#d(e){let t=this.providers.hid??globalThis.navigator?.hid??null;if(!t?.requestDevice)return this.#g(`hid`,`unavailable`,`WebHID unavailable`);try{let n=await t.requestDevice({filters:e?.filters??[]}),r=Array.isArray(n)?n:n?[n]:[];return r.length===0?this.#g(`hid`,`cancelled`):this.#h({kind:`hid`,device:r[0],devices:r})}catch(e){return this.#_(`hid`,e)}}async#f(e){let t=this.providers.serial??globalThis.navigator?.serial??null;if(!t?.requestPort)return this.#g(`serial`,`unavailable`,`Web Serial unavailable`);try{let n=await t.requestPort(e?.filters?.length?{filters:e.filters}:{});return n?this.#h({kind:`serial`,port:n}):this.#g(`serial`,`cancelled`)}catch(e){return this.#_(`serial`,e)}}async#p(){let e=this.providers.filesystem??(typeof window<`u`&&`showDirectoryPicker`in window&&window||null);if(!e?.showDirectoryPicker)return this.#g(`filesystem`,`unavailable`,`showDirectoryPicker unavailable`);try{let t=await e.showDirectoryPicker({mode:`readwrite`});return this.#h({kind:`filesystem`,handle:t,source:`picker`,permission:`granted`})}catch(e){return this.#_(`filesystem`,e)}}#m(e){let t=e?.url;if(!t)return this.#g(`popup`,`error`,`popup request missing url`);let n=e?.features??`width=500,height=700,popup=yes`,r=this.providers.popup??(typeof window<`u`?{open:(e,t)=>window.open(e,`_blank`,t)}:null);if(!r)return this.#g(`popup`,`unavailable`,`window.open unavailable`);let i;try{i=r.open(t,n)}catch(e){return this.#_(`popup`,e)}return i?this.#h({kind:`popup`,window:i}):this.#g(`popup`,`error`,`window.open returned null (popup blocked?)`)}#h(e){return this.dispatchEvent(new CustomEvent(`slicc-permission-grant`,{detail:e,bubbles:!0,composed:!0})),e}#g(e,t,n){return this.dispatchEvent(new CustomEvent(`slicc-permission-deny`,{detail:{kind:e,reason:t,message:n},bubbles:!0,composed:!0})),null}#_(e,t){return t instanceof Error&&(t.name===`AbortError`||t.name===`NotFoundError`)?this.#g(e,`cancelled`):this.#g(e,`error`,t instanceof Error?t.message:String(t))}#v=e=>{ea(e)&&(e.preventDefault(),this.#n++,this.setAttribute(`data-dropping`,``))};#y=e=>{ea(e)&&e.preventDefault()};#b=e=>{ea(e)&&(this.#n=Math.max(0,this.#n-1),this.#n===0&&this.removeAttribute(`data-dropping`))};#x=e=>{if(!ea(e))return;e.preventDefault(),this.#n=0,this.removeAttribute(`data-dropping`);let t=e.dataTransfer?.items;if(!t?.length)return;let n=[];for(let e=0;e<t.length;e++){let r=t[e];r.kind===`file`&&typeof r.getAsFileSystemHandle==`function`&&n.push(r.getAsFileSystemHandle())}n.length!==0&&this.#S(n)};async#S(e){let t;try{t=await Promise.all(e)}catch(e){this.#g(`filesystem`,`error`,e instanceof Error?e.message:String(e));return}let n=t.find(e=>e?.kind===`directory`);if(!n){this.#g(`filesystem`,`cancelled`,`no directory in drop`);return}let r=n,i;if(r.requestPermission)try{i=await r.requestPermission({mode:`readwrite`})}catch(e){this.#g(`filesystem`,`error`,e instanceof Error?e.message:String(e));return}else i=`granted`;if(i!==`granted`){this.#g(`filesystem`,`cancelled`,`permission ${i}`);return}this.#h({kind:`filesystem`,handle:n,source:`drop`,permission:i})}#C(){if(this.#t)return;this.#t=!0;let e=j(`div`,{class:`slicc-permissions__drop-inner`},n(`folder-up`,{size:32}),j(`div`,null,`Drop a folder to mount it (read-write)`));this.#e=j(`div`,{class:`slicc-permissions__drop`,part:`drop`,"aria-hidden":`true`},e),this.append(this.#e)}#w(e,t){let r=e.heading??ia(e.kinds),i=e.grantLabel??`Allow`,a=e.cancelLabel??`Cancel`,o=`slicc-permissions__heading-${Math.random().toString(36).slice(2,8)}`,s=`slicc-permissions__desc-${Math.random().toString(36).slice(2,8)}`,c=j(`button`,{type:`button`,class:`slicc-permissions__prompt-btn`,"data-variant":`ghost`,part:`prompt-cancel`},a),l=j(`button`,{type:`button`,class:`slicc-permissions__prompt-btn`,"data-variant":`primary`,part:`prompt-grant`},i),u=j(`div`,{class:`slicc-permissions__prompt-icons`,"aria-hidden":`true`},...e.kinds.map(e=>j(`span`,{class:`slicc-permissions__prompt-icon`},n(na(e),{size:22})))),d=j(`div`,{class:`slicc-permissions__prompt`,part:`prompt`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":o,"aria-describedby":s,tabindex:`-1`,popover:`manual`},u,j(`h2`,{class:`slicc-permissions__prompt-heading`,id:o},r),j(`p`,{class:`slicc-permissions__prompt-desc`,id:s},e.description),j(`div`,{class:`slicc-permissions__prompt-actions`},c,l));this.append(d);let f=d;if(typeof f.showPopover==`function`)try{f.showPopover()}catch{}let p=!1,m=this.ownerDocument.activeElement??null,h=()=>{if(d.removeEventListener(`keydown`,_),d.remove(),m&&typeof m.focus==`function`)try{m.focus()}catch{}this.#r=null},g=(n,r)=>{if(!p){p=!0;for(let t of e.kinds)this.#g(t,n,r);h(),t({status:`cancelled`,grants:[],reason:n,message:r})}},_=e=>{if(e.key===`Escape`){e.preventDefault(),g(`cancelled`);return}if(e.key===`Tab`){let t=[c,l],n=this.ownerDocument.activeElement,r=t.indexOf(n);if(r===-1){t[0].focus(),e.preventDefault();return}(e.shiftKey?t[(r-1+t.length)%t.length]:t[(r+1)%t.length]).focus(),e.preventDefault()}};c.addEventListener(`click`,()=>g(`cancelled`)),l.addEventListener(`click`,async()=>{if(p)return;p=!0,l.disabled=!0,c.disabled=!0;let n=[],r=null;for(let t of e.kinds){let i=await this.request(t,e.requestOptions?.[t]);if(i)n.push(i);else{r={kind:t,reason:`cancelled`};break}}let i=r?e.kinds.indexOf(r.kind):-1;if(r&&i>=0)for(let t=i+1;t<e.kinds.length;t++)this.#g(e.kinds[t],`cancelled`);h(),t(r?{status:`cancelled`,grants:n,reason:`cancelled`}:{status:`granted`,grants:n})}),d.addEventListener(`keydown`,_),this.#r={cancel:()=>g(`cancelled`)},requestAnimationFrame(()=>{d.setAttribute(`data-open`,``),l.focus()})}};function na(e){switch(e){case`camera`:return`camera`;case`microphone`:return`mic`;case`screenshare`:return`monitor-up`;case`usb`:return`usb`;case`hid`:return`keyboard`;case`serial`:return`cable`;case`filesystem`:return`folder`;case`popup`:return`external-link`}}function ra(e){switch(e){case`camera`:return`camera`;case`microphone`:return`microphone`;case`screenshare`:return`screen`;case`usb`:return`USB device`;case`hid`:return`HID device`;case`serial`:return`serial port`;case`filesystem`:return`folder`;case`popup`:return`sign-in window`}}function ia(e){if(e.length===1)return`Allow access to your ${ra(e[0])}?`;let t=e.map(ra),n=t.pop();return`Allow access to your ${t.join(`, `)} and ${n}?`}A(`slicc-permissions`,ta);var aa=new Set([`top`,`bottom`,`left`,`right`]),oa=M(`
3529
3529
  :host { position: relative; display: inline-flex; }
3530
3530
  :host([hidden]) { display: none; }
3531
3531
  .tip {
@@ -3550,7 +3550,7 @@ slicc-permissions .slicc-permissions__prompt-btn:disabled {
3550
3550
  :host(:hover) .tip[data-p="right"], :host(:focus-within) .tip[data-p="right"], :host([open]) .tip[data-p="right"] { transform: translate(0, -50%); }
3551
3551
  .tip:empty { display: none; }
3552
3552
  @media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
3553
- `);A(`slicc-tooltip`,class extends HTMLElement{static observedAttributes=[`label`,`placement`];#e;#t;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[sa],this.#t=j(`span`,{class:`tip`,part:`tip`,role:`tooltip`,"aria-hidden":`true`}),this.#e.replaceChildren(j(`slot`),this.#t)}connectedCallback(){this.#n()}attributeChangedCallback(){this.#n()}get label(){return this.getAttribute(`label`)??``}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get placement(){let e=this.getAttribute(`placement`);return e&&oa.has(e)?e:`top`}set placement(e){this.setAttribute(`placement`,e)}#n(){this.#t.textContent=this.label,this.#t.setAttribute(`data-p`,this.placement)}});function ca(e,t){let n=e.base;for(let r of e.variants??[])f(r.when,t)&&(r.zones!==void 0||r.center!==void 0)&&(n=r);return n}var la=.02,ua=48,da={top:`Top`,left:`Left`,center:`Center`,right:`Right`,bottom:`Bottom`},fa=class{#e;#t;#n;#r=null;constructor(e){this.#e=e,this.#t=pa(`slicc-layout__ghost`),this.#n=pa(`slicc-layout__targets`)}overlays(){return[this.#n,this.#t]}cancel(){window.removeEventListener(`pointermove`,this.#l),window.removeEventListener(`pointerup`,this.#d),this.#r=null,this.#t.classList.remove(`slicc-layout__ghost--active`),this.#n.replaceChildren(),this.#n.classList.remove(`slicc-layout__targets--active`)}decorateSlot(e,t){if(this.#e.isLocked(t))return;let r=document.createElement(`button`);r.type=`button`,r.className=`slicc-layout__move`,r.title=`Move ${t}`,r.setAttribute(`aria-label`,`Move ${t}`),r.dataset.panelId=t,r.appendChild(n(`grip-vertical`,{size:13})),r.addEventListener(`pointerdown`,e=>this.#a(e,t)),e.appendChild(r)}buildZonePanelDivider(e,t,n,r){if(r)return null;let i=t===`row`,a=pa(`slicc-layout__divider slicc-layout__divider--${i?`h`:`v`}`);return a.dataset.zone=e,a.addEventListener(`pointerdown`,t=>{this.#f(t,e,i,n)}),a}buildZoneDivider(e,t,n,r,i){if(i)return null;let a=pa(`slicc-layout__divider slicc-layout__divider--zone slicc-layout__divider--${n?`h`:`v`}`);return a.dataset.zoneBefore=e,a.dataset.zoneAfter=t,a.addEventListener(`pointerdown`,i=>{this.#i(i,e,t,n,r)}),a}#i(e,t,n,r,i){e.preventDefault();let a=t===`center`?n:t,o=a===t?1:-1,s=i.querySelector(`:scope > [data-zone="${a}"]`);if(!(s instanceof HTMLElement))return;this.#e.setPointerCapture(e.pointerId);let c=s.getBoundingClientRect(),l=r?c.width:c.height,u=r?e.clientX:e.clientY,d=i.getBoundingClientRect(),f=r?d.width:d.height,p=0;for(let e of Array.from(i.children)){if(!(e instanceof HTMLElement)||e===s)continue;let t=e.getBoundingClientRect(),n=r?t.width:t.height,i=e.dataset.zone===`center`||e.classList.contains(`slicc-layout__work-row`);p+=i?ua:n}let m=Math.max(ua,f-p),h=l,g=e=>{let t=r?e.clientX:e.clientY;h=Math.max(ua,Math.min(m,l+(t-u)*o)),this.#e.applyZoneResize(a,`${Math.round(h)}px`),this.#e.rerender()},_=()=>{window.removeEventListener(`pointermove`,g),window.removeEventListener(`pointerup`,_),window.removeEventListener(`pointercancel`,_),this.#e.hasPointerCapture(e.pointerId)&&this.#e.releasePointerCapture(e.pointerId),this.#e.applyZoneResize(a,`${Math.round(h)}px`),this.#e.commitResize()};window.addEventListener(`pointermove`,g),window.addEventListener(`pointerup`,_),window.addEventListener(`pointercancel`,_)}#a(e,t){this.#e.isLocked(t)||(e.preventDefault(),this.#r={panelId:t,zone:null},this.#t.textContent=t,this.#t.classList.add(`slicc-layout__ghost--active`),this.#c(e),this.#o(),window.addEventListener(`pointermove`,this.#l),window.addEventListener(`pointerup`,this.#d))}#o(){let e=this.#e.querySelector(`.slicc-layout__work`);if(!(e instanceof HTMLElement))return;let t=e.getBoundingClientRect();for(let e of h)this.#n.appendChild(_a(e,t));this.#n.classList.add(`slicc-layout__targets--active`)}#s(e){for(let t of Array.from(this.#n.children))t.classList.toggle(`slicc-layout__target--hot`,t===e)}#c(e){this.#t.style.left=`${e.clientX}px`,this.#t.style.top=`${e.clientY}px`}#l=e=>{let t=this.#r;if(!t)return;this.#c(e),t.zone=null;let n=document.elementFromPoint(e.clientX,e.clientY),r=n?.closest(`.slicc-layout__target`);if(r instanceof HTMLElement){let e=r.dataset.zone;if(e){t.zone=e,this.#s(r);return}}let i=n?.closest(`.slicc-layout__zone`),a=i instanceof HTMLElement?i.dataset.zone:null;t.zone=a,this.#s(a?this.#u(a):null)};#u(e){return this.#n.querySelector(`.slicc-layout__target[data-zone="${e}"]`)}#d=()=>{let e=this.#r;this.cancel(),e?.zone&&this.#e.applyMove(e.panelId,e.zone)};#f(e,t,n,r){e.preventDefault();let i=e.currentTarget,a=Array.from(r.querySelectorAll(`:scope > .slicc-layout__slot`)),o=Array.from(r.children).slice(0,Array.from(r.children).indexOf(i)).filter(e=>e.classList.contains(`slicc-layout__slot`)).length;if(o<1||o>=a.length)return;this.#e.setPointerCapture(e.pointerId);let s=a.map(e=>{let t=e.getBoundingClientRect();return Math.max(1,n?t.width:t.height)}),c=s.reduce((e,t)=>e+t,0),l=s.map(e=>e/c*s.length),u=r.getBoundingClientRect(),d=n?u.width:u.height,f=n?e.clientX:e.clientY,p=l.reduce((e,t)=>e+t,0),m=l[o-1]+l[o],h=m*la,g=l[o-1],_=l,v=e=>{let r=n?e.clientX:e.clientY,i=d>0?(r-f)/d*p:0,a=Math.max(h,Math.min(m-h,g+i));_=[...l],_[o-1]=a,_[o]=m-a,this.#e.applyResize(t,_),this.#e.rerender()},y=()=>{window.removeEventListener(`pointermove`,v),window.removeEventListener(`pointerup`,y),window.removeEventListener(`pointercancel`,y),this.#e.hasPointerCapture(e.pointerId)&&this.#e.releasePointerCapture(e.pointerId),this.#e.applyResize(t,_),this.#e.commitResize()};window.addEventListener(`pointermove`,v),window.addEventListener(`pointerup`,y),window.addEventListener(`pointercancel`,y)}};function pa(e){let t=document.createElement(`div`);return t.className=e,t}var ma={top:`arrow-up`,bottom:`arrow-down`,left:`arrow-left`,right:`arrow-right`,center:`square`},ha=56,ga=16;function _a(e,t){let r=pa(`slicc-layout__target slicc-layout__target--${e}`);r.dataset.zone=e,r.title=`Move to ${da[e]}`,r.appendChild(n(ma[e],{size:20}));let i=pa(`slicc-layout__target-label`);i.textContent=da[e],r.appendChild(i);let a=t.left+t.width/2-ha/2,o=t.top+t.height/2-ha/2,[s,c]={center:[a,o],top:[a,t.top+ga],bottom:[a,t.bottom-ha-ga],left:[t.left+ga,o],right:[t.right-ha-ga,o]}[e];return r.style.left=`${s}px`,r.style.top=`${c}px`,r}var va=`
3553
+ `);A(`slicc-tooltip`,class extends HTMLElement{static observedAttributes=[`label`,`placement`];#e;#t;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[oa],this.#t=j(`span`,{class:`tip`,part:`tip`,role:`tooltip`,"aria-hidden":`true`}),this.#e.replaceChildren(j(`slot`),this.#t)}connectedCallback(){this.#n()}attributeChangedCallback(){this.#n()}get label(){return this.getAttribute(`label`)??``}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get placement(){let e=this.getAttribute(`placement`);return e&&aa.has(e)?e:`top`}set placement(e){this.setAttribute(`placement`,e)}#n(){this.#t.textContent=this.label,this.#t.setAttribute(`data-p`,this.placement)}});function sa(e,t){let n=e.base;for(let r of e.variants??[])f(r.when,t)&&(r.zones!==void 0||r.center!==void 0)&&(n=r);return n}var ca=.02,la=48,ua={top:`Top`,left:`Left`,center:`Center`,right:`Right`,bottom:`Bottom`},da=class{#e;#t;#n;#r=null;constructor(e){this.#e=e,this.#t=fa(`slicc-layout__ghost`),this.#n=fa(`slicc-layout__targets`)}overlays(){return[this.#n,this.#t]}cancel(){window.removeEventListener(`pointermove`,this.#l),window.removeEventListener(`pointerup`,this.#d),this.#r=null,this.#t.classList.remove(`slicc-layout__ghost--active`),this.#n.replaceChildren(),this.#n.classList.remove(`slicc-layout__targets--active`)}decorateSlot(e,t){if(this.#e.isLocked(t))return;let r=document.createElement(`button`);r.type=`button`,r.className=`slicc-layout__move`,r.title=`Move ${t}`,r.setAttribute(`aria-label`,`Move ${t}`),r.dataset.panelId=t,r.appendChild(n(`grip-vertical`,{size:13})),r.addEventListener(`pointerdown`,e=>this.#a(e,t)),e.appendChild(r)}buildZonePanelDivider(e,t,n,r){if(r)return null;let i=t===`row`,a=fa(`slicc-layout__divider slicc-layout__divider--${i?`h`:`v`}`);return a.dataset.zone=e,a.addEventListener(`pointerdown`,t=>{this.#f(t,e,i,n)}),a}buildZoneDivider(e,t,n,r,i){if(i)return null;let a=fa(`slicc-layout__divider slicc-layout__divider--zone slicc-layout__divider--${n?`h`:`v`}`);return a.dataset.zoneBefore=e,a.dataset.zoneAfter=t,a.addEventListener(`pointerdown`,i=>{this.#i(i,e,t,n,r)}),a}#i(e,t,n,r,i){e.preventDefault();let a=t===`center`?n:t,o=a===t?1:-1,s=i.querySelector(`:scope > [data-zone="${a}"]`);if(!(s instanceof HTMLElement))return;this.#e.setPointerCapture(e.pointerId);let c=s.getBoundingClientRect(),l=r?c.width:c.height,u=r?e.clientX:e.clientY,d=i.getBoundingClientRect(),f=r?d.width:d.height,p=0;for(let e of Array.from(i.children)){if(!(e instanceof HTMLElement)||e===s)continue;let t=e.getBoundingClientRect(),n=r?t.width:t.height,i=e.dataset.zone===`center`||e.classList.contains(`slicc-layout__work-row`);p+=i?la:n}let m=Math.max(la,f-p),h=l,g=e=>{let t=r?e.clientX:e.clientY;h=Math.max(la,Math.min(m,l+(t-u)*o)),this.#e.applyZoneResize(a,`${Math.round(h)}px`),this.#e.rerender()},_=()=>{window.removeEventListener(`pointermove`,g),window.removeEventListener(`pointerup`,_),window.removeEventListener(`pointercancel`,_),this.#e.hasPointerCapture(e.pointerId)&&this.#e.releasePointerCapture(e.pointerId),this.#e.applyZoneResize(a,`${Math.round(h)}px`),this.#e.commitResize()};window.addEventListener(`pointermove`,g),window.addEventListener(`pointerup`,_),window.addEventListener(`pointercancel`,_)}#a(e,t){this.#e.isLocked(t)||(e.preventDefault(),this.#r={panelId:t,zone:null},this.#t.textContent=t,this.#t.classList.add(`slicc-layout__ghost--active`),this.#c(e),this.#o(),window.addEventListener(`pointermove`,this.#l),window.addEventListener(`pointerup`,this.#d))}#o(){let e=this.#e.querySelector(`.slicc-layout__work`);if(!(e instanceof HTMLElement))return;let t=e.getBoundingClientRect();for(let e of h)this.#n.appendChild(ga(e,t));this.#n.classList.add(`slicc-layout__targets--active`)}#s(e){for(let t of Array.from(this.#n.children))t.classList.toggle(`slicc-layout__target--hot`,t===e)}#c(e){this.#t.style.left=`${e.clientX}px`,this.#t.style.top=`${e.clientY}px`}#l=e=>{let t=this.#r;if(!t)return;this.#c(e),t.zone=null;let n=document.elementFromPoint(e.clientX,e.clientY),r=n?.closest(`.slicc-layout__target`);if(r instanceof HTMLElement){let e=r.dataset.zone;if(e){t.zone=e,this.#s(r);return}}let i=n?.closest(`.slicc-layout__zone`),a=i instanceof HTMLElement?i.dataset.zone:null;t.zone=a,this.#s(a?this.#u(a):null)};#u(e){return this.#n.querySelector(`.slicc-layout__target[data-zone="${e}"]`)}#d=()=>{let e=this.#r;this.cancel(),e?.zone&&this.#e.applyMove(e.panelId,e.zone)};#f(e,t,n,r){e.preventDefault();let i=e.currentTarget,a=Array.from(r.querySelectorAll(`:scope > .slicc-layout__slot`)),o=Array.from(r.children).slice(0,Array.from(r.children).indexOf(i)).filter(e=>e.classList.contains(`slicc-layout__slot`)).length;if(o<1||o>=a.length)return;this.#e.setPointerCapture(e.pointerId);let s=a.map(e=>{let t=e.getBoundingClientRect();return Math.max(1,n?t.width:t.height)}),c=s.reduce((e,t)=>e+t,0),l=s.map(e=>e/c*s.length),u=r.getBoundingClientRect(),d=n?u.width:u.height,f=n?e.clientX:e.clientY,p=l.reduce((e,t)=>e+t,0),m=l[o-1]+l[o],h=m*ca,g=l[o-1],_=l,v=e=>{let r=n?e.clientX:e.clientY,i=d>0?(r-f)/d*p:0,a=Math.max(h,Math.min(m-h,g+i));_=[...l],_[o-1]=a,_[o]=m-a,this.#e.applyResize(t,_),this.#e.rerender()},y=()=>{window.removeEventListener(`pointermove`,v),window.removeEventListener(`pointerup`,y),window.removeEventListener(`pointercancel`,y),this.#e.hasPointerCapture(e.pointerId)&&this.#e.releasePointerCapture(e.pointerId),this.#e.applyResize(t,_),this.#e.commitResize()};window.addEventListener(`pointermove`,v),window.addEventListener(`pointerup`,y),window.addEventListener(`pointercancel`,y)}};function fa(e){let t=document.createElement(`div`);return t.className=e,t}var pa={top:`arrow-up`,bottom:`arrow-down`,left:`arrow-left`,right:`arrow-right`,center:`square`},ma=56,ha=16;function ga(e,t){let r=fa(`slicc-layout__target slicc-layout__target--${e}`);r.dataset.zone=e,r.title=`Move to ${ua[e]}`,r.appendChild(n(pa[e],{size:20}));let i=fa(`slicc-layout__target-label`);i.textContent=ua[e],r.appendChild(i);let a=t.left+t.width/2-ma/2,o=t.top+t.height/2-ma/2,[s,c]={center:[a,o],top:[a,t.top+ha],bottom:[a,t.bottom-ma-ha],left:[t.left+ha,o],right:[t.right-ma-ha,o]}[e];return r.style.left=`${s}px`,r.style.top=`${c}px`,r}var _a=`
3554
3554
  /* The corner grip: hidden until the slot is hovered, mirroring the dock-tree's
3555
3555
  (and slicc-file-tree's) hover-reveal action pattern — a persistent title bar on
3556
3556
  every panel was the thing the redesign set out to remove. */
@@ -3656,7 +3656,7 @@ slicc-layout .slicc-layout__target--hot {
3656
3656
  color: #fff;
3657
3657
  transform: scale(1.12);
3658
3658
  }
3659
- `,ya=`
3659
+ `,va=`
3660
3660
  [data-slicc-panel] {
3661
3661
  display: flex;
3662
3662
  flex-direction: column;
@@ -3695,7 +3695,7 @@ slicc-layout .slicc-layout__target--hot {
3695
3695
  [data-slicc-panel][presentation="floating"][anchor="center"] {
3696
3696
  top: 50%; left: 50%; transform: translate(-50%, -50%);
3697
3697
  }
3698
- `,ba=`slicc-panel-style`;function xa(e){if(e.getElementById(ba))return;let t=e.createElement(`style`);t.id=ba,t.textContent=ya,(e.head??e.documentElement).appendChild(t)}var Sa=`data-slicc-panel`;A(`slicc-panel`,class extends HTMLElement{static observedAttributes=[`panel-id`,`hidden`,`locked`,`presentation`,`anchor`];static panelMeta;#e=null;connectedCallback(){xa(this.ownerDocument),this.setAttribute(Sa,``),this.setAttribute(`part`,`panel`),this.hasAttribute(`presentation`)||this.setAttribute(`presentation`,this.presentation),!this.hasAttribute(`anchor`)&&this.anchor&&this.setAttribute(`anchor`,this.anchor),this.#t(),this.visible&&this.onPanelShow?.()}disconnectedCallback(){this.#e?.disconnect(),this.#e=null}attributeChangedCallback(e,t,n){if(!this.isConnected||t===n||e!==`hidden`)return;let r=this.visible;r?this.onPanelShow?.():this.onPanelHide?.(),this.dispatchEvent(new CustomEvent(`slicc-panel-visibility`,{bubbles:!0,composed:!0,detail:{panelId:this.panelId,visible:r}}))}get panelId(){return this.getAttribute(`panel-id`)??S(this.constructor)?.id??null}set panelId(e){e==null?this.removeAttribute(`panel-id`):this.setAttribute(`panel-id`,e)}get visible(){return!this.hasAttribute(`hidden`)}set visible(e){this.toggleAttribute(`hidden`,!e)}get locked(){return this.hasAttribute(`locked`)}set locked(e){this.toggleAttribute(`locked`,e)}get presentation(){let e=this.getAttribute(`presentation`);return e===`floating`||e===`docked`?e:S(this.constructor)?.presentation??`docked`}set presentation(e){this.setAttribute(`presentation`,e)}get anchor(){let e=this.getAttribute(`anchor`);return x(e)?e:S(this.constructor)?.anchor??null}set anchor(e){e==null?this.removeAttribute(`anchor`):this.setAttribute(`anchor`,e)}get meta(){return S(this.constructor)}#t(){!this.onPanelResize||typeof ResizeObserver>`u`||(this.#e=new ResizeObserver(e=>{let t=e[0]?.contentRect;t&&this.onPanelResize?.(t)}),this.#e.observe(this))}});var Ca=`
3698
+ `,ya=`slicc-panel-style`;function ba(e){if(e.getElementById(ya))return;let t=e.createElement(`style`);t.id=ya,t.textContent=va,(e.head??e.documentElement).appendChild(t)}var xa=`data-slicc-panel`;A(`slicc-panel`,class extends HTMLElement{static observedAttributes=[`panel-id`,`hidden`,`locked`,`presentation`,`anchor`];static panelMeta;#e=null;connectedCallback(){ba(this.ownerDocument),this.setAttribute(xa,``),this.setAttribute(`part`,`panel`),this.hasAttribute(`presentation`)||this.setAttribute(`presentation`,this.presentation),!this.hasAttribute(`anchor`)&&this.anchor&&this.setAttribute(`anchor`,this.anchor),this.#t(),this.visible&&this.onPanelShow?.()}disconnectedCallback(){this.#e?.disconnect(),this.#e=null}attributeChangedCallback(e,t,n){if(!this.isConnected||t===n||e!==`hidden`)return;let r=this.visible;r?this.onPanelShow?.():this.onPanelHide?.(),this.dispatchEvent(new CustomEvent(`slicc-panel-visibility`,{bubbles:!0,composed:!0,detail:{panelId:this.panelId,visible:r}}))}get panelId(){return this.getAttribute(`panel-id`)??S(this.constructor)?.id??null}set panelId(e){e==null?this.removeAttribute(`panel-id`):this.setAttribute(`panel-id`,e)}get visible(){return!this.hasAttribute(`hidden`)}set visible(e){this.toggleAttribute(`hidden`,!e)}get locked(){return this.hasAttribute(`locked`)}set locked(e){this.toggleAttribute(`locked`,e)}get presentation(){let e=this.getAttribute(`presentation`);return e===`floating`||e===`docked`?e:S(this.constructor)?.presentation??`docked`}set presentation(e){this.setAttribute(`presentation`,e)}get anchor(){let e=this.getAttribute(`anchor`);return x(e)?e:S(this.constructor)?.anchor??null}set anchor(e){e==null?this.removeAttribute(`anchor`):this.setAttribute(`anchor`,e)}get meta(){return S(this.constructor)}#t(){!this.onPanelResize||typeof ResizeObserver>`u`||(this.#e=new ResizeObserver(e=>{let t=e[0]?.contentRect;t&&this.onPanelResize?.(t)}),this.#e.observe(this))}});var Sa=`
3699
3699
  slicc-layout {
3700
3700
  display: flex;
3701
3701
  flex-direction: column;
@@ -3794,7 +3794,7 @@ slicc-layout .slicc-layout__zone {
3794
3794
  sit side by side or stacked — see zoneAxis(). */
3795
3795
  slicc-layout .slicc-layout__zone[data-axis='row'] { flex-direction: row; }
3796
3796
  slicc-layout .slicc-layout__zone[data-axis='col'] { flex-direction: column; }
3797
- ${va}`,wa=`slicc-layout-style`;function Ta(e){if(e.getElementById(wa))return;let t=e.createElement(`style`);t.id=wa,t.textContent=Ca,(e.head??e.documentElement).appendChild(t)}function Ea(e,t){let n=document.createElement(e);return n.className=t,n}var Da=class extends HTMLElement{static observedAttributes=[`platform`];#e=m();#t=null;#n=!1;#r=Ea(`div`,`slicc-layout__root`);#i=Ea(`div`,`slicc-layout__parking`);#a=new Set;#o=null;#s=null;#c=0;#l=new MutationObserver(()=>this.#f());#u=new fa(this);connectedCallback(){Ta(this.ownerDocument),this.#n=!0,this.#r.parentElement!==this&&this.append(this.#r),this.#i.parentElement!==this&&this.append(this.#i);for(let e of this.#u.overlays())e.parentElement!==this&&this.append(e);this.#v(),this.#f(),this.#l.observe(this,{childList:!0})}disconnectedCallback(){this.#n=!1,this.#l.disconnect(),this.#u.cancel(),this.#s?.disconnect(),this.#s=null,this.#c&&cancelAnimationFrame(this.#c),this.#c=0}attributeChangedCallback(e,t,n){e!==`platform`||t===n||!this.#n||this.#f(`environment`)}setLayout(e){this.#e=e?v(e):m(),this.#n&&this.#f(`set`)}getLayout(){return v(this.#e)}getResolved(){return this.#t?v(this.#t):null}getPlacedPanelIds(){return this.#t?g(this.#t).filter(e=>this.#a.has(e)):[]}isLocked(e){let t=this.#o??this.#t;return t?l(t,e):!1}environment(){let e=this.getBoundingClientRect(),t=this.getAttribute(`platform`);return{width:e.width,height:e.height,platform:t===`web`||t===`extension`||t===`electron`?t:void 0}}#d(){let e=new Map;for(let t of Array.from(this.querySelectorAll(`[${Sa}]`))){if(!(t instanceof HTMLElement)||t.parentElement?.closest(`[data-slicc-panel]`))continue;let n=t.getAttribute(`panel-id`);n&&e.set(n,t)}return e}#f(e=`set`,t){let n=y(this.#e,this.environment());this.#o=n;let r=this.#d(),i=new Set,a=e=>this.#p(n,e,r,i),o=Ea(`div`,`slicc-layout__row`),s=a(`left`),c=a(`right`);s&&o.appendChild(s);let l=this.#m(n,r,i);l.style.flex=`1 1 0`,o.appendChild(l),c&&o.appendChild(c);let u=[],d=a(`top`);d&&u.push(d),u.push(o);let f=a(`bottom`);f&&u.push(f);let p=this.#g(n,r,i);p&&u.push(p);for(let[e,t]of r)i.has(e)||t.parentElement!==this.#i&&this.#i.appendChild(t);this.#r.replaceChildren(...u),this.#l.takeRecords(),this.#t=n,this.#a=i,this.#o=null,!t?.silent&&this.dispatchEvent(new CustomEvent(`slicc-layout-change`,{bubbles:!0,composed:!0,detail:{layout:v(n),reason:e}}))}#p(e,t,n,r){let i=e.docks.filter(e=>e.edge===t);if(i.length===0)return null;let a=[];for(let o of i){let i=Ea(`div`,`slicc-layout__dock slicc-layout__dock--${t}`);i.dataset.edge=t;let s=!1;for(let t of o.panels){let a=n.get(t);!a||e.panels[t]?.visible===!1||(this.#_(a,e,t),i.appendChild(a),r.add(t),s=!0)}s&&(i.style.flex=o.size==null?`0 0 auto`:d(o.size),a.push(i))}if(a.length===0)return null;if(a.length===1)return a[0];let o=Ea(`div`,`slicc-layout__dockstack slicc-layout__dockstack--${t}`);return o.dataset.edge=t,o.append(...a),o.style.flex=`0 0 auto`,o}#m(e,t,n){let r=e.zones??(e.center?p(e.center):{}),i=Ea(`div`,`slicc-layout__work`),a=i=>{let a=e.locked||(r.locked??[]).includes(i),o=(r[i]??[]).map(r=>this.#h(r,i,e,t,n)).filter(e=>e!==null);if(o.length===0)return null;let s=Ea(`div`,`slicc-layout__zone slicc-layout__zone--${i}`);s.dataset.zone=i;let c=_(r,i);s.dataset.axis=c,o.forEach((e,t)=>{if(t>0){let e=this.#u.buildZonePanelDivider(i,c,s,a);e&&s.appendChild(e)}s.appendChild(e)});let l=r.sizes?.[i];return s.style.flex=i===`center`?`1 1 0`:d(l??void 0),s},o=(t,n,i)=>{let o=n.map(e=>({zone:e,element:a(e)})).filter(e=>!!e.element);o.forEach((n,a)=>{if(a>0){let s=o[a-1].zone,c=e.locked||(r.locked??[]).includes(s)||(r.locked??[]).includes(n.zone),l=this.#u.buildZoneDivider(s,n.zone,i,t,c);l&&t.appendChild(l)}t.appendChild(n.element)})},s=Ea(`div`,`slicc-layout__work-row`);o(s,[`left`,`center`,`right`],!0);let c=a(`top`),l=a(`bottom`),u=[];return c&&u.push({zone:`top`,element:c}),u.push({zone:`center`,element:s}),l&&u.push({zone:`bottom`,element:l}),u.forEach((t,n)=>{if(n>0){let a=u[n-1].zone,o=e.locked||(r.locked??[]).includes(a)||(r.locked??[]).includes(t.zone),s=this.#u.buildZoneDivider(a,t.zone,!1,i,o);s&&i.appendChild(s)}i.appendChild(t.element)}),i}#h(e,t,n,r,i){let a=r.get(e);if(!a||n.panels[e]?.visible===!1)return null;let o=Ea(`div`,`slicc-layout__slot`);return o.dataset.panelId=e,o.dataset.zone=t,o.style.flex=d(n.panels[e]?.size??void 0),this.#_(a,n,e),o.appendChild(a),this.#u.decorateSlot(o,e),i.add(e),o}applyMove(e,t){if(this.isLocked(e))return;let n=ca(this.#e,this.environment()),r=n.zones??p(n.center??null),i=u(r,e,t);i===r&&n.zones||(n.zones=i,n.center=null,this.#f(`rearrange`))}applyResize(e,t){let n=ca(this.#e,this.environment()).zones,r=n?.[e];if(!n||!r||r.length!==t.length)return;let i={...this.#e.panels??{}};r.forEach((e,n)=>{i[e]={...i[e],size:t[n]}}),this.#e.panels=i}applyZoneResize(e,t){let n=ca(this.#e,this.environment());n.zones&&(n.zones.sizes={...n.zones.sizes,[e]:t})}rerender(){this.#f(`resize`,{silent:!0})}commitResize(){this.#f(`resize`)}#g(e,t,n){if(e.floating.length===0)return null;let r=Ea(`div`,`slicc-layout__floating`),i=!1;for(let a of e.floating){let o=t.get(a.panel);!o||e.panels[a.panel]?.visible===!1||(this.#_(o,e,a.panel),o.setAttribute(`presentation`,`floating`),a.anchor&&o.setAttribute(`anchor`,a.anchor),a.width!=null&&(o.style.width=Oa(a.width)),a.height!=null&&(o.style.height=Oa(a.height)),r.appendChild(o),n.add(a.panel),i=!0)}return i?r:null}#_(e,t,n){e.toggleAttribute(`locked`,l(t,n)),e.removeAttribute(`hidden`),e.setAttribute(`presentation`,`docked`),e.removeAttribute(`anchor`),e.style.removeProperty(`width`),e.style.removeProperty(`height`)}#v(){typeof ResizeObserver>`u`||(this.#s=new ResizeObserver(()=>{this.#e.variants?.length&&(this.#c||=requestAnimationFrame(()=>{this.#c=0;let e=y(this.#e,this.environment()),t=this.#t?.appliedVariants.join(`,`)??``;e.appliedVariants.join(`,`)!==t&&this.#f(`viewport`)}))}),this.#s.observe(this))}};function Oa(e){return typeof e==`number`?`${e}px`:e}A(`slicc-layout`,Da);var ka=M(`
3797
+ ${_a}`,Ca=`slicc-layout-style`;function wa(e){if(e.getElementById(Ca))return;let t=e.createElement(`style`);t.id=Ca,t.textContent=Sa,(e.head??e.documentElement).appendChild(t)}function Ta(e,t){let n=document.createElement(e);return n.className=t,n}var Ea=class extends HTMLElement{static observedAttributes=[`platform`];#e=m();#t=null;#n=!1;#r=Ta(`div`,`slicc-layout__root`);#i=Ta(`div`,`slicc-layout__parking`);#a=new Set;#o=null;#s=null;#c=0;#l=new MutationObserver(()=>this.#f());#u=new da(this);connectedCallback(){wa(this.ownerDocument),this.#n=!0,this.#r.parentElement!==this&&this.append(this.#r),this.#i.parentElement!==this&&this.append(this.#i);for(let e of this.#u.overlays())e.parentElement!==this&&this.append(e);this.#v(),this.#f(),this.#l.observe(this,{childList:!0})}disconnectedCallback(){this.#n=!1,this.#l.disconnect(),this.#u.cancel(),this.#s?.disconnect(),this.#s=null,this.#c&&cancelAnimationFrame(this.#c),this.#c=0}attributeChangedCallback(e,t,n){e!==`platform`||t===n||!this.#n||this.#f(`environment`)}setLayout(e){this.#e=e?v(e):m(),this.#n&&this.#f(`set`)}getLayout(){return v(this.#e)}getResolved(){return this.#t?v(this.#t):null}getPlacedPanelIds(){return this.#t?g(this.#t).filter(e=>this.#a.has(e)):[]}isLocked(e){let t=this.#o??this.#t;return t?l(t,e):!1}environment(){let e=this.getBoundingClientRect(),t=this.getAttribute(`platform`);return{width:e.width,height:e.height,platform:t===`web`||t===`extension`||t===`electron`?t:void 0}}#d(){let e=new Map;for(let t of Array.from(this.querySelectorAll(`[${xa}]`))){if(!(t instanceof HTMLElement)||t.parentElement?.closest(`[data-slicc-panel]`))continue;let n=t.getAttribute(`panel-id`);n&&e.set(n,t)}return e}#f(e=`set`,t){let n=y(this.#e,this.environment());this.#o=n;let r=this.#d(),i=new Set,a=e=>this.#p(n,e,r,i),o=Ta(`div`,`slicc-layout__row`),s=a(`left`),c=a(`right`);s&&o.appendChild(s);let l=this.#m(n,r,i);l.style.flex=`1 1 0`,o.appendChild(l),c&&o.appendChild(c);let u=[],d=a(`top`);d&&u.push(d),u.push(o);let f=a(`bottom`);f&&u.push(f);let p=this.#g(n,r,i);p&&u.push(p);for(let[e,t]of r)i.has(e)||t.parentElement!==this.#i&&this.#i.appendChild(t);this.#r.replaceChildren(...u),this.#l.takeRecords(),this.#t=n,this.#a=i,this.#o=null,!t?.silent&&this.dispatchEvent(new CustomEvent(`slicc-layout-change`,{bubbles:!0,composed:!0,detail:{layout:v(n),reason:e}}))}#p(e,t,n,r){let i=e.docks.filter(e=>e.edge===t);if(i.length===0)return null;let a=[];for(let o of i){let i=Ta(`div`,`slicc-layout__dock slicc-layout__dock--${t}`);i.dataset.edge=t;let s=!1;for(let t of o.panels){let a=n.get(t);!a||e.panels[t]?.visible===!1||(this.#_(a,e,t),i.appendChild(a),r.add(t),s=!0)}s&&(i.style.flex=o.size==null?`0 0 auto`:d(o.size),a.push(i))}if(a.length===0)return null;if(a.length===1)return a[0];let o=Ta(`div`,`slicc-layout__dockstack slicc-layout__dockstack--${t}`);return o.dataset.edge=t,o.append(...a),o.style.flex=`0 0 auto`,o}#m(e,t,n){let r=e.zones??(e.center?p(e.center):{}),i=Ta(`div`,`slicc-layout__work`),a=i=>{let a=e.locked||(r.locked??[]).includes(i),o=(r[i]??[]).map(r=>this.#h(r,i,e,t,n)).filter(e=>e!==null);if(o.length===0)return null;let s=Ta(`div`,`slicc-layout__zone slicc-layout__zone--${i}`);s.dataset.zone=i;let c=_(r,i);s.dataset.axis=c,o.forEach((e,t)=>{if(t>0){let e=this.#u.buildZonePanelDivider(i,c,s,a);e&&s.appendChild(e)}s.appendChild(e)});let l=r.sizes?.[i];return s.style.flex=i===`center`?`1 1 0`:d(l??void 0),s},o=(t,n,i)=>{let o=n.map(e=>({zone:e,element:a(e)})).filter(e=>!!e.element);o.forEach((n,a)=>{if(a>0){let s=o[a-1].zone,c=e.locked||(r.locked??[]).includes(s)||(r.locked??[]).includes(n.zone),l=this.#u.buildZoneDivider(s,n.zone,i,t,c);l&&t.appendChild(l)}t.appendChild(n.element)})},s=Ta(`div`,`slicc-layout__work-row`);o(s,[`left`,`center`,`right`],!0);let c=a(`top`),l=a(`bottom`),u=[];return c&&u.push({zone:`top`,element:c}),u.push({zone:`center`,element:s}),l&&u.push({zone:`bottom`,element:l}),u.forEach((t,n)=>{if(n>0){let a=u[n-1].zone,o=e.locked||(r.locked??[]).includes(a)||(r.locked??[]).includes(t.zone),s=this.#u.buildZoneDivider(a,t.zone,!1,i,o);s&&i.appendChild(s)}i.appendChild(t.element)}),i}#h(e,t,n,r,i){let a=r.get(e);if(!a||n.panels[e]?.visible===!1)return null;let o=Ta(`div`,`slicc-layout__slot`);return o.dataset.panelId=e,o.dataset.zone=t,o.style.flex=d(n.panels[e]?.size??void 0),this.#_(a,n,e),o.appendChild(a),this.#u.decorateSlot(o,e),i.add(e),o}applyMove(e,t){if(this.isLocked(e))return;let n=sa(this.#e,this.environment()),r=n.zones??p(n.center??null),i=u(r,e,t);i===r&&n.zones||(n.zones=i,n.center=null,this.#f(`rearrange`))}applyResize(e,t){let n=sa(this.#e,this.environment()).zones,r=n?.[e];if(!n||!r||r.length!==t.length)return;let i={...this.#e.panels??{}};r.forEach((e,n)=>{i[e]={...i[e],size:t[n]}}),this.#e.panels=i}applyZoneResize(e,t){let n=sa(this.#e,this.environment());n.zones&&(n.zones.sizes={...n.zones.sizes,[e]:t})}rerender(){this.#f(`resize`,{silent:!0})}commitResize(){this.#f(`resize`)}#g(e,t,n){if(e.floating.length===0)return null;let r=Ta(`div`,`slicc-layout__floating`),i=!1;for(let a of e.floating){let o=t.get(a.panel);!o||e.panels[a.panel]?.visible===!1||(this.#_(o,e,a.panel),o.setAttribute(`presentation`,`floating`),a.anchor&&o.setAttribute(`anchor`,a.anchor),a.width!=null&&(o.style.width=Da(a.width)),a.height!=null&&(o.style.height=Da(a.height)),r.appendChild(o),n.add(a.panel),i=!0)}return i?r:null}#_(e,t,n){e.toggleAttribute(`locked`,l(t,n)),e.removeAttribute(`hidden`),e.setAttribute(`presentation`,`docked`),e.removeAttribute(`anchor`),e.style.removeProperty(`width`),e.style.removeProperty(`height`)}#v(){typeof ResizeObserver>`u`||(this.#s=new ResizeObserver(()=>{this.#e.variants?.length&&(this.#c||=requestAnimationFrame(()=>{this.#c=0;let e=y(this.#e,this.environment()),t=this.#t?.appliedVariants.join(`,`)??``;e.appliedVariants.join(`,`)!==t&&this.#f(`viewport`)}))}),this.#s.observe(this))}};function Da(e){return typeof e==`number`?`${e}px`:e}A(`slicc-layout`,Ea);var Oa=M(`
3798
3798
  :host {
3799
3799
  display: inline-grid;
3800
3800
  place-items: center;
@@ -3841,7 +3841,7 @@ ${va}`,wa=`slicc-layout-style`;function Ta(e){if(e.getElementById(wa))return;let
3841
3841
  object-fit: cover;
3842
3842
  display: block;
3843
3843
  }
3844
- `),Aa=class extends HTMLElement{static observedAttributes=[`initials`,`name`,`src`,`email`,`size`,`label`];#e;#t=0;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ka],this.addEventListener(`click`,this.#i),this.addEventListener(`keydown`,this.#a)}connectedCallback(){this.hasAttribute(`role`)||this.setAttribute(`role`,`button`),this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`),this.#o()}disconnectedCallback(){this.#t++}attributeChangedCallback(e,t,n){e===`size`&&this.#r(n),this.isConnected&&this.#o()}get initials(){return this.getAttribute(`initials`)}set initials(e){e==null?this.removeAttribute(`initials`):this.setAttribute(`initials`,e)}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get email(){return this.getAttribute(`email`)}set email(e){e==null?this.removeAttribute(`email`):this.setAttribute(`email`,e)}get size(){return this.getAttribute(`size`)}set size(e){e==null?this.removeAttribute(`size`):this.setAttribute(`size`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get resolvedInitials(){let e=this.initials;return e!=null&&e.trim()!==``?e.trim().slice(0,2).toUpperCase():Ma(this.name)||`?`}async gravatarUrl(e=this.email){let t=e?.trim().toLowerCase();return t?`https://www.gravatar.com/avatar/${await ja(t)}?s=${this.#n()}&d=404`:null}#n(){let e=this.getBoundingClientRect().width;return Math.max(1,Math.round((e>0?e:30)*2))}#r(e){e==null||e.trim()===``?this.style.removeProperty(`--avatar-size`):this.style.setProperty(`--avatar-size`,e)}#i=()=>{this.dispatchEvent(new CustomEvent(`slicc-avatar-click`,{bubbles:!0,composed:!0}))};#a=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.click())};#o(){let e=++this.#t,t=this.src,n=this.email,r=this.resolvedInitials,i=this.label??this.name??(r===`?`?`Account`:r);this.setAttribute(`aria-label`,i);let a=[j(`span`,{class:`ini`,part:`initials`},r)];if(t){let n=j(`img`,{class:`img`,part:`image`,src:t,alt:i});n.addEventListener(`load`,()=>{e===this.#t&&this.#e.querySelector(`.me`)?.classList.add(`has-img`)}),n.addEventListener(`error`,()=>{e===this.#t&&(n.remove(),this.#e.querySelector(`.me`)?.classList.remove(`has-img`))}),a.push(n)}let o=j(`div`,{class:`me`,part:`avatar`},j(`slot`,null,...a));this.#e.replaceChildren(o),!t&&n&&this.#s(n,e)}#s(e,t){this.gravatarUrl(e).then(e=>{if(!e||t!==this.#t)return;let n=new Image;n.onload=()=>{if(t!==this.#t||!this.isConnected)return;let n=this.#e.querySelector(`.me`);n&&(n.style.backgroundImage=`url("${e}")`,n.classList.add(`has-img`))},n.src=e}).catch(()=>{})}};async function ja(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function Ma(e){if(!e)return``;let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?``:t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}A(`slicc-avatar`,Aa);var Na=5,Pa=1;function Fa(e){return e.replace(`claude-`,``)}function Ia(e){return e==null||e===0?``:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function La(e){if(e.length<=Na)return{individuals:e,buckets:[]};let t=[...e].sort((e,t)=>t.cost-e.cost),n=t.slice(0,Na),r=[],i={count:0,cost:0};for(let e of t.slice(Na))i.count+=1,i.cost+=e.cost,i.cost>=Pa&&(r.push(i),i={count:0,cost:0});if(i.count>0){let e=r.at(-1);e?(e.count+=i.count,e.cost+=i.cost):r.push(i)}return{individuals:n,buckets:r}}var Ra=M(`
3844
+ `),ka=class extends HTMLElement{static observedAttributes=[`initials`,`name`,`src`,`email`,`size`,`label`];#e;#t=0;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Oa],this.addEventListener(`click`,this.#i),this.addEventListener(`keydown`,this.#a)}connectedCallback(){this.hasAttribute(`role`)||this.setAttribute(`role`,`button`),this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`),this.#o()}disconnectedCallback(){this.#t++}attributeChangedCallback(e,t,n){e===`size`&&this.#r(n),this.isConnected&&this.#o()}get initials(){return this.getAttribute(`initials`)}set initials(e){e==null?this.removeAttribute(`initials`):this.setAttribute(`initials`,e)}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get email(){return this.getAttribute(`email`)}set email(e){e==null?this.removeAttribute(`email`):this.setAttribute(`email`,e)}get size(){return this.getAttribute(`size`)}set size(e){e==null?this.removeAttribute(`size`):this.setAttribute(`size`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get resolvedInitials(){let e=this.initials;return e!=null&&e.trim()!==``?e.trim().slice(0,2).toUpperCase():ja(this.name)||`?`}async gravatarUrl(e=this.email){let t=e?.trim().toLowerCase();return t?`https://www.gravatar.com/avatar/${await Aa(t)}?s=${this.#n()}&d=404`:null}#n(){let e=this.getBoundingClientRect().width;return Math.max(1,Math.round((e>0?e:30)*2))}#r(e){e==null||e.trim()===``?this.style.removeProperty(`--avatar-size`):this.style.setProperty(`--avatar-size`,e)}#i=()=>{this.dispatchEvent(new CustomEvent(`slicc-avatar-click`,{bubbles:!0,composed:!0}))};#a=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.click())};#o(){let e=++this.#t,t=this.src,n=this.email,r=this.resolvedInitials,i=this.label??this.name??(r===`?`?`Account`:r);this.setAttribute(`aria-label`,i);let a=[j(`span`,{class:`ini`,part:`initials`},r)];if(t){let n=j(`img`,{class:`img`,part:`image`,src:t,alt:i});n.addEventListener(`load`,()=>{e===this.#t&&this.#e.querySelector(`.me`)?.classList.add(`has-img`)}),n.addEventListener(`error`,()=>{e===this.#t&&(n.remove(),this.#e.querySelector(`.me`)?.classList.remove(`has-img`))}),a.push(n)}let o=j(`div`,{class:`me`,part:`avatar`},j(`slot`,null,...a));this.#e.replaceChildren(o),!t&&n&&this.#s(n,e)}#s(e,t){this.gravatarUrl(e).then(e=>{if(!e||t!==this.#t)return;let n=new Image;n.onload=()=>{if(t!==this.#t||!this.isConnected)return;let n=this.#e.querySelector(`.me`);n&&(n.style.backgroundImage=`url("${e}")`,n.classList.add(`has-img`))},n.src=e}).catch(()=>{})}};async function Aa(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function ja(e){if(!e)return``;let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?``:t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}A(`slicc-avatar`,ka);var Ma=5,Na=1;function Pa(e){return e.replace(`claude-`,``)}function Fa(e){return e==null||e===0?``:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function Ia(e){if(e.length<=Ma)return{individuals:e,buckets:[]};let t=[...e].sort((e,t)=>t.cost-e.cost),n=t.slice(0,Ma),r=[],i={count:0,cost:0};for(let e of t.slice(Ma))i.count+=1,i.cost+=e.cost,i.cost>=Na&&(r.push(i),i={count:0,cost:0});if(i.count>0){let e=r.at(-1);e?(e.count+=i.count,e.cost+=i.cost):r.push(i)}return{individuals:n,buckets:r}}var La=M(`
3845
3845
  :host {
3846
3846
  position: absolute;
3847
3847
  top: calc(100% + 8px);
@@ -3965,7 +3965,7 @@ ${va}`,wa=`slicc-layout-style`;function Ta(e){if(e.getElementById(wa))return;let
3965
3965
  font-variant-numeric: tabular-nums;
3966
3966
  color: var(--ink);
3967
3967
  }
3968
- `);A(`slicc-cost-overlay`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n=[];#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ra]}connectedCallback(){this.#i()}attributeChangedCallback(){this.isConnected&&this.#i()}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get models(){return this.#t}set models(e){this.#t=e,this.isConnected&&this.#i()}get scoops(){return this.#n}set scoops(e){this.#n=e,this.isConnected&&this.#i()}get total(){return this.#r}set total(e){this.#r=e!=null&&Number.isFinite(e)?e:null,this.isConnected&&this.#i()}#i(){let e=[];if(this.#t.length>0){let t=this.#t.map(e=>{let t=Ia(e.tokens);return j(`div`,{class:`model-row`},j(`span`,{class:`model-name`},Fa(e.model)),t?j(`span`,{class:`model-tokens`},t):!1,j(`span`,{class:`model-cost`},`$${e.cost.toFixed(2)}`))});e.push(j(`div`,{class:`section section--models`},j(`div`,{class:`section-title`},`BY MODEL`),...t))}if(this.#n.length>0){let t=La(this.#n),n=t.individuals.map(e=>j(`div`,{class:`scoop-row`},j(`span`,{class:`scoop-name`},e.name),j(`span`,{class:`scoop-cost`},`$${e.cost.toFixed(2)}`))),r=t.buckets.map(e=>j(`div`,{class:`bucket-row`,part:`bucket`},`${e.count} ${e.count===1?`agent`:`agents`} · $${e.cost.toFixed(2)}`));e.push(j(`div`,{class:`section section--scoops`},j(`div`,{class:`section-title`},`BY AGENT`),...n,...r))}let t=this.#r??this.#t.reduce((e,t)=>e+t.cost,0);e.push(j(`div`,{class:`total-row`},j(`span`,{class:`total-label`},`Total`),j(`span`,{class:`total-cost`},`$${t.toFixed(2)}`)));let n=j(`div`,{class:`card`},...e);this.#e.replaceChildren(n)}});var za=M(`
3968
+ `);A(`slicc-cost-overlay`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n=[];#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[La]}connectedCallback(){this.#i()}attributeChangedCallback(){this.isConnected&&this.#i()}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get models(){return this.#t}set models(e){this.#t=e,this.isConnected&&this.#i()}get scoops(){return this.#n}set scoops(e){this.#n=e,this.isConnected&&this.#i()}get total(){return this.#r}set total(e){this.#r=e!=null&&Number.isFinite(e)?e:null,this.isConnected&&this.#i()}#i(){let e=[];if(this.#t.length>0){let t=this.#t.map(e=>{let t=Fa(e.tokens);return j(`div`,{class:`model-row`},j(`span`,{class:`model-name`},Pa(e.model)),t?j(`span`,{class:`model-tokens`},t):!1,j(`span`,{class:`model-cost`},`$${e.cost.toFixed(2)}`))});e.push(j(`div`,{class:`section section--models`},j(`div`,{class:`section-title`},`BY MODEL`),...t))}if(this.#n.length>0){let t=Ia(this.#n),n=t.individuals.map(e=>j(`div`,{class:`scoop-row`},j(`span`,{class:`scoop-name`},e.name),j(`span`,{class:`scoop-cost`},`$${e.cost.toFixed(2)}`))),r=t.buckets.map(e=>j(`div`,{class:`bucket-row`,part:`bucket`},`${e.count} ${e.count===1?`agent`:`agents`} · $${e.cost.toFixed(2)}`));e.push(j(`div`,{class:`section section--scoops`},j(`div`,{class:`section-title`},`BY AGENT`),...n,...r))}let t=this.#r??this.#t.reduce((e,t)=>e+t.cost,0);e.push(j(`div`,{class:`total-row`},j(`span`,{class:`total-label`},`Total`),j(`span`,{class:`total-cost`},`$${t.toFixed(2)}`)));let n=j(`div`,{class:`card`},...e);this.#e.replaceChildren(n)}});var Ra=M(`
3969
3969
  :host {
3970
3970
  display: flex;
3971
3971
  align-items: center;
@@ -3994,7 +3994,7 @@ ${va}`,wa=`slicc-layout-style`;function Ta(e){if(e.getElementById(wa))return;let
3994
3994
  min-width: 0;
3995
3995
  background: var(--line, #e5e5e5);
3996
3996
  }
3997
- `);A(`slicc-day-separator`,class extends HTMLElement{static observedAttributes=[`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[za]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.label??j(`slot`);this.#e.replaceChildren(j(`span`,{class:`label`,part:`label`},e))}});var Ba=`CLI float`;function Va(e){if(e==null)return null;let t=e.trim();if(t===``)return null;let n=Number.parseFloat(t.replace(/^\$/,``));return Number.isFinite(n)?n:null}function Ha(e){let t=Va(e);return t==null?null:`$${t.toFixed(2)}`}function Ua(e){return`${Ha(e)??`$0.00`}/h`}var Wa=720,Ga=M(`
3997
+ `);A(`slicc-day-separator`,class extends HTMLElement{static observedAttributes=[`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ra]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.label??j(`slot`);this.#e.replaceChildren(j(`span`,{class:`label`,part:`label`},e))}});var za=`CLI float`;function Ba(e){if(e==null)return null;let t=e.trim();if(t===``)return null;let n=Number.parseFloat(t.replace(/^\$/,``));return Number.isFinite(n)?n:null}function Va(e){let t=Ba(e);return t==null?null:`$${t.toFixed(2)}`}function Ha(e){return`${Va(e)??`$0.00`}/h`}var Ua=720,Wa=M(`
3998
3998
  :host {
3999
3999
  position: relative;
4000
4000
  display: inline-flex;
@@ -4111,7 +4111,7 @@ ${va}`,wa=`slicc-layout-style`;function Ta(e){if(e.getElementById(wa))return;let
4111
4111
  @media (prefers-reduced-motion: reduce) {
4112
4112
  .tip { transition: none; }
4113
4113
  }
4114
- `);A(`slicc-floatbar`,class extends HTMLElement{static observedAttributes=[`label`,`linked`,`online`,`rate`,`spent`];#e;#t=null;#n=null;#r=[];#i=[];#a;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ga]}connectedCallback(){this.#c();let e=this.closest(`slicc-nav`);e&&typeof ResizeObserver<`u`&&(this.#t=new ResizeObserver(()=>this.#s()),this.#t.observe(e))}disconnectedCallback(){this.#t?.disconnect(),this.#t=null,clearTimeout(this.#a)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.#c()}get label(){return this.getAttribute(`label`)??Ba}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get linked(){return this.hasAttribute(`linked`)}set linked(e){this.toggleAttribute(`linked`,!!e)}get online(){return this.hasAttribute(`online`)}set online(e){this.toggleAttribute(`online`,!!e)}get spent(){return this.getAttribute(`spent`)}set spent(e){e==null?this.removeAttribute(`spent`):this.setAttribute(`spent`,String(e))}get rate(){return this.getAttribute(`rate`)}set rate(e){e==null?this.removeAttribute(`rate`):this.setAttribute(`rate`,String(e))}get costModels(){return this.#r}set costModels(e){this.#r=e,this.#n&&(this.#n.models=e)}get costScoops(){return this.#i}set costScoops(e){this.#i=e,this.#n&&(this.#n.scoops=e)}#o(){let e=[this.label];return e.push(Ua(this.rate)),e.push(`recency-weighted session avg`),e.push(this.online?`online`:`offline`),e.join(` · `)}#s(){let e=this.closest(`slicc-nav`),t=e?getComputedStyle(e):null;(e?e.clientWidth-Number.parseFloat(t?.paddingLeft??`0`)-Number.parseFloat(t?.paddingRight??`0`):1/0)<=Wa?this.setAttribute(`title`,this.#o()):this.removeAttribute(`title`)}#c(){let e=[];this.online&&e.push(j(`span`,{class:`fdot`,part:`dot`}));let[t,...r]=this.label.split(` · `),i=[j(`span`,{class:`runtime`},t)];r.length>0&&i.push(j(`span`,{class:`detail`},` · ${r.join(` · `)}`)),e.push(j(`span`,{class:`label`,part:`label`},j(`slot`,null,...i))),e.push(j(`span`,{class:`sep`,part:`sep`}));let a=j(`span`,{class:`spent`,part:`spent rate`},n(`circle-dollar-sign`,{size:12}),j(`span`,{class:`amount`},Ua(this.rate)));a.addEventListener(`mouseenter`,()=>this.#l()),a.addEventListener(`mouseleave`,()=>this.#u()),e.push(a),e.push(j(`span`,{class:`tip`,part:`tip`,"aria-hidden":`true`},this.#o())),this.#n=null,this.#e.replaceChildren(...e),this.#s()}#l(){if(clearTimeout(this.#a),!this.#n){let e=document.createElement(`slicc-cost-overlay`);e.models=this.#r,e.scoops=this.#i,e.total=Va(this.spent),e.addEventListener(`mouseenter`,()=>this.#l()),e.addEventListener(`mouseleave`,()=>this.#u()),this.#e.appendChild(e),this.#n=e}this.#n.toggleAttribute(`open`,!0)}#u(){this.#a=setTimeout(()=>{this.#n&&this.#n.removeAttribute(`open`)},150)}});var Ka=M(`
4114
+ `);A(`slicc-floatbar`,class extends HTMLElement{static observedAttributes=[`label`,`linked`,`online`,`rate`,`spent`];#e;#t=null;#n=null;#r=[];#i=[];#a;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Wa]}connectedCallback(){this.#c();let e=this.closest(`slicc-nav`);e&&typeof ResizeObserver<`u`&&(this.#t=new ResizeObserver(()=>this.#s()),this.#t.observe(e))}disconnectedCallback(){this.#t?.disconnect(),this.#t=null,clearTimeout(this.#a)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.#c()}get label(){return this.getAttribute(`label`)??za}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get linked(){return this.hasAttribute(`linked`)}set linked(e){this.toggleAttribute(`linked`,!!e)}get online(){return this.hasAttribute(`online`)}set online(e){this.toggleAttribute(`online`,!!e)}get spent(){return this.getAttribute(`spent`)}set spent(e){e==null?this.removeAttribute(`spent`):this.setAttribute(`spent`,String(e))}get rate(){return this.getAttribute(`rate`)}set rate(e){e==null?this.removeAttribute(`rate`):this.setAttribute(`rate`,String(e))}get costModels(){return this.#r}set costModels(e){this.#r=e,this.#n&&(this.#n.models=e)}get costScoops(){return this.#i}set costScoops(e){this.#i=e,this.#n&&(this.#n.scoops=e)}#o(){let e=[this.label];return e.push(Ha(this.rate)),e.push(`recency-weighted session avg`),e.push(this.online?`online`:`offline`),e.join(` · `)}#s(){let e=this.closest(`slicc-nav`),t=e?getComputedStyle(e):null;(e?e.clientWidth-Number.parseFloat(t?.paddingLeft??`0`)-Number.parseFloat(t?.paddingRight??`0`):1/0)<=Ua?this.setAttribute(`title`,this.#o()):this.removeAttribute(`title`)}#c(){let e=[];this.online&&e.push(j(`span`,{class:`fdot`,part:`dot`}));let[t,...r]=this.label.split(` · `),i=[j(`span`,{class:`runtime`},t)];r.length>0&&i.push(j(`span`,{class:`detail`},` · ${r.join(` · `)}`)),e.push(j(`span`,{class:`label`,part:`label`},j(`slot`,null,...i))),e.push(j(`span`,{class:`sep`,part:`sep`}));let a=j(`span`,{class:`spent`,part:`spent rate`},n(`circle-dollar-sign`,{size:12}),j(`span`,{class:`amount`},Ha(this.rate)));a.addEventListener(`mouseenter`,()=>this.#l()),a.addEventListener(`mouseleave`,()=>this.#u()),e.push(a),e.push(j(`span`,{class:`tip`,part:`tip`,"aria-hidden":`true`},this.#o())),this.#n=null,this.#e.replaceChildren(...e),this.#s()}#l(){if(clearTimeout(this.#a),!this.#n){let e=document.createElement(`slicc-cost-overlay`);e.models=this.#r,e.scoops=this.#i,e.total=Ba(this.spent),e.addEventListener(`mouseenter`,()=>this.#l()),e.addEventListener(`mouseleave`,()=>this.#u()),this.#e.appendChild(e),this.#n=e}this.#n.toggleAttribute(`open`,!0)}#u(){this.#a=setTimeout(()=>{this.#n&&this.#n.removeAttribute(`open`)},150)}});var Ga=M(`
4115
4115
  :host { display: inline-grid; }
4116
4116
  :host([hidden]) { display: none; }
4117
4117
  .iconbtn {
@@ -4140,7 +4140,7 @@ ${va}`,wa=`slicc-layout-style`;function Ta(e){if(e.getElementById(wa))return;let
4140
4140
  .iconbtn:disabled:hover { background: var(--canvas); color: var(--txt-2); }
4141
4141
  .icon { display: grid; place-items: center; pointer-events: none; }
4142
4142
  .icon svg { display: block; }
4143
- `),qa=`plus`,Ja=16;A(`slicc-icon-button`,class extends HTMLElement{static observedAttributes=[`icon`,`disabled`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ka]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get icon(){return this.getAttribute(`icon`)??qa}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.label,t=j(`slot`,null,j(`span`,{class:`icon`},n(this.icon,{size:Ja,part:`icon`}))),r=j(`button`,{type:`button`,class:`iconbtn`,part:`button`,"aria-label":e??void 0,title:e??void 0,disabled:this.disabled},t);this.#e.replaceChildren(r)}});var Ya=`
4143
+ `),Ka=`plus`,qa=16;A(`slicc-icon-button`,class extends HTMLElement{static observedAttributes=[`icon`,`disabled`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ga]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get icon(){return this.getAttribute(`icon`)??Ka}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.label,t=j(`slot`,null,j(`span`,{class:`icon`},n(this.icon,{size:qa,part:`icon`}))),r=j(`button`,{type:`button`,class:`iconbtn`,part:`button`,"aria-label":e??void 0,title:e??void 0,disabled:this.disabled},t);this.#e.replaceChildren(r)}});var Ja=`
4144
4144
  slicc-pane {
4145
4145
  display: flex;
4146
4146
  flex-direction: column;
@@ -4179,7 +4179,7 @@ slicc-pane .slicc-pane__body {
4179
4179
  min-height: 0;
4180
4180
  overflow: auto;
4181
4181
  }
4182
- `,Xa=`slicc-pane-style`;function Za(e){if(e.getElementById(Xa))return;let t=e.createElement(`style`);t.id=Xa,t.textContent=Ya,(e.head??e.documentElement).appendChild(t)}A(`slicc-pane`,class extends HTMLElement{static observedAttributes=[`elevated`];#e;#t;#n=!1;connectedCallback(){Za(this.ownerDocument),this.#r()}attributeChangedCallback(e,t,n){e===`elevated`&&t!==n&&this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-pane-change`,{bubbles:!0,composed:!0,detail:{elevated:n!==null}}))}get elevated(){return this.hasAttribute(`elevated`)}set elevated(e){e?this.setAttribute(`elevated`,``):this.removeAttribute(`elevated`)}#r(){if(this.#n)return;this.#n=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-pane__surface`))),t=this.ownerDocument.createElement(`div`);t.className=`slicc-pane__surface`,t.setAttribute(`part`,`surface`),this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-pane__header`,this.#e.setAttribute(`part`,`header`),this.#t=this.ownerDocument.createElement(`div`),this.#t.className=`slicc-pane__body`,this.#t.setAttribute(`part`,`body`),t.append(this.#e,this.#t);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`header`?this.#e.appendChild(t):this.#t.appendChild(t);this.appendChild(t)}});var Qa=`
4182
+ `,Ya=`slicc-pane-style`;function Xa(e){if(e.getElementById(Ya))return;let t=e.createElement(`style`);t.id=Ya,t.textContent=Ja,(e.head??e.documentElement).appendChild(t)}A(`slicc-pane`,class extends HTMLElement{static observedAttributes=[`elevated`];#e;#t;#n=!1;connectedCallback(){Xa(this.ownerDocument),this.#r()}attributeChangedCallback(e,t,n){e===`elevated`&&t!==n&&this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-pane-change`,{bubbles:!0,composed:!0,detail:{elevated:n!==null}}))}get elevated(){return this.hasAttribute(`elevated`)}set elevated(e){e?this.setAttribute(`elevated`,``):this.removeAttribute(`elevated`)}#r(){if(this.#n)return;this.#n=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-pane__surface`))),t=this.ownerDocument.createElement(`div`);t.className=`slicc-pane__surface`,t.setAttribute(`part`,`surface`),this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-pane__header`,this.#e.setAttribute(`part`,`header`),this.#t=this.ownerDocument.createElement(`div`),this.#t.className=`slicc-pane__body`,this.#t.setAttribute(`part`,`body`),t.append(this.#e,this.#t);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`header`?this.#e.appendChild(t):this.#t.appendChild(t);this.appendChild(t)}});var Za=`
4183
4183
  slicc-press-button {
4184
4184
  display: inline-flex;
4185
4185
  }
@@ -4271,7 +4271,7 @@ slicc-press-button {
4271
4271
  animation: none;
4272
4272
  }
4273
4273
  }
4274
- `,$a=`slicc-press-button-style`;function eo(e){if(e.getElementById($a))return;let t=e.createElement(`style`);t.id=$a,t.textContent=Qa,(e.head??e.documentElement).appendChild(t)}var to=`slicc-press-btn`,no=`is-squish`,ro=`is-wobble`;A(`slicc-press-button`,class extends HTMLElement{static get observedAttributes(){return[`label`,`tooltip`,`tooltip-pos`,`disabled`]}innerBtn=null;pressLayer=null;handle=null;initialized=!1;pendingShortTimer=null;pendingShortEvent=null;animEndListener=null;connectedCallback(){eo(this.ownerDocument),this.initialized?this.handle===null&&this.attachGesture():this.initialize(),this.syncAttributes()}disconnectedCallback(){this.handle?.destroy(),this.handle=null,this.clearPendingShort(),this.clearRipple(),this.clearAnimation()}attributeChangedCallback(){this.initialized&&this.syncAttributes()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get tooltip(){return this.getAttribute(`tooltip`)}set tooltip(e){e==null?this.removeAttribute(`tooltip`):this.setAttribute(`tooltip`,e)}setIcon(e){this.initialized||this.initialize();let t=this.innerBtn,n=this.pressLayer;for(let e of Array.from(t.childNodes))e!==n&&e.remove();let r=new DOMParser().parseFromString(e,`text/html`).body;for(;r.firstChild;)t.appendChild(r.firstChild)}focus(e){this.initialized||this.initialize(),this.innerBtn?.focus(e)}initialize(){this.initialized=!0;let e=j(`span`,{class:`${to}__press-layer`,part:`press-layer`}),t=j(`button`,{type:`button`,class:`${to}__btn`,part:`button`},e);for(;this.firstChild;)t.appendChild(this.firstChild);this.appendChild(t),this.innerBtn=t,this.pressLayer=e,this.attachGesture()}syncAttributes(){let e=this.innerBtn;if(!e)return;let t=this.getAttribute(`label`);t==null?e.removeAttribute(`aria-label`):e.setAttribute(`aria-label`,t);let n=this.getAttribute(`tooltip`);n==null?delete e.dataset.tooltip:e.dataset.tooltip=n;let r=this.getAttribute(`tooltip-pos`);r==null?delete e.dataset.tooltipPos:e.dataset.tooltipPos=r,this.hasAttribute(`disabled`)?e.setAttribute(`disabled`,``):e.removeAttribute(`disabled`)}longPressMs(){let e=this.getAttribute(`long-press-ms`);if(e==null)return Zn;let t=Number(e);return Number.isFinite(t)&&t>0?t:Zn}doubleClickMs(){let e=this.getAttribute(`double-click-ms`);if(e==null)return 350;let t=Number(e);return Number.isFinite(t)&&t>0?t:350}doubleClickDisabled(){return this.hasAttribute(`disable-double-click`)}emit(e,t){e===`short-click`?this.playAnimation(no):e===`double-click`&&this.playAnimation(ro);let n=t?{sourceEvent:t}:{};this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n}))}playAnimation(e){let t=this.innerBtn;if(!t)return;this.clearAnimation(),t.offsetWidth,t.classList.add(e);let n=e=>{e.target===t&&this.clearAnimation()};this.animEndListener=n,t.addEventListener(`animationend`,n)}clearAnimation(){let e=this.innerBtn;e&&(this.animEndListener&&=(e.removeEventListener(`animationend`,this.animEndListener),null),e.classList.remove(no,ro))}clearPendingShort(){this.pendingShortTimer!==null&&(clearTimeout(this.pendingShortTimer),this.pendingShortTimer=null),this.pendingShortEvent=null}attachGesture(){this.handle=Qn(this,{longPressMs:this.longPressMs(),onPressStart:e=>this.paintRipple(e),onPressEnd:()=>this.clearRipple(),onLongPress:()=>{if(this.pendingShortTimer!==null){this.clearPendingShort(),this.emit(`double-click`);return}this.emit(`long-press`)},onShortClick:e=>{if(this.doubleClickDisabled()){this.emit(`short-click`,e);return}if(this.pendingShortTimer!==null){this.clearPendingShort(),this.emit(`double-click`,e);return}this.pendingShortEvent=e,this.pendingShortTimer=setTimeout(()=>{this.pendingShortTimer=null;let e=this.pendingShortEvent;this.pendingShortEvent=null,this.emit(`short-click`,e??void 0)},this.doubleClickMs())}})}paintRipple(e){this.clearRipple();let t=this.pressLayer;if(!t)return;let n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top,a=Math.max(r,n.width-r),o=Math.max(i,n.height-i),s=Math.ceil(Math.hypot(a,o))+2,c=this.ownerDocument.createElement(`span`);c.className=`${to}__press`,c.style.left=`${r}px`,c.style.top=`${i}px`,c.style.width=`0px`,c.style.height=`0px`,c.style.transitionDuration=`${this.longPressMs()}ms`,t.appendChild(c),requestAnimationFrame(()=>{c.isConnected&&(c.style.width=`${s*2}px`,c.style.height=`${s*2}px`)})}clearRipple(){let e=this.pressLayer;if(e)for(;e.firstChild;)e.firstChild.remove()}});var io=M(`
4274
+ `,Qa=`slicc-press-button-style`;function $a(e){if(e.getElementById(Qa))return;let t=e.createElement(`style`);t.id=Qa,t.textContent=Za,(e.head??e.documentElement).appendChild(t)}var eo=`slicc-press-btn`,to=`is-squish`,no=`is-wobble`;A(`slicc-press-button`,class extends HTMLElement{static get observedAttributes(){return[`label`,`tooltip`,`tooltip-pos`,`disabled`]}innerBtn=null;pressLayer=null;handle=null;initialized=!1;pendingShortTimer=null;pendingShortEvent=null;animEndListener=null;connectedCallback(){$a(this.ownerDocument),this.initialized?this.handle===null&&this.attachGesture():this.initialize(),this.syncAttributes()}disconnectedCallback(){this.handle?.destroy(),this.handle=null,this.clearPendingShort(),this.clearRipple(),this.clearAnimation()}attributeChangedCallback(){this.initialized&&this.syncAttributes()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get tooltip(){return this.getAttribute(`tooltip`)}set tooltip(e){e==null?this.removeAttribute(`tooltip`):this.setAttribute(`tooltip`,e)}setIcon(e){this.initialized||this.initialize();let t=this.innerBtn,n=this.pressLayer;for(let e of Array.from(t.childNodes))e!==n&&e.remove();let r=new DOMParser().parseFromString(e,`text/html`).body;for(;r.firstChild;)t.appendChild(r.firstChild)}focus(e){this.initialized||this.initialize(),this.innerBtn?.focus(e)}initialize(){this.initialized=!0;let e=j(`span`,{class:`${eo}__press-layer`,part:`press-layer`}),t=j(`button`,{type:`button`,class:`${eo}__btn`,part:`button`},e);for(;this.firstChild;)t.appendChild(this.firstChild);this.appendChild(t),this.innerBtn=t,this.pressLayer=e,this.attachGesture()}syncAttributes(){let e=this.innerBtn;if(!e)return;let t=this.getAttribute(`label`);t==null?e.removeAttribute(`aria-label`):e.setAttribute(`aria-label`,t);let n=this.getAttribute(`tooltip`);n==null?delete e.dataset.tooltip:e.dataset.tooltip=n;let r=this.getAttribute(`tooltip-pos`);r==null?delete e.dataset.tooltipPos:e.dataset.tooltipPos=r,this.hasAttribute(`disabled`)?e.setAttribute(`disabled`,``):e.removeAttribute(`disabled`)}longPressMs(){let e=this.getAttribute(`long-press-ms`);if(e==null)return Xn;let t=Number(e);return Number.isFinite(t)&&t>0?t:Xn}doubleClickMs(){let e=this.getAttribute(`double-click-ms`);if(e==null)return 350;let t=Number(e);return Number.isFinite(t)&&t>0?t:350}doubleClickDisabled(){return this.hasAttribute(`disable-double-click`)}emit(e,t){e===`short-click`?this.playAnimation(to):e===`double-click`&&this.playAnimation(no);let n=t?{sourceEvent:t}:{};this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n}))}playAnimation(e){let t=this.innerBtn;if(!t)return;this.clearAnimation(),t.offsetWidth,t.classList.add(e);let n=e=>{e.target===t&&this.clearAnimation()};this.animEndListener=n,t.addEventListener(`animationend`,n)}clearAnimation(){let e=this.innerBtn;e&&(this.animEndListener&&=(e.removeEventListener(`animationend`,this.animEndListener),null),e.classList.remove(to,no))}clearPendingShort(){this.pendingShortTimer!==null&&(clearTimeout(this.pendingShortTimer),this.pendingShortTimer=null),this.pendingShortEvent=null}attachGesture(){this.handle=Zn(this,{longPressMs:this.longPressMs(),onPressStart:e=>this.paintRipple(e),onPressEnd:()=>this.clearRipple(),onLongPress:()=>{if(this.pendingShortTimer!==null){this.clearPendingShort(),this.emit(`double-click`);return}this.emit(`long-press`)},onShortClick:e=>{if(this.doubleClickDisabled()){this.emit(`short-click`,e);return}if(this.pendingShortTimer!==null){this.clearPendingShort(),this.emit(`double-click`,e);return}this.pendingShortEvent=e,this.pendingShortTimer=setTimeout(()=>{this.pendingShortTimer=null;let e=this.pendingShortEvent;this.pendingShortEvent=null,this.emit(`short-click`,e??void 0)},this.doubleClickMs())}})}paintRipple(e){this.clearRipple();let t=this.pressLayer;if(!t)return;let n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top,a=Math.max(r,n.width-r),o=Math.max(i,n.height-i),s=Math.ceil(Math.hypot(a,o))+2,c=this.ownerDocument.createElement(`span`);c.className=`${eo}__press`,c.style.left=`${r}px`,c.style.top=`${i}px`,c.style.width=`0px`,c.style.height=`0px`,c.style.transitionDuration=`${this.longPressMs()}ms`,t.appendChild(c),requestAnimationFrame(()=>{c.isConnected&&(c.style.width=`${s*2}px`,c.style.height=`${s*2}px`)})}clearRipple(){let e=this.pressLayer;if(e)for(;e.firstChild;)e.firstChild.remove()}});var ro=M(`
4275
4275
  :host { display: inline-flex; }
4276
4276
  :host([hidden]) { display: none; }
4277
4277
 
@@ -4301,7 +4301,7 @@ slicc-press-button {
4301
4301
  outline: 2px solid var(--violet);
4302
4302
  outline-offset: 2px;
4303
4303
  }
4304
- `);A(`slicc-swatch`,class extends HTMLElement{static observedAttributes=[`color`,`hue`,`selected`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[io]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get hue(){return this.hasAttribute(`hue`)}set hue(e){this.toggleAttribute(`hue`,!!e)}get selected(){return this.hasAttribute(`selected`)}set selected(e){this.toggleAttribute(`selected`,!!e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.color,t=[`sw`];this.hue&&t.push(`hue`),this.selected&&t.push(`on`);let n=j(`button`,{type:`button`,part:`button`,class:t.join(` `),"aria-pressed":this.selected?`true`:`false`,"aria-label":this.label??e??`color swatch`},j(`slot`));e&&n.style.setProperty(`--swatch-color`,e),n.addEventListener(`click`,this.#n),this.#e.replaceChildren(n)}#n=()=>{this.selected=!0,this.dispatchEvent(new CustomEvent(`select`,{detail:{color:this.color},bubbles:!0,composed:!0}))}});var ao=new Set([`rose`,`cyan`,`violet`,`amber`,`waffle`,`green`]),oo=M(`
4304
+ `);A(`slicc-swatch`,class extends HTMLElement{static observedAttributes=[`color`,`hue`,`selected`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ro]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get hue(){return this.hasAttribute(`hue`)}set hue(e){this.toggleAttribute(`hue`,!!e)}get selected(){return this.hasAttribute(`selected`)}set selected(e){this.toggleAttribute(`selected`,!!e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.color,t=[`sw`];this.hue&&t.push(`hue`),this.selected&&t.push(`on`);let n=j(`button`,{type:`button`,part:`button`,class:t.join(` `),"aria-pressed":this.selected?`true`:`false`,"aria-label":this.label??e??`color swatch`},j(`slot`));e&&n.style.setProperty(`--swatch-color`,e),n.addEventListener(`click`,this.#n),this.#e.replaceChildren(n)}#n=()=>{this.selected=!0,this.dispatchEvent(new CustomEvent(`select`,{detail:{color:this.color},bubbles:!0,composed:!0}))}});var io=new Set([`rose`,`cyan`,`violet`,`amber`,`waffle`,`green`]),ao=M(`
4305
4305
  :host {
4306
4306
  display: inline-flex;
4307
4307
  vertical-align: middle;
@@ -4361,7 +4361,7 @@ slicc-press-button {
4361
4361
  :host-context(.dark)[hue="amber"] .tag, :host-context([data-theme="dark"])[hue="amber"] .tag { background: color-mix(in srgb, var(--amber) 22%, var(--canvas)); border-color: color-mix(in srgb, var(--amber) 38%, var(--line)); }
4362
4362
  :host-context(.dark)[hue="waffle"] .tag, :host-context([data-theme="dark"])[hue="waffle"] .tag { background: color-mix(in srgb, var(--waffle) 22%, var(--canvas)); border-color: color-mix(in srgb, var(--waffle) 38%, var(--line)); }
4363
4363
  :host-context(.dark)[hue="green"] .tag, :host-context([data-theme="dark"])[hue="green"] .tag { background: color-mix(in srgb, var(--green) 22%, var(--canvas)); border-color: color-mix(in srgb, var(--green) 38%, var(--line)); }
4364
- `);A(`slicc-tag`,class extends HTMLElement{static observedAttributes=[`hue`,`label`,`dot`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[oo]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get hue(){let e=this.getAttribute(`hue`);return e&&ao.has(e)?e:null}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get dot(){return this.hasAttribute(`dot`)}set dot(e){e?this.setAttribute(`dot`,``):this.removeAttribute(`dot`)}#t(){let e=this.label??j(`slot`),t=j(`span`,{class:`tag`,part:`tag`},this.dot?j(`span`,{class:`dot`,part:`dot`}):null,j(`span`,{class:`label`,part:`label`},e));this.#e.replaceChildren(t)}});var so=M(`
4364
+ `);A(`slicc-tag`,class extends HTMLElement{static observedAttributes=[`hue`,`label`,`dot`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ao]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get hue(){let e=this.getAttribute(`hue`);return e&&io.has(e)?e:null}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get dot(){return this.hasAttribute(`dot`)}set dot(e){e?this.setAttribute(`dot`,``):this.removeAttribute(`dot`)}#t(){let e=this.label??j(`slot`),t=j(`span`,{class:`tag`,part:`tag`},this.dot?j(`span`,{class:`dot`,part:`dot`}):null,j(`span`,{class:`label`,part:`label`},e));this.#e.replaceChildren(t)}});var oo=M(`
4365
4365
  :host {
4366
4366
  position: fixed;
4367
4367
  inset: 0;
@@ -4495,6 +4495,53 @@ iframe {
4495
4495
  border: 0;
4496
4496
  display: block;
4497
4497
  }
4498
+ /* The rendered document view. Deliberately plain prose chrome — this is a file
4499
+ preview, not a themed reader — but it must not inherit the mono/pre look. */
4500
+ .rendered {
4501
+ font-family: var(--ui);
4502
+ font-size: 14px;
4503
+ line-height: 1.55;
4504
+ color: var(--ink, #131313);
4505
+ max-height: 62vh;
4506
+ overflow: auto;
4507
+ }
4508
+ .rendered > :first-child { margin-top: 0; }
4509
+ .rendered > :last-child { margin-bottom: 0; }
4510
+ .rendered h1, .rendered h2, .rendered h3, .rendered h4, .rendered h5, .rendered h6 {
4511
+ margin: 1.1em 0 .35em;
4512
+ line-height: 1.25;
4513
+ }
4514
+ .rendered h1 { font-size: 22px; }
4515
+ .rendered h2 { font-size: 18px; }
4516
+ .rendered h3 { font-size: 16px; }
4517
+ .rendered p, .rendered ul, .rendered ol, .rendered blockquote { margin: 0 0 .7em; }
4518
+ .rendered ul, .rendered ol { padding-left: 1.4em; }
4519
+ .rendered a { color: var(--accent, #6d28d9); }
4520
+ .rendered code {
4521
+ font-family: var(--mono, monospace);
4522
+ font-size: 12.5px;
4523
+ background: var(--ghost, rgba(0,0,0,.05));
4524
+ border-radius: 5px;
4525
+ padding: 1px 5px;
4526
+ }
4527
+ .rendered pre {
4528
+ max-height: none;
4529
+ background: var(--ghost, rgba(0,0,0,.05));
4530
+ border: 1px solid var(--line, #e1e1e1);
4531
+ border-radius: 8px;
4532
+ padding: 10px 12px;
4533
+ }
4534
+ .rendered pre code { background: none; padding: 0; }
4535
+ .rendered blockquote {
4536
+ border-left: 3px solid var(--line, #e1e1e1);
4537
+ padding-left: 12px;
4538
+ color: var(--txt-2, #4a4a4a);
4539
+ }
4540
+ .rendered table { border-collapse: collapse; font-size: 13px; }
4541
+ .rendered th, .rendered td { border: 1px solid var(--line, #e1e1e1); padding: 5px 10px; }
4542
+ .rendered img { max-height: 40vh; }
4543
+ /* A sandboxed document owns its own page box, so it gets the full panel. */
4544
+ .rendered-frame { height: 70vh; }
4498
4545
  .fallback {
4499
4546
  text-align: center;
4500
4547
  padding: 32px 16px;
@@ -4502,7 +4549,7 @@ iframe {
4502
4549
  font-size: 13px;
4503
4550
  }
4504
4551
  .fallback code { font-family: var(--mono, monospace); font-size: 12px; }
4505
- `),co=null,lo=null;function uo(e){if(e.text===!0)return!0;let t=e.mimeType.split(`;`,1)[0]?.trim()??e.mimeType;return t.startsWith(`text/`)?!0:t===`application/json`||t===`application/xml`||t===`application/javascript`||t===`image/svg+xml`||t.endsWith(`+json`)||t.endsWith(`+xml`)}function fo(e){return typeof e==`string`?e:new TextDecoder().decode(e)}function po(e,t){let n=typeof e==`string`?new TextEncoder().encode(e):e;return new Blob([n],{type:t})}var mo=!1;function ho(e){if(!mo){mo=!0;for(let t of[`jsh`,`bsh`])try{e.setCustomExtension(t,`zsh`)}catch{}}}function go(){let e=document.documentElement,t=e.dataset.theme??e.getAttribute(`data-theme`)??``;return t.includes(`dark`)?`dark`:t.includes(`light`)?`light`:globalThis.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}var _o=class e extends HTMLElement{#e;#t=[];#n=0;#r=null;#i=null;#a=`file`;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[so]}disconnectedCallback(){for(let e of this.#t)URL.revokeObjectURL(e);this.#t.length=0,co===this&&(co=null)}static open(t){e.close();let r=document.createElement(`slicc-quick-look`);r.#r=t,r.#n+=1,r.#a=t.baseContent===void 0?`file`:`diff`;let i=t.path.split(`/`).pop()||t.path,a=t.path.slice(0,t.path.length-i.length),o=j(`div`,{class:`backdrop`}),s=j(`button`,{class:`x`});s.setAttribute(`aria-label`,`Close preview`),s.appendChild(n(`x`,{size:14}));let c=j(`div`,{class:`header`},j(`div`,{class:`name`},j(`span`,{class:`dir`},a),i));c.appendChild(j(`span`,{class:`chip`},vo(t))),t.gitStatus&&c.appendChild(j(`span`,{class:`chip chip--git`},t.gitStatus)),t.baseContent!==void 0&&c.appendChild(r.#o()),c.appendChild(s);let l=j(`div`,{class:`content`});r.#i=l,l.appendChild(r.#l(t));let u=j(`div`,{class:`panel`},c,l);u.tabIndex=-1,r.#e.append(o,u),document.body.appendChild(r),co=r,u.focus(),o.addEventListener(`click`,()=>r.#s(`backdrop`)),s.addEventListener(`click`,()=>r.#s(`close-button`)),lo&&document.removeEventListener(`keydown`,lo),lo=e=>{e.key===`Escape`&&r.#s(`escape`)},document.addEventListener(`keydown`,lo),uo(t)&&r.#c(r.#n)}static close(){if(co){for(let e of co.#t)URL.revokeObjectURL(e);co.remove(),co=null}lo&&=(document.removeEventListener(`keydown`,lo),null)}#o(){let e=j(`button`,{type:`button`},`Diff`),t=j(`button`,{type:`button`},`File`),n=()=>{e.setAttribute(`aria-pressed`,String(this.#a===`diff`)),t.setAttribute(`aria-pressed`,String(this.#a===`file`))};n();let r=e=>()=>{this.#a!==e&&(this.#a=e,n(),this.#c(this.#n))};return e.addEventListener(`click`,r(`diff`)),t.addEventListener(`click`,r(`file`)),j(`div`,{class:`toggle`},e,t)}#s(t){this.dispatchEvent(new CustomEvent(`quick-look-close`,{bubbles:!0,composed:!0,detail:{reason:t}})),e.close()}async#c(e){let n=this.#r,r=this.#i;if(!n||!r)return;let i;try{i=await t(()=>import(`./dist-YOzumI7I.js`),__vite__mapDeps([0,1,2]))}catch{return}if(ho(i),e!==this.#n||!this.isConnected)return;let a=n.path.split(`/`).pop()||n.path,o=fo(n.content),s={themeType:go(),theme:{dark:`github-dark`,light:`github-light`},stickyHeader:!1,disableFileHeader:!0},c=j(`div`);try{if(this.#a===`diff`&&n.baseContent!==void 0){let e=new i.FileDiff({...s,diffStyle:`unified`});e.render({oldFile:{name:a,contents:n.baseContent},newFile:{name:a,contents:o},containerWrapper:c}),n.line!==void 0&&e.setSelectedLines({start:n.line,end:n.line,side:`additions`})}else{let e=new i.File(s);e.render({file:{name:a,contents:o},containerWrapper:c}),n.line!==void 0&&e.setSelectedLines({start:n.line,end:n.line})}}catch{return}e!==this.#n||!this.isConnected||(r.classList.add(`content--rich`),r.replaceChildren(c))}#l(e){let t=e.mimeType;if(uo(e))return j(`pre`,null,fo(e.content));if(t.startsWith(`image/`)){let n=document.createElement(`img`);return n.src=this.#u(e.content,t),n.alt=e.path.split(`/`).pop()||``,n}if(t.startsWith(`audio/`)){let n=document.createElement(`audio`);return n.controls=!0,n.src=this.#u(e.content,t),n}if(t.startsWith(`video/`)){let n=document.createElement(`video`);return n.controls=!0,n.src=this.#u(e.content,t),n}if(t===`application/pdf`){let n=document.createElement(`iframe`);return n.src=this.#u(e.content,t),n.title=e.path.split(`/`).pop()||`PDF preview`,n}return j(`div`,{class:`fallback`},j(`div`,null,`Preview not available for this file type (${yo(typeof e.content==`string`?e.content.length:e.content.byteLength)})`),j(`div`,{style:`margin-top:6px;`},j(`code`,null,t)))}#u(e,t){let n=URL.createObjectURL(po(e,t));return this.#t.push(n),n}};function vo(e){let t=e.mimeType.split(`;`,1)[0]?.trim()??e.mimeType;return t===`application/octet-stream`?`binary`:t.slice(t.indexOf(`/`)+1).replace(/^x-/,``).replace(/\+.*$/,``)}function yo(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}A(`slicc-quick-look`,_o);var bo=`
4552
+ `),so={rendered:`Preview`,file:`Source`,diff:`Diff`};function co(e){let t=[];return e.rendered&&t.push(`rendered`),po(e)&&t.push(`file`),e.baseContent!==void 0&&t.push(`diff`),t}function lo(e){return e.rendered?`rendered`:e.baseContent===void 0?`file`:`diff`}var uo=null,fo=null;function po(e){if(e.text===!0)return!0;let t=e.mimeType.split(`;`,1)[0]?.trim()??e.mimeType;return t.startsWith(`text/`)?!0:t===`application/json`||t===`application/xml`||t===`application/javascript`||t===`image/svg+xml`||t.endsWith(`+json`)||t.endsWith(`+xml`)}function mo(e){return typeof e==`string`?e:new TextDecoder().decode(e)}function ho(e,t){let n=typeof e==`string`?new TextEncoder().encode(e):e;return new Blob([n],{type:t})}var go=!1;function _o(e){if(!go){go=!0;for(let t of[`jsh`,`bsh`])try{e.setCustomExtension(t,`zsh`)}catch{}}}function vo(e,t){let n=`<style>:root{color-scheme:${t};}html{background:Canvas;color:CanvasText;}</style>`,r=/^\s*<!doctype[^>]*>/i.exec(e);return r?e.slice(0,r[0].length)+n+e.slice(r[0].length):n+e}function yo(){let e=document.documentElement,t=e.dataset.theme??e.getAttribute(`data-theme`)??``;return t.includes(`dark`)?`dark`:t.includes(`light`)?`light`:globalThis.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}var bo=class e extends HTMLElement{#e;#t=[];#n=0;#r=null;#i=null;#a=`file`;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[oo]}disconnectedCallback(){for(let e of this.#t)URL.revokeObjectURL(e);this.#t.length=0,uo===this&&(uo=null)}static open(t){e.close();let r=document.createElement(`slicc-quick-look`);r.#r=t,r.#n+=1,r.#a=lo(t);let i=t.path.split(`/`).pop()||t.path,a=t.path.slice(0,t.path.length-i.length),o=j(`div`,{class:`backdrop`}),s=j(`button`,{class:`x`});s.setAttribute(`aria-label`,`Close preview`),s.appendChild(n(`x`,{size:14}));let c=j(`div`,{class:`header`},j(`div`,{class:`name`},j(`span`,{class:`dir`},a),i));c.appendChild(j(`span`,{class:`chip`},xo(t))),t.gitStatus&&c.appendChild(j(`span`,{class:`chip chip--git`},t.gitStatus));let l=co(t);l.length>1&&c.appendChild(r.#o(l)),c.appendChild(s);let u=j(`div`,{class:`content`});r.#i=u,r.#s();let d=j(`div`,{class:`panel`},c,u);d.tabIndex=-1,r.#e.append(o,d),document.body.appendChild(r),uo=r,d.focus(),o.addEventListener(`click`,()=>r.#l(`backdrop`)),s.addEventListener(`click`,()=>r.#l(`close-button`)),fo&&document.removeEventListener(`keydown`,fo),fo=e=>{e.key===`Escape`&&r.#l(`escape`)},document.addEventListener(`keydown`,fo)}static close(){if(uo){for(let e of uo.#t)URL.revokeObjectURL(e);uo.remove(),uo=null}fo&&=(document.removeEventListener(`keydown`,fo),null)}#o(e){let t=e.map(e=>j(`button`,{type:`button`},so[e])),n=()=>{for(let[n,r]of e.entries())t[n]?.setAttribute(`aria-pressed`,String(this.#a===r))};n();for(let[r,i]of e.entries())t[r]?.addEventListener(`click`,()=>{this.#a!==i&&(this.#a=i,n(),this.#s())});return j(`div`,{class:`toggle`},...t)}#s(){let e=this.#r,t=this.#i;!e||!t||(t.replaceChildren(this.#d(e)),t.classList.toggle(`content--rich`,this.#a===`rendered`&&e.rendered?.mount===`sandbox`),this.#a!==`rendered`&&po(e)&&this.#u(this.#n))}#c(e){let t=e.rendered;if(!t)return j(`pre`,null,mo(e.content));if(t.mount===`sandbox`){let n=document.createElement(`iframe`);return n.setAttribute(`sandbox`,``),n.srcdoc=vo(t.html,yo()),n.title=`${e.path.split(`/`).pop()||e.path} preview`,n.className=`rendered-frame`,n}let n=j(`div`,{class:`rendered`}),r=this.ownerDocument.createRange();return r.selectNodeContents(n),n.appendChild(r.createContextualFragment(t.html)),n}#l(t){this.dispatchEvent(new CustomEvent(`quick-look-close`,{bubbles:!0,composed:!0,detail:{reason:t}})),e.close()}async#u(e){let n=this.#r,r=this.#i;if(!n||!r)return;let i;try{i=await t(()=>import(`./dist-YOzumI7I.js`),__vite__mapDeps([0,1,2]))}catch{return}if(_o(i),e!==this.#n||!this.isConnected)return;let a=n.path.split(`/`).pop()||n.path,o=mo(n.content),s={themeType:yo(),theme:{dark:`github-dark`,light:`github-light`},stickyHeader:!1,disableFileHeader:!0},c=j(`div`);try{if(this.#a===`diff`&&n.baseContent!==void 0){let e=new i.FileDiff({...s,diffStyle:`unified`});e.render({oldFile:{name:a,contents:n.baseContent},newFile:{name:a,contents:o},containerWrapper:c}),n.line!==void 0&&e.setSelectedLines({start:n.line,end:n.line,side:`additions`})}else{let e=new i.File(s);e.render({file:{name:a,contents:o},containerWrapper:c}),n.line!==void 0&&e.setSelectedLines({start:n.line,end:n.line})}}catch{return}e!==this.#n||!this.isConnected||(r.classList.add(`content--rich`),r.replaceChildren(c))}#d(e){let t=e.mimeType;if(this.#a===`rendered`)return this.#c(e);if(po(e))return j(`pre`,null,mo(e.content));if(t.startsWith(`image/`)){let n=document.createElement(`img`);return n.src=this.#f(e.content,t),n.alt=e.path.split(`/`).pop()||``,n}if(t.startsWith(`audio/`)){let n=document.createElement(`audio`);return n.controls=!0,n.src=this.#f(e.content,t),n}if(t.startsWith(`video/`)){let n=document.createElement(`video`);return n.controls=!0,n.src=this.#f(e.content,t),n}if(t===`application/pdf`){let n=document.createElement(`iframe`);return n.src=this.#f(e.content,t),n.title=e.path.split(`/`).pop()||`PDF preview`,n}return j(`div`,{class:`fallback`},j(`div`,null,`Preview not available for this file type (${So(typeof e.content==`string`?e.content.length:e.content.byteLength)})`),j(`div`,{style:`margin-top:6px;`},j(`code`,null,t)))}#f(e,t){let n=URL.createObjectURL(ho(e,t));return this.#t.push(n),n}};function xo(e){let t=e.mimeType.split(`;`,1)[0]?.trim()??e.mimeType;return t===`application/octet-stream`?`binary`:t.slice(t.indexOf(`/`)+1).replace(/^x-/,``).replace(/\+.*$/,``)}function So(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}A(`slicc-quick-look`,bo);var Co=`
4506
4553
  .slicc-chatpane {
4507
4554
  flex: 1 1 0;
4508
4555
  width: 100%;
@@ -4543,7 +4590,7 @@ iframe {
4543
4590
  -webkit-mask-image: none;
4544
4591
  mask-image: none;
4545
4592
  }
4546
- `,xo=`slicc-chatpane-style`;function So(e){if(e.getElementById(xo))return;let t=e.createElement(`style`);t.id=xo,t.textContent=bo,(e.head??e.documentElement).appendChild(t)}var Co=[`slicc-chat-thread`,`slicc-composer`];A(`slicc-chatpane`,class extends HTMLElement{static observedAttributes=[`narrow`];#e=null;#t=!1;connectedCallback(){So(this.ownerDocument),this.classList.add(`slicc-chatpane`),this.setAttribute(`part`,`pane`),this.#t=!0,this.#n(),this.#r()}disconnectedCallback(){this.#e?.disconnect(),this.#e=null}attributeChangedCallback(e,t,n){e===`narrow`&&t!==n&&this.isConnected&&(this.#n(),this.dispatchEvent(new CustomEvent(`slicc-chatpane-narrow-change`,{detail:{narrow:this.narrow},bubbles:!0,composed:!0})))}get narrow(){return this.hasAttribute(`narrow`)}set narrow(e){e?this.setAttribute(`narrow`,``):this.removeAttribute(`narrow`)}get nav(){return this.querySelector(`:scope > slicc-nav`)}get thread(){return this.querySelector(`:scope > slicc-chat-thread`)}get composer(){return this.querySelector(`:scope > slicc-composer`)}#n(){if(!this.#t)return;let e=this.narrow;for(let t of Co)for(let n of this.querySelectorAll(`:scope > ${t}`))e?n.setAttribute(`open`,``):n.removeAttribute(`open`)}#r(){this.#e||(this.#e=new MutationObserver(()=>this.#n()),this.#e.observe(this,{childList:!0}))}});var wo=`
4593
+ `,wo=`slicc-chatpane-style`;function To(e){if(e.getElementById(wo))return;let t=e.createElement(`style`);t.id=wo,t.textContent=Co,(e.head??e.documentElement).appendChild(t)}var Eo=[`slicc-chat-thread`,`slicc-composer`];A(`slicc-chatpane`,class extends HTMLElement{static observedAttributes=[`narrow`];#e=null;#t=!1;connectedCallback(){To(this.ownerDocument),this.classList.add(`slicc-chatpane`),this.setAttribute(`part`,`pane`),this.#t=!0,this.#n(),this.#r()}disconnectedCallback(){this.#e?.disconnect(),this.#e=null}attributeChangedCallback(e,t,n){e===`narrow`&&t!==n&&this.isConnected&&(this.#n(),this.dispatchEvent(new CustomEvent(`slicc-chatpane-narrow-change`,{detail:{narrow:this.narrow},bubbles:!0,composed:!0})))}get narrow(){return this.hasAttribute(`narrow`)}set narrow(e){e?this.setAttribute(`narrow`,``):this.removeAttribute(`narrow`)}get nav(){return this.querySelector(`:scope > slicc-nav`)}get thread(){return this.querySelector(`:scope > slicc-chat-thread`)}get composer(){return this.querySelector(`:scope > slicc-composer`)}#n(){if(!this.#t)return;let e=this.narrow;for(let t of Eo)for(let n of this.querySelectorAll(`:scope > ${t}`))e?n.setAttribute(`open`,``):n.removeAttribute(`open`)}#r(){this.#e||(this.#e=new MutationObserver(()=>this.#n()),this.#e.observe(this,{childList:!0}))}});var Do=`
4547
4594
  .slicc-shell { display: flex; flex: 1; min-height: 0; }
4548
4595
  .slicc-shell > slicc-dock-tree,
4549
4596
  .slicc-shell > .dock-tree {
@@ -4559,7 +4606,7 @@ iframe {
4559
4606
  and blur the rail's own opaque strip. */
4560
4607
  .slicc-shell > slicc-dock,
4561
4608
  .slicc-shell > .dock { flex: 0 0 48px; position: relative; z-index: 3; }
4562
- `,To=`slicc-shell-style`;function Eo(e){if(e.getElementById(To))return;let t=e.createElement(`style`);t.id=To,t.textContent=wo,(e.head??e.documentElement).appendChild(t)}var Do=`chat`;A(`slicc-shell`,class extends HTMLElement{#e=e=>{let t=e.detail?.placed;if(!Array.isArray(t))return;let n=t.some(e=>e!==Do);this.querySelector(`slicc-chatpane`)?.toggleAttribute(`narrow`,n)};connectedCallback(){Eo(this.ownerDocument),this.classList.add(`slicc-shell`),this.setAttribute(`part`,`shell`),this.addEventListener(`dock-tree-render`,this.#e)}disconnectedCallback(){this.removeEventListener(`dock-tree-render`,this.#e)}get dockTree(){return this.querySelector(`:scope > slicc-dock-tree, :scope > .dock-tree`)}get dock(){return this.querySelector(`:scope > slicc-dock, :scope > .dock`)}});var Oo=[`idle`,`thinking`,`working`,`awaiting`],ko=.22,Ao=.08,jo=3400,Mo=4600,No=.38,Po=2600,Fo=.22,Io=1e3,Lo=.1,Ro=.55,zo=.16,Bo={left:{raise:-9,tilt:-10},right:{raise:2,tilt:6}},Vo=[{x:45,y:-15},{x:150,y:-10},{x:95,y:-25},{x:160,y:-30},{x:40,y:-28}],Ho=1300,Uo=[{x:70,y:60},{x:130,y:40},{x:100,y:72},{x:55,y:30},{x:148,y:62}],Wo=4100,Go=2.2,Ko={x:100,y:66};function qo(e,t,n){return e+(t-e)*n}function Jo(e,t,n,r){return e+(t-e)*Math.min(1,n*r)}function Yo(e){return e===null?null:Oo.includes(e)?e:`idle`}function Xo(e){let t=Number.parseFloat(e??``);return Number.isFinite(t)&&t>=0?t:90}function Zo(e){return+(e===`working`)}function Qo(e){return qo(38,10,e)}function $o(e,t){return qo(e,e*ko,t)}function es(e){return e<=50?1:e>=85?2.2:1+(e-50)/35*1.2}function ts(e){return e<=0?1:1+zo*Math.min(1,e/350)}function ns(e){return Math.max(2,Math.min(16,38-e-4))}function rs(e){return e>.001?12+e*2*38:9}function is(e){return e>.001?88-e*2*38:91}function as(e,t){let n=e-50;return qo(Math.sqrt(Math.max(0,1444-n*n)),36,t)}function os(e,t){return e<=t?Lo:qo(Lo,Ro,Math.min(1,(e-t)/12))}function ss(e){return e.left.raise<0}function cs(e,t=Math.random){let n=t()<.65?!ss(e):ss(e),r={raise:-(7+t()*5),tilt:7+t()*5},i={raise:1+t()*2,tilt:4+t()*3};return n?{left:{raise:r.raise,tilt:-r.tilt},right:i}:{left:{raise:i.raise,tilt:-i.tilt},right:r}}function ls(e,t,n){return t<2?0:(e+1+Math.floor(n()*(t-1)))%t}var us=`http://www.w3.org/2000/svg`,ds={cx:55,cy:50,r:38},fs={cx:145,cy:50,r:38},ps=1,ms=12,hs=.72,gs=[.08,.36,.68,.94],_s=1372365086,vs=2654435769,ys=2246822507,bs=Date.UTC(2001,0,1),xs=500,Ss={cone:{vb:`70 330 440 570`,eyes:{top:-18.5,left:17,width:70,height:44},zoom:3,glyph:96},scoop:{vb:`0 0 580 470`,eyes:{top:30,left:15,width:70,height:45},zoom:2.65,glyph:96}},Cs={cone:`#D2691E`,scoop:`#FFB6C1`},ws=M(`
4609
+ `,Oo=`slicc-shell-style`;function ko(e){if(e.getElementById(Oo))return;let t=e.createElement(`style`);t.id=Oo,t.textContent=Do,(e.head??e.documentElement).appendChild(t)}var Ao=`chat`;A(`slicc-shell`,class extends HTMLElement{#e=e=>{let t=e.detail?.placed;if(!Array.isArray(t))return;let n=t.some(e=>e!==Ao);this.querySelector(`slicc-chatpane`)?.toggleAttribute(`narrow`,n)};connectedCallback(){ko(this.ownerDocument),this.classList.add(`slicc-shell`),this.setAttribute(`part`,`shell`),this.addEventListener(`dock-tree-render`,this.#e)}disconnectedCallback(){this.removeEventListener(`dock-tree-render`,this.#e)}get dockTree(){return this.querySelector(`:scope > slicc-dock-tree, :scope > .dock-tree`)}get dock(){return this.querySelector(`:scope > slicc-dock, :scope > .dock`)}});var jo=[`idle`,`thinking`,`working`,`awaiting`],Mo=.22,No=.08,Po=3400,Fo=4600,Io=.38,Lo=2600,Ro=.22,zo=1e3,Bo=.1,Vo=.55,Ho=.16,Uo={left:{raise:-9,tilt:-10},right:{raise:2,tilt:6}},Wo=[{x:45,y:-15},{x:150,y:-10},{x:95,y:-25},{x:160,y:-30},{x:40,y:-28}],Go=1300,Ko=[{x:70,y:60},{x:130,y:40},{x:100,y:72},{x:55,y:30},{x:148,y:62}],qo=4100,Jo=2.2,Yo={x:100,y:66};function Xo(e,t,n){return e+(t-e)*n}function Zo(e,t,n,r){return e+(t-e)*Math.min(1,n*r)}function Qo(e){return e===null?null:jo.includes(e)?e:`idle`}function $o(e){let t=Number.parseFloat(e??``);return Number.isFinite(t)&&t>=0?t:90}function es(e){return+(e===`working`)}function ts(e){return Xo(38,10,e)}function ns(e,t){return Xo(e,e*Mo,t)}function rs(e){return e<=50?1:e>=85?2.2:1+(e-50)/35*1.2}function is(e){return e<=0?1:1+Ho*Math.min(1,e/350)}function as(e){return Math.max(2,Math.min(16,38-e-4))}function os(e){return e>.001?12+e*2*38:9}function ss(e){return e>.001?88-e*2*38:91}function cs(e,t){let n=e-50;return Xo(Math.sqrt(Math.max(0,1444-n*n)),36,t)}function ls(e,t){return e<=t?Bo:Xo(Bo,Vo,Math.min(1,(e-t)/12))}function us(e){return e.left.raise<0}function ds(e,t=Math.random){let n=t()<.65?!us(e):us(e),r={raise:-(7+t()*5),tilt:7+t()*5},i={raise:1+t()*2,tilt:4+t()*3};return n?{left:{raise:r.raise,tilt:-r.tilt},right:i}:{left:{raise:i.raise,tilt:-i.tilt},right:r}}function fs(e,t,n){return t<2?0:(e+1+Math.floor(n()*(t-1)))%t}var ps=`http://www.w3.org/2000/svg`,ms={cx:55,cy:50,r:38},hs={cx:145,cy:50,r:38},gs=1,_s=12,vs=.72,ys=[.08,.36,.68,.94],bs=1372365086,xs=2654435769,Ss=2246822507,Cs=Date.UTC(2001,0,1),ws=500,Ts={cone:{vb:`70 330 440 570`,eyes:{top:-18.5,left:17,width:70,height:44},zoom:3,glyph:96},scoop:{vb:`0 0 580 470`,eyes:{top:30,left:15,width:70,height:45},zoom:2.65,glyph:96}},Es={cone:`#D2691E`,scoop:`#FFB6C1`},Ds=M(`
4563
4610
  :host{display:block;width:26px;height:26px;pointer-events:none;}
4564
4611
  .avatar{position:relative;display:block;width:100%;height:100%;overflow:hidden;border-radius:7px;background:color-mix(in srgb,var(--slicc-agent-tabs-hue) 18%,transparent);}
4565
4612
  .icon-inner{position:absolute;inset:0;transform-origin:0 0;transform:translate(var(--tx),var(--ty)) scale(var(--zoom));}
@@ -4567,14 +4614,14 @@ iframe {
4567
4614
  .eyes{position:absolute;pointer-events:none;}
4568
4615
  .eyes-svg{display:block;overflow:visible;}
4569
4616
  .eye-blink,.eye-frozen{transform-box:view-box;}
4570
- @keyframes slicc-agent-avatar-blink{0%,92%,100%{transform:scaleY(1);}96%{transform:scaleY(${Ao});}}
4617
+ @keyframes slicc-agent-avatar-blink{0%,92%,100%{transform:scaleY(1);}96%{transform:scaleY(${No});}}
4571
4618
  :host([blink]) .eye-blink{animation:slicc-agent-avatar-blink 3.4s ease-in-out infinite;}
4572
4619
  :host([blink]) .eye-r{animation-duration:4.6s;}
4573
4620
  /* The engine drives blinks itself so it can commit shape changes at the apex. */
4574
4621
  .avatar[data-expressive] .eye-blink{animation:none;}
4575
4622
  .brow{transition:opacity 350ms ease,transform 350ms ease;}
4576
4623
  @media (prefers-reduced-motion:reduce){:host([blink]) .eye-blink{animation:none;}.brow{transition:none;}}
4577
- `);function R(e,t,...n){let r=document.createElementNS(us,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function Ts(e,t,n){e&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function z(e,t,n){Ts(e,t,n.toFixed(2))}function Es(e,t){let n=e.replace(`#`,``),r=n.length===3?[...n].map(e=>`${e}${e}`).join(``):n,i=Number.parseInt(r,16);if(!Number.isFinite(i))return e;let a=t<0?0:255,o=e=>Math.round(e+(a-e)*Math.abs(t)).toString(16).padStart(2,`0`);return`#${o(i>>16&255)}${o(i>>8&255)}${o(i&255)}`}function Ds(e,t,n){let r=[[`path`,{d:`M108.22,414.88l189.84,460.03c1.36,3.3,6.09,3.16,7.25-.22l159.34-463.34c.87-2.53-1.03-5.16-3.7-5.13l-349.18,3.32c-2.74.03-4.59,2.82-3.55,5.35Z`,fill:e,stroke:t,"stroke-linejoin":`round`,"stroke-width":20}],[`path`,{d:`M261.93,482.48h0c15.03-15.03,4.46-40.72-16.79-40.83h0c-21.37-.11-32.14,25.72-17.03,40.83h0c9.34,9.34,24.48,9.34,33.82,0Z`,fill:n}],[`path`,{d:`M384.85,527.49l-51.82,51.82c-2.24,2.24-2.24,5.86,0,8.1l55.71,55.71c2.24,2.24,5.86,2.24,8.1,0h0c.62-.62,1.08-1.36,1.37-2.19l26.52-77.11c.71-2.07.18-4.36-1.37-5.91l-30.41-30.41c-2.24-2.24-5.86-2.24-8.1,0Z`,fill:n}],[`path`,{d:`M371.7,684.58l-25.94,25.94c-2.24,2.24-2.24,5.86,0,8.1l12.67,12.67c2.99,2.99,8.09,1.82,9.46-2.19l13.28-38.61c1.97-5.74-5.17-10.2-9.46-5.91Z`,fill:n}],[`path`,{d:`M159.42,564.14l2.73,6.83c1.52,3.82,6.46,4.83,9.37,1.93l2.05-2.05c2.24-2.24,2.24-5.86,0-8.1l-4.78-4.78c-4.4-4.4-11.67.39-9.37,6.17Z`,fill:n}],[`path`,{d:`M243.92,633.11l-48.65-48.65c-5.24-5.24-13.74-5.24-18.99,0h0c-3.8,3.8-4.97,9.49-2.98,14.47l27.77,69.54c3.58,8.95,15.14,11.33,21.96,4.51l20.89-20.89c5.24-5.24,5.24-13.74,0-18.99Z`,fill:n}],[`path`,{d:`M211.32,533.1h0c14.11-14.11,14.11-36.98,0-51.08l-34.94-34.94c-.72-.72-.72-1.89,0-2.62h0c1.16-1.16.34-3.15-1.3-3.16l-11.23-.06c-25.62-.13-43.23,25.72-33.73,49.51l5.37,13.45c1.82,4.55,4.54,8.68,8,12.15l16.74,16.74c14.11,14.11,36.98,14.11,51.08,0Z`,fill:n}],[`path`,{d:`M263.74,792.53h0c-5.69,5.69-7.45,14.23-4.46,21.71l22.5,56.36c6.92,17.34,31.68,16.74,37.75-.92l8.66-25.2c2.5-7.28.64-15.35-4.8-20.79l-31.17-31.17c-7.87-7.87-20.62-7.87-28.48,0Z`,fill:n}],[`path`,{d:`M392.94,503.07l40.81-40.81c2.24-2.24,5.86-2.24,8.1,0l.06.06c2.24,2.24,2.24,5.86,0,8.1l-40.81,40.81c-2.24,2.24-2.24,5.86,0,8.1l22.48,22.48c2.99,2.99,8.09,1.82,9.46-2.19l30.71-89.32c1.27-3.71-1.47-7.57-5.39-7.59l-120.63-.6c-5.11-.03-7.69,6.16-4.08,9.77l51.18,51.18c2.24,2.24,5.86,2.24,8.1,0Z`,fill:n}]],i=[[274.59,463.59,84.73,95.66,42.36,`translate(-268.79 373.91) rotate(-45)`],[291.06,603.84,72.24,90.24,36.12,`translate(-363.06 421.43) rotate(-45)`],[217.18,527.25,72.24,95.66,36.12,`translate(-332.45 347.55) rotate(-45)`],[236.26,661.25,67.04,90.24,33.52,`translate(-420.46 397.65) rotate(-45)`]],a=r.map(([e,t])=>R(e,t));return a.push(...i.map(([e,t,r,i,a,o])=>R(`rect`,{x:e,y:t,width:r,height:i,rx:a,ry:a,transform:o,fill:n})),R(`ellipse`,{cx:288.37,cy:404.38,rx:182.34,ry:67.01,fill:e,stroke:t,"stroke-miterlimit":10,"stroke-width":20})),a}function Os(e,t){return[R(`path`,{d:`M566.75,340.67c0-29.85-12.97-56.87-33.96-76.47,4.8-9.98,7.44-20.71,7.44-31.9,0-38.29-30.62-71.33-74.92-86.77.33-3.07.51-6.17.51-9.3,0-69.72-84.29-126.24-188.26-126.24s-188.26,56.52-188.26,126.24c0,4,.29,7.95.83,11.86-34.94,15.4-58.48,44.25-58.48,77.34,0,18.21,7.15,34.25,19.39,49.26-25.1,19.88-41.05,49.47-41.05,82.54,0,59.85,52.15,108.37,116.49,108.37,10.83,0,21.3-1.4,31.26-3.98,31.42,41.91,83.55,69.34,142.55,69.34,64.73,0,121.2-33,151.11-81.94,63.8-.57,115.34-48.85,115.34-108.34Z`,fill:e,stroke:t,"stroke-width":20})]}function ks(e,t,n,r){return R(`rect`,{x:e-t,y:50-t,width:t*2,height:t*2,rx:n,...r})}function As(e,t,n,r){return R(`g`,{class:`pupil pupil-${t}`},ks(e,n,$o(n,r),{fill:`#000`}),R(`circle`,{cx:e-n*.3,cy:50-n*.35,r:n*.4,fill:`#fff`}))}function js(e,t){return R(`line`,{class:`lid-line lid-${t}`,x1:e-38,y1:50,x2:e+38,y2:50,stroke:`#000`,"stroke-width":4,"stroke-linecap":`round`,display:`none`})}function Ms(e,t){let n=R(`line`,{class:`brow brow-${t}`,x1:e-22,y1:2,x2:e+22,y2:2,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`,opacity:0});return n.style.transformBox=`fill-box`,n.style.transformOrigin=`center`,n}function Ns(e,t,n){let r=R(`g`,{class:`${n} eye-${t}`});return r.style.transformOrigin=`${e}px 50px`,r}function Ps(e,t,n){let r=`slicc-agent-avatar-noise-${t}`;return R(`g`,{class:`eye-static eye-body-${t}`},R(`defs`,{},R(`clipPath`,{id:r},ks(e,38,n,{class:`noise-clip`}))),ks(e,38,n,{class:`socket`,fill:`#fff`}),R(`g`,{class:`noise noise-${t}`,"clip-path":`url(#${r})`,"data-cell-size":ps}),ks(e,38,n,{class:`eye-outline`,fill:`none`,stroke:`#000`,"stroke-width":4}))}function Fs(e){return e^=e<<13,e^=e>>>17,e^=e<<5,e>>>0}function Is(e){return(_s^Math.imul(e,ys))>>>0}function Ls(e,t){return(Is(e)^Math.imul(t,vs))>>>0}function Rs(){return Math.floor((Date.now()-bs)/1e3*ms)>>>0}function zs(e){return[R(`circle`,{cx:e,cy:50,r:38,fill:`#fff`,stroke:`#000`,"stroke-width":4}),R(`line`,{x1:e-15,y1:35,x2:e+15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`}),R(`line`,{x1:e+15,y1:35,x2:e-15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`})]}function Bs(e,t,n,r,i){let a=n-t,o=r-50,s=Math.hypot(a,o),c=Math.min(s,i),l=s>0?a/s*c:0,u=s>0?o/s*c:0;e.setAttribute(`transform`,`translate(${l.toFixed(2)},${u.toFixed(2)})`)}var Vs={now:()=>performance.now(),requestFrame:e=>window.requestAnimationFrame(e),cancelFrame:e=>window.cancelAnimationFrame(e),delay:(e,t)=>window.setTimeout(e,t),cancelDelay:e=>window.clearTimeout(e),repeat:(e,t)=>window.setInterval(e,t),cancelRepeat:e=>window.clearInterval(e)};A(`slicc-agent-avatar`,class extends HTMLElement{static observedAttributes=[`type`,`color`,`eyes`,`fill`,`connection`,`activity`,`gaze-target`,`drowse-delay`];#e;#t=e=>this.#Oe(e);#n=()=>{this.#B(),this.#K(),this.#H()===`static`&&this.#Ce()};#r=null;#i=null;#a=null;#o=null;#s=[];#c=null;#l=16;#u=!1;#d=null;#f=!1;#p=!1;#m=0;#h=0;#g=!1;#_=0;#v=0;#y=Bo;#b={x:100,y:50};#x=0;#S=0;#C=18;#w=null;#T=0;#E=0;#D=0;#O=null;#k=0;#A=[];#j=null;#M=[];#N=Ko;#P=null;#F=Vs;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ws]}connectedCallback(){this.#r=window.matchMedia(`(prefers-reduced-motion: reduce)`),this.#r.addEventListener(`change`,this.#n),this.#L(),this.#B(),this.#K()}disconnectedCallback(){this.#V(),this.#Ee(),this.#Z(),this.#r?.removeEventListener(`change`,this.#n),this.#r=null,this.#p=!1}attributeChangedCallback(e){if(this.isConnected){if(e===`activity`||e===`gaze-target`||e===`drowse-delay`){this.#G();return}this.#L(),this.#B(),this.#K()}}get activity(){return Yo(this.getAttribute(`activity`))}set activity(e){e===null?this.removeAttribute(`activity`):this.setAttribute(`activity`,e)}get gazeTarget(){return this.getAttribute(`gaze-target`)}set gazeTarget(e){e===null?this.removeAttribute(`gaze-target`):this.setAttribute(`gaze-target`,e)}get drowseDelay(){return Xo(this.getAttribute(`drowse-delay`))}set drowseDelay(e){this.setAttribute(`drowse-delay`,String(e))}get clock(){return this.#F}set clock(e){if(e===this.#F)return;this.#Z(),this.#F=e;let t=e.now();this.#k=t,this.#w!==null&&(this.#w=t),this.#T=0,this.#E=0,this.#D=0,this.#P=null,this.isConnected&&this.#K()}get expression(){return Object.freeze({activity:this.#d,shape:this.#m,lidTop:this.#_,lidBottom:this.#v,pupilRadius:this.#C,gaze:{...this.#b},brows:this.#y,browsVisible:this.#ge()})}wake(){let e=this.#F.now();this.#w=e,this.#U()||(this.#D=e+350,this.#se()),this.#J()}scrutinize(){this.#E=this.#F.now()+Io,this.#J()}glower(){this.#T=this.#F.now()+Po,this.#J()}resetExpression(){this.#oe();let e=this.#F.now();this.#T=0,this.#E=0,this.#D=0,this.#_=0,this.#v=0,this.#y=Bo,this.#N=Ko,this.#P=null,this.#S=0,this.#w=this.#d===`awaiting`?e:null,this.#g=!1,this.#h=Zo(this.#d),this.#m=this.#h,this.#k=e,this.#I()&&this.isConnected&&(this.#_e(),this.#K())}#I(){return this.hasAttribute(`activity`)||this.#f}#L(){this.#Ee(),this.#s=[];let e=this.getAttribute(`type`)===`cone`?`cone`:`scoop`,t=Ss[e],n=this.getAttribute(`color`)??Cs[e],r=this.#I();this.#d=Yo(this.getAttribute(`activity`)),this.#d===`awaiting`&&this.#w===null&&(this.#w=this.#F.now()),this.#p||=(this.#m=this.#h=Zo(this.#d),!0);let i=R(`svg`,{class:`glyph`,viewBox:t.vb,preserveAspectRatio:`xMidYMid meet`,style:`--g:${t.glyph}%`},...e===`cone`?Ds(n,Es(n,-.38),Es(n,.3)):Os(n,Es(n,-.32)));this.#o=R(`svg`,{class:`eyes-svg`,viewBox:`0 0 200 100`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},...this.#R(r));let a=j(`span`,{class:`eyes`,style:`top:${t.eyes.top}%;left:${t.eyes.left}%;width:${t.eyes.width}%;height:${t.eyes.height}%`});a.append(this.#o);let o=j(`span`,{class:`icon-inner`,style:`--tx:${((.5-t.zoom*((t.eyes.left+t.eyes.width/2)/100))*100).toFixed(2)}%;--ty:${((.5-t.zoom*((t.eyes.top+t.eyes.height/2)/100))*100).toFixed(2)}%;--zoom:${t.zoom}`},i,a);this.#e.replaceChildren(j(`span`,{class:`avatar`,"aria-hidden":`true`,"data-expressive":r||null},o)),this.#i=this.#e.querySelector(`.pupil-l`),this.#a=this.#e.querySelector(`.pupil-r`),this.#H()===`static`&&this.#Ce(),r&&this.#_e()}#R(e){let t=this.#H();if(t===`none`)return[];if(t===`dead`)return[...zs(ds.cx),...zs(fs.cx)];this.#C=this.#z(),this.#l=ns(this.#C);let n=Qo(this.#m);return[ds.cx,fs.cx].map((r,i)=>{let a=i===0?`l`:`r`,o=t===`static`,s=Ns(r,a,o?`eye-frozen`:`eye-blink`),c=o?Ps(r,a,n):R(`g`,{class:`eye-body eye-body-${a}`},ks(r,38,n,{class:`socket`,fill:`#fff`,stroke:`#000`,"stroke-width":4}),As(r,a,this.#C,this.#m));if(s.append(c),!e)return s;let l=`slicc-agent-avatar-lid-${a}`;return s.append(R(`defs`,{},R(`clipPath`,{id:l},R(`rect`,{class:`lid-clip`,x:r-38-3,y:9,width:82,height:82}))),js(r,`top`),js(r,`bottom`),Ms(r,a)),c.setAttribute(`clip-path`,`url(#${l})`),s})}#z(){return 18*es(Math.max(0,Math.min(100,Number.parseFloat(this.getAttribute(`fill`)??`0`)||0)))}#B(){let e=this.#H()===`open`&&!this.#r?.matches&&(this.#d===null||this.#d===`working`);e&&!this.#u?(this.ownerDocument.addEventListener(`pointermove`,this.#t),this.#u=!0):e||(this.#V(),(this.#d===null||this.#d===`working`)&&this.#De())}#V(){this.#u&&=(this.ownerDocument.removeEventListener(`pointermove`,this.#t),!1)}#H(){let e=this.getAttribute(`connection`);if(e!==null&&e!==`connected`)return`static`;let t=this.getAttribute(`eyes`);return t===`dead`||t===`none`||t===`static`?t:`open`}#U(){return this.#r?.matches===!0||this.#H()!==`open`||!this.isConnected||!this.#p}#W(){return this.#H()!==`open`}#G(){let e=Yo(this.getAttribute(`activity`)),t=this.#e.querySelector(`.avatar[data-expressive]`)!==null;e===`awaiting`&&this.#d!==`awaiting`?this.#w=this.#F.now():e!==`awaiting`&&(this.#w=null),this.#P=null,this.#d=e,this.#I()!==t&&this.#L(),this.#B(),this.#K()}#K(){if(!this.#I()||!this.isConnected){this.#Z();return}if(this.#W()||this.#r?.matches){this.#X(),this.#q(),this.#ee();return}this.#le(),this.#Y()}#q(){for(let e of this.#M)this.#F.cancelRepeat(e);this.#M=[]}#J(){this.#I()||(this.#f=!0,this.isConnected&&this.#L()),this.#K()}#Y(){this.#O===null&&(this.#k=this.#F.now(),this.#O=this.#F.requestFrame(this.#Q))}#X(){this.#O!==null&&(this.#F.cancelFrame(this.#O),this.#O=null)}#Z(){this.#X();for(let e of this.#A)this.#F.cancelDelay(e);this.#A=[],this.#j!==null&&this.#F.cancelDelay(this.#j),this.#j=null;for(let e of this.#M)this.#F.cancelRepeat(e);this.#M=[]}#Q=e=>{this.#O=this.#F.requestFrame(this.#Q);let t=Math.min(.05,Math.max(0,(e-this.#k)/1e3));this.#k=e,this.#$(e,t),this.#_e()};#$(e,t){let n=Zo(this.#d);n!==this.#h&&!this.#g&&this.#ie(n),this.#m=Jo(this.#m,this.#h,6,t),this.#_=Jo(this.#_,this.#ne(e,!1),5,t),this.#v=Jo(this.#v,this.#re(e),5,t),this.#fe(e,t)}#ee(){let e=this.#F.now();this.#W()||(this.#h=this.#m=Zo(this.#d),this.#_=this.#ne(e,!0),this.#v=this.#re(e),this.#pe()),this.#_e(),this.#te(e)}#te(e){if(this.#j!==null&&this.#F.cancelDelay(this.#j),this.#j=null,this.#W())return;let t=this.#d===`awaiting`&&this.#w!==null?this.#w+this.drowseDelay*1e3:1/0,n=Math.min(this.#T>e?this.#T:1/0,this.#E>e?this.#E:1/0,t>e?t:1/0);Number.isFinite(n)&&(this.#j=this.#F.delay(()=>this.#ee(),Math.max(0,n-e)+1))}#ne(e,t){let n=this.#T>e?No:0;if(this.#d!==`awaiting`)return n;let r=this.#w===null?0:(e-this.#w)/1e3,i=this.drowseDelay;return Math.max(n,os(t&&r>i?i+12:r,i))}#re(e){return this.#E>e?Fo:0}#ie(e){if(this.#U()){this.#h=this.#m=e;return}this.#g=!0,this.#se(()=>{this.#h=this.#m=e,this.#g=!1})}#ae(){return[...this.#e.querySelectorAll(`.eye-blink`)]}#oe(){for(let e of this.#A)this.#F.cancelDelay(e);this.#A=[];for(let e of this.#ae())e.style.transition=`none`,e.style.transform=`scaleY(1)`}#se(e){let t=this.#ae();if(t.length===0){e?.();return}t.forEach((t,n)=>{this.#ce(t,n===0?e:void 0)})}#ce(e,t){e.style.transition=`transform 110ms ease-in`,e.style.transform=`scaleY(${Ao})`,this.#A.push(this.#F.delay(()=>{t?.(),this.#d===`thinking`&&!this.#W()&&(this.#y=cs(this.#y)),e.style.transition=`transform 130ms ease-out`,e.style.transform=`scaleY(1)`},120))}#le(){this.#M.length>0||this.#U()||this.#W()||[jo,Mo].forEach((e,t)=>{this.#M.push(this.#F.repeat(()=>{let e=this.#ae()[t];e&&this.hasAttribute(`blink`)&&!this.#W()&&this.#ce(e)},e))})}#ue(e){return this.#d===`thinking`?{target:this.#de(e,Vo,Ho),rate:9}:this.#d===`idle`?{target:this.#de(e,Uo,Wo),rate:Go}:this.#d===`awaiting`?{target:this.#he(e),rate:6}:null}#de(e,t,n){return e-this.#S>n&&(this.#S=e,this.#x=ls(this.#x,t.length,Math.random)),t[this.#x]??Ko}#fe(e,t){let n=this.#ue(e);n&&(this.#b={x:Jo(this.#b.x,n.target.x,n.rate,t),y:Jo(this.#b.y,n.target.y,n.rate,t)},this.#me())}#pe(){this.#d===`awaiting`?(this.#b=this.#he(this.#F.now()),this.#me()):(this.#d===`thinking`||this.#d===`idle`)&&this.#De()}#me(){this.#i&&Bs(this.#i,ds.cx,this.#b.x,this.#b.y,this.#l),this.#a&&Bs(this.#a,fs.cx,this.#b.x,this.#b.y,this.#l)}#he(e){if(this.#P!==null&&e-this.#P<xs)return this.#N;this.#P=e;let t=this.getAttribute(`gaze-target`),n=t?this.ownerDocument.querySelector(t):null,r=this.#o?.getBoundingClientRect();if(!n||!r?.width||!r.height)return this.#N=Ko,this.#N;let i=n.getBoundingClientRect();return this.#N={x:(i.left+i.width/2-r.left)*(200/r.width),y:(i.top+i.height/2-r.top)*(100/r.height)},this.#N}#ge(){return this.#d===`thinking`}#_e(){let e=this.#F.now(),t=this.#m,n=Qo(t),r=this.#z()*ts(this.#D-e);this.#C=r,this.#l=ns(r);for(let[e,i]of[`l`,`r`].entries()){let a=e===0?ds.cx:fs.cx;this.#ve(i,n),this.#ye(i,a,r,t),this.#be(i,a,t),this.#Se(i)}}#ve(e,t){for(let n of this.#e.querySelectorAll(`.eye-body-${e} .socket, .eye-body-${e} .eye-outline, .eye-body-${e} .noise-clip`))z(n,`rx`,t)}#ye(e,t,n,r){let i=this.#e.querySelector(`.pupil-${e} rect`);if(!i)return;z(i,`x`,t-n),z(i,`y`,50-n),z(i,`width`,n*2),z(i,`height`,n*2),z(i,`rx`,$o(n,r));let a=this.#e.querySelector(`.pupil-${e} circle`);z(a,`cx`,t-n*.3),z(a,`cy`,50-n*.35),z(a,`r`,n*.4)}#be(e,t,n){let r=this.#e.querySelector(`.eye-${e} .lid-clip`);if(!r)return;let i=rs(this.#_),a=is(this.#v);z(r,`y`,i),z(r,`height`,Math.max(0,a-i)),this.#xe(`.eye-${e} .lid-top`,t,i,n,this.#_),this.#xe(`.eye-${e} .lid-bottom`,t,a,n,this.#v)}#xe(e,t,n,r,i){let a=this.#e.querySelector(e);if(!a)return;let o=as(n,r);z(a,`x1`,t-o),z(a,`x2`,t+o),z(a,`y1`,n),z(a,`y2`,n),Ts(a,`display`,i>.02?`inline`:`none`)}#Se(e){let t=this.#e.querySelector(`.brow-${e}`);if(!t)return;let n=this.#ge(),r=e===`l`?this.#y.left:this.#y.right;Ts(t,`opacity`,n?`1`:`0`),t.style.transform=n?`translateY(${r.raise.toFixed(2)}px) rotate(${r.tilt.toFixed(2)}deg)`:`translateY(6px)`}#Ce(){if(this.#Ee(),this.#s.length===0&&this.#we(),this.#r?.matches){this.#Te(null);return}this.#Te(Rs()),this.#c=window.setInterval(()=>{this.#Te(Rs())},1e3/ms)}#we(){let e=this.#o?.getBoundingClientRect(),t=e?Math.min(e.width/200,e.height/100):0,n=ps/(t>0?t:.25);this.#s=[...this.#e.querySelectorAll(`.noise`)].map((e,t)=>{let r=t===0?ds.cx:fs.cx,i=[],a=r-ds.r,o=r+ds.r,s=50-ds.r,c=50+ds.r;for(let e=s;e<c;e+=n)for(let t=a;t<o;t+=n){let r=R(`rect`,{x:t,y:e,width:Math.min(n,o-t),height:Math.min(n,c-e),opacity:hs});i.push(r)}return e.replaceChildren(...i),i})}#Te(e){this.#s.forEach((t,n)=>{let r=e===null?Is(n):Ls(n,e),i=r===0?_s:r;(t[0]?.parentElement)?.setAttribute(`data-seed`,String(i));for(let e of t){i=Fs(i);let t=`${gs[i%gs.length]*100}%`;e.setAttribute(`fill`,`rgb(${t} ${t} ${t})`)}})}#Ee(){this.#c!==null&&(window.clearInterval(this.#c),this.#c=null)}#De(){this.#i?.setAttribute(`transform`,`translate(0,0)`),this.#a?.setAttribute(`transform`,`translate(0,0)`)}#Oe(e){if(!this.#o||!this.#i||!this.#a)return;let t=this.#o.getBoundingClientRect();!t.width||!t.height||(this.#b={x:(e.clientX-t.left)*(200/t.width),y:(e.clientY-t.top)*(100/t.height)},this.#me())}});var Hs=M(`
4624
+ `);function z(e,t,...n){let r=document.createElementNS(ps,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function Os(e,t,n){e&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function ks(e,t,n){Os(e,t,n.toFixed(2))}function As(e,t){let n=e.replace(`#`,``),r=n.length===3?[...n].map(e=>`${e}${e}`).join(``):n,i=Number.parseInt(r,16);if(!Number.isFinite(i))return e;let a=t<0?0:255,o=e=>Math.round(e+(a-e)*Math.abs(t)).toString(16).padStart(2,`0`);return`#${o(i>>16&255)}${o(i>>8&255)}${o(i&255)}`}function js(e,t,n){let r=[[`path`,{d:`M108.22,414.88l189.84,460.03c1.36,3.3,6.09,3.16,7.25-.22l159.34-463.34c.87-2.53-1.03-5.16-3.7-5.13l-349.18,3.32c-2.74.03-4.59,2.82-3.55,5.35Z`,fill:e,stroke:t,"stroke-linejoin":`round`,"stroke-width":20}],[`path`,{d:`M261.93,482.48h0c15.03-15.03,4.46-40.72-16.79-40.83h0c-21.37-.11-32.14,25.72-17.03,40.83h0c9.34,9.34,24.48,9.34,33.82,0Z`,fill:n}],[`path`,{d:`M384.85,527.49l-51.82,51.82c-2.24,2.24-2.24,5.86,0,8.1l55.71,55.71c2.24,2.24,5.86,2.24,8.1,0h0c.62-.62,1.08-1.36,1.37-2.19l26.52-77.11c.71-2.07.18-4.36-1.37-5.91l-30.41-30.41c-2.24-2.24-5.86-2.24-8.1,0Z`,fill:n}],[`path`,{d:`M371.7,684.58l-25.94,25.94c-2.24,2.24-2.24,5.86,0,8.1l12.67,12.67c2.99,2.99,8.09,1.82,9.46-2.19l13.28-38.61c1.97-5.74-5.17-10.2-9.46-5.91Z`,fill:n}],[`path`,{d:`M159.42,564.14l2.73,6.83c1.52,3.82,6.46,4.83,9.37,1.93l2.05-2.05c2.24-2.24,2.24-5.86,0-8.1l-4.78-4.78c-4.4-4.4-11.67.39-9.37,6.17Z`,fill:n}],[`path`,{d:`M243.92,633.11l-48.65-48.65c-5.24-5.24-13.74-5.24-18.99,0h0c-3.8,3.8-4.97,9.49-2.98,14.47l27.77,69.54c3.58,8.95,15.14,11.33,21.96,4.51l20.89-20.89c5.24-5.24,5.24-13.74,0-18.99Z`,fill:n}],[`path`,{d:`M211.32,533.1h0c14.11-14.11,14.11-36.98,0-51.08l-34.94-34.94c-.72-.72-.72-1.89,0-2.62h0c1.16-1.16.34-3.15-1.3-3.16l-11.23-.06c-25.62-.13-43.23,25.72-33.73,49.51l5.37,13.45c1.82,4.55,4.54,8.68,8,12.15l16.74,16.74c14.11,14.11,36.98,14.11,51.08,0Z`,fill:n}],[`path`,{d:`M263.74,792.53h0c-5.69,5.69-7.45,14.23-4.46,21.71l22.5,56.36c6.92,17.34,31.68,16.74,37.75-.92l8.66-25.2c2.5-7.28.64-15.35-4.8-20.79l-31.17-31.17c-7.87-7.87-20.62-7.87-28.48,0Z`,fill:n}],[`path`,{d:`M392.94,503.07l40.81-40.81c2.24-2.24,5.86-2.24,8.1,0l.06.06c2.24,2.24,2.24,5.86,0,8.1l-40.81,40.81c-2.24,2.24-2.24,5.86,0,8.1l22.48,22.48c2.99,2.99,8.09,1.82,9.46-2.19l30.71-89.32c1.27-3.71-1.47-7.57-5.39-7.59l-120.63-.6c-5.11-.03-7.69,6.16-4.08,9.77l51.18,51.18c2.24,2.24,5.86,2.24,8.1,0Z`,fill:n}]],i=[[274.59,463.59,84.73,95.66,42.36,`translate(-268.79 373.91) rotate(-45)`],[291.06,603.84,72.24,90.24,36.12,`translate(-363.06 421.43) rotate(-45)`],[217.18,527.25,72.24,95.66,36.12,`translate(-332.45 347.55) rotate(-45)`],[236.26,661.25,67.04,90.24,33.52,`translate(-420.46 397.65) rotate(-45)`]],a=r.map(([e,t])=>z(e,t));return a.push(...i.map(([e,t,r,i,a,o])=>z(`rect`,{x:e,y:t,width:r,height:i,rx:a,ry:a,transform:o,fill:n})),z(`ellipse`,{cx:288.37,cy:404.38,rx:182.34,ry:67.01,fill:e,stroke:t,"stroke-miterlimit":10,"stroke-width":20})),a}function Ms(e,t){return[z(`path`,{d:`M566.75,340.67c0-29.85-12.97-56.87-33.96-76.47,4.8-9.98,7.44-20.71,7.44-31.9,0-38.29-30.62-71.33-74.92-86.77.33-3.07.51-6.17.51-9.3,0-69.72-84.29-126.24-188.26-126.24s-188.26,56.52-188.26,126.24c0,4,.29,7.95.83,11.86-34.94,15.4-58.48,44.25-58.48,77.34,0,18.21,7.15,34.25,19.39,49.26-25.1,19.88-41.05,49.47-41.05,82.54,0,59.85,52.15,108.37,116.49,108.37,10.83,0,21.3-1.4,31.26-3.98,31.42,41.91,83.55,69.34,142.55,69.34,64.73,0,121.2-33,151.11-81.94,63.8-.57,115.34-48.85,115.34-108.34Z`,fill:e,stroke:t,"stroke-width":20})]}function Ns(e,t,n,r){return z(`rect`,{x:e-t,y:50-t,width:t*2,height:t*2,rx:n,...r})}function Ps(e,t,n,r){return z(`g`,{class:`pupil pupil-${t}`},Ns(e,n,ns(n,r),{fill:`#000`}),z(`circle`,{cx:e-n*.3,cy:50-n*.35,r:n*.4,fill:`#fff`}))}function Fs(e,t){return z(`line`,{class:`lid-line lid-${t}`,x1:e-38,y1:50,x2:e+38,y2:50,stroke:`#000`,"stroke-width":4,"stroke-linecap":`round`,display:`none`})}function Is(e,t){let n=z(`line`,{class:`brow brow-${t}`,x1:e-22,y1:2,x2:e+22,y2:2,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`,opacity:0});return n.style.transformBox=`fill-box`,n.style.transformOrigin=`center`,n}function Ls(e,t,n){let r=z(`g`,{class:`${n} eye-${t}`});return r.style.transformOrigin=`${e}px 50px`,r}function Rs(e,t,n){let r=`slicc-agent-avatar-noise-${t}`;return z(`g`,{class:`eye-static eye-body-${t}`},z(`defs`,{},z(`clipPath`,{id:r},Ns(e,38,n,{class:`noise-clip`}))),Ns(e,38,n,{class:`socket`,fill:`#fff`}),z(`g`,{class:`noise noise-${t}`,"clip-path":`url(#${r})`,"data-cell-size":gs}),Ns(e,38,n,{class:`eye-outline`,fill:`none`,stroke:`#000`,"stroke-width":4}))}function zs(e){return e^=e<<13,e^=e>>>17,e^=e<<5,e>>>0}function Bs(e){return(bs^Math.imul(e,Ss))>>>0}function Vs(e,t){return(Bs(e)^Math.imul(t,xs))>>>0}function Hs(){return Math.floor((Date.now()-Cs)/1e3*_s)>>>0}function Us(e){return[z(`circle`,{cx:e,cy:50,r:38,fill:`#fff`,stroke:`#000`,"stroke-width":4}),z(`line`,{x1:e-15,y1:35,x2:e+15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`}),z(`line`,{x1:e+15,y1:35,x2:e-15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`})]}function Ws(e,t,n,r,i){let a=n-t,o=r-50,s=Math.hypot(a,o),c=Math.min(s,i),l=s>0?a/s*c:0,u=s>0?o/s*c:0;e.setAttribute(`transform`,`translate(${l.toFixed(2)},${u.toFixed(2)})`)}var Gs={now:()=>performance.now(),requestFrame:e=>window.requestAnimationFrame(e),cancelFrame:e=>window.cancelAnimationFrame(e),delay:(e,t)=>window.setTimeout(e,t),cancelDelay:e=>window.clearTimeout(e),repeat:(e,t)=>window.setInterval(e,t),cancelRepeat:e=>window.clearInterval(e)};A(`slicc-agent-avatar`,class extends HTMLElement{static observedAttributes=[`type`,`color`,`eyes`,`fill`,`connection`,`activity`,`gaze-target`,`drowse-delay`];#e;#t=e=>this.#Oe(e);#n=()=>{this.#B(),this.#K(),this.#H()===`static`&&this.#Ce()};#r=null;#i=null;#a=null;#o=null;#s=[];#c=null;#l=16;#u=!1;#d=null;#f=!1;#p=!1;#m=0;#h=0;#g=!1;#_=0;#v=0;#y=Uo;#b={x:100,y:50};#x=0;#S=0;#C=18;#w=null;#T=0;#E=0;#D=0;#O=null;#k=0;#A=[];#j=null;#M=[];#N=Yo;#P=null;#F=Gs;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ds]}connectedCallback(){this.#r=window.matchMedia(`(prefers-reduced-motion: reduce)`),this.#r.addEventListener(`change`,this.#n),this.#L(),this.#B(),this.#K()}disconnectedCallback(){this.#V(),this.#Ee(),this.#Z(),this.#r?.removeEventListener(`change`,this.#n),this.#r=null,this.#p=!1}attributeChangedCallback(e){if(this.isConnected){if(e===`activity`||e===`gaze-target`||e===`drowse-delay`){this.#G();return}this.#L(),this.#B(),this.#K()}}get activity(){return Qo(this.getAttribute(`activity`))}set activity(e){e===null?this.removeAttribute(`activity`):this.setAttribute(`activity`,e)}get gazeTarget(){return this.getAttribute(`gaze-target`)}set gazeTarget(e){e===null?this.removeAttribute(`gaze-target`):this.setAttribute(`gaze-target`,e)}get drowseDelay(){return $o(this.getAttribute(`drowse-delay`))}set drowseDelay(e){this.setAttribute(`drowse-delay`,String(e))}get clock(){return this.#F}set clock(e){if(e===this.#F)return;this.#Z(),this.#F=e;let t=e.now();this.#k=t,this.#w!==null&&(this.#w=t),this.#T=0,this.#E=0,this.#D=0,this.#P=null,this.isConnected&&this.#K()}get expression(){return Object.freeze({activity:this.#d,shape:this.#m,lidTop:this.#_,lidBottom:this.#v,pupilRadius:this.#C,gaze:{...this.#b},brows:this.#y,browsVisible:this.#ge()})}wake(){let e=this.#F.now();this.#w=e,this.#U()||(this.#D=e+350,this.#se()),this.#J()}scrutinize(){this.#E=this.#F.now()+zo,this.#J()}glower(){this.#T=this.#F.now()+Lo,this.#J()}resetExpression(){this.#oe();let e=this.#F.now();this.#T=0,this.#E=0,this.#D=0,this.#_=0,this.#v=0,this.#y=Uo,this.#N=Yo,this.#P=null,this.#S=0,this.#w=this.#d===`awaiting`?e:null,this.#g=!1,this.#h=es(this.#d),this.#m=this.#h,this.#k=e,this.#I()&&this.isConnected&&(this.#_e(),this.#K())}#I(){return this.hasAttribute(`activity`)||this.#f}#L(){this.#Ee(),this.#s=[];let e=this.getAttribute(`type`)===`cone`?`cone`:`scoop`,t=Ts[e],n=this.getAttribute(`color`)??Es[e],r=this.#I();this.#d=Qo(this.getAttribute(`activity`)),this.#d===`awaiting`&&this.#w===null&&(this.#w=this.#F.now()),this.#p||=(this.#m=this.#h=es(this.#d),!0);let i=z(`svg`,{class:`glyph`,viewBox:t.vb,preserveAspectRatio:`xMidYMid meet`,style:`--g:${t.glyph}%`},...e===`cone`?js(n,As(n,-.38),As(n,.3)):Ms(n,As(n,-.32)));this.#o=z(`svg`,{class:`eyes-svg`,viewBox:`0 0 200 100`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},...this.#R(r));let a=j(`span`,{class:`eyes`,style:`top:${t.eyes.top}%;left:${t.eyes.left}%;width:${t.eyes.width}%;height:${t.eyes.height}%`});a.append(this.#o);let o=j(`span`,{class:`icon-inner`,style:`--tx:${((.5-t.zoom*((t.eyes.left+t.eyes.width/2)/100))*100).toFixed(2)}%;--ty:${((.5-t.zoom*((t.eyes.top+t.eyes.height/2)/100))*100).toFixed(2)}%;--zoom:${t.zoom}`},i,a);this.#e.replaceChildren(j(`span`,{class:`avatar`,"aria-hidden":`true`,"data-expressive":r||null},o)),this.#i=this.#e.querySelector(`.pupil-l`),this.#a=this.#e.querySelector(`.pupil-r`),this.#H()===`static`&&this.#Ce(),r&&this.#_e()}#R(e){let t=this.#H();if(t===`none`)return[];if(t===`dead`)return[...Us(ms.cx),...Us(hs.cx)];this.#C=this.#z(),this.#l=as(this.#C);let n=ts(this.#m);return[ms.cx,hs.cx].map((r,i)=>{let a=i===0?`l`:`r`,o=t===`static`,s=Ls(r,a,o?`eye-frozen`:`eye-blink`),c=o?Rs(r,a,n):z(`g`,{class:`eye-body eye-body-${a}`},Ns(r,38,n,{class:`socket`,fill:`#fff`,stroke:`#000`,"stroke-width":4}),Ps(r,a,this.#C,this.#m));if(s.append(c),!e)return s;let l=`slicc-agent-avatar-lid-${a}`;return s.append(z(`defs`,{},z(`clipPath`,{id:l},z(`rect`,{class:`lid-clip`,x:r-38-3,y:9,width:82,height:82}))),Fs(r,`top`),Fs(r,`bottom`),Is(r,a)),c.setAttribute(`clip-path`,`url(#${l})`),s})}#z(){return 18*rs(Math.max(0,Math.min(100,Number.parseFloat(this.getAttribute(`fill`)??`0`)||0)))}#B(){let e=this.#H()===`open`&&!this.#r?.matches&&(this.#d===null||this.#d===`working`);e&&!this.#u?(this.ownerDocument.addEventListener(`pointermove`,this.#t),this.#u=!0):e||(this.#V(),(this.#d===null||this.#d===`working`)&&this.#De())}#V(){this.#u&&=(this.ownerDocument.removeEventListener(`pointermove`,this.#t),!1)}#H(){let e=this.getAttribute(`connection`);if(e!==null&&e!==`connected`)return`static`;let t=this.getAttribute(`eyes`);return t===`dead`||t===`none`||t===`static`?t:`open`}#U(){return this.#r?.matches===!0||this.#H()!==`open`||!this.isConnected||!this.#p}#W(){return this.#H()!==`open`}#G(){let e=Qo(this.getAttribute(`activity`)),t=this.#e.querySelector(`.avatar[data-expressive]`)!==null;e===`awaiting`&&this.#d!==`awaiting`?this.#w=this.#F.now():e!==`awaiting`&&(this.#w=null),this.#P=null,this.#d=e,this.#I()!==t&&this.#L(),this.#B(),this.#K()}#K(){if(!this.#I()||!this.isConnected){this.#Z();return}if(this.#W()||this.#r?.matches){this.#X(),this.#q(),this.#ee();return}this.#le(),this.#Y()}#q(){for(let e of this.#M)this.#F.cancelRepeat(e);this.#M=[]}#J(){this.#I()||(this.#f=!0,this.isConnected&&this.#L()),this.#K()}#Y(){this.#O===null&&(this.#k=this.#F.now(),this.#O=this.#F.requestFrame(this.#Q))}#X(){this.#O!==null&&(this.#F.cancelFrame(this.#O),this.#O=null)}#Z(){this.#X();for(let e of this.#A)this.#F.cancelDelay(e);this.#A=[],this.#j!==null&&this.#F.cancelDelay(this.#j),this.#j=null;for(let e of this.#M)this.#F.cancelRepeat(e);this.#M=[]}#Q=e=>{this.#O=this.#F.requestFrame(this.#Q);let t=Math.min(.05,Math.max(0,(e-this.#k)/1e3));this.#k=e,this.#$(e,t),this.#_e()};#$(e,t){let n=es(this.#d);n!==this.#h&&!this.#g&&this.#ie(n),this.#m=Zo(this.#m,this.#h,6,t),this.#_=Zo(this.#_,this.#ne(e,!1),5,t),this.#v=Zo(this.#v,this.#re(e),5,t),this.#fe(e,t)}#ee(){let e=this.#F.now();this.#W()||(this.#h=this.#m=es(this.#d),this.#_=this.#ne(e,!0),this.#v=this.#re(e),this.#pe()),this.#_e(),this.#te(e)}#te(e){if(this.#j!==null&&this.#F.cancelDelay(this.#j),this.#j=null,this.#W())return;let t=this.#d===`awaiting`&&this.#w!==null?this.#w+this.drowseDelay*1e3:1/0,n=Math.min(this.#T>e?this.#T:1/0,this.#E>e?this.#E:1/0,t>e?t:1/0);Number.isFinite(n)&&(this.#j=this.#F.delay(()=>this.#ee(),Math.max(0,n-e)+1))}#ne(e,t){let n=this.#T>e?Io:0;if(this.#d!==`awaiting`)return n;let r=this.#w===null?0:(e-this.#w)/1e3,i=this.drowseDelay;return Math.max(n,ls(t&&r>i?i+12:r,i))}#re(e){return this.#E>e?Ro:0}#ie(e){if(this.#U()){this.#h=this.#m=e;return}this.#g=!0,this.#se(()=>{this.#h=this.#m=e,this.#g=!1})}#ae(){return[...this.#e.querySelectorAll(`.eye-blink`)]}#oe(){for(let e of this.#A)this.#F.cancelDelay(e);this.#A=[];for(let e of this.#ae())e.style.transition=`none`,e.style.transform=`scaleY(1)`}#se(e){let t=this.#ae();if(t.length===0){e?.();return}t.forEach((t,n)=>{this.#ce(t,n===0?e:void 0)})}#ce(e,t){e.style.transition=`transform 110ms ease-in`,e.style.transform=`scaleY(${No})`,this.#A.push(this.#F.delay(()=>{t?.(),this.#d===`thinking`&&!this.#W()&&(this.#y=ds(this.#y)),e.style.transition=`transform 130ms ease-out`,e.style.transform=`scaleY(1)`},120))}#le(){this.#M.length>0||this.#U()||this.#W()||[Po,Fo].forEach((e,t)=>{this.#M.push(this.#F.repeat(()=>{let e=this.#ae()[t];e&&this.hasAttribute(`blink`)&&!this.#W()&&this.#ce(e)},e))})}#ue(e){return this.#d===`thinking`?{target:this.#de(e,Wo,Go),rate:9}:this.#d===`idle`?{target:this.#de(e,Ko,qo),rate:Jo}:this.#d===`awaiting`?{target:this.#he(e),rate:6}:null}#de(e,t,n){return e-this.#S>n&&(this.#S=e,this.#x=fs(this.#x,t.length,Math.random)),t[this.#x]??Yo}#fe(e,t){let n=this.#ue(e);n&&(this.#b={x:Zo(this.#b.x,n.target.x,n.rate,t),y:Zo(this.#b.y,n.target.y,n.rate,t)},this.#me())}#pe(){this.#d===`awaiting`?(this.#b=this.#he(this.#F.now()),this.#me()):(this.#d===`thinking`||this.#d===`idle`)&&this.#De()}#me(){this.#i&&Ws(this.#i,ms.cx,this.#b.x,this.#b.y,this.#l),this.#a&&Ws(this.#a,hs.cx,this.#b.x,this.#b.y,this.#l)}#he(e){if(this.#P!==null&&e-this.#P<ws)return this.#N;this.#P=e;let t=this.getAttribute(`gaze-target`),n=t?this.ownerDocument.querySelector(t):null,r=this.#o?.getBoundingClientRect();if(!n||!r?.width||!r.height)return this.#N=Yo,this.#N;let i=n.getBoundingClientRect();return this.#N={x:(i.left+i.width/2-r.left)*(200/r.width),y:(i.top+i.height/2-r.top)*(100/r.height)},this.#N}#ge(){return this.#d===`thinking`}#_e(){let e=this.#F.now(),t=this.#m,n=ts(t),r=this.#z()*is(this.#D-e);this.#C=r,this.#l=as(r);for(let[e,i]of[`l`,`r`].entries()){let a=e===0?ms.cx:hs.cx;this.#ve(i,n),this.#ye(i,a,r,t),this.#be(i,a,t),this.#Se(i)}}#ve(e,t){for(let n of this.#e.querySelectorAll(`.eye-body-${e} .socket, .eye-body-${e} .eye-outline, .eye-body-${e} .noise-clip`))ks(n,`rx`,t)}#ye(e,t,n,r){let i=this.#e.querySelector(`.pupil-${e} rect`);if(!i)return;ks(i,`x`,t-n),ks(i,`y`,50-n),ks(i,`width`,n*2),ks(i,`height`,n*2),ks(i,`rx`,ns(n,r));let a=this.#e.querySelector(`.pupil-${e} circle`);ks(a,`cx`,t-n*.3),ks(a,`cy`,50-n*.35),ks(a,`r`,n*.4)}#be(e,t,n){let r=this.#e.querySelector(`.eye-${e} .lid-clip`);if(!r)return;let i=os(this.#_),a=ss(this.#v);ks(r,`y`,i),ks(r,`height`,Math.max(0,a-i)),this.#xe(`.eye-${e} .lid-top`,t,i,n,this.#_),this.#xe(`.eye-${e} .lid-bottom`,t,a,n,this.#v)}#xe(e,t,n,r,i){let a=this.#e.querySelector(e);if(!a)return;let o=cs(n,r);ks(a,`x1`,t-o),ks(a,`x2`,t+o),ks(a,`y1`,n),ks(a,`y2`,n),Os(a,`display`,i>.02?`inline`:`none`)}#Se(e){let t=this.#e.querySelector(`.brow-${e}`);if(!t)return;let n=this.#ge(),r=e===`l`?this.#y.left:this.#y.right;Os(t,`opacity`,n?`1`:`0`),t.style.transform=n?`translateY(${r.raise.toFixed(2)}px) rotate(${r.tilt.toFixed(2)}deg)`:`translateY(6px)`}#Ce(){if(this.#Ee(),this.#s.length===0&&this.#we(),this.#r?.matches){this.#Te(null);return}this.#Te(Hs()),this.#c=window.setInterval(()=>{this.#Te(Hs())},1e3/_s)}#we(){let e=this.#o?.getBoundingClientRect(),t=e?Math.min(e.width/200,e.height/100):0,n=gs/(t>0?t:.25);this.#s=[...this.#e.querySelectorAll(`.noise`)].map((e,t)=>{let r=t===0?ms.cx:hs.cx,i=[],a=r-ms.r,o=r+ms.r,s=50-ms.r,c=50+ms.r;for(let e=s;e<c;e+=n)for(let t=a;t<o;t+=n){let r=z(`rect`,{x:t,y:e,width:Math.min(n,o-t),height:Math.min(n,c-e),opacity:vs});i.push(r)}return e.replaceChildren(...i),i})}#Te(e){this.#s.forEach((t,n)=>{let r=e===null?Bs(n):Vs(n,e),i=r===0?bs:r;(t[0]?.parentElement)?.setAttribute(`data-seed`,String(i));for(let e of t){i=zs(i);let t=`${ys[i%ys.length]*100}%`;e.setAttribute(`fill`,`rgb(${t} ${t} ${t})`)}})}#Ee(){this.#c!==null&&(window.clearInterval(this.#c),this.#c=null)}#De(){this.#i?.setAttribute(`transform`,`translate(0,0)`),this.#a?.setAttribute(`transform`,`translate(0,0)`)}#Oe(e){if(!this.#o||!this.#i||!this.#a)return;let t=this.#o.getBoundingClientRect();!t.width||!t.height||(this.#b={x:(e.clientX-t.left)*(200/t.width),y:(e.clientY-t.top)*(100/t.height)},this.#me())}});var Ks=M(`
4578
4625
  :host{display:inline-block;}
4579
4626
  .switcher-more{position:relative;}
4580
4627
  .morebtn{display:none;font:inherit;font-size:13px;font-weight:600;color:var(--txt-2);background:transparent;border:1px solid var(--line);border-radius:9999px;height:var(--ctl-h,30px);padding:0 11px;cursor:pointer;line-height:1;align-items:center;}
@@ -4606,14 +4653,14 @@ iframe {
4606
4653
  @keyframes scoopReveal{from{opacity:0;transform:translateY(-4px);}to{opacity:1;transform:none;}}
4607
4654
  @keyframes scoopArc{from{transform:rotate(-90deg);}to{transform:rotate(270deg);}}
4608
4655
  @media (prefers-reduced-motion:reduce){.popup-row{animation:none;}.popup-row[data-state="working"] .glyph-arc{animation:none;transform:rotate(-90deg);}}
4609
- `),Us=[4,5,3,7,1,6,2,0,8],Ws=`http://www.w3.org/2000/svg`,Gs=5,Ks=2*Math.PI*Gs;function qs(e,t,...n){let r=document.createElementNS(Ws,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function Js(e){return typeof e==`number`&&Number.isFinite(e)?Math.max(0,Math.min(100,e)):0}function Ys(e){return e.state??`idle`}function Xs(e){return(90+Js(e)*2.7)/360*Ks}function Zs(e,t){let n=[];return e===`initializing`?n.push(qs(`circle`,{class:`initializing-ring`,cx:7,cy:7,r:Gs,"stroke-width":1.7})):n.push(qs(`circle`,{class:`glyph-base`,cx:7,cy:7,r:Gs,"stroke-width":1.5})),(e===`working`||e===`idle`)&&n.push(qs(`circle`,{class:`glyph-arc`,cx:7,cy:7,r:Gs,"stroke-width":2,"stroke-dasharray":`${Xs(t).toFixed(3)} ${Ks.toFixed(3)}`,"stroke-dashoffset":0})),e===`working`&&n.push(qs(`circle`,{class:`glyph-pin`,cx:7,cy:7,r:1.25})),e===`broken`&&n.push(qs(`line`,{class:`broken-x`,x1:4.8,y1:4.8,x2:9.2,y2:9.2,"stroke-width":1.8}),qs(`line`,{class:`broken-x`,x1:9.2,y1:4.8,x2:4.8,y2:9.2,"stroke-width":1.8})),qs(`svg`,{class:`status-glyph`,viewBox:`0 0 14 14`,width:14,height:14,"aria-hidden":`true`},...n)}function Qs(e){return e.state===`broken`?`broken`:(e.fill??0)>=75?`near-limit`:e.state===`working`?`working`:`idle`}function $s(e){return e===`broken`?3:e===`near-limit`?2:+(e===`working`)}function ec(e){let t=e.reduce((e,t)=>{let n=Qs(t);return $s(n)>$s(e)?n:e},`idle`),n=t===`near-limit`?`near context limit`:t;return`${e.length} hidden scoop${e.length===1?``:`s`}; worst state ${n}`}function tc(e,t=!1){if(t)return j(`span`,{class:`overflow-grid-cell overflow-grid-cell--plus`,"aria-hidden":`true`},j(`span`,{class:`overflow-plus-bar overflow-plus-bar--horizontal`}),j(`span`,{class:`overflow-plus-bar overflow-plus-bar--vertical`}));let n={class:`overflow-grid-cell`,"aria-hidden":`true`};return e&&(n[`data-dot-state`]=e),j(`span`,n)}function nc(e){let t=e.map((e,t)=>({order:t,state:Qs(e)})).sort((e,t)=>$s(t.state)-$s(e.state)||e.order-t.order).slice(0,e.length>9?8:9),n=Array.from({length:Us.length},()=>tc());return t.forEach((e,t)=>{n[Us[t]]=tc(e.state)}),e.length>9&&(n[Us.at(-1)]=tc(void 0,!0)),j(`span`,{class:`overflow-grid`,role:`img`,"aria-label":ec(e),"data-hidden-count":String(e.length)},...n)}A(`slicc-scoop-overflow`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n;#r;#i;#a;#o=e=>{this.open&&!this.contains(e.target)&&this.close()};#s=e=>{!this.open||e.key!==`Escape`||(e.preventDefault(),this.close(),this.#r.focus())};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Hs]}connectedCallback(){this.#c()}disconnectedCallback(){document.removeEventListener(`click`,this.#o),document.removeEventListener(`keydown`,this.#s)}attributeChangedCallback(e){e===`open`&&this.#n&&this.#u()}get items(){return this.#t}set items(e){this.#t=Array.isArray(e)?e:[],this.isConnected&&this.#l()}get count(){return this.#t.length}get hasOverflow(){return this.#t.length>0}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}show(){this.open||=!0}close(){this.open&&=!1}toggle(){this.open=!this.open}#c(){this.#i=j(`slot`,{name:`more`},nc(this.#t)),this.#r=j(`button`,{class:`morebtn`,part:`more`,type:`button`,title:`More scoops`,"aria-haspopup":`true`,"aria-expanded":`false`},this.#i),this.#a=j(`div`,{class:`pop`,part:`pop`,role:`menu`}),this.#n=j(`div`,{class:`switcher-more`,part:`wrap`},this.#r,this.#a),this.#r.addEventListener(`click`,e=>{e.stopPropagation(),this.toggle()}),this.#e.replaceChildren(this.#n),this.#l(),this.#u()}#l(){let e=this.#t.length;e>0?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`),this.#n.classList.toggle(`has-overflow`,e>0),this.#r.setAttribute(`aria-haspopup`,`true`);let t=ec(this.#t);if(this.#r.setAttribute(`aria-label`,`${t}. Show hidden scoops`),this.#i.replaceChildren(nc(this.#t)),e===0){this.#a.replaceChildren(j(`slot`,{name:`empty`})),this.open&&this.close();return}let n=[];this.#t.forEach((e,t)=>{let r=e.id,i=e.label??e.id,a=Ys(e),o=Js(e.fill),s=j(`button`,{class:`popup-row`,part:`row`,type:`button`,role:`menuitem`,"aria-label":`${i}: ${a}, ${o}% context fill`,"data-state":a,"data-k":r,style:`--hue:${e.color??`var(--rose)`};--i:${t}`},Zs(a,o),j(`span`,{class:`popup-label`},i),j(`span`,{class:`popup-state`},`${a} · ${o}%`));s.addEventListener(`click`,()=>{let e=s.dataset.k??``,t=this.#t.find(t=>t.id===e);this.#d(e,t?.label??e)}),n.push(s)}),this.#a.replaceChildren(...n)}#u(){let e=this.open;this.#n.classList.toggle(`open`,e),this.#r.setAttribute(`aria-expanded`,e?`true`:`false`),document.removeEventListener(`click`,this.#o),document.removeEventListener(`keydown`,this.#s),e&&(document.addEventListener(`click`,this.#o),document.addEventListener(`keydown`,this.#s))}#d(e,t){this.dispatchEvent(new CustomEvent(`slicc-scoop-select`,{detail:{id:e,key:e,label:t},bubbles:!0,composed:!0})),this.close()}});var B=`slicc-agent-tabs`,rc=`${B}-style`,ic=`http://www.w3.org/2000/svg`,ac=5,oc=2*Math.PI*ac,sc=26,cc=8,lc=6,uc=39,dc=`sliccy`,fc=14,pc=5,mc=16,hc=4,gc=65,_c={cone:`var(--waffle)`,researcher:`var(--cyan)`,designer:`var(--violet)`,tester:`var(--amber)`,triage:`var(--green)`},vc=`
4610
- .slicc-agent-tabs{display:flex;align-items:center;gap:${cc}px;min-width:0;overflow:visible;color:var(--ink);font-family:var(--ui);}
4656
+ `),qs=[4,5,3,7,1,6,2,0,8],Js=`http://www.w3.org/2000/svg`,Ys=5,Xs=2*Math.PI*Ys;function Zs(e,t,...n){let r=document.createElementNS(Js,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function Qs(e){return typeof e==`number`&&Number.isFinite(e)?Math.max(0,Math.min(100,e)):0}function $s(e){return e.state??`idle`}function ec(e){return(90+Qs(e)*2.7)/360*Xs}function tc(e,t){let n=[];return e===`initializing`?n.push(Zs(`circle`,{class:`initializing-ring`,cx:7,cy:7,r:Ys,"stroke-width":1.7})):n.push(Zs(`circle`,{class:`glyph-base`,cx:7,cy:7,r:Ys,"stroke-width":1.5})),(e===`working`||e===`idle`)&&n.push(Zs(`circle`,{class:`glyph-arc`,cx:7,cy:7,r:Ys,"stroke-width":2,"stroke-dasharray":`${ec(t).toFixed(3)} ${Xs.toFixed(3)}`,"stroke-dashoffset":0})),e===`working`&&n.push(Zs(`circle`,{class:`glyph-pin`,cx:7,cy:7,r:1.25})),e===`broken`&&n.push(Zs(`line`,{class:`broken-x`,x1:4.8,y1:4.8,x2:9.2,y2:9.2,"stroke-width":1.8}),Zs(`line`,{class:`broken-x`,x1:9.2,y1:4.8,x2:4.8,y2:9.2,"stroke-width":1.8})),Zs(`svg`,{class:`status-glyph`,viewBox:`0 0 14 14`,width:14,height:14,"aria-hidden":`true`},...n)}function nc(e){return e.state===`broken`?`broken`:(e.fill??0)>=75?`near-limit`:e.state===`working`?`working`:`idle`}function rc(e){return e===`broken`?3:e===`near-limit`?2:+(e===`working`)}function ic(e){let t=e.reduce((e,t)=>{let n=nc(t);return rc(n)>rc(e)?n:e},`idle`),n=t===`near-limit`?`near context limit`:t;return`${e.length} hidden scoop${e.length===1?``:`s`}; worst state ${n}`}function ac(e,t=!1){if(t)return j(`span`,{class:`overflow-grid-cell overflow-grid-cell--plus`,"aria-hidden":`true`},j(`span`,{class:`overflow-plus-bar overflow-plus-bar--horizontal`}),j(`span`,{class:`overflow-plus-bar overflow-plus-bar--vertical`}));let n={class:`overflow-grid-cell`,"aria-hidden":`true`};return e&&(n[`data-dot-state`]=e),j(`span`,n)}function oc(e){let t=e.map((e,t)=>({order:t,state:nc(e)})).sort((e,t)=>rc(t.state)-rc(e.state)||e.order-t.order).slice(0,e.length>9?8:9),n=Array.from({length:qs.length},()=>ac());return t.forEach((e,t)=>{n[qs[t]]=ac(e.state)}),e.length>9&&(n[qs.at(-1)]=ac(void 0,!0)),j(`span`,{class:`overflow-grid`,role:`img`,"aria-label":ic(e),"data-hidden-count":String(e.length)},...n)}A(`slicc-scoop-overflow`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n;#r;#i;#a;#o=e=>{this.open&&!this.contains(e.target)&&this.close()};#s=e=>{!this.open||e.key!==`Escape`||(e.preventDefault(),this.close(),this.#r.focus())};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ks]}connectedCallback(){this.#c()}disconnectedCallback(){document.removeEventListener(`click`,this.#o),document.removeEventListener(`keydown`,this.#s)}attributeChangedCallback(e){e===`open`&&this.#n&&this.#u()}get items(){return this.#t}set items(e){this.#t=Array.isArray(e)?e:[],this.isConnected&&this.#l()}get count(){return this.#t.length}get hasOverflow(){return this.#t.length>0}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}show(){this.open||=!0}close(){this.open&&=!1}toggle(){this.open=!this.open}#c(){this.#i=j(`slot`,{name:`more`},oc(this.#t)),this.#r=j(`button`,{class:`morebtn`,part:`more`,type:`button`,title:`More scoops`,"aria-haspopup":`true`,"aria-expanded":`false`},this.#i),this.#a=j(`div`,{class:`pop`,part:`pop`,role:`menu`}),this.#n=j(`div`,{class:`switcher-more`,part:`wrap`},this.#r,this.#a),this.#r.addEventListener(`click`,e=>{e.stopPropagation(),this.toggle()}),this.#e.replaceChildren(this.#n),this.#l(),this.#u()}#l(){let e=this.#t.length;e>0?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`),this.#n.classList.toggle(`has-overflow`,e>0),this.#r.setAttribute(`aria-haspopup`,`true`);let t=ic(this.#t);if(this.#r.setAttribute(`aria-label`,`${t}. Show hidden scoops`),this.#i.replaceChildren(oc(this.#t)),e===0){this.#a.replaceChildren(j(`slot`,{name:`empty`})),this.open&&this.close();return}let n=[];this.#t.forEach((e,t)=>{let r=e.id,i=e.label??e.id,a=$s(e),o=Qs(e.fill),s=j(`button`,{class:`popup-row`,part:`row`,type:`button`,role:`menuitem`,"aria-label":`${i}: ${a}, ${o}% context fill`,"data-state":a,"data-k":r,style:`--hue:${e.color??`var(--rose)`};--i:${t}`},tc(a,o),j(`span`,{class:`popup-label`},i),j(`span`,{class:`popup-state`},`${a} · ${o}%`));s.addEventListener(`click`,()=>{let e=s.dataset.k??``,t=this.#t.find(t=>t.id===e);this.#d(e,t?.label??e)}),n.push(s)}),this.#a.replaceChildren(...n)}#u(){let e=this.open;this.#n.classList.toggle(`open`,e),this.#r.setAttribute(`aria-expanded`,e?`true`:`false`),document.removeEventListener(`click`,this.#o),document.removeEventListener(`keydown`,this.#s),e&&(document.addEventListener(`click`,this.#o),document.addEventListener(`keydown`,this.#s))}#d(e,t){this.dispatchEvent(new CustomEvent(`slicc-scoop-select`,{detail:{id:e,key:e,label:t},bubbles:!0,composed:!0})),this.close()}});var B=`slicc-agent-tabs`,sc=`${B}-style`,cc=`http://www.w3.org/2000/svg`,lc=5,uc=2*Math.PI*lc,dc=26,fc=8,pc=6,mc=39,hc=`sliccy`,gc=14,_c=5,vc=16,yc=4,bc=65,xc={cone:`var(--waffle)`,researcher:`var(--cyan)`,designer:`var(--violet)`,tester:`var(--amber)`,triage:`var(--green)`},Sc=`
4657
+ .slicc-agent-tabs{display:flex;align-items:center;gap:${fc}px;min-width:0;overflow:visible;color:var(--ink);font-family:var(--ui);}
4611
4658
  .slicc-agent-tabs *{box-sizing:border-box;}
4612
- .slicc-agent-tabs__focus-avatar{display:block;flex:0 0 ${sc}px;width:${sc}px;height:${sc}px;pointer-events:none;}
4659
+ .slicc-agent-tabs__focus-avatar{display:block;flex:0 0 ${dc}px;width:${dc}px;height:${dc}px;pointer-events:none;}
4613
4660
  .slicc-agent-tabs__track-frame{position:relative;flex:0 1 auto;min-width:0;height:var(--ctl-h,30px);overflow:visible;border:1px solid var(--line);border-radius:9px;background:var(--ghost);}
4614
4661
  .slicc-agent-tabs__track{display:flex;align-items:center;min-width:0;height:100%;padding:2px;overflow:hidden;}
4615
4662
  .slicc-agent-tabs.has-overflow .slicc-agent-tabs__track{padding-right:41px;}
4616
- .slicc-agent-tabs__segment{position:relative;display:inline-flex;flex:0 1 auto;align-items:center;justify-content:center;gap:${pc}px;width:max-content;min-width:var(--slicc-agent-tabs-segment-floor,${gc}px);max-width:160px;height:24px;padding:0 8px;overflow:hidden;color:var(--txt-2);font:500 11px/1 var(--ui);white-space:nowrap;border:0;border-radius:6px;background:transparent;cursor:pointer;}
4663
+ .slicc-agent-tabs__segment{position:relative;display:inline-flex;flex:0 1 auto;align-items:center;justify-content:center;gap:${_c}px;width:max-content;min-width:var(--slicc-agent-tabs-segment-floor,${bc}px);max-width:160px;height:24px;padding:0 8px;overflow:hidden;color:var(--txt-2);font:500 11px/1 var(--ui);white-space:nowrap;border:0;border-radius:6px;background:transparent;cursor:pointer;}
4617
4664
  .slicc-agent-tabs__segment:hover{color:var(--ink);}
4618
4665
  .slicc-agent-tabs__segment[aria-selected='true']{color:var(--ink);background:var(--canvas);box-shadow:0 1px 3px color-mix(in srgb,var(--ink) 12%,transparent);}
4619
4666
  .slicc-agent-tabs__segment.hide{display:none;}
@@ -4642,7 +4689,7 @@ iframe {
4642
4689
  .slicc-agent-tabs slicc-scoop-overflow::part(pop){right:0;left:auto;}
4643
4690
  @keyframes slicc-agent-tabs-arc{from{transform:rotate(-90deg);}to{transform:rotate(270deg);}}
4644
4691
  @media (prefers-reduced-motion:reduce){.slicc-agent-tabs__glyph-arc{animation:none;transform:rotate(-90deg);}.slicc-agent-tabs__glyph-glow{transition:none;}}
4645
- `;function yc(e){if(e.getElementById(rc))return;let t=e.createElement(`style`);t.id=rc,t.textContent=vc,(e.head??e.documentElement).append(t)}function bc(e,t,...n){let r=document.createElementNS(ic,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function xc(e){return typeof e==`number`&&Number.isFinite(e)?Math.max(0,Math.min(100,e)):0}function Sc(e){let t=e.ownerDocument.createElement(`canvas`).getContext(`2d`),n=e.ownerDocument.defaultView?.getComputedStyle(e);return!t||!n?gc:(t.font=n.font,Math.ceil(t.measureText(dc).width+fc+pc+mc)+hc)}function Cc(e){return(90+xc(e)*2.7)/360*oc}function wc(e,t){return t===`working`?e.phase===`tool`?`tool`:`thinking`:null}function Tc(e,t){return t===`working`?wc(e,t)===`tool`?`working`:`thinking`:t===`idle`?e.awaiting?`awaiting`:`idle`:null}function Ec(e,t){return e.state?e.state:e.eyes===`dead`?`broken`:t===e.key?`working`:`idle`}function Dc(e){return e.type===`cone`||e.key===`cone`?`cone`:`scoop`}function Oc(e){return e.eyes??`open`}function kc(e){return _c[e.key]??e.color??`var(--rose)`}function Ac(e){let t=[bc(`circle`,{class:`${B}__glyph-glow`,cx:7,cy:7,r:ac,"stroke-width":1.5}),bc(`circle`,{class:`${B}__glyph-base`,cx:7,cy:7,r:ac,"stroke-width":1.5}),bc(`circle`,{class:`${B}__glyph-arc`,cx:7,cy:7,r:ac,"stroke-width":2,"stroke-dasharray":`${Cc(xc(e.fill)).toFixed(3)} ${oc.toFixed(3)}`,"stroke-dashoffset":0}),bc(`circle`,{class:`${B}__glyph-pin`,cx:7,cy:7,r:1.25}),bc(`rect`,{class:`${B}__glyph-pin-square`,x:5.5,y:5.5,width:3,height:3,rx:.15}),bc(`line`,{class:`${B}__broken-x`,x1:4.8,y1:4.8,x2:9.2,y2:9.2,"stroke-width":1.8}),bc(`line`,{class:`${B}__broken-x`,x1:9.2,y1:4.8,x2:4.8,y2:9.2,"stroke-width":1.8}),bc(`circle`,{class:`${B}__initializing-ring`,cx:7,cy:7,r:ac,"stroke-width":1.7})];return bc(`svg`,{class:`${B}__status-glyph`,viewBox:`0 0 14 14`,width:14,height:14,"aria-hidden":`true`},...t)}A(`slicc-agent-tabs`,class extends HTMLElement{static observedAttributes=[`active`,`attention`,`connection`,`gaze-target`,`drowse-delay`];#e=[];#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=!1;#c=null;#l=!1;#u=null;#d=e=>this.#w(e);#f=e=>this.#T(e);connectedCallback(){yc(this.ownerDocument),this.classList.add(B),this.setAttribute(`part`,`row`),this.#l||=!0,this.addEventListener(`click`,this.#d),this.addEventListener(`keydown`,this.#f),this.#m(),this.#O(),requestAnimationFrame(()=>this.reflow())}disconnectedCallback(){this.#o?.disconnect(),this.#o=null,this.#c!==null&&cancelAnimationFrame(this.#c),this.#c=null,this.removeEventListener(`click`,this.#d),this.removeEventListener(`keydown`,this.#f)}attributeChangedCallback(){!this.#l||!this.isConnected||(this.#m(),this.reflow())}get scoops(){return this.#e.map(e=>({...e}))}set scoops(e){let t=new Map;if(Array.isArray(e))for(let n of e)t.has(n.key)||t.set(n.key,{...n});this.#e=[...t.values()],this.#l&&this.isConnected&&(this.#m(),this.reflow())}get attention(){return this.getAttribute(`attention`)}set attention(e){e==null?this.removeAttribute(`attention`):this.setAttribute(`attention`,e)}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}get connection(){return this.getAttribute(`connection`)===`disconnected`?`disconnected`:`connected`}set connection(e){this.setAttribute(`connection`,e)}get gazeTarget(){return this.getAttribute(`gaze-target`)}set gazeTarget(e){e==null?this.removeAttribute(`gaze-target`):this.setAttribute(`gaze-target`,e)}get drowseDelay(){let e=this.getAttribute(`drowse-delay`);if(e===null)return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}set drowseDelay(e){e==null?this.removeAttribute(`drowse-delay`):this.setAttribute(`drowse-delay`,String(e))}scrutinize(){this.#t?.scrutinize()}glower(){this.#t?.glower()}wake(){this.#t?.wake()}select(e){this.active=e;let t=this.#e.find(t=>t.key===e)?.label??e;this.dispatchEvent(new CustomEvent(`slicc-scoop-select`,{detail:{id:e,key:e,label:t},bubbles:!0,composed:!0}))}reflow(){if(!(!this.isConnected||this.#s)){this.#s=!0;try{this.#p()}finally{this.#s=!1}}}#p(){let e=[...this.querySelectorAll(`.${B}__segment`)];for(let t of e)t.classList.remove(`hide`);if(this.classList.remove(`has-overflow`),e.length===0){this.#C([]);return}this.#u===null&&(this.#u=Sc(e[0]),this.style.setProperty(`--slicc-agent-tabs-segment-floor`,`${this.#u}px`));let t=this.clientWidth;if(t<=0){this.#C([]),requestAnimationFrame(()=>{this.isConnected&&this.clientWidth>0&&this.reflow()});return}let n=Math.max(0,t-sc-cc-lc),r=e.map(e=>e.offsetWidth),i=r.reduce((e,t)=>e+t,0),a=e.length>1&&i>n+1;this.classList.toggle(`has-overflow`,a);let o=a?e.map(e=>e.offsetWidth):r,s=Math.max(0,n-(a?uc:0));if(!a){this.#C([]);return}let c=[],l=0;e.forEach((e,t)=>{t===0||c.length===0&&l+o[t]<=s?l+=o[t]:(e.classList.add(`hide`),c.push(e))}),this.#C(c)}#m(){let e=this.#E(),t=this.#e.find(e=>e.key===this.active)??this.#e.at(0)??null;this.#h(),this.#v(t),this.#x(t?.key??null),e!=null&&!this.#e.some(t=>t.key===e)&&this.#D(t?.key??null)?.focus()}#h(){if(this.#r&&this.#i&&this.#a&&this.contains(this.#i))return;this.#r=j(`div`,{class:`${B}__track`,part:`track`,role:`tablist`,"aria-label":`Agents`});let e=this.ownerDocument.createElement(`slicc-scoop-overflow`);e.setAttribute(`part`,`overflow`),e.addEventListener(`slicc-scoop-select`,e=>{let t=e.detail?.id;typeof t==`string`&&(e.stopPropagation(),this.select(t))}),this.#a=e,this.#i=j(`div`,{class:`${B}__track-frame`,part:`track-frame`},this.#r,e),this.replaceChildren(this.#i)}#g(e){let t=j(`slicc-agent-avatar`,{class:`${B}__focus-avatar`,part:`avatar`,role:`img`});return this.#_(t,e),t}#_(e,t){let n=Ec(t,this.attention);this.#S(e,`type`,Dc(t)),this.#S(e,`color`,t.color??null),this.#S(e,`eyes`,Oc(t)),this.#S(e,`connection`,this.getAttribute(`connection`)),this.#S(e,`fill`,String(Math.round(xc(t.fill)))),this.#S(e,`blink`,n===`working`),this.#S(e,`activity`,Tc(t,n)),this.#S(e,`gaze-target`,this.getAttribute(`gaze-target`)),this.#S(e,`drowse-delay`,this.getAttribute(`drowse-delay`)),this.#S(e,`aria-label`,`${t.label??t.key} focused agent`),e.style.setProperty(`--slicc-agent-tabs-hue`,kc(t))}#v(e){if(!e){this.#t?.remove(),this.#t=null,this.#n=null;return}let t=this.#t??this.#g(e);this.#t=t;let n=this.#n!==null&&this.#n!==e.key;this.#n=e.key,this.#_(t,e),n&&t.resetExpression(),(t.parentElement!==this||t.nextElementSibling!==this.#i)&&this.insertBefore(t,this.#i)}#y(e,t){let n=j(`button`,{part:`segment`,type:`button`,role:`tab`},Ac(e),j(`span`,{class:`${B}__label`},e.label??e.key));return this.#b(n,e,t),n}#b(e,t,n){let r=Ec(t,this.attention),i=wc(t,r),a=xc(t.fill),o=this.attention===t.key;e.className=`${B}__segment${t.ephemeral?` ephemeral`:``}`,e.setAttribute(`aria-selected`,String(t.key===n)),e.tabIndex=t.key===n?0:-1;let s=i===`tool`?` (running a tool)`:i?` (thinking)`:``;e.setAttribute(`aria-label`,`${t.label??t.key}: ${r}${s}, ${Math.round(a)}% context fill${o?`, spoke most recently`:``}`),e.dataset.k=t.key,e.dataset.state=r,this.#S(e,`data-phase`,i),this.#S(e,`data-attention`,o?`true`:null),e.style.setProperty(`--slicc-agent-tabs-hue`,kc(t));let c=e.querySelector(`.${B}__label`);c&&(c.textContent=t.label??t.key),e.querySelector(`.${B}__glyph-arc`)?.setAttribute(`stroke-dasharray`,`${Cc(a).toFixed(3)} ${oc.toFixed(3)}`)}#x(e){if(!this.#r)return;let t=new Map;for(let e of this.#r.querySelectorAll(`:scope > .${B}__segment`)){let n=e.dataset.k??``;t.has(n)?e.remove():t.set(n,e)}let n=this.#e.map(n=>{let r=t.get(n.key)??this.#y(n,e);return t.delete(n.key),this.#b(r,n,e),r});for(let e of t.values())e.remove();n.forEach((e,t)=>{let n=this.#r?.children.item(t)??null;n!==e&&this.#r?.insertBefore(e,n)})}#S(e,t,n){n===null||n===!1?e.hasAttribute(t)&&e.removeAttribute(t):n===!0?e.hasAttribute(t)||e.setAttribute(t,``):e.getAttribute(t)!==n&&e.setAttribute(t,n)}#C(e){if(!this.#a)return;let t=e.map(e=>{let t=e.dataset.k??``,n=this.#e.find(e=>e.key===t)??{key:t};return{id:t,label:n.label??t,type:Dc(n),color:n.color,eyes:Oc(n),state:Ec(n,this.attention),fill:xc(n.fill)}});this.#a.items=t}#w(e){let t=e.target?.closest(`.${B}__segment`);t&&this.contains(t)&&t.dataset.k&&this.select(t.dataset.k)}#T(e){let t=e.target?.closest(`.${B}__segment`);if(!t||!this.contains(t))return;if(e.key===`Enter`||e.key===` `){if(!t.dataset.k)return;e.preventDefault(),this.select(t.dataset.k);return}let n=[...this.querySelectorAll(`.${B}__segment:not(.hide)`)].filter(e=>!e.disabled),r=n.indexOf(t);if(r<0||n.length===0)return;let i;if(e.key===`ArrowLeft`)i=n[(r-1+n.length)%n.length];else if(e.key===`ArrowRight`)i=n[(r+1)%n.length];else if(e.key===`Home`)i=n[0];else if(e.key===`End`)i=n.at(-1);else return;e.preventDefault(),i?.focus()}#E(){let e=this.ownerDocument.activeElement;return!(e instanceof Element)||!this.contains(e)?null:e.closest(`.${B}__segment`)?.dataset.k??null}#D(e){return e==null?null:[...this.querySelectorAll(`.${B}__segment`)].find(t=>t.dataset.k===e)??null}#O(){this.#o||typeof ResizeObserver>`u`||(this.#o=new ResizeObserver(()=>{this.#c===null&&(this.#c=requestAnimationFrame(()=>{this.#c=null,this.reflow()}))}),this.#o.observe(this),this.parentElement&&this.#o.observe(this.parentElement))}});var jc=`/**
4692
+ `;function Cc(e){if(e.getElementById(sc))return;let t=e.createElement(`style`);t.id=sc,t.textContent=Sc,(e.head??e.documentElement).append(t)}function wc(e,t,...n){let r=document.createElementNS(cc,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function Tc(e){return typeof e==`number`&&Number.isFinite(e)?Math.max(0,Math.min(100,e)):0}function Ec(e){let t=e.ownerDocument.createElement(`canvas`).getContext(`2d`),n=e.ownerDocument.defaultView?.getComputedStyle(e);return!t||!n?bc:(t.font=n.font,Math.ceil(t.measureText(hc).width+gc+_c+vc)+yc)}function Dc(e){return(90+Tc(e)*2.7)/360*uc}function Oc(e,t){return t===`working`?e.phase===`tool`?`tool`:`thinking`:null}function kc(e,t){return t===`working`?Oc(e,t)===`tool`?`working`:`thinking`:t===`idle`?e.awaiting?`awaiting`:`idle`:null}function Ac(e,t){return e.state?e.state:e.eyes===`dead`?`broken`:t===e.key?`working`:`idle`}function jc(e){return e.type===`cone`||e.key===`cone`?`cone`:`scoop`}function Mc(e){return e.eyes??`open`}function Nc(e){return xc[e.key]??e.color??`var(--rose)`}function Pc(e){let t=[wc(`circle`,{class:`${B}__glyph-glow`,cx:7,cy:7,r:lc,"stroke-width":1.5}),wc(`circle`,{class:`${B}__glyph-base`,cx:7,cy:7,r:lc,"stroke-width":1.5}),wc(`circle`,{class:`${B}__glyph-arc`,cx:7,cy:7,r:lc,"stroke-width":2,"stroke-dasharray":`${Dc(Tc(e.fill)).toFixed(3)} ${uc.toFixed(3)}`,"stroke-dashoffset":0}),wc(`circle`,{class:`${B}__glyph-pin`,cx:7,cy:7,r:1.25}),wc(`rect`,{class:`${B}__glyph-pin-square`,x:5.5,y:5.5,width:3,height:3,rx:.15}),wc(`line`,{class:`${B}__broken-x`,x1:4.8,y1:4.8,x2:9.2,y2:9.2,"stroke-width":1.8}),wc(`line`,{class:`${B}__broken-x`,x1:9.2,y1:4.8,x2:4.8,y2:9.2,"stroke-width":1.8}),wc(`circle`,{class:`${B}__initializing-ring`,cx:7,cy:7,r:lc,"stroke-width":1.7})];return wc(`svg`,{class:`${B}__status-glyph`,viewBox:`0 0 14 14`,width:14,height:14,"aria-hidden":`true`},...t)}A(`slicc-agent-tabs`,class extends HTMLElement{static observedAttributes=[`active`,`attention`,`connection`,`gaze-target`,`drowse-delay`];#e=[];#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=!1;#c=null;#l=!1;#u=null;#d=e=>this.#w(e);#f=e=>this.#T(e);connectedCallback(){Cc(this.ownerDocument),this.classList.add(B),this.setAttribute(`part`,`row`),this.#l||=!0,this.addEventListener(`click`,this.#d),this.addEventListener(`keydown`,this.#f),this.#m(),this.#O(),requestAnimationFrame(()=>this.reflow())}disconnectedCallback(){this.#o?.disconnect(),this.#o=null,this.#c!==null&&cancelAnimationFrame(this.#c),this.#c=null,this.removeEventListener(`click`,this.#d),this.removeEventListener(`keydown`,this.#f)}attributeChangedCallback(){!this.#l||!this.isConnected||(this.#m(),this.reflow())}get scoops(){return this.#e.map(e=>({...e}))}set scoops(e){let t=new Map;if(Array.isArray(e))for(let n of e)t.has(n.key)||t.set(n.key,{...n});this.#e=[...t.values()],this.#l&&this.isConnected&&(this.#m(),this.reflow())}get attention(){return this.getAttribute(`attention`)}set attention(e){e==null?this.removeAttribute(`attention`):this.setAttribute(`attention`,e)}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}get connection(){return this.getAttribute(`connection`)===`disconnected`?`disconnected`:`connected`}set connection(e){this.setAttribute(`connection`,e)}get gazeTarget(){return this.getAttribute(`gaze-target`)}set gazeTarget(e){e==null?this.removeAttribute(`gaze-target`):this.setAttribute(`gaze-target`,e)}get drowseDelay(){let e=this.getAttribute(`drowse-delay`);if(e===null)return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}set drowseDelay(e){e==null?this.removeAttribute(`drowse-delay`):this.setAttribute(`drowse-delay`,String(e))}scrutinize(){this.#t?.scrutinize()}glower(){this.#t?.glower()}wake(){this.#t?.wake()}select(e){this.active=e;let t=this.#e.find(t=>t.key===e)?.label??e;this.dispatchEvent(new CustomEvent(`slicc-scoop-select`,{detail:{id:e,key:e,label:t},bubbles:!0,composed:!0}))}reflow(){if(!(!this.isConnected||this.#s)){this.#s=!0;try{this.#p()}finally{this.#s=!1}}}#p(){let e=[...this.querySelectorAll(`.${B}__segment`)];for(let t of e)t.classList.remove(`hide`);if(this.classList.remove(`has-overflow`),e.length===0){this.#C([]);return}this.#u===null&&(this.#u=Ec(e[0]),this.style.setProperty(`--slicc-agent-tabs-segment-floor`,`${this.#u}px`));let t=this.clientWidth;if(t<=0){this.#C([]),requestAnimationFrame(()=>{this.isConnected&&this.clientWidth>0&&this.reflow()});return}let n=Math.max(0,t-dc-fc-pc),r=e.map(e=>e.offsetWidth),i=r.reduce((e,t)=>e+t,0),a=e.length>1&&i>n+1;this.classList.toggle(`has-overflow`,a);let o=a?e.map(e=>e.offsetWidth):r,s=Math.max(0,n-(a?mc:0));if(!a){this.#C([]);return}let c=[],l=0;e.forEach((e,t)=>{t===0||c.length===0&&l+o[t]<=s?l+=o[t]:(e.classList.add(`hide`),c.push(e))}),this.#C(c)}#m(){let e=this.#E(),t=this.#e.find(e=>e.key===this.active)??this.#e.at(0)??null;this.#h(),this.#v(t),this.#x(t?.key??null),e!=null&&!this.#e.some(t=>t.key===e)&&this.#D(t?.key??null)?.focus()}#h(){if(this.#r&&this.#i&&this.#a&&this.contains(this.#i))return;this.#r=j(`div`,{class:`${B}__track`,part:`track`,role:`tablist`,"aria-label":`Agents`});let e=this.ownerDocument.createElement(`slicc-scoop-overflow`);e.setAttribute(`part`,`overflow`),e.addEventListener(`slicc-scoop-select`,e=>{let t=e.detail?.id;typeof t==`string`&&(e.stopPropagation(),this.select(t))}),this.#a=e,this.#i=j(`div`,{class:`${B}__track-frame`,part:`track-frame`},this.#r,e),this.replaceChildren(this.#i)}#g(e){let t=j(`slicc-agent-avatar`,{class:`${B}__focus-avatar`,part:`avatar`,role:`img`});return this.#_(t,e),t}#_(e,t){let n=Ac(t,this.attention);this.#S(e,`type`,jc(t)),this.#S(e,`color`,t.color??null),this.#S(e,`eyes`,Mc(t)),this.#S(e,`connection`,this.getAttribute(`connection`)),this.#S(e,`fill`,String(Math.round(Tc(t.fill)))),this.#S(e,`blink`,n===`working`),this.#S(e,`activity`,kc(t,n)),this.#S(e,`gaze-target`,this.getAttribute(`gaze-target`)),this.#S(e,`drowse-delay`,this.getAttribute(`drowse-delay`)),this.#S(e,`aria-label`,`${t.label??t.key} focused agent`),e.style.setProperty(`--slicc-agent-tabs-hue`,Nc(t))}#v(e){if(!e){this.#t?.remove(),this.#t=null,this.#n=null;return}let t=this.#t??this.#g(e);this.#t=t;let n=this.#n!==null&&this.#n!==e.key;this.#n=e.key,this.#_(t,e),n&&t.resetExpression(),(t.parentElement!==this||t.nextElementSibling!==this.#i)&&this.insertBefore(t,this.#i)}#y(e,t){let n=j(`button`,{part:`segment`,type:`button`,role:`tab`},Pc(e),j(`span`,{class:`${B}__label`},e.label??e.key));return this.#b(n,e,t),n}#b(e,t,n){let r=Ac(t,this.attention),i=Oc(t,r),a=Tc(t.fill),o=this.attention===t.key;e.className=`${B}__segment${t.ephemeral?` ephemeral`:``}`,e.setAttribute(`aria-selected`,String(t.key===n)),e.tabIndex=t.key===n?0:-1;let s=i===`tool`?` (running a tool)`:i?` (thinking)`:``;e.setAttribute(`aria-label`,`${t.label??t.key}: ${r}${s}, ${Math.round(a)}% context fill${o?`, spoke most recently`:``}`),e.dataset.k=t.key,e.dataset.state=r,this.#S(e,`data-phase`,i),this.#S(e,`data-attention`,o?`true`:null),e.style.setProperty(`--slicc-agent-tabs-hue`,Nc(t));let c=e.querySelector(`.${B}__label`);c&&(c.textContent=t.label??t.key),e.querySelector(`.${B}__glyph-arc`)?.setAttribute(`stroke-dasharray`,`${Dc(a).toFixed(3)} ${uc.toFixed(3)}`)}#x(e){if(!this.#r)return;let t=new Map;for(let e of this.#r.querySelectorAll(`:scope > .${B}__segment`)){let n=e.dataset.k??``;t.has(n)?e.remove():t.set(n,e)}let n=this.#e.map(n=>{let r=t.get(n.key)??this.#y(n,e);return t.delete(n.key),this.#b(r,n,e),r});for(let e of t.values())e.remove();n.forEach((e,t)=>{let n=this.#r?.children.item(t)??null;n!==e&&this.#r?.insertBefore(e,n)})}#S(e,t,n){n===null||n===!1?e.hasAttribute(t)&&e.removeAttribute(t):n===!0?e.hasAttribute(t)||e.setAttribute(t,``):e.getAttribute(t)!==n&&e.setAttribute(t,n)}#C(e){if(!this.#a)return;let t=e.map(e=>{let t=e.dataset.k??``,n=this.#e.find(e=>e.key===t)??{key:t};return{id:t,label:n.label??t,type:jc(n),color:n.color,eyes:Mc(n),state:Ac(n,this.attention),fill:Tc(n.fill)}});this.#a.items=t}#w(e){let t=e.target?.closest(`.${B}__segment`);t&&this.contains(t)&&t.dataset.k&&this.select(t.dataset.k)}#T(e){let t=e.target?.closest(`.${B}__segment`);if(!t||!this.contains(t))return;if(e.key===`Enter`||e.key===` `){if(!t.dataset.k)return;e.preventDefault(),this.select(t.dataset.k);return}let n=[...this.querySelectorAll(`.${B}__segment:not(.hide)`)].filter(e=>!e.disabled),r=n.indexOf(t);if(r<0||n.length===0)return;let i;if(e.key===`ArrowLeft`)i=n[(r-1+n.length)%n.length];else if(e.key===`ArrowRight`)i=n[(r+1)%n.length];else if(e.key===`Home`)i=n[0];else if(e.key===`End`)i=n.at(-1);else return;e.preventDefault(),i?.focus()}#E(){let e=this.ownerDocument.activeElement;return!(e instanceof Element)||!this.contains(e)?null:e.closest(`.${B}__segment`)?.dataset.k??null}#D(e){return e==null?null:[...this.querySelectorAll(`.${B}__segment`)].find(t=>t.dataset.k===e)??null}#O(){this.#o||typeof ResizeObserver>`u`||(this.#o=new ResizeObserver(()=>{this.#c===null&&(this.#c=requestAnimationFrame(()=>{this.#c=null,this.reflow()}))}),this.#o.observe(this),this.parentElement&&this.#o.observe(this.parentElement))}});var Fc=`/**
4646
4693
  * SLICC design tokens — lifted verbatim from the prototype
4647
4694
  * (proto/StellarRubySwift.html :root + body.dark). Light is the default; dark is
4648
4695
  * opt-in. Per project decision the prototype's token vocabulary and light-default
@@ -4706,7 +4753,7 @@ iframe {
4706
4753
  --shaderbg: #171410;
4707
4754
  --shadow-pane: rgba(0, 0, 0, 0.35) 0 8px 26px -10px;
4708
4755
  }
4709
- `,Mc=`slicc-tokens`;function Nc(e=document){if(e.getElementById(Mc))return;let t=e.createElement(`style`);t.id=Mc,t.textContent=jc,(e.head??e.documentElement).appendChild(t)}function Pc(e,t=document.body){t.classList.toggle(`dark`,e===`dark`),t.setAttribute(`data-theme`,e)}function Fc(e=document.body){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>Pc(t.matches?`dark`:`light`,e);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}var Ic=M(`
4756
+ `,Ic=`slicc-tokens`;function Lc(e=document){if(e.getElementById(Ic))return;let t=e.createElement(`style`);t.id=Ic,t.textContent=Fc,(e.head??e.documentElement).appendChild(t)}function Rc(e,t=document.body){t.classList.toggle(`dark`,e===`dark`),t.setAttribute(`data-theme`,e)}function zc(e=document.body){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>Rc(t.matches?`dark`:`light`,e);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}var Bc=M(`
4710
4757
  :host { display: inline-flex; flex: 0 0 auto; }
4711
4758
  .themetgl {
4712
4759
  font: inherit; font-family: var(--ui); font-size: 14px; line-height: 1;
@@ -4718,7 +4765,7 @@ iframe {
4718
4765
  }
4719
4766
  .themetgl:hover { background: color-mix(in srgb, var(--ink) 8%, var(--ghost)); }
4720
4767
  .themetgl svg { display: block; }
4721
- `),Lc=16,Rc={light:`moon`,dark:`sun`},zc={light:`Switch to dark mode`,dark:`Switch to light mode`};A(`slicc-theme-toggle`,class extends HTMLElement{static observedAttributes=[`theme`];#e;#t=null;#n=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ic];let e=j(`button`,{class:`themetgl`,part:`button`,type:`button`,"aria-pressed":`false`},j(`slot`,{name:`glyph-light`},n(Rc.light,{size:Lc})),j(`slot`,{name:`glyph-dark`,hidden:!0},n(Rc.dark,{size:Lc})));this.#e.replaceChildren(e),this.#t=e}connectedCallback(){this.#t?.addEventListener(`click`,this.#i),this.#a(this.theme??`light`,{silent:!0})}disconnectedCallback(){this.#t?.removeEventListener(`click`,this.#i)}attributeChangedCallback(e,t,n){e===`theme`&&t!==n&&(this.#n||this.isConnected&&this.#a(this.#r(n)??`light`,{silent:!0}))}get theme(){return this.#r(this.getAttribute(`theme`))}set theme(e){this.#a(e===`dark`?`dark`:`light`,{silent:!0})}get pressed(){return this.theme===`dark`}#r(e){return e===`dark`?`dark`:e===`light`?`light`:null}#i=()=>{this.#a(this.theme===`dark`?`light`:`dark`)};#a(e,t={}){this.#n=!0;try{if(Pc(e),this.getAttribute(`theme`)!==e&&this.setAttribute(`theme`,e),this.#t){this.#t.setAttribute(`aria-pressed`,e===`dark`?`true`:`false`),this.#t.title=zc[e];let t=this.#e.querySelector(`slot[name="glyph-light"]`),n=this.#e.querySelector(`slot[name="glyph-dark"]`);t?.toggleAttribute(`hidden`,e===`dark`),n?.toggleAttribute(`hidden`,e===`light`)}for(let t of document.querySelectorAll(`slicc-add-menu`))t.setAttribute(`theme`,e)}finally{this.#n=!1}t.silent||this.dispatchEvent(new CustomEvent(`slicc-theme-change`,{detail:{theme:e},bubbles:!0,composed:!0}))}}),A(`slicc-theme`,class extends HTMLElement{static observedAttributes=[`theme`];connectedCallback(){Nc(this.ownerDocument),this.classList.add(`slicc-theme`),this.#e()}attributeChangedCallback(e,t,n){e===`theme`&&t!==n&&this.isConnected&&this.#e()}get theme(){return this.getAttribute(`theme`)===`dark`?`dark`:`light`}set theme(e){this.setAttribute(`theme`,e===`dark`?`dark`:`light`)}#e(){let e=this.theme;Pc(e,this),this.dispatchEvent(new CustomEvent(`slicc-theme-change`,{detail:{theme:e},bubbles:!0,composed:!0}))}});var Bc=`
4768
+ `),Vc=16,Hc={light:`moon`,dark:`sun`},Uc={light:`Switch to dark mode`,dark:`Switch to light mode`};A(`slicc-theme-toggle`,class extends HTMLElement{static observedAttributes=[`theme`];#e;#t=null;#n=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Bc];let e=j(`button`,{class:`themetgl`,part:`button`,type:`button`,"aria-pressed":`false`},j(`slot`,{name:`glyph-light`},n(Hc.light,{size:Vc})),j(`slot`,{name:`glyph-dark`,hidden:!0},n(Hc.dark,{size:Vc})));this.#e.replaceChildren(e),this.#t=e}connectedCallback(){this.#t?.addEventListener(`click`,this.#i),this.#a(this.theme??`light`,{silent:!0})}disconnectedCallback(){this.#t?.removeEventListener(`click`,this.#i)}attributeChangedCallback(e,t,n){e===`theme`&&t!==n&&(this.#n||this.isConnected&&this.#a(this.#r(n)??`light`,{silent:!0}))}get theme(){return this.#r(this.getAttribute(`theme`))}set theme(e){this.#a(e===`dark`?`dark`:`light`,{silent:!0})}get pressed(){return this.theme===`dark`}#r(e){return e===`dark`?`dark`:e===`light`?`light`:null}#i=()=>{this.#a(this.theme===`dark`?`light`:`dark`)};#a(e,t={}){this.#n=!0;try{if(Rc(e),this.getAttribute(`theme`)!==e&&this.setAttribute(`theme`,e),this.#t){this.#t.setAttribute(`aria-pressed`,e===`dark`?`true`:`false`),this.#t.title=Uc[e];let t=this.#e.querySelector(`slot[name="glyph-light"]`),n=this.#e.querySelector(`slot[name="glyph-dark"]`);t?.toggleAttribute(`hidden`,e===`dark`),n?.toggleAttribute(`hidden`,e===`light`)}for(let t of document.querySelectorAll(`slicc-add-menu`))t.setAttribute(`theme`,e)}finally{this.#n=!1}t.silent||this.dispatchEvent(new CustomEvent(`slicc-theme-change`,{detail:{theme:e},bubbles:!0,composed:!0}))}}),A(`slicc-theme`,class extends HTMLElement{static observedAttributes=[`theme`];connectedCallback(){Lc(this.ownerDocument),this.classList.add(`slicc-theme`),this.#e()}attributeChangedCallback(e,t,n){e===`theme`&&t!==n&&this.isConnected&&this.#e()}get theme(){return this.getAttribute(`theme`)===`dark`?`dark`:`light`}set theme(e){this.setAttribute(`theme`,e===`dark`?`dark`:`light`)}#e(){let e=this.theme;Rc(e,this),this.dispatchEvent(new CustomEvent(`slicc-theme-change`,{detail:{theme:e},bubbles:!0,composed:!0}))}});var Wc=`
4722
4769
  slicc-dock-tree {
4723
4770
  display: block;
4724
4771
  /* Fill the parent shell's flex column. Without this the host collapses to
@@ -4941,7 +4988,7 @@ slicc-dock-tree .dock-tree__preview {
4941
4988
  slicc-dock-tree .dock-tree__preview--active {
4942
4989
  display: block;
4943
4990
  }
4944
- `,Vc=`slicc-dock-tree-style`;function Hc(e){if(e.getElementById(Vc))return;let t=e.createElement(`style`);t.id=Vc,t.textContent=Bc,(e.head??e.documentElement).appendChild(t)}var Uc=`slicc-surface`,Wc=`chat`,Gc=`sprinkle:`;function Kc(e){return typeof e==`string`&&e.trim().toLowerCase()===`false`}function qc(e){return e===`chat`?`Chat`:e.startsWith(Gc)?e.slice(9):e}var Jc=[`top`,`left`,`middle`,`right`,`bottom`],Yc=[`left`,`middle`,`right`],Xc=[`top`,`center`,`bottom`],Zc=.02;function Qc(){return{zones:{top:null,left:null,middle:null,right:null,bottom:null},rowFr:{top:1,center:1,bottom:1},colFr:{left:1,middle:1,right:1}}}function $c(e){return JSON.parse(JSON.stringify(e))}function el(e,t){if(e.type===`leaf`){t.push(e.surfaceId);return}for(let n of e.children)el(n,t)}function tl(e,t){if(e.type===`leaf`)return e.surfaceId===t?e:null;for(let n of e.children){let e=tl(n,t);if(e)return e}return null}function nl(e,t,n){if(n)return!0;function r(e,n){let i=n||e.locked===!0;if(e===t)return i;if(e.type!==`split`)return null;for(let t of e.children){let e=r(t,i);if(e!=null)return e}return null}return r(e,!1)??!1}function rl(e){return e.locked===!0||e.type===`split`&&e.children.some(rl)}function il(e){return e.getAttribute(`surface-id`)||e.getAttribute(`data-s`)||e.id||null}function al(e){e.style.position=`relative`,e.style.inset=`auto`,e.style.display=`flex`,e.style.flex=`1 1 auto`,e.style.minWidth=`0`,e.style.minHeight=`0`}function ol(e){e.style.removeProperty(`position`),e.style.removeProperty(`inset`),e.style.removeProperty(`flex`),e.style.removeProperty(`min-width`),e.style.removeProperty(`min-height`),e.style.display=`none`}function sl(e,t){return{type:`split`,dir:e,children:t,sizes:t.map(()=>1)}}function cl(e,t,n){e.type===`split`&&e.children.forEach((r,i)=>{r===t?n(e,i):cl(r,t,n)})}function ll(e,t){if(e.type!==`split`)return null;for(let n=0;n<e.children.length;n++){let r=e.children[n];if(r===t)return{parent:e,index:n};let i=ll(r,t);if(i)return i}return null}function ul(e){if(!e)return null;if(e.type!==`split`)return e;e.children=e.children.map(ul).filter(e=>e!=null);let t=[],n=[];return e.children.forEach((r,i)=>{r.type===`split`&&r.dir===e.dir?r.children.forEach((a,o)=>{t.push(a),n.push((e.sizes[i]||1)*(r.sizes[o]||1))}):(t.push(r),n.push(e.sizes[i]||1))}),e.children=t,e.sizes=n,e.children.length===0?null:e.children.length===1?e.children[0]:e}function dl(e,t,n){let r=e[t];if(r){if(r===n){e[t]=null;return}cl(r,n,(e,t)=>{e.children.splice(t,1),e.sizes.splice(t,1)}),e[t]=ul(r)}}function fl(e,t,n,r){if(e[t]===n){e[t]=r;return}let i=e[t];i&&cl(i,n,(e,t)=>{e.children[t]=r})}function pl(e,t,n){let r=t.reduce((e,t)=>e+t,0)-e;if(r<=0)return null;let i=Math.min(.98,Math.max(Zc,n));return i*r/(1-i)}function ml(e,t,n){let r=(t-e.left)/e.width,i=(n-e.top)/e.height;if(r>.34&&r<.66&&i>.34&&i<.66)return`center`;let a={n:i,s:1-i,w:r,e:1-r},o=Object.entries(a);return o.sort((e,t)=>e[1]-t[1]),o[0][0]}function hl(e){let t=document.createElement(`div`);return t.className=`dock-tree__divider dock-tree__divider--${e}`,t}function gl(){let e=document.createElement(`div`);return e.className=`dock-tree__root`,e}function _l(){let e=document.createElement(`div`);return e.className=`dock-tree__parking`,e.hidden=!0,e}function vl(){let e=document.createElement(`div`);return e.className=`dock-tree__ghost`,e}function yl(){let e=document.createElement(`div`);return e.className=`dock-tree__preview`,e}A(`slicc-dock-tree`,class extends HTMLElement{static observedAttributes=[`tiles-movable`];#e=Qc();#t=!1;#n=!1;#r=new Set;#i=null;#a=null;#o=new WeakMap;#s=new Set;#c=gl();#l=_l();#u=vl();#d=yl();#f=new MutationObserver(()=>this.#x());connectedCallback(){Hc(this.ownerDocument),this.#n=!0,this.#c.parentElement!==this&&this.append(this.#c),this.#l.parentElement!==this&&this.append(this.#l),this.#u.parentElement!==this&&this.append(this.#u),this.#d.parentElement!==this&&this.append(this.#d),this.#x(),this.#f.observe(this,{childList:!0})}disconnectedCallback(){this.#n=!1,this.#f.disconnect(),this.#L()}attributeChangedCallback(e,t,n){e!==`tiles-movable`||t===n||!this.#n||(this.tilesMovable||this.#L(),this.#x())}get tilesMovable(){let e=this.getAttribute(`tiles-movable`);return e!==null&&!Kc(e)}set tilesMovable(e){this.toggleAttribute(`tiles-movable`,!!e&&!Kc(e))}setTree(e){this.#e=e?$c(e):Qc(),this.#n&&this.#x()}getTree(){return $c(this.#e)}setPinned(e){this.#r=new Set(e)}getSurfaceIds(){let e=[];for(let t of Jc){let n=this.#e.zones[t];n&&el(n,e)}return e}#p(e){return this.#e.zones[e]!=null||this.#t}#m(e,t){let n=this.#e.zones[t];return n?nl(n,e,this.#e.locked===!0):!1}#h(e){if(this.#e.locked===!0)return!0;let t=this.#e.zones[e];return t!=null&&rl(t)}#g(e){return this.#e.locked===!0?!0:e===`center`?Yc.some(e=>this.#h(e)):this.#h(e)}placeSurface(e,t){if(this.getSurfaceIds().includes(e))return;let n={type:`leaf`,surfaceId:e},r=this.#e.zones[t];this.#e.zones[t]=r==null?n:ul(sl(`col`,[r,n])),this.#n&&this.#x(),this.#R()}removeSurface(e){if(!this.#r.has(e))for(let t of Jc){let n=this.#e.zones[t];if(!n)continue;let r=tl(n,e);if(r){if(this.#m(r,t))return;dl(this.#e.zones,t,r),this.#n&&this.#x(),this.#R();return}}}moveSurfaceToZone(e,t){let n=!1;for(let r of Jc){let i=this.#e.zones[r];if(!i)continue;let a=tl(i,e);if(a){if(n=!0,this.#m(a,r)||r===t&&i===a)return;dl(this.#e.zones,r,a);break}}if(!n){this.placeSurface(e,t);return}let r={type:`leaf`,surfaceId:e};this.#e.zones[t]=r,this.#n&&this.#x(),this.#R()}setSurfaceSize(e,t){let n=this.#_(e);if(!n)return!1;let r=this.#z().get(e)??null,i=r?.getBoundingClientRect()??null,a=r?.closest(`.dock-tree__leaf`)?.getBoundingClientRect()??i,o=!1;if(n.width&&(t.widthPx!=null||t.widthPercent!=null)){let e=a&&i?Math.max(0,a.width-i.width):0;o=this.#b(n.width,t.widthPx==null?void 0:t.widthPx+e,t.widthPercent,a?.width)||o}if(n.height&&(t.heightPx!=null||t.heightPercent!=null)){let e=a&&i?Math.max(0,a.height-i.height):0;o=this.#b(n.height,t.heightPx==null?void 0:t.heightPx+e,t.heightPercent,a?.height)||o}return o&&(this.#x(),this.#k()),o}#_(e){for(let t of Jc){let n=this.#e.zones[t];if(!n)continue;let r=tl(n,e);if(!r)continue;if(this.#m(r,t))return{width:null,height:null};let i=ll(n,r);if(i){let{parent:e,index:t}=i,n={currentFr:e.sizes[t]??1,groupFr:e.sizes,apply:n=>{e.sizes[t]=n}};return{width:e.dir===`row`?n:null,height:e.dir===`col`?n:null}}let a=t===`left`||t===`middle`||t===`right`,o=null;if(a){let e=t,n=this.#y();o={currentFr:this.#e.colFr[e],groupFr:n.map(e=>this.#e.colFr[e]),apply:t=>{this.#e.colFr[e]=t}}}let s=a?`center`:t,c=this.#v(),l={currentFr:this.#e.rowFr[s],groupFr:c.map(e=>this.#e.rowFr[e]),apply:e=>{this.#e.rowFr[s]=e}};return{width:o,height:l}}return null}#v(){let e=[];return this.#p(`top`)&&e.push(`top`),Yc.some(e=>this.#p(e))&&e.push(`center`),this.#p(`bottom`)&&e.push(`bottom`),e}#y(){return Yc.filter(e=>this.#p(e))}#b(e,t,n,r){let i=null;if(n!=null)i=n/100;else if(t!=null&&r!=null&&r>0&&e.currentFr>0){let n=r*e.groupFr.reduce((e,t)=>e+t,0)/e.currentFr;n>0&&(i=t/n)}if(i==null)return!1;let a=pl(e.currentFr,e.groupFr,i);return a!=null&&(e.apply(a),!0)}#x(){let e=this.#e,t=this.#z(),n=new Set(this.getSurfaceIds()),r=this.#S(e,t),i=[];if(this.#p(`top`)){let n=this.#C(`top`,t);n.style.flex=`${e.rowFr.top} 1 0`,i.push({key:`top`,el:n})}if(r&&i.push({key:`center`,el:r}),this.#p(`bottom`)){let n=this.#C(`bottom`,t);n.style.flex=`${e.rowFr.bottom} 1 0`,i.push({key:`bottom`,el:n})}let a=[];i.forEach((t,n)=>{a.push(t.el),n<i.length-1&&!this.#g(t.key)&&!this.#g(i[n+1].key)&&a.push(this.#E(`v`,t.key,i[n+1].key,this.#c,e.rowFr,Xc))}),this.#c.replaceChildren(...a);for(let[e,r]of t)n.has(e)||(ol(r),r.parentElement!==this.#l&&this.#l.appendChild(r));this.#s=n,this.dispatchEvent(new CustomEvent(`dock-tree-render`,{detail:{placed:[...n]},bubbles:!0,composed:!0}))}#S(e,t){let n=Yc.filter(e=>this.#p(e));if(n.length===0)return null;let r=document.createElement(`div`);return r.className=`dock-tree__row`,r.style.flex=`${e.rowFr.center} 1 0`,n.forEach((i,a)=>{let o=this.#C(i,t);o.style.flex=`${e.colFr[i]} 1 0`,r.appendChild(o),a<n.length-1&&!this.#h(i)&&!this.#h(n[a+1])&&r.appendChild(this.#E(`h`,i,n[a+1],r,e.colFr,Yc))}),r}#C(e,t){let n=document.createElement(`div`);n.className=`dock-tree__zone`,this.#t&&n.classList.add(`dock-tree__zone--droppable`),n.dataset.zone=e;let r=this.#e.zones[e];if(r==null){let t=document.createElement(`div`);return t.className=`dock-tree__empty`,t.textContent=`${e} (drop here)`,n.appendChild(t),n}let i=this.#w(r,t,e);return i.style.flex=`1 1 0`,n.appendChild(i),n}#w(e,t,n){if(e.type===`leaf`){let r=document.createElement(`div`);r.className=`dock-tree__leaf`;let i=t.get(e.surfaceId);return i&&r.appendChild(this.#T(e,n,e.surfaceId,i)),r}let r=document.createElement(`div`);r.className=`dock-tree__split dock-tree__split--${e.dir}`;let i=this.#e.locked===!0||e.locked===!0;return e.children.forEach((a,o)=>{let s=this.#w(a,t,n);s.style.flex=`${e.sizes[o]??1} 1 0`,r.appendChild(s),o<e.children.length-1&&!i&&r.appendChild(this.#D(e,o,r))}),r}#T(e,t,r,i){let a=document.createElement(`div`);if(a.className=`dock-tree__tile`,r!==`chat`&&(a.classList.add(`dock-tree__tile--chrome`),this.#s.has(r)||a.classList.add(`dock-tree__tile--enter`)),this.tilesMovable&&!this.#m(e,t)){let i=qc(r),o=document.createElement(`button`);o.type=`button`,o.className=`dock-tree__tile-move`,o.setAttribute(`aria-label`,`Move ${i}`),o.title=i,o.appendChild(n(`grip-vertical`,{size:13})),o.addEventListener(`pointerdown`,n=>this.#A(n,e,t)),a.appendChild(o)}let o=document.createElement(`div`);return o.className=`dock-tree__tile-body`,al(i),o.appendChild(i),a.appendChild(o),this.#o.set(a,e),a}#E(e,t,n,r,i,a){let o=hl(e);return this.#O(o,e===`h`,r,()=>i[t]??1,()=>i[n]??1,(e,r)=>{i[t]=e,i[n]=r},()=>a.reduce((e,t)=>e+(i[t]??1),0)),o}#D(e,t,n){let r=e.dir===`row`,i=hl(r?`h`:`v`);return this.#O(i,r,n,()=>e.sizes[t]??1,()=>e.sizes[t+1]??1,(n,r)=>{e.sizes[t]=n,e.sizes[t+1]=r},()=>e.sizes.reduce((e,t)=>e+(t??1),0)),i}#O(e,t,n,r,i,a,o){e.addEventListener(`pointerdown`,e=>{e.preventDefault(),this.setPointerCapture(e.pointerId);let s=n.getBoundingClientRect(),c=r()+i(),l=c*Zc,u=o(),d=t?s.width:s.height,f=t?e.clientX:e.clientY,p=r(),m=e=>{let n=t?e.clientX:e.clientY,r=d>0?(n-f)/d*u:0,i=Math.max(l,Math.min(c-l,p+r));a(i,c-i),this.#x()},h=()=>{window.removeEventListener(`pointermove`,m),window.removeEventListener(`pointerup`,h),window.removeEventListener(`pointercancel`,h),this.hasPointerCapture(e.pointerId)&&this.releasePointerCapture(e.pointerId),this.#k()};window.addEventListener(`pointermove`,m),window.addEventListener(`pointerup`,h),window.addEventListener(`pointercancel`,h)})}#k(){this.dispatchEvent(new CustomEvent(`dock-tree-resize`,{detail:{tree:this.getTree()},bubbles:!0,composed:!0}))}#A(e,t,n){!this.tilesMovable||this.#m(t,n)||(e.preventDefault(),this.#j({kind:`internal`,node:t,fromZone:n},t.type===`leaf`?t.surfaceId:`panel`),this.#M(e))}beginExternalDrag(e,t){this.tilesMovable&&this.#j({kind:`external`,surfaceId:e},e)}#j(e,t){this.#i=e,this.#a=null,this.#t=!0,this.#x(),this.#u.textContent=t,this.#u.classList.add(`dock-tree__ghost--active`),window.addEventListener(`pointermove`,this.#N),window.addEventListener(`pointerup`,this.#I)}#M(e){this.#u.style.left=`${e.clientX}px`,this.#u.style.top=`${e.clientY}px`}#N=e=>{this.#M(e),this.#a=null,this.#d.classList.remove(`dock-tree__preview--active`);for(let e of Array.from(this.querySelectorAll(`.dock-tree__zone--hot`)))e.classList.remove(`dock-tree__zone--hot`);let t=this.#i;if(!t)return;let n=document.elementFromPoint(e.clientX,e.clientY);if(!n)return;let r=n.closest(`.dock-tree__zone`);if(!(r instanceof HTMLElement))return;let i=r.dataset.zone;if(!i)return;r.classList.add(`dock-tree__zone--hot`);let a=n.closest(`.dock-tree__tile`),o=a instanceof HTMLElement?this.#o.get(a):void 0,s=t.kind===`internal`&&o===t.node,c=!!o&&this.#m(o,i);if(a instanceof HTMLElement&&o&&!s&&!c){let t=a.getBoundingClientRect(),n=ml(t,e.clientX,e.clientY);this.#a={zone:i,leaf:o,region:n},this.#P(t,n)}else a||(this.#a={zone:i,empty:!0},this.#F(r.getBoundingClientRect()))};#P(e,t){let{left:n,top:r,width:i,height:a}=e;t===`n`?a=e.height/2:t===`s`?(r=e.top+e.height/2,a=e.height/2):t===`w`?i=e.width/2:t===`e`&&(n=e.left+e.width/2,i=e.width/2),this.#F(new DOMRect(n,r,i,a))}#F(e){this.#d.style.left=`${e.left}px`,this.#d.style.top=`${e.top}px`,this.#d.style.width=`${e.width}px`,this.#d.style.height=`${e.height}px`,this.#d.classList.add(`dock-tree__preview--active`)}#I=()=>{window.removeEventListener(`pointermove`,this.#N),window.removeEventListener(`pointerup`,this.#I),this.#u.classList.remove(`dock-tree__ghost--active`),this.#d.classList.remove(`dock-tree__preview--active`);for(let e of Array.from(this.querySelectorAll(`.dock-tree__zone--hot`)))e.classList.remove(`dock-tree__zone--hot`);let e=this.#a,t=this.#i;this.#a=null,this.#i=null,this.#t=!1;let n=!!t&&t.kind===`internal`&&!!e&&!e.empty&&e.leaf===t.node,r=!!t&&t.kind===`external`&&this.getSurfaceIds().includes(t.surfaceId);if(!t||!e||n||r){this.#x();return}let i;if(t.kind===`internal`?(dl(this.#e.zones,t.fromZone,t.node),i=t.node):i={type:`leaf`,surfaceId:t.surfaceId},e.empty||this.#e.zones[e.zone]==null)this.#e.zones[e.zone]=i;else{let{region:t,leaf:n}=e,r=sl(t===`e`||t===`w`?`row`:`col`,t===`n`||t===`w`?[i,n]:[n,i]);fl(this.#e.zones,e.zone,n,r),this.#e.zones[e.zone]=ul(this.#e.zones[e.zone])}this.#x(),this.#R()};#L(){this.#i&&(window.removeEventListener(`pointermove`,this.#N),window.removeEventListener(`pointerup`,this.#I),this.#i=null,this.#a=null,this.#t=!1,this.#u.classList.remove(`dock-tree__ghost--active`),this.#d.classList.remove(`dock-tree__preview--active`))}#R(){this.dispatchEvent(new CustomEvent(`dock-tree-change`,{detail:{tree:this.getTree()},bubbles:!0,composed:!0}))}#z(){let e=new Map;for(let t of Array.from(this.querySelectorAll(Uc))){if(!(t instanceof HTMLElement)||t.parentElement?.closest(Uc))continue;let n=il(t);n&&e.set(n,t)}return e}});var bl=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
4991
+ `,Gc=`slicc-dock-tree-style`;function Kc(e){if(e.getElementById(Gc))return;let t=e.createElement(`style`);t.id=Gc,t.textContent=Wc,(e.head??e.documentElement).appendChild(t)}var qc=`slicc-surface`,Jc=`chat`,Yc=`sprinkle:`;function Xc(e){return typeof e==`string`&&e.trim().toLowerCase()===`false`}function Zc(e){return e===`chat`?`Chat`:e.startsWith(Yc)?e.slice(9):e}var Qc=[`top`,`left`,`middle`,`right`,`bottom`],$c=[`left`,`middle`,`right`],el=[`top`,`center`,`bottom`],tl=.02;function nl(){return{zones:{top:null,left:null,middle:null,right:null,bottom:null},rowFr:{top:1,center:1,bottom:1},colFr:{left:1,middle:1,right:1}}}function rl(e){return JSON.parse(JSON.stringify(e))}function il(e,t){if(e.type===`leaf`){t.push(e.surfaceId);return}for(let n of e.children)il(n,t)}function al(e,t){if(e.type===`leaf`)return e.surfaceId===t?e:null;for(let n of e.children){let e=al(n,t);if(e)return e}return null}function ol(e,t,n){if(n)return!0;function r(e,n){let i=n||e.locked===!0;if(e===t)return i;if(e.type!==`split`)return null;for(let t of e.children){let e=r(t,i);if(e!=null)return e}return null}return r(e,!1)??!1}function sl(e){return e.locked===!0||e.type===`split`&&e.children.some(sl)}function cl(e){return e.getAttribute(`surface-id`)||e.getAttribute(`data-s`)||e.id||null}function ll(e){e.style.position=`relative`,e.style.inset=`auto`,e.style.display=`flex`,e.style.flex=`1 1 auto`,e.style.minWidth=`0`,e.style.minHeight=`0`}function ul(e){e.style.removeProperty(`position`),e.style.removeProperty(`inset`),e.style.removeProperty(`flex`),e.style.removeProperty(`min-width`),e.style.removeProperty(`min-height`),e.style.display=`none`}function dl(e,t){return{type:`split`,dir:e,children:t,sizes:t.map(()=>1)}}function fl(e,t,n){e.type===`split`&&e.children.forEach((r,i)=>{r===t?n(e,i):fl(r,t,n)})}function pl(e,t){if(e.type!==`split`)return null;for(let n=0;n<e.children.length;n++){let r=e.children[n];if(r===t)return{parent:e,index:n};let i=pl(r,t);if(i)return i}return null}function ml(e){if(!e)return null;if(e.type!==`split`)return e;e.children=e.children.map(ml).filter(e=>e!=null);let t=[],n=[];return e.children.forEach((r,i)=>{r.type===`split`&&r.dir===e.dir?r.children.forEach((a,o)=>{t.push(a),n.push((e.sizes[i]||1)*(r.sizes[o]||1))}):(t.push(r),n.push(e.sizes[i]||1))}),e.children=t,e.sizes=n,e.children.length===0?null:e.children.length===1?e.children[0]:e}function hl(e,t,n){let r=e[t];if(r){if(r===n){e[t]=null;return}fl(r,n,(e,t)=>{e.children.splice(t,1),e.sizes.splice(t,1)}),e[t]=ml(r)}}function gl(e,t,n,r){if(e[t]===n){e[t]=r;return}let i=e[t];i&&fl(i,n,(e,t)=>{e.children[t]=r})}function _l(e,t,n){let r=t.reduce((e,t)=>e+t,0)-e;if(r<=0)return null;let i=Math.min(.98,Math.max(tl,n));return i*r/(1-i)}function vl(e,t,n){let r=(t-e.left)/e.width,i=(n-e.top)/e.height;if(r>.34&&r<.66&&i>.34&&i<.66)return`center`;let a={n:i,s:1-i,w:r,e:1-r},o=Object.entries(a);return o.sort((e,t)=>e[1]-t[1]),o[0][0]}function yl(e){let t=document.createElement(`div`);return t.className=`dock-tree__divider dock-tree__divider--${e}`,t}function bl(){let e=document.createElement(`div`);return e.className=`dock-tree__root`,e}function xl(){let e=document.createElement(`div`);return e.className=`dock-tree__parking`,e.hidden=!0,e}function Sl(){let e=document.createElement(`div`);return e.className=`dock-tree__ghost`,e}function Cl(){let e=document.createElement(`div`);return e.className=`dock-tree__preview`,e}A(`slicc-dock-tree`,class extends HTMLElement{static observedAttributes=[`tiles-movable`];#e=nl();#t=!1;#n=!1;#r=new Set;#i=null;#a=null;#o=new WeakMap;#s=new Set;#c=bl();#l=xl();#u=Sl();#d=Cl();#f=new MutationObserver(()=>this.#x());connectedCallback(){Kc(this.ownerDocument),this.#n=!0,this.#c.parentElement!==this&&this.append(this.#c),this.#l.parentElement!==this&&this.append(this.#l),this.#u.parentElement!==this&&this.append(this.#u),this.#d.parentElement!==this&&this.append(this.#d),this.#x(),this.#f.observe(this,{childList:!0})}disconnectedCallback(){this.#n=!1,this.#f.disconnect(),this.#L()}attributeChangedCallback(e,t,n){e!==`tiles-movable`||t===n||!this.#n||(this.tilesMovable||this.#L(),this.#x())}get tilesMovable(){let e=this.getAttribute(`tiles-movable`);return e!==null&&!Xc(e)}set tilesMovable(e){this.toggleAttribute(`tiles-movable`,!!e&&!Xc(e))}setTree(e){this.#e=e?rl(e):nl(),this.#n&&this.#x()}getTree(){return rl(this.#e)}setPinned(e){this.#r=new Set(e)}getSurfaceIds(){let e=[];for(let t of Qc){let n=this.#e.zones[t];n&&il(n,e)}return e}#p(e){return this.#e.zones[e]!=null||this.#t}#m(e,t){let n=this.#e.zones[t];return n?ol(n,e,this.#e.locked===!0):!1}#h(e){if(this.#e.locked===!0)return!0;let t=this.#e.zones[e];return t!=null&&sl(t)}#g(e){return this.#e.locked===!0?!0:e===`center`?$c.some(e=>this.#h(e)):this.#h(e)}placeSurface(e,t){if(this.getSurfaceIds().includes(e))return;let n={type:`leaf`,surfaceId:e},r=this.#e.zones[t];this.#e.zones[t]=r==null?n:ml(dl(`col`,[r,n])),this.#n&&this.#x(),this.#R()}removeSurface(e){if(!this.#r.has(e))for(let t of Qc){let n=this.#e.zones[t];if(!n)continue;let r=al(n,e);if(r){if(this.#m(r,t))return;hl(this.#e.zones,t,r),this.#n&&this.#x(),this.#R();return}}}moveSurfaceToZone(e,t){let n=!1;for(let r of Qc){let i=this.#e.zones[r];if(!i)continue;let a=al(i,e);if(a){if(n=!0,this.#m(a,r)||r===t&&i===a)return;hl(this.#e.zones,r,a);break}}if(!n){this.placeSurface(e,t);return}let r={type:`leaf`,surfaceId:e};this.#e.zones[t]=r,this.#n&&this.#x(),this.#R()}setSurfaceSize(e,t){let n=this.#_(e);if(!n)return!1;let r=this.#z().get(e)??null,i=r?.getBoundingClientRect()??null,a=r?.closest(`.dock-tree__leaf`)?.getBoundingClientRect()??i,o=!1;if(n.width&&(t.widthPx!=null||t.widthPercent!=null)){let e=a&&i?Math.max(0,a.width-i.width):0;o=this.#b(n.width,t.widthPx==null?void 0:t.widthPx+e,t.widthPercent,a?.width)||o}if(n.height&&(t.heightPx!=null||t.heightPercent!=null)){let e=a&&i?Math.max(0,a.height-i.height):0;o=this.#b(n.height,t.heightPx==null?void 0:t.heightPx+e,t.heightPercent,a?.height)||o}return o&&(this.#x(),this.#k()),o}#_(e){for(let t of Qc){let n=this.#e.zones[t];if(!n)continue;let r=al(n,e);if(!r)continue;if(this.#m(r,t))return{width:null,height:null};let i=pl(n,r);if(i){let{parent:e,index:t}=i,n={currentFr:e.sizes[t]??1,groupFr:e.sizes,apply:n=>{e.sizes[t]=n}};return{width:e.dir===`row`?n:null,height:e.dir===`col`?n:null}}let a=t===`left`||t===`middle`||t===`right`,o=null;if(a){let e=t,n=this.#y();o={currentFr:this.#e.colFr[e],groupFr:n.map(e=>this.#e.colFr[e]),apply:t=>{this.#e.colFr[e]=t}}}let s=a?`center`:t,c=this.#v(),l={currentFr:this.#e.rowFr[s],groupFr:c.map(e=>this.#e.rowFr[e]),apply:e=>{this.#e.rowFr[s]=e}};return{width:o,height:l}}return null}#v(){let e=[];return this.#p(`top`)&&e.push(`top`),$c.some(e=>this.#p(e))&&e.push(`center`),this.#p(`bottom`)&&e.push(`bottom`),e}#y(){return $c.filter(e=>this.#p(e))}#b(e,t,n,r){let i=null;if(n!=null)i=n/100;else if(t!=null&&r!=null&&r>0&&e.currentFr>0){let n=r*e.groupFr.reduce((e,t)=>e+t,0)/e.currentFr;n>0&&(i=t/n)}if(i==null)return!1;let a=_l(e.currentFr,e.groupFr,i);return a!=null&&(e.apply(a),!0)}#x(){let e=this.#e,t=this.#z(),n=new Set(this.getSurfaceIds()),r=this.#S(e,t),i=[];if(this.#p(`top`)){let n=this.#C(`top`,t);n.style.flex=`${e.rowFr.top} 1 0`,i.push({key:`top`,el:n})}if(r&&i.push({key:`center`,el:r}),this.#p(`bottom`)){let n=this.#C(`bottom`,t);n.style.flex=`${e.rowFr.bottom} 1 0`,i.push({key:`bottom`,el:n})}let a=[];i.forEach((t,n)=>{a.push(t.el),n<i.length-1&&!this.#g(t.key)&&!this.#g(i[n+1].key)&&a.push(this.#E(`v`,t.key,i[n+1].key,this.#c,e.rowFr,el))}),this.#c.replaceChildren(...a);for(let[e,r]of t)n.has(e)||(ul(r),r.parentElement!==this.#l&&this.#l.appendChild(r));this.#s=n,this.dispatchEvent(new CustomEvent(`dock-tree-render`,{detail:{placed:[...n]},bubbles:!0,composed:!0}))}#S(e,t){let n=$c.filter(e=>this.#p(e));if(n.length===0)return null;let r=document.createElement(`div`);return r.className=`dock-tree__row`,r.style.flex=`${e.rowFr.center} 1 0`,n.forEach((i,a)=>{let o=this.#C(i,t);o.style.flex=`${e.colFr[i]} 1 0`,r.appendChild(o),a<n.length-1&&!this.#h(i)&&!this.#h(n[a+1])&&r.appendChild(this.#E(`h`,i,n[a+1],r,e.colFr,$c))}),r}#C(e,t){let n=document.createElement(`div`);n.className=`dock-tree__zone`,this.#t&&n.classList.add(`dock-tree__zone--droppable`),n.dataset.zone=e;let r=this.#e.zones[e];if(r==null){let t=document.createElement(`div`);return t.className=`dock-tree__empty`,t.textContent=`${e} (drop here)`,n.appendChild(t),n}let i=this.#w(r,t,e);return i.style.flex=`1 1 0`,n.appendChild(i),n}#w(e,t,n){if(e.type===`leaf`){let r=document.createElement(`div`);r.className=`dock-tree__leaf`;let i=t.get(e.surfaceId);return i&&r.appendChild(this.#T(e,n,e.surfaceId,i)),r}let r=document.createElement(`div`);r.className=`dock-tree__split dock-tree__split--${e.dir}`;let i=this.#e.locked===!0||e.locked===!0;return e.children.forEach((a,o)=>{let s=this.#w(a,t,n);s.style.flex=`${e.sizes[o]??1} 1 0`,r.appendChild(s),o<e.children.length-1&&!i&&r.appendChild(this.#D(e,o,r))}),r}#T(e,t,r,i){let a=document.createElement(`div`);if(a.className=`dock-tree__tile`,r!==`chat`&&(a.classList.add(`dock-tree__tile--chrome`),this.#s.has(r)||a.classList.add(`dock-tree__tile--enter`)),this.tilesMovable&&!this.#m(e,t)){let i=Zc(r),o=document.createElement(`button`);o.type=`button`,o.className=`dock-tree__tile-move`,o.setAttribute(`aria-label`,`Move ${i}`),o.title=i,o.appendChild(n(`grip-vertical`,{size:13})),o.addEventListener(`pointerdown`,n=>this.#A(n,e,t)),a.appendChild(o)}let o=document.createElement(`div`);return o.className=`dock-tree__tile-body`,ll(i),o.appendChild(i),a.appendChild(o),this.#o.set(a,e),a}#E(e,t,n,r,i,a){let o=yl(e);return this.#O(o,e===`h`,r,()=>i[t]??1,()=>i[n]??1,(e,r)=>{i[t]=e,i[n]=r},()=>a.reduce((e,t)=>e+(i[t]??1),0)),o}#D(e,t,n){let r=e.dir===`row`,i=yl(r?`h`:`v`);return this.#O(i,r,n,()=>e.sizes[t]??1,()=>e.sizes[t+1]??1,(n,r)=>{e.sizes[t]=n,e.sizes[t+1]=r},()=>e.sizes.reduce((e,t)=>e+(t??1),0)),i}#O(e,t,n,r,i,a,o){e.addEventListener(`pointerdown`,e=>{e.preventDefault(),this.setPointerCapture(e.pointerId);let s=n.getBoundingClientRect(),c=r()+i(),l=c*tl,u=o(),d=t?s.width:s.height,f=t?e.clientX:e.clientY,p=r(),m=e=>{let n=t?e.clientX:e.clientY,r=d>0?(n-f)/d*u:0,i=Math.max(l,Math.min(c-l,p+r));a(i,c-i),this.#x()},h=()=>{window.removeEventListener(`pointermove`,m),window.removeEventListener(`pointerup`,h),window.removeEventListener(`pointercancel`,h),this.hasPointerCapture(e.pointerId)&&this.releasePointerCapture(e.pointerId),this.#k()};window.addEventListener(`pointermove`,m),window.addEventListener(`pointerup`,h),window.addEventListener(`pointercancel`,h)})}#k(){this.dispatchEvent(new CustomEvent(`dock-tree-resize`,{detail:{tree:this.getTree()},bubbles:!0,composed:!0}))}#A(e,t,n){!this.tilesMovable||this.#m(t,n)||(e.preventDefault(),this.#j({kind:`internal`,node:t,fromZone:n},t.type===`leaf`?t.surfaceId:`panel`),this.#M(e))}beginExternalDrag(e,t){this.tilesMovable&&this.#j({kind:`external`,surfaceId:e},e)}#j(e,t){this.#i=e,this.#a=null,this.#t=!0,this.#x(),this.#u.textContent=t,this.#u.classList.add(`dock-tree__ghost--active`),window.addEventListener(`pointermove`,this.#N),window.addEventListener(`pointerup`,this.#I)}#M(e){this.#u.style.left=`${e.clientX}px`,this.#u.style.top=`${e.clientY}px`}#N=e=>{this.#M(e),this.#a=null,this.#d.classList.remove(`dock-tree__preview--active`);for(let e of Array.from(this.querySelectorAll(`.dock-tree__zone--hot`)))e.classList.remove(`dock-tree__zone--hot`);let t=this.#i;if(!t)return;let n=document.elementFromPoint(e.clientX,e.clientY);if(!n)return;let r=n.closest(`.dock-tree__zone`);if(!(r instanceof HTMLElement))return;let i=r.dataset.zone;if(!i)return;r.classList.add(`dock-tree__zone--hot`);let a=n.closest(`.dock-tree__tile`),o=a instanceof HTMLElement?this.#o.get(a):void 0,s=t.kind===`internal`&&o===t.node,c=!!o&&this.#m(o,i);if(a instanceof HTMLElement&&o&&!s&&!c){let t=a.getBoundingClientRect(),n=vl(t,e.clientX,e.clientY);this.#a={zone:i,leaf:o,region:n},this.#P(t,n)}else a||(this.#a={zone:i,empty:!0},this.#F(r.getBoundingClientRect()))};#P(e,t){let{left:n,top:r,width:i,height:a}=e;t===`n`?a=e.height/2:t===`s`?(r=e.top+e.height/2,a=e.height/2):t===`w`?i=e.width/2:t===`e`&&(n=e.left+e.width/2,i=e.width/2),this.#F(new DOMRect(n,r,i,a))}#F(e){this.#d.style.left=`${e.left}px`,this.#d.style.top=`${e.top}px`,this.#d.style.width=`${e.width}px`,this.#d.style.height=`${e.height}px`,this.#d.classList.add(`dock-tree__preview--active`)}#I=()=>{window.removeEventListener(`pointermove`,this.#N),window.removeEventListener(`pointerup`,this.#I),this.#u.classList.remove(`dock-tree__ghost--active`),this.#d.classList.remove(`dock-tree__preview--active`);for(let e of Array.from(this.querySelectorAll(`.dock-tree__zone--hot`)))e.classList.remove(`dock-tree__zone--hot`);let e=this.#a,t=this.#i;this.#a=null,this.#i=null,this.#t=!1;let n=!!t&&t.kind===`internal`&&!!e&&!e.empty&&e.leaf===t.node,r=!!t&&t.kind===`external`&&this.getSurfaceIds().includes(t.surfaceId);if(!t||!e||n||r){this.#x();return}let i;if(t.kind===`internal`?(hl(this.#e.zones,t.fromZone,t.node),i=t.node):i={type:`leaf`,surfaceId:t.surfaceId},e.empty||this.#e.zones[e.zone]==null)this.#e.zones[e.zone]=i;else{let{region:t,leaf:n}=e,r=dl(t===`e`||t===`w`?`row`:`col`,t===`n`||t===`w`?[i,n]:[n,i]);gl(this.#e.zones,e.zone,n,r),this.#e.zones[e.zone]=ml(this.#e.zones[e.zone])}this.#x(),this.#R()};#L(){this.#i&&(window.removeEventListener(`pointermove`,this.#N),window.removeEventListener(`pointerup`,this.#I),this.#i=null,this.#a=null,this.#t=!1,this.#u.classList.remove(`dock-tree__ghost--active`),this.#d.classList.remove(`dock-tree__preview--active`))}#R(){this.dispatchEvent(new CustomEvent(`dock-tree-change`,{detail:{tree:this.getTree()},bubbles:!0,composed:!0}))}#z(){let e=new Map;for(let t of Array.from(this.querySelectorAll(qc))){if(!(t instanceof HTMLElement)||t.parentElement?.closest(qc))continue;let n=cl(t);n&&e.set(n,t)}return e}});var wl=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
4945
4992
  <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
4946
4993
  <path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
4947
4994
  </symbol>
@@ -4958,72 +5005,72 @@ slicc-dock-tree .dock-tree__preview--active {
4958
5005
  <symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
4959
5006
  <path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
4960
5007
  </symbol>
4961
- </svg>`,xl=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
5008
+ </svg>`,Tl=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
4962
5009
  <path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
4963
5010
  <path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
4964
- </symbol>`,Sl=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
5011
+ </symbol>`,El=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
4965
5012
  <path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
4966
- </symbol>`,Cl=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
5013
+ </symbol>`,Dl=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
4967
5014
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
4968
5015
  <path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
4969
- </symbol>`,wl=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
5016
+ </symbol>`,Ol=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
4970
5017
  <path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
4971
- </symbol>`,Tl=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
5018
+ </symbol>`,kl=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
4972
5019
  <path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
4973
5020
  <path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
4974
- </symbol>`,El=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
5021
+ </symbol>`,Al=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
4975
5022
  <path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
4976
5023
  <path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
4977
5024
  <path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
4978
- </symbol>`,Dl=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
5025
+ </symbol>`,jl=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
4979
5026
  <path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
4980
- </symbol>`,Ol=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
5027
+ </symbol>`,Ml=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
4981
5028
  <path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
4982
- </symbol>`,kl=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
5029
+ </symbol>`,Nl=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
4983
5030
  <path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
4984
- </symbol>`,Al=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
5031
+ </symbol>`,Pl=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
4985
5032
  <path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
4986
- </symbol>`,jl=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
5033
+ </symbol>`,Fl=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
4987
5034
  <path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
4988
5035
  <path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
4989
- </symbol>`,Ml=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
5036
+ </symbol>`,Il=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
4990
5037
  <path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
4991
5038
  <path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
4992
5039
  <path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
4993
- </symbol>`,Nl=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
5040
+ </symbol>`,Ll=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
4994
5041
  <path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
4995
5042
  <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
4996
- </symbol>`,Pl=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
5043
+ </symbol>`,Rl=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
4997
5044
  <path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
4998
5045
  <path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
4999
- </symbol>`,Fl=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
5046
+ </symbol>`,zl=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
5000
5047
  <path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
5001
5048
  <path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
5002
- </symbol>`,Il=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
5049
+ </symbol>`,Bl=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
5003
5050
  <path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
5004
- </symbol>`,Ll=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
5051
+ </symbol>`,Vl=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
5005
5052
  <path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
5006
- </symbol>`,Rl=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
5053
+ </symbol>`,Hl=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
5007
5054
  <path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
5008
- </symbol>`,zl=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
5055
+ </symbol>`,Ul=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
5009
5056
  <path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
5010
- </symbol>`,Bl=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
5057
+ </symbol>`,Wl=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
5011
5058
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
5012
5059
  <path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
5013
- </symbol>`,Vl=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
5060
+ </symbol>`,Gl=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
5014
5061
  <path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
5015
5062
  <path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
5016
- </symbol>`,Hl=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
5063
+ </symbol>`,Kl=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
5017
5064
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
5018
5065
  <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
5019
- </symbol>`,Ul=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
5066
+ </symbol>`,ql=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
5020
5067
  <path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
5021
- </symbol>`,Wl=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
5068
+ </symbol>`,Jl=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
5022
5069
  <path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
5023
- </symbol>`,Gl=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
5070
+ </symbol>`,Yl=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
5024
5071
  <path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
5025
5072
  <path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
5026
- </symbol>`,Kl=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
5073
+ </symbol>`,Xl=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
5027
5074
  <defs>
5028
5075
  <linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
5029
5076
  <stop stop-color="currentColor"/>
@@ -5033,82 +5080,82 @@ slicc-dock-tree .dock-tree__preview--active {
5033
5080
  <path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
5034
5081
  <path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
5035
5082
  <path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
5036
- </symbol>`,ql=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
5083
+ </symbol>`,Zl=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
5037
5084
  <path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
5038
5085
  <path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
5039
- </symbol>`,Jl=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
5086
+ </symbol>`,Ql=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
5040
5087
  <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
5041
- </symbol>`,Yl=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
5088
+ </symbol>`,$l=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
5042
5089
  <path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
5043
- </symbol>`,Xl=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
5090
+ </symbol>`,eu=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
5044
5091
  <path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
5045
5092
  <path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
5046
5093
  <path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
5047
5094
  <path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
5048
- </symbol>`,Zl=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
5095
+ </symbol>`,tu=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
5049
5096
  <path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
5050
5097
  <path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
5051
- </symbol>`,Ql=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
5098
+ </symbol>`,nu=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
5052
5099
  <path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
5053
5100
  <path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
5054
- </symbol>`,$l=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
5101
+ </symbol>`,ru=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
5055
5102
  <path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
5056
- </symbol>`,eu=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
5103
+ </symbol>`,iu=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
5057
5104
  <path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
5058
- </symbol>`,tu=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
5105
+ </symbol>`,au=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
5059
5106
  <path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
5060
- </symbol>`,nu=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
5107
+ </symbol>`,ou=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
5061
5108
  <path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
5062
5109
  <path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
5063
- </symbol>`,ru=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
5110
+ </symbol>`,su=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
5064
5111
  <path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
5065
- </symbol>`,iu=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
5112
+ </symbol>`,cu=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
5066
5113
  <path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
5067
5114
  <path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
5068
- </symbol>`,au=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
5115
+ </symbol>`,lu=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
5069
5116
  <path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
5070
5117
  <path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
5071
- </symbol>`,ou=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
5118
+ </symbol>`,uu=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
5072
5119
  <path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
5073
- </symbol>`,su=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
5120
+ </symbol>`,du=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
5074
5121
  <path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
5075
5122
  <path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
5076
- </symbol>`,cu=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
5123
+ </symbol>`,fu=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
5077
5124
  <path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
5078
- </symbol>`,lu=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
5125
+ </symbol>`,pu=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
5079
5126
  <path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
5080
- </symbol>`,uu=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
5127
+ </symbol>`,mu=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
5081
5128
  <path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
5082
5129
  <path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
5083
- </symbol>`,du=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
5130
+ </symbol>`,hu=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
5084
5131
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
5085
5132
  <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
5086
- </symbol>`,fu=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
5133
+ </symbol>`,gu=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
5087
5134
  <path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
5088
- </symbol>`,pu=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
5135
+ </symbol>`,_u=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
5089
5136
  <path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
5090
5137
  <path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
5091
5138
  <path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
5092
- </symbol>`,mu=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
5139
+ </symbol>`,vu=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
5093
5140
  <path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
5094
5141
  <path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
5095
- </symbol>`,hu=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
5142
+ </symbol>`,yu=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
5096
5143
  <path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
5097
5144
  <path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
5098
5145
  <path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
5099
- </symbol>`,gu=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
5146
+ </symbol>`,bu=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
5100
5147
  <path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
5101
5148
  <path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
5102
- </symbol>`,_u=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
5149
+ </symbol>`,xu=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
5103
5150
  <path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
5104
- </symbol>`,vu=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
5151
+ </symbol>`,Su=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
5105
5152
  <path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
5106
5153
  <path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
5107
- </symbol>`,yu=[Cl,Ol,Al,jl,Ml,Nl,Il,Ll,Rl,Bl,Vl,Hl,Ul,Wl,Gl,Zl,$l,eu,ou,su,uu,du,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
5154
+ </symbol>`,Cu=[Dl,Ml,Pl,Fl,Il,Ll,Bl,Vl,Hl,Wl,Gl,Kl,ql,Jl,Yl,tu,ru,iu,uu,du,mu,hu,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
5108
5155
  <path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
5109
5156
  <path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
5110
- </symbol>`],bu=[xl,Sl,wl,Tl,El,Dl,kl,Pl,Fl,zl,Kl,ql,Jl,Yl,Xl,Ql,tu,nu,ru,iu,au,cu,lu,fu,pu,mu,hu,gu,_u,vu];function xu(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
5111
- `)}\n</svg>`)}var Su=xu(bl,yu),Cu={minimal:bl,standard:Su,complete:xu(Su,bu)},wu={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},Tu={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},Eu={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},Du=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),Ou=new Set([`complete`]);function ku(e){return Cu[e===`none`?`minimal`:e]}function Au(e){return`file-tree-builtin-${e}`}function ju(e){return e!==`none`&&Ou.has(e)}function Mu(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=wu[t.toLowerCase()];if(i!=null&&(r||Du.has(i)))return i;for(let e of n){if(r){let t=Eu[e];if(t!=null)return t}let t=Tu[e];if(t!=null&&(r||Du.has(t)))return t}return`default`}var Nu=`file-tree-container`,Pu=`data-file-tree-style`,Fu=`data-file-tree-unsafe-css`,Iu=`data-file-tree-scrollbar-measure`,Lu=`data-file-tree-scrollbar-gutter-measured`,Ru=`--trees-scrollbar-gutter-measured`,zu=`header`,Bu=`context-menu`,Vu=`context-menu-trigger`;function Hu(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function Uu(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(Hu(e)?`none`:`complete`),colored:e.colored??!0}}var Wu=e=>e.trim().toLowerCase(),Gu=e=>e.split(`/`).at(-1)??e,Ku=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function qu(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function Ju(e){let t=Uu(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(Wu(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let s=Gu(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return qu(l,e);for(let[t,n]of a)if(c.includes(t))return qu(n,e);let u=Ku(s);for(let t of u){let n=i.get(t);if(n!=null)return qu(n,e)}let d=Mu(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return qu(t,e)}return{name:Au(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:qu(s,e)}}}var Yu=5,Xu=32,Zu=128;function Qu(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function $u(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function ed(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function td(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function nd(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function rd(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function id(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,cd(e,t)}function ad(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=td(e).get(t);if(i===void 0)return;let a=i>>Yu;e.childVisibleChunkSums[a]+=r}function od(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=ld(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=Xu}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function sd(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>Yu;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<Yu}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function cd(e,t){if(t.childIds.length<Zu){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/Xu),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>Yu]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function ld(e,t,n,r){let i=Math.min(t.childIds.length,n+Xu),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var ud=7,dd=3,fd=8,pd=4;function md(e,t,n=0){return e<<pd|n<<dd|t}function hd(e){return e.depthAndFlags>>>pd}function gd(e){return(e.depthAndFlags&fd)>>dd}function V(e){return(e.depthAndFlags&fd)!==0}function _d(e){return e.depthAndFlags&ud}function H(e,t){return(_d(e)&t)!==0}function vd(e,t){e.depthAndFlags|=t}function yd(e,t){e.depthAndFlags=md(t,_d(e),gd(e))}var bd=Symbol(`benchmarkInstrumentation`);function xd(e,t){return t==null||Object.defineProperty(e,bd,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function Sd(e){return e==null?null:e[bd]??null}function U(e,t,n){return e==null?n():e.measurePhase(t,n)}function Cd(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function wd(e){return e>=48&&e<=57}function Td(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!wd(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&wd(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function Ed(e){let t=e.toLowerCase();return{lowerValue:t,tokens:Td(t)}}function Dd(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function Od(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=Dd(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function kd(e,t,n){let r=Od(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function Ad(e,t){return kd(e,t,Ed)}function jd(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function Md(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=jd(e,r);return a===jd(t,r)?Ad(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Nd(e,t){return Md(e,t)}function Pd(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=Ed(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=jd(e,n);return o===jd(t,n)?kd(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Fd(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=Ed(r);return e.sortKeyById[t]=i,i}function Id(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function Ld(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function Rd(e){let{hasTrailingSlash:t,segments:n}=Ld(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function zd(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=Ld(e);return{requiresDirectory:t,segments:n}}function Bd(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[Ed(``)]}}function Vd(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function Hd(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var Ud=Symbol(`pathStorePreparedInputKind`);function Wd(e,t){return e[Ud]=t,e}function Gd(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function Kd(e,t,n){return n==="default"?Nd(e,t):n(Gd(e),Gd(t))}function qd(){return{depthAndFlags:md(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function Jd(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function Yd(e){return e.isDirectory?e.segments.length:e.segments.length-1}function Xd(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function Zd(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Qd(e,t={}){return af(e,t).map(e=>e.path)}function $d(e,t={}){let n=af(e,t);return Wd({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function ef(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return Wd({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function tf(e){let t=e,n=t.preparedPaths;if(t[Ud]===`prepared`&&n!=null)return n;if(!Xd(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function nf(e){let t=e;return t[Ud]===`presorted`&&t.presortedPaths!=null||Zd(t.presortedPaths)?t.presortedPaths:null}function rf(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function af(e,t={}){let n=Id(t),r=Sd(t);Cd(r,`workload.inputFiles`,e.length);let i=U(r,`store.preparePathEntries.parse`,()=>e.map(e=>Rd(e)));return U(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>Kd(e,t,n.sort))),i}var of=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[qd()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=Bd();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=Sd(e),this.options=Id(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,Qu())}appendPaths(e){return U(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>Rd(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,U(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return U(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:md(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:md(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d,m=a+1}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:md(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=Rd(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:md(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:md(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=Rd(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(U(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||U(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?Pd(this.lastPreparedPath,e,this.segmentSortKeyCache):Kd(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=Yd(e),i=n==null?0:Yd(n),a=n==null?0:Jd(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=Vd(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:md(hd(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),nd(i,s),s}createFileChildUnchecked(e,t){let n=Vd(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:md(hd(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),nd(r,a),a}getOrCreateDirectoryChild(e,t){let n=Vd(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!V(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:md(hd(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),nd(r,a),this.directories.set(a,Qu()),a}createDirectoryChild(e,t){let n=Vd(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:md(hd(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),nd(r,a),this.directories.set(a,Qu()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!V(n))throw Error(`Path is not a directory: "${t}"`);if(H(n,1))throw Error(`Duplicate path: "${t}"`);vd(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,$u());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(V(a)){let t=$u();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;V(n)&&this.directories.set(t,Qu());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),nd(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!V(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return id(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function sf(e,t=`closed`,n=null){let r=lf(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function cf(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function lf(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function uf(e,t){return H(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&hd(t)<=e.defaultExpansion}function df(e,t,n=e.snapshot.nodes[t]){return n==null||!V(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:uf(e,n)}function ff(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!V(r))return;let i=uf(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function pf(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function mf(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function hf(e,t){let n=pf(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function gf(e,t){let n=pf(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function _f(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function vf(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function yf(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function bf(e,t){e.directoryLoadInfoById.delete(t)}function xf(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Sf(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Cf(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function wf(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function Tf(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Ef(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Df(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Of(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function kf(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Af(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function jf(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Mf(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function Nf(e,t,n){return{...n,visibleCountDelta:Wf(e)-t}}function Pf(e,t){let n=Wf(e),r=cf();e.transactionStack.push(r);try{t()}catch(t){throw Lf(e,r,!1),t}Lf(e,r,!0,Wf(e)-n)}function Ff(e,t){let n=e.instrumentation;if(n==null){If(e,t);return}U(n,`store.events.record`,()=>If(e,t))}function If(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){Hf(e,t);return}n.events.push(t),Vf(n,t)}function Lf(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?Bf(i,t):U(n,`store.events.batch.merge`,()=>Bf(i,t));return}let a=Rf(t,r),o=e.instrumentation;if(o==null){Hf(e,a);return}U(o,`store.events.batch.commit`,()=>Hf(e,a))}function Rf(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function zf(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function Bf(e,t){for(let n of t.events)e.events.push(n);zf(e,t)}function Vf(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function Hf(e,t){let n=e.instrumentation;if(n==null){Uf(e,t);return}U(n,`store.events.emit`,()=>Uf(e,t))}function Uf(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function Wf(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function Gf(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!V(n)||H(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!V(a)?null:i}function Kf(e,t){let n=t;for(;;){let t=Gf(e,n);if(t==null)return n;n=t}}function qf(e,t){let n=[t],r=t;for(;;){let t=Gf(e,r);if(t==null)return n;n.push(t),r=t}}function Jf(e,t){let n=t==null?e.snapshot.rootId:rp(e,t);return n==null?[]:ap(e,n)}function Yf(e,t){let n=Rd(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=bp(e,yp(e,r)),{createdNodeIds:a,directoryId:o}=op(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=K(e,o);if(H(n,1))throw Error(`Path already exists: "${t}"`);vd(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=cp(e,o,n.basename),s.add(c);ep(e,o);let l=bp(e,o);return Sf({affectedAncestorIds:np(e,c),affectedNodeIds:[...s],path:t,projectionChanged:xp(i,l)})}function Xf(e,t,n){let r=rp(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=K(e,r);if(H(i,2))throw Error(`The root node cannot be removed`);if(V(i)&&G(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=bp(e,a),s=_p(e,r);dp(e,a,r,i.nameId),vp(e,a),ep(e,a);let c=bp(e,a);return Cf({affectedAncestorIds:np(e,a),affectedNodeIds:s,path:t,projectionChanged:xp(o,c),recursive:n.recursive===!0})}function Zf(e,t,n,r){let i=rp(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=K(e,i);if(H(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=hp(e,i,n),c=bp(e,a.parentId),l=bp(e,s.parentId),u=Hd(e.snapshot.segmentTable,a.nameId),d=Vd(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(V(a)&&Tp(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=ed(e.snapshot.nodes,G(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&gp(e,p,o,gd(a))===`skip`)return null;let m=a.parentId;dp(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),wp(e,i),up(e,s.parentId,i),vp(e,m),e.pathCacheVersion++,ep(e,m),s.parentId!==m&&ep(e,s.parentId);let h=bp(e,m),g=bp(e,s.parentId);return wf({affectedAncestorIds:[...new Set([...np(e,m),...np(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:Sp([c,l],[h,g]),to:W(e,i)})}function Qf(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function $f(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function W(e,t){let n=K(e,t),r=Qf(e,t);if(r!=null)return r;if(H(n,2))return $f(e,t,``);let i=W(e,n.parentId),a=Hd(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return $f(e,t,V(n)?`${o}/`:o)}function ep(e,t){let n=e.instrumentation;if(n==null){Dp(e,t);return}U(n,`store.recomputeCountsUpwardFrom`,()=>Dp(e,t))}function tp(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!V(o)){Ep(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){Ep(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function np(e,t){let n=[],r=t;for(;r!=null;){let t=K(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function rp(e,t){if(t.length===0)return e.snapshot.rootId;let n=zd(t);return ip(e,n.segments,n.requiresDirectory)}function ip(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=G(e,r),a=ed(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=K(e,r);return n&&!V(i)?null:r}function G(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function K(e,t){let n=e.snapshot.nodes[t];if(n===void 0||H(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function ap(e,t){let n=e.snapshot.nodes[t];if(n===void 0||H(n,4))return[];if(!V(n))return[W(e,t)];if(G(e,t).childIds.length===0)return H(n,1)&&!H(n,2)?[W(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||H(n,4)){i.pop();continue}if(!V(n)){r.push(W(e,t.nodeId)),i.pop();continue}let a=G(e,t.nodeId);if(a.childIds.length===0){H(n,1)&&!H(n,2)&&r.push(W(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function op(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=Vd(e.snapshot.segmentTable,i),a=G(e,r),o=ed(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!V(K(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=sp(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function sp(e,t,n){let r=K(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:md(hd(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,Qu()),up(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function cp(e,t,n){let r=Vd(e.snapshot.segmentTable,n),i=G(e,t);if(ed(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${kp(e,t,n)}"`);let a=K(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:md(hd(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),up(e,t,o),e.activeNodeCount++,o}function lp(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}fp(e,n,o)<0?i=a:r=a+1}return r}function up(e,t,n){let r=G(e,t),i=K(e,n);ed(e.snapshot.nodes,r).set(i.nameId,n),ad(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=lp(e,r,n);r.childIds.splice(a,0,n),rd(r,a),cd(e.snapshot.nodes,r)}function dp(e,t,n,r){let i=G(e,t),a=td(i),o=a.get(n)??-1;ed(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&ad(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),rd(i,o),cd(e.snapshot.nodes,i))}function fp(e,t,n){let r=e.snapshot.options.sort;return r==="default"?pp(e,t,n):r(mp(e,t),mp(e,n))}function pp(e,t,n){let r=K(e,t),i=K(e,n),a=V(r);if(a!==V(i))return a?-1:1;let o=Od(Fd(e.snapshot.segmentTable,r.nameId),Fd(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=Hd(e.snapshot.segmentTable,r.nameId),c=Hd(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function mp(e,t){let n=K(e,t),r=W(e,t),i=V(n),a=i?r.slice(0,-1):r;return{basename:Hd(e.snapshot.segmentTable,n.nameId),depth:hd(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function hp(e,t,n){let r=K(e,t),i=rp(e,n);if(i!=null){let t=K(e,i);if(V(t))return{basename:Hd(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=zd(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=zd(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:ip(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function gp(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${W(e,t)}"`);let i=K(e,t);if(gd(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(V(i)&&G(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return _p(e,t),dp(e,a,t,o),vp(e,a),ep(e,a),`handled`}function _p(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=K(e,t.nodeId);if(t.visitedChildren||!V(i)){V(i)&&e.snapshot.directories.delete(t.nodeId),vd(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),bf(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=G(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function vp(e,t){let n=t;for(;n!=null;){let t=K(e,n);if(!V(t)||H(t,2)||G(e,n).childIds.length>0)return;vd(t,1),n=t.parentId===n?null:t.parentId}}function yp(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=ed(e.snapshot.nodes,G(e,n)).get(t);if(i==null||!V(K(e,i)))break;n=i}return n}function bp(e,t){let n=Cp(e,t);if(n==null)return null;let r=Kf(e,n),i=K(e,r),a=n===r?null:qf(e,n).map(t=>W(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:G(e,r).childIds.length>0,path:W(e,r),terminalKind:gd(i)})}function xp(e,t){return Sp([e],[t])}function Sp(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function Cp(e,t){let n=t;for(;n!=null;){let t=K(e,n);if(!V(t)||H(t,2))return null;if(!df(e,n,t))return n;n=t.parentId}return null}function wp(e,t){let n=K(e,t);if(yd(n,(t===e.snapshot.rootId?-1:hd(K(e,n.parentId)))+1),!V(n))return;let r=G(e,t);for(let t of r.childIds)wp(e,t)}function Tp(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=K(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function Ep(e,t,n=K(e,t),r=!1){let i=e.instrumentation;if(i==null){Op(e,t,n,r);return}U(i,`store.recomputeNodeCounts`,()=>Op(e,t,n,r))}function Dp(e,t){let n=t;for(;n!=null;){let t=K(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(Ep(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&ad(G(e,s),n,a,o),n=s}}function Op(e,t,n,r){if(!V(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=G(e,t);if(r){let t=e.instrumentation;t==null?id(e.snapshot.nodes,i):U(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>id(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,H(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=Gf(e,t)==null?df(e,t,n)?1+o:1:o}function kp(e,t,n){let r=W(e,t);return r.length===0?n:`${r}${n}`}function Ap(e){return e!=null&&!H(e,4)}function jp(e,t){let n=e.snapshot.nodes[t];return!Ap(n)||!V(n)||H(n,2)?null:n}function Mp(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&Ap(e.snapshot.nodes[n])&&(t+=1);return t}function Np(e){return Math.max(0,e.valueById.length-1)}function Pp(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:Mp(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:Np(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function Fp(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function Ip(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)jp(e,n)!=null&&t.push(W(e,n));for(let t of e.expandedDirectoryIds)jp(e,t)!=null&&n.push(W(e,t));return{collapsedPaths:t,expandedPaths:n}}function Lp(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)jp(e,n)!=null&&mf(e,n)!==`loaded`&&t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:W(e,n)});return t}function Rp(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=rp(e,n);t!=null&&ff(e,t,!0,K(e,t))}for(let n of t.collapsedPaths){let t=rp(e,n);t!=null&&ff(e,t,!1,K(e,t))}}function zp(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=rp(e,n.path);t!=null&&jp(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function Bp(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function Vp(e){let t=e.snapshot.segmentTable,n=Bd();for(let r of e.snapshot.nodes)if(Ap(r)){if(H(r,2)){r.nameId=0;continue}r.nameId=Vd(n,Hd(t,r.nameId))}e.snapshot.segmentTable=n}function Hp(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!Ap(r)||!V(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return Ap(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[K(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),id(e.snapshot.nodes,n)}}function Up(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(Ap(n))break;--t}e.snapshot.nodes.length=t+1}function Wp(e){let t=Ip(e),n=Lp(e);U(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>Bp(e)),U(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>Vp(e)),U(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>Hp(e)),U(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>Up(e)),U(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>Rp(e,t)),U(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>zp(e,n)),U(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>tp(e,e.snapshot.rootId))}function Gp(e){let t=Ip(e),n=Lp(e),r=U(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>Jf(e)),i=xd({...e.snapshot.options},e.instrumentation),a=U(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new of(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,U(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>Rp(e,t)),U(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>zp(e,n)),U(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>tp(e,e.snapshot.rootId))}function Kp(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function qp(e,t){let n=Pp(e);t===`stable`?U(e.instrumentation,`store.cleanup.stable`,()=>Wp(e)):U(e.instrumentation,`store.cleanup.aggressive`,()=>Gp(e));let r=Pp(e);return Fp(t,t===`stable`,n,r)}var Jp=64;function Yp(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function q(e){return K(e,e.snapshot.rootId).visibleSubtreeCount}function Xp(e,t,n,r){let i=K(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function Zp(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:gm(e,t.cursor),setSize:t.setSize,subtreeEndIndex:Xp(e,t.cursor,t.index,n)}}function Qp(e,t,n,r,i,a){let o=G(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=od(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return $p(e,u,l,r+c,i+1,s,o.childIds.length,a)}function $p(e,t,n,r,i,a,o,s){if(!V(K(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=um(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=K(e,c.terminalNodeId);if(!V(l)||!df(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return Qp(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function em(e,t){let n=q(e);if(t<0||t>=n)return null;let r=Qp(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>W(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=Zp(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:gm(e,r.cursor),setSize:r.setSize,subtreeEndIndex:Xp(e,r.cursor,r.index,n)}}function tm(e,t,n){let r=e.instrumentation,i=q(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return hm(e,o+1);let t=[],n=sm(e,a);for(let r=a;r<=o&&n!=null;r++){let r=gm(e,n);t.push(r),n=fm(e,n)}return t}let s=[],c=0,l=0,u=U(r,`store.getVisibleSlice.selectFirstRow`,()=>sm(e,a));for(let t=a;t<=o&&u!=null;t++){let t=U(r,`store.getVisibleSlice.materializeRow`,()=>gm(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=U(r,`store.getVisibleSlice.advanceCursor`,()=>fm(e,u))}return Cd(r,`workload.visibleRowsRead`,s.length),Cd(r,`workload.flattenedRowsRead`,c),Cd(r,`workload.flattenedSegmentsRead`,l),s}function nm(e,t=q(e)){let n=e.instrumentation;return n==null?mm(e,t):U(n,`store.getVisibleTreeProjection`,()=>mm(e,t))}function rm(e){return pm(nm(e))}function im(e,t){let n=rp(e,t);if(n==null||n===e.snapshot.rootId||V(K(e,n))&&Kf(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=K(e,i).parentId,n=G(e,t),s=td(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=sd(a,n,s),t!==o){let n=K(e,t),a=Gf(e,t);if(!df(e,t,n)&&a!==i)return null;Kf(e,t)===t&&(r+=1)}i=t}return r}function am(e,t){let n=rp(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=K(e,n);if(!V(r))throw Error(`Path is not a directory: "${t}"`);return df(e,n,r)?null:(ff(e,n,!0,r),ep(e,n),Tf({affectedAncestorIds:np(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function om(e,t){let n=rp(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=K(e,n);if(!V(r))throw Error(`Path is not a directory: "${t}"`);return df(e,n,r)?(ff(e,n,!1,r),ep(e,n),Ef({affectedAncestorIds:np(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function sm(e,t){return t<0||t>=q(e)?null:cm(e,e.snapshot.rootId,t,-1)}function cm(e,t,n,r){let i=G(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?od(e.snapshot.nodes,i,n):U(a,`store.getVisibleSlice.selectChildIndex`,()=>od(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return lm(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function lm(e,t,n,r){if(!V(K(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=um(e,t,r);if(n===0)return i;let a=K(e,i.terminalNodeId);if(!V(a)||!df(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return cm(e,i.terminalNodeId,n-1,i.visibleDepth)}function um(e,t,n){return V(K(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:Kf(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:U(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>Kf(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function dm(e,t){let n=K(e,t);if(!V(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||Gf(e,r)!==t}function fm(e,t){let n=K(e,t.terminalNodeId);if(V(n)){let r=G(e,t.terminalNodeId);if(df(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:lm(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=K(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=G(e,n),o=td(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return lm(e,s,0,i);dm(e,r)&&i--,r=n}}function pm(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function mm(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(Jp);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=Yp(o,y);let x,S=_;if(V(v))S=f?Kf(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:W(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&V(C)&&df(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function hm(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!V(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:W(e,f)};continue}let h=l?Kf(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=gm(e,g);let _=i[h];_!=null&&V(_)&&df(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function gm(e,t){let n=K(e,t.terminalNodeId),r=V(n)?_m(e,t):null,i=W(e,t.terminalNodeId),a=Hd(e.snapshot.segmentTable,n.nameId),o=V(n)&&G(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?qf(e,t.headNodeId).map(n=>{let r=K(e,n);return{isTerminal:n===t.terminalNodeId,name:Hd(e.snapshot.segmentTable,r.nameId),nodeId:n,path:W(e,n)}}):U(c,`store.getVisibleSlice.flatten.collectSegments`,()=>qf(e,t.headNodeId).map(n=>{let r=K(e,n);return{isTerminal:n===t.terminalNodeId,name:Hd(e.snapshot.segmentTable,r.nameId),nodeId:n,path:W(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:V(n)&&df(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:V(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function _m(e,t){if(t.headNodeId===t.terminalNodeId)return mf(e,t.terminalNodeId);let n=qf(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=mf(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}var vm=8;function ym(e){let{nodes:t,directories:n,rootId:r,options:i}=e,a=t.length,o=new Int32Array(a),s=new Int32Array(a),c=new Int32Array(a),l=new Int32Array(a),u=new Int32Array(a),d=new Int32Array(a),f=new Int32Array(a);for(let e=0;e<a;e+=1){let n=t[e];n!=null&&(o[e]=n.parentId,s[e]=n.nameId,c[e]=n.depthAndFlags,l[e]=n.subtreeNodeCount,u[e]=n.visibleSubtreeCount)}let p=0;for(let e of n.values())p+=e.childIds.length;let m=new Int32Array(p),h=0;for(let[e,t]of n){let n=t.childIds;d[e]=h,f[e]=n.length;for(let e=0;e<n.length;e+=1)m[h]=n[e],h+=1}return{nodeCount:a,rootId:r,flattenEmptyDirectories:i.flattenEmptyDirectories===!0,parentId:o,nameId:s,depthAndFlags:c,subtreeNodeCount:l,visibleSubtreeCount:u,childStart:d,childCount:f,childIdsFlat:m}}function bm(e){let{nodeCount:t,rootId:n,flattenEmptyDirectories:r,depthAndFlags:i,subtreeNodeCount:a,visibleSubtreeCount:o,childStart:s,childCount:c,childIdsFlat:l}=e;for(let e=t-1;e>=1;--e){if((i[e]&vm)===0)continue;let t=s[e],n=c[e],u=0,d=0;for(let e=0;e<n;e+=1){let n=l[t+e];u+=a[n],d+=o[n]}a[e]=1+u;let f;f=r&&n===1?(i[l[t]]&vm)===0?1+d:d:1+d,o[e]=f}let u=s[n],d=c[n],f=0,p=0;for(let e=0;e<d;e+=1){let t=l[u+e];f+=a[t],p+=o[t]}a[n]=1+f,o[n]=p}function xm(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!V(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&cd(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&V(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,cd(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function Sm(e){let{directories:t,nodes:n,rootId:r}=e.snapshot,i=ym(e.snapshot);bm(i);let a=i.subtreeNodeCount,o=i.visibleSubtreeCount;for(let e=0;e<n.length;e+=1){let t=n[e];t!=null&&(t.subtreeNodeCount=a[e],t.visibleSubtreeCount=o[e])}for(let[e,i]of t){let t=i.childIds,a=t.length,o=0,s=0;for(let e=0;e<a;e++){let r=t[e];if(r==null)continue;let i=n[r];o+=i.subtreeNodeCount,s+=i.visibleSubtreeCount}i.totalChildSubtreeNodeCount=o,i.totalChildVisibleSubtreeCount=s,(e===r||a>=128)&&cd(n,i)}}function Cm(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var wm=class e{#e;constructor(e={}){let t=Sd(e),n=U(t,`store.builder.create`,()=>new of(e));if(e.preparedInput!=null){let t=nf(e.preparedInput);t==null?n.appendPreparedPaths(tf(e.preparedInput),!1):n.appendPresortedPaths(t,rf(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(U(t,`store.preparePathEntries`,()=>af(r,e)))}let r=U(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=U(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=U(t,`store.state.create`,()=>sf(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:U(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||Cm(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&U(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?e.useSoaCountSweep===!0?U(t,`store.state.initializeOpenVisibleCountsViaSoa`,()=>Sm(this.#e)):U(t,`store.state.initializeOpenVisibleCounts`,()=>xm(this.#e)):U(t,`store.state.recomputeCounts`,()=>tp(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return Qd(e,t)}static prepareInput(e,t={}){return $d(e,t)}static preparePresortedInput(e){return ef(e)}list(e){return U(this.#e.instrumentation,`store.list`,()=>Jf(this.#e,e))}add(e){U(this.#e.instrumentation,`store.add`,()=>{let t=q(this.#e);Ff(this.#e,Nf(this.#e,t,Yf(this.#e,e)))})}remove(e,t={}){U(this.#e.instrumentation,`store.remove`,()=>{let n=q(this.#e);Ff(this.#e,Nf(this.#e,n,Xf(this.#e,e,t)))})}move(e,t,n={}){U(this.#e.instrumentation,`store.move`,()=>{let r=q(this.#e),i=Zf(this.#e,e,t,n);i!=null&&Ff(this.#e,Nf(this.#e,r,i))})}batch(e){Pf(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return U(this.#e.instrumentation,`store.getVisibleCount`,()=>q(this.#e))}getVisibleSlice(e,t){return U(this.#e.instrumentation,`store.getVisibleSlice`,()=>tm(this.#e,e,t))}getVisibleRowContext(e){return U(this.#e.instrumentation,`store.getVisibleRowContext`,()=>em(this.#e,e))}getVisibleTreeProjection(){return rm(this.#e)}getVisibleTreeProjectionData(e){return nm(this.#e,e)}getVisibleIndex(e){return U(this.#e.instrumentation,`store.getVisibleIndex`,()=>im(this.#e,e))}getPathInfo(e){return U(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=rp(this.#e,e);if(t==null)return null;let n=K(this.#e,t);return{depth:hd(n),kind:V(n)?`directory`:`file`,path:W(this.#e,t)}})}isExpanded(e){return U(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=K(this.#e,t);return df(this.#e,t,n)})}expand(e){U(this.#e.instrumentation,`store.expand`,()=>{let t=q(this.#e),n=am(this.#e,e);n!=null&&Ff(this.#e,Nf(this.#e,t,n))})}collapse(e){U(this.#e.instrumentation,`store.collapse`,()=>{let t=q(this.#e),n=om(this.#e,e);n!=null&&Ff(this.#e,Nf(this.#e,t,n))})}on(e,t){return xf(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return mf(this.#e,t)}markDirectoryUnloaded(e){U(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(G(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=q(this.#e);gf(this.#e,t),Ff(this.#e,Nf(this.#e,n,Df({affectedAncestorIds:np(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return U(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=q(this.#e),r=hf(this.#e,t);return Ff(this.#e,Nf(this.#e,n,Of({affectedAncestorIds:np(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return U(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||mf(this.#e,n)!==`loading`||!vf(this.#e,n,e.attemptId))return!1;let r=W(this.#e,n);this.validateChildPatch(r,t);let i=q(this.#e),a=[];for(let e of t.operations){Tm(r,e);let t=q(this.#e);switch(e.type){case`add`:a.push(Nf(this.#e,t,Yf(this.#e,e.path)));break;case`remove`:a.push(Nf(this.#e,t,Xf(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=Zf(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Nf(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return Ff(this.#e,Nf(this.#e,i,kf({affectedAncestorIds:np(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:W(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return U(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=q(this.#e),r=_f(this.#e,t,e.attemptId);return Ff(this.#e,Nf(this.#e,n,Af({affectedAncestorIds:np(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:W(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return U(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=q(this.#e),i=yf(this.#e,n,e.attemptId,t);return Ff(this.#e,Nf(this.#e,r,jf({affectedAncestorIds:np(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:W(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return U(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(Kp(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=q(this.#e),n=qp(this.#e,e.mode??`stable`);return Ff(this.#e,Nf(this.#e,t,Mf({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=G(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??Ed(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=Od(Fd(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!V(K(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=K(this.#e,n);df(this.#e,n,i)||(ff(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=K(this.#e,e);if(!df(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=rp(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!V(K(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!V(K(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=K(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=K(this.#e,e),r=Gf(this.#e,e);if(!df(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function Tm(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`)}}function Em(e,t={}){return wm.prepareInput(e,t)}var Dm={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function Om(e,t){if(typeof e==`number`)return{itemHeight:t??Dm.default.itemHeight,factor:e};let n=Dm[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var km=Dm.default.itemHeight,Am=`@layer base {
5157
+ </symbol>`],wu=[Tl,El,Ol,kl,Al,jl,Nl,Rl,zl,Ul,Xl,Zl,Ql,$l,eu,nu,au,ou,su,cu,lu,fu,pu,gu,_u,vu,yu,bu,xu,Su];function Tu(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
5158
+ `)}\n</svg>`)}var Eu=Tu(wl,Cu),Du={minimal:wl,standard:Eu,complete:Tu(Eu,wu)},Ou={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},ku={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},Au={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},ju=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),Mu=new Set([`complete`]);function Nu(e){return Du[e===`none`?`minimal`:e]}function Pu(e){return`file-tree-builtin-${e}`}function Fu(e){return e!==`none`&&Mu.has(e)}function Iu(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=Ou[t.toLowerCase()];if(i!=null&&(r||ju.has(i)))return i;for(let e of n){if(r){let t=Au[e];if(t!=null)return t}let t=ku[e];if(t!=null&&(r||ju.has(t)))return t}return`default`}var Lu=`file-tree-container`,Ru=`data-file-tree-style`,zu=`data-file-tree-unsafe-css`,Bu=`data-file-tree-scrollbar-measure`,Vu=`data-file-tree-scrollbar-gutter-measured`,Hu=`--trees-scrollbar-gutter-measured`,Uu=`header`,Wu=`context-menu`,Gu=`context-menu-trigger`;function Ku(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function qu(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(Ku(e)?`none`:`complete`),colored:e.colored??!0}}var Ju=e=>e.trim().toLowerCase(),Yu=e=>e.split(`/`).at(-1)??e,Xu=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function Zu(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function Qu(e){let t=qu(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(Ju(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let s=Yu(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return Zu(l,e);for(let[t,n]of a)if(c.includes(t))return Zu(n,e);let u=Xu(s);for(let t of u){let n=i.get(t);if(n!=null)return Zu(n,e)}let d=Iu(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return Zu(t,e)}return{name:Pu(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:Zu(s,e)}}}var $u=5,ed=32,td=128;function nd(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function rd(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function id(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function ad(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function od(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function sd(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function cd(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,fd(e,t)}function ld(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=ad(e).get(t);if(i===void 0)return;let a=i>>$u;e.childVisibleChunkSums[a]+=r}function ud(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=pd(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=ed}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function dd(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>$u;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<$u}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function fd(e,t){if(t.childIds.length<td){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/ed),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>$u]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function pd(e,t,n,r){let i=Math.min(t.childIds.length,n+ed),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var md=7,hd=3,gd=8,_d=4;function vd(e,t,n=0){return e<<_d|n<<hd|t}function yd(e){return e.depthAndFlags>>>_d}function bd(e){return(e.depthAndFlags&gd)>>hd}function V(e){return(e.depthAndFlags&gd)!==0}function xd(e){return e.depthAndFlags&md}function H(e,t){return(xd(e)&t)!==0}function Sd(e,t){e.depthAndFlags|=t}function Cd(e,t){e.depthAndFlags=vd(t,xd(e),bd(e))}var wd=Symbol(`benchmarkInstrumentation`);function Td(e,t){return t==null||Object.defineProperty(e,wd,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function Ed(e){return e==null?null:e[wd]??null}function U(e,t,n){return e==null?n():e.measurePhase(t,n)}function Dd(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function Od(e){return e>=48&&e<=57}function kd(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!Od(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&Od(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function Ad(e){let t=e.toLowerCase();return{lowerValue:t,tokens:kd(t)}}function jd(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function Md(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=jd(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function Nd(e,t,n){let r=Md(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function Pd(e,t){return Nd(e,t,Ad)}function Fd(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function Id(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=Fd(e,r);return a===Fd(t,r)?Pd(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Ld(e,t){return Id(e,t)}function Rd(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=Ad(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=Fd(e,n);return o===Fd(t,n)?Nd(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function zd(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=Ad(r);return e.sortKeyById[t]=i,i}function Bd(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function Vd(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function Hd(e){let{hasTrailingSlash:t,segments:n}=Vd(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function Ud(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=Vd(e);return{requiresDirectory:t,segments:n}}function Wd(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[Ad(``)]}}function Gd(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function Kd(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var qd=Symbol(`pathStorePreparedInputKind`);function Jd(e,t){return e[qd]=t,e}function Yd(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function Xd(e,t,n){return n==="default"?Ld(e,t):n(Yd(e),Yd(t))}function Zd(){return{depthAndFlags:vd(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function Qd(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function $d(e){return e.isDirectory?e.segments.length:e.segments.length-1}function ef(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function tf(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function nf(e,t={}){return lf(e,t).map(e=>e.path)}function rf(e,t={}){let n=lf(e,t);return Jd({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function af(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return Jd({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function of(e){let t=e,n=t.preparedPaths;if(t[qd]===`prepared`&&n!=null)return n;if(!ef(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function sf(e){let t=e;return t[qd]===`presorted`&&t.presortedPaths!=null||tf(t.presortedPaths)?t.presortedPaths:null}function cf(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function lf(e,t={}){let n=Bd(t),r=Ed(t);Dd(r,`workload.inputFiles`,e.length);let i=U(r,`store.preparePathEntries.parse`,()=>e.map(e=>Hd(e)));return U(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>Xd(e,t,n.sort))),i}var uf=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[Zd()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=Wd();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=Ed(e),this.options=Bd(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,nd())}appendPaths(e){return U(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>Hd(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,U(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return U(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:vd(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:vd(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d,m=a+1}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:vd(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=Hd(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:vd(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:vd(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=Hd(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(U(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||U(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?Rd(this.lastPreparedPath,e,this.segmentSortKeyCache):Xd(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=$d(e),i=n==null?0:$d(n),a=n==null?0:Qd(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=Gd(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:vd(yd(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),od(i,s),s}createFileChildUnchecked(e,t){let n=Gd(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:vd(yd(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),od(r,a),a}getOrCreateDirectoryChild(e,t){let n=Gd(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!V(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:vd(yd(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),od(r,a),this.directories.set(a,nd()),a}createDirectoryChild(e,t){let n=Gd(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:vd(yd(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),od(r,a),this.directories.set(a,nd()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!V(n))throw Error(`Path is not a directory: "${t}"`);if(H(n,1))throw Error(`Duplicate path: "${t}"`);Sd(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,rd());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(V(a)){let t=rd();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;V(n)&&this.directories.set(t,nd());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),od(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!V(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return cd(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function df(e,t=`closed`,n=null){let r=pf(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function ff(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function pf(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function mf(e,t){return H(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&yd(t)<=e.defaultExpansion}function hf(e,t,n=e.snapshot.nodes[t]){return n==null||!V(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:mf(e,n)}function gf(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!V(r))return;let i=mf(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function _f(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function vf(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function yf(e,t){let n=_f(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function bf(e,t){let n=_f(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function xf(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function Sf(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function Cf(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function wf(e,t){e.directoryLoadInfoById.delete(t)}function Tf(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Ef(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Df(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Of(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function kf(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Af(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function jf(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Mf(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function Nf(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Pf(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Ff(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function If(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function Lf(e,t,n){return{...n,visibleCountDelta:Jf(e)-t}}function Rf(e,t){let n=Jf(e),r=ff();e.transactionStack.push(r);try{t()}catch(t){throw Vf(e,r,!1),t}Vf(e,r,!0,Jf(e)-n)}function zf(e,t){let n=e.instrumentation;if(n==null){Bf(e,t);return}U(n,`store.events.record`,()=>Bf(e,t))}function Bf(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){Kf(e,t);return}n.events.push(t),Gf(n,t)}function Vf(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?Wf(i,t):U(n,`store.events.batch.merge`,()=>Wf(i,t));return}let a=Hf(t,r),o=e.instrumentation;if(o==null){Kf(e,a);return}U(o,`store.events.batch.commit`,()=>Kf(e,a))}function Hf(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function Uf(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function Wf(e,t){for(let n of t.events)e.events.push(n);Uf(e,t)}function Gf(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function Kf(e,t){let n=e.instrumentation;if(n==null){qf(e,t);return}U(n,`store.events.emit`,()=>qf(e,t))}function qf(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function Jf(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function Yf(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!V(n)||H(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!V(a)?null:i}function Xf(e,t){let n=t;for(;;){let t=Yf(e,n);if(t==null)return n;n=t}}function Zf(e,t){let n=[t],r=t;for(;;){let t=Yf(e,r);if(t==null)return n;n.push(t),r=t}}function Qf(e,t){let n=t==null?e.snapshot.rootId:sp(e,t);return n==null?[]:lp(e,n)}function $f(e,t){let n=Hd(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=wp(e,Cp(e,r)),{createdNodeIds:a,directoryId:o}=up(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=K(e,o);if(H(n,1))throw Error(`Path already exists: "${t}"`);Sd(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=fp(e,o,n.basename),s.add(c);ip(e,o);let l=wp(e,o);return Ef({affectedAncestorIds:op(e,c),affectedNodeIds:[...s],path:t,projectionChanged:Tp(i,l)})}function ep(e,t,n){let r=sp(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=K(e,r);if(H(i,2))throw Error(`The root node cannot be removed`);if(V(i)&&G(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=wp(e,a),s=xp(e,r);hp(e,a,r,i.nameId),Sp(e,a),ip(e,a);let c=wp(e,a);return Df({affectedAncestorIds:op(e,a),affectedNodeIds:s,path:t,projectionChanged:Tp(o,c),recursive:n.recursive===!0})}function tp(e,t,n,r){let i=sp(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=K(e,i);if(H(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=yp(e,i,n),c=wp(e,a.parentId),l=wp(e,s.parentId),u=Kd(e.snapshot.segmentTable,a.nameId),d=Gd(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(V(a)&&kp(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=id(e.snapshot.nodes,G(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&bp(e,p,o,bd(a))===`skip`)return null;let m=a.parentId;hp(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),Op(e,i),mp(e,s.parentId,i),Sp(e,m),e.pathCacheVersion++,ip(e,m),s.parentId!==m&&ip(e,s.parentId);let h=wp(e,m),g=wp(e,s.parentId);return Of({affectedAncestorIds:[...new Set([...op(e,m),...op(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:Ep([c,l],[h,g]),to:W(e,i)})}function np(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function rp(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function W(e,t){let n=K(e,t),r=np(e,t);if(r!=null)return r;if(H(n,2))return rp(e,t,``);let i=W(e,n.parentId),a=Kd(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return rp(e,t,V(n)?`${o}/`:o)}function ip(e,t){let n=e.instrumentation;if(n==null){jp(e,t);return}U(n,`store.recomputeCountsUpwardFrom`,()=>jp(e,t))}function ap(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!V(o)){Ap(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){Ap(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function op(e,t){let n=[],r=t;for(;r!=null;){let t=K(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function sp(e,t){if(t.length===0)return e.snapshot.rootId;let n=Ud(t);return cp(e,n.segments,n.requiresDirectory)}function cp(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=G(e,r),a=id(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=K(e,r);return n&&!V(i)?null:r}function G(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function K(e,t){let n=e.snapshot.nodes[t];if(n===void 0||H(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function lp(e,t){let n=e.snapshot.nodes[t];if(n===void 0||H(n,4))return[];if(!V(n))return[W(e,t)];if(G(e,t).childIds.length===0)return H(n,1)&&!H(n,2)?[W(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||H(n,4)){i.pop();continue}if(!V(n)){r.push(W(e,t.nodeId)),i.pop();continue}let a=G(e,t.nodeId);if(a.childIds.length===0){H(n,1)&&!H(n,2)&&r.push(W(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function up(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=Gd(e.snapshot.segmentTable,i),a=G(e,r),o=id(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!V(K(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=dp(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function dp(e,t,n){let r=K(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:vd(yd(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,nd()),mp(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function fp(e,t,n){let r=Gd(e.snapshot.segmentTable,n),i=G(e,t);if(id(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${Np(e,t,n)}"`);let a=K(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:vd(yd(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),mp(e,t,o),e.activeNodeCount++,o}function pp(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}gp(e,n,o)<0?i=a:r=a+1}return r}function mp(e,t,n){let r=G(e,t),i=K(e,n);id(e.snapshot.nodes,r).set(i.nameId,n),ld(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=pp(e,r,n);r.childIds.splice(a,0,n),sd(r,a),fd(e.snapshot.nodes,r)}function hp(e,t,n,r){let i=G(e,t),a=ad(i),o=a.get(n)??-1;id(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&ld(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),sd(i,o),fd(e.snapshot.nodes,i))}function gp(e,t,n){let r=e.snapshot.options.sort;return r==="default"?_p(e,t,n):r(vp(e,t),vp(e,n))}function _p(e,t,n){let r=K(e,t),i=K(e,n),a=V(r);if(a!==V(i))return a?-1:1;let o=Md(zd(e.snapshot.segmentTable,r.nameId),zd(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=Kd(e.snapshot.segmentTable,r.nameId),c=Kd(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function vp(e,t){let n=K(e,t),r=W(e,t),i=V(n),a=i?r.slice(0,-1):r;return{basename:Kd(e.snapshot.segmentTable,n.nameId),depth:yd(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function yp(e,t,n){let r=K(e,t),i=sp(e,n);if(i!=null){let t=K(e,i);if(V(t))return{basename:Kd(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=Ud(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=Ud(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:cp(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function bp(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${W(e,t)}"`);let i=K(e,t);if(bd(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(V(i)&&G(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return xp(e,t),hp(e,a,t,o),Sp(e,a),ip(e,a),`handled`}function xp(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=K(e,t.nodeId);if(t.visitedChildren||!V(i)){V(i)&&e.snapshot.directories.delete(t.nodeId),Sd(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),wf(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=G(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function Sp(e,t){let n=t;for(;n!=null;){let t=K(e,n);if(!V(t)||H(t,2)||G(e,n).childIds.length>0)return;Sd(t,1),n=t.parentId===n?null:t.parentId}}function Cp(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=id(e.snapshot.nodes,G(e,n)).get(t);if(i==null||!V(K(e,i)))break;n=i}return n}function wp(e,t){let n=Dp(e,t);if(n==null)return null;let r=Xf(e,n),i=K(e,r),a=n===r?null:Zf(e,n).map(t=>W(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:G(e,r).childIds.length>0,path:W(e,r),terminalKind:bd(i)})}function Tp(e,t){return Ep([e],[t])}function Ep(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function Dp(e,t){let n=t;for(;n!=null;){let t=K(e,n);if(!V(t)||H(t,2))return null;if(!hf(e,n,t))return n;n=t.parentId}return null}function Op(e,t){let n=K(e,t);if(Cd(n,(t===e.snapshot.rootId?-1:yd(K(e,n.parentId)))+1),!V(n))return;let r=G(e,t);for(let t of r.childIds)Op(e,t)}function kp(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=K(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function Ap(e,t,n=K(e,t),r=!1){let i=e.instrumentation;if(i==null){Mp(e,t,n,r);return}U(i,`store.recomputeNodeCounts`,()=>Mp(e,t,n,r))}function jp(e,t){let n=t;for(;n!=null;){let t=K(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(Ap(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&ld(G(e,s),n,a,o),n=s}}function Mp(e,t,n,r){if(!V(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=G(e,t);if(r){let t=e.instrumentation;t==null?cd(e.snapshot.nodes,i):U(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>cd(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,H(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=Yf(e,t)==null?hf(e,t,n)?1+o:1:o}function Np(e,t,n){let r=W(e,t);return r.length===0?n:`${r}${n}`}function Pp(e){return e!=null&&!H(e,4)}function Fp(e,t){let n=e.snapshot.nodes[t];return!Pp(n)||!V(n)||H(n,2)?null:n}function Ip(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&Pp(e.snapshot.nodes[n])&&(t+=1);return t}function Lp(e){return Math.max(0,e.valueById.length-1)}function Rp(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:Ip(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:Lp(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function zp(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function Bp(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)Fp(e,n)!=null&&t.push(W(e,n));for(let t of e.expandedDirectoryIds)Fp(e,t)!=null&&n.push(W(e,t));return{collapsedPaths:t,expandedPaths:n}}function Vp(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)Fp(e,n)!=null&&vf(e,n)!==`loaded`&&t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:W(e,n)});return t}function Hp(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=sp(e,n);t!=null&&gf(e,t,!0,K(e,t))}for(let n of t.collapsedPaths){let t=sp(e,n);t!=null&&gf(e,t,!1,K(e,t))}}function Up(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=sp(e,n.path);t!=null&&Fp(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function Wp(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function Gp(e){let t=e.snapshot.segmentTable,n=Wd();for(let r of e.snapshot.nodes)if(Pp(r)){if(H(r,2)){r.nameId=0;continue}r.nameId=Gd(n,Kd(t,r.nameId))}e.snapshot.segmentTable=n}function Kp(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!Pp(r)||!V(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return Pp(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[K(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),cd(e.snapshot.nodes,n)}}function qp(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(Pp(n))break;--t}e.snapshot.nodes.length=t+1}function Jp(e){let t=Bp(e),n=Vp(e);U(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>Wp(e)),U(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>Gp(e)),U(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>Kp(e)),U(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>qp(e)),U(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>Hp(e,t)),U(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>Up(e,n)),U(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>ap(e,e.snapshot.rootId))}function Yp(e){let t=Bp(e),n=Vp(e),r=U(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>Qf(e)),i=Td({...e.snapshot.options},e.instrumentation),a=U(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new uf(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,U(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>Hp(e,t)),U(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>Up(e,n)),U(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>ap(e,e.snapshot.rootId))}function Xp(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function Zp(e,t){let n=Rp(e);t===`stable`?U(e.instrumentation,`store.cleanup.stable`,()=>Jp(e)):U(e.instrumentation,`store.cleanup.aggressive`,()=>Yp(e));let r=Rp(e);return zp(t,t===`stable`,n,r)}var Qp=64;function $p(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function q(e){return K(e,e.snapshot.rootId).visibleSubtreeCount}function em(e,t,n,r){let i=K(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function tm(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:bm(e,t.cursor),setSize:t.setSize,subtreeEndIndex:em(e,t.cursor,t.index,n)}}function nm(e,t,n,r,i,a){let o=G(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=ud(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return rm(e,u,l,r+c,i+1,s,o.childIds.length,a)}function rm(e,t,n,r,i,a,o,s){if(!V(K(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=mm(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=K(e,c.terminalNodeId);if(!V(l)||!hf(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return nm(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function im(e,t){let n=q(e);if(t<0||t>=n)return null;let r=nm(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>W(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=tm(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:bm(e,r.cursor),setSize:r.setSize,subtreeEndIndex:em(e,r.cursor,r.index,n)}}function am(e,t,n){let r=e.instrumentation,i=q(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return ym(e,o+1);let t=[],n=dm(e,a);for(let r=a;r<=o&&n!=null;r++){let r=bm(e,n);t.push(r),n=gm(e,n)}return t}let s=[],c=0,l=0,u=U(r,`store.getVisibleSlice.selectFirstRow`,()=>dm(e,a));for(let t=a;t<=o&&u!=null;t++){let t=U(r,`store.getVisibleSlice.materializeRow`,()=>bm(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=U(r,`store.getVisibleSlice.advanceCursor`,()=>gm(e,u))}return Dd(r,`workload.visibleRowsRead`,s.length),Dd(r,`workload.flattenedRowsRead`,c),Dd(r,`workload.flattenedSegmentsRead`,l),s}function om(e,t=q(e)){let n=e.instrumentation;return n==null?vm(e,t):U(n,`store.getVisibleTreeProjection`,()=>vm(e,t))}function sm(e){return _m(om(e))}function cm(e,t){let n=sp(e,t);if(n==null||n===e.snapshot.rootId||V(K(e,n))&&Xf(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=K(e,i).parentId,n=G(e,t),s=ad(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=dd(a,n,s),t!==o){let n=K(e,t),a=Yf(e,t);if(!hf(e,t,n)&&a!==i)return null;Xf(e,t)===t&&(r+=1)}i=t}return r}function lm(e,t){let n=sp(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=K(e,n);if(!V(r))throw Error(`Path is not a directory: "${t}"`);return hf(e,n,r)?null:(gf(e,n,!0,r),ip(e,n),kf({affectedAncestorIds:op(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function um(e,t){let n=sp(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=K(e,n);if(!V(r))throw Error(`Path is not a directory: "${t}"`);return hf(e,n,r)?(gf(e,n,!1,r),ip(e,n),Af({affectedAncestorIds:op(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function dm(e,t){return t<0||t>=q(e)?null:fm(e,e.snapshot.rootId,t,-1)}function fm(e,t,n,r){let i=G(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?ud(e.snapshot.nodes,i,n):U(a,`store.getVisibleSlice.selectChildIndex`,()=>ud(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return pm(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function pm(e,t,n,r){if(!V(K(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=mm(e,t,r);if(n===0)return i;let a=K(e,i.terminalNodeId);if(!V(a)||!hf(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return fm(e,i.terminalNodeId,n-1,i.visibleDepth)}function mm(e,t,n){return V(K(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:Xf(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:U(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>Xf(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function hm(e,t){let n=K(e,t);if(!V(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||Yf(e,r)!==t}function gm(e,t){let n=K(e,t.terminalNodeId);if(V(n)){let r=G(e,t.terminalNodeId);if(hf(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:pm(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=K(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=G(e,n),o=ad(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return pm(e,s,0,i);hm(e,r)&&i--,r=n}}function _m(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function vm(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(Qp);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=$p(o,y);let x,S=_;if(V(v))S=f?Xf(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:W(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&V(C)&&hf(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function ym(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!V(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:W(e,f)};continue}let h=l?Xf(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=bm(e,g);let _=i[h];_!=null&&V(_)&&hf(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function bm(e,t){let n=K(e,t.terminalNodeId),r=V(n)?xm(e,t):null,i=W(e,t.terminalNodeId),a=Kd(e.snapshot.segmentTable,n.nameId),o=V(n)&&G(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?Zf(e,t.headNodeId).map(n=>{let r=K(e,n);return{isTerminal:n===t.terminalNodeId,name:Kd(e.snapshot.segmentTable,r.nameId),nodeId:n,path:W(e,n)}}):U(c,`store.getVisibleSlice.flatten.collectSegments`,()=>Zf(e,t.headNodeId).map(n=>{let r=K(e,n);return{isTerminal:n===t.terminalNodeId,name:Kd(e.snapshot.segmentTable,r.nameId),nodeId:n,path:W(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:V(n)&&hf(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:V(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function xm(e,t){if(t.headNodeId===t.terminalNodeId)return vf(e,t.terminalNodeId);let n=Zf(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=vf(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}var Sm=8;function Cm(e){let{nodes:t,directories:n,rootId:r,options:i}=e,a=t.length,o=new Int32Array(a),s=new Int32Array(a),c=new Int32Array(a),l=new Int32Array(a),u=new Int32Array(a),d=new Int32Array(a),f=new Int32Array(a);for(let e=0;e<a;e+=1){let n=t[e];n!=null&&(o[e]=n.parentId,s[e]=n.nameId,c[e]=n.depthAndFlags,l[e]=n.subtreeNodeCount,u[e]=n.visibleSubtreeCount)}let p=0;for(let e of n.values())p+=e.childIds.length;let m=new Int32Array(p),h=0;for(let[e,t]of n){let n=t.childIds;d[e]=h,f[e]=n.length;for(let e=0;e<n.length;e+=1)m[h]=n[e],h+=1}return{nodeCount:a,rootId:r,flattenEmptyDirectories:i.flattenEmptyDirectories===!0,parentId:o,nameId:s,depthAndFlags:c,subtreeNodeCount:l,visibleSubtreeCount:u,childStart:d,childCount:f,childIdsFlat:m}}function wm(e){let{nodeCount:t,rootId:n,flattenEmptyDirectories:r,depthAndFlags:i,subtreeNodeCount:a,visibleSubtreeCount:o,childStart:s,childCount:c,childIdsFlat:l}=e;for(let e=t-1;e>=1;--e){if((i[e]&Sm)===0)continue;let t=s[e],n=c[e],u=0,d=0;for(let e=0;e<n;e+=1){let n=l[t+e];u+=a[n],d+=o[n]}a[e]=1+u;let f;f=r&&n===1?(i[l[t]]&Sm)===0?1+d:d:1+d,o[e]=f}let u=s[n],d=c[n],f=0,p=0;for(let e=0;e<d;e+=1){let t=l[u+e];f+=a[t],p+=o[t]}a[n]=1+f,o[n]=p}function Tm(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!V(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&fd(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&V(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,fd(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function Em(e){let{directories:t,nodes:n,rootId:r}=e.snapshot,i=Cm(e.snapshot);wm(i);let a=i.subtreeNodeCount,o=i.visibleSubtreeCount;for(let e=0;e<n.length;e+=1){let t=n[e];t!=null&&(t.subtreeNodeCount=a[e],t.visibleSubtreeCount=o[e])}for(let[e,i]of t){let t=i.childIds,a=t.length,o=0,s=0;for(let e=0;e<a;e++){let r=t[e];if(r==null)continue;let i=n[r];o+=i.subtreeNodeCount,s+=i.visibleSubtreeCount}i.totalChildSubtreeNodeCount=o,i.totalChildVisibleSubtreeCount=s,(e===r||a>=128)&&fd(n,i)}}function Dm(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var Om=class e{#e;constructor(e={}){let t=Ed(e),n=U(t,`store.builder.create`,()=>new uf(e));if(e.preparedInput!=null){let t=sf(e.preparedInput);t==null?n.appendPreparedPaths(of(e.preparedInput),!1):n.appendPresortedPaths(t,cf(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(U(t,`store.preparePathEntries`,()=>lf(r,e)))}let r=U(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=U(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=U(t,`store.state.create`,()=>df(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:U(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||Dm(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&U(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?e.useSoaCountSweep===!0?U(t,`store.state.initializeOpenVisibleCountsViaSoa`,()=>Em(this.#e)):U(t,`store.state.initializeOpenVisibleCounts`,()=>Tm(this.#e)):U(t,`store.state.recomputeCounts`,()=>ap(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return nf(e,t)}static prepareInput(e,t={}){return rf(e,t)}static preparePresortedInput(e){return af(e)}list(e){return U(this.#e.instrumentation,`store.list`,()=>Qf(this.#e,e))}add(e){U(this.#e.instrumentation,`store.add`,()=>{let t=q(this.#e);zf(this.#e,Lf(this.#e,t,$f(this.#e,e)))})}remove(e,t={}){U(this.#e.instrumentation,`store.remove`,()=>{let n=q(this.#e);zf(this.#e,Lf(this.#e,n,ep(this.#e,e,t)))})}move(e,t,n={}){U(this.#e.instrumentation,`store.move`,()=>{let r=q(this.#e),i=tp(this.#e,e,t,n);i!=null&&zf(this.#e,Lf(this.#e,r,i))})}batch(e){Rf(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return U(this.#e.instrumentation,`store.getVisibleCount`,()=>q(this.#e))}getVisibleSlice(e,t){return U(this.#e.instrumentation,`store.getVisibleSlice`,()=>am(this.#e,e,t))}getVisibleRowContext(e){return U(this.#e.instrumentation,`store.getVisibleRowContext`,()=>im(this.#e,e))}getVisibleTreeProjection(){return sm(this.#e)}getVisibleTreeProjectionData(e){return om(this.#e,e)}getVisibleIndex(e){return U(this.#e.instrumentation,`store.getVisibleIndex`,()=>cm(this.#e,e))}getPathInfo(e){return U(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=sp(this.#e,e);if(t==null)return null;let n=K(this.#e,t);return{depth:yd(n),kind:V(n)?`directory`:`file`,path:W(this.#e,t)}})}isExpanded(e){return U(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=K(this.#e,t);return hf(this.#e,t,n)})}expand(e){U(this.#e.instrumentation,`store.expand`,()=>{let t=q(this.#e),n=lm(this.#e,e);n!=null&&zf(this.#e,Lf(this.#e,t,n))})}collapse(e){U(this.#e.instrumentation,`store.collapse`,()=>{let t=q(this.#e),n=um(this.#e,e);n!=null&&zf(this.#e,Lf(this.#e,t,n))})}on(e,t){return Tf(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return vf(this.#e,t)}markDirectoryUnloaded(e){U(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(G(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=q(this.#e);bf(this.#e,t),zf(this.#e,Lf(this.#e,n,jf({affectedAncestorIds:op(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return U(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=q(this.#e),r=yf(this.#e,t);return zf(this.#e,Lf(this.#e,n,Mf({affectedAncestorIds:op(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return U(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||vf(this.#e,n)!==`loading`||!Sf(this.#e,n,e.attemptId))return!1;let r=W(this.#e,n);this.validateChildPatch(r,t);let i=q(this.#e),a=[];for(let e of t.operations){km(r,e);let t=q(this.#e);switch(e.type){case`add`:a.push(Lf(this.#e,t,$f(this.#e,e.path)));break;case`remove`:a.push(Lf(this.#e,t,ep(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=tp(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Lf(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return zf(this.#e,Lf(this.#e,i,Nf({affectedAncestorIds:op(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:W(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return U(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=q(this.#e),r=xf(this.#e,t,e.attemptId);return zf(this.#e,Lf(this.#e,n,Pf({affectedAncestorIds:op(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:W(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return U(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=q(this.#e),i=Cf(this.#e,n,e.attemptId,t);return zf(this.#e,Lf(this.#e,r,Ff({affectedAncestorIds:op(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:W(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return U(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(Xp(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=q(this.#e),n=Zp(this.#e,e.mode??`stable`);return zf(this.#e,Lf(this.#e,t,If({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=G(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??Ad(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=Md(zd(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!V(K(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=K(this.#e,n);hf(this.#e,n,i)||(gf(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=K(this.#e,e);if(!hf(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=sp(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!V(K(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!V(K(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=K(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=K(this.#e,e),r=Yf(this.#e,e);if(!hf(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function km(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`)}}function Am(e,t={}){return Om.prepareInput(e,t)}var jm={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function Mm(e,t){if(typeof e==`number`)return{itemHeight:t??jm.default.itemHeight,factor:e};let n=jm[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var Nm=jm.default.itemHeight,Pm=`@layer base {
5112
5159
  :host {
5113
5160
  --trees-accent: var(--trees-accent-override, #009fff);
5114
5161
  --trees-fg: var(--trees-fg-override, var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1)));
@@ -6200,13 +6247,13 @@ slicc-dock-tree .dock-tree__preview--active {
6200
6247
  }
6201
6248
 
6202
6249
  @layer theme, unsafe;
6203
- `,jm=`@layer base, unsafe;`;function Mm(e){return`${jm}
6250
+ `,Fm=`@layer base, unsafe;`;function Im(e){return`${Fm}
6204
6251
  @layer base {
6205
6252
  ${e}
6206
- }`}function Nm(e){return`${jm}
6253
+ }`}function Lm(e){return`${Fm}
6207
6254
  @layer unsafe {
6208
6255
  ${e}
6209
- }`}var Pm=new WeakMap;function Fm(e){let t=Pm.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(Iu,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),Pm.set(e,i),i}function Im(e,t){if(!e.isConnected)return;let n=Fm(t);if(n==null)return;let r=t.querySelector(`style[${Lu}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(Lu,``),t.appendChild(i)),i.textContent=`:host { ${Ru}: ${n}px; }`}var Lm;function Rm(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){Lm??(Lm=new CSSStyleSheet,Lm.replaceSync(Mm(Am)));let t=!1;try{e.adoptedStyleSheets=[Lm],t=!0}catch{}if(t){e.querySelector(`style[${Pu}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(Pu,``),t.textContent=Mm(Am),e.prepend(t)}}function zm(e,t){Bm(e,t),Rm(t),Im(e,t)}function Bm(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});zm(this,e)}}if(customElements.define(Nu,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(Nu)))e instanceof HTMLElement&&zm(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var Vm=e=>e.startsWith(`f::`)?e.slice(3):e;function Hm(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function Um(e,t){return e===``?t:`${e}/${t}`}function Wm({files:e,path:t,isFolder:n,nextBasename:r}){let i=Vm(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=Hm(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=Um(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function Gm(e){return e.endsWith(`/`)}function Km(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function qm(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function Jm(e,t){return t.includes(e)?qm(t):[e]}function Ym(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function Xm(e,t){return{draggedPaths:e,target:t}}function Zm(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(Gm(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function Qm(e,t){return t.kind===`root`||t.directoryPath==null?Km(e):t.directoryPath}function $m(e,t){let n=e.map(e=>{let n=Qm(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function eh(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function th(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!eh(wm.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function nh(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function rh(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function ih(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function ah(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return ih(e,t.path)?n?e:null:e;case`move`:return rh(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=ah(r,e,n),r==null)return null;return r}}}function oh(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function sh(e){switch(e.operation){case`add`:return{...oh(e),operation:`add`,path:e.path};case`remove`:return{...oh(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...oh(e),from:e.from,operation:`move`,to:e.to}}}function ch(e){return{...oh(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>sh(e)),operation:`batch`}}function lh(e){switch(e.operation){case`add`:case`remove`:case`move`:return sh(e);case`batch`:return ch(e);default:return null}}function uh(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function dh(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function fh(e){return dh(e).at(-1)??null}function ph(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function mh(e){return e.endsWith(`/`)}var hh=e=>e.toLowerCase();function gh(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function _h(e){return e.endsWith(`/`)?e.slice(0,-1):e}function vh(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var yh=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},bh=Symbol(`FILE_TREE_RENAME_VIEW`),xh=512,Sh=512;function Ch(e){return e===`top`||e===`center`?e:`nearest`}function wh(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=dh(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function Th(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:wh(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var Eh=class e{static{Object.defineProperty(e.prototype,bh,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=th({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=fh(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:Ch(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=Sh){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=Jm(t,n);return this.#r.canDrag?.(r)!==!1&&(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=Xm(t.draggedPaths,n);(Zm(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}Ym(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=Xm(e.draggedPaths,t);if(Zm(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=$m(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=mh(r),a=_h(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of dh(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=gh(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,mh(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,mh(e)?{recursive:!0}:void 0);return}let t=mh(e),n=Wm({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:_h(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(vh(n.sourcePath,t),vh(n.destinationPath,t))}#Y(e){this.#T!=null&&this.#E!==e&&(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=th({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!uh(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=fh(e),n=ph(e,t),r=null,i=null;for(let e of this.#be()){if(fh(e)!==t)continue;let a=ph(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=dh(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!uh(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new wm({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of dh(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(hh),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(hh),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of dh(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:yh(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of dh(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of dh(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=Th(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,xh)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s!==e||this.#c!==n)&&(this.#s=e,this.#c=n,t&&this.#De())}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=ah(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=ah(this.#c,e,!0),r=[...this.#B].map(t=>ah(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=ah(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return uh(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&nh(e)&&(this.#i=null);let t=nh(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=lh(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},Dh=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function Oh(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(e[t]!==`/`&&t!==e.length){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function kh(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function Ah(e,t){return t?`${e}/`:e}function jh(e,t=null){let n=Dh(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=Nh(t);e!=null&&Ih({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function Mh(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=Ph(e);t!=null&&(c=Fh({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=Nh(e);t!=null&&(c=Ih({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:zh(i),statusByPath:i}:e}function Nh(e){return Ph(e.path)}function Ph(e){let t=Oh(e);if(t!=null)return{canonicalPath:Ah(t.path,t.isDirectory),isDirectory:t.isDirectory}}function Fh({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),Rh(t,n,e),!0)}function Ih({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??Lh(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function Lh(e,t,n){for(let r of kh(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function Rh(e,t,n){for(let r of kh(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function zh(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var J,Bh,Vh,Hh,Uh,Wh,Gh,Kh,qh,Jh,Yh={},Xh=[],Zh=Array.isArray,Qh=Xh.slice,$h=Object.assign;function eg(e){e&&e.parentNode&&e.remove()}function tg(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?Qh.call(arguments,2):n),ng(e,o,r,i,null)}function ng(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Bh,__i:-1,__u:0};return i==null&&J.vnode!=null&&J.vnode(a),a}function rg(e){return e.children}function ig(e,t){this.props=e,this.context=t,this.__g=0}function ag(e,t){if(t==null)return e.__?ag(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?ag(e):null}function og(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return og(e)}}function sg(e){(8&e.__g||!(e.__g|=8)||!Vh.push(e)||Uh++)&&Hh==J.debounceRendering||((Hh=J.debounceRendering)||queueMicrotask)(cg)}function cg(){for(var e,t,n,r,i,a,o,s,c=1;Vh.length;)Vh.length>c&&Vh.sort(Wh),e=Vh.shift(),c=Vh.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=$h({},r)).__v=r.__v+1,J.vnode&&J.vnode(n),gg(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??ag(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,vg(a,n,o),n.__e!=i&&og(n)));Uh=0}function lg(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||Xh,b=t.length;for(c=ug(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?Yh:y[m.__i]||Yh,m.__i=f,_=gg(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&xg(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=dg(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function ug(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?ng(null,o,null,null,null):Zh(o)?ng(rg,{children:o},null,null,null):o.constructor==null&&o.__b>0?ng(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=fg(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=ag(s)),Sg(s,s));return r}function dg(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=dg(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=ag(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function fg(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function pg(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function mg(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||pg(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||pg(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(Gh,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=Kh,e.addEventListener(t,a?Jh:qh,a)):e.removeEventListener(t,a?Jh:qh,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function hg(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=Kh++;else if(t.u<n.l)return;return n(J.event?J.event(t):t)}}}function gg(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,ee,te,w,T,E,ne,re,ie,D=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=J.__b)&&d(t);n:if(typeof D==`function`)try{if(v=t.props,y=`prototype`in D&&D.prototype.render,b=(d=D.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new D(v,x):(t.__c=f=new ig(v,x),f.constructor=D,f.render=Cg),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&D.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=$h({},f.__s)),$h(f.__s,D.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&D.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&D.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=J.__r,ee=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),te=0;te<f._sb.length;te++)f.__h.push(f._sb[te]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++ee<25);f.state=f.__s,f.getChildContext!=null&&(r=$h({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),w=d,d!=null&&d.type===rg&&d.key==null&&(w=yg(d.props.children)),s=lg(e,Zh(w)?w:[w],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(T=0,E=!1,t.__u|=c?160:128,t.__c.__z=[],ne=0;ne<a.length;ne++)(re=a[ne])==null||E||(re.nodeType==8&&re.data==`$s`?(T>0&&t.__c.__z.push(re),T++,a[ne]=null):re.nodeType==8&&re.data==`/$s`?(--T>0&&t.__c.__z.push(re),E=T===0,s=a[ne],a[ne]=null):T>0&&(t.__c.__z.push(re),a[ne]=null));if(!E){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(ie=a.length;ie--;)eg(a[ie]);_g(t)}else t.__e=n.__e,t.__k=n.__k,e.then||_g(t);J.__e(e,t,n)}else s=t.__e=bg(n.__e,t,n,r,i,a,o,c,l,u);return(d=J.diffed)&&d(t),128&t.__u?void 0:s}function _g(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(_g)}function vg(e,t,n){for(var r=0;r<n.length;r++)xg(n[r],n[++r],n[++r]);J.__c&&J.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){J.__e(e,t.__v)}})}function yg(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:Zh(e)?e.map(yg):$h({},e)}function bg(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(J.__m&&J.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=Qh.call(e.childNodes),v=n.props||Yh,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;mg(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||mg(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),lg(b==`template`?e.content:e,Zh(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&ag(n,0),s,c,l),a!=null)for(u=a.length;u--;)eg(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||mg(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&mg(e,u,g,v[u],i))}return e}function xg(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){J.__e(e,n)}}function Sg(e,t,n){var r,i;if(J.unmount&&J.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||xg(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){J.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Sg(r[i],t,n||typeof e.type!=`function`);n||eg(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function Cg(e,t,n){return this.constructor(e,n)}function wg(e,t){var n,r,i,a;t==document&&(t=document.documentElement),J.__&&J.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=tg(rg,null,[e]),i=[],a=[],gg(t,e,r||Yh,Yh,t.namespaceURI,r?null:t.firstChild?Qh.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),vg(i,e,a)}function Tg(e,t){e.__u|=32,wg(e,t)}J={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw Uh=0,e}},Bh=0,ig.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$h({},this.state);typeof e==`function`&&(e=e($h({},n),this.props)),e&&$h(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),sg(this))},ig.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),sg(this))},ig.prototype.render=rg,Vh=[],Uh=0,Wh=function(e,t){return e.__v.__b-t.__v.__b},Gh=/(PointerCapture)$|Capture$/i,Kh=0,qh=hg(!1),Jh=hg(!0);var Eg=0;Array.isArray;function Y(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Eg,__i:-1,__u:0,__source:i,__self:a};return J.vnode&&J.vnode(l),l}var Dg=16,Og=16,kg={};function Ag({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=kg[e]??{width:Dg,height:Og},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return Y(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:Y(`use`,{href:c})})}var jg=e=>e!==void 0&&/\s/.test(e),Mg=(e,t)=>{let n=t=>jg(e[t-1])||jg(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},Ng=e=>Mg(e,Math.ceil(e.length/2)),Pg=e=>{if(e.length<2)return[e,``];let t=Ng(e);return[e.slice(0,t),e.slice(t)]},Fg=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Ng(e);return[e.slice(0,r),e.slice(r)]},Ig=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},Lg=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},Rg=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},zg=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function Bg({children:e,marker:t,variant:n=`default`}){"use no memo";return Y(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:Y(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?Y(`span`,{"data-truncate-fade":!0}):t})})}function Vg(e){"use no memo";let{mode:t,children:n}=e;return Y(`div`,{children:[Y(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?Y(`span`,{children:n}):n}),Y(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?Y(`span`,{children:n}):n})]})}function Hg({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=Y(Vg,{mode:t,children:e},`content`),o=Y(Bg,{marker:n,mode:t,variant:r},`marker`),s=Y(`div`,{"data-truncate-fill":!0},`fill`);return Y(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:Y(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function Ug({children:e,...t}){"use no memo";return Y(Hg,{mode:`truncate`,...t,children:e})}function Wg({children:e,...t}){"use no memo";return Y(Hg,{mode:`fruncate`,...t,children:e})}function Gg({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=Y(Ug,{...s,children:t[0]}),l=Y(Wg,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return Y(`div`,{className:a,style:o});if(e.length<i)return Y(n===`end`?Wg:Ug,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=Pg:r===`extension`?t=Fg:r===`leaf-path`&&(t=Ig);else if(typeof r==`number`)t=Lg,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=Rg:e===`first`&&(t=zg)}else typeof r==`function`&&(t=r);t??=Pg;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=Y(Ug,{...s,..._,children:f}),l=Y(Wg,{...s,...v,children:p})}return Y(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[Y(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),Y(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var Kg={endIndex:-1,startIndex:-1};function qg(e,t,n){return Math.min(Math.max(e,t),n)}function Jg(e,t){return e<0||t<e?Kg:{endIndex:t,startIndex:e}}function Yg(e){return e.startIndex<0||e.endIndex<e.startIndex}function Xg(e,t){return Yg(e)?0:(e.endIndex-e.startIndex+1)*t}function Zg(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function Qg(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function $g(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function e_(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function t_(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function n_(e,t,n){if(e.length===0||t<=0)return[];let r=t_(e),i=$g(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=e_(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function r_(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=qg(t.scrollTop,0,o),c=t.stickyRows??n_(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=Zg(s,n,t.itemHeight),m=Zg(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?Kg:Jg(m,Qg(u+d,n,t.itemHeight)),y=g+1,b=Yg(v)?Kg:Jg(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=Xg(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:Yg(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var i_={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},a_={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},o_=`Contains git status items`;function s_(e){return e.current?!0:(e.current=!0,!1)}function c_(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function l_(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return c_({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function u_(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function d_(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function f_(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function p_(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function m_(e,t){return e!=null&&e>0?e:t}function h_(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function g_(e,t,n,r,i=0){let a=c_({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function __(e,t,n,r,i,a,o=0){let s=l_({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function v_(e,t,n,r,i,a){let o=u_({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function y_(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function b_(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function x_({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return Y(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function S_(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function C_(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var w_,X,T_,E_,D_=Object.is,O_=0,k_=[],Z=J,A_=Z.__b,j_=Z.__r,M_=Z.diffed,N_=Z.__c,P_=Z.unmount,F_=Z.__;function I_(e,t){Z.__h&&Z.__h(X,e,O_||t),O_=0;var n=X.__H||(X.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function L_(e){return O_=1,R_(J_,e)}function R_(e,t,n){var r=I_(w_++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):J_(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);D_(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=X,!X.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,D_(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};X.__f=!0;var a=X.shouldComponentUpdate,o=X.componentWillUpdate;X.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},X.shouldComponentUpdate=i}return r.__N||r.__}function z_(e,t){var n=I_(w_++,3);!Z.__s&&q_(n.__H,t)&&(n.__=e,n.u=t,X.__H.__h.push(n))}function B_(e,t){var n=I_(w_++,4);!Z.__s&&q_(n.__H,t)&&(n.__=e,n.u=t,X.__h.push(n))}function Q(e){return O_=5,V_(function(){return{current:e}},[])}function V_(e,t){var n=I_(w_++,7);return q_(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function $(e,t){return O_=8,V_(function(){return e},t)}function H_(){for(var e;e=k_.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(G_),e.__H.__h.forEach(K_),e.__H.__h=[]}catch(t){e.__H.__h=[],Z.__e(t,e.__v)}}Z.__b=function(e){X=null,A_&&A_(e)},Z.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),F_&&F_(e,t)},Z.__r=function(e){j_&&j_(e),w_=0;var t=(X=e.__c).__H;t&&(T_===X?(t.__h=[],X.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(G_),t.__h.forEach(K_),t.__h=[],w_=0)),T_=X},Z.diffed=function(e){M_&&M_(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(k_.push(t)!==1&&E_===Z.requestAnimationFrame||((E_=Z.requestAnimationFrame)||W_)(H_)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),T_=X=null},Z.__c=function(e,t){t.some(function(e){try{e.__h.forEach(G_),e.__h=e.__h.filter(function(e){return!e.__||K_(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],Z.__e(n,e.__v)}}),N_&&N_(e,t)},Z.unmount=function(e){P_&&P_(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{G_(e)}catch(e){t=e}}),n.__H=void 0,t&&Z.__e(t,n.__v))};var U_=typeof requestAnimationFrame==`function`;function W_(e){var t,n=function(){clearTimeout(r),U_&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);U_&&(t=requestAnimationFrame(n))}function G_(e){var t=X,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),X=t}function K_(e){var t=X;e.__c=e.__(),X=t}function q_(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!D_(t,e[n])})}function J_(e,t){return typeof t==`function`?t(e):t}function Y_(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:Y(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return Y(rg,{children:[Y(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:Y(Ug,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function X_(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function Z_(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function Q_(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function $_({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=r_(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:Q_(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?Q_(u,1,t,o):i&&r<=0&&c.length>0?n_(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var ev=400,tv=40,nv=18;function rv(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?iv(e,t,n):a instanceof HTMLElement?a:null}function iv(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function av(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function ov(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function sv(){return navigator.vendor!==`Apple Computer, Inc.`}function cv(e,t){let n=e-t.top;if(n<tv)return-Math.ceil((tv-Math.max(0,n))/tv*nv);let r=t.bottom-e;return r<tv?Math.ceil((tv-Math.max(0,r))/tv*nv):0}function lv(e,t){if(e!=null){let t=i_[e];return t==null?null:{text:t,title:a_[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:o_}:null}function uv(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function dv(e){return e!=null&&`toggle`in e}function fv(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function pv(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function mv(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function hv(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function gv(e,t){return t&&hv(e)||(e.ctrlKey||e.metaKey)&&fv(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var _v=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function vv(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function yv(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function bv(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function xv(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function Sv(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function Cv(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function wv(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function Tv(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function Ev(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=Tv(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function Dv(e,t){return{kind:e.kind,name:Z_(e),path:t}}function Ov(e){return e==null?void 0:`${e}__tree`}function kv(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function Av(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function jv(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?Y(`span`,{title:e.title,children:e.text}):Y(`span`,{title:e.title,children:e.parts.map((e,t)=>Y(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?Av(e.icon)?t(e.icon):{name:e.icon}:Av(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return Y(`span`,{title:e.title,children:Y(Ag,{...n})})}function Mv(e){e!=null&&d_(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function Nv(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=X_(e);return Y(rg,{children:[e.depth>0?Y(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>Y(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,Y(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?Y(Ag,{...t(`file-tree-icon-chevron`)}):Y(Ag,{...t(`file-tree-icon-file`,u)})}),Y(`div`,{"data-item-section":`content`,children:e.isFlattened?Y_(e,c,a):c??Y(Gg,{minimumLength:5,split:`extension`,children:e.name})}),i?Y(`div`,{"data-item-section":`decoration`,children:r==null?null:jv(r,t)}):null,s?Y(`div`,{"data-item-section":`git`,children:jv(o,t)}):null,n?Y(`div`,{"data-item-section":`action`,children:l?Y(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:Y(Ag,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function Pv(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:ee,contextMenuButtonVisibility:te,contextMenuRightClickEnabled:w,registerRenameInput:T,registerButton:E,resolveIcon:ne,renderDecorationForRow:re,openContextMenuForRow:ie,onRowClick:D,onKeyDown:ae}=e,O=X_(t),{isParked:oe=!1,mode:se=`flow`,style:ce}=r,le=se===`sticky`,ue=_?.get(O)??null??uv(t.ancestorPaths,v,y),de=t.kind===`directory`&&(b?.has(O)??!1),fe=re(t,O),pe=lv(ue,de),me=S&&ee,k=fe!=null||x||me,he=me&&te===`always`,ge=a.getPath()===O,_e=ge?a.getValue():``,ve=le||!ge?null:Y(x_,{ref:T,ariaLabel:`Rename ${Z_(t)}`,isFlattened:t.isFlattened,value:_e,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ye=Nv(t,ne,{actionLaneEnabled:me,customDecoration:fe,decorationLaneEnabled:k,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:pe,gitLaneActive:x,renameInput:ve,showDecorativeActionAffordance:he}),be={...S_({ariaLabel:Z_(t),domId:t.isFocused?kv(h,O,oe):void 0,extraStyle:ce,features:{actionLaneEnabled:me,contextMenuButtonVisibility:me?te:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:oe,itemHeight:g,mode:se,row:t,state:{containsGitChange:de,effectiveGitStatus:ue,isContextHovered:s===O,isDragTarget:l?.kind===`directory`&&l.directoryPath===O,isDragging:c?.has(O)===!0,isFocusRinged:t.isFocused&&o===O},targetPath:O}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),w&&(i.focusMountedPathFromInput(O),ie(t,O,{anchorRect:bv(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:le?void 0:()=>{i.focusMountedPathFromInput(O)},onKeyDown:le?void 0:ae,ref:e=>{E(O,e)}};return!le&&ge?Y(`div`,{...be,children:ye}):Y(`button`,{...be,type:`button`,draggable:u&&!oe,onDragEnd:u&&!oe?p:void 0,onDragStart:u&&!oe?e=>{f(e,t,O)}:void 0,onMouseDown:e=>{if(le){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!oe?e=>{m(e,t,O)}:void 0,onClick:e=>{D(e,t,O,se)},children:ye})}function Fv(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(X_(e))).map((n,r)=>Pv(e,n,t.start+r))}function Iv({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=km,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=Q(null),v=Q(null),y=Q(!1),b=Q(null),x=Q(null),S=Q(null),C=Q(null),ee=Q(null),te=Q(new Map),w=Q(new Map),T=Q(()=>{}),E=Q(null),ne=Q(0),re=Q(!1),ie=Q(null);ie.current!==t&&(re.current=!1,ie.current=t);let D=Q(!1),ae=Q(null),O=Q(null),oe=Q(!1),se=Q(null),ce=Q(null),le=Q(null),ue=Q(null),de=Q(null),fe=Q(null),pe=Q(null),me=Q(null),k=Q(!1),he=Q(null),ge=Q(null),_e=Q(null),ve=Q(null),ye=V_(()=>new Map,[]),[,be]=L_(0),xe=Q(!1),[Se,Ce]=L_(null),[A,we]=L_(null),[j,M]=L_(null),[Te,Ee]=L_(null),[De,Oe]=L_(0),[N,ke]=L_(null),Ae=Q(N);Ae.current=N;let je=Q(null),Me=Q(null),Ne=Q(null),Pe=Q(null),Fe=Q(null),Ie=Q(!1),Le=()=>{Me.current=null,Ne.current=null,Pe.current=null},Re=(e,t)=>{Me.current=e,Ne.current=null,Pe.current=t==null?null:{path:e,scrollTop:t}},ze=(e,t)=>{Me.current=null,Ne.current={path:e,viewportOffset:t},Pe.current=null},Be=Q(d===`retain`&&t.isSearchOpen()),[Ve,He]=L_(p);z_(()=>{p||He(!1)},[p]);let Ue=Q(!1),We=$(()=>{Ue.current=!0,He(e=>e&&!1)},[]),[Ge,Ke]=L_(()=>$_({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[qe,Je]=L_(!1);z_(()=>{Je(!0)},[]);let Ye=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Xe=e?.contextMenu?.triggerMode??(Ye?`right-click`:`both`),Ze=Xe===`both`||Xe===`button`,Qe=e?.contextMenu?.buttonVisibility??`when-needed`,$e=Xe===`both`||Xe===`right-click`;B_(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Fe.current=t,we(t),Ee(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Ie.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let et=$((e,t)=>{Sv(te.current,e,t)},[]),tt=$((e,t)=>{Sv(w.current,e,t)},[]),nt=$(e=>{x.current=e},[]),rt=$(e=>Cv(e,w.current,te.current),[]),it=n!=null||r!=null||i!=null,{resolveIcon:at}=V_(()=>Ju(a),[a]),ot=t[bh](),st=ot.getPath(),ct=st!=null,lt=t.isSearchOpen(),ut=t.getSearchValue(),P=t.getFocusedPath(),F=t.getFocusedIndex(),dt=t.getScrollRequest(),ft=t.isDragAndDropEnabled(),pt=t.getDragSession(),mt=V_(()=>pt==null?null:new Set(pt.draggedPaths),[pt]),ht=pt?.target??null,gt=pt?.primaryPath??null,_t=Ov(o),{overlayHeight:vt,overlayRows:yt,snapshot:I,visibleRows:bt}=Ge,L=I.physical.viewportHeight,xt=V_(()=>({end:I.window.endIndex,start:I.window.startIndex}),[I.window.endIndex,I.window.startIndex]),St=yt,Ct=I.sticky.rows,wt=I.physical.totalHeight,Tt=I.sticky.height,Et=V_(()=>new Set(Ct.map(e=>X_(e.row))),[Ct]),Dt=F>=0&&F>=xt.start&&F<=xt.end,Ot=$((e,t)=>u?.({item:Dv(e,t),row:e})??null,[u]),kt=$(e=>d_(e==null?null:te.current.get(e)??null)?!0:d_(S.current),[]),At=$(e=>{kt(t.focusNearestPath(e))},[t,kt]),jt=Q(At);jt.current=At;let Mt=Q(!0),Nt=Q(()=>{}),Pt=$((t=!0)=>{let n=Ae.current;n!=null&&(Mt.current=Mt.current&&t,ke(null),e?.contextMenu?.onClose?.(),Mt.current&&At(n.path))},[e?.contextMenu,At]);Nt.current=Pt;let Ft=$(e=>{let t=e==null?null:xv(S.current,e);M(e=>e===t?e:t)},[]),It=$((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=rt(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Re(n,e?.scrollTop??null),D.current=!0,Ce(e=>e===n?e:n)}i.focus(),Ft(a),Mt.current=!0,ke({anchorRect:r?.anchorRect??null,item:Dv(e,n),path:n,source:r?.source??`keyboard`})},[t,rt,Ft]),Lt=$(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=p_(e,L);se.current=F<0||e==null?null:Math.max(0,Math.min(F*s-e.scrollTop,Math.max(0,t-s))),oe.current=!0}t.startRenaming(e)!==!1&&(Ee(`focus`),be(e=>e+1))}},[t,F,s,l,L]),Rt=$((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=p_(i,L),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:$_({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return D.current=!0,v_(i,a,s,l,u,d),T.current(),je.current=n?e:null,!0},[t,s,c,L,h]),zt=()=>y.current===!0||ve.current!=null||k.current===!0,Bt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Vt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Ht=()=>{ue.current!=null&&(clearTimeout(ue.current),ue.current=null),le.current=null},Ut=()=>{fe.current?.remove(),fe.current=null},Wt=()=>{Vt(ce.current),ce.current=null,de.current=null},Gt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Kt=()=>{me.current?.(),me.current=null,ve.current!=null&&(clearTimeout(ve.current),ve.current=null),k.current=!1,he.current=null,_e.current=null,ge.current!=null&&(ge.current.setAttribute(`draggable`,`true`),ge.current.style.removeProperty(`touch-action`),ge.current=null),Ut(),Ht(),Wt(),pe.current=null},qt=(e,n)=>{let r=S.current?.getRootNode(),i=av(rv(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Jt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Ht();return}let r=t.getItem(e.directoryPath),i=dv(r)?r:null;if(i==null||i.isExpanded()){Ht();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;le.current!==a&&(Ht(),le.current=a,ue.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Yt=()=>{ce.current=null;let e=de.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=cv(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,T.current()),Jt(qt(e.clientX,e.clientY)),ce.current=Bt(Yt)},Xt=(e,t)=>{de.current={clientX:e,clientY:t},ce.current??=Bt(Yt)},Zt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Kt(),Ut(),Ht(),Wt(),t.startDrag(r)===!1){e.preventDefault();return}if(pe.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),sv())){let t=ov(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Gt(t),fe.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Qt=()=>{Ut(),Ht(),Wt(),pe.current=null,t.cancelDrag()},$t=(e,n,r)=>{if(ve.current!=null||k.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;_e.current={clientX:i.clientX,clientY:i.clientY},ge.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!k.current;ve.current!=null&&(clearTimeout(ve.current),ve.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),me.current===o&&(me.current=null),t&&(a.setAttribute(`draggable`,`true`),ge.current===a&&(ge.current=null),_e.current=null)},s=e=>{let t=e.touches[0],n=_e.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),me.current=o,ve.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),ge.current===a&&(ge.current=null),_e.current=null;return}k.current=!0,ge.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),pe.current=n;let e=a.getBoundingClientRect(),s=ov(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Gt(s),fe.current=s,he.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=he.current;n!=null&&fe.current!=null&&(fe.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Jt(qt(t.clientX,t.clientY)),Xt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&qt(n.clientX,n.clientY),t.completeDrag(),Kt()},u=()=>{t.cancelDrag(),Kt()};me.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},ev)},en=e=>{if(N!=null){if(e.key===`Escape`){Pt(),e.preventDefault(),e.stopPropagation();return}_v.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(ot.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)ot.cancel();else if(e.key===`Enter`)ot.commit();else return;Ee(`focus`),be(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Lt(P??void 0),e.preventDefault(),e.stopPropagation();return}if(lt){if(e.key===`Escape`)oe.current=!1,se.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=p_(n,L);se.current=F<0||n==null?null:Math.max(0,Math.min(F*s-n.scrollTop,Math.max(0,r-s))),oe.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;Ee(`focus`),be(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&pv(e)){t.openSearch(e.key),be(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Ye&&hv(e),r=gv(e,Ye),i=r&&S.current!=null?f_(S.current):null,a=r?new Set(wv(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==P&&a.has(o)){let e=C.current;Re(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=dv(p)?p:null,h=u!=null&&(Et.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=Cv(u,w.current,te.current);e==null||n==null?y=!1:It(e,u)}else if((e.ctrlKey||e.metaKey)&&fv(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;Ee(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Et.has(b)||a.has(b)),ee=g&&b!==u,T=n&&c&&o===u&&b===u;if((h||T)&&b!=null&&(ee&&x||T))Re(b,v?.scrollTop??null),D.current=!0,Ce(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(ze(b,Ev(S.current,v,i,u,s,Tt,L)),D.current=!0,Ce(e=>e===b?e:b)):Le()}be(e=>e+1),e.preventDefault(),e.stopPropagation()};B_(()=>{if(!(!f||!lt)){if(Be.current){Be.current=!1;return}d_(ee.current)}},[lt,f]),B_(()=>{let e=x.current;switch(b_({hasRenderedInput:e!=null,previousRenamingPath:O.current,renamingPath:st})){case`reset`:O.current=null;return;case`reveal-canonical`:st!=null&&Rt(st,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(je.current=null,O.current=st,d_(e),e.select());return}},[xt.end,xt.start,st,Rt,Et]),B_(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=f_(e)?.dataset.itemPath??null;Ce(e=>e===t?e:t)},i=()=>{n(),D.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,f_(e)!=null){r();return}D.current=!1,Ce(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),D.current=!1,Ce(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;Ce(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),B_(()=>{let e=S.current;e!=null&&(I.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[I.physical.scrollTop]),B_(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;E.current=p_(n,g);let a=()=>{let e=t.getVisibleCount(),r=m_(E.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Ke($_({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!re.current){re.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=m_(E.current,g),i=t.getVisibleRows(e,e)[0]??null;g_(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}T.current=a;let o=t.subscribe(()=>{s_(xe)&&be(e=>e+1),a()}),l=()=>{Ie.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,Oe(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&Ie.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),Ae.current!=null&&y.current&&Nt.current(),Ie.current===!0){y.current=!1;return}we(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{E.current=(e[0]==null?null:h_(e[0]))??p_(n,g),a()}):null;return x?.observe(n),()=>{T.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,E.current=null,x?.disconnect()}},[t,g,s,c,h]),B_(()=>{Ye||N==null||Pt(!1)},[Pt,Ye,N]);let tn=V_(()=>N==null?null:`${N.path}::${N.source}`,[N]);B_(()=>{if(tn==null){m?.clearSlotContent(Bu);return}let t=Ae.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??yv(n.getBoundingClientRect()),close:e=>{Nt.current(e?.restoreFocus??!0)},restoreFocus:()=>{Mt.current&&jt.current(Ae.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(Bu,i),e?.contextMenu?.onOpen?.(t.item,r),Mv(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&Mv(i)}),()=>{m?.clearSlotContent(Bu)}},[tn,e?.contextMenu,m]),B_(()=>{N!=null&&t.getItem(N.path)==null&&Pt()},[Pt,N,t]),B_(()=>{if(N==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(vv(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Pt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Pt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Pt,N]),B_(()=>{let e=C.current,n=S.current;if(e==null||n==null){ae.current=P;return}let r=P==null?null:te.current.get(P)??null,i=f_(n),a=i?.dataset.itemPath??null,o=ct&&x.current===i,c=f&&ee.current===i,l=oe.current&&!lt,u=se.current??0,d=je.current,p=Me.current,m=Ne.current,g=Pe.current,_=i!=null,v=D.current||_,y=ae.current!==P,b=p!=null&&p===P&&P!=null,w=!1,E=!1;if(dt!=null&&dt.id!==ne.current){ne.current=dt.id;let n=dt.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,L-s))):Tt;w=!0,E=__(e,n,s,L,wt,dt.offset,t)}t.clearScrollRequest(dt.id)}let re=!w&&l&&v_(e,F,s,L,wt,u),ie=!w&&d!=null&&d===P&&v_(e,F,s,L,wt,Tt),O=!w&&m!=null&&m.path===P&&v_(e,F,s,L,wt,m.viewportOffset),ce=!w&&g!=null&&g.path===P&&e.scrollTop!==g.scrollTop;if(ce&&(e.scrollTop=g.scrollTop),(ce||E||ie||O||re||v&&y&&d!==P&&!b&&g_(e,F,s,L,Tt))&&T.current(),w){ae.current=P;return}if(!v){ae.current=P;return}if(o){ae.current=P;return}if(c&&!l){ae.current=P;return}if(r==null){l&&F>=0&&(v_(e,F,s,L,wt,u),T.current()),ae.current=P;return}(y||l||d===P||p===P||m?.path===P||g?.path===P||a==null||a!==P)&&(d_(r),d===P&&(je.current=null),p===P&&(Me.current=null),m?.path===P&&(Ne.current=null),g?.path===P&&(Pe.current=null),oe.current=!1,se.current=null),ae.current=P},[t,F,P,Dt,s,ct,lt,xt,L,f,dt,h,Tt,wt,bt]);let nn=F>=0&&F>=I.visible.startIndex&&F<=I.visible.endIndex,rn=P!=null&&St.some(e=>X_(e.row)===P),an=nn||rn,on=Ze&&D.current===!0&&an?P:null,sn=Te===`pointer`?A:null,cn=N?.path??Fe.current??sn??on??A,ln=N?.source===`right-click`;B_(()=>{y.current&&N==null||Ft(rt(cn))},[N,rt,xt,L,De,St,cn,Ft,bt]);let un=$(e=>{if(y.current||vv(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&Ee(e=>e===`pointer`?e:`pointer`),we(e=>e===i?e:i)},[]),dn=$(()=>{we(null)},[]);B_(()=>{if(!ft)return;let e=()=>{Kt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Kt(),t.cancelDrag()}},[t,ft]);let fn=e=>{if(!ft||t.getDragSession()==null||k.current)return;let n=av(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Jt(t.getDragSession()?.target??null),Xt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},pn=e=>{if(!ft||t.getDragSession()==null||k.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Ht(),Wt(),t.setDragTarget(null))},mn=e=>{!ft||t.getDragSession()==null||k.current||(e.preventDefault(),qt(e.clientX,e.clientY),t.completeDrag(),Ut(),Ht(),Wt(),pe.current=null)},hn=I.window.height,gn=I.window.offsetTop,_n=Math.min(0,L-hn),vn=Math.min(0,L-hn-Tt),yn=Se===P||oe.current,bn=P!=null&&yn&&!Dt&&F>=0?bt[F]??t.getVisibleRows(F,F)[0]??null:null,xn=bn==null?null:y_(F,s,xt,hn),Sn=pe.current,Cn=gt!=null&&Sn!=null&&Sn.path===gt&&Sn.index>=xt.start&&Sn.index<=xt.end,wn=gt!=null&&Sn!=null&&Sn.path===gt&&!Cn&&Sn.path!==bn?.path?Sn:null,Tn=wn==null?null:y_(wn.index,s,xt,hn),En=mv((F>=0?bt[F]??t.getVisibleRows(F,F)[0]??null:null)?.ancestorPaths.at(-1)??null),Dn=lt&&P!=null?kv(o,P,!Dt):void 0,On=N?.path??(lt?P:Se),kn=N?.path??A,An=rt(cn),jn=Ye&&Ze&&!ln&&!ct&&An!=null&&j!=null&&cn!=null,Mn=Ye&&(jn||N!=null),Nn=N?.anchorRect,Pn=Nn==null&&An!=null&&j!=null&&(N!=null||jn)?j:null,Fn=Nn==null?Pn==null?void 0:{top:`${Pn}px`}:{left:`${Nn.left}px`,position:`fixed`,right:`auto`,top:`${Nn.top}px`},In=ln?{opacity:`0`}:void 0,Ln=$((e,n,r,i)=>{let a=C_({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:lt,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=I.visible.startIndex&&n.index<=I.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(D.current=!0,Ce(e=>e===c?e:c),Ee(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Rt(c,{targetOffset:`sticky-parents`})},[t,lt,I.visible.endIndex,I.visible.startIndex,Rt]),Rn=()=>{if(y.current||!Ze||cn==null||An==null)return;let e=t.getItem(cn);e!=null&&(Ft(An),Mt.current=!0,ke({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:An.getAttribute(`aria-label`)??cn,path:e.getPath()},path:e.getPath(),source:`button`}))},zn={contextHoverPath:kn,contextMenuButtonTriggerEnabled:Ze,contextMenuButtonVisibility:Qe,contextMenuEnabled:Ye,contextMenuRightClickEnabled:$e,contextMenuTriggerMode:Xe,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:ft,draggedPathSet:mt,dragTarget:ht,gitLaneActive:it,gitStatusByPath:n,handleRowDragEnd:Qt,handleRowDragStart:Zt,handleRowTouchStart:$t,ignoredGitDirectories:r,ignoredInheritanceCache:ye,instanceId:o,itemHeight:s,onKeyDown:en,onRowClick:Ln,openContextMenuForRow:It,registerButton:et,registerRenameInput:nt,renameView:ot,renderDecorationForRow:Ot,resolveIcon:at,shouldSuppressContextMenu:zt,visualFocusPath:On},Bn={...zn,registerButton:tt};return Y(`div`,{ref:S,id:_t,"data-file-tree-context-menu-button-visibility":Ye&&Ze?Qe:void 0,"data-file-tree-context-menu-trigger-mode":Ye?Xe:void 0,"data-file-tree-has-context-menu-action-lane":Ye&&Ze?`true`:void 0,"data-file-tree-has-git-lane":it?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:ft?pn:void 0,onDragOver:ft?fn:void 0,onDrop:ft?mn:void 0,onKeyDown:en,onPointerLeave:Ye?dn:void 0,onPointerOver:Ye?un:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[Y(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:En}}),Y(`slot`,{name:zu,"data-type":`header-slot`}),f?Y(`div`,{"data-file-tree-search-container":!0,"data-open":lt?`true`:`false`,children:Y(`input`,{ref:ee,"aria-activedescendant":Dn,"aria-controls":_t,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ve?`true`:void 0,value:ut,onBlur:()=>{d===`retain`&&!Ue.current||t.closeSearch()},onFocus:We,onPointerDown:We,onInput:e=>{We();let n=e.currentTarget;t.setSearch(n.value)}})}):null,Y(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&qe&&St.length>0?Y(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:Y(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${vt}px`},children:St.map((e,t)=>Pv(Bn,e.row,`sticky:${X_(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${St.length-t}`}}))})}):null,Y(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${wt}px`},children:[Y(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${gn}px`}}),Y(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${hn}px`,top:`${_n}px`,bottom:`${vn}px`},children:[Fv(zn,xt,Et),bn!=null&&xn!=null?Pv(zn,bn,`parked:${bn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:gt===bn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${xn}px`}}):null,wn!=null&&Tn!=null?Pv(zn,wn,`parked-drag:${wn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${Tn}px`}}):null]})]})]}),Ye?Y(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Mn?`true`:`false`,style:Fn,children:[Y(`button`,{ref:v,type:`button`,"data-type":Vu,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":N==null?`false`:`true`,"data-visible":jn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),N!=null){Pt();return}Rn()},tabIndex:-1,style:In,children:Y(Ag,{...at(`file-tree-icon-ellipsis`)})}),N==null?null:Y(`slot`,{name:Bu})]}):null,N==null?null:Y(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Pt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Pt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var Lv={hydrateRoot:(e,t)=>{Tg(tg(Iv,t),e)},renderRoot:(e,t)=>{wg(tg(Iv,t),e)},unmountRoot:e=>{wg(null,e)}};function Rv(e,t){Lv.renderRoot(e,t)}function zv(e,t){Lv.hydrateRoot(e,t)}function Bv(e){Lv.unmountRoot(e)}var Vv=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}};Array.isArray;var Hv=0;function Uv(e){return e!=null&&e.length>0?e:(Hv+=1,`pst_ft_${Hv}`)}function Wv({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??km)}function Gv(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function Kv(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function qv(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var Jv=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new Vv;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=Uv(a),this.#p=jh(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=Om(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new Eh({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(Bv(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=Mh(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&Rv(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),Rv(t.wrapper,this.#w()))}setGitStatus(e){let t=jh(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&Rv(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),Rv(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),zv(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),Rv(r,this.#w())}#C(){return{initialViewportHeight:Wv({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(zu,e());return}this.#l.setSlotHtml(zu,this.#e?.header?.html??null)}#k(e){let t=qv(e).find(e=>Kv(e)),n=Gv(ku(Uu(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=qv(e),n=t.find(e=>Kv(e)),r=t.filter(e=>e!==n),i=Uu(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=Gv(i);if(a==null){for(let e of r)e.remove();return}if(r.length!==1||r[0].outerHTML!==a.outerHTML){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=Uu(this.#m);t.colored&&ju(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${Fu}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}(this.#g?.parentNode!==e||this.#_!==this.#h)&&(this.#g??=document.createElement(`style`),this.#g.setAttribute(Fu,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=Nm(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return zm(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},Yv=`
6256
+ }`}var Rm=new WeakMap;function zm(e){let t=Rm.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(Bu,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),Rm.set(e,i),i}function Bm(e,t){if(!e.isConnected)return;let n=zm(t);if(n==null)return;let r=t.querySelector(`style[${Vu}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(Vu,``),t.appendChild(i)),i.textContent=`:host { ${Hu}: ${n}px; }`}var Vm;function Hm(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){Vm??(Vm=new CSSStyleSheet,Vm.replaceSync(Im(Pm)));let t=!1;try{e.adoptedStyleSheets=[Vm],t=!0}catch{}if(t){e.querySelector(`style[${Ru}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(Ru,``),t.textContent=Im(Pm),e.prepend(t)}}function Um(e,t){Wm(e,t),Hm(t),Bm(e,t)}function Wm(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});Um(this,e)}}if(customElements.define(Lu,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(Lu)))e instanceof HTMLElement&&Um(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var Gm=e=>e.startsWith(`f::`)?e.slice(3):e;function Km(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function qm(e,t){return e===``?t:`${e}/${t}`}function Jm({files:e,path:t,isFolder:n,nextBasename:r}){let i=Gm(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=Km(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=qm(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function Ym(e){return e.endsWith(`/`)}function Xm(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function Zm(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function Qm(e,t){return t.includes(e)?Zm(t):[e]}function $m(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function eh(e,t){return{draggedPaths:e,target:t}}function th(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(Ym(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function nh(e,t){return t.kind===`root`||t.directoryPath==null?Xm(e):t.directoryPath}function rh(e,t){let n=e.map(e=>{let n=nh(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function ih(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function ah(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!ih(Om.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function oh(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function sh(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function ch(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function lh(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return ch(e,t.path)?n?e:null:e;case`move`:return sh(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=lh(r,e,n),r==null)return null;return r}}}function uh(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function dh(e){switch(e.operation){case`add`:return{...uh(e),operation:`add`,path:e.path};case`remove`:return{...uh(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...uh(e),from:e.from,operation:`move`,to:e.to}}}function fh(e){return{...uh(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>dh(e)),operation:`batch`}}function ph(e){switch(e.operation){case`add`:case`remove`:case`move`:return dh(e);case`batch`:return fh(e);default:return null}}function mh(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function hh(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function gh(e){return hh(e).at(-1)??null}function _h(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function vh(e){return e.endsWith(`/`)}var yh=e=>e.toLowerCase();function bh(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function xh(e){return e.endsWith(`/`)?e.slice(0,-1):e}function Sh(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var Ch=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},wh=Symbol(`FILE_TREE_RENAME_VIEW`),Th=512,Eh=512;function Dh(e){return e===`top`||e===`center`?e:`nearest`}function Oh(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=hh(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function kh(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:Oh(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var Ah=class e{static{Object.defineProperty(e.prototype,wh,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=ah({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=gh(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:Dh(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=Eh){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=Qm(t,n);return this.#r.canDrag?.(r)!==!1&&(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=eh(t.draggedPaths,n);(th(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}$m(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=eh(e.draggedPaths,t);if(th(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=rh(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=vh(r),a=xh(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of hh(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=bh(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,vh(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,vh(e)?{recursive:!0}:void 0);return}let t=vh(e),n=Jm({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:xh(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(Sh(n.sourcePath,t),Sh(n.destinationPath,t))}#Y(e){this.#T!=null&&this.#E!==e&&(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=ah({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!mh(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=gh(e),n=_h(e,t),r=null,i=null;for(let e of this.#be()){if(gh(e)!==t)continue;let a=_h(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=hh(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!mh(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new Om({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of hh(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(yh),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(yh),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of hh(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:Ch(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of hh(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of hh(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=kh(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,Th)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s!==e||this.#c!==n)&&(this.#s=e,this.#c=n,t&&this.#De())}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=lh(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=lh(this.#c,e,!0),r=[...this.#B].map(t=>lh(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=lh(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return mh(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&oh(e)&&(this.#i=null);let t=oh(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=ph(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},jh=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function Mh(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(e[t]!==`/`&&t!==e.length){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function Nh(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function Ph(e,t){return t?`${e}/`:e}function Fh(e,t=null){let n=jh(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=Lh(t);e!=null&&Bh({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function Ih(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=Rh(e);t!=null&&(c=zh({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=Lh(e);t!=null&&(c=Bh({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:Uh(i),statusByPath:i}:e}function Lh(e){return Rh(e.path)}function Rh(e){let t=Mh(e);if(t!=null)return{canonicalPath:Ph(t.path,t.isDirectory),isDirectory:t.isDirectory}}function zh({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),Hh(t,n,e),!0)}function Bh({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??Vh(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function Vh(e,t,n){for(let r of Nh(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function Hh(e,t,n){for(let r of Nh(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function Uh(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var J,Wh,Gh,Kh,qh,Jh,Yh,Xh,Zh,Qh,$h={},eg=[],tg=Array.isArray,ng=eg.slice,rg=Object.assign;function ig(e){e&&e.parentNode&&e.remove()}function ag(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?ng.call(arguments,2):n),og(e,o,r,i,null)}function og(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Wh,__i:-1,__u:0};return i==null&&J.vnode!=null&&J.vnode(a),a}function sg(e){return e.children}function cg(e,t){this.props=e,this.context=t,this.__g=0}function lg(e,t){if(t==null)return e.__?lg(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?lg(e):null}function ug(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return ug(e)}}function dg(e){(8&e.__g||!(e.__g|=8)||!Gh.push(e)||qh++)&&Kh==J.debounceRendering||((Kh=J.debounceRendering)||queueMicrotask)(fg)}function fg(){for(var e,t,n,r,i,a,o,s,c=1;Gh.length;)Gh.length>c&&Gh.sort(Jh),e=Gh.shift(),c=Gh.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=rg({},r)).__v=r.__v+1,J.vnode&&J.vnode(n),bg(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??lg(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,Sg(a,n,o),n.__e!=i&&ug(n)));qh=0}function pg(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||eg,b=t.length;for(c=mg(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?$h:y[m.__i]||$h,m.__i=f,_=bg(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Tg(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=hg(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function mg(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?og(null,o,null,null,null):tg(o)?og(sg,{children:o},null,null,null):o.constructor==null&&o.__b>0?og(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=gg(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=lg(s)),Eg(s,s));return r}function hg(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=hg(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=lg(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function gg(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function _g(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function vg(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||_g(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||_g(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(Yh,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=Xh,e.addEventListener(t,a?Qh:Zh,a)):e.removeEventListener(t,a?Qh:Zh,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function yg(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=Xh++;else if(t.u<n.l)return;return n(J.event?J.event(t):t)}}}function bg(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,ee,te,w,T,E,ne,re,ie,D=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=J.__b)&&d(t);n:if(typeof D==`function`)try{if(v=t.props,y=`prototype`in D&&D.prototype.render,b=(d=D.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new D(v,x):(t.__c=f=new cg(v,x),f.constructor=D,f.render=Dg),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&D.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=rg({},f.__s)),rg(f.__s,D.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&D.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&D.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=J.__r,ee=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),te=0;te<f._sb.length;te++)f.__h.push(f._sb[te]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++ee<25);f.state=f.__s,f.getChildContext!=null&&(r=rg({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),w=d,d!=null&&d.type===sg&&d.key==null&&(w=Cg(d.props.children)),s=pg(e,tg(w)?w:[w],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(T=0,E=!1,t.__u|=c?160:128,t.__c.__z=[],ne=0;ne<a.length;ne++)(re=a[ne])==null||E||(re.nodeType==8&&re.data==`$s`?(T>0&&t.__c.__z.push(re),T++,a[ne]=null):re.nodeType==8&&re.data==`/$s`?(--T>0&&t.__c.__z.push(re),E=T===0,s=a[ne],a[ne]=null):T>0&&(t.__c.__z.push(re),a[ne]=null));if(!E){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(ie=a.length;ie--;)ig(a[ie]);xg(t)}else t.__e=n.__e,t.__k=n.__k,e.then||xg(t);J.__e(e,t,n)}else s=t.__e=wg(n.__e,t,n,r,i,a,o,c,l,u);return(d=J.diffed)&&d(t),128&t.__u?void 0:s}function xg(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(xg)}function Sg(e,t,n){for(var r=0;r<n.length;r++)Tg(n[r],n[++r],n[++r]);J.__c&&J.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){J.__e(e,t.__v)}})}function Cg(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:tg(e)?e.map(Cg):rg({},e)}function wg(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(J.__m&&J.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=ng.call(e.childNodes),v=n.props||$h,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;vg(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||vg(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),pg(b==`template`?e.content:e,tg(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&lg(n,0),s,c,l),a!=null)for(u=a.length;u--;)ig(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||vg(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&vg(e,u,g,v[u],i))}return e}function Tg(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){J.__e(e,n)}}function Eg(e,t,n){var r,i;if(J.unmount&&J.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Tg(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){J.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Eg(r[i],t,n||typeof e.type!=`function`);n||ig(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function Dg(e,t,n){return this.constructor(e,n)}function Og(e,t){var n,r,i,a;t==document&&(t=document.documentElement),J.__&&J.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=ag(sg,null,[e]),i=[],a=[],bg(t,e,r||$h,$h,t.namespaceURI,r?null:t.firstChild?ng.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),Sg(i,e,a)}function kg(e,t){e.__u|=32,Og(e,t)}J={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw qh=0,e}},Wh=0,cg.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=rg({},this.state);typeof e==`function`&&(e=e(rg({},n),this.props)),e&&rg(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),dg(this))},cg.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),dg(this))},cg.prototype.render=sg,Gh=[],qh=0,Jh=function(e,t){return e.__v.__b-t.__v.__b},Yh=/(PointerCapture)$|Capture$/i,Xh=0,Zh=yg(!1),Qh=yg(!0);var Ag=0;Array.isArray;function Y(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ag,__i:-1,__u:0,__source:i,__self:a};return J.vnode&&J.vnode(l),l}var jg=16,Mg=16,Ng={};function Pg({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=Ng[e]??{width:jg,height:Mg},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return Y(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:Y(`use`,{href:c})})}var Fg=e=>e!==void 0&&/\s/.test(e),Ig=(e,t)=>{let n=t=>Fg(e[t-1])||Fg(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},Lg=e=>Ig(e,Math.ceil(e.length/2)),Rg=e=>{if(e.length<2)return[e,``];let t=Lg(e);return[e.slice(0,t),e.slice(t)]},zg=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Lg(e);return[e.slice(0,r),e.slice(r)]},Bg=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},Vg=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},Hg=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},Ug=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function Wg({children:e,marker:t,variant:n=`default`}){"use no memo";return Y(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:Y(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?Y(`span`,{"data-truncate-fade":!0}):t})})}function Gg(e){"use no memo";let{mode:t,children:n}=e;return Y(`div`,{children:[Y(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?Y(`span`,{children:n}):n}),Y(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?Y(`span`,{children:n}):n})]})}function Kg({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=Y(Gg,{mode:t,children:e},`content`),o=Y(Wg,{marker:n,mode:t,variant:r},`marker`),s=Y(`div`,{"data-truncate-fill":!0},`fill`);return Y(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:Y(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function qg({children:e,...t}){"use no memo";return Y(Kg,{mode:`truncate`,...t,children:e})}function Jg({children:e,...t}){"use no memo";return Y(Kg,{mode:`fruncate`,...t,children:e})}function Yg({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=Y(qg,{...s,children:t[0]}),l=Y(Jg,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return Y(`div`,{className:a,style:o});if(e.length<i)return Y(n===`end`?Jg:qg,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=Rg:r===`extension`?t=zg:r===`leaf-path`&&(t=Bg);else if(typeof r==`number`)t=Vg,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=Hg:e===`first`&&(t=Ug)}else typeof r==`function`&&(t=r);t??=Rg;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=Y(qg,{...s,..._,children:f}),l=Y(Jg,{...s,...v,children:p})}return Y(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[Y(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),Y(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var Xg={endIndex:-1,startIndex:-1};function Zg(e,t,n){return Math.min(Math.max(e,t),n)}function Qg(e,t){return e<0||t<e?Xg:{endIndex:t,startIndex:e}}function $g(e){return e.startIndex<0||e.endIndex<e.startIndex}function e_(e,t){return $g(e)?0:(e.endIndex-e.startIndex+1)*t}function t_(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function n_(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function r_(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function i_(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function a_(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function o_(e,t,n){if(e.length===0||t<=0)return[];let r=a_(e),i=r_(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=i_(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function s_(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=Zg(t.scrollTop,0,o),c=t.stickyRows??o_(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=t_(s,n,t.itemHeight),m=t_(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?Xg:Qg(m,n_(u+d,n,t.itemHeight)),y=g+1,b=$g(v)?Xg:Qg(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=e_(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:$g(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var c_={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},l_={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},u_=`Contains git status items`;function d_(e){return e.current?!0:(e.current=!0,!1)}function f_(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function p_(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return f_({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function m_(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function h_(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function g_(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function __(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function v_(e,t){return e!=null&&e>0?e:t}function y_(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function b_(e,t,n,r,i=0){let a=f_({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function x_(e,t,n,r,i,a,o=0){let s=p_({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function S_(e,t,n,r,i,a){let o=m_({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function C_(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function w_(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function T_({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return Y(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function E_(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function D_(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var O_,X,k_,A_,j_=Object.is,M_=0,N_=[],Z=J,P_=Z.__b,F_=Z.__r,I_=Z.diffed,L_=Z.__c,R_=Z.unmount,z_=Z.__;function B_(e,t){Z.__h&&Z.__h(X,e,M_||t),M_=0;var n=X.__H||(X.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function V_(e){return M_=1,H_(Q_,e)}function H_(e,t,n){var r=B_(O_++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Q_(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);j_(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=X,!X.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,j_(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};X.__f=!0;var a=X.shouldComponentUpdate,o=X.componentWillUpdate;X.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},X.shouldComponentUpdate=i}return r.__N||r.__}function U_(e,t){var n=B_(O_++,3);!Z.__s&&Z_(n.__H,t)&&(n.__=e,n.u=t,X.__H.__h.push(n))}function W_(e,t){var n=B_(O_++,4);!Z.__s&&Z_(n.__H,t)&&(n.__=e,n.u=t,X.__h.push(n))}function Q(e){return M_=5,G_(function(){return{current:e}},[])}function G_(e,t){var n=B_(O_++,7);return Z_(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function $(e,t){return M_=8,G_(function(){return e},t)}function K_(){for(var e;e=N_.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Y_),e.__H.__h.forEach(X_),e.__H.__h=[]}catch(t){e.__H.__h=[],Z.__e(t,e.__v)}}Z.__b=function(e){X=null,P_&&P_(e)},Z.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),z_&&z_(e,t)},Z.__r=function(e){F_&&F_(e),O_=0;var t=(X=e.__c).__H;t&&(k_===X?(t.__h=[],X.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(Y_),t.__h.forEach(X_),t.__h=[],O_=0)),k_=X},Z.diffed=function(e){I_&&I_(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(N_.push(t)!==1&&A_===Z.requestAnimationFrame||((A_=Z.requestAnimationFrame)||J_)(K_)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),k_=X=null},Z.__c=function(e,t){t.some(function(e){try{e.__h.forEach(Y_),e.__h=e.__h.filter(function(e){return!e.__||X_(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],Z.__e(n,e.__v)}}),L_&&L_(e,t)},Z.unmount=function(e){R_&&R_(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{Y_(e)}catch(e){t=e}}),n.__H=void 0,t&&Z.__e(t,n.__v))};var q_=typeof requestAnimationFrame==`function`;function J_(e){var t,n=function(){clearTimeout(r),q_&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);q_&&(t=requestAnimationFrame(n))}function Y_(e){var t=X,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),X=t}function X_(e){var t=X;e.__c=e.__(),X=t}function Z_(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!j_(t,e[n])})}function Q_(e,t){return typeof t==`function`?t(e):t}function $_(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:Y(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return Y(sg,{children:[Y(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:Y(qg,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function ev(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function tv(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function nv(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function rv({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=s_(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:nv(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?nv(u,1,t,o):i&&r<=0&&c.length>0?o_(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var iv=400,av=40,ov=18;function sv(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?cv(e,t,n):a instanceof HTMLElement?a:null}function cv(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function lv(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function uv(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function dv(){return navigator.vendor!==`Apple Computer, Inc.`}function fv(e,t){let n=e-t.top;if(n<av)return-Math.ceil((av-Math.max(0,n))/av*ov);let r=t.bottom-e;return r<av?Math.ceil((av-Math.max(0,r))/av*ov):0}function pv(e,t){if(e!=null){let t=c_[e];return t==null?null:{text:t,title:l_[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:u_}:null}function mv(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function hv(e){return e!=null&&`toggle`in e}function gv(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function _v(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function vv(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function yv(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function bv(e,t){return t&&yv(e)||(e.ctrlKey||e.metaKey)&&gv(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var xv=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function Sv(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function Cv(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function wv(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function Tv(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function Ev(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function Dv(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function Ov(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function kv(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function Av(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=kv(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function jv(e,t){return{kind:e.kind,name:tv(e),path:t}}function Mv(e){return e==null?void 0:`${e}__tree`}function Nv(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function Pv(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function Fv(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?Y(`span`,{title:e.title,children:e.text}):Y(`span`,{title:e.title,children:e.parts.map((e,t)=>Y(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?Pv(e.icon)?t(e.icon):{name:e.icon}:Pv(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return Y(`span`,{title:e.title,children:Y(Pg,{...n})})}function Iv(e){e!=null&&h_(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function Lv(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=ev(e);return Y(sg,{children:[e.depth>0?Y(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>Y(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,Y(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?Y(Pg,{...t(`file-tree-icon-chevron`)}):Y(Pg,{...t(`file-tree-icon-file`,u)})}),Y(`div`,{"data-item-section":`content`,children:e.isFlattened?$_(e,c,a):c??Y(Yg,{minimumLength:5,split:`extension`,children:e.name})}),i?Y(`div`,{"data-item-section":`decoration`,children:r==null?null:Fv(r,t)}):null,s?Y(`div`,{"data-item-section":`git`,children:Fv(o,t)}):null,n?Y(`div`,{"data-item-section":`action`,children:l?Y(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:Y(Pg,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function Rv(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:ee,contextMenuButtonVisibility:te,contextMenuRightClickEnabled:w,registerRenameInput:T,registerButton:E,resolveIcon:ne,renderDecorationForRow:re,openContextMenuForRow:ie,onRowClick:D,onKeyDown:ae}=e,O=ev(t),{isParked:oe=!1,mode:se=`flow`,style:ce}=r,le=se===`sticky`,ue=_?.get(O)??null??mv(t.ancestorPaths,v,y),de=t.kind===`directory`&&(b?.has(O)??!1),fe=re(t,O),pe=pv(ue,de),me=S&&ee,k=fe!=null||x||me,he=me&&te===`always`,ge=a.getPath()===O,_e=ge?a.getValue():``,ve=le||!ge?null:Y(T_,{ref:T,ariaLabel:`Rename ${tv(t)}`,isFlattened:t.isFlattened,value:_e,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ye=Lv(t,ne,{actionLaneEnabled:me,customDecoration:fe,decorationLaneEnabled:k,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:pe,gitLaneActive:x,renameInput:ve,showDecorativeActionAffordance:he}),be={...E_({ariaLabel:tv(t),domId:t.isFocused?Nv(h,O,oe):void 0,extraStyle:ce,features:{actionLaneEnabled:me,contextMenuButtonVisibility:me?te:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:oe,itemHeight:g,mode:se,row:t,state:{containsGitChange:de,effectiveGitStatus:ue,isContextHovered:s===O,isDragTarget:l?.kind===`directory`&&l.directoryPath===O,isDragging:c?.has(O)===!0,isFocusRinged:t.isFocused&&o===O},targetPath:O}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),w&&(i.focusMountedPathFromInput(O),ie(t,O,{anchorRect:wv(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:le?void 0:()=>{i.focusMountedPathFromInput(O)},onKeyDown:le?void 0:ae,ref:e=>{E(O,e)}};return!le&&ge?Y(`div`,{...be,children:ye}):Y(`button`,{...be,type:`button`,draggable:u&&!oe,onDragEnd:u&&!oe?p:void 0,onDragStart:u&&!oe?e=>{f(e,t,O)}:void 0,onMouseDown:e=>{if(le){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!oe?e=>{m(e,t,O)}:void 0,onClick:e=>{D(e,t,O,se)},children:ye})}function zv(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(ev(e))).map((n,r)=>Rv(e,n,t.start+r))}function Bv({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=Nm,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=Q(null),v=Q(null),y=Q(!1),b=Q(null),x=Q(null),S=Q(null),C=Q(null),ee=Q(null),te=Q(new Map),w=Q(new Map),T=Q(()=>{}),E=Q(null),ne=Q(0),re=Q(!1),ie=Q(null);ie.current!==t&&(re.current=!1,ie.current=t);let D=Q(!1),ae=Q(null),O=Q(null),oe=Q(!1),se=Q(null),ce=Q(null),le=Q(null),ue=Q(null),de=Q(null),fe=Q(null),pe=Q(null),me=Q(null),k=Q(!1),he=Q(null),ge=Q(null),_e=Q(null),ve=Q(null),ye=G_(()=>new Map,[]),[,be]=V_(0),xe=Q(!1),[Se,Ce]=V_(null),[A,we]=V_(null),[j,M]=V_(null),[Te,Ee]=V_(null),[De,Oe]=V_(0),[N,ke]=V_(null),Ae=Q(N);Ae.current=N;let je=Q(null),Me=Q(null),Ne=Q(null),Pe=Q(null),Fe=Q(null),Ie=Q(!1),Le=()=>{Me.current=null,Ne.current=null,Pe.current=null},Re=(e,t)=>{Me.current=e,Ne.current=null,Pe.current=t==null?null:{path:e,scrollTop:t}},ze=(e,t)=>{Me.current=null,Ne.current={path:e,viewportOffset:t},Pe.current=null},Be=Q(d===`retain`&&t.isSearchOpen()),[Ve,He]=V_(p);U_(()=>{p||He(!1)},[p]);let Ue=Q(!1),We=$(()=>{Ue.current=!0,He(e=>e&&!1)},[]),[Ge,Ke]=V_(()=>rv({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[qe,Je]=V_(!1);U_(()=>{Je(!0)},[]);let P=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Ye=e?.contextMenu?.triggerMode??(P?`right-click`:`both`),Xe=Ye===`both`||Ye===`button`,Ze=e?.contextMenu?.buttonVisibility??`when-needed`,Qe=Ye===`both`||Ye===`right-click`;W_(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Fe.current=t,we(t),Ee(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Ie.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let $e=$((e,t)=>{Ev(te.current,e,t)},[]),et=$((e,t)=>{Ev(w.current,e,t)},[]),tt=$(e=>{x.current=e},[]),nt=$(e=>Dv(e,w.current,te.current),[]),rt=n!=null||r!=null||i!=null,{resolveIcon:it}=G_(()=>Qu(a),[a]),at=t[wh](),ot=at.getPath(),st=ot!=null,ct=t.isSearchOpen(),lt=t.getSearchValue(),F=t.getFocusedPath(),I=t.getFocusedIndex(),ut=t.getScrollRequest(),dt=t.isDragAndDropEnabled(),ft=t.getDragSession(),pt=G_(()=>ft==null?null:new Set(ft.draggedPaths),[ft]),mt=ft?.target??null,ht=ft?.primaryPath??null,gt=Mv(o),{overlayHeight:_t,overlayRows:vt,snapshot:L,visibleRows:yt}=Ge,R=L.physical.viewportHeight,bt=G_(()=>({end:L.window.endIndex,start:L.window.startIndex}),[L.window.endIndex,L.window.startIndex]),xt=vt,St=L.sticky.rows,Ct=L.physical.totalHeight,wt=L.sticky.height,Tt=G_(()=>new Set(St.map(e=>ev(e.row))),[St]),Et=I>=0&&I>=bt.start&&I<=bt.end,Dt=$((e,t)=>u?.({item:jv(e,t),row:e})??null,[u]),Ot=$(e=>h_(e==null?null:te.current.get(e)??null)?!0:h_(S.current),[]),kt=$(e=>{Ot(t.focusNearestPath(e))},[t,Ot]),At=Q(kt);At.current=kt;let jt=Q(!0),Mt=Q(()=>{}),Nt=$((t=!0)=>{let n=Ae.current;n!=null&&(jt.current=jt.current&&t,ke(null),e?.contextMenu?.onClose?.(),jt.current&&kt(n.path))},[e?.contextMenu,kt]);Mt.current=Nt;let Pt=$(e=>{let t=e==null?null:Tv(S.current,e);M(e=>e===t?e:t)},[]),Ft=$((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=nt(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Re(n,e?.scrollTop??null),D.current=!0,Ce(e=>e===n?e:n)}i.focus(),Pt(a),jt.current=!0,ke({anchorRect:r?.anchorRect??null,item:jv(e,n),path:n,source:r?.source??`keyboard`})},[t,nt,Pt]),It=$(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=__(e,R);se.current=I<0||e==null?null:Math.max(0,Math.min(I*s-e.scrollTop,Math.max(0,t-s))),oe.current=!0}t.startRenaming(e)!==!1&&(Ee(`focus`),be(e=>e+1))}},[t,I,s,l,R]),Lt=$((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=__(i,R),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:rv({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return D.current=!0,S_(i,a,s,l,u,d),T.current(),je.current=n?e:null,!0},[t,s,c,R,h]),Rt=()=>y.current===!0||ve.current!=null||k.current===!0,zt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Bt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Vt=()=>{ue.current!=null&&(clearTimeout(ue.current),ue.current=null),le.current=null},Ht=()=>{fe.current?.remove(),fe.current=null},Ut=()=>{Bt(ce.current),ce.current=null,de.current=null},Wt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Gt=()=>{me.current?.(),me.current=null,ve.current!=null&&(clearTimeout(ve.current),ve.current=null),k.current=!1,he.current=null,_e.current=null,ge.current!=null&&(ge.current.setAttribute(`draggable`,`true`),ge.current.style.removeProperty(`touch-action`),ge.current=null),Ht(),Vt(),Ut(),pe.current=null},Kt=(e,n)=>{let r=S.current?.getRootNode(),i=lv(sv(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},qt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Vt();return}let r=t.getItem(e.directoryPath),i=hv(r)?r:null;if(i==null||i.isExpanded()){Vt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;le.current!==a&&(Vt(),le.current=a,ue.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Jt=()=>{ce.current=null;let e=de.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=fv(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,T.current()),qt(Kt(e.clientX,e.clientY)),ce.current=zt(Jt)},Yt=(e,t)=>{de.current={clientX:e,clientY:t},ce.current??=zt(Jt)},Xt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Gt(),Ht(),Vt(),Ut(),t.startDrag(r)===!1){e.preventDefault();return}if(pe.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),dv())){let t=uv(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Wt(t),fe.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Zt=()=>{Ht(),Vt(),Ut(),pe.current=null,t.cancelDrag()},Qt=(e,n,r)=>{if(ve.current!=null||k.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;_e.current={clientX:i.clientX,clientY:i.clientY},ge.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!k.current;ve.current!=null&&(clearTimeout(ve.current),ve.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),me.current===o&&(me.current=null),t&&(a.setAttribute(`draggable`,`true`),ge.current===a&&(ge.current=null),_e.current=null)},s=e=>{let t=e.touches[0],n=_e.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),me.current=o,ve.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),ge.current===a&&(ge.current=null),_e.current=null;return}k.current=!0,ge.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),pe.current=n;let e=a.getBoundingClientRect(),s=uv(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Wt(s),fe.current=s,he.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=he.current;n!=null&&fe.current!=null&&(fe.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),qt(Kt(t.clientX,t.clientY)),Yt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Kt(n.clientX,n.clientY),t.completeDrag(),Gt()},u=()=>{t.cancelDrag(),Gt()};me.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},iv)},$t=e=>{if(N!=null){if(e.key===`Escape`){Nt(),e.preventDefault(),e.stopPropagation();return}xv.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(at.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)at.cancel();else if(e.key===`Enter`)at.commit();else return;Ee(`focus`),be(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){It(F??void 0),e.preventDefault(),e.stopPropagation();return}if(ct){if(e.key===`Escape`)oe.current=!1,se.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=__(n,R);se.current=I<0||n==null?null:Math.max(0,Math.min(I*s-n.scrollTop,Math.max(0,r-s))),oe.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;Ee(`focus`),be(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&_v(e)){t.openSearch(e.key),be(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=P&&yv(e),r=bv(e,P),i=r&&S.current!=null?g_(S.current):null,a=r?new Set(Ov(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==F&&a.has(o)){let e=C.current;Re(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=hv(p)?p:null,h=u!=null&&(Tt.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=Dv(u,w.current,te.current);e==null||n==null?y=!1:Ft(e,u)}else if((e.ctrlKey||e.metaKey)&&gv(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;Ee(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Tt.has(b)||a.has(b)),ee=g&&b!==u,T=n&&c&&o===u&&b===u;if((h||T)&&b!=null&&(ee&&x||T))Re(b,v?.scrollTop??null),D.current=!0,Ce(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(ze(b,Av(S.current,v,i,u,s,wt,R)),D.current=!0,Ce(e=>e===b?e:b)):Le()}be(e=>e+1),e.preventDefault(),e.stopPropagation()};W_(()=>{if(!(!f||!ct)){if(Be.current){Be.current=!1;return}h_(ee.current)}},[ct,f]),W_(()=>{let e=x.current;switch(w_({hasRenderedInput:e!=null,previousRenamingPath:O.current,renamingPath:ot})){case`reset`:O.current=null;return;case`reveal-canonical`:ot!=null&&Lt(ot,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(je.current=null,O.current=ot,h_(e),e.select());return}},[bt.end,bt.start,ot,Lt,Tt]),W_(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=g_(e)?.dataset.itemPath??null;Ce(e=>e===t?e:t)},i=()=>{n(),D.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,g_(e)!=null){r();return}D.current=!1,Ce(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),D.current=!1,Ce(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;Ce(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),W_(()=>{let e=S.current;e!=null&&(L.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[L.physical.scrollTop]),W_(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;E.current=__(n,g);let a=()=>{let e=t.getVisibleCount(),r=v_(E.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Ke(rv({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!re.current){re.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=v_(E.current,g),i=t.getVisibleRows(e,e)[0]??null;b_(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}T.current=a;let o=t.subscribe(()=>{d_(xe)&&be(e=>e+1),a()}),l=()=>{Ie.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,Oe(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&Ie.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),Ae.current!=null&&y.current&&Mt.current(),Ie.current===!0){y.current=!1;return}we(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{E.current=(e[0]==null?null:y_(e[0]))??__(n,g),a()}):null;return x?.observe(n),()=>{T.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,E.current=null,x?.disconnect()}},[t,g,s,c,h]),W_(()=>{P||N==null||Nt(!1)},[Nt,P,N]);let en=G_(()=>N==null?null:`${N.path}::${N.source}`,[N]);W_(()=>{if(en==null){m?.clearSlotContent(Wu);return}let t=Ae.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??Cv(n.getBoundingClientRect()),close:e=>{Mt.current(e?.restoreFocus??!0)},restoreFocus:()=>{jt.current&&At.current(Ae.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(Wu,i),e?.contextMenu?.onOpen?.(t.item,r),Iv(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&Iv(i)}),()=>{m?.clearSlotContent(Wu)}},[en,e?.contextMenu,m]),W_(()=>{N!=null&&t.getItem(N.path)==null&&Nt()},[Nt,N,t]),W_(()=>{if(N==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(Sv(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Nt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Nt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Nt,N]),W_(()=>{let e=C.current,n=S.current;if(e==null||n==null){ae.current=F;return}let r=F==null?null:te.current.get(F)??null,i=g_(n),a=i?.dataset.itemPath??null,o=st&&x.current===i,c=f&&ee.current===i,l=oe.current&&!ct,u=se.current??0,d=je.current,p=Me.current,m=Ne.current,g=Pe.current,_=i!=null,v=D.current||_,y=ae.current!==F,b=p!=null&&p===F&&F!=null,w=!1,E=!1;if(ut!=null&&ut.id!==ne.current){ne.current=ut.id;let n=ut.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,R-s))):wt;w=!0,E=x_(e,n,s,R,Ct,ut.offset,t)}t.clearScrollRequest(ut.id)}let re=!w&&l&&S_(e,I,s,R,Ct,u),ie=!w&&d!=null&&d===F&&S_(e,I,s,R,Ct,wt),O=!w&&m!=null&&m.path===F&&S_(e,I,s,R,Ct,m.viewportOffset),ce=!w&&g!=null&&g.path===F&&e.scrollTop!==g.scrollTop;if(ce&&(e.scrollTop=g.scrollTop),(ce||E||ie||O||re||v&&y&&d!==F&&!b&&b_(e,I,s,R,wt))&&T.current(),w){ae.current=F;return}if(!v){ae.current=F;return}if(o){ae.current=F;return}if(c&&!l){ae.current=F;return}if(r==null){l&&I>=0&&(S_(e,I,s,R,Ct,u),T.current()),ae.current=F;return}(y||l||d===F||p===F||m?.path===F||g?.path===F||a==null||a!==F)&&(h_(r),d===F&&(je.current=null),p===F&&(Me.current=null),m?.path===F&&(Ne.current=null),g?.path===F&&(Pe.current=null),oe.current=!1,se.current=null),ae.current=F},[t,I,F,Et,s,st,ct,bt,R,f,ut,h,wt,Ct,yt]);let tn=I>=0&&I>=L.visible.startIndex&&I<=L.visible.endIndex,nn=F!=null&&xt.some(e=>ev(e.row)===F),rn=tn||nn,an=Xe&&D.current===!0&&rn?F:null,on=Te===`pointer`?A:null,sn=N?.path??Fe.current??on??an??A,cn=N?.source===`right-click`;W_(()=>{y.current&&N==null||Pt(nt(sn))},[N,nt,bt,R,De,xt,sn,Pt,yt]);let ln=$(e=>{if(y.current||Sv(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&Ee(e=>e===`pointer`?e:`pointer`),we(e=>e===i?e:i)},[]),un=$(()=>{we(null)},[]);W_(()=>{if(!dt)return;let e=()=>{Gt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Gt(),t.cancelDrag()}},[t,dt]);let dn=e=>{if(!dt||t.getDragSession()==null||k.current)return;let n=lv(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),qt(t.getDragSession()?.target??null),Yt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},fn=e=>{if(!dt||t.getDragSession()==null||k.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Vt(),Ut(),t.setDragTarget(null))},pn=e=>{!dt||t.getDragSession()==null||k.current||(e.preventDefault(),Kt(e.clientX,e.clientY),t.completeDrag(),Ht(),Vt(),Ut(),pe.current=null)},mn=L.window.height,hn=L.window.offsetTop,gn=Math.min(0,R-mn),_n=Math.min(0,R-mn-wt),vn=Se===F||oe.current,yn=F!=null&&vn&&!Et&&I>=0?yt[I]??t.getVisibleRows(I,I)[0]??null:null,bn=yn==null?null:C_(I,s,bt,mn),xn=pe.current,Sn=ht!=null&&xn!=null&&xn.path===ht&&xn.index>=bt.start&&xn.index<=bt.end,Cn=ht!=null&&xn!=null&&xn.path===ht&&!Sn&&xn.path!==yn?.path?xn:null,wn=Cn==null?null:C_(Cn.index,s,bt,mn),Tn=vv((I>=0?yt[I]??t.getVisibleRows(I,I)[0]??null:null)?.ancestorPaths.at(-1)??null),En=ct&&F!=null?Nv(o,F,!Et):void 0,Dn=N?.path??(ct?F:Se),On=N?.path??A,kn=nt(sn),An=P&&Xe&&!cn&&!st&&kn!=null&&j!=null&&sn!=null,jn=P&&(An||N!=null),Mn=N?.anchorRect,Nn=Mn==null&&kn!=null&&j!=null&&(N!=null||An)?j:null,Pn=Mn==null?Nn==null?void 0:{top:`${Nn}px`}:{left:`${Mn.left}px`,position:`fixed`,right:`auto`,top:`${Mn.top}px`},Fn=cn?{opacity:`0`}:void 0,In=$((e,n,r,i)=>{let a=D_({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:ct,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=L.visible.startIndex&&n.index<=L.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(D.current=!0,Ce(e=>e===c?e:c),Ee(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Lt(c,{targetOffset:`sticky-parents`})},[t,ct,L.visible.endIndex,L.visible.startIndex,Lt]),Ln=()=>{if(y.current||!Xe||sn==null||kn==null)return;let e=t.getItem(sn);e!=null&&(Pt(kn),jt.current=!0,ke({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:kn.getAttribute(`aria-label`)??sn,path:e.getPath()},path:e.getPath(),source:`button`}))},Rn={contextHoverPath:On,contextMenuButtonTriggerEnabled:Xe,contextMenuButtonVisibility:Ze,contextMenuEnabled:P,contextMenuRightClickEnabled:Qe,contextMenuTriggerMode:Ye,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:dt,draggedPathSet:pt,dragTarget:mt,gitLaneActive:rt,gitStatusByPath:n,handleRowDragEnd:Zt,handleRowDragStart:Xt,handleRowTouchStart:Qt,ignoredGitDirectories:r,ignoredInheritanceCache:ye,instanceId:o,itemHeight:s,onKeyDown:$t,onRowClick:In,openContextMenuForRow:Ft,registerButton:$e,registerRenameInput:tt,renameView:at,renderDecorationForRow:Dt,resolveIcon:it,shouldSuppressContextMenu:Rt,visualFocusPath:Dn},zn={...Rn,registerButton:et};return Y(`div`,{ref:S,id:gt,"data-file-tree-context-menu-button-visibility":P&&Xe?Ze:void 0,"data-file-tree-context-menu-trigger-mode":P?Ye:void 0,"data-file-tree-has-context-menu-action-lane":P&&Xe?`true`:void 0,"data-file-tree-has-git-lane":rt?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:dt?fn:void 0,onDragOver:dt?dn:void 0,onDrop:dt?pn:void 0,onKeyDown:$t,onPointerLeave:P?un:void 0,onPointerOver:P?ln:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[Y(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:Tn}}),Y(`slot`,{name:Uu,"data-type":`header-slot`}),f?Y(`div`,{"data-file-tree-search-container":!0,"data-open":ct?`true`:`false`,children:Y(`input`,{ref:ee,"aria-activedescendant":En,"aria-controls":gt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ve?`true`:void 0,value:lt,onBlur:()=>{d===`retain`&&!Ue.current||t.closeSearch()},onFocus:We,onPointerDown:We,onInput:e=>{We();let n=e.currentTarget;t.setSearch(n.value)}})}):null,Y(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&qe&&xt.length>0?Y(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:Y(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${_t}px`},children:xt.map((e,t)=>Rv(zn,e.row,`sticky:${ev(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${xt.length-t}`}}))})}):null,Y(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${Ct}px`},children:[Y(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${hn}px`}}),Y(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${mn}px`,top:`${gn}px`,bottom:`${_n}px`},children:[zv(Rn,bt,Tt),yn!=null&&bn!=null?Rv(Rn,yn,`parked:${yn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:ht===yn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${bn}px`}}):null,Cn!=null&&wn!=null?Rv(Rn,Cn,`parked-drag:${Cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${wn}px`}}):null]})]})]}),P?Y(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":jn?`true`:`false`,style:Pn,children:[Y(`button`,{ref:v,type:`button`,"data-type":Gu,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":N==null?`false`:`true`,"data-visible":An?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),N!=null){Nt();return}Ln()},tabIndex:-1,style:Fn,children:Y(Pg,{...it(`file-tree-icon-ellipsis`)})}),N==null?null:Y(`slot`,{name:Wu})]}):null,N==null?null:Y(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Nt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Nt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var Vv={hydrateRoot:(e,t)=>{kg(ag(Bv,t),e)},renderRoot:(e,t)=>{Og(ag(Bv,t),e)},unmountRoot:e=>{Og(null,e)}};function Hv(e,t){Vv.renderRoot(e,t)}function Uv(e,t){Vv.hydrateRoot(e,t)}function Wv(e){Vv.unmountRoot(e)}var Gv=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}};Array.isArray;var Kv=0;function qv(e){return e!=null&&e.length>0?e:(Kv+=1,`pst_ft_${Kv}`)}function Jv({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??Nm)}function Yv(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function Xv(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function Zv(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var Qv=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new Gv;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=qv(a),this.#p=Fh(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=Mm(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new Ah({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(Wv(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=Ih(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&Hv(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),Hv(t.wrapper,this.#w()))}setGitStatus(e){let t=Fh(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&Hv(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),Hv(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),Uv(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),Hv(r,this.#w())}#C(){return{initialViewportHeight:Jv({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(Uu,e());return}this.#l.setSlotHtml(Uu,this.#e?.header?.html??null)}#k(e){let t=Zv(e).find(e=>Xv(e)),n=Yv(Nu(qu(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=Zv(e),n=t.find(e=>Xv(e)),r=t.filter(e=>e!==n),i=qu(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=Yv(i);if(a==null){for(let e of r)e.remove();return}if(r.length!==1||r[0].outerHTML!==a.outerHTML){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=qu(this.#m);t.colored&&Fu(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${zu}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}(this.#g?.parentNode!==e||this.#_!==this.#h)&&(this.#g??=document.createElement(`style`),this.#g.setAttribute(zu,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=Lm(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return Um(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},$v=`
6210
6257
  :host {
6211
6258
  --file-tree-font-family: var(--ui, system-ui, sans-serif);
6212
6259
  --file-tree-font-size: 12.5px;
@@ -6222,7 +6269,7 @@ slicc-dock-tree .dock-tree__preview--active {
6222
6269
  --file-tree-git-deleted-color: var(--rose, #d1242f);
6223
6270
  --file-tree-git-untracked-color: var(--txt-3, #717171);
6224
6271
  }
6225
- `,Xv=`
6272
+ `,ey=`
6226
6273
  slicc-file-tree {
6227
6274
  display: block;
6228
6275
  box-sizing: border-box;
@@ -6235,7 +6282,7 @@ slicc-file-tree {
6235
6282
  font-family: var(--ui);
6236
6283
  font-size: 13px;
6237
6284
  }
6238
- `,Zv=`slicc-file-tree-style`;function Qv(e){if(e.getElementById(Zv))return;let t=e.createElement(`style`);t.id=Zv,t.textContent=Xv,(e.head??e.documentElement).appendChild(t)}function $v(e){return e?.isDirectory()?e:null}function ey(e){return e.replace(/^\/+/,``)}function ty(e){return e<1024?`${e}B`:e<1048576?`${Math.round(e/1024)}K`:e<1073741824?`${(e/1048576).toFixed(1)}M`:`${(e/1073741824).toFixed(1)}G`}function ny(e){let t=[],n=new Map,r=[],i=e=>{for(let a of e){if(a.kind===`group`)continue;let e=ey(a.id);if(a.kind===`dir`){n.set(e,{id:a.id,path:a.path??a.id,kind:`directory`}),a.open&&r.push(e),a.children.length===0?t.push(e):i(a.children);continue}t.push(e),n.set(e,{id:a.id,path:a.path??a.label,kind:`file`,...a.size===void 0?{}:{size:a.size}})}};return i(e),{paths:t,meta:n,initiallyOpen:r}}A(`slicc-file-tree`,class extends HTMLElement{#e=[];#t=new Map;#n=null;#r=null;#i=[];#a=null;#o=!1;#s=null;static get observedAttributes(){return[`selected`]}connectedCallback(){Qv(this.ownerDocument),this.#r||(this.#r=document.createElement(`div`),this.#r.style.cssText=`display:flex;flex-direction:column;height:100%;min-height:0;`,this.appendChild(this.#r)),this.#d()}disconnectedCallback(){this.#n?.unmount(),this.#n=null}attributeChangedCallback(e,t,n){e===`selected`&&n!==this.#a&&(this.#a=n,this.#u())}get items(){return this.#e.slice()}set items(e){this.#e=Array.isArray(e)?e.slice():[],this.#d()}get gitStatus(){return this.#i.slice()}set gitStatus(e){this.#i=Array.isArray(e)?e.slice():[],this.#d()}get selected(){return this.#a}set selected(e){e===null?this.removeAttribute(`selected`):this.setAttribute(`selected`,e)}selectFile(e){let t=this.#t.get(ey(e));if(t){this.#o=!0;try{this.selected=e}finally{this.#o=!1}this.#u(),this.#c(`file-select`,{id:e,path:t.path})}}toggleDir(e){let t=$v(this.#n?.getItem(ey(e)));t&&(t.toggle(),this.#c(`dir-toggle`,{id:e,open:t.isExpanded()}))}isDirOpen(e){return $v(this.#n?.getItem(ey(e)))?.isExpanded()===!0}previewFile(e){let t=this.#t.get(ey(e));t?.kind===`file`&&this.#c(`file-preview`,{id:e,path:t.path})}#c(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}#l(){let e=this.#n;if(!e)return;let t=e.getVisibleCount();if(t===0)return;let n=e.getVisibleRows(0,t);this.#s=n.filter(e=>e.isExpanded).map(e=>e.path)}#u(){let e=this.#a;if(!(!e||!this.#n)){this.#o=!0;try{this.#n.getItem(ey(e))?.select()}finally{this.#o=!1}}}#d(){if(!this.isConnected||!this.#r)return;let{paths:e,meta:t,initiallyOpen:n}=ny(this.#e);this.#t=t,this.#l();let r=this.#s??n;if(this.#n?.unmount(),this.#r.replaceChildren(),e.length===0){this.#n=null;return}let i=new Jv({preparedInput:Em(e),gitStatus:this.#i,search:!0,initialVisibleRowCount:40,renaming:!1,dragAndDrop:!1,unsafeCSS:Yv,initialExpandedPaths:r,...this.#a?{initialSelectedPaths:[ey(this.#a)]}:{},onSelectionChange:e=>{if(this.#o)return;let t=e[0];if(t===void 0)return;let n=this.#t.get(t);n&&(this.#a=n.id,this.setAttribute(`selected`,n.id),this.#c(`file-select`,{id:n.id,path:n.path}))},renderRowDecoration:({row:e})=>{let t=this.#t.get(e.path);return!t||t.size===void 0?null:{text:ty(t.size)}},composition:{contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`,onOpen:(e,t)=>{let n=this.#t.get(e.path);t.close({restoreFocus:!1}),this.#c(`file-overflow`,{id:n?.id??e.path,path:n?.path??e.path,anchor:t.anchorElement,kind:e.kind})}}}});i.render({containerWrapper:this.#r}),this.#n=i,this.#f()}#f(){let e=this.#n?.getFileTreeContainer();if(!e)return;let t=()=>{let e=this.#n?.getFocusedPath()??this.#n?.getSelectedPaths()[0],t=e==null?null:this.#t.get(e);t&&this.previewFile(t.id)};e.addEventListener(`dblclick`,t),e.addEventListener(`keydown`,e=>{e.key===`Enter`&&t()})}});var ry=`
6285
+ `,ty=`slicc-file-tree-style`;function ny(e){if(e.getElementById(ty))return;let t=e.createElement(`style`);t.id=ty,t.textContent=ey,(e.head??e.documentElement).appendChild(t)}function ry(e){return e?.isDirectory()?e:null}function iy(e){return e.replace(/^\/+/,``)}function ay(e){return e<1024?`${e}B`:e<1048576?`${Math.round(e/1024)}K`:e<1073741824?`${(e/1048576).toFixed(1)}M`:`${(e/1073741824).toFixed(1)}G`}function oy(e){let t=[],n=new Map,r=[],i=e=>{for(let a of e){if(a.kind===`group`)continue;let e=iy(a.id);if(a.kind===`dir`){n.set(e,{id:a.id,path:a.path??a.id,kind:`directory`}),a.open&&r.push(e),a.children.length===0?t.push(e):i(a.children);continue}t.push(e),n.set(e,{id:a.id,path:a.path??a.label,kind:`file`,...a.size===void 0?{}:{size:a.size}})}};return i(e),{paths:t,meta:n,initiallyOpen:r}}A(`slicc-file-tree`,class extends HTMLElement{#e=[];#t=new Map;#n=null;#r=null;#i=[];#a=null;#o=!1;#s=null;static get observedAttributes(){return[`selected`]}connectedCallback(){ny(this.ownerDocument),this.#r||(this.#r=document.createElement(`div`),this.#r.style.cssText=`display:flex;flex-direction:column;height:100%;min-height:0;`,this.appendChild(this.#r)),this.#d()}disconnectedCallback(){this.#n?.unmount(),this.#n=null}attributeChangedCallback(e,t,n){e===`selected`&&n!==this.#a&&(this.#a=n,this.#u())}get items(){return this.#e.slice()}set items(e){this.#e=Array.isArray(e)?e.slice():[],this.#d()}get gitStatus(){return this.#i.slice()}set gitStatus(e){this.#i=Array.isArray(e)?e.slice():[],this.#d()}get selected(){return this.#a}set selected(e){e===null?this.removeAttribute(`selected`):this.setAttribute(`selected`,e)}selectFile(e){let t=this.#t.get(iy(e));if(t){this.#o=!0;try{this.selected=e}finally{this.#o=!1}this.#u(),this.#c(`file-select`,{id:e,path:t.path})}}toggleDir(e){let t=ry(this.#n?.getItem(iy(e)));t&&(t.toggle(),this.#c(`dir-toggle`,{id:e,open:t.isExpanded()}))}isDirOpen(e){return ry(this.#n?.getItem(iy(e)))?.isExpanded()===!0}previewFile(e){let t=this.#t.get(iy(e));t?.kind===`file`&&this.#c(`file-preview`,{id:e,path:t.path})}#c(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}#l(){let e=this.#n;if(!e)return;let t=e.getVisibleCount();if(t===0)return;let n=e.getVisibleRows(0,t);this.#s=n.filter(e=>e.isExpanded).map(e=>e.path)}#u(){let e=this.#a;if(!(!e||!this.#n)){this.#o=!0;try{this.#n.getItem(iy(e))?.select()}finally{this.#o=!1}}}#d(){if(!this.isConnected||!this.#r)return;let{paths:e,meta:t,initiallyOpen:n}=oy(this.#e);this.#t=t,this.#l();let r=this.#s??n;if(this.#n?.unmount(),this.#r.replaceChildren(),e.length===0){this.#n=null;return}let i=new Qv({preparedInput:Am(e),gitStatus:this.#i,search:!0,initialVisibleRowCount:40,renaming:!1,dragAndDrop:!1,unsafeCSS:$v,initialExpandedPaths:r,...this.#a?{initialSelectedPaths:[iy(this.#a)]}:{},onSelectionChange:e=>{if(this.#o)return;let t=e[0];if(t===void 0)return;let n=this.#t.get(t);n&&(this.#a=n.id,this.setAttribute(`selected`,n.id),this.#c(`file-select`,{id:n.id,path:n.path}))},renderRowDecoration:({row:e})=>{let t=this.#t.get(e.path);return!t||t.size===void 0?null:{text:ay(t.size)}},composition:{contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`,onOpen:(e,t)=>{let n=this.#t.get(e.path);t.close({restoreFocus:!1}),this.#c(`file-overflow`,{id:n?.id??e.path,path:n?.path??e.path,anchor:t.anchorElement,kind:e.kind})}}}});i.render({containerWrapper:this.#r}),this.#n=i,this.#f()}#f(){let e=this.#n?.getFileTreeContainer();if(!e)return;let t=()=>{let e=this.#n?.getFocusedPath()??this.#n?.getSelectedPaths()[0],t=e==null?null:this.#t.get(e);t&&this.previewFile(t.id)};e.addEventListener(`dblclick`,t),e.addEventListener(`keydown`,e=>{e.key===`Enter`&&t()})}});var sy=`
6239
6286
  slicc-surface {
6240
6287
  position: absolute;
6241
6288
  inset: 0;
@@ -6267,7 +6314,7 @@ slicc-surface:fullscreen {
6267
6314
  background: var(--canvas, #fff);
6268
6315
  position: fixed;
6269
6316
  }
6270
- `,iy=`slicc-surface-style`;function ay(e){if(e.getElementById(iy))return;let t=e.createElement(`style`);t.id=iy,t.textContent=ry,(e.head??e.documentElement).appendChild(t)}function oy(e){return e===`block`||e===`column`?e:`flex`}A(`slicc-surface`,class extends HTMLElement{static observedAttributes=[`surface-id`,`active`,`layout`];connectedCallback(){ay(this.ownerDocument),this.#e()}attributeChangedCallback(e,t,n){this.isConnected&&(e===`surface-id`?this.#e():e===`active`&&t!==n&&this.dispatchEvent(new CustomEvent(`surface-toggle`,{bubbles:!0,composed:!0,detail:{surfaceId:this.surfaceId,active:this.active,layout:this.layout}})))}get surfaceId(){return this.getAttribute(`surface-id`)}set surfaceId(e){e==null?this.removeAttribute(`surface-id`):this.setAttribute(`surface-id`,e)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,e)}get layout(){return oy(this.getAttribute(`layout`))}set layout(e){this.setAttribute(`layout`,oy(e))}#e(){let e=this.surfaceId;e==null?delete this.dataset.s:this.dataset.s=e}});var sy=`/**
6317
+ `,cy=`slicc-surface-style`;function ly(e){if(e.getElementById(cy))return;let t=e.createElement(`style`);t.id=cy,t.textContent=sy,(e.head??e.documentElement).appendChild(t)}function uy(e){return e===`block`||e===`column`?e:`flex`}A(`slicc-surface`,class extends HTMLElement{static observedAttributes=[`surface-id`,`active`,`layout`];connectedCallback(){ly(this.ownerDocument),this.#e()}attributeChangedCallback(e,t,n){this.isConnected&&(e===`surface-id`?this.#e():e===`active`&&t!==n&&this.dispatchEvent(new CustomEvent(`surface-toggle`,{bubbles:!0,composed:!0,detail:{surfaceId:this.surfaceId,active:this.active,layout:this.layout}})))}get surfaceId(){return this.getAttribute(`surface-id`)}set surfaceId(e){e==null?this.removeAttribute(`surface-id`):this.setAttribute(`surface-id`,e)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,e)}get layout(){return uy(this.getAttribute(`layout`))}set layout(e){this.setAttribute(`layout`,uy(e))}#e(){let e=this.surfaceId;e==null?delete this.dataset.s:this.dataset.s=e}});var dy=`/**
6271
6318
  * Copyright (c) 2014 The xterm.js authors. All rights reserved.
6272
6319
  * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
6273
6320
  * https://github.com/chjj/term.js
@@ -6552,7 +6599,7 @@ slicc-surface:fullscreen {
6552
6599
  .xterm .xterm-scrollable-element > .shadow.top.left {
6553
6600
  box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
6554
6601
  }
6555
- `,cy={background:`#0c0c0e`,foreground:`#e7e7ea`,cursor:`#e7e7ea`,cursorAccent:`#0c0c0e`,selectionBackground:`#8b5cf64d`,selectionForeground:`#ffffff`,black:`#0c0c0e`,red:`#f43f5e`,green:`#5bd17b`,yellow:`#f59e0b`,blue:`#3b82f6`,magenta:`#8b5cf6`,cyan:`#06b6d4`,white:`#e7e7ea`,brightBlack:`#8a8a93`,brightRed:`#fb7185`,brightGreen:`#86efac`,brightYellow:`#fbbf24`,brightBlue:`#60a5fa`,brightMagenta:`#a78bfa`,brightCyan:`#22d3ee`,brightWhite:`#ffffff`},ly=`
6602
+ `,fy={background:`#0c0c0e`,foreground:`#e7e7ea`,cursor:`#e7e7ea`,cursorAccent:`#0c0c0e`,selectionBackground:`#8b5cf64d`,selectionForeground:`#ffffff`,black:`#0c0c0e`,red:`#f43f5e`,green:`#5bd17b`,yellow:`#f59e0b`,blue:`#3b82f6`,magenta:`#8b5cf6`,cyan:`#06b6d4`,white:`#e7e7ea`,brightBlack:`#8a8a93`,brightRed:`#fb7185`,brightGreen:`#86efac`,brightYellow:`#fbbf24`,brightBlue:`#60a5fa`,brightMagenta:`#a78bfa`,brightCyan:`#22d3ee`,brightWhite:`#ffffff`},py=`
6556
6603
  :host {
6557
6604
  display: flex;
6558
6605
  flex-direction: column;
@@ -6593,7 +6640,7 @@ slicc-surface:fullscreen {
6593
6640
  /* xterm.js wants its container to size the canvas; let it fill. */
6594
6641
  .host .xterm { height: 100%; }
6595
6642
  .host .xterm-viewport { overflow-y: auto; }
6596
- `,uy=null;function dy(){return uy||=[M(sy),M(ly)],uy}var fy=class extends HTMLElement{static observedAttributes=[`label`,`hide-header`];#e;#t=null;#n=null;#r=null;#i=null;#a=[];#o=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`})}connectedCallback(){this.#o=!1,this.#s(),this.#c()}disconnectedCallback(){this.#l()}attributeChangedCallback(e){if(this.isConnected&&e===`label`){let e=this.#e.querySelector(`.title`);e&&(e.textContent=this.label)}}get label(){return this.getAttribute(`label`)??`Terminal`}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get hideHeader(){return this.hasAttribute(`hide-header`)}set hideHeader(e){this.toggleAttribute(`hide-header`,e)}get terminal(){return this.#n}write(e){this.#n?this.#n.write(e):this.#a.push(e)}writeln(e){this.#n?this.#n.writeln(e):this.#a.push(`${e}\r\n`)}clear(){this.#n?this.#n.clear():this.#a.length=0}focus(){this.#n?.focus()}fit(){this.#r?.fit()}#s(){if(this.#t)return;this.#e.adoptedStyleSheets=dy();let e=j(`div`,{class:`hd`,part:`header`},n(`terminal`,{size:14}),j(`span`,{class:`title`},this.label),j(`span`,{class:`spacer`})),t=j(`div`,{class:`host`,part:`host`});this.#e.replaceChildren(e,t),this.#t=t}async#c(){if(this.#n||this.#o)return;let[{Terminal:e},{FitAddon:n}]=await Promise.all([t(()=>import(`./xterm-BSL5rRqA.js`),[]),t(()=>import(`./addon-fit-DIOBYJe3.js`),[])]);if(this.#o||!this.#t)return;let r=new e({cursorBlink:!py(),fontSize:12,lineHeight:1.25,fontFamily:`'IBM Plex Mono', 'Source Code Pro', 'JetBrains Mono', ui-monospace, monospace`,theme:cy,convertEol:!0,scrollback:2e3}),i=new n;if(r.loadAddon(i),r.open(this.#t),r.onData(e=>{this.dispatchEvent(new CustomEvent(`terminal-data`,{detail:e,bubbles:!0,composed:!0}))}),this.#n=r,this.#r=i,i.fit(),this.#a.length){for(let e of this.#a)r.write(e);this.#a.length=0}typeof ResizeObserver==`function`&&(this.#i=new ResizeObserver(()=>this.#r?.fit()),this.#i.observe(this.#t))}#l(){this.#o=!0,this.#i?.disconnect(),this.#i=null,this.#n?.dispose(),this.#n=null,this.#r=null,this.#a.length=0}};function py(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}A(`slicc-terminal`,fy);var my=`slicc_monitor_collapsed`;function hy(){try{let e=localStorage.getItem(my);return new Set(e?JSON.parse(e):[])}catch{return new Set}}function gy(e){try{localStorage.setItem(my,JSON.stringify([...e]))}catch{}}var _y=`
6643
+ `,my=null;function hy(){return my||=[M(dy),M(py)],my}var gy=class extends HTMLElement{static observedAttributes=[`label`,`hide-header`];#e;#t=null;#n=null;#r=null;#i=null;#a=[];#o=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`})}connectedCallback(){this.#o=!1,this.#s(),this.#c()}disconnectedCallback(){this.#l()}attributeChangedCallback(e){if(this.isConnected&&e===`label`){let e=this.#e.querySelector(`.title`);e&&(e.textContent=this.label)}}get label(){return this.getAttribute(`label`)??`Terminal`}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get hideHeader(){return this.hasAttribute(`hide-header`)}set hideHeader(e){this.toggleAttribute(`hide-header`,e)}get terminal(){return this.#n}write(e){this.#n?this.#n.write(e):this.#a.push(e)}writeln(e){this.#n?this.#n.writeln(e):this.#a.push(`${e}\r\n`)}clear(){this.#n?this.#n.clear():this.#a.length=0}focus(){this.#n?.focus()}fit(){this.#r?.fit()}#s(){if(this.#t)return;this.#e.adoptedStyleSheets=hy();let e=j(`div`,{class:`hd`,part:`header`},n(`terminal`,{size:14}),j(`span`,{class:`title`},this.label),j(`span`,{class:`spacer`})),t=j(`div`,{class:`host`,part:`host`});this.#e.replaceChildren(e,t),this.#t=t}async#c(){if(this.#n||this.#o)return;let[{Terminal:e},{FitAddon:n}]=await Promise.all([t(()=>import(`./xterm-BSL5rRqA.js`),[]),t(()=>import(`./addon-fit-DIOBYJe3.js`),[])]);if(this.#o||!this.#t)return;let r=new e({cursorBlink:!_y(),fontSize:12,lineHeight:1.25,fontFamily:`'IBM Plex Mono', 'Source Code Pro', 'JetBrains Mono', ui-monospace, monospace`,theme:fy,convertEol:!0,scrollback:2e3}),i=new n;if(r.loadAddon(i),r.open(this.#t),r.onData(e=>{this.dispatchEvent(new CustomEvent(`terminal-data`,{detail:e,bubbles:!0,composed:!0}))}),this.#n=r,this.#r=i,i.fit(),this.#a.length){for(let e of this.#a)r.write(e);this.#a.length=0}typeof ResizeObserver==`function`&&(this.#i=new ResizeObserver(()=>this.#r?.fit()),this.#i.observe(this.#t))}#l(){this.#o=!0,this.#i?.disconnect(),this.#i=null,this.#n?.dispose(),this.#n=null,this.#r=null,this.#a.length=0}};function _y(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}A(`slicc-terminal`,gy);var vy=`slicc_monitor_collapsed`;function yy(){try{let e=localStorage.getItem(vy);return new Set(e?JSON.parse(e):[])}catch{return new Set}}function by(e){try{localStorage.setItem(vy,JSON.stringify([...e]))}catch{}}var xy=`
6597
6644
  slicc-monitor {
6598
6645
  display: block;
6599
6646
  box-sizing: border-box;
@@ -7009,4 +7056,4 @@ slicc-monitor {
7009
7056
  transition-duration: 0.01ms;
7010
7057
  }
7011
7058
  }
7012
- `,vy=`slicc-monitor-style`;function yy(e){if(e.getElementById(vy))return;let t=e.createElement(`style`);t.id=vy,t.textContent=_y,(e.head??e.documentElement).appendChild(t)}function by(e){return e.status?e.status:e.error?`error`:e.active?`active`:`idle`}function xy(e){return e===`active`?`Active`:e===`error`?`Error`:e===`warn`?`Warning`:`Idle`}function Sy(e){let t=by(e),r=j(`span`,{class:`monitor-row__badges`});for(let t of e.badges??[])r.appendChild(j(`span`,{class:`monitor-row__badge`},t));let i=j(`span`,{class:`monitor-row__headline`},j(`span`,{class:`monitor-row__name`},e.name));r.childElementCount>0&&i.appendChild(r);let a=j(`span`,{class:`monitor-row__content`},i);return e.sublabel&&a.appendChild(j(`span`,{class:`monitor-row__sublabel`},e.sublabel)),j(`li`,{class:`monitor-row`,"data-status":t},j(`span`,{class:`monitor-row__icon`},n(e.icon??`box`,{size:16})),a,j(`span`,{class:`monitor-row__aside`},j(`span`,{class:`monitor-row__meta`},e.meta),j(`span`,{class:`monitor-row__state monitor-row__state--${t}`},j(`span`,{class:`monitor-row__dot`,"aria-hidden":`true`}),xy(t))))}function Cy(e){return j(`div`,{class:`monitor-empty`,role:`status`},j(`span`,{class:`monitor-empty__icon`},n(`inbox`,{size:18})),j(`span`,{class:`monitor-empty__title`},`No ${e.label.toLocaleLowerCase()} yet`),j(`span`,{class:`monitor-empty__text`},e.emptyText??`${e.label} will appear here when available.`))}function wy(e,t,r,i){let a=t.has(e.id),o=e.count===0?`monitor-section monitor-section--empty`:`monitor-section`,s=[j(`span`,{class:`monitor-section__toggle`,"aria-hidden":`true`},n(a?`chevron-right`:`chevron-down`,{size:15})),j(`span`,{class:`monitor-section__heading`},j(`span`,{class:`monitor-section__title`},e.label),e.meta?j(`span`,{class:`monitor-section__meta`},e.meta):null)];s.push(j(`span`,{class:`monitor-section__count`},String(e.count)));let c=j(`button`,{class:`monitor-section__header`,type:`button`},...s);c.setAttribute(`aria-expanded`,String(!a)),c.setAttribute(`aria-controls`,i),c.addEventListener(`click`,()=>r(e.id));let l=j(`div`,{class:`monitor-section__body`,id:i});if(a&&l.setAttribute(`hidden`,``),e.rows.length===0)l.appendChild(Cy(e));else{let t=j(`ul`,{class:`monitor-section__list`});for(let n of e.rows)t.appendChild(Sy(n));l.appendChild(t)}return j(`section`,{class:o,"data-section":e.id,"data-accent":e.accent??`neutral`},c,l)}function Ty(e,t){return j(`div`,{class:`monitor-summary__metric`},j(`dt`,null,e),j(`dd`,null,t))}function Ey(e,t){let r=e.flatMap(e=>e.rows),i=r.filter(e=>by(e)===`active`).length,a=r.filter(e=>[`warn`,`error`].includes(by(e))).length,o=e.reduce((e,t)=>e+(t.id===`cost`?0:t.count),0),s=e.find(e=>e.id===`cost`)?.meta??`—`,c=j(`button`,{class:`monitor-summary__refresh`,type:`button`,"aria-label":`Refresh monitor data`},n(`refresh-cw`,{size:15}),j(`span`,null,`Refresh`));return c.addEventListener(`click`,t),j(`header`,{class:`monitor-summary`},j(`div`,{class:`monitor-summary__topline`},j(`span`,{class:`monitor-summary__mark`},n(`activity`,{size:19})),j(`div`,{class:`monitor-summary__copy`},j(`h2`,{class:`monitor-summary__title`},`Live monitor`),j(`p`,{class:`monitor-summary__subtitle`},`System activity and connections at a glance`)),c),j(`dl`,{class:`monitor-summary__metrics`},Ty(`Tracked`,String(o)),Ty(`Active`,String(i)),Ty(`Attention`,String(a)),Ty(`Session cost`,s)))}function Dy(e){return{...e,rows:e.rows.map(e=>({...e,badges:e.badges?.slice()}))}}var Oy=0;A(`slicc-monitor`,class extends HTMLElement{#e=[];#t=new Set;#n=!1;#r=++Oy;connectedCallback(){yy(this.ownerDocument),this.#n||=(this.#t=hy(),!0),this.#e.length>0&&this.#i()}get sections(){return this.#e.map(Dy)}set sections(e){this.#e=Array.isArray(e)?e.map(Dy):[],this.isConnected&&this.#i()}#i(){let e=Ey(this.#e,()=>{this.dispatchEvent(new CustomEvent(`slicc-monitor-refresh`,{bubbles:!0,composed:!0}))}),t=j(`div`,{class:`monitor-sections`});for(let e of this.#e){let n=e.id.replace(/[^a-z0-9_-]/gi,`-`);t.appendChild(wy(e,this.#t,e=>{this.#t.has(e)?this.#t.delete(e):this.#t.add(e),gy(this.#t),this.#i()},`monitor-${this.#r}-${n}`))}this.replaceChildren(),we(this,[e,t])}});var ky=e({CHAT_SURFACE_ID:()=>Wc,DEFAULT_LAUNCHER_CORNER:()=>ee,DEFAULT_LAUNCHER_FOLLOWER_STATUS:()=>T,HOLD_TO_ENABLE_MS:()=>en,LAUNCHER_FOLLOWER_STATUS_ATTR:()=>E,LAYOUT_SCHEMA_VERSION:()=>1,MACHINE_WRITTEN_MEMORY_PATH:()=>MACHINE_WRITTEN_MEMORY_PATH,PANEL_MARKER_ATTR:()=>Sa,REDACTED_REAL_WORLD_MEMORY_PATH:()=>REDACTED_REAL_WORLD_MEMORY_PATH,SYNTHETIC_MEMORY_PATH:()=>SYNTHETIC_MEMORY_PATH,SliccImagePreview:()=>qt,TOKENS_CSS:()=>jc,ensureGlobalTokens:()=>Nc,followSystemTheme:()=>Fc,setTheme:()=>Pc});export{ca as a,_o as i,Nc as n,Ui as o,Fc as r,ky as t};
7059
+ `,Sy=`slicc-monitor-style`;function Cy(e){if(e.getElementById(Sy))return;let t=e.createElement(`style`);t.id=Sy,t.textContent=xy,(e.head??e.documentElement).appendChild(t)}function wy(e){return e.status?e.status:e.error?`error`:e.active?`active`:`idle`}function Ty(e){return e===`active`?`Active`:e===`error`?`Error`:e===`warn`?`Warning`:`Idle`}function Ey(e){let t=wy(e),r=j(`span`,{class:`monitor-row__badges`});for(let t of e.badges??[])r.appendChild(j(`span`,{class:`monitor-row__badge`},t));let i=j(`span`,{class:`monitor-row__headline`},j(`span`,{class:`monitor-row__name`},e.name));r.childElementCount>0&&i.appendChild(r);let a=j(`span`,{class:`monitor-row__content`},i);return e.sublabel&&a.appendChild(j(`span`,{class:`monitor-row__sublabel`},e.sublabel)),j(`li`,{class:`monitor-row`,"data-status":t},j(`span`,{class:`monitor-row__icon`},n(e.icon??`box`,{size:16})),a,j(`span`,{class:`monitor-row__aside`},j(`span`,{class:`monitor-row__meta`},e.meta),j(`span`,{class:`monitor-row__state monitor-row__state--${t}`},j(`span`,{class:`monitor-row__dot`,"aria-hidden":`true`}),Ty(t))))}function Dy(e){return j(`div`,{class:`monitor-empty`,role:`status`},j(`span`,{class:`monitor-empty__icon`},n(`inbox`,{size:18})),j(`span`,{class:`monitor-empty__title`},`No ${e.label.toLocaleLowerCase()} yet`),j(`span`,{class:`monitor-empty__text`},e.emptyText??`${e.label} will appear here when available.`))}function Oy(e,t,r,i){let a=t.has(e.id),o=e.count===0?`monitor-section monitor-section--empty`:`monitor-section`,s=[j(`span`,{class:`monitor-section__toggle`,"aria-hidden":`true`},n(a?`chevron-right`:`chevron-down`,{size:15})),j(`span`,{class:`monitor-section__heading`},j(`span`,{class:`monitor-section__title`},e.label),e.meta?j(`span`,{class:`monitor-section__meta`},e.meta):null)];s.push(j(`span`,{class:`monitor-section__count`},String(e.count)));let c=j(`button`,{class:`monitor-section__header`,type:`button`},...s);c.setAttribute(`aria-expanded`,String(!a)),c.setAttribute(`aria-controls`,i),c.addEventListener(`click`,()=>r(e.id));let l=j(`div`,{class:`monitor-section__body`,id:i});if(a&&l.setAttribute(`hidden`,``),e.rows.length===0)l.appendChild(Dy(e));else{let t=j(`ul`,{class:`monitor-section__list`});for(let n of e.rows)t.appendChild(Ey(n));l.appendChild(t)}return j(`section`,{class:o,"data-section":e.id,"data-accent":e.accent??`neutral`},c,l)}function ky(e,t){return j(`div`,{class:`monitor-summary__metric`},j(`dt`,null,e),j(`dd`,null,t))}function Ay(e,t){let r=e.flatMap(e=>e.rows),i=r.filter(e=>wy(e)===`active`).length,a=r.filter(e=>[`warn`,`error`].includes(wy(e))).length,o=e.reduce((e,t)=>e+(t.id===`cost`?0:t.count),0),s=e.find(e=>e.id===`cost`)?.meta??`—`,c=j(`button`,{class:`monitor-summary__refresh`,type:`button`,"aria-label":`Refresh monitor data`},n(`refresh-cw`,{size:15}),j(`span`,null,`Refresh`));return c.addEventListener(`click`,t),j(`header`,{class:`monitor-summary`},j(`div`,{class:`monitor-summary__topline`},j(`span`,{class:`monitor-summary__mark`},n(`activity`,{size:19})),j(`div`,{class:`monitor-summary__copy`},j(`h2`,{class:`monitor-summary__title`},`Live monitor`),j(`p`,{class:`monitor-summary__subtitle`},`System activity and connections at a glance`)),c),j(`dl`,{class:`monitor-summary__metrics`},ky(`Tracked`,String(o)),ky(`Active`,String(i)),ky(`Attention`,String(a)),ky(`Session cost`,s)))}function jy(e){return{...e,rows:e.rows.map(e=>({...e,badges:e.badges?.slice()}))}}var My=0;A(`slicc-monitor`,class extends HTMLElement{#e=[];#t=new Set;#n=!1;#r=++My;connectedCallback(){Cy(this.ownerDocument),this.#n||=(this.#t=yy(),!0),this.#e.length>0&&this.#i()}get sections(){return this.#e.map(jy)}set sections(e){this.#e=Array.isArray(e)?e.map(jy):[],this.isConnected&&this.#i()}#i(){let e=Ay(this.#e,()=>{this.dispatchEvent(new CustomEvent(`slicc-monitor-refresh`,{bubbles:!0,composed:!0}))}),t=j(`div`,{class:`monitor-sections`});for(let e of this.#e){let n=e.id.replace(/[^a-z0-9_-]/gi,`-`);t.appendChild(Oy(e,this.#t,e=>{this.#t.has(e)?this.#t.delete(e):this.#t.add(e),by(this.#t),this.#i()},`monitor-${this.#r}-${n}`))}this.replaceChildren(),we(this,[e,t])}});var Ny=e({CHAT_SURFACE_ID:()=>Jc,DEFAULT_LAUNCHER_CORNER:()=>ee,DEFAULT_LAUNCHER_FOLLOWER_STATUS:()=>T,HOLD_TO_ENABLE_MS:()=>$t,LAUNCHER_FOLLOWER_STATUS_ATTR:()=>E,LAYOUT_SCHEMA_VERSION:()=>1,MACHINE_WRITTEN_MEMORY_PATH:()=>MACHINE_WRITTEN_MEMORY_PATH,PANEL_MARKER_ATTR:()=>xa,REDACTED_REAL_WORLD_MEMORY_PATH:()=>REDACTED_REAL_WORLD_MEMORY_PATH,SYNTHETIC_MEMORY_PATH:()=>SYNTHETIC_MEMORY_PATH,SliccImagePreview:()=>Kt,TOKENS_CSS:()=>Fc,ensureGlobalTokens:()=>Lc,followSystemTheme:()=>zc,setTheme:()=>Rc});export{sa as a,bo as i,Lc as n,Hi as o,zc as r,Ny as t};