@deslop/workbench 0.0.360 → 0.0.381
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/anthropic-C02QVQ9u.mjs +6313 -0
- package/dist/azure-openai-responses-CUFLNwdy.mjs +207 -0
- package/dist/client/assets/{(home)-DVKAaI4b.js → (home)-BL3S5BVq.js} +1 -1
- package/dist/client/assets/-workbench-terminal-YB9hQXjr.js +145 -0
- package/dist/client/assets/agent-BmwIVlVZ.js +1 -0
- package/dist/client/assets/agent-CE67X_hb.js +2 -0
- package/dist/client/assets/{arc-CuHXSNPr.js → arc-BjSQqbzd.js} +1 -1
- package/dist/client/assets/architectureDiagram-3BPJPVTR-CTWT1AFv.js +36 -0
- package/dist/client/assets/{blockDiagram-GPEHLZMM-D3jiL-uN.js → blockDiagram-GPEHLZMM-CISQUfO9.js} +1 -1
- package/dist/client/assets/{c4Diagram-AAUBKEIU-bA47L7u8.js → c4Diagram-AAUBKEIU-Ct3OGD9a.js} +1 -1
- package/dist/client/assets/channel-S3CdaK6m.js +1 -0
- package/dist/client/assets/{chunk-2J33WTMH-optplvap.js → chunk-2J33WTMH-BUMgKaV6.js} +1 -1
- package/dist/client/assets/{chunk-3OPIFGDE-k7mTnOn5.js → chunk-3OPIFGDE-BlIdNnu8.js} +1 -1
- package/dist/client/assets/{chunk-4BX2VUAB-Co5qfYem.js → chunk-4BX2VUAB-CiBu5cRv.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-7AWIUH7L.js → chunk-55IACEB6-nU8KvKB3.js} +1 -1
- package/dist/client/assets/{chunk-5ZQYHXKU-Bub4jU0C.js → chunk-5ZQYHXKU-DbN9DSns.js} +1 -1
- package/dist/client/assets/{chunk-727SXJPM-DcofuxtV.js → chunk-727SXJPM-DkPu5ecB.js} +2 -2
- package/dist/client/assets/{chunk-AQP2D5EJ-CBwGmuY5.js → chunk-AQP2D5EJ-B8lrSg7a.js} +1 -1
- package/dist/client/assets/{chunk-BSJP7CBP-BInTsaMb.js → chunk-BSJP7CBP-C450xCVa.js} +1 -1
- package/dist/client/assets/{chunk-CSCIHK7Q-BTHSw3Fl.js → chunk-CSCIHK7Q-DoGVP1BZ.js} +2 -2
- package/dist/client/assets/{chunk-FMBD7UC4-BQD4ioRx.js → chunk-FMBD7UC4-cqorOok8.js} +1 -1
- package/dist/client/assets/{chunk-KSCS5N6A-CUDSaUx0.js → chunk-KSCS5N6A-dbmnxO_p.js} +1 -1
- package/dist/client/assets/{chunk-L5ZTLDWV-D0-tvK0S.js → chunk-L5ZTLDWV-D9P-YjsA.js} +1 -1
- package/dist/client/assets/{chunk-LZXEDZCA-BkJ5xlLM.js → chunk-LZXEDZCA-BdVT_AWc.js} +2 -2
- package/dist/client/assets/{chunk-ND2GUHAM-COdW9HuZ.js → chunk-ND2GUHAM-CmHIi1wD.js} +1 -1
- package/dist/client/assets/{chunk-NZK2D7GU-Byrnkfto.js → chunk-NZK2D7GU-hkTOm2qR.js} +1 -1
- package/dist/client/assets/{chunk-O5CBEL6O-C_CProRX.js → chunk-O5CBEL6O-D1fDxsSH.js} +1 -1
- package/dist/client/assets/chunk-QZHKN3VN-BS_CF_l3.js +1 -0
- package/dist/client/assets/chunk-WU5MYG2G-CtG2KJlt.js +1 -0
- package/dist/client/assets/{chunk-XPW4576I-DWr3727k.js → chunk-XPW4576I-BjBK3ctW.js} +2 -2
- package/dist/client/assets/classDiagram-4FO5ZUOK-BdTSUdNF.js +1 -0
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-BdTSUdNF.js +1 -0
- package/dist/client/assets/compiler-runtime-CLAvuQ-D.js +1 -0
- package/dist/client/assets/cose-bilkent-S5V4N54A-BGt2II16.js +1 -0
- package/dist/client/assets/{cytoscape.esm-FqbQrHcz.js → cytoscape.esm-Kic9WIU3.js} +2 -2
- package/dist/client/assets/{dagre-BM42HDAG-Bwiv8kFL.js → dagre-BM42HDAG-CN7Tha00.js} +1 -1
- package/dist/client/assets/{diagram-2AECGRRQ-BY9KXQPi.js → diagram-2AECGRRQ-DnobmroZ.js} +1 -1
- package/dist/client/assets/{diagram-5GNKFQAL-C-jmG8LL.js → diagram-5GNKFQAL-D6NqAeoi.js} +1 -1
- package/dist/client/assets/{diagram-KO2AKTUF-qDHWGr5P.js → diagram-KO2AKTUF-y8QX4vEL.js} +1 -1
- package/dist/client/assets/{diagram-LMA3HP47-Dg8zuIuL.js → diagram-LMA3HP47-DAEPoAHp.js} +1 -1
- package/dist/client/assets/{diagram-OG6HWLK6-DupmLmKo.js → diagram-OG6HWLK6-B3KiYvxM.js} +1 -1
- package/dist/client/assets/dialog-B0kBnYwI.js +153 -0
- package/dist/client/assets/diff-BP9B4x7R.js +2 -0
- package/dist/client/assets/diff-OmMK6IL0.js +221 -0
- package/dist/client/assets/dist-D9sYb5Oa.js +1 -0
- package/dist/client/assets/{erDiagram-TEJ5UH35-DcYoMsDA.js → erDiagram-TEJ5UH35-CbzdEpkS.js} +1 -1
- package/dist/client/assets/external-link-D7Q28KpR.js +1 -0
- package/dist/client/assets/fallbacks-DwGmG_0c.js +16 -0
- package/dist/client/assets/{flowDiagram-I6XJVG4X-xLfWiyaL.js → flowDiagram-I6XJVG4X-C2H7PQev.js} +1 -1
- package/dist/client/assets/ganttDiagram-6RSMTGT7-BZql2QFP.js +292 -0
- package/dist/client/assets/{gitGraphDiagram-PVQCEYII-DE7nmb1q.js → gitGraphDiagram-PVQCEYII-d2_5HIIo.js} +1 -1
- package/dist/client/assets/{index-D1icept3.js → index-Cc-cDoXa.js} +4 -4
- package/dist/client/assets/index-DT_QSnKQ.css +2 -0
- package/dist/client/assets/{infoDiagram-5YYISTIA-CUzdfhph.js → infoDiagram-5YYISTIA-DaDFMb3D.js} +1 -1
- package/dist/client/assets/input-CEh4Uy0l.js +1 -0
- package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-D3h5fT3O.js → ishikawaDiagram-YF4QCWOH-7tWPtPSR.js} +1 -1
- package/dist/client/assets/{journeyDiagram-JHISSGLW-DXqP7IZk.js → journeyDiagram-JHISSGLW-CYDeiigr.js} +1 -1
- package/dist/client/assets/{kanban-definition-UN3LZRKU-BBdz3OGi.js → kanban-definition-UN3LZRKU-BFoF4JfY.js} +3 -3
- package/dist/client/assets/{katex-Vhh-h91d.js → katex-CddkPoXu.js} +1 -1
- package/dist/client/assets/{line-D2nnU070.js → line-CcJ0IOWh.js} +1 -1
- package/dist/client/assets/{linear-BifnMVyn.js → linear-Ct8JHF0c.js} +1 -1
- package/dist/client/assets/mermaid-parser.core-CKHoAf1J.js +2 -2
- package/dist/client/assets/{mindmap-definition-RKZ34NQL-BAbACAeS.js → mindmap-definition-RKZ34NQL-DTgZ_Z5F.js} +1 -1
- package/dist/client/assets/{pieDiagram-4H26LBE5-YjWBEaV3.js → pieDiagram-4H26LBE5-BmpbjVUG.js} +1 -1
- package/dist/client/assets/pierre-dark-vibrant-D4RhcSIK.js +1 -0
- package/dist/client/assets/pierre-light-vibrant-B76X7i5Y.js +1 -0
- package/dist/client/assets/portless-4_iTgOr5.js +1 -0
- package/dist/client/assets/portless-qyhmpSUj.js +2 -0
- package/dist/client/assets/{quadrantDiagram-W4KKPZXB-0qpR8bhI.js → quadrantDiagram-W4KKPZXB-BncnX7WL.js} +1 -1
- package/dist/client/assets/{requirementDiagram-4Y6WPE33-UxrH60_h.js → requirementDiagram-4Y6WPE33-C4viwYDb.js} +1 -1
- package/dist/client/assets/resizable-A9BpOcmt.js +1 -0
- package/dist/client/assets/route-Da0uHKH9.js +45 -0
- package/dist/client/assets/route-ULg8h9n0.js +2 -0
- package/dist/client/assets/run-CCCofwDU.js +2 -0
- package/dist/client/assets/run-D7w-8aQA.js +1 -0
- package/dist/client/assets/{sankeyDiagram-5OEKKPKP-CtfCq9EV.js → sankeyDiagram-5OEKKPKP-cs1kWOqp.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-3UESZ5HK-BgLwmDnV.js → sequenceDiagram-3UESZ5HK-D7Bj1Dg6.js} +1 -1
- package/dist/client/assets/sonner-DgKrvTU1.js +1 -0
- package/dist/client/assets/src-DzxfdEt6.js +1 -0
- package/dist/client/assets/state-_2CmL5IM.js +2 -0
- package/dist/client/assets/{stateDiagram-AJRCARHV--lvnWH2s.js → stateDiagram-AJRCARHV-xBL-crbl.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-ZbAyaVmU.js +1 -0
- package/dist/client/assets/terminal-DJ8tjXNh.js +1 -0
- package/dist/client/assets/terminal-Dx10AUUW.js +2 -0
- package/dist/client/assets/{timeline-definition-PNZ67QCA-BbIMEZmJ.js → timeline-definition-PNZ67QCA-Bs3JkoMQ.js} +2 -2
- package/dist/client/assets/triangle-alert-cDPYgb7f.js +1 -0
- package/dist/client/assets/{vennDiagram-CIIHVFJN-ClrNZ6mc.js → vennDiagram-CIIHVFJN-D25dPloy.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-YWT4CUSO-B104yVOC.js → wardleyDiagram-YWT4CUSO-B7X6xZZ7.js} +1 -1
- package/dist/client/assets/{xychartDiagram-2RQKCTM6-BBRSu-ZO.js → xychartDiagram-2RQKCTM6-Cgc-2R8L.js} +1 -1
- package/dist/client/index.html +13 -14
- package/dist/completionchunk-DDfxP5hO.mjs +5196 -0
- package/dist/dist-CsBDFjO2.mjs +1163 -0
- package/dist/{execAsync-BeHTdVKh.mjs → execAsync-B-b5b4hb.mjs} +2 -2
- package/dist/from-DGwFTZmN.mjs +3845 -0
- package/dist/{getMachineId-bsd-8V0SSHI2.mjs → getMachineId-bsd-C-aUDBo5.mjs} +4 -3
- package/dist/{getMachineId-darwin-fwMRmXNE.mjs → getMachineId-darwin-CQg0u9gI.mjs} +4 -3
- package/dist/{getMachineId-linux-BglPdw6k.mjs → getMachineId-linux-DQmpbzHz.mjs} +3 -2
- package/dist/{getMachineId-unsupported-B6r8oWEG.mjs → getMachineId-unsupported-BT4Te_jg.mjs} +3 -2
- package/dist/{getMachineId-win-Bvbq3C3K.mjs → getMachineId-win-zoUdci1a.mjs} +4 -3
- package/dist/github-copilot-headers-B--aVYl2.mjs +39 -0
- package/dist/google-DHtiCcEt.mjs +348 -0
- package/dist/google-shared-BT0mQb3v.mjs +25358 -0
- package/dist/google-vertex-CRkz0MgQ.mjs +391 -0
- package/dist/hash-CDrrQIkY.mjs +17 -0
- package/dist/headers-m19bM8_9.mjs +9 -0
- package/dist/mistral-DXtHhhUc.mjs +36806 -0
- package/dist/multipart-parser-6y-zJbR0.mjs +295 -0
- package/dist/openai-CUH8rb7p.mjs +6671 -0
- package/dist/openai-codex-responses-BSLixEC8.mjs +1081 -0
- package/dist/openai-completions-CE-LDmL4.mjs +735 -0
- package/dist/openai-prompt-cache-6hf3xB_x.mjs +9 -0
- package/dist/openai-responses-41QiypX_.mjs +217 -0
- package/dist/openai-responses-shared-BAoGGIxP.mjs +415 -0
- package/dist/openrouter-CDq1vETJ.mjs +125 -0
- package/dist/otel-ugdFQeJO.mjs +23177 -0
- package/dist/photon_rs-D6BNoOSO.mjs +4253 -0
- package/dist/rolldown-runtime-EQORzF3F.mjs +38 -0
- package/dist/sanitize-unicode-CPcy0g31.mjs +27 -0
- package/dist/server.js +247457 -56643
- package/dist/src-BHoXDvRK.mjs +1178 -0
- package/dist/transform-messages-CUKh2_5w.mjs +188 -0
- package/package.json +4 -3
- package/dist/client/assets/-workbench-terminal-CoufoT41.js +0 -145
- package/dist/client/assets/agent-B0AsYIb3.js +0 -2
- package/dist/client/assets/agent-DCVbbaGs.js +0 -1
- package/dist/client/assets/architectureDiagram-3BPJPVTR-hs4IN-ZW.js +0 -36
- package/dist/client/assets/button-Dz6Az3h_.js +0 -16
- package/dist/client/assets/channel-CHiC1IgU.js +0 -1
- package/dist/client/assets/chunk-QZHKN3VN-SFi3gsXX.js +0 -1
- package/dist/client/assets/chunk-WU5MYG2G-OzrGGim9.js +0 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-DvZGz7Ek.js +0 -1
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-DvZGz7Ek.js +0 -1
- package/dist/client/assets/compiler-runtime-rGeCHUuX.js +0 -1
- package/dist/client/assets/cose-bilkent-S5V4N54A-BzitJXTQ.js +0 -1
- package/dist/client/assets/diff-BqnMP7Ys.js +0 -217
- package/dist/client/assets/diff-CLnQZZVT.js +0 -2
- package/dist/client/assets/dist-lRkD-JPF.js +0 -1
- package/dist/client/assets/external-link-DPI4TAq4.js +0 -1
- package/dist/client/assets/fallbacks-uU4M5NOw.js +0 -1
- package/dist/client/assets/ganttDiagram-6RSMTGT7-hA3inn7u.js +0 -292
- package/dist/client/assets/index-DNWcrdqu.css +0 -2
- package/dist/client/assets/input-group-1-P7Y_75.js +0 -153
- package/dist/client/assets/loader-circle-BxillczB.js +0 -1
- package/dist/client/assets/portless-ClPWjTC4.js +0 -1
- package/dist/client/assets/portless-QJD7ZmA9.js +0 -2
- package/dist/client/assets/resizable-BaJ5ba6-.js +0 -1
- package/dist/client/assets/route-C-L2dkin.js +0 -45
- package/dist/client/assets/route-b5JXfzPO.js +0 -2
- package/dist/client/assets/run-C7DiKMnt.js +0 -1
- package/dist/client/assets/run-Dt91HvlA.js +0 -2
- package/dist/client/assets/src-oaGqIoNi.js +0 -1
- package/dist/client/assets/state-CVjPP5QG.js +0 -2
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-BggoNPhO.js +0 -1
- package/dist/client/assets/terminal-C4sv4xT5.js +0 -2
- package/dist/client/assets/terminal-kxE_eoTZ.js +0 -1
- package/dist/client/assets/triangle-alert-CTEZG9zF.js +0 -1
- /package/dist/client/assets/{chunk-QTnfLwEv.js → rolldown-runtime-QTnfLwEv.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n,t as r}from"./compiler-runtime-CLAvuQ-D.js";import{E as i,g as a,gs as o,k as s,s as c}from"./fallbacks-DwGmG_0c.js";var l=o(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),u=`none`,d=`trigger-press`,f=`trigger-hover`,p=`outside-press`,m=`close-press`,h=`focus-out`,g=`escape-key`,_=`imperative-action`;function v(e,t,n,r){let i=!1,a=!1,o=r??c;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var y=e(n(),1),b=0;function x(e,t=`mui`){let[n,r]=y.useState(e),i=e||n;return y.useEffect(()=>{n??(b+=1,r(`${t}-${b}`))},[n,t]),i}var S=a.useId;function C(e,t){if(S!==void 0){let n=S();return e??(t?`${t}-${n}`:n)}return x(e,t)}function w(e){return C(e,`base-ui`)}function T(e){return e?.ownerDocument||document}function E(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function D(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&i(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ee(e){return`composedPath`in e?e.composedPath()[0]:e.target}var O=r(),k=t();function te(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function ne(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function re(e){return e/100*window.innerHeight}function ie(e){return e/100*window.innerWidth}function ae(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function A({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=ae(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=ne(t,i);break;case`em`:r=te(t,i);break;case`vh`:r=re(i);break;case`vw`:r=ie(i);break}return r}function j(e){return parseFloat(e.toFixed(3))}function M({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function oe(e){let{panels:t}=e,n=M({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=j(A({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=j(A({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=j(A({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=j(A({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function N(e,t=`Assertion error`){if(!e)throw Error(t)}function se(e,t){return Array.from(t).sort(e===`horizontal`?ce:le)}function ce(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function le(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function ue(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function de(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function fe({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=de(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return N(i,`No rect found`),i}var pe;function me(){return pe===void 0&&(pe=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),pe}function he(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=se(n,Array.from(t.children).filter(ue).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,fe({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=me()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:M({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var ge=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},P=new Map,_e=new ge;function ve(e){P=new Map(P),P.delete(e)}function ye(e,t){for(let[t]of P)if(t.id===e)return t}function F(e,t){for(let[t,n]of P)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function I(){return P}function be(e,t){return _e.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function L(e,t){let n=P.get(e);P=new Map(P),P.set(e,t),_e.emit(`groupChange`,{group:e,prev:n,next:t})}function xe(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=de(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function Se(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Ce(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:ke(e),b:ke(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();N(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Oe(De(n.a)),b:Oe(De(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var we=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Te(e){let t=getComputedStyle(Ae(e)??e).display;return t===`flex`||t===`inline-flex`}function Ee(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Te(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||we.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function De(e){let t=e.length;for(;t--;){let n=e[t];if(N(n,`Missing node`),Ee(n))return n}return null}function Oe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function ke(e){let t=[];for(;e;)t.push(e),e=Ae(e);return t}function Ae(e){let{parentNode:t}=e;return Se(t)?t.host:t}function je(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Me({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!ue(n)||n.contains(e)||e.contains(n))return!0;if(Ce(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(je(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Ne(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=he(r),a=xe(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Me({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function Pe(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function R(e,t,n=0){return Math.abs(j(e)-j(t))<=n}function z(e,t){return R(e,t)?0:e>t?1:-1}function B({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(z(r,c)<0)if(a){let e=(i+c)/2;r=z(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=j(r),r}function V({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(R(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;N(u!=null,`Invalid first pivot index`),N(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];N(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(N(n!=null,`Previous layout not found for panel index ${t}`),R(n,i)){let t=o-n;z(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];N(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(N(n!=null,`Previous layout not found for panel index ${t}`),R(n,o)){let t=n-i;z(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];N(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&z(i,c)<0)if(e>0){let t=c-o,n=t/2;z(i+e,c)<0&&(e=z(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;z(i-e,c)<0&&(e=z(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];N(e!=null,`Previous layout not found for panel index ${r}`);let a=B({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];N(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=B({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!R(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(Pe(c,l))return i;{let t=e<0?d:u,r=s[t];N(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=B({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!R(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];N(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=B({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(R(i,s)||(t-=s-i,l[r]=s),R(t,0))break;e>0?r--:r++}}}if(!R(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function H(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||z(e[n],t[n])!==0)return!1;return!0}function U({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!R(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];N(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];N(i!=null,`No layout data found for index ${e}`);let o=r[e];N(o!=null,`No layout data found for index ${e}`);let s=B({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!R(a,0))for(let e=0;e<t.length;e++){let n=r[e];N(n!=null,`No layout data found for index ${e}`);let i=n+a,o=B({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,R(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function Fe({groupId:e,panelId:t}){let n=()=>{let t=I();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&R(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:j(100-e)}}return V({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=U({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});H(c,u)||L(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&R(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=M({group:t});s(j(A({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function Ie(e){e.defaultPrevented||Ne(e,I()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=Fe({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function W(e){let t=I();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function Le({groupId:e}){let t=()=>{let t=I();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=U({layout:e,panelConstraints:r});return n?o:(H(o,c)||L(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function G(e,t){let n=W(e),r=F(n.id,!0),i=n.separators.find(t=>t.element===e);N(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);N(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=Le({groupId:n.id}).getLayout(),c=U({layout:V({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});H(s,c)||L(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function Re(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=W(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&G(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&G(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&G(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&G(t,-5);break;case`End`:e.preventDefault(),G(t,100);break;case`Enter`:{e.preventDefault();let n=W(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=F(n.id,!0),o=n.separators.find(e=>e.element===t);N(o,`Matching separator not found`);let s=a.get(o);N(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(N(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];G(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=W(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);N(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),G(t,-100);break}}var K={cursorFlags:0,state:`inactive`},ze=new ge;function q(){return K}function Be(e){return ze.addListener(`change`,e)}function Ve(e){let t=K,n={...K};n.cursorFlags=e,K=n,ze.emit(`change`,{prev:t,next:n})}function J(e){let t=K;K=e,ze.emit(`change`,{prev:t,next:e})}function He(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=I(),n=Ne(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),J({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var Ue=e=>e,We=()=>{},Ge=1,Ke=2,qe=4,Je=8,Ye=3,Xe=12,Y;function Ze(){return Y===void 0&&(Y=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(Y=!0)),Y}function Qe({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&Ze()){let t=(e&Ge)!==0,n=(e&Ke)!==0,r=(e&qe)!==0,i=(e&Je)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return Ze()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var $e=new WeakMap;function et(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=$e.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=q();switch(r.state){case`active`:case`hover`:{let e=Qe({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}$e.set(e,{prevStyle:t,styleSheet:n})}function tt({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=V({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(H(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?Ge:Ke;break;case`vertical`:s|=d<0?qe:Je;break}}else L(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&Ye:c|=s&Ye,t.movementY===0?c|=o&Xe:c|=s&Xe,Ve(c),et(e)}function nt(e){let t=I(),n=q();switch(n.state){case`active`:tt({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function rt(e){if(e.defaultPrevented)return;let t=q(),n=I();switch(t.state){case`active`:if(e.buttons===0){J({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=F(e.group.id,!0);L(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}tt({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=Ne(e,n);r.length===0?t.state!==`inactive`&&J({cursorFlags:0,state:`inactive`}):J({cursorFlags:0,hitRegions:r,state:`hover`}),et(e.currentTarget);break}}}function it(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(q().state){case`hover`:J({cursorFlags:0,state:`inactive`})}}function at(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=q();switch(t.state){case`active`:J({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(et(e.currentTarget),t.hitRegions.forEach(e=>{let t=F(e.group.id,!0);L(e.group,t)}),e.preventDefault())}}function ot(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=j(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=j((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function st(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=M({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:j(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function ct(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function lt({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=j(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=j((r[e]??0)/a*l);else{let e=j(l/c.length);for(let t of c)u[t]=e}return u}function ut(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var X=new Map;function dt(e){let t=!0;N(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=M({group:e});if(t===0)return;let n=F(e.id);if(!n)return;let r=oe(e),i=n.defaultLayoutDeferred?ot(r):n.layout,a=U({layout:lt({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&H(n.layout,a)&&ct(n.derivedPanelConstraints,r)&&n.groupSize===t)return;L(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else st(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{N(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=M({group:e}),s=oe(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(ut(e.panels,l)||(l=void 0));let u=U({layout:e.mutableState.layouts[c]??l??ot(s),panelConstraints:s}),d=e.element.ownerDocument;X.set(d,(X.get(d)??0)+1);let f=new Map;return he(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),L(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{N(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,Re)}),X.get(d)===1&&(d.addEventListener(`dblclick`,Ie,!0),d.addEventListener(`pointerdown`,He,!0),d.addEventListener(`pointerleave`,nt),d.addEventListener(`pointermove`,rt),d.addEventListener(`pointerout`,it),d.addEventListener(`pointerup`,at,!0)),function(){t=!1,X.set(d,Math.max(0,(X.get(d)??0)-1)),ve(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,Re)}),X.get(d)||(d.removeEventListener(`dblclick`,Ie,!0),d.removeEventListener(`pointerdown`,He,!0),d.removeEventListener(`pointerleave`,nt),d.removeEventListener(`pointermove`,rt),d.removeEventListener(`pointerout`,it),d.removeEventListener(`pointerup`,at,!0)),a.disconnect()}}function ft(){let[e,t]=(0,y.useState)({});return[e,(0,y.useCallback)(()=>t({}),[])]}function pt(e){let t=(0,y.useId)();return`${e??t}`}var Z=typeof window<`u`?y.useLayoutEffect:y.useEffect;function Q(e){let t=(0,y.useRef)(e);return Z(()=>{t.current=e},[e]),(0,y.useCallback)((...e)=>t.current?.(...e),[t])}function mt(...e){return Q(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function ht(e){let t=(0,y.useRef)({...e});return Z(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var gt=(0,y.createContext)(null);function _t(e,t){let n=(0,y.useRef)({getLayout:()=>({}),setLayout:Ue});(0,y.useImperativeHandle)(t,()=>n.current,[]),Z(()=>{Object.assign(n.current,Le({groupId:e}))})}function vt({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,y.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=Q(e=>{H(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=Q(e=>{H(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=pt(s),v=(0,y.useRef)(null),[b,x]=ft(),S=(0,y.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),C=mt(v,a);_t(_,o);let w=Q((e,t)=>{let r=q(),i=ye(e),a=F(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),T=ht({defaultLayout:n,disableCursor:r}),E=(0,y.useMemo)(()=>({get disableCursor(){return!!T.disableCursor},getPanelStyles:w,id:_,orientation:u,registerPanel:e=>{let t=S.current;return t.panels=se(u,[...t.panels,e]),x(),()=>{t.panels=t.panels.filter(t=>t!==e),x()}},registerSeparator:e=>{let t=S.current;return t.separators=se(u,[...t.separators,e]),x(),()=>{t.separators=t.separators.filter(t=>t!==e),x()}},updatePanelProps:(e,{disabled:t})=>{let n=S.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=ye(_),i=F(_);r&&i&&L(r,{...i,derivedPanelConstraints:oe(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=S.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[w,_,x,u,T]),D=(0,y.useRef)(null);return Z(()=>{let e=v.current;if(e===null)return;let t=S.current,n;if(T.defaultLayout!==void 0&&Object.keys(T.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=T.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!T.disableCursor,expandedPanelSizes:S.current.lastExpandedPanelSizes,layouts:S.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};D.current=r;let a=dt(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=F(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=be(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=R(t.collapsedSize,i[t.panelId]),a=R(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=q().state!==`active`;h(i),o&&g(i)});return()=>{D.current=null,a(),l()}},[i,_,g,h,u,b,T]),(0,y.useEffect)(()=>{let e=D.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,k.jsx)(gt.Provider,{value:E,children:(0,k.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:C,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}vt.displayName=`Group`;function $(){let e=(0,y.useContext)(gt);return N(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function yt(e,t){let{id:n}=$(),r=(0,y.useRef)({collapse:We,expand:We,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:We});(0,y.useImperativeHandle)(t,()=>r.current,[]),Z(()=>{Object.assign(r.current,Fe({groupId:n,panelId:e}))})}function bt({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=pt(c),_=ht({disabled:a}),v=(0,y.useRef)(null),b=mt(v,o),{getPanelStyles:x,id:S,orientation:C,registerPanel:w,updatePanelProps:T}=$(),E=d!==null,D=Q((e,t,n)=>{d?.(e,c,n)});Z(()=>{let e=v.current;if(e!==null)return w({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:E?D:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,E,g,h,l,u,D,w,_]),(0,y.useEffect)(()=>{T(g,{disabled:a})},[a,g,T]),yt(g,f);let ee=()=>{let e=x(S,g);if(e)return JSON.stringify(e)},O=(0,y.useSyncExternalStore)(e=>be(S,e),ee,ee),te;return te=O?JSON.parse(O):i===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:i},(0,k.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:b,style:{...xt,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...te},children:(0,k.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:C===`horizontal`?`pan-y`:`pan-x`},children:e})})}bt.displayName=`Panel`;var xt={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function St({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=U({layout:V({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=U({layout:V({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function Ct({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=pt(a),l=ht({disabled:n,disableDoubleClick:r}),[u,d]=(0,y.useState)({}),[f,p]=(0,y.useState)(`inactive`),[m,h]=(0,y.useState)(!1),g=(0,y.useRef)(null),_=mt(g,i),{disableCursor:v,id:b,orientation:x,registerSeparator:S,updateSeparatorProps:C}=$(),w=x===`horizontal`?`vertical`:`horizontal`;Z(()=>{let e=g.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=S(t),r=Be(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=be(b,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(St({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[b,c,S,l]),(0,y.useEffect)(()=>{C(c,{disabled:n,disableDoubleClick:r})},[n,r,c,C]);let T;n&&!v&&(T=`not-allowed`);let E;if(n)E=`disabled`;else switch(f){case`active`:E=`active`;break;default:E=m?`focus`:f}return(0,k.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":w,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":E,"data-testid":c,id:c,onBlur:()=>h(!1),onFocus:()=>h(!0),ref:_,role:`separator`,style:{flexBasis:`auto`,cursor:T,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}Ct.displayName=`Separator`;function wt(e){let t=(0,O.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`flex h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,k.jsx)(vt,{"data-slot":`resizable-panel-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Tt(e){let t=(0,O.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,k.jsx)(bt,{"data-slot":`resizable-panel`,...n}),t[2]=n,t[3]=r),r}function Et(e){let t=(0,O.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({withHandle:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=s(`bg-border ring-offset-background focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),t[4]=n,t[5]=a);let o;t[6]===i?o=t[7]:(o=i&&(0,k.jsx)(`div`,{className:`bg-border z-10 flex h-6 w-1 shrink-0 rounded-none`}),t[6]=i,t[7]=o);let c;return t[8]!==r||t[9]!==a||t[10]!==o?(c=(0,k.jsx)(Ct,{"data-slot":`resizable-handle`,className:a,...r,children:o}),t[8]=r,t[9]=a,t[10]=o,t[11]=c):c=t[11],c}export{f as _,D as a,w as c,m as d,g as f,p as g,u as h,E as i,C as l,_ as m,Tt as n,ee as o,h as p,wt as r,T as s,Et as t,v as u,d as v,l as y};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n,t as r}from"./compiler-runtime-CLAvuQ-D.js";import{A as i,Ar as a,Ba as o,D as s,Dr as c,Ds as l,Es as u,F as d,Fr as f,Gt as p,I as m,Ka as h,L as g,M as _,Ma as v,Mr as y,Nr as b,O as x,Or as S,Pa as C,Za as w,_o as ee,a as T,eo as E,er as D,es as te,fo as O,gs as k,ho as ne,j as re,jr as ie,k as A,kr as j,mo as ae,ps as M,r as oe,ro as se,to as ce,uc as le,un as ue,xs as de,yo as fe,za as N}from"./fallbacks-DwGmG_0c.js";import{r as pe,t as me}from"./route-ULg8h9n0.js";import{C as he,S as ge,a as _e,c as P,f as ve,i as ye,l as be,n as xe,o as Se,r as Ce,s as we,t as Te,u as Ee}from"./dialog-B0kBnYwI.js";import{n as F}from"./sonner-DgKrvTU1.js";import{n as De,r as Oe,t as ke}from"./resizable-A9BpOcmt.js";import{A as Ae,C as je,S as Me,T as Ne,a as Pe,b as I,d as L,f as Fe,j as Ie,l as Le,n as Re,p as ze,u as Be,w as Ve}from"./state-_2CmL5IM.js";function He(e){let t=le({warn:e?.router===void 0}),n=e?.router||t;return l(n.stores.__store,u(e,n))}var Ue=k(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),We=k(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Ge=k(`calendar-days`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),Ke=k(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),qe=k(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Je=k(`git-branch-plus`,[[`path`,{d:`M6 3v12`,key:`qpgusn`}],[`path`,{d:`M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`,key:`1d02ji`}],[`path`,{d:`M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`,key:`chk6ph`}],[`path`,{d:`M15 6a9 9 0 0 0-9 9`,key:`or332x`}],[`path`,{d:`M18 15v6`,key:`9wciyi`}],[`path`,{d:`M21 18h-6`,key:`139f0c`}]]),Ye=k(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Xe=k(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Ze=k(`memory-stick`,[[`path`,{d:`M12 12v-2`,key:`fwoke6`}],[`path`,{d:`M12 18v-2`,key:`qj6yno`}],[`path`,{d:`M16 12v-2`,key:`heuere`}],[`path`,{d:`M16 18v-2`,key:`s1ct0w`}],[`path`,{d:`M2 11h1.5`,key:`15p63e`}],[`path`,{d:`M20 18v-2`,key:`12ehxp`}],[`path`,{d:`M20.5 11H22`,key:`khsy7a`}],[`path`,{d:`M4 18v-2`,key:`1c3oqr`}],[`path`,{d:`M8 12v-2`,key:`1mwtfd`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`rect`,{x:`2`,y:`6`,width:`20`,height:`10`,rx:`2`,key:`1qcswk`}]]),Qe=k(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),$e=k(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),et=k(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),tt=k(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),nt=k(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),rt=k(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),it=k(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),R=e(n(),1),z=r(),B=t(),at=[`claude`,`codex`];function ot(e){return e>=90?`text-destructive`:e>=75?`text-amber-500`:`text-foreground`}function st(e){let t=(0,z.c)(16),n;if(t[0]!==e.icon||t[1]!==e.window.resetsAt||t[2]!==e.window.utilization){let r=M(ae(e.window.resetsAt),O(p)),i;t[4]===e.icon?i=t[5]:(i=(0,B.jsx)(`span`,{className:`text-muted-foreground flex shrink-0 items-center [&_svg]:size-2.5`,children:e.icon}),t[4]=e.icon,t[5]=i);let a;t[6]===e.window.utilization?a=t[7]:(a=ot(e.window.utilization),t[6]=e.window.utilization,t[7]=a);let o;t[8]===e.window.utilization?o=t[9]:(o=Math.round(e.window.utilization),t[8]=e.window.utilization,t[9]=o);let s;t[10]!==a||t[11]!==o?(s=(0,B.jsxs)(`span`,{className:a,children:[o,`%`]}),t[10]=a,t[11]=o,t[12]=s):s=t[12];let c;t[13]!==i||t[14]!==s?(c=(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[i,s]}),t[13]=i,t[14]=s,t[15]=c):c=t[15],n=(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center justify-between gap-1.5 px-2.5`,children:[c,fe(r)&&(0,B.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate`,title:`resets ${_(r.value)}`,children:re(r.value)})]}),t[0]=e.icon,t[1]=e.window.resetsAt,t[2]=e.window.utilization,t[3]=n}else n=t[3];return n}function ct(e){let t=(0,z.c)(12),n;t[0]===e.icon?n=t[1]:(n=(0,B.jsx)(`span`,{className:`text-muted-foreground flex shrink-0 items-center [&_svg]:size-2.5`,children:e.icon}),t[0]=e.icon,t[1]=n);let r;t[2]===e.utilization?r=t[3]:(r=ot(e.utilization),t[2]=e.utilization,t[3]=r);let i;t[4]===e.utilization?i=t[5]:(i=Math.round(e.utilization),t[4]=e.utilization,t[5]=i);let a;t[6]!==r||t[7]!==i?(a=(0,B.jsxs)(`span`,{className:r,children:[i,`%`]}),t[6]=r,t[7]=i,t[8]=a):a=t[8];let o;return t[9]!==n||t[10]!==a?(o=(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 px-2.5`,children:[n,a]}),t[9]=n,t[10]=a,t[11]=o):o=t[11],o}function lt(){let e=(0,z.c)(17),t=je(Pe);if(Ae(t)){let n;e[0]===t.cause?n=e[1]:(n=i(t.cause),e[0]=t.cause,e[1]=n);let r;e[2]===t.cause?r=e[3]:(r=i(t.cause),e[2]=t.cause,e[3]=r);let a;return e[4]!==n||e[5]!==r?(a=(0,B.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:n,children:r}),e[4]=n,e[5]=r,e[6]=a):a=e[6],a}if(!Ie(t)){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),e[7]=t):t=e[7],t}let n;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,B.jsx)(qe,{}),e[8]=n):n=e[8];let r;e[9]===t.value.cpuUtilization?r=e[10]:(r=(0,B.jsx)(ct,{icon:n,utilization:t.value.cpuUtilization}),e[9]=t.value.cpuUtilization,e[10]=r);let a;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,B.jsx)(Ze,{}),e[11]=a):a=e[11];let o;e[12]===t.value.memoryUtilization?o=e[13]:(o=(0,B.jsx)(ct,{icon:a,utilization:t.value.memoryUtilization}),e[12]=t.value.memoryUtilization,e[13]=o);let s;return e[14]!==r||e[15]!==o?(s=(0,B.jsxs)(B.Fragment,{children:[r,o]}),e[14]=r,e[15]=o,e[16]=s):s=e[16],s}function ut(e){let t=(0,z.c)(19),n;t[0]===e.layer?n=t[1]:(n=Le(e.layer),t[0]=e.layer,t[1]=n);let r=je(n);if(Ae(r)){let e;t[2]===r.cause?e=t[3]:(e=i(r.cause),t[2]=r.cause,t[3]=e);let n;t[4]===r.cause?n=t[5]:(n=i(r.cause),t[4]=r.cause,t[5]=n);let a;return t[6]!==e||t[7]!==n?(a=(0,B.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:e,children:n}),t[6]=e,t[7]=n,t[8]=a):a=t[8],a}if(!Ie(r)){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),t[9]=e):e=t[9],e}let a;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,B.jsx)(Ke,{}),t[10]=a):a=t[10];let o;t[11]===r.value.fiveHour?o=t[12]:(o=(0,B.jsx)(st,{icon:a,window:r.value.fiveHour}),t[11]=r.value.fiveHour,t[12]=o);let s;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,B.jsx)(Ge,{}),t[13]=s):s=t[13];let c;t[14]===r.value.weekly?c=t[15]:(c=(0,B.jsx)(st,{icon:s,window:r.value.weekly}),t[14]=r.value.weekly,t[15]=c);let l;return t[16]!==o||t[17]!==c?(l=(0,B.jsxs)(B.Fragment,{children:[o,c]}),t[16]=o,t[17]=c,t[18]=l):l=t[18],l}function dt(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-col divide-y border-t font-mono text-[11px]`,children:[(0,B.jsxs)(`div`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,B.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,B.jsx)(qe,{className:`text-muted-foreground size-3`})}),(0,B.jsx)(lt,{})]}),at.map(ft)]}),e[0]=t):t=e[0],t}function ft(e){return(0,B.jsxs)(`div`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,B.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,B.jsx)(Ee,{layer:e})}),(0,B.jsx)(ut,{layer:e})]},e)}var pt=1,mt=.9,ht=.8,gt=.17,_t=.1,vt=.999,yt=.9999,bt=.99,xt=/[\\\/_+.#"@\[\(\{&]/,St=/[\\\/_+.#"@\[\(\{&]/g,Ct=/[\s-]/,wt=/[\s-]/g;function Tt(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?pt:bt;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Tt(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=pt:xt.test(e.charAt(l-1))?(d*=ht,p=e.slice(i,l-1).match(St),p&&i>0&&(d*=vt**+p.length)):Ct.test(e.charAt(l-1))?(d*=mt,m=e.slice(i,l-1).match(wt),m&&i>0&&(d*=vt**+m.length)):(d*=gt,i>0&&(d*=vt**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=yt)),(d<_t&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Tt(e,t,n,r,l+1,a+2,o),f*_t>d&&(d=f*_t)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Et(e){return e.toLowerCase().replace(wt,` `)}function Dt(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Tt(e,t,Et(e),Et(t),0,0,{})}typeof window<`u`&&window.document&&window.document.createElement;function V(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Ot(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function H(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ot(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ot(e[t],null)}}}}function U(...e){return R.useCallback(H(...e),e)}function kt(e,t){let n=R.createContext(t),r=e=>{let{children:t,...r}=e,i=R.useMemo(()=>r,Object.values(r));return(0,B.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=R.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function At(e,t=[]){let n=[];function r(t,r){let i=R.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=R.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=R.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>R.createContext(e));return function(n){let r=n?.[e]||t;return R.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,jt(i,...t)]}function jt(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return R.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Mt=globalThis?.document?R.useLayoutEffect:()=>{},Nt=R.useId||(()=>void 0),Pt=0;function W(e){let[t,n]=R.useState(Nt());return Mt(()=>{e||n(e=>e??String(Pt++))},[e]),e||(t?`radix-${t}`:``)}var Ft=R.useInsertionEffect||Mt;function It({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Lt({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=R.useRef(e!==void 0);R.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,R.useCallback(t=>{if(s){let n=Rt(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Lt({defaultProp:e,onChange:t}){let[n,r]=R.useState(e),i=R.useRef(n),a=R.useRef(t);return Ft(()=>{a.current=t},[t]),R.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Rt(e){return typeof e==`function`}var zt=e(de(),1);function Bt(e){let t=Vt(e),n=R.forwardRef((e,n)=>{let{children:r,...i}=e,a=R.Children.toArray(r),o=a.find(Ut);if(o){let e=o.props.children,r=a.map(t=>t===o?R.Children.count(e)>1?R.Children.only(null):R.isValidElement(e)?e.props.children:null:t);return(0,B.jsx)(t,{...i,ref:n,children:R.isValidElement(e)?R.cloneElement(e,void 0,r):null})}return(0,B.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Vt(e){let t=R.forwardRef((e,t)=>{let{children:n,...r}=e;if(R.isValidElement(n)){let e=Gt(n),i=Wt(r,n.props);return n.type!==R.Fragment&&(i.ref=t?H(t,e):e),R.cloneElement(n,i)}return R.Children.count(n)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ht=Symbol(`radix.slottable`);function Ut(e){return R.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ht}function Wt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Gt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var G=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Bt(`Primitive.${t}`),r=R.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Kt(e,t){e&&zt.flushSync(()=>e.dispatchEvent(t))}function qt(e){let t=R.useRef(e);return R.useEffect(()=>{t.current=e}),R.useMemo(()=>(...e)=>t.current?.(...e),[])}function Jt(e,t=globalThis?.document){let n=qt(e);R.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Yt=`DismissableLayer`,Xt=`dismissableLayer.update`,Zt=`dismissableLayer.pointerDownOutside`,Qt=`dismissableLayer.focusOutside`,$t,en=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tn=R.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=R.useContext(en),[u,d]=R.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=R.useState({}),m=U(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=an(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=on(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Jt(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),R.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&($t=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),sn(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=$t)}},[u,f,n,l]),R.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),sn())},[u,l]),R.useEffect(()=>{let e=()=>p({});return document.addEventListener(Xt,e),()=>document.removeEventListener(Xt,e)},[]),(0,B.jsx)(G.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:V(e.onFocusCapture,S.onFocusCapture),onBlurCapture:V(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,x.onPointerDownCapture)})});tn.displayName=Yt;var nn=`DismissableLayerBranch`,rn=R.forwardRef((e,t)=>{let n=R.useContext(en),r=R.useRef(null),i=U(t,r);return R.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,B.jsx)(G.div,{...e,ref:i})});rn.displayName=nn;function an(e,t=globalThis?.document){let n=qt(e),r=R.useRef(!1),i=R.useRef(()=>{});return R.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){cn(Zt,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function on(e,t=globalThis?.document){let n=qt(e),r=R.useRef(!1);return R.useEffect(()=>{let e=e=>{e.target&&!r.current&&cn(Qt,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function sn(){let e=new CustomEvent(Xt);document.dispatchEvent(e)}function cn(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Kt(i,a):i.dispatchEvent(a)}var ln=`focusScope.autoFocusOnMount`,un=`focusScope.autoFocusOnUnmount`,dn={bubbles:!1,cancelable:!0},fn=`FocusScope`,pn=R.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=R.useState(null),l=qt(i),u=qt(a),d=R.useRef(null),f=U(t,e=>c(e)),p=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:K(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||K(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&K(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),R.useEffect(()=>{if(s){bn.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ln,dn);s.addEventListener(ln,l),s.dispatchEvent(t),t.defaultPrevented||(mn(Cn(gn(s)),{select:!0}),document.activeElement===e&&K(s))}return()=>{s.removeEventListener(ln,l),setTimeout(()=>{let t=new CustomEvent(un,dn);s.addEventListener(un,u),s.dispatchEvent(t),t.defaultPrevented||K(e??document.body,{select:!0}),s.removeEventListener(un,u),bn.remove(p)},0)}}},[s,l,u,p]);let m=R.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=hn(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&K(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&K(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,B.jsx)(G.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});pn.displayName=fn;function mn(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(K(r,{select:t}),document.activeElement!==n)return}function hn(e){let t=gn(e);return[_n(t,e),_n(t.reverse(),e)]}function gn(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _n(e,t){for(let n of e)if(!vn(n,{upTo:t}))return n}function vn(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function yn(e){return e instanceof HTMLInputElement&&`select`in e}function K(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&yn(e)&&t&&e.select()}}var bn=xn();function xn(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Sn(e,t),e.unshift(t)},remove(t){e=Sn(e,t),e[0]?.resume()}}}function Sn(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Cn(e){return e.filter(e=>e.tagName!==`A`)}var wn=`Portal`,Tn=R.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=R.useState(!1);Mt(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?zt.createPortal((0,B.jsx)(G.div,{...r,ref:t}),o):null});Tn.displayName=wn;function En(e,t){return R.useReducer((e,n)=>t[e][n]??e,e)}var Dn=e=>{let{present:t,children:n}=e,r=On(t),i=typeof n==`function`?n({present:r.isPresent}):R.Children.only(n),a=U(r.ref,An(i));return typeof n==`function`||r.isPresent?R.cloneElement(i,{ref:a}):null};Dn.displayName=`Presence`;function On(e){let[t,n]=R.useState(),r=R.useRef(null),i=R.useRef(e),a=R.useRef(`none`),[o,s]=En(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return R.useEffect(()=>{let e=kn(r.current);a.current=o===`mounted`?e:`none`},[o]),Mt(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=kn(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Mt(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=kn(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=kn(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:R.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function kn(e){return e?.animationName||`none`}function An(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jn=0;function Mn(){R.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Nn()),document.body.insertAdjacentElement(`beforeend`,e[1]??Nn()),jn++,()=>{jn===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),jn--}},[])}function Nn(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var q=function(){return q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},q.apply(this,arguments)};function Pn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Fn(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var In=`right-scroll-bar-position`,Ln=`width-before-scroll-bar`,Rn=`with-scroll-bars-hidden`,zn=`--removed-body-scroll-bar-size`;function Bn(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Vn(e,t){var n=(0,R.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Hn=typeof window<`u`?R.useLayoutEffect:R.useEffect,Un=new WeakMap;function Wn(e,t){var n=Vn(t||null,function(t){return e.forEach(function(e){return Bn(e,t)})});return Hn(function(){var t=Un.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Bn(e,null)}),i.forEach(function(e){r.has(e)||Bn(e,a)})}Un.set(n,e)},[e]),n}function Gn(e){return e}function Kn(e,t){t===void 0&&(t=Gn);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function qn(e){e===void 0&&(e={});var t=Kn(null);return t.options=q({async:!0,ssr:!1},e),t}var Jn=function(e){var t=e.sideCar,n=Pn(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return R.createElement(r,q({},n))};Jn.isSideCarExport=!0;function Yn(e,t){return e.useMedium(t),Jn}var Xn=qn(),Zn=function(){},Qn=R.forwardRef(function(e,t){var n=R.useRef(null),r=R.useState({onScrollCapture:Zn,onWheelCapture:Zn,onTouchMoveCapture:Zn}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Pn(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Wn([n,t]),C=q(q({},b),i);return R.createElement(R.Fragment,null,u&&R.createElement(x,{sideCar:Xn,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?R.cloneElement(R.Children.only(s),q(q({},C),{ref:S})):R.createElement(v,q({},C,{className:c,ref:S}),s))});Qn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Qn.classNames={fullWidth:Ln,zeroRight:In};var $n,er=function(){if($n)return $n;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function tr(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=er();return t&&e.setAttribute(`nonce`,t),e}function nr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rr(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ir=function(){var e=0,t=null;return{add:function(n){e==0&&(t=tr())&&(nr(t,n),rr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ar=function(){var e=ir();return function(t,n){R.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},or=function(){var e=ar();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},sr={left:0,top:0,right:0,gap:0},cr=function(e){return parseInt(e||``,10)||0},lr=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[cr(n),cr(r),cr(i)]},ur=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return sr;var t=lr(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},dr=or(),fr=`data-scroll-locked`,pr=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
+
.${Rn} {
|
|
3
|
+
overflow: hidden ${r};
|
|
4
|
+
padding-right: ${s}px ${r};
|
|
5
|
+
}
|
|
6
|
+
body[${fr}] {
|
|
7
|
+
overflow: hidden ${r};
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
+
padding-left: ${i}px;
|
|
11
|
+
padding-top: ${a}px;
|
|
12
|
+
padding-right: ${o}px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: ${s}px ${r};
|
|
16
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.${In} {
|
|
20
|
+
right: ${s}px ${r};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${Ln} {
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.${In} .${In} {
|
|
28
|
+
right: 0 ${r};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${Ln} .${Ln} {
|
|
32
|
+
margin-right: 0 ${r};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[${fr}] {
|
|
36
|
+
${zn}: ${s}px;
|
|
37
|
+
}
|
|
38
|
+
`},mr=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},hr=function(){R.useEffect(function(){return document.body.setAttribute(fr,(mr()+1).toString()),function(){var e=mr()-1;e<=0?document.body.removeAttribute(fr):document.body.setAttribute(fr,e.toString())}},[])},gr=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;hr();var a=R.useMemo(function(){return ur(i)},[i]);return R.createElement(dr,{styles:pr(a,!t,i,n?``:`!important`)})},_r=!1;if(typeof window<`u`)try{var vr=Object.defineProperty({},"passive",{get:function(){return _r=!0,!0}});window.addEventListener(`test`,vr,vr),window.removeEventListener(`test`,vr,vr)}catch{_r=!1}var J=_r?{passive:!1}:!1,yr=function(e){return e.tagName===`TEXTAREA`},br=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!yr(e)&&n[t]===`visible`)},xr=function(e){return br(e,`overflowY`)},Sr=function(e){return br(e,`overflowX`)},Cr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Er(e,r)){var i=Dr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wr=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Tr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Er=function(e,t){return e===`v`?xr(t):Sr(t)},Dr=function(e,t){return e===`v`?wr(t):Tr(t)},Or=function(e,t){return e===`h`&&t===`rtl`?-1:1},kr=function(e,t,n,r,i){var a=Or(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Dr(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Er(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Ar=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jr=function(e){return[e.deltaX,e.deltaY]},Mr=function(e){return e&&`current`in e?e.current:e},Nr=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Pr=function(e){return`
|
|
39
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
+
`},Fr=0,Ir=[];function Lr(e){var t=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),i=R.useState(Fr++)[0],a=R.useState(or)[0],o=R.useRef(e);R.useEffect(function(){o.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Fn([e.lockRef.current],(e.shards||[]).map(Mr),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=R.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ar(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Cr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Cr(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return kr(h,t,e,h===`h`?s:c,!0)},[]),c=R.useCallback(function(e){var n=e;if(!(!Ir.length||Ir[Ir.length-1]!==a)){var r=`deltaY`in n?jr(n):Ar(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Nr(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Mr).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=R.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Rr(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=R.useCallback(function(e){n.current=Ar(e),r.current=void 0},[]),d=R.useCallback(function(t){l(t.type,jr(t),t.target,s(t,e.lockRef.current))},[]),f=R.useCallback(function(t){l(t.type,Ar(t),t.target,s(t,e.lockRef.current))},[]);R.useEffect(function(){return Ir.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,J),document.addEventListener(`touchmove`,c,J),document.addEventListener(`touchstart`,u,J),function(){Ir=Ir.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,J),document.removeEventListener(`touchmove`,c,J),document.removeEventListener(`touchstart`,u,J)}},[]);var p=e.removeScrollBar,m=e.inert;return R.createElement(R.Fragment,null,m?R.createElement(a,{styles:Pr(i)}):null,p?R.createElement(gr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Rr(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var zr=Yn(Xn,Lr),Br=R.forwardRef(function(e,t){return R.createElement(Qn,q({},e,{ref:t,sideCar:zr}))});Br.classNames=Qn.classNames;var Vr=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Hr=new WeakMap,Ur=new WeakMap,Wr={},Gr=0,Kr=function(e){return e&&(e.host||Kr(e.parentNode))},qr=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Kr(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Jr=function(e,t,n,r){var i=qr(t,Array.isArray(e)?e:[e]);Wr[n]||(Wr[n]=new WeakMap);var a=Wr[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Hr.get(e)||0)+1,l=(a.get(e)||0)+1;Hr.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ur.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Gr++,function(){o.forEach(function(e){var t=Hr.get(e)-1,i=a.get(e)-1;Hr.set(e,t),a.set(e,i),t||(Ur.has(e)||e.removeAttribute(r),Ur.delete(e)),i||e.removeAttribute(n)}),Gr--,Gr||(Hr=new WeakMap,Hr=new WeakMap,Ur=new WeakMap,Wr={})}},Yr=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Vr(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Jr(r,i,n,`aria-hidden`)):function(){return null}},Xr=`Dialog`,[Zr,Qr]=At(Xr),[$r,Y]=Zr(Xr),ei=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=R.useRef(null),c=R.useRef(null),[l,u]=It({prop:r,defaultProp:i??!1,onChange:a,caller:Xr});return(0,B.jsx)($r,{scope:t,triggerRef:s,contentRef:c,contentId:W(),titleId:W(),descriptionId:W(),open:l,onOpenChange:u,onOpenToggle:R.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};ei.displayName=Xr;var ti=`DialogTrigger`,ni=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(ti,n),a=U(t,i.triggerRef);return(0,B.jsx)(G.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":xi(i.open),...r,ref:a,onClick:V(e.onClick,i.onOpenToggle)})});ni.displayName=ti;var ri=`DialogPortal`,[ii,ai]=Zr(ri,{forceMount:void 0}),oi=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Y(ri,t);return(0,B.jsx)(ii,{scope:t,forceMount:n,children:R.Children.map(r,e=>(0,B.jsx)(Dn,{present:n||a.open,children:(0,B.jsx)(Tn,{asChild:!0,container:i,children:e})}))})};oi.displayName=ri;var si=`DialogOverlay`,ci=R.forwardRef((e,t)=>{let n=ai(si,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Y(si,e.__scopeDialog);return a.modal?(0,B.jsx)(Dn,{present:r||a.open,children:(0,B.jsx)(ui,{...i,ref:t})}):null});ci.displayName=si;var li=Bt(`DialogOverlay.RemoveScroll`),ui=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(si,n);return(0,B.jsx)(Br,{as:li,allowPinchZoom:!0,shards:[i.contentRef],children:(0,B.jsx)(G.div,{"data-state":xi(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),X=`DialogContent`,di=R.forwardRef((e,t)=>{let n=ai(X,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Y(X,e.__scopeDialog);return(0,B.jsx)(Dn,{present:r||a.open,children:a.modal?(0,B.jsx)(fi,{...i,ref:t}):(0,B.jsx)(pi,{...i,ref:t})})});di.displayName=X;var fi=R.forwardRef((e,t)=>{let n=Y(X,e.__scopeDialog),r=R.useRef(null),i=U(t,n.contentRef,r);return R.useEffect(()=>{let e=r.current;if(e)return Yr(e)},[]),(0,B.jsx)(mi,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault())})}),pi=R.forwardRef((e,t)=>{let n=Y(X,e.__scopeDialog),r=R.useRef(!1),i=R.useRef(!1);return(0,B.jsx)(mi,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),mi=R.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Y(X,n),c=R.useRef(null),l=U(t,c);return Mn(),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(pn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,B.jsx)(tn,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":xi(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ti,{titleId:s.titleId}),(0,B.jsx)(Di,{contentRef:c,descriptionId:s.descriptionId})]})]})}),hi=`DialogTitle`,gi=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(hi,n);return(0,B.jsx)(G.h2,{id:i.titleId,...r,ref:t})});gi.displayName=hi;var _i=`DialogDescription`,vi=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(_i,n);return(0,B.jsx)(G.p,{id:i.descriptionId,...r,ref:t})});vi.displayName=_i;var yi=`DialogClose`,bi=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(yi,n);return(0,B.jsx)(G.button,{type:`button`,...r,ref:t,onClick:V(e.onClick,()=>i.onOpenChange(!1))})});bi.displayName=yi;function xi(e){return e?`open`:`closed`}var Si=`DialogTitleWarning`,[Ci,wi]=kt(Si,{contentName:X,titleName:hi,docsSlug:`dialog`}),Ti=({titleId:e})=>{let t=wi(Si),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
|
+
|
|
43
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
|
+
|
|
45
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return R.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ei=`DialogDescriptionWarning`,Di=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wi(Ei).contentName}}.`;return R.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Oi=ei,ki=oi,Ai=ci,ji=di,Mi=Symbol.for(`react.lazy`),Ni=R.use;function Pi(e){return typeof e==`object`&&!!e&&`then`in e}function Fi(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Mi&&`_payload`in e&&Pi(e._payload)}function Ii(e){let t=Li(e),n=R.forwardRef((e,n)=>{let{children:r,...i}=e;Fi(r)&&typeof Ni==`function`&&(r=Ni(r._payload));let a=R.Children.toArray(r),o=a.find(zi);if(o){let e=o.props.children,r=a.map(t=>t===o?R.Children.count(e)>1?R.Children.only(null):R.isValidElement(e)?e.props.children:null:t);return(0,B.jsx)(t,{...i,ref:n,children:R.isValidElement(e)?R.cloneElement(e,void 0,r):null})}return(0,B.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Li(e){let t=R.forwardRef((e,t)=>{let{children:n,...r}=e;if(Fi(n)&&typeof Ni==`function`&&(n=Ni(n._payload)),R.isValidElement(n)){let e=Vi(n),i=Bi(r,n.props);return n.type!==R.Fragment&&(i.ref=t?H(t,e):e),R.cloneElement(n,i)}return R.Children.count(n)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ri=Symbol(`radix.slottable`);function zi(e){return R.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ri}function Bi(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Vi(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Z=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ii(`Primitive.${t}`),r=R.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Hi=`[cmdk-group=""]`,Ui=`[cmdk-group-items=""]`,Wi=`[cmdk-group-heading=""]`,Gi=`[cmdk-item=""]`,Ki=`${Gi}:not([aria-disabled="true"])`,qi=`cmdk-item-select`,Ji=`data-value`,Yi=(e,t,n)=>Dt(e,t,n),Xi=R.createContext(void 0),Zi=()=>R.useContext(Xi),Qi=R.createContext(void 0),$i=()=>R.useContext(Qi),ea=R.createContext(void 0),ta=R.forwardRef((e,t)=>{let n=ma(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=ma(()=>new Set),i=ma(()=>new Map),a=ma(()=>new Map),o=ma(()=>new Set),s=pa(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=W(),y=W(),b=W(),x=R.useRef(null),S=ga();Q(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),Q(()=>{S(6,te)},[]);let C=R.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)D(),T(),S(1,E);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=O()?.id,C.emit()}),r||S(5,te),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=R.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,ee(t,r)),S(2,()=>{T(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{D(),T(),n.current.value||E(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=O();S(4,()=>{D(),t?.getAttribute(`id`)===e&&E(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function ee(e,t){let r=s.current?.filter??Yi;return e?r(e,n.current.search,t):0}function T(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;k().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Ui);t?t.appendChild(e.parentElement===t?e:e.closest(`${Ui} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Ui} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${Hi}[${Ji}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function E(){let e=k().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Ji);C.setState(`value`,e||void 0)}function D(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=ee(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function te(){var e;let t=O();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Hi)?.querySelector(Wi))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function O(){return x.current?.querySelector(`${Gi}[aria-selected="true"]`)}function k(){return Array.from(x.current?.querySelectorAll(Ki)||[])}function ne(e){let t=k()[e];t&&C.setState(`value`,t.getAttribute(Ji))}function re(e){var t;let n=O(),r=k(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(Ji))}function ie(e){let t=O()?.closest(Hi),n;for(;t&&!n;)t=e>0?da(t,Hi):fa(t,Hi),n=t?.querySelector(Ki);n?C.setState(`value`,n.getAttribute(Ji)):re(e)}let A=()=>ne(k().length-1),j=e=>{e.preventDefault(),e.metaKey?A():e.altKey?ie(1):re(1)},ae=e=>{e.preventDefault(),e.metaKey?ne(0):e.altKey?ie(-1):re(-1)};return R.createElement(Z.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&j(e);break;case`ArrowDown`:j(e);break;case`p`:case`k`:g&&e.ctrlKey&&ae(e);break;case`ArrowUp`:ae(e);break;case`Home`:e.preventDefault(),ne(0);break;case`End`:e.preventDefault(),A();break;case`Enter`:{e.preventDefault();let t=O();if(t){let e=new Event(qi);t.dispatchEvent(e)}}}}},R.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:ya},c),va(e,e=>R.createElement(Qi.Provider,{value:C},R.createElement(Xi.Provider,{value:w},e))))}),na=R.forwardRef((e,t)=>{let n=W(),r=R.useRef(null),i=R.useContext(ea),a=Zi(),o=pa(e),s=o.current?.forceMount??i?.forceMount;Q(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=ha(n,r,[e.value,e.children,r],e.keywords),l=$i(),u=$(e=>e.value&&e.value===c.current),d=$(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);R.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(qi,f),()=>t.removeEventListener(qi,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return R.createElement(Z.div,{ref:H(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),ra=R.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=W(),s=R.useRef(null),c=R.useRef(null),l=W(),u=Zi(),d=$(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Q(()=>u.group(o),[]),ha(o,s,[e.value,e.heading,c]);let f=R.useMemo(()=>({id:o,forceMount:i}),[i]);return R.createElement(Z.div,{ref:H(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&R.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),va(e,e=>R.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},R.createElement(ea.Provider,{value:f},e))))}),ia=R.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=R.useRef(null),a=$(e=>!e.search);return!n&&!a?null:R.createElement(Z.div,{ref:H(i,t),...r,"cmdk-separator":``,role:`separator`})}),aa=R.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=$i(),o=$(e=>e.search),s=$(e=>e.selectedItemId),c=Zi();return R.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),R.createElement(Z.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),oa=R.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=R.useRef(null),o=R.useRef(null),s=$(e=>e.selectedItemId),c=Zi();return R.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),R.createElement(Z.div,{ref:H(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},va(e,e=>R.createElement(`div`,{ref:H(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),sa=R.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return R.createElement(Oi,{open:n,onOpenChange:r},R.createElement(ki,{container:o},R.createElement(Ai,{"cmdk-overlay":``,className:i}),R.createElement(ji,{"aria-label":e.label,"cmdk-dialog":``,className:a},R.createElement(ta,{ref:t,...s}))))}),ca=R.forwardRef((e,t)=>$(e=>e.filtered.count===0)?R.createElement(Z.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),la=R.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return R.createElement(Z.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},va(e,e=>R.createElement(`div`,{"aria-hidden":!0},e)))}),ua=Object.assign(ta,{List:oa,Item:na,Input:aa,Group:ra,Separator:ia,Dialog:sa,Empty:ca,Loading:la});function da(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function fa(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function pa(e){let t=R.useRef(e);return Q(()=>{t.current=e}),t}var Q=typeof window>`u`?R.useEffect:R.useLayoutEffect;function ma(e){let t=R.useRef();return t.current===void 0&&(t.current=e()),t}function $(e){let t=$i(),n=()=>e(t.snapshot());return R.useSyncExternalStore(t.subscribe,n,n)}function ha(e,t,n,r=[]){let i=R.useRef(),a=Zi();return Q(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Ji,s),i.current=s}),i}var ga=()=>{let[e,t]=R.useState(),n=ma(()=>new Map);return Q(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function _a(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function va({asChild:e,children:t},n){return e&&R.isValidElement(t)?R.cloneElement(_a(t),{ref:t.ref},n(t.props.children)):n(t)}var ya={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function ba(e){let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=A(`group/input-group border-input has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot][aria-invalid=true]]:border-destructive has-disabled:bg-input/50 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-8 w-full min-w-0 items-center rounded-none border transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-1 has-[[data-slot][aria-invalid=true]]:ring-1 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var xa=s(`text-muted-foreground h-auto gap-2 py-1.5 font-normal group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-none [&>svg:not([class*='size-'])]:size-3 flex cursor-text items-center justify-center select-none`,{variants:{align:{"inline-start":`pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem] order-first`,"inline-end":`pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem] order-last`,"block-start":`px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start`,"block-end":`px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start`}},defaultVariants:{align:`inline-start`}});function Sa(e){let t=(0,z.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=A(xa({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,B.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":a,className:o,onClick:Ca,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function Ca(e){e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()}s(`gap-2 font-normal shadow-none flex items-center`,{variants:{size:{xs:`h-6 gap-1 rounded-none px-1.5 [&>svg:not([class*='size-'])]:size-3`,sm:``,"icon-xs":`size-6 rounded-none p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function wa(e){let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=A(`bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(ua,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ta(e){let t=(0,z.c)(24),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({title:a,description:o,children:n,className:r,showCloseButton:s,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`Command Palette`:a,l=o===void 0?`Search for a command to run...`:o,u=s===void 0?!1:s,d;t[7]===r?d=t[8]:(d=A(`top-1/3 translate-y-0 overflow-hidden rounded-none p-0`,r),t[7]=r,t[8]=d);let f;t[9]===c?f=t[10]:(f=(0,B.jsx)(Se,{children:c}),t[9]=c,t[10]=f);let p;t[11]===l?p=t[12]:(p=(0,B.jsx)(Ce,{children:l}),t[11]=l,t[12]=p);let m;t[13]!==f||t[14]!==p?(m=(0,B.jsxs)(_e,{className:`sr-only`,children:[f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]!==n||t[17]!==u||t[18]!==d||t[19]!==m?(h=(0,B.jsxs)(xe,{className:d,showCloseButton:u,children:[m,n]}),t[16]=n,t[17]=u,t[18]=d,t[19]=m,t[20]=h):h=t[20];let g;return t[21]!==i||t[22]!==h?(g=(0,B.jsx)(Te,{...i,children:h}),t[21]=i,t[22]=h,t[23]=g):g=t[23],g}function Ea(e){let t=(0,z.c)(11),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=A(`w-full font-normal outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,n),t[3]=n,t[4]=i);let a;t[5]!==r||t[6]!==i?(a=(0,B.jsx)(ua.Input,{"data-slot":`command-input`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7];let o;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,B.jsx)(Sa,{children:(0,B.jsx)(tt,{className:`size-3 shrink-0 opacity-50`})}),t[8]=o):o=t[8];let s;return t[9]===a?s=t[10]:(s=(0,B.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`border-b pb-0`,children:(0,B.jsxs)(ba,{className:`border-input/30 bg-input/30 h-8 border-none shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[a,o]})}),t[9]=a,t[10]=s),s}function Da(e){let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=A(`no-scrollbar max-h-72 scroll-py-0 overflow-x-hidden overflow-y-auto outline-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(ua.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Oa(e){let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=A(`py-6 text-center font-normal`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(ua.Empty,{"data-slot":`command-empty`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ka(e){let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=A(`text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden font-normal **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:font-normal`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(ua.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Aa(e){let t=(0,z.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=A(`group/command-item data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-none px-2 py-2 font-normal outline-hidden select-none in-data-[slot=dialog-content]:rounded-none! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,B.jsx)(ge,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,B.jsxs)(ua.Item,{"data-slot":`command-item`,className:a,...i,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function ja(e){let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=A(`text-muted-foreground group-data-selected/command-item:text-foreground ml-auto font-normal tracking-widest`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`span`,{"data-slot":`command-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Ma=Ve(e=>Ne(L.runtime.atom(ue(L,t=>j(e)?t(`projects.branches`,{cwd:e}):D(new ze({branches:[],defaultBranch:`main`}))),{initialValue:new ze({branches:[],defaultBranch:`main`})})));function Na(){let e=(0,z.c)(24),t=me.useNavigate(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={select:Pa},e[0]=n):n=e[0];let r=He(n),i;e[1]===r.activeWorktreeId?i=e[2]:(i=Re(r.activeWorktreeId),e[1]=r.activeWorktreeId,e[2]=i);let a=Me(i),o,s,c,l,u;e[3]===t?(o=e[4],s=e[5],c=e[6],l=e[7],u=e[8]):(o=e=>{(0,R.startTransition)(()=>{t({params:{worktree:Be(e)},to:`/$worktree/diff`})})},s=e=>{(0,R.startTransition)(()=>{t({params:{worktree:Be(e)},to:`/$worktree/terminal`})})},c=(e,n)=>{(0,R.startTransition)(()=>{t({params:{worktree:Be(e)},search:{origin:n},to:`/$worktree/portless`})})},l=(e,n)=>{(0,R.startTransition)(()=>{t({params:{worktree:Be(e)},search:{agentId:n},to:`/$worktree/agent`})})},u=(e,n,r)=>{(0,R.startTransition)(()=>{t({params:{worktree:Be(e)},search:{inactive:r,sessionId:n},to:`/$worktree/run`})})},e[3]=t,e[4]=o,e[5]=s,e[6]=c,e[7]=l,e[8]=u);let d;e[9]!==a.value.activeProject||e[10]!==a.value.activeWorktree||e[11]!==a.value.agentProfiles||e[12]!==a.value.projects||e[13]!==r.activeView||e[14]!==o||e[15]!==s||e[16]!==c||e[17]!==l||e[18]!==u?(d=(0,B.jsx)(De,{defaultSize:`22%`,minSize:`16%`,maxSize:`34%`,children:(0,B.jsx)(no,{activeProject:a.value.activeProject,activeWorktree:a.value.activeWorktree,activeView:r.activeView,agentProfiles:a.value.agentProfiles,projects:a.value.projects,selectWorktree:o,selectTerminal:s,selectPortless:c,selectAgent:l,selectRun:u})}),e[9]=a.value.activeProject,e[10]=a.value.activeWorktree,e[11]=a.value.agentProfiles,e[12]=a.value.projects,e[13]=r.activeView,e[14]=o,e[15]=s,e[16]=c,e[17]=l,e[18]=u,e[19]=d):d=e[19];let f;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,B.jsx)(ke,{}),e[20]=f):f=e[20];let p;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,B.jsx)(De,{defaultSize:`86%`,minSize:`60%`,children:(0,B.jsx)(`div`,{className:`flex h-full min-h-0 flex-col`,children:(0,B.jsx)(pe,{})})}),e[21]=p):p=e[21];let m;return e[22]===d?m=e[23]:(m=(0,B.jsx)(`div`,{className:`bg-background h-full min-h-0 flex-1 overflow-hidden`,children:(0,B.jsxs)(Oe,{orientation:`horizontal`,className:`h-full min-h-0 overflow-hidden`,children:[d,f,p]})}),e[22]=d,e[23]=m),m}function Pa(e){return{activeView:M(m(e.location.pathname),g(c(`/terminal`),za),g(c(`/portless`),Ra),g(c(`/run`),La),g(c(`/agent`),Ia),d(Fa)),activeWorktreeId:y(`/`)(e.location.pathname)[1]}}function Fa(){return`diff`}function Ia(){return`agent`}function La(){return`run`}function Ra(){return`portless`}function za(){return`terminal`}function Ba(e){return M(y(`/`)(e),E,o(e=>j(e)&&e!==`.`),ne(()=>e))}function Va(e){let t=b(`/home/`)(e)?M(y(`/`)(e),se(3),h(`/`)):void 0;return te(t)&&b(`${t}/`)(e)?`~/${ie(a(t)+1)(e)}`:Ba(e)}function Ha(e){let t=(0,z.c)(4);if(e.root){let n=e.dirty?`text-amber-500`:`text-current`,r;return t[0]===n?r=t[1]:(r=(0,B.jsx)(Qe,{className:n}),t[0]=n,t[1]=r),r}let n=e.dirty?`text-amber-500`:`text-current`,r;return t[2]===n?r=t[3]:(r=(0,B.jsx)(nt,{className:n}),t[2]=n,t[3]=r),r}function Ua(e,t){return{cwd:e,sessionId:t.sessionId}}function Wa(e){return{cwd:e.script.cwd,sessionId:e.script.sessionId}}function Ga(e){return j(f(e))&&!/\s/u.test(e)}function Ka(e){return[...e].toSorted((e,t)=>e.taskId.localeCompare(t.taskId))}function qa(e){return[...e].toSorted((e,t)=>e.script.taskId.localeCompare(t.script.taskId))}function Ja(e){let t=(0,z.c)(10),n=(0,R.useState)(!1),r,i;if(t[0]!==n||t[1]!==e.cwd||t[2]!==e.runStatuses||t[3]!==e.scripts||t[4]!==e.selectRun){i=Symbol.for(`react.early_return_sentinel`);bb0:{let a=Ka(e.scripts);if(a.length===0){i=null;break bb0}let o;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,B.jsx)(he,{}),t[7]=o):o=t[7];let s;t[8]===n?s=t[9]:(s=(0,B.jsx)(P,{icon:o,selected:!1,onClick:()=>{n[1](Ya)},children:`scripts`}),t[8]=n,t[9]=s),r=(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[s,n[0]&&(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:a.map(t=>(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(oe,{}),children:(0,B.jsx)(Xa,{cwd:e.cwd,run:t,status:e.runStatuses[t.sessionId]??{state:`idle`,title:``},selectRun:e.selectRun})},t.sessionId))})]})}t[0]=n,t[1]=e.cwd,t[2]=e.runStatuses,t[3]=e.scripts,t[4]=e.selectRun,t[5]=r,t[6]=i}else r=t[5],i=t[6];return i===Symbol.for(`react.early_return_sentinel`)?r:i}function Ya(e){return!e}function Xa(e){let t=Ua(e.cwd,e.run),n=I(L.mutation(`terminal.restart`),{mode:`promise`}),r=I(L.mutation(`terminal.stop`),{mode:`promise`}),a=(0,R.useState)(!1),o=Fe(e.status.state)&&e.status.state!==`idle`,s=(0,B.jsx)($e,{className:`size-3`});o&&(s=(0,B.jsx)(nt,{className:`size-3`})),a[0]&&(s=(0,B.jsx)(x,{className:`size-2.5 border opacity-60`}));async function c(){if(!a[0]){a[1](!0);try{await(o?r({payload:t}):n({payload:t}))}catch(e){F.error(i(e))}finally{a[1](!1)}}}return(0,B.jsx)(`li`,{className:`w-full min-w-0`,children:(0,B.jsx)(P,{actions:(0,B.jsx)(`span`,{className:`flex h-full items-center justify-end`,children:(0,B.jsx)(T,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:a[0],onClick:e=>{e.stopPropagation(),c()},title:o?`Stop ${e.run.taskId}`:`Start ${e.run.taskId}`,children:s})}),icon:(0,B.jsx)(ve,{state:e.status.state}),selected:!1,title:e.run.command,onClick:()=>{e.selectRun(e.cwd,e.run.sessionId,e.status.state===`idle`)},children:e.run.taskId})})}function Za(e){let t=(0,z.c)(8),n;t[0]===e.runs?n=t[1]:(n=qa(e.runs),t[0]=e.runs,t[1]=n);let r=n;if(r.length===0)return null;let i;return t[2]!==e.cwd||t[3]!==e.runStatuses||t[4]!==e.selectPortless||t[5]!==e.selectRun||t[6]!==r?(i=(0,B.jsx)(Qa,{cwd:e.cwd,runs:r,runStatuses:e.runStatuses,selectPortless:e.selectPortless,selectRun:e.selectRun}),t[2]=e.cwd,t[3]=e.runStatuses,t[4]=e.selectPortless,t[5]=e.selectRun,t[6]=r,t[7]=i):i=t[7],i}function Qa(e){let t=(0,R.useState)(!0),n=ce(e.runs,t=>Fe(e.runStatuses[t.script.sessionId]?.state??`idle`)&&e.runStatuses[t.script.sessionId]?.state!==`idle`),r=I(L.mutation(`terminal.restart`),{mode:`promise`}),a=I(L.mutation(`terminal.stop`),{mode:`promise`}),o=(0,R.useState)(!1),s=(0,B.jsx)($e,{className:`size-3`});n&&(s=(0,B.jsx)(nt,{className:`size-3`})),o[0]&&(s=(0,B.jsx)(x,{className:`size-2.5 border opacity-60`}));async function c(){if(!o[0]){o[1](!0);try{for(let t of e.runs){let e=Wa(t);n?await a({payload:e}):await r({payload:e})}}catch(e){F.error(i(e))}finally{o[1](!1)}}}return(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,B.jsx)(P,{actions:(0,B.jsx)(T,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:o[0],onClick:e=>{e.stopPropagation(),c()},title:n?`Stop deslop`:`Start deslop`,children:s}),icon:(0,B.jsx)(Xe,{}),selected:!1,onClick:()=>{t[1](e=>!e)},children:`deslop`}),t[0]&&(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:e.runs.map(t=>(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(oe,{}),children:(0,B.jsx)($a,{run:t,status:e.runStatuses[t.script.sessionId]??{state:`idle`,title:``},selectPortless:e.selectPortless,selectRun:e.selectRun})},t.script.sessionId))})]})}function $a(e){let t=(0,z.c)(16),n;t[0]===e?n=t[1]:(n=t=>{t.stopPropagation(),e.selectPortless(e.run.script.cwd,e.run.origin.origin)},t[0]=e,t[1]=n);let r=`Open ${e.run.script.taskId} preview`,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,B.jsx)(Xe,{className:`size-3`}),t[2]=i):i=t[2];let a;t[3]!==n||t[4]!==r?(a=(0,B.jsx)(T,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,onClick:n,title:r,children:i}),t[3]=n,t[4]=r,t[5]=a):a=t[5];let o;t[6]===e.status.state?o=t[7]:(o=(0,B.jsx)(ve,{state:e.status.state}),t[6]=e.status.state,t[7]=o);let s=e.run.script.command??e.run.script.taskId,c;t[8]===e?c=t[9]:(c=()=>{e.selectRun(e.run.script.cwd,e.run.script.sessionId,e.status.state===`idle`)},t[8]=e,t[9]=c);let l;return t[10]!==e.run.script.taskId||t[11]!==a||t[12]!==o||t[13]!==s||t[14]!==c?(l=(0,B.jsx)(`li`,{className:`w-full min-w-0`,children:(0,B.jsx)(P,{actions:a,icon:o,selected:!1,title:s,onClick:c,children:e.run.script.taskId})}),t[10]=e.run.script.taskId,t[11]=a,t[12]=o,t[13]=s,t[14]=c,t[15]=l):l=t[15],l}function eo(e){let t=(0,z.c)(17),n;t[0]===e?n=t[1]:(n=t=>{t.stopPropagation(),e.onStop()},t[0]=e,t[1]=n);let r=`Stop ${e.session.label}`,i;t[2]===e.stopping?i=t[3]:(i=e.stopping?(0,B.jsx)(x,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(nt,{className:`size-3`}),t[2]=e.stopping,t[3]=i);let a;t[4]!==e.stopping||t[5]!==n||t[6]!==r||t[7]!==i?(a=(0,B.jsx)(T,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:e.stopping,onClick:n,title:r,children:i}),t[4]=e.stopping,t[5]=n,t[6]=r,t[7]=i,t[8]=a):a=t[8];let o;t[9]===e.session.state.state?o=t[10]:(o=(0,B.jsx)(ve,{state:e.session.state.state}),t[9]=e.session.state.state,t[10]=o);let s=e.session.state.title?`Title: ${e.session.state.title}`:e.session.label,c=e.session.state.title===``?e.session.label:e.session.state.title,l;return t[11]!==e.onSelect||t[12]!==a||t[13]!==o||t[14]!==s||t[15]!==c?(l=(0,B.jsx)(`li`,{className:`w-full min-w-0`,children:(0,B.jsx)(P,{actions:a,icon:o,selected:!1,title:s,onClick:e.onSelect,children:c})}),t[11]=e.onSelect,t[12]=a,t[13]=o,t[14]=s,t[15]=c,t[16]=l):l=t[16],l}function to(e){let t=I(L.mutation(`agents.create`),{mode:`promise`}),n=I(L.mutation(`agents.remove`),{mode:`promise`}),r=(0,R.useState)(new Set),a=(0,R.useState)(new Set);async function o(n){if(!r[0].has(n.id)){r[1](e=>new Set([...e,n.id]));try{let r=await t({payload:{cwd:e.cwd,profileId:n.id}});e.selectAgent(e.cwd,r.uuid)}catch(e){F.error(i(e))}finally{r[1](e=>{let t=new Set(e);return t.delete(n.id),t})}}}async function s(t){if(!a[0].has(t.uuid)){a[1](e=>new Set([...e,t.uuid]));try{await n({payload:{cwd:e.cwd,uuid:t.uuid}})}catch(e){F.error(i(e))}finally{a[1](e=>{let n=new Set(e);return n.delete(t.uuid),n})}}}return(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,B.jsx)(P,{icon:(0,B.jsx)(We,{}),selected:!1,children:`agents`}),(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:e.profiles.map(t=>{let n=M(e.sessions,N(e=>e.profileId===t.id));return(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,B.jsx)(P,{actions:(0,B.jsx)(T,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:r[0].has(t.id),onClick:e=>{e.stopPropagation(),o(t)},title:`Start ${t.label}`,children:r[0].has(t.id)?(0,B.jsx)(x,{className:`size-2.5 border opacity-60`}):(0,B.jsx)($e,{className:`size-3`})}),icon:(0,B.jsx)(Ee,{layer:t.icon}),selected:!1,children:t.label}),n.length>0&&(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:n.map(t=>(0,B.jsx)(eo,{session:t,onSelect:()=>{e.selectAgent(e.cwd,t.uuid)},onStop:()=>{s(t)},stopping:a[0].has(t.uuid)},t.uuid))})]},t.id)})})]})}function no(e){let t=I(L.mutation(`projects.fix`),{mode:`promise`}),n=I(L.mutation(`projects.createWorktree`),{mode:`promise`}),r=I(L.mutation(`projects.deleteWorktree`),{mode:`promise`}),a=(0,R.useState)(``),s=(0,R.useState)(!1),c=(0,R.useState)(e.activeProject?.repository.root),l=(0,R.useState)(``),u=(0,R.useState)(!1),p=(0,R.useState)(!1),h=(0,R.useState)(``),_=M(e.projects,o(e=>e.repository.root===c[0]),ee)??e.activeProject,y=Me(Ma(_?.repository.root??``)),b=M(y.value.branches,N(e=>e.type===`local`),w(e=>e.name)),E=M(y.value.branches,N(e=>j(e.name)),N(e=>e.type===`local`||!v(b,e.name)),C((e,t)=>e.name===t.name&&e.type===t.type&&e.remote===t.remote),N(e=>!M(_?.worktrees??[],w(e=>e.branch??``),N(j),v(e.name)))),D=f(a[0]),te=M(E,ce(e=>e.name===D)),O=j(D)&&Ga(D)&&!te;async function k(t){let r=t?.name??D;if(S(r)||j(l[0]))return;if(t===void 0&&!Ga(r)){F.error(`Branch names cannot contain spaces.`);return}let o=t===void 0?{_tag:`new`}:m(t).pipe(g({type:`local`},()=>({_tag:`local`})),d(e=>({_tag:`remote`,remote:e.remote??`origin`})));l[1](r);try{let t=await n({payload:{branch:r,cwd:(_??e.activeProject)?.repository.root??``,source:o}});s[1](!1),a[1](``),e.selectWorktree(t)}catch(e){F.error(i(e))}finally{l[1](``)}}async function ne(){if(!(!e.activeWorktree||u[0])){u[1](!0);try{await r({payload:{cwd:e.activeWorktree.root}}),p[1](!1)}catch(e){F.error(i(e))}finally{u[1](!1)}}}return(0,B.jsxs)(`div`,{className:`flex h-full flex-col border-r`,children:[(0,B.jsxs)(`div`,{className:`grid h-8 grid-cols-[minmax(0,1fr)_auto] items-center border-b`,children:[(0,B.jsx)(T,{type:`button`,variant:`ghost`,size:`sm`,className:`text-muted-foreground hover:text-foreground flex h-full w-full min-w-0 justify-start px-3 text-left`,onClick:()=>{e.activeWorktree&&navigator.clipboard.writeText(e.activeWorktree.root)},children:(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:e.activeWorktree?Va(e.activeWorktree.root):`No worktree selected`})}),e.activeWorktree&&e.activeWorktree.root!==e.activeProject?.repository.root&&(0,B.jsx)(T,{type:`button`,variant:`destructive`,size:`icon`,className:`h-8 w-8`,disabled:u[0],onClick:()=>{p[1](!0)},title:`Delete worktree`,children:u[0]?(0,B.jsx)(x,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(it,{className:`size-3`})})]}),(0,B.jsx)(Te,{open:p[0],onOpenChange:p[1],children:(0,B.jsxs)(xe,{showCloseButton:!u[0],children:[(0,B.jsxs)(_e,{children:[(0,B.jsx)(Se,{children:`Delete worktree`}),(0,B.jsx)(Ce,{children:e.activeWorktree?`Delete ${e.activeWorktree.branch??Ba(e.activeWorktree.root)}?`:`No worktree selected.`})]}),(0,B.jsxs)(ye,{children:[(0,B.jsx)(T,{type:`button`,variant:`outline`,disabled:u[0],onClick:()=>{p[1](!1)},children:`Cancel`}),(0,B.jsxs)(T,{type:`button`,variant:`destructive`,disabled:!e.activeWorktree||u[0],onClick:()=>{ne(),s[1](!1)},children:[u[0]?(0,B.jsx)(x,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(it,{className:`size-3`}),`Delete`]})]})]})}),(0,B.jsx)(Ta,{open:s[0],onOpenChange:s[1],title:`Create worktree`,description:`Create or open a worktree branch.`,className:`sm:max-w-2xl`,children:(0,B.jsxs)(wa,{onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&s[1](!1)},children:[(0,B.jsx)(Ea,{placeholder:`Find or create branch in ${_?Ba(_.repository.root):`workspace`}...`,value:a[0],onValueChange:a[1],onKeyDown:e=>{e.key===`Enter`&&j(D)&&_&&(e.preventDefault(),k(M(E,o(e=>e.name===D),ee)))}}),(0,B.jsxs)(Da,{children:[(0,B.jsx)(Oa,{children:j(D)&&!Ga(D)?`Branch names cannot contain spaces.`:`No matching branch.`}),_&&(0,B.jsxs)(ka,{children:[O&&(0,B.jsxs)(Aa,{value:D,disabled:j(l[0]),onSelect:()=>{k()},children:[l[0]===D?(0,B.jsx)(x,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(Je,{}),(0,B.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Create `,D]}),(0,B.jsxs)(ja,{children:[`origin/`,y.value.defaultBranch]})]}),w(E,e=>{let t=l[0]===e.name?(0,B.jsx)(x,{className:`size-2.5 border opacity-60`}):m(e.type).pipe(g(`local`,()=>(0,B.jsx)(Ye,{})),d(()=>(0,B.jsx)(Xe,{})));return(0,B.jsxs)(Aa,{value:e.name,onSelect:()=>{a[1](e.name),k(e)},children:[t,(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,B.jsx)(ja,{children:e.type})]},`${e.type}:${e.remote??``}:${e.name}`)})]})]})]})}),(0,B.jsx)(we,{className:`min-h-0 flex-1 overflow-y-auto px-0 py-1`,children:(0,B.jsx)(be,{children:w(e.projects,n=>{let r=ee(o(n.worktrees,e=>e.root===n.repository.root))??n.worktrees[0];return(0,B.jsxs)(`li`,{className:`min-w-0 py-1 first:pt-0`,children:[(0,B.jsxs)(`div`,{className:`text-foreground grid h-7 w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2 px-3 pr-2 text-left font-normal hover:bg-transparent`,children:[(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center [&_svg]:size-3`,children:(0,B.jsx)(Ue,{})}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,B.jsx)(`button`,{type:`button`,className:`tree-label flex min-w-0 items-center gap-1.5 text-left`,onClick:()=>{r&&e.selectWorktree(r.root)},children:(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:Ba(n.repository.root)})})})]}),(0,B.jsxs)(`span`,{className:`flex items-center`,children:[(0,B.jsx)(T,{variant:`ghost`,size:`icon-xs`,className:`h-5 w-5 rounded-none opacity-70 hover:opacity-100`,disabled:h[0]===n.repository.root,onClick:e=>{e.stopPropagation(),h[1](n.repository.root),t({payload:{cwd:n.repository.root}}).catch(e=>{F.error(i(e))}).finally(()=>{h[1](``)})},title:`Fix repo state`,children:h[0]===n.repository.root?(0,B.jsx)(x,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(et,{className:`size-3`})}),(0,B.jsx)(T,{variant:`ghost`,size:`icon-xs`,className:`h-5 w-5 rounded-none opacity-70 hover:opacity-100`,onClick:e=>{e.stopPropagation(),c[1](n.repository.root),a[1](``),s[1](!0)},title:`Create worktree`,children:(0,B.jsx)(Je,{className:`size-3`})})]})]}),(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:w(n.worktrees,t=>(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,B.jsx)(P,{icon:(0,B.jsx)(Ha,{dirty:!1,root:t.root===n.repository.root}),selected:e.activeView===`diff`&&e.activeWorktree?.root===t.root,onClick:()=>{e.selectWorktree(t.root)},children:t.branch??Ba(t.root)},t.root),(0,B.jsxs)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:[(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(oe,{}),children:(0,B.jsx)(to,{cwd:t.root,profiles:e.agentProfiles,sessions:t.agents,selectAgent:e.selectAgent})}),(0,B.jsx)(`li`,{className:`w-full min-w-0`,children:(0,B.jsx)(P,{icon:(0,B.jsx)(rt,{}),selected:e.activeView===`terminal`&&e.activeWorktree?.root===t.root,onClick:()=>{e.selectTerminal(t.root)},children:`terminal`})}),(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(oe,{}),children:(0,B.jsx)(Za,{cwd:t.root,runStatuses:t.runStatuses,runs:t.portlessRuns,selectPortless:e.selectPortless,selectRun:e.selectRun})}),(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(oe,{}),children:(0,B.jsx)(Ja,{cwd:t.root,runStatuses:t.runStatuses,scripts:t.scriptRuns,selectRun:e.selectRun})})]})]},t.root))})]},n.repository.gitDirectory)})})}),(0,B.jsx)(dt,{})]})}export{Na as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/route-Da0uHKH9.js","assets/rolldown-runtime-QTnfLwEv.js","assets/compiler-runtime-CLAvuQ-D.js","assets/fallbacks-DwGmG_0c.js","assets/dialog-B0kBnYwI.js","assets/resizable-A9BpOcmt.js","assets/preload-helper-CjdClQve.js","assets/sonner-DgKrvTU1.js","assets/triangle-alert-cDPYgb7f.js","assets/state-_2CmL5IM.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n}from"./compiler-runtime-CLAvuQ-D.js";import{$s as r,As as i,Bs as a,Ds as o,Fs as s,Gs as c,Hs as l,Is as u,Js as d,Ks as f,Ls as p,Ms as m,Ns as h,Ot as g,Ps as _,Qs as v,Rs as y,Ss as b,Us as x,Vs as S,Ws as C,Xs as w,Ys as T,Zs as E,ac as D,cc as O,ec as k,ic as A,lc as ee,nc as j,nt as te,oc as ne,qs as re,rc as ie,sc as M,uc as N,vs as ae,ws as oe,ys as se,zs as ce}from"./fallbacks-DwGmG_0c.js";import{t as le}from"./preload-helper-CjdClQve.js";function ue(e){let t=e;return{get(){return t},set(e){t=j(e,t)}}}function de(e){return{get(){return e()}}}function fe(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>P(o,_.get())),x=r(()=>P(s,v.get())),S=r(()=>P(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=re(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:A,setPending:ee,setCached:j};A(e.matches),a?.(k);function A(e){F(e,o,_,n,i)}function ee(e){F(e,s,v,n,i)}function j(e){F(e,c,y,n,i)}return k}function P(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function F(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}w(n.get(),a)||n.set(a)})}function pe(){try{return sessionStorage}catch{return}}var me=`tsr-scroll-restoration-v1_3`,he=pe();function ge(){try{return JSON.parse(he?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function _e(){try{he?.setItem(me,JSON.stringify(I))}catch{}}var I=ge(),ve=`data-scroll-restoration-id`,ye=e=>e.state.__TSR_key||e.href;function be(e){let t=e.getAttribute(ve);if(t)return`[${ve}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var L=!1,R=`window`;function z(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function xe(e){let t=[];for(let n of e){if(n===R)continue;let e=z(n);e&&t.push(e)}return t}function Se(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||ye,a=new Map,o=(e,t,n)=>{let r=a.get(e)||{};r.scrollX=t,r.scrollY=n,a.set(e,r)},s=e=>{if(!(L||!r.restoring))if(e.target===document)o(R,scrollX,scrollY);else{let t=e.target;o(t,t.scrollLeft,t.scrollTop)}},c=e=>{if(!r.restoring)return;let t=I[e]||={};for(let[e,n]of a)e===R?t[R]=n:e.isConnected&&(t[be(e)]=n)};n&&!r.restoration&&(r.restoration=!0,L=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,s,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&c(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{c(i(e.stores.resolvedLocation.get()??e.stores.location.get())),_e()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c;if(a.clear(),s||(r.next=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let l=i(t.toLocation),u=t.fromLocation&&i(t.fromLocation);if(r.restoring&&u&&u!==l){let e=I[u];if(e){let t=I[l];for(let n in e){if(n===R){if(s)continue}else{let e=z(n);if(!e||s&&o&&(c??=xe(o),c.includes(e)))continue}t||=I[l]={},t[n]??=e[n]}}}L=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){let s=rt.get(t.toLocation),u=e&&i&&(s===`PUSH`||s===`REPLACE`),d=r.restoring?I[l]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:r}=d[e];if(e===R){if(u)continue;scrollTo({top:r,left:t,behavior:n}),a=!0}else{let n=z(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=xe(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{L=!1}}))}function Ce(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function we(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Te(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=we(r):Array.isArray(t)?t.push(we(r)):n[e]=[t,we(r)]}return n}var Ee=Oe(JSON.parse),De=ke(JSON.stringify,JSON.parse);function Oe(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Te(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function ke(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Ce(e,r);return t?`?${t}`:``}}var Ae=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},je=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),B=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),V=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Me=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},H=(e,t,n)=>{if(!(!i(n)&&!h(n)))throw i(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:i(n)?`redirected`:h(n)?`notFound`:r.status===`pending`?`success`:r.status,context:V(e,t.index),isFetching:!1,error:n})),h(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),i(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Ne=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Pe=(e,t,n)=>{let r=V(e,n);e.updateMatch(t,e=>({...e,context:r}))},U=(e,t,n)=>{let{id:r,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,H(e,e.router.getMatch(r),n);try{o.options.onError?.(n)}catch(t){n=t,H(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!i(n)&&!h(n)&&(e.serialError??=n)},Fe=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!B(e,t)&&(n.options.loader||n.options.beforeLoad||Ge(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Ae(e)},i);r._nonReactive.pendingTimeout=t}},Ie=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Fe(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&H(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Le=(e,t,n,r)=>{let a=e.router.getMatch(t),o=a._nonReactive.loadPromise;a._nonReactive.loadPromise=E(()=>{o?.resolve(),o=void 0});let{paramsError:s,searchError:c}=a;s&&U(e,n,s),c&&U(e,n,c),Fe(e,t,r,a);let l=new AbortController,u=!1,d=()=>{u||(u=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:l})))},f=()=>{a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{d(),f()});return}a._nonReactive.beforeLoadPromise=E();let p={...V(e,n,!1),...a.__routeContext},{search:m,params:g,cause:_}=a,v=B(e,t),y={search:m,abortController:l,params:g,preload:v,context:p,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?`preload`:_,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},b=r=>{if(r===void 0){e.router.batch(()=>{d(),f()});return}(i(r)||h(r))&&(d(),U(e,n,r)),e.router.batch(()=>{d(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),f()})},x;try{if(x=r.options.beforeLoad(y),D(x))return d(),x.catch(t=>{U(e,n,t)}).then(b)}catch(t){d(),U(e,n,t)}b(x)},Re=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Le(e,n,t,i),s=()=>{if(Ne(e,n))return;let t=Ie(e,n,i);return D(t)?t.then(o):o()};return a()},ze=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Be=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=V(e,r),d=B(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Ve=async(e,t,n,r,a)=>{try{let o=e.router.getMatch(n);try{W(a);let i=a.options.loader,s=typeof i==`function`?i:i?.handler,c=s?.(Be(e,t,n,r,a)),l=!!s&&D(c);if((l||a._lazyPromise||a._componentsPromise||a.options.head||a.options.scripts||a.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;H(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}a._lazyPromise&&await a._lazyPromise;let u=o._nonReactive.minPendingPromise;u&&await u,a._componentsPromise&&await a._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:V(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let s=t;if(s?.name===`AbortError`){if(o.abortController.signal.aborted){o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:V(e,r)}));return}let c=o._nonReactive.minPendingPromise;c&&await c,h(t)&&await a.options.notFoundComponent?.preload?.(),H(e,e.router.getMatch(n),t);try{a.options.onError?.(t)}catch(t){s=t,H(e,e.router.getMatch(n),t)}!i(s)&&!h(s)&&await W(a,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:s,context:V(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),H(e,r,t)}},He=async(e,t,n)=>{async function r(r,o,l,u,f){let p=Date.now()-o.updatedAt,m=r?f.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:f.options.staleTime??e.router.options.defaultStaleTime??0,h=f.options.shouldReload,g=typeof h==`function`?h(Be(e,t,a,n,f)):h,{status:_,invalid:v}=u,y=p>=m&&(!!e.forceStaleReload||u.cause===`enter`||l!==void 0&&l!==u.id);s=_===`success`&&(v||(g??y)),r&&f.options.preload===!1||(s&&!e.sync&&d?(c=!0,(async()=>{try{await Ve(e,t,a,n,f);let r=e.router.getMatch(a);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){i(t)&&await e.router.navigate(t.options)}})()):_!==`success`||s?await Ve(e,t,a,n,f):Pe(e,a,n))}let{id:a,routeId:o}=e.matches[n],s=!1,c=!1,l=e.router.looseRoutesById[o],u=l.options.loader,d=((typeof u==`function`?void 0:u?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Ne(e,a)){if(!e.router.getMatch(a))return e.matches[n];Pe(e,a,n)}else{let t=e.router.getMatch(a),i=e.router.stores.matchesId.get()[n],s=(i&&e.router.stores.matchStores.get(i)||null)?.routeId===o?i:e.router.stores.matches.get().find(e=>e.routeId===o)?.id,c=B(e,a);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&d)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(a),i=n._nonReactive.error||n.error;i&&H(e,n,i),n.status===`pending`&&await r(c,t,s,n,l)}else{let n=c&&!e.router.stores.matchStores.has(a),i=e.router.getMatch(a);i._nonReactive.loaderPromise=E(),n!==i.preload&&e.updateMatch(a,e=>({...e,preload:n})),await r(c,t,s,i,l)}}let f=e.router.getMatch(a);c||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,c||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;let p=c?f.isFetching:!1;return p!==f.isFetching||f.invalid!==!1?(e.updateMatch(a,e=>({...e,isFetching:p,invalid:!1})),e.router.getMatch(a)):f};async function Ue(e){let t=e,n=[];je(t.router)&&Ae(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=Re(t,e);D(n)&&await n}catch(e){if(i(e))throw e;if(h(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let a=t.firstBadMatchIndex??t.matches.length,o=r&&!t.preload?Me(t,r):void 0,s=r&&t.preload?0:o===void 0?a:Math.min(o+1,a),c,l;for(let e=0;e<s;e++)n.push(He(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(i(e))throw e;h(e)?c??=e:l??=e}if(l!==void 0)throw l}let u=c??(r&&!t.preload?r:void 0),f=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!u&&r&&t.preload)return t.matches;if(u){let e=Me(t,u);e===void 0&&d();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),u.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:u},isFetching:!1})),f=e,await W(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await W(e,[`errorComponent`])}for(let e=0;e<=f;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=ze(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let p=Ae(t);if(D(p)&&await p,u)throw u;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function We(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function W(e,t=G){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===G?(()=>{if(e._componentsPromise===void 0){let t=We(e,G);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():We(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ge(e){for(let t of G)if(e.options[t]?.preload)return!0;return!1}var G=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function Ke(e){return{input:({url:t})=>{for(let n of e)t=Je(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Ye(e[n],t);return t}}}function qe(e){let t=ce(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=p([`/`,t,e.pathname]),e)}}function Je(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Ye(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}var K=`__TSR_index`,Xe=`popstate`,Ze=`beforeunload`;function Qe(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=q(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[K];i=$e(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[K];i=$e(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[K]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function $e(e,t){t||={};let n=nt();return{...t,key:n,__TSR_key:n,[K]:e}}function et(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>q(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=nt();t.history.replaceState({[K]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=q(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[K]-l.state[K],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Qe({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ze,S,{capture:!0}),t.removeEventListener(Xe,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Ze,S,{capture:!0}),t.addEventListener(Xe,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function tt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function q(e,t){let n=tt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=nt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[K]:0,key:a,__TSR_key:a}}}function nt(){return(Math.random()+1).toString(36).substring(7)}function J(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var rt=new WeakMap,it=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=s(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=et()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=re(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=fe(ot(this.latestLocation),e),Se(this)}let a=!1,o=this.options.basepath??`/`,c=this.options.rewrite;if(r||n!==o||i!==c){this.basepath=o;let e=[],t=ce(o);t&&t!==`/`&&e.push(qe({basepath:o})),c&&e.push(c),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Ke(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=f(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&c(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:v(e).path,external:!1,searchStr:o,search:M(t?.search,i),hash:v(r.slice(1)).path,state:O(t?.state,a)}}let o=new URL(i,this.origin),s=Je(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:v(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:M(t?.search,c),hash:v(s.hash.slice(1)).path,state:O(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>y({base:e,to:t.includes(`//`)?_(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>st({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,o=t.to?`${t.to}`:void 0,s=r.search,c=Object.assign(Object.create(null),r.params),l=o?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),d=o?this.resolvePathWithBase(l,o):l,f=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?c:Object.assign(c,j(t.params,c)),p=this.routesByPath[a(d)],m;if(p)m=this.getRouteBranch(p);else if(d.includes(`$`))m=[];else{let e=this.getMatchedRoutes(d);m=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(m=[...m,this.options.notFoundRoute])}if(m.length&&ie(f))for(let e of m){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(f,t(f))}catch{}}let h=e.leaveParams?d:v(u({path:d,params:f,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,g=s;if(e._includeValidateSearch&&this.options.search?.strict){let e={};m.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,X(t.options.validateSearch,{...e,...g}))}catch{}}),g=e}g=ct({search:g,dest:t,destRoutes:m,_includeValidateSearch:e._includeValidateSearch}),g=M(s,g);let _=this.options.stringifySearch(g),y=t.hash===!0?n.hash:t.hash?j(t.hash,n.hash):void 0,b=y?`#${y}`:``,x=t.state===!0?n.state:t.state?j(t.state,n.state):{};x=O(n.state,x);let S=`${h}${_}${b}`,C,w,T=!1;if(this.rewrite){let e=new URL(S,this.origin),t=Ye(this.rewrite,e);C=e.href.replace(e.origin,``),t.origin===this.origin?w=t.pathname+t.search+t.hash:(w=t.href,T=!0)}else C=k(S),w=C;return{publicHref:w,href:C,pathname:h,search:g,searchStr:_,state:x,hash:y??``,external:T,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=l(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,j(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let i,o=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=r(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},s=a(this.latestLocation.href)===a(n.href),c=this.commitLocationPromise;if(this.commitLocationPromise=E(()=>{c?.resolve(),c=void 0}),s&&o())this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(i?{action:{type:i}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=q(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Je(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(A(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,a,o=this.stores.resolvedLocation.get()??this.stores.location.get();for(a=new Promise(s=>{this.startTransition(async()=>{try{this.beforeLoad(),t?rt.set(this.latestLocation,t):rt.delete(this.latestLocation);let n=this.latestLocation,r=J(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await Ue({router:this,sync:e?.sync,forceStaleReload:o.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){i(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):h(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),s()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let s;this.hasNotFoundMatch()?s=404:this.stores.matches.get().some(e=>e.status===`error`)&&(s=500),s!==void 0&&this.stores.statusCode.set(s)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(J(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&A(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=W,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),a=new Set([...r,...this.stores.cachedIds.get()]),o=n.filter(e=>!a.has(e.id));if(o.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...o])}try{return n=await Ue({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(i(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});h(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},i=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let a=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=C(i.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!r(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?r(a.search,i.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??De,parseSearch:e.parseSearch??Ee,protocolAllowlist:e.protocolAllowlist??T}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=S(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:o}=n,{matchedRoutes:s}=n,c=!1;(r?r.path!==`/`&&o[`**`]:a(e.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:c=!0);let l=c?ut(this.options.notFoundMode,s):void 0,d=Array(s.length),f=new Map;for(let e of this.stores.matchStores.values())e.routeId&&f.set(e.routeId,e.get());for(let n=0;n<s.length;n++){let r=s[n],a=d[n-1],c,p,m;{let n=a?.search??e.search,i=a?._strictSearch??void 0;try{let e=X(r.options.validateSearch,{...n})??void 0;c={...n,...e},p={...i,...e},m=void 0}catch(e){let r=e;if(e instanceof Y||(r=new Y(e.message,{cause:e})),t?.throwOnError)throw r;c=n,p={},m=r}}let g=r.options.loaderDeps?.({search:c})??``,_=g?JSON.stringify(g):``,{interpolatedPath:v,usedParams:y}=u({path:r.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),b=r.id+v+_,x=this.getMatch(b),S=f.get(r.id),C=x?._strictParams??y,w;if(!x)try{dt(r,C)}catch(e){if(w=h(e)||i(e)?e:new at(e.message,{cause:e}),t?.throwOnError)throw w}Object.assign(o,C);let T=S?`stay`:`enter`,D;if(x)D={...x,cause:T,params:S?.params??o,_strictParams:C,search:M(S?S.search:x.search,c),_strictSearch:p};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Ge(r)?`pending`:`success`;D={id:b,ssr:r.options.ssr,index:n,routeId:r.id,params:S?.params??o,_strictParams:C,pathname:v,updatedAt:Date.now(),search:S?M(S.search,c):c,_strictSearch:p,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:w,__routeContext:void 0,_nonReactive:{loadPromise:E()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:T,loaderDeps:S?O(S.loaderDeps,g):g,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(D.globalNotFound=l===r.id),D.searchError=m;let k=this.getParentContext(a);D.context={...k,...D.__routeContext,...D.__beforeLoadContext},d[n]=D}for(let t=0;t<d.length;t++){let n=d[t],r=this.looseRoutesById[n.routeId],i=this.getMatch(n.id),a=f.get(n.routeId);if(n.params=a?M(a.params,o):o,!i){let i=d[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:d,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return d}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=ne(t),i={...e.search};for(let e of t)try{Object.assign(i,X(e.options.validateSearch,i))}catch{}let a=ne(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{dt(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},Y=class extends Error{},at=class extends Error{};function ot(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function X(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Y(`Async validation not supported`);if(n.issues)throw new Y(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function st({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=a(e),o,s=x(i,n,!0);return s&&(o=s.route,Object.assign(r,s.rawParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:o}}function ct({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return lt(n)(e,t,r??!1)}function lt(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=X(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=j(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function ut(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return m}function dt(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}var Z=e(n(),1),Q=t();function ft(e){let t=e.errorComponent??mt;return(0,Q.jsx)(pt,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?Z.createElement(t,{error:n,reset:r}):e.children})}var pt=class extends Z.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function mt({error:e}){let[t,n]=Z.useState(!1);return(0,Q.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Q.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Q.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,Q.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,Q.jsx)(`code`,{children:e.message}):null})}):null]})}function ht(e){let t=N(),n=`not-found-${o(t.stores.location,e=>e.pathname)}-${o(t.stores.status,e=>e)}`;return(0,Q.jsx)(ft,{getResetKey:()=>n,onCatch:(t,n)=>{if(h(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(h(t))return e.fallback?.(t);throw t},children:e.children})}function gt(){return(0,Q.jsx)(`p`,{children:`Not Found`})}function $(e){return(0,Q.jsx)(Q.Fragment,{children:e.children})}function _t(e,t,n){return t.options.notFoundComponent?(0,Q.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Q.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Q.jsx)(gt,{})}var vt=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,yt=(e,t)=>e[0]===t[0]&&e[1]===t[1],bt=Z.memo(function({matchId:e}){let t=N(),n=t.stores.matchStores.get(e);n||d();let r=o(t.stores.loadedAt,e=>e),i=o(n,e=>e,vt);return(0,Q.jsx)(xt,{router:t,matchId:e,resetKey:r,matchState:Z.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function xt({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,Q.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?Z.Suspense:$,f=s?ft:$,p=l?ht:$;return(0,Q.jsxs)(i.isRoot?i.options.shellComponent??$:$,{children:[(0,Q.jsx)(ee.Provider,{value:t,children:(0,Q.jsx)(d,{fallback:o,children:(0,Q.jsx)(f,{getResetKey:()=>n,errorComponent:s||mt,onCatch:(e,t)=>{if(h(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,Q.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return Z.createElement(l,e)},children:u||r._displayPending?(0,Q.jsx)(b,{fallback:o,children:(0,Q.jsx)(Ct,{matchId:t})}):(0,Q.jsx)(Ct,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(St,{}),(e.options.scrollRestoration,null)]}):null]})}function St(){let e=N(),t=Z.useRef();return oe(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...J(e.stores.location.get(),r??n)}),t.current=n},[o(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var Ct=Z.memo(function({matchId:e}){let t=N(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||d();let a=o(r,e=>e),s=a.routeId,c=t.routesById[s],l=Z.useMemo(()=>{let e=(t.routesById[s].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:s,loaderDeps:a.loaderDeps,params:a._strictParams,search:a._strictSearch});return e?JSON.stringify(e):void 0},[s,a.loaderDeps,a._strictParams,a._strictSearch,t.options.defaultRemountDeps,t.routesById]),u=Z.useMemo(()=>{let e=c.options.component??t.options.defaultComponent;return e?(0,Q.jsx)(e,{},l):(0,Q.jsx)(wt,{})},[l,c.options.component,t.options.defaultComponent]);if(a._displayPending)throw n(a,`displayPendingPromise`);if(a._forcePending)throw n(a,`minPendingPromise`);if(a.status===`pending`){let e=c.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(a.id);if(n&&!n._nonReactive.minPendingPromise){let t=E();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(a,`loadPromise`)}if(a.status===`notFound`)return h(a.error)||d(),_t(t,c,a.error);if(a.status===`redirected`)throw i(a.error)||d(),n(a,`loadPromise`);if(a.status===`error`)throw a.error;return u}),wt=Z.memo(function(){let e=N(),t=Z.useContext(ee),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=o(a,e=>[e?.routeId,e?.globalNotFound??!1],yt),i=o(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,s=e.options.defaultPendingComponent?(0,Q.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||d(),_t(e,a,void 0);if(!i)return null;let c=(0,Q.jsx)(bt,{matchId:i});return n===`__root__`?(0,Q.jsx)(Z.Suspense,{fallback:s,children:c}):c}),Tt=se(`/(home)`)({component:ae(()=>le(()=>import(`./route-Da0uHKH9.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),`component`),validateSearch:g(te({}))});export{ft as a,J as c,$ as i,ue as l,bt as n,mt as o,wt as r,it as s,Tt as t,de as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/run-D7w-8aQA.js","assets/compiler-runtime-CLAvuQ-D.js","assets/rolldown-runtime-QTnfLwEv.js","assets/fallbacks-DwGmG_0c.js","assets/state-_2CmL5IM.js","assets/-workbench-terminal-YB9hQXjr.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Ot as e,nt as t,tt as n,vs as r,wt as i,ys as a,z as o}from"./fallbacks-DwGmG_0c.js";import{t as s}from"./preload-helper-CjdClQve.js";var c=a(`/(home)/$worktree/run`)({component:r(()=>s(()=>import(`./run-D7w-8aQA.js`),__vite__mapDeps([0,1,2,3,4,5])),`component`),validateSearch:e(t({inactive:i(o),sessionId:n}))});export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./compiler-runtime-CLAvuQ-D.js";import{n}from"./fallbacks-DwGmG_0c.js";import{S as r,t as i}from"./state-_2CmL5IM.js";import{t as a}from"./run-CCCofwDU.js";import{t as o}from"./-workbench-terminal-YB9hQXjr.js";var s=t(),c=e();function l(){let e=(0,s.c)(9),t=a.useParams(),l=a.useSearch(),u;e[0]===t.worktree?u=e[1]:(u=i(t.worktree),e[0]=t.worktree,e[1]=u);let d=r(u);if(!d.value.activeWorktree)return;if(l.inactive===!0){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(`div`,{className:`bg-background h-full min-h-0 min-w-0 p-2`,children:(0,c.jsx)(n,{message:`This script has not been started yet. Use the play button to start it.`})}),e[2]=t):t=e[2],t}let f;e[3]!==d.value.activeWorktree.root||e[4]!==l.sessionId?(f={cwd:d.value.activeWorktree.root,sessionId:l.sessionId},e[3]=d.value.activeWorktree.root,e[4]=l.sessionId,e[5]=f):f=e[5];let p;return e[6]!==l.sessionId||e[7]!==f?(p=(0,c.jsx)(`div`,{className:`bg-background h-full min-h-0 min-w-0`,children:(0,c.jsx)(o,{session:f},l.sessionId)}),e[6]=l.sessionId,e[7]=f,e[8]=p):p=e[8],p}export{l as component};
|
package/dist/client/assets/{sankeyDiagram-5OEKKPKP-CtfCq9EV.js → sankeyDiagram-5OEKKPKP-cs1kWOqp.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as e,p as t}from"./src-oaGqIoNi.js";import{H as n,J as r,K as i,U as a,a as o,d as s,s as c,v as l,w as u,x as d,y as f}from"./chunk-CSCIHK7Q-BTHSw3Fl.js";import{t as p}from"./ordinal-hYBb2elL.js";function m(e){for(var t=e.length/6|0,n=Array(t),r=0;r<t;)n[r]=`#`+e.slice(r*6,++r*6);return n}var h=m(`4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab`);function g(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function _(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function v(e,t){let n=0;if(t===void 0)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function y(e){return e.target.depth}function b(e){return e.depth}function x(e,t){return t-1-e.height}function S(e,t){return e.sourceLinks.length?e.depth:t-1}function C(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?_(e.sourceLinks,y)-1:0}function w(e){return function(){return e}}function T(e,t){return D(e.source,t.source)||e.index-t.index}function E(e,t){return D(e.target,t.target)||e.index-t.index}function D(e,t){return e.y0-t.y0}function O(e){return e.value}function k(e){return e.index}function A(e){return e.nodes}function j(e){return e.links}function M(e,t){let n=e.get(t);if(!n)throw Error(`missing: `+t);return n}function N({nodes:e}){for(let t of e){let e=t.y0,n=e;for(let n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(let e of t.targetLinks)e.y1=n+e.width/2,n+=e.width}}function P(){let e=0,t=0,n=1,r=1,i=24,a=8,o,s=k,c=S,l,u,d=A,f=j,p=6;function m(){let e={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return h(e),y(e),b(e),x(e),F(e),N(e),e}m.update=function(e){return N(e),e},m.nodeId=function(e){return arguments.length?(s=typeof e==`function`?e:w(e),m):s},m.nodeAlign=function(e){return arguments.length?(c=typeof e==`function`?e:w(e),m):c},m.nodeSort=function(e){return arguments.length?(l=e,m):l},m.nodeWidth=function(e){return arguments.length?(i=+e,m):i},m.nodePadding=function(e){return arguments.length?(a=o=+e,m):a},m.nodes=function(e){return arguments.length?(d=typeof e==`function`?e:w(e),m):d},m.links=function(e){return arguments.length?(f=typeof e==`function`?e:w(e),m):f},m.linkSort=function(e){return arguments.length?(u=e,m):u},m.size=function(i){return arguments.length?(e=t=0,n=+i[0],r=+i[1],m):[n-e,r-t]},m.extent=function(i){return arguments.length?(e=+i[0][0],n=+i[1][0],t=+i[0][1],r=+i[1][1],m):[[e,t],[n,r]]},m.iterations=function(e){return arguments.length?(p=+e,m):p};function h({nodes:e,links:t}){for(let[t,n]of e.entries())n.index=t,n.sourceLinks=[],n.targetLinks=[];let n=new Map(e.map((t,n)=>[s(t,n,e),t]));for(let[e,r]of t.entries()){r.index=e;let{source:t,target:i}=r;typeof t!=`object`&&(t=r.source=M(n,t)),typeof i!=`object`&&(i=r.target=M(n,i)),t.sourceLinks.push(r),i.targetLinks.push(r)}if(u!=null)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(u),n.sort(u)}function y({nodes:e}){for(let t of e)t.value=t.fixedValue===void 0?Math.max(v(t.sourceLinks,O),v(t.targetLinks,O)):t.fixedValue}function b({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.depth=i;for(let{target:t}of e.sourceLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function x({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.height=i;for(let{source:t}of e.targetLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function C({nodes:t}){let r=g(t,e=>e.depth)+1,a=(n-e-i)/(r-1),o=Array(r);for(let n of t){let t=Math.max(0,Math.min(r-1,Math.floor(c.call(null,n,r))));n.layer=t,n.x0=e+t*a,n.x1=n.x0+i,o[t]?o[t].push(n):o[t]=[n]}if(l)for(let e of o)e.sort(l);return o}function P(e){let n=_(e,e=>(r-t-(e.length-1)*o)/v(e,O));for(let i of e){let e=t;for(let t of i){t.y0=e,t.y1=e+t.value*n,e=t.y1+o;for(let e of t.sourceLinks)e.width=e.value*n}e=(r-e+o)/(i.length+1);for(let t=0;t<i.length;++t){let n=i[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}H(i)}}function F(e){let n=C(e);o=Math.min(a,(r-t)/(g(n,e=>e.length)-1)),P(n);for(let e=0;e<p;++e){let t=.99**e,r=Math.max(1-t,(e+1)/p);L(n,t,r),I(n,t,r)}}function I(e,t,n){for(let r=1,i=e.length;r<i;++r){let i=e[r];for(let e of i){let n=0,r=0;for(let{source:t,value:i}of e.targetLinks){let a=i*(e.layer-t.layer);n+=U(t,e)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function L(e,t,n){for(let r=e.length-2;r>=0;--r){let i=e[r];for(let e of i){let n=0,r=0;for(let{target:t,value:i}of e.sourceLinks){let a=i*(t.layer-e.layer);n+=W(e,t)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function R(e,n){let i=e.length>>1,a=e[i];B(e,a.y0-o,i-1,n),z(e,a.y1+o,i+1,n),B(e,r,e.length-1,n),z(e,t,0,n)}function z(e,t,n,r){for(;n<e.length;++n){let i=e[n],a=(t-i.y0)*r;a>1e-6&&(i.y0+=a,i.y1+=a),t=i.y1+o}}function B(e,t,n,r){for(;n>=0;--n){let i=e[n],a=(i.y1-t)*r;a>1e-6&&(i.y0-=a,i.y1-=a),t=i.y0-o}}function V({sourceLinks:e,targetLinks:t}){if(u===void 0){for(let{source:{sourceLinks:e}}of t)e.sort(E);for(let{target:{targetLinks:t}}of e)t.sort(T)}}function H(e){if(u===void 0)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(E),n.sort(T)}function U(e,t){let n=e.y0-(e.sourceLinks.length-1)*o/2;for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n+=i+o}for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n-=i}return n}function W(e,t){let n=t.y0-(t.targetLinks.length-1)*o/2;for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n+=i+o}for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n-=i}return n}return m}var F=Math.PI,I=2*F,L=1e-6,R=I-L;function z(){this._x0=this._y0=this._x1=this._y1=null,this._=``}function B(){return new z}z.prototype=B.prototype={constructor:z,moveTo:function(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(d>L)if(!(Math.abs(u*s-c*l)>L)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((F-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>L&&(this._+=`L`+(e+y*l)+`,`+(t+y*u)),this._+=`A`+i+`,`+i+`,0,0,`+ +(u*f>l*p)+`,`+(this._x1=e+b*s)+`,`+(this._y1=t+b*c)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+c+`,`+l:(Math.abs(this._x1-c)>L||Math.abs(this._y1-l)>L)&&(this._+=`L`+c+`,`+l),n&&(d<0&&(d=d%I+I),d>R?this._+=`A`+n+`,`+n+`,0,1,`+u+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+u+`,`+(this._x1=c)+`,`+(this._y1=l):d>L&&(this._+=`A`+n+`,`+n+`,0,`+ +(d>=F)+`,`+u+`,`+(this._x1=e+n*Math.cos(i))+`,`+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}};var V=Array.prototype.slice;function H(e){return function(){return e}}function U(e){return e[0]}function W(e){return e[1]}function G(e){return e.source}function ee(e){return e.target}function te(e){var t=G,n=ee,r=U,i=W,a=null;function o(){var o,s=V.call(arguments),c=t.apply(this,s),l=n.apply(this,s);if(a||=o=B(),e(a,+r.apply(this,(s[0]=c,s)),+i.apply(this,s),+r.apply(this,(s[0]=l,s)),+i.apply(this,s)),o)return a=null,o+``||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(n=e,o):n},o.x=function(e){return arguments.length?(r=typeof e==`function`?e:H(+e),o):r},o.y=function(e){return arguments.length?(i=typeof e==`function`?e:H(+e),o):i},o.context=function(e){return arguments.length?(a=e??null,o):a},o}function ne(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function re(){return te(ne)}function ie(e){return[e.source.x1,e.y0]}function ae(e){return[e.target.x0,e.y1]}function K(){return re().source(ie).target(ae)}var q=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,9],r=[1,10],i=[1,5,10,12],a={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:`error`,4:`SANKEY`,5:`NEWLINE`,10:`EOF`,11:`field[source]`,12:`COMMA`,13:`field[target]`,14:`field[value]`,18:`DQUOTE`,19:`ESCAPED_TEXT`,20:`NON_ESCAPED_TEXT`},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 7:let e=r.findOrCreateNode(a[s-4].trim().replaceAll(`""`,`"`)),t=r.findOrCreateNode(a[s-2].trim().replaceAll(`""`,`"`)),n=parseFloat(a[s].trim());r.addLink(e,t,n);break;case 8:case 9:case 11:this.$=a[s];break;case 10:this.$=a[s-1];break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:r},{15:18,16:7,17:8,18:n,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
1
|
+
import{h as e,p as t}from"./src-DzxfdEt6.js";import{H as n,J as r,K as i,U as a,a as o,d as s,s as c,v as l,w as u,x as d,y as f}from"./chunk-CSCIHK7Q-DoGVP1BZ.js";import{t as p}from"./ordinal-hYBb2elL.js";function m(e){for(var t=e.length/6|0,n=Array(t),r=0;r<t;)n[r]=`#`+e.slice(r*6,++r*6);return n}var h=m(`4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab`);function g(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function _(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function v(e,t){let n=0;if(t===void 0)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function y(e){return e.target.depth}function b(e){return e.depth}function x(e,t){return t-1-e.height}function S(e,t){return e.sourceLinks.length?e.depth:t-1}function C(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?_(e.sourceLinks,y)-1:0}function w(e){return function(){return e}}function T(e,t){return D(e.source,t.source)||e.index-t.index}function E(e,t){return D(e.target,t.target)||e.index-t.index}function D(e,t){return e.y0-t.y0}function O(e){return e.value}function k(e){return e.index}function A(e){return e.nodes}function j(e){return e.links}function M(e,t){let n=e.get(t);if(!n)throw Error(`missing: `+t);return n}function N({nodes:e}){for(let t of e){let e=t.y0,n=e;for(let n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(let e of t.targetLinks)e.y1=n+e.width/2,n+=e.width}}function P(){let e=0,t=0,n=1,r=1,i=24,a=8,o,s=k,c=S,l,u,d=A,f=j,p=6;function m(){let e={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return h(e),y(e),b(e),x(e),F(e),N(e),e}m.update=function(e){return N(e),e},m.nodeId=function(e){return arguments.length?(s=typeof e==`function`?e:w(e),m):s},m.nodeAlign=function(e){return arguments.length?(c=typeof e==`function`?e:w(e),m):c},m.nodeSort=function(e){return arguments.length?(l=e,m):l},m.nodeWidth=function(e){return arguments.length?(i=+e,m):i},m.nodePadding=function(e){return arguments.length?(a=o=+e,m):a},m.nodes=function(e){return arguments.length?(d=typeof e==`function`?e:w(e),m):d},m.links=function(e){return arguments.length?(f=typeof e==`function`?e:w(e),m):f},m.linkSort=function(e){return arguments.length?(u=e,m):u},m.size=function(i){return arguments.length?(e=t=0,n=+i[0],r=+i[1],m):[n-e,r-t]},m.extent=function(i){return arguments.length?(e=+i[0][0],n=+i[1][0],t=+i[0][1],r=+i[1][1],m):[[e,t],[n,r]]},m.iterations=function(e){return arguments.length?(p=+e,m):p};function h({nodes:e,links:t}){for(let[t,n]of e.entries())n.index=t,n.sourceLinks=[],n.targetLinks=[];let n=new Map(e.map((t,n)=>[s(t,n,e),t]));for(let[e,r]of t.entries()){r.index=e;let{source:t,target:i}=r;typeof t!=`object`&&(t=r.source=M(n,t)),typeof i!=`object`&&(i=r.target=M(n,i)),t.sourceLinks.push(r),i.targetLinks.push(r)}if(u!=null)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(u),n.sort(u)}function y({nodes:e}){for(let t of e)t.value=t.fixedValue===void 0?Math.max(v(t.sourceLinks,O),v(t.targetLinks,O)):t.fixedValue}function b({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.depth=i;for(let{target:t}of e.sourceLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function x({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.height=i;for(let{source:t}of e.targetLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function C({nodes:t}){let r=g(t,e=>e.depth)+1,a=(n-e-i)/(r-1),o=Array(r);for(let n of t){let t=Math.max(0,Math.min(r-1,Math.floor(c.call(null,n,r))));n.layer=t,n.x0=e+t*a,n.x1=n.x0+i,o[t]?o[t].push(n):o[t]=[n]}if(l)for(let e of o)e.sort(l);return o}function P(e){let n=_(e,e=>(r-t-(e.length-1)*o)/v(e,O));for(let i of e){let e=t;for(let t of i){t.y0=e,t.y1=e+t.value*n,e=t.y1+o;for(let e of t.sourceLinks)e.width=e.value*n}e=(r-e+o)/(i.length+1);for(let t=0;t<i.length;++t){let n=i[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}H(i)}}function F(e){let n=C(e);o=Math.min(a,(r-t)/(g(n,e=>e.length)-1)),P(n);for(let e=0;e<p;++e){let t=.99**e,r=Math.max(1-t,(e+1)/p);L(n,t,r),I(n,t,r)}}function I(e,t,n){for(let r=1,i=e.length;r<i;++r){let i=e[r];for(let e of i){let n=0,r=0;for(let{source:t,value:i}of e.targetLinks){let a=i*(e.layer-t.layer);n+=U(t,e)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function L(e,t,n){for(let r=e.length-2;r>=0;--r){let i=e[r];for(let e of i){let n=0,r=0;for(let{target:t,value:i}of e.sourceLinks){let a=i*(t.layer-e.layer);n+=W(e,t)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function R(e,n){let i=e.length>>1,a=e[i];B(e,a.y0-o,i-1,n),z(e,a.y1+o,i+1,n),B(e,r,e.length-1,n),z(e,t,0,n)}function z(e,t,n,r){for(;n<e.length;++n){let i=e[n],a=(t-i.y0)*r;a>1e-6&&(i.y0+=a,i.y1+=a),t=i.y1+o}}function B(e,t,n,r){for(;n>=0;--n){let i=e[n],a=(i.y1-t)*r;a>1e-6&&(i.y0-=a,i.y1-=a),t=i.y0-o}}function V({sourceLinks:e,targetLinks:t}){if(u===void 0){for(let{source:{sourceLinks:e}}of t)e.sort(E);for(let{target:{targetLinks:t}}of e)t.sort(T)}}function H(e){if(u===void 0)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(E),n.sort(T)}function U(e,t){let n=e.y0-(e.sourceLinks.length-1)*o/2;for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n+=i+o}for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n-=i}return n}function W(e,t){let n=t.y0-(t.targetLinks.length-1)*o/2;for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n+=i+o}for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n-=i}return n}return m}var F=Math.PI,I=2*F,L=1e-6,R=I-L;function z(){this._x0=this._y0=this._x1=this._y1=null,this._=``}function B(){return new z}z.prototype=B.prototype={constructor:z,moveTo:function(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(d>L)if(!(Math.abs(u*s-c*l)>L)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((F-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>L&&(this._+=`L`+(e+y*l)+`,`+(t+y*u)),this._+=`A`+i+`,`+i+`,0,0,`+ +(u*f>l*p)+`,`+(this._x1=e+b*s)+`,`+(this._y1=t+b*c)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+c+`,`+l:(Math.abs(this._x1-c)>L||Math.abs(this._y1-l)>L)&&(this._+=`L`+c+`,`+l),n&&(d<0&&(d=d%I+I),d>R?this._+=`A`+n+`,`+n+`,0,1,`+u+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+u+`,`+(this._x1=c)+`,`+(this._y1=l):d>L&&(this._+=`A`+n+`,`+n+`,0,`+ +(d>=F)+`,`+u+`,`+(this._x1=e+n*Math.cos(i))+`,`+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}};var V=Array.prototype.slice;function H(e){return function(){return e}}function U(e){return e[0]}function W(e){return e[1]}function G(e){return e.source}function ee(e){return e.target}function te(e){var t=G,n=ee,r=U,i=W,a=null;function o(){var o,s=V.call(arguments),c=t.apply(this,s),l=n.apply(this,s);if(a||=o=B(),e(a,+r.apply(this,(s[0]=c,s)),+i.apply(this,s),+r.apply(this,(s[0]=l,s)),+i.apply(this,s)),o)return a=null,o+``||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(n=e,o):n},o.x=function(e){return arguments.length?(r=typeof e==`function`?e:H(+e),o):r},o.y=function(e){return arguments.length?(i=typeof e==`function`?e:H(+e),o):i},o.context=function(e){return arguments.length?(a=e??null,o):a},o}function ne(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function re(){return te(ne)}function ie(e){return[e.source.x1,e.y0]}function ae(e){return[e.target.x0,e.y1]}function K(){return re().source(ie).target(ae)}var q=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,9],r=[1,10],i=[1,5,10,12],a={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:`error`,4:`SANKEY`,5:`NEWLINE`,10:`EOF`,11:`field[source]`,12:`COMMA`,13:`field[target]`,14:`field[value]`,18:`DQUOTE`,19:`ESCAPED_TEXT`,20:`NON_ESCAPED_TEXT`},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 7:let e=r.findOrCreateNode(a[s-4].trim().replaceAll(`""`,`"`)),t=r.findOrCreateNode(a[s-2].trim().replaceAll(`""`,`"`)),n=parseFloat(a[s].trim());r.addLink(e,t,n);break;case 8:case 9:case 11:this.$=a[s];break;case 10:this.$=a[s-1];break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:r},{15:18,16:7,17:8,18:n,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};a.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|