vibora 9.7.0 → 9.7.1

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.
@@ -25,9 +25,9 @@ Error generating stack: `+k.message+`
25
25
  `:"",O=E+w+x+A+T;t(O)}else t(e+(e?`
26
26
  `:"")+x)}catch(x){Et.error(a("errors.imageUploadFailed")),Lt.kanban.error("Upload error",{error:String(x)})}finally{o(!1)}return}}};return p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"relative",children:[p.jsx(o1,{ref:l,value:e,onChange:c=>t(c.target.value),onPaste:d,className:ze(s&&"opacity-50",n),disabled:s||r,...i}),s&&p.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 rounded-md",children:p.jsx("span",{className:"text-sm text-muted-foreground",children:a("status.uploading")})})]}),u.length>0&&p.jsx("div",{className:"flex flex-wrap gap-2",children:u.map((c,m)=>p.jsx("a",{href:DV(c),target:"_blank",rel:"noopener noreferrer",className:"block",children:p.jsx("img",{src:DV(c),alt:`Attachment ${m+1}`,className:"h-16 w-auto rounded border object-cover hover:opacity-80 transition-opacity"})},m))})]})}function ea({className:e,...t}){return p.jsx("label",{"data-slot":"label",className:ze("gap-2 text-xs/relaxed leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",e),...t})}const Rj=C.forwardRef(function(t,n){const{className:r,render:i,orientation:a="horizontal",...s}=t,o=C.useMemo(()=>({orientation:a}),[a]);return kt("div",t,{state:o,ref:n,props:[{role:"separator","aria-orientation":a},s]})});function uCe({className:e,orientation:t="horizontal",...n}){return p.jsx(Rj,{"data-slot":"separator",orientation:t,className:ze("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",e),...n})}function Tp({className:e,...t}){return p.jsx("div",{"data-slot":"field-group",className:ze("gap-4 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col",e),...t})}const cCe=$d("data-[invalid=true]:text-destructive gap-2 group/field flex w-full",{variants:{orientation:{vertical:"flex-col [&>*]:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function zn({className:e,orientation:t="vertical",...n}){return p.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:ze(cCe({orientation:t}),e),...n})}function Hn({className:e,...t}){return p.jsx(ea,{"data-slot":"field-label",className:ze("has-data-checked:bg-primary/5 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...t})}function Da({className:e,...t}){return p.jsx("p",{"data-slot":"field-description",className:ze("text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",e),...t})}function Pie(e){const t=C.useRef(!0);t.current&&(t.current=!1,e())}const Mie=C.createContext(null),jie=C.createContext(null);function au(){const e=C.useContext(Mie);if(e===null)throw new Error(hn(60));return e}function Fie(){const e=C.useContext(jie);if(e===null)throw new Error(hn(61));return e}const Bie=(e,t)=>Object.is(e,t);function nc(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Hf(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:nc(r,t,n))}function Bm(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:nc(r,t,n))}function Uie(e,t,n){return e.filter(r=>!nc(r,t,n))}function YL(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function $ie(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function fi(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return YL(e)}function Ho(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?YL(e.value):YL(e)}function dCe(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??fi(e,n);if(Array.isArray(t)){const r=$ie(t)?t.flatMap(i=>i.items):t;if(e==null){const i=r.find(a=>a.value==null);return i&&i.label!=null?i.label:fi(e,n)}if(typeof e!="object"){const i=r.find(a=>a&&a.value===e);return i&&i.label!=null?i.label:fi(e,n)}if("value"in e){const i=r.find(a=>a&&a.value===e.value);if(i&&i.label!=null)return i.label}}return fi(e,n)}function fCe(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>fi(n,t)).join(", ")}const Jt={id:qe(e=>e.id),modal:qe(e=>e.modal),multiple:qe(e=>e.multiple),items:qe(e=>e.items),itemToStringLabel:qe(e=>e.itemToStringLabel),itemToStringValue:qe(e=>e.itemToStringValue),isItemEqualToValue:qe(e=>e.isItemEqualToValue),value:qe(e=>e.value),open:qe(e=>e.open),mounted:qe(e=>e.mounted),forceMount:qe(e=>e.forceMount),transitionStatus:qe(e=>e.transitionStatus),openMethod:qe(e=>e.openMethod),activeIndex:qe(e=>e.activeIndex),selectedIndex:qe(e=>e.selectedIndex),isActive:qe((e,t)=>e.activeIndex===t),isSelected:qe((e,t,n)=>{const r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(a=>nc(a,n,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:nc(i,n,r)}),isSelectedByFocus:qe((e,t)=>e.selectedIndex===t),popupProps:qe(e=>e.popupProps),triggerProps:qe(e=>e.triggerProps),triggerElement:qe(e=>e.triggerElement),positionerElement:qe(e=>e.positionerElement),listElement:qe(e=>e.listElement),scrollUpArrowVisible:qe(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:qe(e=>e.scrollDownArrowVisible),hasScrollArrows:qe(e=>e.hasScrollArrows),serializedValue:qe(e=>{const{multiple:t,value:n,itemToStringValue:r}=e;return t&&Array.isArray(n)&&n.length===0?"":Ho(n,r)})};function Vf(e,t){const n=C.useRef(e),r=tt(t);it(()=>{n.current!==e&&r(n.current)},[e,r]),it(()=>{n.current=e},[e])}function pCe(e){const{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:s=!1,onOpenChange:o,name:l,disabled:u=!1,readOnly:d=!1,required:c=!1,modal:m=!0,actionsRef:g,inputRef:_,onOpenChangeComplete:x,items:b,multiple:v=!1,itemToStringLabel:y,itemToStringValue:E,isItemEqualToValue:T=Bie,highlightItemOnHover:w=!0,children:A}=e,{clearErrors:O}=a1(),{setDirty:R,shouldValidateOnChange:N,validityData:D,setFilled:L,name:U,disabled:M,validation:W}=xo(),{controlId:z}=Wd(),H=NC({id:t}),q=M||u,K=U??l,[$,j]=Ls({controlled:n,default:v?r??La:r,name:"Select",state:"value"}),[F,G]=Ls({controlled:a,default:s,name:"Select",state:"open"}),V=C.useRef([]),J=C.useRef([]),ae=C.useRef(null),se=C.useRef(null),Z=C.useRef(0),Y=C.useRef(null),Q=C.useRef([]),re=C.useRef(!1),oe=C.useRef(!1),ee=C.useRef(null),ve=C.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Ee=C.useRef(!1),{mounted:me,setMounted:Se,transitionStatus:xe}=ul(F),{openMethod:Ye,triggerProps:Ue,reset:je}=OC(F),we=Ui(()=>new ip({id:H,modal:m,multiple:v,itemToStringLabel:y,itemToStringValue:E,isItemEqualToValue:T,value:$,open:F,mounted:me,transitionStatus:xe,items:b,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Ne=et(we,Jt.activeIndex),_e=et(we,Jt.selectedIndex),pe=et(we,Jt.triggerElement),Ae=et(we,Jt.positionerElement),he=C.useMemo(()=>v&&Array.isArray($)&&$.length===0?"":Ho($,E),[v,$,E]),Oe=C.useMemo(()=>v&&Array.isArray($)?$.map(St=>Ho(St,E)):Ho($,E),[v,$,E]),ge=Er(we.state.triggerElement);s1({id:H,commit:W.commit,value:$,controlRef:ge,name:K,getValue:()=>Oe});const Ie=C.useRef($);it(()=>{$!==Ie.current&&we.set("forceMount",!0)},[we,$]),it(()=>{L($!==null)},[$,L]),it(function(){if(F)return;const Xt=Q.current;if(v){const yt=Array.isArray($)?$:[];if(yt.length===0){we.set("selectedIndex",null);return}const nt=yt[yt.length-1],_n=Bm(Xt,nt,T);we.set("selectedIndex",_n===-1?null:_n);return}const De=Bm(Xt,$,T);we.set("selectedIndex",De===-1?null:De)},[v,F,$,Q,T,we]),Vf($,()=>{O(K),R($!==D.initialValue),N()?W.commit($):W.commit($,!0)});const We=tt((St,Xt)=>{if(o?.(St,Xt),!Xt.isCanceled&&(G(St),!St&&we.state.activeIndex!==null)){const De=V.current[we.state.activeIndex];queueMicrotask(()=>{De?.setAttribute("tabindex","-1")})}}),mt=tt(()=>{Se(!1),we.set("activeIndex",null),je(),x?.(!1)});ia({enabled:!g,open:F,ref:ae,onComplete(){F||mt()}}),C.useImperativeHandle(g,()=>({unmount:mt}),[mt]);const lt=tt((St,Xt)=>{i?.(St,Xt),!Xt.isCanceled&&j(St)}),dt=tt(()=>{const St=we.state.listElement||ae.current;if(!St)return;const Xt=St.scrollTop,De=St.scrollTop+St.clientHeight,yt=Xt>1,nt=De<St.scrollHeight-1;we.state.scrollUpArrowVisible!==yt&&we.set("scrollUpArrowVisible",yt),we.state.scrollDownArrowVisible!==nt&&we.set("scrollDownArrowVisible",nt)}),$e=gC({open:F,onOpenChange:We,elements:{reference:pe,floating:Ae}}),ht=Ng($e,{enabled:!d&&!q,event:"mousedown"}),Re=Ig($e,{bubbles:!1}),de=mj($e,{enabled:!d&&!q,listRef:V,activeIndex:Ne,selectedIndex:_e,disabledIndices:La,onNavigate(St){St===null&&!F||we.set("activeIndex",St)},focusItemOnHover:!1}),Te=gj($e,{enabled:!d&&!q&&(F||!v),listRef:J,activeIndex:Ne,selectedIndex:_e,onMatch(St){F?we.set("activeIndex",St):lt(Q.current[St],ft("none"))},onTypingChange(St){re.current=St}}),{getReferenceProps:Ke,getFloatingProps:st,getItemProps:Bt}=Vd([ht,Re,de,Te]),zt=C.useMemo(()=>Jl(Ke(),Ue),[Ke,Ue]);Pie(()=>{we.update({popupProps:st(),triggerProps:zt})}),it(()=>{we.update({id:H,modal:m,multiple:v,value:$,open:F,mounted:me,transitionStatus:xe,popupProps:st(),triggerProps:zt,items:b,itemToStringLabel:y,itemToStringValue:E,isItemEqualToValue:T,openMethod:Ye})},[we,H,m,v,$,F,me,xe,st,zt,b,y,E,T,Ye]);const Mt=C.useMemo(()=>({store:we,name:K,required:c,disabled:q,readOnly:d,multiple:v,itemToStringLabel:y,itemToStringValue:E,highlightItemOnHover:w,setValue:lt,setOpen:We,listRef:V,popupRef:ae,scrollHandlerRef:se,handleScrollArrowVisibility:dt,scrollArrowsMountedCountRef:Z,getItemProps:Bt,events:$e.context.events,valueRef:Y,valuesRef:Q,labelsRef:J,typingRef:re,selectionRef:ve,selectedItemTextRef:ee,validation:W,onOpenChangeComplete:x,keyboardActiveRef:oe,alignItemWithTriggerActiveRef:Ee,initialValueRef:Ie}),[we,K,c,q,d,v,y,E,w,lt,We,Bt,$e.context.events,W,x,dt]),bt=_o(_,W.inputRef),en=v&&Array.isArray($)&&$.length>0,Wt=C.useMemo(()=>!v||!Array.isArray($)||!K?null:$.map(St=>{const Xt=Ho(St,E);return p.jsx("input",{type:"hidden",name:K,value:Xt},Xt)}),[v,$,K,E]);return p.jsx(Mie.Provider,{value:Mt,children:p.jsxs(jie.Provider,{value:$e,children:[A,p.jsx("input",{...W.getInputValidationProps({onFocus(){we.state.triggerElement?.focus()},onChange(St){if(St.nativeEvent.defaultPrevented)return;const Xt=St.target.value,De=ft(qr,St.nativeEvent);function yt(){if(v)return;const nt=Q.current.find(_n=>Ho(_n,E).toLowerCase()===Xt.toLowerCase());nt!=null&&(R(nt!==D.initialValue),lt(nt,De),N()&&W.commit(nt))}we.set("forceMount",!0),queueMicrotask(yt)}}),id:t||z||void 0,name:v?void 0:K,value:he,disabled:q,required:c&&!en,readOnly:d,ref:bt,style:Rg,tabIndex:-1,"aria-hidden":!0}),Wt]})})}function Nj(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const a=parseFloat(n.width)||0,s=parseFloat(n.height)||0,o=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=Math.max(t.width,a,o),d=Math.max(t.height,s,l),c=u-t.width,m=d-t.height;return{left:t.left-c/2,right:t.right+c/2,top:t.top-m/2,bottom:t.bottom+m/2}}const Cx=2,hCe={...Pm,...$p,value:()=>null},mCe=C.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,nativeButton:s=!0,...o}=t,{setTouched:l,setFocused:u,validationMode:d,state:c,disabled:m}=xo(),{labelId:g}=Wd(),{store:_,setOpen:x,selectionRef:b,validation:v,readOnly:y,alignItemWithTriggerActiveRef:E,disabled:T,keyboardActiveRef:w}=au(),A=m||T||a,O=et(_,Jt.open),R=et(_,Jt.value),N=et(_,Jt.triggerProps),D=et(_,Jt.positionerElement),L=et(_,Jt.listElement),U=et(_,Jt.serializedValue),M=Er(D),W=C.useRef(null),z=Wn(),H=Wn(),{getButtonProps:q,buttonRef:K}=za({disabled:A,native:s}),$=tt(se=>{_.set("triggerElement",se)}),j=_o(n,W,K,$),F=Wn(),G=Wn();C.useEffect(()=>{if(O)return G.start(200,()=>{b.current.allowUnselectedMouseUp=!0,F.start(200,()=>{b.current.allowSelectedMouseUp=!0})}),()=>{F.clear(),G.clear()};b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},H.clear()},[O,b,H,F,G]);const V=C.useMemo(()=>L?.id??Cy(D)?.id,[L,D]),J=Jl(N,{role:"combobox","aria-expanded":O?"true":"false","aria-haspopup":"listbox","aria-controls":O?V:void 0,"aria-labelledby":g,"aria-readonly":y||void 0,tabIndex:A?-1:0,ref:j,onFocus(se){u(!0),O&&E.current&&x(!1,ft(el,se.nativeEvent)),z.start(0,()=>{_.set("forceMount",!0)})},onBlur(){l(!0),u(!1),d==="onBlur"&&v.commit(R)},onPointerMove(){w.current=!1},onKeyDown(){w.current=!0},onMouseDown(se){if(O)return;const Z=ra(se.currentTarget);function Y(Q){if(!W.current)return;const re=Q.target;if(Pt(W.current,re)||Pt(M.current,re)||re===W.current)return;const oe=Nj(W.current);Q.clientX>=oe.left-Cx&&Q.clientX<=oe.right+Cx&&Q.clientY>=oe.top-Cx&&Q.clientY<=oe.bottom+Cx||x(!1,ft(vre,Q))}H.start(0,()=>{Z.addEventListener("mouseup",Y,{once:!0})})}},v.getValidationProps,o,q);J.role="combobox";const ae=C.useMemo(()=>({...c,open:O,disabled:A,value:R,readOnly:y,placeholder:!U}),[c,O,A,R,y,U]);return kt("button",t,{ref:[n,W],state:ae,stateAttributesMapping:hCe,props:J})}),gCe={value:()=>null},bCe=C.forwardRef(function(t,n){const{className:r,render:i,children:a,...s}=t,{store:o,valueRef:l}=au(),u=et(o,Jt.value),d=et(o,Jt.items),c=et(o,Jt.itemToStringLabel),m=et(o,Jt.serializedValue),g=C.useMemo(()=>({value:u,placeholder:!m}),[u,m]),_=typeof a=="function"?a(u):a??(Array.isArray(u)?fCe(u,c):dCe(u,d,c));return kt("span",t,{state:g,ref:[n,l],props:[{children:_},s],stateAttributesMapping:gCe})}),vCe=C.forwardRef(function(t,n){const{className:r,render:i,...a}=t,{store:s}=au(),o=et(s,Jt.open),l=C.useMemo(()=>({open:o}),[o]);return kt("span",t,{state:l,ref:n,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:_C})}),yCe=C.createContext(void 0),_Ce=C.forwardRef(function(t,n){const{store:r}=au(),i=et(r,Jt.mounted),a=et(r,Jt.forceMount);return i||a?p.jsx(yCe.Provider,{value:!0,children:p.jsx(Q0,{ref:n,...t})}):null}),zie=C.createContext(void 0);function Ij(){const e=C.useContext(zie);if(!e)throw new Error(hn(59));return e}function dS(e,t){e&&Object.assign(e.style,t)}const Hie={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},xCe={position:"fixed"},ECe=C.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:a,render:s,side:o="bottom",align:l="center",sideOffset:u=0,alignOffset:d=0,collisionBoundary:c="clipping-ancestors",collisionPadding:m,arrowPadding:g=5,sticky:_=!1,disableAnchorTracking:x,alignItemWithTrigger:b=!0,collisionAvoidance:v=uC,...y}=t,{store:E,listRef:T,labelsRef:w,alignItemWithTriggerActiveRef:A,selectedItemTextRef:O,valuesRef:R,initialValueRef:N,popupRef:D,setValue:L}=au(),U=Fie(),M=et(E,Jt.open),W=et(E,Jt.mounted),z=et(E,Jt.modal),H=et(E,Jt.value),q=et(E,Jt.openMethod),K=et(E,Jt.positionerElement),$=et(E,Jt.triggerElement),j=et(E,Jt.isItemEqualToValue),F=C.useRef(null),G=C.useRef(null),[V,J]=C.useState(b),ae=W&&V&&q!=="touch";!W&&V!==b&&J(b),it(()=>{W||(Jt.scrollUpArrowVisible(E.state)&&E.set("scrollUpArrowVisible",!1),Jt.scrollDownArrowVisible(E.state)&&E.set("scrollDownArrowVisible",!1))},[E,W]),C.useImperativeHandle(A,()=>ae),kC((ae||z)&&M&&q!=="touch",$);const se=r1({anchor:r,floatingRootContext:U,positionMethod:i,mounted:W,side:o,sideOffset:u,align:l,alignOffset:d,arrowPadding:g,collisionBoundary:c,collisionPadding:m,sticky:_,disableAnchorTracking:x??ae,collisionAvoidance:v,keepMounted:!0}),Z=ae?"none":se.side,Y=ae?xCe:se.positionerStyles,Q=C.useMemo(()=>{const Se={};return M||(Se.pointerEvents="none"),{role:"presentation",hidden:!W,style:{...Y,...Se}}},[M,W,Y]),re=C.useMemo(()=>({open:M,side:Z,align:se.align,anchorHidden:se.anchorHidden}),[M,Z,se.align,se.anchorHidden]),oe=tt(Se=>{E.set("positionerElement",Se)}),ee=kt("div",t,{ref:[n,oe],state:re,stateAttributesMapping:cs,props:[Q,y]}),ve=C.useRef(0),Ee=tt(Se=>{if(Se.size===0&&ve.current===0||R.current.length===0)return;const xe=ve.current;if(ve.current=Se.size,Se.size===xe)return;const Ye=ft(qr);if(xe!==0&&!E.state.multiple&&H!==null&&Bm(R.current,H,j)===-1){const je=N.current,Ne=je!=null&&Hf(R.current,je,j)?je:null;L(Ne,Ye),Ne===null&&(E.set("selectedIndex",null),O.current=null)}if(xe!==0&&E.state.multiple&&Array.isArray(H)){const Ue=H.filter(je=>Hf(R.current,je,j));(Ue.length!==H.length||Ue.some(je=>!Hf(H,je,j)))&&(L(Ue,Ye),Ue.length===0&&(E.set("selectedIndex",null),O.current=null))}if(M&&ae){E.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ue={height:""};dS(K,Ue),dS(D.current,Ue)}}),me=C.useMemo(()=>({...se,side:Z,alignItemWithTriggerActive:ae,setControlledAlignItemWithTrigger:J,scrollUpArrowRef:F,scrollDownArrowRef:G}),[se,Z,ae,J]);return p.jsx(e1,{elementsRef:T,labelsRef:w,onMapChange:Ee,children:p.jsxs(zie.Provider,{value:me,children:[W&&z&&p.jsx(AC,{inert:Dg(!M),cutout:$}),ee]})})});function Vie(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Tx="base-ui-disable-scrollbar",jy={className:Tx,element:p.jsx("style",{href:Tx,precedence:"base-ui:low",children:`.${Tx}{scrollbar-width:none}.${Tx}::-webkit-scrollbar{display:none}`})},SCe=C.createContext(void 0);function Dj(e){return C.useContext(SCe)}const wCe={...cs,...Us},CCe=C.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{store:s,popupRef:o,onOpenChangeComplete:l,setOpen:u,valueRef:d,selectedItemTextRef:c,keyboardActiveRef:m,multiple:g,handleScrollArrowVisibility:_,scrollHandlerRef:x}=au(),{side:b,align:v,alignItemWithTriggerActive:y,setControlledAlignItemWithTrigger:E,scrollDownArrowRef:T,scrollUpArrowRef:w}=Ij(),A=Dj()!=null,O=Fie(),R=Wn(),N=et(s,Jt.id),D=et(s,Jt.open),L=et(s,Jt.mounted),U=et(s,Jt.popupProps),M=et(s,Jt.transitionStatus),W=et(s,Jt.triggerElement),z=et(s,Jt.positionerElement),H=et(s,Jt.listElement),q=C.useRef(0),K=C.useRef(!1),$=C.useRef(0),j=C.useRef(!1),F=C.useRef({}),G=qu(),V=tt(Z=>{if(!z||!o.current||!j.current)return;if(K.current||!y){_();return}const Y=z.style.top==="0px",Q=z.style.bottom==="0px",re=z.getBoundingClientRect().height,oe=ra(z),ee=getComputedStyle(z),ve=parseFloat(ee.marginTop),Ee=parseFloat(ee.marginBottom),me=oe.documentElement.clientHeight-ve-Ee,Se=Z.scrollTop,xe=Z.scrollHeight,Ye=Z.clientHeight,Ue=xe-Ye;let je=null,we=null,Ne=!1;if(Y){const _e=Ue-Se,pe=re+_e,Ae=Math.min(pe,me);je=Ae,Ae!==me?we=Ue:Ne=!0}else if(Q){const _e=Se-0,pe=re+_e,Ae=Math.min(pe,me),he=pe-me;je=Ae,Ae!==me?we=0:(Ne=!0,Se<Ue&&(we=Se-(_e-he)))}je!=null&&(z.style.height=`${je}px`),we!=null&&(Z.scrollTop=we),Ne&&(K.current=!0),_()});C.useImperativeHandle(x,()=>V,[V]),ia({open:D,ref:o,onComplete(){D&&l?.(!0)}});const J=C.useMemo(()=>({open:D,transitionStatus:M,side:b,align:v}),[D,M,b,v]);it(()=>{!z||!o.current||Object.keys(F.current).length||(F.current={top:z.style.top||"0",left:z.style.left||"0",right:z.style.right,height:z.style.height,bottom:z.style.bottom,minHeight:z.style.minHeight,maxHeight:z.style.maxHeight,marginTop:z.style.marginTop,marginBottom:z.style.marginBottom})},[o,z]),it(()=>{L||y||(j.current=!1,K.current=!1,q.current=0,$.current=0,dS(z,F.current))},[L,y,z,o]),it(()=>{const Z=o.current;if(!(!L||!W||!z||!Z)){if(!y){j.current=!0,G.request(_);return}queueMicrotask(()=>{const Y=getComputedStyle(z),Q=getComputedStyle(Z),re=ra(W),oe=Pr(z),ee=W.getBoundingClientRect(),ve=z.getBoundingClientRect(),Ee=ee.left,me=ee.height,Se=H||Z,xe=Se.scrollHeight,Ye=parseFloat(Q.borderBottomWidth),Ue=parseFloat(Y.marginTop)||10,je=parseFloat(Y.marginBottom)||10,we=parseFloat(Y.minHeight)||100,Ne=5,_e=5,pe=20,Ae=re.documentElement.clientHeight-Ue-je,he=re.documentElement.clientWidth,Oe=Ae-ee.bottom+me,ge=c.current,Ie=d.current;let We=0,mt=0;if(ge&&Ie){const Mt=Ie.getBoundingClientRect(),bt=ge.getBoundingClientRect(),en=Mt.left-Ee,Wt=bt.left-ve.left,St=Mt.top-ee.top+Mt.height/2,Xt=bt.top-ve.top+bt.height/2;We=en-Wt,mt=Xt-St}const lt=Oe+mt+je+Ye;let dt=Math.min(Ae,lt);const $e=Ae-Ue-je,ht=lt-dt,Re=Math.max(Ne,Ee+We),de=he-_e,Te=Math.max(0,Re+ve.width-de);z.style.left=`${Re-Te}px`,z.style.height=`${dt}px`,z.style.maxHeight="auto",z.style.marginTop=`${Ue}px`,z.style.marginBottom=`${je}px`,Z.style.height="100%";const Ke=Se.scrollHeight-Se.clientHeight,st=ht>=Ke;st&&(dt=Math.min(Ae,ve.height)-(ht-Ke));const Bt=ee.top<pe||ee.bottom>Ae-pe||dt<Math.min(xe,we),zt=(oe.visualViewport?.scale??1)!==1&&K3;if(Bt||zt){j.current=!0,dS(z,F.current),jr.flushSync(()=>E(!1));return}if(st){const Mt=Math.max(0,Ae-lt);z.style.top=ve.height>=$e?"0":`${Mt}px`,z.style.height=`${dt}px`,Se.scrollTop=Se.scrollHeight-Se.clientHeight,q.current=Math.max(we,dt)}else z.style.bottom="0",q.current=Math.max(we,dt),Se.scrollTop=ht;q.current===Ae&&(K.current=!0),_(),setTimeout(()=>{j.current=!0})})}},[s,L,z,W,d,c,o,_,y,E,G,T,w,H]),C.useEffect(()=>{if(!y||!z||!L)return;const Z=Pr(z);function Y(Q){u(!1,ft(Q_e,Q))}return Z.addEventListener("resize",Y),()=>{Z.removeEventListener("resize",Y)}},[u,y,z,L]);const ae={...H?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":g||void 0,id:`${N}-list`},onKeyDown(Z){m.current=!0,A&&vj.has(Z.key)&&Z.stopPropagation()},onMouseMove(){m.current=!1},onPointerLeave(Z){if(Vie(Z)||Z.pointerType==="touch")return;const Y=Z.currentTarget;R.start(0,()=>{s.set("activeIndex",null),Y.focus({preventScroll:!0})})},onScroll(Z){H||x.current?.(Z.currentTarget)},...y&&{style:H?{height:"100%"}:Hie}},se=kt("div",t,{ref:[n,o],state:J,stateAttributesMapping:wCe,props:[U,ae,Pg(M),{className:!H&&y?jy.className:void 0},a]});return p.jsxs(C.Fragment,{children:[jy.element,p.jsx(fC,{context:O,modal:!1,disabled:!L,restoreFocus:!0,children:se})]})}),TCe=C.forwardRef(function(t,n){const{className:r,render:i,...a}=t,{store:s,scrollHandlerRef:o}=au(),{alignItemWithTriggerActive:l}=Ij(),u=et(s,Jt.hasScrollArrows),d=et(s,Jt.openMethod),c=et(s,Jt.multiple),g={id:`${et(s,Jt.id)}-list`,role:"listbox","aria-multiselectable":c||void 0,onScroll(x){o.current?.(x.currentTarget)},...l&&{style:Hie},className:u&&d!=="touch"?jy.className:void 0},_=tt(x=>{s.set("listElement",x)});return kt("div",t,{ref:[n,_],props:[g,a]})}),Wie=C.createContext(void 0);function Lj(){const e=C.useContext(Wie);if(!e)throw new Error(hn(57));return e}const ACe=C.memo(C.forwardRef(function(t,n){const{render:r,className:i,value:a=null,label:s,disabled:o=!1,nativeButton:l=!1,...u}=t,d=C.useRef(null),c=Lg({label:s,textRef:d,indexGuessBehavior:yj.GuessFromOrder}),{store:m,getItemProps:g,setOpen:_,setValue:x,selectionRef:b,typingRef:v,valuesRef:y,keyboardActiveRef:E,multiple:T,highlightItemOnHover:w}=au(),A=Wn(),O=et(m,Jt.isActive,c.index),R=et(m,Jt.isSelected,c.index,a),N=et(m,Jt.isSelectedByFocus,c.index),D=et(m,Jt.isItemEqualToValue),L=c.index,U=L!==-1,M=C.useRef(null),W=Er(L);it(()=>{if(!U)return;const se=y.current;return se[L]=a,()=>{delete se[L]}},[U,L,a,y]),it(()=>{if(!U)return;const se=m.state.value;let Z=se;T&&Array.isArray(se)&&se.length>0&&(Z=se[se.length-1]),Z!==void 0&&nc(Z,a,D)&&m.set("selectedIndex",L)},[U,L,T,D,m,a]);const z=C.useMemo(()=>({disabled:o,selected:R,highlighted:O}),[o,R,O]),H=g({active:O,selected:R});H.onFocus=void 0,H.id=void 0;const q=C.useRef(null),K=C.useRef("mouse"),$=C.useRef(!1),{getButtonProps:j,buttonRef:F}=za({disabled:o,focusableWhenDisabled:!0,native:l});function G(se){const Z=m.state.value;if(T){const Y=Array.isArray(Z)?Z:[],Q=R?Uie(Y,a,D):[...Y,a];x(Q,ft(np,se))}else x(a,ft(np,se)),_(!1,ft(np,se))}const V={role:"option","aria-selected":R,"aria-disabled":o||void 0,tabIndex:O?0:-1,onFocus(){m.set("activeIndex",L)},onMouseEnter(){!E.current&&m.state.selectedIndex===null&&m.set("activeIndex",L)},onMouseMove(){w&&m.set("activeIndex",L)},onMouseLeave(se){!w||E.current||Vie(se)||A.start(0,()=>{m.state.activeIndex===L&&m.set("activeIndex",null)})},onTouchStart(){b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(se){q.current=se.key,m.set("activeIndex",L)},onClick(se){$.current=!1,!(se.type==="keydown"&&q.current===null)&&(o||q.current===" "&&v.current||K.current!=="touch"&&!O||(q.current=null,G(se.nativeEvent)))},onPointerEnter(se){K.current=se.pointerType},onPointerDown(se){K.current=se.pointerType,$.current=!0},onMouseUp(se){if(o)return;if($.current){$.current=!1;return}const Z=!b.current.allowSelectedMouseUp&&R,Y=!b.current.allowUnselectedMouseUp&&!R;Z||Y||K.current!=="touch"&&!O||G(se.nativeEvent)}},J=kt("div",t,{ref:[F,n,c.ref,M],state:z,props:[H,V,u,j]}),ae=C.useMemo(()=>({selected:R,indexRef:W,textRef:d,selectedByFocus:N,hasRegistered:U}),[R,W,d,N,U]);return p.jsx(Wie.Provider,{value:ae,children:J})})),kCe=C.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=Lj();return r||i?p.jsx(OCe,{...t,ref:n}):null}),OCe=C.memo(C.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:i,...a}=e,{selected:s}=Lj(),o=C.useRef(null),{transitionStatus:l,setMounted:u}=ul(s),d=C.useMemo(()=>({selected:s,transitionStatus:l}),[s,l]),c=kt("span",e,{ref:[t,o],state:d,props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:Us});return ia({open:s,ref:o,onComplete(){s||u(!1)}}),c})),RCe=C.memo(C.forwardRef(function(t,n){const{indexRef:r,textRef:i,selectedByFocus:a,hasRegistered:s}=Lj(),{selectedItemTextRef:o}=au(),{className:l,render:u,...d}=t,c=C.useCallback(g=>{if(!g||!s)return;const _=o.current===null||!o.current.isConnected;(a||_&&r.current===0)&&(o.current=g)},[o,r,a,s]);return kt("div",t,{ref:[c,n,i],props:d})})),Gie=C.forwardRef(function(t,n){const{render:r,className:i,direction:a,keepMounted:s=!1,...o}=t,{store:l,popupRef:u,listRef:d,handleScrollArrowVisibility:c,scrollArrowsMountedCountRef:m}=au(),{side:g,scrollDownArrowRef:_,scrollUpArrowRef:x}=Ij(),b=a==="up"?Jt.scrollUpArrowVisible:Jt.scrollDownArrowVisible,v=et(l,b),y=et(l,Jt.openMethod),E=v&&y!=="touch",T=Wn(),w=a==="up"?x:_,{transitionStatus:A,setMounted:O}=ul(E);it(()=>(m.current+=1,l.state.hasScrollArrows||l.set("hasScrollArrows",!0),()=>{m.current=Math.max(0,m.current-1),m.current===0&&l.state.hasScrollArrows&&l.set("hasScrollArrows",!1)}),[l,m]),ia({open:E,ref:w,onComplete(){E||O(!1)}});const R=C.useMemo(()=>({direction:a,visible:E,side:g,transitionStatus:A}),[a,E,g,A]),D=kt("div",t,{ref:[n,w],state:R,props:[{"aria-hidden":!0,children:a==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(U){if(U.movementX===0&&U.movementY===0||T.isStarted())return;l.set("activeIndex",null);function M(){const W=l.state.listElement??u.current;if(!W)return;l.set("activeIndex",null),c();const z=W.scrollTop===0,H=Math.round(W.scrollTop+W.clientHeight)>=W.scrollHeight;if(d.current.length===0&&(a==="up"?l.set("scrollUpArrowVisible",!z):l.set("scrollDownArrowVisible",!H)),a==="up"&&z||a==="down"&&H){T.clear();return}if((l.state.listElement||u.current)&&d.current&&d.current.length>0){const K=d.current,$=w.current?.offsetHeight||0;if(a==="up"){let j=0;const F=W.scrollTop+$;for(let V=0;V<K.length;V+=1){const J=K[V];if(J&&J.offsetTop>=F){j=V;break}}const G=Math.max(0,j-1);if(G<j){const V=K[G];V&&(W.scrollTop=Math.max(0,V.offsetTop-$))}else W.scrollTop=0}else{let j=K.length-1;const F=W.scrollTop+W.clientHeight-$;for(let V=0;V<K.length;V+=1){const J=K[V];if(J&&J.offsetTop+J.offsetHeight>F){j=Math.max(0,V-1);break}}const G=Math.min(K.length-1,j+1);if(G>j){const V=K[G];V&&(W.scrollTop=V.offsetTop+V.offsetHeight-W.clientHeight+$)}else W.scrollTop=W.scrollHeight-W.clientHeight}}T.start(40,M)}T.start(40,M)},onMouseLeave(){T.clear()}},o]});return E||s?D:null}),NCe=C.forwardRef(function(t,n){return p.jsx(Gie,{...t,ref:n,direction:"down"})}),ICe=C.forwardRef(function(t,n){return p.jsx(Gie,{...t,ref:n,direction:"up"})}),mi=pCe;function gi({className:e,...t}){return p.jsx(bCe,{"data-slot":"select-value",className:ze("flex flex-1 text-left",e),...t})}function bi({className:e,size:t="default",children:n,...r}){return p.jsxs(mCe,{"data-slot":"select-trigger","data-size":t,className:ze("border-input data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border px-2 py-1.5 text-xs/relaxed transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n,p.jsx(vCe,{render:p.jsx(te,{icon:vie,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function vi({className:e,children:t,side:n="bottom",sideOffset:r=4,align:i="center",alignOffset:a=0,alignItemWithTrigger:s=!0,...o}){return p.jsx(_Ce,{children:p.jsx(ECe,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:s,className:"isolate z-50",children:p.jsxs(CCe,{"data-slot":"select-content",className:ze("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-32 rounded-lg shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto",e),...o,children:[p.jsx(DCe,{}),p.jsx(TCe,{children:t}),p.jsx(LCe,{})]})})})}function gn({className:e,children:t,...n}){return p.jsxs(ACe,{"data-slot":"select-item",className:ze("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[p.jsx(RCe,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),p.jsx(kCe,{render:p.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:p.jsx(te,{icon:di,strokeWidth:2,className:"pointer-events-none"})})]})}function DCe({className:e,...t}){return p.jsx(ICe,{"data-slot":"select-scroll-up-button",className:ze("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 top-0 w-full",e),...t,children:p.jsx(te,{icon:xj,strokeWidth:2})})}function LCe({className:e,...t}){return p.jsx(NCe,{"data-slot":"select-scroll-down-button",className:ze("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 bottom-0 w-full",e),...t,children:p.jsx(te,{icon:Mg,strokeWidth:2})})}const qie=C.createContext(void 0);function Pj(){const e=C.useContext(qie);if(e===void 0)throw new Error(hn(64));return e}let PCe=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const Mj={tabActivationDirection:e=>({[PCe.activationDirection]:e})},MCe=C.forwardRef(function(t,n){const{className:r,defaultValue:i=0,onValueChange:a,orientation:s="horizontal",render:o,value:l,...u}=t,d=_c(),c=Object.hasOwn(t,"defaultValue"),m=C.useRef([]),[g,_]=C.useState(()=>new Map),[x,b]=Ls({controlled:l,default:i,name:"Tabs",state:"value"}),v=l!==void 0,[y,E]=C.useState(()=>new Map),[T,w]=C.useState("none"),A=tt((q,K)=>{a?.(q,K),!K.isCanceled&&(b(q),w(K.activationDirection))}),O=tt((q,K)=>{_($=>{if($.get(q)===K)return $;const j=new Map($);return j.set(q,K),j})}),R=tt((q,K)=>{_($=>{if(!$.has(q)||$.get(q)!==K)return $;const j=new Map($);return j.delete(q),j})}),N=C.useCallback(q=>g.get(q),[g]),D=C.useCallback(q=>{for(const K of y.values())if(q===K?.value)return K?.id},[y]),L=C.useCallback(q=>{if(q===void 0)return null;for(const[K,$]of y.entries())if($!=null&&q===($.value??$.index))return K;return null},[y]),U=C.useMemo(()=>({direction:d,getTabElementBySelectedValue:L,getTabIdByPanelValue:D,getTabPanelIdByValue:N,onValueChange:A,orientation:s,registerMountedTabPanel:O,setTabMap:E,unregisterMountedTabPanel:R,tabActivationDirection:T,value:x}),[d,L,D,N,A,s,O,E,R,T,x]),M=C.useMemo(()=>{for(const q of y.values())if(q!=null&&q.value===x)return q},[y,x]),W=C.useMemo(()=>{for(const q of y.values())if(q!=null&&!q.disabled)return q.value},[y]);it(()=>{if(v||y.size===0)return;const q=M?.disabled,K=M==null&&x!==null;if(c&&q&&x===i||!q&&!K)return;const j=W??null;x!==j&&(b(j),w("none"))},[i,W,c,v,M,w,b,y,x]);const H=kt("div",t,{state:{orientation:s,tabActivationDirection:T},ref:n,props:u,stateAttributesMapping:Mj});return p.jsx(qie.Provider,{value:U,children:p.jsx(e1,{elementsRef:m,children:H})})}),Kie=C.createContext(void 0);function jCe(){const e=C.useContext(Kie);if(e===void 0)throw new Error(hn(65));return e}const FCe=C.forwardRef(function(t,n){const{className:r,disabled:i=!1,render:a,value:s,id:o,nativeButton:l=!0,...u}=t,{value:d,getTabPanelIdByValue:c,orientation:m}=Pj(),{activateOnFocus:g,highlightedTabIndex:_,onTabActivation:x,setHighlightedTabIndex:b,tabsListElement:v}=jCe(),y=wi(o),E=C.useMemo(()=>({disabled:i,id:y,value:s}),[i,y,s]),{compositeProps:T,compositeRef:w,index:A}=Xre({metadata:E}),O=s===d,R=C.useRef(!1);it(()=>{if(R.current){R.current=!1;return}if(!(O&&A>-1&&_!==A))return;const $=v;if($!=null){const j=co(ra($));if(j&&Pt($,j))return}i||b(A)},[O,A,_,b,i,v]);const{getButtonProps:N,buttonRef:D}=za({disabled:i,native:l,focusableWhenDisabled:!0}),L=c(s),U=C.useRef(!1),M=C.useRef(!1);function W($){O||i||x(s,ft(qr,$.nativeEvent,void 0,{activationDirection:"none"}))}function z($){O||(A>-1&&!i&&b(A),!i&&g&&(!U.current||U.current&&M.current)&&x(s,ft(qr,$.nativeEvent,void 0,{activationDirection:"none"})))}function H($){if(O||i)return;U.current=!0;function j(){U.current=!1,M.current=!1}(!$.button||$.button===0)&&(M.current=!0,ra($.currentTarget).addEventListener("pointerup",j,{once:!0}))}const q=C.useMemo(()=>({disabled:i,active:O,orientation:m}),[i,O,m]);return kt("button",t,{state:q,ref:[n,D,w],props:[T,{role:"tab","aria-controls":L,"aria-selected":O,id:y,onClick:W,onFocus:z,onPointerDown:H,[Wre]:O?"":void 0,onKeyDownCapture(){R.current=!0}},u,N]})});let BCe=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const UCe=C.forwardRef(function(t,n){const{className:r,value:i,render:a,keepMounted:s=!1,...o}=t,{value:l,getTabIdByPanelValue:u,orientation:d,tabActivationDirection:c,registerMountedTabPanel:m,unregisterMountedTabPanel:g}=Pj(),_=wi(),x=C.useMemo(()=>({id:_,value:i}),[_,i]),{ref:b,index:v}=Lg({metadata:x}),y=i!==l,E=u(i),T=C.useMemo(()=>({hidden:y,orientation:d,tabActivationDirection:c}),[y,d,c]),w=kt("div",t,{state:T,ref:[n,b],props:[{"aria-labelledby":E,hidden:y,id:_??void 0,role:"tabpanel",tabIndex:y?-1:0,[BCe.index]:v},o],stateAttributesMapping:Mj});return it(()=>{if(!(y&&!s)&&_!=null)return m(i,_),()=>{g(i,_)}},[y,s,i,_,m,g]),!y||s?w:null}),$Ce=C.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:i,loopFocus:a=!0,render:s,...o}=t,{getTabElementBySelectedValue:l,onValueChange:u,orientation:d,value:c,setTabMap:m,tabActivationDirection:g}=Pj(),[_,x]=C.useState(0),[b,v]=C.useState(null),y=zCe(c,d,b,l),E=tt((O,R)=>{if(O!==c){const N=y(O);R.activationDirection=N,u(O,R)}}),T=C.useMemo(()=>({orientation:d,tabActivationDirection:g}),[d,g]),w={"aria-orientation":d==="vertical"?"vertical":void 0,role:"tablist"},A=C.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:_,onTabActivation:E,setHighlightedTabIndex:x,tabsListElement:b,value:c}),[r,_,E,x,b,c]);return p.jsx(Kie.Provider,{value:A,children:p.jsx(yC,{render:s,className:i,state:T,refs:[n,v],props:[w,o],stateAttributesMapping:Mj,highlightedIndex:_,enableHomeAndEndKeys:!0,loopFocus:a,orientation:d,onHighlightedIndexChange:x,onMapChange:m,disabledIndices:La})})});function LV(e,t){const{left:n,top:r}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect(),s=n-i,o=r-a;return{left:s,top:o}}function zCe(e,t,n,r){const[i,a]=C.useState(null);return it(()=>{if(e==null||n==null){a(null);return}const s=r(e);if(s==null){a(null);return}const{left:o,top:l}=LV(s,n);a(t==="horizontal"?o:l)},[t,r,n,e]),C.useCallback(s=>{if(s===e)return"none";if(s==null)return a(null),"none";if(s!=null&&n!=null){const o=r(s);if(o!=null){const{left:l,top:u}=LV(o,n);if(i==null)return a(t==="horizontal"?l:u),"none";if(t==="horizontal"){if(l<i)return a(l),"left";if(l>i)return a(l),"right"}else{if(u<i)return a(u),"up";if(u>i)return a(u),"down"}}}return"none"},[r,t,i,n,e])}function Ko({className:e,orientation:t="horizontal",...n}){return p.jsx(MCe,{"data-slot":"tabs","data-orientation":t,className:ze("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",e),...n})}const HCe=$d("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Yo({className:e,variant:t="default",...n}){return p.jsx($Ce,{"data-slot":"tabs-list","data-variant":t,className:ze(HCe({variant:t}),e),...n})}function Vn({className:e,...t}){return p.jsx(FCe,{"data-slot":"tabs-trigger",className:ze("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function Kn({className:e,...t}){return p.jsx(UCe,{"data-slot":"tabs-content",className:ze("text-xs/relaxed flex-1 min-h-0 outline-none",e),...t})}function VCe(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,actionsRef:s,handle:o,triggerId:l,defaultTriggerId:u=null}=e,d=xc(),c=!!d,m=Ui(()=>o?.store??new Oie({open:n??r,activeTriggerId:l!==void 0?l:u,modal:!0,disablePointerDismissal:!0,nested:c,role:"alertdialog"})).current;m.useControlledProp("open",n,r),m.useControlledProp("activeTriggerId",l,u),m.useSyncedValue("nested",c),m.useContextCallback("onOpenChange",i),m.useContextCallback("onOpenChangeComplete",a);const g=m.useState("payload");kie({store:m,actionsRef:s,parentContext:d?.store.context});const _=C.useMemo(()=>({store:m}),[m]);return p.jsx(Oj.Provider,{value:_,children:typeof t=="function"?t({payload:g}):t})}const Yie=C.createContext(void 0),Xie=C.createContext(void 0),Zie=C.createContext(void 0),Qie=C.createContext("");function Ec(){const e=C.useContext(Yie);if(!e)throw new Error(hn(22));return e}function IC(){const e=C.useContext(Xie);if(!e)throw new Error(hn(23));return e}function zp(){const e=C.useContext(Zie);if(!e)throw new Error(hn(24));return e}function jj(){return C.useContext(Qie)}const xt={id:qe(e=>e.id),query:qe(e=>e.query),items:qe(e=>e.items),selectedValue:qe(e=>e.selectedValue),open:qe(e=>e.open),mounted:qe(e=>e.mounted),forceMounted:qe(e=>e.forceMounted),inline:qe(e=>e.inline),activeIndex:qe(e=>e.activeIndex),selectedIndex:qe(e=>e.selectedIndex),isActive:qe((e,t)=>e.activeIndex===t),isSelected:qe((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(i=>nc(i,t,n)):nc(r,t,n)}),transitionStatus:qe(e=>e.transitionStatus),popupProps:qe(e=>e.popupProps),inputProps:qe(e=>e.inputProps),triggerProps:qe(e=>e.triggerProps),getItemProps:qe(e=>e.getItemProps),positionerElement:qe(e=>e.positionerElement),listElement:qe(e=>e.listElement),triggerElement:qe(e=>e.triggerElement),inputElement:qe(e=>e.inputElement),popupSide:qe(e=>e.popupSide),openMethod:qe(e=>e.openMethod),inputInsidePopup:qe(e=>e.inputInsidePopup),selectionMode:qe(e=>e.selectionMode),listRef:qe(e=>e.listRef),labelsRef:qe(e=>e.labelsRef),popupRef:qe(e=>e.popupRef),emptyRef:qe(e=>e.emptyRef),inputRef:qe(e=>e.inputRef),keyboardActiveRef:qe(e=>e.keyboardActiveRef),chipsContainerRef:qe(e=>e.chipsContainerRef),clearRef:qe(e=>e.clearRef),valuesRef:qe(e=>e.valuesRef),allValuesRef:qe(e=>e.allValuesRef),name:qe(e=>e.name),disabled:qe(e=>e.disabled),readOnly:qe(e=>e.readOnly),required:qe(e=>e.required),grid:qe(e=>e.grid),isGrouped:qe(e=>e.isGrouped),virtualized:qe(e=>e.virtualized),onOpenChangeComplete:qe(e=>e.onOpenChangeComplete),openOnInputClick:qe(e=>e.openOnInputClick),itemToStringLabel:qe(e=>e.itemToStringLabel),isItemEqualToValue:qe(e=>e.isItemEqualToValue),modal:qe(e=>e.modal),autoHighlight:qe(e=>e.autoHighlight),submitOnItemClick:qe(e=>e.submitOnItemClick)};function WCe(e,t){return(n,r)=>{if(n==null)return!1;const i=fi(n,t);return e.contains(i,r)}}function GCe(e,t,n){return(r,i)=>{if(r==null)return!1;if(!i)return!0;const a=fi(r,t),s=n!=null?fi(n,t):"";return s&&e.contains(s,i)&&s.length===i.length?!0:e.contains(a,i)}}const PV=new Map;function Jie(e){return Array.isArray(e)?e.map(t=>Jie(t)).join(","):e==null?"":String(e)}function qCe(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${Jie(e.locale)}|${JSON.stringify(t)}`,r=PV.get(n);if(r)return r;const i=new Intl.Collator(e.locale,t),a={contains(s,o,l){if(!o)return!0;const u=fi(s,l);for(let d=0;d<=u.length-o.length;d+=1)if(i.compare(u.slice(d,d+o.length),o)===0)return!0;return!1},startsWith(s,o,l){if(!o)return!0;const u=fi(s,l);return i.compare(u.slice(0,o.length),o)===0},endsWith(s,o,l){if(!o)return!0;const u=fi(s,l),d=o.length;return u.length>=d&&i.compare(u.slice(u.length-d),o)===0}};return PV.set(n,a),a}const KCe=qCe,eae=Symbol("none"),wf={value:eae,index:-1};function YCe(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:s,inputValue:o,selectionMode:l="none",onItemHighlighted:u,name:d,disabled:c=!1,readOnly:m=!1,required:g=!1,inputRef:_,grid:x=!1,items:b,filteredItems:v,filter:y,openOnInputClick:E=!0,autoHighlight:T=!1,keepHighlight:w=!1,highlightItemOnHover:A=!0,itemToStringLabel:O,itemToStringValue:R,isItemEqualToValue:N=Bie,virtualized:D=!1,inline:L=!1,fillInputOnItemPress:U=!0,modal:M=!1,limit:W=-1,autoComplete:z="list",locale:H,submitOnItemClick:q=!1}=e,{clearErrors:K}=a1(),{setDirty:$,validityData:j,shouldValidateOnChange:F,setFilled:G,name:V,disabled:J,validation:ae}=xo(),se=NC({id:t}),Z=KCe({locale:H}),[Y,Q]=C.useState(!1),[re,oe]=C.useState(null),ee=C.useRef([]),ve=C.useRef([]),Ee=C.useRef(null),me=C.useRef(null),Se=C.useRef(null),xe=C.useRef(!0),Ye=C.useRef(!1),Ue=C.useRef(null),je=C.useRef(null),we=C.useRef(null),Ne=C.useRef(wf),_e=C.useRef(null),pe=C.useRef([]),Ae=C.useRef([]),he=J||c,Oe=V??d,ge=l==="multiple",Ie=l==="single",We=o!==void 0||s!==void 0,mt=b!==void 0,lt=v!==void 0;let dt;T==="always"?dt="always":dt=T?"input-change":!1;const[$e,ht]=Ls({controlled:i,default:ge?r??La:r,name:"Combobox",state:"selectedValue"}),Re=C.useMemo(()=>y===null?()=>!0:y!==void 0?y:Ie&&!Y?GCe(Z,O,$e):WCe(Z,O),[y,Ie,$e,Y,Z,O]),de=Ui(()=>We?s??"":Ie?fi($e,O):"").current,[Te,Ke]=Ls({controlled:o,default:de,name:"Combobox",state:"inputValue"}),[st,Bt]=Ls({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),zt=$ie(b),Mt=re??(Te===""?"":String(Te).trim()),bt=Ie?fi($e,O):"",en=Ie&&!Y&&Mt!==""&&bt!==""&&bt.length===Mt.length&&Z.contains(bt,Mt),Wt=en?"":Mt,St=mt&&lt&&en,Xt=C.useMemo(()=>b?zt?b.flatMap(vt=>vt.items):b:La,[b,zt]),De=C.useMemo(()=>{if(v&&!St)return v;if(!b)return La;if(zt){const Dt=b,tn=[];let Yn=0;for(const br of Dt){if(W>-1&&Yn>=W)break;const Fr=Wt===""?br.items:br.items.filter(Io=>Re(Io,Wt,O));if(Fr.length===0)continue;const Ro=W>-1?W-Yn:1/0,No=Fr.slice(0,Ro);if(No.length>0){const Io={...br,items:No};tn.push(Io),Yn+=No.length}}return tn}if(Wt==="")return W>-1?Xt.slice(0,W):Xt;const vt=[];for(const Dt of Xt){if(W>-1&&vt.length>=W)break;Re(Dt,Wt,O)&&vt.push(Dt)}return vt},[v,St,b,zt,Wt,W,Re,O,Xt]),yt=C.useMemo(()=>zt?De.flatMap(Dt=>Dt.items):De,[De,zt]),nt=Ui(()=>new ip({id:se,selectedValue:$e,open:st,filter:Re,query:Mt,items:b,selectionMode:l,listRef:ee,labelsRef:ve,popupRef:Ee,emptyRef:Se,inputRef:me,keyboardActiveRef:xe,chipsContainerRef:Ue,clearRef:je,valuesRef:pe,allValuesRef:Ae,selectionEventRef:we,name:Oe,disabled:he,readOnly:m,required:g,grid:x,isGrouped:zt,virtualized:D,openOnInputClick:E,itemToStringLabel:O,isItemEqualToValue:N,modal:M,autoHighlight:dt,submitOnItemClick:q,hasInputValue:We,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:L,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Dr,setOpen:Dr,setInputValue:Dr,setSelectedValue:Dr,setIndices:Dr,onItemHighlighted:Dr,handleSelection:Dr,getItemProps:()=>pr,forceMount:Dr,requestSubmit:Dr})).current,_n=l==="none"?Te:$e,Bn=C.useMemo(()=>l==="none"?_n:Array.isArray($e)?$e.map(vt=>Ho(vt,R)):Ho($e,R),[_n,R,l,$e]),ar=tt(u),sr=tt(n),ca=et(nt,xt.activeIndex),Rr=et(nt,xt.selectedIndex),Hr=et(nt,xt.positionerElement),gr=et(nt,xt.listElement),Nr=et(nt,xt.triggerElement),Va=et(nt,xt.inputElement),da=et(nt,xt.inline),hs=et(nt,xt.inputInsidePopup),oh=Er(Nr),{mounted:pu,setMounted:yl,transitionStatus:ko}=ul(st),{openMethod:zs,triggerProps:Vi,reset:_l}=OC(st);s1({id:se,name:Oe,commit:ae.commit,value:_n,controlRef:hs?oh:me,getValue:()=>Bn});const Ai=tt(()=>{b?ve.current=yt.map(vt=>fi(vt,O)):nt.set("forceMounted",!0)}),Ir=C.useRef($e);it(()=>{$e!==Ir.current&&Ai()},[Ai,$e]);const Vr=tt(vt=>{nt.update(vt);const Dt=vt.type||"none";if(vt.activeIndex!==void 0)if(vt.activeIndex===null)Ne.current!==wf&&(Ne.current=wf,ar(void 0,fv(Dt,void 0,{index:-1})));else{const tn=pe.current[vt.activeIndex];Ne.current={value:tn,index:vt.activeIndex},ar(tn,fv(Dt,void 0,{index:vt.activeIndex}))}}),ki=tt((vt,Dt)=>{if(Ye.current=Dt.reason===ud,e.onInputValueChange?.(vt,Dt),!Dt.isCanceled){if(Dt.reason===Uf){const tn=vt.trim()!=="";tn&&Q(!0),_e.current={hasQuery:tn},tn&&dt&&nt.state.activeIndex==null&&nt.set("activeIndex",0)}Ke(vt)}}),Oi=tt((vt,Dt)=>{st!==vt&&(Dt.reason==="escape-key"&&mt&&yt.length===0&&!nt.state.emptyRef.current&&Dt.allowPropagation(),e.onOpenChange?.(vt,Dt),!Dt.isCanceled&&(!vt&&Y&&(Ie?(oe(Mt),Mt===""&&Q(!1)):ge&&(da||hs?Vr({activeIndex:null}):oe(Mt),ki("",ft(ud,Dt.event)))),Bt(vt)))}),Wa=tt((vt,Dt)=>{if(a?.(vt,Dt),Dt.isCanceled)return;ht(vt),(l==="none"&&Ee.current&&U||Ie&&!nt.state.inputInsidePopup)&&ki(fi(vt,O),ft(Dt.reason,Dt.event)),Ie&&vt!=null&&Dt.reason!==Uf&&Y&&oe(Mt)}),Nc=tt((vt,Dt)=>{let tn=Dt;if(tn===void 0){if(ca===null)return;tn=pe.current[ca]}const Yn=Lr(vt),br=we.current??vt;we.current=null;const Fr=ft(np,br),Ro=Yn?.closest("a")?.getAttribute("href");if(Ro){Ro.startsWith("#")&&Oi(!1,Fr);return}if(ge){const No=Array.isArray($e)?$e:[],ha=Hf(No,tn,nt.state.isItemEqualToValue)?Uie(No,tn,nt.state.isItemEqualToValue):[...No,tn];if(Wa(ha,Fr),!(me.current?me.current.value.trim()!=="":!1))return;nt.state.inputInsidePopup?ki("",ft(ud,Fr.event)):Oi(!1,Fr)}else Wa(tn,Fr),Oi(!1,Fr)}),hu=tt(()=>{if(!nt.state.submitOnItemClick)return;const vt=nt.state.inputElement?.form;vt&&typeof vt.requestSubmit=="function"&&vt.requestSubmit()}),xl=tt(()=>{if(yl(!1),sr?.(!1),Q(!1),_l(),oe(null),Vr(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),ge&&me.current&&me.current.value!==""&&!Ye.current&&ki("",ft(ud)),Ie)if(nt.state.inputInsidePopup)me.current&&me.current.value!==""&&ki("",ft(ud));else{const vt=fi($e,O);me.current&&me.current.value!==vt&&ki(vt,ft(vt===""?ud:qr))}}),rf=C.useMemo(()=>da&&Hr?{current:Hr.closest('[role="dialog"]')}:Ee,[da,Hr]);ia({enabled:!e.actionsRef,open:st,ref:rf,onComplete(){st||xl()}}),C.useImperativeHandle(e.actionsRef,()=>({unmount:xl}),[xl]),it(function(){if(st||l==="none")return;const Dt=b?Xt:Ae.current;if(ge){const tn=Array.isArray($e)?$e:[],Yn=tn[tn.length-1],br=Bm(Dt,Yn,N);Vr({selectedIndex:br===-1?null:br})}else{const tn=Bm(Dt,$e,N);Vr({selectedIndex:tn===-1?null:tn})}},[st,$e,b,l,Xt,ge,N,Vr]),it(()=>{b&&(pe.current=yt,ee.current.length=yt.length)},[b,yt]),it(()=>{const vt=_e.current;if(vt&&(vt.hasQuery?dt&&nt.set("activeIndex",0):dt==="always"&&nt.set("activeIndex",0),_e.current=null),!st&&!da)return;const tn=mt||lt?yt:pe.current,Yn=nt.state.activeIndex;if(Yn==null){if(dt==="always"&&tn.length>0){nt.set("activeIndex",0);return}Ne.current!==wf&&(Ne.current=wf,nt.state.onItemHighlighted(void 0,fv(qr,void 0,{index:-1})));return}if(Yn>=tn.length){Ne.current!==wf&&(Ne.current=wf,nt.state.onItemHighlighted(void 0,fv(qr,void 0,{index:-1}))),nt.set("activeIndex",null);return}const br=tn[Yn],Fr=Ne.current.value,Ro=Fr!==eae&&nt.state.isItemEqualToValue(br,Fr);(Ne.current.index!==Yn||!Ro)&&(Ne.current={value:br,index:Yn},nt.state.onItemHighlighted(br,fv(qr,void 0,{index:Yn})))},[ca,dt,lt,mt,yt,da,st,nt]),it(()=>{if(!b||l==="none")return;const vt=Xt;if(ge){const Yn=Array.isArray($e)?$e:La,br=Yn.filter(Fr=>Hf(vt,Fr,nt.state.isItemEqualToValue));br.length!==Yn.length&&ht(br);return}if($e==null?!0:Hf(vt,$e,nt.state.isItemEqualToValue))return;let tn=null;if(r!=null&&Hf(vt,r,nt.state.isItemEqualToValue)&&(tn=r),ht(tn),!nt.state.inputInsidePopup){const Yn=fi(tn,O);me.current&&me.current.value!==Yn&&ki(Yn,ft(qr))}},[b,Xt,ge,l,$e,r,ht,O,nt,ki]),it(()=>{if(l==="none"){G(String(Te)!=="");return}G(ge?Array.isArray($e)&&$e.length>0:$e!=null)},[G,l,Te,$e,ge]),C.useEffect(()=>{mt&&dt&&yt.length===0&&Vr({activeIndex:null})},[mt,dt,yt.length,Vr]),Vf(Mt,()=>{!st||Mt===""||Mt===String(de)||Q(!0)}),Vf($e,()=>{if(l!=="none"&&(K(Oe),$($e!==j.initialValue),F()?ae.commit($e):ae.commit($e,!0),ge&&nt.state.selectedIndex!==null&&(!Array.isArray($e)||$e.length===0)&&Vr({activeIndex:null,selectedIndex:null}),Ie&&!We&&!hs)){const vt=fi($e,O);Te!==vt&&ki(vt,ft(qr))}}),Vf(Te,()=>{l==="none"&&(K(Oe),$(Te!==j.initialValue),F()?ae.commit(Te):ae.commit(Te,!0))}),Vf(b,()=>{if(!Ie||We||hs||Y)return;const vt=fi($e,O);Te!==vt&&ki(vt,ft(qr))});const Hs=gC({open:da?!0:st,onOpenChange:Oi,elements:{reference:hs?Nr:Va,floating:Hr}});let Vs,fa;da||(Vs=x?"grid":"listbox",fa=st?"true":"false");const Wi=C.useMemo(()=>{const vt=Va?.tagName==="INPUT",Dt=vt||st,tn=vt?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return Dt&&(tn.role="combobox",tn["aria-expanded"]=fa,tn["aria-haspopup"]=Vs,tn["aria-controls"]=st?gr?.id:void 0,tn["aria-autocomplete"]=z),{reference:tn,floating:{role:"presentation"}}},[Va,st,fa,Vs,gr?.id,z]),mu=Ng(Hs,{enabled:!m&&!he&&E,event:"mousedown-only",toggle:!1,touchOpenDelay:hs?0:50}),Zt=Ig(Hs,{enabled:!m&&!he&&!da,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:da?!0:void 0,outsidePress(vt){const Dt=Lr(vt);return!Pt(Nr,Dt)&&!Pt(je.current,Dt)&&!Pt(Ue.current,Dt)}}),Ic=mj(Hs,{enabled:!m&&!he,id:se,listRef:ee,activeIndex:ca,selectedIndex:Rr,virtual:!0,loopFocus:!0,allowEscape:!dt,focusItemOnOpen:Y||l==="none"&&!dt?!1:"auto",focusItemOnHover:A,resetOnPointerLeave:!w,cols:x?2:1,orientation:x?"horizontal":void 0,disabledIndices:La,onNavigate(vt,Dt){!Dt&&!st||ko==="ending"||Vr(Dt?{activeIndex:vt,type:xe.current?"keyboard":"pointer"}:{activeIndex:vt})}}),{getReferenceProps:gu,getFloatingProps:Oo,getItemProps:Dc}=Vd([Wi,mu,Zt,Ic]);Pie(()=>{nt.update({inline:L,popupProps:Oo(),inputProps:gu(),triggerProps:Vi,getItemProps:Dc,setOpen:Oi,setInputValue:ki,setSelectedValue:Wa,setIndices:Vr,onItemHighlighted:ar,handleSelection:Nc,forceMount:Ai,requestSubmit:hu})}),it(()=>{nt.update({id:se,selectedValue:$e,open:st,mounted:pu,transitionStatus:ko,items:b,inline:L,popupProps:Oo(),inputProps:gu(),triggerProps:Vi,openMethod:zs,getItemProps:Dc,selectionMode:l,name:Oe,disabled:he,readOnly:m,required:g,grid:x,isGrouped:zt,virtualized:D,onOpenChangeComplete:sr,openOnInputClick:E,itemToStringLabel:O,modal:M,autoHighlight:dt,isItemEqualToValue:N,submitOnItemClick:q,hasInputValue:We,requestSubmit:hu})},[nt,se,$e,st,pu,ko,b,Oo,gu,Dc,zs,Vi,l,Oe,he,m,g,ae,x,zt,D,sr,E,O,M,N,q,We,L,hu,dt]);const pa=_o(_,ae.inputRef),af=C.useMemo(()=>({query:Mt,filteredItems:De,flatFilteredItems:yt}),[Mt,De,yt]),lh=C.useMemo(()=>Array.isArray(_n)?"":Ho(_n,R),[_n,R]),sf=ge&&Array.isArray($e)&&$e.length>0,El=C.useMemo(()=>!ge||!Array.isArray($e)||!Oe?null:$e.map(vt=>{const Dt=Ho(vt,R);return p.jsx("input",{type:"hidden",name:Oe,value:Dt},Dt)}),[ge,$e,Oe,R]),uh=p.jsxs(C.Fragment,{children:[e.children,p.jsx("input",{...ae.getInputValidationProps({onFocus(){if(hs){Nr?.focus();return}(me.current||Nr)?.focus()},onChange(vt){if(vt.nativeEvent.defaultPrevented)return;const Dt=vt.target.value,tn=ft(Uf,vt.nativeEvent);function Yn(){if(ge)return;if(l==="none"){$(Dt!==j.initialValue),ki(Dt,tn),F()&&ae.commit(Dt);return}const br=pe.current.find(Fr=>Ho(Fr,R).toLowerCase()===Dt.toLowerCase());br!=null&&($(br!==j.initialValue),Wa?.(br,tn),F()&&ae.commit(br))}b?Yn():(Ai(),queueMicrotask(Yn))}}),id:se,name:ge||l==="none"?void 0:Oe,disabled:he,required:g&&!sf,readOnly:m,value:lh,ref:pa,style:Rg,tabIndex:-1,"aria-hidden":!0}),El]});return p.jsx(Yie.Provider,{value:nt,children:p.jsx(Xie.Provider,{value:Hs,children:p.jsx(Zie.Provider,{value:af,children:p.jsx(Qie.Provider,{value:Te,children:uh})})})})}const Ax=2,XCe={...Pm,...$p},ZCe=C.forwardRef(function(t,n){const{render:r,className:i,nativeButton:a=!0,disabled:s=!1,...o}=t,{state:l,disabled:u,setTouched:d,setFocused:c,validationMode:m,validation:g}=xo(),{labelId:_}=Wd(),x=Ec(),b=et(x,xt.selectionMode),v=et(x,xt.disabled),y=et(x,xt.readOnly),E=et(x,xt.listElement),T=et(x,xt.triggerProps),w=et(x,xt.triggerElement),A=et(x,xt.inputInsidePopup),O=et(x,xt.open),R=et(x,xt.selectedValue),N=et(x,xt.activeIndex),D=et(x,xt.selectedIndex),L=IC(),U=jj(),M=Wn(),W=u||v||s,z=C.useRef("");function H(ae){z.current=ae.pointerType}const q=L.select("domReferenceElement");C.useEffect(()=>{A&&w&&w!==q&&L.set("domReferenceElement",w)},[w,q,L,A]);const{reference:K}=gj(L,{enabled:!O&&!y&&!v&&b==="single",listRef:x.state.labelsRef,activeIndex:N,selectedIndex:D,onMatch(ae){const se=x.state.valuesRef.current[ae];se!==void 0&&x.state.setSelectedValue(se,ft("none"))}}),{reference:$}=Ng(L,{enabled:!y&&!v,event:"mousedown"}),{buttonRef:j,getButtonProps:F}=za({native:a,disabled:W}),G=C.useMemo(()=>({...l,open:O,disabled:W}),[l,O,W]),V=tt(ae=>{x.set("triggerElement",ae)});return kt("button",t,{ref:[n,j,V],state:G,props:[T,$,K,{tabIndex:A?0:-1,disabled:W,role:A?"combobox":void 0,"aria-expanded":O?"true":"false","aria-haspopup":A?"dialog":"listbox","aria-controls":O?E?.id:void 0,"aria-readonly":y||void 0,"aria-labelledby":_,onPointerDown:H,onPointerEnter:H,onFocus(){c(!0),!(W||y)&&M.start(0,x.state.forceMount)},onBlur(){if(d(!0),c(!1),m==="onBlur"){const ae=b==="none"?U:R;g.commit(ae)}},onMouseDown(ae){if(W||y||(A||L.set("domReferenceElement",ae.currentTarget),x.state.forceMount(),z.current!=="touch"&&(x.state.inputRef.current?.focus(),A||ae.preventDefault()),O))return;const se=ra(ae.currentTarget);function Z(Y){if(!w)return;const Q=Lr(Y),re=x.state.positionerElement,oe=x.state.listElement;if(Pt(w,Q)||Pt(re,Q)||Pt(oe,Q)||Q===w)return;const ee=Nj(w),ve=Y.clientX>=ee.left-Ax&&Y.clientX<=ee.right+Ax,Ee=Y.clientY>=ee.top-Ax&&Y.clientY<=ee.bottom+Ax;ve&&Ee||x.state.setOpen(!1,ft("cancel-open",Y))}A&&se.addEventListener("mouseup",Z,{once:!0})},onKeyDown(ae){W||y||(ae.key==="ArrowDown"||ae.key==="ArrowUp")&&(zr(ae),x.state.setOpen(!0,ft(gm,ae.nativeEvent)),x.state.inputRef.current?.focus())}},g?g.getValidationProps(o):o,F],stateAttributesMapping:XCe})}),QCe=C.createContext(void 0);function JCe(){return C.useContext(QCe)}const tae=C.createContext(void 0);function Fj(e){const t=C.useContext(tae);if(t===void 0&&!e)throw new Error(hn(21));return t}const eTe={...Pm,...$p,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},tTe=C.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,id:s,...o}=t,{state:l,disabled:u,setTouched:d,setFocused:c,validationMode:m,validation:g}=xo(),{labelId:_}=Wd(),x=JCe(),v=!!Fj(!0),y=Ec(),{filteredItems:E}=zp(),T=jj(),w=wi(s),A=_c(),O=et(y,xt.disabled),R=et(y,xt.readOnly),N=et(y,xt.name),D=et(y,xt.selectionMode),L=et(y,xt.autoHighlight),U=et(y,xt.inputProps),M=et(y,xt.triggerProps),W=et(y,xt.open),z=et(y,xt.mounted),H=et(y,xt.selectedValue),q=et(y,xt.popupSide),K=et(y,xt.positionerElement),$=!!L,j=z&&K?q:null,F=u||O||a,G=E.length===0,[V,J]=C.useState(null),ae=C.useRef(!1),se=tt(re=>{const oe=v||y.state.inline;oe&&!y.state.hasInputValue&&y.state.setInputValue("",ft(qr)),y.update({inputElement:re,inputInsidePopup:oe})}),Z=C.useMemo(()=>({...l,open:W,disabled:F,readOnly:R,popupSide:j,listEmpty:G}),[l,W,F,R,j,G]);function Y(re){if(!x)return;let oe;const{highlightedChipIndex:ee}=x;if(ee!==void 0){if(re.key==="ArrowLeft")re.preventDefault(),ee>0?oe=ee-1:oe=void 0;else if(re.key==="ArrowRight")re.preventDefault(),ee<H.length-1?oe=ee+1:oe=void 0;else if(re.key==="Backspace"||re.key==="Delete"){re.preventDefault();const ve=ee>=H.length-1?H.length-2:ee;oe=ve>=0?ve:void 0,y.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return oe}return re.key==="ArrowLeft"&&(re.currentTarget.selectionStart??0)===0&&H.length>0?(re.preventDefault(),oe=Math.max(H.length-1,0)):re.key==="Backspace"&&re.currentTarget.value===""&&H.length>0&&(y.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),re.preventDefault()),oe}return kt("input",t,{state:Z,ref:[n,y.state.inputRef,se],props:[U,M,{type:"text",value:t.value??V??T,"aria-readonly":R||void 0,"aria-labelledby":_,disabled:F,readOnly:R,...D==="none"&&N&&{name:N},id:w,onFocus(){c(!0)},onBlur(){if(d(!0),c(!1),m==="onBlur"){const re=D==="none"?T:H;g.commit(re)}},onCompositionStart(re){JE||(ae.current=!0,J(re.currentTarget.value))},onCompositionEnd(re){ae.current=!1;const oe=re.currentTarget.value;J(null),y.state.setInputValue(oe,ft(Uf,re.nativeEvent))},onChange(re){if(ae.current){const Ee=re.currentTarget.value;J(Ee),Ee===""&&!y.state.openOnInputClick&&!y.state.inputInsidePopup&&y.state.setOpen(!1,ft(ud,re.nativeEvent));const me=Ee.trim(),Se=$&&me!=="";!R&&!F&&me!==""&&(y.state.setOpen(!0,ft(Uf,re.nativeEvent)),$||y.state.setIndices({activeIndex:null,selectedIndex:null,type:y.state.keyboardActiveRef.current?"keyboard":"pointer"})),W&&y.state.activeIndex!==null&&!Se&&y.state.setIndices({activeIndex:null,selectedIndex:null,type:y.state.keyboardActiveRef.current?"keyboard":"pointer"});return}y.state.setInputValue(re.currentTarget.value,ft(Uf,re.nativeEvent));const oe=re.currentTarget.value==="",ee=ft(ud,re.nativeEvent);oe&&!y.state.inputInsidePopup&&(D==="single"&&y.state.setSelectedValue(null,ee),y.state.openOnInputClick||y.state.setOpen(!1,ee));const ve=re.currentTarget.value.trim();!R&&!F&&ve!==""&&(y.state.setOpen(!0,ft(Uf,re.nativeEvent)),$||y.state.setIndices({activeIndex:null,selectedIndex:null,type:y.state.keyboardActiveRef.current?"keyboard":"pointer"})),W&&y.state.activeIndex!==null&&!$&&y.state.setIndices({activeIndex:null,selectedIndex:null,type:y.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(re){if(F||R||re.ctrlKey||re.shiftKey||re.altKey||re.metaKey)return;y.state.keyboardActiveRef.current=!0;const oe=re.currentTarget,ee=oe.scrollWidth-oe.clientWidth,ve=A==="rtl";if(re.key==="Home"){zr(re);const me=WH&&ve?oe.value.length:0;oe.setSelectionRange(me,me),oe.scrollLeft=0;return}if(re.key==="End"){zr(re);const me=WH&&ve?0:oe.value.length;oe.setSelectionRange(me,me),oe.scrollLeft=ve?-ee:ee;return}if(!z&&re.key==="Escape"){const me=D==="multiple"&&Array.isArray(H)?H.length===0:H===null,Se=ft(Z0,re.nativeEvent),xe=D==="multiple"?[]:null;y.state.setInputValue("",Se),y.state.setSelectedValue(xe,Se),!me&&!y.state.inline&&!Se.isPropagationAllowed&&re.stopPropagation();return}if(x&&re.key==="Backspace"&&oe.value===""&&x.highlightedChipIndex===void 0&&Array.isArray(H)&&H.length>0){const me=H.slice(0,-1);y.state.setIndices({activeIndex:null,selectedIndex:null,type:y.state.keyboardActiveRef.current?"keyboard":"pointer"}),y.state.setSelectedValue(me,ft(qr,re.nativeEvent));return}const Ee=Y(re);if(x?.setHighlightedChipIndex(Ee),Ee!==void 0?x?.chipsRef.current[Ee]?.focus():y.state.inputRef.current?.focus(),re.which!==229&&re.key==="Enter"&&W){const me=y.state.activeIndex,Se=re.nativeEvent;if(me===null){y.state.setOpen(!1,ft(qr,Se));return}zr(re);const xe=y.state.listRef.current[me];xe&&(y.state.selectionEventRef.current=Se,xe.click(),y.state.selectionEventRef.current=null)}},onPointerMove(){y.state.keyboardActiveRef.current=!1},onPointerDown(){y.state.keyboardActiveRef.current=!1}},g?g.getValidationProps(o):o],stateAttributesMapping:eTe})}),nTe={...Us,..._C},rTe=C.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,nativeButton:s=!0,keepMounted:o=!1,...l}=t,{disabled:u}=xo(),d=Ec(),c=et(d,xt.selectionMode),m=et(d,xt.disabled),g=et(d,xt.readOnly),_=et(d,xt.open),x=et(d,xt.selectedValue),b=jj();let v=!1;c==="none"?v=b!=="":c==="single"?v=x!=null:v=Array.isArray(x)&&x.length>0;const y=u||m||a,{buttonRef:E,getButtonProps:T}=za({native:s,disabled:y}),{mounted:w,transitionStatus:A,setMounted:O}=ul(v),R=C.useMemo(()=>({disabled:y,open:_,transitionStatus:A}),[y,_,A]);ia({open:v,ref:d.state.clearRef,onComplete(){v||O(!1)}});const N=kt("button",t,{state:R,ref:[n,E,d.state.clearRef],props:[{tabIndex:-1,children:"x",disabled:y,"aria-readonly":g||void 0,onMouseDown(L){L.preventDefault()},onClick(L){if(y||g)return;const U=d.state.keyboardActiveRef;d.state.setInputValue("",ft(QH,L.nativeEvent)),c!=="none"?(d.state.setSelectedValue(Array.isArray(x)?[]:null,ft(QH,L.nativeEvent)),d.state.setIndices({activeIndex:null,selectedIndex:null,type:U.current?"keyboard":"pointer"})):d.state.setIndices({activeIndex:null,type:U.current?"keyboard":"pointer"}),d.state.inputRef.current?.focus()}},l,T],stateAttributesMapping:nTe});return o||w?N:null}),nae=C.createContext(null);function iTe(){return C.useContext(nae)}function aTe(e){const{children:t,items:n}=e,r=C.useMemo(()=>({items:n}),[n]);return p.jsx(nae.Provider,{value:r,children:t})}function sTe(e){const{children:t}=e,{filteredItems:n}=zp(),r=iTe(),i=r?r.items:n;return i?p.jsx(C.Fragment,{children:i.map(t)}):null}const oTe=C.forwardRef(function(t,n){var r;const{render:i,className:a,children:s,...o}=t,l=Ec(),u=IC(),d=!!Fj(!0),{filteredItems:c}=zp(),m=et(l,xt.items),g=et(l,xt.labelsRef),_=et(l,xt.listRef),x=et(l,xt.selectionMode),b=et(l,xt.grid),v=et(l,xt.popupProps),y=et(l,xt.disabled),E=et(l,xt.readOnly),T=et(l,xt.virtualized),w=x==="multiple",A=c.length===0,O=tt(M=>{l.set("positionerElement",M)}),R=tt(M=>{l.set("listElement",M)}),N=C.useMemo(()=>typeof s=="function"?r||(r=p.jsx(sTe,{children:s})):s,[s]),D=C.useMemo(()=>({empty:A}),[A]),L=u.useState("floatingId"),U=kt("div",t,{state:D,ref:[n,R,d?null:O],props:[v,{children:N,tabIndex:-1,id:L,role:b?"grid":"listbox","aria-multiselectable":w?"true":void 0,onKeyDown(M){if(!(y||E)&&M.key==="Enter"){const W=l.state.activeIndex;if(W==null)return;zr(M);const z=M.nativeEvent,H=l.state.listRef.current[W];H&&(l.state.selectionEventRef.current=z,H.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},o]});return T?U:p.jsx(e1,{elementsRef:_,labelsRef:m?void 0:g,children:U})}),rae=C.createContext(void 0);function lTe(){const e=C.useContext(rae);if(e===void 0)throw new Error(hn(20));return e}const uTe=C.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,a=Ec(),s=et(a,xt.mounted),o=et(a,xt.forceMounted);return s||r||o?p.jsx(rae.Provider,{value:r,children:p.jsx(Q0,{ref:n,...i})}):null}),cTe=C.forwardRef(function(t,n){const{render:r,className:i,anchor:a,positionMethod:s="absolute",side:o="bottom",align:l="center",sideOffset:u=0,alignOffset:d=0,collisionBoundary:c="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:_=!1,disableAnchorTracking:x=!1,collisionAvoidance:b=uC,...v}=t,y=Ec(),{filteredItems:E}=zp(),T=IC(),w=lTe(),A=et(y,xt.modal),O=et(y,xt.open),R=et(y,xt.mounted),N=et(y,xt.openMethod),D=et(y,xt.triggerElement),L=et(y,xt.inputElement),U=et(y,xt.inputInsidePopup),M=E.length===0,z=r1({anchor:a??(U?D:L),floatingRootContext:T,positionMethod:s,mounted:R,side:o,sideOffset:u,align:l,alignOffset:d,arrowPadding:g,collisionBoundary:c,collisionPadding:m,sticky:_,disableAnchorTracking:x,keepMounted:w,collisionAvoidance:b,lazyFlip:!0});kC(O&&A&&N!=="touch",D);const H=C.useMemo(()=>{const F={...z.positionerStyles};return O||(F.pointerEvents="none"),{role:"presentation",hidden:!R,style:F}},[O,R,z.positionerStyles]),q=C.useMemo(()=>({open:O,side:z.side,align:z.align,anchorHidden:z.anchorHidden,empty:M}),[O,z.side,z.align,z.anchorHidden,M]);it(()=>{y.set("popupSide",z.side)},[y,z.side]);const K=C.useMemo(()=>({side:z.side,align:z.align,arrowRef:z.arrowRef,arrowUncentered:z.arrowUncentered,arrowStyles:z.arrowStyles,anchorHidden:z.anchorHidden,isPositioned:z.isPositioned}),[z.side,z.align,z.arrowRef,z.arrowUncentered,z.arrowStyles,z.anchorHidden,z.isPositioned]),$=tt(F=>{y.set("positionerElement",F)}),j=kt("div",t,{state:q,ref:[n,$],props:[H,v],stateAttributesMapping:cs});return p.jsxs(tae.Provider,{value:K,children:[R&&A&&p.jsx(AC,{inert:Dg(!O),cutout:L??D}),j]})}),dTe={...cs,...Us},fTe=C.forwardRef(function(t,n){const{render:r,className:i,initialFocus:a,finalFocus:s,...o}=t,l=Ec(),u=Fj(),d=IC(),{filteredItems:c}=zp(),m=et(l,xt.mounted),g=et(l,xt.open),_=et(l,xt.openMethod),x=et(l,xt.transitionStatus),b=et(l,xt.inputInsidePopup),v=et(l,xt.inputElement),y=c.length===0;ia({open:g,ref:l.state.popupRef,onComplete(){g&&l.state.onOpenChangeComplete(!0)}});const E=C.useMemo(()=>({open:g,side:u.side,align:u.align,anchorHidden:u.anchorHidden,transitionStatus:x,empty:y}),[g,u.side,u.align,u.anchorHidden,x,y]),T=kt("div",t,{state:E,ref:[n,l.state.popupRef],props:[{role:b?"dialog":"presentation",tabIndex:-1,onFocus(R){const N=Lr(R.nativeEvent);_!=="touch"&&(Pt(l.state.listElement,N)||N===R.currentTarget)&&l.state.inputRef.current?.focus()}},Pg(x),o],stateAttributesMapping:dTe}),A=a===void 0?b?R=>R==="touch"?l.state.popupRef.current:v:!1:a;let O;return s!=null?O=s:O=b?void 0:!1,p.jsx(fC,{context:d,disabled:!m,modal:!b,openInteractionType:_,initialFocus:A,returnFocus:O,children:T})}),iae=C.createContext(void 0);function pTe(){const e=C.useContext(iae);if(e===void 0)throw new Error(hn(18));return e}const hTe=C.forwardRef(function(t,n){const{render:r,className:i,items:a,...s}=t,[o,l]=C.useState(),u=C.useMemo(()=>({labelId:o,setLabelId:l,items:a}),[o,l,a]),d=kt("div",t,{ref:n,props:[{role:"group","aria-labelledby":o},s]}),c=p.jsx(iae.Provider,{value:u,children:d});return a?p.jsx(aTe,{items:a,children:c}):c}),mTe=C.forwardRef(function(t,n){const{render:r,className:i,id:a,...s}=t,{setLabelId:o}=pTe(),l=wi(a);return it(()=>(o(l),()=>{o(void 0)}),[l,o]),kt("div",t,{ref:n,props:[{id:l},s]})}),aae=C.createContext(void 0);function sae(){const e=C.useContext(aae);if(!e)throw new Error(hn(19));return e}const gTe=C.createContext(!1);function bTe(){return C.useContext(gTe)}const vTe=C.memo(C.forwardRef(function(t,n){const{render:r,className:i,value:a=null,index:s,disabled:o=!1,nativeButton:l=!1,...u}=t,d=C.useRef(!1),c=C.useRef(null),m=Lg({index:s,textRef:c,indexGuessBehavior:yj.GuessFromOrder}),g=Ec(),_=bTe(),{flatFilteredItems:x}=zp(),b=et(g,xt.open),v=et(g,xt.selectionMode),y=et(g,xt.readOnly),E=et(g,xt.virtualized),T=et(g,xt.isItemEqualToValue),w=v!=="none",A=s??(E?Bm(x,a,T):m.index),O=m.index!==-1,R=et(g,xt.id),N=et(g,xt.isActive,A),D=et(g,xt.isSelected,a),L=et(g,xt.items),U=et(g,xt.getItemProps),M=C.useRef(null),W=R!=null&&O?`${R}-${A}`:void 0,z=D&&w;it(()=>{if(!(O&&(E||s!=null)))return;const ae=g.state.listRef.current;return ae[A]=M.current,()=>{delete ae[A]}},[O,E,A,s,g]),it(()=>{if(!O||L)return;const J=g.state.valuesRef.current;return J[A]=a,v!=="none"&&g.state.allValuesRef.current.push(a),()=>{delete J[A]}},[O,L,A,a,g,v]),it(()=>{if(!b){d.current=!1;return}if(!O||L)return;const J=g.state.selectedValue,ae=Array.isArray(J)?J[J.length-1]:J;nc(ae,a,T)&&g.set("selectedIndex",A)},[O,L,b,g,A,a,T]);const H=C.useMemo(()=>({disabled:o,selected:z,highlighted:N}),[o,z,N]),q=U({active:N,selected:z});q.id=void 0,q.onFocus=void 0;const{getButtonProps:K,buttonRef:$}=za({disabled:o,focusableWhenDisabled:!0,native:l});function j(J){function ae(){g.state.handleSelection(J,a)}g.state.submitOnItemClick?(jr.flushSync(ae),g.state.requestSubmit()):ae()}const F={id:W,role:_?"gridcell":"option","aria-disabled":o||void 0,"aria-selected":w?z:void 0,tabIndex:void 0,onPointerDownCapture(J){d.current=!0,J.preventDefault()},onClick(J){o||y||j(J.nativeEvent)},onMouseUp(J){const ae=d.current;d.current=!1,!(o||y||J.button!==0||ae||!N)&&j(J.nativeEvent)}},G=kt("div",t,{ref:[$,n,m.ref,M],state:H,props:[q,F,u,K]}),V=C.useMemo(()=>({selected:z,textRef:c}),[z,c]);return p.jsx(aae.Provider,{value:V,children:G})})),yTe=C.forwardRef(function(t,n){const{render:r,className:i,children:a,...s}=t,{filteredItems:o}=zp(),l=Ec(),u=o.length===0?a:null;return kt("div",t,{ref:[n,l.state.emptyRef],props:[{children:u,role:"status","aria-live":"polite","aria-atomic":!0},s]})});let MV=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function oae(e){return C.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[MV.checked]:""}:{[MV.unchecked]:""}},...$p}),[e.indeterminate])}const lae=C.createContext(void 0);function _Te(){const e=C.useContext(lae);if(e===void 0)throw new Error(hn(14));return e}const xTe="data-parent",ETe=C.forwardRef(function(t,n){const{checked:r,className:i,defaultChecked:a=!1,disabled:s=!1,id:o,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:c,parent:m=!1,readOnly:g=!1,render:_,required:x=!1,uncheckedValue:b,value:v,nativeButton:y=!1,...E}=t,{clearErrors:T}=a1(),{disabled:w,name:A,setDirty:O,setFilled:R,setFocused:N,setTouched:D,state:L,validationMode:U,validityData:M,shouldValidateOnChange:W,validation:z}=xo(),H=iCe(),{labelId:q,controlId:K,setControlId:$,getDescriptionProps:j}=Wd(),F=sCe(),G=F?.parent,V=G&&F.allValues,J=w||H.disabled||F?.disabled||s,ae=A??d,se=v??ae,Z=wi(),Y=wi();let Q=K;V?Q=m?Y:`${G.id}-${se}`:o&&(Q=o);let re={};V&&(m?re=F.parent.getParentProps():se&&(re=F.parent.getChildProps(se)));const oe=tt(c),{checked:ee=r,indeterminate:ve=l,onCheckedChange:Ee,...me}=re,Se=F?.value,xe=F?.setValue,Ye=F?.defaultValue,Ue=C.useRef(null),{getButtonProps:je,buttonRef:we}=za({disabled:J,native:y}),Ne=F?.validation??z,[_e,pe]=Ls({controlled:se&&Se&&!m?Se.includes(se):ee,default:se&&Ye&&!m?Ye.includes(se):a,name:"Checkbox",state:"checked"});it(()=>{if($!==Dr)return $(Q),()=>{$(void 0)}},[Q,F,$,m]),s1({enabled:!F,id:Z,commit:Ne.commit,value:_e,controlRef:Ue,name:ae,getValue:()=>_e});const Ae=C.useRef(null),he=_o(u,Ae,Ne.inputRef);it(()=>{Ae.current&&(Ae.current.indeterminate=ve,_e&&R(!0))},[_e,ve,R]),Vf(_e,()=>{F&&!m||(T(ae),R(_e),O(_e!==M.initialValue),W()?Ne.commit(_e):Ne.commit(_e,!0))});const Oe=Jl({checked:_e,disabled:J,name:m?void 0:ae,id:Q??void 0,required:x,ref:he,style:Rg,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(dt){if(dt.nativeEvent.defaultPrevented)return;const $e=dt.target.checked,ht=ft(qr,dt.nativeEvent);if(Ee?.($e,ht),oe($e,ht),!ht.isCanceled&&(pe($e),se&&Se&&xe&&!m)){const Re=$e?[...Se,se]:Se.filter(de=>de!==se);xe(Re,ht)}},onFocus(){Ue.current?.focus()}},v!==void 0?{value:(F?_e&&v:v)||""}:pr,j,F?Ne.getValidationProps:Ne.getInputValidationProps),ge=V?!!ee:_e,Ie=V&&ve||l;C.useEffect(()=>{G&&se&&G.disabledStatesRef.current.set(se,J)},[G,J,se]);const We=C.useMemo(()=>({...L,checked:ge,disabled:J,readOnly:g,required:x,indeterminate:Ie}),[L,ge,J,g,x,Ie]),mt=oae(We),lt=kt("span",t,{state:We,ref:[we,Ue,n,F?.registerControlRef],props:[{id:Z,role:"checkbox","aria-checked":ve?"mixed":_e,"aria-readonly":g||void 0,"aria-required":x||void 0,"aria-labelledby":q,[xTe]:m?"":void 0,onFocus(){N(!0)},onBlur(){const dt=Ae.current;dt&&(D(!0),N(!1),U==="onBlur"&&Ne.commit(F?Se:dt.checked))},onClick(dt){g||J||(dt.preventDefault(),Ae.current?.click())}},j,Ne.getValidationProps,E,me,je],stateAttributesMapping:mt});return p.jsxs(lae.Provider,{value:We,children:[lt,!_e&&!F&&ae&&!m&&b!==void 0&&p.jsx("input",{type:"hidden",name:ae,value:b}),p.jsx("input",{...Oe})]})}),STe=C.forwardRef(function(t,n){const{render:r,className:i,keepMounted:a=!1,...s}=t,o=_Te(),l=o.checked||o.indeterminate,{transitionStatus:u,setMounted:d}=ul(l),c=C.useRef(null),m=C.useMemo(()=>({...o,transitionStatus:u}),[o,u]);ia({open:l,ref:c,onComplete(){l||d(!1)}});const g=oae(o),_=C.useMemo(()=>({...g,...Us,...$p}),[g]),x=a||l,b=kt("span",t,{enabled:x,ref:[n,c],state:m,stateAttributesMapping:_,props:s});return x?b:null});function wTe(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,...a}=e;return p.jsx(YCe,{...a,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i})}const CTe=C.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=sae();return r||i?p.jsx(TTe,{...t,ref:n}):null}),TTe=C.memo(C.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:i,...a}=e,{selected:s}=sae(),o=C.useRef(null),{transitionStatus:l,setMounted:u}=ul(s),d=C.useMemo(()=>({selected:s,transitionStatus:l}),[s,l]),c=kt("span",e,{ref:[t,o],state:d,props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:Us});return ia({open:s,ref:o,onComplete(){s||u(!1)}}),c})),ATe=C.createContext(void 0);function DC(e=!0){const t=C.useContext(ATe);if(t===void 0&&!e)throw new Error(hn(25));return t}const uae=C.createContext(void 0);function Bj(e){const t=C.useContext(uae);if(t===void 0&&!e)throw new Error(hn(33));return t}const cae=C.createContext(void 0);function Gd(e){const t=C.useContext(cae);if(t===void 0&&!e)throw new Error(hn(36));return t}const dae={type:"regular-item"};function fae(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,nativeButton:s,itemMetadata:o,nodeId:l}=e,u=C.useRef(null),d=DC(!0),c=d!==void 0,{events:m}=a.useState("floatingTreeRoot"),{getButtonProps:g,buttonRef:_}=za({disabled:n,focusableWhenDisabled:!0,native:s}),x=C.useCallback(v=>Jl({id:i,role:"menuitem",tabIndex:r?0:-1,onMouseMove(y){l&&m.emit("itemhover",{nodeId:l,target:y.currentTarget})},onMouseEnter(){o.type==="submenu-trigger"&&o.setActive()},onKeyUp(y){y.key===" "&&a.context.typingRef.current&&y.preventBaseUIHandler()},onClick(y){t&&m.emit("close",{domEvent:y,reason:np})},onMouseUp(y){if(d){const E=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,c&&E&&Math.abs(y.clientX-E.x)<=1&&Math.abs(y.clientY-E.y)<=1)return}u.current&&a.context.allowMouseUpTriggerRef.current&&(!c||y.button===2)&&o.type==="regular-item"&&u.current.click()}},v,g),[i,r,g,t,m,a,c,d,o,l]),b=_o(u,_);return C.useMemo(()=>({getItemProps:x,itemRef:b}),[x,b])}let jV=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e})({});const pae={checked(e){return e?{[jV.checked]:""}:{[jV.unchecked]:""}},...Us},kTe=C.forwardRef(function(t,n){const{render:r,className:i,id:a,label:s,nativeButton:o=!1,disabled:l=!1,closeOnClick:u=!0,...d}=t,c=Lg({label:s}),m=Bj(!0),g=wi(a),{store:_}=Gd(),x=_.useState("isActive",c.index),b=_.useState("itemProps"),{getItemProps:v,itemRef:y}=fae({closeOnClick:u,disabled:l,highlighted:x,id:g,store:_,nativeButton:o,nodeId:m?.nodeId,itemMetadata:dae}),E=C.useMemo(()=>({disabled:l,highlighted:x}),[l,x]);return kt("div",t,{state:E,props:[b,d,v],ref:[y,n,c.ref]})}),OTe={...cs,...Us},RTe=C.forwardRef(function(t,n){const{render:r,className:i,finalFocus:a,...s}=t,{store:o}=Gd(),{side:l,align:u}=Bj(),d=Dj()!=null,c=o.useState("open"),m=o.useState("transitionStatus"),g=o.useState("popupProps"),_=o.useState("mounted"),x=o.useState("instantType"),b=o.useState("activeTriggerElement"),v=o.useState("parent"),y=o.useState("lastOpenChangeReason"),E=o.useState("rootId"),T=o.useState("floatingRootContext"),w=o.useState("floatingTreeRoot"),A=o.useState("closeDelay"),O=o.useState("activeTriggerElement");ia({open:c,ref:o.context.popupRef,onComplete(){c&&o.context.onOpenChangeComplete?.(!0)}}),C.useEffect(()=>{function M(W){o.setOpen(!1,ft(W.reason,W.domEvent))}return w.events.on("close",M),()=>{w.events.off("close",M)}},[w.events,o]);const R=o.useState("hoverEnabled"),N=o.useState("disabled");Mre(T,{enabled:R&&!N&&v.type!=="context-menu"&&v.type!=="menubar",closeDelay:A});const D=C.useMemo(()=>({transitionStatus:m,side:l,align:u,open:c,nested:v.type==="menu",instant:x}),[m,l,u,c,v.type,x]),L=kt("div",t,{state:D,ref:[n,o.context.popupRef],stateAttributesMapping:OTe,props:[g,{onKeyDown(M){d&&vj.has(M.key)&&M.stopPropagation()}},Pg(m),s,{"data-rootownerid":E}]});let U=v.type===void 0||v.type==="context-menu";return(b||v.type==="menubar"&&y!==dC)&&(U=!0),p.jsx(fC,{context:T,modal:!1,disabled:!_,returnFocus:a===void 0?U:a,initialFocus:v.type!=="menu",restoreFocus:!0,externalTree:v.type!=="menubar"?w:void 0,previousFocusableElement:O,nextFocusableElement:v.type===void 0?o.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:v.type===void 0?o.context.beforeContentFocusGuardRef:void 0,children:L})}),hae=C.createContext(void 0);function NTe(){const e=C.useContext(hae);if(e===void 0)throw new Error(hn(32));return e}const ITe=C.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:a}=Gd();return a.useState("mounted")||r?p.jsx(hae.Provider,{value:r,children:p.jsx(Q0,{ref:n,...i})}):null}),DTe=C.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:a,render:s,side:o,align:l,sideOffset:u=0,alignOffset:d=0,collisionBoundary:c="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:_=!1,disableAnchorTracking:x=!1,collisionAvoidance:b=uC,...v}=t,{store:y}=Gd(),E=NTe(),T=DC(!0),w=y.useState("parent"),A=y.useState("floatingRootContext"),O=y.useState("floatingTreeRoot"),R=y.useState("mounted"),N=y.useState("open"),D=y.useState("modal"),L=y.useState("activeTriggerElement"),U=y.useState("lastOpenChangeReason"),M=y.useState("floatingNodeId"),W=y.useState("floatingParentNodeId");let z=r,H=u,q=d,K=l,$=b;w.type==="context-menu"&&(z=r??w.context?.anchor,K=K??"start",!o&&K!=="center"&&(q=t.alignOffset??2,H=t.sideOffset??-5));let j=o,F=K;w.type==="menu"?(j=j??"inline-end",F=F??"start",$=t.collisionAvoidance??W3):w.type==="menubar"&&(j=j??"bottom",F=F??"start");const G=w.type==="context-menu",V=r1({anchor:z,floatingRootContext:A,positionMethod:T?"fixed":i,mounted:R,side:j,sideOffset:H,align:F,alignOffset:q,arrowPadding:G?0:g,collisionBoundary:c,collisionPadding:m,sticky:_,nodeId:M,keepMounted:E,disableAnchorTracking:x,collisionAvoidance:$,shiftCrossAxis:G,externalTree:O}),J=C.useMemo(()=>{const re={};return N||(re.pointerEvents="none"),{role:"presentation",hidden:!R,style:{...V.positionerStyles,...re}}},[N,R,V.positionerStyles]);C.useEffect(()=>{function re(oe){oe.open?(oe.parentNodeId===M&&y.set("hoverEnabled",!1),oe.nodeId!==M&&oe.parentNodeId===y.select("floatingParentNodeId")&&y.setOpen(!1,ft(Fv))):oe.parentNodeId===M&&oe.reason!==Fv&&y.set("hoverEnabled",!0)}return O.events.on("menuopenchange",re),()=>{O.events.off("menuopenchange",re)}},[y,O.events,M]),C.useEffect(()=>{if(y.select("floatingParentNodeId")==null)return;function re(oe){if(oe.open||oe.nodeId!==y.select("floatingParentNodeId"))return;const ee=oe.reason??Fv;y.setOpen(!1,ft(ee))}return O.events.on("menuopenchange",re),()=>{O.events.off("menuopenchange",re)}},[O.events,y]),C.useEffect(()=>{function re(oe){!N||oe.nodeId!==y.select("floatingParentNodeId")||oe.target&&L&&L!==oe.target&&y.setOpen(!1,ft(Fv))}return O.events.on("itemhover",re),()=>{O.events.off("itemhover",re)}},[O.events,N,L,y]),C.useEffect(()=>{const re={open:N,nodeId:M,parentNodeId:W,reason:y.select("lastOpenChangeReason")};O.events.emit("menuopenchange",re)},[O.events,N,y,M,W]);const ae=C.useMemo(()=>({open:N,side:V.side,align:V.align,anchorHidden:V.anchorHidden,nested:w.type==="menu"}),[N,V.side,V.align,V.anchorHidden,w.type]),se=C.useMemo(()=>({side:V.side,align:V.align,arrowRef:V.arrowRef,arrowUncentered:V.arrowUncentered,arrowStyles:V.arrowStyles,nodeId:V.context.nodeId}),[V.side,V.align,V.arrowRef,V.arrowUncentered,V.arrowStyles,V.context.nodeId]),Z=kt("div",t,{state:ae,stateAttributesMapping:cs,ref:[n,y.useStateSetter("positionerElement")],props:[J,v]}),Y=R&&w.type!=="menu"&&(w.type!=="menubar"&&D&&U!==Cr||w.type==="menubar"&&w.context.modal);let Q=null;return w.type==="menubar"?Q=w.context.contentElement:w.type===void 0&&(Q=L),p.jsxs(uae.Provider,{value:se,children:[Y&&p.jsx(AC,{ref:w.type==="context-menu"||w.type==="nested-context-menu"?w.context.internalBackdropRef:null,inert:Dg(!N),cutout:Q}),p.jsx(gre,{id:M,children:p.jsx(e1,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,children:Z})})]})}),mae=C.createContext(void 0);function LTe(){const e=C.useContext(mae);if(e===void 0)throw new Error(hn(34));return e}const PTe=C.memo(C.forwardRef(function(t,n){const{render:r,className:i,value:a,defaultValue:s,onValueChange:o,disabled:l=!1,...u}=t,[d,c]=Ls({controlled:a,default:s,name:"MenuRadioGroup"}),m=tt(o),g=tt((v,y)=>{m?.(v,y),!y.isCanceled&&c(v)}),_=C.useMemo(()=>({disabled:l}),[l]),x=kt("div",t,{state:_,ref:n,props:{role:"group","aria-disabled":l||void 0,...u}}),b=C.useMemo(()=>({value:d,setValue:g,disabled:l}),[d,g,l]);return p.jsx(mae.Provider,{value:b,children:x})})),gae=C.createContext(void 0);function MTe(){const e=C.useContext(gae);if(e===void 0)throw new Error(hn(35));return e}const jTe=C.forwardRef(function(t,n){const{render:r,className:i,id:a,label:s,nativeButton:o=!1,disabled:l=!1,closeOnClick:u=!1,value:d,...c}=t,m=Lg({label:s}),g=Bj(!0),_=wi(a),{store:x}=Gd(),b=x.useState("isActive",m.index),v=x.useState("itemProps"),{value:y,setValue:E,disabled:T}=LTe(),w=T||l,A=y===d,{getItemProps:O,itemRef:R}=fae({closeOnClick:u,disabled:w,highlighted:b,id:_,store:x,nativeButton:o,nodeId:g?.nodeId,itemMetadata:dae}),N=C.useMemo(()=>({disabled:w,highlighted:b,checked:A}),[w,b,A]),D=tt(U=>{const M={...ft(np,U.nativeEvent),preventUnmountOnClose:()=>{}};E(d,M)}),L=kt("div",t,{state:N,stateAttributesMapping:pae,props:[v,{role:"menuitemradio","aria-checked":A,onClick:D},c,O],ref:[R,n,m.ref]});return p.jsx(gae.Provider,{value:N,children:L})}),FTe=C.forwardRef(function(t,n){const{render:r,className:i,keepMounted:a=!1,...s}=t,o=MTe(),l=C.useRef(null),{transitionStatus:u,setMounted:d}=ul(o.checked);ia({open:o.checked,ref:l,onComplete(){o.checked||d(!1)}});const c=C.useMemo(()=>({checked:o.checked,disabled:o.disabled,highlighted:o.highlighted,transitionStatus:u}),[o.checked,o.disabled,o.highlighted,u]);return kt("span",t,{state:c,stateAttributesMapping:pae,ref:[n,l],props:{"aria-hidden":!0,...s},enabled:a||o.checked})}),BTe=C.createContext(null);function bae(e){return C.useContext(BTe)}const UTe={...pj,disabled:qe(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:qe(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:qe(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:qe(e=>e.stickIfOpen),parent:qe(e=>e.parent),rootId:qe(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:qe(e=>e.activeIndex),isActive:qe((e,t)=>e.activeIndex===t),hoverEnabled:qe(e=>e.hoverEnabled),instantType:qe(e=>e.instantType),lastOpenChangeReason:qe(e=>e.openChangeReason),floatingTreeRoot:qe(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:qe(e=>e.floatingNodeId),floatingParentNodeId:qe(e=>e.floatingParentNodeId),itemProps:qe(e=>e.itemProps),closeDelay:qe(e=>e.closeDelay),keyboardEventRelay:qe(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class Uj extends hC{constructor(t){super({...$Te(),...t},{positionerRef:C.createRef(),popupRef:C.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:C.createRef(),beforeContentFocusGuardRef:C.createRef(),onOpenChangeComplete:void 0,triggerElements:new J0},UTe),this.observe(qe(n=>n.allowMouseEnter),(n,r)=>{this.state.parent.type==="menu"&&n!==r&&this.state.parent.store.set("allowMouseEnter",n)}),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){this.unsubscribeParentListener=n.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){return Ui(()=>t??new Uj(n)).current}unsubscribeParentListener=null}function $Te(){return{...fj(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new nj,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:pr,keyboardEventRelay:void 0,closeDelay:0}}const zTe=C.createContext(void 0);function HTe(){return C.useContext(zTe)}function VTe(e){const{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:s=!1,modal:o,loopFocus:l=!0,orientation:u="vertical",actionsRef:d,closeParentOnEsc:c=!1,handle:m,triggerId:g,defaultTriggerId:_=null,highlightItemOnHover:x=!0}=e,b=DC(!0),v=Gd(!0),y=bae(),E=HTe(),T=C.useMemo(()=>E&&v?{type:"menu",store:v.store}:y?{type:"menubar",context:y}:b&&!v?{type:"context-menu",context:b}:{type:void 0},[b,v,y,E]),w=Uj.useStore(m?.store,{parent:T}),A=w.useState("floatingTreeRoot"),O=rj(A),R=ol();it(()=>{b&&!v?w.update({parent:{type:"context-menu",context:b},floatingNodeId:O,floatingParentNodeId:R}):v&&w.update({floatingNodeId:O,floatingParentNodeId:R})},[b,v,O,R,w]),w.useControlledProp("open",n,a),w.useControlledProp("activeTriggerId",g,_),w.useContextCallback("onOpenChangeComplete",i);const N=w.useState("open"),D=w.useState("activeTriggerElement"),L=w.useState("positionerElement"),U=w.useState("hoverEnabled"),M=w.useState("modal"),W=w.useState("disabled"),z=w.useState("lastOpenChangeReason"),H=w.useState("parent"),q=w.useState("activeIndex"),K=w.useState("payload"),$=w.useState("floatingParentNodeId"),j=C.useRef(null),F=$!=null;let G;w.useSyncedValues({disabled:s,modal:H.type===void 0?o:void 0,rootId:Hd()});const{openMethod:V,triggerProps:J,reset:ae}=OC(N);cj(w);const{forceUnmount:se}=dj(N,w,()=>{w.update({allowMouseEnter:!1,stickIfOpen:!0}),ae()}),Z=C.useRef(H.type!=="context-menu"),Y=Wn();C.useEffect(()=>{if(N||(j.current=null),H.type==="context-menu"){if(!N){Y.clear(),Z.current=!1;return}Y.start(500,()=>{Z.current=!0})}},[Y,N,H.type]),kC(N&&M&&z!==Cr&&V!=="touch",L),it(()=>{!N&&!U&&w.set("hoverEnabled",!0)},[N,U,w]);const Q=C.useRef(!0),re=Wn(),oe=tt(($e,ht)=>{const Re=ht.reason;if(N===$e&&ht.trigger===D||(ht.preventUnmountOnClose=()=>{w.set("preventUnmountingOnClose",!0)},!$e&&ht.trigger==null&&(ht.trigger=D??void 0),r?.($e,ht),ht.isCanceled))return;const de={open:$e,nativeEvent:ht.event,reason:ht.reason,nested:F};G?.emit("openchange",de);const Te=ht.event;if($e===!1&&Te?.type==="click"&&Te.pointerType==="touch"&&!Q.current)return;if(!$e&&q!==null){const zt=w.context.itemDomElements.current[q];queueMicrotask(()=>{zt?.setAttribute("tabindex","-1")})}$e&&Re===Ay?(Q.current=!1,re.start(300,()=>{Q.current=!0})):(Q.current=!0,re.clear());const Ke=(Re===Gu||Re===np)&&Te.detail===0&&Te?.isTrusted,st=!$e&&(Re===Z0||Re==null);function Bt(){const zt={open:$e,openChangeReason:Re};j.current=ht.event??null;const Mt=ht.trigger?.id??null;(Mt||$e)&&(zt.activeTriggerId=Mt,zt.activeTriggerElement=ht.trigger??null),w.update(zt)}Re===Cr?jr.flushSync(Bt):Bt(),H.type==="menubar"&&(Re===Ay||Re===el||Re===Cr||Re===gm||Re===Fv)?w.set("instantType","group"):Ke||st?w.set("instantType",Ke?"click":"dismiss"):w.set("instantType",void 0)}),ee=C.useCallback($e=>{const ht=ft($e);return ht.preventUnmountOnClose=()=>{w.set("preventUnmountingOnClose",!0)},ht},[w]),ve=C.useCallback(()=>{w.setOpen(!1,ee(ij))},[w,ee]);C.useImperativeHandle(d,()=>({unmount:se,close:ve}),[se,ve]);let Ee;H.type==="context-menu"&&(Ee=H.context),C.useImperativeHandle(Ee?.positionerRef,()=>L,[L]),C.useImperativeHandle(Ee?.actionsRef,()=>({setOpen:oe}),[oe]);const me=hj({popupStore:w,onOpenChange:oe});G=me.context.events,C.useEffect(()=>{const $e=({open:ht,eventDetails:Re})=>oe(ht,Re);return G.on("setOpen",$e),()=>{G?.off("setOpen",$e)}},[G,oe]);const Se=Ig(me,{enabled:!W,bubbles:c&&H.type==="menu",outsidePress(){return H.type!=="context-menu"||j.current?.type==="contextmenu"?!0:Z.current},externalTree:F?A:void 0}),xe=Fre(me,{role:"menu"}),Ye=_c(),Ue=C.useCallback($e=>{w.select("activeIndex")!==$e&&w.set("activeIndex",$e)},[w]),je=mj(me,{enabled:!W,listRef:w.context.itemDomElements,activeIndex:q,nested:H.type!==void 0,loopFocus:l,orientation:u,parentOrientation:H.type==="menubar"?H.context.orientation:void 0,rtl:Ye==="rtl",disabledIndices:La,onNavigate:Ue,openOnArrowKeyDown:H.type!=="context-menu",externalTree:F?A:void 0,focusItemOnHover:x}),we=C.useCallback($e=>{w.context.typingRef.current=$e},[w]),Ne=gj(me,{listRef:w.context.itemLabels,activeIndex:q,resetMs:h1e,onMatch:$e=>{N&&$e!==q&&w.set("activeIndex",$e)},onTypingChange:we}),{getReferenceProps:_e,getFloatingProps:pe,getItemProps:Ae,getTriggerProps:he}=Vd([Se,xe,je,Ne]),Oe=C.useMemo(()=>{const $e=Jl(_e(),{onMouseEnter(){w.set("hoverEnabled",!0)},onMouseMove(){w.set("allowMouseEnter",!0)}},J);return delete $e.role,$e},[_e,w,J]),ge=C.useMemo(()=>{const $e=he();if(!$e)return $e;const ht=Jl($e,J);return delete ht.role,delete ht["aria-controls"],ht},[he,J]),Ie=qu(),We=C.useMemo(()=>pe({onMouseEnter(){H.type==="menu"&&Ie.request(()=>w.set("hoverEnabled",!1))},onMouseMove(){w.set("allowMouseEnter",!0)},onClick(){w.select("hoverEnabled")&&w.set("hoverEnabled",!1)},onKeyDown($e){const ht=w.select("keyboardEventRelay");ht&&!$e.isPropagationStopped()&&ht($e)}}),[pe,H.type,Ie,w]),mt=C.useMemo(()=>Ae(),[Ae]);w.useSyncedValues({floatingRootContext:me,activeTriggerProps:Oe,inactiveTriggerProps:ge,popupProps:We,itemProps:mt});const lt=C.useMemo(()=>({store:w,parent:T}),[w,T]),dt=p.jsx(cae.Provider,{value:lt,children:typeof t=="function"?t({payload:K}):t});return H.type===void 0||H.type==="context-menu"?p.jsx(bre,{externalTree:A,children:dt}):dt}function vae(e){if(fr(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!Ul(e))return vae(Ql(e))}function WTe(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,i=C.useRef(!1);return C.useMemo(()=>t?{onMouseDown:a=>{(n==="open"&&!r||n==="close"&&r)&&(i.current=!0,ra(a.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:a=>{i.current&&(i.current=!1,a.preventBaseUIHandler())}}:pr,[t,n,r])}const kx=2,GTe=C.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,nativeButton:s=!0,id:o,openOnHover:l,delay:u=100,closeDelay:d=0,handle:c,payload:m,...g}=t,_=Gd(!0),x=c?.store??_?.store;if(!x)throw new Error(hn(85));const b=wi(o),v=x.useState("isTriggerActive",b),y=x.useState("floatingRootContext"),E=x.useState("isOpenedByTrigger",b),T=C.useRef(null),w=KTe(),A=H3(!0),O=ll(),R=C.useMemo(()=>O??new nj,[O]),N=rj(R),D=ol(),{registerTrigger:L,isMountedByThisTrigger:U}=uj(b,T,x,{payload:m,closeDelay:d,parent:w,floatingTreeRoot:R,floatingNodeId:N,floatingParentNodeId:D,keyboardEventRelay:A?.relayKeyboardEvent}),M=x.useState("disabled"),W=a||M||w.type==="menubar"&&w.context.disabled,{getButtonProps:z,buttonRef:H}=za({disabled:W,native:s});C.useEffect(()=>{!E&&w.type===void 0&&(x.context.allowMouseUpTriggerRef.current=!1)},[x,E,w.type]);const q=C.useRef(null),K=Wn(),$=tt(xe=>{if(!q.current)return;K.clear(),x.context.allowMouseUpTriggerRef.current=!1;const Ye=xe.target;if(Pt(q.current,Ye)||Pt(x.select("positionerElement"),Ye)||Ye===q.current||Ye!=null&&vae(Ye)===x.select("rootId"))return;const Ue=Nj(q.current);xe.clientX>=Ue.left-kx&&xe.clientX<=Ue.right+kx&&xe.clientY>=Ue.top-kx&&xe.clientY<=Ue.bottom+kx||R.events.emit("close",{domEvent:xe,reason:vre})});C.useEffect(()=>{E&&x.select("lastOpenChangeReason")===Cr&&ra(q.current).addEventListener("mouseup",$,{once:!0})},[E,$,x]);const j=w.type==="menubar"&&w.context.hasSubmenuOpen,G=jre(y,{enabled:(l??j??!1)&&!W&&w.type!=="context-menu"&&(w.type!=="menubar"||j&&!U),handleClose:bj({blockPointerEvents:w.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:w.type===void 0?u:void 0,delay:{close:d},triggerElementRef:T,externalTree:R,isActiveTrigger:v}),V=qTe(E,x.select("lastOpenChangeReason")),J=Ng(y,{enabled:!W&&w.type!=="context-menu",event:E&&w.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:w.type===void 0?V:!1}),ae=Lre(y,{enabled:!W&&(w.type!=="menubar"&&E||j)}),se=WTe({open:E,enabled:w.type==="menubar",mouseDownAction:"open"}),Z=Vd([J,ae]),Y=w.type==="menubar",Q=C.useMemo(()=>({disabled:W,open:E}),[W,E]),re=x.useState("triggerProps",U),oe=[q,n,H,L,T],ee=[Z.getReferenceProps(),G??pr,re,{"aria-haspopup":"menu",id:b,onMouseDown:xe=>{if(x.select("open"))return;K.start(200,()=>{x.context.allowMouseUpTriggerRef.current=!0}),ra(xe.currentTarget).addEventListener("mouseup",$,{once:!0})}},Y?{role:"menuitem"}:{},se,g,z],ve=C.useRef(null),Ee=tt(xe=>{jr.flushSync(()=>{x.setOpen(!1,ft(el,xe.nativeEvent,xe.currentTarget))}),G_e(ve.current)?.focus()}),me=tt(xe=>{const Ye=x.select("positionerElement");if(Ye&&qo(xe,Ye))x.context.beforeContentFocusGuardRef.current?.focus();else{jr.flushSync(()=>{x.setOpen(!1,ft(el,xe.nativeEvent,xe.currentTarget))});let Ue=W_e(T.current);for(;Ue!==null&&Pt(Ye,Ue)||Ue?.hasAttribute("aria-hidden");){const je=Ue;if(Ue=X0(Ue),Ue===je)break}Ue?.focus()}}),Se=kt("button",t,{enabled:!Y,stateAttributesMapping:Pm,state:Q,ref:oe,props:ee});return Y?p.jsx(xC,{tag:"button",render:r,className:i,state:Q,refs:oe,props:ee,stateAttributesMapping:Pm}):E?p.jsxs(C.Fragment,{children:[p.jsx(eu,{ref:ve,onFocus:Ee},`${b}-pre-focus-guard`),p.jsx(C.Fragment,{children:Se},b),p.jsx(eu,{ref:x.context.triggerFocusTargetRef,onFocus:me},`${b}-post-focus-guard`)]}):p.jsx(C.Fragment,{children:Se},b)});function qTe(e,t){const n=Wn(),[r,i]=C.useState(!1);return it(()=>{e&&t==="trigger-hover"?(i(!0),n.start(kne,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function KTe(){const e=DC(!0),t=Gd(!0),n=bae();return C.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function Pu(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const YTe=typeof ResizeObserver<"u",XTe=()=>!0;function ZTe(e){const{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=XTe,onMeasureLayout:s,onMeasureLayoutComplete:o,side:l,direction:u}=e,d=C.useRef(!0),c=lj(t,!0,!1),m=qu(),g=C.useRef(null),_=tt(s),x=tt(o),b=C.useMemo(()=>{let v=l==="top",y=l==="left";return u==="rtl"?(v=v||l==="inline-end",y=y||l==="inline-end"):(v=v||l==="inline-start",y=y||l==="inline-start"),v?{position:"absolute",[l==="top"?"bottom":"top"]:"0",[y?"right":"left"]:"0"}:pr},[l,u]);it(()=>{if(!i||!a()||!YTe){d.current=!0,g.current=null;return}if(!t||!n)return;Object.entries(b).forEach(([N,D])=>{t.style.setProperty(N,D)});const v=new ResizeObserver(N=>{const D=N[0];D&&(g.current===null?g.current={width:Math.ceil(D.borderBoxSize[0].inlineSize),height:Math.ceil(D.borderBoxSize[0].blockSize)}:(g.current.width=Math.ceil(D.borderBoxSize[0].inlineSize),g.current.height=Math.ceil(D.borderBoxSize[0].blockSize)))});v.observe(t),t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto");const y=pv(t,"position","static"),E=pv(t,"transform","none"),T=pv(t,"scale","1"),w=pv(n,"--available-width","max-content"),A=pv(n,"--available-height","max-content");if(_?.(),d.current||g.current===null){n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const N=Oy(t);return n.style.setProperty("--positioner-width",`${N.width}px`),n.style.setProperty("--positioner-height",`${N.height}px`),y(),E(),T(),w(),A(),x?.(null,N),d.current=!1,()=>{v.disconnect()}}t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto"),n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const O=Oy(t);t.style.setProperty("--popup-width",`${g.current.width}px`),t.style.setProperty("--popup-height",`${g.current.height}px`),y(),E(),w(),A(),x?.(g.current,O),n.style.setProperty("--positioner-width",`${O.width}px`),n.style.setProperty("--positioner-height",`${O.height}px`);const R=new AbortController;return m.request(()=>{t.style.setProperty("--popup-width",`${O.width}px`),t.style.setProperty("--popup-height",`${O.height}px`),c(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},R.signal)}),()=>{v.disconnect(),R.abort(),m.cancel()}},[r,t,n,c,m,a,i,_,x,b])}function pv(e,t,n){const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}const QTe=C.forwardRef(function(t,n){const{children:r,container:i,className:a,render:s,...o}=t,{portalNode:l,portalSubtree:u}=Sre({container:i,ref:n,componentProps:t,elementProps:o});return!u&&!l?null:p.jsxs(C.Fragment,{children:[u,l&&jr.createPortal(r,l)]})}),yae=C.createContext(void 0);function LC(){const e=C.useContext(yae);if(e===void 0)throw new Error(hn(53));return e}let fS=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const Ox=500,FV=16;function go(e,t,n){if(!e)return 0;const r=getComputedStyle(e),i=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${i}Start`])+parseFloat(r[`${t}${i}End`])}let JTe=(function(e){return e.orientation="data-orientation",e.hovering="data-hovering",e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({}),Hh=(function(e){return e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({});const $j={hasOverflowX:e=>e?{[Hh.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[Hh.hasOverflowY]:""}:null,overflowXStart:e=>e?{[Hh.overflowXStart]:""}:null,overflowXEnd:e=>e?{[Hh.overflowXEnd]:""}:null,overflowYStart:e=>e?{[Hh.overflowYStart]:""}:null,overflowYEnd:e=>e?{[Hh.overflowYEnd]:""}:null,cornerHidden:()=>null},BV={width:0,height:0},eAe={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},tAe=C.forwardRef(function(t,n){const{render:r,className:i,overflowEdgeThreshold:a,...s}=t,[o,l]=C.useState(!1),[u,d]=C.useState(!1),[c,m]=C.useState(!1),[g,_]=C.useState(BV),[x,b]=C.useState(BV),[v,y]=C.useState(!1),[E,T]=C.useState(eAe),w=wi(),A=C.useRef(null),O=C.useRef(null),R=C.useRef(null),N=C.useRef(null),D=C.useRef(null),L=C.useRef(null),U=C.useRef(null),M=C.useRef(!1),W=C.useRef(0),z=C.useRef(0),H=C.useRef(0),q=C.useRef(0),K=C.useRef("vertical"),$=Wn(),j=Wn(),F=C.useRef({x:0,y:0}),[G,V]=C.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),J=nAe(a),ae=tt(Ee=>{const me=Ee.x-F.current.x,Se=Ee.y-F.current.y;F.current=Ee,Se!==0&&(m(!0),$.start(Ox,()=>{m(!1)})),me!==0&&(d(!0),j.start(Ox,()=>{d(!1)}))}),se=tt(Ee=>{Ee.button===0&&(M.current=!0,W.current=Ee.clientY,z.current=Ee.clientX,K.current=Ee.currentTarget.getAttribute(JTe.orientation),O.current&&(H.current=O.current.scrollTop,q.current=O.current.scrollLeft),D.current&&K.current==="vertical"&&D.current.setPointerCapture(Ee.pointerId),L.current&&K.current==="horizontal"&&L.current.setPointerCapture(Ee.pointerId))}),Z=tt(Ee=>{if(!M.current)return;const me=Ee.clientY-W.current,Se=Ee.clientX-z.current;if(O.current){const xe=O.current.scrollHeight,Ye=O.current.clientHeight,Ue=O.current.scrollWidth,je=O.current.clientWidth;if(D.current&&R.current&&K.current==="vertical"){const we=go(R.current,"padding","y"),Ne=go(D.current,"margin","y"),_e=D.current.offsetHeight,pe=R.current.offsetHeight-_e-we-Ne,Ae=me/pe;O.current.scrollTop=H.current+Ae*(xe-Ye),Ee.preventDefault(),m(!0),$.start(Ox,()=>{m(!1)})}if(L.current&&N.current&&K.current==="horizontal"){const we=go(N.current,"padding","x"),Ne=go(L.current,"margin","x"),_e=L.current.offsetWidth,pe=N.current.offsetWidth-_e-we-Ne,Ae=Se/pe;O.current.scrollLeft=q.current+Ae*(Ue-je),Ee.preventDefault(),d(!0),j.start(Ox,()=>{d(!1)})}}}),Y=tt(Ee=>{M.current=!1,D.current&&K.current==="vertical"&&D.current.releasePointerCapture(Ee.pointerId),L.current&&K.current==="horizontal"&&L.current.releasePointerCapture(Ee.pointerId)});function Q(Ee){const me=Ee.pointerType==="touch";if(y(me),!me){const Se=Pt(A.current,Ee.target);l(Se)}}const re=C.useMemo(()=>({hasOverflowX:!G.scrollbarXHidden,hasOverflowY:!G.scrollbarYHidden,overflowXStart:E.xStart,overflowXEnd:E.xEnd,overflowYStart:E.yStart,overflowYEnd:E.yEnd,cornerHidden:G.cornerHidden}),[G.scrollbarXHidden,G.scrollbarYHidden,G.cornerHidden,E]),oe={role:"presentation",onPointerEnter:Q,onPointerMove:Q,onPointerDown({pointerType:Ee}){y(Ee==="touch")},onPointerLeave(){l(!1)},style:{position:"relative",[fS.scrollAreaCornerHeight]:`${g.height}px`,[fS.scrollAreaCornerWidth]:`${g.width}px`}},ee=kt("div",t,{state:re,ref:[n,A],props:[oe,s],stateAttributesMapping:$j}),ve=C.useMemo(()=>({handlePointerDown:se,handlePointerMove:Z,handlePointerUp:Y,handleScroll:ae,cornerSize:g,setCornerSize:_,thumbSize:x,setThumbSize:b,touchModality:v,cornerRef:U,scrollingX:u,setScrollingX:d,scrollingY:c,setScrollingY:m,hovering:o,setHovering:l,viewportRef:O,rootRef:A,scrollbarYRef:R,scrollbarXRef:N,thumbYRef:D,thumbXRef:L,rootId:w,hiddenState:G,setHiddenState:V,overflowEdges:E,setOverflowEdges:T,viewportState:re,overflowEdgeThreshold:J}),[se,Z,Y,ae,g,x,v,U,u,d,c,m,o,l,O,A,R,N,D,L,w,G,E,re,J]);return p.jsxs(yae.Provider,{value:ve,children:[jy.element,ee]})});function nAe(e){if(typeof e=="number"){const t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}const rAe=C.createContext(void 0);function iAe(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(r=>{r.forEach(i=>{i.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let gd=(function(e){return e.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",e.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",e.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",e.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",e})({}),UV=!1;function aAe(){UV||K3||(typeof CSS<"u"&&"registerProperty"in CSS&&[gd.scrollAreaOverflowXStart,gd.scrollAreaOverflowXEnd,gd.scrollAreaOverflowYStart,gd.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),UV=!0)}const sAe=C.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{viewportRef:s,scrollbarYRef:o,scrollbarXRef:l,thumbYRef:u,thumbXRef:d,cornerRef:c,setCornerSize:m,setThumbSize:g,rootId:_,setHiddenState:x,hiddenState:b,handleScroll:v,setHovering:y,setOverflowEdges:E,overflowEdges:T,overflowEdgeThreshold:w}=LC(),A=_c(),O=C.useRef(!0),R=Wn(),N=Wn();function D(){const q=s.current,K=o.current,$=l.current,j=u.current,F=d.current,G=c.current;if(!q)return;const V=q.scrollHeight,J=q.scrollWidth,ae=q.clientHeight,se=q.clientWidth,Z=q.scrollTop,Y=q.scrollLeft;if(V===0||J===0)return;const Q=ae>=V,re=se>=J,oe=se/J,ee=ae/V,ve=Math.max(0,J-se),Ee=Math.max(0,V-ae);let me=0,Se=0;re||(A==="rtl"?me=Pu(-Y,0,ve):me=Pu(Y,0,ve),Se=ve-me);const xe=Q?0:Pu(Z,0,Ee),Ye=Q?0:Ee-xe,Ue=re?0:se,je=Q?0:ae,we=go($,"padding","x"),Ne=go(K,"padding","y"),_e=go(F,"margin","x"),pe=go(j,"margin","y"),Ae=Ue-we-_e,he=je-Ne-pe,Oe=$?Math.min($.offsetWidth,Ae):Ae,ge=K?Math.min(K.offsetHeight,he):he,Ie=Math.max(FV,Oe*oe),We=Math.max(FV,ge*ee);if(g(de=>de.height===We&&de.width===Ie?de:{width:Ie,height:We}),K&&j){const de=K.offsetHeight-We-Ne-pe,Te=V-ae,Ke=Te===0?0:Z/Te,st=Math.min(de,Math.max(0,Ke*de));j.style.transform=`translate3d(0,${st}px,0)`}if($&&F){const de=$.offsetWidth-Ie-we-_e,Te=J-se,Ke=Te===0?0:Y/Te,st=A==="rtl"?Pu(Ke*de,-de,0):Pu(Ke*de,0,de);F.style.transform=`translate3d(${st}px,0,0)`}const mt=Pu(me,0,ve),lt=Pu(Se,0,ve),dt=Pu(xe,0,Ee),$e=Pu(Ye,0,Ee),ht=[[gd.scrollAreaOverflowXStart,mt],[gd.scrollAreaOverflowXEnd,lt],[gd.scrollAreaOverflowYStart,dt],[gd.scrollAreaOverflowYEnd,$e]];for(const[de,Te]of ht)q.style.setProperty(de,`${Te}px`);if(G){if(re||Q)m({width:0,height:0});else if(!re&&!Q){const de=K?.offsetWidth||0,Te=$?.offsetHeight||0;m({width:de,height:Te})}}x(de=>{const Te=Q||re;return de.scrollbarYHidden===Q&&de.scrollbarXHidden===re&&de.cornerHidden===Te?de:{scrollbarYHidden:Q,scrollbarXHidden:re,cornerHidden:Te}});const Re={xStart:!re&&mt>w.xStart,xEnd:!re&&lt>w.xEnd,yStart:!Q&&dt>w.yStart,yEnd:!Q&&$e>w.yEnd};E(de=>de.xStart===Re.xStart&&de.xEnd===Re.xEnd&&de.yStart===Re.yStart&&de.yEnd===Re.yEnd?de:Re)}const L=tt(()=>{jr.flushSync(D)});it(()=>s.current?(aAe(),iAe(s.current,L)):void 0,[L,s]),it(()=>{queueMicrotask(L)},[L,b,A]),it(()=>{s.current?.matches(":hover")&&y(!0)},[s,y]),C.useEffect(()=>{const q=s.current;if(typeof ResizeObserver>"u"||!q)return;const K=new ResizeObserver(L);return K.observe(q),N.start(0,()=>{Promise.all(q.getAnimations({subtree:!0}).map($=>$.finished)).then(L).catch(()=>{})}),()=>{K.disconnect(),N.clear()}},[L,s,N]);function U(){O.current=!1}const M={role:"presentation",..._&&{"data-id":`${_}-viewport`},...(!b.scrollbarXHidden||!b.scrollbarYHidden)&&{tabIndex:0},className:jy.className,style:{overflow:"scroll"},onScroll(){s.current&&(L(),O.current||v({x:s.current.scrollLeft,y:s.current.scrollTop}),R.start(100,()=>{O.current=!0}))},onWheel:U,onTouchMove:U,onPointerMove:U,onPointerEnter:U,onKeyDown:U},W=C.useMemo(()=>({hasOverflowX:!b.scrollbarXHidden,hasOverflowY:!b.scrollbarYHidden,overflowXStart:T.xStart,overflowXEnd:T.xEnd,overflowYStart:T.yStart,overflowYEnd:T.yEnd,cornerHidden:b.cornerHidden}),[b.scrollbarXHidden,b.scrollbarYHidden,b.cornerHidden,T]),z=kt("div",t,{ref:[n,s],state:W,props:[M,a],stateAttributesMapping:$j}),H=C.useMemo(()=>({computeThumbPosition:L}),[L]);return p.jsx(rAe.Provider,{value:H,children:z})}),_ae=C.createContext(void 0);function oAe(){const e=C.useContext(_ae);if(e===void 0)throw new Error(hn(54));return e}let pS=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const lAe=C.forwardRef(function(t,n){const{render:r,className:i,orientation:a="vertical",keepMounted:s=!1,...o}=t,{hovering:l,scrollingX:u,scrollingY:d,hiddenState:c,overflowEdges:m,scrollbarYRef:g,scrollbarXRef:_,viewportRef:x,thumbYRef:b,thumbXRef:v,handlePointerDown:y,handlePointerUp:E,rootId:T,thumbSize:w}=LC(),A=C.useMemo(()=>({hovering:l,scrolling:{horizontal:u,vertical:d}[a],orientation:a,hasOverflowX:!c.scrollbarXHidden,hasOverflowY:!c.scrollbarYHidden,overflowXStart:m.xStart,overflowXEnd:m.xEnd,overflowYStart:m.yStart,overflowYEnd:m.yEnd,cornerHidden:c.cornerHidden}),[l,u,d,a,c,m]),O=_c();C.useEffect(()=>{const M=x.current,W=a==="vertical"?g.current:_.current;if(!W)return;function z(H){if(!(!M||!W||H.ctrlKey)){if(H.preventDefault(),a==="vertical"){if(M.scrollTop===0&&H.deltaY<0)return}else if(M.scrollLeft===0&&H.deltaX<0)return;if(a==="vertical"){if(M.scrollTop===M.scrollHeight-M.clientHeight&&H.deltaY>0)return}else if(M.scrollLeft===M.scrollWidth-M.clientWidth&&H.deltaX>0)return;a==="vertical"?M.scrollTop+=H.deltaY:M.scrollLeft+=H.deltaX}}return W.addEventListener("wheel",z,{passive:!1}),()=>{W.removeEventListener("wheel",z)}},[a,_,g,x]);const R={...T&&{"data-id":`${T}-scrollbar`},onPointerDown(M){if(M.button===0&&M.currentTarget===M.target&&x.current){if(b.current&&g.current&&a==="vertical"){const W=go(b.current,"margin","y"),z=go(g.current,"padding","y"),H=b.current.offsetHeight,q=g.current.getBoundingClientRect(),K=M.clientY-q.top-H/2-z+W/2,$=x.current.scrollHeight,j=x.current.clientHeight,F=g.current.offsetHeight-H-z-W,V=K/F*($-j);x.current.scrollTop=V}if(v.current&&_.current&&a==="horizontal"){const W=go(v.current,"margin","x"),z=go(_.current,"padding","x"),H=v.current.offsetWidth,q=_.current.getBoundingClientRect(),K=M.clientX-q.left-H/2-z+W/2,$=x.current.scrollWidth,j=x.current.clientWidth,F=_.current.offsetWidth-H-z-W,G=K/F;let V;O==="rtl"?(V=(1-G)*($-j),x.current.scrollLeft<=0&&(V=-V)):V=G*($-j),x.current.scrollLeft=V}y(M)}},onPointerUp:E,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...a==="vertical"&&{top:0,bottom:`var(${fS.scrollAreaCornerHeight})`,insetInlineEnd:0,[pS.scrollAreaThumbHeight]:`${w.height}px`},...a==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${fS.scrollAreaCornerWidth})`,bottom:0,[pS.scrollAreaThumbWidth]:`${w.width}px`}}},N=kt("div",t,{ref:[n,a==="vertical"?g:_],state:A,props:[R,o],stateAttributesMapping:$j}),D=C.useMemo(()=>({orientation:a}),[a]),L=a==="vertical"?c.scrollbarYHidden:c.scrollbarXHidden;return s||!L?p.jsx(_ae.Provider,{value:D,children:N}):null}),uAe=C.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{thumbYRef:s,thumbXRef:o,handlePointerDown:l,handlePointerMove:u,handlePointerUp:d,setScrollingX:c,setScrollingY:m}=LC(),{orientation:g}=oAe(),_=C.useMemo(()=>({orientation:g}),[g]);return kt("div",t,{ref:[n,g==="vertical"?s:o],state:_,props:[{onPointerDown:l,onPointerMove:u,onPointerUp(b){g==="vertical"&&m(!1),g==="horizontal"&&c(!1),d(b)},style:{...g==="vertical"&&{height:`var(${pS.scrollAreaThumbHeight})`},...g==="horizontal"&&{width:`var(${pS.scrollAreaThumbWidth})`}}},a]})}),cAe=C.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{cornerRef:s,cornerSize:o,hiddenState:l}=LC(),u=kt("div",t,{ref:[n,s],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:o.width,height:o.height}},a]});return l.cornerHidden?null:u}),xae=C.createContext(void 0);function dAe(){const e=C.useContext(xae);if(e===void 0)throw new Error(hn(63));return e}let $V=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Eae={...$p,checked(e){return e?{[$V.checked]:""}:{[$V.unchecked]:""}}},fAe=C.forwardRef(function(t,n){const{checked:r,className:i,defaultChecked:a,id:s,inputRef:o,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:c=!1,required:m=!1,disabled:g=!1,render:_,uncheckedValue:x,...b}=t,{clearErrors:v}=a1(),{state:y,setTouched:E,setDirty:T,validityData:w,setFilled:A,setFocused:O,shouldValidateOnChange:R,validationMode:N,disabled:D,name:L,validation:U}=xo(),{labelId:M}=Wd(),W=D||g,z=L??l,H=tt(d),q=C.useRef(null),K=_o(q,o,U.inputRef),$=C.useRef(null),j=wi(),F=NC({id:s,implicit:!1,controlRef:$}),[G,V]=Ls({controlled:r,default:!!a,name:"Switch",state:"checked"});s1({id:j,commit:U.commit,value:G,controlRef:$,name:z,getValue:()=>G}),it(()=>{q.current&&A(q.current.checked)},[q,A]),Vf(G,()=>{v(z),T(G!==w.initialValue),A(G),R()?U.commit(G):U.commit(G,!0)});const{getButtonProps:J,buttonRef:ae}=za({disabled:W,native:u}),se={id:j,role:"switch","aria-checked":G,"aria-readonly":c||void 0,"aria-labelledby":M,onFocus(){W||O(!0)},onBlur(){const re=q.current;!re||W||(E(!0),O(!1),N==="onBlur"&&U.commit(re.checked))},onClick(re){c||W||(re.preventDefault(),q?.current?.click())}},Z=C.useMemo(()=>Jl({checked:G,disabled:W,id:F,name:z,required:m,style:Rg,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:K,onChange(re){if(re.nativeEvent.defaultPrevented)return;const oe=re.target.checked,ee=ft(qr,re.nativeEvent);H?.(oe,ee),!ee.isCanceled&&V(oe)},onFocus(){$.current?.focus()}},U.getInputValidationProps),[G,W,K,F,z,H,m,V,U]),Y=C.useMemo(()=>({...y,checked:G,disabled:W,readOnly:c,required:m}),[y,G,W,c,m]),Q=kt("span",t,{state:Y,ref:[n,$,ae],props:[se,U.getValidationProps,b,J],stateAttributesMapping:Eae});return p.jsxs(xae.Provider,{value:Y,children:[Q,!G&&z&&x!==void 0&&p.jsx("input",{type:"hidden",name:z,value:x}),p.jsx("input",{...Z})]})}),pAe=C.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{state:s}=xo(),o=dAe(),l={...s,...o};return kt("span",t,{state:l,ref:n,stateAttributesMapping:Eae,props:a})}),Sae=C.createContext(void 0);function hAe(e=!0){const t=C.useContext(Sae);if(t===void 0&&!e)throw new Error(hn(7));return t}const mAe=C.forwardRef(function(t,n){const{className:r,defaultPressed:i=!1,disabled:a=!1,form:s,onPressedChange:o,pressed:l,render:u,type:d,value:c,nativeButton:m=!0,...g}=t,_=wi(c||void 0),x=hAe(),b=x?.value??[],v=x?void 0:i,y=(a||x?.disabled)??!1,[E,T]=Ls({controlled:x?b?.indexOf(_)>-1:l,default:v,name:"Toggle",state:"pressed"}),w=tt((U,M)=>{_&&x?.setGroupValue?.(_,U,M),o?.(U,M)}),{getButtonProps:A,buttonRef:O}=za({disabled:y,native:m}),R=C.useMemo(()=>({disabled:y,pressed:E}),[y,E]),N=[O,n],D=[{"aria-pressed":E,onClick(U){const M=!E,W=ft(qr,U.nativeEvent);w(M,W),!W.isCanceled&&T(M)}},g,A],L=kt("button",t,{enabled:!x,state:R,ref:N,props:D});return x?p.jsx(xC,{tag:"button",render:u,className:r,state:R,refs:N,props:D}):L});let gAe=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const zV={multiple(e){return e?{[gAe.multiple]:""}:null}},bAe=C.forwardRef(function(t,n){const{defaultValue:r,disabled:i=!1,loopFocus:a=!0,onValueChange:s,orientation:o="horizontal",multiple:l=!1,value:u,className:d,render:c,...m}=t,g=Dj(),_=C.useMemo(()=>{if(u===void 0)return r??[]},[u,r]),x=(g?.disabled??!1)||i,[b,v]=Ls({controlled:u,default:_,name:"ToggleGroup",state:"value"}),y=tt((O,R,N)=>{let D;if(l?(D=b.slice(),R?D.push(O):D.splice(b.indexOf(O),1)):D=R?[O]:[],Array.isArray(D)){if(s?.(D,N),N.isCanceled)return;v(D)}}),E=C.useMemo(()=>({disabled:x,multiple:l,orientation:o}),[x,o,l]),T=C.useMemo(()=>({disabled:x,orientation:o,setGroupValue:y,value:b}),[x,o,y,b]),w={role:"group"},A=kt("div",t,{enabled:!!g,state:E,ref:n,props:[w,m],stateAttributesMapping:zV});return p.jsx(Sae.Provider,{value:T,children:g?A:p.jsx(yC,{render:c,className:d,state:E,refs:[n],props:[w,m],stateAttributesMapping:zV,loopFocus:a})})}),wae=C.createContext(void 0);function l1(e){const t=C.useContext(wae);if(t===void 0&&!e)throw new Error(hn(72));return t}const vAe={...pj,disabled:qe(e=>e.disabled),instantType:qe(e=>e.instantType),isInstantPhase:qe(e=>e.isInstantPhase),trackCursorAxis:qe(e=>e.trackCursorAxis),disableHoverablePopup:qe(e=>e.disableHoverablePopup),lastOpenChangeReason:qe(e=>e.openChangeReason),closeDelay:qe(e=>e.closeDelay)};class zj extends hC{constructor(t){super({...yAe(),...t},{popupRef:C.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new J0},vAe)}setOpen=(t,n)=>{const r=n.reason,i=r===Cr,a=t&&r===Ay,s=!t&&(r===Gu||r===Z0);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const o=()=>{const l={open:t,openChangeReason:r};a?l.instantType="focus":s?l.instantType="dismiss":r===Cr&&(l.instantType=void 0);const u=n.trigger?.id??null;(u||t)&&(l.activeTriggerId=u,l.activeTriggerElement=n.trigger??null),this.update(l)};i?jr.flushSync(o):o()};static useStore(t,n){const r=Ui(()=>t??new zj(n)).current,i=hj({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}}function yAe(){return{...fj(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function _Ae(e){const{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a="none",actionsRef:s,onOpenChange:o,onOpenChangeComplete:l,handle:u,triggerId:d,defaultTriggerId:c=null,children:m}=e,g=zj.useStore(u?.store,{open:r??n,activeTriggerId:d!==void 0?d:c});g.useControlledProp("open",r,n),g.useControlledProp("activeTriggerId",d,c),g.useContextCallback("onOpenChange",o),g.useContextCallback("onOpenChangeComplete",l);const _=g.useState("open"),x=g.useState("activeTriggerId"),b=g.useState("payload");g.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i});const v=!t&&_;it(()=>{_&&t&&g.setOpen(!1,ft(Z_e))},[_,t,g]),g.useSyncedValue("disabled",t),cj(g);const{forceUnmount:y,transitionStatus:E}=dj(v,g),T=g.useState("isInstantPhase"),w=g.useState("instantType"),A=g.useState("lastOpenChangeReason"),O=C.useRef(null);it(()=>{E==="ending"&&A===qr||E!=="ending"&&T?(w!=="delay"&&(O.current=w),g.set("instantType","delay")):O.current!==null&&(g.set("instantType",O.current),O.current=null)},[E,T,A,w,g]),it(()=>{v&&x==null&&g.set("payload",void 0)},[g,x,v]);const R=C.useCallback(()=>{g.setOpen(!1,xAe(g,ij))},[g]);C.useImperativeHandle(s,()=>({unmount:y,close:R}),[y,R]);const N=g.useState("floatingRootContext"),D=Lre(N,{enabled:!t}),L=Ig(N,{enabled:!t,referencePress:!0}),U=hxe(N,{enabled:!t&&a!=="none",axis:a==="none"?void 0:a}),{getReferenceProps:M,getFloatingProps:W,getTriggerProps:z}=Vd([D,L,U]),H=C.useMemo(()=>M(),[M]),q=C.useMemo(()=>z(),[z]),K=C.useMemo(()=>W(),[W]);return g.useSyncedValues({floatingRootContext:N,activeTriggerProps:H,inactiveTriggerProps:q,popupProps:K}),p.jsx(wae.Provider,{value:g,children:typeof m=="function"?m({payload:b}):m})}function xAe(e,t){const n=ft(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const Cae=C.createContext(void 0);function EAe(){return C.useContext(Cae)}const SAe=600,wAe=C.forwardRef(function(t,n){const{className:r,render:i,handle:a,payload:s,disabled:o,delay:l,closeDelay:u,id:d,...c}=t,m=l1(!0),g=a?.store??m;if(!g)throw new Error(hn(82));const _=wi(d),x=g.useState("isTriggerActive",_),b=g.useState("floatingRootContext"),v=g.useState("isOpenedByTrigger",_),y=C.useRef(null),E=l??SAe,T=u??0,{registerTrigger:w,isMountedByThisTrigger:A}=uj(_,y,g,{payload:s,closeDelay:T}),O=EAe(),{delayRef:R,isInstantPhase:N,hasProvider:D}=rxe(b,{open:v});g.useSyncedValue("isInstantPhase",N);const L=g.useState("disabled"),U=o??L,M=g.useState("trackCursorAxis"),W=g.useState("disableHoverablePopup"),z=jre(b,{enabled:!U,mouseOnly:!0,move:!1,handleClose:!W&&M!=="both"?bj():null,restMs(){const $=O?.delay,j=typeof R.current=="object"?R.current.open:void 0;let F=E;return D&&(j!==0?F=l??$??E:F=0),F},delay(){const $=typeof R.current=="object"?R.current.close:void 0;let j=T;return u==null&&D&&(j=$),{close:j}},triggerElementRef:y,isActiveTrigger:x}),H=C.useMemo(()=>({open:v}),[v]),q=g.useState("triggerProps",A);return kt("button",t,{state:H,ref:[n,w,y],props:[z,q,{id:_},c],stateAttributesMapping:_C})}),Tae=C.createContext(void 0);function CAe(){const e=C.useContext(Tae);if(e===void 0)throw new Error(hn(70));return e}const TAe=C.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t;return l1().useState("mounted")||r?p.jsx(Tae.Provider,{value:r,children:p.jsx(QTe,{ref:n,...i})}):null}),Aae=C.createContext(void 0);function kae(){const e=C.useContext(Aae);if(e===void 0)throw new Error(hn(71));return e}const AAe=C.forwardRef(function(t,n){const{render:r,className:i,anchor:a,positionMethod:s="absolute",side:o="top",align:l="center",sideOffset:u=0,alignOffset:d=0,collisionBoundary:c="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:_=!1,disableAnchorTracking:x=!1,collisionAvoidance:b=W3,...v}=t,y=l1(),E=CAe(),T=y.useState("open"),w=y.useState("mounted"),A=y.useState("trackCursorAxis"),O=y.useState("disableHoverablePopup"),R=y.useState("floatingRootContext"),N=y.useState("instantType"),D=y.useState("transitionStatus"),L=r1({anchor:a,positionMethod:s,floatingRootContext:R,mounted:w,side:o,sideOffset:u,align:l,alignOffset:d,collisionBoundary:c,collisionPadding:m,sticky:_,arrowPadding:g,disableAnchorTracking:x,keepMounted:E,collisionAvoidance:b,adaptiveOrigin:Qre}),U=C.useMemo(()=>{const H={};return(!T||A==="both"||O)&&(H.pointerEvents="none"),{role:"presentation",hidden:!w,style:{...L.positionerStyles,...H}}},[T,A,O,w,L.positionerStyles]),M=C.useMemo(()=>({open:T,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:A!=="none"?"tracking-cursor":N}),[T,L.side,L.align,L.anchorHidden,A,N]),W=C.useMemo(()=>({...M,arrowRef:L.arrowRef,arrowStyles:L.arrowStyles,arrowUncentered:L.arrowUncentered}),[M,L.arrowRef,L.arrowStyles,L.arrowUncentered]),z=kt("div",t,{state:M,props:[U,Pg(D),v],ref:[n,y.useStateSetter("positionerElement")],stateAttributesMapping:cs});return p.jsx(Aae.Provider,{value:W,children:z})}),kAe={...cs,...Us},OAe=C.forwardRef(function(t,n){const{className:r,render:i,...a}=t,s=l1(),{side:o,align:l}=kae(),u=s.useState("open"),d=s.useState("mounted"),c=s.useState("instantType"),m=s.useState("transitionStatus"),g=s.useState("popupProps"),_=s.useState("payload"),x=s.useState("popupElement"),b=s.useState("positionerElement"),v=s.useState("floatingRootContext"),y=_c();ia({open:u,ref:s.context.popupRef,onComplete(){u&&s.context.onOpenChangeComplete?.(!0)}});function E(){v.context.events.emit("measure-layout")}function T(D,L){v.context.events.emit("measure-layout-complete",{previousDimensions:D,nextDimensions:L})}const w=C.useCallback(()=>s.context.triggerElements.size>1,[s]);ZTe({popupElement:x,positionerElement:b,mounted:d,content:_,enabled:w,onMeasureLayout:E,onMeasureLayoutComplete:T,side:o,direction:y});const A=s.useState("disabled"),O=s.useState("closeDelay");Mre(v,{enabled:!A,closeDelay:O});const R=C.useMemo(()=>({open:u,side:o,align:l,instant:c,transitionStatus:m}),[u,o,l,c,m]);return kt("div",t,{state:R,ref:[n,s.context.popupRef,s.useStateSetter("popupElement")],props:[g,Pg(m),a],stateAttributesMapping:kAe})}),RAe=C.forwardRef(function(t,n){const{className:r,render:i,...a}=t,o=l1().useState("instantType"),{open:l,arrowRef:u,side:d,align:c,arrowUncentered:m,arrowStyles:g}=kae(),_=C.useMemo(()=>({open:l,side:d,align:c,uncentered:m,instant:o}),[l,d,c,m,o]);return kt("div",t,{state:_,ref:[n,u],props:[{style:g,"aria-hidden":!0},a],stateAttributesMapping:cs})}),NAe=function(t){const{delay:n,closeDelay:r,timeout:i=400}=t,a=C.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),s=C.useMemo(()=>({open:n,close:r}),[n,r]);return p.jsx(Cae.Provider,{value:a,children:p.jsx(nxe,{delay:s,timeoutMs:i,children:t.children})})};function IAe(e){return kt(e.defaultTagName??"div",e,e)}function DAe({className:e,...t}){return p.jsx("div",{"data-slot":"input-group",role:"group",className:ze("border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot=input-group-control]:focus-visible]:ring-inset has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[[data-slot][aria-invalid=true]]:ring-inset h-7 rounded-md border transition-colors has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-md 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-[>[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 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",e),...t})}const LAe=$d("text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first","inline-end":"pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last","block-start":"px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start","block-end":"px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function PAe({className:e,align:t="inline-start",...n}){return p.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:ze(LAe({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const MAe=$d("gap-2 rounded-md text-xs/relaxed shadow-none flex items-center",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function Oae({className:e,type:t="button",variant:n="ghost",size:r="xs",...i}){return p.jsx(Be,{type:t,"data-size":r,variant:n,className:ze(MAe({size:r}),e),...i})}function jAe({className:e,...t}){return p.jsx(Ht,{"data-slot":"input-group-control",className:ze("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1",e),...t})}const Rae=wTe;function FAe({className:e,children:t,...n}){return p.jsxs(ZCe,{"data-slot":"combobox-trigger",className:ze("[&_svg:not([class*='size-'])]:size-3.5",e),...n,children:[t,p.jsx(te,{icon:Mg,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})]})}function BAe({className:e,...t}){return p.jsx(rTe,{"data-slot":"combobox-clear",render:p.jsx(Oae,{variant:"ghost",size:"icon-xs"}),className:ze(e),...t,children:p.jsx(te,{icon:Yr,strokeWidth:2,className:"pointer-events-none"})})}function Nae({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:i=!1,...a}){return p.jsxs(DAe,{className:ze("w-auto",e),children:[p.jsx(tTe,{render:p.jsx(jAe,{disabled:n}),...a}),p.jsxs(PAe,{align:"inline-end",children:[r&&p.jsx(Oae,{size:"icon-xs",variant:"ghost",render:p.jsx(FAe,{}),"data-slot":"input-group-button",className:"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",disabled:n}),i&&p.jsx(BAe,{disabled:n})]}),t]})}function Iae({className:e,side:t="bottom",sideOffset:n=6,align:r="start",alignOffset:i=0,anchor:a,...s}){return p.jsx(uTe,{children:p.jsx(cTe,{side:t,sideOffset:n,align:r,alignOffset:i,anchor:a,className:"isolate z-50",children:p.jsx(fTe,{"data-slot":"combobox-content","data-chips":!!a,className:ze("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 *:data-[slot=input-group]:bg-input/20 dark:bg-popover max-h-72 min-w-32 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:shadow-none group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)",e),...s})})})}function Dae({className:e,...t}){return p.jsx(oTe,{"data-slot":"combobox-list",className:ze("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0 overflow-y-auto overscroll-contain",e),...t})}function XL({className:e,children:t,...n}){return p.jsxs(vTe,{"data-slot":"combobox-item",className:ze("data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[t,p.jsx(CTe,{render:p.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:p.jsx(te,{icon:di,strokeWidth:2,className:"pointer-events-none"})})]})}function UAe({className:e,...t}){return p.jsx(hTe,{"data-slot":"combobox-group",className:ze(e),...t})}function $Ae({className:e,...t}){return p.jsx(mTe,{"data-slot":"combobox-label",className:ze("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function Lae({className:e,...t}){return p.jsx(yTe,{"data-slot":"combobox-empty",className:ze("text-muted-foreground hidden w-full justify-center py-2 text-center text-xs/relaxed group-data-empty/combobox-content:flex",e),...t})}function HV({className:e,...t}){return p.jsx(Rj,{"data-slot":"combobox-separator",className:ze("bg-border/50 -mx-1 my-1 h-px",e),...t})}const zAe=$d("hover:text-foreground hover:bg-accent/20 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive aria-pressed:bg-accent aria-pressed:text-accent-foreground aria-pressed:hover:bg-accent data-[state=on]:bg-accent data-[state=on]:text-accent-foreground data-[state=on]:hover:bg-accent gap-1 rounded-md text-xs font-medium transition-all [&_svg:not([class*='size-'])]:size-3.5 group/toggle inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border-input hover:bg-accent/20 border bg-transparent"},size:{default:"h-7 min-w-7 px-2",sm:"h-6 min-w-6 rounded-[min(var(--radius-md),8px)] px-1.5 text-[0.625rem] [&_svg:not([class*='size-'])]:size-3",lg:"h-8 min-w-8 px-2"}},defaultVariants:{variant:"default",size:"default"}}),Pae=C.createContext({size:"default",variant:"default",spacing:0,orientation:"horizontal"});function HAe({className:e,variant:t,size:n,spacing:r=0,orientation:i="horizontal",children:a,...s}){return p.jsx(bAe,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:ze("rounded-md data-[size=sm]:rounded-[min(var(--radius-md),8px)] group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch",e),...s,children:p.jsx(Pae.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function VV({className:e,children:t,variant:n="default",size:r="default",...i}){const a=C.useContext(Pae);return p.jsx(mAe,{"data-slot":"toggle-group-item","data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:ze("group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",zAe({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}async function pt(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const r=await n.json().catch(()=>({error:"Request failed"}));throw new Error(r.error||"Request failed")}return n.json()}const rc="";function PC(){return ln({queryKey:["tasks"],queryFn:()=>pt(`${rc}/api/tasks`)})}function Mae(e){return ln({queryKey:["tasks",e],queryFn:()=>pt(`${rc}/api/tasks/${e}`),enabled:!!e})}function VAe(){const e=pn();return rn({mutationFn:t=>pt(`${rc}/api/tasks`,{method:"POST",body:JSON.stringify({...t,status:"IN_PROGRESS"})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function WAe(){const e=pn();return rn({mutationFn:({taskId:t,status:n,position:r})=>pt(`${rc}/api/tasks/${t}/status`,{method:"PATCH",body:JSON.stringify({status:n,position:r})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function MC(){const e=pn();return rn({mutationFn:({taskId:t,updates:n})=>pt(`${rc}/api/tasks/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{taskId:n})=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["tasks",n]})}})}function GAe(){const e=pn();return rn({mutationFn:({taskId:t,deleteLinkedWorktree:n})=>{const r=n?`${rc}/api/tasks/${t}?deleteLinkedWorktree=true`:`${rc}/api/tasks/${t}`;return pt(r,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["worktrees"]})}})}function qAe(){const e=pn();return rn({mutationFn:({ids:t,deleteLinkedWorktrees:n})=>pt(`${rc}/api/tasks/bulk`,{method:"DELETE",body:JSON.stringify({ids:t,deleteLinkedWorktrees:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["worktrees"]})}})}function KAe(){const e=pn();return rn({mutationFn:({taskId:t,pinned:n})=>pt(`${rc}/api/tasks/${t}`,{method:"PATCH",body:JSON.stringify({pinned:n})}),onSuccess:(t,{taskId:n})=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["tasks",n]}),e.invalidateQueries({queryKey:["worktrees"]})}})}const Fg="";function YAe(e){return ln({queryKey:["fs","list",e],queryFn:()=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return pt(`${Fg}/api/fs/list${t}`)},enabled:e!==null})}function XAe(e){return ln({queryKey:["git","branches",e],queryFn:()=>pt(`${Fg}/api/git/branches?repo=${encodeURIComponent(e)}`),enabled:!!e})}function ZAe(e,t={}){const{staged:n=!1,ignoreWhitespace:r=!1,includeUntracked:i=!1,baseBranch:a}=t;return ln({queryKey:["git","diff",e,n,r,i,a],queryFn:()=>{const s=new URLSearchParams({path:e,...n&&{staged:"true"},...r&&{ignoreWhitespace:"true"},...i&&{includeUntracked:"true"},...a&&{baseBranch:a}});return pt(`${Fg}/api/git/diff?${s}`)},enabled:!!e,refetchInterval:5e3})}function QAe(e){return ln({queryKey:["git","status",e],queryFn:()=>pt(`${Fg}/api/git/status?path=${encodeURIComponent(e)}`),enabled:!!e,refetchInterval:5e3})}async function JAe(e){return pt(`${Fg}/api/fs/is-git-repo?path=${encodeURIComponent(e)}`)}function eke(e){return ln({queryKey:["fs","stat",e],queryFn:()=>pt(`${Fg}/api/fs/stat?path=${encodeURIComponent(e)}`),enabled:!!e&&e.trim().length>0})}const fl="",sn={PORT:"server.port",WORKTREE_BASE_PATH:"worktree_base_path",HOME_DIR:"home_dir",DEFAULT_GIT_REPOS_DIR:"paths.defaultGitReposDir",EDITOR_APP:"editor.app",EDITOR_HOST:"editor.host",EDITOR_SSH_PORT:"editor.sshPort",LINEAR_API_KEY:"integrations.linearApiKey",GITHUB_PAT:"integrations.githubPat",DEFAULT_AGENT:"agent.defaultAgent",OPENCODE_MODEL:"agent.opencodeModel",OPENCODE_DEFAULT_AGENT:"agent.opencodeDefaultAgent",OPENCODE_PLAN_AGENT:"agent.opencodePlanAgent",LANGUAGE:"appearance.language",SYNC_CLAUDE_CODE_THEME:"appearance.syncClaudeCodeTheme",CLAUDE_CODE_LIGHT_THEME:"appearance.claudeCodeLightTheme",CLAUDE_CODE_DARK_THEME:"appearance.claudeCodeDarkTheme"},tke=7777;function sa(e){return ln({queryKey:["config",e],queryFn:()=>pt(`${fl}/api/config/${e}`)})}function jae(){const e=sa(sn.PORT);return{...e,data:e.data?.value??tke,isDefault:e.data?.isDefault??!0}}function nke(){const e=sa(sn.WORKTREE_BASE_PATH);return{...e,data:e.data?.value??""}}function rke(){const e=sa(sn.HOME_DIR);return{...e,data:e.data?.value??""}}function Hj(){const e=sa(sn.DEFAULT_GIT_REPOS_DIR);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function u1(){const e=sa(sn.EDITOR_APP);return{...e,data:e.data?.value??"vscode",isDefault:e.data?.isDefault??!0}}function c1(){const e=sa(sn.EDITOR_HOST);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function d1(){const e=sa(sn.EDITOR_SSH_PORT);return{...e,data:e.data?.value??22,isDefault:e.data?.isDefault??!0}}function ike(){const e=sa(sn.LINEAR_API_KEY);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function ake(){const e=sa(sn.GITHUB_PAT);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function Vj(){const e=sa(sn.DEFAULT_AGENT);return{...e,data:e.data?.value??"claude",isDefault:e.data?.isDefault??!0}}function Wj(){const e=sa(sn.OPENCODE_MODEL);return{...e,data:e.data?.value??null,isDefault:e.data?.isDefault??!0}}function Fae(){const e=sa(sn.OPENCODE_DEFAULT_AGENT);return{...e,data:e.data?.value??"build",isDefault:e.data?.isDefault??!0}}function Bae(){const e=sa(sn.OPENCODE_PLAN_AGENT);return{...e,data:e.data?.value??"plan",isDefault:e.data?.isDefault??!0}}function ske(){const e=sa(sn.LANGUAGE);return{...e,data:e.data?.value??null,isDefault:e.data?.isDefault??!0}}function oke(){const e=sa(sn.SYNC_CLAUDE_CODE_THEME);return{...e,data:!!e.data?.value,isDefault:e.data?.isDefault??!0}}const WV=["light","light-ansi","light-daltonized","dark","dark-ansi","dark-daltonized"];function lke(){const e=sa(sn.CLAUDE_CODE_LIGHT_THEME);return{...e,data:e.data?.value??"light-ansi",isDefault:e.data?.isDefault??!0}}function uke(){const e=sa(sn.CLAUDE_CODE_DARK_THEME);return{...e,data:e.data?.value??"dark-ansi",isDefault:e.data?.isDefault??!0}}function Uae(){const e=pn();return rn({mutationFn:({key:t,value:n})=>pt(`${fl}/api/config/${t}`,{method:"PUT",body:JSON.stringify({value:n})}),onSuccess:(t,{key:n})=>{e.invalidateQueries({queryKey:["config",n]}),n===sn.GITHUB_PAT&&(e.invalidateQueries({queryKey:["github-user"]}),e.invalidateQueries({queryKey:["github-prs"]}),e.invalidateQueries({queryKey:["github-issues"]}),e.invalidateQueries({queryKey:["github-orgs"]}))}})}function cke(){const e=pn();return rn({mutationFn:t=>pt(`${fl}/api/config/${t}`,{method:"DELETE"}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["config",n]})}})}function dke(){return ln({queryKey:["config","notifications"],queryFn:()=>pt(`${fl}/api/config/notifications`)})}function fke(){const e=pn();return rn({mutationFn:t=>pt(`${fl}/api/config/notifications`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","notifications"]})}})}function pke(){return rn({mutationFn:e=>pt(`${fl}/api/config/notifications/test/${e}`,{method:"POST"})})}function hke(){return ln({queryKey:["config","z-ai"],queryFn:()=>pt(`${fl}/api/config/z-ai`)})}function mke(){const e=pn();return rn({mutationFn:t=>pt(`${fl}/api/config/z-ai`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","z-ai"]}),e.invalidateQueries({queryKey:["monitoring","claude-usage"]})}})}function gke(){return ln({queryKey:["config","developer-mode"],queryFn:()=>pt(`${fl}/api/config/developer-mode`),staleTime:1/0})}function bke(){return rn({mutationFn:()=>pt(`${fl}/api/config/restart`,{method:"POST"})})}function vke(){const e=ln({queryKey:["health"],queryFn:()=>pt(`${fl}/health`),staleTime:1/0});return{...e,version:e.data?.version??null,uptime:e.data?.uptime??null}}const il={claude:"Claude Code",opencode:"OpenCode"},$ae={claude:"npm install -g @anthropic-ai/claude-code",opencode:"npm install -g opencode-ai@latest"},zae={claude:"https://docs.anthropic.com/en/docs/claude-code/overview",opencode:"https://opencode.ai/docs/"},Hae="";function jC(){return ln({queryKey:["repositories"],queryFn:()=>pt(`${Hae}/api/repositories`)})}function yke(){const e=pn();return rn({mutationFn:({id:t,updates:n})=>pt(`${Hae}/api/repositories/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{id:n})=>{e.invalidateQueries({queryKey:["repositories"]}),e.invalidateQueries({queryKey:["repositories",n]}),e.invalidateQueries({queryKey:["projects"]})}})}function Bg({className:e,children:t,...n}){return p.jsxs(tAe,{"data-slot":"scroll-area",className:ze("relative",e),...n,children:[p.jsx(sAe,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),p.jsx(_ke,{}),p.jsx(cAe,{})]})}function _ke({className:e,orientation:t="vertical",...n}){return p.jsx(lAe,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:ze("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none",e),...n,children:p.jsx(uAe,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function bd({open:e,onOpenChange:t,onSelect:n,initialPath:r}){const[i,a]=C.useState(r||null),[s,o]=C.useState(""),[l,u]=C.useState("");C.useEffect(()=>{e&&(a(r||null),o(""),u(""))},[e,r]);const{data:d,isLoading:c,error:m}=YAe(e?i??"":null),g=E=>{d&&(a(d.path+"/"+E),u(""))},_=()=>{d?.parent&&d.parent!==d.path&&(a(d.parent),u(""))},x=()=>{a(null),u("")},b=()=>{s.trim()&&(a(s.trim()),u(""))},v=E=>{n(E),t(!1)},y=d?.entries.filter(E=>E.name.toLowerCase().includes(l.toLowerCase()));return p.jsx(So,{open:e,onOpenChange:t,children:p.jsxs(wo,{className:"sm:max-w-lg overflow-x-hidden max-w-[calc(100vw-2rem)]",children:[p.jsxs(cl,{children:[p.jsx(dl,{children:"Select Git Repository"}),p.jsx(Up,{children:"Choose an existing git repository"})]}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"Click folder names to navigate • Use action buttons to select"}),p.jsx(uCe,{}),p.jsxs("div",{className:"space-y-1 min-w-0",children:[p.jsx("label",{className:"text-xs font-medium",children:"Enter path manually:"}),p.jsxs("div",{className:"flex gap-2 min-w-0",children:[p.jsx(Ht,{value:s,onChange:E=>o(E.target.value),placeholder:"/path/to/your/project",onKeyDown:E=>E.key==="Enter"&&b(),className:"flex-1 min-w-0"}),p.jsx(Be,{variant:"outline",size:"sm",onClick:b,className:"shrink-0",children:"Go"})]})]}),p.jsxs("div",{className:"space-y-1 min-w-0",children:[p.jsx("label",{className:"text-xs font-medium",children:"Search current directory:"}),p.jsxs("div",{className:"relative",children:[p.jsx(te,{icon:jg,size:14,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),p.jsx(Ht,{value:l,onChange:E=>u(E.target.value),placeholder:"Filter folders and files...",className:"pl-8"})]})]}),p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsx(Be,{variant:"outline",size:"icon-sm",onClick:x,title:"Home",className:"shrink-0",children:p.jsx(te,{icon:FSe,size:14,strokeWidth:2})}),p.jsx(Be,{variant:"outline",size:"icon-sm",onClick:_,disabled:!d||d.parent===d.path,title:"Parent directory",className:"shrink-0",children:p.jsx(te,{icon:xj,size:14,strokeWidth:2})}),p.jsx("code",{className:"min-w-0 flex-1 text-xs bg-muted/50 px-2 py-1 rounded truncate overflow-hidden",children:d?.path||"~"}),p.jsxs(Be,{variant:"outline",size:"sm",onClick:()=>d&&v(d.path),disabled:!d,className:"shrink-0 max-sm:px-2",title:"Select current directory",children:[p.jsx(te,{icon:GL,size:14,strokeWidth:2,className:"sm:hidden"}),p.jsx("span",{className:"max-sm:hidden",children:"Select Current"})]})]}),p.jsx(Bg,{className:"h-64 border rounded-md min-w-0",children:p.jsxs("div",{className:"p-1 min-w-0",children:[c&&p.jsx("div",{className:"text-muted-foreground text-xs p-3",children:"Loading..."}),m&&p.jsx("div",{className:"text-destructive text-xs p-3",children:m.message}),d&&y&&p.jsxs(p.Fragment,{children:[y.length===0&&p.jsx("div",{className:"text-muted-foreground text-xs p-3",children:l?"No matches found":"Empty directory"}),y.map(E=>p.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted group min-w-0",children:E.type==="directory"?p.jsxs(p.Fragment,{children:[p.jsx(te,{icon:E.isGitRepo?GL:Ba,size:16,strokeWidth:2,className:"text-accent shrink-0"}),p.jsx("button",{onClick:()=>g(E.name),className:"flex-1 text-left text-xs truncate hover:underline min-w-0",children:E.name}),E.isGitRepo&&p.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded border border-accent/50 text-accent font-medium shrink-0",children:[p.jsx("span",{className:"max-sm:hidden",children:"git repo"}),p.jsx("span",{className:"sm:hidden",children:"git"})]})]}):p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"w-4 shrink-0"}),p.jsx("span",{className:"flex-1 text-xs text-muted-foreground truncate min-w-0",children:E.name})]})},E.name))]})]})}),p.jsxs(i1,{children:[p.jsx(RC,{render:p.jsx(Be,{variant:"outline"}),children:"Cancel"}),p.jsx(Be,{onClick:()=>d&&v(d.path),disabled:!d,children:"Select Path"})]})]})})}function xke(){const e=ln({queryKey:["opencode","models"],queryFn:()=>pt("/api/opencode/models"),staleTime:3e5,gcTime:6e5});return{...e,installed:e.data?.installed??!1,providers:e.data?.providers??{},models:e.data?.models??[]}}function Gj({value:e,onChange:t,placeholder:n,showUseDefault:r=!0,className:i}){const{t:a}=Ct("common"),{providers:s,installed:o,isLoading:l,isError:u}=xke(),d=C.useMemo(()=>Object.entries(s).sort(([m],[g])=>m.localeCompare(g)),[s]),c=m=>m||"";return l?p.jsx("div",{className:`text-muted-foreground text-sm ${i}`,children:a("status.loading")}):u||!o?p.jsx("div",{className:`text-muted-foreground text-sm ${i}`,children:a("opencode.notInstalled","OpenCode not installed")}):p.jsx("div",{className:i,children:p.jsxs(Rae,{value:e||"",onValueChange:m=>t(m===""?null:m),itemToStringLabel:c,children:[p.jsx(Nae,{placeholder:n||a("opencode.selectModel","Select model"),className:"w-full"}),p.jsx(Iae,{children:p.jsxs(Dae,{children:[p.jsx(Lae,{children:a("opencode.noModelsFound","No models found")}),r&&p.jsxs(p.Fragment,{children:[p.jsx(XL,{value:"",children:p.jsx("span",{className:"text-muted-foreground",children:a("opencode.useDefault","Use default")})}),d.length>0&&p.jsx(HV,{})]}),d.map(([m,g],_)=>p.jsxs(UAe,{children:[p.jsx($Ae,{children:m}),g.map(x=>p.jsx(XL,{value:`${m}/${x}`,children:p.jsx("span",{className:"pl-2",children:x})},`${m}/${x}`)),_<d.length-1&&p.jsx(HV,{})]},m))]})})]})})}function Eke(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Ske(e){const t=e.trim().split(/\s+/).slice(0,4).join(" "),n=Eke(t);if(!n)return"";const r=Math.random().toString(36).substring(2,6);return`${n}-${r}`}function qj({open:e,onOpenChange:t,defaultRepository:n,showTrigger:r=!0}={}){const{t:i}=Ct("tasks"),{t:a}=Ct("common"),[s,o]=C.useState(!1),l=e??s,u=t??o,[d,c]=C.useState(!1),[m,g]=C.useState(""),[_,x]=C.useState(""),[b,v]=C.useState(""),[y,E]=C.useState(""),[T,w]=C.useState(""),[A,O]=C.useState(""),[R,N]=C.useState("default"),[D,L]=C.useState(!1),[U,M]=C.useState("claude"),[W,z]=C.useState(null),[H,q]=C.useState("browse"),[K,$]=C.useState(""),[j,F]=C.useState(null),[G,V]=C.useState(!1),[J,ae]=C.useState(null),se=Sa(),Z=VAe(),Y=C.useRef(null),{data:Q}=nke(),{data:re}=Hj(),{data:oe}=Vj(),{data:ee}=Wj(),{data:ve}=jC(),{data:Ee,isLoading:me}=XAe(b||null),Se=W?ve?.find(pe=>pe.id===W):null,xe=C.useMemo(()=>{if(!ve)return[];if(Se&&K===Se.displayName||!K.trim())return ve;const pe=K.toLowerCase();return ve.filter(Ae=>Ae.displayName.toLowerCase().includes(pe)||Ae.path.toLowerCase().includes(pe))},[ve,K,Se]);C.useEffect(()=>{ve&&ve.length>0?q("saved"):q("browse")},[ve]),C.useEffect(()=>{if(l){const pe=n??(ve&&ve.length>0?ve[0]:null);if(pe?.defaultAgent?M(pe.defaultAgent):oe&&M(oe),pe?.opencodeModel?ae(pe.opencodeModel):ae(ee||null),n)z(n.id),v(n.path),$(n.displayName),q("saved");else if(ve&&ve.length>0){const Ae=ve[0];z(Ae.id),v(Ae.path),$(Ae.displayName),q("saved")}}},[l,n,ve,oe,ee]),C.useEffect(()=>{E(Ee?Ee.defaultBranch||Ee.branches[0]||"main":"")},[Ee,b]);const Ye=pe=>{g(pe),O(Ske(pe))},Ue=async pe=>{F(null),V(!0);try{if(!(await JAe(pe)).isGitRepo){F(i("createModal.errors.notGitRepo")),V(!1);return}v(pe);const he=ve?.find(Oe=>Oe.path===pe);z(he?he.id:null)}catch(Ae){F(Ae instanceof Error?Ae.message:i("createModal.errors.validationFailed"))}finally{V(!1)}},je=pe=>{if(pe.preventDefault(),!m.trim()||!b)return;const Ae=b.split("/").pop()||"repo",he=T.trim()||A,Oe=`${Q}/${he}`,ge=U==="claude"?Se?.claudeOptions:Se?.opencodeOptions;Z.mutate({title:m.trim(),description:_.trim(),agent:U,aiMode:R,repoPath:b,repoName:Ae,baseBranch:y||"main",branch:he,worktreePath:Oe,copyFiles:Se?.copyFiles||void 0,startupScript:Se?.startupScript||void 0,agentOptions:ge||void 0,opencodeModel:U==="opencode"?J:void 0},{onSuccess:Ie=>{const We=_.trim()?{aiMode:R,description:_.trim(),focusTerminal:!0}:{aiMode:R,focusTerminal:!0};u(!1),g(""),x(""),v(""),E(""),w(""),O(""),N("default"),L(!1),M(oe||"claude"),ae(null),z(null),$(""),F(null),q(ve&&ve.length>0?"saved":"browse"),se({to:"/tasks/$taskId",params:{taskId:Ie.id},state:We})},onError:Ie=>{Et.error(i("createModal.errors.createFailed"),{description:Ie instanceof Error?Ie.message:String(Ie)})}})},we=!Z.isPending&&!!m.trim()&&!!b;Ra("meta+enter",()=>{Y.current&&Y.current.requestSubmit()},{enabled:l&&we,allowInInput:!0,ignoreContext:!0,deps:[l,we]});const Ne=T.trim()||A,_e=Ne?`${Q}/${Ne}`:"";return p.jsxs(p.Fragment,{children:[p.jsxs(So,{open:l,onOpenChange:u,children:[r&&p.jsxs(Kwe,{render:p.jsx(Be,{size:"sm"}),children:[p.jsx(te,{icon:Cj,size:16,strokeWidth:2,"data-slot":"icon",className:"-translate-y-px"}),i("newTask")]}),p.jsx(wo,{className:"sm:max-w-md max-h-[80dvh] flex flex-col overflow-hidden",children:p.jsxs("form",{ref:Y,onSubmit:je,className:"flex flex-col min-h-0 flex-1",children:[p.jsxs(cl,{className:"shrink-0",children:[p.jsx(dl,{children:i("createModal.title")}),p.jsx(Up,{children:i("createModal.description")})]}),p.jsxs(Tp,{className:"mt-4 pb-4 overflow-y-auto min-h-0 flex-1",children:[p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"title",children:i("createModal.fields.title")}),p.jsx(Ht,{id:"title",value:m,onChange:pe=>Ye(pe.target.value),placeholder:i("createModal.fields.titlePlaceholder"),required:!0})]}),p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"description",children:i("createModal.fields.description")}),p.jsx(Lie,{id:"description",value:_,onValueChange:pe=>{x(pe),D||N(pe.trim()?"plan":"default")},placeholder:i("createModal.fields.descriptionPlaceholder"),rows:2})]}),p.jsxs(zn,{children:[p.jsx(Hn,{children:i("createModal.fields.aiMode")}),p.jsxs(HAe,{value:[R],onValueChange:pe=>{const Ae=Array.isArray(pe)?pe[0]:pe;Ae&&(N(Ae),L(!0))},className:"w-full",variant:"outline",children:[p.jsx(VV,{value:"plan",className:"flex-1",children:i("createModal.aiModes.plan")}),p.jsx(VV,{value:"default",className:"flex-1",children:i("createModal.aiModes.default")})]})]}),p.jsxs(zn,{children:[p.jsx(Hn,{children:i("createModal.fields.agent")}),p.jsxs(mi,{value:U,onValueChange:pe=>M(pe),children:[p.jsx(bi,{className:"w-full",children:p.jsx(gi,{})}),p.jsx(vi,{children:Object.keys(il).map(pe=>p.jsx(gn,{value:pe,children:il[pe]},pe))})]})]}),U==="opencode"&&p.jsxs(zn,{children:[p.jsx(Hn,{children:i("createModal.fields.opencodeModel")}),p.jsx(Gj,{value:J,onChange:ae,placeholder:i("createModal.fields.opencodeModelPlaceholder")})]}),p.jsxs(zn,{children:[p.jsx(Hn,{children:i("createModal.fields.repository")}),p.jsxs(Ko,{value:H,onValueChange:pe=>{q(pe),F(null)},children:[p.jsxs(Yo,{children:[p.jsx(Vn,{value:"saved",disabled:!ve?.length,children:i("createModal.tabs.saved")}),p.jsx(Vn,{value:"browse",children:i("createModal.tabs.browse")})]}),p.jsx(Kn,{value:"saved",className:"mt-2",children:p.jsxs(Rae,{value:W||"",onValueChange:pe=>{const Ae=ve?.find(he=>he.id===pe);Ae&&(z(pe),v(Ae.path),$(Ae.displayName),F(null),Ae.defaultAgent&&M(Ae.defaultAgent),ae(Ae.opencodeModel??ee??null))},inputValue:K,onInputValueChange:pe=>{$(pe)},itemToStringLabel:pe=>ve?.find(Ae=>Ae.id===pe)?.displayName||"",children:[p.jsx(Nae,{placeholder:i("createModal.searchRepositories"),className:"w-full"}),p.jsx(Iae,{children:p.jsxs(Dae,{children:[p.jsx(Lae,{children:i("createModal.noRepositoriesFound")}),xe.map(pe=>p.jsx(XL,{value:pe.id,children:pe.displayName},pe.id))]})})]})}),p.jsx(Kn,{value:"browse",className:"mt-2",children:p.jsxs(Be,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>c(!0),disabled:G,children:[p.jsx(te,{icon:Ba,size:14,strokeWidth:2,className:"mr-2"}),G?p.jsx("span",{className:"text-muted-foreground",children:a("status.validating")}):b&&!W?p.jsx("span",{className:"truncate",children:b}):p.jsx("span",{className:"text-muted-foreground group-hover/button:text-accent-foreground",children:i("createModal.selectFolder")})]})})]}),j&&p.jsx("p",{className:"text-sm text-destructive",children:j}),b&&!j&&p.jsx(Da,{className:"font-mono text-xs truncate",children:b})]}),p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"baseBranch",children:i("createModal.fields.baseBranch")}),p.jsxs(mi,{value:y,onValueChange:pe=>E(pe??""),disabled:!b||me,children:[p.jsx(bi,{className:"w-full",children:p.jsx(gi,{children:y||p.jsx("span",{className:"text-muted-foreground",children:i(b?me?"createModal.loadingBranches":"createModal.selectBranch":"createModal.selectRepositoryFirst")})})}),p.jsx(vi,{children:Ee?.branches.map(pe=>p.jsxs(gn,{value:pe,children:[pe,pe===Ee.current&&p.jsx("span",{className:"text-muted-foreground ml-2",children:i("createModal.current")})]},pe))})]})]}),p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"branch",children:i("createModal.fields.branchName")}),p.jsx(Ht,{id:"branch",value:T,onChange:pe=>w(pe.target.value),placeholder:A||i("createModal.fields.branchPlaceholder")}),_e&&p.jsxs(Da,{children:[i("createModal.worktreePrefix")," ",_e]}),!T.trim()&&A&&p.jsx(Da,{children:i("createModal.branchAutoGenerated",{branch:A})})]})]}),p.jsxs(i1,{className:"mt-4 shrink-0",children:[p.jsx(RC,{render:p.jsx(Be,{variant:"outline",type:"button",className:"border-destructive text-destructive hover:bg-destructive hover:text-white"}),children:a("buttons.cancel")}),p.jsx(Be,{type:"submit",disabled:Z.isPending||!m.trim()||!b,children:Z.isPending?a("status.creating"):i("createModal.createTask")})]})]})})]}),p.jsx(bd,{open:d,onOpenChange:c,onSelect:Ue,initialPath:re||void 0})]})}const GV=[{to:"/tasks",icon:Tj,labelKey:"header.tasks",matchPrefix:!0},{to:"/terminals",icon:sie,labelKey:"header.terminals",matchPrefix:!1},{to:"/projects",icon:Ds,labelKey:"header.projects",matchPrefix:!0},{to:"/review",icon:Ku,labelKey:"header.review",matchPrefix:!0},{to:"/monitoring",icon:rie,labelKey:"header.monitoring",matchPrefix:!0}];function wke({onNewTaskRef:e,onOpenCommandPalette:t}){const{t:n}=Ct("navigation"),{location:r}=Ei(),i=r.pathname,[a,s]=C.useState(!1),[o,l]=C.useState(""),u=(d,c)=>c?i.startsWith(d):i===d;return C.useEffect(()=>{e?.(()=>s(!0))},[e]),p.jsxs("header",{className:"sticky top-0 z-10 flex h-10 shrink-0 items-center justify-between border-b border-border bg-card px-4 max-sm:px-2",children:[p.jsxs("div",{className:"flex min-w-0 items-center gap-4 max-sm:gap-2",children:[p.jsx(YSe,{className:"sm:hidden",value:o,onValueChange:l,children:p.jsx(XSe,{children:p.jsxs(ZSe,{children:[p.jsxs(JSe,{className:"bg-transparent hover:bg-muted/50 data-open:bg-muted/50 gap-1 px-2",children:[p.jsx(te,{icon:pie,size:16,strokeWidth:2}),p.jsx("span",{className:"sr-only",children:"Menu"})]}),p.jsx(ewe,{className:"min-w-48",children:GV.map(d=>p.jsxs(nwe,{href:d.to,active:u(d.to,d.matchPrefix),render:p.jsx(Or,{to:d.to}),onClick:()=>l(""),children:[p.jsx(te,{icon:d.icon,size:16,strokeWidth:2}),n(d.labelKey)]},d.to))})]})})}),p.jsx("nav",{className:"hidden items-center gap-1 sm:flex",children:GV.map(d=>{const c=u(d.to,d.matchPrefix);return p.jsxs(Or,{to:d.to,className:ze("relative flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium transition-colors",c?"bg-background text-foreground":"text-foreground/60 hover:text-foreground","after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-foreground after:transition-opacity",c?"after:opacity-100":"after:opacity-0"),children:[p.jsx(te,{icon:d.icon,size:16,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{children:n(d.labelKey)})]},d.to)})})]}),p.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[p.jsx(qj,{open:a,onOpenChange:s}),p.jsx(Be,{variant:"ghost",size:"icon-sm",onClick:t,title:n("header.commandPalette",{shortcut:"⌘K"}),className:"hidden sm:inline-flex",children:p.jsx(te,{icon:lS,size:16,strokeWidth:2})}),p.jsx("a",{href:"https://www.vibora.dev/guide/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center rounded-md p-1.5 text-foreground/60 transition-colors hover:text-foreground",title:n("header.help"),children:p.jsx(te,{icon:lie,size:16,strokeWidth:2})}),p.jsx(Or,{to:"/settings",className:ze("relative flex items-center justify-center rounded-md p-1.5 transition-colors",i==="/settings"?"bg-background text-foreground":"text-foreground/60 hover:text-foreground","after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-foreground after:transition-opacity",i==="/settings"?"after:opacity-100":"after:opacity-0"),children:p.jsx(te,{icon:mie,size:16,strokeWidth:2})})]})]})}function Cke(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}const Tke=10,Ake=2e3;function kke(){const e=pn(),t=Sa(),n=C.useRef(null),r=C.useRef(void 0),i=C.useRef(0),a=C.useRef(void 0),s=C.useCallback(l=>{try{const u=JSON.parse(l.data);if(u.type==="task:updated")e.invalidateQueries({queryKey:["tasks"]});else if(u.type==="notification"&&"payload"in u){let d=function(){const D=y&&!E?"/goat.jpeg":"/logo.png";if(b!==!1){const U={description:g,icon:p.jsx("img",{src:D,alt:"",className:"size-8 shrink-0 aspect-square rounded-sm object-cover"}),...x&&{action:{label:"View",onClick:()=>t({to:"/tasks/$taskId",params:{taskId:x}})}}};switch(_){case"success":Et.success(m,U);break;case"error":Et.error(m,U);break;case"warning":Et.warning(m,U);break;default:Et.info(m,U);break}}if(v!==!1&&"Notification"in window&&window.parent===window&&Notification.permission==="granted"&&new Notification(m,{body:g,icon:D,tag:c}),y){const M="vibora:lastSoundPlayed",W=Date.now(),z=localStorage.getItem(M);if(z){const q=parseInt(z.split(":")[0]);if(W-q<1e3)return}const H=`${W}:${Math.random().toString(36).slice(2)}`;localStorage.setItem(M,H),setTimeout(()=>{if(localStorage.getItem(M)!==H)return;let q=!1;const K=()=>{if(q)return;q=!0,new Audio("/sounds/goat-bleat.mp3").play().catch(()=>{})},$=new Audio("/api/uploads/sound");$.onerror=K,$.play().catch(K)},50)}window.parent!==window&&window.parent.postMessage({type:"vibora:notification",title:m,message:g,notificationType:_},"*")};const{id:c,title:m,message:g,notificationType:_,taskId:x,showToast:b,showDesktop:v,playSound:y,isCustomSound:E}=u.payload,T=`vibora:notification:${c}`,w=50,A=1e4;if(localStorage.getItem(T))return;const R=`${Date.now()}:${Math.random().toString(36).slice(2)}`;localStorage.setItem(T,R),setTimeout(()=>{localStorage.getItem(T)===R&&(setTimeout(()=>localStorage.removeItem(T),A),d())},w)}}catch{}},[e,t]),o=C.useCallback(()=>{const l=n.current;if(l&&(l.readyState===WebSocket.CONNECTING||l.readyState===WebSocket.OPEN))return;const u=Cke(),d=new WebSocket(u);n.current=d,d.onopen=()=>{i.current=0},d.onmessage=s,d.onclose=()=>{n.current===d&&(n.current=null),i.current<Tke&&(i.current++,r.current=setTimeout(()=>{a.current?.()},Ake))},d.onerror=()=>{}},[s]);a.current=o,C.useEffect(()=>{"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()},[]),C.useEffect(()=>(o(),()=>{r.current&&clearTimeout(r.current);const l=n.current;l&&(l.readyState===WebSocket.OPEN&&l.close(),n.current=null)}),[o])}const Oke={save:"Save Changes",cancel:"Cancel",delete:"Delete",create:"Create",reset:"Reset to default",browse:"Browse",clearFilters:"Clear filters"},Rke={loading:"Loading...",saving:"Saving...",saved:"Saved",error:"Error",calculating:"calculating...",validating:"Validating...",creating:"Creating...",deleting:"Deleting...",loggingIn:"Logging in...",uploading:"Uploading..."},Nke={justNow:"just now",minuteAgo:"1 minute ago",minutesAgo:"{{count}} minutes ago",hourAgo:"1 hour ago",hoursAgo:"{{count}} hours ago",dayAgo:"1 day ago",daysAgo:"{{count}} days ago"},Ike={one:"{{count}} result",other:"{{count}} results"},Dke={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled",ORPHANED:"Orphaned"},Lke={loginTitle:"Login to Vibora",username:"Username",password:"Password",login:"Login",loginFailed:"Login failed"},Pke={sentToClaude:"Sent to Claude Code",noTerminal:"No terminal available",syncedFromMain:"Synced from main",mergedToMain:"Merged to main",pushedToOrigin:"Pushed to origin",parentSynced:"Parent synced with origin",prCreated:"PR created",prExists:"PR already exists"},Mke={imageUploadFailed:"Failed to upload image",terminalNotConnected:"Terminal not connected",terminalNotConnectedDesc:"Please wait for the connection to establish"},jke={notInstalled:"OpenCode not installed",selectModel:"Select model",useDefault:"Use default",noModelsFound:"No models found"},Fke={manualDnsRequired:"Manual DNS required",manualDnsRequiredDesc:"Cloudflare API token not configured. You must create DNS records manually for your domains.",deployToApply:"Deploy to apply changes",deployToApplyDesc:"Domain configuration saved. Deploy the app for changes to take effect.",unknownRepo:"Unknown repo",service:"service",services:"services",exposed:"exposed",lastDeployed:"Last deployed",stop:"Stop",deploy:"Deploy",deploying:"Deploying...",building:"Building...",cancelDeploy:"Cancel",cancelling:"Cancelling...",delete:"Delete",deleting:"Deleting...",searchApps:"Search apps...",allRepos:"All repos",newApp:"New App",createApp:"Create App",noAppsYet:"No apps yet. Create your first app to get started!",noAppsMatch:"No apps match your search.",failedToLoadApps:"Failed to load apps",deleteApp:"Delete App",deleteAppConfirm:'Are you sure you want to delete "{{name}}"? This will stop all containers and remove the app configuration. This action cannot be undone.',cancel:"Cancel",appNotFound:"App not found",backToApps:"Back to Apps",tabs:{general:"General",deployments:"Deployments",logs:"Logs",environment:"Environment",domains:"Domains",monitoring:"Monitoring",workspace:"Workspace"},general:{deploy:"Deploy",deployOptions:"Deploy Options",autodeploy:"Autodeploy",noCache:"No-cache",notifications:"Notifications",services:"Services",noServicesConfigured:"No services configured"},workspace:{noRepository:"No repository linked to this app"},compose:{title:"Compose File",repoNotFound:"Repository path not found",unsavedChanges:"unsaved changes",save:"Save",edit:"Edit",done:"Done",preview:"Preview",previewDescription:"Preview the compose file that will be deployed",generatedTitle:"Generated Compose File Preview",generatedDescription:"This shows what will be deployed with the current configuration, including environment variable expansion and Docker Swarm transformations."},logs:{title:"Logs",description:"Watch the logs of the application in real time",allContainers:"All containers",lines:"lines",copy:"Copy",copied:"Copied",download:"Download",refresh:"Refresh",noLogs:"No logs available"},deployments:{title:"Deployments",description:"See the last 10 deployments for this compose",noDeployments:"No deployments yet",view:"View",statusDone:"Done",statusError:"Error",statusBuilding:"Building",deployment:"Deployment",seeDetails:"See all the details of this deployment",noBuildLogs:"No build logs available"},environment:{title:"Environment Variables",description:"Set environment variables for Docker Compose builds. These will be available during the build and in your containers.",placeholder:`DATABASE_URL=postgres://...
27
27
  API_KEY=your-api-key
28
- # Comments are supported`,save:"Save Environment",showValues:"Show values",hideValues:"Hide values",unsavedChanges:"You have unsaved changes"},domains:{title:"Domain Configuration",description:"Configure which services are exposed and their domain mappings",expose:"Expose",exposeRequiresPort:"No port configured. Add a port mapping to your compose file.",domain:"Domain",noDomain:"No domain configured",portRequired:"Port required",editDomain:"Edit domain",noServices:"No services configured. Deploy the app first to see available services.",save:"Save"},streaming:{pulling:"Pulling code...",building:"Building containers...",starting:"Starting services...",configuring:"Configuring routing...",done:"Deployment complete!",failed:"Deployment failed",cancelled:"Deployment cancelled",preparing:"Preparing...",waitingForLogs:"Waiting for logs..."},dnsConfigRequired:"DNS configuration required",settings:"Settings",status:{running:"Running",building:"Building",failed:"Failed",stopped:"Stopped"},monitoring:{title:"Resource Usage",description:"Real-time CPU and memory usage for each service",cpu:"CPU",memory:"Memory",noContainers:"No running containers found",dockerUnavailable:"Docker stats not available",serviceTotal:"Service Total"}},Bke={buttons:Oke,status:Rke,time:Nke,results:Ike,statuses:Dke,auth:Lke,git:Pke,errors:Mke,opencode:jke,apps:Fke},Uke={tasks:"Tasks",projects:"Projects",terminals:"Terminals",worktrees:"Worktrees",repositories:"Repositories",apps:"Apps",jobs:"Jobs",review:"Review",monitoring:"Monitoring",settings:"Settings",commandPalette:"Command Palette ({{shortcut}})",help:"Documentation"},$ke={placeholder:"Type a command or search...",noResults:"No commands found.",categories:{navigation:"Navigation",actions:"Actions"},commands:{goToTasks:"Go to Tasks",goToProjects:"Go to Projects",goToTerminals:"Go to Terminals",goToTaskTerminals:"Go to Task Terminals",goToProjectTerminals:"Go to Project Terminals",goToRepositories:"Go to Repositories",goToApps:"Go to Apps",goToJobs:"Go to Jobs",goToReview:"Go to Review",goToMonitoring:"Go to Monitoring",goToSettings:"Go to Settings",newTask:"New Task",newProject:"New Project",openInEditor:"Open in Editor",keyboardShortcuts:"Keyboard Shortcuts"}},zke={title:"Keyboard Shortcuts",groups:{navigation:"Navigation",actions:"Actions",terminals:"Terminals (Desktop)",general:"General"},labels:{goToTasks:"Go to Tasks",goToProjects:"Go to Projects",goToTerminals:"Go to Terminals",goToTaskTerminals:"Go to Task Terminals",goToProjectTerminals:"Go to Project Terminals",goToRepositories:"Go to Repositories",goToApps:"Go to Apps",goToJobs:"Go to Jobs",goToReview:"Go to Review",goToMonitoring:"Go to Monitoring",goToSettings:"Go to Settings",commandPalette:"Command Palette",newTask:"New Task",newProject:"New Project",openInEditor:"Open in Editor",keyboardShortcuts:"Keyboard Shortcuts",closeModal:"Close Modal",newTerminal:"New Terminal",closeTerminal:"Close Terminal",submitForm:"Submit Form"}},Hke={title:"Open in Editor",description:"Open a folder in {{editor}}",pathLabel:"Directory Path",pathPlaceholder:"~/projects/my-project",pathHint:"Enter a directory path. Supports ~ for home directory.",pathNotFound:"Path does not exist",pathNotDirectory:"Path must be a directory, not a file",browse:"Browse",cancel:"Cancel",open:"Open"},Vke={header:Uke,commandPalette:$ke,shortcuts:zke,openInEditor:Hke},Wke="Tasks",Gke="Search",qke="All Repos",Kke="New Task",Yke={title:"Create New Task",description:"Create a new task with a git worktree for isolated development.",fields:{title:"Title",titlePlaceholder:"Add user authentication",description:"Description",descriptionPlaceholder:"Implement OAuth2 login flow...",aiMode:"AI Mode",agent:"AI Agent",opencodeModel:"OpenCode Model",opencodeModelPlaceholder:"Select model",repository:"Repository",baseBranch:"Base Branch",branchName:"Branch Name",branchPlaceholder:"auto-generated-from-title"},aiModes:{plan:"Plan",default:"Default"},tabs:{saved:"Repos",browse:"Browse"},worktreePrefix:"Worktree:",branchAutoGenerated:'Will use "{{branch}}" if left empty.',selectFolder:"Select folder...",searchRepositories:"Search repositories...",noRepositoriesFound:"No repositories found",selectRepositoryFirst:"Select repository first",loadingBranches:"Loading branches...",selectBranch:"Select branch",current:"(current)",createTask:"Create Task",errors:{notGitRepo:"Selected folder is not a git repository",validationFailed:"Failed to validate repository",createFailed:"Failed to create task"}},Xke={title:Wke,searchPlaceholder:Gke,allRepos:qke,newTask:Kke,createModal:Yke},Zke="Settings",Qke={server:"Server",serverDefaults:"Server & Defaults",paths:"Paths",editor:"Editor",integrations:"Integrations",zai:"z.ai",agent:"Agent",notifications:"Notifications",appearance:"Appearance",developer:"Developer"},Jke={port:{label:"Port",description:"Requires restart"},startupCommand:{label:"Startup Command",description:"Command for new task terminals"},gitReposDir:{label:"Git Repos Directory",description:"Starting directory for repo picker"},editor:{app:{label:"Editor",description:"Code editor for opening worktrees",options:{vscode:"VS Code",cursor:"Cursor",windsurf:"Windsurf",zed:"Zed",antigravity:"Antigravity"}},host:{label:"Remote Host",description:"For SSH URLs when code is on a remote machine",placeholder:"e.g., my-server.tailnet.ts.net"},sshPort:{label:"SSH Port",description:"Remote SSH port (default 22)"}},linear:{label:"Linear",description:"API key for ticket sync"},github:{label:"GitHub",description:"PAT for Issues & PRs"},cloudflare:{label:"Cloudflare",placeholder:"Enter API token...",description:"API token for automatic DNS records"},zai:{enable:"Enable",apiKey:"API Key",description:"Configures Claude Code to use z.ai proxy",modelMappings:"Model Mappings",haiku:"Haiku",sonnet:"Sonnet",opus:"Opus"},agent:{default:{label:"Default Agent",description:"The AI coding agent to use for new tasks"},opencodeModel:{label:"OpenCode Model",placeholder:"Select model",description:"Default model used when launching OpenCode tasks"},advancedAgentNames:{label:"Advanced Agent Names",description:"Configure specific agent names for OpenCode modes",warning:"Only change these if you know what you're doing. These settings are for users with custom OpenCode agents (e.g., oh-my-opencode plugin with Sisyphus/Planner-Sisyphus agents)."},opencodeDefaultAgent:{label:"Default Mode",description:"Agent name for full-permission mode. Use 'Sisyphus' for oh-my-opencode, or 'build' for vanilla OpenCode."},opencodePlanAgent:{label:"Plan Mode",description:"Agent name for restricted/planning mode. Use 'Planner-Sisyphus' for oh-my-opencode, or 'plan' for vanilla OpenCode. Note: Planner-Sisyphus inherits its model from OpenCode's plan agent config, so the model override above may not apply. Configure the model in ~/.config/opencode/oh-my-opencode.json instead."}},language:{label:"Language",description:"Interface language",options:{auto:"Auto-detect",en:"English",zh:"Chinese (Simplified)"}},theme:{label:"Theme",description:"Color theme for the interface",options:{system:"System",light:"Light",dark:"Dark"}},syncClaudeTheme:{label:"Sync Claude Code",description:"Automatically update Claude Code's theme when Vibora switches between light and dark mode"},claudeCodeTheme:{light:"Light mode",dark:"Dark mode",options:{light:"Light","light-ansi":"Light ANSI","light-daltonized":"Light (colorblind)",dark:"Dark","dark-ansi":"Dark ANSI","dark-daltonized":"Dark (colorblind)"}}},e2e={enable:"Enable Notifications",toast:"In-app Toast",toastDescription:"Show toast notifications in the Vibora interface",desktop:"Desktop Notifications",desktopDescription:"Show native desktop or browser notifications",sound:"Sound",slack:"Slack",discord:"Discord",pushover:"Pushover",appToken:"App Token",userKey:"User Key",testSuccess:"{{channel}} test successful",testFailed:"{{channel}} test failed: {{error}}",uploadSound:"Upload custom sound",deleteSound:"Remove custom sound",testSound:"Test sound",soundUploaded:"Custom sound uploaded",soundUploadFailed:"Failed to upload sound: {{error}}",soundDeleted:"Custom sound removed",soundDeleteFailed:"Failed to remove custom sound",customSoundActive:"Custom sound active"},t2e={restartButton:"Restart Vibora",restarting:"Restarting...",restartDescription:"Rebuild and restart the Vibora server. If the build fails, the server will continue running.",restartFailed:"Restart failed",checkLogs:"Build may have failed. Check journalctl --user -u vibora for details."},n2e={title:"Unsaved Changes",description:"You have unsaved changes that will be lost if you leave this page.",stay:"Stay",leave:"Leave"},r2e={title:Zke,sections:Qke,fields:Jke,notifications:e2e,developer:t2e,unsavedChanges:n2e},i2e="Review",a2e={pullRequests:"Pull Requests",issues:"Issues"},s2e={pr:{created:"Created by me",assigned:"Assigned to me",reviewRequested:"Review requests",mentioned:"Mentioned"},issue:{assigned:"Assigned to me",created:"Created by me",mentioned:"Mentioned"},allOrgs:"All Orgs",allOrganizations:"All Organizations",viboraReposOnly:"Vibora repos only"},o2e={tokenRequired:"GitHub Token Required",tokenDescription:"To view your issues and pull requests, add a GitHub Personal Access Token in Settings.",requiredScopes:"Required scopes:",scopes:{repo:"(for private repositories)",readUser:"(for user info)",readOrg:"(for organization list)"},generateToken:"Generate Token",goToSettings:"Go to Settings"},l2e={loading:"Loading...",failedToLoad:"Failed to load pull requests",empty:{all:"No open pull requests",created:"No pull requests created by you",assigned:"No pull requests assigned to you",reviewRequested:"No pull requests awaiting your review",mentioned:"No pull requests mentioning you"},draft:"Draft"},u2e={loading:"Loading...",failedToLoad:"Failed to load issues",empty:{assigned:"No issues assigned to you",created:"No issues created by you",mentioned:"No issues mentioning you"}},c2e={title:i2e,tabs:a2e,filters:s2e,github:o2e,prs:l2e,issues:u2e},d2e="Worktrees",f2e={total:"{{count}} total",orphaned:"{{count}} orphaned"},p2e={button:"Clean up ({{count}})",title:"Delete Completed Worktrees",description:"This will permanently delete {{count}} worktree(s).",linkedTasksWillBeDeleted:"Their linked tasks will also be deleted.",alsoDeleteLinkedTasks:"Also delete linked tasks",done:"Done",canceled:"Canceled",cannotUndo:"This action cannot be undone.",pinnedSkipped:"{{count}} pinned worktree(s) will be skipped"},h2e={pin:"Pin worktree",unpin:"Unpin worktree"},m2e={noMatch:"No worktrees match the selected filters.",noWorktrees:"No worktrees found. Worktrees are created when you create tasks."},g2e={failedToLoad:"Failed to load worktrees: {{message}}"},b2e={title:d2e,summary:f2e,cleanup:p2e,delete:{title:"Delete Worktree",description:"This will permanently delete the worktree directory at",linkedTaskWillBeDeleted:'The linked task "{{title}}" will also be deleted.',alsoDeleteLinkedTask:'Also delete linked task "{{title}}"',cannotUndo:"This action cannot be undone.",button:"Delete {{count}}",unpinFirst:"Unpin worktree before deleting"},pin:h2e,empty:m2e,error:g2e},v2e="Monitoring",y2e={claude:"AI Agents",system:"System Metrics",processes:"Processes",vibora:"Vibora Servers",worktrees:"Worktrees",jobs:"Jobs",usage:"Usage Limits"},_2e={showAllInstances:"Show all instances",instanceCount:"{{count}} instance(s) running",totalRam:"{{ram}} MB total",headers:{agent:"Agent",terminal:"Terminal",task:"Task",ram:"RAM",actions:"Actions",pid:"PID",workingDirectory:"Working Dir",source:"Source"},noTask:"(no task)",kill:"Kill",killing:"Killing...",killSelected:"Kill {{count}} selected",source:{vibora:"Vibora: {{name}}",external:"External"},empty:"No AI agent instances running",emptyVibora:" in Vibora terminals",error:"Failed to load AI agent instances: {{message}}"},x2e={cpuUsage:"CPU Usage",memoryUsage:"Memory Usage",memoryLabels:{used:"Used",cache:"Cache / Buffers"},diskUsage:"Disk Usage ({{path}})",error:"Failed to load system metrics: {{message}}",timeWindows:{"1m":"1 min","10m":"10 min","1h":"1 hour","3h":"3 hours","6h":"6 hours","12h":"12 hours","24h":"24 hours"}},E2e={topProcesses:"Top Processes",sortBy:{memory:"By Memory",cpu:"By CPU"},headers:{pid:"PID",name:"Name",command:"Command",memory:"Memory"},empty:"No processes found",error:"Failed to load processes: {{message}}",containers:"Containers",containersEmpty:"No containers running",containersUnavailable:"Docker/Podman not available"},S2e={description:"Running Vibora dev servers",instanceCount:"{{count}} instance(s) running",headers:{port:"Port",mode:"Mode",directory:"Directory",ram:"RAM",actions:"Actions"},mode:{dev:"Dev",prod:"Prod"},vite:"Vite",kill:"Kill",killing:"Killing...",empty:"No Vibora instances running",error:"Failed to load Vibora instances: {{message}}"},w2e={fiveHourBlock:"5-Hour Block",sevenDayRolling:"7-Day Rolling",opusWeekly:"Opus Weekly",sonnetWeekly:"Sonnet Weekly",resetsIn:"Resets in {{time}}",resetsAt:"Resets {{time}}",weekProgress:"{{percent}}% through week",unavailable:"Claude Code usage data not available. Make sure you're logged in to Claude Code.",error:"Failed to load usage data: {{message}}"},C2e={title:v2e,tabs:y2e,claude:_2e,system:x2e,processes:E2e,vibora:S2e,usage:w2e},T2e="Tasks",A2e="Projects",k2e="New Terminal",O2e="All Repos",R2e="Select projects",N2e="{{count}} selected",I2e="Select up to 6 projects",D2e="Clear selection",L2e="Select a project to open its workspace terminal",P2e="No active tasks",M2e={title:"Edit Tab",name:"Name",namePlaceholder:"Tab name",directory:"Directory",directoryPlaceholder:"Select a directory...",clearDirectory:"Clear directory",cancel:"Cancel",save:"Save"},j2e={title:"New Tab",create:"Create"},F2e={taskTerminals:T2e,projectTerminals:A2e,newTerminal:k2e,allRepos:O2e,selectProjects:R2e,projectsSelected:N2e,filterByProject:I2e,clearFilter:D2e,emptyProjects:L2e,emptyTasks:P2e,editTab:M2e,newTab:j2e},B2e="Repositories",U2e="{{count}} total",$2e="Search repositories...",z2e="New Task",H2e="Tasks",V2e="Terminal",W2e="Editor",G2e="Application",q2e="Applications",K2e="Create App",Y2e={title:"Docker Compose Required",description:"To create an app for deployment, this repository needs a Docker Compose file.",instructions:"Create a docker-compose.yml file in your repository.",close:"Got it"},X2e="Settings",Z2e="Add Repository",Q2e="Scan Directory",J2e="Open in Terminal",eOe="Open in {{editor}}",tOe={openInVSCode:"Open in VS Code"},nOe={title:"Add Repository",description:"Add a git repository from a URL or local path, or scan a directory.",tabs:{add:"Add",scan:"Scan",template:"From Template"},inputLabel:"Repository URL or path",inputPlaceholder:"https://github.com/user/repo or /local/path",browse:"Browse...",cloneOptions:"Clone Options",targetDirectory:"Clone to directory",folderName:"Folder name",willCloneTo:"Will clone to",cloning:"Cloning repository...",adding:"Adding...",cloneFailed:"Failed to clone repository",createFailed:"Failed to add repository",cancel:"Cancel",add:"Add",retry:"Retry",fields:{path:"Repository Path",pathPlaceholder:"Select repository...",displayName:"Display Name",startupScript:"Startup Script",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"Command to run in the terminal when creating a worktree.",copyFiles:"Copy Files",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"Comma-separated glob patterns for files to copy into new worktrees.",isCopierTemplate:"Use as Copier Template",isCopierTemplateDescription:"Mark as a template for creating new projects."}},rOe={button:"New Project",title:"Create New Project",back:"Back",next:"Next",create:"Create Project",steps:{template:{description:"Select a template to create your project from.",sectionTitle:"Copier Template",sectionDescription:"Select a saved template or enter a URL/path.",learnMore:"Learn more",savedTemplates:"Saved Templates",selectTemplate:"Select a template...",or:"or",customUrl:"Custom Template URL/Path"},questions:{title:"Template Questions",description:"Configure your project.",noQuestions:"This template has no configuration questions."},output:{title:"Output Location",description:"Choose where to create your project.",projectName:"Project Name",outputDirectory:"Output Directory",selectDirectory:"Select directory...",willCreate:"Will create",trust:"Trust template"},creating:{description:"Creating your project...",inProgress:"Running Copier..."}}},iOe={title:"Scan Directory for Repositories",description:"Find and add multiple git repositories from a directory.",directoryLabel:"Directory to scan",directoryPlaceholder:"Enter directory path",browse:"Browse...",scan:"Scan",foundRepos:"Found {{count}} repositories",selectAll:"Select all",selectNone:"Select none",noReposFound:"No git repositories found in this directory.",alreadyAdded:"Already added",adding:"Adding repositories...",scanFailed:"Failed to scan directory",addFailed:"Failed to add repositories",cancel:"Cancel",addSelected:"Add {{count}} selected"},aOe={noRepositories:"No repositories added yet. Add a repository for quick access when creating tasks.",noMatches:"No repositories match your search."},sOe={failedToLoad:"Failed to load repositories: {{message}}"},oOe={breadcrumb:"Repositories",notFound:"Repository not found",save:"Save",saving:"Saving...",saved:"Repository saved",failedToSave:"Failed to save repository",tabs:{settings:"Task Settings",workspace:"Workspace"},mobileWorkspace:{terminal:"Terminal",files:"Files"},fileTree:{title:"Files",searchPlaceholder:"Search files...",noFiles:"No files",collapseAll:"Collapse all folders"},settings:{generalTitle:"General",agentTitle:"Agent Options",displayName:"Display Name",defaultAgent:"Default Agent",defaultAgentInherit:"Use global default",defaultAgentDescription:"Override the global default agent for tasks created from this repository.",startupScript:"Startup Script",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"Command to run in the terminal when creating a worktree.",claudeOptions:"Claude Code Options",claudeOptionsDescription:"CLI flags passed to Claude Code when starting a task.",opencodeOptions:"OpenCode Options",opencodeOptionsDescription:"CLI flags passed to OpenCode when starting a task.",opencodeModel:"OpenCode Model",opencodeModelPlaceholder:"Select model",opencodeModelDescription:"Default OpenCode model for tasks created from this repository.",agentOptionsFlag:"Flag",agentOptionsValue:"Value",addAgentOption:"Add option",copyFiles:"Copy Files",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"Comma-separated glob patterns for files to copy into new worktrees.",isCopierTemplate:"Use as Copier Template",isCopierTemplateDescription:"Mark as a template for creating new projects with Copier."},workspace:{connectingToTerminal:"Connecting to terminal server...",initializingTerminal:"Initializing terminal..."}},lOe={title:B2e,total:U2e,searchPlaceholder:$2e,newTask:z2e,viewTasks:H2e,terminal:V2e,editor:W2e,application:G2e,applications:q2e,createApp:K2e,createAppDialog:Y2e,settings:X2e,addRepository:Z2e,scanDirectory:Q2e,openInTerminal:J2e,openInEditor:eOe,card:tOe,delete:{title:"Delete Repository",description:'This will remove "{{name}}" from Vibora. The actual repository files will not be affected.',button:"Delete",deleting:"Deleting...",alsoDeleteDirectory:"Also delete the directory from disk",deleteDirectoryWarning:"This will permanently delete all files in the repository. This action cannot be undone."},addModal:nOe,newProject:rOe,bulkAdd:iOe,empty:aOe,error:sOe,detailView:oOe},uOe="Jobs",cOe="View scheduled tasks (systemd timers on Linux, launchd jobs on macOS)",dOe="Search jobs...",fOe="No scheduled jobs found",pOe="No jobs match your search",hOe="Create Job",mOe={all:"All",user:"User",system:"System"},gOe={active:"Active",inactive:"Inactive",failed:"Failed",waiting:"Waiting",disabled:"Disabled"},bOe="Next",vOe="Last",yOe="System timers are read-only",_Oe="Jobs on macOS are read-only",xOe={enable:"Enable",disable:"Disable",start:"Start",stop:"Stop",runNow:"Run Now",edit:"Edit",delete:"Delete",viewLogs:"View Logs"},EOe={tabs:{general:"General",logs:"Logs",edit:"Edit"},schedule:"Schedule",nextRun:"Next Run",lastRun:"Last Run",lastResult:"Last Result",description:"Description",command:"Command",workingDir:"Working Directory",systemTimer:"System timer (read-only)",timerFile:"Timer File",serviceFile:"Service File",executionStats:"Last Execution",duration:"Duration",cpuTime:"CPU Time",noStats:"No execution data available"},SOe={title:"Create Scheduled Job",name:"Job Name",namePlaceholder:"backup-daily",nameHelp:"Alphanumeric, hyphens, and underscores only",description:"Description",descriptionPlaceholder:"Daily backup of important files",schedule:"Schedule",scheduleHelp:"OnCalendar expression (e.g., *-*-* 02:00:00, daily, weekly)",command:"Command",commandPlaceholder:"/home/user/scripts/backup.sh",workingDir:"Working Directory",workingDirPlaceholder:"/home/user",persistent:"Persistent",persistentHelp:"Run missed executions when system starts",cancel:"Cancel",create:"Create Job"},wOe={title:"Job Logs",noLogs:"No logs available",lines:"lines",refresh:"Refresh"},COe={loadFailed:"Failed to load jobs",createFailed:"Failed to create job",updateFailed:"Failed to update job",deleteFailed:"Failed to delete job"},qV={title:uOe,description:cOe,searchPlaceholder:dOe,noJobs:fOe,noJobsMatch:pOe,createJob:hOe,scope:mOe,status:gOe,nextRun:bOe,lastRun:vOe,systemTimerReadonly:yOe,macosReadonly:_Oe,actions:xOe,detail:EOe,create:SOe,delete:{title:"Delete Job",confirm:'Are you sure you want to delete "{{name}}"? This will remove both the timer and service files.',cancel:"Cancel",delete:"Delete"},logs:wOe,errors:COe},TOe="Projects",AOe="{{count}} total",kOe="Search projects...",OOe="New Task",ROe="Terminal",NOe="Editor",IOe="Deploy",DOe="Stop",LOe="New Project",POe={noProjects:"No projects yet. Create a project to get started.",noMatches:"No projects match your search."},MOe={failedToLoad:"Failed to load projects: {{message}}"},jOe={noApp:"No app",running:"Running",building:"Building",stopped:"Stopped",failed:"Failed"},FOe={breadcrumb:"Projects",notFound:"Project not found",save:"Save",saving:"Saving...",tabs:{settings:"Task Settings",workspace:"Workspace",deploy:"Deploy",deployGeneral:"General",deployments:"Deployments",logs:"Logs",monitoring:"Monitoring"},general:{repositoryTitle:"Repository",agentTitle:"Agent Options",path:"Path",displayName:"Display Name",startupScript:"Startup Script",copyFiles:"Copy Files",defaultAgent:"Default Agent",claudeOptions:"Claude Code Options",opencodeOptions:"OpenCode Options",opencodeModel:"OpenCode Model",noRepository:"No repository linked to this project."},app:{title:"App Configuration",noApp:"No app configured for this project.",configureDeployment:"Configure Deployment",configureDeploymentDescription:"Set up Docker Compose deployment for this project",configuring:"Configuring...",deployOptions:"Deploy Options",autoDeployEnabled:"Auto-deploy on commit",autoPortAllocation:"Auto-allocate ports",noCacheBuild:"No-cache builds",notificationsEnabled:"Deployment notifications",services:"Services",environment:"Environment Variables",composeFile:"Compose File"}},BOe={step:"Step {{current}} of {{total}}",selectRepository:"Select Repository",existingRepo:"Existing",addNewRepo:"Add New",searchRepos:"Search repositories...",noReposFound:"No repositories found",repoPathOrUrl:"Repository Path or URL",repoInputPlaceholder:"~/code/my-repo or https://github.com/user/repo",browse:"Browse",cloneOptions:"Clone Options",targetDirectory:"Target Directory",folderName:"Folder Name",willCloneTo:"Will clone to",cloning:"Cloning repository...",adding:"Adding repository...",cloneAndSelect:"Clone & Select",addAndSelect:"Add & Select",addRepoFailed:"Failed to add repository",checkingCompose:"Checking for compose file...",composeFound:"Found {{file}}",noCompose:"No compose file found",cancel:"Cancel",next:"Next",back:"Back",configureProject:"Configure Project",projectName:"Project Name",projectNamePlaceholder:"my-project",description:"Description",descriptionPlaceholder:"Optional project description",composeDetected:"Docker Compose detected: {{file}}",setupAppNow:"Set up app deployment after creation",createProject:"Create Project",creating:"Creating...",create:"Create"},UOe={all:"All",hasApp:"With App",noApp:"Without App",running:"Running",archived:"Archived"},$Oe={title:TOe,total:AOe,searchPlaceholder:kOe,newTask:OOe,terminal:ROe,editor:NOe,deploy:IOe,stop:DOe,newProjectButton:LOe,empty:POe,error:MOe,card:jOe,delete:{title:"Delete Project",description:'This will remove the project "{{name}}".',button:"Delete",deleting:"Deleting...",alsoDeleteDirectory:"Also delete the directory",alsoDeleteApp:"Also delete the app and stop containers"},detailView:FOe,newProject:BOe,filter:UOe},zOe={save:"保存更改",cancel:"取消",delete:"删除",create:"创建",reset:"重置为默认值",browse:"浏览",clearFilters:"清除筛选"},HOe={loading:"加载中...",saving:"保存中...",saved:"已保存",error:"错误",calculating:"计算中...",validating:"验证中...",creating:"创建中...",deleting:"删除中...",loggingIn:"登录中...",uploading:"上传中..."},VOe={justNow:"刚刚",minuteAgo:"1 分钟前",minutesAgo:"{{count}} 分钟前",hourAgo:"1 小时前",hoursAgo:"{{count}} 小时前",dayAgo:"1 天前",daysAgo:"{{count}} 天前"},WOe={one:"{{count}} 个结果",other:"{{count}} 个结果"},GOe={IN_PROGRESS:"进行中",IN_REVIEW:"审核中",DONE:"已完成",CANCELED:"已取消",ORPHANED:"孤立"},qOe={loginTitle:"登录 Vibora",username:"用户名",password:"密码",login:"登录",loginFailed:"登录失败"},KOe={sentToClaude:"已发送到 Claude Code",noTerminal:"没有可用的终端",syncedFromMain:"已从 main 同步",mergedToMain:"已合并到 main",pushedToOrigin:"已推送到 origin",parentSynced:"父仓库已与 origin 同步",prCreated:"PR 已创建",prExists:"PR 已存在"},YOe={imageUploadFailed:"图片上传失败",terminalNotConnected:"终端未连接",terminalNotConnectedDesc:"请等待连接建立"},XOe={notInstalled:"OpenCode 未安装",selectModel:"选择模型",useDefault:"使用默认",noModelsFound:"未找到模型"},ZOe={manualDnsRequired:"需要手动配置 DNS",manualDnsRequiredDesc:"未配置 Cloudflare API 令牌。您需要手动为域名创建 DNS 记录。",deployToApply:"部署以应用更改",deployToApplyDesc:"域名配置已保存。部署应用程序以使更改生效。",unknownRepo:"未知仓库",service:"服务",services:"服务",exposed:"已暴露",lastDeployed:"上次部署",stop:"停止",deploy:"部署",deploying:"部署中...",building:"构建中...",cancelDeploy:"取消",cancelling:"取消中...",delete:"删除",deleting:"删除中...",searchApps:"搜索应用...",allRepos:"所有仓库",newApp:"新建应用",createApp:"创建应用",noAppsYet:"暂无应用。创建您的第一个应用开始使用!",noAppsMatch:"没有匹配的应用。",failedToLoadApps:"加载应用失败",deleteApp:"删除应用",deleteAppConfirm:'确定要删除 "{{name}}" 吗?这将停止所有容器并删除应用配置。此操作无法撤销。',cancel:"取消",appNotFound:"应用未找到",backToApps:"返回应用列表",tabs:{general:"概览",deployments:"部署记录",logs:"日志",environment:"环境变量",domains:"域名",monitoring:"监控",workspace:"工作区"},general:{deploy:"部署",deployOptions:"部署选项",autodeploy:"自动部署",noCache:"无缓存",notifications:"通知",services:"服务",noServicesConfigured:"未配置服务"},workspace:{noRepository:"此应用未关联仓库"},compose:{title:"Compose 文件",repoNotFound:"未找到仓库路径",unsavedChanges:"未保存的更改",save:"保存",edit:"编辑",done:"完成",preview:"预览",previewDescription:"预览将要部署的 compose 文件",generatedTitle:"生成的 Compose 文件预览",generatedDescription:"显示当前配置将要部署的内容,包括环境变量展开和 Docker Swarm 转换。"},logs:{title:"日志",description:"实时查看应用程序日志",allContainers:"所有容器",lines:"行",copy:"复制",copied:"已复制",download:"下载",refresh:"刷新",noLogs:"暂无日志"},deployments:{title:"部署记录",description:"查看此 Compose 的最近 10 次部署",noDeployments:"暂无部署记录",view:"查看",statusDone:"完成",statusError:"错误",statusBuilding:"构建中",deployment:"部署",seeDetails:"查看此部署的详细信息",noBuildLogs:"暂无构建日志"},environment:{title:"环境变量",description:"设置 Docker Compose 构建的环境变量。这些变量在构建期间和容器中都可用。",placeholder:`DATABASE_URL=postgres://...
28
+ # Comments are supported`,save:"Save Environment",showValues:"Show values",hideValues:"Hide values",unsavedChanges:"You have unsaved changes"},domains:{title:"Domain Configuration",description:"Configure which services are exposed and their domain mappings",expose:"Expose",exposeRequiresPort:"No port configured. Add a port mapping to your compose file.",domain:"Domain",noDomain:"No domain configured",portRequired:"Port required",editDomain:"Edit domain",noServices:"No services configured. Deploy the app first to see available services.",save:"Save"},streaming:{pulling:"Pulling code...",building:"Building containers...",starting:"Starting services...",configuring:"Configuring routing...",done:"Deployment complete!",failed:"Deployment failed",cancelled:"Deployment cancelled",preparing:"Preparing...",waitingForLogs:"Waiting for logs..."},dnsConfigRequired:"DNS configuration required",settings:"Settings",status:{running:"Running",building:"Building",failed:"Failed",stopped:"Stopped"},monitoring:{title:"Resource Usage",description:"Real-time CPU and memory usage for each service",cpu:"CPU",memory:"Memory",noContainers:"No running containers found",dockerUnavailable:"Docker stats not available",serviceTotal:"Service Total"}},Bke={buttons:Oke,status:Rke,time:Nke,results:Ike,statuses:Dke,auth:Lke,git:Pke,errors:Mke,opencode:jke,apps:Fke},Uke={tasks:"Tasks",projects:"Projects",terminals:"Terminals",worktrees:"Worktrees",repositories:"Repositories",apps:"Apps",jobs:"Jobs",review:"Review",monitoring:"Monitoring",settings:"Settings",commandPalette:"Command Palette ({{shortcut}})",help:"Documentation"},$ke={placeholder:"Type a command or search...",noResults:"No commands found.",categories:{navigation:"Navigation",actions:"Actions"},commands:{goToTasks:"Go to Tasks",goToProjects:"Go to Projects",goToTerminals:"Go to Terminals",goToTaskTerminals:"Go to Task Terminals",goToProjectTerminals:"Go to Project Terminals",goToRepositories:"Go to Repositories",goToApps:"Go to Apps",goToJobs:"Go to Jobs",goToReview:"Go to Review",goToMonitoring:"Go to Monitoring",goToSettings:"Go to Settings",newTask:"New Task",newProject:"New Project",openInEditor:"Open in Editor",keyboardShortcuts:"Keyboard Shortcuts"}},zke={title:"Keyboard Shortcuts",groups:{navigation:"Navigation",actions:"Actions",terminals:"Terminals (Desktop)",general:"General"},labels:{goToTasks:"Go to Tasks",goToProjects:"Go to Projects",goToTerminals:"Go to Terminals",goToTaskTerminals:"Go to Task Terminals",goToProjectTerminals:"Go to Project Terminals",goToRepositories:"Go to Repositories",goToApps:"Go to Apps",goToJobs:"Go to Jobs",goToReview:"Go to Review",goToMonitoring:"Go to Monitoring",goToSettings:"Go to Settings",commandPalette:"Command Palette",newTask:"New Task",newProject:"New Project",openInEditor:"Open in Editor",keyboardShortcuts:"Keyboard Shortcuts",closeModal:"Close Modal",newTerminal:"New Terminal",closeTerminal:"Close Terminal",submitForm:"Submit Form"}},Hke={title:"Open in Editor",description:"Open a folder in {{editor}}",pathLabel:"Directory Path",pathPlaceholder:"~/projects/my-project",pathHint:"Enter a directory path. Supports ~ for home directory.",pathNotFound:"Path does not exist",pathNotDirectory:"Path must be a directory, not a file",browse:"Browse",cancel:"Cancel",open:"Open"},Vke={header:Uke,commandPalette:$ke,shortcuts:zke,openInEditor:Hke},Wke="Tasks",Gke="Search",qke="All Projects",Kke="New Task",Yke={title:"Create New Task",description:"Create a new task with a git worktree for isolated development.",fields:{title:"Title",titlePlaceholder:"Add user authentication",description:"Description",descriptionPlaceholder:"Implement OAuth2 login flow...",aiMode:"AI Mode",agent:"AI Agent",opencodeModel:"OpenCode Model",opencodeModelPlaceholder:"Select model",repository:"Repository",baseBranch:"Base Branch",branchName:"Branch Name",branchPlaceholder:"auto-generated-from-title"},aiModes:{plan:"Plan",default:"Default"},tabs:{saved:"Repos",browse:"Browse"},worktreePrefix:"Worktree:",branchAutoGenerated:'Will use "{{branch}}" if left empty.',selectFolder:"Select folder...",searchRepositories:"Search repositories...",noRepositoriesFound:"No repositories found",selectRepositoryFirst:"Select repository first",loadingBranches:"Loading branches...",selectBranch:"Select branch",current:"(current)",createTask:"Create Task",errors:{notGitRepo:"Selected folder is not a git repository",validationFailed:"Failed to validate repository",createFailed:"Failed to create task"}},Xke={title:Wke,searchPlaceholder:Gke,allProjects:qke,newTask:Kke,createModal:Yke},Zke="Settings",Qke={server:"Server",serverDefaults:"Server & Defaults",paths:"Paths",editor:"Editor",integrations:"Integrations",zai:"z.ai",agent:"Agent",notifications:"Notifications",appearance:"Appearance",developer:"Developer"},Jke={port:{label:"Port",description:"Requires restart"},startupCommand:{label:"Startup Command",description:"Command for new task terminals"},gitReposDir:{label:"Git Repos Directory",description:"Starting directory for repo picker"},editor:{app:{label:"Editor",description:"Code editor for opening worktrees",options:{vscode:"VS Code",cursor:"Cursor",windsurf:"Windsurf",zed:"Zed",antigravity:"Antigravity"}},host:{label:"Remote Host",description:"For SSH URLs when code is on a remote machine",placeholder:"e.g., my-server.tailnet.ts.net"},sshPort:{label:"SSH Port",description:"Remote SSH port (default 22)"}},linear:{label:"Linear",description:"API key for ticket sync"},github:{label:"GitHub",description:"PAT for Issues & PRs"},cloudflare:{label:"Cloudflare",placeholder:"Enter API token...",description:"API token for automatic DNS records"},zai:{enable:"Enable",apiKey:"API Key",description:"Configures Claude Code to use z.ai proxy",modelMappings:"Model Mappings",haiku:"Haiku",sonnet:"Sonnet",opus:"Opus"},agent:{default:{label:"Default Agent",description:"The AI coding agent to use for new tasks"},opencodeModel:{label:"OpenCode Model",placeholder:"Select model",description:"Default model used when launching OpenCode tasks"},advancedAgentNames:{label:"Advanced Agent Names",description:"Configure specific agent names for OpenCode modes",warning:"Only change these if you know what you're doing. These settings are for users with custom OpenCode agents (e.g., oh-my-opencode plugin with Sisyphus/Planner-Sisyphus agents)."},opencodeDefaultAgent:{label:"Default Mode",description:"Agent name for full-permission mode. Use 'Sisyphus' for oh-my-opencode, or 'build' for vanilla OpenCode."},opencodePlanAgent:{label:"Plan Mode",description:"Agent name for restricted/planning mode. Use 'Planner-Sisyphus' for oh-my-opencode, or 'plan' for vanilla OpenCode. Note: Planner-Sisyphus inherits its model from OpenCode's plan agent config, so the model override above may not apply. Configure the model in ~/.config/opencode/oh-my-opencode.json instead."}},language:{label:"Language",description:"Interface language",options:{auto:"Auto-detect",en:"English",zh:"Chinese (Simplified)"}},theme:{label:"Theme",description:"Color theme for the interface",options:{system:"System",light:"Light",dark:"Dark"}},syncClaudeTheme:{label:"Sync Claude Code",description:"Automatically update Claude Code's theme when Vibora switches between light and dark mode"},claudeCodeTheme:{light:"Light mode",dark:"Dark mode",options:{light:"Light","light-ansi":"Light ANSI","light-daltonized":"Light (colorblind)",dark:"Dark","dark-ansi":"Dark ANSI","dark-daltonized":"Dark (colorblind)"}}},e2e={enable:"Enable Notifications",toast:"In-app Toast",toastDescription:"Show toast notifications in the Vibora interface",desktop:"Desktop Notifications",desktopDescription:"Show native desktop or browser notifications",sound:"Sound",slack:"Slack",discord:"Discord",pushover:"Pushover",appToken:"App Token",userKey:"User Key",testSuccess:"{{channel}} test successful",testFailed:"{{channel}} test failed: {{error}}",uploadSound:"Upload custom sound",deleteSound:"Remove custom sound",testSound:"Test sound",soundUploaded:"Custom sound uploaded",soundUploadFailed:"Failed to upload sound: {{error}}",soundDeleted:"Custom sound removed",soundDeleteFailed:"Failed to remove custom sound",customSoundActive:"Custom sound active"},t2e={restartButton:"Restart Vibora",restarting:"Restarting...",restartDescription:"Rebuild and restart the Vibora server. If the build fails, the server will continue running.",restartFailed:"Restart failed",checkLogs:"Build may have failed. Check journalctl --user -u vibora for details."},n2e={title:"Unsaved Changes",description:"You have unsaved changes that will be lost if you leave this page.",stay:"Stay",leave:"Leave"},r2e={title:Zke,sections:Qke,fields:Jke,notifications:e2e,developer:t2e,unsavedChanges:n2e},i2e="Review",a2e={pullRequests:"Pull Requests",issues:"Issues"},s2e={pr:{created:"Created by me",assigned:"Assigned to me",reviewRequested:"Review requests",mentioned:"Mentioned"},issue:{assigned:"Assigned to me",created:"Created by me",mentioned:"Mentioned"},allOrgs:"All Orgs",allOrganizations:"All Organizations",viboraReposOnly:"Vibora repos only"},o2e={tokenRequired:"GitHub Token Required",tokenDescription:"To view your issues and pull requests, add a GitHub Personal Access Token in Settings.",requiredScopes:"Required scopes:",scopes:{repo:"(for private repositories)",readUser:"(for user info)",readOrg:"(for organization list)"},generateToken:"Generate Token",goToSettings:"Go to Settings"},l2e={loading:"Loading...",failedToLoad:"Failed to load pull requests",empty:{all:"No open pull requests",created:"No pull requests created by you",assigned:"No pull requests assigned to you",reviewRequested:"No pull requests awaiting your review",mentioned:"No pull requests mentioning you"},draft:"Draft"},u2e={loading:"Loading...",failedToLoad:"Failed to load issues",empty:{assigned:"No issues assigned to you",created:"No issues created by you",mentioned:"No issues mentioning you"}},c2e={title:i2e,tabs:a2e,filters:s2e,github:o2e,prs:l2e,issues:u2e},d2e="Worktrees",f2e={total:"{{count}} total",orphaned:"{{count}} orphaned"},p2e={button:"Clean up ({{count}})",title:"Delete Completed Worktrees",description:"This will permanently delete {{count}} worktree(s).",linkedTasksWillBeDeleted:"Their linked tasks will also be deleted.",alsoDeleteLinkedTasks:"Also delete linked tasks",done:"Done",canceled:"Canceled",cannotUndo:"This action cannot be undone.",pinnedSkipped:"{{count}} pinned worktree(s) will be skipped"},h2e={pin:"Pin worktree",unpin:"Unpin worktree"},m2e={noMatch:"No worktrees match the selected filters.",noWorktrees:"No worktrees found. Worktrees are created when you create tasks."},g2e={failedToLoad:"Failed to load worktrees: {{message}}"},b2e={title:d2e,summary:f2e,cleanup:p2e,delete:{title:"Delete Worktree",description:"This will permanently delete the worktree directory at",linkedTaskWillBeDeleted:'The linked task "{{title}}" will also be deleted.',alsoDeleteLinkedTask:'Also delete linked task "{{title}}"',cannotUndo:"This action cannot be undone.",button:"Delete {{count}}",unpinFirst:"Unpin worktree before deleting"},pin:h2e,empty:m2e,error:g2e},v2e="Monitoring",y2e={claude:"AI Agents",system:"System Metrics",processes:"Processes",vibora:"Vibora Servers",worktrees:"Worktrees",jobs:"Jobs",usage:"Usage Limits"},_2e={showAllInstances:"Show all instances",instanceCount:"{{count}} instance(s) running",totalRam:"{{ram}} MB total",headers:{agent:"Agent",terminal:"Terminal",task:"Task",ram:"RAM",actions:"Actions",pid:"PID",workingDirectory:"Working Dir",source:"Source"},noTask:"(no task)",kill:"Kill",killing:"Killing...",killSelected:"Kill {{count}} selected",source:{vibora:"Vibora: {{name}}",external:"External"},empty:"No AI agent instances running",emptyVibora:" in Vibora terminals",error:"Failed to load AI agent instances: {{message}}"},x2e={cpuUsage:"CPU Usage",memoryUsage:"Memory Usage",memoryLabels:{used:"Used",cache:"Cache / Buffers"},diskUsage:"Disk Usage ({{path}})",error:"Failed to load system metrics: {{message}}",timeWindows:{"1m":"1 min","10m":"10 min","1h":"1 hour","3h":"3 hours","6h":"6 hours","12h":"12 hours","24h":"24 hours"}},E2e={topProcesses:"Top Processes",sortBy:{memory:"By Memory",cpu:"By CPU"},headers:{pid:"PID",name:"Name",command:"Command",memory:"Memory"},empty:"No processes found",error:"Failed to load processes: {{message}}",containers:"Containers",containersEmpty:"No containers running",containersUnavailable:"Docker/Podman not available"},S2e={description:"Running Vibora dev servers",instanceCount:"{{count}} instance(s) running",headers:{port:"Port",mode:"Mode",directory:"Directory",ram:"RAM",actions:"Actions"},mode:{dev:"Dev",prod:"Prod"},vite:"Vite",kill:"Kill",killing:"Killing...",empty:"No Vibora instances running",error:"Failed to load Vibora instances: {{message}}"},w2e={fiveHourBlock:"5-Hour Block",sevenDayRolling:"7-Day Rolling",opusWeekly:"Opus Weekly",sonnetWeekly:"Sonnet Weekly",resetsIn:"Resets in {{time}}",resetsAt:"Resets {{time}}",weekProgress:"{{percent}}% through week",unavailable:"Claude Code usage data not available. Make sure you're logged in to Claude Code.",error:"Failed to load usage data: {{message}}"},C2e={title:v2e,tabs:y2e,claude:_2e,system:x2e,processes:E2e,vibora:S2e,usage:w2e},T2e="Tasks",A2e="Projects",k2e="New Terminal",O2e="All Repos",R2e="Select projects",N2e="{{count}} selected",I2e="Select up to 6 projects",D2e="Clear selection",L2e="Select a project to open its workspace terminal",P2e="No active tasks",M2e={title:"Edit Tab",name:"Name",namePlaceholder:"Tab name",directory:"Directory",directoryPlaceholder:"Select a directory...",clearDirectory:"Clear directory",cancel:"Cancel",save:"Save"},j2e={title:"New Tab",create:"Create"},F2e={taskTerminals:T2e,projectTerminals:A2e,newTerminal:k2e,allRepos:O2e,selectProjects:R2e,projectsSelected:N2e,filterByProject:I2e,clearFilter:D2e,emptyProjects:L2e,emptyTasks:P2e,editTab:M2e,newTab:j2e},B2e="Repositories",U2e="{{count}} total",$2e="Search repositories...",z2e="New Task",H2e="Tasks",V2e="Terminal",W2e="Editor",G2e="Application",q2e="Applications",K2e="Create App",Y2e={title:"Docker Compose Required",description:"To create an app for deployment, this repository needs a Docker Compose file.",instructions:"Create a docker-compose.yml file in your repository.",close:"Got it"},X2e="Settings",Z2e="Add Repository",Q2e="Scan Directory",J2e="Open in Terminal",eOe="Open in {{editor}}",tOe={openInVSCode:"Open in VS Code"},nOe={title:"Add Repository",description:"Add a git repository from a URL or local path, or scan a directory.",tabs:{add:"Add",scan:"Scan",template:"From Template"},inputLabel:"Repository URL or path",inputPlaceholder:"https://github.com/user/repo or /local/path",browse:"Browse...",cloneOptions:"Clone Options",targetDirectory:"Clone to directory",folderName:"Folder name",willCloneTo:"Will clone to",cloning:"Cloning repository...",adding:"Adding...",cloneFailed:"Failed to clone repository",createFailed:"Failed to add repository",cancel:"Cancel",add:"Add",retry:"Retry",fields:{path:"Repository Path",pathPlaceholder:"Select repository...",displayName:"Display Name",startupScript:"Startup Script",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"Command to run in the terminal when creating a worktree.",copyFiles:"Copy Files",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"Comma-separated glob patterns for files to copy into new worktrees.",isCopierTemplate:"Use as Copier Template",isCopierTemplateDescription:"Mark as a template for creating new projects."}},rOe={button:"New Project",title:"Create New Project",back:"Back",next:"Next",create:"Create Project",steps:{template:{description:"Select a template to create your project from.",sectionTitle:"Copier Template",sectionDescription:"Select a saved template or enter a URL/path.",learnMore:"Learn more",savedTemplates:"Saved Templates",selectTemplate:"Select a template...",or:"or",customUrl:"Custom Template URL/Path"},questions:{title:"Template Questions",description:"Configure your project.",noQuestions:"This template has no configuration questions."},output:{title:"Output Location",description:"Choose where to create your project.",projectName:"Project Name",outputDirectory:"Output Directory",selectDirectory:"Select directory...",willCreate:"Will create",trust:"Trust template"},creating:{description:"Creating your project...",inProgress:"Running Copier..."}}},iOe={title:"Scan Directory for Repositories",description:"Find and add multiple git repositories from a directory.",directoryLabel:"Directory to scan",directoryPlaceholder:"Enter directory path",browse:"Browse...",scan:"Scan",foundRepos:"Found {{count}} repositories",selectAll:"Select all",selectNone:"Select none",noReposFound:"No git repositories found in this directory.",alreadyAdded:"Already added",adding:"Adding repositories...",scanFailed:"Failed to scan directory",addFailed:"Failed to add repositories",cancel:"Cancel",addSelected:"Add {{count}} selected"},aOe={noRepositories:"No repositories added yet. Add a repository for quick access when creating tasks.",noMatches:"No repositories match your search."},sOe={failedToLoad:"Failed to load repositories: {{message}}"},oOe={breadcrumb:"Repositories",notFound:"Repository not found",save:"Save",saving:"Saving...",saved:"Repository saved",failedToSave:"Failed to save repository",tabs:{settings:"Task Settings",workspace:"Workspace"},mobileWorkspace:{terminal:"Terminal",files:"Files"},fileTree:{title:"Files",searchPlaceholder:"Search files...",noFiles:"No files",collapseAll:"Collapse all folders"},settings:{generalTitle:"General",agentTitle:"Agent Options",displayName:"Display Name",defaultAgent:"Default Agent",defaultAgentInherit:"Use global default",defaultAgentDescription:"Override the global default agent for tasks created from this repository.",startupScript:"Startup Script",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"Command to run in the terminal when creating a worktree.",claudeOptions:"Claude Code Options",claudeOptionsDescription:"CLI flags passed to Claude Code when starting a task.",opencodeOptions:"OpenCode Options",opencodeOptionsDescription:"CLI flags passed to OpenCode when starting a task.",opencodeModel:"OpenCode Model",opencodeModelPlaceholder:"Select model",opencodeModelDescription:"Default OpenCode model for tasks created from this repository.",agentOptionsFlag:"Flag",agentOptionsValue:"Value",addAgentOption:"Add option",copyFiles:"Copy Files",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"Comma-separated glob patterns for files to copy into new worktrees.",isCopierTemplate:"Use as Copier Template",isCopierTemplateDescription:"Mark as a template for creating new projects with Copier."},workspace:{connectingToTerminal:"Connecting to terminal server...",initializingTerminal:"Initializing terminal..."}},lOe={title:B2e,total:U2e,searchPlaceholder:$2e,newTask:z2e,viewTasks:H2e,terminal:V2e,editor:W2e,application:G2e,applications:q2e,createApp:K2e,createAppDialog:Y2e,settings:X2e,addRepository:Z2e,scanDirectory:Q2e,openInTerminal:J2e,openInEditor:eOe,card:tOe,delete:{title:"Delete Repository",description:'This will remove "{{name}}" from Vibora. The actual repository files will not be affected.',button:"Delete",deleting:"Deleting...",alsoDeleteDirectory:"Also delete the directory from disk",deleteDirectoryWarning:"This will permanently delete all files in the repository. This action cannot be undone."},addModal:nOe,newProject:rOe,bulkAdd:iOe,empty:aOe,error:sOe,detailView:oOe},uOe="Jobs",cOe="View scheduled tasks (systemd timers on Linux, launchd jobs on macOS)",dOe="Search jobs...",fOe="No scheduled jobs found",pOe="No jobs match your search",hOe="Create Job",mOe={all:"All",user:"User",system:"System"},gOe={active:"Active",inactive:"Inactive",failed:"Failed",waiting:"Waiting",disabled:"Disabled"},bOe="Next",vOe="Last",yOe="System timers are read-only",_Oe="Jobs on macOS are read-only",xOe={enable:"Enable",disable:"Disable",start:"Start",stop:"Stop",runNow:"Run Now",edit:"Edit",delete:"Delete",viewLogs:"View Logs"},EOe={tabs:{general:"General",logs:"Logs",edit:"Edit"},schedule:"Schedule",nextRun:"Next Run",lastRun:"Last Run",lastResult:"Last Result",description:"Description",command:"Command",workingDir:"Working Directory",systemTimer:"System timer (read-only)",timerFile:"Timer File",serviceFile:"Service File",executionStats:"Last Execution",duration:"Duration",cpuTime:"CPU Time",noStats:"No execution data available"},SOe={title:"Create Scheduled Job",name:"Job Name",namePlaceholder:"backup-daily",nameHelp:"Alphanumeric, hyphens, and underscores only",description:"Description",descriptionPlaceholder:"Daily backup of important files",schedule:"Schedule",scheduleHelp:"OnCalendar expression (e.g., *-*-* 02:00:00, daily, weekly)",command:"Command",commandPlaceholder:"/home/user/scripts/backup.sh",workingDir:"Working Directory",workingDirPlaceholder:"/home/user",persistent:"Persistent",persistentHelp:"Run missed executions when system starts",cancel:"Cancel",create:"Create Job"},wOe={title:"Job Logs",noLogs:"No logs available",lines:"lines",refresh:"Refresh"},COe={loadFailed:"Failed to load jobs",createFailed:"Failed to create job",updateFailed:"Failed to update job",deleteFailed:"Failed to delete job"},qV={title:uOe,description:cOe,searchPlaceholder:dOe,noJobs:fOe,noJobsMatch:pOe,createJob:hOe,scope:mOe,status:gOe,nextRun:bOe,lastRun:vOe,systemTimerReadonly:yOe,macosReadonly:_Oe,actions:xOe,detail:EOe,create:SOe,delete:{title:"Delete Job",confirm:'Are you sure you want to delete "{{name}}"? This will remove both the timer and service files.',cancel:"Cancel",delete:"Delete"},logs:wOe,errors:COe},TOe="Projects",AOe="{{count}} total",kOe="Search projects...",OOe="New Task",ROe="Terminal",NOe="Editor",IOe="Deploy",DOe="Stop",LOe="New Project",POe={noProjects:"No projects yet. Create a project to get started.",noMatches:"No projects match your search."},MOe={failedToLoad:"Failed to load projects: {{message}}"},jOe={noApp:"No app",running:"Running",building:"Building",stopped:"Stopped",failed:"Failed"},FOe={breadcrumb:"Projects",notFound:"Project not found",save:"Save",saving:"Saving...",tabs:{settings:"Task Settings",workspace:"Workspace",deploy:"Deploy",deployGeneral:"General",deployments:"Deployments",logs:"Logs",monitoring:"Monitoring"},general:{repositoryTitle:"Repository",agentTitle:"Agent Options",path:"Path",displayName:"Display Name",startupScript:"Startup Script",copyFiles:"Copy Files",defaultAgent:"Default Agent",claudeOptions:"Claude Code Options",opencodeOptions:"OpenCode Options",opencodeModel:"OpenCode Model",noRepository:"No repository linked to this project."},app:{title:"App Configuration",noApp:"No app configured for this project.",configureDeployment:"Configure Deployment",configureDeploymentDescription:"Set up Docker Compose deployment for this project",configuring:"Configuring...",deployOptions:"Deploy Options",autoDeployEnabled:"Auto-deploy on commit",autoPortAllocation:"Auto-allocate ports",noCacheBuild:"No-cache builds",notificationsEnabled:"Deployment notifications",services:"Services",environment:"Environment Variables",composeFile:"Compose File"}},BOe={step:"Step {{current}} of {{total}}",selectRepository:"Select Repository",existingRepo:"Existing",addNewRepo:"Add New",searchRepos:"Search repositories...",noReposFound:"No repositories found",repoPathOrUrl:"Repository Path or URL",repoInputPlaceholder:"~/code/my-repo or https://github.com/user/repo",browse:"Browse",cloneOptions:"Clone Options",targetDirectory:"Target Directory",folderName:"Folder Name",willCloneTo:"Will clone to",cloning:"Cloning repository...",adding:"Adding repository...",cloneAndSelect:"Clone & Select",addAndSelect:"Add & Select",addRepoFailed:"Failed to add repository",checkingCompose:"Checking for compose file...",composeFound:"Found {{file}}",noCompose:"No compose file found",cancel:"Cancel",next:"Next",back:"Back",configureProject:"Configure Project",projectName:"Project Name",projectNamePlaceholder:"my-project",description:"Description",descriptionPlaceholder:"Optional project description",composeDetected:"Docker Compose detected: {{file}}",setupAppNow:"Set up app deployment after creation",createProject:"Create Project",creating:"Creating...",create:"Create"},UOe={all:"All",hasApp:"With App",noApp:"Without App",running:"Running",archived:"Archived"},$Oe={title:TOe,total:AOe,searchPlaceholder:kOe,newTask:OOe,terminal:ROe,editor:NOe,deploy:IOe,stop:DOe,newProjectButton:LOe,empty:POe,error:MOe,card:jOe,delete:{title:"Delete Project",description:'This will remove the project "{{name}}".',button:"Delete",deleting:"Deleting...",alsoDeleteDirectory:"Also delete the directory",alsoDeleteApp:"Also delete the app and stop containers"},detailView:FOe,newProject:BOe,filter:UOe},zOe={save:"保存更改",cancel:"取消",delete:"删除",create:"创建",reset:"重置为默认值",browse:"浏览",clearFilters:"清除筛选"},HOe={loading:"加载中...",saving:"保存中...",saved:"已保存",error:"错误",calculating:"计算中...",validating:"验证中...",creating:"创建中...",deleting:"删除中...",loggingIn:"登录中...",uploading:"上传中..."},VOe={justNow:"刚刚",minuteAgo:"1 分钟前",minutesAgo:"{{count}} 分钟前",hourAgo:"1 小时前",hoursAgo:"{{count}} 小时前",dayAgo:"1 天前",daysAgo:"{{count}} 天前"},WOe={one:"{{count}} 个结果",other:"{{count}} 个结果"},GOe={IN_PROGRESS:"进行中",IN_REVIEW:"审核中",DONE:"已完成",CANCELED:"已取消",ORPHANED:"孤立"},qOe={loginTitle:"登录 Vibora",username:"用户名",password:"密码",login:"登录",loginFailed:"登录失败"},KOe={sentToClaude:"已发送到 Claude Code",noTerminal:"没有可用的终端",syncedFromMain:"已从 main 同步",mergedToMain:"已合并到 main",pushedToOrigin:"已推送到 origin",parentSynced:"父仓库已与 origin 同步",prCreated:"PR 已创建",prExists:"PR 已存在"},YOe={imageUploadFailed:"图片上传失败",terminalNotConnected:"终端未连接",terminalNotConnectedDesc:"请等待连接建立"},XOe={notInstalled:"OpenCode 未安装",selectModel:"选择模型",useDefault:"使用默认",noModelsFound:"未找到模型"},ZOe={manualDnsRequired:"需要手动配置 DNS",manualDnsRequiredDesc:"未配置 Cloudflare API 令牌。您需要手动为域名创建 DNS 记录。",deployToApply:"部署以应用更改",deployToApplyDesc:"域名配置已保存。部署应用程序以使更改生效。",unknownRepo:"未知仓库",service:"服务",services:"服务",exposed:"已暴露",lastDeployed:"上次部署",stop:"停止",deploy:"部署",deploying:"部署中...",building:"构建中...",cancelDeploy:"取消",cancelling:"取消中...",delete:"删除",deleting:"删除中...",searchApps:"搜索应用...",allRepos:"所有仓库",newApp:"新建应用",createApp:"创建应用",noAppsYet:"暂无应用。创建您的第一个应用开始使用!",noAppsMatch:"没有匹配的应用。",failedToLoadApps:"加载应用失败",deleteApp:"删除应用",deleteAppConfirm:'确定要删除 "{{name}}" 吗?这将停止所有容器并删除应用配置。此操作无法撤销。',cancel:"取消",appNotFound:"应用未找到",backToApps:"返回应用列表",tabs:{general:"概览",deployments:"部署记录",logs:"日志",environment:"环境变量",domains:"域名",monitoring:"监控",workspace:"工作区"},general:{deploy:"部署",deployOptions:"部署选项",autodeploy:"自动部署",noCache:"无缓存",notifications:"通知",services:"服务",noServicesConfigured:"未配置服务"},workspace:{noRepository:"此应用未关联仓库"},compose:{title:"Compose 文件",repoNotFound:"未找到仓库路径",unsavedChanges:"未保存的更改",save:"保存",edit:"编辑",done:"完成",preview:"预览",previewDescription:"预览将要部署的 compose 文件",generatedTitle:"生成的 Compose 文件预览",generatedDescription:"显示当前配置将要部署的内容,包括环境变量展开和 Docker Swarm 转换。"},logs:{title:"日志",description:"实时查看应用程序日志",allContainers:"所有容器",lines:"行",copy:"复制",copied:"已复制",download:"下载",refresh:"刷新",noLogs:"暂无日志"},deployments:{title:"部署记录",description:"查看此 Compose 的最近 10 次部署",noDeployments:"暂无部署记录",view:"查看",statusDone:"完成",statusError:"错误",statusBuilding:"构建中",deployment:"部署",seeDetails:"查看此部署的详细信息",noBuildLogs:"暂无构建日志"},environment:{title:"环境变量",description:"设置 Docker Compose 构建的环境变量。这些变量在构建期间和容器中都可用。",placeholder:`DATABASE_URL=postgres://...
29
29
  API_KEY=your-api-key
30
- # 支持注释`,save:"保存环境变量",showValues:"显示值",hideValues:"隐藏值",unsavedChanges:"您有未保存的更改"},domains:{title:"域名配置",description:"配置要暴露的服务及其域名映射",expose:"暴露",exposeRequiresPort:"未配置端口。请在 compose 文件中添加端口映射。",domain:"域名",noDomain:"未配置域名",portRequired:"需要端口",editDomain:"编辑域名",noServices:"未配置服务。请先部署应用以查看可用服务。",save:"保存"},streaming:{pulling:"拉取代码...",building:"构建容器...",starting:"启动服务...",configuring:"配置路由...",done:"部署完成!",failed:"部署失败",cancelled:"部署已取消",preparing:"准备中...",waitingForLogs:"等待日志..."},dnsConfigRequired:"需要配置 DNS",settings:"设置",status:{running:"运行中",building:"构建中",failed:"失败",stopped:"已停止"},monitoring:{title:"资源使用",description:"每个服务的实时 CPU 和内存使用情况",cpu:"CPU",memory:"内存",noContainers:"未找到运行中的容器",dockerUnavailable:"Docker 统计不可用",serviceTotal:"服务总计"}},QOe={buttons:zOe,status:HOe,time:VOe,results:WOe,statuses:GOe,auth:qOe,git:KOe,errors:YOe,opencode:XOe,apps:ZOe},JOe={tasks:"任务",projects:"项目",terminals:"终端",worktrees:"工作树",repositories:"仓库",apps:"应用",jobs:"作业",review:"审核",monitoring:"监控",settings:"设置",commandPalette:"命令面板 ({{shortcut}})",help:"文档"},eRe={placeholder:"输入命令或搜索...",noResults:"未找到命令",categories:{navigation:"导航",actions:"操作"},commands:{goToTasks:"前往任务",goToProjects:"前往项目",goToTerminals:"前往终端",goToTaskTerminals:"前往任务终端",goToProjectTerminals:"前往项目终端",goToRepositories:"前往仓库",goToApps:"前往应用",goToJobs:"前往作业",goToReview:"前往审核",goToMonitoring:"前往监控",goToSettings:"前往设置",newTask:"新建任务",newProject:"新建项目",openInEditor:"在编辑器中打开",keyboardShortcuts:"键盘快捷键"}},tRe={title:"键盘快捷键",groups:{navigation:"导航",actions:"操作",terminals:"终端(桌面端)",general:"通用"},labels:{goToTasks:"前往任务",goToProjects:"前往项目",goToTerminals:"前往终端",goToTaskTerminals:"前往任务终端",goToProjectTerminals:"前往项目终端",goToRepositories:"前往仓库",goToApps:"前往应用",goToJobs:"前往作业",goToReview:"前往审核",goToMonitoring:"前往监控",goToSettings:"前往设置",commandPalette:"命令面板",newTask:"新建任务",newProject:"新建项目",openInEditor:"在编辑器中打开",keyboardShortcuts:"键盘快捷键",closeModal:"关闭弹窗",newTerminal:"新建终端",closeTerminal:"关闭终端",submitForm:"提交表单"}},nRe={title:"在编辑器中打开",description:"在 {{editor}} 中打开文件夹",pathLabel:"目录路径",pathPlaceholder:"~/projects/my-project",pathHint:"请输入目录路径。支持 ~ 表示主目录。",pathNotFound:"路径不存在",pathNotDirectory:"路径必须是目录,不能是文件",browse:"浏览",cancel:"取消",open:"打开"},rRe={header:JOe,commandPalette:eRe,shortcuts:tRe,openInEditor:nRe},iRe="任务",aRe="搜索",sRe="全部仓库",oRe="新建任务",lRe={title:"创建新任务",description:"创建一个带有 Git 工作树的新任务,用于隔离开发。",fields:{title:"标题",titlePlaceholder:"添加用户认证",description:"描述",descriptionPlaceholder:"实现 OAuth2 登录流程...",aiMode:"AI 模式",agent:"AI 代理",opencodeModel:"OpenCode 模型",opencodeModelPlaceholder:"选择模型",repository:"仓库",baseBranch:"基础分支",branchName:"分支名称",branchPlaceholder:"自动生成分支名"},aiModes:{plan:"计划",default:"默认"},tabs:{saved:"仓库",browse:"浏览"},worktreePrefix:"工作树:",branchAutoGenerated:'留空将使用 "{{branch}}"。',selectFolder:"选择文件夹...",searchRepositories:"搜索仓库...",noRepositoriesFound:"未找到仓库",selectRepositoryFirst:"请先选择仓库",loadingBranches:"加载分支中...",selectBranch:"选择分支",current:"(当前)",createTask:"创建任务",errors:{notGitRepo:"所选文件夹不是 Git 仓库",validationFailed:"验证仓库失败",createFailed:"创建任务失败"}},uRe={title:iRe,searchPlaceholder:aRe,allRepos:sRe,newTask:oRe,createModal:lRe},cRe="设置",dRe={server:"服务器",serverDefaults:"服务器与默认设置",paths:"路径",editor:"编辑器",integrations:"集成",zai:"z.ai",agent:"AI 代理",notifications:"通知",appearance:"外观",developer:"开发者"},fRe={port:{label:"端口",description:"需要重启"},startupCommand:{label:"启动命令",description:"新任务终端的命令"},gitReposDir:{label:"Git 仓库目录",description:"仓库选择器的起始目录"},editor:{app:{label:"编辑器",description:"用于打开工作树的代码编辑器",options:{vscode:"VS Code",cursor:"Cursor",windsurf:"Windsurf",zed:"Zed",antigravity:"Antigravity"}},host:{label:"远程主机",description:"代码在远程机器上时使用的 SSH 地址",placeholder:"例如:my-server.tailnet.ts.net"},sshPort:{label:"SSH 端口",description:"远程 SSH 端口(默认 22)"}},linear:{label:"Linear",description:"用于工单同步的 API 密钥"},github:{label:"GitHub",description:"用于 Issues 和 PR 的个人访问令牌"},cloudflare:{label:"Cloudflare",placeholder:"输入 API 令牌...",description:"用于自动 DNS 记录的 API 令牌"},zai:{enable:"启用",apiKey:"API 密钥",description:"配置 Claude Code 使用 z.ai 代理",modelMappings:"模型映射",haiku:"Haiku",sonnet:"Sonnet",opus:"Opus"},agent:{default:{label:"默认代理",description:"新任务使用的 AI 编码代理"},opencodeModel:{label:"OpenCode 模型",placeholder:"选择模型",description:"启动 OpenCode 任务时使用的默认模型"},advancedAgentNames:{label:"高级代理名称",description:"配置 OpenCode 模式的特定代理名称",warning:"仅在您知道自己在做什么的情况下更改这些设置。这些设置适用于拥有自定义 OpenCode 代理(例如,带有 Sisyphus/Planner-Sisyphus 代理的 oh-my-opencode 插件)的用户。"},opencodeDefaultAgent:{label:"默认模式",description:"全权限模式的代理名称。oh-my-opencode 使用 'Sisyphus',原版 OpenCode 使用 'build'。"},opencodePlanAgent:{label:"计划模式",description:"受限/计划模式的代理名称。oh-my-opencode 使用 'Planner-Sisyphus',原版 OpenCode 使用 'plan'。注意:Planner-Sisyphus 从 OpenCode 的 plan 代理配置继承模型,因此上述模型覆盖可能不适用。请在 ~/.config/opencode/oh-my-opencode.json 中配置模型。"}},language:{label:"语言",description:"界面语言",options:{auto:"自动检测",en:"English",zh:"简体中文"}},theme:{label:"主题",description:"界面颜色主题",options:{system:"跟随系统",light:"浅色",dark:"深色"}},syncClaudeTheme:{label:"同步 Claude Code",description:"当 Vibora 在浅色和深色模式之间切换时自动更新 Claude Code 的主题"},claudeCodeTheme:{light:"浅色模式",dark:"深色模式",options:{light:"浅色","light-ansi":"浅色 ANSI","light-daltonized":"浅色(色盲友好)",dark:"深色","dark-ansi":"深色 ANSI","dark-daltonized":"深色(色盲友好)"}}},pRe={enable:"启用通知",toast:"应用内提示",toastDescription:"在 Vibora 界面中显示提示通知",desktop:"桌面通知",desktopDescription:"显示原生桌面或浏览器通知",sound:"声音",slack:"Slack",discord:"Discord",pushover:"Pushover",appToken:"应用令牌",userKey:"用户密钥",testSuccess:"{{channel}} 测试成功",testFailed:"{{channel}} 测试失败:{{error}}",uploadSound:"上传自定义声音",deleteSound:"删除自定义声音",testSound:"测试声音",soundUploaded:"自定义声音已上传",soundUploadFailed:"上传声音失败:{{error}}",soundDeleted:"自定义声音已删除",soundDeleteFailed:"删除自定义声音失败",customSoundActive:"使用自定义声音"},hRe={restartButton:"重启 Vibora",restarting:"重启中...",restartDescription:"重新构建并重启 Vibora 服务器。如果构建失败,服务器将继续运行。",restartFailed:"重启失败",checkLogs:"构建可能失败。运行 journalctl --user -u vibora 查看详情。"},mRe={title:"未保存的更改",description:"您有未保存的更改,离开此页面将丢失这些更改。",stay:"留下",leave:"离开"},gRe={title:cRe,sections:dRe,fields:fRe,notifications:pRe,developer:hRe,unsavedChanges:mRe},bRe="审核",vRe={pullRequests:"拉取请求",issues:"问题"},yRe={pr:{created:"我创建的",assigned:"分配给我的",reviewRequested:"待我审核",mentioned:"提及我的"},issue:{assigned:"分配给我的",created:"我创建的",mentioned:"提及我的"},allOrgs:"所有组织",allOrganizations:"所有组织",viboraReposOnly:"仅 Vibora 仓库"},_Re={tokenRequired:"需要 GitHub 令牌",tokenDescription:"要查看您的问题和拉取请求,请在设置中添加 GitHub 个人访问令牌。",requiredScopes:"所需权限:",scopes:{repo:"(用于私有仓库)",readUser:"(用于用户信息)",readOrg:"(用于组织列表)"},generateToken:"生成令牌",goToSettings:"前往设置"},xRe={loading:"加载中...",failedToLoad:"加载拉取请求失败",empty:{all:"没有打开的拉取请求",created:"没有您创建的拉取请求",assigned:"没有分配给您的拉取请求",reviewRequested:"没有等待您审核的拉取请求",mentioned:"没有提及您的拉取请求"},draft:"草稿"},ERe={loading:"加载中...",failedToLoad:"加载问题失败",empty:{assigned:"没有分配给您的问题",created:"没有您创建的问题",mentioned:"没有提及您的问题"}},SRe={title:bRe,tabs:vRe,filters:yRe,github:_Re,prs:xRe,issues:ERe},wRe="工作树",CRe={total:"共 {{count}} 个",orphaned:"{{count}} 个孤立"},TRe={button:"清理 ({{count}})",title:"删除已完成的工作树",description:"这将永久删除 {{count}} 个工作树。",linkedTasksWillBeDeleted:"关联的任务也将被删除。",alsoDeleteLinkedTasks:"同时删除关联的任务",done:"已完成",canceled:"已取消",cannotUndo:"此操作无法撤销。",pinnedSkipped:"将跳过 {{count}} 个已固定的工作树"},ARe={pin:"固定工作树",unpin:"取消固定工作树"},kRe={noMatch:"没有匹配所选筛选条件的工作树。",noWorktrees:"未找到工作树。工作树在创建任务时自动生成。"},ORe={failedToLoad:"加载工作树失败:{{message}}"},RRe={title:wRe,summary:CRe,cleanup:TRe,delete:{title:"删除工作树",description:"这将永久删除位于以下位置的工作树目录",linkedTaskWillBeDeleted:'关联的任务 "{{title}}" 也将被删除。',alsoDeleteLinkedTask:'同时删除关联的任务 "{{title}}"',cannotUndo:"此操作无法撤销。",button:"删除 {{count}} 个",unpinFirst:"请先取消固定工作树再删除"},pin:ARe,empty:kRe,error:ORe},NRe="监控",IRe={claude:"AI 代理",system:"系统指标",processes:"进程",vibora:"Vibora 服务器",worktrees:"工作树",jobs:"作业",usage:"使用限额"},DRe={showAllInstances:"显示所有实例",instanceCount:"{{count}} 个实例运行中",totalRam:"总计 {{ram}} MB",headers:{agent:"代理",terminal:"终端",task:"任务",ram:"内存",actions:"操作",pid:"PID",workingDirectory:"工作目录",source:"来源"},noTask:"(无任务)",kill:"终止",killing:"终止中...",killSelected:"终止 {{count}} 个已选",source:{vibora:"Vibora: {{name}}",external:"外部"},empty:"没有 AI 代理实例运行中",emptyVibora:" (在 Vibora 终端中)",error:"加载 AI 代理实例失败:{{message}}"},LRe={cpuUsage:"CPU 使用率",memoryUsage:"内存使用率",memoryLabels:{used:"已使用",cache:"缓存/缓冲区"},diskUsage:"磁盘使用率 ({{path}})",error:"加载系统指标失败:{{message}}",timeWindows:{"1m":"1 分钟","10m":"10 分钟","1h":"1 小时","3h":"3 小时","6h":"6 小时","12h":"12 小时","24h":"24 小时"}},PRe={topProcesses:"热门进程",sortBy:{memory:"按内存",cpu:"按 CPU"},headers:{pid:"PID",name:"名称",command:"命令",memory:"内存"},empty:"未找到进程",error:"加载进程失败:{{message}}",containers:"容器",containersEmpty:"没有容器运行中",containersUnavailable:"Docker/Podman 不可用"},MRe={description:"运行中的 Vibora 开发服务器",instanceCount:"{{count}} 个实例运行中",headers:{port:"端口",mode:"模式",directory:"目录",ram:"内存",actions:"操作"},mode:{dev:"开发",prod:"生产"},vite:"Vite",kill:"终止",killing:"终止中...",empty:"没有 Vibora 实例运行中",error:"加载 Vibora 实例失败:{{message}}"},jRe={fiveHourBlock:"5小时配额",sevenDayRolling:"7天滚动配额",opusWeekly:"Opus 周配额",sonnetWeekly:"Sonnet 周配额",resetsIn:"{{time}}后重置",resetsAt:"{{time}}重置",weekProgress:"本周已过 {{percent}}%",unavailable:"Claude Code 使用数据不可用。请确保已登录 Claude Code。",error:"加载使用数据失败:{{message}}"},FRe={title:NRe,tabs:IRe,claude:DRe,system:LRe,processes:PRe,vibora:MRe,usage:jRe},BRe="任务",URe="项目",$Re="新建终端",zRe="全部仓库",HRe="选择项目",VRe="已选择 {{count}} 个",WRe="最多选择6个项目",GRe="清除选择",qRe="选择项目以打开其工作区终端",KRe="没有进行中的任务",YRe={title:"编辑标签页",name:"名称",namePlaceholder:"标签页名称",directory:"目录",directoryPlaceholder:"选择目录...",clearDirectory:"清除目录",cancel:"取消",save:"保存"},XRe={title:"新建标签页",create:"创建"},ZRe={taskTerminals:BRe,projectTerminals:URe,newTerminal:$Re,allRepos:zRe,selectProjects:HRe,projectsSelected:VRe,filterByProject:WRe,clearFilter:GRe,emptyProjects:qRe,emptyTasks:KRe,editTab:YRe,newTab:XRe},QRe="仓库",JRe="共 {{count}} 个",eNe="搜索仓库...",tNe="新建任务",nNe="任务",rNe="终端",iNe="编辑器",aNe="应用",sNe="应用",oNe="创建应用",lNe={title:"需要 Docker Compose",description:"要为部署创建应用,此仓库需要 Docker Compose 文件。",instructions:"请在仓库中创建 docker-compose.yml 文件。",close:"知道了"},uNe="设置",cNe="添加仓库",dNe="扫描目录",fNe="在终端中打开",pNe="在 {{editor}} 中打开",hNe={openInVSCode:"在 VS Code 中打开"},mNe={title:"添加仓库",description:"从 URL 或本地路径添加 Git 仓库,或扫描目录。",tabs:{add:"添加",scan:"扫描",template:"从模板创建"},inputLabel:"仓库 URL 或路径",inputPlaceholder:"https://github.com/user/repo 或 /local/path",browse:"浏览...",cloneOptions:"克隆选项",targetDirectory:"克隆到目录",folderName:"文件夹名称",willCloneTo:"将克隆到",cloning:"正在克隆仓库...",adding:"添加中...",cloneFailed:"克隆仓库失败",createFailed:"添加仓库失败",cancel:"取消",add:"添加",retry:"重试",fields:{path:"仓库路径",pathPlaceholder:"选择仓库...",displayName:"显示名称",startupScript:"启动脚本",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"创建工作树时在终端中运行的命令。",copyFiles:"复制文件",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"用逗号分隔的 glob 模式,用于复制文件到新的工作树。"}},gNe={title:"扫描目录中的仓库",description:"从目录中查找并添加多个 Git 仓库。",directoryLabel:"要扫描的目录",directoryPlaceholder:"输入目录路径",browse:"浏览...",scan:"扫描",foundRepos:"找到 {{count}} 个仓库",selectAll:"全选",selectNone:"取消全选",noReposFound:"此目录中未找到 Git 仓库。",alreadyAdded:"已添加",adding:"正在添加仓库...",scanFailed:"扫描目录失败",addFailed:"添加仓库失败",cancel:"取消",addSelected:"添加 {{count}} 个选中项"},bNe={button:"新建项目",title:"创建新项目",back:"返回",next:"下一步",create:"创建项目",steps:{template:{description:"选择一个模板来创建您的项目。",sectionTitle:"Copier 模板",sectionDescription:"选择已保存的模板或输入 URL/路径。",learnMore:"了解更多",savedTemplates:"已保存的模板",selectTemplate:"选择模板...",or:"或",customUrl:"自定义模板 URL/路径"},questions:{title:"模板问题",description:"配置您的项目。",noQuestions:"此模板没有配置问题。"},output:{title:"输出位置",description:"选择项目创建位置。",projectName:"项目名称",outputDirectory:"输出目录",selectDirectory:"选择目录...",willCreate:"将创建",trust:"信任模板"},creating:{description:"正在创建您的项目...",inProgress:"正在运行 Copier..."}}},vNe={noRepositories:"尚未添加任何仓库。添加一个仓库以便在创建任务时快速访问。",noMatches:"没有匹配的仓库。"},yNe={failedToLoad:"加载仓库失败:{{message}}"},_Ne={breadcrumb:"仓库",notFound:"仓库未找到",save:"保存",saving:"保存中...",saved:"仓库已保存",failedToSave:"保存仓库失败",tabs:{settings:"任务设置",workspace:"工作区"},mobileWorkspace:{terminal:"终端",files:"文件"},fileTree:{title:"文件",searchPlaceholder:"搜索文件...",noFiles:"无文件",collapseAll:"折叠所有文件夹"},settings:{generalTitle:"常规",agentTitle:"代理选项",displayName:"显示名称",defaultAgent:"默认代理",defaultAgentInherit:"使用全局默认",defaultAgentDescription:"覆盖从此仓库创建任务时使用的全局默认代理。",startupScript:"启动脚本",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"创建工作树时在终端中运行的命令。",claudeOptions:"Claude Code 选项",claudeOptionsDescription:"启动任务时传递给 Claude Code 的命令行参数。",opencodeOptions:"OpenCode 选项",opencodeOptionsDescription:"启动任务时传递给 OpenCode 的命令行参数。",opencodeModel:"OpenCode 模型",opencodeModelPlaceholder:"选择模型",opencodeModelDescription:"从此仓库创建任务时使用的默认 OpenCode 模型。",agentOptionsFlag:"参数",agentOptionsValue:"值",addAgentOption:"添加选项",copyFiles:"复制文件",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"用逗号分隔的 glob 模式,用于复制文件到新的工作树。",isCopierTemplate:"用作 Copier 模板",isCopierTemplateDescription:"标记为使用 Copier 创建新项目的模板。"},workspace:{connectingToTerminal:"正在连接终端服务器...",initializingTerminal:"正在初始化终端..."}},xNe={title:QRe,total:JRe,searchPlaceholder:eNe,newTask:tNe,viewTasks:nNe,terminal:rNe,editor:iNe,application:aNe,applications:sNe,createApp:oNe,createAppDialog:lNe,settings:uNe,addRepository:cNe,scanDirectory:dNe,openInTerminal:fNe,openInEditor:pNe,card:hNe,delete:{title:"删除仓库",description:'这将从 Vibora 中移除 "{{name}}"。实际的仓库文件不会受到影响。',button:"删除",deleting:"删除中...",alsoDeleteDirectory:"同时从磁盘删除目录",deleteDirectoryWarning:"这将永久删除仓库中的所有文件。此操作无法撤销。"},addModal:mNe,bulkAdd:gNe,newProject:bNe,empty:vNe,error:yNe,detailView:_Ne},ENe="项目",SNe="共 {{count}} 个",wNe="搜索项目...",CNe="新建任务",TNe="终端",ANe="编辑器",kNe="部署",ONe="停止",RNe="新建项目",NNe={noProjects:"暂无项目。创建一个项目开始使用。",noMatches:"没有匹配的项目。"},INe={failedToLoad:"加载项目失败:{{message}}"},DNe={noApp:"无应用",running:"运行中",building:"构建中",stopped:"已停止",failed:"失败"},LNe={breadcrumb:"项目",notFound:"项目未找到",save:"保存",saving:"保存中...",tabs:{settings:"任务设置",workspace:"工作区",deploy:"部署",deployGeneral:"通用",deployments:"部署记录",logs:"日志",monitoring:"监控"},general:{repositoryTitle:"仓库",agentTitle:"代理选项",path:"路径",displayName:"显示名称",startupScript:"启动脚本",copyFiles:"复制文件",defaultAgent:"默认代理",claudeOptions:"Claude Code 选项",opencodeOptions:"OpenCode 选项",opencodeModel:"OpenCode 模型",noRepository:"该项目未关联仓库。"},app:{title:"应用配置",noApp:"该项目未配置应用。",configureDeployment:"配置部署",configureDeploymentDescription:"为此项目设置 Docker Compose 部署",configuring:"配置中...",deployOptions:"部署选项",autoDeployEnabled:"提交时自动部署",autoPortAllocation:"自动分配端口",noCacheBuild:"无缓存构建",notificationsEnabled:"部署通知",services:"服务",environment:"环境变量",composeFile:"Compose 文件"}},PNe={step:"第 {{current}} 步,共 {{total}} 步",selectRepository:"选择仓库",existingRepo:"现有仓库",addNewRepo:"添加新仓库",searchRepos:"搜索仓库...",noReposFound:"未找到仓库",repoPathOrUrl:"仓库路径或 URL",repoInputPlaceholder:"~/code/my-repo 或 https://github.com/user/repo",browse:"浏览",cloneOptions:"克隆选项",targetDirectory:"目标目录",folderName:"文件夹名称",willCloneTo:"将克隆到",cloning:"正在克隆仓库...",adding:"正在添加仓库...",cloneAndSelect:"克隆并选择",addAndSelect:"添加并选择",addRepoFailed:"添加仓库失败",checkingCompose:"正在检查 compose 文件...",composeFound:"找到 {{file}}",noCompose:"未找到 compose 文件",cancel:"取消",next:"下一步",back:"上一步",configureProject:"配置项目",projectName:"项目名称",projectNamePlaceholder:"my-project",description:"描述",descriptionPlaceholder:"可选的项目描述",composeDetected:"检测到 Docker Compose:{{file}}",setupAppNow:"创建后设置应用部署",createProject:"创建项目",creating:"创建中...",create:"创建"},MNe={all:"全部",hasApp:"有应用",noApp:"无应用",running:"运行中",archived:"已归档"},jNe={title:ENe,total:SNe,searchPlaceholder:wNe,newTask:CNe,terminal:TNe,editor:ANe,deploy:kNe,stop:ONe,newProjectButton:RNe,empty:NNe,error:INe,card:DNe,delete:{title:"删除项目",description:"这将删除项目「{{name}}」。",button:"删除",deleting:"删除中...",alsoDeleteDirectory:"同时删除目录",alsoDeleteApp:"同时删除应用并停止容器"},detailView:LNe,newProject:PNe,filter:MNe},FNe="common",ZL=["en","zh"],BNe={en:{common:Bke,navigation:Vke,tasks:Xke,settings:r2e,review:c2e,worktrees:b2e,monitoring:C2e,terminals:F2e,repositories:lOe,jobs:qV,projects:$Oe},zh:{common:QOe,navigation:rRe,tasks:uRe,settings:gRe,review:SRe,worktrees:RRe,monitoring:FRe,terminals:ZRe,repositories:xNe,jobs:qV,projects:jNe}};function UNe(){if(typeof window<"u"){const e=localStorage.getItem("vibora-language");if(e&&ZL.includes(e))return e;const t=navigator.language.split("-")[0];if(ZL.includes(t))return t}return"en"}wa.use(P0e).init({resources:BNe,lng:UNe(),fallbackLng:"en",defaultNS:FNe,ns:["common","navigation","tasks","settings","review","worktrees","monitoring","terminals","repositories","jobs","projects"],interpolation:{escapeValue:!1}});wa.on("languageChanged",e=>{typeof window<"u"&&localStorage.setItem("vibora-language",e)});function Vae(){const{i18n:e}=Ct(),{data:t,isSuccess:n}=ske(),r=Uae();C.useEffect(()=>{n&&t&&t!==e.language&&e.changeLanguage(t)},[n,t,e]);const i=C.useCallback(async a=>{if(a)await e.changeLanguage(a);else{const s=navigator.language.split("-")[0],o=ZL.includes(s)?s:"en";await e.changeLanguage(o)}r.mutate({key:sn.LANGUAGE,value:a??""})},[e,r]);return{language:e.language,savedLanguage:t,changeLanguage:i,isUpdating:r.isPending}}function bn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var $Ne={};function FC(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:$Ne}var Wae=Object.assign,hS=Object.getOwnPropertyDescriptor,zl=Object.defineProperty,BC=Object.prototype,QL=[];Object.freeze(QL);var Kj={};Object.freeze(Kj);var zNe=typeof Proxy<"u",HNe=Object.toString();function Gae(){zNe||bn("Proxy not available")}function qae(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var nm=function(){};function Fs(e){return typeof e=="function"}function Ap(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function UC(e){return e!==null&&typeof e=="object"}function Pd(e){if(!UC(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n.toString()===HNe}function Kae(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function $C(e,t,n){zl(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Yae(e,t,n){zl(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function qd(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(r){return UC(r)&&r[n]===!0}}function Ug(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function VNe(e){var t=Object.getPrototypeOf(e),n=Object.getPrototypeOf(t),r=Object.getPrototypeOf(n);return r===null}function Bu(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Xae=typeof Object.getOwnPropertySymbols<"u";function WNe(e){var t=Object.keys(e);if(!Xae)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(r){return BC.propertyIsEnumerable.call(e,r)})):t}var zC=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Xae?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Zae(e){return e===null?null:typeof e=="object"?""+e:e}function Yu(e,t){return BC.hasOwnProperty.call(e,t)}var GNe=Object.getOwnPropertyDescriptors||function(t){var n={};return zC(t).forEach(function(r){n[r]=hS(t,r)}),n};function Rs(e,t){return!!(e&t)}function Ns(e,t,n){return n?e|=t:e&=~t,e}function KV(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qNe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,YNe(r.key),r)}}function $g(e,t,n){return t&&qNe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rm(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=XNe(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
30
+ # 支持注释`,save:"保存环境变量",showValues:"显示值",hideValues:"隐藏值",unsavedChanges:"您有未保存的更改"},domains:{title:"域名配置",description:"配置要暴露的服务及其域名映射",expose:"暴露",exposeRequiresPort:"未配置端口。请在 compose 文件中添加端口映射。",domain:"域名",noDomain:"未配置域名",portRequired:"需要端口",editDomain:"编辑域名",noServices:"未配置服务。请先部署应用以查看可用服务。",save:"保存"},streaming:{pulling:"拉取代码...",building:"构建容器...",starting:"启动服务...",configuring:"配置路由...",done:"部署完成!",failed:"部署失败",cancelled:"部署已取消",preparing:"准备中...",waitingForLogs:"等待日志..."},dnsConfigRequired:"需要配置 DNS",settings:"设置",status:{running:"运行中",building:"构建中",failed:"失败",stopped:"已停止"},monitoring:{title:"资源使用",description:"每个服务的实时 CPU 和内存使用情况",cpu:"CPU",memory:"内存",noContainers:"未找到运行中的容器",dockerUnavailable:"Docker 统计不可用",serviceTotal:"服务总计"}},QOe={buttons:zOe,status:HOe,time:VOe,results:WOe,statuses:GOe,auth:qOe,git:KOe,errors:YOe,opencode:XOe,apps:ZOe},JOe={tasks:"任务",projects:"项目",terminals:"终端",worktrees:"工作树",repositories:"仓库",apps:"应用",jobs:"作业",review:"审核",monitoring:"监控",settings:"设置",commandPalette:"命令面板 ({{shortcut}})",help:"文档"},eRe={placeholder:"输入命令或搜索...",noResults:"未找到命令",categories:{navigation:"导航",actions:"操作"},commands:{goToTasks:"前往任务",goToProjects:"前往项目",goToTerminals:"前往终端",goToTaskTerminals:"前往任务终端",goToProjectTerminals:"前往项目终端",goToRepositories:"前往仓库",goToApps:"前往应用",goToJobs:"前往作业",goToReview:"前往审核",goToMonitoring:"前往监控",goToSettings:"前往设置",newTask:"新建任务",newProject:"新建项目",openInEditor:"在编辑器中打开",keyboardShortcuts:"键盘快捷键"}},tRe={title:"键盘快捷键",groups:{navigation:"导航",actions:"操作",terminals:"终端(桌面端)",general:"通用"},labels:{goToTasks:"前往任务",goToProjects:"前往项目",goToTerminals:"前往终端",goToTaskTerminals:"前往任务终端",goToProjectTerminals:"前往项目终端",goToRepositories:"前往仓库",goToApps:"前往应用",goToJobs:"前往作业",goToReview:"前往审核",goToMonitoring:"前往监控",goToSettings:"前往设置",commandPalette:"命令面板",newTask:"新建任务",newProject:"新建项目",openInEditor:"在编辑器中打开",keyboardShortcuts:"键盘快捷键",closeModal:"关闭弹窗",newTerminal:"新建终端",closeTerminal:"关闭终端",submitForm:"提交表单"}},nRe={title:"在编辑器中打开",description:"在 {{editor}} 中打开文件夹",pathLabel:"目录路径",pathPlaceholder:"~/projects/my-project",pathHint:"请输入目录路径。支持 ~ 表示主目录。",pathNotFound:"路径不存在",pathNotDirectory:"路径必须是目录,不能是文件",browse:"浏览",cancel:"取消",open:"打开"},rRe={header:JOe,commandPalette:eRe,shortcuts:tRe,openInEditor:nRe},iRe="任务",aRe="搜索",sRe="全部项目",oRe="新建任务",lRe={title:"创建新任务",description:"创建一个带有 Git 工作树的新任务,用于隔离开发。",fields:{title:"标题",titlePlaceholder:"添加用户认证",description:"描述",descriptionPlaceholder:"实现 OAuth2 登录流程...",aiMode:"AI 模式",agent:"AI 代理",opencodeModel:"OpenCode 模型",opencodeModelPlaceholder:"选择模型",repository:"仓库",baseBranch:"基础分支",branchName:"分支名称",branchPlaceholder:"自动生成分支名"},aiModes:{plan:"计划",default:"默认"},tabs:{saved:"仓库",browse:"浏览"},worktreePrefix:"工作树:",branchAutoGenerated:'留空将使用 "{{branch}}"。',selectFolder:"选择文件夹...",searchRepositories:"搜索仓库...",noRepositoriesFound:"未找到仓库",selectRepositoryFirst:"请先选择仓库",loadingBranches:"加载分支中...",selectBranch:"选择分支",current:"(当前)",createTask:"创建任务",errors:{notGitRepo:"所选文件夹不是 Git 仓库",validationFailed:"验证仓库失败",createFailed:"创建任务失败"}},uRe={title:iRe,searchPlaceholder:aRe,allProjects:sRe,newTask:oRe,createModal:lRe},cRe="设置",dRe={server:"服务器",serverDefaults:"服务器与默认设置",paths:"路径",editor:"编辑器",integrations:"集成",zai:"z.ai",agent:"AI 代理",notifications:"通知",appearance:"外观",developer:"开发者"},fRe={port:{label:"端口",description:"需要重启"},startupCommand:{label:"启动命令",description:"新任务终端的命令"},gitReposDir:{label:"Git 仓库目录",description:"仓库选择器的起始目录"},editor:{app:{label:"编辑器",description:"用于打开工作树的代码编辑器",options:{vscode:"VS Code",cursor:"Cursor",windsurf:"Windsurf",zed:"Zed",antigravity:"Antigravity"}},host:{label:"远程主机",description:"代码在远程机器上时使用的 SSH 地址",placeholder:"例如:my-server.tailnet.ts.net"},sshPort:{label:"SSH 端口",description:"远程 SSH 端口(默认 22)"}},linear:{label:"Linear",description:"用于工单同步的 API 密钥"},github:{label:"GitHub",description:"用于 Issues 和 PR 的个人访问令牌"},cloudflare:{label:"Cloudflare",placeholder:"输入 API 令牌...",description:"用于自动 DNS 记录的 API 令牌"},zai:{enable:"启用",apiKey:"API 密钥",description:"配置 Claude Code 使用 z.ai 代理",modelMappings:"模型映射",haiku:"Haiku",sonnet:"Sonnet",opus:"Opus"},agent:{default:{label:"默认代理",description:"新任务使用的 AI 编码代理"},opencodeModel:{label:"OpenCode 模型",placeholder:"选择模型",description:"启动 OpenCode 任务时使用的默认模型"},advancedAgentNames:{label:"高级代理名称",description:"配置 OpenCode 模式的特定代理名称",warning:"仅在您知道自己在做什么的情况下更改这些设置。这些设置适用于拥有自定义 OpenCode 代理(例如,带有 Sisyphus/Planner-Sisyphus 代理的 oh-my-opencode 插件)的用户。"},opencodeDefaultAgent:{label:"默认模式",description:"全权限模式的代理名称。oh-my-opencode 使用 'Sisyphus',原版 OpenCode 使用 'build'。"},opencodePlanAgent:{label:"计划模式",description:"受限/计划模式的代理名称。oh-my-opencode 使用 'Planner-Sisyphus',原版 OpenCode 使用 'plan'。注意:Planner-Sisyphus 从 OpenCode 的 plan 代理配置继承模型,因此上述模型覆盖可能不适用。请在 ~/.config/opencode/oh-my-opencode.json 中配置模型。"}},language:{label:"语言",description:"界面语言",options:{auto:"自动检测",en:"English",zh:"简体中文"}},theme:{label:"主题",description:"界面颜色主题",options:{system:"跟随系统",light:"浅色",dark:"深色"}},syncClaudeTheme:{label:"同步 Claude Code",description:"当 Vibora 在浅色和深色模式之间切换时自动更新 Claude Code 的主题"},claudeCodeTheme:{light:"浅色模式",dark:"深色模式",options:{light:"浅色","light-ansi":"浅色 ANSI","light-daltonized":"浅色(色盲友好)",dark:"深色","dark-ansi":"深色 ANSI","dark-daltonized":"深色(色盲友好)"}}},pRe={enable:"启用通知",toast:"应用内提示",toastDescription:"在 Vibora 界面中显示提示通知",desktop:"桌面通知",desktopDescription:"显示原生桌面或浏览器通知",sound:"声音",slack:"Slack",discord:"Discord",pushover:"Pushover",appToken:"应用令牌",userKey:"用户密钥",testSuccess:"{{channel}} 测试成功",testFailed:"{{channel}} 测试失败:{{error}}",uploadSound:"上传自定义声音",deleteSound:"删除自定义声音",testSound:"测试声音",soundUploaded:"自定义声音已上传",soundUploadFailed:"上传声音失败:{{error}}",soundDeleted:"自定义声音已删除",soundDeleteFailed:"删除自定义声音失败",customSoundActive:"使用自定义声音"},hRe={restartButton:"重启 Vibora",restarting:"重启中...",restartDescription:"重新构建并重启 Vibora 服务器。如果构建失败,服务器将继续运行。",restartFailed:"重启失败",checkLogs:"构建可能失败。运行 journalctl --user -u vibora 查看详情。"},mRe={title:"未保存的更改",description:"您有未保存的更改,离开此页面将丢失这些更改。",stay:"留下",leave:"离开"},gRe={title:cRe,sections:dRe,fields:fRe,notifications:pRe,developer:hRe,unsavedChanges:mRe},bRe="审核",vRe={pullRequests:"拉取请求",issues:"问题"},yRe={pr:{created:"我创建的",assigned:"分配给我的",reviewRequested:"待我审核",mentioned:"提及我的"},issue:{assigned:"分配给我的",created:"我创建的",mentioned:"提及我的"},allOrgs:"所有组织",allOrganizations:"所有组织",viboraReposOnly:"仅 Vibora 仓库"},_Re={tokenRequired:"需要 GitHub 令牌",tokenDescription:"要查看您的问题和拉取请求,请在设置中添加 GitHub 个人访问令牌。",requiredScopes:"所需权限:",scopes:{repo:"(用于私有仓库)",readUser:"(用于用户信息)",readOrg:"(用于组织列表)"},generateToken:"生成令牌",goToSettings:"前往设置"},xRe={loading:"加载中...",failedToLoad:"加载拉取请求失败",empty:{all:"没有打开的拉取请求",created:"没有您创建的拉取请求",assigned:"没有分配给您的拉取请求",reviewRequested:"没有等待您审核的拉取请求",mentioned:"没有提及您的拉取请求"},draft:"草稿"},ERe={loading:"加载中...",failedToLoad:"加载问题失败",empty:{assigned:"没有分配给您的问题",created:"没有您创建的问题",mentioned:"没有提及您的问题"}},SRe={title:bRe,tabs:vRe,filters:yRe,github:_Re,prs:xRe,issues:ERe},wRe="工作树",CRe={total:"共 {{count}} 个",orphaned:"{{count}} 个孤立"},TRe={button:"清理 ({{count}})",title:"删除已完成的工作树",description:"这将永久删除 {{count}} 个工作树。",linkedTasksWillBeDeleted:"关联的任务也将被删除。",alsoDeleteLinkedTasks:"同时删除关联的任务",done:"已完成",canceled:"已取消",cannotUndo:"此操作无法撤销。",pinnedSkipped:"将跳过 {{count}} 个已固定的工作树"},ARe={pin:"固定工作树",unpin:"取消固定工作树"},kRe={noMatch:"没有匹配所选筛选条件的工作树。",noWorktrees:"未找到工作树。工作树在创建任务时自动生成。"},ORe={failedToLoad:"加载工作树失败:{{message}}"},RRe={title:wRe,summary:CRe,cleanup:TRe,delete:{title:"删除工作树",description:"这将永久删除位于以下位置的工作树目录",linkedTaskWillBeDeleted:'关联的任务 "{{title}}" 也将被删除。',alsoDeleteLinkedTask:'同时删除关联的任务 "{{title}}"',cannotUndo:"此操作无法撤销。",button:"删除 {{count}} 个",unpinFirst:"请先取消固定工作树再删除"},pin:ARe,empty:kRe,error:ORe},NRe="监控",IRe={claude:"AI 代理",system:"系统指标",processes:"进程",vibora:"Vibora 服务器",worktrees:"工作树",jobs:"作业",usage:"使用限额"},DRe={showAllInstances:"显示所有实例",instanceCount:"{{count}} 个实例运行中",totalRam:"总计 {{ram}} MB",headers:{agent:"代理",terminal:"终端",task:"任务",ram:"内存",actions:"操作",pid:"PID",workingDirectory:"工作目录",source:"来源"},noTask:"(无任务)",kill:"终止",killing:"终止中...",killSelected:"终止 {{count}} 个已选",source:{vibora:"Vibora: {{name}}",external:"外部"},empty:"没有 AI 代理实例运行中",emptyVibora:" (在 Vibora 终端中)",error:"加载 AI 代理实例失败:{{message}}"},LRe={cpuUsage:"CPU 使用率",memoryUsage:"内存使用率",memoryLabels:{used:"已使用",cache:"缓存/缓冲区"},diskUsage:"磁盘使用率 ({{path}})",error:"加载系统指标失败:{{message}}",timeWindows:{"1m":"1 分钟","10m":"10 分钟","1h":"1 小时","3h":"3 小时","6h":"6 小时","12h":"12 小时","24h":"24 小时"}},PRe={topProcesses:"热门进程",sortBy:{memory:"按内存",cpu:"按 CPU"},headers:{pid:"PID",name:"名称",command:"命令",memory:"内存"},empty:"未找到进程",error:"加载进程失败:{{message}}",containers:"容器",containersEmpty:"没有容器运行中",containersUnavailable:"Docker/Podman 不可用"},MRe={description:"运行中的 Vibora 开发服务器",instanceCount:"{{count}} 个实例运行中",headers:{port:"端口",mode:"模式",directory:"目录",ram:"内存",actions:"操作"},mode:{dev:"开发",prod:"生产"},vite:"Vite",kill:"终止",killing:"终止中...",empty:"没有 Vibora 实例运行中",error:"加载 Vibora 实例失败:{{message}}"},jRe={fiveHourBlock:"5小时配额",sevenDayRolling:"7天滚动配额",opusWeekly:"Opus 周配额",sonnetWeekly:"Sonnet 周配额",resetsIn:"{{time}}后重置",resetsAt:"{{time}}重置",weekProgress:"本周已过 {{percent}}%",unavailable:"Claude Code 使用数据不可用。请确保已登录 Claude Code。",error:"加载使用数据失败:{{message}}"},FRe={title:NRe,tabs:IRe,claude:DRe,system:LRe,processes:PRe,vibora:MRe,usage:jRe},BRe="任务",URe="项目",$Re="新建终端",zRe="全部仓库",HRe="选择项目",VRe="已选择 {{count}} 个",WRe="最多选择6个项目",GRe="清除选择",qRe="选择项目以打开其工作区终端",KRe="没有进行中的任务",YRe={title:"编辑标签页",name:"名称",namePlaceholder:"标签页名称",directory:"目录",directoryPlaceholder:"选择目录...",clearDirectory:"清除目录",cancel:"取消",save:"保存"},XRe={title:"新建标签页",create:"创建"},ZRe={taskTerminals:BRe,projectTerminals:URe,newTerminal:$Re,allRepos:zRe,selectProjects:HRe,projectsSelected:VRe,filterByProject:WRe,clearFilter:GRe,emptyProjects:qRe,emptyTasks:KRe,editTab:YRe,newTab:XRe},QRe="仓库",JRe="共 {{count}} 个",eNe="搜索仓库...",tNe="新建任务",nNe="任务",rNe="终端",iNe="编辑器",aNe="应用",sNe="应用",oNe="创建应用",lNe={title:"需要 Docker Compose",description:"要为部署创建应用,此仓库需要 Docker Compose 文件。",instructions:"请在仓库中创建 docker-compose.yml 文件。",close:"知道了"},uNe="设置",cNe="添加仓库",dNe="扫描目录",fNe="在终端中打开",pNe="在 {{editor}} 中打开",hNe={openInVSCode:"在 VS Code 中打开"},mNe={title:"添加仓库",description:"从 URL 或本地路径添加 Git 仓库,或扫描目录。",tabs:{add:"添加",scan:"扫描",template:"从模板创建"},inputLabel:"仓库 URL 或路径",inputPlaceholder:"https://github.com/user/repo 或 /local/path",browse:"浏览...",cloneOptions:"克隆选项",targetDirectory:"克隆到目录",folderName:"文件夹名称",willCloneTo:"将克隆到",cloning:"正在克隆仓库...",adding:"添加中...",cloneFailed:"克隆仓库失败",createFailed:"添加仓库失败",cancel:"取消",add:"添加",retry:"重试",fields:{path:"仓库路径",pathPlaceholder:"选择仓库...",displayName:"显示名称",startupScript:"启动脚本",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"创建工作树时在终端中运行的命令。",copyFiles:"复制文件",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"用逗号分隔的 glob 模式,用于复制文件到新的工作树。"}},gNe={title:"扫描目录中的仓库",description:"从目录中查找并添加多个 Git 仓库。",directoryLabel:"要扫描的目录",directoryPlaceholder:"输入目录路径",browse:"浏览...",scan:"扫描",foundRepos:"找到 {{count}} 个仓库",selectAll:"全选",selectNone:"取消全选",noReposFound:"此目录中未找到 Git 仓库。",alreadyAdded:"已添加",adding:"正在添加仓库...",scanFailed:"扫描目录失败",addFailed:"添加仓库失败",cancel:"取消",addSelected:"添加 {{count}} 个选中项"},bNe={button:"新建项目",title:"创建新项目",back:"返回",next:"下一步",create:"创建项目",steps:{template:{description:"选择一个模板来创建您的项目。",sectionTitle:"Copier 模板",sectionDescription:"选择已保存的模板或输入 URL/路径。",learnMore:"了解更多",savedTemplates:"已保存的模板",selectTemplate:"选择模板...",or:"或",customUrl:"自定义模板 URL/路径"},questions:{title:"模板问题",description:"配置您的项目。",noQuestions:"此模板没有配置问题。"},output:{title:"输出位置",description:"选择项目创建位置。",projectName:"项目名称",outputDirectory:"输出目录",selectDirectory:"选择目录...",willCreate:"将创建",trust:"信任模板"},creating:{description:"正在创建您的项目...",inProgress:"正在运行 Copier..."}}},vNe={noRepositories:"尚未添加任何仓库。添加一个仓库以便在创建任务时快速访问。",noMatches:"没有匹配的仓库。"},yNe={failedToLoad:"加载仓库失败:{{message}}"},_Ne={breadcrumb:"仓库",notFound:"仓库未找到",save:"保存",saving:"保存中...",saved:"仓库已保存",failedToSave:"保存仓库失败",tabs:{settings:"任务设置",workspace:"工作区"},mobileWorkspace:{terminal:"终端",files:"文件"},fileTree:{title:"文件",searchPlaceholder:"搜索文件...",noFiles:"无文件",collapseAll:"折叠所有文件夹"},settings:{generalTitle:"常规",agentTitle:"代理选项",displayName:"显示名称",defaultAgent:"默认代理",defaultAgentInherit:"使用全局默认",defaultAgentDescription:"覆盖从此仓库创建任务时使用的全局默认代理。",startupScript:"启动脚本",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"创建工作树时在终端中运行的命令。",claudeOptions:"Claude Code 选项",claudeOptionsDescription:"启动任务时传递给 Claude Code 的命令行参数。",opencodeOptions:"OpenCode 选项",opencodeOptionsDescription:"启动任务时传递给 OpenCode 的命令行参数。",opencodeModel:"OpenCode 模型",opencodeModelPlaceholder:"选择模型",opencodeModelDescription:"从此仓库创建任务时使用的默认 OpenCode 模型。",agentOptionsFlag:"参数",agentOptionsValue:"值",addAgentOption:"添加选项",copyFiles:"复制文件",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"用逗号分隔的 glob 模式,用于复制文件到新的工作树。",isCopierTemplate:"用作 Copier 模板",isCopierTemplateDescription:"标记为使用 Copier 创建新项目的模板。"},workspace:{connectingToTerminal:"正在连接终端服务器...",initializingTerminal:"正在初始化终端..."}},xNe={title:QRe,total:JRe,searchPlaceholder:eNe,newTask:tNe,viewTasks:nNe,terminal:rNe,editor:iNe,application:aNe,applications:sNe,createApp:oNe,createAppDialog:lNe,settings:uNe,addRepository:cNe,scanDirectory:dNe,openInTerminal:fNe,openInEditor:pNe,card:hNe,delete:{title:"删除仓库",description:'这将从 Vibora 中移除 "{{name}}"。实际的仓库文件不会受到影响。',button:"删除",deleting:"删除中...",alsoDeleteDirectory:"同时从磁盘删除目录",deleteDirectoryWarning:"这将永久删除仓库中的所有文件。此操作无法撤销。"},addModal:mNe,bulkAdd:gNe,newProject:bNe,empty:vNe,error:yNe,detailView:_Ne},ENe="项目",SNe="共 {{count}} 个",wNe="搜索项目...",CNe="新建任务",TNe="终端",ANe="编辑器",kNe="部署",ONe="停止",RNe="新建项目",NNe={noProjects:"暂无项目。创建一个项目开始使用。",noMatches:"没有匹配的项目。"},INe={failedToLoad:"加载项目失败:{{message}}"},DNe={noApp:"无应用",running:"运行中",building:"构建中",stopped:"已停止",failed:"失败"},LNe={breadcrumb:"项目",notFound:"项目未找到",save:"保存",saving:"保存中...",tabs:{settings:"任务设置",workspace:"工作区",deploy:"部署",deployGeneral:"通用",deployments:"部署记录",logs:"日志",monitoring:"监控"},general:{repositoryTitle:"仓库",agentTitle:"代理选项",path:"路径",displayName:"显示名称",startupScript:"启动脚本",copyFiles:"复制文件",defaultAgent:"默认代理",claudeOptions:"Claude Code 选项",opencodeOptions:"OpenCode 选项",opencodeModel:"OpenCode 模型",noRepository:"该项目未关联仓库。"},app:{title:"应用配置",noApp:"该项目未配置应用。",configureDeployment:"配置部署",configureDeploymentDescription:"为此项目设置 Docker Compose 部署",configuring:"配置中...",deployOptions:"部署选项",autoDeployEnabled:"提交时自动部署",autoPortAllocation:"自动分配端口",noCacheBuild:"无缓存构建",notificationsEnabled:"部署通知",services:"服务",environment:"环境变量",composeFile:"Compose 文件"}},PNe={step:"第 {{current}} 步,共 {{total}} 步",selectRepository:"选择仓库",existingRepo:"现有仓库",addNewRepo:"添加新仓库",searchRepos:"搜索仓库...",noReposFound:"未找到仓库",repoPathOrUrl:"仓库路径或 URL",repoInputPlaceholder:"~/code/my-repo 或 https://github.com/user/repo",browse:"浏览",cloneOptions:"克隆选项",targetDirectory:"目标目录",folderName:"文件夹名称",willCloneTo:"将克隆到",cloning:"正在克隆仓库...",adding:"正在添加仓库...",cloneAndSelect:"克隆并选择",addAndSelect:"添加并选择",addRepoFailed:"添加仓库失败",checkingCompose:"正在检查 compose 文件...",composeFound:"找到 {{file}}",noCompose:"未找到 compose 文件",cancel:"取消",next:"下一步",back:"上一步",configureProject:"配置项目",projectName:"项目名称",projectNamePlaceholder:"my-project",description:"描述",descriptionPlaceholder:"可选的项目描述",composeDetected:"检测到 Docker Compose:{{file}}",setupAppNow:"创建后设置应用部署",createProject:"创建项目",creating:"创建中...",create:"创建"},MNe={all:"全部",hasApp:"有应用",noApp:"无应用",running:"运行中",archived:"已归档"},jNe={title:ENe,total:SNe,searchPlaceholder:wNe,newTask:CNe,terminal:TNe,editor:ANe,deploy:kNe,stop:ONe,newProjectButton:RNe,empty:NNe,error:INe,card:DNe,delete:{title:"删除项目",description:"这将删除项目「{{name}}」。",button:"删除",deleting:"删除中...",alsoDeleteDirectory:"同时删除目录",alsoDeleteApp:"同时删除应用并停止容器"},detailView:LNe,newProject:PNe,filter:MNe},FNe="common",ZL=["en","zh"],BNe={en:{common:Bke,navigation:Vke,tasks:Xke,settings:r2e,review:c2e,worktrees:b2e,monitoring:C2e,terminals:F2e,repositories:lOe,jobs:qV,projects:$Oe},zh:{common:QOe,navigation:rRe,tasks:uRe,settings:gRe,review:SRe,worktrees:RRe,monitoring:FRe,terminals:ZRe,repositories:xNe,jobs:qV,projects:jNe}};function UNe(){if(typeof window<"u"){const e=localStorage.getItem("vibora-language");if(e&&ZL.includes(e))return e;const t=navigator.language.split("-")[0];if(ZL.includes(t))return t}return"en"}wa.use(P0e).init({resources:BNe,lng:UNe(),fallbackLng:"en",defaultNS:FNe,ns:["common","navigation","tasks","settings","review","worktrees","monitoring","terminals","repositories","jobs","projects"],interpolation:{escapeValue:!1}});wa.on("languageChanged",e=>{typeof window<"u"&&localStorage.setItem("vibora-language",e)});function Vae(){const{i18n:e}=Ct(),{data:t,isSuccess:n}=ske(),r=Uae();C.useEffect(()=>{n&&t&&t!==e.language&&e.changeLanguage(t)},[n,t,e]);const i=C.useCallback(async a=>{if(a)await e.changeLanguage(a);else{const s=navigator.language.split("-")[0],o=ZL.includes(s)?s:"en";await e.changeLanguage(o)}r.mutate({key:sn.LANGUAGE,value:a??""})},[e,r]);return{language:e.language,savedLanguage:t,changeLanguage:i,isUpdating:r.isPending}}function bn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var $Ne={};function FC(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:$Ne}var Wae=Object.assign,hS=Object.getOwnPropertyDescriptor,zl=Object.defineProperty,BC=Object.prototype,QL=[];Object.freeze(QL);var Kj={};Object.freeze(Kj);var zNe=typeof Proxy<"u",HNe=Object.toString();function Gae(){zNe||bn("Proxy not available")}function qae(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var nm=function(){};function Fs(e){return typeof e=="function"}function Ap(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function UC(e){return e!==null&&typeof e=="object"}function Pd(e){if(!UC(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n.toString()===HNe}function Kae(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function $C(e,t,n){zl(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Yae(e,t,n){zl(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function qd(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(r){return UC(r)&&r[n]===!0}}function Ug(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function VNe(e){var t=Object.getPrototypeOf(e),n=Object.getPrototypeOf(t),r=Object.getPrototypeOf(n);return r===null}function Bu(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Xae=typeof Object.getOwnPropertySymbols<"u";function WNe(e){var t=Object.keys(e);if(!Xae)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(r){return BC.propertyIsEnumerable.call(e,r)})):t}var zC=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Xae?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Zae(e){return e===null?null:typeof e=="object"?""+e:e}function Yu(e,t){return BC.hasOwnProperty.call(e,t)}var GNe=Object.getOwnPropertyDescriptors||function(t){var n={};return zC(t).forEach(function(r){n[r]=hS(t,r)}),n};function Rs(e,t){return!!(e&t)}function Ns(e,t,n){return n?e|=t:e&=~t,e}function KV(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qNe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,YNe(r.key),r)}}function $g(e,t,n){return t&&qNe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rm(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=XNe(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
31
31
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Md(){return Md=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Md.apply(null,arguments)}function Qae(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,JL(e,t)}function JL(e,t){return JL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},JL(e,t)}function KNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function YNe(e){var t=KNe(e,"string");return typeof t=="symbol"?t:t+""}function XNe(e,t){if(e){if(typeof e=="string")return KV(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?KV(e,t):void 0}}var jl=Symbol("mobx-stored-annotations");function Hl(e){function t(n,r){if(p1(r))return e.decorate_20223_(n,r);f1(n,r,e)}return Object.assign(t,e)}function f1(e,t,n){Yu(e,jl)||$C(e,jl,Md({},e[jl])),rIe(n)||(e[jl][t]=n)}function ZNe(e){return Yu(e,jl)||$C(e,jl,Md({},e[jl])),e[jl]}function p1(e){return typeof e=="object"&&typeof e.kind=="string"}var Yt=Symbol("mobx administration"),Kd=(function(){function e(n){n===void 0&&(n="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Pn.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.reportObserved=function(){return mse(this)},t.reportChanged=function(){ns(),gse(this),rs()},t.toString=function(){return this.name_},$g(e,[{key:"isBeingObserved",get:function(){return Rs(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Rs(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Rs(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=Ns(this.flags_,e.diffValueMask_,r===1)}}])})();Kd.isBeingObservedMask_=1;Kd.isPendingUnobservationMask_=2;Kd.diffValueMask_=4;var Yj=qd("Atom",Kd);function mS(e,t,n){t===void 0&&(t=nm),n===void 0&&(n=nm);var r=new Kd(e);return t!==nm&&sDe(r,t),n!==nm&&wse(r,n),r}function QNe(e,t){return $se(e,t)}function JNe(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Um={structural:QNe,default:JNe};function kp(e,t,n){return Ose(e)?e:Array.isArray(e)?Tr.array(e,{name:n}):Pd(e)?Tr.object(e,void 0,{name:n}):Ug(e)?Tr.map(e,{name:n}):Bu(e)?Tr.set(e,{name:n}):typeof e=="function"&&!$m(e)&&!By(e)?Kae(e)?Hm(e):Fy(n,e):e}function eIe(e,t,n){if(e==null||hl(e)||su(e)||Co(e)||Pa(e))return e;if(Array.isArray(e))return Tr.array(e,{name:n,deep:!1});if(Pd(e))return Tr.object(e,void 0,{name:n,deep:!1});if(Ug(e))return Tr.map(e,{name:n,deep:!1});if(Bu(e))return Tr.set(e,{name:n,deep:!1})}function HC(e){return e}function tIe(e,t){return $se(e,t)?t:e}var nIe="override";function rIe(e){return e.annotationType_===nIe}function h1(e,t){return{annotationType_:e,options_:t,make_:iIe,extend_:aIe,decorate_20223_:sIe}}function iIe(e,t,n,r){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,n,!1)===null?0:1;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if($m(n.value))return 1;var a=Jae(e,this,t,n,!1);return zl(r,t,a),2}function aIe(e,t,n,r){var i=Jae(e,this,t,n);return e.defineProperty_(t,i,r)}function sIe(e,t){var n=t.kind,r=t.name,i=t.addInitializer,a=this,s=function(u){var d,c,m,g;return jd((d=(c=a.options_)==null?void 0:c.name)!=null?d:r.toString(),u,(m=(g=a.options_)==null?void 0:g.autoAction)!=null?m:!1)};if(n=="field")return function(l){var u,d=l;return $m(d)||(d=s(d)),(u=a.options_)!=null&&u.bound&&(d=d.bind(this),d.isMobxAction=!0),d};if(n=="method"){var o;return $m(e)||(e=s(e)),(o=this.options_)!=null&&o.bound&&i(function(){var l=this,u=l[r].bind(l);u.isMobxAction=!0,l[r]=u}),e}bn("Cannot apply '"+a.annotationType_+"' to '"+String(r)+"' (kind: "+n+"):"+(`
32
32
  '`+a.annotationType_+"' can only be used on properties with a function value."))}function oIe(e,t,n,r){t.annotationType_,r.value}function Jae(e,t,n,r,i){var a,s,o,l,u,d,c;i===void 0&&(i=gt.safeDescriptors),oIe(e,t,n,r);var m=r.value;if((a=t.options_)!=null&&a.bound){var g;m=m.bind((g=e.proxy_)!=null?g:e.target_)}return{value:jd((s=(o=t.options_)==null?void 0:o.name)!=null?s:n.toString(),m,(l=(u=t.options_)==null?void 0:u.autoAction)!=null?l:!1,(d=t.options_)!=null&&d.bound?(c=e.proxy_)!=null?c:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function ese(e,t){return{annotationType_:e,options_:t,make_:lIe,extend_:uIe,decorate_20223_:cIe}}function lIe(e,t,n,r){var i;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!Yu(e.target_,t)||!By(e.target_[t]))&&this.extend_(e,t,n,!1)===null)return 0;if(By(n.value))return 1;var a=tse(e,this,t,n,!1,!1);return zl(r,t,a),2}function uIe(e,t,n,r){var i,a=tse(e,this,t,n,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,r)}function cIe(e,t){var n,r=t.name,i=t.addInitializer;return By(e)||(e=Hm(e)),(n=this.options_)!=null&&n.bound&&i(function(){var a=this,s=a[r].bind(a);s.isMobXFlow=!0,a[r]=s}),e}function dIe(e,t,n,r){t.annotationType_,r.value}function tse(e,t,n,r,i,a){a===void 0&&(a=gt.safeDescriptors),dIe(e,t,n,r);var s=r.value;if(By(s)||(s=Hm(s)),i){var o;s=s.bind((o=e.proxy_)!=null?o:e.target_),s.isMobXFlow=!0}return{value:s,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function Xj(e,t){return{annotationType_:e,options_:t,make_:fIe,extend_:pIe,decorate_20223_:hIe}}function fIe(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function pIe(e,t,n,r){return mIe(e,this,t,n),e.defineComputedProperty_(t,Md({},this.options_,{get:n.get,set:n.set}),r)}function hIe(e,t){var n=this,r=t.name,i=t.addInitializer;return i(function(){var a=Hg(this)[Yt],s=Md({},n.options_,{get:e,context:this});s.name||(s.name="ObservableObject."+r.toString()),a.values_.set(r,new al(s))}),function(){return this[Yt].getObservablePropValue_(r)}}function mIe(e,t,n,r){t.annotationType_,r.get}function VC(e,t){return{annotationType_:e,options_:t,make_:gIe,extend_:bIe,decorate_20223_:vIe}}function gIe(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function bIe(e,t,n,r){var i,a;return yIe(e,this),e.defineObservableProperty_(t,n.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:kp,r)}function vIe(e,t){var n=this,r=t.kind,i=t.name,a=new WeakSet;function s(o,l){var u,d,c=Hg(o)[Yt],m=new Rd(l,(u=(d=n.options_)==null?void 0:d.enhancer)!=null?u:kp,"ObservableObject."+i.toString(),!1);c.values_.set(i,m),a.add(o)}if(r=="accessor")return{get:function(){return a.has(this)||s(this,e.get.call(this)),this[Yt].getObservablePropValue_(i)},set:function(l){return a.has(this)||s(this,l),this[Yt].setObservablePropValue_(i,l)},init:function(l){return a.has(this)||s(this,l),l}}}function yIe(e,t,n,r){t.annotationType_}var _Ie="true",xIe=nse();function nse(e){return{annotationType_:_Ie,options_:e,make_:EIe,extend_:SIe,decorate_20223_:wIe}}function EIe(e,t,n,r){var i,a;if(n.get)return zg.make_(e,t,n,r);if(n.set){var s=$m(n.set)?n.set:jd(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:gt.safeDescriptors?e.isPlainObject_:!0,set:s})===null?0:2:(zl(r,t,{configurable:!0,set:s}),2)}if(r!==e.target_&&typeof n.value=="function"){var o;if(Kae(n.value)){var l,u=(l=this.options_)!=null&&l.autoBind?Hm.bound:Hm;return u.make_(e,t,n,r)}var d=(o=this.options_)!=null&&o.autoBind?Fy.bound:Fy;return d.make_(e,t,n,r)}var c=((i=this.options_)==null?void 0:i.deep)===!1?Tr.ref:Tr;if(typeof n.value=="function"&&(a=this.options_)!=null&&a.autoBind){var m;n.value=n.value.bind((m=e.proxy_)!=null?m:e.target_)}return c.make_(e,t,n,r)}function SIe(e,t,n,r){var i,a;if(n.get)return zg.extend_(e,t,n,r);if(n.set)return e.defineProperty_(t,{configurable:gt.safeDescriptors?e.isPlainObject_:!0,set:jd(t.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var s;n.value=n.value.bind((s=e.proxy_)!=null?s:e.target_)}var o=((a=this.options_)==null?void 0:a.deep)===!1?Tr.ref:Tr;return o.extend_(e,t,n,r)}function wIe(e,t){bn("'"+this.annotationType_+"' cannot be used as a decorator")}var CIe="observable",TIe="observable.ref",AIe="observable.shallow",kIe="observable.struct",rse={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(rse);function Rx(e){return e||rse}var eP=VC(CIe),OIe=VC(TIe,{enhancer:HC}),RIe=VC(AIe,{enhancer:eIe}),NIe=VC(kIe,{enhancer:tIe}),ise=Hl(eP);function Nx(e){return e.deep===!0?kp:e.deep===!1?HC:DIe(e.defaultDecorator)}function IIe(e){var t;return e?(t=e.defaultDecorator)!=null?t:nse(e):void 0}function DIe(e){var t,n;return e&&(t=(n=e.options_)==null?void 0:n.enhancer)!=null?t:kp}function ase(e,t,n){if(p1(t))return eP.decorate_20223_(e,t);if(Ap(t)){f1(e,t,eP);return}return Ose(e)?e:Pd(e)?Tr.object(e,t,n):Array.isArray(e)?Tr.array(e,t):Ug(e)?Tr.map(e,t):Bu(e)?Tr.set(e,t):typeof e=="object"&&e!==null?e:Tr.box(e,t)}Wae(ase,ise);var LIe={box:function(t,n){var r=Rx(n);return new Rd(t,Nx(r),r.name,!0,r.equals)},array:function(t,n){var r=Rx(n);return(gt.useProxies===!1||r.proxy===!1?MDe:TDe)(t,Nx(r),r.name)},map:function(t,n){var r=Rx(n);return new t5(t,Nx(r),r.name)},set:function(t,n){var r=Rx(n);return new Mse(t,Nx(r),r.name)},object:function(t,n,r){return Vp(function(){return cDe(gt.useProxies===!1||r?.proxy===!1?Hg({},r):SDe({},r),t,n)})},ref:Hl(OIe),shallow:Hl(RIe),deep:ise,struct:Hl(NIe)},Tr=Wae(ase,LIe),sse="computed",PIe="computed.struct",tP=Xj(sse),MIe=Xj(PIe,{equals:Um.structural}),zg=function(t,n){if(p1(n))return tP.decorate_20223_(t,n);if(Ap(n))return f1(t,n,tP);if(Pd(t))return Hl(Xj(sse,t));var r=Pd(n)?n:{};return r.get=t,r.name||(r.name=t.name||""),new al(r)};Object.assign(zg,tP);zg.struct=Hl(MIe);var YV,XV,gS=0,jIe=1,FIe=(YV=(XV=hS(function(){},"name"))==null?void 0:XV.configurable)!=null?YV:!1,ZV={value:"action",configurable:!0,writable:!1,enumerable:!1};function jd(e,t,n,r){n===void 0&&(n=!1);function i(){return ose(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},FIe&&(ZV.value=e,zl(i,"name",ZV)),i}function ose(e,t,n,r,i){var a=BIe(e,t);try{return n.apply(r,i)}catch(s){throw a.error_=s,s}finally{UIe(a)}}function BIe(e,t,n,r){var i=!1,a=0,s=gt.trackingDerivation,o=!t||!s;ns();var l=gt.allowStateChanges;o&&(Hp(),l=WC(!0));var u=Zj(!0),d={runAsAction_:o,prevDerivation_:s,prevAllowStateChanges_:l,prevAllowStateReads_:u,notifySpy_:i,startTime_:a,actionId_:jIe++,parentActionId_:gS};return gS=d.actionId_,d}function UIe(e){gS!==e.actionId_&&bn(30),gS=e.parentActionId_,e.error_!==void 0&&(gt.suppressReactionErrors=!0),GC(e.prevAllowStateChanges_),Zv(e.prevAllowStateReads_),rs(),e.runAsAction_&&Xu(e.prevDerivation_),gt.suppressReactionErrors=!1}function lse(e,t){var n=WC(e);try{return t()}finally{GC(n)}}function WC(e){var t=gt.allowStateChanges;return gt.allowStateChanges=e,t}function GC(e){gt.allowStateChanges=e}var Rd=(function(e){function t(r,i,a,s,o){var l;return a===void 0&&(a="ObservableValue"),o===void 0&&(o=Um.default),l=e.call(this,a)||this,l.enhancer=void 0,l.name_=void 0,l.equals=void 0,l.hasUnreportedChange_=!1,l.interceptors_=void 0,l.changeListeners_=void 0,l.value_=void 0,l.dehancer=void 0,l.enhancer=i,l.name_=a,l.equals=o,l.value_=i(r,void 0,a),l}Qae(t,e);var n=t.prototype;return n.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},n.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==gt.UNCHANGED&&this.setNewValue_(i)},n.prepareNewValue_=function(i){if(fo(this)){var a=po(this,{object:this,type:Vl,newValue:i});if(!a)return gt.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?gt.UNCHANGED:i},n.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),Xo(this)&&Zo(this,{type:Vl,object:this,newValue:i,oldValue:a})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return m1(this,i)},n.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Vl,newValue:this.value_,oldValue:void 0}),g1(this,i)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return Zae(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t})(Kd),$Ie=qd("ObservableValue",Rd),al=(function(){function e(n){this.dependenciesState_=Pn.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Pn.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new vS(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=bS.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||bn(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=jd("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?Um.structural:Um.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){qIe(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.get=function(){if(this.isComputing&&bn(32,this.name_,this.derivation),gt.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)nP(this)&&(this.warnAboutUntrackedRead_(),ns(),this.value_=this.computeValue_(!1),rs());else if(mse(this),nP(this)){var r=gt.trackingContext;this.keepAlive_&&!r&&(gt.trackingContext=this),this.trackAndCompute()&&GIe(this),gt.trackingContext=r}var i=this.value_;if(CE(i))throw i.cause;return i},t.set=function(r){if(this.setter_){this.isRunningSetter&&bn(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else bn(34,this.name_)},t.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===Pn.NOT_TRACKING_,a=this.computeValue_(!0),s=i||CE(r)||CE(a)||!this.equals_(r,a);return s&&(this.value_=a),s},t.computeValue_=function(r){this.isComputing=!0;var i=WC(!1),a;if(r)a=use(this,this.derivation,this.scope_);else if(gt.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(s){a=new vS(s)}return GC(i),this.isComputing=!1,a},t.suspend_=function(){this.keepAlive_||(rP(this),this.value_=void 0)},t.observe_=function(r,i){var a=this,s=!0,o=void 0;return Ese(function(){var l=a.get();if(!s||i){var u=Hp();r({observableKind:"computed",debugObjectName:a.name_,type:Vl,object:a,newValue:l,oldValue:o}),Xu(u)}s=!1,o=l})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Zae(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},$g(e,[{key:"isComputing",get:function(){return Rs(this.flags_,e.isComputingMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return Rs(this.flags_,e.isRunningSetterMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return Rs(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Rs(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Rs(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=Ns(this.flags_,e.diffValueMask_,r===1)}}])})();al.isComputingMask_=1;al.isRunningSetterMask_=2;al.isBeingObservedMask_=4;al.isPendingUnobservationMask_=8;al.diffValueMask_=16;var qC=qd("ComputedValue",al),Pn;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(Pn||(Pn={}));var bS;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(bS||(bS={}));var vS=function(t){this.cause=void 0,this.cause=t};function CE(e){return e instanceof vS}function nP(e){switch(e.dependenciesState_){case Pn.UP_TO_DATE_:return!1;case Pn.NOT_TRACKING_:case Pn.STALE_:return!0;case Pn.POSSIBLY_STALE_:{for(var t=Zj(!0),n=Hp(),r=e.observing_,i=r.length,a=0;a<i;a++){var s=r[a];if(qC(s)){if(gt.disableErrorBoundaries)s.get();else try{s.get()}catch{return Xu(n),Zv(t),!0}if(e.dependenciesState_===Pn.STALE_)return Xu(n),Zv(t),!0}}return dse(e),Xu(n),Zv(t),!1}}}function use(e,t,n){var r=Zj(!0);dse(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++gt.runId;var i=gt.trackingDerivation;gt.trackingDerivation=e,gt.inBatch++;var a;if(gt.disableErrorBoundaries===!0)a=t.call(n);else try{a=t.call(n)}catch(s){a=new vS(s)}return gt.inBatch--,gt.trackingDerivation=i,zIe(e),Zv(r),a}function zIe(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=Pn.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,s=0;s<a;s++){var o=n[s];o.diffValue===0&&(o.diffValue=1,i!==s&&(n[i]=o),i++),o.dependenciesState_>r&&(r=o.dependenciesState_)}for(n.length=i,e.newObserving_=null,a=t.length;a--;){var l=t[a];l.diffValue===0&&pse(l,e),l.diffValue=0}for(;i--;){var u=n[i];u.diffValue===1&&(u.diffValue=0,WIe(u,e))}r!==Pn.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function rP(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)pse(t[n],e);e.dependenciesState_=Pn.NOT_TRACKING_}function cse(e){var t=Hp();try{return e()}finally{Xu(t)}}function Hp(){var e=gt.trackingDerivation;return gt.trackingDerivation=null,e}function Xu(e){gt.trackingDerivation=e}function Zj(e){var t=gt.allowStateReads;return gt.allowStateReads=e,t}function Zv(e){gt.allowStateReads=e}function dse(e){if(e.dependenciesState_!==Pn.UP_TO_DATE_){e.dependenciesState_=Pn.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=Pn.UP_TO_DATE_}}var TE=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},AE=!0,fse=!1,gt=(function(){var e=FC();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(AE=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new TE().version&&(AE=!1),AE?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new TE):(setTimeout(function(){fse||bn(35)},1),new TE)})();function HIe(){if((gt.pendingReactions.length||gt.inBatch||gt.isRunningReactions)&&bn(36),fse=!0,AE){var e=FC();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),gt=new TE}}function VIe(){return gt}function WIe(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function pse(e,t){e.observers_.delete(t),e.observers_.size===0&&hse(e)}function hse(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,gt.pendingUnobservations.push(e))}function ns(){gt.inBatch++}function rs(){if(--gt.inBatch===0){bse();for(var e=gt.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof al&&n.suspend_())}gt.pendingUnobservations=[]}}function mse(e){var t=gt.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&gt.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&gt.inBatch>0&&hse(e),!1)}function gse(e){e.lowestObserverState_!==Pn.STALE_&&(e.lowestObserverState_=Pn.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Pn.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=Pn.STALE_}))}function GIe(e){e.lowestObserverState_!==Pn.STALE_&&(e.lowestObserverState_=Pn.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Pn.POSSIBLY_STALE_?t.dependenciesState_=Pn.STALE_:t.dependenciesState_===Pn.UP_TO_DATE_&&(e.lowestObserverState_=Pn.UP_TO_DATE_)}))}function qIe(e){e.lowestObserverState_===Pn.UP_TO_DATE_&&(e.lowestObserverState_=Pn.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Pn.UP_TO_DATE_&&(t.dependenciesState_=Pn.POSSIBLY_STALE_,t.onBecomeStale_())}))}var tu=(function(){function e(n,r,i,a){n===void 0&&(n="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Pn.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=bS.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=a}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,gt.pendingReactions.push(this),bse())},t.runReaction_=function(){if(!this.isDisposed){ns(),this.isScheduled=!1;var r=gt.trackingContext;if(gt.trackingContext=this,nP(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}gt.trackingContext=r,rs()}},t.track=function(r){if(!this.isDisposed){ns(),this.isRunning=!0;var i=gt.trackingContext;gt.trackingContext=this;var a=use(this,r,void 0);gt.trackingContext=i,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&rP(this),CE(a)&&this.reportExceptionInDerivation_(a.cause),rs()}},t.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(gt.disableErrorBoundaries)throw r;var a="[mobx] uncaught error in '"+this+"'";gt.suppressReactionErrors||console.error(a,r),gt.globalReactionErrorHandlers.forEach(function(s){return s(r,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(ns(),rP(this),rs()))},t.getDisposer_=function(r){var i=this,a=function s(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",s)};return r==null||r.addEventListener==null||r.addEventListener("abort",a),a[Yt]=this,"dispose"in Symbol&&typeof Symbol.dispose=="symbol"&&(a[Symbol.dispose]=a),a},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(r){},$g(e,[{key:"isDisposed",get:function(){return Rs(this.flags_,e.isDisposedMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return Rs(this.flags_,e.isScheduledMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return Rs(this.flags_,e.isTrackPendingMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return Rs(this.flags_,e.isRunningMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isRunningMask_,r)}},{key:"diffValue",get:function(){return Rs(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=Ns(this.flags_,e.diffValueMask_,r===1)}}])})();tu.isDisposedMask_=1;tu.isScheduledMask_=2;tu.isTrackPendingMask_=4;tu.isRunningMask_=8;tu.diffValueMask_=16;var KIe=100,iP=function(t){return t()};function bse(){gt.inBatch>0||gt.isRunningReactions||iP(YIe)}function YIe(){gt.isRunningReactions=!0;for(var e=gt.pendingReactions,t=0;e.length>0;){++t===KIe&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}gt.isRunningReactions=!1}var yS=qd("Reaction",tu);function XIe(e){var t=iP;iP=function(r){return e(function(){return t(r)})}}function Qv(){return!1}function ZIe(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var vse="action",QIe="action.bound",yse="autoAction",JIe="autoAction.bound",_se="<unnamed action>",aP=h1(vse),eDe=h1(QIe,{bound:!0}),sP=h1(yse,{autoAction:!0}),tDe=h1(JIe,{autoAction:!0,bound:!0});function xse(e){var t=function(r,i){if(Fs(r))return jd(r.name||_se,r,e);if(Fs(i))return jd(r,i,e);if(p1(i))return(e?sP:aP).decorate_20223_(r,i);if(Ap(i))return f1(r,i,e?sP:aP);if(Ap(r))return Hl(h1(e?yse:vse,{name:r,autoAction:e}))};return t}var _i=xse(!1);Object.assign(_i,aP);var Fy=xse(!0);Object.assign(Fy,sP);_i.bound=Hl(eDe);Fy.bound=Hl(tDe);function QV(e){return ose(e.name||_se,!1,e,this,void 0)}function $m(e){return Fs(e)&&e.isMobxAction===!0}function Ese(e,t){var n,r,i,a;t===void 0&&(t=Kj);var s=(n=(r=t)==null?void 0:r.name)!=null?n:"Autorun",o=!t.scheduler&&!t.delay,l;if(o)l=new tu(s,function(){this.track(c)},t.onError,t.requiresObservable);else{var u=Sse(t),d=!1;l=new tu(s,function(){d||(d=!0,u(function(){d=!1,l.isDisposed||l.track(c)}))},t.onError,t.requiresObservable)}function c(){e(l)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||l.schedule_(),l.getDisposer_((a=t)==null?void 0:a.signal)}var nDe=function(t){return t()};function Sse(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:nDe}function zm(e,t,n){var r,i,a;n===void 0&&(n=Kj);var s=(r=n.name)!=null?r:"Reaction",o=_i(s,n.onError?rDe(n.onError,t):t),l=!n.scheduler&&!n.delay,u=Sse(n),d=!0,c=!1,m,g=n.compareStructural?Um.structural:n.equals||Um.default,_=new tu(s,function(){d||l?x():c||(c=!0,u(x))},n.onError,n.requiresObservable);function x(){if(c=!1,!_.isDisposed){var b=!1,v=m;_.track(function(){var y=lse(!1,function(){return e(_)});b=d||!g(m,y),m=y}),(d&&n.fireImmediately||!d&&b)&&o(m,v,_),d=!1}}return(i=n)!=null&&(i=i.signal)!=null&&i.aborted||_.schedule_(),_.getDisposer_((a=n)==null?void 0:a.signal)}function rDe(e,t){return function(){try{return t.apply(this,arguments)}catch(n){e.call(this,n)}}}var iDe="onBO",aDe="onBUO";function sDe(e,t,n){return Cse(iDe,e,t,n)}function wse(e,t,n){return Cse(aDe,e,t,n)}function Cse(e,t,n,r){var i=Vm(t),a=Fs(r)?r:n,s=e+"L";return i[s]?i[s].add(a):i[s]=new Set([a]),function(){var o=i[s];o&&(o.delete(a),o.size===0&&delete i[s])}}var oDe="never",Ix="always",lDe="observed";function uDe(e){e.isolateGlobalState===!0&&HIe();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(gt.useProxies=t===Ix?!0:t===oDe?!1:typeof Proxy<"u"),t==="ifavailable"&&(gt.verifyProxies=!0),n!==void 0){var r=n===Ix?Ix:n===lDe;gt.enforceActions=r,gt.allowStateChanges=!(r===!0||r===Ix)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(gt[i]=!!e[i])}),gt.allowStateReads=!gt.observableRequiresReaction,e.reactionScheduler&&XIe(e.reactionScheduler)}function cDe(e,t,n,r){var i=GNe(t);return Vp(function(){var a=Hg(e,r)[Yt];zC(i).forEach(function(s){a.extend_(s,i[s],n&&s in n?n[s]:!0)})}),e}function dDe(e,t){return Tse(Vm(e,t))}function Tse(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=fDe(e.observing_).map(Tse)),t}function fDe(e){return Array.from(new Set(e))}var pDe=0;function Ase(){this.message="FLOW_CANCELLED"}Ase.prototype=Object.create(Error.prototype);var rO=ese("flow"),hDe=ese("flow.bound",{bound:!0}),Hm=Object.assign(function(t,n){if(p1(n))return rO.decorate_20223_(t,n);if(Ap(n))return f1(t,n,rO);var r=t,i=r.name||"<unnamed flow>",a=function(){var o=this,l=arguments,u=++pDe,d=_i(i+" - runid: "+u+" - init",r).apply(o,l),c,m=void 0,g=new Promise(function(_,x){var b=0;c=x;function v(T){m=void 0;var w;try{w=_i(i+" - runid: "+u+" - yield "+b++,d.next).call(d,T)}catch(A){return x(A)}E(w)}function y(T){m=void 0;var w;try{w=_i(i+" - runid: "+u+" - yield "+b++,d.throw).call(d,T)}catch(A){return x(A)}E(w)}function E(T){if(Fs(T?.then)){T.then(E,x);return}return T.done?_(T.value):(m=Promise.resolve(T.value),m.then(v,y))}v(void 0)});return g.cancel=_i(i+" - runid: "+u+" - cancel",function(){try{m&&JV(m);var _=d.return(void 0),x=Promise.resolve(_.value);x.then(nm,nm),JV(x),c(new Ase)}catch(b){c(b)}}),g};return a.isMobXFlow=!0,a},rO);Hm.bound=Hl(hDe);function JV(e){Fs(e.cancel)&&e.cancel()}function By(e){return e?.isMobXFlow===!0}function kse(e,t,n){var r;return Co(e)||su(e)||$Ie(e)?r=nu(e):hl(e)&&(r=nu(e,t)),r.dehancer=typeof t=="function"?t:n,function(){r.dehancer=void 0}}function Qj(e,t,n){return Fs(n)?gDe(e,t,n):mDe(e,t)}function mDe(e,t){return nu(e).intercept_(t)}function gDe(e,t,n){return nu(e,t).intercept_(n)}function bDe(e,t){return e?hl(e)||!!e[Yt]||Yj(e)||yS(e)||qC(e):!1}function Ose(e){return bDe(e)}function _S(e){if(hl(e))return e[Yt].keys_();if(Co(e)||Pa(e))return Array.from(e.keys());if(su(e))return e.map(function(t,n){return n});bn(5)}function Rse(e){if(hl(e))return _S(e).map(function(t){return e[t]});if(Co(e))return _S(e).map(function(t){return e.get(t)});if(Pa(e))return Array.from(e.values());if(su(e))return e.slice();bn(6)}function vDe(e){if(hl(e))return _S(e).map(function(t){return[t,e[t]]});if(Co(e))return _S(e).map(function(t){return[t,e.get(t)]});if(Pa(e))return Array.from(e.entries());if(su(e))return e.map(function(t,n){return[n,t]});bn(7)}function Nse(e,t,n){if(arguments.length===2&&!Pa(e)){ns();var r=t;try{for(var i in r)Nse(e,i,r[i])}finally{rs()}return}hl(e)?e[Yt].set_(t,n):Co(e)?e.set(t,n):Pa(e)?e.add(t):su(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&bn("Invalid index: '"+t+"'"),ns(),t>=e.length&&(e.length=t+1),e[t]=n,rs()):bn(8)}function Ise(e,t,n){if(hl(e))return e[Yt].defineProperty_(t,n);bn(39)}function Jj(e,t,n,r){return Fs(n)?_De(e,t,n,r):yDe(e,t,n)}function yDe(e,t,n){return nu(e).observe_(t,n)}function _De(e,t,n,r){return nu(e,t).observe_(n,r)}function Uu(e,t){t===void 0&&(t=void 0),ns();try{return e.apply(t)}finally{rs()}}function eW(e,t,n){return arguments.length===1||t&&typeof t=="object"?xDe(e,t):Dse(e,t,{})}function Dse(e,t,n){var r;if(typeof n.timeout=="number"){var i=new Error("WHEN_TIMEOUT");r=setTimeout(function(){if(!s[Yt].isDisposed)if(s(),n.onError)n.onError(i);else throw i},n.timeout)}n.name="When";var a=jd("When-effect",t),s=Ese(function(o){var l=lse(!1,e);l&&(o.dispose(),r&&clearTimeout(r),a())},n);return s}function xDe(e,t){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var r,i,a=new Promise(function(s,o){var l,u=Dse(e,s,Md({},t,{onError:o}));r=function(){u(),o(new Error("WHEN_CANCELLED"))},i=function(){u(),o(new Error("WHEN_ABORTED"))},t==null||(l=t.signal)==null||l.addEventListener==null||l.addEventListener("abort",i)}).finally(function(){var s;return t==null||(s=t.signal)==null||s.removeEventListener==null?void 0:s.removeEventListener("abort",i)});return a.cancel=r,a}function Vh(e){return e[Yt]}var EDe={has:function(t,n){return Vh(t).has_(n)},get:function(t,n){return Vh(t).get_(n)},set:function(t,n,r){var i;return Ap(n)?(i=Vh(t).set_(n,r,!0))!=null?i:!0:!1},deleteProperty:function(t,n){var r;return Ap(n)?(r=Vh(t).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(t,n,r){var i;return(i=Vh(t).defineProperty_(n,r))!=null?i:!0},ownKeys:function(t){return Vh(t).ownKeys_()},preventExtensions:function(t){bn(13)}};function SDe(e,t){var n,r;return Gae(),e=Hg(e,t),(r=(n=e[Yt]).proxy_)!=null?r:n.proxy_=new Proxy(e,EDe)}function fo(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function m1(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),qae(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function po(e,t){var n=Hp();try{for(var r=[].concat(e.interceptors_||[]),i=0,a=r.length;i<a&&(t=r[i](t),t&&!t.type&&bn(14),!!t);i++);return t}finally{Xu(n)}}function Xo(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function g1(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),qae(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function Zo(e,t){var n=Hp(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,a=r.length;i<a;i++)r[i](t);Xu(n)}}function Lse(e,t,n){return Vp(function(){var r,i=Hg(e,n)[Yt];(r=t)!=null||(t=ZNe(e)),zC(t).forEach(function(a){return i.make_(a,t[a])})}),e}var tW="splice",Vl="update",wDe=1e4,CDe={get:function(t,n){var r=t[Yt];return n===Yt?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):Yu(xS,n)?xS[n]:t[n]},set:function(t,n,r){var i=t[Yt];return n==="length"&&i.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?t[n]=r:i.set_(parseInt(n),r),!0},preventExtensions:function(){bn(15)}},e5=(function(){function e(n,r,i,a){n===void 0&&(n="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new Kd(n),this.enhancer_=function(s,o){return r(s,o,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},t.intercept_=function(r){return m1(this,r)},t.observe_=function(r,i){return i===void 0&&(i=!1),i&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),g1(this,r)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&bn("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var a=new Array(r-i),s=0;s<r-i;s++)a[s]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(r,i-r)},t.updateArrayLength_=function(r,i){r!==this.lastKnownLength_&&bn(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&Use(r+i+1)},t.spliceWithArray_=function(r,i,a){var s=this;this.atom_;var o=this.values_.length;if(r===void 0?r=0:r>o?r=o:r<0&&(r=Math.max(0,o+r)),arguments.length===1?i=o-r:i==null?i=0:i=Math.max(0,Math.min(i,o-r)),a===void 0&&(a=QL),fo(this)){var l=po(this,{object:this.proxy_,type:tW,index:r,removedCount:i,added:a});if(!l)return QL;i=l.removedCount,a=l.added}if(a=a.length===0?a:a.map(function(c){return s.enhancer_(c,void 0)}),this.legacyMode_){var u=a.length-i;this.updateArrayLength_(o,u)}var d=this.spliceItemsIntoValues_(r,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(r,a,d),this.dehanceValues_(d)},t.spliceItemsIntoValues_=function(r,i,a){if(a.length<wDe){var s;return(s=this.values_).splice.apply(s,[r,i].concat(a))}else{var o=this.values_.slice(r,r+i),l=this.values_.slice(r+i);this.values_.length+=a.length-i;for(var u=0;u<a.length;u++)this.values_[r+u]=a[u];for(var d=0;d<l.length;d++)this.values_[r+a.length+d]=l[d];return o}},t.notifyArrayChildUpdate_=function(r,i,a){var s=!this.owned_&&Qv(),o=Xo(this),l=o||s?{observableKind:"array",object:this.proxy_,type:Vl,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),o&&Zo(this,l)},t.notifyArraySplice_=function(r,i,a){var s=!this.owned_&&Qv(),o=Xo(this),l=o||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:tW,index:r,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),o&&Zo(this,l)},t.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx] Out of bounds read: "+r);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},t.set_=function(r,i){var a=this.values_;if(this.legacyMode_&&r>a.length&&bn(17,r,a.length),r<a.length){this.atom_;var s=a[r];if(fo(this)){var o=po(this,{type:Vl,object:this.proxy_,index:r,newValue:i});if(!o)return;i=o.newValue}i=this.enhancer_(i,s);var l=i!==s;l&&(a[r]=i,this.notifyArrayChildUpdate_(r,i,s))}else{for(var u=new Array(r+1-a.length),d=0;d<u.length-1;d++)u[d]=void 0;u[u.length-1]=i,this.spliceWithArray_(a.length,0,u)}},e})();function TDe(e,t,n,r){return n===void 0&&(n="ObservableArray"),r===void 0&&(r=!1),Gae(),Vp(function(){var i=new e5(n,t,r,!1);Yae(i.values_,Yt,i);var a=new Proxy(i.values_,CDe);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var xS={clear:function(){return this.splice(0)},replace:function(t){var n=this[Yt];return n.spliceWithArray_(0,n.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];var s=this[Yt];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(t);case 2:return s.spliceWithArray_(t,n)}return s.spliceWithArray_(t,n,i)},spliceWithArray:function(t,n,r){return this[Yt].spliceWithArray_(t,n,r)},push:function(){for(var t=this[Yt],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,r),t.values_.length},pop:function(){return this.splice(Math.max(this[Yt].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[Yt],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(0,0,r),t.values_.length},reverse:function(){return gt.trackingDerivation&&bn(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){gt.trackingDerivation&&bn(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var n=this[Yt],r=n.dehanceValues_(n.values_).indexOf(t);return r>-1?(this.splice(r,1),!0):!1}};hr("at",$s);hr("concat",$s);hr("flat",$s);hr("includes",$s);hr("indexOf",$s);hr("join",$s);hr("lastIndexOf",$s);hr("slice",$s);hr("toString",$s);hr("toLocaleString",$s);hr("toSorted",$s);hr("toSpliced",$s);hr("with",$s);hr("every",pl);hr("filter",pl);hr("find",pl);hr("findIndex",pl);hr("findLast",pl);hr("findLastIndex",pl);hr("flatMap",pl);hr("forEach",pl);hr("map",pl);hr("some",pl);hr("toReversed",pl);hr("reduce",Pse);hr("reduceRight",Pse);function hr(e,t){typeof Array.prototype[e]=="function"&&(xS[e]=t(e))}function $s(e){return function(){var t=this[Yt];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function pl(e){return function(t,n){var r=this,i=this[Yt];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[e](function(s,o){return t.call(n,s,o,r)})}}function Pse(e){return function(){var t=this,n=this[Yt];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(a,s,o){return i(a,s,o,t)},r[e].apply(r,arguments)}}var ADe=qd("ObservableArrayAdministration",e5);function su(e){return UC(e)&&ADe(e[Yt])}var kDe={},vd="add",ES="delete",t5=(function(){function e(n,r,i){var a=this;r===void 0&&(r=kp),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Yt]=kDe,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=r,this.name_=i,Fs(Map)||bn(18),Vp(function(){a.keysAtom_=mS("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,n&&a.merge(n)})}var t=e.prototype;return t.has_=function(r){return this.data_.has(r)},t.has=function(r){var i=this;if(!gt.trackingDerivation)return this.has_(r);var a=this.hasMap_.get(r);if(!a){var s=a=new Rd(this.has_(r),HC,"ObservableMap.key?",!1);this.hasMap_.set(r,s),wse(s,function(){return i.hasMap_.delete(r)})}return a.get()},t.set=function(r,i){var a=this.has_(r);if(fo(this)){var s=po(this,{type:a?Vl:vd,object:this,newValue:i,name:r});if(!s)return this;i=s.newValue}return a?this.updateValue_(r,i):this.addValue_(r,i),this},t.delete=function(r){var i=this;if(this.keysAtom_,fo(this)){var a=po(this,{type:ES,object:this,name:r});if(!a)return!1}if(this.has_(r)){var s=Qv(),o=Xo(this),l=o||s?{observableKind:"map",debugObjectName:this.name_,type:ES,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return Uu(function(){var u;i.keysAtom_.reportChanged(),(u=i.hasMap_.get(r))==null||u.setNewValue_(!1);var d=i.data_.get(r);d.setNewValue_(void 0),i.data_.delete(r)}),o&&Zo(this,l),!0}return!1},t.updateValue_=function(r,i){var a=this.data_.get(r);if(i=a.prepareNewValue_(i),i!==gt.UNCHANGED){var s=Qv(),o=Xo(this),l=o||s?{observableKind:"map",debugObjectName:this.name_,type:Vl,object:this,oldValue:a.value_,name:r,newValue:i}:null;a.setNewValue_(i),o&&Zo(this,l)}},t.addValue_=function(r,i){var a=this;this.keysAtom_,Uu(function(){var u,d=new Rd(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(r,d),i=d.value_,(u=a.hasMap_.get(r))==null||u.setNewValue_(!0),a.keysAtom_.reportChanged()});var s=Qv(),o=Xo(this),l=o||s?{observableKind:"map",debugObjectName:this.name_,type:vd,object:this,name:r,newValue:i}:null;o&&Zo(this,l)},t.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var r=this,i=this.keys();return nW({next:function(){var s=i.next(),o=s.done,l=s.value;return{done:o,value:o?void 0:r.get(l)}}})},t.entries=function(){var r=this,i=this.keys();return nW({next:function(){var s=i.next(),o=s.done,l=s.value;return{done:o,value:o?void 0:[l,r.get(l)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(r,i){for(var a=rm(this),s;!(s=a()).done;){var o=s.value,l=o[0],u=o[1];r.call(i,u,l,this)}},t.merge=function(r){var i=this;return Co(r)&&(r=new Map(r)),Uu(function(){Pd(r)?WNe(r).forEach(function(a){return i.set(a,r[a])}):Array.isArray(r)?r.forEach(function(a){var s=a[0],o=a[1];return i.set(s,o)}):Ug(r)?(VNe(r)||bn(19,r),r.forEach(function(a,s){return i.set(s,a)})):r!=null&&bn(20,r)}),this},t.clear=function(){var r=this;Uu(function(){cse(function(){for(var i=rm(r.keys()),a;!(a=i()).done;){var s=a.value;r.delete(s)}})})},t.replace=function(r){var i=this;return Uu(function(){for(var a=ODe(r),s=new Map,o=!1,l=rm(i.data_.keys()),u;!(u=l()).done;){var d=u.value;if(!a.has(d)){var c=i.delete(d);if(c)o=!0;else{var m=i.data_.get(d);s.set(d,m)}}}for(var g=rm(a.entries()),_;!(_=g()).done;){var x=_.value,b=x[0],v=x[1],y=i.data_.has(b);if(i.set(b,v),i.data_.has(b)){var E=i.data_.get(b);s.set(b,E),y||(o=!0)}}if(!o)if(i.data_.size!==s.size)i.keysAtom_.reportChanged();else for(var T=i.data_.keys(),w=s.keys(),A=T.next(),O=w.next();!A.done;){if(A.value!==O.value){i.keysAtom_.reportChanged();break}A=T.next(),O=w.next()}i.data_=s}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(r,i){return g1(this,r)},t.intercept_=function(r){return m1(this,r)},$g(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])})(),Co=qd("ObservableMap",t5);function nW(e){return e[Symbol.toStringTag]="MapIterator",r5(e)}function ODe(e){if(Ug(e)||Co(e))return e;if(Array.isArray(e))return new Map(e);if(Pd(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return bn(21,e)}var RDe={},Mse=(function(){function e(n,r,i){var a=this;r===void 0&&(r=kp),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Yt]=RDe,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,Fs(Set)||bn(22),this.enhancer_=function(s,o){return r(s,o,i)},Vp(function(){a.atom_=mS(a.name_),n&&a.replace(n)})}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.clear=function(){var r=this;Uu(function(){cse(function(){for(var i=rm(r.data_.values()),a;!(a=i()).done;){var s=a.value;r.delete(s)}})})},t.forEach=function(r,i){for(var a=rm(this),s;!(s=a()).done;){var o=s.value;r.call(i,o,o,this)}},t.add=function(r){var i=this;if(this.atom_,fo(this)){var a=po(this,{type:vd,object:this,newValue:r});if(!a)return this;r=a.newValue}if(!this.has(r)){Uu(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var s=!1,o=Xo(this),l=o||s?{observableKind:"set",debugObjectName:this.name_,type:vd,object:this,newValue:r}:null;o&&Zo(this,l)}return this},t.delete=function(r){var i=this;if(fo(this)){var a=po(this,{type:ES,object:this,oldValue:r});if(!a)return!1}if(this.has(r)){var s=!1,o=Xo(this),l=o||s?{observableKind:"set",debugObjectName:this.name_,type:ES,object:this,oldValue:r}:null;return Uu(function(){i.atom_.reportChanged(),i.data_.delete(r)}),o&&Zo(this,l),!0}return!1},t.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},t.entries=function(){var r=this.values();return rW({next:function(){var a=r.next(),s=a.value,o=a.done;return o?{value:void 0,done:o}:{value:[s,s],done:o}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var r=this,i=this.data_.values();return rW({next:function(){var s=i.next(),o=s.value,l=s.done;return l?{value:void 0,done:l}:{value:r.dehanceValue_(o),done:l}}})},t.intersection=function(r){if(Bu(r)&&!Pa(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},t.union=function(r){if(Bu(r)&&!Pa(r))return r.union(this);var i=new Set(this);return i.union(r)},t.difference=function(r){return new Set(this).difference(r)},t.symmetricDifference=function(r){if(Bu(r)&&!Pa(r))return r.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(r)},t.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},t.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},t.isDisjointFrom=function(r){if(Bu(r)&&!Pa(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},t.replace=function(r){var i=this;return Pa(r)&&(r=new Set(r)),Uu(function(){Array.isArray(r)?(i.clear(),r.forEach(function(a){return i.add(a)})):Bu(r)?(i.clear(),r.forEach(function(a){return i.add(a)})):r!=null&&bn("Cannot initialize set from "+r)}),this},t.observe_=function(r,i){return g1(this,r)},t.intercept_=function(r){return m1(this,r)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},$g(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])})(),Pa=qd("ObservableSet",Mse);function rW(e){return e[Symbol.toStringTag]="SetIterator",r5(e)}var iW=Object.create(null),aW="remove",jse=(function(){function e(n,r,i,a){r===void 0&&(r=new Map),a===void 0&&(a=xIe),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=r,this.name_=i,this.defaultAnnotation_=a,this.keysAtom_=new Kd("ObservableObject.keys"),this.isPlainObject_=Pd(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(r){return this.values_.get(r).get()},t.setObservablePropValue_=function(r,i){var a=this.values_.get(r);if(a instanceof al)return a.set(i),!0;if(fo(this)){var s=po(this,{type:Vl,object:this.proxy_||this.target_,name:r,newValue:i});if(!s)return null;i=s.newValue}if(i=a.prepareNewValue_(i),i!==gt.UNCHANGED){var o=Xo(this),l=!1,u=o||l?{type:Vl,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:r,newValue:i}:null;a.setNewValue_(i),o&&Zo(this,u)}return!0},t.get_=function(r){return gt.trackingDerivation&&!Yu(this.target_,r)&&this.has_(r),this.target_[r]},t.set_=function(r,i,a){return a===void 0&&(a=!1),Yu(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,i):a?Reflect.set(this.target_,r,i):(this.target_[r]=i,!0):this.extend_(r,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},t.has_=function(r){if(!gt.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(r);return i||(i=new Rd(r in this.target_,HC,"ObservableObject.key?",!1),this.pendingKeys_.set(r,i)),i.get()},t.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(r in this.target_)){var a;if((a=this.target_[jl])!=null&&a[r])return;bn(1,i.annotationType_,this.name_+"."+r.toString())}for(var s=this.target_;s&&s!==BC;){var o=hS(s,r);if(o){var l=i.make_(this,r,o,s);if(l===0)return;if(l===1)break}s=Object.getPrototypeOf(s)}oW(this,i,r)}},t.extend_=function(r,i,a,s){if(s===void 0&&(s=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(r,i,s);var o=a.extend_(this,r,i,s);return o&&oW(this,a,r),o},t.defineProperty_=function(r,i,a){a===void 0&&(a=!1),this.keysAtom_;try{ns();var s=this.delete_(r);if(!s)return s;if(fo(this)){var o=po(this,{object:this.proxy_||this.target_,name:r,type:vd,newValue:i.value});if(!o)return null;var l=o.newValue;i.value!==l&&(i=Md({},i,{value:l}))}if(a){if(!Reflect.defineProperty(this.target_,r,i))return!1}else zl(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{rs()}return!0},t.defineObservableProperty_=function(r,i,a,s){s===void 0&&(s=!1),this.keysAtom_;try{ns();var o=this.delete_(r);if(!o)return o;if(fo(this)){var l=po(this,{object:this.proxy_||this.target_,name:r,type:vd,newValue:i});if(!l)return null;i=l.newValue}var u=sW(r),d={configurable:gt.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:u.get,set:u.set};if(s){if(!Reflect.defineProperty(this.target_,r,d))return!1}else zl(this.target_,r,d);var c=new Rd(i,a,"ObservableObject.key",!1);this.values_.set(r,c),this.notifyPropertyAddition_(r,c.value_)}finally{rs()}return!0},t.defineComputedProperty_=function(r,i,a){a===void 0&&(a=!1),this.keysAtom_;try{ns();var s=this.delete_(r);if(!s)return s;if(fo(this)){var o=po(this,{object:this.proxy_||this.target_,name:r,type:vd,newValue:void 0});if(!o)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var l=sW(r),u={configurable:gt.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:l.get,set:l.set};if(a){if(!Reflect.defineProperty(this.target_,r,u))return!1}else zl(this.target_,r,u);this.values_.set(r,new al(i)),this.notifyPropertyAddition_(r,void 0)}finally{rs()}return!0},t.delete_=function(r,i){if(i===void 0&&(i=!1),this.keysAtom_,!Yu(this.target_,r))return!0;if(fo(this)){var a=po(this,{object:this.proxy_||this.target_,name:r,type:aW});if(!a)return null}try{var s;ns();var o=Xo(this),l=!1,u=this.values_.get(r),d=void 0;if(!u&&(o||l)){var c;d=(c=hS(this.target_,r))==null?void 0:c.value}if(i){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(u&&(this.values_.delete(r),u instanceof Rd&&(d=u.value_),gse(u)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(r in this.target_),o||l){var m={type:aW,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:d,name:r};o&&Zo(this,m)}}finally{rs()}return!0},t.observe_=function(r,i){return g1(this,r)},t.intercept_=function(r){return m1(this,r)},t.notifyPropertyAddition_=function(r,i){var a,s=Xo(this),o=!1;if(s||o){var l=s||o?{type:vd,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;s&&Zo(this,l)}(a=this.pendingKeys_)==null||(a=a.get(r))==null||a.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),zC(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e})();function Hg(e,t){var n;if(Yu(e,Yt))return e;var r=(n=t?.name)!=null?n:"ObservableObject",i=new jse(e,new Map,String(r),IIe(t));return $C(e,Yt,i),e}var NDe=qd("ObservableObjectAdministration",jse);function sW(e){return iW[e]||(iW[e]={get:function(){return this[Yt].getObservablePropValue_(e)},set:function(n){return this[Yt].setObservablePropValue_(e,n)}})}function hl(e){return UC(e)?NDe(e[Yt]):!1}function oW(e,t,n){var r;(r=e.target_[jl])==null||delete r[n]}var IDe=Bse(0),DDe=(function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1})(),iO=0,Fse=function(){};function LDe(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}LDe(Fse,Array.prototype);var n5=(function(e){function t(r,i,a,s){var o;return a===void 0&&(a="ObservableArray"),s===void 0&&(s=!1),o=e.call(this)||this,Vp(function(){var l=new e5(a,i,s,!0);l.proxy_=o,Yae(o,Yt,l),r&&r.length&&o.spliceWithArray(0,0,r),DDe&&Object.defineProperty(o,"0",IDe)}),o}Qae(t,e);var n=t.prototype;return n.concat=function(){this[Yt].atom_.reportObserved();for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return Array.prototype.concat.apply(this.slice(),a.map(function(o){return su(o)?o.slice():o}))},n[Symbol.iterator]=function(){var r=this,i=0;return r5({next:function(){return i<r.length?{value:r[i++],done:!1}:{done:!0,value:void 0}}})},$g(t,[{key:"length",get:function(){return this[Yt].getArrayLength_()},set:function(i){this[Yt].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])})(Fse);Object.entries(xS).forEach(function(e){var t=e[0],n=e[1];t!=="concat"&&$C(n5.prototype,t,n)});function Bse(e){return{enumerable:!1,configurable:!0,get:function(){return this[Yt].get_(e)},set:function(n){this[Yt].set_(e,n)}}}function PDe(e){zl(n5.prototype,""+e,Bse(e))}function Use(e){if(e>iO){for(var t=iO;t<e+100;t++)PDe(t);iO=e}}Use(1e3);function MDe(e,t,n){return new n5(e,t,n)}function Vm(e,t){if(typeof e=="object"&&e!==null){if(su(e))return t!==void 0&&bn(23),e[Yt].atom_;if(Pa(e))return e.atom_;if(Co(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||bn(25,t,oP(e)),n}if(hl(e)){if(!t)return bn(26);var r=e[Yt].values_.get(t);return r||bn(27,t,oP(e)),r}if(Yj(e)||qC(e)||yS(e))return e}else if(Fs(e)&&yS(e[Yt]))return e[Yt];bn(28)}function nu(e,t){if(e||bn(29),t!==void 0)return nu(Vm(e,t));if(Yj(e)||qC(e)||yS(e)||Co(e)||Pa(e))return e;if(e[Yt])return e[Yt];bn(24,e)}function oP(e,t){var n;if(t!==void 0)n=Vm(e,t);else{if($m(e))return e.name;hl(e)||Co(e)||Pa(e)?n=nu(e):n=Vm(e)}return n.name_}function Vp(e){var t=Hp(),n=WC(!0);ns();try{return e()}finally{rs(),GC(n),Xu(t)}}var lW=BC.toString;function $se(e,t,n){return n===void 0&&(n=-1),lP(e,t,n)}function lP(e,t,n,r,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!=="function"&&a!=="object"&&typeof t!="object")return!1;var s=lW.call(e);if(s!==lW.call(t))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":n>=0&&n++;break}e=uW(e),t=uW(t);var o=s==="[object Array]";if(!o){if(typeof e!="object"||typeof t!="object")return!1;var l=e.constructor,u=t.constructor;if(l!==u&&!(Fs(l)&&l instanceof l&&Fs(u)&&u instanceof u)&&"constructor"in e&&"constructor"in t)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var d=r.length;d--;)if(r[d]===e)return i[d]===t;if(r.push(e),i.push(t),o){if(d=e.length,d!==t.length)return!1;for(;d--;)if(!lP(e[d],t[d],n-1,r,i))return!1}else{var c=Object.keys(e),m=c.length;if(Object.keys(t).length!==m)return!1;for(var g=0;g<m;g++){var _=c[g];if(!(Yu(t,_)&&lP(e[_],t[_],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function uW(e){return su(e)?e.slice():Ug(e)||Co(e)||Bu(e)||Pa(e)?Array.from(e.entries()):e}var cW,jDe=((cW=FC().Iterator)==null?void 0:cW.prototype)||{};function r5(e){return e[Symbol.iterator]=FDe,Object.assign(Object.create(jDe),e)}function FDe(){return this}["Symbol","Map","Set"].forEach(function(e){var t=FC();typeof t[e]>"u"&&bn("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:ZIe,extras:{getDebugName:oP},$mobx:Yt});var dW={},BDe="warn";function UDe(){return BDe}var yi;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(yi||(yi={}));var uP=function(e,t){return uP=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},uP(e,t)};function mr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");uP(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var is=function(){return is=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},is.apply(this,arguments)};function $De(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 Jv(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ic(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return a}function ac(e,t,n){if(arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function zse(e){return Mn(e).type}function zDe(e,t){return Mn(e).onPatch(t)}function Uy(e,t){Mn(e).applyPatches(eoe(t))}function fW(e,t){var n={patches:[],inversePatches:[]},r={},i,a={get recording(){return!!i},get patches(){return r.patches||(r.patches=n.patches.slice()),r.patches},get reversedInversePatches(){return r.reversedInversePatches||(r.reversedInversePatches=n.inversePatches.slice().reverse()),r.reversedInversePatches},get inversePatches(){return r.inversePatches||(r.inversePatches=n.inversePatches.slice()),r.inversePatches},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=zDe(e,function(s,o){n.patches.push(s),n.inversePatches.push(o),r.patches=void 0,r.inversePatches=void 0,r.reversedInversePatches=void 0}))},replay:function(s){Uy(s||e,n.patches)},undo:function(s){Uy(s||e,n.inversePatches.slice().reverse())}};return a.resume(),a}function HDe(e,t){t===void 0&&(t=!0);var n=Mn(e);return t?n.snapshot:n.type.getSnapshot(n,!1)}function Hse(e){return Mn(e).root.storedValue}function VDe(e){return Mn(e).path}function WDe(e){return Mn(e).identifier}function SS(e){var t=Mn(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function cP(e){var t=Mn(e),n=t.root.environment;if(!n)throw new Nt("Failed to find the environment of ".concat(t," ").concat(t.path));return n}var Vse=(function(){function e(t,n,r,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:Ji.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(n,r)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(t){var n=this.isAlive;this._state=t;var r=this.isAlive;this.aliveAtom&&n!==r&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._hookSubscribers&&this._hookSubscribers.emit(t,this,t)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this._hookSubscribers||(this._hookSubscribers=new roe),this._hookSubscribers.register(t,n)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){this._parent=t,this._subpath=n,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.pathAtom||(this.pathAtom=mS("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?sp(this._subpath):""),this.parent.getEscapedPath(t)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==Ji.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Ji.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=mS("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===Ji.CREATED){if(this.parent){if(this.parent.state!==Ji.FINALIZED)return;this.fireHook(yi.afterAttach)}this.state=Ji.FINALIZED,t&&t()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=Ji.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(yi.beforeDestroy)}}),e})(),$y=(function(e){mr(t,e);function t(n,r,i,a,s){var o=e.call(this,n,r,i,a)||this;try{o.storedValue=n.createNewInstance(s)}catch(l){throw o.state=Ji.DEAD,l}return o.state=Ji.CREATED,o.finalizeCreation(),o}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw new Nt("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this.parent!==n,a=this.subpath!==r;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,r))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Ji.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.fireInternalHook(n)}}),t})(Vse);$y.prototype.die=_i($y.prototype.die);var GDe=1,Uo;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(Uo||(Uo={}));var ws;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(ws||(ws={}));var qDe={onError:function(e){throw e}},ls=(function(e){mr(t,e);function t(n,r,i,a,s){var o=e.call(this,n,r,i,a)||this;if(Object.defineProperty(o,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++GDe}),Object.defineProperty(o,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(o,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(o,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:Uo.UNINITIALIZED}),Object.defineProperty(o,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o._snapshotComputed=zg(function(){return o.getSnapshot()}),o.unbox=o.unbox.bind(o),o._initialSnapshot=s,o.identifierAttribute=n.identifierAttribute,r||(o.identifierCache=new iLe),o._childNodes=n.initializeChildNodes(o,o._initialSnapshot),o.identifier=null,o.unnormalizedIdentifier=null,o.identifierAttribute&&o._initialSnapshot){var l=o._initialSnapshot[o.identifierAttribute];if(l===void 0){var u=o._childNodes[o.identifierAttribute];u&&(l=u.value)}if(typeof l!="string"&&typeof l!="number")throw new Nt("Instance identifier '".concat(o.identifierAttribute,"' for type '").concat(o.type.name,"' must be a string or a number"));o.identifier=b1(l),o.unnormalizedIdentifier=l}return r?r.root.identifierCache.addNodeToCache(o):o.identifierCache.addNodeToCache(o),o}return Object.defineProperty(t.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.createObservableInstanceIfNeeded(),this._applyPatches(n)}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.createObservableInstanceIfNeeded(),this._applySnapshot(n)}}),Object.defineProperty(t.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=!0),this._observableInstanceState===Uo.UNINITIALIZED&&this.createObservableInstance(n)}}),Object.defineProperty(t.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r,i,a,s;n===void 0&&(n=!0),this._observableInstanceState=Uo.CREATING;for(var o=[],l=this.parent;l&&l._observableInstanceState===Uo.UNINITIALIZED;)o.unshift(l),l=l.parent;try{for(var u=Jv(o),d=u.next();!d.done;d=u.next()){var c=d.value;c.createObservableInstanceIfNeeded(!1)}}catch(x){r={error:x}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}var m=this.type;try{this.storedValue=m.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,m.finalizeNewInstance(this,this.storedValue)}catch(x){throw this.state=Ji.DEAD,x}finally{this._isRunningAction=!1}if(this._observableInstanceState=Uo.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=qm,this.state=Ji.CREATED,n){this.fireHook(yi.afterCreate),this.finalizeCreation();try{for(var g=Jv(o.reverse()),_=g.next();!_.done;_=g.next()){var c=_.value;c.fireHook(yi.afterCreate),c.finalizeCreation()}}catch(x){a={error:x}}finally{try{_&&!_.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var n=this.parent;return n?n.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(yi.beforeDetach);var n=this.state;this.state=Ji.DETACHING;var r=this.root,i=r.environment,a=r.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=n}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=n!==this.parent,a=r!==this.subpath;!i&&!a||(i?(this.environment=void 0,n.root.identifierCache.mergeCache(this),this.baseSetParent(n,r),this.fireHook(yi.afterAttach)):a&&this.baseSetParent(this.parent,r))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;this.fireInternalHook(n);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[n];typeof i=="function"&&(QV?QV(function(){i.apply(r.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===Uo.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var n=this.type,r=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=n.processInitialSnapshot(r,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=UDe();if(!this.isAlive&&r!=="ignore"){var i=this._getAssertAliveError(n);switch(r){case"error":throw new Nt(i);case"warn":gLe(i)}}}}),Object.defineProperty(t.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.getEscapedPath(!1)||this.pathUponDeath||"",i=n.subpath&&sp(n.subpath)||"",a=n.actionContext||qse();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var s="";if(a&&a.name!=null){var o=a&&a.context&&VDe(a.context)||r;s="".concat(o,".").concat(a.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(r,"', Subpath: '").concat(i,"', Action: '").concat(s,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.assertAlive({subpath:n}),this._autoUnbox=!1;try{return this._observableInstanceState===Uo.CREATED?this.type.getChildNode(this,n):this._childNodes[n]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(qm),this._autoUnbox=!1;try{return this._observableInstanceState===Uo.CREATED?this.type.getChildren(this):Qse(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.type.getChildType(n)}}),Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(this.assertAlive(n),!this.isRunningAction()&&this.isProtected)throw new Nt("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.type.removeChild(this,n)}}),Object.defineProperty(t.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n&&(this.assertAlive({subpath:n.subpath||n.subpathUponDeath}),this._autoUnbox?n.value:n)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=(this.isAlive?this.path:this.pathUponDeath)||"<root>",r=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(n).concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;this.baseFinalizeCreation(function(){var r,i;try{for(var a=Jv(n.getChildren()),s=a.next();!s.done;s=a.next()){var o=s.value;o.finalizeCreation()}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}n.fireInternalHook(yi.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new Nt("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;this._applyPatches=zy(this.storedValue,"@APPLY_PATCHES",function(r){r.forEach(function(i){if(!i.path){n.type.applySnapshot(n,i.value);return}var a=wLe(i.path),s=oLe(n,a.slice(0,-1));s.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=zy(this.storedValue,"@APPLY_SNAPSHOT",function(r){if(r!==n.snapshot)return n.type.applySnapshot(n,r)}),ap(this.storedValue,"$treenode",this),ap(this.storedValue,"toJSON",sLe)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Ji.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==Uo.UNINITIALIZED&&(this.getChildren().forEach(function(n){n.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(ws.Dispose),this._internalEventsClear(ws.Dispose))}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(r){r.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var n=this.snapshot;this._snapshotUponDeath=n,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._addSnapshotReaction(),this._internalEventsRegister(ws.Snapshot,n)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this._internalEventsEmit(ws.Snapshot,n)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._internalEventsRegister(ws.Patch,n)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this._internalEventsHasSubscribers(ws.Patch)){var i=r.path.substr(this.path.length)+(n.path?"/"+n.path:""),a=pLe({},n,{path:i}),s=ic(yLe(a),2),o=s[0],l=s[1];this._internalEventsEmit(ws.Patch,o,l)}this.parent&&this.parent.emitPatch(n,r)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._internalEventsHas(ws.Dispose,n)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!this.hasDisposer(n)){this._internalEventsRegister(ws.Dispose,n,!0);return}throw new Nt("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!this._internalEventsHas(ws.Dispose,n))throw new Nt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(ws.Dispose,n)}}),Object.defineProperty(t.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(this.middlewares){var r=this.middlewares.indexOf(n);r>=0&&this.middlewares.splice(r,1)}}}),Object.defineProperty(t.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;r===void 0&&(r=!0);var a={handler:n,includeHooks:r};return this.middlewares?this.middlewares.push(a):this.middlewares=[a],function(){i.removeMiddleware(a)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){this.assertWritable({subpath:n}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,n,r)}}),Object.defineProperty(t.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;if(!this._hasSnapshotReaction){var r=zm(function(){return n.snapshot},function(i){return n.emitSnapshot(i)},qDe);this.addDisposer(r),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return!!this._internalEvents&&this._internalEvents.hasSubscribers(n)}}),Object.defineProperty(t.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new roe),this._internalEvents.register(n,r,i)}}),Object.defineProperty(t.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return!!this._internalEvents&&this._internalEvents.has(n,r)}}),Object.defineProperty(t.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){this._internalEvents&&this._internalEvents.unregister(n,r)}}),Object.defineProperty(t.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(n){for(var r,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];this._internalEvents&&(r=this._internalEvents).emit.apply(r,ac([n],ic(i),!1))}}),Object.defineProperty(t.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this._internalEvents&&this._internalEvents.clear(n)}}),Object.defineProperty(t.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t})(Vse);ls.prototype.createObservableInstance=_i(ls.prototype.createObservableInstance);ls.prototype.detach=_i(ls.prototype.detach);ls.prototype.die=_i(ls.prototype.die);var Wse,On;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(On||(On={}));var Gse="cannotDetermine",KDe=Symbol("$type"),sc=(function(){function e(t){Object.defineProperty(this,Wse,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return Zu(this,t),this.instantiate(null,"",n,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){throw new Nt("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var r=Zse(t);if(r){var i=zse(t);return this.isAssignableFrom(i)?us():ds(n,t)}return this.isValidSnapshot(t,n)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.validate(t,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new Nt("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new Nt("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new Nt("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new Nt("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e})();Wse=KDe;sc.prototype.create=_i(sc.prototype.create);var Wm=(function(e){mr(t,e);function t(n){var r=e.call(this,n)||this;return Object.defineProperty(r,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return n===void 0&&(n=this.getDefaultSnapshot()),e.prototype.create.call(this,n,r)}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.createObservableInstanceIfNeeded(),n.storedValue}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return!n.identifierAttribute||n.identifier===b1(r[n.identifierAttribute])}}),Object.defineProperty(t.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return n.isDetaching?!1:n.snapshot===r||Mr(r)&&Mn(r)===n?!0:n.type===this&&toe(r)&&!Mr(r)&&this.isMatchingSnapshotId(n,r)?(n.applySnapshot(r),!0):!1}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var s=this.tryToReconcileNode(n,r);if(s)return n.setParent(i,a),n;if(n.die(),Mr(r)&&this.isAssignableFrom(zse(r))){var o=Mn(r);return o.setParent(i,a),o}return this.instantiate(i,a,void 0,r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t})(sc);Wm.prototype.create=_i(Wm.prototype.create);var Wp=(function(e){mr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){if(!n.isDetaching&&n.type===this&&n.storedValue===r)return n;var s=this.instantiate(i,a,void 0,r);return n.die(),s}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t})(sc);function oc(e){return typeof e=="object"&&e&&e.isType===!0}var YDe=1,ey;function qse(){return ey}function Kse(){return YDe++}function dP(e,t){var n=Mn(e.context);e.type==="action"&&n.assertAlive({actionContext:e});var r=n._isRunningAction;n._isRunningAction=!0;var i=ey;ey=e;try{return ZDe(n,e,t)}finally{ey=i,n._isRunningAction=r}}function Yse(e){if(e)return e.type==="action"?e:e.parentActionEvent}function zy(e,t,n){var r=function(){var i=Kse(),a=ey,s=Yse(a);return dP({type:"action",name:t,id:i,args:ioe(arguments),context:e,tree:Hse(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?ac(ac([],ic(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:s},n)};return r._isMSTAction=!0,r._isFlowAction=n._isFlowAction,r}var XDe=(function(){function e(t,n){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),n.$mst_middleware&&this.middlewares.push(n.$mst_middleware);for(var r=t;r;)r.middlewares&&this.middlewares.push(r.middlewares),r=r.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.middlewares[this.arrayIndex];if(t){var n=t[this.inArrayIndex++];return n||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e})();function ZDe(e,t,n){var r=new XDe(e,n);if(r.isEmpty)return _i(n).apply(null,t.args);var i=null;function a(s){var o=r.getNextMiddleware(),l=o&&o.handler;if(!l)return _i(n).apply(null,s.args);if(!o.includeHooks&&yi[s.name])return a(s);function u(c,m){i=a(c),m&&(i=m(i))}function d(c){i=c}return l(s,u,d),i}return a(t)}function QDe(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: ".concat(t,">")}}function Xse(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):Mr(e)?"<".concat(e,">"):"`".concat(QDe(e),"`")}function JDe(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function eLe(e){var t=e.value,n=e.context[e.context.length-1].type,r=e.context.map(function(o){var l=o.path;return l}).filter(function(o){return o.length>0}).join("/"),i=r.length>0?'at path "/'.concat(r,'" '):"",a=Mr(t)?"value of type ".concat(Mn(t).type.name,":"):Hy(t)?"value":"snapshot",s=n&&Mr(t)&&n.is(Mn(t).snapshot);return"".concat(i).concat(a," ").concat(Xse(t)," is not assignable ").concat(n?"to type: `".concat(n.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(n?ULe(n)||Hy(t)?".":", expected an instance of `".concat(n.name,"` or a snapshot like `").concat(n.describe(),"` instead.")+(s?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function i5(e,t,n){return e.concat([{path:t,type:n}])}function us(){return Gm}function ds(e,t,n){return[{context:e,value:t,message:n}]}function KC(e){return e.reduce(function(t,n){return t.concat(n)},[])}function Zu(e,t){bLe()&&tLe(e,t)}function tLe(e,t){var n=e.validate(t,[{path:"",type:e}]);if(n.length>0)throw new Nt(nLe(e,t,n))}function nLe(e,t,n){if(n.length!==0)return"Error while converting ".concat(JDe(Xse(t))," to `").concat(e.name,`\`:
33
33
 
@@ -48,7 +48,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48
48
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ule(e){return K3e(e)||Y3e(e)||nle(e)||X3e()}function qp(e){var t=null;return function(){if(!t){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var s=e.apply(this,i);t={result:s}}return t.result}}var Z3e=qp(function(){return navigator.userAgent.includes("Firefox")}),y1=qp(function(){var t=navigator,n=t.userAgent;return n.includes("AppleWebKit")&&!n.includes("Chrome")}),bP={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};function Q3e(e){var t=e.dragLeave;return y1()?t.hasOwnProperty(bP.isLeavingWindow):!1}(function(){if(typeof window>"u"||!y1())return;function t(){return{enterCount:0,isOverWindow:!1}}var n=t();function r(){n=t()}Ym.bindAll(window,[{type:"dragstart",listener:function(){n.enterCount=0,n.isOverWindow=!0}},{type:"drop",listener:r},{type:"dragend",listener:r},{type:"dragenter",listener:function(a){!n.isOverWindow&&n.enterCount===0&&(a[bP.isEnteringWindow]=!0),n.isOverWindow=!0,n.enterCount++}},{type:"dragleave",listener:function(a){n.enterCount--,n.isOverWindow&&n.enterCount===0&&(a[bP.isLeavingWindow]=!0,n.isOverWindow=!1)}}],{capture:!0})})();function J3e(e){return"nodeName"in e}function eje(e){return J3e(e)&&e.ownerDocument!==document}function tje(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n!=="dragleave"?!1:y1()?Q3e({dragLeave:t}):r==null?!0:Z3e()?eje(r):r instanceof HTMLIFrameElement}function nje(e){var t=e.onDragEnd;return[{type:"pointermove",listener:(function(){var n=0;return function(){if(n<20){n++;return}t()}})()},{type:"pointerdown",listener:t}]}function ny(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var rje=function(t){var n=[],r=null,i=function(){for(var s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];n=o,!r&&(r=requestAnimationFrame(function(){r=null,t.apply(void 0,n)}))};return i.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},i},yO=rje(function(e){return e()}),jx=(function(){var e=null;function t(r){var i=requestAnimationFrame(function(){e=null,r()});e={frameId:i,fn:r}}function n(){e&&(cancelAnimationFrame(e.frameId),e.fn(),e=null)}return{schedule:t,flush:n}})();function ije(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(o){r(o),i={dropTargets:o.payload.location.current.dropTargets}}var s={start:function(l){var u=l.nativeSetDragImage,d={current:n,previous:i,initial:n};a({eventName:"onGenerateDragPreview",payload:{source:t,location:d,nativeSetDragImage:u}}),jx.schedule(function(){a({eventName:"onDragStart",payload:{source:t,location:d}})})},dragUpdate:function(l){var u=l.current;jx.flush(),yO.cancel(),a({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:i,current:u}}})},drag:function(l){var u=l.current;yO(function(){jx.flush();var d={initial:n,previous:i,current:u};a({eventName:"onDrag",payload:{source:t,location:d}})})},drop:function(l){var u=l.current,d=l.updatedSourcePayload;jx.flush(),yO.cancel(),a({eventName:"onDrop",payload:{source:d??t,location:{current:u,previous:i,initial:n}}})}};return s}var vP={isActive:!1};function cle(){return!vP.isActive}function aje(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function sje(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function oje(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(!cle())return;var a=lje({event:t,dragType:n,getDropTargetsOver:r});vP.isActive=!0;var s={current:a};_O({event:t,current:a.dropTargets});var o=ije({source:n.payload,dispatchEvent:i,initial:a});function l(g){var _=sje({current:s.current.dropTargets,next:g.dropTargets});s.current=g,_&&o.dragUpdate({current:s.current})}function u(g){var _=ny(g),x=sle(g.target)?ole({x:_.clientX,y:_.clientY}):g.target,b=r({target:x,input:_,source:n.payload,current:s.current.dropTargets});b.length&&(g.preventDefault(),_O({event:g,current:b})),l({dropTargets:b,input:_})}function d(){s.current.dropTargets.length&&l({dropTargets:[],input:s.current.input}),o.drop({current:s.current,updatedSourcePayload:null}),c()}function c(){vP.isActive=!1,m()}var m=Ym.bindAll(window,[{type:"dragover",listener:function(_){u(_),o.drag({current:s.current})}},{type:"dragenter",listener:u},{type:"dragleave",listener:function(_){tje({dragLeave:_})&&(l({input:s.current.input,dropTargets:[]}),n.startedFrom==="external"&&d())}},{type:"drop",listener:function(_){if(s.current={dropTargets:s.current.dropTargets,input:ny(_)},!s.current.dropTargets.length){d();return}_.preventDefault(),_O({event:_,current:s.current.dropTargets}),o.drop({current:s.current,updatedSourcePayload:n.type==="external"?n.getDropPayload(_):null}),c()}},{type:"dragend",listener:function(_){s.current={dropTargets:s.current.dropTargets,input:ny(_)},d()}}].concat(ule(nje({onDragEnd:d}))),{capture:!0});o.start({nativeSetDragImage:aje(t)})}function _O(e){var t,n=e.event,r=e.current,i=(t=r[0])===null||t===void 0?void 0:t.dropEffect;i!=null&&n.dataTransfer&&(n.dataTransfer.dropEffect=i)}function lje(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=ny(t);if(n.startedFrom==="external")return{input:i,dropTargets:[]};var a=r({input:i,source:n.payload,target:t.target,current:[]});return{input:i,dropTargets:a}}var QW={canStart:cle,start:oje},yP=new Map;function uje(e){var t=e.typeKey,n=e.mount,r=yP.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return yP.set(t,i),i}function cje(e){var t=uje(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),yP.delete(e.typeKey))}}function _1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){t.forEach(function(i){return i()})}}function dle(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function JW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function id(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JW(Object(n),!0).forEach(function(r){v1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xO(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=dje(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
49
49
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{s||n.return==null||n.return()}finally{if(o)throw a}}}}function dje(e,t){if(e){if(typeof e=="string")return eG(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eG(e,t):void 0}}function eG(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function EO(e){return e.slice(0).reverse()}function fje(e){var t=e.typeKey,n=e.defaultDropEffect,r=new WeakMap,i="data-drop-target-for-".concat(t),a="[".concat(i,"]");function s(g){return r.set(g.element,g),function(){return r.delete(g.element)}}function o(g){var _=_1(dle(g.element,{attribute:i,value:"true"}),s(g));return qp(_)}function l(g){var _,x,b,v,y=g.source,E=g.target,T=g.input,w=g.result,A=w===void 0?[]:w;if(E==null)return A;if(!(E instanceof Element))return E instanceof Node?l({source:y,target:E.parentElement,input:T,result:A}):A;var O=E.closest(a);if(O==null)return A;var R=r.get(O);if(R==null)return A;var N={input:T,source:y,element:R.element};if(R.canDrop&&!R.canDrop(N))return l({source:y,target:R.element.parentElement,input:T,result:A});var D=(_=(x=R.getData)===null||x===void 0?void 0:x.call(R,N))!==null&&_!==void 0?_:{},L=(b=(v=R.getDropEffect)===null||v===void 0?void 0:v.call(R,N))!==null&&b!==void 0?b:n,U={data:D,element:R.element,dropEffect:L,isActiveDueToStickiness:!1};return l({source:y,target:R.element.parentElement,input:T,result:[].concat(ule(A),[U])})}function u(g){var _=g.eventName,x=g.payload,b=xO(x.location.current.dropTargets),v;try{for(b.s();!(v=b.n()).done;){var y,E=v.value,T=r.get(E.element),w=id(id({},x),{},{self:E});T==null||(y=T[_])===null||y===void 0||y.call(T,w)}}catch(A){b.e(A)}finally{b.f()}}var d={onGenerateDragPreview:u,onDrag:u,onDragStart:u,onDrop:u,onDropTargetChange:function(_){var x=_.payload,b=new Set(x.location.current.dropTargets.map(function(q){return q.element})),v=new Set,y=xO(x.location.previous.dropTargets),E;try{for(y.s();!(E=y.n()).done;){var T,w=E.value;v.add(w.element);var A=r.get(w.element),O=b.has(w.element),R=id(id({},x),{},{self:w});if(A==null||(T=A.onDropTargetChange)===null||T===void 0||T.call(A,R),!O){var N;A==null||(N=A.onDragLeave)===null||N===void 0||N.call(A,R)}}}catch(q){y.e(q)}finally{y.f()}var D=xO(x.location.current.dropTargets),L;try{for(D.s();!(L=D.n()).done;){var U,M,W=L.value;if(!v.has(W.element)){var z=id(id({},x),{},{self:W}),H=r.get(W.element);H==null||(U=H.onDropTargetChange)===null||U===void 0||U.call(H,z),H==null||(M=H.onDragEnter)===null||M===void 0||M.call(H,z)}}}catch(q){D.e(q)}finally{D.f()}}};function c(g){d[g.eventName](g)}function m(g){var _=g.source,x=g.target,b=g.input,v=g.current,y=l({source:_,target:x,input:b});if(y.length>=v.length)return y;for(var E=EO(v),T=EO(y),w=[],A=0;A<E.length;A++){var O,R=E[A],N=T[A];if(N!=null){w.push(N);continue}var D=w[A-1],L=E[A-1];if(D?.element!==L?.element)break;var U=r.get(R.element);if(!U)break;var M={input:b,source:_,element:U.element};if(U.canDrop&&!U.canDrop(M)||!((O=U.getIsSticky)!==null&&O!==void 0&&O.call(U,M)))break;w.push(id(id({},R),{},{isActiveDueToStickiness:!0}))}return EO(w)}return{dropTargetForConsumers:o,getIsOver:m,dispatchEvent:c}}function pje(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=hje(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
50
50
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{s||n.return==null||n.return()}finally{if(o)throw a}}}}function hje(e,t){if(e){if(typeof e=="string")return tG(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tG(e,t):void 0}}function tG(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mje(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nG(Object(n),!0).forEach(function(r){v1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gje(){var e=new Set,t=null;function n(a){t&&(!a.canMonitor||a.canMonitor(t.canMonitorArgs))&&t.active.add(a)}function r(a){var s=mje({},a);e.add(s),n(s);function o(){e.delete(s),t&&t.active.delete(s)}return qp(o)}function i(a){var s=a.eventName,o=a.payload;if(s==="onGenerateDragPreview"){t={canMonitorArgs:{initial:o.location.initial,source:o.source},active:new Set};var l=pje(e),u;try{for(l.s();!(u=l.n()).done;){var d=u.value;n(d)}}catch(b){l.e(b)}finally{l.f()}}if(t){for(var c=Array.from(t.active),m=0,g=c;m<g.length;m++){var _=g[m];if(t.active.has(_)){var x;(x=_[s])===null||x===void 0||x.call(_,o)}}s==="onDrop"&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function bje(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,s=gje(),o=fje({typeKey:t,defaultDropEffect:a});function l(c){r?.(c),o.dispatchEvent(c),s.dispatchEvent(c),i?.(c)}function u(c){var m=c.event,g=c.dragType;QW.start({event:m,dragType:g,getDropTargetsOver:o.getIsOver,dispatchEvent:l})}function d(){function c(){var m={canStart:QW.canStart,start:u};return n(m)}return cje({typeKey:t,mount:c})}return{registerUsage:d,dropTarget:o.dropTargetForConsumers,monitor:s.monitorForConsumers}}var fle=qp(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),vje="pdnd:android-fallback",rG="text/plain",yje="text/uri-list",_je="application/vnd.pdnd",AS=new WeakMap;function xje(e){return AS.set(e.element,e),function(){AS.delete(e.element)}}var iG=q3e(),y5=bje({typeKey:"element",defaultDropEffect:"move",mount:function(t){return _1(iG.bindEvents(),Ym.bind(document,{type:"dragstart",listener:function(r){var i,a,s,o,l,u;if(t.canStart(r)&&!r.defaultPrevented&&r.dataTransfer){var d=r.target;if(d instanceof HTMLElement){var c=AS.get(d);if(c){var m=ny(r),g={element:c.element,dragHandle:(i=c.dragHandle)!==null&&i!==void 0?i:null,input:m};if(c.canDrag&&!c.canDrag(g)){r.preventDefault();return}if(c.dragHandle){var _=ole({x:m.clientX,y:m.clientY});if(!c.dragHandle.contains(_)){r.preventDefault();return}}var x=(a=(s=c.getInitialDataForExternal)===null||s===void 0?void 0:s.call(c,g))!==null&&a!==void 0?a:null;if(x)for(var b=0,v=Object.entries(x);b<v.length;b++){var y=rle(v[b],2),E=y[0],T=y[1];r.dataTransfer.setData(E,T??"")}fle()&&!r.dataTransfer.types.includes(rG)&&!r.dataTransfer.types.includes(yje)&&r.dataTransfer.setData(rG,vje),r.dataTransfer.setData(_je,"");var w={element:c.element,dragHandle:(o=c.dragHandle)!==null&&o!==void 0?o:null,data:(l=(u=c.getInitialData)===null||u===void 0?void 0:u.call(c,g))!==null&&l!==void 0?l:{}},A={type:"element",payload:w,startedFrom:"internal"};t.start({event:r,dragType:A})}}}}}))},dispatchEventToSource:function(t){var n,r,i=t.eventName,a=t.payload;(n=AS.get(a.source.element))===null||n===void 0||(r=n[i])===null||r===void 0||r.call(n,a)},onPostDispatch:iG.getOnPostDispatch()}),tT=y5.dropTarget,ple=y5.monitor;function hle(e){var t=_1(y5.registerUsage(),xje(e),dle(e.element,{attribute:"draggable",value:"true"}));return qp(t)}function aG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aG(Object(n),!0).forEach(function(r){v1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Eje={top:function(t,n){return Math.abs(n.y-t.top)},right:function(t,n){return Math.abs(t.right-n.x)},bottom:function(t,n){return Math.abs(t.bottom-n.y)},left:function(t,n){return Math.abs(n.x-t.left)}},mle=Symbol("closestEdge");function gle(e,t){var n,r,i=t.element,a=t.input,s=t.allowedEdges,o={x:a.clientX,y:a.clientY},l=i.getBoundingClientRect(),u=s.map(function(c){return{edge:c,value:Eje[c](l,o)}}),d=(n=(r=u.sort(function(c,m){return c.value-m.value})[0])===null||r===void 0?void 0:r.edge)!==null&&n!==void 0?n:null;return sG(sG({},e),{},v1({},mle,d))}function xm(e){var t;return(t=e[mle])!==null&&t!==void 0?t:null}function Sje({tab:e,isActive:t,canClose:n,onSelect:r,onClose:i,onEdit:a,onReorder:s}){const o=C.useRef(null),[l,u]=C.useState(!1),[d,c]=C.useState(null),m=C.useRef(!1);C.useEffect(()=>{const x=o.current;if(!(!x||!s))return _1(hle({element:x,getInitialData:()=>({type:"terminal-tab",tabId:e.id,position:e.position}),onDragStart:()=>{u(!0),m.current=!0},onDrop:()=>{u(!1)}}),tT({element:x,getData:({input:b,element:v})=>{const y={type:"terminal-tab",tabId:e.id,position:e.position};return gle(y,{input:b,element:v,allowedEdges:["left","right"]})},canDrop:({source:b})=>b.data.type==="terminal-tab"&&b.data.tabId!==e.id,onDragEnter:({self:b})=>{c(xm(b.data))},onDrag:({self:b})=>{c(xm(b.data))},onDragLeave:()=>{c(null)},onDrop:({source:b,self:v})=>{c(null);const y=xm(v.data),E=b.data.tabId,T=e.position;let w;y==="left"?w=T:w=T+1,s(E,w)}}))},[e.id,e.position,s]);const g=()=>{m.current=!1},_=()=>{m.current||r(),m.current=!1};return p.jsxs("button",{ref:o,onPointerDown:g,onClick:_,onDoubleClick:a,onContextMenu:x=>{x.preventDefault(),a()},className:ze("group relative flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs transition-colors max-sm:px-2 max-sm:py-1",t?"bg-background text-foreground":"text-muted-foreground hover:text-foreground","after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-foreground after:transition-opacity",t?"after:opacity-100":"after:opacity-0",l&&"opacity-50",s&&"cursor-grab active:cursor-grabbing"),title:e.directory?`${e.name}
51
- ${e.directory}`:e.name,children:[d&&p.jsx("div",{className:ze("absolute top-0 bottom-0 w-0.5 bg-primary z-10",d==="left"&&"-left-1",d==="right"&&"-right-1")}),e.directory&&p.jsx(te,{icon:Ba,size:12,strokeWidth:2,className:"shrink-0 opacity-60"}),e.name,n&&p.jsx("button",{onClick:x=>{x.stopPropagation(),i()},onPointerDown:x=>x.stopPropagation(),className:"ml-1 rounded opacity-0 hover:bg-muted group-hover:opacity-100",children:p.jsx(te,{icon:Yr,size:12,strokeWidth:2})})]})}function wje({tabs:e,activeTabId:t,onTabSelect:n,onTabClose:r,onTabCreate:i,onTabEdit:a,onTabReorder:s}){const o=C.useRef(null),l=C.useRef(null),[u,d]=C.useState(!1),[c,m]=C.useState(!1),[g,_]=C.useState(!0),x=C.useCallback(()=>{const y=o.current;if(!y)return;const{scrollLeft:E,scrollWidth:T,clientWidth:w}=y;d(E>0),m(E+w<T-1)},[]);C.useEffect(()=>{const y=l.current,E=o.current;if(!y||!E)return;const T=new IntersectionObserver(([w])=>{_(w.isIntersecting)},{root:E,threshold:.9});return T.observe(y),()=>T.disconnect()},[]),C.useEffect(()=>{const y=o.current;if(!y)return;x(),y.addEventListener("scroll",x);const E=new ResizeObserver(x);return E.observe(y),()=>{y.removeEventListener("scroll",x),E.disconnect()}},[x]),C.useEffect(()=>{x()},[e,x]);const b=C.useCallback(()=>{o.current?.scrollTo({left:0,behavior:"smooth"})},[]),v=C.useCallback(()=>{const y=o.current;y&&y.scrollTo({left:y.scrollWidth,behavior:"smooth"})},[]);return p.jsxs("div",{className:"flex items-center",children:[u&&p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:b,className:"shrink-0",children:p.jsx(te,{icon:Cp,size:14,strokeWidth:2})}),p.jsxs("div",{ref:o,className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto scrollbar-none",children:[e.map(y=>p.jsx(Sje,{tab:y,isActive:y.id===t,canClose:e.length>1,onSelect:()=>n(y.id),onClose:()=>r(y.id),onEdit:()=>a(y),onReorder:s},y.id)),p.jsx("span",{ref:l,children:p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:i,className:"shrink-0",children:p.jsx(te,{icon:jm,size:14,strokeWidth:2})})})]}),c&&p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:v,className:"shrink-0",children:p.jsx(te,{icon:EC,size:14,strokeWidth:2})}),!g&&p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:i,className:"shrink-0",children:p.jsx(te,{icon:jm,size:14,strokeWidth:2})})]})}function Cje({tab:e,open:t,onOpenChange:n,onSave:r,onCreate:i,defaultName:a=""}){const{t:s}=Ct("terminals"),[o,l]=C.useState(""),[u,d]=C.useState(null),[c,m]=C.useState(!1),g=!e&&i;C.useEffect(()=>{t&&(e?(l(e.name),d(e.directory??null)):(l(a),d(null)))},[t,e,a]);const _=()=>{if(g){i(o.trim(),u??void 0),n(!1);return}if(!e)return;const E={};o.trim()&&o.trim()!==e.name&&(E.name=o.trim()),u!==(e.directory??null)&&(E.directory=u),Object.keys(E).length>0&&r(e.id,E),n(!1)},x=E=>{E.key==="Enter"&&(E.preventDefault(),_())},b=()=>{d(null)},v=E=>{d(E)},y=u?u.split("/").pop():null;return p.jsxs(p.Fragment,{children:[p.jsx(So,{open:t,onOpenChange:n,children:p.jsxs(wo,{className:"sm:max-w-md",children:[p.jsx(cl,{children:p.jsx(dl,{children:s(g?"newTab.title":"editTab.title")})}),p.jsxs(Tp,{className:"mt-4",children:[p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"tabName",children:s("editTab.name")}),p.jsx(Ht,{id:"tabName",value:o,onChange:E=>l(E.target.value),onKeyDown:x,placeholder:s("editTab.namePlaceholder"),autoFocus:!0})]}),p.jsxs(zn,{children:[p.jsx(Hn,{children:s("editTab.directory")}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs(Be,{type:"button",variant:"outline",className:"flex-1 justify-start font-normal",onClick:()=>m(!0),children:[p.jsx(te,{icon:Ba,size:14,strokeWidth:2,className:"mr-2 shrink-0"}),y?p.jsx("span",{className:"truncate font-mono text-xs",children:u}):p.jsx("span",{className:"text-muted-foreground",children:s("editTab.directoryPlaceholder")})]}),u&&p.jsx(Be,{type:"button",variant:"ghost",size:"icon",onClick:b,title:s("editTab.clearDirectory"),children:p.jsx(te,{icon:Yr,size:14,strokeWidth:2})})]})]})]}),p.jsxs(i1,{className:"mt-4",children:[p.jsx(RC,{render:p.jsx(Be,{variant:"outline",type:"button"}),children:s("editTab.cancel")}),p.jsx(Be,{onClick:_,disabled:!o.trim(),children:s(g?"newTab.create":"editTab.save")})]})]})}),p.jsx(bd,{open:c,onOpenChange:m,onSelect:v,initialPath:u??void 0})]})}function SO(e){return{id:e.id,name:e.name,cwd:e.cwd,status:e.status,exitCode:e.exitCode??void 0,cols:e.cols,rows:e.rows,createdAt:e.createdAt,tabId:e.tabId??void 0,positionInTab:e.positionInTab}}function Tje(e,t){return{id:e.id,name:e.name,layout:"single",position:t,directory:e.directory??void 0}}const Oa="all-tasks",Ni="all-projects",oG=["IN_PROGRESS","IN_REVIEW"],lG="vibora:lastTerminalTab",Aje=Wg(function(){const{t}=Ct("terminals"),n=Sa(),{tab:r,repo:i,projects:a}=rC({from:"/terminals/"}),{terminals:s,tabs:o,connected:l,createTerminal:u,destroyTerminal:d,renameTerminal:c,assignTerminalToTab:m,createTab:g,updateTab:_,deleteTab:x,reorderTab:b,attachXterm:v,resizeTerminal:y,setupImagePaste:E,writeToTerminal:T,sendInputToTerminal:w,newTerminalIds:A,pendingTabCreation:O,lastCreatedTabId:R}=yoe(),[N,D]=C.useState(null),{getFocusedTerminal:L,selectedProjectIds:U,setSelectedProjects:M,isLoading:W}=Roe(),z=C.useMemo(()=>o.map(de=>de.id),[o]),H=r&&(z.includes(r)||r===Oa||r===Ni),q=H?r:o[0]?.id??null,K=C.useCallback(de=>{n({to:"/terminals",search:{tab:de,repo:de===Oa?i:void 0,projects:de===Ni?a:void 0},replace:!0})},[n,i,a]),$=C.useCallback(de=>{n({to:"/terminals",search:Te=>({...Te,repo:de||void 0}),replace:!0})},[n]),j=Vg();C.useEffect(()=>zm(()=>({lastCreatedTabId:j.lastCreatedTabId,pendingTabCreation:j.pendingTabCreation}),({lastCreatedTabId:Te})=>{Te&&(Lt.terminal.info("MobX reaction: lastCreatedTabId changed",{tabId:Te}),K(Te),setTimeout(()=>{j.clearLastCreatedTabId(),je.current++;const Ke=`Terminal ${je.current}`;Lt.terminal.debug("Creating terminal in new tab",{tabId:Te,name:Ke}),u({name:Ke,cols:80,rows:24,tabId:Te,positionInTab:0})},150))},{fireImmediately:!0}),[j,K,u]),C.useEffect(()=>{if(Lt.terminal.debug("Redirect effect running",{tabsLength:o.length,isValidTab:H,pendingTabCreation:O,lastCreatedTabId:R}),o.length!==0&&!(O||R)&&!H){const de=localStorage.getItem(lG),Te=de&&(o.some(Ke=>Ke.id===de)||de===Oa||de===Ni)?de:o[0].id;Lt.terminal.debug("Redirecting to tab",{targetTab:Te}),n({to:"/terminals",search:{tab:Te},replace:!0})}},[o,H,R,O,n]),C.useEffect(()=>{q&&localStorage.setItem(lG,q)},[q]);const{data:F=[],status:G}=PC(),{data:V=[]}=jC(),{data:J=[]}=eT(),ae=C.useMemo(()=>{const de=new Map;for(const Te of V)de.set(Te.path,Te.id);return de},[V]),se=C.useMemo(()=>new Set(F.filter(de=>oG.includes(de.status)&&de.worktreePath).map(de=>de.worktreePath)),[F]),Z=C.useMemo(()=>new Set(F.filter(de=>de.worktreePath).map(de=>de.worktreePath)),[F]),Y=C.useMemo(()=>{const de=new Map;for(const Te of F)Te.worktreePath&&de.set(Te.worktreePath,{taskId:Te.id,repoId:ae.get(Te.repoPath),repoName:Te.repoName,title:Te.title,repoPath:Te.repoPath,worktreePath:Te.worktreePath,baseBranch:Te.baseBranch,branch:Te.branch,prUrl:Te.prUrl,pinned:Te.pinned});return de},[F,ae]),Q=C.useMemo(()=>{const de=new Set(F.filter(Te=>oG.includes(Te.status)).map(Te=>Te.repoName));return Array.from(de).sort()},[F]),re=C.useMemo(()=>{const de=new Map;for(const Te of J)Te.repository?.path&&de.set(Te.repository.path,Te.id);return de},[J]),oe=C.useMemo(()=>{const de=new Map;for(const Te of J)Te.repository?.path&&de.set(Te.repository.path,{projectId:Te.id,projectName:Te.name,repoPath:Te.repository.path,appStatus:Te.app?.status??null});return de},[J]),ee=C.useMemo(()=>a?.split(",").filter(Boolean)??[],[a]),[ve,Ee]=C.useState(null),me=C.useRef(0),Se=400,xe=C.useCallback((de,Te)=>{Lt.projectTerminals.info("toggleProjectFilter called",{projectId:de,checked:Te});const Ke=a?.split(",").filter(Boolean)??[];if(Te&&Ke.length>=6)return;Te&&(Lt.projectTerminals.info("Setting loadingProjectId",{projectId:de}),me.current=Date.now(),Ee(de));const st=Te?[...Ke,de]:Ke.filter(Bt=>Bt!==de);n({to:"/terminals",search:Bt=>({...Bt,projects:st.length>0?st.join(","):void 0}),replace:!0})},[n,a]),Ye=C.useRef(!1);C.useEffect(()=>{if(q!==Ni){Ye.current=!1;return}W||Ye.current||a||U.length!==0&&(Ye.current=!0,n({to:"/terminals",search:de=>({...de,projects:U.join(",")}),replace:!0}))},[q,a,U,n,W]),C.useEffect(()=>{if(q!==Ni||W||!a&&!Ye.current&&U.length>0)return;const de=ee.join(","),Te=U.join(",");de!==Te&&M(ee)},[q,ee,U,M,W,a]),C.useEffect(()=>{if(q===Ni&&l){Lt.projectTerminals.debug("Auto-create effect running",{selectedProjectIds:ee,terminalCount:s.length,terminalCwds:s.map(de=>de.cwd)});for(const de of ee){const Te=J.find(Bt=>Bt.id===de);if(!Te?.repository?.path)continue;const Ke=Te.repository.path;if(s.find(Bt=>Bt.cwd===Ke&&!Bt.tabId)){Lt.projectTerminals.debug("Terminal already exists for project",{projectId:de,repoPath:Ke});continue}Lt.projectTerminals.info("Creating terminal for project",{projectId:de,repoPath:Ke}),u({name:Te.name,cwd:Ke,cols:80,rows:24})}}},[q,ee,J,s,l,u]);const Ue=C.useRef(new Map),je=C.useRef(0),we=C.useRef(!1),Ne=C.useRef(!1),_e=C.useMemo(()=>q===Oa?s.filter(de=>de.cwd&&se.has(de.cwd)).filter(de=>i?F.find(Ke=>Ke.worktreePath===de.cwd)?.repoName===i:!0).sort((de,Te)=>{const Ke=F.find(Bt=>Bt.worktreePath===de.cwd),st=F.find(Bt=>Bt.worktreePath===Te.cwd);return!Ke||!st?0:new Date(st.createdAt).getTime()-new Date(Ke.createdAt).getTime()}).map(SO):q===Ni?ee.length===0?[]:s.filter(de=>de.cwd&&!de.tabId&&re.has(de.cwd)).filter(de=>{const Te=re.get(de.cwd);return Te&&ee.includes(Te)}).map(SO):s.filter(de=>de.tabId===q).sort((de,Te)=>de.positionInTab-Te.positionInTab).map(SO),[q,s,se,i,F,re,ee]);C.useEffect(()=>{if(!ve)return;const de=J.find(st=>st.id===ve);if(!de?.repository?.path)return;const Te=de.repository.path,Ke=_e.some(st=>st.cwd===Te);if(Lt.projectTerminals.debug("Clear loading effect",{loadingProjectId:ve,repoPath:Te,hasTerminal:Ke,visibleTerminalCwds:_e.map(st=>st.cwd)}),Ke){const st=Date.now()-me.current,Bt=Se-st;if(Bt>0){const zt=setTimeout(()=>{Lt.projectTerminals.info("Clearing loadingProjectId after delay",{loadingProjectId:ve}),Ee(null)},Bt);return()=>clearTimeout(zt)}Lt.projectTerminals.info("Clearing loadingProjectId",{loadingProjectId:ve}),Ee(null)}},[ve,J,_e]);const pe=C.useCallback(()=>{if(Lt.terminal.info("handleTerminalAdd called",{activeTabId:q,connected:l,pendingTerminalCreate:we.current,terminalCount:s.length}),we.current){Lt.terminal.debug("Skipping terminal creation, already pending");return}we.current=!0,je.current++;const de=`Terminal ${je.current}`,Te=s.filter(st=>st.tabId===q),Ke=Te.length;Lt.terminal.info("Creating terminal",{name:de,tabId:q,positionInTab:Ke,terminalsInTabCount:Te.length}),u({name:de,cols:80,rows:24,tabId:q??void 0,positionInTab:Ke}),setTimeout(()=>{we.current=!1},500)},[u,q,s,l]);C.useEffect(()=>{if(G!=="success"){Lt.terminalsView.debug("Tab assignment effect skipped",{tasksStatus:G});return}for(const de of s)de.cwd&&Z.has(de.cwd)&&de.tabId&&(Lt.terminalsView.debug("Removing task terminal from regular tab",{terminalId:de.id,name:de.name,cwd:de.cwd,tabId:de.tabId}),m(de.id,null))},[s,Z,m,G]);const Ae=C.useCallback(de=>{const Te=Ue.current.get(de);Te&&(Te(),Ue.current.delete(de)),d(de,{force:!0,reason:"user_closed"})},[d]),he=C.useCallback((de,Te)=>{const Ke=v(de,Te);Ue.current.set(de,Ke),A.has(de)&&setTimeout(()=>{Te.focus()},50)},[v,A]),Oe=C.useCallback((de,Te,Ke)=>{y(de,Te,Ke)},[y]),ge=C.useCallback((de,Te)=>{c(de,Te)},[c]),Ie=C.useCallback(()=>{if(Ne.current){Lt.terminal.debug("Skipping tab creation, already pending");return}Ne.current=!0;const de=`Tab ${o.length+1}`;Lt.terminal.debug("Quick creating tab",{name:de}),g(de,void 0,void 0),setTimeout(()=>{Ne.current=!1},500)},[g,o.length]),We=C.useCallback((de,Te)=>{Lt.terminal.debug("Reordering tab",{tabId:de,newPosition:Te}),b(de,Te)},[b]),mt=C.useCallback((de,Te)=>{if(Ne.current){Lt.terminal.debug("Skipping tab creation, already pending");return}Ne.current=!0,Lt.terminal.debug("Creating tab",{name:de,directory:Te}),g(de,void 0,Te),setTimeout(()=>{Ne.current=!1},500)},[g]),lt=C.useCallback(de=>{const Te=s.filter(Ke=>Ke.tabId===de);for(const Ke of Te){const st=Ue.current.get(Ke.id);st&&(st(),Ue.current.delete(Ke.id))}x(de)},[s,x]),dt=o.map(Tje),$e=C.useCallback(de=>{D(de)},[]),ht=C.useCallback((de,Te)=>{_(de,Te)},[_]),Re=q===Oa||q===Ni;return Ra("meta+d",pe,{enabled:!Re&&l,allowInTerminal:!0,deps:[pe,Re,l]}),Ra("meta+w",()=>{if(q&&!Re){const de=L(q);de&&Ae(de)}},{enabled:!Re,allowInTerminal:!0,deps:[q,Re,L,Ae]}),p.jsxs("div",{className:"flex h-full max-w-full flex-col overflow-hidden",children:[p.jsxs("div",{className:"sticky top-0 z-10 flex shrink-0 items-center justify-between border-b border-border bg-background px-2 py-1",children:[p.jsxs("div",{className:"flex min-w-0 flex-1 items-center",children:[p.jsxs("button",{onClick:()=>K(Oa),className:ze("relative flex shrink-0 items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors max-sm:px-2",q===Oa?"bg-primary/10 text-primary":"text-muted-foreground hover:text-primary hover:bg-primary/5","after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-primary after:transition-opacity",q===Oa?"after:opacity-100":"after:opacity-0"),children:[p.jsx(te,{icon:Tj,size:12,strokeWidth:2}),p.jsx("span",{className:"max-sm:hidden",children:t("taskTerminals")})]}),p.jsxs("button",{onClick:()=>K(Ni),className:ze("relative flex shrink-0 items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors max-sm:px-2",q===Ni?"bg-primary/10 text-primary":"text-muted-foreground hover:text-primary hover:bg-primary/5","after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-primary after:transition-opacity",q===Ni?"after:opacity-100":"after:opacity-0"),children:[p.jsx(te,{icon:Ds,size:12,strokeWidth:2}),p.jsx("span",{className:"max-sm:hidden",children:t("projectTerminals")})]}),p.jsx("div",{className:"mx-2 h-4 w-px shrink-0 bg-border"}),p.jsx("div",{className:"min-w-0 flex-1",children:p.jsx(wje,{tabs:dt,activeTabId:q??"",onTabSelect:K,onTabClose:lt,onTabCreate:Ie,onTabEdit:$e,onTabReorder:We})})]}),p.jsxs("div",{className:"flex shrink-0 items-center gap-3 max-sm:gap-1",children:[q===Oa&&Q.length>1&&p.jsxs(mi,{value:i??"",onValueChange:de=>$(de||null),children:[p.jsxs(bi,{size:"sm",className:"max-sm:w-auto",children:[p.jsx(te,{icon:uS,size:12,strokeWidth:2,className:"text-muted-foreground"}),p.jsx(gi,{children:i||t("allRepos")})]}),p.jsxs(vi,{children:[p.jsx(gn,{value:"",children:t("allRepos")}),Q.map(de=>p.jsx(gn,{value:de,children:de},de))]})]}),q===Ni&&J.length>0&&p.jsxs(up,{children:[p.jsxs(cp,{render:p.jsx(Be,{variant:"outline",size:"sm",className:"max-sm:w-auto"}),children:[ve?p.jsx(te,{icon:Ft,size:12,strokeWidth:2,className:"animate-spin text-muted-foreground"}):p.jsx(te,{icon:uS,size:12,strokeWidth:2,className:"text-muted-foreground"}),p.jsx("span",{children:ee.length===0?t("selectProjects"):t("projectsSelected",{count:ee.length})})]}),p.jsx(dp,{className:"w-64",align:"end",children:p.jsxs("div",{className:"p-2 space-y-2",children:[p.jsx("div",{className:"text-sm font-medium mb-2",children:t("filterByProject")}),J.map(de=>{const Te=ee.includes(de.id),Ke=ve===de.id,st=ve!==null||!Te&&ee.length>=6;return p.jsxs("div",{className:"flex items-center gap-2",children:[Ke?p.jsx(te,{icon:Ft,size:16,strokeWidth:2,className:"animate-spin text-muted-foreground"}):p.jsx(Ar,{id:`project-filter-${de.id}`,checked:Te,disabled:st,onCheckedChange:Bt=>xe(de.id,Bt===!0)}),p.jsx(ea,{htmlFor:`project-filter-${de.id}`,className:`text-sm ${st?"text-muted-foreground cursor-not-allowed":"cursor-pointer"}`,children:de.name})]},de.id)}),ee.length>0&&!ve&&p.jsx(Be,{variant:"ghost",size:"sm",className:"w-full mt-2",onClick:()=>n({to:"/terminals",search:de=>({...de,projects:void 0}),replace:!0}),children:t("clearFilter")})]})})]}),p.jsxs(Be,{variant:"outline",size:"sm",onClick:pe,disabled:!l||q===Oa||q===Ni,className:"max-sm:px-2 border-transparent text-primary",children:[p.jsx(te,{icon:sie,size:14,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{className:"max-sm:hidden",children:t("newTerminal")})]})]})]}),p.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:p.jsx(D3e,{terminals:_e,onTerminalClose:q===Oa||q===Ni?void 0:Ae,onTerminalAdd:l&&q!==Oa&&q!==Ni?pe:void 0,onTerminalReady:he,onTerminalResize:Oe,onTerminalRename:q===Oa||q===Ni?void 0:ge,setupImagePaste:E,writeToTerminal:T,sendInputToTerminal:w,taskInfoByCwd:q===Oa?Y:void 0,projectInfoByCwd:q===Ni?oe:void 0,emptyMessage:q===Ni?t("emptyProjects"):q===Oa?t("emptyTasks"):void 0})}),p.jsx(Cje,{tab:N,open:N!==null,onOpenChange:de=>{de||D(null)},onSave:ht,onCreate:mt,defaultName:`Tab ${o.length+1}`})]})}),kje=Si("/terminals/")({component:Aje,validateSearch:e=>({tab:typeof e.tab=="string"?e.tab:void 0,repo:typeof e.repo=="string"?e.repo:void 0,projects:typeof e.projects=="string"?e.projects:void 0})});function Oje(){return{x:0,y:0}}function Rje(e){var t=e.render,n=e.nativeSetDragImage,r=e.getOffset,i=r===void 0?Oje:r,a=document.createElement("div");Object.assign(a.style,{position:"fixed",top:0,left:0,zIndex:lle,pointerEvents:"none"}),document.body.append(a);var s=t({container:a});queueMicrotask(function(){var u=i({container:a});if(y1()){var d=a.getBoundingClientRect();if(d.width===0)return;a.style.left="-".concat(d.width-1e-4,"px")}n?.(a,u.x,u.y)});function o(){l(),s?.(),document.body.removeChild(a)}var l=ple({onDragStart:o,onDrop:o})}var Nje=qp(function(){return y1()&&"ontouchend"in document}),Ije=function(t){var n=t.container,r=n.getBoundingClientRect();return{x:r.width/2,y:r.height/2}};function Dje(e){return function(n){var r=n.container;if(Nje()||fle())return Ije({container:r});Object.assign(r.style,{borderInlineStart:"".concat(e.x," solid transparent"),borderTop:"".concat(e.y," solid transparent")});var i=window.getComputedStyle(r);if(i.direction==="rtl"){var a=r.getBoundingClientRect();return{x:a.width,y:0}}return{x:0,y:0}}}function Ua({className:e,size:t="default",...n}){return p.jsx("div",{"data-slot":"card","data-size":t,className:ze("ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-lg py-4 text-xs/relaxed ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg group/card flex flex-col",e),...n})}function Lje({className:e,...t}){return p.jsx("div",{"data-slot":"card-header",className:ze("gap-1 rounded-t-lg px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",e),...t})}function Pje({className:e,...t}){return p.jsx("div",{"data-slot":"card-title",className:ze("text-sm font-medium",e),...t})}function Fd({className:e,...t}){return p.jsx("div",{"data-slot":"card-content",className:ze("px-4 group-data-[size=sm]/card:px-3",e),...t})}const ble=C.createContext(null);function Mje({children:e}){const[t,n]=C.useState(null);return p.jsx(ble.Provider,{value:{activeTask:t,setActiveTask:n},children:e})}function vle(){const e=C.useContext(ble);if(!e)throw new Error("useDrag must be used within DragProvider");return e}const yle=C.createContext(null);function jje({children:e}){const[t,n]=C.useState(new Set),[r,i]=C.useState(null),a=C.useCallback(u=>{n(d=>{const c=new Set(d);return c.has(u)?c.delete(u):c.add(u),c}),i(u)},[]),s=C.useCallback((u,d)=>{if(!r){n(new Set([u])),i(u);return}const c=d.indexOf(r),m=d.indexOf(u);if(c===-1||m===-1){n(new Set([u])),i(u);return}const[g,_]=c<m?[c,m]:[m,c],x=d.slice(g,_+1);n(b=>{const v=new Set(b);for(const y of x)v.add(y);return v})},[r]),o=C.useCallback(()=>{n(new Set),i(null)},[]),l=C.useCallback(u=>t.has(u),[t]);return p.jsx(yle.Provider,{value:{selectedIds:t,lastSelectedId:r,toggleSelection:a,selectRange:s,clearSelection:o,isSelected:l},children:e})}function _5(){const e=C.useContext(yle);if(!e)throw new Error("useSelection must be used within a SelectionProvider");return e}function Fje(e){return e.match(/\/issue\/([A-Z]+-\d+)/i)?.[1]??null}function _le({task:e,open:t,onOpenChange:n}){const r=MC(),i=KAe(),[a,s]=C.useState(e.title),[o,l]=C.useState(!1),[u,d]=C.useState(e.description||""),[c,m]=C.useState(e.prUrl||""),[g,_]=C.useState(e.linearTicketUrl||"");C.useEffect(()=>{t&&(s(e.title),d(e.description||""),m(e.prUrl||""),_(e.linearTicketUrl||""),l(!1))},[t,e]);const x=()=>{const y={},E=a.trim();if(!E)return;E!==e.title&&(y.title=E);const T=u.trim();T!==(e.description||"")&&(y.description=T);const w=c.trim();w!==(e.prUrl||"")&&(y.prUrl=w||null);const A=g.trim();A!==(e.linearTicketUrl||"")&&(y.linearTicketUrl=A||null,y.linearTicketId=A?Fje(A):null),Object.keys(y).length>0&&r.mutate({taskId:e.id,updates:y}),n(!1)},b=y=>{y.key==="Enter"&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),x())},v=()=>{i.mutate({taskId:e.id,pinned:!e.pinned})};return p.jsx(So,{open:t,onOpenChange:n,children:p.jsxs(wo,{className:"sm:max-w-md",onKeyDown:b,children:[p.jsx(cl,{children:p.jsx(dl,{children:"Task Settings"})}),p.jsxs(Tp,{className:"mt-4",children:[p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"config-title",children:"Title"}),p.jsx(Ht,{id:"config-title",value:a,onChange:y=>s(y.target.value),autoFocus:!0})]}),p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"config-description",children:"Description"}),p.jsx(Lie,{id:"config-description",value:u,onValueChange:d,rows:3})]}),p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"config-pr-url",children:"GitHub PR URL"}),p.jsx(Ht,{id:"config-pr-url",value:c,onChange:y=>m(y.target.value),placeholder:"https://github.com/owner/repo/pull/123"})]}),p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"config-linear-url",children:"Linear Ticket URL"}),p.jsx(Ht,{id:"config-linear-url",value:g,onChange:y=>_(y.target.value),placeholder:"https://linear.app/team/issue/TEAM-123"})]}),p.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[p.jsx(Ar,{id:"config-pinned",checked:e.pinned,onCheckedChange:v,disabled:i.isPending}),p.jsx("label",{htmlFor:"config-pinned",className:"text-sm cursor-pointer",children:"Pin worktree (exclude from bulk cleanup)"})]})]}),p.jsxs(i1,{className:"mt-4 flex-row justify-between sm:justify-between",children:[p.jsx(Be,{variant:"ghost",className:"text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>l(!0),children:"Delete Task"}),p.jsx(JC,{task:e,open:o,onOpenChange:l,onDeleted:()=>n(!1)}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Be,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),p.jsx(Be,{onClick:x,disabled:!a.trim(),children:"Save"})]})]})]})})}function xle({task:e,isDragPreview:t}){const{setActiveTask:n}=vle(),{isSelected:r,toggleSelection:i}=_5(),a=Sa(),s=r(e.id),o=C.useRef(null),[l,u]=C.useState(!1),[d,c]=C.useState(null),[m,g]=C.useState(null),[_,x]=C.useState(!1),b=C.useRef(!1);C.useEffect(()=>{const T=o.current;if(!(!T||t))return _1(hle({element:T,getInitialData:()=>({type:"task",taskId:e.id,status:e.status}),onGenerateDragPreview:({nativeSetDragImage:w})=>{Rje({nativeSetDragImage:w,getOffset:Dje({x:"16px",y:"8px"}),render:({container:A})=>{g(A)}})},onDragStart:()=>{u(!0),n(e),b.current=!0},onDrop:()=>{u(!1),n(null),g(null)}}),tT({element:T,getData:({input:w,element:A})=>{const O={type:"task",taskId:e.id,status:e.status};return gle(O,{input:w,element:A,allowedEdges:["top","bottom"]})},canDrop:({source:w})=>w.data.taskId!==e.id,onDragEnter:({self:w})=>{c(xm(w.data))},onDrag:({self:w})=>{c(xm(w.data))},onDragLeave:()=>{c(null)},onDrop:()=>{c(null)}}))},[e,t,n]);const v=()=>{b.current=!1},y=()=>{if(b.current){b.current=!1;return}a({to:"/tasks/$taskId",params:{taskId:e.id}}),b.current=!1},E=p.jsxs("div",{className:"group/card relative",children:[!t&&p.jsx("div",{className:ze("absolute left-2 top-2 z-20 transition-opacity",s?"opacity-100":"opacity-0 group-hover/card:opacity-100"),onPointerDown:T=>T.stopPropagation(),children:p.jsx(Ar,{checked:s,onCheckedChange:()=>i(e.id)})}),p.jsxs(Ua,{ref:t?void 0:o,onPointerDown:v,onClick:y,className:ze("transition-shadow hover:shadow-md relative cursor-grab active:cursor-grabbing",l&&"opacity-50",s&&"ring-2 ring-primary bg-primary/5"),children:[d&&p.jsx("div",{className:ze("absolute left-0 right-0 h-0.5 bg-primary z-10",d==="top"&&"-top-1",d==="bottom"&&"-bottom-1")}),p.jsxs(Lje,{className:ze("p-3 pb-1 flex flex-row items-start justify-between gap-2",!t&&"pl-8"),children:[p.jsx(Pje,{className:"text-sm font-medium leading-tight flex-1",children:e.title}),!t&&p.jsx("button",{type:"button",className:"shrink-0 p-0.5 -m-0.5 rounded hover:bg-muted transition-colors cursor-pointer",onClick:T=>{T.stopPropagation(),x(!0)},onPointerDown:T=>T.stopPropagation(),children:p.jsx(te,{icon:My,size:14,strokeWidth:2,className:"text-muted-foreground"})})]}),p.jsxs(Fd,{className:"p-3 pt-1",children:[e.description&&p.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:e.description}),p.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-muted-foreground/70",children:[p.jsx(te,{icon:Ds,size:12,strokeWidth:2}),p.jsx("span",{children:e.repoName}),e.prUrl&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted-foreground/30",children:"•"}),p.jsx(te,{icon:Ku,size:12,strokeWidth:2,className:"text-foreground"})]}),e.linearTicketId&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted-foreground/30",children:"•"}),p.jsx(te,{icon:gie,size:12,strokeWidth:2,className:"text-foreground"})]})]})]})]})]});return p.jsxs(p.Fragment,{children:[E,m&&jr.createPortal(p.jsx("div",{className:"w-72 max-w-[90vw]",children:p.jsx(xle,{task:e,isDragPreview:!0})}),m),p.jsx(_le,{task:e,open:_,onOpenChange:x})]})}const Bje={IN_PROGRESS:"border-t-status-in-progress",IN_REVIEW:"border-t-status-in-review",DONE:"border-t-status-done",CANCELED:"border-t-status-canceled"};function uG({status:e,tasks:t,isMobile:n}){const{t:r}=Ct("common"),i=C.useRef(null),[a,s]=C.useState(!1),o=[...t].sort((l,u)=>new Date(u.updatedAt).getTime()-new Date(l.updatedAt).getTime());return C.useEffect(()=>{const l=i.current;if(l)return tT({element:l,getData:()=>({type:"column",status:e}),canDrop:({source:u})=>u.data.type==="task",onDragEnter:()=>s(!0),onDragLeave:()=>s(!1),onDrop:()=>s(!1)})},[e]),p.jsxs("div",{ref:i,className:ze("flex flex-col rounded-lg border border-t-4 bg-card",n?"h-full w-full":"h-full w-72 min-w-52 flex-shrink",Bje[e],a&&"ring-2 ring-primary ring-offset-2 ring-offset-background"),children:[!n&&p.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[p.jsx("h3",{className:"text-sm font-medium",children:r(`statuses.${e}`)}),p.jsx("span",{className:"flex h-5 min-w-5 items-center justify-center rounded-full bg-muted px-1.5 text-xs font-medium",children:t.length})]}),p.jsx(Bg,{className:"min-h-0 flex-1",children:p.jsx("div",{className:"flex flex-col gap-2 p-2",children:o.map(l=>p.jsx(xle,{task:l},l.id))})})]})}function Uje(){const{selectedIds:e,clearSelection:t}=_5(),n=qAe(),{data:r=[]}=PC(),[i,a]=C.useState(!0),s=e.size,{pinnedCount:o,unpinnedWithWorktreeCount:l}=C.useMemo(()=>{const c=r.filter(m=>e.has(m.id));return{pinnedCount:c.filter(m=>m.pinned).length,unpinnedWithWorktreeCount:c.filter(m=>!m.pinned&&m.worktreePath).length}},[r,e]),u=l>0,d=()=>{n.mutate({ids:Array.from(e),deleteLinkedWorktrees:i},{onSuccess:()=>{t()}})};return s===0?null:p.jsx("div",{className:ze("fixed inset-x-0 bottom-0 z-40 border-t bg-background/95 backdrop-blur-sm","animate-in slide-in-from-bottom-2 duration-200"),children:p.jsxs("div",{className:"mx-auto flex max-w-7xl items-center justify-between gap-4 px-4 py-3",children:[p.jsxs("span",{className:"text-sm text-muted-foreground",children:[s," task",s!==1?"s":""," selected"]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Be,{variant:"ghost",size:"sm",onClick:t,children:"Clear"}),p.jsxs(lc,{children:[p.jsx(ele,{render:p.jsx(Be,{variant:"destructive",size:"sm",disabled:n.isPending}),children:n.isPending?"Deleting...":"Delete"}),p.jsxs(uc,{children:[p.jsxs(cc,{children:[p.jsxs(fc,{children:["Delete ",s," Task",s!==1?"s":""]}),p.jsxs(pc,{children:["This will permanently delete ",s," task",s!==1?"s":"",". This action cannot be undone."]}),o>0&&p.jsxs("p",{className:"flex items-center gap-1.5 text-sm text-primary",children:[p.jsx(te,{icon:cS,size:14,strokeWidth:2}),o," pinned worktree",o!==1?"s":""," will be preserved"]})]}),u&&p.jsxs("div",{className:"flex items-center gap-2 py-2",children:[p.jsx(Ar,{id:"bulk-delete-worktrees",checked:i,onCheckedChange:c=>a(c===!0)}),p.jsx("label",{htmlFor:"bulk-delete-worktrees",className:"cursor-pointer text-sm",children:"Also delete linked worktrees"})]}),p.jsxs(dc,{children:[p.jsx(hc,{children:"Cancel"}),p.jsx(qg,{onClick:d,variant:"destructive",disabled:n.isPending,children:n.isPending?"Deleting...":"Delete"})]})]})]})]})]})})}const wO=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED"];function $je({status:e}){const{t}=Ct("common"),n=C.useRef(null),[r,i]=C.useState(!1);return C.useEffect(()=>{const a=n.current;if(a)return tT({element:a,getData:()=>({type:"column",status:e}),canDrop:({source:s})=>s.data.type==="task",onDragEnter:()=>i(!0),onDragLeave:()=>i(!1),onDrop:()=>i(!1)})},[e]),p.jsx("div",{ref:n,className:ze("flex-1 rounded-lg border-2 border-dashed px-3 py-2 text-center text-xs font-medium transition-colors",r?"border-primary bg-primary/10 text-primary":"border-muted-foreground/30 text-muted-foreground"),children:t(`statuses.${e}`)})}function zje({repoFilter:e,searchQuery:t}){const{t:n}=Ct("common"),{data:r=[],isLoading:i}=PC(),a=WAe(),{activeTask:s}=vle(),{clearSelection:o,selectedIds:l}=_5(),[u,d]=C.useState("IN_PROGRESS");C.useEffect(()=>{const g=_=>{_.key==="Escape"&&l.size>0&&o()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[o,l.size]);const c=C.useMemo(()=>{let g=r;return e&&(g=g.filter(_=>_.repoName===e)),t?.trim()?g=g.map(_=>({task:_,score:Math.max(ts(_.title,t),ts(_.description||"",t),ts(_.branch||"",t),ts(_.linearTicketId||"",t),ts(_.prUrl||"",t))})).filter(({score:_})=>_>0).sort((_,x)=>x.score-_.score).map(({task:_})=>_):g=[...g].sort((_,x)=>new Date(x.updatedAt).getTime()-new Date(_.updatedAt).getTime()),g},[r,e,t]),m=C.useMemo(()=>{const g={IN_PROGRESS:0,IN_REVIEW:0,DONE:0,CANCELED:0};for(const _ of c)g[_.status]++;return g},[c]);return C.useEffect(()=>ple({canMonitor:({source:g})=>g.data.type==="task",onDrop:({source:g,location:_})=>{const x=_.current.dropTargets;if(x.length===0)return;const b=g.data.taskId,v=c.find(T=>T.id===b);if(!v)return;const y=x[0],E=y.data;if(E.type==="column"){const T=E.status;if(T!==v.status){const w=c.filter(A=>A.status===T);a.mutate({taskId:b,status:T,position:w.length})}}else if(E.type==="task"){const T=xm(y.data),w=E.status,A=c.filter(N=>N.status===w).sort((N,D)=>N.position-D.position),O=A.findIndex(N=>N.id===E.taskId);let R=O;T==="bottom"&&(R=O+1),v.status===w&&A.findIndex(D=>D.id===b)<O&&(R=Math.max(0,R-1)),(v.status!==w||R!==v.position)&&a.mutate({taskId:b,status:w,position:R})}}}),[c,a]),i?p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx("p",{className:"text-muted-foreground",children:"Loading tasks..."})}):p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsx("div",{className:"border-b bg-background lg:hidden",children:p.jsx(Ko,{value:u,onValueChange:g=>d(g),children:p.jsx(Yo,{variant:"line",className:"w-full justify-start px-4",children:wO.map(g=>p.jsxs(Vn,{value:g,className:"gap-1.5",children:[p.jsx("span",{className:"truncate",children:n(`statuses.${g}`)}),p.jsx("span",{className:"text-muted-foreground",children:m[g]})]},g))})})}),p.jsx("div",{className:"hidden h-full justify-center gap-4 overflow-x-auto p-4 lg:flex",children:wO.map(g=>p.jsx(uG,{status:g,tasks:c.filter(_=>_.status===g)},g))}),p.jsx("div",{className:"flex-1 overflow-y-auto p-4 lg:hidden",children:p.jsx(uG,{status:u,tasks:c.filter(g=>g.status===u),isMobile:!0})}),s&&p.jsx("div",{className:"fixed inset-x-0 bottom-0 flex gap-2 border-t bg-background/95 p-4 backdrop-blur-sm lg:hidden",children:wO.filter(g=>g!==u).map(g=>p.jsx($je,{status:g},g))}),p.jsx(Uje,{})]})}function Hje(e){return p.jsx(jje,{children:p.jsx(Mje,{children:p.jsx(zje,{...e})})})}const Ele=Si("/tasks/")({component:Vje,validateSearch:e=>({repo:typeof e.repo=="string"?e.repo:void 0})});function Vje(){const{t:e}=Ct("tasks"),{data:t=[]}=PC(),{repo:n}=Ele.useSearch(),r=Sa(),[i,a]=C.useState(""),s=C.useCallback(l=>{r({to:"/tasks",search:l?{repo:l}:{},replace:!0})},[r]),o=C.useMemo(()=>{const l=new Set(t.map(u=>u.repoName));return Array.from(l).sort()},[t]);return p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-background px-4 py-2",children:[p.jsxs("div",{className:"relative min-w-0 flex-1 sm:max-w-64 sm:flex-none",children:[p.jsx(te,{icon:jg,size:12,strokeWidth:2,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),p.jsx(Ht,{value:i,onChange:l=>a(l.target.value),placeholder:e("searchPlaceholder"),className:"w-full pl-6"})]}),p.jsxs(mi,{value:n??"",onValueChange:l=>s(l||null),children:[p.jsxs(bi,{size:"sm",className:"shrink-0 gap-1.5",children:[p.jsx(te,{icon:uS,size:12,strokeWidth:2,className:"text-muted-foreground"}),p.jsx(gi,{children:n??e("allRepos")})]}),p.jsxs(vi,{className:"min-w-[160px]",children:[p.jsx(gn,{value:"",children:e("allRepos")}),o.map(l=>p.jsx(gn,{value:l,children:l},l))]})]})]}),p.jsx("div",{className:"flex-1 overflow-hidden",children:p.jsx(Hje,{repoFilter:n??null,searchQuery:i})})]})}function ao({className:e,size:t="default",...n}){return p.jsx(fAe,{"data-slot":"switch","data-size":t,className:ze("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-[16.6px] data-[size=default]:w-[28px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:p.jsx(pAe,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-3.5 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}function Wje(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Gje(e,t=[]){let n=[];function r(a,s){const o=C.createContext(s),l=n.length;n=[...n,s];const u=c=>{const{scope:m,children:g,..._}=c,x=m?.[e]?.[l]||o,b=C.useMemo(()=>_,Object.values(_));return p.jsx(x.Provider,{value:b,children:g})};u.displayName=a+"Provider";function d(c,m){const g=m?.[e]?.[l]||o,_=C.useContext(g);if(_)return _;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${a}\``)}return[u,d]}const i=()=>{const a=n.map(s=>C.createContext(s));return function(o){const l=o?.[e]||a;return C.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,qje(i,...t)]}function qje(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:l,scopeName:u})=>{const c=l(a)[`__scope${u}`];return{...o,...c}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Yy=globalThis?.document?C.useLayoutEffect:()=>{},Kje=Qw[" useInsertionEffect ".trim().toString()]||Yy;function Yje({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,s]=Xje({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:i;{const d=C.useRef(e!==void 0);C.useEffect(()=>{const c=d.current;c!==o&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${o?"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.`),d.current=o},[o,r])}const u=C.useCallback(d=>{if(o){const c=Zje(d)?d(e):d;c!==e&&s.current?.(c)}else a(d)},[o,e,a,s]);return[l,u]}function Xje({defaultProp:e,onChange:t}){const[n,r]=C.useState(e),i=C.useRef(n),a=C.useRef(t);return Kje(()=>{a.current=t},[t]),C.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Zje(e){return typeof e=="function"}function cG(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Sle(...e){return t=>{let n=!1;const r=e.map(i=>{const a=cG(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():cG(e[i],null)}}}}function wle(...e){return C.useCallback(Sle(...e),e)}function Qje(e){const t=Jje(e),n=C.forwardRef((r,i)=>{const{children:a,...s}=r,o=C.Children.toArray(a),l=o.find(t5e);if(l){const u=l.props.children,d=o.map(c=>c===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:c);return p.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,d):null})}return p.jsx(t,{...s,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function Jje(e){const t=C.forwardRef((n,r)=>{const{children:i,...a}=n;if(C.isValidElement(i)){const s=r5e(i),o=n5e(a,i.props);return i.type!==C.Fragment&&(o.ref=r?Sle(r,s):s),C.cloneElement(i,o)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var e5e=Symbol("radix.slottable");function t5e(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===e5e}function n5e(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{const l=a(...o);return i(...o),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function r5e(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 i5e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],x5=i5e.reduce((e,t)=>{const n=Qje(`Primitive.${t}`),r=C.forwardRef((i,a)=>{const{asChild:s,...o}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...o,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function a5e(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var Cle=e=>{const{present:t,children:n}=e,r=s5e(t),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),a=wle(r.ref,o5e(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:a}):null};Cle.displayName="Presence";function s5e(e){const[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),a=C.useRef("none"),s=e?"mounted":"unmounted",[o,l]=a5e(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=Fx(r.current);a.current=o==="mounted"?u:"none"},[o]),Yy(()=>{const u=r.current,d=i.current;if(d!==e){const m=a.current,g=Fx(u);e?l("MOUNT"):g==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&m!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Yy(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,c=g=>{const x=Fx(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&x&&(l("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=g=>{g.target===t&&(a.current=Fx(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:C.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Fx(e){return e?.animationName||"none"}function o5e(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 l5e=Qw[" useId ".trim().toString()]||(()=>{}),u5e=0;function c5e(e){const[t,n]=C.useState(l5e());return Yy(()=>{n(r=>r??String(u5e++))},[e]),e||(t?`radix-${t}`:"")}var nT="Collapsible",[d5e]=Gje(nT),[f5e,E5]=d5e(nT),Tle=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:s,...o}=e,[l,u]=Yje({prop:r,defaultProp:i??!1,onChange:s,caller:nT});return p.jsx(f5e,{scope:n,disabled:a,contentId:c5e(),open:l,onOpenToggle:C.useCallback(()=>u(d=>!d),[u]),children:p.jsx(x5.div,{"data-state":w5(l),"data-disabled":a?"":void 0,...o,ref:t})})});Tle.displayName=nT;var Ale="CollapsibleTrigger",kle=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=E5(Ale,n);return p.jsx(x5.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":w5(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Wje(e.onClick,i.onOpenToggle)})});kle.displayName=Ale;var S5="CollapsibleContent",Ole=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=E5(S5,e.__scopeCollapsible);return p.jsx(Cle,{present:n||i.open,children:({present:a})=>p.jsx(p5e,{...r,ref:t,present:a})})});Ole.displayName=S5;var p5e=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...a}=e,s=E5(S5,n),[o,l]=C.useState(r),u=C.useRef(null),d=wle(t,u),c=C.useRef(0),m=c.current,g=C.useRef(0),_=g.current,x=s.open||o,b=C.useRef(x),v=C.useRef(void 0);return C.useEffect(()=>{const y=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(y)},[]),Yy(()=>{const y=u.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const E=y.getBoundingClientRect();c.current=E.height,g.current=E.width,b.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),l(r)}},[s.open,r]),p.jsx(x5.div,{"data-state":w5(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!x,...a,ref:d,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:x&&i})});function w5(e){return e?"open":"closed"}var h5e=Tle;const Rle=h5e,Nle=kle,Ile=Ole,m5e=Si("/settings/")({component:g5e});function Mu({title:e,children:t}){return p.jsxs("div",{className:"relative rounded-lg border border-border bg-card p-4 pt-6",children:[p.jsx("span",{className:"absolute -top-2.5 left-3 rounded bg-card px-2 text-xs font-medium text-muted-foreground",children:e}),t]})}function g5e(){const{t:e}=Ct("settings"),{t}=Ct("common"),n=typeof window<"u"&&window.parent!==window,{data:r,isLoading:i}=jae(),{data:a,isLoading:s}=Hj(),{data:o,isLoading:l}=u1(),{data:u,isLoading:d}=c1(),{data:c,isLoading:m}=d1(),{data:g,isLoading:_}=ike(),{data:x,isLoading:b}=ake(),{data:v,isLoading:y}=Vj(),{data:E,isLoading:T}=Wj(),{data:w,isLoading:A}=Fae(),{data:O,isLoading:R}=Bae(),{data:N,isLoading:D}=dke(),{data:L,isLoading:U}=hke(),{data:M,isLoading:W}=Coe(),z=jPe(),{data:H}=gke(),q=bke(),{savedLanguage:K,changeLanguage:$}=Vae(),{theme:j,syncClaudeCode:F,changeTheme:G}=Ooe(),{data:V}=lke(),{data:J}=uke(),{version:ae}=vke(),se=Uae(),Z=cke(),Y=fke(),Q=mke(),re=pke(),[oe,ee]=C.useState(""),[ve,Ee]=C.useState(""),[me,Se]=C.useState("vscode"),[xe,Ye]=C.useState(""),[Ue,je]=C.useState(""),[we,Ne]=C.useState(""),[_e,pe]=C.useState(""),[Ae,he]=C.useState("claude"),[Oe,ge]=C.useState(null),[Ie,We]=C.useState("build"),[mt,lt]=C.useState("plan"),[dt,$e]=C.useState(!1),[ht,Re]=C.useState(!1),[de,Te]=C.useState(!0),[Ke,st]=C.useState(!0),[Bt,zt]=C.useState(!0),[Mt,bt]=C.useState(!1),[en,Wt]=C.useState(!1),[St,Xt]=C.useState(""),[De,yt]=C.useState(!1),[nt,_n]=C.useState(""),[Bn,ar]=C.useState(!1),[sr,ca]=C.useState(""),[Rr,Hr]=C.useState(""),[gr,Nr]=C.useState(!1),[Va,da]=C.useState(""),[hs,oh]=C.useState("glm-4.5-air"),[pu,yl]=C.useState("glm-4.7"),[ko,zs]=C.useState("glm-4.7"),[Vi,_l]=C.useState(""),[Ai,Ir]=C.useState(""),[Vr,ki]=C.useState(!1),[Oi,Wa]=C.useState("light-ansi"),[Nc,hu]=C.useState("dark-ansi"),[xl,rf]=C.useState(!1),[Hs,Vs]=C.useState(!1),[fa,Wi]=C.useState(!1),mu=C.useRef(null);C.useEffect(()=>{r!==void 0&&ee(String(r)),a!==void 0&&Ee(a),o!==void 0&&Se(o),u!==void 0&&Ye(u),c!==void 0&&je(String(c)),g!==void 0&&Ne(g),x!==void 0&&pe(x),v!==void 0&&he(v),E!==void 0&&ge(E),w!==void 0&&We(w),O!==void 0&&lt(O)},[r,a,o,u,c,g,x,v,E,w,O]),C.useEffect(()=>{N&&(Te(N.enabled),st(N.toast?.enabled??!0),zt(N.desktop?.enabled??!0),bt(N.sound?.enabled??!1),Vs(!!N.sound?.customSoundFile),Wt(N.slack?.enabled??!1),Xt(N.slack?.webhookUrl??""),yt(N.discord?.enabled??!1),_n(N.discord?.webhookUrl??""),ar(N.pushover?.enabled??!1),ca(N.pushover?.appToken??""),Hr(N.pushover?.userKey??""))},[N]),C.useEffect(()=>{L&&(Nr(L.enabled),da(L.apiKey??""),oh(L.haikuModel),yl(L.sonnetModel),zs(L.opusModel))},[L]),C.useEffect(()=>{M?.cloudflareApiToken!==void 0&&_l(M.cloudflareApiToken??""),M?.cloudflareAccountId!==void 0&&Ir(M.cloudflareAccountId??"")},[M]),C.useEffect(()=>{F!==void 0&&ki(F),V!==void 0&&Wa(V),J!==void 0&&hu(J)},[F,V,J]);const Zt=i||s||l||d||m||_||b||y||T||A||R||D||U||W,Ic=L&&(gr!==L.enabled||Va!==(L.apiKey??"")||hs!==L.haikuModel||pu!==L.sonnetModel||ko!==L.opusModel),gu=Vr!==(F??!1)||Oi!==V||Nc!==J,Oo=(()=>{const He=M?.cloudflareApiToken??"",jt=M?.cloudflareAccountId??"",Gi=Vi!==He&&!Vi.match(/^•+$/),ma=Ai!==jt&&!Ai.match(/^•+$/);return Gi||ma})(),Dc=N&&(de!==N.enabled||Ke!==(N.toast?.enabled??!0)||Bt!==(N.desktop?.enabled??!0)||Mt!==(N.sound?.enabled??!1)||en!==(N.slack?.enabled??!1)||St!==(N.slack?.webhookUrl??"")||De!==(N.discord?.enabled??!1)||nt!==(N.discord?.webhookUrl??"")||Bn!==(N.pushover?.enabled??!1)||sr!==(N.pushover?.appToken??"")||Rr!==(N.pushover?.userKey??"")),pa=me!==o||xe!==u||Ue!==String(c),af=Ae!==v||Oe!==(E??null)||Ie!==w||mt!==O,lh=oe!==String(r)||ve!==a||we!==g||_e!==x||af||pa||Dc||Ic||gu||Oo,sf=async()=>{const He=[];if(oe!==String(r)){const jt=parseInt(oe,10);!isNaN(jt)&&jt>=1&&jt<=65535&&He.push(new Promise(Gi=>{se.mutate({key:sn.PORT,value:jt},{onSettled:Gi})}))}if(ve!==a&&He.push(new Promise(jt=>{se.mutate({key:sn.DEFAULT_GIT_REPOS_DIR,value:ve},{onSettled:jt})})),me!==o&&He.push(new Promise(jt=>{se.mutate({key:sn.EDITOR_APP,value:me},{onSettled:jt})})),xe!==u&&He.push(new Promise(jt=>{se.mutate({key:sn.EDITOR_HOST,value:xe},{onSettled:jt})})),Ue!==String(c)){const jt=parseInt(Ue,10);!isNaN(jt)&&jt>=1&&jt<=65535&&He.push(new Promise(Gi=>{se.mutate({key:sn.EDITOR_SSH_PORT,value:jt},{onSettled:Gi})}))}if(we!==g&&He.push(new Promise(jt=>{se.mutate({key:sn.LINEAR_API_KEY,value:we},{onSettled:jt})})),_e!==x&&He.push(new Promise(jt=>{se.mutate({key:sn.GITHUB_PAT,value:_e},{onSettled:jt})})),Ae!==v&&He.push(new Promise(jt=>{se.mutate({key:sn.DEFAULT_AGENT,value:Ae},{onSettled:jt})})),Oe!==(E??null)&&He.push(new Promise(jt=>{se.mutate({key:sn.OPENCODE_MODEL,value:Oe},{onSettled:jt})})),Ie!==w&&He.push(new Promise(jt=>{se.mutate({key:sn.OPENCODE_DEFAULT_AGENT,value:Ie},{onSettled:jt})})),mt!==O&&He.push(new Promise(jt=>{se.mutate({key:sn.OPENCODE_PLAN_AGENT,value:mt},{onSettled:jt})})),Dc&&He.push(new Promise(jt=>{Y.mutate({enabled:de,toast:{enabled:Ke},desktop:{enabled:Bt},sound:{enabled:Mt},slack:{enabled:en,webhookUrl:St},discord:{enabled:De,webhookUrl:nt},pushover:{enabled:Bn,appToken:sr,userKey:Rr}},{onSettled:jt})})),Ic&&He.push(new Promise(jt=>{Q.mutate({enabled:gr,apiKey:Va||null,haikuModel:hs,sonnetModel:pu,opusModel:ko},{onSettled:jt})})),gu&&(Vr!==(F??!1)&&He.push(new Promise(jt=>{se.mutate({key:sn.SYNC_CLAUDE_CODE_THEME,value:Vr},{onSettled:jt})})),Oi!==V&&He.push(new Promise(jt=>{se.mutate({key:sn.CLAUDE_CODE_LIGHT_THEME,value:Oi},{onSettled:jt})})),Nc!==J&&He.push(new Promise(jt=>{se.mutate({key:sn.CLAUDE_CODE_DARK_THEME,value:Nc},{onSettled:jt})}))),Oo){const jt=M?.cloudflareApiToken??"",Gi=M?.cloudflareAccountId??"",ma={};Vi!==jt&&!Vi.match(/^•+$/)&&(ma.cloudflareApiToken=Vi||null),Ai!==Gi&&!Ai.match(/^•+$/)&&(ma.cloudflareAccountId=Ai||null),Object.keys(ma).length>0&&He.push(new Promise(Do=>{z.mutate(ma,{onSettled:Do})}))}await Promise.all(He),Re(!0),setTimeout(()=>Re(!1),2e3)},El=()=>{Z.mutate(sn.PORT,{onSuccess:He=>{He.value!==null&&ee(String(He.value))}})},uh=()=>{Z.mutate(sn.DEFAULT_GIT_REPOS_DIR,{onSuccess:He=>{He.value&&Ee(String(He.value))}})},vt=()=>{Z.mutate(sn.EDITOR_APP,{onSuccess:He=>{He.value!==null&&He.value!==void 0&&Se(He.value)}})},Dt=()=>{Z.mutate(sn.EDITOR_HOST,{onSuccess:He=>{Ye(He.value!==null&&He.value!==void 0?String(He.value):"")}})},tn=()=>{Z.mutate(sn.EDITOR_SSH_PORT,{onSuccess:He=>{He.value!==null&&He.value!==void 0&&je(String(He.value))}})},Yn=()=>{Z.mutate(sn.LINEAR_API_KEY,{onSuccess:He=>{Ne(He.value!==null&&He.value!==void 0?String(He.value):"")}})},br=()=>{Z.mutate(sn.GITHUB_PAT,{onSuccess:He=>{pe(He.value!==null&&He.value!==void 0?String(He.value):"")}})},Fr=()=>{Z.mutate(sn.DEFAULT_AGENT,{onSuccess:He=>{he(He.value??"claude")}})},Ro=()=>{Z.mutate(sn.OPENCODE_MODEL,{onSuccess:He=>{ge(He.value!==null&&He.value!==void 0?String(He.value):null)}})},No=()=>{Z.mutate(sn.OPENCODE_DEFAULT_AGENT,{onSuccess:He=>{We(He.value??"build")}})},Io=()=>{Z.mutate(sn.OPENCODE_PLAN_AGENT,{onSuccess:He=>{lt(He.value??"plan")}})},ha=async He=>{re.mutate(He,{onSuccess:jt=>{jt.success?Et.success(e("notifications.testSuccess",{channel:He})):Et.error(e("notifications.testFailed",{channel:He,error:jt.error}))},onError:jt=>{Et.error(e("notifications.testFailed",{channel:He,error:jt.message}))}})},ch=async He=>{const jt=He.target.files?.[0];if(jt){Wi(!0);try{const Gi=new FormData;Gi.append("file",jt);const ma=await fetch("/api/uploads/sound",{method:"POST",body:Gi});if(!ma.ok){const Do=await ma.json();throw new Error(Do.error||"Upload failed")}Vs(!0),Et.success(e("notifications.soundUploaded"))}catch(Gi){Et.error(e("notifications.soundUploadFailed",{error:Gi instanceof Error?Gi.message:"Unknown error"}))}finally{Wi(!1),mu.current&&(mu.current.value="")}}},bb=async()=>{try{if(!(await fetch("/api/uploads/sound",{method:"DELETE"})).ok)throw new Error("Delete failed");Vs(!1),Et.success(e("notifications.soundDeleted"))}catch{Et.error(e("notifications.soundDeleteFailed"))}};return p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-background px-4 py-2",children:[p.jsx("h1",{className:"text-sm font-medium",children:e("title")}),ae&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",ae]})]}),p.jsx("div",{className:"flex-1 overflow-auto p-6",children:p.jsxs("div",{className:"mx-auto max-w-5xl space-y-4",children:[p.jsx(Mu,{title:e("sections.server"),children:p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.port.label")}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ht,{type:"number",min:1,max:65535,value:oe,onChange:He=>ee(He.target.value),placeholder:"7777",disabled:Zt,className:"w-24 font-mono text-sm"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:El,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.port.description")})]})}),p.jsx(Mu,{title:e("sections.paths"),children:p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.gitReposDir.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsx(Ht,{value:ve,onChange:He=>Ee(He.target.value),placeholder:"~/projects",disabled:Zt,className:"flex-1 font-mono text-sm"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>$e(!0),disabled:Zt,title:t("buttons.browse"),children:p.jsx(te,{icon:Ba,size:14,strokeWidth:2})}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:uh,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.gitReposDir.description")})]})}),p.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[p.jsx(Mu,{title:e("sections.editor"),children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.editor.app.label")}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(mi,{value:me,onValueChange:He=>Se(He),children:[p.jsx(bi,{className:"w-32",children:p.jsx(gi,{})}),p.jsxs(vi,{children:[p.jsx(gn,{value:"vscode",children:"VS Code"}),p.jsx(gn,{value:"cursor",children:"Cursor"}),p.jsx(gn,{value:"windsurf",children:"Windsurf"}),p.jsx(gn,{value:"zed",children:"Zed"}),p.jsx(gn,{value:"antigravity",children:"Antigravity"})]})]}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:vt,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.editor.app.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.editor.host.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsx(Ht,{value:xe,onChange:He=>Ye(He.target.value),placeholder:e("fields.editor.host.placeholder"),disabled:Zt,className:"flex-1 font-mono text-sm"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Dt,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.editor.host.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.editor.sshPort.label")}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ht,{type:"number",min:1,max:65535,value:Ue,onChange:He=>je(He.target.value),placeholder:"22",disabled:Zt,className:"w-20 font-mono text-sm"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:tn,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.editor.sshPort.description")})]})]})}),p.jsx(Mu,{title:e("sections.integrations"),children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.linear.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Ht,{type:"password",value:we,onChange:He=>Ne(He.target.value),placeholder:"lin_api_...",disabled:Zt,className:"flex-1 pr-8 font-mono text-sm"}),!!g&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Yn,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.linear.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.github.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Ht,{type:"password",value:_e,onChange:He=>pe(He.target.value),placeholder:"ghp_...",disabled:Zt,className:"flex-1 pr-8 font-mono text-sm"}),!!x&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:br,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.github.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.cloudflare.label")}),p.jsx("div",{className:"flex flex-1 items-center gap-2",children:p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Ht,{type:"password",value:Vi,onChange:He=>_l(He.target.value),placeholder:e("fields.cloudflare.placeholder"),disabled:Zt,className:"flex-1 pr-8 font-mono text-sm"}),!!M?.cloudflareApiToken&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]})})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.cloudflare.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:"Account ID"}),p.jsx("div",{className:"flex flex-1 items-center gap-2",children:p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Ht,{type:"password",value:Ai,onChange:He=>Ir(He.target.value),placeholder:"CF Account ID",disabled:Zt,className:"flex-1 pr-8 font-mono text-sm"}),!!M?.cloudflareAccountId&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]})})]}),p.jsxs("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:["Required for Cloudflare Tunnel. Find in your dashboard URL: dash.cloudflare.com/","<account_id>","/..."]})]})]})})]}),p.jsx(Mu,{title:e("sections.zai"),children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.zai.enable")}),p.jsx(ao,{checked:gr,onCheckedChange:Nr,disabled:Zt})]}),gr&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.zai.apiKey")}),p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Ht,{type:"password",value:Va,onChange:He=>da(He.target.value),placeholder:"zai_...",disabled:Zt,className:"flex-1 pr-8 font-mono text-sm"}),!!L?.apiKey&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.zai.description")})]}),p.jsxs("div",{className:"space-y-3 border-t border-border pt-4",children:[p.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("fields.zai.modelMappings")}),p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.zai.haiku")}),p.jsx(Ht,{value:hs,onChange:He=>oh(He.target.value),placeholder:"glm-4.5-air",disabled:Zt,className:"flex-1 font-mono text-sm"})]}),p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.zai.sonnet")}),p.jsx(Ht,{value:pu,onChange:He=>yl(He.target.value),placeholder:"glm-4.7",disabled:Zt,className:"flex-1 font-mono text-sm"})]}),p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.zai.opus")}),p.jsx(Ht,{value:ko,onChange:He=>zs(He.target.value),placeholder:"glm-4.7",disabled:Zt,className:"flex-1 font-mono text-sm"})]})]})]})]})}),p.jsxs(Mu,{title:e("sections.agent"),children:[p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.agent.default.label")}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(mi,{value:Ae,onValueChange:He=>he(He),children:[p.jsx(bi,{className:"w-40",children:p.jsx(gi,{})}),p.jsx(vi,{children:Object.keys(il).map(He=>p.jsx(gn,{value:He,children:il[He]},He))})]}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Fr,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.agent.default.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.agent.opencodeModel.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsx(Gj,{value:Oe,onChange:ge,placeholder:e("fields.agent.opencodeModel.placeholder"),className:"w-64"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Ro,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.agent.opencodeModel.description")})]})]}),p.jsxs(Rle,{className:"mt-4 space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start",children:[p.jsxs(Nle,{className:"group flex cursor-pointer items-center gap-1.5 text-left text-sm text-muted-foreground transition-colors hover:text-foreground sm:w-32 sm:shrink-0",children:[p.jsx(te,{icon:Mg,size:12,strokeWidth:2,className:"shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180"}),p.jsx("span",{children:e("fields.agent.advancedAgentNames.label")})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:pt-0.5",children:e("fields.agent.advancedAgentNames.description")})]}),p.jsxs(Ile,{className:"space-y-4 pt-2 sm:ml-32 sm:pl-2",children:[p.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-500/20 bg-amber-500/10 p-3",children:[p.jsx(te,{icon:ai,size:16,strokeWidth:2,className:"mt-0.5 shrink-0 text-amber-600 dark:text-amber-400"}),p.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:e("fields.agent.advancedAgentNames.warning")})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.agent.opencodeDefaultAgent.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsx(Ht,{value:Ie??"build",onChange:He=>We(He.target.value),placeholder:"build",disabled:Zt,className:"font-mono text-sm"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:No,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.agent.opencodeDefaultAgent.description")})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.agent.opencodePlanAgent.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsx(Ht,{value:mt??"plan",onChange:He=>lt(He.target.value),placeholder:"plan",disabled:Zt,className:"font-mono text-sm"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Io,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.agent.opencodePlanAgent.description")})]})]})]})]}),p.jsx(Mu,{title:e("sections.notifications"),children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-40 sm:shrink-0",children:e("notifications.enable")}),p.jsx(ao,{checked:de,onCheckedChange:Te,disabled:Zt})]}),p.jsxs("div",{className:"space-y-2 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ao,{checked:Ke,onCheckedChange:st,disabled:Zt||!de}),p.jsx("label",{className:"text-sm text-muted-foreground",children:e("notifications.toast")})]}),p.jsx("p",{className:"ml-10 text-xs text-muted-foreground",children:e("notifications.toastDescription")})]}),p.jsxs("div",{className:"space-y-2 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ao,{checked:Bt,onCheckedChange:zt,disabled:Zt||!de}),p.jsx("label",{className:"text-sm text-muted-foreground",children:e("notifications.desktop")})]}),p.jsx("p",{className:"ml-10 text-xs text-muted-foreground",children:e("notifications.desktopDescription")})]}),p.jsxs("div",{className:"space-y-2 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ao,{checked:Mt,onCheckedChange:bt,disabled:Zt||!de}),p.jsx("label",{className:"text-sm text-muted-foreground",children:e("notifications.sound")}),p.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[p.jsx("input",{ref:mu,type:"file",accept:"audio/mpeg,audio/mp3,audio/wav,audio/ogg",className:"hidden",onChange:ch}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>mu.current?.click(),disabled:Zt||!de||!Mt||fa,title:e("notifications.uploadSound"),children:fa?p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin"}):p.jsx(te,{icon:KSe,size:14,strokeWidth:2})}),Hs&&p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:bb,disabled:Zt||!de||!Mt,title:e("notifications.deleteSound"),children:p.jsx(te,{icon:rl,size:14,strokeWidth:2})}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>ha("sound"),disabled:Zt||!de||!Mt||re.isPending,title:e("notifications.testSound"),children:re.isPending?p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin"}):p.jsx(te,{icon:Sx,size:14,strokeWidth:2})})]})]}),Hs&&p.jsx("p",{className:"ml-10 text-xs text-muted-foreground",children:e("notifications.customSoundActive")})]}),p.jsxs("div",{className:"space-y-2 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ao,{checked:en,onCheckedChange:Wt,disabled:Zt||!de}),p.jsx("label",{className:"text-sm text-muted-foreground",children:e("notifications.slack")}),p.jsx(Be,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>ha("slack"),disabled:Zt||!de||!en||!St||re.isPending,title:e("notifications.slack"),children:re.isPending?p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin"}):p.jsx(te,{icon:Sx,size:14,strokeWidth:2})})]}),en&&p.jsxs("div",{className:"relative ml-6",children:[p.jsx(Ht,{type:"password",value:St,onChange:He=>Xt(He.target.value),placeholder:"https://hooks.slack.com/services/...",disabled:Zt||!de,className:"flex-1 pr-8 font-mono text-sm"}),!!N?.slack?.webhookUrl&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]})]}),p.jsxs("div",{className:"space-y-2 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ao,{checked:De,onCheckedChange:yt,disabled:Zt||!de}),p.jsx("label",{className:"text-sm text-muted-foreground",children:e("notifications.discord")}),p.jsx(Be,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>ha("discord"),disabled:Zt||!de||!De||!nt||re.isPending,title:e("notifications.discord"),children:re.isPending?p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin"}):p.jsx(te,{icon:Sx,size:14,strokeWidth:2})})]}),De&&p.jsxs("div",{className:"relative ml-6",children:[p.jsx(Ht,{type:"password",value:nt,onChange:He=>_n(He.target.value),placeholder:"https://discord.com/api/webhooks/...",disabled:Zt||!de,className:"flex-1 pr-8 font-mono text-sm"}),!!N?.discord?.webhookUrl&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]})]}),p.jsxs("div",{className:"space-y-2 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ao,{checked:Bn,onCheckedChange:ar,disabled:Zt||!de}),p.jsx("label",{className:"text-sm text-muted-foreground",children:e("notifications.pushover")}),p.jsx(Be,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>ha("pushover"),disabled:Zt||!de||!Bn||!sr||!Rr||re.isPending,title:e("notifications.pushover"),children:re.isPending?p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin"}):p.jsx(te,{icon:Sx,size:14,strokeWidth:2})})]}),Bn&&p.jsxs("div",{className:"ml-6 space-y-2",children:[p.jsxs("div",{className:"relative",children:[p.jsx(Ht,{type:"password",value:sr,onChange:He=>ca(He.target.value),placeholder:e("notifications.appToken"),disabled:Zt||!de,className:"flex-1 pr-8 font-mono text-sm"}),!!N?.pushover?.appToken&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]}),p.jsxs("div",{className:"relative",children:[p.jsx(Ht,{type:"password",value:Rr,onChange:He=>Hr(He.target.value),placeholder:e("notifications.userKey"),disabled:Zt||!de,className:"flex-1 pr-8 font-mono text-sm"}),!!N?.pushover?.userKey&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]})]})]})]})}),p.jsx(Mu,{title:e("sections.appearance"),children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.language.label")}),p.jsxs(mi,{value:K??"auto",onValueChange:He=>$(He==="auto"?null:He),children:[p.jsx(bi,{className:"w-40",children:p.jsx(gi,{})}),p.jsxs(vi,{children:[p.jsx(gn,{value:"auto",children:e("fields.language.options.auto")}),p.jsx(gn,{value:"en",children:e("fields.language.options.en")}),p.jsx(gn,{value:"zh",children:e("fields.language.options.zh")})]})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.language.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.theme.label")}),p.jsxs(mi,{value:j??"system",onValueChange:He=>G(He),children:[p.jsx(bi,{className:"w-40",children:p.jsx(gi,{})}),p.jsxs(vi,{children:[p.jsx(gn,{value:"system",children:e("fields.theme.options.system")}),p.jsx(gn,{value:"light",children:e("fields.theme.options.light")}),p.jsx(gn,{value:"dark",children:e("fields.theme.options.dark")})]})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.theme.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.syncClaudeTheme.label")}),p.jsx(ao,{checked:Vr,onCheckedChange:ki})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.syncClaudeTheme.description")})]}),Vr&&p.jsxs("div",{className:"space-y-3 border-t border-border pt-4 sm:ml-32 sm:pl-2",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-24 sm:shrink-0",children:e("fields.claudeCodeTheme.light")}),p.jsxs(mi,{value:Oi,onValueChange:He=>Wa(He),children:[p.jsx(bi,{className:"w-40",children:p.jsx(gi,{})}),p.jsx(vi,{children:WV.filter(He=>He.startsWith("light")).map(He=>p.jsx(gn,{value:He,children:e(`fields.claudeCodeTheme.options.${He}`)},He))})]})]}),p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-24 sm:shrink-0",children:e("fields.claudeCodeTheme.dark")}),p.jsxs(mi,{value:Nc,onValueChange:He=>hu(He),children:[p.jsx(bi,{className:"w-40",children:p.jsx(gi,{})}),p.jsx(vi,{children:WV.filter(He=>He.startsWith("dark")).map(He=>p.jsx(gn,{value:He,children:e(`fields.claudeCodeTheme.options.${He}`)},He))})]})]})]})]})}),H?.enabled&&p.jsx(Mu,{title:e("sections.developer"),children:p.jsx("div",{className:"space-y-1",children:p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[p.jsx("div",{className:"flex-1",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:e("developer.restartDescription")})}),p.jsxs(Be,{variant:"outline",size:"sm",onClick:()=>{const He=H?.startedAt;rf(!0),q.mutate(void 0,{onSuccess:()=>{(async()=>{for(let ma=0;ma<120;ma++){await new Promise(Do=>setTimeout(Do,500));try{const Do=await fetch("/api/config/developer-mode");if(Do.ok&&(await Do.json()).startedAt!==He){window.location.reload();return}}catch{}}rf(!1),Et.error(e("developer.restartFailed"),{description:e("developer.checkLogs")})})()},onError:jt=>{rf(!1),Et.error(e("developer.restartFailed"),{description:jt.message})}})},disabled:q.isPending||xl,className:"shrink-0 gap-2",children:[(q.isPending||xl)&&p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin"}),e(xl?"developer.restarting":"developer.restartButton")]})]})})})]})}),p.jsx("div",{className:"shrink-0 border-t border-border bg-background px-6 py-3",children:p.jsxs("div",{className:`mx-auto flex max-w-5xl items-center gap-2 ${n?"justify-start":"justify-end"}`,children:[ht&&p.jsxs("span",{className:"flex items-center gap-1 text-xs text-accent",children:[p.jsx(te,{icon:di,size:12,strokeWidth:2}),t("status.saved")]}),p.jsx(Be,{size:"sm",onClick:sf,disabled:!lh||Zt||se.isPending,children:t("buttons.save")})]})}),p.jsx(bd,{open:dt,onOpenChange:$e,onSelect:He=>Ee(He),initialPath:ve||void 0})]})}const rT="";function b5e(){return ln({queryKey:["github-user"],queryFn:async()=>{const e=await fetch(`${rT}/api/github/user`);return e.ok?e.json():null},staleTime:600*1e3,retry:!1})}function v5e(){return ln({queryKey:["github-orgs"],queryFn:async()=>{const e=await fetch(`${rT}/api/github/orgs`);return e.ok?e.json():[]},staleTime:600*1e3})}function y5e(e,t,n){return ln({queryKey:["github-issues",e,t,n],queryFn:async()=>{const r=new URLSearchParams({filter:e});t&&r.set("viboraReposOnly","true"),n&&r.set("org",n);const i=await fetch(`${rT}/api/github/issues?${r}`);if(!i.ok)throw new Error("Failed to fetch issues");return i.json()},staleTime:300*1e3})}function _5e(e,t,n){return ln({queryKey:["github-prs",e,t,n],queryFn:async()=>{const r=new URLSearchParams({filter:e});t&&r.set("viboraReposOnly","true"),n&&r.set("org",n);const i=await fetch(`${rT}/api/github/prs?${r}`);if(!i.ok)throw new Error("Failed to fetch PRs");return i.json()},staleTime:300*1e3})}function x5e({filter:e,viboraReposOnly:t,org:n}){const{t:r}=Ct("review"),{t:i}=Ct("common"),{data:a,isLoading:s,error:o}=y5e(e,t,n);if(s)return p.jsx("div",{className:"flex h-48 items-center justify-center",children:p.jsx(te,{icon:Ft,size:24,className:"animate-spin text-muted-foreground"})});if(o)return p.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[p.jsx(te,{icon:ai,size:24}),p.jsx("p",{className:"text-sm",children:r("issues.failedToLoad")}),p.jsx("p",{className:"text-xs",children:o.message})]});const l={assigned:"issues.empty.assigned",created:"issues.empty.created",mentioned:"issues.empty.mentioned"};return a?.length?p.jsxs("div",{className:"space-y-4",children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:i(a.length===1?"results.one":"results.other",{count:a.length})}),p.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:a.map(u=>p.jsx(E5e,{issue:u},u.id))})]}):p.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[p.jsx(te,{icon:di,size:24}),p.jsx("p",{className:"text-sm",children:r(l[e])})]})}function E5e({issue:e}){return p.jsx(Ua,{className:"transition-colors hover:border-border/80",children:p.jsx(Fd,{className:"py-4",children:p.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"block space-y-2",children:[p.jsx("div",{className:"flex items-start gap-2",children:p.jsx("span",{className:"line-clamp-2 text-sm font-medium",children:e.title})}),p.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:p.jsxs("span",{className:"font-mono",children:[e.repository.fullName,"#",e.number]})}),e.labels.length>0&&p.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.labels.slice(0,3).map(t=>p.jsx(na,{className:"text-xs",style:{backgroundColor:`#${t.color}20`,color:`#${t.color}`,borderColor:`#${t.color}40`},children:t.name},t.name)),e.labels.length>3&&p.jsxs(na,{variant:"secondary",className:"text-xs",children:["+",e.labels.length-3]})]})]})})})}function S5e({filter:e,viboraReposOnly:t,org:n}){const{t:r}=Ct("review"),{t:i}=Ct("common"),{data:a,isLoading:s,error:o}=_5e(e,t,n);if(s)return p.jsx("div",{className:"flex h-48 items-center justify-center",children:p.jsx(te,{icon:Ft,size:24,className:"animate-spin text-muted-foreground"})});if(o)return p.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[p.jsx(te,{icon:ai,size:24}),p.jsx("p",{className:"text-sm",children:r("prs.failedToLoad")}),p.jsx("p",{className:"text-xs",children:o.message})]});const l={all:"prs.empty.all",created:"prs.empty.created",assigned:"prs.empty.assigned",review_requested:"prs.empty.reviewRequested",mentioned:"prs.empty.mentioned"};return a?.length?p.jsxs("div",{className:"space-y-4",children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:i(a.length===1?"results.one":"results.other",{count:a.length})}),p.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:a.map(u=>p.jsx(w5e,{pr:u},u.id))})]}):p.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[p.jsx(te,{icon:di,size:24}),p.jsx("p",{className:"text-sm",children:r(l[e])})]})}function w5e({pr:e}){const{t}=Ct("review");return p.jsx(Ua,{className:"transition-colors hover:border-border/80",children:p.jsx(Fd,{className:"py-4",children:p.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"block space-y-2",children:[p.jsx("div",{className:"flex items-start gap-2",children:p.jsx("span",{className:"line-clamp-2 text-sm font-medium",children:e.title})}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[p.jsxs("span",{className:"font-mono",children:[e.repository.fullName,"#",e.number]}),e.draft&&p.jsx(na,{variant:"secondary",className:ze("text-xs","bg-muted-foreground/20 text-muted-foreground"),children:t("prs.draft")})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[e.author.avatarUrl&&p.jsx("img",{src:e.author.avatarUrl,alt:e.author.login,className:"h-4 w-4 rounded-full"}),p.jsx("span",{className:"text-xs text-muted-foreground",children:e.author.login})]}),e.labels.length>0&&p.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.labels.slice(0,3).map(n=>p.jsx(na,{className:"text-xs",style:{backgroundColor:`#${n.color}20`,color:`#${n.color}`,borderColor:`#${n.color}40`},children:n.name},n.name)),e.labels.length>3&&p.jsxs(na,{variant:"secondary",className:"text-xs",children:["+",e.labels.length-3]})]})]})})})}const C5e=Si("/review/")({component:T5e});function T5e(){const{t:e}=Ct("review"),[t,n]=C.useState("prs"),[r,i]=C.useState("review_requested"),[a,s]=C.useState("assigned"),[o,l]=C.useState(!1),[u,d]=C.useState(""),{data:c,isLoading:m}=b5e(),{data:g=[]}=v5e();return!m&&!c?p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsx("div",{className:"flex shrink-0 items-center border-b border-border bg-background px-4 py-2"}),p.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:p.jsxs("div",{className:"max-w-md space-y-4 text-center",children:[p.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:p.jsx(te,{icon:$Se,size:24,className:"text-muted-foreground"})}),p.jsx("h2",{className:"text-lg font-medium",children:e("github.tokenRequired")}),p.jsx("p",{className:"text-sm text-muted-foreground",children:e("github.tokenDescription")}),p.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 p-4 text-left",children:[p.jsx("p",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("github.requiredScopes")}),p.jsxs("ul",{className:"space-y-1 text-xs text-muted-foreground",children:[p.jsxs("li",{children:["• ",p.jsx("code",{className:"rounded bg-muted px-1",children:"repo"})," ",e("github.scopes.repo")]}),p.jsxs("li",{children:["• ",p.jsx("code",{className:"rounded bg-muted px-1",children:"read:user"})," ",e("github.scopes.readUser")]}),p.jsxs("li",{children:["• ",p.jsx("code",{className:"rounded bg-muted px-1",children:"read:org"})," ",e("github.scopes.readOrg")]})]})]}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,read:user,read:org&description=Vibora",target:"_blank",rel:"noopener noreferrer",children:p.jsxs(Be,{variant:"outline",size:"sm",className:"w-full",children:[p.jsx(te,{icon:zSe,size:14,"data-slot":"icon"}),e("github.generateToken")]})}),p.jsx(Or,{to:"/settings",children:p.jsx(Be,{size:"sm",className:"w-full",children:e("github.goToSettings")})})]})]})})]}):p.jsx("div",{className:"flex h-full flex-col",children:p.jsxs(Ko,{value:t,onValueChange:_=>n(_),className:"flex flex-1 flex-col overflow-hidden",children:[p.jsxs("div",{className:"flex shrink-0 flex-col border-b border-border bg-background sm:flex-row sm:items-center sm:justify-between",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-1 max-sm:px-2",children:[p.jsxs(Yo,{variant:"line",children:[p.jsx(Vn,{value:"prs",children:e("tabs.pullRequests")}),p.jsx(Vn,{value:"issues",children:e("tabs.issues")})]}),p.jsx("label",{className:"flex cursor-pointer items-center gap-2 text-xs sm:hidden",title:e("filters.viboraReposOnly"),children:p.jsx(ao,{checked:o,onCheckedChange:l,disabled:!!u})})]}),p.jsxs("div",{className:"flex items-center gap-2 border-t border-border px-4 py-1.5 sm:gap-4 sm:border-t-0 sm:px-4 sm:py-1",children:[t==="prs"?p.jsxs(mi,{value:r,onValueChange:_=>i(_),children:[p.jsx(bi,{size:"sm",className:"flex-1 sm:flex-initial",children:p.jsx(gi,{})}),p.jsxs(vi,{children:[p.jsx(gn,{value:"created",children:e("filters.pr.created")}),p.jsx(gn,{value:"assigned",children:e("filters.pr.assigned")}),p.jsx(gn,{value:"review_requested",children:e("filters.pr.reviewRequested")}),p.jsx(gn,{value:"mentioned",children:e("filters.pr.mentioned")})]})]}):p.jsxs(mi,{value:a,onValueChange:_=>s(_),children:[p.jsx(bi,{size:"sm",className:"flex-1 sm:flex-initial",children:p.jsx(gi,{})}),p.jsxs(vi,{children:[p.jsx(gn,{value:"assigned",children:e("filters.issue.assigned")}),p.jsx(gn,{value:"created",children:e("filters.issue.created")}),p.jsx(gn,{value:"mentioned",children:e("filters.issue.mentioned")})]})]}),p.jsxs(mi,{value:u,onValueChange:_=>d(_||""),children:[p.jsx(bi,{size:"sm",className:"flex-1 sm:flex-initial",children:p.jsx(gi,{children:u||e("filters.allOrgs")})}),p.jsxs(vi,{children:[p.jsx(gn,{value:"",children:e("filters.allOrganizations")}),g.map(_=>p.jsx(gn,{value:_.login,children:_.login},_.login))]})]}),p.jsxs("label",{className:"hidden cursor-pointer items-center gap-2 text-xs sm:flex",title:e("filters.viboraReposOnly"),children:[p.jsx(ao,{checked:o,onCheckedChange:l,disabled:!!u}),p.jsx("span",{className:"text-muted-foreground",children:e("filters.viboraReposOnly")})]})]})]}),p.jsx(Kn,{value:"prs",className:"flex-1 overflow-auto p-4",children:p.jsx(S5e,{filter:r,viboraReposOnly:o,org:u||void 0})}),p.jsx(Kn,{value:"issues",className:"flex-1 overflow-auto p-4",children:p.jsx(x5e,{filter:a,viboraReposOnly:o,org:u||void 0})})]})})}const A5e=Si("/repositories/")({beforeLoad:()=>{throw Xl({to:"/projects"})}}),Dle="";function k5e(e){return ln({queryKey:["copier-questions",e],queryFn:()=>pt(`${Dle}/api/copier/questions?source=${encodeURIComponent(e)}`),enabled:!!e,staleTime:300*1e3,retry:!1})}function O5e(){const{data:e,...t}=jC();return{...t,data:e?.filter(n=>n.isCopierTemplate)??[]}}function R5e(){const e=pn();return rn({mutationFn:t=>pt(`${Dle}/api/copier/create`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]}),e.invalidateQueries({queryKey:["projects"]})}})}function dG(e){return e.startsWith("git@")||e.startsWith("https://")||e.startsWith("http://")||e.startsWith("gh:")||e.startsWith("gl:")||e.startsWith("bb:")}function N5e(e){const t=e.replace(/\.git$/,"");if(t.startsWith("git@")){const n=t.match(/:([^/]+\/)?([^/]+)$/);if(n)return n[2]}else if(t.startsWith("gh:")||t.startsWith("gl:")||t.startsWith("bb:")){const n=t.split("/");if(n.length>0)return n[n.length-1]}else{const n=t.split("/");if(n.length>0)return n[n.length-1]}return t}function I5e({open:e,onOpenChange:t,initialTab:n,initialTemplateSource:r}){const{t:i}=Ct("projects"),{t:a}=Ct("repositories"),s=Sa(),{data:o}=Hj(),l=b3e(),u=x3e(),d=E3e(),[c,m]=C.useState("add"),[g,_]=C.useState(""),[x,b]=C.useState(""),[v,y]=C.useState(""),[E,T]=C.useState(null),[w,A]=C.useState(!1),[O,R]=C.useState(!1),[N,D]=C.useState(""),[L,U]=C.useState(null),[M,W]=C.useState(new Set),[z,H]=C.useState(null),[q,K]=C.useState(!1),[$,j]=C.useState(""),[F,G]=C.useState(""),[V,J]=C.useState({}),[ae,se]=C.useState(""),[Z,Y]=C.useState(""),[Q,re]=C.useState(null),[oe,ee]=C.useState(!0),[ve,Ee]=C.useState(!1),[me,Se]=C.useState(new Set),[xe,Ye]=C.useState(""),[Ue,je]=C.useState(!1),{data:we}=O5e(),Ne=$||F,{data:_e,isLoading:pe,error:Ae}=k5e(c==="template"&&Ne?Ne:null),he=R5e();C.useEffect(()=>{e&&(m(r?"template":n||"add"),_(""),b(""),y(""),T(null),D(""),U(null),W(new Set),H(null),j(r??""),G(""),J({}),se(o||""),Y(""),re(null),ee(!0),Se(new Set),Ye(""),je(!1))},[e,n,r,o]);const Oe=C.useMemo(()=>dG(g.trim()),[g]),ge=C.useMemo(()=>Oe?N5e(g.trim()):null,[g,Oe]);C.useEffect(()=>{ge&&!v&&y(ge)},[ge,v]);const Ie=C.useMemo(()=>{if(Oe)return v.trim()||ge||"";const De=g.trim();if(!De||De.endsWith("/"))return"";const yt=De.split("/").pop()||"";return["~",".",".."].includes(yt)?"":yt},[Oe,v,ge,g]);C.useEffect(()=>{Ie&&!Ue&&Ye(Ie)},[Ie,Ue]);const We=x.trim()||o||"",mt=N.trim()||o||"",lt=C.useMemo(()=>{if(!Oe||!We)return null;const De=v.trim()||ge||"";return De?`${We}/${De}`:null},[Oe,We,v,ge]),dt=C.useMemo(()=>L?.filter(De=>!De.hasProject)??[],[L]),$e=l.isPending,ht=u.isPending||d.isPending,Re=he.isPending;C.useEffect(()=>{_e?.questions&&J(De=>{const yt={...De};for(const nt of _e.questions)yt[nt.name]===void 0&&nt.default!==void 0&&(yt[nt.name]=nt.default);return yt})},[_e]),C.useEffect(()=>{o&&!ae&&se(o)},[o,ae]);const de=_e?.questions.filter(De=>{if(De.default!==void 0&&!(typeof De.default=="string"&&De.default.includes("{{")))return!1;const nt=V[De.name];return nt==null||nt===""})??[],Te=Ne&&Z.trim()&&ae.trim()&&!pe&&de.length===0,Ke=async()=>{T(null);const De=g.trim(),yt=xe.trim();if(!(!De||!yt))try{const nt=await l.mutateAsync(Oe?{name:yt,url:De,targetDir:x.trim()||void 0,folderName:v.trim()||void 0}:{name:yt,path:De});t(!1),s({to:"/projects/$projectId",params:{projectId:nt.id}})}catch(nt){T(nt instanceof Error?nt.message:i("newProject.addRepoFailed"))}},st=()=>{H(null),U(null),W(new Set),u.mutate(mt||void 0,{onSuccess:De=>{U(De.repositories);const yt=De.repositories.filter(nt=>!nt.hasProject);W(new Set(yt.map(nt=>nt.path)))},onError:De=>{H(De instanceof Error?De.message:a("bulkAdd.scanFailed"))}})},Bt=De=>{W(yt=>{const nt=new Set(yt);return nt.has(De)?nt.delete(De):nt.add(De),nt})},zt=()=>{W(new Set(dt.map(De=>De.path)))},Mt=()=>{W(new Set)},bt=async()=>{if(M.size===0)return;const De=Array.from(M).map(yt=>{const nt=L?.find(_n=>_n.path===yt);return{path:yt,displayName:nt?.name}});d.mutate(De,{onSuccess:()=>{t(!1)},onError:yt=>{H(yt instanceof Error?yt.message:a("bulkAdd.addFailed"))}})},en=!!$||oe,Wt=()=>{re(null),he.mutate({templateSource:Ne,outputPath:ae,answers:V,projectName:Z,trust:en},{onSuccess:De=>{t(!1),s({to:"/projects/$projectId",params:{projectId:De.projectId}})},onError:De=>{re(De.message)}})},St=De=>{const yt=V[De.name],nt=ar=>J(sr=>({...sr,[De.name]:ar})),Bn=De.default===void 0||typeof De.default=="string"&&De.default.includes("{{")?`${De.name} *`:De.name;switch(De.type){case"bool":return p.jsxs(zn,{children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ar,{checked:yt,onCheckedChange:nt}),p.jsx(Hn,{className:"cursor-pointer",children:Bn})]}),De.help&&p.jsx(Da,{children:De.help})]},De.name);case"int":case"float":return p.jsxs(zn,{children:[p.jsx(Hn,{children:Bn}),p.jsx(Ht,{type:"number",value:yt,onChange:ar=>nt(De.type==="int"?parseInt(ar.target.value):parseFloat(ar.target.value)),step:De.type==="float"?"any":1}),De.help&&p.jsx(Da,{children:De.help})]},De.name);default:{if(De.choices&&De.choices.length>0)return p.jsxs(zn,{children:[p.jsx(Hn,{children:Bn}),p.jsxs(mi,{value:String(yt??""),onValueChange:nt,children:[p.jsx(bi,{className:"w-full",children:p.jsx(gi,{})}),p.jsx(vi,{children:De.choices.map(Rr=>p.jsx(gn,{value:String(Rr.value),children:Rr.label},String(Rr.value)))})]}),De.help&&p.jsx(Da,{children:De.help})]},De.name);const ar=De.type==="yaml"||De.type==="json",sr=De.name.toLowerCase().includes("password"),ca=me.has(De.name);return p.jsxs(zn,{children:[p.jsx(Hn,{children:Bn}),ar?p.jsx(o1,{value:String(yt??""),onChange:Rr=>nt(Rr.target.value),rows:4}):sr?p.jsxs("div",{className:"relative",children:[p.jsx(Ht,{type:ca?"text":"password",value:String(yt??""),onChange:Rr=>nt(Rr.target.value),className:"pr-8"}),p.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",onClick:()=>{Se(Rr=>{const Hr=new Set(Rr);return Hr.has(De.name)?Hr.delete(De.name):Hr.add(De.name),Hr})},children:p.jsx(te,{icon:ca?yie:Ej,size:14,strokeWidth:2})})]}):p.jsx(Ht,{value:String(yt??""),onChange:Rr=>nt(Rr.target.value)}),De.help&&p.jsx(Da,{children:De.help})]},De.name)}}},Xt=()=>{t(!1)};return p.jsxs(p.Fragment,{children:[p.jsx(So,{open:e,onOpenChange:t,children:p.jsxs(wo,{className:"sm:max-w-2xl max-h-[80dvh] flex flex-col overflow-hidden",children:[p.jsx(cl,{className:"shrink-0",children:p.jsx(dl,{children:i("newProjectButton")})}),p.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 px-1",children:p.jsx("div",{className:"space-y-4",children:p.jsxs(Ko,{value:c,onValueChange:m,children:[p.jsxs(Yo,{className:"w-full",children:[p.jsx(Vn,{value:"add",className:"flex-1",children:a("addModal.tabs.add")}),p.jsx(Vn,{value:"scan",className:"flex-1",children:a("addModal.tabs.scan")}),p.jsx(Vn,{value:"template",className:"flex-1",children:a("addModal.tabs.template")})]}),p.jsxs(Kn,{value:"add",className:"space-y-4 pt-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(ea,{children:i("newProject.repoPathOrUrl")}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Ht,{value:g,onChange:De=>{_(De.target.value),T(null),dG(De.target.value.trim())||y("")},placeholder:i("newProject.repoInputPlaceholder"),disabled:$e,className:"pr-8"}),g&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2",children:p.jsx(te,{icon:Oe?uie:Ba,size:14,strokeWidth:2,className:"text-muted-foreground"})})]}),p.jsx(Be,{type:"button",variant:"outline",size:"sm",onClick:()=>A(!0),disabled:$e,children:i("newProject.browse")})]})]}),Oe&&p.jsxs("div",{className:"space-y-3 rounded-md border border-border bg-muted/30 p-3",children:[p.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:i("newProject.cloneOptions")}),p.jsxs("div",{className:"space-y-1",children:[p.jsx(ea,{className:"text-xs",children:i("newProject.targetDirectory")}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ht,{value:x,onChange:De=>b(De.target.value),placeholder:o||"~/",disabled:$e,className:"flex-1 text-xs"}),p.jsx(Be,{type:"button",variant:"outline",size:"sm",onClick:()=>R(!0),disabled:$e,children:i("newProject.browse")})]})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx(ea,{className:"text-xs",children:i("newProject.folderName")}),p.jsx(Ht,{value:v,onChange:De=>y(De.target.value),placeholder:ge||"",disabled:$e,className:"text-xs"})]}),lt&&p.jsxs("div",{className:"rounded-md bg-background px-3 py-2 text-xs text-muted-foreground",children:[i("newProject.willCloneTo"),": ",p.jsx("span",{className:"font-mono",children:lt})]})]}),$e&&p.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 text-sm text-muted-foreground",children:[p.jsx(te,{icon:Ft,size:16,strokeWidth:2,className:"animate-spin"}),i(Oe?"newProject.cloning":"newProject.adding")]}),E&&p.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive",children:[p.jsx(te,{icon:ai,size:14,strokeWidth:2,className:"mt-0.5 shrink-0"}),p.jsx("span",{children:E})]}),g.trim()&&p.jsxs("div",{className:"space-y-2",children:[p.jsx(ea,{htmlFor:"addProjectName",children:i("newProject.projectName")}),p.jsx(Ht,{id:"addProjectName",value:xe,onChange:De=>{Ye(De.target.value),je(!0)},placeholder:i("newProject.projectNamePlaceholder"),disabled:$e})]}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx(Be,{variant:"outline",onClick:Xt,disabled:$e,children:i("newProject.cancel")}),p.jsx(Be,{onClick:Ke,disabled:!g.trim()||!xe.trim()||$e,children:$e?p.jsxs(p.Fragment,{children:[p.jsx(te,{icon:Ft,size:16,strokeWidth:2,className:"animate-spin"}),i("newProject.creating")]}):i("newProject.create")})]})]}),p.jsxs(Kn,{value:"scan",className:"space-y-4 pt-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(ea,{children:a("bulkAdd.directoryLabel")}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ht,{value:N,onChange:De=>{D(De.target.value),H(null),U(null)},placeholder:o||a("bulkAdd.directoryPlaceholder"),disabled:ht,className:"flex-1"}),p.jsx(Be,{type:"button",variant:"outline",size:"sm",onClick:()=>K(!0),disabled:ht,children:a("bulkAdd.browse")}),p.jsxs(Be,{type:"button",size:"sm",onClick:st,disabled:ht||!mt,children:[u.isPending?p.jsx(te,{icon:Ft,size:16,strokeWidth:2,className:"animate-spin"}):p.jsx(te,{icon:jg,size:16,strokeWidth:2}),a("bulkAdd.scan")]})]})]}),L!==null&&p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx(ea,{className:"text-xs",children:a("bulkAdd.foundRepos",{count:L.length})}),dt.length>0&&p.jsxs("div",{className:"flex gap-2 text-xs",children:[p.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:zt,disabled:ht,children:a("bulkAdd.selectAll")}),p.jsx("span",{className:"text-muted-foreground",children:"/"}),p.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:Mt,disabled:ht,children:a("bulkAdd.selectNone")})]})]}),L.length===0?p.jsx("div",{className:"rounded-md bg-muted/50 px-3 py-4 text-center text-sm text-muted-foreground",children:a("bulkAdd.noReposFound")}):p.jsx("div",{className:"max-h-64 overflow-y-auto rounded-md border",children:L.map(De=>p.jsxs("div",{className:`flex items-center gap-3 border-b px-3 py-2 last:border-b-0 ${De.hasProject?"bg-muted/30 opacity-60":""}`,children:[p.jsx(Ar,{checked:M.has(De.path),onCheckedChange:()=>Bt(De.path),disabled:De.hasProject||ht}),p.jsx(te,{icon:De.hasProject?nl:Ba,size:16,strokeWidth:2,className:De.hasProject?"text-green-500":"text-muted-foreground"}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"truncate text-sm font-medium",children:De.name}),p.jsx("div",{className:"truncate text-xs text-muted-foreground",children:De.path})]}),De.hasProject&&p.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:a("bulkAdd.alreadyAdded")})]},De.path))})]}),d.isPending&&p.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 text-sm text-muted-foreground",children:[p.jsx(te,{icon:Ft,size:16,strokeWidth:2,className:"animate-spin"}),a("bulkAdd.adding")]}),z&&p.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive",children:[p.jsx(te,{icon:ai,size:14,strokeWidth:2,className:"mt-0.5 shrink-0"}),p.jsx("span",{children:z})]}),M.size>0&&p.jsx(Be,{onClick:bt,disabled:M.size===0||ht,className:"w-full",children:a("bulkAdd.addSelected",{count:M.size})})]}),p.jsxs(Kn,{value:"template",className:"space-y-4 pt-4",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:a("newProject.steps.template.sectionTitle")}),p.jsxs("div",{className:"text-xs text-muted-foreground",children:[a("newProject.steps.template.sectionDescription")," ",p.jsx("a",{href:"https://copier.readthedocs.io/",target:"_blank",rel:"noopener noreferrer",className:"underline hover:opacity-80",children:a("newProject.steps.template.learnMore")})]})]}),p.jsxs(Tp,{children:[p.jsxs(zn,{children:[p.jsx(Hn,{children:a("newProject.steps.template.savedTemplates")}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs(mi,{value:$,onValueChange:De=>{j(De??""),G(""),J({})},children:[p.jsx(bi,{className:"w-full",children:p.jsx(gi,{children:$?we?.find(De=>De.id===$)?.displayName:p.jsx("span",{className:"text-muted-foreground",children:a("newProject.steps.template.selectTemplate")})})}),p.jsx(vi,{children:we?.map(De=>p.jsx(gn,{value:De.id,children:De.displayName},De.id))})]}),$&&p.jsx(Be,{type:"button",variant:"ghost",size:"sm",onClick:()=>{j(""),J({})},disabled:Re,className:"text-muted-foreground hover:text-foreground",children:"Clear"})]})]}),!$&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"text-center text-muted-foreground text-xs py-1",children:a("newProject.steps.template.or")}),p.jsxs(zn,{children:[p.jsx(Hn,{children:a("newProject.steps.template.customUrl")}),p.jsx(Ht,{value:F,onChange:De=>{G(De.target.value),j(""),J({})},placeholder:"https://github.com/user/template or /path/to/template",disabled:Re})]})]})]}),Ne&&p.jsxs("div",{className:"space-y-3 rounded-md border border-border bg-muted/30 p-3",children:[p.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:a("newProject.steps.questions.title")}),pe&&p.jsx("div",{className:"flex items-center justify-center py-4",children:p.jsx(te,{icon:Ft,size:20,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),Ae&&p.jsx("div",{className:"text-destructive text-sm py-2",children:Ae.message}),_e&&p.jsx(Tp,{children:_e.questions.length===0?p.jsx("div",{className:"text-muted-foreground text-sm py-2",children:a("newProject.steps.questions.noQuestions")}):_e.questions.map(St)})]}),Ne&&!pe&&p.jsxs("div",{className:"space-y-3 rounded-md border border-border bg-muted/30 p-3",children:[p.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:a("newProject.steps.output.title")}),p.jsxs(zn,{children:[p.jsx(Hn,{children:a("newProject.steps.output.projectName")}),p.jsx(Ht,{value:Z,onChange:De=>Y(De.target.value),placeholder:"my-new-project",disabled:Re})]}),p.jsxs(zn,{children:[p.jsx(Hn,{children:a("newProject.steps.output.outputDirectory")}),p.jsxs(Be,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>Ee(!0),disabled:Re,children:[p.jsx(te,{icon:Ba,size:14,strokeWidth:2,className:"mr-2"}),ae||a("newProject.steps.output.selectDirectory")]})]}),Z&&ae&&p.jsxs(Da,{className:"font-mono text-xs",children:[a("newProject.steps.output.willCreate"),": ",ae,"/",Z]})]}),Re&&p.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 text-sm text-muted-foreground",children:[p.jsx(te,{icon:Ft,size:16,strokeWidth:2,className:"animate-spin"}),a("newProject.steps.creating.inProgress")]}),Q&&p.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive",children:[p.jsx(te,{icon:ai,size:14,strokeWidth:2,className:"mt-0.5 shrink-0"}),p.jsx("span",{children:Q})]}),p.jsxs("div",{className:"flex items-center justify-between pt-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ar,{id:"trust-template",checked:oe,onCheckedChange:De=>ee(De===!0),disabled:Re}),p.jsx("label",{htmlFor:"trust-template",className:"text-xs text-muted-foreground cursor-pointer",children:a("newProject.steps.output.trust")})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Be,{variant:"outline",onClick:Xt,disabled:Re,children:i("newProject.cancel")}),p.jsx(Be,{onClick:Wt,disabled:!Te||Re,children:a("newProject.create")})]})]})]})]})})})]})}),p.jsx(bd,{open:w,onOpenChange:A,onSelect:De=>{_(De),A(!1)},initialPath:o||void 0}),p.jsx(bd,{open:O,onOpenChange:R,onSelect:De=>{b(De),R(!1)},initialPath:We||void 0}),p.jsx(bd,{open:q,onOpenChange:K,onSelect:De=>{D(De),K(!1),U(null),W(new Set)},initialPath:mt||void 0}),p.jsx(bd,{open:ve,onOpenChange:Ee,onSelect:De=>{se(De),Ee(!1)},initialPath:ae||o||void 0})]})}const D5e=Si("/projects/")({component:F5e});function L5e(e){switch(e){case"running":return"bg-green-500";case"building":return"bg-yellow-500";case"failed":return"bg-red-500";default:return"bg-muted-foreground/30"}}function P5e(e,t){switch(e){case"running":return t("card.running");case"building":return t("card.building");case"failed":return t("card.failed");case"stopped":return t("card.stopped");default:return t("card.noApp")}}function M5e({project:e,onStartTask:t,onDeleteClick:n}){const{t:r}=Ct("projects"),i=Sa(),{data:a}=u1(),{data:s}=c1(),{data:o}=d1(),l=OPe(),u=Eoe(),d=!!e.app,c=e.app?.status,m=c==="running",g=c==="building",_=e.repository?.path,x=e.app?.services?.find(E=>E.exposed&&E.domain)?.domain,b=()=>{if(!_){Et.error("No repository path");return}const E=ZC(_,a,s,o);Wl(E)},v=async()=>{if(e.app)try{await l.mutateAsync(e.app.id),i({to:"/projects/$projectId",params:{projectId:e.id},search:{tab:"deploy",subtab:"deployments"}})}catch(E){Et.error("Deploy failed",{description:E instanceof Error?E.message:"Unknown error"})}},y=async()=>{if(e.app)try{await u.mutateAsync(e.app.id)}catch(E){Et.error("Stop failed",{description:E instanceof Error?E.message:"Unknown error"})}};return p.jsxs(Ua,{className:"h-full group transition-colors hover:border-foreground/20",children:[p.jsx(Or,{to:"/projects/$projectId",params:{projectId:e.id},className:"block",children:p.jsxs(Fd,{className:"flex flex-col gap-3 py-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:ze("h-2.5 w-2.5 rounded-full shrink-0",L5e(c))}),p.jsx("span",{className:"truncate font-medium group-hover:text-primary transition-colors",children:e.name})]}),_&&p.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[p.jsx(te,{icon:Ba,size:12,strokeWidth:2,className:"shrink-0"}),p.jsx("span",{className:"truncate font-mono",children:_})]}),p.jsx("div",{className:"flex items-center gap-2 text-xs",children:d?p.jsxs(p.Fragment,{children:[p.jsxs("span",{className:"text-muted-foreground",children:["App: ",P5e(c,r)]}),x&&p.jsx("span",{className:"text-muted-foreground truncate",children:x})]}):p.jsx("span",{className:"text-muted-foreground",children:r("card.noApp")})})]})}),p.jsx(Fd,{className:"pt-0 pb-4 px-6",children:p.jsxs("div",{className:"mt-auto flex flex-wrap gap-1",children:[e.repository&&p.jsxs(Be,{variant:"outline",size:"sm",onClick:t,className:"text-muted-foreground hover:text-foreground",children:[p.jsx(te,{icon:Cj,size:14,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{className:"max-sm:hidden",children:r("newTask")})]}),_&&p.jsxs(Be,{variant:"outline",size:"sm",onClick:b,className:"text-muted-foreground hover:text-foreground max-sm:hidden",title:`Open in ${Ioe(a)}`,children:[p.jsx(te,{icon:Aj,size:14,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{children:r("editor")})]}),d&&p.jsx(p.Fragment,{children:m?p.jsxs(Be,{variant:"outline",size:"sm",onClick:y,disabled:u.isPending,className:"text-muted-foreground hover:text-destructive",children:[p.jsx(te,{icon:Fm,size:14,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{className:"max-sm:hidden",children:r("stop")})]}):p.jsxs(Be,{variant:"outline",size:"sm",onClick:v,disabled:l.isPending||g,className:"text-muted-foreground hover:text-foreground",children:[g?p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin","data-slot":"icon"}):p.jsx(te,{icon:Mm,size:14,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{className:"max-sm:hidden",children:r("deploy")})]})}),p.jsxs(Be,{variant:"outline",size:"sm",onClick:n,className:"text-muted-foreground hover:text-destructive",title:r("delete.button"),children:[p.jsx(te,{icon:rl,size:14,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{className:"max-sm:hidden",children:r("delete.button")})]})]})})]})}function j5e({project:e,open:t,onOpenChange:n,onDelete:r}){const{t:i}=Ct("projects"),[a,s]=C.useState(!1),[o,l]=C.useState(!1),[u,d]=C.useState(!1),c=async()=>{d(!0);try{await r(a,o),n(!1)}finally{d(!1)}};return p.jsx(lc,{open:t,onOpenChange:n,children:p.jsxs(uc,{children:[p.jsxs(cc,{children:[p.jsx(fc,{children:i("delete.title")}),p.jsx(pc,{children:i("delete.description",{name:e?.name})})]}),p.jsxs("div",{className:"space-y-3 py-2",children:[e?.repository&&p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(Ar,{id:"deleteDirectory",checked:a,onCheckedChange:m=>s(m===!0)}),p.jsx(ea,{htmlFor:"deleteDirectory",className:"text-sm",children:i("delete.alsoDeleteDirectory")})]}),e?.app&&p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(Ar,{id:"deleteApp",checked:o,onCheckedChange:m=>l(m===!0)}),p.jsx(ea,{htmlFor:"deleteApp",className:"text-sm",children:i("delete.alsoDeleteApp")})]})]}),p.jsxs(dc,{children:[p.jsx(hc,{disabled:u,children:"Cancel"}),p.jsx(qg,{onClick:c,disabled:u,className:"bg-destructive hover:bg-destructive/90",children:i(u?"delete.deleting":"delete.button")})]})]})})}function F5e(){const{t:e}=Ct("projects"),{data:t,isLoading:n,error:r}=eT(),i=tle(),[a,s]=C.useState(null),[o,l]=C.useState(null),[u,d]=C.useState(!1),[c,m]=C.useState(""),g=C.useMemo(()=>t?c?.trim()?t.map(x=>({project:x,score:Math.max(ts(x.name,c),ts(x.repository?.path??"",c),ts(x.repository?.displayName??"",c))})).filter(({score:x})=>x>0).sort((x,b)=>b.score-x.score).map(({project:x})=>x):t:[],[t,c]),_=async(x,b)=>{o&&await i.mutateAsync({id:o.id,deleteDirectory:x,deleteApp:b})};return p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-background px-4 py-2",children:[p.jsxs("div",{className:"relative min-w-0 flex-1 sm:max-w-64 sm:flex-none",children:[p.jsx(te,{icon:jg,size:12,strokeWidth:2,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),p.jsx(Ht,{value:c,onChange:x=>m(x.target.value),placeholder:e("searchPlaceholder"),className:"w-full pl-6"})]}),p.jsx("div",{className:"hidden sm:block flex-1"}),p.jsxs(Be,{size:"sm",onClick:()=>d(!0),children:[p.jsx(te,{icon:hie,size:16,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{className:"max-sm:hidden",children:e("newProjectButton")})]})]}),p.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[n&&p.jsx("div",{className:"flex items-center justify-center py-12",children:p.jsx(te,{icon:Ft,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),r&&p.jsxs("div",{className:"flex items-center gap-3 py-6 text-destructive",children:[p.jsx(te,{icon:ai,size:20,strokeWidth:2}),p.jsx("span",{className:"text-sm",children:e("error.failedToLoad",{message:r.message})})]}),!n&&!r&&t?.length===0&&p.jsx("div",{className:"py-12 text-muted-foreground",children:p.jsx("p",{className:"text-sm",children:e("empty.noProjects")})}),!n&&!r&&t&&t.length>0&&g.length===0&&p.jsx("div",{className:"py-12 text-muted-foreground",children:p.jsx("p",{className:"text-sm",children:e("empty.noMatches")})}),p.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:g.map(x=>p.jsx(M5e,{project:x,onStartTask:()=>s(x),onDeleteClick:()=>l(x)},x.id))})]}),a?.repository&&p.jsx(qj,{open:a!==null,onOpenChange:x=>!x&&s(null),defaultRepository:{id:a.repository.id,path:a.repository.path,displayName:a.repository.displayName,startupScript:a.repository.startupScript,copyFiles:a.repository.copyFiles,claudeOptions:a.repository.claudeOptions,opencodeOptions:a.repository.opencodeOptions,opencodeModel:a.repository.opencodeModel,defaultAgent:a.repository.defaultAgent,remoteUrl:a.repository.remoteUrl,isCopierTemplate:a.repository.isCopierTemplate,createdAt:"",updatedAt:""},showTrigger:!1}),p.jsx(j5e,{project:o,open:o!==null,onOpenChange:x=>!x&&l(null),onDelete:_}),p.jsx(I5e,{open:u,onOpenChange:d})]})}var CO,fG;function fs(){if(fG)return CO;fG=1;var e=Array.isArray;return CO=e,CO}var TO,pG;function Lle(){if(pG)return TO;pG=1;var e=typeof ix=="object"&&ix&&ix.Object===Object&&ix;return TO=e,TO}var AO,hG;function lu(){if(hG)return AO;hG=1;var e=Lle(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return AO=n,AO}var kO,mG;function x1(){if(mG)return kO;mG=1;var e=lu(),t=e.Symbol;return kO=t,kO}var OO,gG;function B5e(){if(gG)return OO;gG=1;var e=x1(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function a(s){var o=n.call(s,i),l=s[i];try{s[i]=void 0;var u=!0}catch{}var d=r.call(s);return u&&(o?s[i]=l:delete s[i]),d}return OO=a,OO}var RO,bG;function U5e(){if(bG)return RO;bG=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return RO=n,RO}var NO,vG;function Cc(){if(vG)return NO;vG=1;var e=x1(),t=B5e(),n=U5e(),r="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function s(o){return o==null?o===void 0?i:r:a&&a in Object(o)?t(o):n(o)}return NO=s,NO}var IO,yG;function Tc(){if(yG)return IO;yG=1;function e(t){return t!=null&&typeof t=="object"}return IO=e,IO}var DO,_G;function Kg(){if(_G)return DO;_G=1;var e=Cc(),t=Tc(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return DO=r,DO}var LO,xG;function C5(){if(xG)return LO;xG=1;var e=fs(),t=Kg(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,s){if(e(a))return!1;var o=typeof a;return o=="number"||o=="symbol"||o=="boolean"||a==null||t(a)?!0:r.test(a)||!n.test(a)||s!=null&&a in Object(s)}return LO=i,LO}var PO,EG;function Xd(){if(EG)return PO;EG=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return PO=e,PO}var MO,SG;function T5(){if(SG)return MO;SG=1;var e=Cc(),t=Xd(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function s(o){if(!t(o))return!1;var l=e(o);return l==r||l==i||l==n||l==a}return MO=s,MO}var jO,wG;function $5e(){if(wG)return jO;wG=1;var e=lu(),t=e["__core-js_shared__"];return jO=t,jO}var FO,CG;function z5e(){if(CG)return FO;CG=1;var e=$5e(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return FO=n,FO}var BO,TG;function Ple(){if(TG)return BO;TG=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return BO=n,BO}var UO,AG;function H5e(){if(AG)return UO;AG=1;var e=T5(),t=z5e(),n=Xd(),r=Ple(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,d=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function c(m){if(!n(m)||t(m))return!1;var g=e(m)?d:a;return g.test(r(m))}return UO=c,UO}var $O,kG;function V5e(){if(kG)return $O;kG=1;function e(t,n){return t?.[n]}return $O=e,$O}var zO,OG;function Kp(){if(OG)return zO;OG=1;var e=H5e(),t=V5e();function n(r,i){var a=t(r,i);return e(a)?a:void 0}return zO=n,zO}var HO,RG;function iT(){if(RG)return HO;RG=1;var e=Kp(),t=e(Object,"create");return HO=t,HO}var VO,NG;function W5e(){if(NG)return VO;NG=1;var e=iT();function t(){this.__data__=e?e(null):{},this.size=0}return VO=t,VO}var WO,IG;function G5e(){if(IG)return WO;IG=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return WO=e,WO}var GO,DG;function q5e(){if(DG)return GO;DG=1;var e=iT(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(a){var s=this.__data__;if(e){var o=s[a];return o===t?void 0:o}return r.call(s,a)?s[a]:void 0}return GO=i,GO}var qO,LG;function K5e(){if(LG)return qO;LG=1;var e=iT(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var a=this.__data__;return e?a[i]!==void 0:n.call(a,i)}return qO=r,qO}var KO,PG;function Y5e(){if(PG)return KO;PG=1;var e=iT(),t="__lodash_hash_undefined__";function n(r,i){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=e&&i===void 0?t:i,this}return KO=n,KO}var YO,MG;function X5e(){if(MG)return YO;MG=1;var e=W5e(),t=G5e(),n=q5e(),r=K5e(),i=Y5e();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,YO=a,YO}var XO,jG;function Z5e(){if(jG)return XO;jG=1;function e(){this.__data__=[],this.size=0}return XO=e,XO}var ZO,FG;function A5(){if(FG)return ZO;FG=1;function e(t,n){return t===n||t!==t&&n!==n}return ZO=e,ZO}var QO,BG;function aT(){if(BG)return QO;BG=1;var e=A5();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return QO=t,QO}var JO,UG;function Q5e(){if(UG)return JO;UG=1;var e=aT(),t=Array.prototype,n=t.splice;function r(i){var a=this.__data__,s=e(a,i);if(s<0)return!1;var o=a.length-1;return s==o?a.pop():n.call(a,s,1),--this.size,!0}return JO=r,JO}var eR,$G;function J5e(){if($G)return eR;$G=1;var e=aT();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return eR=t,eR}var tR,zG;function e4e(){if(zG)return tR;zG=1;var e=aT();function t(n){return e(this.__data__,n)>-1}return tR=t,tR}var nR,HG;function t4e(){if(HG)return nR;HG=1;var e=aT();function t(n,r){var i=this.__data__,a=e(i,n);return a<0?(++this.size,i.push([n,r])):i[a][1]=r,this}return nR=t,nR}var rR,VG;function sT(){if(VG)return rR;VG=1;var e=Z5e(),t=Q5e(),n=J5e(),r=e4e(),i=t4e();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,rR=a,rR}var iR,WG;function k5(){if(WG)return iR;WG=1;var e=Kp(),t=lu(),n=e(t,"Map");return iR=n,iR}var aR,GG;function n4e(){if(GG)return aR;GG=1;var e=X5e(),t=sT(),n=k5();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return aR=r,aR}var sR,qG;function r4e(){if(qG)return sR;qG=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return sR=e,sR}var oR,KG;function oT(){if(KG)return oR;KG=1;var e=r4e();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return oR=t,oR}var lR,YG;function i4e(){if(YG)return lR;YG=1;var e=oT();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return lR=t,lR}var uR,XG;function a4e(){if(XG)return uR;XG=1;var e=oT();function t(n){return e(this,n).get(n)}return uR=t,uR}var cR,ZG;function s4e(){if(ZG)return cR;ZG=1;var e=oT();function t(n){return e(this,n).has(n)}return cR=t,cR}var dR,QG;function o4e(){if(QG)return dR;QG=1;var e=oT();function t(n,r){var i=e(this,n),a=i.size;return i.set(n,r),this.size+=i.size==a?0:1,this}return dR=t,dR}var fR,JG;function O5(){if(JG)return fR;JG=1;var e=n4e(),t=i4e(),n=a4e(),r=s4e(),i=o4e();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,fR=a,fR}var pR,eq;function Mle(){if(eq)return pR;eq=1;var e=O5(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var s=arguments,o=i?i.apply(this,s):s[0],l=a.cache;if(l.has(o))return l.get(o);var u=r.apply(this,s);return a.cache=l.set(o,u)||l,u};return a.cache=new(n.Cache||e),a}return n.Cache=e,pR=n,pR}var hR,tq;function l4e(){if(tq)return hR;tq=1;var e=Mle(),t=500;function n(r){var i=e(r,function(s){return a.size===t&&a.clear(),s}),a=i.cache;return i}return hR=n,hR}var mR,nq;function u4e(){if(nq)return mR;nq=1;var e=l4e(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(s,o,l,u){a.push(l?u.replace(n,"$1"):o||s)}),a});return mR=r,mR}var gR,rq;function R5(){if(rq)return gR;rq=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,a=Array(i);++r<i;)a[r]=n(t[r],r,t);return a}return gR=e,gR}var bR,iq;function c4e(){if(iq)return bR;iq=1;var e=x1(),t=R5(),n=fs(),r=Kg(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function s(o){if(typeof o=="string")return o;if(n(o))return t(o,s)+"";if(r(o))return a?a.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return bR=s,bR}var vR,aq;function jle(){if(aq)return vR;aq=1;var e=c4e();function t(n){return n==null?"":e(n)}return vR=t,vR}var yR,sq;function Fle(){if(sq)return yR;sq=1;var e=fs(),t=C5(),n=u4e(),r=jle();function i(a,s){return e(a)?a:t(a,s)?[a]:n(r(a))}return yR=i,yR}var _R,oq;function lT(){if(oq)return _R;oq=1;var e=Kg();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return _R=t,_R}var xR,lq;function N5(){if(lq)return xR;lq=1;var e=Fle(),t=lT();function n(r,i){i=e(i,r);for(var a=0,s=i.length;r!=null&&a<s;)r=r[t(i[a++])];return a&&a==s?r:void 0}return xR=n,xR}var ER,uq;function Ble(){if(uq)return ER;uq=1;var e=N5();function t(n,r,i){var a=n==null?void 0:e(n,r);return a===void 0?i:a}return ER=t,ER}var d4e=Ble();const Ps=kn(d4e);var SR,cq;function f4e(){if(cq)return SR;cq=1;function e(t){return t==null}return SR=e,SR}var p4e=f4e();const on=kn(p4e);var wR,dq;function h4e(){if(dq)return wR;dq=1;var e=Cc(),t=fs(),n=Tc(),r="[object String]";function i(a){return typeof a=="string"||!t(a)&&n(a)&&e(a)==r}return wR=i,wR}var m4e=h4e();const Rp=kn(m4e);var g4e=T5();const qt=kn(g4e);var b4e=Xd();const Yg=kn(b4e);var CR={exports:{}},Un={};var fq;function v4e(){if(fq)return Un;fq=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),o=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),c=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),_;_=Symbol.for("react.module.reference");function x(b){if(typeof b=="object"&&b!==null){var v=b.$$typeof;switch(v){case e:switch(b=b.type,b){case n:case i:case r:case u:case d:return b;default:switch(b=b&&b.$$typeof,b){case o:case s:case l:case m:case c:case a:return b;default:return v}}case t:return v}}}return Un.ContextConsumer=s,Un.ContextProvider=a,Un.Element=e,Un.ForwardRef=l,Un.Fragment=n,Un.Lazy=m,Un.Memo=c,Un.Portal=t,Un.Profiler=i,Un.StrictMode=r,Un.Suspense=u,Un.SuspenseList=d,Un.isAsyncMode=function(){return!1},Un.isConcurrentMode=function(){return!1},Un.isContextConsumer=function(b){return x(b)===s},Un.isContextProvider=function(b){return x(b)===a},Un.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Un.isForwardRef=function(b){return x(b)===l},Un.isFragment=function(b){return x(b)===n},Un.isLazy=function(b){return x(b)===m},Un.isMemo=function(b){return x(b)===c},Un.isPortal=function(b){return x(b)===t},Un.isProfiler=function(b){return x(b)===i},Un.isStrictMode=function(b){return x(b)===r},Un.isSuspense=function(b){return x(b)===u},Un.isSuspenseList=function(b){return x(b)===d},Un.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===u||b===d||b===g||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===c||b.$$typeof===a||b.$$typeof===s||b.$$typeof===l||b.$$typeof===_||b.getModuleId!==void 0)},Un.typeOf=x,Un}var pq;function y4e(){return pq||(pq=1,CR.exports=v4e()),CR.exports}var _4e=y4e(),TR,hq;function Ule(){if(hq)return TR;hq=1;var e=Cc(),t=Tc(),n="[object Number]";function r(i){return typeof i=="number"||t(i)&&e(i)==n}return TR=r,TR}var AR,mq;function x4e(){if(mq)return AR;mq=1;var e=Ule();function t(n){return e(n)&&n!=+n}return AR=t,AR}var E4e=x4e();const Xg=kn(E4e);var S4e=Ule();const w4e=kn(S4e);var Bi=function(t){return t===0?0:t>0?1:-1},Wf=function(t){return Rp(t)&&t.indexOf("%")===t.length-1},ot=function(t){return w4e(t)&&!Xg(t)},C4e=function(t){return on(t)},xi=function(t){return ot(t)||Rp(t)},T4e=0,Zg=function(t){var n=++T4e;return"".concat(t||"").concat(n)},ja=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ot(t)&&!Rp(t))return r;var a;if(Wf(t)){var s=t.indexOf("%");a=n*parseFloat(t.slice(0,s))/100}else a=+t;return Xg(a)&&(a=r),i&&a>n&&(a=n),a},fd=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},A4e=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},ta=function(t,n){return ot(t)&&ot(n)?function(r){return t+r*(n-t)}:function(){return n}};function kS(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Ps(r,t))===n})}var k4e=function(t,n){return ot(t)&&ot(n)?t-n:Rp(t)&&Rp(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function Em(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function _P(e){"@babel/helpers - typeof";return _P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_P(e)}var O4e=["viewBox","children"],R4e=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],gq=["points","pathLength"],kR={svg:O4e,polygon:gq,polyline:gq},I5=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],OS=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(C.isValidElement(t)&&(r=t.props),!Yg(r))return null;var i={};return Object.keys(r).forEach(function(a){I5.includes(a)&&(i[a]=n||function(s){return r[a](r,s)})}),i},N4e=function(t,n,r){return function(i){return t(n,r,i),null}},mc=function(t,n,r){if(!Yg(t)||_P(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(a){var s=t[a];I5.includes(a)&&typeof s=="function"&&(i||(i={}),i[a]=N4e(s,n,r))}),i},I4e=["children"],D4e=["children"];function bq(e,t){if(e==null)return{};var n=L4e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function L4e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function xP(e){"@babel/helpers - typeof";return xP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xP(e)}var vq={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Qu=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},yq=null,OR=null,D5=function e(t){if(t===yq&&Array.isArray(OR))return OR;var n=[];return C.Children.forEach(t,function(r){on(r)||(_4e.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),OR=n,yq=t,n};function Ms(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return Qu(i)}):r=[Qu(t)],D5(e).forEach(function(i){var a=Ps(i,"type.displayName")||Ps(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function Ts(e,t){var n=Ms(e,t);return n&&n[0]}var _q=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!ot(r)||r<=0||!ot(i)||i<=0)},P4e=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],M4e=function(t){return t&&t.type&&Rp(t.type)&&P4e.indexOf(t.type)>=0},j4e=function(t){return t&&xP(t)==="object"&&"clipDot"in t},F4e=function(t,n,r,i){var a,s=(a=kR?.[i])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!qt(t)&&(i&&s.includes(n)||R4e.includes(n))||r&&I5.includes(n)},Ut=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(C.isValidElement(t)&&(i=t.props),!Yg(i))return null;var a={};return Object.keys(i).forEach(function(s){var o;F4e((o=i)===null||o===void 0?void 0:o[s],s,n,r)&&(a[s]=i[s])}),a},EP=function e(t,n){if(t===n)return!0;var r=C.Children.count(t);if(r!==C.Children.count(n))return!1;if(r===0)return!0;if(r===1)return xq(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=t[i],s=n[i];if(Array.isArray(a)||Array.isArray(s)){if(!e(a,s))return!1}else if(!xq(a,s))return!1}return!0},xq=function(t,n){if(on(t)&&on(n))return!0;if(!on(t)&&!on(n)){var r=t.props||{},i=r.children,a=bq(r,I4e),s=n.props||{},o=s.children,l=bq(s,D4e);return i&&o?Em(a,l)&&EP(i,o):!i&&!o?Em(a,l):!1}return!1},Eq=function(t,n){var r=[],i={};return D5(t).forEach(function(a,s){if(M4e(a))r.push(a);else if(a){var o=Qu(a.type),l=n[o]||{},u=l.handler,d=l.once;if(u&&(!d||!i[o])){var c=u(a,o,s);r.push(c),i[o]=!0}}}),r},B4e=function(t){var n=t&&t.type;return n&&vq[n]?vq[n]:null},U4e=function(t,n){return D5(n).indexOf(t)},$4e=["children","width","height","viewBox","className","style","title","desc"];function SP(){return SP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SP.apply(this,arguments)}function z4e(e,t){if(e==null)return{};var n=H4e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function H4e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function wP(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,a=e.className,s=e.style,o=e.title,l=e.desc,u=z4e(e,$4e),d=i||{width:n,height:r,x:0,y:0},c=nn("recharts-surface",a);return le.createElement("svg",SP({},Ut(u,!0,"svg"),{className:c,width:n,height:r,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),le.createElement("title",null,o),le.createElement("desc",null,l),t)}var V4e=["children","className"];function CP(){return CP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CP.apply(this,arguments)}function W4e(e,t){if(e==null)return{};var n=G4e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function G4e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var yn=le.forwardRef(function(e,t){var n=e.children,r=e.className,i=W4e(e,V4e),a=nn("recharts-layer",r);return le.createElement("g",CP({className:a},Ut(i,!0),{ref:t}),n)}),Qo=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a]},RR,Sq;function q4e(){if(Sq)return RR;Sq=1;function e(t,n,r){var i=-1,a=t.length;n<0&&(n=-n>a?0:a+n),r=r>a?a:r,r<0&&(r+=a),a=n>r?0:r-n>>>0,n>>>=0;for(var s=Array(a);++i<a;)s[i]=t[i+n];return s}return RR=e,RR}var NR,wq;function K4e(){if(wq)return NR;wq=1;var e=q4e();function t(n,r,i){var a=n.length;return i=i===void 0?a:i,!r&&i>=a?n:e(n,r,i)}return NR=t,NR}var IR,Cq;function $le(){if(Cq)return IR;Cq=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,a="\\ufe0e\\ufe0f",s="\\u200d",o=RegExp("["+s+e+i+a+"]");function l(u){return o.test(u)}return IR=l,IR}var DR,Tq;function Y4e(){if(Tq)return DR;Tq=1;function e(t){return t.split("")}return DR=e,DR}var LR,Aq;function X4e(){if(Aq)return LR;Aq=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,a="\\ufe0e\\ufe0f",s="["+e+"]",o="["+i+"]",l="\\ud83c[\\udffb-\\udfff]",u="(?:"+o+"|"+l+")",d="[^"+e+"]",c="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",_=u+"?",x="["+a+"]?",b="(?:"+g+"(?:"+[d,c,m].join("|")+")"+x+_+")*",v=x+_+b,y="(?:"+[d+o+"?",o,c,m,s].join("|")+")",E=RegExp(l+"(?="+l+")|"+y+v,"g");function T(w){return w.match(E)||[]}return LR=T,LR}var PR,kq;function Z4e(){if(kq)return PR;kq=1;var e=Y4e(),t=$le(),n=X4e();function r(i){return t(i)?n(i):e(i)}return PR=r,PR}var MR,Oq;function Q4e(){if(Oq)return MR;Oq=1;var e=K4e(),t=$le(),n=Z4e(),r=jle();function i(a){return function(s){s=r(s);var o=t(s)?n(s):void 0,l=o?o[0]:s.charAt(0),u=o?e(o,1).join(""):s.slice(1);return l[a]()+u}}return MR=i,MR}var jR,Rq;function J4e(){if(Rq)return jR;Rq=1;var e=Q4e(),t=e("toUpperCase");return jR=t,jR}var e6e=J4e();const uT=kn(e6e);function cr(e){return function(){return e}}const zle=Math.cos,RS=Math.sin,ml=Math.sqrt,NS=Math.PI,cT=2*NS,TP=Math.PI,AP=2*TP,If=1e-6,t6e=AP-If;function Hle(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function n6e(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Hle;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class r6e{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Hle:n6e(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,o=this._y1,l=r-t,u=i-n,d=s-t,c=o-n,m=d*d+c*c;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(m>If)if(!(Math.abs(c*l-u*d)>If)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-s,_=i-o,x=l*l+u*u,b=g*g+_*_,v=Math.sqrt(x),y=Math.sqrt(m),E=a*Math.tan((TP-Math.acos((x+m-b)/(2*v*y)))/2),T=E/y,w=E/v;Math.abs(T-1)>If&&this._append`L${t+T*d},${n+T*c}`,this._append`A${a},${a},0,0,${+(c*g>d*_)},${this._x1=t+w*l},${this._y1=n+w*u}`}}arc(t,n,r,i,a,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),u=t+o,d=n+l,c=1^s,m=s?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>If||Math.abs(this._y1-d)>If)&&this._append`L${u},${d}`,r&&(m<0&&(m=m%AP+AP),m>t6e?this._append`A${r},${r},0,1,${c},${t-o},${n-l}A${r},${r},0,1,${c},${this._x1=u},${this._y1=d}`:m>If&&this._append`A${r},${r},0,${+(m>=TP)},${c},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function L5(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new r6e(t)}function P5(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Vle(e){this._context=e}Vle.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function dT(e){return new Vle(e)}function Wle(e){return e[0]}function Gle(e){return e[1]}function qle(e,t){var n=cr(!0),r=null,i=dT,a=null,s=L5(o);e=typeof e=="function"?e:e===void 0?Wle:cr(e),t=typeof t=="function"?t:t===void 0?Gle:cr(t);function o(l){var u,d=(l=P5(l)).length,c,m=!1,g;for(r==null&&(a=i(g=s())),u=0;u<=d;++u)!(u<d&&n(c=l[u],u,l))===m&&((m=!m)?a.lineStart():a.lineEnd()),m&&a.point(+e(c,u,l),+t(c,u,l));if(g)return a=null,g+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:cr(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:cr(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:cr(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(a=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=a=null:a=i(r=l),o):r},o}function Bx(e,t,n){var r=null,i=cr(!0),a=null,s=dT,o=null,l=L5(u);e=typeof e=="function"?e:e===void 0?Wle:cr(+e),t=typeof t=="function"?t:cr(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Gle:cr(+n);function u(c){var m,g,_,x=(c=P5(c)).length,b,v=!1,y,E=new Array(x),T=new Array(x);for(a==null&&(o=s(y=l())),m=0;m<=x;++m){if(!(m<x&&i(b=c[m],m,c))===v)if(v=!v)g=m,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),_=m-1;_>=g;--_)o.point(E[_],T[_]);o.lineEnd(),o.areaEnd()}v&&(E[m]=+e(b,m,c),T[m]=+t(b,m,c),o.point(r?+r(b,m,c):E[m],n?+n(b,m,c):T[m]))}if(y)return o=null,y+""||null}function d(){return qle().defined(i).curve(s).context(a)}return u.x=function(c){return arguments.length?(e=typeof c=="function"?c:cr(+c),r=null,u):e},u.x0=function(c){return arguments.length?(e=typeof c=="function"?c:cr(+c),u):e},u.x1=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:cr(+c),u):r},u.y=function(c){return arguments.length?(t=typeof c=="function"?c:cr(+c),n=null,u):t},u.y0=function(c){return arguments.length?(t=typeof c=="function"?c:cr(+c),u):t},u.y1=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:cr(+c),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(c){return arguments.length?(i=typeof c=="function"?c:cr(!!c),u):i},u.curve=function(c){return arguments.length?(s=c,a!=null&&(o=s(a)),u):s},u.context=function(c){return arguments.length?(c==null?a=o=null:o=s(a=c),u):a},u}class Kle{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function i6e(e){return new Kle(e,!0)}function a6e(e){return new Kle(e,!1)}const M5={draw(e,t){const n=ml(t/NS);e.moveTo(n,0),e.arc(0,0,n,0,cT)}},s6e={draw(e,t){const n=ml(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Yle=ml(1/3),o6e=Yle*2,l6e={draw(e,t){const n=ml(t/o6e),r=n*Yle;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},u6e={draw(e,t){const n=ml(t),r=-n/2;e.rect(r,r,n,n)}},c6e=.8908130915292852,Xle=RS(NS/10)/RS(7*NS/10),d6e=RS(cT/10)*Xle,f6e=-zle(cT/10)*Xle,p6e={draw(e,t){const n=ml(t*c6e),r=d6e*n,i=f6e*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const s=cT*a/5,o=zle(s),l=RS(s);e.lineTo(l*n,-o*n),e.lineTo(o*r-l*i,l*r+o*i)}e.closePath()}},FR=ml(3),h6e={draw(e,t){const n=-ml(t/(FR*3));e.moveTo(0,n*2),e.lineTo(-FR*n,-n),e.lineTo(FR*n,-n),e.closePath()}},Js=-.5,eo=ml(3)/2,kP=1/ml(12),m6e=(kP/2+1)*3,g6e={draw(e,t){const n=ml(t/m6e),r=n/2,i=n*kP,a=r,s=n*kP+n,o=-a,l=s;e.moveTo(r,i),e.lineTo(a,s),e.lineTo(o,l),e.lineTo(Js*r-eo*i,eo*r+Js*i),e.lineTo(Js*a-eo*s,eo*a+Js*s),e.lineTo(Js*o-eo*l,eo*o+Js*l),e.lineTo(Js*r+eo*i,Js*i-eo*r),e.lineTo(Js*a+eo*s,Js*s-eo*a),e.lineTo(Js*o+eo*l,Js*l-eo*o),e.closePath()}};function b6e(e,t){let n=null,r=L5(i);e=typeof e=="function"?e:cr(e||M5),t=typeof t=="function"?t:cr(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:cr(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:cr(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function IS(){}function DS(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Zle(e){this._context=e}Zle.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:DS(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:DS(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function v6e(e){return new Zle(e)}function Qle(e){this._context=e}Qle.prototype={areaStart:IS,areaEnd:IS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:DS(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function y6e(e){return new Qle(e)}function Jle(e){this._context=e}Jle.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:DS(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _6e(e){return new Jle(e)}function eue(e){this._context=e}eue.prototype={areaStart:IS,areaEnd:IS,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function x6e(e){return new eue(e)}function Nq(e){return e<0?-1:1}function Iq(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),o=(a*i+s*r)/(r+i);return(Nq(a)+Nq(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Dq(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function BR(e,t,n){var r=e._x0,i=e._y0,a=e._x1,s=e._y1,o=(a-r)/3;e._context.bezierCurveTo(r+o,i+o*t,a-o,s-o*n,a,s)}function LS(e){this._context=e}LS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:BR(this,this._t0,Dq(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,BR(this,Dq(this,n=Iq(this,e,t)),n);break;default:BR(this,this._t0,n=Iq(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function tue(e){this._context=new nue(e)}(tue.prototype=Object.create(LS.prototype)).point=function(e,t){LS.prototype.point.call(this,t,e)};function nue(e){this._context=e}nue.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function E6e(e){return new LS(e)}function S6e(e){return new tue(e)}function rue(e){this._context=e}rue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Lq(e),i=Lq(t),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Lq(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function w6e(e){return new rue(e)}function fT(e,t){this._context=e,this._t=t}fT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function C6e(e){return new fT(e,.5)}function T6e(e){return new fT(e,0)}function A6e(e){return new fT(e,1)}function Xm(e,t){if((s=e.length)>1)for(var n=1,r,i,a=e[t[0]],s,o=a.length;n<s;++n)for(i=a,a=e[t[n]],r=0;r<o;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function OP(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function k6e(e,t){return e[t]}function O6e(e){const t=[];return t.key=e,t}function R6e(){var e=cr([]),t=OP,n=Xm,r=k6e;function i(a){var s=Array.from(e.apply(this,arguments),O6e),o,l=s.length,u=-1,d;for(const c of a)for(o=0,++u;o<l;++o)(s[o][u]=[0,+r(c,s[o].key,u,a)]).data=c;for(o=0,d=P5(t(s));o<l;++o)s[d[o]].index=o;return n(s,d),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:cr(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:cr(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?OP:typeof a=="function"?a:cr(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Xm,i):n},i}function N6e(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,s;i<a;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}Xm(e,t)}}function I6e(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var s=0,o=0;s<i;++s)o+=e[s][n][1]||0;r[n][1]+=r[n][0]=-o/2}Xm(e,t)}}function D6e(e,t){if(!(!((s=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,s;r<a;++r){for(var o=0,l=0,u=0;o<s;++o){for(var d=e[t[o]],c=d[r][1]||0,m=d[r-1][1]||0,g=(c-m)/2,_=0;_<o;++_){var x=e[t[_]],b=x[r][1]||0,v=x[r-1][1]||0;g+=b-v}l+=c,u+=g*c}i[r-1][1]+=i[r-1][0]=n,l&&(n-=u/l)}i[r-1][1]+=i[r-1][0]=n,Xm(e,t)}}function Xy(e){"@babel/helpers - typeof";return Xy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xy(e)}var L6e=["type","size","sizeType"];function RP(){return RP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RP.apply(this,arguments)}function Pq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pq(Object(n),!0).forEach(function(r){P6e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P6e(e,t,n){return t=M6e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M6e(e){var t=j6e(e,"string");return Xy(t)=="symbol"?t:t+""}function j6e(e,t){if(Xy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function F6e(e,t){if(e==null)return{};var n=B6e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function B6e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var iue={symbolCircle:M5,symbolCross:s6e,symbolDiamond:l6e,symbolSquare:u6e,symbolStar:p6e,symbolTriangle:h6e,symbolWye:g6e},U6e=Math.PI/180,$6e=function(t){var n="symbol".concat(uT(t));return iue[n]||M5},z6e=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*U6e;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},H6e=function(t,n){iue["symbol".concat(uT(t))]=n},j5=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,a=i===void 0?64:i,s=t.sizeType,o=s===void 0?"area":s,l=F6e(t,L6e),u=Mq(Mq({},l),{},{type:r,size:a,sizeType:o}),d=function(){var b=$6e(r),v=b6e().type(b).size(z6e(a,o,r));return v()},c=u.className,m=u.cx,g=u.cy,_=Ut(u,!0);return m===+m&&g===+g&&a===+a?le.createElement("path",RP({},_,{className:nn("recharts-symbols",c),transform:"translate(".concat(m,", ").concat(g,")"),d:d()})):null};j5.registerSymbol=H6e;function Zm(e){"@babel/helpers - typeof";return Zm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zm(e)}function NP(){return NP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NP.apply(this,arguments)}function jq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function V6e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jq(Object(n),!0).forEach(function(r){Zy(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sue(r.key),r)}}function q6e(e,t,n){return t&&G6e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function K6e(e,t,n){return t=PS(t),Y6e(e,aue()?Reflect.construct(t,n||[],PS(e).constructor):t.apply(e,n))}function Y6e(e,t){if(t&&(Zm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X6e(e)}function X6e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aue(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aue=function(){return!!e})()}function PS(e){return PS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},PS(e)}function Z6e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&IP(e,t)}function IP(e,t){return IP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},IP(e,t)}function Zy(e,t,n){return t=sue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sue(e){var t=Q6e(e,"string");return Zm(t)=="symbol"?t:t+""}function Q6e(e,t){if(Zm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var to=32,F5=(function(e){function t(){return W6e(this,t),K6e(this,t,arguments)}return Z6e(t,e),q6e(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,a=to/2,s=to/6,o=to/3,l=r.inactive?i:r.color;if(r.type==="plainline")return le.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:to,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return le.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(a,"h").concat(o,`
51
+ ${e.directory}`:e.name,children:[d&&p.jsx("div",{className:ze("absolute top-0 bottom-0 w-0.5 bg-primary z-10",d==="left"&&"-left-1",d==="right"&&"-right-1")}),e.directory&&p.jsx(te,{icon:Ba,size:12,strokeWidth:2,className:"shrink-0 opacity-60"}),e.name,n&&p.jsx("button",{onClick:x=>{x.stopPropagation(),i()},onPointerDown:x=>x.stopPropagation(),className:"ml-1 rounded opacity-0 hover:bg-muted group-hover:opacity-100",children:p.jsx(te,{icon:Yr,size:12,strokeWidth:2})})]})}function wje({tabs:e,activeTabId:t,onTabSelect:n,onTabClose:r,onTabCreate:i,onTabEdit:a,onTabReorder:s}){const o=C.useRef(null),l=C.useRef(null),[u,d]=C.useState(!1),[c,m]=C.useState(!1),[g,_]=C.useState(!0),x=C.useCallback(()=>{const y=o.current;if(!y)return;const{scrollLeft:E,scrollWidth:T,clientWidth:w}=y;d(E>0),m(E+w<T-1)},[]);C.useEffect(()=>{const y=l.current,E=o.current;if(!y||!E)return;const T=new IntersectionObserver(([w])=>{_(w.isIntersecting)},{root:E,threshold:.9});return T.observe(y),()=>T.disconnect()},[]),C.useEffect(()=>{const y=o.current;if(!y)return;x(),y.addEventListener("scroll",x);const E=new ResizeObserver(x);return E.observe(y),()=>{y.removeEventListener("scroll",x),E.disconnect()}},[x]),C.useEffect(()=>{x()},[e,x]);const b=C.useCallback(()=>{o.current?.scrollTo({left:0,behavior:"smooth"})},[]),v=C.useCallback(()=>{const y=o.current;y&&y.scrollTo({left:y.scrollWidth,behavior:"smooth"})},[]);return p.jsxs("div",{className:"flex items-center",children:[u&&p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:b,className:"shrink-0",children:p.jsx(te,{icon:Cp,size:14,strokeWidth:2})}),p.jsxs("div",{ref:o,className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto scrollbar-none",children:[e.map(y=>p.jsx(Sje,{tab:y,isActive:y.id===t,canClose:e.length>1,onSelect:()=>n(y.id),onClose:()=>r(y.id),onEdit:()=>a(y),onReorder:s},y.id)),p.jsx("span",{ref:l,children:p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:i,className:"shrink-0",children:p.jsx(te,{icon:jm,size:14,strokeWidth:2})})})]}),c&&p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:v,className:"shrink-0",children:p.jsx(te,{icon:EC,size:14,strokeWidth:2})}),!g&&p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:i,className:"shrink-0",children:p.jsx(te,{icon:jm,size:14,strokeWidth:2})})]})}function Cje({tab:e,open:t,onOpenChange:n,onSave:r,onCreate:i,defaultName:a=""}){const{t:s}=Ct("terminals"),[o,l]=C.useState(""),[u,d]=C.useState(null),[c,m]=C.useState(!1),g=!e&&i;C.useEffect(()=>{t&&(e?(l(e.name),d(e.directory??null)):(l(a),d(null)))},[t,e,a]);const _=()=>{if(g){i(o.trim(),u??void 0),n(!1);return}if(!e)return;const E={};o.trim()&&o.trim()!==e.name&&(E.name=o.trim()),u!==(e.directory??null)&&(E.directory=u),Object.keys(E).length>0&&r(e.id,E),n(!1)},x=E=>{E.key==="Enter"&&(E.preventDefault(),_())},b=()=>{d(null)},v=E=>{d(E)},y=u?u.split("/").pop():null;return p.jsxs(p.Fragment,{children:[p.jsx(So,{open:t,onOpenChange:n,children:p.jsxs(wo,{className:"sm:max-w-md",children:[p.jsx(cl,{children:p.jsx(dl,{children:s(g?"newTab.title":"editTab.title")})}),p.jsxs(Tp,{className:"mt-4",children:[p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"tabName",children:s("editTab.name")}),p.jsx(Ht,{id:"tabName",value:o,onChange:E=>l(E.target.value),onKeyDown:x,placeholder:s("editTab.namePlaceholder"),autoFocus:!0})]}),p.jsxs(zn,{children:[p.jsx(Hn,{children:s("editTab.directory")}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs(Be,{type:"button",variant:"outline",className:"flex-1 justify-start font-normal",onClick:()=>m(!0),children:[p.jsx(te,{icon:Ba,size:14,strokeWidth:2,className:"mr-2 shrink-0"}),y?p.jsx("span",{className:"truncate font-mono text-xs",children:u}):p.jsx("span",{className:"text-muted-foreground",children:s("editTab.directoryPlaceholder")})]}),u&&p.jsx(Be,{type:"button",variant:"ghost",size:"icon",onClick:b,title:s("editTab.clearDirectory"),children:p.jsx(te,{icon:Yr,size:14,strokeWidth:2})})]})]})]}),p.jsxs(i1,{className:"mt-4",children:[p.jsx(RC,{render:p.jsx(Be,{variant:"outline",type:"button"}),children:s("editTab.cancel")}),p.jsx(Be,{onClick:_,disabled:!o.trim(),children:s(g?"newTab.create":"editTab.save")})]})]})}),p.jsx(bd,{open:c,onOpenChange:m,onSelect:v,initialPath:u??void 0})]})}function SO(e){return{id:e.id,name:e.name,cwd:e.cwd,status:e.status,exitCode:e.exitCode??void 0,cols:e.cols,rows:e.rows,createdAt:e.createdAt,tabId:e.tabId??void 0,positionInTab:e.positionInTab}}function Tje(e,t){return{id:e.id,name:e.name,layout:"single",position:t,directory:e.directory??void 0}}const Oa="all-tasks",Ni="all-projects",oG=["IN_PROGRESS","IN_REVIEW"],lG="vibora:lastTerminalTab",Aje=Wg(function(){const{t}=Ct("terminals"),n=Sa(),{tab:r,repo:i,projects:a}=rC({from:"/terminals/"}),{terminals:s,tabs:o,connected:l,createTerminal:u,destroyTerminal:d,renameTerminal:c,assignTerminalToTab:m,createTab:g,updateTab:_,deleteTab:x,reorderTab:b,attachXterm:v,resizeTerminal:y,setupImagePaste:E,writeToTerminal:T,sendInputToTerminal:w,newTerminalIds:A,pendingTabCreation:O,lastCreatedTabId:R}=yoe(),[N,D]=C.useState(null),{getFocusedTerminal:L,selectedProjectIds:U,setSelectedProjects:M,isLoading:W}=Roe(),z=C.useMemo(()=>o.map(de=>de.id),[o]),H=r&&(z.includes(r)||r===Oa||r===Ni),q=H?r:o[0]?.id??null,K=C.useCallback(de=>{n({to:"/terminals",search:{tab:de,repo:de===Oa?i:void 0,projects:de===Ni?a:void 0},replace:!0})},[n,i,a]),$=C.useCallback(de=>{n({to:"/terminals",search:Te=>({...Te,repo:de||void 0}),replace:!0})},[n]),j=Vg();C.useEffect(()=>zm(()=>({lastCreatedTabId:j.lastCreatedTabId,pendingTabCreation:j.pendingTabCreation}),({lastCreatedTabId:Te})=>{Te&&(Lt.terminal.info("MobX reaction: lastCreatedTabId changed",{tabId:Te}),K(Te),setTimeout(()=>{j.clearLastCreatedTabId(),je.current++;const Ke=`Terminal ${je.current}`;Lt.terminal.debug("Creating terminal in new tab",{tabId:Te,name:Ke}),u({name:Ke,cols:80,rows:24,tabId:Te,positionInTab:0})},150))},{fireImmediately:!0}),[j,K,u]),C.useEffect(()=>{if(Lt.terminal.debug("Redirect effect running",{tabsLength:o.length,isValidTab:H,pendingTabCreation:O,lastCreatedTabId:R}),o.length!==0&&!(O||R)&&!H){const de=localStorage.getItem(lG),Te=de&&(o.some(Ke=>Ke.id===de)||de===Oa||de===Ni)?de:o[0].id;Lt.terminal.debug("Redirecting to tab",{targetTab:Te}),n({to:"/terminals",search:{tab:Te},replace:!0})}},[o,H,R,O,n]),C.useEffect(()=>{q&&localStorage.setItem(lG,q)},[q]);const{data:F=[],status:G}=PC(),{data:V=[]}=jC(),{data:J=[]}=eT(),ae=C.useMemo(()=>{const de=new Map;for(const Te of V)de.set(Te.path,Te.id);return de},[V]),se=C.useMemo(()=>new Set(F.filter(de=>oG.includes(de.status)&&de.worktreePath).map(de=>de.worktreePath)),[F]),Z=C.useMemo(()=>new Set(F.filter(de=>de.worktreePath).map(de=>de.worktreePath)),[F]),Y=C.useMemo(()=>{const de=new Map;for(const Te of F)Te.worktreePath&&de.set(Te.worktreePath,{taskId:Te.id,repoId:ae.get(Te.repoPath),repoName:Te.repoName,title:Te.title,repoPath:Te.repoPath,worktreePath:Te.worktreePath,baseBranch:Te.baseBranch,branch:Te.branch,prUrl:Te.prUrl,pinned:Te.pinned});return de},[F,ae]),Q=C.useMemo(()=>{const de=new Set(F.filter(Te=>oG.includes(Te.status)).map(Te=>Te.repoName));return Array.from(de).sort()},[F]),re=C.useMemo(()=>{const de=new Map;for(const Te of J)Te.repository?.path&&de.set(Te.repository.path,Te.id);return de},[J]),oe=C.useMemo(()=>{const de=new Map;for(const Te of J)Te.repository?.path&&de.set(Te.repository.path,{projectId:Te.id,projectName:Te.name,repoPath:Te.repository.path,appStatus:Te.app?.status??null});return de},[J]),ee=C.useMemo(()=>a?.split(",").filter(Boolean)??[],[a]),[ve,Ee]=C.useState(null),me=C.useRef(0),Se=400,xe=C.useCallback((de,Te)=>{Lt.projectTerminals.info("toggleProjectFilter called",{projectId:de,checked:Te});const Ke=a?.split(",").filter(Boolean)??[];if(Te&&Ke.length>=6)return;Te&&(Lt.projectTerminals.info("Setting loadingProjectId",{projectId:de}),me.current=Date.now(),Ee(de));const st=Te?[...Ke,de]:Ke.filter(Bt=>Bt!==de);n({to:"/terminals",search:Bt=>({...Bt,projects:st.length>0?st.join(","):void 0}),replace:!0})},[n,a]),Ye=C.useRef(!1);C.useEffect(()=>{if(q!==Ni){Ye.current=!1;return}W||Ye.current||a||U.length!==0&&(Ye.current=!0,n({to:"/terminals",search:de=>({...de,projects:U.join(",")}),replace:!0}))},[q,a,U,n,W]),C.useEffect(()=>{if(q!==Ni||W||!a&&!Ye.current&&U.length>0)return;const de=ee.join(","),Te=U.join(",");de!==Te&&M(ee)},[q,ee,U,M,W,a]),C.useEffect(()=>{if(q===Ni&&l){Lt.projectTerminals.debug("Auto-create effect running",{selectedProjectIds:ee,terminalCount:s.length,terminalCwds:s.map(de=>de.cwd)});for(const de of ee){const Te=J.find(Bt=>Bt.id===de);if(!Te?.repository?.path)continue;const Ke=Te.repository.path;if(s.find(Bt=>Bt.cwd===Ke&&!Bt.tabId)){Lt.projectTerminals.debug("Terminal already exists for project",{projectId:de,repoPath:Ke});continue}Lt.projectTerminals.info("Creating terminal for project",{projectId:de,repoPath:Ke}),u({name:Te.name,cwd:Ke,cols:80,rows:24})}}},[q,ee,J,s,l,u]);const Ue=C.useRef(new Map),je=C.useRef(0),we=C.useRef(!1),Ne=C.useRef(!1),_e=C.useMemo(()=>q===Oa?s.filter(de=>de.cwd&&se.has(de.cwd)).filter(de=>i?F.find(Ke=>Ke.worktreePath===de.cwd)?.repoName===i:!0).sort((de,Te)=>{const Ke=F.find(Bt=>Bt.worktreePath===de.cwd),st=F.find(Bt=>Bt.worktreePath===Te.cwd);return!Ke||!st?0:new Date(st.createdAt).getTime()-new Date(Ke.createdAt).getTime()}).map(SO):q===Ni?ee.length===0?[]:s.filter(de=>de.cwd&&!de.tabId&&re.has(de.cwd)).filter(de=>{const Te=re.get(de.cwd);return Te&&ee.includes(Te)}).map(SO):s.filter(de=>de.tabId===q).sort((de,Te)=>de.positionInTab-Te.positionInTab).map(SO),[q,s,se,i,F,re,ee]);C.useEffect(()=>{if(!ve)return;const de=J.find(st=>st.id===ve);if(!de?.repository?.path)return;const Te=de.repository.path,Ke=_e.some(st=>st.cwd===Te);if(Lt.projectTerminals.debug("Clear loading effect",{loadingProjectId:ve,repoPath:Te,hasTerminal:Ke,visibleTerminalCwds:_e.map(st=>st.cwd)}),Ke){const st=Date.now()-me.current,Bt=Se-st;if(Bt>0){const zt=setTimeout(()=>{Lt.projectTerminals.info("Clearing loadingProjectId after delay",{loadingProjectId:ve}),Ee(null)},Bt);return()=>clearTimeout(zt)}Lt.projectTerminals.info("Clearing loadingProjectId",{loadingProjectId:ve}),Ee(null)}},[ve,J,_e]);const pe=C.useCallback(()=>{if(Lt.terminal.info("handleTerminalAdd called",{activeTabId:q,connected:l,pendingTerminalCreate:we.current,terminalCount:s.length}),we.current){Lt.terminal.debug("Skipping terminal creation, already pending");return}we.current=!0,je.current++;const de=`Terminal ${je.current}`,Te=s.filter(st=>st.tabId===q),Ke=Te.length;Lt.terminal.info("Creating terminal",{name:de,tabId:q,positionInTab:Ke,terminalsInTabCount:Te.length}),u({name:de,cols:80,rows:24,tabId:q??void 0,positionInTab:Ke}),setTimeout(()=>{we.current=!1},500)},[u,q,s,l]);C.useEffect(()=>{if(G!=="success"){Lt.terminalsView.debug("Tab assignment effect skipped",{tasksStatus:G});return}for(const de of s)de.cwd&&Z.has(de.cwd)&&de.tabId&&(Lt.terminalsView.debug("Removing task terminal from regular tab",{terminalId:de.id,name:de.name,cwd:de.cwd,tabId:de.tabId}),m(de.id,null))},[s,Z,m,G]);const Ae=C.useCallback(de=>{const Te=Ue.current.get(de);Te&&(Te(),Ue.current.delete(de)),d(de,{force:!0,reason:"user_closed"})},[d]),he=C.useCallback((de,Te)=>{const Ke=v(de,Te);Ue.current.set(de,Ke),A.has(de)&&setTimeout(()=>{Te.focus()},50)},[v,A]),Oe=C.useCallback((de,Te,Ke)=>{y(de,Te,Ke)},[y]),ge=C.useCallback((de,Te)=>{c(de,Te)},[c]),Ie=C.useCallback(()=>{if(Ne.current){Lt.terminal.debug("Skipping tab creation, already pending");return}Ne.current=!0;const de=`Tab ${o.length+1}`;Lt.terminal.debug("Quick creating tab",{name:de}),g(de,void 0,void 0),setTimeout(()=>{Ne.current=!1},500)},[g,o.length]),We=C.useCallback((de,Te)=>{Lt.terminal.debug("Reordering tab",{tabId:de,newPosition:Te}),b(de,Te)},[b]),mt=C.useCallback((de,Te)=>{if(Ne.current){Lt.terminal.debug("Skipping tab creation, already pending");return}Ne.current=!0,Lt.terminal.debug("Creating tab",{name:de,directory:Te}),g(de,void 0,Te),setTimeout(()=>{Ne.current=!1},500)},[g]),lt=C.useCallback(de=>{const Te=s.filter(Ke=>Ke.tabId===de);for(const Ke of Te){const st=Ue.current.get(Ke.id);st&&(st(),Ue.current.delete(Ke.id))}x(de)},[s,x]),dt=o.map(Tje),$e=C.useCallback(de=>{D(de)},[]),ht=C.useCallback((de,Te)=>{_(de,Te)},[_]),Re=q===Oa||q===Ni;return Ra("meta+d",pe,{enabled:!Re&&l,allowInTerminal:!0,deps:[pe,Re,l]}),Ra("meta+w",()=>{if(q&&!Re){const de=L(q);de&&Ae(de)}},{enabled:!Re,allowInTerminal:!0,deps:[q,Re,L,Ae]}),p.jsxs("div",{className:"flex h-full max-w-full flex-col overflow-hidden",children:[p.jsxs("div",{className:"sticky top-0 z-10 flex shrink-0 items-center justify-between border-b border-border bg-background px-2 py-1",children:[p.jsxs("div",{className:"flex min-w-0 flex-1 items-center",children:[p.jsxs("button",{onClick:()=>K(Oa),className:ze("relative flex shrink-0 items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors max-sm:px-2",q===Oa?"bg-primary/10 text-primary":"text-muted-foreground hover:text-primary hover:bg-primary/5","after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-primary after:transition-opacity",q===Oa?"after:opacity-100":"after:opacity-0"),children:[p.jsx(te,{icon:Tj,size:12,strokeWidth:2}),p.jsx("span",{className:"max-sm:hidden",children:t("taskTerminals")})]}),p.jsxs("button",{onClick:()=>K(Ni),className:ze("relative flex shrink-0 items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors max-sm:px-2",q===Ni?"bg-primary/10 text-primary":"text-muted-foreground hover:text-primary hover:bg-primary/5","after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-primary after:transition-opacity",q===Ni?"after:opacity-100":"after:opacity-0"),children:[p.jsx(te,{icon:Ds,size:12,strokeWidth:2}),p.jsx("span",{className:"max-sm:hidden",children:t("projectTerminals")})]}),p.jsx("div",{className:"mx-2 h-4 w-px shrink-0 bg-border"}),p.jsx("div",{className:"min-w-0 flex-1",children:p.jsx(wje,{tabs:dt,activeTabId:q??"",onTabSelect:K,onTabClose:lt,onTabCreate:Ie,onTabEdit:$e,onTabReorder:We})})]}),p.jsxs("div",{className:"flex shrink-0 items-center gap-3 max-sm:gap-1",children:[q===Oa&&Q.length>1&&p.jsxs(mi,{value:i??"",onValueChange:de=>$(de||null),children:[p.jsxs(bi,{size:"sm",className:"max-sm:w-auto",children:[p.jsx(te,{icon:uS,size:12,strokeWidth:2,className:"text-muted-foreground"}),p.jsx(gi,{children:i||t("allRepos")})]}),p.jsxs(vi,{children:[p.jsx(gn,{value:"",children:t("allRepos")}),Q.map(de=>p.jsx(gn,{value:de,children:de},de))]})]}),q===Ni&&J.length>0&&p.jsxs(up,{children:[p.jsxs(cp,{render:p.jsx(Be,{variant:"outline",size:"sm",className:"max-sm:w-auto"}),children:[ve?p.jsx(te,{icon:Ft,size:12,strokeWidth:2,className:"animate-spin text-muted-foreground"}):p.jsx(te,{icon:uS,size:12,strokeWidth:2,className:"text-muted-foreground"}),p.jsx("span",{children:ee.length===0?t("selectProjects"):t("projectsSelected",{count:ee.length})})]}),p.jsx(dp,{className:"w-64",align:"end",children:p.jsxs("div",{className:"p-2 space-y-2",children:[p.jsx("div",{className:"text-sm font-medium mb-2",children:t("filterByProject")}),J.map(de=>{const Te=ee.includes(de.id),Ke=ve===de.id,st=ve!==null||!Te&&ee.length>=6;return p.jsxs("div",{className:"flex items-center gap-2",children:[Ke?p.jsx(te,{icon:Ft,size:16,strokeWidth:2,className:"animate-spin text-muted-foreground"}):p.jsx(Ar,{id:`project-filter-${de.id}`,checked:Te,disabled:st,onCheckedChange:Bt=>xe(de.id,Bt===!0)}),p.jsx(ea,{htmlFor:`project-filter-${de.id}`,className:`text-sm ${st?"text-muted-foreground cursor-not-allowed":"cursor-pointer"}`,children:de.name})]},de.id)}),ee.length>0&&!ve&&p.jsx(Be,{variant:"ghost",size:"sm",className:"w-full mt-2",onClick:()=>n({to:"/terminals",search:de=>({...de,projects:void 0}),replace:!0}),children:t("clearFilter")})]})})]}),p.jsxs(Be,{variant:"outline",size:"sm",onClick:pe,disabled:!l||q===Oa||q===Ni,className:"max-sm:px-2 border-transparent text-primary",children:[p.jsx(te,{icon:sie,size:14,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{className:"max-sm:hidden",children:t("newTerminal")})]})]})]}),p.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:p.jsx(D3e,{terminals:_e,onTerminalClose:q===Oa||q===Ni?void 0:Ae,onTerminalAdd:l&&q!==Oa&&q!==Ni?pe:void 0,onTerminalReady:he,onTerminalResize:Oe,onTerminalRename:q===Oa||q===Ni?void 0:ge,setupImagePaste:E,writeToTerminal:T,sendInputToTerminal:w,taskInfoByCwd:q===Oa?Y:void 0,projectInfoByCwd:q===Ni?oe:void 0,emptyMessage:q===Ni?t("emptyProjects"):q===Oa?t("emptyTasks"):void 0})}),p.jsx(Cje,{tab:N,open:N!==null,onOpenChange:de=>{de||D(null)},onSave:ht,onCreate:mt,defaultName:`Tab ${o.length+1}`})]})}),kje=Si("/terminals/")({component:Aje,validateSearch:e=>({tab:typeof e.tab=="string"?e.tab:void 0,repo:typeof e.repo=="string"?e.repo:void 0,projects:typeof e.projects=="string"?e.projects:void 0})});function Oje(){return{x:0,y:0}}function Rje(e){var t=e.render,n=e.nativeSetDragImage,r=e.getOffset,i=r===void 0?Oje:r,a=document.createElement("div");Object.assign(a.style,{position:"fixed",top:0,left:0,zIndex:lle,pointerEvents:"none"}),document.body.append(a);var s=t({container:a});queueMicrotask(function(){var u=i({container:a});if(y1()){var d=a.getBoundingClientRect();if(d.width===0)return;a.style.left="-".concat(d.width-1e-4,"px")}n?.(a,u.x,u.y)});function o(){l(),s?.(),document.body.removeChild(a)}var l=ple({onDragStart:o,onDrop:o})}var Nje=qp(function(){return y1()&&"ontouchend"in document}),Ije=function(t){var n=t.container,r=n.getBoundingClientRect();return{x:r.width/2,y:r.height/2}};function Dje(e){return function(n){var r=n.container;if(Nje()||fle())return Ije({container:r});Object.assign(r.style,{borderInlineStart:"".concat(e.x," solid transparent"),borderTop:"".concat(e.y," solid transparent")});var i=window.getComputedStyle(r);if(i.direction==="rtl"){var a=r.getBoundingClientRect();return{x:a.width,y:0}}return{x:0,y:0}}}function Ua({className:e,size:t="default",...n}){return p.jsx("div",{"data-slot":"card","data-size":t,className:ze("ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-lg py-4 text-xs/relaxed ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg group/card flex flex-col",e),...n})}function Lje({className:e,...t}){return p.jsx("div",{"data-slot":"card-header",className:ze("gap-1 rounded-t-lg px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",e),...t})}function Pje({className:e,...t}){return p.jsx("div",{"data-slot":"card-title",className:ze("text-sm font-medium",e),...t})}function Fd({className:e,...t}){return p.jsx("div",{"data-slot":"card-content",className:ze("px-4 group-data-[size=sm]/card:px-3",e),...t})}const ble=C.createContext(null);function Mje({children:e}){const[t,n]=C.useState(null);return p.jsx(ble.Provider,{value:{activeTask:t,setActiveTask:n},children:e})}function vle(){const e=C.useContext(ble);if(!e)throw new Error("useDrag must be used within DragProvider");return e}const yle=C.createContext(null);function jje({children:e}){const[t,n]=C.useState(new Set),[r,i]=C.useState(null),a=C.useCallback(u=>{n(d=>{const c=new Set(d);return c.has(u)?c.delete(u):c.add(u),c}),i(u)},[]),s=C.useCallback((u,d)=>{if(!r){n(new Set([u])),i(u);return}const c=d.indexOf(r),m=d.indexOf(u);if(c===-1||m===-1){n(new Set([u])),i(u);return}const[g,_]=c<m?[c,m]:[m,c],x=d.slice(g,_+1);n(b=>{const v=new Set(b);for(const y of x)v.add(y);return v})},[r]),o=C.useCallback(()=>{n(new Set),i(null)},[]),l=C.useCallback(u=>t.has(u),[t]);return p.jsx(yle.Provider,{value:{selectedIds:t,lastSelectedId:r,toggleSelection:a,selectRange:s,clearSelection:o,isSelected:l},children:e})}function _5(){const e=C.useContext(yle);if(!e)throw new Error("useSelection must be used within a SelectionProvider");return e}function Fje(e){return e.match(/\/issue\/([A-Z]+-\d+)/i)?.[1]??null}function _le({task:e,open:t,onOpenChange:n}){const r=MC(),i=KAe(),[a,s]=C.useState(e.title),[o,l]=C.useState(!1),[u,d]=C.useState(e.description||""),[c,m]=C.useState(e.prUrl||""),[g,_]=C.useState(e.linearTicketUrl||"");C.useEffect(()=>{t&&(s(e.title),d(e.description||""),m(e.prUrl||""),_(e.linearTicketUrl||""),l(!1))},[t,e]);const x=()=>{const y={},E=a.trim();if(!E)return;E!==e.title&&(y.title=E);const T=u.trim();T!==(e.description||"")&&(y.description=T);const w=c.trim();w!==(e.prUrl||"")&&(y.prUrl=w||null);const A=g.trim();A!==(e.linearTicketUrl||"")&&(y.linearTicketUrl=A||null,y.linearTicketId=A?Fje(A):null),Object.keys(y).length>0&&r.mutate({taskId:e.id,updates:y}),n(!1)},b=y=>{y.key==="Enter"&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),x())},v=()=>{i.mutate({taskId:e.id,pinned:!e.pinned})};return p.jsx(So,{open:t,onOpenChange:n,children:p.jsxs(wo,{className:"sm:max-w-md",onKeyDown:b,children:[p.jsx(cl,{children:p.jsx(dl,{children:"Task Settings"})}),p.jsxs(Tp,{className:"mt-4",children:[p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"config-title",children:"Title"}),p.jsx(Ht,{id:"config-title",value:a,onChange:y=>s(y.target.value),autoFocus:!0})]}),p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"config-description",children:"Description"}),p.jsx(Lie,{id:"config-description",value:u,onValueChange:d,rows:3})]}),p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"config-pr-url",children:"GitHub PR URL"}),p.jsx(Ht,{id:"config-pr-url",value:c,onChange:y=>m(y.target.value),placeholder:"https://github.com/owner/repo/pull/123"})]}),p.jsxs(zn,{children:[p.jsx(Hn,{htmlFor:"config-linear-url",children:"Linear Ticket URL"}),p.jsx(Ht,{id:"config-linear-url",value:g,onChange:y=>_(y.target.value),placeholder:"https://linear.app/team/issue/TEAM-123"})]}),p.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[p.jsx(Ar,{id:"config-pinned",checked:e.pinned,onCheckedChange:v,disabled:i.isPending}),p.jsx("label",{htmlFor:"config-pinned",className:"text-sm cursor-pointer",children:"Pin worktree (exclude from bulk cleanup)"})]})]}),p.jsxs(i1,{className:"mt-4 flex-row justify-between sm:justify-between",children:[p.jsx(Be,{variant:"ghost",className:"text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>l(!0),children:"Delete Task"}),p.jsx(JC,{task:e,open:o,onOpenChange:l,onDeleted:()=>n(!1)}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Be,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),p.jsx(Be,{onClick:x,disabled:!a.trim(),children:"Save"})]})]})]})})}function xle({task:e,isDragPreview:t}){const{setActiveTask:n}=vle(),{isSelected:r,toggleSelection:i}=_5(),a=Sa(),s=r(e.id),o=C.useRef(null),[l,u]=C.useState(!1),[d,c]=C.useState(null),[m,g]=C.useState(null),[_,x]=C.useState(!1),b=C.useRef(!1);C.useEffect(()=>{const T=o.current;if(!(!T||t))return _1(hle({element:T,getInitialData:()=>({type:"task",taskId:e.id,status:e.status}),onGenerateDragPreview:({nativeSetDragImage:w})=>{Rje({nativeSetDragImage:w,getOffset:Dje({x:"16px",y:"8px"}),render:({container:A})=>{g(A)}})},onDragStart:()=>{u(!0),n(e),b.current=!0},onDrop:()=>{u(!1),n(null),g(null)}}),tT({element:T,getData:({input:w,element:A})=>{const O={type:"task",taskId:e.id,status:e.status};return gle(O,{input:w,element:A,allowedEdges:["top","bottom"]})},canDrop:({source:w})=>w.data.taskId!==e.id,onDragEnter:({self:w})=>{c(xm(w.data))},onDrag:({self:w})=>{c(xm(w.data))},onDragLeave:()=>{c(null)},onDrop:()=>{c(null)}}))},[e,t,n]);const v=()=>{b.current=!1},y=()=>{if(b.current){b.current=!1;return}a({to:"/tasks/$taskId",params:{taskId:e.id}}),b.current=!1},E=p.jsxs("div",{className:"group/card relative",children:[!t&&p.jsx("div",{className:ze("absolute left-2 top-2 z-20 transition-opacity",s?"opacity-100":"opacity-0 group-hover/card:opacity-100"),onPointerDown:T=>T.stopPropagation(),children:p.jsx(Ar,{checked:s,onCheckedChange:()=>i(e.id)})}),p.jsxs(Ua,{ref:t?void 0:o,onPointerDown:v,onClick:y,className:ze("transition-shadow hover:shadow-md relative cursor-grab active:cursor-grabbing",l&&"opacity-50",s&&"ring-2 ring-primary bg-primary/5"),children:[d&&p.jsx("div",{className:ze("absolute left-0 right-0 h-0.5 bg-primary z-10",d==="top"&&"-top-1",d==="bottom"&&"-bottom-1")}),p.jsxs(Lje,{className:ze("p-3 pb-1 flex flex-row items-start justify-between gap-2",!t&&"pl-8"),children:[p.jsx(Pje,{className:"text-sm font-medium leading-tight flex-1",children:e.title}),!t&&p.jsx("button",{type:"button",className:"shrink-0 p-0.5 -m-0.5 rounded hover:bg-muted transition-colors cursor-pointer",onClick:T=>{T.stopPropagation(),x(!0)},onPointerDown:T=>T.stopPropagation(),children:p.jsx(te,{icon:My,size:14,strokeWidth:2,className:"text-muted-foreground"})})]}),p.jsxs(Fd,{className:"p-3 pt-1",children:[e.description&&p.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:e.description}),p.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-muted-foreground/70",children:[p.jsx(te,{icon:Ds,size:12,strokeWidth:2}),p.jsx("span",{children:e.repoName}),e.prUrl&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted-foreground/30",children:"•"}),p.jsx(te,{icon:Ku,size:12,strokeWidth:2,className:"text-foreground"})]}),e.linearTicketId&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted-foreground/30",children:"•"}),p.jsx(te,{icon:gie,size:12,strokeWidth:2,className:"text-foreground"})]})]})]})]})]});return p.jsxs(p.Fragment,{children:[E,m&&jr.createPortal(p.jsx("div",{className:"w-72 max-w-[90vw]",children:p.jsx(xle,{task:e,isDragPreview:!0})}),m),p.jsx(_le,{task:e,open:_,onOpenChange:x})]})}const Bje={IN_PROGRESS:"border-t-status-in-progress",IN_REVIEW:"border-t-status-in-review",DONE:"border-t-status-done",CANCELED:"border-t-status-canceled"};function uG({status:e,tasks:t,isMobile:n}){const{t:r}=Ct("common"),i=C.useRef(null),[a,s]=C.useState(!1),o=[...t].sort((l,u)=>new Date(u.updatedAt).getTime()-new Date(l.updatedAt).getTime());return C.useEffect(()=>{const l=i.current;if(l)return tT({element:l,getData:()=>({type:"column",status:e}),canDrop:({source:u})=>u.data.type==="task",onDragEnter:()=>s(!0),onDragLeave:()=>s(!1),onDrop:()=>s(!1)})},[e]),p.jsxs("div",{ref:i,className:ze("flex flex-col rounded-lg border border-t-4 bg-card",n?"h-full w-full":"h-full w-72 min-w-52 flex-shrink",Bje[e],a&&"ring-2 ring-primary ring-offset-2 ring-offset-background"),children:[!n&&p.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[p.jsx("h3",{className:"text-sm font-medium",children:r(`statuses.${e}`)}),p.jsx("span",{className:"flex h-5 min-w-5 items-center justify-center rounded-full bg-muted px-1.5 text-xs font-medium",children:t.length})]}),p.jsx(Bg,{className:"min-h-0 flex-1",children:p.jsx("div",{className:"flex flex-col gap-2 p-2",children:o.map(l=>p.jsx(xle,{task:l},l.id))})})]})}function Uje(){const{selectedIds:e,clearSelection:t}=_5(),n=qAe(),{data:r=[]}=PC(),[i,a]=C.useState(!0),s=e.size,{pinnedCount:o,unpinnedWithWorktreeCount:l}=C.useMemo(()=>{const c=r.filter(m=>e.has(m.id));return{pinnedCount:c.filter(m=>m.pinned).length,unpinnedWithWorktreeCount:c.filter(m=>!m.pinned&&m.worktreePath).length}},[r,e]),u=l>0,d=()=>{n.mutate({ids:Array.from(e),deleteLinkedWorktrees:i},{onSuccess:()=>{t()}})};return s===0?null:p.jsx("div",{className:ze("fixed inset-x-0 bottom-0 z-40 border-t bg-background/95 backdrop-blur-sm","animate-in slide-in-from-bottom-2 duration-200"),children:p.jsxs("div",{className:"mx-auto flex max-w-7xl items-center justify-between gap-4 px-4 py-3",children:[p.jsxs("span",{className:"text-sm text-muted-foreground",children:[s," task",s!==1?"s":""," selected"]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Be,{variant:"ghost",size:"sm",onClick:t,children:"Clear"}),p.jsxs(lc,{children:[p.jsx(ele,{render:p.jsx(Be,{variant:"destructive",size:"sm",disabled:n.isPending}),children:n.isPending?"Deleting...":"Delete"}),p.jsxs(uc,{children:[p.jsxs(cc,{children:[p.jsxs(fc,{children:["Delete ",s," Task",s!==1?"s":""]}),p.jsxs(pc,{children:["This will permanently delete ",s," task",s!==1?"s":"",". This action cannot be undone."]}),o>0&&p.jsxs("p",{className:"flex items-center gap-1.5 text-sm text-primary",children:[p.jsx(te,{icon:cS,size:14,strokeWidth:2}),o," pinned worktree",o!==1?"s":""," will be preserved"]})]}),u&&p.jsxs("div",{className:"flex items-center gap-2 py-2",children:[p.jsx(Ar,{id:"bulk-delete-worktrees",checked:i,onCheckedChange:c=>a(c===!0)}),p.jsx("label",{htmlFor:"bulk-delete-worktrees",className:"cursor-pointer text-sm",children:"Also delete linked worktrees"})]}),p.jsxs(dc,{children:[p.jsx(hc,{children:"Cancel"}),p.jsx(qg,{onClick:d,variant:"destructive",disabled:n.isPending,children:n.isPending?"Deleting...":"Delete"})]})]})]})]})]})})}const wO=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED"];function $je({status:e}){const{t}=Ct("common"),n=C.useRef(null),[r,i]=C.useState(!1);return C.useEffect(()=>{const a=n.current;if(a)return tT({element:a,getData:()=>({type:"column",status:e}),canDrop:({source:s})=>s.data.type==="task",onDragEnter:()=>i(!0),onDragLeave:()=>i(!1),onDrop:()=>i(!1)})},[e]),p.jsx("div",{ref:n,className:ze("flex-1 rounded-lg border-2 border-dashed px-3 py-2 text-center text-xs font-medium transition-colors",r?"border-primary bg-primary/10 text-primary":"border-muted-foreground/30 text-muted-foreground"),children:t(`statuses.${e}`)})}function zje({repoFilter:e,searchQuery:t}){const{t:n}=Ct("common"),{data:r=[],isLoading:i}=PC(),a=WAe(),{activeTask:s}=vle(),{clearSelection:o,selectedIds:l}=_5(),[u,d]=C.useState("IN_PROGRESS");C.useEffect(()=>{const g=_=>{_.key==="Escape"&&l.size>0&&o()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[o,l.size]);const c=C.useMemo(()=>{let g=r;return e&&(g=g.filter(_=>_.repoName===e)),t?.trim()?g=g.map(_=>({task:_,score:Math.max(ts(_.title,t),ts(_.description||"",t),ts(_.branch||"",t),ts(_.linearTicketId||"",t),ts(_.prUrl||"",t))})).filter(({score:_})=>_>0).sort((_,x)=>x.score-_.score).map(({task:_})=>_):g=[...g].sort((_,x)=>new Date(x.updatedAt).getTime()-new Date(_.updatedAt).getTime()),g},[r,e,t]),m=C.useMemo(()=>{const g={IN_PROGRESS:0,IN_REVIEW:0,DONE:0,CANCELED:0};for(const _ of c)g[_.status]++;return g},[c]);return C.useEffect(()=>ple({canMonitor:({source:g})=>g.data.type==="task",onDrop:({source:g,location:_})=>{const x=_.current.dropTargets;if(x.length===0)return;const b=g.data.taskId,v=c.find(T=>T.id===b);if(!v)return;const y=x[0],E=y.data;if(E.type==="column"){const T=E.status;if(T!==v.status){const w=c.filter(A=>A.status===T);a.mutate({taskId:b,status:T,position:w.length})}}else if(E.type==="task"){const T=xm(y.data),w=E.status,A=c.filter(N=>N.status===w).sort((N,D)=>N.position-D.position),O=A.findIndex(N=>N.id===E.taskId);let R=O;T==="bottom"&&(R=O+1),v.status===w&&A.findIndex(D=>D.id===b)<O&&(R=Math.max(0,R-1)),(v.status!==w||R!==v.position)&&a.mutate({taskId:b,status:w,position:R})}}}),[c,a]),i?p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx("p",{className:"text-muted-foreground",children:"Loading tasks..."})}):p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsx("div",{className:"border-b bg-background lg:hidden",children:p.jsx(Ko,{value:u,onValueChange:g=>d(g),children:p.jsx(Yo,{variant:"line",className:"w-full justify-start px-4",children:wO.map(g=>p.jsxs(Vn,{value:g,className:"gap-1.5",children:[p.jsx("span",{className:"truncate",children:n(`statuses.${g}`)}),p.jsx("span",{className:"text-muted-foreground",children:m[g]})]},g))})})}),p.jsx("div",{className:"hidden h-full justify-center gap-4 overflow-x-auto p-4 lg:flex",children:wO.map(g=>p.jsx(uG,{status:g,tasks:c.filter(_=>_.status===g)},g))}),p.jsx("div",{className:"flex-1 overflow-y-auto p-4 lg:hidden",children:p.jsx(uG,{status:u,tasks:c.filter(g=>g.status===u),isMobile:!0})}),s&&p.jsx("div",{className:"fixed inset-x-0 bottom-0 flex gap-2 border-t bg-background/95 p-4 backdrop-blur-sm lg:hidden",children:wO.filter(g=>g!==u).map(g=>p.jsx($je,{status:g},g))}),p.jsx(Uje,{})]})}function Hje(e){return p.jsx(jje,{children:p.jsx(Mje,{children:p.jsx(zje,{...e})})})}const Ele=Si("/tasks/")({component:Vje,validateSearch:e=>({repo:typeof e.repo=="string"?e.repo:void 0})});function Vje(){const{t:e}=Ct("tasks"),{data:t=[]}=PC(),{repo:n}=Ele.useSearch(),r=Sa(),[i,a]=C.useState(""),s=C.useCallback(l=>{r({to:"/tasks",search:l?{repo:l}:{},replace:!0})},[r]),o=C.useMemo(()=>{const l=new Set(t.map(u=>u.repoName));return Array.from(l).sort()},[t]);return p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-background px-4 py-2",children:[p.jsxs("div",{className:"relative min-w-0 flex-1 sm:max-w-64 sm:flex-none",children:[p.jsx(te,{icon:jg,size:12,strokeWidth:2,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),p.jsx(Ht,{value:i,onChange:l=>a(l.target.value),placeholder:e("searchPlaceholder"),className:"w-full pl-6"})]}),p.jsxs(mi,{value:n??"",onValueChange:l=>s(l||null),children:[p.jsxs(bi,{size:"sm",className:"shrink-0 gap-1.5",children:[p.jsx(te,{icon:uS,size:12,strokeWidth:2,className:"text-muted-foreground"}),p.jsx(gi,{children:n??e("allProjects")})]}),p.jsxs(vi,{className:"min-w-[160px]",children:[p.jsx(gn,{value:"",children:e("allProjects")}),o.map(l=>p.jsx(gn,{value:l,children:l},l))]})]})]}),p.jsx("div",{className:"flex-1 overflow-hidden",children:p.jsx(Hje,{repoFilter:n??null,searchQuery:i})})]})}function ao({className:e,size:t="default",...n}){return p.jsx(fAe,{"data-slot":"switch","data-size":t,className:ze("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-[16.6px] data-[size=default]:w-[28px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:p.jsx(pAe,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-3.5 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}function Wje(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Gje(e,t=[]){let n=[];function r(a,s){const o=C.createContext(s),l=n.length;n=[...n,s];const u=c=>{const{scope:m,children:g,..._}=c,x=m?.[e]?.[l]||o,b=C.useMemo(()=>_,Object.values(_));return p.jsx(x.Provider,{value:b,children:g})};u.displayName=a+"Provider";function d(c,m){const g=m?.[e]?.[l]||o,_=C.useContext(g);if(_)return _;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${a}\``)}return[u,d]}const i=()=>{const a=n.map(s=>C.createContext(s));return function(o){const l=o?.[e]||a;return C.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,qje(i,...t)]}function qje(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:l,scopeName:u})=>{const c=l(a)[`__scope${u}`];return{...o,...c}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Yy=globalThis?.document?C.useLayoutEffect:()=>{},Kje=Qw[" useInsertionEffect ".trim().toString()]||Yy;function Yje({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,s]=Xje({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:i;{const d=C.useRef(e!==void 0);C.useEffect(()=>{const c=d.current;c!==o&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${o?"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.`),d.current=o},[o,r])}const u=C.useCallback(d=>{if(o){const c=Zje(d)?d(e):d;c!==e&&s.current?.(c)}else a(d)},[o,e,a,s]);return[l,u]}function Xje({defaultProp:e,onChange:t}){const[n,r]=C.useState(e),i=C.useRef(n),a=C.useRef(t);return Kje(()=>{a.current=t},[t]),C.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Zje(e){return typeof e=="function"}function cG(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Sle(...e){return t=>{let n=!1;const r=e.map(i=>{const a=cG(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():cG(e[i],null)}}}}function wle(...e){return C.useCallback(Sle(...e),e)}function Qje(e){const t=Jje(e),n=C.forwardRef((r,i)=>{const{children:a,...s}=r,o=C.Children.toArray(a),l=o.find(t5e);if(l){const u=l.props.children,d=o.map(c=>c===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:c);return p.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,d):null})}return p.jsx(t,{...s,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function Jje(e){const t=C.forwardRef((n,r)=>{const{children:i,...a}=n;if(C.isValidElement(i)){const s=r5e(i),o=n5e(a,i.props);return i.type!==C.Fragment&&(o.ref=r?Sle(r,s):s),C.cloneElement(i,o)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var e5e=Symbol("radix.slottable");function t5e(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===e5e}function n5e(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{const l=a(...o);return i(...o),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function r5e(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 i5e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],x5=i5e.reduce((e,t)=>{const n=Qje(`Primitive.${t}`),r=C.forwardRef((i,a)=>{const{asChild:s,...o}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...o,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function a5e(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var Cle=e=>{const{present:t,children:n}=e,r=s5e(t),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),a=wle(r.ref,o5e(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:a}):null};Cle.displayName="Presence";function s5e(e){const[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),a=C.useRef("none"),s=e?"mounted":"unmounted",[o,l]=a5e(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=Fx(r.current);a.current=o==="mounted"?u:"none"},[o]),Yy(()=>{const u=r.current,d=i.current;if(d!==e){const m=a.current,g=Fx(u);e?l("MOUNT"):g==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&m!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Yy(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,c=g=>{const x=Fx(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&x&&(l("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=g=>{g.target===t&&(a.current=Fx(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:C.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Fx(e){return e?.animationName||"none"}function o5e(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 l5e=Qw[" useId ".trim().toString()]||(()=>{}),u5e=0;function c5e(e){const[t,n]=C.useState(l5e());return Yy(()=>{n(r=>r??String(u5e++))},[e]),e||(t?`radix-${t}`:"")}var nT="Collapsible",[d5e]=Gje(nT),[f5e,E5]=d5e(nT),Tle=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:s,...o}=e,[l,u]=Yje({prop:r,defaultProp:i??!1,onChange:s,caller:nT});return p.jsx(f5e,{scope:n,disabled:a,contentId:c5e(),open:l,onOpenToggle:C.useCallback(()=>u(d=>!d),[u]),children:p.jsx(x5.div,{"data-state":w5(l),"data-disabled":a?"":void 0,...o,ref:t})})});Tle.displayName=nT;var Ale="CollapsibleTrigger",kle=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=E5(Ale,n);return p.jsx(x5.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":w5(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Wje(e.onClick,i.onOpenToggle)})});kle.displayName=Ale;var S5="CollapsibleContent",Ole=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=E5(S5,e.__scopeCollapsible);return p.jsx(Cle,{present:n||i.open,children:({present:a})=>p.jsx(p5e,{...r,ref:t,present:a})})});Ole.displayName=S5;var p5e=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...a}=e,s=E5(S5,n),[o,l]=C.useState(r),u=C.useRef(null),d=wle(t,u),c=C.useRef(0),m=c.current,g=C.useRef(0),_=g.current,x=s.open||o,b=C.useRef(x),v=C.useRef(void 0);return C.useEffect(()=>{const y=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(y)},[]),Yy(()=>{const y=u.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const E=y.getBoundingClientRect();c.current=E.height,g.current=E.width,b.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),l(r)}},[s.open,r]),p.jsx(x5.div,{"data-state":w5(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!x,...a,ref:d,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:x&&i})});function w5(e){return e?"open":"closed"}var h5e=Tle;const Rle=h5e,Nle=kle,Ile=Ole,m5e=Si("/settings/")({component:g5e});function Mu({title:e,children:t}){return p.jsxs("div",{className:"relative rounded-lg border border-border bg-card p-4 pt-6",children:[p.jsx("span",{className:"absolute -top-2.5 left-3 rounded bg-card px-2 text-xs font-medium text-muted-foreground",children:e}),t]})}function g5e(){const{t:e}=Ct("settings"),{t}=Ct("common"),n=typeof window<"u"&&window.parent!==window,{data:r,isLoading:i}=jae(),{data:a,isLoading:s}=Hj(),{data:o,isLoading:l}=u1(),{data:u,isLoading:d}=c1(),{data:c,isLoading:m}=d1(),{data:g,isLoading:_}=ike(),{data:x,isLoading:b}=ake(),{data:v,isLoading:y}=Vj(),{data:E,isLoading:T}=Wj(),{data:w,isLoading:A}=Fae(),{data:O,isLoading:R}=Bae(),{data:N,isLoading:D}=dke(),{data:L,isLoading:U}=hke(),{data:M,isLoading:W}=Coe(),z=jPe(),{data:H}=gke(),q=bke(),{savedLanguage:K,changeLanguage:$}=Vae(),{theme:j,syncClaudeCode:F,changeTheme:G}=Ooe(),{data:V}=lke(),{data:J}=uke(),{version:ae}=vke(),se=Uae(),Z=cke(),Y=fke(),Q=mke(),re=pke(),[oe,ee]=C.useState(""),[ve,Ee]=C.useState(""),[me,Se]=C.useState("vscode"),[xe,Ye]=C.useState(""),[Ue,je]=C.useState(""),[we,Ne]=C.useState(""),[_e,pe]=C.useState(""),[Ae,he]=C.useState("claude"),[Oe,ge]=C.useState(null),[Ie,We]=C.useState("build"),[mt,lt]=C.useState("plan"),[dt,$e]=C.useState(!1),[ht,Re]=C.useState(!1),[de,Te]=C.useState(!0),[Ke,st]=C.useState(!0),[Bt,zt]=C.useState(!0),[Mt,bt]=C.useState(!1),[en,Wt]=C.useState(!1),[St,Xt]=C.useState(""),[De,yt]=C.useState(!1),[nt,_n]=C.useState(""),[Bn,ar]=C.useState(!1),[sr,ca]=C.useState(""),[Rr,Hr]=C.useState(""),[gr,Nr]=C.useState(!1),[Va,da]=C.useState(""),[hs,oh]=C.useState("glm-4.5-air"),[pu,yl]=C.useState("glm-4.7"),[ko,zs]=C.useState("glm-4.7"),[Vi,_l]=C.useState(""),[Ai,Ir]=C.useState(""),[Vr,ki]=C.useState(!1),[Oi,Wa]=C.useState("light-ansi"),[Nc,hu]=C.useState("dark-ansi"),[xl,rf]=C.useState(!1),[Hs,Vs]=C.useState(!1),[fa,Wi]=C.useState(!1),mu=C.useRef(null);C.useEffect(()=>{r!==void 0&&ee(String(r)),a!==void 0&&Ee(a),o!==void 0&&Se(o),u!==void 0&&Ye(u),c!==void 0&&je(String(c)),g!==void 0&&Ne(g),x!==void 0&&pe(x),v!==void 0&&he(v),E!==void 0&&ge(E),w!==void 0&&We(w),O!==void 0&&lt(O)},[r,a,o,u,c,g,x,v,E,w,O]),C.useEffect(()=>{N&&(Te(N.enabled),st(N.toast?.enabled??!0),zt(N.desktop?.enabled??!0),bt(N.sound?.enabled??!1),Vs(!!N.sound?.customSoundFile),Wt(N.slack?.enabled??!1),Xt(N.slack?.webhookUrl??""),yt(N.discord?.enabled??!1),_n(N.discord?.webhookUrl??""),ar(N.pushover?.enabled??!1),ca(N.pushover?.appToken??""),Hr(N.pushover?.userKey??""))},[N]),C.useEffect(()=>{L&&(Nr(L.enabled),da(L.apiKey??""),oh(L.haikuModel),yl(L.sonnetModel),zs(L.opusModel))},[L]),C.useEffect(()=>{M?.cloudflareApiToken!==void 0&&_l(M.cloudflareApiToken??""),M?.cloudflareAccountId!==void 0&&Ir(M.cloudflareAccountId??"")},[M]),C.useEffect(()=>{F!==void 0&&ki(F),V!==void 0&&Wa(V),J!==void 0&&hu(J)},[F,V,J]);const Zt=i||s||l||d||m||_||b||y||T||A||R||D||U||W,Ic=L&&(gr!==L.enabled||Va!==(L.apiKey??"")||hs!==L.haikuModel||pu!==L.sonnetModel||ko!==L.opusModel),gu=Vr!==(F??!1)||Oi!==V||Nc!==J,Oo=(()=>{const He=M?.cloudflareApiToken??"",jt=M?.cloudflareAccountId??"",Gi=Vi!==He&&!Vi.match(/^•+$/),ma=Ai!==jt&&!Ai.match(/^•+$/);return Gi||ma})(),Dc=N&&(de!==N.enabled||Ke!==(N.toast?.enabled??!0)||Bt!==(N.desktop?.enabled??!0)||Mt!==(N.sound?.enabled??!1)||en!==(N.slack?.enabled??!1)||St!==(N.slack?.webhookUrl??"")||De!==(N.discord?.enabled??!1)||nt!==(N.discord?.webhookUrl??"")||Bn!==(N.pushover?.enabled??!1)||sr!==(N.pushover?.appToken??"")||Rr!==(N.pushover?.userKey??"")),pa=me!==o||xe!==u||Ue!==String(c),af=Ae!==v||Oe!==(E??null)||Ie!==w||mt!==O,lh=oe!==String(r)||ve!==a||we!==g||_e!==x||af||pa||Dc||Ic||gu||Oo,sf=async()=>{const He=[];if(oe!==String(r)){const jt=parseInt(oe,10);!isNaN(jt)&&jt>=1&&jt<=65535&&He.push(new Promise(Gi=>{se.mutate({key:sn.PORT,value:jt},{onSettled:Gi})}))}if(ve!==a&&He.push(new Promise(jt=>{se.mutate({key:sn.DEFAULT_GIT_REPOS_DIR,value:ve},{onSettled:jt})})),me!==o&&He.push(new Promise(jt=>{se.mutate({key:sn.EDITOR_APP,value:me},{onSettled:jt})})),xe!==u&&He.push(new Promise(jt=>{se.mutate({key:sn.EDITOR_HOST,value:xe},{onSettled:jt})})),Ue!==String(c)){const jt=parseInt(Ue,10);!isNaN(jt)&&jt>=1&&jt<=65535&&He.push(new Promise(Gi=>{se.mutate({key:sn.EDITOR_SSH_PORT,value:jt},{onSettled:Gi})}))}if(we!==g&&He.push(new Promise(jt=>{se.mutate({key:sn.LINEAR_API_KEY,value:we},{onSettled:jt})})),_e!==x&&He.push(new Promise(jt=>{se.mutate({key:sn.GITHUB_PAT,value:_e},{onSettled:jt})})),Ae!==v&&He.push(new Promise(jt=>{se.mutate({key:sn.DEFAULT_AGENT,value:Ae},{onSettled:jt})})),Oe!==(E??null)&&He.push(new Promise(jt=>{se.mutate({key:sn.OPENCODE_MODEL,value:Oe},{onSettled:jt})})),Ie!==w&&He.push(new Promise(jt=>{se.mutate({key:sn.OPENCODE_DEFAULT_AGENT,value:Ie},{onSettled:jt})})),mt!==O&&He.push(new Promise(jt=>{se.mutate({key:sn.OPENCODE_PLAN_AGENT,value:mt},{onSettled:jt})})),Dc&&He.push(new Promise(jt=>{Y.mutate({enabled:de,toast:{enabled:Ke},desktop:{enabled:Bt},sound:{enabled:Mt},slack:{enabled:en,webhookUrl:St},discord:{enabled:De,webhookUrl:nt},pushover:{enabled:Bn,appToken:sr,userKey:Rr}},{onSettled:jt})})),Ic&&He.push(new Promise(jt=>{Q.mutate({enabled:gr,apiKey:Va||null,haikuModel:hs,sonnetModel:pu,opusModel:ko},{onSettled:jt})})),gu&&(Vr!==(F??!1)&&He.push(new Promise(jt=>{se.mutate({key:sn.SYNC_CLAUDE_CODE_THEME,value:Vr},{onSettled:jt})})),Oi!==V&&He.push(new Promise(jt=>{se.mutate({key:sn.CLAUDE_CODE_LIGHT_THEME,value:Oi},{onSettled:jt})})),Nc!==J&&He.push(new Promise(jt=>{se.mutate({key:sn.CLAUDE_CODE_DARK_THEME,value:Nc},{onSettled:jt})}))),Oo){const jt=M?.cloudflareApiToken??"",Gi=M?.cloudflareAccountId??"",ma={};Vi!==jt&&!Vi.match(/^•+$/)&&(ma.cloudflareApiToken=Vi||null),Ai!==Gi&&!Ai.match(/^•+$/)&&(ma.cloudflareAccountId=Ai||null),Object.keys(ma).length>0&&He.push(new Promise(Do=>{z.mutate(ma,{onSettled:Do})}))}await Promise.all(He),Re(!0),setTimeout(()=>Re(!1),2e3)},El=()=>{Z.mutate(sn.PORT,{onSuccess:He=>{He.value!==null&&ee(String(He.value))}})},uh=()=>{Z.mutate(sn.DEFAULT_GIT_REPOS_DIR,{onSuccess:He=>{He.value&&Ee(String(He.value))}})},vt=()=>{Z.mutate(sn.EDITOR_APP,{onSuccess:He=>{He.value!==null&&He.value!==void 0&&Se(He.value)}})},Dt=()=>{Z.mutate(sn.EDITOR_HOST,{onSuccess:He=>{Ye(He.value!==null&&He.value!==void 0?String(He.value):"")}})},tn=()=>{Z.mutate(sn.EDITOR_SSH_PORT,{onSuccess:He=>{He.value!==null&&He.value!==void 0&&je(String(He.value))}})},Yn=()=>{Z.mutate(sn.LINEAR_API_KEY,{onSuccess:He=>{Ne(He.value!==null&&He.value!==void 0?String(He.value):"")}})},br=()=>{Z.mutate(sn.GITHUB_PAT,{onSuccess:He=>{pe(He.value!==null&&He.value!==void 0?String(He.value):"")}})},Fr=()=>{Z.mutate(sn.DEFAULT_AGENT,{onSuccess:He=>{he(He.value??"claude")}})},Ro=()=>{Z.mutate(sn.OPENCODE_MODEL,{onSuccess:He=>{ge(He.value!==null&&He.value!==void 0?String(He.value):null)}})},No=()=>{Z.mutate(sn.OPENCODE_DEFAULT_AGENT,{onSuccess:He=>{We(He.value??"build")}})},Io=()=>{Z.mutate(sn.OPENCODE_PLAN_AGENT,{onSuccess:He=>{lt(He.value??"plan")}})},ha=async He=>{re.mutate(He,{onSuccess:jt=>{jt.success?Et.success(e("notifications.testSuccess",{channel:He})):Et.error(e("notifications.testFailed",{channel:He,error:jt.error}))},onError:jt=>{Et.error(e("notifications.testFailed",{channel:He,error:jt.message}))}})},ch=async He=>{const jt=He.target.files?.[0];if(jt){Wi(!0);try{const Gi=new FormData;Gi.append("file",jt);const ma=await fetch("/api/uploads/sound",{method:"POST",body:Gi});if(!ma.ok){const Do=await ma.json();throw new Error(Do.error||"Upload failed")}Vs(!0),Et.success(e("notifications.soundUploaded"))}catch(Gi){Et.error(e("notifications.soundUploadFailed",{error:Gi instanceof Error?Gi.message:"Unknown error"}))}finally{Wi(!1),mu.current&&(mu.current.value="")}}},bb=async()=>{try{if(!(await fetch("/api/uploads/sound",{method:"DELETE"})).ok)throw new Error("Delete failed");Vs(!1),Et.success(e("notifications.soundDeleted"))}catch{Et.error(e("notifications.soundDeleteFailed"))}};return p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-background px-4 py-2",children:[p.jsx("h1",{className:"text-sm font-medium",children:e("title")}),ae&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",ae]})]}),p.jsx("div",{className:"flex-1 overflow-auto p-6",children:p.jsxs("div",{className:"mx-auto max-w-5xl space-y-4",children:[p.jsx(Mu,{title:e("sections.server"),children:p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.port.label")}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ht,{type:"number",min:1,max:65535,value:oe,onChange:He=>ee(He.target.value),placeholder:"7777",disabled:Zt,className:"w-24 font-mono text-sm"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:El,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.port.description")})]})}),p.jsx(Mu,{title:e("sections.paths"),children:p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.gitReposDir.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsx(Ht,{value:ve,onChange:He=>Ee(He.target.value),placeholder:"~/projects",disabled:Zt,className:"flex-1 font-mono text-sm"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>$e(!0),disabled:Zt,title:t("buttons.browse"),children:p.jsx(te,{icon:Ba,size:14,strokeWidth:2})}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:uh,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.gitReposDir.description")})]})}),p.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[p.jsx(Mu,{title:e("sections.editor"),children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.editor.app.label")}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(mi,{value:me,onValueChange:He=>Se(He),children:[p.jsx(bi,{className:"w-32",children:p.jsx(gi,{})}),p.jsxs(vi,{children:[p.jsx(gn,{value:"vscode",children:"VS Code"}),p.jsx(gn,{value:"cursor",children:"Cursor"}),p.jsx(gn,{value:"windsurf",children:"Windsurf"}),p.jsx(gn,{value:"zed",children:"Zed"}),p.jsx(gn,{value:"antigravity",children:"Antigravity"})]})]}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:vt,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.editor.app.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.editor.host.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsx(Ht,{value:xe,onChange:He=>Ye(He.target.value),placeholder:e("fields.editor.host.placeholder"),disabled:Zt,className:"flex-1 font-mono text-sm"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Dt,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.editor.host.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.editor.sshPort.label")}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ht,{type:"number",min:1,max:65535,value:Ue,onChange:He=>je(He.target.value),placeholder:"22",disabled:Zt,className:"w-20 font-mono text-sm"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:tn,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.editor.sshPort.description")})]})]})}),p.jsx(Mu,{title:e("sections.integrations"),children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.linear.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Ht,{type:"password",value:we,onChange:He=>Ne(He.target.value),placeholder:"lin_api_...",disabled:Zt,className:"flex-1 pr-8 font-mono text-sm"}),!!g&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Yn,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.linear.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.github.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Ht,{type:"password",value:_e,onChange:He=>pe(He.target.value),placeholder:"ghp_...",disabled:Zt,className:"flex-1 pr-8 font-mono text-sm"}),!!x&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:br,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.github.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.cloudflare.label")}),p.jsx("div",{className:"flex flex-1 items-center gap-2",children:p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Ht,{type:"password",value:Vi,onChange:He=>_l(He.target.value),placeholder:e("fields.cloudflare.placeholder"),disabled:Zt,className:"flex-1 pr-8 font-mono text-sm"}),!!M?.cloudflareApiToken&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]})})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.cloudflare.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:"Account ID"}),p.jsx("div",{className:"flex flex-1 items-center gap-2",children:p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Ht,{type:"password",value:Ai,onChange:He=>Ir(He.target.value),placeholder:"CF Account ID",disabled:Zt,className:"flex-1 pr-8 font-mono text-sm"}),!!M?.cloudflareAccountId&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]})})]}),p.jsxs("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:["Required for Cloudflare Tunnel. Find in your dashboard URL: dash.cloudflare.com/","<account_id>","/..."]})]})]})})]}),p.jsx(Mu,{title:e("sections.zai"),children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.zai.enable")}),p.jsx(ao,{checked:gr,onCheckedChange:Nr,disabled:Zt})]}),gr&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.zai.apiKey")}),p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Ht,{type:"password",value:Va,onChange:He=>da(He.target.value),placeholder:"zai_...",disabled:Zt,className:"flex-1 pr-8 font-mono text-sm"}),!!L?.apiKey&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:e("fields.zai.description")})]}),p.jsxs("div",{className:"space-y-3 border-t border-border pt-4",children:[p.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("fields.zai.modelMappings")}),p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.zai.haiku")}),p.jsx(Ht,{value:hs,onChange:He=>oh(He.target.value),placeholder:"glm-4.5-air",disabled:Zt,className:"flex-1 font-mono text-sm"})]}),p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.zai.sonnet")}),p.jsx(Ht,{value:pu,onChange:He=>yl(He.target.value),placeholder:"glm-4.7",disabled:Zt,className:"flex-1 font-mono text-sm"})]}),p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:e("fields.zai.opus")}),p.jsx(Ht,{value:ko,onChange:He=>zs(He.target.value),placeholder:"glm-4.7",disabled:Zt,className:"flex-1 font-mono text-sm"})]})]})]})]})}),p.jsxs(Mu,{title:e("sections.agent"),children:[p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.agent.default.label")}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(mi,{value:Ae,onValueChange:He=>he(He),children:[p.jsx(bi,{className:"w-40",children:p.jsx(gi,{})}),p.jsx(vi,{children:Object.keys(il).map(He=>p.jsx(gn,{value:He,children:il[He]},He))})]}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Fr,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.agent.default.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.agent.opencodeModel.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsx(Gj,{value:Oe,onChange:ge,placeholder:e("fields.agent.opencodeModel.placeholder"),className:"w-64"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Ro,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.agent.opencodeModel.description")})]})]}),p.jsxs(Rle,{className:"mt-4 space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start",children:[p.jsxs(Nle,{className:"group flex cursor-pointer items-center gap-1.5 text-left text-sm text-muted-foreground transition-colors hover:text-foreground sm:w-32 sm:shrink-0",children:[p.jsx(te,{icon:Mg,size:12,strokeWidth:2,className:"shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180"}),p.jsx("span",{children:e("fields.agent.advancedAgentNames.label")})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:pt-0.5",children:e("fields.agent.advancedAgentNames.description")})]}),p.jsxs(Ile,{className:"space-y-4 pt-2 sm:ml-32 sm:pl-2",children:[p.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-500/20 bg-amber-500/10 p-3",children:[p.jsx(te,{icon:ai,size:16,strokeWidth:2,className:"mt-0.5 shrink-0 text-amber-600 dark:text-amber-400"}),p.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:e("fields.agent.advancedAgentNames.warning")})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.agent.opencodeDefaultAgent.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsx(Ht,{value:Ie??"build",onChange:He=>We(He.target.value),placeholder:"build",disabled:Zt,className:"font-mono text-sm"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:No,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.agent.opencodeDefaultAgent.description")})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.agent.opencodePlanAgent.label")}),p.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[p.jsx(Ht,{value:mt??"plan",onChange:He=>lt(He.target.value),placeholder:"plan",disabled:Zt,className:"font-mono text-sm"}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Io,disabled:Zt||Z.isPending,title:t("buttons.reset"),children:p.jsx(te,{icon:Fo,size:14,strokeWidth:2})})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.agent.opencodePlanAgent.description")})]})]})]})]}),p.jsx(Mu,{title:e("sections.notifications"),children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-40 sm:shrink-0",children:e("notifications.enable")}),p.jsx(ao,{checked:de,onCheckedChange:Te,disabled:Zt})]}),p.jsxs("div",{className:"space-y-2 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ao,{checked:Ke,onCheckedChange:st,disabled:Zt||!de}),p.jsx("label",{className:"text-sm text-muted-foreground",children:e("notifications.toast")})]}),p.jsx("p",{className:"ml-10 text-xs text-muted-foreground",children:e("notifications.toastDescription")})]}),p.jsxs("div",{className:"space-y-2 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ao,{checked:Bt,onCheckedChange:zt,disabled:Zt||!de}),p.jsx("label",{className:"text-sm text-muted-foreground",children:e("notifications.desktop")})]}),p.jsx("p",{className:"ml-10 text-xs text-muted-foreground",children:e("notifications.desktopDescription")})]}),p.jsxs("div",{className:"space-y-2 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ao,{checked:Mt,onCheckedChange:bt,disabled:Zt||!de}),p.jsx("label",{className:"text-sm text-muted-foreground",children:e("notifications.sound")}),p.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[p.jsx("input",{ref:mu,type:"file",accept:"audio/mpeg,audio/mp3,audio/wav,audio/ogg",className:"hidden",onChange:ch}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>mu.current?.click(),disabled:Zt||!de||!Mt||fa,title:e("notifications.uploadSound"),children:fa?p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin"}):p.jsx(te,{icon:KSe,size:14,strokeWidth:2})}),Hs&&p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:bb,disabled:Zt||!de||!Mt,title:e("notifications.deleteSound"),children:p.jsx(te,{icon:rl,size:14,strokeWidth:2})}),p.jsx(Be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>ha("sound"),disabled:Zt||!de||!Mt||re.isPending,title:e("notifications.testSound"),children:re.isPending?p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin"}):p.jsx(te,{icon:Sx,size:14,strokeWidth:2})})]})]}),Hs&&p.jsx("p",{className:"ml-10 text-xs text-muted-foreground",children:e("notifications.customSoundActive")})]}),p.jsxs("div",{className:"space-y-2 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ao,{checked:en,onCheckedChange:Wt,disabled:Zt||!de}),p.jsx("label",{className:"text-sm text-muted-foreground",children:e("notifications.slack")}),p.jsx(Be,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>ha("slack"),disabled:Zt||!de||!en||!St||re.isPending,title:e("notifications.slack"),children:re.isPending?p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin"}):p.jsx(te,{icon:Sx,size:14,strokeWidth:2})})]}),en&&p.jsxs("div",{className:"relative ml-6",children:[p.jsx(Ht,{type:"password",value:St,onChange:He=>Xt(He.target.value),placeholder:"https://hooks.slack.com/services/...",disabled:Zt||!de,className:"flex-1 pr-8 font-mono text-sm"}),!!N?.slack?.webhookUrl&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]})]}),p.jsxs("div",{className:"space-y-2 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ao,{checked:De,onCheckedChange:yt,disabled:Zt||!de}),p.jsx("label",{className:"text-sm text-muted-foreground",children:e("notifications.discord")}),p.jsx(Be,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>ha("discord"),disabled:Zt||!de||!De||!nt||re.isPending,title:e("notifications.discord"),children:re.isPending?p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin"}):p.jsx(te,{icon:Sx,size:14,strokeWidth:2})})]}),De&&p.jsxs("div",{className:"relative ml-6",children:[p.jsx(Ht,{type:"password",value:nt,onChange:He=>_n(He.target.value),placeholder:"https://discord.com/api/webhooks/...",disabled:Zt||!de,className:"flex-1 pr-8 font-mono text-sm"}),!!N?.discord?.webhookUrl&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]})]}),p.jsxs("div",{className:"space-y-2 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ao,{checked:Bn,onCheckedChange:ar,disabled:Zt||!de}),p.jsx("label",{className:"text-sm text-muted-foreground",children:e("notifications.pushover")}),p.jsx(Be,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>ha("pushover"),disabled:Zt||!de||!Bn||!sr||!Rr||re.isPending,title:e("notifications.pushover"),children:re.isPending?p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin"}):p.jsx(te,{icon:Sx,size:14,strokeWidth:2})})]}),Bn&&p.jsxs("div",{className:"ml-6 space-y-2",children:[p.jsxs("div",{className:"relative",children:[p.jsx(Ht,{type:"password",value:sr,onChange:He=>ca(He.target.value),placeholder:e("notifications.appToken"),disabled:Zt||!de,className:"flex-1 pr-8 font-mono text-sm"}),!!N?.pushover?.appToken&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]}),p.jsxs("div",{className:"relative",children:[p.jsx(Ht,{type:"password",value:Rr,onChange:He=>Hr(He.target.value),placeholder:e("notifications.userKey"),disabled:Zt||!de,className:"flex-1 pr-8 font-mono text-sm"}),!!N?.pushover?.userKey&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500",children:p.jsx(te,{icon:di,size:14,strokeWidth:2})})]})]})]})]})}),p.jsx(Mu,{title:e("sections.appearance"),children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.language.label")}),p.jsxs(mi,{value:K??"auto",onValueChange:He=>$(He==="auto"?null:He),children:[p.jsx(bi,{className:"w-40",children:p.jsx(gi,{})}),p.jsxs(vi,{children:[p.jsx(gn,{value:"auto",children:e("fields.language.options.auto")}),p.jsx(gn,{value:"en",children:e("fields.language.options.en")}),p.jsx(gn,{value:"zh",children:e("fields.language.options.zh")})]})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.language.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.theme.label")}),p.jsxs(mi,{value:j??"system",onValueChange:He=>G(He),children:[p.jsx(bi,{className:"w-40",children:p.jsx(gi,{})}),p.jsxs(vi,{children:[p.jsx(gn,{value:"system",children:e("fields.theme.options.system")}),p.jsx(gn,{value:"light",children:e("fields.theme.options.light")}),p.jsx(gn,{value:"dark",children:e("fields.theme.options.dark")})]})]})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.theme.description")})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:e("fields.syncClaudeTheme.label")}),p.jsx(ao,{checked:Vr,onCheckedChange:ki})]}),p.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:e("fields.syncClaudeTheme.description")})]}),Vr&&p.jsxs("div",{className:"space-y-3 border-t border-border pt-4 sm:ml-32 sm:pl-2",children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-24 sm:shrink-0",children:e("fields.claudeCodeTheme.light")}),p.jsxs(mi,{value:Oi,onValueChange:He=>Wa(He),children:[p.jsx(bi,{className:"w-40",children:p.jsx(gi,{})}),p.jsx(vi,{children:WV.filter(He=>He.startsWith("light")).map(He=>p.jsx(gn,{value:He,children:e(`fields.claudeCodeTheme.options.${He}`)},He))})]})]}),p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[p.jsx("label",{className:"text-sm text-muted-foreground sm:w-24 sm:shrink-0",children:e("fields.claudeCodeTheme.dark")}),p.jsxs(mi,{value:Nc,onValueChange:He=>hu(He),children:[p.jsx(bi,{className:"w-40",children:p.jsx(gi,{})}),p.jsx(vi,{children:WV.filter(He=>He.startsWith("dark")).map(He=>p.jsx(gn,{value:He,children:e(`fields.claudeCodeTheme.options.${He}`)},He))})]})]})]})]})}),H?.enabled&&p.jsx(Mu,{title:e("sections.developer"),children:p.jsx("div",{className:"space-y-1",children:p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[p.jsx("div",{className:"flex-1",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:e("developer.restartDescription")})}),p.jsxs(Be,{variant:"outline",size:"sm",onClick:()=>{const He=H?.startedAt;rf(!0),q.mutate(void 0,{onSuccess:()=>{(async()=>{for(let ma=0;ma<120;ma++){await new Promise(Do=>setTimeout(Do,500));try{const Do=await fetch("/api/config/developer-mode");if(Do.ok&&(await Do.json()).startedAt!==He){window.location.reload();return}}catch{}}rf(!1),Et.error(e("developer.restartFailed"),{description:e("developer.checkLogs")})})()},onError:jt=>{rf(!1),Et.error(e("developer.restartFailed"),{description:jt.message})}})},disabled:q.isPending||xl,className:"shrink-0 gap-2",children:[(q.isPending||xl)&&p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin"}),e(xl?"developer.restarting":"developer.restartButton")]})]})})})]})}),p.jsx("div",{className:"shrink-0 border-t border-border bg-background px-6 py-3",children:p.jsxs("div",{className:`mx-auto flex max-w-5xl items-center gap-2 ${n?"justify-start":"justify-end"}`,children:[ht&&p.jsxs("span",{className:"flex items-center gap-1 text-xs text-accent",children:[p.jsx(te,{icon:di,size:12,strokeWidth:2}),t("status.saved")]}),p.jsx(Be,{size:"sm",onClick:sf,disabled:!lh||Zt||se.isPending,children:t("buttons.save")})]})}),p.jsx(bd,{open:dt,onOpenChange:$e,onSelect:He=>Ee(He),initialPath:ve||void 0})]})}const rT="";function b5e(){return ln({queryKey:["github-user"],queryFn:async()=>{const e=await fetch(`${rT}/api/github/user`);return e.ok?e.json():null},staleTime:600*1e3,retry:!1})}function v5e(){return ln({queryKey:["github-orgs"],queryFn:async()=>{const e=await fetch(`${rT}/api/github/orgs`);return e.ok?e.json():[]},staleTime:600*1e3})}function y5e(e,t,n){return ln({queryKey:["github-issues",e,t,n],queryFn:async()=>{const r=new URLSearchParams({filter:e});t&&r.set("viboraReposOnly","true"),n&&r.set("org",n);const i=await fetch(`${rT}/api/github/issues?${r}`);if(!i.ok)throw new Error("Failed to fetch issues");return i.json()},staleTime:300*1e3})}function _5e(e,t,n){return ln({queryKey:["github-prs",e,t,n],queryFn:async()=>{const r=new URLSearchParams({filter:e});t&&r.set("viboraReposOnly","true"),n&&r.set("org",n);const i=await fetch(`${rT}/api/github/prs?${r}`);if(!i.ok)throw new Error("Failed to fetch PRs");return i.json()},staleTime:300*1e3})}function x5e({filter:e,viboraReposOnly:t,org:n}){const{t:r}=Ct("review"),{t:i}=Ct("common"),{data:a,isLoading:s,error:o}=y5e(e,t,n);if(s)return p.jsx("div",{className:"flex h-48 items-center justify-center",children:p.jsx(te,{icon:Ft,size:24,className:"animate-spin text-muted-foreground"})});if(o)return p.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[p.jsx(te,{icon:ai,size:24}),p.jsx("p",{className:"text-sm",children:r("issues.failedToLoad")}),p.jsx("p",{className:"text-xs",children:o.message})]});const l={assigned:"issues.empty.assigned",created:"issues.empty.created",mentioned:"issues.empty.mentioned"};return a?.length?p.jsxs("div",{className:"space-y-4",children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:i(a.length===1?"results.one":"results.other",{count:a.length})}),p.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:a.map(u=>p.jsx(E5e,{issue:u},u.id))})]}):p.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[p.jsx(te,{icon:di,size:24}),p.jsx("p",{className:"text-sm",children:r(l[e])})]})}function E5e({issue:e}){return p.jsx(Ua,{className:"transition-colors hover:border-border/80",children:p.jsx(Fd,{className:"py-4",children:p.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"block space-y-2",children:[p.jsx("div",{className:"flex items-start gap-2",children:p.jsx("span",{className:"line-clamp-2 text-sm font-medium",children:e.title})}),p.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:p.jsxs("span",{className:"font-mono",children:[e.repository.fullName,"#",e.number]})}),e.labels.length>0&&p.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.labels.slice(0,3).map(t=>p.jsx(na,{className:"text-xs",style:{backgroundColor:`#${t.color}20`,color:`#${t.color}`,borderColor:`#${t.color}40`},children:t.name},t.name)),e.labels.length>3&&p.jsxs(na,{variant:"secondary",className:"text-xs",children:["+",e.labels.length-3]})]})]})})})}function S5e({filter:e,viboraReposOnly:t,org:n}){const{t:r}=Ct("review"),{t:i}=Ct("common"),{data:a,isLoading:s,error:o}=_5e(e,t,n);if(s)return p.jsx("div",{className:"flex h-48 items-center justify-center",children:p.jsx(te,{icon:Ft,size:24,className:"animate-spin text-muted-foreground"})});if(o)return p.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[p.jsx(te,{icon:ai,size:24}),p.jsx("p",{className:"text-sm",children:r("prs.failedToLoad")}),p.jsx("p",{className:"text-xs",children:o.message})]});const l={all:"prs.empty.all",created:"prs.empty.created",assigned:"prs.empty.assigned",review_requested:"prs.empty.reviewRequested",mentioned:"prs.empty.mentioned"};return a?.length?p.jsxs("div",{className:"space-y-4",children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:i(a.length===1?"results.one":"results.other",{count:a.length})}),p.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:a.map(u=>p.jsx(w5e,{pr:u},u.id))})]}):p.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[p.jsx(te,{icon:di,size:24}),p.jsx("p",{className:"text-sm",children:r(l[e])})]})}function w5e({pr:e}){const{t}=Ct("review");return p.jsx(Ua,{className:"transition-colors hover:border-border/80",children:p.jsx(Fd,{className:"py-4",children:p.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"block space-y-2",children:[p.jsx("div",{className:"flex items-start gap-2",children:p.jsx("span",{className:"line-clamp-2 text-sm font-medium",children:e.title})}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[p.jsxs("span",{className:"font-mono",children:[e.repository.fullName,"#",e.number]}),e.draft&&p.jsx(na,{variant:"secondary",className:ze("text-xs","bg-muted-foreground/20 text-muted-foreground"),children:t("prs.draft")})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[e.author.avatarUrl&&p.jsx("img",{src:e.author.avatarUrl,alt:e.author.login,className:"h-4 w-4 rounded-full"}),p.jsx("span",{className:"text-xs text-muted-foreground",children:e.author.login})]}),e.labels.length>0&&p.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.labels.slice(0,3).map(n=>p.jsx(na,{className:"text-xs",style:{backgroundColor:`#${n.color}20`,color:`#${n.color}`,borderColor:`#${n.color}40`},children:n.name},n.name)),e.labels.length>3&&p.jsxs(na,{variant:"secondary",className:"text-xs",children:["+",e.labels.length-3]})]})]})})})}const C5e=Si("/review/")({component:T5e});function T5e(){const{t:e}=Ct("review"),[t,n]=C.useState("prs"),[r,i]=C.useState("review_requested"),[a,s]=C.useState("assigned"),[o,l]=C.useState(!1),[u,d]=C.useState(""),{data:c,isLoading:m}=b5e(),{data:g=[]}=v5e();return!m&&!c?p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsx("div",{className:"flex shrink-0 items-center border-b border-border bg-background px-4 py-2"}),p.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:p.jsxs("div",{className:"max-w-md space-y-4 text-center",children:[p.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:p.jsx(te,{icon:$Se,size:24,className:"text-muted-foreground"})}),p.jsx("h2",{className:"text-lg font-medium",children:e("github.tokenRequired")}),p.jsx("p",{className:"text-sm text-muted-foreground",children:e("github.tokenDescription")}),p.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 p-4 text-left",children:[p.jsx("p",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("github.requiredScopes")}),p.jsxs("ul",{className:"space-y-1 text-xs text-muted-foreground",children:[p.jsxs("li",{children:["• ",p.jsx("code",{className:"rounded bg-muted px-1",children:"repo"})," ",e("github.scopes.repo")]}),p.jsxs("li",{children:["• ",p.jsx("code",{className:"rounded bg-muted px-1",children:"read:user"})," ",e("github.scopes.readUser")]}),p.jsxs("li",{children:["• ",p.jsx("code",{className:"rounded bg-muted px-1",children:"read:org"})," ",e("github.scopes.readOrg")]})]})]}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,read:user,read:org&description=Vibora",target:"_blank",rel:"noopener noreferrer",children:p.jsxs(Be,{variant:"outline",size:"sm",className:"w-full",children:[p.jsx(te,{icon:zSe,size:14,"data-slot":"icon"}),e("github.generateToken")]})}),p.jsx(Or,{to:"/settings",children:p.jsx(Be,{size:"sm",className:"w-full",children:e("github.goToSettings")})})]})]})})]}):p.jsx("div",{className:"flex h-full flex-col",children:p.jsxs(Ko,{value:t,onValueChange:_=>n(_),className:"flex flex-1 flex-col overflow-hidden",children:[p.jsxs("div",{className:"flex shrink-0 flex-col border-b border-border bg-background sm:flex-row sm:items-center sm:justify-between",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-1 max-sm:px-2",children:[p.jsxs(Yo,{variant:"line",children:[p.jsx(Vn,{value:"prs",children:e("tabs.pullRequests")}),p.jsx(Vn,{value:"issues",children:e("tabs.issues")})]}),p.jsx("label",{className:"flex cursor-pointer items-center gap-2 text-xs sm:hidden",title:e("filters.viboraReposOnly"),children:p.jsx(ao,{checked:o,onCheckedChange:l,disabled:!!u})})]}),p.jsxs("div",{className:"flex items-center gap-2 border-t border-border px-4 py-1.5 sm:gap-4 sm:border-t-0 sm:px-4 sm:py-1",children:[t==="prs"?p.jsxs(mi,{value:r,onValueChange:_=>i(_),children:[p.jsx(bi,{size:"sm",className:"flex-1 sm:flex-initial",children:p.jsx(gi,{})}),p.jsxs(vi,{children:[p.jsx(gn,{value:"created",children:e("filters.pr.created")}),p.jsx(gn,{value:"assigned",children:e("filters.pr.assigned")}),p.jsx(gn,{value:"review_requested",children:e("filters.pr.reviewRequested")}),p.jsx(gn,{value:"mentioned",children:e("filters.pr.mentioned")})]})]}):p.jsxs(mi,{value:a,onValueChange:_=>s(_),children:[p.jsx(bi,{size:"sm",className:"flex-1 sm:flex-initial",children:p.jsx(gi,{})}),p.jsxs(vi,{children:[p.jsx(gn,{value:"assigned",children:e("filters.issue.assigned")}),p.jsx(gn,{value:"created",children:e("filters.issue.created")}),p.jsx(gn,{value:"mentioned",children:e("filters.issue.mentioned")})]})]}),p.jsxs(mi,{value:u,onValueChange:_=>d(_||""),children:[p.jsx(bi,{size:"sm",className:"flex-1 sm:flex-initial",children:p.jsx(gi,{children:u||e("filters.allOrgs")})}),p.jsxs(vi,{children:[p.jsx(gn,{value:"",children:e("filters.allOrganizations")}),g.map(_=>p.jsx(gn,{value:_.login,children:_.login},_.login))]})]}),p.jsxs("label",{className:"hidden cursor-pointer items-center gap-2 text-xs sm:flex",title:e("filters.viboraReposOnly"),children:[p.jsx(ao,{checked:o,onCheckedChange:l,disabled:!!u}),p.jsx("span",{className:"text-muted-foreground",children:e("filters.viboraReposOnly")})]})]})]}),p.jsx(Kn,{value:"prs",className:"flex-1 overflow-auto p-4",children:p.jsx(S5e,{filter:r,viboraReposOnly:o,org:u||void 0})}),p.jsx(Kn,{value:"issues",className:"flex-1 overflow-auto p-4",children:p.jsx(x5e,{filter:a,viboraReposOnly:o,org:u||void 0})})]})})}const A5e=Si("/repositories/")({beforeLoad:()=>{throw Xl({to:"/projects"})}}),Dle="";function k5e(e){return ln({queryKey:["copier-questions",e],queryFn:()=>pt(`${Dle}/api/copier/questions?source=${encodeURIComponent(e)}`),enabled:!!e,staleTime:300*1e3,retry:!1})}function O5e(){const{data:e,...t}=jC();return{...t,data:e?.filter(n=>n.isCopierTemplate)??[]}}function R5e(){const e=pn();return rn({mutationFn:t=>pt(`${Dle}/api/copier/create`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]}),e.invalidateQueries({queryKey:["projects"]})}})}function dG(e){return e.startsWith("git@")||e.startsWith("https://")||e.startsWith("http://")||e.startsWith("gh:")||e.startsWith("gl:")||e.startsWith("bb:")}function N5e(e){const t=e.replace(/\.git$/,"");if(t.startsWith("git@")){const n=t.match(/:([^/]+\/)?([^/]+)$/);if(n)return n[2]}else if(t.startsWith("gh:")||t.startsWith("gl:")||t.startsWith("bb:")){const n=t.split("/");if(n.length>0)return n[n.length-1]}else{const n=t.split("/");if(n.length>0)return n[n.length-1]}return t}function I5e({open:e,onOpenChange:t,initialTab:n,initialTemplateSource:r}){const{t:i}=Ct("projects"),{t:a}=Ct("repositories"),s=Sa(),{data:o}=Hj(),l=b3e(),u=x3e(),d=E3e(),[c,m]=C.useState("add"),[g,_]=C.useState(""),[x,b]=C.useState(""),[v,y]=C.useState(""),[E,T]=C.useState(null),[w,A]=C.useState(!1),[O,R]=C.useState(!1),[N,D]=C.useState(""),[L,U]=C.useState(null),[M,W]=C.useState(new Set),[z,H]=C.useState(null),[q,K]=C.useState(!1),[$,j]=C.useState(""),[F,G]=C.useState(""),[V,J]=C.useState({}),[ae,se]=C.useState(""),[Z,Y]=C.useState(""),[Q,re]=C.useState(null),[oe,ee]=C.useState(!0),[ve,Ee]=C.useState(!1),[me,Se]=C.useState(new Set),[xe,Ye]=C.useState(""),[Ue,je]=C.useState(!1),{data:we}=O5e(),Ne=$||F,{data:_e,isLoading:pe,error:Ae}=k5e(c==="template"&&Ne?Ne:null),he=R5e();C.useEffect(()=>{e&&(m(r?"template":n||"add"),_(""),b(""),y(""),T(null),D(""),U(null),W(new Set),H(null),j(r??""),G(""),J({}),se(o||""),Y(""),re(null),ee(!0),Se(new Set),Ye(""),je(!1))},[e,n,r,o]);const Oe=C.useMemo(()=>dG(g.trim()),[g]),ge=C.useMemo(()=>Oe?N5e(g.trim()):null,[g,Oe]);C.useEffect(()=>{ge&&!v&&y(ge)},[ge,v]);const Ie=C.useMemo(()=>{if(Oe)return v.trim()||ge||"";const De=g.trim();if(!De||De.endsWith("/"))return"";const yt=De.split("/").pop()||"";return["~",".",".."].includes(yt)?"":yt},[Oe,v,ge,g]);C.useEffect(()=>{Ie&&!Ue&&Ye(Ie)},[Ie,Ue]);const We=x.trim()||o||"",mt=N.trim()||o||"",lt=C.useMemo(()=>{if(!Oe||!We)return null;const De=v.trim()||ge||"";return De?`${We}/${De}`:null},[Oe,We,v,ge]),dt=C.useMemo(()=>L?.filter(De=>!De.hasProject)??[],[L]),$e=l.isPending,ht=u.isPending||d.isPending,Re=he.isPending;C.useEffect(()=>{_e?.questions&&J(De=>{const yt={...De};for(const nt of _e.questions)yt[nt.name]===void 0&&nt.default!==void 0&&(yt[nt.name]=nt.default);return yt})},[_e]),C.useEffect(()=>{o&&!ae&&se(o)},[o,ae]);const de=_e?.questions.filter(De=>{if(De.default!==void 0&&!(typeof De.default=="string"&&De.default.includes("{{")))return!1;const nt=V[De.name];return nt==null||nt===""})??[],Te=Ne&&Z.trim()&&ae.trim()&&!pe&&de.length===0,Ke=async()=>{T(null);const De=g.trim(),yt=xe.trim();if(!(!De||!yt))try{const nt=await l.mutateAsync(Oe?{name:yt,url:De,targetDir:x.trim()||void 0,folderName:v.trim()||void 0}:{name:yt,path:De});t(!1),s({to:"/projects/$projectId",params:{projectId:nt.id}})}catch(nt){T(nt instanceof Error?nt.message:i("newProject.addRepoFailed"))}},st=()=>{H(null),U(null),W(new Set),u.mutate(mt||void 0,{onSuccess:De=>{U(De.repositories);const yt=De.repositories.filter(nt=>!nt.hasProject);W(new Set(yt.map(nt=>nt.path)))},onError:De=>{H(De instanceof Error?De.message:a("bulkAdd.scanFailed"))}})},Bt=De=>{W(yt=>{const nt=new Set(yt);return nt.has(De)?nt.delete(De):nt.add(De),nt})},zt=()=>{W(new Set(dt.map(De=>De.path)))},Mt=()=>{W(new Set)},bt=async()=>{if(M.size===0)return;const De=Array.from(M).map(yt=>{const nt=L?.find(_n=>_n.path===yt);return{path:yt,displayName:nt?.name}});d.mutate(De,{onSuccess:()=>{t(!1)},onError:yt=>{H(yt instanceof Error?yt.message:a("bulkAdd.addFailed"))}})},en=!!$||oe,Wt=()=>{re(null),he.mutate({templateSource:Ne,outputPath:ae,answers:V,projectName:Z,trust:en},{onSuccess:De=>{t(!1),s({to:"/projects/$projectId",params:{projectId:De.projectId}})},onError:De=>{re(De.message)}})},St=De=>{const yt=V[De.name],nt=ar=>J(sr=>({...sr,[De.name]:ar})),Bn=De.default===void 0||typeof De.default=="string"&&De.default.includes("{{")?`${De.name} *`:De.name;switch(De.type){case"bool":return p.jsxs(zn,{children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ar,{checked:yt,onCheckedChange:nt}),p.jsx(Hn,{className:"cursor-pointer",children:Bn})]}),De.help&&p.jsx(Da,{children:De.help})]},De.name);case"int":case"float":return p.jsxs(zn,{children:[p.jsx(Hn,{children:Bn}),p.jsx(Ht,{type:"number",value:yt,onChange:ar=>nt(De.type==="int"?parseInt(ar.target.value):parseFloat(ar.target.value)),step:De.type==="float"?"any":1}),De.help&&p.jsx(Da,{children:De.help})]},De.name);default:{if(De.choices&&De.choices.length>0)return p.jsxs(zn,{children:[p.jsx(Hn,{children:Bn}),p.jsxs(mi,{value:String(yt??""),onValueChange:nt,children:[p.jsx(bi,{className:"w-full",children:p.jsx(gi,{})}),p.jsx(vi,{children:De.choices.map(Rr=>p.jsx(gn,{value:String(Rr.value),children:Rr.label},String(Rr.value)))})]}),De.help&&p.jsx(Da,{children:De.help})]},De.name);const ar=De.type==="yaml"||De.type==="json",sr=De.name.toLowerCase().includes("password"),ca=me.has(De.name);return p.jsxs(zn,{children:[p.jsx(Hn,{children:Bn}),ar?p.jsx(o1,{value:String(yt??""),onChange:Rr=>nt(Rr.target.value),rows:4}):sr?p.jsxs("div",{className:"relative",children:[p.jsx(Ht,{type:ca?"text":"password",value:String(yt??""),onChange:Rr=>nt(Rr.target.value),className:"pr-8"}),p.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",onClick:()=>{Se(Rr=>{const Hr=new Set(Rr);return Hr.has(De.name)?Hr.delete(De.name):Hr.add(De.name),Hr})},children:p.jsx(te,{icon:ca?yie:Ej,size:14,strokeWidth:2})})]}):p.jsx(Ht,{value:String(yt??""),onChange:Rr=>nt(Rr.target.value)}),De.help&&p.jsx(Da,{children:De.help})]},De.name)}}},Xt=()=>{t(!1)};return p.jsxs(p.Fragment,{children:[p.jsx(So,{open:e,onOpenChange:t,children:p.jsxs(wo,{className:"sm:max-w-2xl max-h-[80dvh] flex flex-col overflow-hidden",children:[p.jsx(cl,{className:"shrink-0",children:p.jsx(dl,{children:i("newProjectButton")})}),p.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 px-1",children:p.jsx("div",{className:"space-y-4",children:p.jsxs(Ko,{value:c,onValueChange:m,children:[p.jsxs(Yo,{className:"w-full",children:[p.jsx(Vn,{value:"add",className:"flex-1",children:a("addModal.tabs.add")}),p.jsx(Vn,{value:"scan",className:"flex-1",children:a("addModal.tabs.scan")}),p.jsx(Vn,{value:"template",className:"flex-1",children:a("addModal.tabs.template")})]}),p.jsxs(Kn,{value:"add",className:"space-y-4 pt-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(ea,{children:i("newProject.repoPathOrUrl")}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Ht,{value:g,onChange:De=>{_(De.target.value),T(null),dG(De.target.value.trim())||y("")},placeholder:i("newProject.repoInputPlaceholder"),disabled:$e,className:"pr-8"}),g&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2",children:p.jsx(te,{icon:Oe?uie:Ba,size:14,strokeWidth:2,className:"text-muted-foreground"})})]}),p.jsx(Be,{type:"button",variant:"outline",size:"sm",onClick:()=>A(!0),disabled:$e,children:i("newProject.browse")})]})]}),Oe&&p.jsxs("div",{className:"space-y-3 rounded-md border border-border bg-muted/30 p-3",children:[p.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:i("newProject.cloneOptions")}),p.jsxs("div",{className:"space-y-1",children:[p.jsx(ea,{className:"text-xs",children:i("newProject.targetDirectory")}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ht,{value:x,onChange:De=>b(De.target.value),placeholder:o||"~/",disabled:$e,className:"flex-1 text-xs"}),p.jsx(Be,{type:"button",variant:"outline",size:"sm",onClick:()=>R(!0),disabled:$e,children:i("newProject.browse")})]})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx(ea,{className:"text-xs",children:i("newProject.folderName")}),p.jsx(Ht,{value:v,onChange:De=>y(De.target.value),placeholder:ge||"",disabled:$e,className:"text-xs"})]}),lt&&p.jsxs("div",{className:"rounded-md bg-background px-3 py-2 text-xs text-muted-foreground",children:[i("newProject.willCloneTo"),": ",p.jsx("span",{className:"font-mono",children:lt})]})]}),$e&&p.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 text-sm text-muted-foreground",children:[p.jsx(te,{icon:Ft,size:16,strokeWidth:2,className:"animate-spin"}),i(Oe?"newProject.cloning":"newProject.adding")]}),E&&p.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive",children:[p.jsx(te,{icon:ai,size:14,strokeWidth:2,className:"mt-0.5 shrink-0"}),p.jsx("span",{children:E})]}),g.trim()&&p.jsxs("div",{className:"space-y-2",children:[p.jsx(ea,{htmlFor:"addProjectName",children:i("newProject.projectName")}),p.jsx(Ht,{id:"addProjectName",value:xe,onChange:De=>{Ye(De.target.value),je(!0)},placeholder:i("newProject.projectNamePlaceholder"),disabled:$e})]}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx(Be,{variant:"outline",onClick:Xt,disabled:$e,children:i("newProject.cancel")}),p.jsx(Be,{onClick:Ke,disabled:!g.trim()||!xe.trim()||$e,children:$e?p.jsxs(p.Fragment,{children:[p.jsx(te,{icon:Ft,size:16,strokeWidth:2,className:"animate-spin"}),i("newProject.creating")]}):i("newProject.create")})]})]}),p.jsxs(Kn,{value:"scan",className:"space-y-4 pt-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(ea,{children:a("bulkAdd.directoryLabel")}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ht,{value:N,onChange:De=>{D(De.target.value),H(null),U(null)},placeholder:o||a("bulkAdd.directoryPlaceholder"),disabled:ht,className:"flex-1"}),p.jsx(Be,{type:"button",variant:"outline",size:"sm",onClick:()=>K(!0),disabled:ht,children:a("bulkAdd.browse")}),p.jsxs(Be,{type:"button",size:"sm",onClick:st,disabled:ht||!mt,children:[u.isPending?p.jsx(te,{icon:Ft,size:16,strokeWidth:2,className:"animate-spin"}):p.jsx(te,{icon:jg,size:16,strokeWidth:2}),a("bulkAdd.scan")]})]})]}),L!==null&&p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx(ea,{className:"text-xs",children:a("bulkAdd.foundRepos",{count:L.length})}),dt.length>0&&p.jsxs("div",{className:"flex gap-2 text-xs",children:[p.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:zt,disabled:ht,children:a("bulkAdd.selectAll")}),p.jsx("span",{className:"text-muted-foreground",children:"/"}),p.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:Mt,disabled:ht,children:a("bulkAdd.selectNone")})]})]}),L.length===0?p.jsx("div",{className:"rounded-md bg-muted/50 px-3 py-4 text-center text-sm text-muted-foreground",children:a("bulkAdd.noReposFound")}):p.jsx("div",{className:"max-h-64 overflow-y-auto rounded-md border",children:L.map(De=>p.jsxs("div",{className:`flex items-center gap-3 border-b px-3 py-2 last:border-b-0 ${De.hasProject?"bg-muted/30 opacity-60":""}`,children:[p.jsx(Ar,{checked:M.has(De.path),onCheckedChange:()=>Bt(De.path),disabled:De.hasProject||ht}),p.jsx(te,{icon:De.hasProject?nl:Ba,size:16,strokeWidth:2,className:De.hasProject?"text-green-500":"text-muted-foreground"}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"truncate text-sm font-medium",children:De.name}),p.jsx("div",{className:"truncate text-xs text-muted-foreground",children:De.path})]}),De.hasProject&&p.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:a("bulkAdd.alreadyAdded")})]},De.path))})]}),d.isPending&&p.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 text-sm text-muted-foreground",children:[p.jsx(te,{icon:Ft,size:16,strokeWidth:2,className:"animate-spin"}),a("bulkAdd.adding")]}),z&&p.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive",children:[p.jsx(te,{icon:ai,size:14,strokeWidth:2,className:"mt-0.5 shrink-0"}),p.jsx("span",{children:z})]}),M.size>0&&p.jsx(Be,{onClick:bt,disabled:M.size===0||ht,className:"w-full",children:a("bulkAdd.addSelected",{count:M.size})})]}),p.jsxs(Kn,{value:"template",className:"space-y-4 pt-4",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:a("newProject.steps.template.sectionTitle")}),p.jsxs("div",{className:"text-xs text-muted-foreground",children:[a("newProject.steps.template.sectionDescription")," ",p.jsx("a",{href:"https://copier.readthedocs.io/",target:"_blank",rel:"noopener noreferrer",className:"underline hover:opacity-80",children:a("newProject.steps.template.learnMore")})]})]}),p.jsxs(Tp,{children:[p.jsxs(zn,{children:[p.jsx(Hn,{children:a("newProject.steps.template.savedTemplates")}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs(mi,{value:$,onValueChange:De=>{j(De??""),G(""),J({})},children:[p.jsx(bi,{className:"w-full",children:p.jsx(gi,{children:$?we?.find(De=>De.id===$)?.displayName:p.jsx("span",{className:"text-muted-foreground",children:a("newProject.steps.template.selectTemplate")})})}),p.jsx(vi,{children:we?.map(De=>p.jsx(gn,{value:De.id,children:De.displayName},De.id))})]}),$&&p.jsx(Be,{type:"button",variant:"ghost",size:"sm",onClick:()=>{j(""),J({})},disabled:Re,className:"text-muted-foreground hover:text-foreground",children:"Clear"})]})]}),!$&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"text-center text-muted-foreground text-xs py-1",children:a("newProject.steps.template.or")}),p.jsxs(zn,{children:[p.jsx(Hn,{children:a("newProject.steps.template.customUrl")}),p.jsx(Ht,{value:F,onChange:De=>{G(De.target.value),j(""),J({})},placeholder:"https://github.com/user/template or /path/to/template",disabled:Re})]})]})]}),Ne&&p.jsxs("div",{className:"space-y-3 rounded-md border border-border bg-muted/30 p-3",children:[p.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:a("newProject.steps.questions.title")}),pe&&p.jsx("div",{className:"flex items-center justify-center py-4",children:p.jsx(te,{icon:Ft,size:20,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),Ae&&p.jsx("div",{className:"text-destructive text-sm py-2",children:Ae.message}),_e&&p.jsx(Tp,{children:_e.questions.length===0?p.jsx("div",{className:"text-muted-foreground text-sm py-2",children:a("newProject.steps.questions.noQuestions")}):_e.questions.map(St)})]}),Ne&&!pe&&p.jsxs("div",{className:"space-y-3 rounded-md border border-border bg-muted/30 p-3",children:[p.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:a("newProject.steps.output.title")}),p.jsxs(zn,{children:[p.jsx(Hn,{children:a("newProject.steps.output.projectName")}),p.jsx(Ht,{value:Z,onChange:De=>Y(De.target.value),placeholder:"my-new-project",disabled:Re})]}),p.jsxs(zn,{children:[p.jsx(Hn,{children:a("newProject.steps.output.outputDirectory")}),p.jsxs(Be,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>Ee(!0),disabled:Re,children:[p.jsx(te,{icon:Ba,size:14,strokeWidth:2,className:"mr-2"}),ae||a("newProject.steps.output.selectDirectory")]})]}),Z&&ae&&p.jsxs(Da,{className:"font-mono text-xs",children:[a("newProject.steps.output.willCreate"),": ",ae,"/",Z]})]}),Re&&p.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 text-sm text-muted-foreground",children:[p.jsx(te,{icon:Ft,size:16,strokeWidth:2,className:"animate-spin"}),a("newProject.steps.creating.inProgress")]}),Q&&p.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive",children:[p.jsx(te,{icon:ai,size:14,strokeWidth:2,className:"mt-0.5 shrink-0"}),p.jsx("span",{children:Q})]}),p.jsxs("div",{className:"flex items-center justify-between pt-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ar,{id:"trust-template",checked:oe,onCheckedChange:De=>ee(De===!0),disabled:Re}),p.jsx("label",{htmlFor:"trust-template",className:"text-xs text-muted-foreground cursor-pointer",children:a("newProject.steps.output.trust")})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Be,{variant:"outline",onClick:Xt,disabled:Re,children:i("newProject.cancel")}),p.jsx(Be,{onClick:Wt,disabled:!Te||Re,children:a("newProject.create")})]})]})]})]})})})]})}),p.jsx(bd,{open:w,onOpenChange:A,onSelect:De=>{_(De),A(!1)},initialPath:o||void 0}),p.jsx(bd,{open:O,onOpenChange:R,onSelect:De=>{b(De),R(!1)},initialPath:We||void 0}),p.jsx(bd,{open:q,onOpenChange:K,onSelect:De=>{D(De),K(!1),U(null),W(new Set)},initialPath:mt||void 0}),p.jsx(bd,{open:ve,onOpenChange:Ee,onSelect:De=>{se(De),Ee(!1)},initialPath:ae||o||void 0})]})}const D5e=Si("/projects/")({component:F5e});function L5e(e){switch(e){case"running":return"bg-green-500";case"building":return"bg-yellow-500";case"failed":return"bg-red-500";default:return"bg-muted-foreground/30"}}function P5e(e,t){switch(e){case"running":return t("card.running");case"building":return t("card.building");case"failed":return t("card.failed");case"stopped":return t("card.stopped");default:return t("card.noApp")}}function M5e({project:e,onStartTask:t,onDeleteClick:n}){const{t:r}=Ct("projects"),i=Sa(),{data:a}=u1(),{data:s}=c1(),{data:o}=d1(),l=OPe(),u=Eoe(),d=!!e.app,c=e.app?.status,m=c==="running",g=c==="building",_=e.repository?.path,x=e.app?.services?.find(E=>E.exposed&&E.domain)?.domain,b=()=>{if(!_){Et.error("No repository path");return}const E=ZC(_,a,s,o);Wl(E)},v=async()=>{if(e.app)try{await l.mutateAsync(e.app.id),i({to:"/projects/$projectId",params:{projectId:e.id},search:{tab:"deploy",subtab:"deployments"}})}catch(E){Et.error("Deploy failed",{description:E instanceof Error?E.message:"Unknown error"})}},y=async()=>{if(e.app)try{await u.mutateAsync(e.app.id)}catch(E){Et.error("Stop failed",{description:E instanceof Error?E.message:"Unknown error"})}};return p.jsxs(Ua,{className:"h-full group transition-colors hover:border-foreground/20",children:[p.jsx(Or,{to:"/projects/$projectId",params:{projectId:e.id},className:"block",children:p.jsxs(Fd,{className:"flex flex-col gap-3 py-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:ze("h-2.5 w-2.5 rounded-full shrink-0",L5e(c))}),p.jsx("span",{className:"truncate font-medium group-hover:text-primary transition-colors",children:e.name})]}),_&&p.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[p.jsx(te,{icon:Ba,size:12,strokeWidth:2,className:"shrink-0"}),p.jsx("span",{className:"truncate font-mono",children:_})]}),p.jsx("div",{className:"flex items-center gap-2 text-xs",children:d?p.jsxs(p.Fragment,{children:[p.jsxs("span",{className:"text-muted-foreground",children:["App: ",P5e(c,r)]}),x&&p.jsx("span",{className:"text-muted-foreground truncate",children:x})]}):p.jsx("span",{className:"text-muted-foreground",children:r("card.noApp")})})]})}),p.jsx(Fd,{className:"pt-0 pb-4 px-6",children:p.jsxs("div",{className:"mt-auto flex flex-wrap gap-1",children:[e.repository&&p.jsxs(Be,{variant:"outline",size:"sm",onClick:t,className:"text-muted-foreground hover:text-foreground",children:[p.jsx(te,{icon:Cj,size:14,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{className:"max-sm:hidden",children:r("newTask")})]}),_&&p.jsxs(Be,{variant:"outline",size:"sm",onClick:b,className:"text-muted-foreground hover:text-foreground max-sm:hidden",title:`Open in ${Ioe(a)}`,children:[p.jsx(te,{icon:Aj,size:14,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{children:r("editor")})]}),d&&p.jsx(p.Fragment,{children:m?p.jsxs(Be,{variant:"outline",size:"sm",onClick:y,disabled:u.isPending,className:"text-muted-foreground hover:text-destructive",children:[p.jsx(te,{icon:Fm,size:14,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{className:"max-sm:hidden",children:r("stop")})]}):p.jsxs(Be,{variant:"outline",size:"sm",onClick:v,disabled:l.isPending||g,className:"text-muted-foreground hover:text-foreground",children:[g?p.jsx(te,{icon:Ft,size:14,strokeWidth:2,className:"animate-spin","data-slot":"icon"}):p.jsx(te,{icon:Mm,size:14,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{className:"max-sm:hidden",children:r("deploy")})]})}),p.jsxs(Be,{variant:"outline",size:"sm",onClick:n,className:"text-muted-foreground hover:text-destructive",title:r("delete.button"),children:[p.jsx(te,{icon:rl,size:14,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{className:"max-sm:hidden",children:r("delete.button")})]})]})})]})}function j5e({project:e,open:t,onOpenChange:n,onDelete:r}){const{t:i}=Ct("projects"),[a,s]=C.useState(!1),[o,l]=C.useState(!1),[u,d]=C.useState(!1),c=async()=>{d(!0);try{await r(a,o),n(!1)}finally{d(!1)}};return p.jsx(lc,{open:t,onOpenChange:n,children:p.jsxs(uc,{children:[p.jsxs(cc,{children:[p.jsx(fc,{children:i("delete.title")}),p.jsx(pc,{children:i("delete.description",{name:e?.name})})]}),p.jsxs("div",{className:"space-y-3 py-2",children:[e?.repository&&p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(Ar,{id:"deleteDirectory",checked:a,onCheckedChange:m=>s(m===!0)}),p.jsx(ea,{htmlFor:"deleteDirectory",className:"text-sm",children:i("delete.alsoDeleteDirectory")})]}),e?.app&&p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx(Ar,{id:"deleteApp",checked:o,onCheckedChange:m=>l(m===!0)}),p.jsx(ea,{htmlFor:"deleteApp",className:"text-sm",children:i("delete.alsoDeleteApp")})]})]}),p.jsxs(dc,{children:[p.jsx(hc,{disabled:u,children:"Cancel"}),p.jsx(qg,{onClick:c,disabled:u,className:"bg-destructive hover:bg-destructive/90",children:i(u?"delete.deleting":"delete.button")})]})]})})}function F5e(){const{t:e}=Ct("projects"),{data:t,isLoading:n,error:r}=eT(),i=tle(),[a,s]=C.useState(null),[o,l]=C.useState(null),[u,d]=C.useState(!1),[c,m]=C.useState(""),g=C.useMemo(()=>t?c?.trim()?t.map(x=>({project:x,score:Math.max(ts(x.name,c),ts(x.repository?.path??"",c),ts(x.repository?.displayName??"",c))})).filter(({score:x})=>x>0).sort((x,b)=>b.score-x.score).map(({project:x})=>x):t:[],[t,c]),_=async(x,b)=>{o&&await i.mutateAsync({id:o.id,deleteDirectory:x,deleteApp:b})};return p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-background px-4 py-2",children:[p.jsxs("div",{className:"relative min-w-0 flex-1 sm:max-w-64 sm:flex-none",children:[p.jsx(te,{icon:jg,size:12,strokeWidth:2,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),p.jsx(Ht,{value:c,onChange:x=>m(x.target.value),placeholder:e("searchPlaceholder"),className:"w-full pl-6"})]}),p.jsx("div",{className:"hidden sm:block flex-1"}),p.jsxs(Be,{size:"sm",onClick:()=>d(!0),children:[p.jsx(te,{icon:hie,size:16,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{className:"max-sm:hidden",children:e("newProjectButton")})]})]}),p.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[n&&p.jsx("div",{className:"flex items-center justify-center py-12",children:p.jsx(te,{icon:Ft,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),r&&p.jsxs("div",{className:"flex items-center gap-3 py-6 text-destructive",children:[p.jsx(te,{icon:ai,size:20,strokeWidth:2}),p.jsx("span",{className:"text-sm",children:e("error.failedToLoad",{message:r.message})})]}),!n&&!r&&t?.length===0&&p.jsx("div",{className:"py-12 text-muted-foreground",children:p.jsx("p",{className:"text-sm",children:e("empty.noProjects")})}),!n&&!r&&t&&t.length>0&&g.length===0&&p.jsx("div",{className:"py-12 text-muted-foreground",children:p.jsx("p",{className:"text-sm",children:e("empty.noMatches")})}),p.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:g.map(x=>p.jsx(M5e,{project:x,onStartTask:()=>s(x),onDeleteClick:()=>l(x)},x.id))})]}),a?.repository&&p.jsx(qj,{open:a!==null,onOpenChange:x=>!x&&s(null),defaultRepository:{id:a.repository.id,path:a.repository.path,displayName:a.repository.displayName,startupScript:a.repository.startupScript,copyFiles:a.repository.copyFiles,claudeOptions:a.repository.claudeOptions,opencodeOptions:a.repository.opencodeOptions,opencodeModel:a.repository.opencodeModel,defaultAgent:a.repository.defaultAgent,remoteUrl:a.repository.remoteUrl,isCopierTemplate:a.repository.isCopierTemplate,createdAt:"",updatedAt:""},showTrigger:!1}),p.jsx(j5e,{project:o,open:o!==null,onOpenChange:x=>!x&&l(null),onDelete:_}),p.jsx(I5e,{open:u,onOpenChange:d})]})}var CO,fG;function fs(){if(fG)return CO;fG=1;var e=Array.isArray;return CO=e,CO}var TO,pG;function Lle(){if(pG)return TO;pG=1;var e=typeof ix=="object"&&ix&&ix.Object===Object&&ix;return TO=e,TO}var AO,hG;function lu(){if(hG)return AO;hG=1;var e=Lle(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return AO=n,AO}var kO,mG;function x1(){if(mG)return kO;mG=1;var e=lu(),t=e.Symbol;return kO=t,kO}var OO,gG;function B5e(){if(gG)return OO;gG=1;var e=x1(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function a(s){var o=n.call(s,i),l=s[i];try{s[i]=void 0;var u=!0}catch{}var d=r.call(s);return u&&(o?s[i]=l:delete s[i]),d}return OO=a,OO}var RO,bG;function U5e(){if(bG)return RO;bG=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return RO=n,RO}var NO,vG;function Cc(){if(vG)return NO;vG=1;var e=x1(),t=B5e(),n=U5e(),r="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function s(o){return o==null?o===void 0?i:r:a&&a in Object(o)?t(o):n(o)}return NO=s,NO}var IO,yG;function Tc(){if(yG)return IO;yG=1;function e(t){return t!=null&&typeof t=="object"}return IO=e,IO}var DO,_G;function Kg(){if(_G)return DO;_G=1;var e=Cc(),t=Tc(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return DO=r,DO}var LO,xG;function C5(){if(xG)return LO;xG=1;var e=fs(),t=Kg(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,s){if(e(a))return!1;var o=typeof a;return o=="number"||o=="symbol"||o=="boolean"||a==null||t(a)?!0:r.test(a)||!n.test(a)||s!=null&&a in Object(s)}return LO=i,LO}var PO,EG;function Xd(){if(EG)return PO;EG=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return PO=e,PO}var MO,SG;function T5(){if(SG)return MO;SG=1;var e=Cc(),t=Xd(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function s(o){if(!t(o))return!1;var l=e(o);return l==r||l==i||l==n||l==a}return MO=s,MO}var jO,wG;function $5e(){if(wG)return jO;wG=1;var e=lu(),t=e["__core-js_shared__"];return jO=t,jO}var FO,CG;function z5e(){if(CG)return FO;CG=1;var e=$5e(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return FO=n,FO}var BO,TG;function Ple(){if(TG)return BO;TG=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return BO=n,BO}var UO,AG;function H5e(){if(AG)return UO;AG=1;var e=T5(),t=z5e(),n=Xd(),r=Ple(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,d=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function c(m){if(!n(m)||t(m))return!1;var g=e(m)?d:a;return g.test(r(m))}return UO=c,UO}var $O,kG;function V5e(){if(kG)return $O;kG=1;function e(t,n){return t?.[n]}return $O=e,$O}var zO,OG;function Kp(){if(OG)return zO;OG=1;var e=H5e(),t=V5e();function n(r,i){var a=t(r,i);return e(a)?a:void 0}return zO=n,zO}var HO,RG;function iT(){if(RG)return HO;RG=1;var e=Kp(),t=e(Object,"create");return HO=t,HO}var VO,NG;function W5e(){if(NG)return VO;NG=1;var e=iT();function t(){this.__data__=e?e(null):{},this.size=0}return VO=t,VO}var WO,IG;function G5e(){if(IG)return WO;IG=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return WO=e,WO}var GO,DG;function q5e(){if(DG)return GO;DG=1;var e=iT(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(a){var s=this.__data__;if(e){var o=s[a];return o===t?void 0:o}return r.call(s,a)?s[a]:void 0}return GO=i,GO}var qO,LG;function K5e(){if(LG)return qO;LG=1;var e=iT(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var a=this.__data__;return e?a[i]!==void 0:n.call(a,i)}return qO=r,qO}var KO,PG;function Y5e(){if(PG)return KO;PG=1;var e=iT(),t="__lodash_hash_undefined__";function n(r,i){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=e&&i===void 0?t:i,this}return KO=n,KO}var YO,MG;function X5e(){if(MG)return YO;MG=1;var e=W5e(),t=G5e(),n=q5e(),r=K5e(),i=Y5e();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,YO=a,YO}var XO,jG;function Z5e(){if(jG)return XO;jG=1;function e(){this.__data__=[],this.size=0}return XO=e,XO}var ZO,FG;function A5(){if(FG)return ZO;FG=1;function e(t,n){return t===n||t!==t&&n!==n}return ZO=e,ZO}var QO,BG;function aT(){if(BG)return QO;BG=1;var e=A5();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return QO=t,QO}var JO,UG;function Q5e(){if(UG)return JO;UG=1;var e=aT(),t=Array.prototype,n=t.splice;function r(i){var a=this.__data__,s=e(a,i);if(s<0)return!1;var o=a.length-1;return s==o?a.pop():n.call(a,s,1),--this.size,!0}return JO=r,JO}var eR,$G;function J5e(){if($G)return eR;$G=1;var e=aT();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return eR=t,eR}var tR,zG;function e4e(){if(zG)return tR;zG=1;var e=aT();function t(n){return e(this.__data__,n)>-1}return tR=t,tR}var nR,HG;function t4e(){if(HG)return nR;HG=1;var e=aT();function t(n,r){var i=this.__data__,a=e(i,n);return a<0?(++this.size,i.push([n,r])):i[a][1]=r,this}return nR=t,nR}var rR,VG;function sT(){if(VG)return rR;VG=1;var e=Z5e(),t=Q5e(),n=J5e(),r=e4e(),i=t4e();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,rR=a,rR}var iR,WG;function k5(){if(WG)return iR;WG=1;var e=Kp(),t=lu(),n=e(t,"Map");return iR=n,iR}var aR,GG;function n4e(){if(GG)return aR;GG=1;var e=X5e(),t=sT(),n=k5();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return aR=r,aR}var sR,qG;function r4e(){if(qG)return sR;qG=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return sR=e,sR}var oR,KG;function oT(){if(KG)return oR;KG=1;var e=r4e();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return oR=t,oR}var lR,YG;function i4e(){if(YG)return lR;YG=1;var e=oT();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return lR=t,lR}var uR,XG;function a4e(){if(XG)return uR;XG=1;var e=oT();function t(n){return e(this,n).get(n)}return uR=t,uR}var cR,ZG;function s4e(){if(ZG)return cR;ZG=1;var e=oT();function t(n){return e(this,n).has(n)}return cR=t,cR}var dR,QG;function o4e(){if(QG)return dR;QG=1;var e=oT();function t(n,r){var i=e(this,n),a=i.size;return i.set(n,r),this.size+=i.size==a?0:1,this}return dR=t,dR}var fR,JG;function O5(){if(JG)return fR;JG=1;var e=n4e(),t=i4e(),n=a4e(),r=s4e(),i=o4e();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,fR=a,fR}var pR,eq;function Mle(){if(eq)return pR;eq=1;var e=O5(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var s=arguments,o=i?i.apply(this,s):s[0],l=a.cache;if(l.has(o))return l.get(o);var u=r.apply(this,s);return a.cache=l.set(o,u)||l,u};return a.cache=new(n.Cache||e),a}return n.Cache=e,pR=n,pR}var hR,tq;function l4e(){if(tq)return hR;tq=1;var e=Mle(),t=500;function n(r){var i=e(r,function(s){return a.size===t&&a.clear(),s}),a=i.cache;return i}return hR=n,hR}var mR,nq;function u4e(){if(nq)return mR;nq=1;var e=l4e(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(s,o,l,u){a.push(l?u.replace(n,"$1"):o||s)}),a});return mR=r,mR}var gR,rq;function R5(){if(rq)return gR;rq=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,a=Array(i);++r<i;)a[r]=n(t[r],r,t);return a}return gR=e,gR}var bR,iq;function c4e(){if(iq)return bR;iq=1;var e=x1(),t=R5(),n=fs(),r=Kg(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function s(o){if(typeof o=="string")return o;if(n(o))return t(o,s)+"";if(r(o))return a?a.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return bR=s,bR}var vR,aq;function jle(){if(aq)return vR;aq=1;var e=c4e();function t(n){return n==null?"":e(n)}return vR=t,vR}var yR,sq;function Fle(){if(sq)return yR;sq=1;var e=fs(),t=C5(),n=u4e(),r=jle();function i(a,s){return e(a)?a:t(a,s)?[a]:n(r(a))}return yR=i,yR}var _R,oq;function lT(){if(oq)return _R;oq=1;var e=Kg();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return _R=t,_R}var xR,lq;function N5(){if(lq)return xR;lq=1;var e=Fle(),t=lT();function n(r,i){i=e(i,r);for(var a=0,s=i.length;r!=null&&a<s;)r=r[t(i[a++])];return a&&a==s?r:void 0}return xR=n,xR}var ER,uq;function Ble(){if(uq)return ER;uq=1;var e=N5();function t(n,r,i){var a=n==null?void 0:e(n,r);return a===void 0?i:a}return ER=t,ER}var d4e=Ble();const Ps=kn(d4e);var SR,cq;function f4e(){if(cq)return SR;cq=1;function e(t){return t==null}return SR=e,SR}var p4e=f4e();const on=kn(p4e);var wR,dq;function h4e(){if(dq)return wR;dq=1;var e=Cc(),t=fs(),n=Tc(),r="[object String]";function i(a){return typeof a=="string"||!t(a)&&n(a)&&e(a)==r}return wR=i,wR}var m4e=h4e();const Rp=kn(m4e);var g4e=T5();const qt=kn(g4e);var b4e=Xd();const Yg=kn(b4e);var CR={exports:{}},Un={};var fq;function v4e(){if(fq)return Un;fq=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),o=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),c=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),_;_=Symbol.for("react.module.reference");function x(b){if(typeof b=="object"&&b!==null){var v=b.$$typeof;switch(v){case e:switch(b=b.type,b){case n:case i:case r:case u:case d:return b;default:switch(b=b&&b.$$typeof,b){case o:case s:case l:case m:case c:case a:return b;default:return v}}case t:return v}}}return Un.ContextConsumer=s,Un.ContextProvider=a,Un.Element=e,Un.ForwardRef=l,Un.Fragment=n,Un.Lazy=m,Un.Memo=c,Un.Portal=t,Un.Profiler=i,Un.StrictMode=r,Un.Suspense=u,Un.SuspenseList=d,Un.isAsyncMode=function(){return!1},Un.isConcurrentMode=function(){return!1},Un.isContextConsumer=function(b){return x(b)===s},Un.isContextProvider=function(b){return x(b)===a},Un.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Un.isForwardRef=function(b){return x(b)===l},Un.isFragment=function(b){return x(b)===n},Un.isLazy=function(b){return x(b)===m},Un.isMemo=function(b){return x(b)===c},Un.isPortal=function(b){return x(b)===t},Un.isProfiler=function(b){return x(b)===i},Un.isStrictMode=function(b){return x(b)===r},Un.isSuspense=function(b){return x(b)===u},Un.isSuspenseList=function(b){return x(b)===d},Un.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===u||b===d||b===g||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===c||b.$$typeof===a||b.$$typeof===s||b.$$typeof===l||b.$$typeof===_||b.getModuleId!==void 0)},Un.typeOf=x,Un}var pq;function y4e(){return pq||(pq=1,CR.exports=v4e()),CR.exports}var _4e=y4e(),TR,hq;function Ule(){if(hq)return TR;hq=1;var e=Cc(),t=Tc(),n="[object Number]";function r(i){return typeof i=="number"||t(i)&&e(i)==n}return TR=r,TR}var AR,mq;function x4e(){if(mq)return AR;mq=1;var e=Ule();function t(n){return e(n)&&n!=+n}return AR=t,AR}var E4e=x4e();const Xg=kn(E4e);var S4e=Ule();const w4e=kn(S4e);var Bi=function(t){return t===0?0:t>0?1:-1},Wf=function(t){return Rp(t)&&t.indexOf("%")===t.length-1},ot=function(t){return w4e(t)&&!Xg(t)},C4e=function(t){return on(t)},xi=function(t){return ot(t)||Rp(t)},T4e=0,Zg=function(t){var n=++T4e;return"".concat(t||"").concat(n)},ja=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ot(t)&&!Rp(t))return r;var a;if(Wf(t)){var s=t.indexOf("%");a=n*parseFloat(t.slice(0,s))/100}else a=+t;return Xg(a)&&(a=r),i&&a>n&&(a=n),a},fd=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},A4e=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},ta=function(t,n){return ot(t)&&ot(n)?function(r){return t+r*(n-t)}:function(){return n}};function kS(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Ps(r,t))===n})}var k4e=function(t,n){return ot(t)&&ot(n)?t-n:Rp(t)&&Rp(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function Em(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function _P(e){"@babel/helpers - typeof";return _P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_P(e)}var O4e=["viewBox","children"],R4e=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],gq=["points","pathLength"],kR={svg:O4e,polygon:gq,polyline:gq},I5=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],OS=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(C.isValidElement(t)&&(r=t.props),!Yg(r))return null;var i={};return Object.keys(r).forEach(function(a){I5.includes(a)&&(i[a]=n||function(s){return r[a](r,s)})}),i},N4e=function(t,n,r){return function(i){return t(n,r,i),null}},mc=function(t,n,r){if(!Yg(t)||_P(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(a){var s=t[a];I5.includes(a)&&typeof s=="function"&&(i||(i={}),i[a]=N4e(s,n,r))}),i},I4e=["children"],D4e=["children"];function bq(e,t){if(e==null)return{};var n=L4e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function L4e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function xP(e){"@babel/helpers - typeof";return xP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xP(e)}var vq={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Qu=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},yq=null,OR=null,D5=function e(t){if(t===yq&&Array.isArray(OR))return OR;var n=[];return C.Children.forEach(t,function(r){on(r)||(_4e.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),OR=n,yq=t,n};function Ms(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return Qu(i)}):r=[Qu(t)],D5(e).forEach(function(i){var a=Ps(i,"type.displayName")||Ps(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function Ts(e,t){var n=Ms(e,t);return n&&n[0]}var _q=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!ot(r)||r<=0||!ot(i)||i<=0)},P4e=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],M4e=function(t){return t&&t.type&&Rp(t.type)&&P4e.indexOf(t.type)>=0},j4e=function(t){return t&&xP(t)==="object"&&"clipDot"in t},F4e=function(t,n,r,i){var a,s=(a=kR?.[i])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!qt(t)&&(i&&s.includes(n)||R4e.includes(n))||r&&I5.includes(n)},Ut=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(C.isValidElement(t)&&(i=t.props),!Yg(i))return null;var a={};return Object.keys(i).forEach(function(s){var o;F4e((o=i)===null||o===void 0?void 0:o[s],s,n,r)&&(a[s]=i[s])}),a},EP=function e(t,n){if(t===n)return!0;var r=C.Children.count(t);if(r!==C.Children.count(n))return!1;if(r===0)return!0;if(r===1)return xq(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=t[i],s=n[i];if(Array.isArray(a)||Array.isArray(s)){if(!e(a,s))return!1}else if(!xq(a,s))return!1}return!0},xq=function(t,n){if(on(t)&&on(n))return!0;if(!on(t)&&!on(n)){var r=t.props||{},i=r.children,a=bq(r,I4e),s=n.props||{},o=s.children,l=bq(s,D4e);return i&&o?Em(a,l)&&EP(i,o):!i&&!o?Em(a,l):!1}return!1},Eq=function(t,n){var r=[],i={};return D5(t).forEach(function(a,s){if(M4e(a))r.push(a);else if(a){var o=Qu(a.type),l=n[o]||{},u=l.handler,d=l.once;if(u&&(!d||!i[o])){var c=u(a,o,s);r.push(c),i[o]=!0}}}),r},B4e=function(t){var n=t&&t.type;return n&&vq[n]?vq[n]:null},U4e=function(t,n){return D5(n).indexOf(t)},$4e=["children","width","height","viewBox","className","style","title","desc"];function SP(){return SP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SP.apply(this,arguments)}function z4e(e,t){if(e==null)return{};var n=H4e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function H4e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function wP(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,a=e.className,s=e.style,o=e.title,l=e.desc,u=z4e(e,$4e),d=i||{width:n,height:r,x:0,y:0},c=nn("recharts-surface",a);return le.createElement("svg",SP({},Ut(u,!0,"svg"),{className:c,width:n,height:r,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),le.createElement("title",null,o),le.createElement("desc",null,l),t)}var V4e=["children","className"];function CP(){return CP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CP.apply(this,arguments)}function W4e(e,t){if(e==null)return{};var n=G4e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function G4e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var yn=le.forwardRef(function(e,t){var n=e.children,r=e.className,i=W4e(e,V4e),a=nn("recharts-layer",r);return le.createElement("g",CP({className:a},Ut(i,!0),{ref:t}),n)}),Qo=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a]},RR,Sq;function q4e(){if(Sq)return RR;Sq=1;function e(t,n,r){var i=-1,a=t.length;n<0&&(n=-n>a?0:a+n),r=r>a?a:r,r<0&&(r+=a),a=n>r?0:r-n>>>0,n>>>=0;for(var s=Array(a);++i<a;)s[i]=t[i+n];return s}return RR=e,RR}var NR,wq;function K4e(){if(wq)return NR;wq=1;var e=q4e();function t(n,r,i){var a=n.length;return i=i===void 0?a:i,!r&&i>=a?n:e(n,r,i)}return NR=t,NR}var IR,Cq;function $le(){if(Cq)return IR;Cq=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,a="\\ufe0e\\ufe0f",s="\\u200d",o=RegExp("["+s+e+i+a+"]");function l(u){return o.test(u)}return IR=l,IR}var DR,Tq;function Y4e(){if(Tq)return DR;Tq=1;function e(t){return t.split("")}return DR=e,DR}var LR,Aq;function X4e(){if(Aq)return LR;Aq=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,a="\\ufe0e\\ufe0f",s="["+e+"]",o="["+i+"]",l="\\ud83c[\\udffb-\\udfff]",u="(?:"+o+"|"+l+")",d="[^"+e+"]",c="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",_=u+"?",x="["+a+"]?",b="(?:"+g+"(?:"+[d,c,m].join("|")+")"+x+_+")*",v=x+_+b,y="(?:"+[d+o+"?",o,c,m,s].join("|")+")",E=RegExp(l+"(?="+l+")|"+y+v,"g");function T(w){return w.match(E)||[]}return LR=T,LR}var PR,kq;function Z4e(){if(kq)return PR;kq=1;var e=Y4e(),t=$le(),n=X4e();function r(i){return t(i)?n(i):e(i)}return PR=r,PR}var MR,Oq;function Q4e(){if(Oq)return MR;Oq=1;var e=K4e(),t=$le(),n=Z4e(),r=jle();function i(a){return function(s){s=r(s);var o=t(s)?n(s):void 0,l=o?o[0]:s.charAt(0),u=o?e(o,1).join(""):s.slice(1);return l[a]()+u}}return MR=i,MR}var jR,Rq;function J4e(){if(Rq)return jR;Rq=1;var e=Q4e(),t=e("toUpperCase");return jR=t,jR}var e6e=J4e();const uT=kn(e6e);function cr(e){return function(){return e}}const zle=Math.cos,RS=Math.sin,ml=Math.sqrt,NS=Math.PI,cT=2*NS,TP=Math.PI,AP=2*TP,If=1e-6,t6e=AP-If;function Hle(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function n6e(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Hle;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class r6e{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Hle:n6e(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,o=this._y1,l=r-t,u=i-n,d=s-t,c=o-n,m=d*d+c*c;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(m>If)if(!(Math.abs(c*l-u*d)>If)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-s,_=i-o,x=l*l+u*u,b=g*g+_*_,v=Math.sqrt(x),y=Math.sqrt(m),E=a*Math.tan((TP-Math.acos((x+m-b)/(2*v*y)))/2),T=E/y,w=E/v;Math.abs(T-1)>If&&this._append`L${t+T*d},${n+T*c}`,this._append`A${a},${a},0,0,${+(c*g>d*_)},${this._x1=t+w*l},${this._y1=n+w*u}`}}arc(t,n,r,i,a,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),u=t+o,d=n+l,c=1^s,m=s?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>If||Math.abs(this._y1-d)>If)&&this._append`L${u},${d}`,r&&(m<0&&(m=m%AP+AP),m>t6e?this._append`A${r},${r},0,1,${c},${t-o},${n-l}A${r},${r},0,1,${c},${this._x1=u},${this._y1=d}`:m>If&&this._append`A${r},${r},0,${+(m>=TP)},${c},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function L5(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new r6e(t)}function P5(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Vle(e){this._context=e}Vle.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function dT(e){return new Vle(e)}function Wle(e){return e[0]}function Gle(e){return e[1]}function qle(e,t){var n=cr(!0),r=null,i=dT,a=null,s=L5(o);e=typeof e=="function"?e:e===void 0?Wle:cr(e),t=typeof t=="function"?t:t===void 0?Gle:cr(t);function o(l){var u,d=(l=P5(l)).length,c,m=!1,g;for(r==null&&(a=i(g=s())),u=0;u<=d;++u)!(u<d&&n(c=l[u],u,l))===m&&((m=!m)?a.lineStart():a.lineEnd()),m&&a.point(+e(c,u,l),+t(c,u,l));if(g)return a=null,g+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:cr(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:cr(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:cr(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(a=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=a=null:a=i(r=l),o):r},o}function Bx(e,t,n){var r=null,i=cr(!0),a=null,s=dT,o=null,l=L5(u);e=typeof e=="function"?e:e===void 0?Wle:cr(+e),t=typeof t=="function"?t:cr(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Gle:cr(+n);function u(c){var m,g,_,x=(c=P5(c)).length,b,v=!1,y,E=new Array(x),T=new Array(x);for(a==null&&(o=s(y=l())),m=0;m<=x;++m){if(!(m<x&&i(b=c[m],m,c))===v)if(v=!v)g=m,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),_=m-1;_>=g;--_)o.point(E[_],T[_]);o.lineEnd(),o.areaEnd()}v&&(E[m]=+e(b,m,c),T[m]=+t(b,m,c),o.point(r?+r(b,m,c):E[m],n?+n(b,m,c):T[m]))}if(y)return o=null,y+""||null}function d(){return qle().defined(i).curve(s).context(a)}return u.x=function(c){return arguments.length?(e=typeof c=="function"?c:cr(+c),r=null,u):e},u.x0=function(c){return arguments.length?(e=typeof c=="function"?c:cr(+c),u):e},u.x1=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:cr(+c),u):r},u.y=function(c){return arguments.length?(t=typeof c=="function"?c:cr(+c),n=null,u):t},u.y0=function(c){return arguments.length?(t=typeof c=="function"?c:cr(+c),u):t},u.y1=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:cr(+c),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(c){return arguments.length?(i=typeof c=="function"?c:cr(!!c),u):i},u.curve=function(c){return arguments.length?(s=c,a!=null&&(o=s(a)),u):s},u.context=function(c){return arguments.length?(c==null?a=o=null:o=s(a=c),u):a},u}class Kle{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function i6e(e){return new Kle(e,!0)}function a6e(e){return new Kle(e,!1)}const M5={draw(e,t){const n=ml(t/NS);e.moveTo(n,0),e.arc(0,0,n,0,cT)}},s6e={draw(e,t){const n=ml(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Yle=ml(1/3),o6e=Yle*2,l6e={draw(e,t){const n=ml(t/o6e),r=n*Yle;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},u6e={draw(e,t){const n=ml(t),r=-n/2;e.rect(r,r,n,n)}},c6e=.8908130915292852,Xle=RS(NS/10)/RS(7*NS/10),d6e=RS(cT/10)*Xle,f6e=-zle(cT/10)*Xle,p6e={draw(e,t){const n=ml(t*c6e),r=d6e*n,i=f6e*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const s=cT*a/5,o=zle(s),l=RS(s);e.lineTo(l*n,-o*n),e.lineTo(o*r-l*i,l*r+o*i)}e.closePath()}},FR=ml(3),h6e={draw(e,t){const n=-ml(t/(FR*3));e.moveTo(0,n*2),e.lineTo(-FR*n,-n),e.lineTo(FR*n,-n),e.closePath()}},Js=-.5,eo=ml(3)/2,kP=1/ml(12),m6e=(kP/2+1)*3,g6e={draw(e,t){const n=ml(t/m6e),r=n/2,i=n*kP,a=r,s=n*kP+n,o=-a,l=s;e.moveTo(r,i),e.lineTo(a,s),e.lineTo(o,l),e.lineTo(Js*r-eo*i,eo*r+Js*i),e.lineTo(Js*a-eo*s,eo*a+Js*s),e.lineTo(Js*o-eo*l,eo*o+Js*l),e.lineTo(Js*r+eo*i,Js*i-eo*r),e.lineTo(Js*a+eo*s,Js*s-eo*a),e.lineTo(Js*o+eo*l,Js*l-eo*o),e.closePath()}};function b6e(e,t){let n=null,r=L5(i);e=typeof e=="function"?e:cr(e||M5),t=typeof t=="function"?t:cr(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:cr(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:cr(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function IS(){}function DS(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Zle(e){this._context=e}Zle.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:DS(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:DS(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function v6e(e){return new Zle(e)}function Qle(e){this._context=e}Qle.prototype={areaStart:IS,areaEnd:IS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:DS(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function y6e(e){return new Qle(e)}function Jle(e){this._context=e}Jle.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:DS(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _6e(e){return new Jle(e)}function eue(e){this._context=e}eue.prototype={areaStart:IS,areaEnd:IS,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function x6e(e){return new eue(e)}function Nq(e){return e<0?-1:1}function Iq(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),o=(a*i+s*r)/(r+i);return(Nq(a)+Nq(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Dq(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function BR(e,t,n){var r=e._x0,i=e._y0,a=e._x1,s=e._y1,o=(a-r)/3;e._context.bezierCurveTo(r+o,i+o*t,a-o,s-o*n,a,s)}function LS(e){this._context=e}LS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:BR(this,this._t0,Dq(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,BR(this,Dq(this,n=Iq(this,e,t)),n);break;default:BR(this,this._t0,n=Iq(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function tue(e){this._context=new nue(e)}(tue.prototype=Object.create(LS.prototype)).point=function(e,t){LS.prototype.point.call(this,t,e)};function nue(e){this._context=e}nue.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function E6e(e){return new LS(e)}function S6e(e){return new tue(e)}function rue(e){this._context=e}rue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Lq(e),i=Lq(t),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Lq(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function w6e(e){return new rue(e)}function fT(e,t){this._context=e,this._t=t}fT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function C6e(e){return new fT(e,.5)}function T6e(e){return new fT(e,0)}function A6e(e){return new fT(e,1)}function Xm(e,t){if((s=e.length)>1)for(var n=1,r,i,a=e[t[0]],s,o=a.length;n<s;++n)for(i=a,a=e[t[n]],r=0;r<o;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function OP(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function k6e(e,t){return e[t]}function O6e(e){const t=[];return t.key=e,t}function R6e(){var e=cr([]),t=OP,n=Xm,r=k6e;function i(a){var s=Array.from(e.apply(this,arguments),O6e),o,l=s.length,u=-1,d;for(const c of a)for(o=0,++u;o<l;++o)(s[o][u]=[0,+r(c,s[o].key,u,a)]).data=c;for(o=0,d=P5(t(s));o<l;++o)s[d[o]].index=o;return n(s,d),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:cr(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:cr(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?OP:typeof a=="function"?a:cr(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Xm,i):n},i}function N6e(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,s;i<a;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}Xm(e,t)}}function I6e(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var s=0,o=0;s<i;++s)o+=e[s][n][1]||0;r[n][1]+=r[n][0]=-o/2}Xm(e,t)}}function D6e(e,t){if(!(!((s=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,s;r<a;++r){for(var o=0,l=0,u=0;o<s;++o){for(var d=e[t[o]],c=d[r][1]||0,m=d[r-1][1]||0,g=(c-m)/2,_=0;_<o;++_){var x=e[t[_]],b=x[r][1]||0,v=x[r-1][1]||0;g+=b-v}l+=c,u+=g*c}i[r-1][1]+=i[r-1][0]=n,l&&(n-=u/l)}i[r-1][1]+=i[r-1][0]=n,Xm(e,t)}}function Xy(e){"@babel/helpers - typeof";return Xy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xy(e)}var L6e=["type","size","sizeType"];function RP(){return RP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RP.apply(this,arguments)}function Pq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pq(Object(n),!0).forEach(function(r){P6e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P6e(e,t,n){return t=M6e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M6e(e){var t=j6e(e,"string");return Xy(t)=="symbol"?t:t+""}function j6e(e,t){if(Xy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function F6e(e,t){if(e==null)return{};var n=B6e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function B6e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var iue={symbolCircle:M5,symbolCross:s6e,symbolDiamond:l6e,symbolSquare:u6e,symbolStar:p6e,symbolTriangle:h6e,symbolWye:g6e},U6e=Math.PI/180,$6e=function(t){var n="symbol".concat(uT(t));return iue[n]||M5},z6e=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*U6e;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},H6e=function(t,n){iue["symbol".concat(uT(t))]=n},j5=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,a=i===void 0?64:i,s=t.sizeType,o=s===void 0?"area":s,l=F6e(t,L6e),u=Mq(Mq({},l),{},{type:r,size:a,sizeType:o}),d=function(){var b=$6e(r),v=b6e().type(b).size(z6e(a,o,r));return v()},c=u.className,m=u.cx,g=u.cy,_=Ut(u,!0);return m===+m&&g===+g&&a===+a?le.createElement("path",RP({},_,{className:nn("recharts-symbols",c),transform:"translate(".concat(m,", ").concat(g,")"),d:d()})):null};j5.registerSymbol=H6e;function Zm(e){"@babel/helpers - typeof";return Zm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zm(e)}function NP(){return NP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NP.apply(this,arguments)}function jq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function V6e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jq(Object(n),!0).forEach(function(r){Zy(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jq(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sue(r.key),r)}}function q6e(e,t,n){return t&&G6e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function K6e(e,t,n){return t=PS(t),Y6e(e,aue()?Reflect.construct(t,n||[],PS(e).constructor):t.apply(e,n))}function Y6e(e,t){if(t&&(Zm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X6e(e)}function X6e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aue(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aue=function(){return!!e})()}function PS(e){return PS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},PS(e)}function Z6e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&IP(e,t)}function IP(e,t){return IP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},IP(e,t)}function Zy(e,t,n){return t=sue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sue(e){var t=Q6e(e,"string");return Zm(t)=="symbol"?t:t+""}function Q6e(e,t){if(Zm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var to=32,F5=(function(e){function t(){return W6e(this,t),K6e(this,t,arguments)}return Z6e(t,e),q6e(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,a=to/2,s=to/6,o=to/3,l=r.inactive?i:r.color;if(r.type==="plainline")return le.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:to,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return le.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(a,"h").concat(o,`
52
52
  A`).concat(s,",").concat(s,",0,1,1,").concat(2*o,",").concat(a,`
53
53
  H`).concat(to,"M").concat(2*o,",").concat(a,`
54
54
  A`).concat(s,",").concat(s,",0,1,1,").concat(o,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return le.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(to/8,"h").concat(to,"v").concat(to*3/4,"h").concat(-to,"z"),className:"recharts-legend-icon"});if(le.isValidElement(r.legendIcon)){var u=V6e({},r);return delete u.legendIcon,le.cloneElement(r.legendIcon,u)}return le.createElement(j5,{fill:l,cx:a,cy:a,size:to,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,a=i.payload,s=i.iconSize,o=i.layout,l=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:to,height:to},c={display:o==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(g,_){var x=g.formatter||l,b=nn(Zy(Zy({"recharts-legend-item":!0},"legend-item-".concat(_),!0),"inactive",g.inactive));if(g.type==="none")return null;var v=qt(g.value)?null:g.value;Qo(!qt(g.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var y=g.inactive?u:g.color;return le.createElement("li",NP({className:b,style:c,key:"legend-item-".concat(_)},mc(r.props,g,_)),le.createElement(wP,{width:s,height:s,viewBox:d,style:m},r.renderIcon(g)),le.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},x?x(v,g,_):v))})}},{key:"render",value:function(){var r=this.props,i=r.payload,a=r.layout,s=r.align;if(!i||!i.length)return null;var o={padding:0,margin:0,textAlign:a==="horizontal"?s:"left"};return le.createElement("ul",{className:"recharts-default-legend",style:o},this.renderItems())}}])})(C.PureComponent);Zy(F5,"displayName","Legend");Zy(F5,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var UR,Fq;function J6e(){if(Fq)return UR;Fq=1;var e=sT();function t(){this.__data__=new e,this.size=0}return UR=t,UR}var $R,Bq;function e8e(){if(Bq)return $R;Bq=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return $R=e,$R}var zR,Uq;function t8e(){if(Uq)return zR;Uq=1;function e(t){return this.__data__.get(t)}return zR=e,zR}var HR,$q;function n8e(){if($q)return HR;$q=1;function e(t){return this.__data__.has(t)}return HR=e,HR}var VR,zq;function r8e(){if(zq)return VR;zq=1;var e=sT(),t=k5(),n=O5(),r=200;function i(a,s){var o=this.__data__;if(o instanceof e){var l=o.__data__;if(!t||l.length<r-1)return l.push([a,s]),this.size=++o.size,this;o=this.__data__=new n(l)}return o.set(a,s),this.size=o.size,this}return VR=i,VR}var WR,Hq;function oue(){if(Hq)return WR;Hq=1;var e=sT(),t=J6e(),n=e8e(),r=t8e(),i=n8e(),a=r8e();function s(o){var l=this.__data__=new e(o);this.size=l.size}return s.prototype.clear=t,s.prototype.delete=n,s.prototype.get=r,s.prototype.has=i,s.prototype.set=a,WR=s,WR}var GR,Vq;function i8e(){if(Vq)return GR;Vq=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return GR=t,GR}var qR,Wq;function a8e(){if(Wq)return qR;Wq=1;function e(t){return this.__data__.has(t)}return qR=e,qR}var KR,Gq;function lue(){if(Gq)return KR;Gq=1;var e=O5(),t=i8e(),n=a8e();function r(i){var a=-1,s=i==null?0:i.length;for(this.__data__=new e;++a<s;)this.add(i[a])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,KR=r,KR}var YR,qq;function uue(){if(qq)return YR;qq=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(t[r],r,t))return!0;return!1}return YR=e,YR}var XR,Kq;function cue(){if(Kq)return XR;Kq=1;function e(t,n){return t.has(n)}return XR=e,XR}var ZR,Yq;function due(){if(Yq)return ZR;Yq=1;var e=lue(),t=uue(),n=cue(),r=1,i=2;function a(s,o,l,u,d,c){var m=l&r,g=s.length,_=o.length;if(g!=_&&!(m&&_>g))return!1;var x=c.get(s),b=c.get(o);if(x&&b)return x==o&&b==s;var v=-1,y=!0,E=l&i?new e:void 0;for(c.set(s,o),c.set(o,s);++v<g;){var T=s[v],w=o[v];if(u)var A=m?u(w,T,v,o,s,c):u(T,w,v,s,o,c);if(A!==void 0){if(A)continue;y=!1;break}if(E){if(!t(o,function(O,R){if(!n(E,R)&&(T===O||d(T,O,l,u,c)))return E.push(R)})){y=!1;break}}else if(!(T===w||d(T,w,l,u,c))){y=!1;break}}return c.delete(s),c.delete(o),y}return ZR=a,ZR}var QR,Xq;function s8e(){if(Xq)return QR;Xq=1;var e=lu(),t=e.Uint8Array;return QR=t,QR}var JR,Zq;function o8e(){if(Zq)return JR;Zq=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i,a){r[++n]=[a,i]}),r}return JR=e,JR}var eN,Qq;function B5(){if(Qq)return eN;Qq=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i){r[++n]=i}),r}return eN=e,eN}var tN,Jq;function l8e(){if(Jq)return tN;Jq=1;var e=x1(),t=s8e(),n=A5(),r=due(),i=o8e(),a=B5(),s=1,o=2,l="[object Boolean]",u="[object Date]",d="[object Error]",c="[object Map]",m="[object Number]",g="[object RegExp]",_="[object Set]",x="[object String]",b="[object Symbol]",v="[object ArrayBuffer]",y="[object DataView]",E=e?e.prototype:void 0,T=E?E.valueOf:void 0;function w(A,O,R,N,D,L,U){switch(R){case y:if(A.byteLength!=O.byteLength||A.byteOffset!=O.byteOffset)return!1;A=A.buffer,O=O.buffer;case v:return!(A.byteLength!=O.byteLength||!L(new t(A),new t(O)));case l:case u:case m:return n(+A,+O);case d:return A.name==O.name&&A.message==O.message;case g:case x:return A==O+"";case c:var M=i;case _:var W=N&s;if(M||(M=a),A.size!=O.size&&!W)return!1;var z=U.get(A);if(z)return z==O;N|=o,U.set(A,O);var H=r(M(A),M(O),N,D,L,U);return U.delete(A),H;case b:if(T)return T.call(A)==T.call(O)}return!1}return tN=w,tN}var nN,eK;function fue(){if(eK)return nN;eK=1;function e(t,n){for(var r=-1,i=n.length,a=t.length;++r<i;)t[a+r]=n[r];return t}return nN=e,nN}var rN,tK;function u8e(){if(tK)return rN;tK=1;var e=fue(),t=fs();function n(r,i,a){var s=i(r);return t(r)?s:e(s,a(r))}return rN=n,rN}var iN,nK;function c8e(){if(nK)return iN;nK=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,a=0,s=[];++r<i;){var o=t[r];n(o,r,t)&&(s[a++]=o)}return s}return iN=e,iN}var aN,rK;function d8e(){if(rK)return aN;rK=1;function e(){return[]}return aN=e,aN}var sN,iK;function f8e(){if(iK)return sN;iK=1;var e=c8e(),t=d8e(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(o){return r.call(s,o)}))}:t;return sN=a,sN}var oN,aK;function p8e(){if(aK)return oN;aK=1;function e(t,n){for(var r=-1,i=Array(t);++r<t;)i[r]=n(r);return i}return oN=e,oN}var lN,sK;function h8e(){if(sK)return lN;sK=1;var e=Cc(),t=Tc(),n="[object Arguments]";function r(i){return t(i)&&e(i)==n}return lN=r,lN}var uN,oK;function U5(){if(oK)return uN;oK=1;var e=h8e(),t=Tc(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,a=e((function(){return arguments})())?e:function(s){return t(s)&&r.call(s,"callee")&&!i.call(s,"callee")};return uN=a,uN}var Bv={exports:{}},cN,lK;function m8e(){if(lK)return cN;lK=1;function e(){return!1}return cN=e,cN}Bv.exports;var uK;function pue(){return uK||(uK=1,(function(e,t){var n=lu(),r=m8e(),i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===i,o=s?n.Buffer:void 0,l=o?o.isBuffer:void 0,u=l||r;e.exports=u})(Bv,Bv.exports)),Bv.exports}var dN,cK;function $5(){if(cK)return dN;cK=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,i){var a=typeof r;return i=i??e,!!i&&(a=="number"||a!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<i}return dN=n,dN}var fN,dK;function z5(){if(dK)return fN;dK=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return fN=t,fN}var pN,fK;function g8e(){if(fK)return pN;fK=1;var e=Cc(),t=z5(),n=Tc(),r="[object Arguments]",i="[object Array]",a="[object Boolean]",s="[object Date]",o="[object Error]",l="[object Function]",u="[object Map]",d="[object Number]",c="[object Object]",m="[object RegExp]",g="[object Set]",_="[object String]",x="[object WeakMap]",b="[object ArrayBuffer]",v="[object DataView]",y="[object Float32Array]",E="[object Float64Array]",T="[object Int8Array]",w="[object Int16Array]",A="[object Int32Array]",O="[object Uint8Array]",R="[object Uint8ClampedArray]",N="[object Uint16Array]",D="[object Uint32Array]",L={};L[y]=L[E]=L[T]=L[w]=L[A]=L[O]=L[R]=L[N]=L[D]=!0,L[r]=L[i]=L[b]=L[a]=L[v]=L[s]=L[o]=L[l]=L[u]=L[d]=L[c]=L[m]=L[g]=L[_]=L[x]=!1;function U(M){return n(M)&&t(M.length)&&!!L[e(M)]}return pN=U,pN}var hN,pK;function hue(){if(pK)return hN;pK=1;function e(t){return function(n){return t(n)}}return hN=e,hN}var Uv={exports:{}};Uv.exports;var hK;function b8e(){return hK||(hK=1,(function(e,t){var n=Lle(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===r,s=a&&n.process,o=(function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();e.exports=o})(Uv,Uv.exports)),Uv.exports}var mN,mK;function mue(){if(mK)return mN;mK=1;var e=g8e(),t=hue(),n=b8e(),r=n&&n.isTypedArray,i=r?t(r):e;return mN=i,mN}var gN,gK;function v8e(){if(gK)return gN;gK=1;var e=p8e(),t=U5(),n=fs(),r=pue(),i=$5(),a=mue(),s=Object.prototype,o=s.hasOwnProperty;function l(u,d){var c=n(u),m=!c&&t(u),g=!c&&!m&&r(u),_=!c&&!m&&!g&&a(u),x=c||m||g||_,b=x?e(u.length,String):[],v=b.length;for(var y in u)(d||o.call(u,y))&&!(x&&(y=="length"||g&&(y=="offset"||y=="parent")||_&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||i(y,v)))&&b.push(y);return b}return gN=l,gN}var bN,bK;function y8e(){if(bK)return bN;bK=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return bN=t,bN}var vN,vK;function gue(){if(vK)return vN;vK=1;function e(t,n){return function(r){return t(n(r))}}return vN=e,vN}var yN,yK;function _8e(){if(yK)return yN;yK=1;var e=gue(),t=e(Object.keys,Object);return yN=t,yN}var _N,_K;function x8e(){if(_K)return _N;_K=1;var e=y8e(),t=_8e(),n=Object.prototype,r=n.hasOwnProperty;function i(a){if(!e(a))return t(a);var s=[];for(var o in Object(a))r.call(a,o)&&o!="constructor"&&s.push(o);return s}return _N=i,_N}var xN,xK;function E1(){if(xK)return xN;xK=1;var e=T5(),t=z5();function n(r){return r!=null&&t(r.length)&&!e(r)}return xN=n,xN}var EN,EK;function pT(){if(EK)return EN;EK=1;var e=v8e(),t=x8e(),n=E1();function r(i){return n(i)?e(i):t(i)}return EN=r,EN}var SN,SK;function E8e(){if(SK)return SN;SK=1;var e=u8e(),t=f8e(),n=pT();function r(i){return e(i,n,t)}return SN=r,SN}var wN,wK;function S8e(){if(wK)return wN;wK=1;var e=E8e(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(a,s,o,l,u,d){var c=o&t,m=e(a),g=m.length,_=e(s),x=_.length;if(g!=x&&!c)return!1;for(var b=g;b--;){var v=m[b];if(!(c?v in s:r.call(s,v)))return!1}var y=d.get(a),E=d.get(s);if(y&&E)return y==s&&E==a;var T=!0;d.set(a,s),d.set(s,a);for(var w=c;++b<g;){v=m[b];var A=a[v],O=s[v];if(l)var R=c?l(O,A,v,s,a,d):l(A,O,v,a,s,d);if(!(R===void 0?A===O||u(A,O,o,l,d):R)){T=!1;break}w||(w=v=="constructor")}if(T&&!w){var N=a.constructor,D=s.constructor;N!=D&&"constructor"in a&&"constructor"in s&&!(typeof N=="function"&&N instanceof N&&typeof D=="function"&&D instanceof D)&&(T=!1)}return d.delete(a),d.delete(s),T}return wN=i,wN}var CN,CK;function w8e(){if(CK)return CN;CK=1;var e=Kp(),t=lu(),n=e(t,"DataView");return CN=n,CN}var TN,TK;function C8e(){if(TK)return TN;TK=1;var e=Kp(),t=lu(),n=e(t,"Promise");return TN=n,TN}var AN,AK;function bue(){if(AK)return AN;AK=1;var e=Kp(),t=lu(),n=e(t,"Set");return AN=n,AN}var kN,kK;function T8e(){if(kK)return kN;kK=1;var e=Kp(),t=lu(),n=e(t,"WeakMap");return kN=n,kN}var ON,OK;function A8e(){if(OK)return ON;OK=1;var e=w8e(),t=k5(),n=C8e(),r=bue(),i=T8e(),a=Cc(),s=Ple(),o="[object Map]",l="[object Object]",u="[object Promise]",d="[object Set]",c="[object WeakMap]",m="[object DataView]",g=s(e),_=s(t),x=s(n),b=s(r),v=s(i),y=a;return(e&&y(new e(new ArrayBuffer(1)))!=m||t&&y(new t)!=o||n&&y(n.resolve())!=u||r&&y(new r)!=d||i&&y(new i)!=c)&&(y=function(E){var T=a(E),w=T==l?E.constructor:void 0,A=w?s(w):"";if(A)switch(A){case g:return m;case _:return o;case x:return u;case b:return d;case v:return c}return T}),ON=y,ON}var RN,RK;function k8e(){if(RK)return RN;RK=1;var e=oue(),t=due(),n=l8e(),r=S8e(),i=A8e(),a=fs(),s=pue(),o=mue(),l=1,u="[object Arguments]",d="[object Array]",c="[object Object]",m=Object.prototype,g=m.hasOwnProperty;function _(x,b,v,y,E,T){var w=a(x),A=a(b),O=w?d:i(x),R=A?d:i(b);O=O==u?c:O,R=R==u?c:R;var N=O==c,D=R==c,L=O==R;if(L&&s(x)){if(!s(b))return!1;w=!0,N=!1}if(L&&!N)return T||(T=new e),w||o(x)?t(x,b,v,y,E,T):n(x,b,O,v,y,E,T);if(!(v&l)){var U=N&&g.call(x,"__wrapped__"),M=D&&g.call(b,"__wrapped__");if(U||M){var W=U?x.value():x,z=M?b.value():b;return T||(T=new e),E(W,z,v,y,T)}}return L?(T||(T=new e),r(x,b,v,y,E,T)):!1}return RN=_,RN}var NN,NK;function H5(){if(NK)return NN;NK=1;var e=k8e(),t=Tc();function n(r,i,a,s,o){return r===i?!0:r==null||i==null||!t(r)&&!t(i)?r!==r&&i!==i:e(r,i,a,s,n,o)}return NN=n,NN}var IN,IK;function O8e(){if(IK)return IN;IK=1;var e=oue(),t=H5(),n=1,r=2;function i(a,s,o,l){var u=o.length,d=u,c=!l;if(a==null)return!d;for(a=Object(a);u--;){var m=o[u];if(c&&m[2]?m[1]!==a[m[0]]:!(m[0]in a))return!1}for(;++u<d;){m=o[u];var g=m[0],_=a[g],x=m[1];if(c&&m[2]){if(_===void 0&&!(g in a))return!1}else{var b=new e;if(l)var v=l(_,x,g,a,s,b);if(!(v===void 0?t(x,_,n|r,l,b):v))return!1}}return!0}return IN=i,IN}var DN,DK;function vue(){if(DK)return DN;DK=1;var e=Xd();function t(n){return n===n&&!e(n)}return DN=t,DN}var LN,LK;function R8e(){if(LK)return LN;LK=1;var e=vue(),t=pT();function n(r){for(var i=t(r),a=i.length;a--;){var s=i[a],o=r[s];i[a]=[s,o,e(o)]}return i}return LN=n,LN}var PN,PK;function yue(){if(PK)return PN;PK=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return PN=e,PN}var MN,MK;function N8e(){if(MK)return MN;MK=1;var e=O8e(),t=R8e(),n=yue();function r(i){var a=t(i);return a.length==1&&a[0][2]?n(a[0][0],a[0][1]):function(s){return s===i||e(s,i,a)}}return MN=r,MN}var jN,jK;function I8e(){if(jK)return jN;jK=1;function e(t,n){return t!=null&&n in Object(t)}return jN=e,jN}var FN,FK;function D8e(){if(FK)return FN;FK=1;var e=Fle(),t=U5(),n=fs(),r=$5(),i=z5(),a=lT();function s(o,l,u){l=e(l,o);for(var d=-1,c=l.length,m=!1;++d<c;){var g=a(l[d]);if(!(m=o!=null&&u(o,g)))break;o=o[g]}return m||++d!=c?m:(c=o==null?0:o.length,!!c&&i(c)&&r(g,c)&&(n(o)||t(o)))}return FN=s,FN}var BN,BK;function L8e(){if(BK)return BN;BK=1;var e=I8e(),t=D8e();function n(r,i){return r!=null&&t(r,i,e)}return BN=n,BN}var UN,UK;function P8e(){if(UK)return UN;UK=1;var e=H5(),t=Ble(),n=L8e(),r=C5(),i=vue(),a=yue(),s=lT(),o=1,l=2;function u(d,c){return r(d)&&i(c)?a(s(d),c):function(m){var g=t(m,d);return g===void 0&&g===c?n(m,d):e(c,g,o|l)}}return UN=u,UN}var $N,$K;function Qg(){if($K)return $N;$K=1;function e(t){return t}return $N=e,$N}var zN,zK;function M8e(){if(zK)return zN;zK=1;function e(t){return function(n){return n?.[t]}}return zN=e,zN}var HN,HK;function j8e(){if(HK)return HN;HK=1;var e=N5();function t(n){return function(r){return e(r,n)}}return HN=t,HN}var VN,VK;function F8e(){if(VK)return VN;VK=1;var e=M8e(),t=j8e(),n=C5(),r=lT();function i(a){return n(a)?e(r(a)):t(a)}return VN=i,VN}var WN,WK;function uu(){if(WK)return WN;WK=1;var e=N8e(),t=P8e(),n=Qg(),r=fs(),i=F8e();function a(s){return typeof s=="function"?s:s==null?n:typeof s=="object"?r(s)?t(s[0],s[1]):e(s):i(s)}return WN=a,WN}var GN,GK;function _ue(){if(GK)return GN;GK=1;function e(t,n,r,i){for(var a=t.length,s=r+(i?1:-1);i?s--:++s<a;)if(n(t[s],s,t))return s;return-1}return GN=e,GN}var qN,qK;function B8e(){if(qK)return qN;qK=1;function e(t){return t!==t}return qN=e,qN}var KN,KK;function U8e(){if(KK)return KN;KK=1;function e(t,n,r){for(var i=r-1,a=t.length;++i<a;)if(t[i]===n)return i;return-1}return KN=e,KN}var YN,YK;function $8e(){if(YK)return YN;YK=1;var e=_ue(),t=B8e(),n=U8e();function r(i,a,s){return a===a?n(i,a,s):e(i,t,s)}return YN=r,YN}var XN,XK;function z8e(){if(XK)return XN;XK=1;var e=$8e();function t(n,r){var i=n==null?0:n.length;return!!i&&e(n,r,0)>-1}return XN=t,XN}var ZN,ZK;function H8e(){if(ZK)return ZN;ZK=1;function e(t,n,r){for(var i=-1,a=t==null?0:t.length;++i<a;)if(r(n,t[i]))return!0;return!1}return ZN=e,ZN}var QN,QK;function V8e(){if(QK)return QN;QK=1;function e(){}return QN=e,QN}var JN,JK;function W8e(){if(JK)return JN;JK=1;var e=bue(),t=V8e(),n=B5(),r=1/0,i=e&&1/n(new e([,-0]))[1]==r?function(a){return new e(a)}:t;return JN=i,JN}var eI,eY;function G8e(){if(eY)return eI;eY=1;var e=lue(),t=z8e(),n=H8e(),r=cue(),i=W8e(),a=B5(),s=200;function o(l,u,d){var c=-1,m=t,g=l.length,_=!0,x=[],b=x;if(d)_=!1,m=n;else if(g>=s){var v=u?null:i(l);if(v)return a(v);_=!1,m=r,b=new e}else b=u?[]:x;e:for(;++c<g;){var y=l[c],E=u?u(y):y;if(y=d||y!==0?y:0,_&&E===E){for(var T=b.length;T--;)if(b[T]===E)continue e;u&&b.push(E),x.push(y)}else m(b,E,d)||(b!==x&&b.push(E),x.push(y))}return x}return eI=o,eI}var tI,tY;function q8e(){if(tY)return tI;tY=1;var e=uu(),t=G8e();function n(r,i){return r&&r.length?t(r,e(i,2)):[]}return tI=n,tI}var K8e=q8e();const nY=kn(K8e);function xue(e,t,n){return t===!0?nY(e,n):qt(t)?nY(e,t):e}function Qm(e){"@babel/helpers - typeof";return Qm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qm(e)}var Y8e=["ref"];function rY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ju(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rY(Object(n),!0).forEach(function(r){hT(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function X8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iY(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Sue(r.key),r)}}function Z8e(e,t,n){return t&&iY(e.prototype,t),n&&iY(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Q8e(e,t,n){return t=MS(t),J8e(e,Eue()?Reflect.construct(t,n||[],MS(e).constructor):t.apply(e,n))}function J8e(e,t){if(t&&(Qm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return eFe(e)}function eFe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eue(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Eue=function(){return!!e})()}function MS(e){return MS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},MS(e)}function tFe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&DP(e,t)}function DP(e,t){return DP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},DP(e,t)}function hT(e,t,n){return t=Sue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sue(e){var t=nFe(e,"string");return Qm(t)=="symbol"?t:t+""}function nFe(e,t){if(Qm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function rFe(e,t){if(e==null)return{};var n=iFe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function iFe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function aFe(e){return e.value}function sFe(e,t){if(le.isValidElement(e))return le.cloneElement(e,t);if(typeof e=="function")return le.createElement(e,t);t.ref;var n=rFe(t,Y8e);return le.createElement(F5,n)}var aY=1,Sm=(function(e){function t(){var n;X8e(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=Q8e(this,t,[].concat(i)),hT(n,"lastBoundingBox",{width:-1,height:-1}),n}return tFe(t,e),Z8e(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>aY||Math.abs(i.height-this.lastBoundingBox.height)>aY)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ju({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,a=i.layout,s=i.align,o=i.verticalAlign,l=i.margin,u=i.chartWidth,d=i.chartHeight,c,m;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(s==="center"&&a==="vertical"){var g=this.getBBoxSnapshot();c={left:((u||0)-g.width)/2}}else c=s==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(o==="middle"){var _=this.getBBoxSnapshot();m={top:((d||0)-_.height)/2}}else m=o==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return ju(ju({},c),m)}},{key:"render",value:function(){var r=this,i=this.props,a=i.content,s=i.width,o=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,c=ju(ju({position:"absolute",width:s||"auto",height:o||"auto"},this.getDefaultPosition(l)),l);return le.createElement("div",{className:"recharts-legend-wrapper",style:c,ref:function(g){r.wrapperNode=g}},sFe(a,ju(ju({},this.props),{},{payload:xue(d,u,aFe)})))}}],[{key:"getWithHeight",value:function(r,i){var a=ju(ju({},this.defaultProps),r.props),s=a.layout;return s==="vertical"&&ot(r.props.height)?{height:r.props.height}:s==="horizontal"?{width:r.props.width||i}:null}}])})(C.PureComponent);hT(Sm,"displayName","Legend");hT(Sm,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var nI,sY;function oFe(){if(sY)return nI;sY=1;var e=x1(),t=U5(),n=fs(),r=e?e.isConcatSpreadable:void 0;function i(a){return n(a)||t(a)||!!(r&&a&&a[r])}return nI=i,nI}var rI,oY;function wue(){if(oY)return rI;oY=1;var e=fue(),t=oFe();function n(r,i,a,s,o){var l=-1,u=r.length;for(a||(a=t),o||(o=[]);++l<u;){var d=r[l];i>0&&a(d)?i>1?n(d,i-1,a,s,o):e(o,d):s||(o[o.length]=d)}return o}return rI=n,rI}var iI,lY;function lFe(){if(lY)return iI;lY=1;function e(t){return function(n,r,i){for(var a=-1,s=Object(n),o=i(n),l=o.length;l--;){var u=o[t?l:++a];if(r(s[u],u,s)===!1)break}return n}}return iI=e,iI}var aI,uY;function uFe(){if(uY)return aI;uY=1;var e=lFe(),t=e();return aI=t,aI}var sI,cY;function Cue(){if(cY)return sI;cY=1;var e=uFe(),t=pT();function n(r,i){return r&&e(r,i,t)}return sI=n,sI}var oI,dY;function cFe(){if(dY)return oI;dY=1;var e=E1();function t(n,r){return function(i,a){if(i==null)return i;if(!e(i))return n(i,a);for(var s=i.length,o=r?s:-1,l=Object(i);(r?o--:++o<s)&&a(l[o],o,l)!==!1;);return i}}return oI=t,oI}var lI,fY;function V5(){if(fY)return lI;fY=1;var e=Cue(),t=cFe(),n=t(e);return lI=n,lI}var uI,pY;function Tue(){if(pY)return uI;pY=1;var e=V5(),t=E1();function n(r,i){var a=-1,s=t(r)?Array(r.length):[];return e(r,function(o,l,u){s[++a]=i(o,l,u)}),s}return uI=n,uI}var cI,hY;function dFe(){if(hY)return cI;hY=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return cI=e,cI}var dI,mY;function fFe(){if(mY)return dI;mY=1;var e=Kg();function t(n,r){if(n!==r){var i=n!==void 0,a=n===null,s=n===n,o=e(n),l=r!==void 0,u=r===null,d=r===r,c=e(r);if(!u&&!c&&!o&&n>r||o&&l&&d&&!u&&!c||a&&l&&d||!i&&d||!s)return 1;if(!a&&!o&&!c&&n<r||c&&i&&s&&!a&&!o||u&&i&&s||!l&&s||!d)return-1}return 0}return dI=t,dI}var fI,gY;function pFe(){if(gY)return fI;gY=1;var e=fFe();function t(n,r,i){for(var a=-1,s=n.criteria,o=r.criteria,l=s.length,u=i.length;++a<l;){var d=e(s[a],o[a]);if(d){if(a>=u)return d;var c=i[a];return d*(c=="desc"?-1:1)}}return n.index-r.index}return fI=t,fI}var pI,bY;function hFe(){if(bY)return pI;bY=1;var e=R5(),t=N5(),n=uu(),r=Tue(),i=dFe(),a=hue(),s=pFe(),o=Qg(),l=fs();function u(d,c,m){c.length?c=e(c,function(x){return l(x)?function(b){return t(b,x.length===1?x[0]:x)}:x}):c=[o];var g=-1;c=e(c,a(n));var _=r(d,function(x,b,v){var y=e(c,function(E){return E(x)});return{criteria:y,index:++g,value:x}});return i(_,function(x,b){return s(x,b,m)})}return pI=u,pI}var hI,vY;function mFe(){if(vY)return hI;vY=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return hI=e,hI}var mI,yY;function gFe(){if(yY)return mI;yY=1;var e=mFe(),t=Math.max;function n(r,i,a){return i=t(i===void 0?r.length-1:i,0),function(){for(var s=arguments,o=-1,l=t(s.length-i,0),u=Array(l);++o<l;)u[o]=s[i+o];o=-1;for(var d=Array(i+1);++o<i;)d[o]=s[o];return d[i]=a(u),e(r,this,d)}}return mI=n,mI}var gI,_Y;function bFe(){if(_Y)return gI;_Y=1;function e(t){return function(){return t}}return gI=e,gI}var bI,xY;function Aue(){if(xY)return bI;xY=1;var e=Kp(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return bI=t,bI}var vI,EY;function vFe(){if(EY)return vI;EY=1;var e=bFe(),t=Aue(),n=Qg(),r=t?function(i,a){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:n;return vI=r,vI}var yI,SY;function yFe(){if(SY)return yI;SY=1;var e=800,t=16,n=Date.now;function r(i){var a=0,s=0;return function(){var o=n(),l=t-(o-s);if(s=o,l>0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return yI=r,yI}var _I,wY;function _Fe(){if(wY)return _I;wY=1;var e=vFe(),t=yFe(),n=t(e);return _I=n,_I}var xI,CY;function xFe(){if(CY)return xI;CY=1;var e=Qg(),t=gFe(),n=_Fe();function r(i,a){return n(t(i,a,e),i+"")}return xI=r,xI}var EI,TY;function mT(){if(TY)return EI;TY=1;var e=A5(),t=E1(),n=$5(),r=Xd();function i(a,s,o){if(!r(o))return!1;var l=typeof s;return(l=="number"?t(o)&&n(s,o.length):l=="string"&&s in o)?e(o[s],a):!1}return EI=i,EI}var SI,AY;function EFe(){if(AY)return SI;AY=1;var e=wue(),t=hFe(),n=xFe(),r=mT(),i=n(function(a,s){if(a==null)return[];var o=s.length;return o>1&&r(a,s[0],s[1])?s=[]:o>2&&r(s[0],s[1],s[2])&&(s=[s[0]]),t(a,e(s,1),[])});return SI=i,SI}var SFe=EFe();const W5=kn(SFe);function Qy(e){"@babel/helpers - typeof";return Qy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qy(e)}function LP(){return LP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},LP.apply(this,arguments)}function wFe(e,t){return kFe(e)||AFe(e,t)||TFe(e,t)||CFe()}function CFe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.