@deslop/workbench 0.0.407 → 0.0.410
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/client/assets/{-workbench-terminal-C3m5o50g.js → -workbench-terminal-Ne3Ca_Zm.js} +8 -8
- package/dist/client/assets/{agent-DWi_bAGy.js → agent-YDhqENQr.js} +1 -1
- package/dist/client/assets/agent-YvOEbSL4.js +2 -0
- package/dist/client/assets/{dialog-CpMhdP-y.js → dialog-O3wBc7X2.js} +2 -2
- package/dist/client/assets/diff-BcPEyFnc.js +223 -0
- package/dist/client/assets/diff-CZdOESVK.js +2 -0
- package/dist/client/assets/{external-link-Bw3Ptvfw.js → external-link-D8TqDHgo.js} +1 -1
- package/dist/client/assets/{fallbacks-f8E4aL2c.js → fallbacks-BYPj1x-T.js} +11 -11
- package/dist/client/assets/index-DFD32fIK.css +2 -0
- package/dist/client/assets/index-k88N8viu.js +10 -0
- package/dist/client/assets/{input-BVvU6Eiy.js → input-BHj016ES.js} +1 -1
- package/dist/client/assets/portless-DbuqdEMA.js +2 -0
- package/dist/client/assets/portless-rPZ2tatn.js +1 -0
- package/dist/client/assets/{resizable-CYsJ6Kg2.js → resizable-BlkgaK6V.js} +1 -1
- package/dist/client/assets/route-DKK79z62.js +2 -0
- package/dist/client/assets/route-DOc4X-Ya.js +45 -0
- package/dist/client/assets/{run-C8QYJmux.js → run-DVOYYIUX.js} +1 -1
- package/dist/client/assets/run-gggwaxnT.js +2 -0
- package/dist/client/assets/{sonner-CrB5PaMX.js → sonner-Bnl1Iat_.js} +1 -1
- package/dist/client/assets/state-Cxz4BVk7.js +2 -0
- package/dist/client/assets/terminal-Brvez29s.js +2 -0
- package/dist/client/assets/{terminal-Dj-VWVHI.js → terminal-CYX_Ixg-.js} +1 -1
- package/dist/client/assets/{triangle-alert-llGGn6BK.js → triangle-alert-Ceg_3GX9.js} +1 -1
- package/dist/client/index.html +11 -11
- package/dist/server.js +718 -784
- package/package.json +1 -1
- package/dist/client/assets/agent-BXm8Dnfe.js +0 -2
- package/dist/client/assets/diff-BDdajfz3.js +0 -2
- package/dist/client/assets/diff-mRZ3PeyD.js +0 -223
- package/dist/client/assets/index-D53pFEJY.js +0 -10
- package/dist/client/assets/index-YmJ_EbaF.css +0 -2
- package/dist/client/assets/portless-BYTEgoik.js +0 -1
- package/dist/client/assets/portless-Cke08ZHX.js +0 -2
- package/dist/client/assets/route-BzHtbTaZ.js +0 -2
- package/dist/client/assets/route-DD4r__Zm.js +0 -45
- package/dist/client/assets/run-CW5YhyWI.js +0 -2
- package/dist/client/assets/state-CvX-YRlC.js +0 -2
- package/dist/client/assets/terminal-DJzGIrES.js +0 -2
|
@@ -1 +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{A as i,D as a,Ps as o,_ as s,c}from"./fallbacks-f8E4aL2c.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=s.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&&a(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 a;t[3]===n?a=t[4]:(a=i(`flex h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,k.jsx)(vt,{"data-slot":`resizable-panel-group`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}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,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({withHandle:a,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let o;t[4]===n?o=t[5]:(o=i(`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]=o);let s;t[6]===a?s=t[7]:(s=a&&(0,k.jsx)(`div`,{className:`bg-border z-10 flex h-6 w-1 shrink-0 rounded-none`}),t[6]=a,t[7]=s);let c;return t[8]!==r||t[9]!==o||t[10]!==s?(c=(0,k.jsx)(Ct,{"data-slot":`resizable-handle`,className:o,...r,children:s}),t[8]=r,t[9]=o,t[10]=s,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};
|
|
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,D as a,Fs as o,_ as s,c}from"./fallbacks-BYPj1x-T.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=s.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&&a(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 a;t[3]===n?a=t[4]:(a=i(`flex h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,k.jsx)(vt,{"data-slot":`resizable-panel-group`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}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,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({withHandle:a,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let o;t[4]===n?o=t[5]:(o=i(`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]=o);let s;t[6]===a?s=t[7]:(s=a&&(0,k.jsx)(`div`,{className:`bg-border z-10 flex h-6 w-1 shrink-0 rounded-none`}),t[6]=a,t[7]=s);let c;return t[8]!==r||t[9]!==o||t[10]!==s?(c=(0,k.jsx)(Ct,{"data-slot":`resizable-handle`,className:o,...r,children:s}),t[8]=r,t[9]=o,t[10]=s,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,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/route-DOc4X-Ya.js","assets/rolldown-runtime-QTnfLwEv.js","assets/compiler-runtime-CLAvuQ-D.js","assets/fallbacks-BYPj1x-T.js","assets/dialog-O3wBc7X2.js","assets/resizable-BlkgaK6V.js","assets/preload-helper-CjdClQve.js","assets/sonner-Bnl1Iat_.js","assets/triangle-alert-Ceg_3GX9.js","assets/state-Cxz4BVk7.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,Cc as i,Dc as a,Ec as o,Ks as s,Ls as c,Nt as l,Oc as u,Qs as d,Rs as f,Sc as p,Tc as m,Us as h,Vs as g,Ys as _,Zs as v,_c as y,ac as b,cc as x,dc as S,ec as C,fc as w,gc as T,hc as E,ic as D,it as O,kc as k,lc as A,mc as ee,nc as te,oc as ne,pc as j,rc as re,sc as ie,tc as ae,uc as oe,vc as se,wc as M,xc as N,yc as ce}from"./fallbacks-BYPj1x-T.js";import{t as le}from"./preload-helper-CjdClQve.js";function ue(e){let t=e;return{get(){return t},set(e){t=N(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]),T=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),E=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),D=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()})),O=w(64);function k(e){let t=O.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()}}),O.set(e,t)),t}let A={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:T,matchRouteDeps:E,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:D,getRouteMatchStore:k,setMatches:ee,setPending:te,setCached:ne};ee(e.matches),a?.(A);function ee(e){F(e,o,_,n,i)}function te(e){F(e,s,v,n,i)}function ne(e){F(e,c,y,n,i)}return A}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)}E(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 xe(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Se(e){let t=[];for(let n of e){if(n===R)continue;let e=xe(n);e&&t.push(e)}return t}function Ce(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=xe(n);if(!e||s&&o&&(c??=Se(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=it.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=xe(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=Se(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{L=!1}}))}function we(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 Te(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ee(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]=Te(r):Array.isArray(t)?t.push(Te(r)):n[e]=[t,Te(r)]}return n}var De=ke(JSON.parse),Oe=Ae(JSON.stringify,JSON.parse);function ke(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Ee(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Ae(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=we(e,r);return t?`?${t}`:``}}var je=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Me=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),z=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),B=(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},Ne=(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},V=(e,t,n)=>{if(!(!_(n)&&!d(n)))throw _(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:_(n)?`redirected`:d(n)?`notFound`:r.status===`pending`?`success`:r.status,context:B(e,t.index),isFetching:!1,error:n})),d(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),_(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Pe=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Fe=(e,t,n)=>{let r=B(e,n);e.updateMatch(t,e=>({...e,context:r}))},H=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,V(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,V(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&&!_(n)&&!d(n)&&(e.serialError??=n)},Ie=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!z(e,t)&&(n.options.loader||n.options.beforeLoad||Ke(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{je(e)},i);r._nonReactive.pendingTimeout=t}},Le=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Ie(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&V(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Re=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=T(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&H(e,n,o),s&&H(e,n,s),Ie(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},f=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),f()});return}i._nonReactive.beforeLoadPromise=T();let p={...B(e,n,!1),...i.__routeContext},{search:m,params:h,cause:g}=i,v=z(e,t),y={search:m,abortController:c,params:h,preload:v,context:p,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?`preload`:g,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},b=r=>{if(r===void 0){e.router.batch(()=>{u(),f()});return}(_(r)||d(r))&&(u(),H(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),f()})},x;try{if(x=r.options.beforeLoad(y),M(x))return u(),x.catch(t=>{H(e,n,t)}).then(b)}catch(t){u(),H(e,n,t)}b(x)},ze=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Re(e,n,t,i),s=()=>{if(Pe(e,n))return;let t=Le(e,n,i);return M(t)?t.then(o):o()};return a()},Be=(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}))},Ve=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=B(e,r),d=z(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}},He=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{U(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Ve(e,t,n,r,i)),l=!!s&&M(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;V(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:B(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:B(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,d(t)&&await i.options.notFoundComponent?.preload?.(),V(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,V(e,e.router.getMatch(n),t)}!_(o)&&!d(o)&&await U(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:B(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),V(e,r,t)}},Ue=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Ve(e,t,i,n,d)):m,{status:g,invalid:v}=l,y=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(v||(h??y)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await He(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){_(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await He(e,t,i,n,d):Fe(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Pe(e,i)){if(!e.router.getMatch(i))return e.matches[n];Fe(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=z(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&V(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=T(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function We(e){let t=e,n=[];Me(t.router)&&je(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=ze(t,e);M(n)&&await n}catch(e){if(_(e))throw e;if(d(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Ne(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(Ue(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(_(e))throw e;d(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=Ne(t,l);e===void 0&&j();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await U(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 U(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Be(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 f=je(t);if(M(f)&&await f,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Ge(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function U(e,t=W){!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===W?(()=>{if(e._componentsPromise===void 0){let t=Ge(e,W);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Ge(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ke(e){for(let t of W)if(e.options[t]?.preload)return!0;return!1}var W=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function qe(e){return{input:({url:t})=>{for(let n of e)t=Ye(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Xe(e[n],t);return t}}}function Je(e){let t=D(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=te([`/`,t,e.pathname]),e)}}function Ye(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 Xe(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}var G=`__TSR_index`,Ze=`popstate`,Qe=`beforeunload`;function $e(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=K(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[G];i=et(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[G];i=et(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[G]!==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 et(e,t){t||={};let n=rt();return{...t,key:n,__TSR_key:n,[G]:e}}function tt(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??(()=>K(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=rt();t.history.replaceState({[G]: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=K(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[G]-l.state[G],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=$e({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(Qe,S,{capture:!0}),t.removeEventListener(Ze,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Qe,S,{capture:!0}),t.addEventListener(Ze,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 nt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function K(e,t){let n=nt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=rt();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||{[G]:0,key:a,__TSR_key:a}}}function rt(){return(Math.random()+1).toString(36).substring(7)}function q(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 it=new WeakMap,at=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=C(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=tt()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=w(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=fe(st(this.latestLocation),e),Ce(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=D(o);t&&t!==`/`&&e.push(Je({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:qe(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=S(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&oe(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:s})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),c=this.options.stringifySearch(i);return{href:e+c+r,publicHref:e+c+r,pathname:y(e).path,external:!1,searchStr:c,search:o(t?.search,i),hash:y(r.slice(1)).path,state:a(t?.state,s)}}let c=new URL(i,this.origin),l=Ye(this.rewrite,c),u=this.options.parseSearch(l.search),d=this.options.stringifySearch(u);return l.search=d,{href:l.href.replace(l.origin,``),publicHref:i,pathname:y(l.pathname).path,external:!!this.rewrite&&l.origin!==this.origin,searchStr:d,search:o(t?.search,u),hash:y(l.hash.slice(1)).path,state:a(t?.state,s)}},r=n(e),{__tempLocation:i,__tempKey:s}=r.state;if(i&&(!s||s===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)=>re({base:e,to:t.includes(`//`)?r(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=>ct({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,s=t.to?`${t.to}`:void 0,c=r.search,l=Object.assign(Object.create(null),r.params),u=s?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),d=s?this.resolvePathWithBase(u,s):u,f=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?l:Object.assign(l,N(t.params,l)),m=this.routesByPath[b(d)],h;if(m)h=this.getRouteBranch(m);else if(d.includes(`$`))h=[];else{let e=this.getMatchedRoutes(d);h=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(h=[...h,this.options.notFoundRoute])}if(h.length&&p(f))for(let e of h){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(f,t(f))}catch{}}let g=e.leaveParams?d:y(ae({path:d,params:f,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,_=c;if(e._includeValidateSearch&&this.options.search?.strict){let e={};h.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Y(t.options.validateSearch,{...e,..._}))}catch{}}),_=e}_=lt({search:_,dest:t,destRoutes:h,_includeValidateSearch:e._includeValidateSearch}),_=o(c,_);let v=this.options.stringifySearch(_),x=t.hash===!0?n.hash:t.hash?N(t.hash,n.hash):void 0,S=x?`#${x}`:``,C=t.state===!0?n.state:t.state?N(t.state,n.state):{};C=a(n.state,C);let w=`${g}${v}${S}`,T,E,D=!1;if(this.rewrite){let e=new URL(w,this.origin),t=Xe(this.rewrite,e);T=e.href.replace(e.origin,``),t.origin===this.origin?E=t.pathname+t.search+t.hash:(E=t.href,D=!0)}else T=ce(w),E=T;return{publicHref:E,href:T,pathname:g,search:_,searchStr:v,state:C,hash:x??``,external:D,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=ie(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,N(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=se(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=b(this.latestLocation.href)===b(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=T(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.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,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}: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=K(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Ye(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,...a})=>{let o=!1;if(n)try{new URL(`${n}`),o=!0}catch{}if(o&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...a});n??=t.publicHref,r??=t.publicHref}let t=!o&&r?r:n;if(i(t,this.protocolAllowlist))return Promise.resolve();if(!a.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 a.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...a,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,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?it.set(this.latestLocation,t):it.delete(this.latestLocation);let n=this.latestLocation,r=q(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await We({router:this,sync:e?.sync,forceStaleReload:a.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){_(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):d(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===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},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(q(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&&i(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=U,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()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await We({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(_(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});d(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=A(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!se(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?se(i.search,r.search,{partial:!0})?a.rawParams:!1:a.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??Oe,parseSearch:e.parseSearch??De,protocolAllowlist:e.protocolAllowlist??ee}),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=ne(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:i}=n,{matchedRoutes:s}=n,c=!1;(r?r.path!==`/`&&i[`**`]:b(e.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:c=!0);let l=c?dt(this.options.notFoundMode,s):void 0,u=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],c=u[n-1],p,m,h;{let n=c?.search??e.search,i=c?._strictSearch??void 0;try{let e=Y(r.options.validateSearch,{...n})??void 0;p={...n,...e},m={...i,...e},h=void 0}catch(e){let r=e;if(e instanceof J||(r=new J(e.message,{cause:e})),t?.throwOnError)throw r;p=n,m={},h=r}}let g=r.options.loaderDeps?.({search:p})??``,v=g?JSON.stringify(g):``,{interpolatedPath:y,usedParams:b}=ae({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),x=r.id+y+v,S=this.getMatch(x),C=f.get(r.id),w=S?._strictParams??b,E;if(!S)try{ft(r,w)}catch(e){if(E=d(e)||_(e)?e:new ot(e.message,{cause:e}),t?.throwOnError)throw E}Object.assign(i,w);let D=C?`stay`:`enter`,O;if(S)O={...S,cause:D,params:C?.params??i,_strictParams:w,search:o(C?C.search:S.search,p),_strictSearch:m};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Ke(r)?`pending`:`success`;O={id:x,ssr:r.options.ssr,index:n,routeId:r.id,params:C?.params??i,_strictParams:w,pathname:y,updatedAt:Date.now(),search:C?o(C.search,p):p,_strictSearch:m,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:E,__routeContext:void 0,_nonReactive:{loadPromise:T()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:D,loaderDeps:C?a(C.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||(O.globalNotFound=l===r.id),O.searchError=h;let k=this.getParentContext(c);O.context={...k,...O.__routeContext,...O.__beforeLoadContext},u[n]=O}for(let t=0;t<u.length;t++){let n=u[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),s=f.get(n.routeId);if(n.params=s?o(s.params,i):i,!a){let i=u[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:u,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return u}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=m(t),i={...e.search};for(let e of t)try{Object.assign(i,Y(e.options.validateSearch,i))}catch{}let a=m(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{ft(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},J=class extends Error{},ot=class extends Error{};function st(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Y(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new J(`Async validation not supported`);if(n.issues)throw new J(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 ct({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=b(e),a,o=x(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function lt({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return ut(n)(e,t,r??!1)}function ut(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=Y(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=N(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 dt(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 v}function ft(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 X=e(n(),1),Z=t();function pt(e){let t=e.errorComponent??Q;return(0,Z.jsx)(mt,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?X.createElement(t,{error:n,reset:r}):e.children})}var mt=class extends X.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 Q({error:e}){let[t,n]=X.useState(!1);return(0,Z.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Z.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Z.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,Z.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Z.jsx)(`div`,{children:(0,Z.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,Z.jsx)(`code`,{children:e.message}):null})}):null]})}function ht(e){let t=k(),n=`not-found-${s(t.stores.location,e=>e.pathname)}-${s(t.stores.status,e=>e)}`;return(0,Z.jsx)(pt,{getResetKey:()=>n,onCatch:(t,n)=>{if(d(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(d(t))return e.fallback?.(t);throw t},children:e.children})}function gt(){return(0,Z.jsx)(`p`,{children:`Not Found`})}function $(e){return(0,Z.jsx)(Z.Fragment,{children:e.children})}function _t(e,t,n){return t.options.notFoundComponent?(0,Z.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Z.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Z.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=X.memo(function({matchId:e}){let t=k(),n=t.stores.matchStores.get(e);n||j();let r=s(t.stores.loadedAt,e=>e),i=s(n,e=>e,vt);return(0,Z.jsx)(xt,{router:t,matchId:e,resetKey:r,matchState:X.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,Z.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,f=r.ssr===!1||r.ssr===`data-only`,p=(!i.isRoot||i.options.wrapInSuspense||f)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||f))?X.Suspense:$,m=s?pt:$,h=l?ht:$;return(0,Z.jsxs)(i.isRoot?i.options.shellComponent??$:$,{children:[(0,Z.jsx)(u.Provider,{value:t,children:(0,Z.jsx)(p,{fallback:o,children:(0,Z.jsx)(m,{getResetKey:()=>n,errorComponent:s||Q,onCatch:(e,t)=>{if(d(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,Z.jsx)(h,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return X.createElement(l,e)},children:f||r._displayPending?(0,Z.jsx)(g,{fallback:o,children:(0,Z.jsx)(Ct,{matchId:t})}):(0,Z.jsx)(Ct,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(St,{}),(e.options.scrollRestoration,null)]}):null]})}function St(){let e=k(),t=X.useRef();return h(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...q(e.stores.location.get(),r??n)}),t.current=n},[s(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var Ct=X.memo(function({matchId:e}){let t=k(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||j();let i=s(r,e=>e),a=i.routeId,o=t.routesById[a],c=X.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),l=X.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,Z.jsx)(e,{},c):(0,Z.jsx)(wt,{})},[c,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=T();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return d(i.error)||j(),_t(t,o,i.error);if(i.status===`redirected`)throw _(i.error)||j(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return l}),wt=X.memo(function(){let e=k(),t=X.useContext(u),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=s(a,e=>[e?.routeId,e?.globalNotFound??!1],yt),i=s(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,Z.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||j(),_t(e,a,void 0);if(!i)return null;let c=(0,Z.jsx)(bt,{matchId:i});return n===`__root__`?(0,Z.jsx)(X.Suspense,{fallback:o,children:c}):c}),Tt=f(`/(home)`)({component:c(()=>le(()=>import(`./route-DOc4X-Ya.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),`component`),validateSearch:l(O({}))});export{pt as a,q as c,$ as i,ue as l,bt as n,Q as o,wt as r,at as s,Tt as t,de as u};
|
|
@@ -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,Ao as a,Br as o,Bs as s,Bt as c,Cs as l,Fo as u,Fs as d,Gs as f,Ha as p,Hr as m,Ir as h,Kr as g,Ks as _,L as v,M as y,Ms as b,N as x,No as S,O as C,Oo as ee,P as te,R as w,Rr as ne,Ur as re,Ut as T,Vt as E,Wa as ie,Wr as ae,Wt as oe,Xa as se,Ya as D,a as O,do as ce,en as le,fo as ue,j as k,jo as de,k as A,kc as fe,lr as pe,mo as me,no as he,r as ge,so as j,vs as _e,yn as ve,z as M,zr as N}from"./fallbacks-BYPj1x-T.js";import{r as ye,t as be}from"./route-DKK79z62.js";import{C as xe,S as Se,a as Ce,c as P,f as we,i as Te,l as Ee,n as De,o as Oe,r as ke,s as Ae,t as je,u as Me}from"./dialog-O3wBc7X2.js";import{n as F}from"./sonner-Bnl1Iat_.js";import{n as Ne,r as Pe,t as Fe}from"./resizable-BlkgaK6V.js";import{A as I,B as Ie,E as Le,F as Re,M as ze,P as Be,T as Ve,V as He,_ as Ue,f as We,g as L,h as R,i as Ge,m as Ke,p as qe,s as Je,w as Ye}from"./state-Cxz4BVk7.js";function Xe(e){let t=fe({warn:e?.router===void 0}),n=e?.router||t;return _(n.stores.__store,f(e,n))}var Ze=d(`badge-check`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Qe=d(`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`}]]),$e=d(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),et=d(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),tt=d(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),nt=d(`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`}]]),rt=d(`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`}]]),it=d(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),at=d(`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`}]]),ot=d(`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`}]]),st=d(`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`}]]),ct=d(`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`}]]),lt=d(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),ut=d(`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`}]]),dt=d(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),ft=d(`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`}]]),pt=d(`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`}]]),mt=d(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ht=d(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),gt=d(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),_t=d(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),vt=d(`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`}]]),z=e(n(),1),B=r(),V=t(),yt=[`codex`,`claude`];function bt(e){return e>=90?`text-destructive`:e>=75?`text-amber-500`:`text-foreground`}function xt(e){let t=(0,B.c)(16),n;if(t[0]!==e.icon||t[1]!==e.window.resetsAt||t[2]!==e.window.utilization){let r=b(a(e.window.resetsAt),ee(le)),i;t[4]===e.icon?i=t[5]:(i=(0,V.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 o;t[6]===e.window.utilization?o=t[7]:(o=bt(e.window.utilization),t[6]=e.window.utilization,t[7]=o);let s;t[8]===e.window.utilization?s=t[9]:(s=Math.round(e.window.utilization),t[8]=e.window.utilization,t[9]=s);let c;t[10]!==o||t[11]!==s?(c=(0,V.jsxs)(`span`,{className:o,children:[s,`%`]}),t[10]=o,t[11]=s,t[12]=c):c=t[12];let l;t[13]!==i||t[14]!==c?(l=(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[i,c]}),t[13]=i,t[14]=c,t[15]=l):l=t[15],n=(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center justify-between gap-1.5 px-2.5`,children:[l,u(r)&&(0,V.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate`,title:`resets ${te(r.value)}`,children:x(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 St(e){let t=(0,B.c)(11),n;t[0]===e.layer?n=t[1]:(n=qe(e.layer),t[0]=e.layer,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={includeFailure:!0},t[2]=r):r=t[2];let i=ze(n,r);if(Ie(i)){let e;t[3]===i.cause?e=t[4]:(e=k(i.cause),t[3]=i.cause,t[4]=e);let n;return t[5]===e?n=t[6]:(n=(0,V.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:e,children:`—`}),t[5]=e,t[6]=n),n}if(!He(i)){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),t[7]=e):e=t[7],e}let a;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(`span`,{className:`text-muted-foreground flex shrink-0 items-center [&_svg]:size-2.5`,children:(0,V.jsx)(Ze,{})}),t[8]=a):a=t[8];let o;return t[9]===i.value?o=t[10]:(o=(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center justify-center gap-1.5 px-2.5`,children:[a,(0,V.jsx)(`span`,{className:`min-w-0 truncate`,children:i.value})]}),t[9]=i.value,t[10]=o),o}function Ct(e){let t=(0,B.c)(14),n=e.compact===!0?`flex min-w-0 flex-1 items-center justify-center gap-1 px-1.5`:`flex min-w-0 flex-1 items-center gap-1.5 px-2.5`,r=e.title,i;t[0]===e.icon?i=t[1]:(i=(0,V.jsx)(`span`,{className:`text-muted-foreground flex shrink-0 items-center [&_svg]:size-2.5`,children:e.icon}),t[0]=e.icon,t[1]=i);let a;t[2]===e.utilization?a=t[3]:(a=bt(e.utilization),t[2]=e.utilization,t[3]=a);let o;t[4]===e.utilization?o=t[5]:(o=Math.round(e.utilization),t[4]=e.utilization,t[5]=o);let s;t[6]!==a||t[7]!==o?(s=(0,V.jsxs)(`span`,{className:a,children:[o,`%`]}),t[6]=a,t[7]=o,t[8]=s):s=t[8];let c;return t[9]!==e.title||t[10]!==n||t[11]!==i||t[12]!==s?(c=(0,V.jsxs)(`span`,{className:n,title:r,children:[i,s]}),t[9]=e.title,t[10]=n,t[11]=i,t[12]=s,t[13]=c):c=t[13],c}function wt(){let e=(0,B.c)(31),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={includeFailure:!0},e[0]=t):t=e[0];let n=ze(Je,t);if(Ie(n)){let t;e[1]===n.cause?t=e[2]:(t=k(n.cause),e[1]=n.cause,e[2]=t);let r;e[3]===n.cause?r=e[4]:(r=k(n.cause),e[3]=n.cause,e[4]=r);let i;return e[5]!==t||e[6]!==r?(i=(0,V.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:t,children:r}),e[5]=t,e[6]=r,e[7]=i):i=e[7],i}if(!He(n)){let t;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),e[8]=t):t=e[8],t}let r;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,V.jsx)(at,{}),e[9]=r):r=e[9];let i;e[10]===n.value.cpu?i=e[11]:(i=Math.round(n.value.cpu),e[10]=n.value.cpu,e[11]=i);let a=`CPU ${i}%`,o;e[12]!==a||e[13]!==n.value.cpu?(o=(0,V.jsx)(Ct,{compact:!0,icon:r,title:a,utilization:n.value.cpu}),e[12]=a,e[13]=n.value.cpu,e[14]=o):o=e[14];let s;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(ut,{}),e[15]=s):s=e[15];let c;e[16]===n.value.memory?c=e[17]:(c=Math.round(n.value.memory),e[16]=n.value.memory,e[17]=c);let l=`System memory ${c}%`,u;e[18]!==l||e[19]!==n.value.memory?(u=(0,V.jsx)(Ct,{compact:!0,icon:s,title:l,utilization:n.value.memory}),e[18]=l,e[19]=n.value.memory,e[20]=u):u=e[20];let d;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,V.jsx)(ht,{}),e[21]=d):d=e[21];let f;e[22]===n.value.nodeHeap?f=e[23]:(f=Math.round(n.value.nodeHeap),e[22]=n.value.nodeHeap,e[23]=f);let p=`Node heap ${f}%`,m;e[24]!==p||e[25]!==n.value.nodeHeap?(m=(0,V.jsx)(Ct,{compact:!0,icon:d,title:p,utilization:n.value.nodeHeap}),e[24]=p,e[25]=n.value.nodeHeap,e[26]=m):m=e[26];let h;return e[27]!==m||e[28]!==o||e[29]!==u?(h=(0,V.jsxs)(V.Fragment,{children:[o,u,m]}),e[27]=m,e[28]=o,e[29]=u,e[30]=h):h=e[30],h}function Tt(e){let t=(0,B.c)(23),n;t[0]===e.layer?n=t[1]:(n=We(e.layer),t[0]=e.layer,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={includeFailure:!0},t[2]=r):r=t[2];let i=ze(n,r);if(Ie(i)){let e;t[3]===i.cause?e=t[4]:(e=k(i.cause),t[3]=i.cause,t[4]=e);let n;t[5]===i.cause?n=t[6]:(n=k(i.cause),t[5]=i.cause,t[6]=n);let r;return t[7]!==e||t[8]!==n?(r=(0,V.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:e,children:n}),t[7]=e,t[8]=n,t[9]=r):r=t[9],r}if(!He(i)){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),t[10]=e):e=t[10],e}let a;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(it,{}),t[11]=a):a=t[11];let o;t[12]===i.value.fiveHour?o=t[13]:(o=(0,V.jsx)(xt,{icon:a,window:i.value.fiveHour}),t[12]=i.value.fiveHour,t[13]=o);let s;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(rt,{}),t[14]=s):s=t[14];let c;t[15]===i.value.weekly?c=t[16]:(c=(0,V.jsx)(xt,{icon:s,window:i.value.weekly}),t[15]=i.value.weekly,t[16]=c);let l;t[17]===e.layer?l=t[18]:(l=(0,V.jsx)(St,{layer:e.layer}),t[17]=e.layer,t[18]=l);let u;return t[19]!==o||t[20]!==c||t[21]!==l?(u=(0,V.jsxs)(V.Fragment,{children:[o,c,l]}),t[19]=o,t[20]=c,t[21]=l,t[22]=u):u=t[22],u}function Et(e){let t=(0,B.c)(7),n;t[0]===e.icon?n=t[1]:(n=_e(e.icon)&&(0,V.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.value?r=t[3]:(r=(0,V.jsx)(`span`,{className:`min-w-0 truncate`,children:e.value}),t[2]=e.value,t[3]=r);let i;return t[4]!==n||t[5]!==r?(i=(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center justify-center gap-1 px-2.5`,children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6],i}function Dt(e){let t=(0,B.c)(29),n;t[0]===e.layer?n=t[1]:(n=We(e.layer),t[0]=e.layer,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={includeFailure:!0},t[2]=r):r=t[2];let i=ze(n,r);if(Ie(i)){let e;t[3]===i.cause?e=t[4]:(e=k(i.cause),t[3]=i.cause,t[4]=e);let n;t[5]===i.cause?n=t[6]:(n=k(i.cause),t[5]=i.cause,t[6]=n);let r;return t[7]!==e||t[8]!==n?(r=(0,V.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:e,children:n}),t[7]=e,t[8]=n,t[9]=r):r=t[9],r}if(!He(i)){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),t[10]=e):e=t[10],e}let a;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(et,{}),t[11]=a):a=t[11];let o;t[12]===i.value.tokens.input?o=t[13]:(o=y(i.value.tokens.input),t[12]=i.value.tokens.input,t[13]=o);let s;t[14]===o?s=t[15]:(s=(0,V.jsx)(Et,{icon:a,value:o}),t[14]=o,t[15]=s);let c;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(tt,{}),t[16]=c):c=t[16];let l;t[17]===i.value.tokens.output?l=t[18]:(l=y(i.value.tokens.output),t[17]=i.value.tokens.output,t[18]=l);let u;t[19]===l?u=t[20]:(u=(0,V.jsx)(Et,{icon:c,value:l}),t[19]=l,t[20]=u);let d;t[21]===i.value.tokens.cached?d=t[22]:(d=y(i.value.tokens.cached),t[21]=i.value.tokens.cached,t[22]=d);let f;t[23]===d?f=t[24]:(f=(0,V.jsx)(Et,{value:d}),t[23]=d,t[24]=f);let p;return t[25]!==s||t[26]!==u||t[27]!==f?(p=(0,V.jsxs)(V.Fragment,{children:[s,u,f]}),t[25]=s,t[26]=u,t[27]=f,t[28]=p):p=t[28],p}function H(){let e=(0,B.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center px-2.5`,children:`…`}),e[0]=t):t=e[0],t}function Ot(){let e=(0,B.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsxs)(`div`,{className:`flex shrink-0 flex-col divide-y border-t font-mono text-[11px]`,children:[(0,V.jsxs)(`div`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,V.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,V.jsx)($e,{className:`text-muted-foreground size-3`})}),(0,V.jsx)(H,{}),(0,V.jsx)(H,{}),(0,V.jsx)(H,{})]}),yt.map(kt)]}),e[0]=t):t=e[0],t}function kt(e){return(0,V.jsxs)(`div`,{className:`flex h-14 min-w-0 items-stretch divide-x`,children:[(0,V.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,V.jsx)(Me,{layer:e})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col divide-y`,children:[(0,V.jsxs)(`span`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,V.jsx)(H,{}),(0,V.jsx)(H,{}),(0,V.jsx)(H,{})]}),(0,V.jsxs)(`span`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,V.jsx)(H,{}),(0,V.jsx)(H,{}),(0,V.jsx)(H,{})]})]})]},e)}function At(){let e=(0,B.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsxs)(`div`,{className:`flex shrink-0 flex-col divide-y border-t font-mono text-[11px]`,children:[(0,V.jsxs)(`div`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,V.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,V.jsx)($e,{className:`text-muted-foreground size-3`})}),(0,V.jsx)(wt,{})]}),yt.map(jt)]}),e[0]=t):t=e[0],t}function jt(e){return(0,V.jsxs)(`div`,{className:`flex h-14 min-w-0 items-stretch divide-x`,children:[(0,V.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,V.jsx)(Me,{layer:e})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col divide-y`,children:[(0,V.jsx)(`span`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:(0,V.jsx)(Tt,{layer:e})}),(0,V.jsx)(`span`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:(0,V.jsx)(Dt,{layer:e})})]})]},e)}var Mt=1,Nt=.9,Pt=.8,Ft=.17,It=.1,Lt=.999,Rt=.9999,zt=.99,Bt=/[\\\/_+.#"@\[\(\{&]/,Vt=/[\\\/_+.#"@\[\(\{&]/g,Ht=/[\s-]/,Ut=/[\s-]/g;function Wt(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Mt:zt;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=Wt(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Mt:Bt.test(e.charAt(l-1))?(d*=Pt,p=e.slice(i,l-1).match(Vt),p&&i>0&&(d*=Lt**+p.length)):Ht.test(e.charAt(l-1))?(d*=Nt,m=e.slice(i,l-1).match(Ut),m&&i>0&&(d*=Lt**+m.length)):(d*=Ft,i>0&&(d*=Lt**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Rt)),(d<It&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Wt(e,t,n,r,l+1,a+2,o),f*It>d&&(d=f*It)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Gt(e){return e.toLowerCase().replace(Ut,` `)}function Kt(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Wt(e,t,Gt(e),Gt(t),0,0,{})}typeof window<`u`&&window.document&&window.document.createElement;function U(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function qt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function W(...e){return t=>{let n=!1,r=e.map(e=>{let r=qt(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():qt(e[t],null)}}}}function G(...e){return z.useCallback(W(...e),e)}function Jt(e,t){let n=z.createContext(t),r=e=>{let{children:t,...r}=e,i=z.useMemo(()=>r,Object.values(r));return(0,V.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=z.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Yt(e,t=[]){let n=[];function r(t,r){let i=z.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=z.useMemo(()=>o,Object.values(o));return(0,V.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=z.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=>z.createContext(e));return function(n){let r=n?.[e]||t;return z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Xt(i,...t)]}function Xt(...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 z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Zt=globalThis?.document?z.useLayoutEffect:()=>{},Qt=z.useId||(()=>void 0),$t=0;function K(e){let[t,n]=z.useState(Qt());return Zt(()=>{e||n(e=>e??String($t++))},[e]),e||(t?`radix-${t}`:``)}var en=z.useInsertionEffect||Zt;function tn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=nn({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=z.useRef(e!==void 0);z.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,z.useCallback(t=>{if(s){let n=rn(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function nn({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return en(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function rn(e){return typeof e==`function`}var an=e(s(),1);function on(e){let t=sn(e),n=z.forwardRef((e,n)=>{let{children:r,...i}=e,a=z.Children.toArray(r),o=a.find(ln);if(o){let e=o.props.children,r=a.map(t=>t===o?z.Children.count(e)>1?z.Children.only(null):z.isValidElement(e)?e.props.children:null:t);return(0,V.jsx)(t,{...i,ref:n,children:z.isValidElement(e)?z.cloneElement(e,void 0,r):null})}return(0,V.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function sn(e){let t=z.forwardRef((e,t)=>{let{children:n,...r}=e;if(z.isValidElement(n)){let e=dn(n),i=un(r,n.props);return n.type!==z.Fragment&&(i.ref=t?W(t,e):e),z.cloneElement(n,i)}return z.Children.count(n)>1?z.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cn=Symbol(`radix.slottable`);function ln(e){return z.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===cn}function un(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 dn(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 q=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=on(`Primitive.${t}`),r=z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,V.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function fn(e,t){e&&an.flushSync(()=>e.dispatchEvent(t))}function pn(e){let t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>(...e)=>t.current?.(...e),[])}function mn(e,t=globalThis?.document){let n=pn(e);z.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 hn=`DismissableLayer`,gn=`dismissableLayer.update`,_n=`dismissableLayer.pointerDownOutside`,vn=`dismissableLayer.focusOutside`,yn,bn=z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xn=z.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=z.useContext(bn),[u,d]=z.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=z.useState({}),m=G(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=wn(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=Tn(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return mn(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),z.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(yn=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),En(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=yn)}},[u,f,n,l]),z.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),En())},[u,l]),z.useEffect(()=>{let e=()=>p({});return document.addEventListener(gn,e),()=>document.removeEventListener(gn,e)},[]),(0,V.jsx)(q.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:U(e.onFocusCapture,S.onFocusCapture),onBlurCapture:U(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,x.onPointerDownCapture)})});xn.displayName=hn;var Sn=`DismissableLayerBranch`,Cn=z.forwardRef((e,t)=>{let n=z.useContext(bn),r=z.useRef(null),i=G(t,r);return z.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,V.jsx)(q.div,{...e,ref:i})});Cn.displayName=Sn;function wn(e,t=globalThis?.document){let n=pn(e),r=z.useRef(!1),i=z.useRef(()=>{});return z.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Dn(_n,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 Tn(e,t=globalThis?.document){let n=pn(e),r=z.useRef(!1);return z.useEffect(()=>{let e=e=>{e.target&&!r.current&&Dn(vn,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 En(){let e=new CustomEvent(gn);document.dispatchEvent(e)}function Dn(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?fn(i,a):i.dispatchEvent(a)}var On=`focusScope.autoFocusOnMount`,kn=`focusScope.autoFocusOnUnmount`,An={bubbles:!1,cancelable:!0},jn=`FocusScope`,Mn=z.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=z.useState(null),l=pn(i),u=pn(a),d=z.useRef(null),f=G(t,e=>c(e)),p=z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;z.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:J(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||J(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&J(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]),z.useEffect(()=>{if(s){zn.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(On,An);s.addEventListener(On,l),s.dispatchEvent(t),t.defaultPrevented||(Nn(Hn(Fn(s)),{select:!0}),document.activeElement===e&&J(s))}return()=>{s.removeEventListener(On,l),setTimeout(()=>{let t=new CustomEvent(kn,An);s.addEventListener(kn,u),s.dispatchEvent(t),t.defaultPrevented||J(e??document.body,{select:!0}),s.removeEventListener(kn,u),zn.remove(p)},0)}}},[s,l,u,p]);let m=z.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]=Pn(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&J(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&J(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,V.jsx)(q.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Mn.displayName=jn;function Nn(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(J(r,{select:t}),document.activeElement!==n)return}function Pn(e){let t=Fn(e);return[In(t,e),In(t.reverse(),e)]}function Fn(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 In(e,t){for(let n of e)if(!Ln(n,{upTo:t}))return n}function Ln(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 Rn(e){return e instanceof HTMLInputElement&&`select`in e}function J(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Rn(e)&&t&&e.select()}}var zn=Bn();function Bn(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Vn(e,t),e.unshift(t)},remove(t){e=Vn(e,t),e[0]?.resume()}}}function Vn(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Hn(e){return e.filter(e=>e.tagName!==`A`)}var Un=`Portal`,Wn=z.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=z.useState(!1);Zt(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?an.createPortal((0,V.jsx)(q.div,{...r,ref:t}),o):null});Wn.displayName=Un;function Gn(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}var Kn=e=>{let{present:t,children:n}=e,r=qn(t),i=typeof n==`function`?n({present:r.isPresent}):z.Children.only(n),a=G(r.ref,Yn(i));return typeof n==`function`||r.isPresent?z.cloneElement(i,{ref:a}):null};Kn.displayName=`Presence`;function qn(e){let[t,n]=z.useState(),r=z.useRef(null),i=z.useRef(e),a=z.useRef(`none`),[o,s]=Gn(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return z.useEffect(()=>{let e=Jn(r.current);a.current=o===`mounted`?e:`none`},[o]),Zt(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Jn(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Zt(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Jn(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=Jn(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:z.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Jn(e){return e?.animationName||`none`}function Yn(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 Xn=0;function Zn(){z.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Qn()),document.body.insertAdjacentElement(`beforeend`,e[1]??Qn()),Xn++,()=>{Xn===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Xn--}},[])}function Qn(){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 Y=function(){return Y=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},Y.apply(this,arguments)};function $n(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 er(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 tr=`right-scroll-bar-position`,nr=`width-before-scroll-bar`,rr=`with-scroll-bars-hidden`,ir=`--removed-body-scroll-bar-size`;function ar(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function or(e,t){var n=(0,z.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 sr=typeof window<`u`?z.useLayoutEffect:z.useEffect,cr=new WeakMap;function lr(e,t){var n=or(t||null,function(t){return e.forEach(function(e){return ar(e,t)})});return sr(function(){var t=cr.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||ar(e,null)}),i.forEach(function(e){r.has(e)||ar(e,a)})}cr.set(n,e)},[e]),n}function ur(e){return e}function dr(e,t){t===void 0&&(t=ur);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 fr(e){e===void 0&&(e={});var t=dr(null);return t.options=Y({async:!0,ssr:!1},e),t}var pr=function(e){var t=e.sideCar,n=$n(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 z.createElement(r,Y({},n))};pr.isSideCarExport=!0;function mr(e,t){return e.useMedium(t),pr}var hr=fr(),gr=function(){},_r=z.forwardRef(function(e,t){var n=z.useRef(null),r=z.useState({onScrollCapture:gr,onWheelCapture:gr,onTouchMoveCapture:gr}),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=$n(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=lr([n,t]),C=Y(Y({},b),i);return z.createElement(z.Fragment,null,u&&z.createElement(x,{sideCar:hr,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?z.cloneElement(z.Children.only(s),Y(Y({},C),{ref:S})):z.createElement(v,Y({},C,{className:c,ref:S}),s))});_r.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_r.classNames={fullWidth:nr,zeroRight:tr};var vr,yr=function(){if(vr)return vr;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function br(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=yr();return t&&e.setAttribute(`nonce`,t),e}function xr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Sr(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Cr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=br())&&(xr(t,n),Sr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},wr=function(){var e=Cr();return function(t,n){z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Tr=function(){var e=wr();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Er={left:0,top:0,right:0,gap:0},Dr=function(e){return parseInt(e||``,10)||0},Or=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[Dr(n),Dr(r),Dr(i)]},kr=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Er;var t=Or(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])}},Ar=Tr(),jr=`data-scroll-locked`,Mr=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
|
+
.${rr} {
|
|
3
|
+
overflow: hidden ${r};
|
|
4
|
+
padding-right: ${s}px ${r};
|
|
5
|
+
}
|
|
6
|
+
body[${jr}] {
|
|
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
|
+
.${tr} {
|
|
20
|
+
right: ${s}px ${r};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${nr} {
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.${tr} .${tr} {
|
|
28
|
+
right: 0 ${r};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${nr} .${nr} {
|
|
32
|
+
margin-right: 0 ${r};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[${jr}] {
|
|
36
|
+
${ir}: ${s}px;
|
|
37
|
+
}
|
|
38
|
+
`},Nr=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Pr=function(){z.useEffect(function(){return document.body.setAttribute(jr,(Nr()+1).toString()),function(){var e=Nr()-1;e<=0?document.body.removeAttribute(jr):document.body.setAttribute(jr,e.toString())}},[])},Fr=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Pr();var a=z.useMemo(function(){return kr(i)},[i]);return z.createElement(Ar,{styles:Mr(a,!t,i,n?``:`!important`)})},Ir=!1;if(typeof window<`u`)try{var Lr=Object.defineProperty({},"passive",{get:function(){return Ir=!0,!0}});window.addEventListener(`test`,Lr,Lr),window.removeEventListener(`test`,Lr,Lr)}catch{Ir=!1}var Rr=Ir?{passive:!1}:!1,zr=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&&!zr(e)&&n[t]===`visible`)},Vr=function(e){return Br(e,`overflowY`)},Hr=function(e){return Br(e,`overflowX`)},Ur=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Kr(e,r)){var i=qr(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]},Gr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Kr=function(e,t){return e===`v`?Vr(t):Hr(t)},qr=function(e,t){return e===`v`?Wr(t):Gr(t)},Jr=function(e,t){return e===`h`&&t===`rtl`?-1:1},Yr=function(e,t,n,r,i){var a=Jr(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=qr(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Kr(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},Xr=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Zr=function(e){return[e.deltaX,e.deltaY]},Qr=function(e){return e&&`current`in e?e.current:e},$r=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ei=function(e){return`
|
|
39
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
+
`},ti=0,ni=[];function ri(e){var t=z.useRef([]),n=z.useRef([0,0]),r=z.useRef(),i=z.useState(ti++)[0],a=z.useState(Tr)[0],o=z.useRef(e);z.useEffect(function(){o.current=e},[e]),z.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=er([e.lockRef.current],(e.shards||[]).map(Qr),!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=z.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Xr(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=Ur(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ur(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 Yr(h,t,e,h===`h`?s:c,!0)},[]),c=z.useCallback(function(e){var n=e;if(!(!ni.length||ni[ni.length-1]!==a)){var r=`deltaY`in n?Zr(n):Xr(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&$r(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Qr).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=z.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ii(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=z.useCallback(function(e){n.current=Xr(e),r.current=void 0},[]),d=z.useCallback(function(t){l(t.type,Zr(t),t.target,s(t,e.lockRef.current))},[]),f=z.useCallback(function(t){l(t.type,Xr(t),t.target,s(t,e.lockRef.current))},[]);z.useEffect(function(){return ni.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Rr),document.addEventListener(`touchmove`,c,Rr),document.addEventListener(`touchstart`,u,Rr),function(){ni=ni.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Rr),document.removeEventListener(`touchmove`,c,Rr),document.removeEventListener(`touchstart`,u,Rr)}},[]);var p=e.removeScrollBar,m=e.inert;return z.createElement(z.Fragment,null,m?z.createElement(a,{styles:ei(i)}):null,p?z.createElement(Fr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ii(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ai=mr(hr,ri),oi=z.forwardRef(function(e,t){return z.createElement(_r,Y({},e,{ref:t,sideCar:ai}))});oi.classNames=_r.classNames;var si=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},ci=new WeakMap,li=new WeakMap,ui={},di=0,fi=function(e){return e&&(e.host||fi(e.parentNode))},pi=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=fi(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})},mi=function(e,t,n,r){var i=pi(t,Array.isArray(e)?e:[e]);ui[n]||(ui[n]=new WeakMap);var a=ui[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=(ci.get(e)||0)+1,l=(a.get(e)||0)+1;ci.set(e,c),a.set(e,l),o.push(e),c===1&&i&&li.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(),di++,function(){o.forEach(function(e){var t=ci.get(e)-1,i=a.get(e)-1;ci.set(e,t),a.set(e,i),t||(li.has(e)||e.removeAttribute(r),li.delete(e)),i||e.removeAttribute(n)}),di--,di||(ci=new WeakMap,ci=new WeakMap,li=new WeakMap,ui={})}},hi=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||si(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),mi(r,i,n,`aria-hidden`)):function(){return null}},gi=`Dialog`,[_i,vi]=Yt(gi),[yi,X]=_i(gi),bi=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=z.useRef(null),c=z.useRef(null),[l,u]=tn({prop:r,defaultProp:i??!1,onChange:a,caller:gi});return(0,V.jsx)(yi,{scope:t,triggerRef:s,contentRef:c,contentId:K(),titleId:K(),descriptionId:K(),open:l,onOpenChange:u,onOpenToggle:z.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};bi.displayName=gi;var xi=`DialogTrigger`,Si=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(xi,n),a=G(t,i.triggerRef);return(0,V.jsx)(q.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Vi(i.open),...r,ref:a,onClick:U(e.onClick,i.onOpenToggle)})});Si.displayName=xi;var Ci=`DialogPortal`,[wi,Ti]=_i(Ci,{forceMount:void 0}),Ei=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=X(Ci,t);return(0,V.jsx)(wi,{scope:t,forceMount:n,children:z.Children.map(r,e=>(0,V.jsx)(Kn,{present:n||a.open,children:(0,V.jsx)(Wn,{asChild:!0,container:i,children:e})}))})};Ei.displayName=Ci;var Di=`DialogOverlay`,Oi=z.forwardRef((e,t)=>{let n=Ti(Di,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=X(Di,e.__scopeDialog);return a.modal?(0,V.jsx)(Kn,{present:r||a.open,children:(0,V.jsx)(Ai,{...i,ref:t})}):null});Oi.displayName=Di;var ki=on(`DialogOverlay.RemoveScroll`),Ai=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(Di,n);return(0,V.jsx)(oi,{as:ki,allowPinchZoom:!0,shards:[i.contentRef],children:(0,V.jsx)(q.div,{"data-state":Vi(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Z=`DialogContent`,ji=z.forwardRef((e,t)=>{let n=Ti(Z,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=X(Z,e.__scopeDialog);return(0,V.jsx)(Kn,{present:r||a.open,children:a.modal?(0,V.jsx)(Mi,{...i,ref:t}):(0,V.jsx)(Ni,{...i,ref:t})})});ji.displayName=Z;var Mi=z.forwardRef((e,t)=>{let n=X(Z,e.__scopeDialog),r=z.useRef(null),i=G(t,n.contentRef,r);return z.useEffect(()=>{let e=r.current;if(e)return hi(e)},[]),(0,V.jsx)(Pi,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault())})}),Ni=z.forwardRef((e,t)=>{let n=X(Z,e.__scopeDialog),r=z.useRef(!1),i=z.useRef(!1);return(0,V.jsx)(Pi,{...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()}})}),Pi=z.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=X(Z,n),c=z.useRef(null),l=G(t,c);return Zn(),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Mn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,V.jsx)(xn,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Vi(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Gi,{titleId:s.titleId}),(0,V.jsx)(qi,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Fi=`DialogTitle`,Ii=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(Fi,n);return(0,V.jsx)(q.h2,{id:i.titleId,...r,ref:t})});Ii.displayName=Fi;var Li=`DialogDescription`,Ri=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(Li,n);return(0,V.jsx)(q.p,{id:i.descriptionId,...r,ref:t})});Ri.displayName=Li;var zi=`DialogClose`,Bi=z.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(zi,n);return(0,V.jsx)(q.button,{type:`button`,...r,ref:t,onClick:U(e.onClick,()=>i.onOpenChange(!1))})});Bi.displayName=zi;function Vi(e){return e?`open`:`closed`}var Hi=`DialogTitleWarning`,[Ui,Wi]=Jt(Hi,{contentName:Z,titleName:Fi,docsSlug:`dialog`}),Gi=({titleId:e})=>{let t=Wi(Hi),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 z.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ki=`DialogDescriptionWarning`,qi=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Wi(Ki).contentName}}.`;return z.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Ji=bi,Yi=Ei,Xi=Oi,Zi=ji,Qi=Symbol.for(`react.lazy`),$i=z.use;function ea(e){return typeof e==`object`&&!!e&&`then`in e}function ta(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Qi&&`_payload`in e&&ea(e._payload)}function na(e){let t=ra(e),n=z.forwardRef((e,n)=>{let{children:r,...i}=e;ta(r)&&typeof $i==`function`&&(r=$i(r._payload));let a=z.Children.toArray(r),o=a.find(aa);if(o){let e=o.props.children,r=a.map(t=>t===o?z.Children.count(e)>1?z.Children.only(null):z.isValidElement(e)?e.props.children:null:t);return(0,V.jsx)(t,{...i,ref:n,children:z.isValidElement(e)?z.cloneElement(e,void 0,r):null})}return(0,V.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function ra(e){let t=z.forwardRef((e,t)=>{let{children:n,...r}=e;if(ta(n)&&typeof $i==`function`&&(n=$i(n._payload)),z.isValidElement(n)){let e=sa(n),i=oa(r,n.props);return n.type!==z.Fragment&&(i.ref=t?W(t,e):e),z.cloneElement(n,i)}return z.Children.count(n)>1?z.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ia=Symbol(`radix.slottable`);function aa(e){return z.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ia}function oa(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 sa(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 Q=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=na(`Primitive.${t}`),r=z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,V.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ca=`[cmdk-group=""]`,la=`[cmdk-group-items=""]`,ua=`[cmdk-group-heading=""]`,da=`[cmdk-item=""]`,fa=`${da}:not([aria-disabled="true"])`,pa=`cmdk-item-select`,ma=`data-value`,ha=(e,t,n)=>Kt(e,t,n),ga=z.createContext(void 0),_a=()=>z.useContext(ga),va=z.createContext(void 0),ya=()=>z.useContext(va),ba=z.createContext(void 0),xa=z.forwardRef((e,t)=>{let n=Fa(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Fa(()=>new Set),i=Fa(()=>new Map),a=Fa(()=>new Map),o=Fa(()=>new Set),s=Na(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=K(),y=K(),b=K(),x=z.useRef(null),S=La();Pa(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),Pa(()=>{S(6,T)},[]);let C=z.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`)re(),w(),S(1,ne);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=E()?.id,C.emit()}),r||S(5,T),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())}}),[]),ee=z.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,te(t,r)),S(2,()=>{w(),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,()=>{re(),w(),n.current.value||ne(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=E();S(4,()=>{re(),t?.getAttribute(`id`)===e&&ne(),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 te(e,t){let r=s.current?.filter??ha;return e?r(e,n.current.search,t):0}function w(){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;ie().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(la);t?t.appendChild(e.parentElement===t?e:e.closest(`${la} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${la} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${ca}[${ma}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function ne(){let e=ie().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(ma);C.setState(`value`,e||void 0)}function re(){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=te(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 T(){var e;let t=E();t&&(t.parentElement?.firstChild===t&&((e=t.closest(ca)?.querySelector(ua))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function E(){return x.current?.querySelector(`${da}[aria-selected="true"]`)}function ie(){return Array.from(x.current?.querySelectorAll(fa)||[])}function ae(e){let t=ie()[e];t&&C.setState(`value`,t.getAttribute(ma))}function oe(e){var t;let n=E(),r=ie(),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(ma))}function se(e){let t=E()?.closest(ca),n;for(;t&&!n;)t=e>0?ja(t,ca):Ma(t,ca),n=t?.querySelector(fa);n?C.setState(`value`,n.getAttribute(ma)):oe(e)}let D=()=>ae(ie().length-1),O=e=>{e.preventDefault(),e.metaKey?D():e.altKey?se(1):oe(1)},ce=e=>{e.preventDefault(),e.metaKey?ae(0):e.altKey?se(-1):oe(-1)};return z.createElement(Q.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&&O(e);break;case`ArrowDown`:O(e);break;case`p`:case`k`:g&&e.ctrlKey&&ce(e);break;case`ArrowUp`:ce(e);break;case`Home`:e.preventDefault(),ae(0);break;case`End`:e.preventDefault(),D();break;case`Enter`:{e.preventDefault();let t=E();if(t){let e=new Event(pa);t.dispatchEvent(e)}}}}},z.createElement(`label`,{"cmdk-label":``,htmlFor:ee.inputId,id:ee.labelId,style:Ba},c),za(e,e=>z.createElement(va.Provider,{value:C},z.createElement(ga.Provider,{value:ee},e))))}),Sa=z.forwardRef((e,t)=>{let n=K(),r=z.useRef(null),i=z.useContext(ba),a=_a(),o=Na(e),s=o.current?.forceMount??i?.forceMount;Pa(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Ia(n,r,[e.value,e.children,r],e.keywords),l=ya(),u=$(e=>e.value&&e.value===c.current),d=$(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);z.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(pa,f),()=>t.removeEventListener(pa,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 z.createElement(Q.div,{ref:W(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)}),Ca=z.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=K(),s=z.useRef(null),c=z.useRef(null),l=K(),u=_a(),d=$(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Pa(()=>u.group(o),[]),Ia(o,s,[e.value,e.heading,c]);let f=z.useMemo(()=>({id:o,forceMount:i}),[i]);return z.createElement(Q.div,{ref:W(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&z.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),za(e,e=>z.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},z.createElement(ba.Provider,{value:f},e))))}),wa=z.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=z.useRef(null),a=$(e=>!e.search);return!n&&!a?null:z.createElement(Q.div,{ref:W(i,t),...r,"cmdk-separator":``,role:`separator`})}),Ta=z.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=ya(),o=$(e=>e.search),s=$(e=>e.selectedItemId),c=_a();return z.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),z.createElement(Q.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)}})}),Ea=z.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=z.useRef(null),o=z.useRef(null),s=$(e=>e.selectedItemId),c=_a();return z.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)}}},[]),z.createElement(Q.div,{ref:W(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},za(e,e=>z.createElement(`div`,{ref:W(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Da=z.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return z.createElement(Ji,{open:n,onOpenChange:r},z.createElement(Yi,{container:o},z.createElement(Xi,{"cmdk-overlay":``,className:i}),z.createElement(Zi,{"aria-label":e.label,"cmdk-dialog":``,className:a},z.createElement(xa,{ref:t,...s}))))}),Oa=z.forwardRef((e,t)=>$(e=>e.filtered.count===0)?z.createElement(Q.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),ka=z.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return z.createElement(Q.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},za(e,e=>z.createElement(`div`,{"aria-hidden":!0},e)))}),Aa=Object.assign(xa,{List:Ea,Item:Sa,Input:Ta,Group:Ca,Separator:wa,Dialog:Da,Empty:Oa,Loading:ka});function ja(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ma(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Na(e){let t=z.useRef(e);return Pa(()=>{t.current=e}),t}var Pa=typeof window>`u`?z.useEffect:z.useLayoutEffect;function Fa(e){let t=z.useRef();return t.current===void 0&&(t.current=e()),t}function $(e){let t=ya(),n=()=>e(t.snapshot());return z.useSyncExternalStore(t.subscribe,n,n)}function Ia(e,t,n,r=[]){let i=z.useRef(),a=_a();return Pa(()=>{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(ma,s),i.current=s}),i}var La=()=>{let[e,t]=z.useState(),n=Fa(()=>new Map);return Pa(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Ra(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function za({asChild:e,children:t},n){return e&&z.isValidElement(t)?z.cloneElement(Ra(t),{ref:t.ref},n(t.props.children)):n(t)}var Ba={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Va(e){let t=(0,B.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 a;t[3]===n?a=t[4]:(a=i(`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]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,V.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}var Ha=C(`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 Ua(e){let t=(0,B.c)(11),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({className:n,align:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let o=a===void 0?`inline-start`:a,s;t[4]!==o||t[5]!==n?(s=i(Ha({align:o}),n),t[4]=o,t[5]=n,t[6]=s):s=t[6];let c;return t[7]!==o||t[8]!==r||t[9]!==s?(c=(0,V.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":o,className:s,onClick:Wa,...r}),t[7]=o,t[8]=r,t[9]=s,t[10]=c):c=t[10],c}function Wa(e){e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()}C(`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 Ga(e){let t=(0,B.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 a;t[3]===n?a=t[4]:(a=i(`bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-none`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,V.jsx)(Aa,{"data-slot":`command`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ka(e){let t=(0,B.c)(24),n,r,a,o,s,c;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],c=t[6]):({title:o,description:s,children:n,className:r,showCloseButton:c,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=c);let l=o===void 0?`Command Palette`:o,u=s===void 0?`Search for a command to run...`:s,d=c===void 0?!1:c,f;t[7]===r?f=t[8]:(f=i(`top-1/3 translate-y-0 overflow-hidden rounded-none p-0`,r),t[7]=r,t[8]=f);let p;t[9]===l?p=t[10]:(p=(0,V.jsx)(Oe,{children:l}),t[9]=l,t[10]=p);let m;t[11]===u?m=t[12]:(m=(0,V.jsx)(ke,{children:u}),t[11]=u,t[12]=m);let h;t[13]!==p||t[14]!==m?(h=(0,V.jsxs)(Ce,{className:`sr-only`,children:[p,m]}),t[13]=p,t[14]=m,t[15]=h):h=t[15];let g;t[16]!==n||t[17]!==d||t[18]!==f||t[19]!==h?(g=(0,V.jsxs)(De,{className:f,showCloseButton:d,children:[h,n]}),t[16]=n,t[17]=d,t[18]=f,t[19]=h,t[20]=g):g=t[20];let _;return t[21]!==a||t[22]!==g?(_=(0,V.jsx)(je,{...a,children:g}),t[21]=a,t[22]=g,t[23]=_):_=t[23],_}function qa(e){let t=(0,B.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 a;t[3]===n?a=t[4]:(a=i(`w-full font-normal outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,n),t[3]=n,t[4]=a);let o;t[5]!==r||t[6]!==a?(o=(0,V.jsx)(Aa.Input,{"data-slot":`command-input`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7];let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(Ua,{children:(0,V.jsx)(mt,{className:`size-3 shrink-0 opacity-50`})}),t[8]=s):s=t[8];let c;return t[9]===o?c=t[10]:(c=(0,V.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`border-b pb-0`,children:(0,V.jsxs)(Va,{className:`border-input/30 bg-input/30 h-8 border-none shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[o,s]})}),t[9]=o,t[10]=c),c}function Ja(e){let t=(0,B.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 a;t[3]===n?a=t[4]:(a=i(`no-scrollbar max-h-72 scroll-py-0 overflow-x-hidden overflow-y-auto outline-none`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,V.jsx)(Aa.List,{"data-slot":`command-list`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ya(e){let t=(0,B.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 a;t[3]===n?a=t[4]:(a=i(`py-6 text-center font-normal`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,V.jsx)(Aa.Empty,{"data-slot":`command-empty`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Xa(e){let t=(0,B.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 a;t[3]===n?a=t[4]:(a=i(`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]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,V.jsx)(Aa.Group,{"data-slot":`command-group`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Za(e){let t=(0,B.c)(11),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({className:r,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let o;t[4]===r?o=t[5]:(o=i(`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]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(Se,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`}),t[6]=s):s=t[6];let c;return t[7]!==n||t[8]!==a||t[9]!==o?(c=(0,V.jsxs)(Aa.Item,{"data-slot":`command-item`,className:o,...a,children:[n,s]}),t[7]=n,t[8]=a,t[9]=o,t[10]=c):c=t[10],c}function Qa(e){let t=(0,B.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 a;t[3]===n?a=t[4]:(a=i(`text-muted-foreground group-data-selected/command-item:text-foreground ml-auto font-normal tracking-widest`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,V.jsx)(`span`,{"data-slot":`command-shortcut`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}var $a=Be(e=>Re(R.runtime.atom(ve(R,t=>N(e)?t(`projects.branches`,{cwd:e}):pe(Ue.make({branches:[],defaultBranch:`main`}))),{initialValue:Ue.make({branches:[],defaultBranch:`main`})})));function eo(){let e=(0,B.c)(24),t=be.useNavigate(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={select:to},e[0]=n):n=e[0];let r=Xe(n),i;e[1]===r.activeWorktreeId?i=e[2]:(i=Ge(r.activeWorktreeId),e[1]=r.activeWorktreeId,e[2]=i);let a=ze(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,z.startTransition)(()=>{t({params:{worktree:Ke(e)},to:`/$worktree/diff`})})},s=e=>{(0,z.startTransition)(()=>{t({params:{worktree:Ke(e)},to:`/$worktree/terminal`})})},c=(e,n)=>{(0,z.startTransition)(()=>{t({params:{worktree:Ke(e)},search:{origin:n},to:`/$worktree/portless`})})},l=(e,n)=>{(0,z.startTransition)(()=>{t({params:{worktree:Ke(e)},search:{agentId:n},to:`/$worktree/agent`})})},u=(e,n,r)=>{(0,z.startTransition)(()=>{t({params:{worktree:Ke(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,V.jsx)(Ne,{defaultSize:`26%`,minSize:`20%`,maxSize:`38%`,children:(0,V.jsx)(Eo,{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,V.jsx)(Fe,{}),e[20]=f):f=e[20];let p;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,V.jsx)(Ne,{defaultSize:`86%`,minSize:`60%`,children:(0,V.jsx)(`div`,{className:`flex h-full min-h-0 flex-col`,children:(0,V.jsx)(ye,{})})}),e[21]=p):p=e[21];let m;return e[22]===d?m=e[23]:(m=(0,V.jsx)(`div`,{className:`bg-background h-full min-h-0 flex-1 overflow-hidden`,children:(0,V.jsxs)(Pe,{orientation:`horizontal`,className:`h-full min-h-0 overflow-hidden`,children:[d,f,p]})}),e[22]=d,e[23]=m),m}function to(e){return{activeView:b(w(e.location.pathname),M(h(`/terminal`),oo),M(h(`/portless`),ao),M(h(`/run`),io),M(h(`/agent`),ro),v(no)),activeWorktreeId:re(`/`)(e.location.pathname)[1]??``}}function no(){return`diff`}function ro(){return`agent`}function io(){return`run`}function ao(){return`portless`}function oo(){return`terminal`}function so(){let e=(0,B.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(z.Suspense,{fallback:(0,V.jsx)(Ot,{}),children:(0,V.jsx)(At,{})}),e[0]=t):t=e[0],t}function co(e){return b(re(`/`)(e),ce,se(e=>N(e)&&e!==`.`),de(()=>e))}function lo(e){let t=ae(`/home/`)(e)?b(re(`/`)(e),me(3),he(`/`)):void 0;return _e(t)&&ae(`${t}/`)(e)?`~/${m(o(t)+1)(e)}`:co(e)}function uo(e){let t=(0,B.c)(4);if(e.root){let n=e.dirty?`text-amber-500`:`text-current`,r;return t[0]===n?r=t[1]:(r=(0,V.jsx)(dt,{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,V.jsx)(gt,{className:n}),t[2]=n,t[3]=r),r}function fo(e,t){return{cwd:e,sessionId:t.sessionId}}function po(e){return{cwd:e.script.cwd,sessionId:e.script.sessionId}}function mo(e){return N(g(e))&&!/\s/u.test(e)}function ho(e){return[...e].toSorted((e,t)=>e.taskId.localeCompare(t.taskId))}function go(e){return[...e].toSorted((e,t)=>e.script.taskId.localeCompare(t.script.taskId))}function _o(e){let t=(0,B.c)(10),n=(0,z.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=ho(e.scripts);if(a.length===0){i=null;break bb0}let o;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsx)(xe,{}),t[7]=o):o=t[7];let s;t[8]===n?s=t[9]:(s=(0,V.jsx)(P,{icon:o,selected:!1,onClick:()=>{n[1](vo)},children:`scripts`}),t[8]=n,t[9]=s),r=(0,V.jsxs)(`li`,{className:`w-full min-w-0`,children:[s,n[0]&&(0,V.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:a.map(t=>(0,V.jsx)(z.Suspense,{fallback:(0,V.jsx)(ge,{}),children:(0,V.jsx)(yo,{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 vo(e){return!e}function yo(e){let t=fo(e.cwd,e.run),n=I(R.mutation(`terminal.restart`),{mode:`promise`}),r=I(R.mutation(`terminal.stop`),{mode:`promise`}),i=(0,z.useState)(!1);async function a(){if(!i[0]){i[1](!0);try{await(L(e.status.state)&&e.status.state!==`idle`?r({payload:t}):n({payload:t}))}catch(e){F.error(k(e))}finally{i[1](!1)}}}return(0,V.jsx)(`li`,{className:`w-full min-w-0`,children:(0,V.jsx)(P,{actions:(0,V.jsx)(`span`,{className:`flex h-full items-center justify-end`,children:(0,V.jsx)(O,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:i[0],onClick:e=>{e.stopPropagation(),a()},title:L(e.status.state)&&e.status.state!==`idle`?`Stop ${e.run.taskId}`:`Start ${e.run.taskId}`,children:b(w({active:L(e.status.state)&&e.status.state!==`idle`,pending:i[0]}),M({pending:!0},()=>(0,V.jsx)(A,{className:`size-2.5 border opacity-60`})),M({active:!0},()=>(0,V.jsx)(gt,{className:`size-3`})),v(()=>(0,V.jsx)(ft,{className:`size-3`})))})}),icon:(0,V.jsx)(we,{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 bo(e){let t=(0,B.c)(8),n;t[0]===e.runs?n=t[1]:(n=go(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,V.jsx)(xo,{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 xo(e){let t=(0,z.useState)(!0),n=I(R.mutation(`terminal.restart`),{mode:`promise`}),r=I(R.mutation(`terminal.stop`),{mode:`promise`}),i=(0,z.useState)(!1);async function a(){if(!i[0]){i[1](!0);try{for(let t of e.runs){let i=po(t);ue(e.runs,t=>L(e.runStatuses[t.script.sessionId]?.state??`idle`)&&e.runStatuses[t.script.sessionId]?.state!==`idle`)?await r({payload:i}):await n({payload:i})}}catch(e){F.error(k(e))}finally{i[1](!1)}}}return(0,V.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,V.jsx)(P,{actions:(0,V.jsx)(O,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:i[0],onClick:e=>{e.stopPropagation(),a()},title:ue(e.runs,t=>L(e.runStatuses[t.script.sessionId]?.state??`idle`)&&e.runStatuses[t.script.sessionId]?.state!==`idle`)?`Stop deslop`:`Start deslop`,children:b(w({active:ue(e.runs,t=>L(e.runStatuses[t.script.sessionId]?.state??`idle`)&&e.runStatuses[t.script.sessionId]?.state!==`idle`),pending:i[0]}),M({pending:!0},()=>(0,V.jsx)(A,{className:`size-2.5 border opacity-60`})),M({active:!0},()=>(0,V.jsx)(gt,{className:`size-3`})),v(()=>(0,V.jsx)(ft,{className:`size-3`})))}),icon:(0,V.jsx)(ct,{}),selected:!1,onClick:()=>{t[1](e=>!e)},children:`deslop`}),t[0]&&(0,V.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:j(e.runs,t=>(0,V.jsx)(z.Suspense,{fallback:(0,V.jsx)(ge,{}),children:(0,V.jsx)(So,{run:t,status:e.runStatuses[t.script.sessionId]??{state:`idle`,title:``},selectPortless:e.selectPortless,selectRun:e.selectRun})},t.script.sessionId))})]})}function So(e){let t=(0,B.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,V.jsx)(ct,{className:`size-3`}),t[2]=i):i=t[2];let a;t[3]!==n||t[4]!==r?(a=(0,V.jsx)(O,{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,V.jsx)(we,{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,V.jsx)(`li`,{className:`w-full min-w-0`,children:(0,V.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 Co(e){let t=(0,B.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,V.jsx)(A,{className:`size-2.5 border opacity-60`}):(0,V.jsx)(gt,{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,V.jsx)(O,{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,V.jsx)(we,{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,V.jsx)(`li`,{className:`w-full min-w-0`,children:(0,V.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 wo(e){let t=I(R.mutation(`agents.create`),{mode:`promise`}),n=I(R.mutation(`agents.remove`),{mode:`promise`}),r=(0,z.useState)(()=>E()),i=(0,z.useState)(()=>E());async function a(n){if(!T(r[0],n.id)){r[1](e=>c(e,n.id));try{let r=await t({payload:{cwd:e.cwd,provider:n.id}});e.selectAgent(e.cwd,r.uuid)}catch(e){F.error(k(e))}finally{r[1](e=>oe(e,n.id))}}}async function o(t){if(!T(i[0],t.uuid)){i[1](e=>c(e,t.uuid));try{await n({payload:{cwd:e.cwd,uuid:t.uuid}})}catch(e){F.error(k(e))}finally{i[1](e=>oe(e,t.uuid))}}}return(0,V.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,V.jsx)(P,{icon:(0,V.jsx)(nt,{}),selected:!1,children:`agents`}),(0,V.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:j(e.profiles,t=>{let n=b(e.sessions,D(e=>e.profileId===t.id));return(0,V.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,V.jsx)(P,{actions:(0,V.jsx)(O,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:T(r[0],t.id),onClick:e=>{e.stopPropagation(),a(t)},title:`Start ${t.label}`,children:T(r[0],t.id)?(0,V.jsx)(A,{className:`size-2.5 border opacity-60`}):(0,V.jsx)(ft,{className:`size-3`})}),icon:(0,V.jsx)(Me,{layer:t.icon}),selected:!1,children:t.label}),n.length>0&&(0,V.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:j(n,t=>(0,V.jsx)(Co,{session:t,onSelect:()=>{e.selectAgent(e.cwd,t.uuid)},onStop:()=>{o(t)},stopping:T(i[0],t.uuid)},t.uuid))})]},t.id)})})]})}function To(e){return b(e.agents,ue(e=>L(e.state.state)&&e.state.state!==`idle`))}function Eo(e){let t=I(R.mutation(`projects.maintenance`),{mode:`promise`}),n=I(R.mutation(`projects.createWorktree`),{mode:`promise`}),r=I(R.mutation(`projects.deleteWorktree`),{mode:`promise`}),[i,a]=(0,z.useState)(()=>({actionsOpen:!1,branch:``,createWorktreeProjectRoot:e.activeProject?.repository.root,creatingBranch:``,deleteDialogOpen:!1,deletingWorktree:!1,filterActiveAgents:!1,maintainingProject:``})),o=b(e.projects,se(e=>e.repository.root===i.createWorktreeProjectRoot),S)??e.activeProject,s=ze($a(o?.repository.root??``)),c=b(s.value.branches,D(e=>e.type===`local`),j(e=>e.name)),u=b(s.value.branches,D(e=>N(e.name)),D(e=>e.type===`local`||!p(c,e.name)),ie((e,t)=>e.name===t.name&&e.type===t.type&&e.remote===t.remote),D(e=>!b(o?.worktrees??[],j(e=>e.branch??``),D(N),p(e.name)))),d=g(i.branch),f=b(u,ue(e=>e.name===d));async function m(t){let r=t?.name??d;if(ne(r)||N(i.creatingBranch))return;if(l(t)&&!mo(r)){F.error(`Branch names cannot contain spaces.`);return}let s=l(t)?Ve.make({}):w(t).pipe(M({type:`local`},()=>Ye.make({})),v(e=>Le.make({remote:e.remote??`origin`})));a(e=>({...e,creatingBranch:r}));try{let t=await n({payload:{branch:r,cwd:(o??e.activeProject)?.repository.root??``,source:s}});a(e=>({...e,actionsOpen:!1,branch:``})),e.selectWorktree(t)}catch(e){F.error(k(e))}finally{a(e=>({...e,creatingBranch:``}))}}async function h(){if(!(!e.activeWorktree||i.deletingWorktree)){a(e=>({...e,deletingWorktree:!0}));try{await r({payload:{cwd:e.activeWorktree.root}}),a(e=>({...e,deleteDialogOpen:!1}))}catch(e){F.error(k(e))}finally{a(e=>({...e,deletingWorktree:!1}))}}}async function _(e){a(t=>({...t,maintainingProject:e}));try{await t({payload:{cwd:e}})}catch(e){F.error(k(e))}finally{a(e=>({...e,maintainingProject:``}))}}return(0,V.jsxs)(`div`,{className:`flex h-full flex-col border-r`,children:[(0,V.jsxs)(`div`,{className:`grid h-8 grid-cols-[minmax(0,1fr)_auto] items-center border-b`,children:[(0,V.jsx)(O,{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,V.jsx)(`span`,{className:`min-w-0 truncate`,children:e.activeWorktree?lo(e.activeWorktree.root):`No worktree selected`})}),(0,V.jsxs)(`span`,{className:`flex items-center`,children:[(0,V.jsx)(O,{type:`button`,variant:`ghost`,size:`icon`,"aria-pressed":i.filterActiveAgents,"aria-label":i.filterActiveAgents?`Showing active agent worktrees`:`Showing all worktrees`,className:i.filterActiveAgents?`bg-muted text-foreground h-8 w-8`:`h-8 w-8`,onClick:()=>{a(e=>({...e,filterActiveAgents:!e.filterActiveAgents}))},title:i.filterActiveAgents?`Show all worktrees`:`Show active agent worktrees`,children:i.filterActiveAgents?(0,V.jsx)(nt,{className:`size-3`}):(0,V.jsx)(lt,{className:`size-3`})}),e.activeWorktree&&e.activeWorktree.root!==e.activeProject?.repository.root&&(0,V.jsx)(O,{type:`button`,variant:`destructive`,size:`icon`,className:`h-8 w-8`,disabled:i.deletingWorktree,onClick:()=>{a(e=>({...e,deleteDialogOpen:!0}))},title:`Delete worktree`,children:i.deletingWorktree?(0,V.jsx)(A,{className:`size-2.5 border opacity-60`}):(0,V.jsx)(vt,{className:`size-3`})})]})]}),(0,V.jsx)(je,{open:i.deleteDialogOpen,onOpenChange:e=>{a(t=>({...t,deleteDialogOpen:e}))},children:(0,V.jsxs)(De,{showCloseButton:!i.deletingWorktree,children:[(0,V.jsxs)(Ce,{children:[(0,V.jsx)(Oe,{children:`Delete worktree`}),(0,V.jsx)(ke,{children:e.activeWorktree?`Delete ${e.activeWorktree.branch??co(e.activeWorktree.root)}?`:`No worktree selected.`})]}),(0,V.jsxs)(Te,{children:[(0,V.jsx)(O,{type:`button`,variant:`outline`,disabled:i.deletingWorktree,onClick:()=>{a(e=>({...e,deleteDialogOpen:!1}))},children:`Cancel`}),(0,V.jsxs)(O,{type:`button`,variant:`destructive`,disabled:!e.activeWorktree||i.deletingWorktree,onClick:()=>{h(),a(e=>({...e,actionsOpen:!1}))},children:[i.deletingWorktree?(0,V.jsx)(A,{className:`size-2.5 border opacity-60`}):(0,V.jsx)(vt,{className:`size-3`}),`Delete`]})]})]})}),(0,V.jsx)(Ka,{open:i.actionsOpen,onOpenChange:e=>{a(t=>({...t,actionsOpen:e}))},title:`Create worktree`,description:`Create or open a worktree branch.`,className:`sm:max-w-2xl`,children:(0,V.jsxs)(Ga,{onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&a(e=>({...e,actionsOpen:!1}))},children:[(0,V.jsx)(qa,{placeholder:`Find or create branch in ${o?co(o.repository.root):`workspace`}...`,value:i.branch,onValueChange:e=>{a(t=>({...t,branch:e}))},onKeyDown:e=>{e.key===`Enter`&&N(d)&&o&&(e.preventDefault(),m(b(u,se(e=>e.name===d),S)))}}),(0,V.jsxs)(Ja,{children:[(0,V.jsx)(Ya,{children:N(d)&&!mo(d)?`Branch names cannot contain spaces.`:`No matching branch.`}),o&&(0,V.jsxs)(Xa,{children:[N(d)&&mo(d)&&!f&&(0,V.jsxs)(Za,{value:d,disabled:N(i.creatingBranch),onSelect:()=>{m()},children:[i.creatingBranch===d?(0,V.jsx)(A,{className:`size-2.5 border opacity-60`}):(0,V.jsx)(ot,{}),(0,V.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Create `,d]}),(0,V.jsxs)(Qa,{children:[`origin/`,s.value.defaultBranch]})]}),j(u,e=>{let t=i.creatingBranch===e.name?(0,V.jsx)(A,{className:`size-2.5 border opacity-60`}):w(e.type).pipe(M(`local`,()=>(0,V.jsx)(st,{})),v(()=>(0,V.jsx)(ct,{})));return(0,V.jsxs)(Za,{value:e.name,onSelect:()=>{a(t=>({...t,branch:e.name})),m(e)},children:[t,(0,V.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,V.jsx)(Qa,{children:e.type})]},`${e.type}:${e.remote??``}:${e.name}`)})]})]})]})}),(0,V.jsx)(Ae,{className:`min-h-0 flex-1 overflow-y-auto px-0 py-1`,children:(0,V.jsx)(Ee,{children:j(e.projects,t=>{let n=i.filterActiveAgents?b(t.worktrees,D(To)):t.worktrees;if(n.length===0)return null;let r=S(se(n,e=>e.root===t.repository.root))??n[0];return(0,V.jsxs)(`li`,{className:`min-w-0 py-1 first:pt-0`,children:[(0,V.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,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,V.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center [&_svg]:size-3`,children:(0,V.jsx)(Qe,{})}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,V.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,V.jsx)(`span`,{className:`min-w-0 truncate`,children:co(t.repository.root)})})})]}),(0,V.jsxs)(`span`,{className:`flex items-center`,children:[(0,V.jsx)(O,{variant:`ghost`,size:`icon-xs`,className:`h-5 w-5 rounded-none opacity-70 hover:opacity-100`,disabled:i.maintainingProject===t.repository.root,onClick:e=>{e.stopPropagation(),_(t.repository.root)},title:`Repository maintenance`,children:i.maintainingProject===t.repository.root?(0,V.jsx)(A,{className:`size-2.5 border opacity-60`}):(0,V.jsx)(pt,{className:`size-3`})}),(0,V.jsx)(O,{variant:`ghost`,size:`icon-xs`,className:`h-5 w-5 rounded-none opacity-70 hover:opacity-100`,onClick:e=>{e.stopPropagation(),a(e=>({...e,actionsOpen:!0,branch:``,createWorktreeProjectRoot:t.repository.root}))},title:`Create worktree`,children:(0,V.jsx)(ot,{className:`size-3`})})]})]}),(0,V.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:j(n,n=>(0,V.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,V.jsx)(P,{icon:(0,V.jsx)(uo,{dirty:!1,root:n.root===t.repository.root}),selected:e.activeView===`diff`&&e.activeWorktree?.root===n.root,onClick:()=>{e.selectWorktree(n.root)},children:n.branch??co(n.root)},n.root),(0,V.jsxs)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:[(0,V.jsx)(z.Suspense,{fallback:(0,V.jsx)(ge,{}),children:(0,V.jsx)(wo,{cwd:n.root,profiles:e.agentProfiles,sessions:n.agents,selectAgent:e.selectAgent})}),(0,V.jsx)(`li`,{className:`w-full min-w-0`,children:(0,V.jsx)(P,{icon:(0,V.jsx)(_t,{}),selected:e.activeView===`terminal`&&e.activeWorktree?.root===n.root,onClick:()=>{e.selectTerminal(n.root)},children:`terminal`})}),(0,V.jsx)(z.Suspense,{fallback:(0,V.jsx)(ge,{}),children:(0,V.jsx)(bo,{cwd:n.root,runStatuses:n.runStatuses,runs:n.portlessRuns,selectPortless:e.selectPortless,selectRun:e.selectRun})}),(0,V.jsx)(z.Suspense,{fallback:(0,V.jsx)(ge,{}),children:(0,V.jsx)(_o,{cwd:n.root,runStatuses:n.runStatuses,scripts:n.scriptRuns,selectRun:e.selectRun})})]})]},n.root))})]},t.repository.gitDirectory)})})}),(0,V.jsx)(so,{})]})}export{eo as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./compiler-runtime-CLAvuQ-D.js";import{n}from"./fallbacks-
|
|
1
|
+
import{n as e,t}from"./compiler-runtime-CLAvuQ-D.js";import{n}from"./fallbacks-BYPj1x-T.js";import{M as r,r as i}from"./state-Cxz4BVk7.js";import{t as a}from"./run-gggwaxnT.js";import{t as o}from"./-workbench-terminal-Ne3Ca_Zm.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/run-DVOYYIUX.js","assets/compiler-runtime-CLAvuQ-D.js","assets/rolldown-runtime-QTnfLwEv.js","assets/fallbacks-BYPj1x-T.js","assets/state-Cxz4BVk7.js","assets/-workbench-terminal-Ne3Ca_Zm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Ls as e,Nt as t,Rs as n,V as r,it as i,kt as a,rt as o}from"./fallbacks-BYPj1x-T.js";import{t as s}from"./preload-helper-CjdClQve.js";var c=n(`/(home)/$worktree/run`)({component:e(()=>s(()=>import(`./run-DVOYYIUX.js`),__vite__mapDeps([0,1,2,3,4,5])),`component`),validateSearch:t(i({inactive:a(r),sessionId:o}))});export{c as t};
|