toolroll 0.9.50 → 0.9.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/backup.d.ts +8 -0
  3. package/dist/backup.js +10 -1
  4. package/dist/browser/workspace.css +1 -1
  5. package/dist/browser/workspace.js +1 -1
  6. package/dist/browser-workspace.d.ts +1 -0
  7. package/dist/database-reclaim.d.ts +4 -0
  8. package/dist/database-reclaim.js +13 -0
  9. package/dist/demo.d.ts +1 -1
  10. package/dist/demo.js +1 -1
  11. package/dist/desktop-update.d.ts +1 -1
  12. package/dist/live-bus.d.ts +3 -3
  13. package/dist/live-bus.js +3 -3
  14. package/dist/mcp-oauth.d.ts +1 -1
  15. package/dist/mcp-oauth.js +3 -2
  16. package/dist/monitoring.js +32 -8
  17. package/dist/notification-delivery.d.ts +19 -0
  18. package/dist/notification-delivery.js +37 -0
  19. package/dist/operate-remote-arguments.js +1 -1
  20. package/dist/operate-remote.js +2 -2
  21. package/dist/operate.d.ts +1 -1
  22. package/dist/operate.js +54 -120
  23. package/dist/process-recovery-settlement.js +1 -0
  24. package/dist/request-budget.d.ts +5 -2
  25. package/dist/request-budget.js +7 -3
  26. package/dist/retention.js +6 -5
  27. package/dist/scope.d.ts +1 -0
  28. package/dist/scope.js +19 -9
  29. package/dist/serve.js +15 -10
  30. package/dist/server/people-tokens.js +1 -2
  31. package/dist/server/remote.js +19 -4
  32. package/dist/server/settings.js +3 -1
  33. package/dist/server/shared.d.ts +1 -0
  34. package/dist/server/shared.js +2 -0
  35. package/dist/sign-in-guard.d.ts +41 -16
  36. package/dist/sign-in-guard.js +147 -24
  37. package/dist/source-key.d.ts +2 -0
  38. package/dist/source-key.js +49 -0
  39. package/dist/store.d.ts +38 -43
  40. package/dist/store.js +255 -134
  41. package/dist/surface.js +1 -2
  42. package/dist/team-http.d.ts +3 -0
  43. package/dist/team-http.js +3 -0
  44. package/dist/toolroll-update.d.ts +14 -3
  45. package/dist/toolroll-update.js +105 -14
  46. package/dist/webhooks.d.ts +10 -22
  47. package/dist/webhooks.js +43 -81
  48. package/dist/work-index.js +2 -2
  49. package/dist/workspace-revision.d.ts +28 -1
  50. package/dist/workspace-revision.js +276 -49
  51. package/package.json +1 -3
@@ -50,7 +50,7 @@ Error generating stack: `+n.message+`
50
50
  `)},bz=0,Ou=[];function XI(e){var t=xt.useRef([]),a=xt.useRef([0,0]),n=xt.useRef(),o=xt.useState(bz++)[0],r=xt.useState(Fd)[0],s=xt.useRef(e);xt.useEffect(function(){s.current=e},[e]),xt.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=AI([e.lockRef.current],(e.shards||[]).map(WI),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=xt.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!s.current.allowPinchZoom;var x=Th(v),y=a.current,h="deltaX"in v?v.deltaX:y[0]-x[0],w="deltaY"in v?v.deltaY:y[1]-x[1],S,C=v.target,I=Math.abs(h)>Math.abs(w)?"h":"v";if("touches"in v&&I==="h"&&C.type==="range")return!1;var L=window.getSelection(),T=L&&L.anchorNode,M=T?T===C||T.contains(C):!1;if(M)return!1;var O=R1(I,C);if(!O)return!0;if(O?S=I:(S=I==="v"?"h":"v",O=R1(I,C)),!O)return!1;if(!n.current&&"changedTouches"in v&&(h||w)&&(n.current=S),!S)return!0;var H=n.current||S;return $I(H,b,v,H==="h"?h:w,!0)},[]),l=xt.useCallback(function(v){var b=v;if(!(!Ou.length||Ou[Ou.length-1]!==r)){var x="deltaY"in b?jI(b):Th(b),y=t.current.filter(function(S){return S.name===b.type&&(S.target===b.target||b.target===S.shadowParent)&&vz(S.delta,x)})[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var h=(s.current.shards||[]).map(WI).filter(Boolean).filter(function(S){return S.contains(b.target)}),w=h.length>0?i(b,h[0]):!s.current.noIsolation;w&&b.cancelable&&b.preventDefault()}}},[]),c=xt.useCallback(function(v,b,x,y){var h={name:v,delta:b,target:x,should:y,shadowParent:wz(x)};t.current.push(h),setTimeout(function(){t.current=t.current.filter(function(w){return w!==h})},1)},[]),f=xt.useCallback(function(v){a.current=Th(v),n.current=void 0},[]),u=xt.useCallback(function(v){c(v.type,jI(v),v.target,i(v,e.lockRef.current))},[]),d=xt.useCallback(function(v){c(v.type,Th(v),v.target,i(v,e.lockRef.current))},[]);xt.useEffect(function(){return Ou.push(r),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:d}),document.addEventListener("wheel",l,Mi),document.addEventListener("touchmove",l,Mi),document.addEventListener("touchstart",f,Mi),function(){Ou=Ou.filter(function(v){return v!==r}),document.removeEventListener("wheel",l,Mi),document.removeEventListener("touchmove",l,Mi),document.removeEventListener("touchstart",f,Mi)}},[]);var p=e.removeScrollBar,g=e.inert;return xt.createElement(xt.Fragment,null,g?xt.createElement(r,{styles:yz(o)}):null,p?xt.createElement(I1,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var YI=b1(Rh,XI);var KI=Mh.forwardRef(function(e,t){return Mh.createElement(Bd,cn({},e,{ref:t,sideCar:YI}))});KI.classNames=Bd.classNames;var Ei=KI;var Sz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},zu=new WeakMap,Eh=new WeakMap,Ah={},T1=0,ZI=function(e){return e&&(e.host||ZI(e.parentNode))},Cz=function(e,t){return t.map(function(a){if(e.contains(a))return a;var n=ZI(a);return n&&e.contains(n)?n:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},kz=function(e,t,a,n){var o=Cz(t,Array.isArray(e)?e:[e]);Ah[a]||(Ah[a]=new WeakMap);var r=Ah[a],s=[],i=new Set,l=new Set(o),c=function(u){!u||i.has(u)||(i.add(u),c(u.parentNode))};o.forEach(c);var f=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(d){if(i.has(d))f(d);else try{var p=d.getAttribute(n),g=p!==null&&p!=="false",v=(zu.get(d)||0)+1,b=(r.get(d)||0)+1;zu.set(d,v),r.set(d,b),s.push(d),v===1&&g&&Eh.set(d,!0),b===1&&d.setAttribute(a,"true"),g||d.setAttribute(n,"true")}catch(x){console.error("aria-hidden: cannot operate on ",d,x)}})};return f(t),i.clear(),T1++,function(){s.forEach(function(u){var d=zu.get(u)-1,p=r.get(u)-1;zu.set(u,d),r.set(u,p),d||(Eh.has(u)||u.removeAttribute(n),Eh.delete(u)),p||u.removeAttribute(a)}),T1--,T1||(zu=new WeakMap,zu=new WeakMap,Eh=new WeakMap,Ah={})}},Bu=function(e,t,a){a===void 0&&(a="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||Sz(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),kz(n,o,a,"aria-hidden")):function(){return null}};var It=j(fe(),1),Lz=Object.defineProperty,An=(e,t)=>Lz(e,"name",{value:t,configurable:!0}),E1="Dialog",[QI,SQ]=gt(E1),[Iz,xo]=QI(E1),JI=An(e=>{let{__scopeDialog:t,children:a,open:n,defaultOpen:o,onOpenChange:r,modal:s=!0}=e,i=mt.useRef(null),l=mt.useRef(null),[c,f]=Ta({prop:n,defaultProp:o??!1,onChange:r,caller:E1}),[u,d]=mt.useState(0),[p,g]=mt.useState(0);return(0,It.jsx)(Iz,{scope:t,triggerRef:i,contentRef:l,contentId:Va(),titleId:Va(),descriptionId:Va(),titlePresent:u>0,descriptionPresent:p>0,setTitleCount:d,setDescriptionCount:g,open:c,onOpenChange:f,onOpenToggle:mt.useCallback(()=>f(v=>!v),[f]),modal:s,children:a})},"Dialog"),Nz="DialogTrigger",e4=mt.forwardRef(An(function(t,a){let{__scopeDialog:n,...o}=t,r=xo(Nz,n),s=Te(a,r.triggerRef);return(0,It.jsx)(Re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.open?r.contentId:void 0,"data-state":Dh(r.open),...o,ref:s,onClick:ke(t.onClick,r.onOpenToggle)})},"DialogTrigger")),t4="DialogPortal",[Rz,a4]=QI(t4,{forceMount:void 0}),n4=An(e=>{let{__scopeDialog:t,forceMount:a,children:n,container:o}=e,r=xo(t4,t);return(0,It.jsx)(Rz,{scope:t,forceMount:a,children:mt.Children.map(n,s=>(0,It.jsx)(En,{present:a||r.open,children:(0,It.jsx)(Eu,{asChild:!0,container:o,children:s})}))})},"DialogPortal"),M1="DialogOverlay",o4=mt.forwardRef(An(function(t,a){let n=a4(M1,t.__scopeDialog),{forceMount:o=n.forceMount,...r}=t,s=xo(M1,t.__scopeDialog);return s.modal?(0,It.jsx)(En,{present:o||s.open,children:(0,It.jsx)(Mz,{...r,ref:a})}):null},"DialogOverlay")),Tz=Ma("DialogOverlay.RemoveScroll"),Mz=mt.forwardRef(An(function(t,a){let{__scopeDialog:n,...o}=t,r=xo(M1,n),s=s1(),i=Te(a,s);return(0,It.jsx)(Ei,{as:Tz,allowPinchZoom:!0,shards:[r.contentRef],children:(0,It.jsx)(Re.div,{"data-state":Dh(r.open),...o,ref:i,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),qd="DialogContent",r4=mt.forwardRef(An(function(t,a){let n=a4(qd,t.__scopeDialog),{forceMount:o=n.forceMount,...r}=t,s=xo(qd,t.__scopeDialog);return(0,It.jsx)(En,{present:o||s.open,children:s.modal?(0,It.jsx)(Ez,{...r,ref:a}):(0,It.jsx)(Az,{...r,ref:a})})},"DialogContent")),Ez=mt.forwardRef(An(function(t,a){let n=xo(qd,t.__scopeDialog),o=mt.useRef(null),r=Te(a,n.contentRef,o);return mt.useEffect(()=>{let s=o.current;if(s)return Bu(s)},[]),(0,It.jsx)(s4,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:ke(t.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ke(t.onPointerDownOutside,s=>{let i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:ke(t.onFocusOutside,s=>s.preventDefault())})},"DialogContentModal")),Az=mt.forwardRef(An(function(t,a){let n=xo(qd,t.__scopeDialog),o=mt.useRef(!1),r=mt.useRef(!1);return(0,It.jsx)(s4,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(o.current||n.triggerRef.current?.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));let i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})},"DialogContentNonModal")),s4=mt.forwardRef(An(function(t,a){let{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,...i}=t,l=xo(qd,n);return bs(),(0,It.jsx)(It.Fragment,{children:(0,It.jsx)(Mu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:(0,It.jsx)(Tu,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":Dh(l.open),...i,ref:a,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),Dz="DialogTitle",i4=mt.forwardRef(An(function(t,a){let{__scopeDialog:n,...o}=t,r=xo(Dz,n),{setTitleCount:s}=r;return Ze(()=>(s(i=>i+1),()=>s(i=>i-1)),[s]),(0,It.jsx)(Re.h2,{id:r.titleId,...o,ref:a})},"DialogTitle")),_z="DialogDescription",l4=mt.forwardRef(An(function(t,a){let{__scopeDialog:n,...o}=t,r=xo(_z,n),{setDescriptionCount:s}=r;return Ze(()=>(s(i=>i+1),()=>s(i=>i-1)),[s]),(0,It.jsx)(Re.p,{id:r.descriptionId,...o,ref:a})},"DialogDescription")),Pz="DialogClose",u4=mt.forwardRef(An(function(t,a){let{__scopeDialog:n,...o}=t,r=xo(Pz,n);return(0,It.jsx)(Re.button,{type:"button",...o,ref:a,onClick:ke(t.onClick,()=>r.onOpenChange(!1))})},"DialogClose"));function Dh(e){return e?"open":"closed"}An(Dh,"getState");var Aa=j(fe(),1);function Pt(...e){return e.filter(Boolean).join(" ")}function _e({className:e,variant:t="primary",size:a="default",asChild:n=!1,type:o,...r}){return(0,Aa.jsx)(n?Sh:"button",{"data-slot":"button","data-variant":t,"data-size":a,className:Pt("ui-button",`ui-button--${t}`,`ui-button--${a}`,e),...n?{}:{type:o??"button"},...r})}function A1({className:e,tone:t="neutral",...a}){return(0,Aa.jsx)("span",{"data-slot":"badge","data-tone":t,className:Pt("ui-badge",`ui-badge--${t}`,e),...a})}function Ai({className:e,...t}){return(0,Aa.jsx)("input",{className:Pt("ui-input",e),...t})}function ws({className:e,...t}){return(0,Aa.jsx)("textarea",{className:Pt("ui-textarea",e),...t})}function Di({className:e,...t}){return(0,Aa.jsx)("label",{className:Pt("ui-label",e),...t})}function Jn({summary:e,className:t,children:a,...n}){return(0,Aa.jsxs)("details",{className:Pt("ui-disclosure",t),...n,children:[(0,Aa.jsx)("summary",{className:"ui-disclosure-trigger",children:e}),(0,Aa.jsx)("div",{className:"ui-disclosure-content",children:a})]})}function dn({className:e,tone:t="info",...a}){return(0,Aa.jsx)("div",{role:t==="error"?"alert":"status","data-tone":t,className:Pt("ui-alert",`ui-alert--${t}`,e),...a})}var D1=JI,_1=e4,P1=u4;function O1({className:e,children:t,...a}){return(0,Aa.jsxs)(n4,{children:[(0,Aa.jsx)(o4,{className:"ui-dialog-overlay"}),(0,Aa.jsx)(r4,{className:Pt("ui-dialog-content",e),...a,children:t})]})}function z1({className:e,...t}){return(0,Aa.jsx)(i4,{className:Pt("ui-dialog-title",e),...t})}function B1({className:e,...t}){return(0,Aa.jsx)(l4,{className:Pt("ui-dialog-description",e),...t})}var va=j(he(),1);var zz={damping:.7,stiffness:.05,mass:1.25},Bz=70,Fz=1e3/60,Hz=350,_h=!1;globalThis.document?.addEventListener("mousedown",()=>{_h=!0});globalThis.document?.addEventListener("mouseup",()=>{_h=!1});globalThis.document?.addEventListener("click",()=>{_h=!1});var d4=(e={})=>{let[t,a]=(0,va.useState)(!1),[n,o]=(0,va.useState)(e.initial!==!1),[r,s]=(0,va.useState)(!1),i=(0,va.useRef)(null);i.current=e;let l=(0,va.useCallback)(()=>{if(!_h)return!1;let y=window.getSelection();if(!y||!y.rangeCount)return!1;let h=y.getRangeAt(0);return h.commonAncestorContainer.contains(b.current)||b.current?.contains(h.commonAncestorContainer)},[]),c=(0,va.useCallback)(y=>{u.isAtBottom=y,o(y)},[]),f=(0,va.useCallback)(y=>{u.escapedFromLock=y,a(y)},[]),u=(0,va.useMemo)(()=>{let y;return{escapedFromLock:t,isAtBottom:n,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return b.current?.scrollTop??0},set scrollTop(h){if(b.current){let{scrollBehavior:w}=getComputedStyle(b.current);w!=="auto"&&(b.current.style.scrollBehavior="auto"),b.current.scrollTop=h,u.ignoreScrollToTop=b.current.scrollTop,w!=="auto"&&(b.current.style.scrollBehavior=w)}},get targetScrollTop(){return!b.current||!x.current?0:b.current.scrollHeight-1-b.current.clientHeight},get calculatedTargetScrollTop(){if(!b.current||!x.current)return 0;let{targetScrollTop:h}=this;if(!e.targetScrollTop)return h;if(y?.targetScrollTop===h)return y.calculatedScrollTop;let w=Math.max(Math.min(e.targetScrollTop(h,{scrollElement:b.current,contentElement:x.current}),h),0);return y={targetScrollTop:h,calculatedScrollTop:w},requestAnimationFrame(()=>{y=void 0}),w},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Bz}}},[]),d=(0,va.useCallback)((y={})=>{typeof y=="string"&&(y={animation:y}),y.preserveScrollPosition||c(!0);let h=Date.now()+(Number(y.wait)||0),w=H1(i.current,y.animation),{ignoreEscapes:S=!1}=y,C,I=u.calculatedTargetScrollTop;y.duration instanceof Promise?y.duration.finally(()=>{C=Date.now()}):C=h+(y.duration??0);let L=async()=>{let T=new Promise(requestAnimationFrame).then(()=>{if(!u.isAtBottom)return u.animation=void 0,!1;let{scrollTop:M}=u,O=performance.now(),H=(O-(u.lastTick??O))/Fz;if(u.animation||(u.animation={behavior:w,promise:T,ignoreEscapes:S}),u.animation.behavior===w&&(u.lastTick=O),l()||h>Date.now())return L();if(M<Math.min(I,u.calculatedTargetScrollTop)){if(u.animation?.behavior===w){if(w==="instant")return u.scrollTop=u.calculatedTargetScrollTop,L();u.velocity=(w.damping*u.velocity+w.stiffness*u.scrollDifference)/w.mass,u.accumulated+=u.velocity*H,u.scrollTop+=u.accumulated,u.scrollTop!==M&&(u.accumulated=0)}return L()}return C>Date.now()?(I=u.calculatedTargetScrollTop,L()):(u.animation=void 0,u.scrollTop<u.calculatedTargetScrollTop?d({animation:H1(i.current,i.current.resize),ignoreEscapes:S,duration:Math.max(0,C-Date.now())||void 0}):u.isAtBottom)});return T.then(M=>(requestAnimationFrame(()=>{u.animation||(u.lastTick=void 0,u.velocity=0)}),M))};return y.wait!==!0&&(u.animation=void 0),u.animation?.behavior===w?u.animation.promise:L()},[c,l,u]),p=(0,va.useCallback)(()=>{f(!0),c(!1)},[f,c]),g=(0,va.useCallback)(({target:y})=>{if(y!==b.current)return;let{scrollTop:h,ignoreScrollToTop:w}=u,{lastScrollTop:S=h}=u;u.lastScrollTop=h,u.ignoreScrollToTop=void 0,w&&w>h&&(S=w),s(u.isNearBottom),setTimeout(()=>{if(u.resizeDifference||h===w)return;if(l()){f(!0),c(!1);return}let C=h>S,I=h<S;if(u.animation?.ignoreEscapes){u.scrollTop=S;return}I&&(f(!0),c(!1)),C&&f(!1),!u.escapedFromLock&&u.isNearBottom&&c(!0)},1)},[f,c,l,u]),v=(0,va.useCallback)(({target:y,deltaY:h})=>{let w=y;for(;!["scroll","auto"].includes(getComputedStyle(w).overflow);){if(!w.parentElement)return;w=w.parentElement}w===b.current&&h<0&&b.current.scrollHeight>b.current.clientHeight&&!u.animation?.ignoreEscapes&&(f(!0),c(!1))},[f,c,u]),b=c4(y=>{b.current?.removeEventListener("scroll",g),b.current?.removeEventListener("wheel",v),y?.addEventListener("scroll",g,{passive:!0}),y?.addEventListener("wheel",v,{passive:!0})},[]),x=c4(y=>{if(u.resizeObserver?.disconnect(),u.resizeObserver=void 0,!y)return;let h;u.resizeObserver=new ResizeObserver(([w])=>{let{height:S}=w.contentRect,C=S-(h??S);if(u.resizeDifference=C,u.scrollTop>u.targetScrollTop&&(u.scrollTop=u.targetScrollTop),s(u.isNearBottom),C>=0){let I=H1(i.current,h?i.current.resize:i.current.initial);d({animation:I,wait:!0,preserveScrollPosition:!0,duration:I==="instant"?void 0:Hz})}else u.isNearBottom&&(f(!1),c(!0));h=S,requestAnimationFrame(()=>{setTimeout(()=>{u.resizeDifference===C&&(u.resizeDifference=0)},1)})}),u.resizeObserver?.observe(y)},[]);return{contentRef:x,scrollRef:b,scrollToBottom:d,stopScroll:p,isAtBottom:n||r,isNearBottom:r,escapedFromLock:t,state:u}};function c4(e,t){let a=(0,va.useCallback)(n=>(a.current=n,e(n)),t);return a}var F1=new Map;function H1(...e){let t={...zz},a=!1;for(let o of e){if(o==="instant"){a=!0;continue}typeof o=="object"&&(a=!1,t.damping=o.damping??t.damping,t.stiffness=o.stiffness??t.stiffness,t.mass=o.mass??t.mass)}let n=JSON.stringify(t);return F1.has(n)||F1.set(n,Object.freeze(t)),a?"instant":F1.get(n)}var _i=j(he(),1),fn=j(he(),1);var f4=(0,fn.createContext)(null),qz=typeof window<"u"?fn.useLayoutEffect:fn.useEffect;function Ud({instance:e,children:t,resize:a,initial:n,mass:o,damping:r,stiffness:s,targetScrollTop:i,contextRef:l,...c}){let f=(0,fn.useRef)(null),u=_i.useCallback((S,C)=>(w?.targetScrollTop??i)?.(S,C)??S,[i]),d=d4({mass:o,damping:r,stiffness:s,resize:a,initial:n,targetScrollTop:u}),{scrollRef:p,contentRef:g,scrollToBottom:v,stopScroll:b,isAtBottom:x,escapedFromLock:y,state:h}=e??d,w=(0,fn.useMemo)(()=>({scrollToBottom:v,stopScroll:b,scrollRef:p,isAtBottom:x,escapedFromLock:y,contentRef:g,state:h,get targetScrollTop(){return f.current},set targetScrollTop(S){f.current=S}}),[v,x,g,p,b,y,h]);return(0,fn.useImperativeHandle)(l,()=>w,[w]),qz(()=>{p.current&&getComputedStyle(p.current).overflow==="visible"&&(p.current.style.overflow="auto")},[]),_i.createElement(f4.Provider,{value:w},_i.createElement("div",{...c},typeof t=="function"?t(w):t))}(function(e){function t({children:a,scrollClassName:n,...o}){let r=q1();return _i.createElement("div",{ref:r.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:n},_i.createElement("div",{...o,ref:r.contentRef},typeof a=="function"?a(r):a))}e.Content=t})(Ud||(Ud={}));function q1(){let e=(0,fn.useContext)(f4);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}var Dn=j(fe(),1);function p4({className:e,...t}){return(0,Dn.jsx)(Ud,{className:Pt("ui-conversation",e),initial:"instant",resize:"instant",role:"log","aria-label":"Conversation",...t})}function m4({className:e,...t}){return(0,Dn.jsx)(Ud.Content,{className:Pt("ui-conversation-content",e),...t})}function h4({className:e,children:t,onClick:a,...n}){let{isAtBottom:o,scrollToBottom:r}=q1();return o?null:(0,Dn.jsx)(_e,{className:Pt("ui-conversation-scroll",e),variant:"secondary",size:"sm",onClick:s=>{a?.(s),s.defaultPrevented||r({animation:"instant"})},...n,children:t??"Latest message"})}function g4({className:e,title:t="Start a conversation",description:a,children:n,...o}){return(0,Dn.jsx)("div",{className:Pt("ui-conversation-empty",e),...o,children:n??(0,Dn.jsxs)(Dn.Fragment,{children:[(0,Dn.jsx)("h2",{children:t}),a&&(0,Dn.jsx)("p",{children:a})]})})}function Ph({className:e,from:t,...a}){return(0,Dn.jsx)("article",{className:Pt("ui-message",`ui-message--${t}`,e),"data-from":t,...a})}function Vd({className:e,...t}){return(0,Dn.jsx)("div",{className:Pt("ui-message-content",e),...t})}var U1=j(he(),1);var V1=j(fe(),1);var AQ=(0,U1.createContext)(null);function x4({className:e,...t}){return(0,V1.jsx)("section",{className:Pt("ui-artifact",e),...t})}function v4({className:e,...t}){return(0,V1.jsx)("div",{className:Pt("ui-artifact-content",e),...t})}var y4=j(fe(),1);var G1="standing-orders:workspace-draft:",w4="standing-orders:workspace-carry:",$1=/^[a-f0-9]{32}$/;function S4(){return Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("")}function Oh(e,t){return`${e}${encodeURIComponent(t.user)}:${e===G1?`${t.session}:`:""}${encodeURIComponent(t.task??"")}`}function zh(e,t=Date.now()){return{text:"",request:e,submitted:!1,pending:null,at:t}}function Nt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Uz(e,t){return Nt(e)&&typeof e.request=="string"&&$1.test(e.request)&&typeof e.text=="string"&&e.text.length<=t}function C4(e,t,a,n,o=Date.now()){let r=zh(a,o);try{let s=Oh(G1,t),i=JSON.parse(e.getItem(s)??"null");if(Nt(i)&&i.user===t.user&&i.session===t.session&&i.task===t.task&&typeof i.at=="number"&&i.at>o-864e5&&i.at<=o&&typeof i.text=="string"&&i.text.length<=n&&typeof i.request=="string"&&$1.test(i.request)&&typeof i.submitted=="boolean"&&(i.pending===null||Uz(i.pending,n)))return{text:i.text,request:i.request,submitted:i.submitted,pending:i.pending,at:i.at};e.removeItem(s);let l=Oh(w4,t),c=JSON.parse(e.getItem(l)??"null");if(e.removeItem(l),Nt(c)&&c.user===t.user&&c.task===t.task&&typeof c.at=="number"&&c.at>o-864e5&&c.at<=o&&typeof c.text=="string"&&c.text.length<=n)return{...r,text:c.text}}catch{}return r}function k4(e,t,a){try{let n=Oh(G1,t);return a.text||a.pending?e.setItem(n,JSON.stringify({...t,...a})):e.removeItem(n),!0}catch{return!1}}function L4(e,t,a,n=Date.now()){try{return t.user&&a.trim()&&e.setItem(Oh(w4,t),JSON.stringify({user:t.user,task:t.task,text:a,at:n})),!0}catch{return!1}}function I4(e,t,a=S4,n=Date.now()){return{...e,text:t,request:e.submitted?a():e.request,submitted:!1,at:n}}function N4(e,t=Date.now()){return e.pending||!e.text.trim()?e:{...e,submitted:!0,pending:{request:e.request,text:e.text},at:t}}function R4(e,t,a,n=S4,o=Date.now()){return!t||!a?.received||a.request!==t||e.pending?.request!==t?e:e.submitted&&e.request===t&&e.text===e.pending.text?zh(n(),o):{...e,pending:null,at:o}}function T4(e,t){return e.pending?.request===t?{...e,pending:null,submitted:!1}:e}function M4(e,t){return e.user===t.user&&e.conversation?.sessionId===t.conversation?.sessionId&&e.conversation?.taskId===t.conversation?.taskId&&e.conversation?.resultRunId===t.conversation?.resultRunId&&(e.conversation?.project??null)===(t.conversation?.project??null)}function Vz(e){if(!e.startsWith("/")||e.startsWith("//"))throw new Error("Unexpected workspace address");return e}function Gz(e){return Nt(e)&&(e.sandbox===null||typeof e.sandbox=="string")&&Array.isArray(e.steps)&&e.steps.every(t=>Nt(t)&&typeof t.key=="string"&&typeof t.title=="string"&&typeof t.done=="boolean"&&(t.action===null||Nt(t.action)&&(t.action.kind==="command"?typeof t.action.command=="string":t.action.kind==="link"&&typeof t.action.label=="string"&&typeof t.action.href=="string"&&t.action.href.startsWith("/"))))&&Array.isArray(e.suggestions)&&e.suggestions.every(t=>Nt(t)&&typeof t.label=="string"&&typeof t.draft=="string"&&typeof t.source=="string")}function j1(e){if(!Nt(e)||e.version!==1||typeof e.path!="string"||typeof e.title!="string"||typeof e.user!="string"||typeof e.csrf!="string"||typeof e.refreshUrl!="string"||typeof e.sensitive!="boolean"||typeof e.crewTruncated!="boolean"||typeof e.catchUpHtml!="string"||typeof e.controlsHtml!="string"||!Array.isArray(e.notices)||!e.notices.every(a=>typeof a=="string")||!(e.pageHtml===null||typeof e.pageHtml=="string")||!Array.isArray(e.navigation)||!e.navigation.every(a=>Nt(a)&&typeof a.label=="string"&&typeof a.href=="string"&&typeof a.active=="boolean"&&(a.count===void 0||typeof a.count=="number"))||e.view!==void 0&&e.view!==null&&!(Nt(e.view)&&typeof e.view.kind=="string")||e.signIn!==void 0&&!(Array.isArray(e.signIn)&&e.signIn.every(a=>Nt(a)&&[a.provider,a.title,a.command,a.detail,a.resumeLabel,a.resumeHref].every(n=>typeof n=="string")&&String(a.resumeHref).startsWith("/")))||e.firstRun!==void 0&&!Gz(e.firstRun)||e.refreshSeconds!==void 0&&!(typeof e.refreshSeconds=="number"&&Number.isFinite(e.refreshSeconds)&&e.refreshSeconds>=5)||e.chats!==void 0&&!(Array.isArray(e.chats)&&e.chats.every(a=>Nt(a)&&(a.kind==="project"||a.kind==="task")&&typeof a.title=="string"&&typeof a.href=="string"&&a.href.startsWith("/")&&typeof a.active=="boolean"&&(a.at===null||typeof a.at=="string")))||!Array.isArray(e.projects)||!e.projects.every(a=>Nt(a)&&[a.name,a.path,a.href,a.knowledgeHref].every(n=>typeof n=="string"))||!Array.isArray(e.crew)||!e.crew.every(a=>Nt(a)&&[a.id,a.title,a.state,a.label,a.tone,a.href].every(n=>typeof n=="string")&&(a.project===null||typeof a.project=="string")&&(a.resultHref===null||typeof a.resultHref=="string")&&(a.action===null||Nt(a.action)&&typeof a.action.label=="string"&&typeof a.action.href=="string"))||!(e.focus===null||Nt(e.focus)&&typeof e.focus.id=="string"&&typeof e.focus.title=="string"&&typeof e.focus.html=="string")||!(e.result===null||Nt(e.result)&&typeof e.result.runId=="number"&&typeof e.result.html=="string")||!(e.receipt===null||Nt(e.receipt)&&typeof e.receipt.request=="string"&&typeof e.receipt.received=="boolean"))return!1;let t=e.conversation;return t===null||Nt(t)&&typeof t.sessionId=="number"&&typeof t.user=="string"&&typeof t.version=="string"&&typeof t.requestId=="string"&&$1.test(t.requestId)&&typeof t.maxChars=="number"&&t.maxChars>0&&(t.taskId===null||typeof t.taskId=="string")&&(t.resultRunId===null||typeof t.resultRunId=="number")&&(t.project===void 0||t.project===null||typeof t.project=="string")&&(t.pendingTurnId===null||typeof t.pendingTurnId=="number")&&Array.isArray(t.messages)&&t.messages.every(b4)&&(t.previous===void 0||t.previous===null||Nt(t.previous)&&Array.isArray(t.previous.messages)&&t.previous.messages.every(b4))}function b4(e){return Nt(e)&&typeof e.id=="number"&&(e.role==="operator"||e.role==="assistant")&&typeof e.text=="string"&&typeof e.html=="string"&&typeof e.cardsHtml=="string"&&typeof e.createdAt=="string"&&(e.activity===null||typeof e.activity=="string")&&(e.cards===void 0||Array.isArray(e.cards)&&e.cards.every(t=>Nt(t)&&typeof t.id=="number"&&typeof t.kind=="string"&&typeof t.label=="string"&&typeof t.state=="string"&&typeof t.body=="string"&&Array.isArray(t.links)&&typeof t.dismissable=="boolean"))}var Lr=class extends Error{};function E4(e,t,a){return t&&!a?Math.min(3e4,e*2):5e3}async function A4(e,t,a=fetch,n={}){let o=new URL(Vz(e.refreshUrl),window.location.origin);o.searchParams.set("format","workspace"),t?o.searchParams.set("request",t):o.searchParams.delete("request");let r=t||n.force?null:n.etag,s=await a(o.pathname+o.search,{credentials:"same-origin",cache:"no-store",headers:{accept:"application/json",...r?{"if-none-match":r}:{}},signal:AbortSignal.timeout(12e3)});if(s.status===401||s.status===403||s.redirected)throw new Lr("Sign in again to reconnect. Your draft stays in this tab.");if(s.status===304){if(!r)throw new Error("The update was incomplete. Your current view is preserved.");return{kind:"unchanged",etag:s.headers.get("etag")??r}}if(!s.ok)throw new Error("Updates are unavailable. Your work is still saved.");let i=await s.json();if(!j1(i))throw new Error("The update was incomplete. Your current view is preserved.");return{kind:"changed",workspace:i,etag:s.headers.get("etag")}}async function D4(e,t,a=fetch,n=null){let o=e.conversation;if(!o)throw new Lr("Reconnect to the conversation before sending.");let r=new URLSearchParams({csrf:e.csrf,message:t.text,request:t.request,"request-session":String(o.sessionId)});n!==null&&o.taskId&&r.set("mode",n),o.taskId?r.set("task",o.taskId):o.project&&r.set("project",o.project),o.resultRunId!==null&&r.set("result",String(o.resultRunId));let s=await a("/chat",{method:"POST",credentials:"same-origin",body:r,headers:{accept:"application/json"},signal:AbortSignal.timeout(15e3)});if(s.status===401||s.status===403)throw new Lr("Sign in again to reconnect. Your draft stays in this tab.");if(s.headers.get("content-type")?.includes("application/json")){let i=await s.json();if(Nt(i)&&i.ok===!1)return{refused:!0,message:typeof i.said=="string"?i.said:"Message not sent. Your draft is saved."}}return{refused:!1,message:null}}var Ct=j(he(),1);var Bh=j(he(),1);var _4=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function P4(e,t,a=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:_4(e),size:24,node:t,...a.length>0?{aliases:a}:{}}}var O4=e=>{let t="",a=!1;for(let n of e){if(n==="-"||n==="_"||n<=" "){a=t.length>0;continue}t.length===0?t+=n.toLowerCase():t+=a?n.toUpperCase():n,a=!1}return t};var z4=e=>{let t=O4(e);return t.charAt(0).toUpperCase()+t.slice(1)};var $d=j(he(),1);var Gd=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var Ss={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function W1(e){return e!=null}function B4(e,t={}){let a=t.attributeNames??{},n=d=>a[d]??d,o=e.size??e.width??Ss.width,r=e.size??e.height??Ss.height,s=e.aliases?.filter(d=>typeof d=="string"&&d.trim()!=="").map(d=>`lucide-${d}`)??[],i=[...e.name?[`lucide-${e.name}`]:[],...s],l=t.className?.split(" ").filter(Boolean)??[],c=t.includeDefaultClasses===!1?Gd(...l):Gd("lucide",...i,...l),f=t.absoluteStrokeWidth?Number(t.strokeWidth??Ss["stroke-width"])*Number(e.size??e.width??Ss.width)/Number(t.size??t.width??Ss.width):t.strokeWidth??Ss["stroke-width"];return["svg",{...Object.entries(Ss).reduce((d,[p,g])=>(d[n(p)]=g,d),{}),..."color"in t&&t.color&&{[n("stroke")]:t.color},..."size"in t&&W1(t.size)&&{[n("width")]:t.size,[n("height")]:t.size},..."width"in t&&W1(t.width)&&{[n("width")]:t.width},..."height"in t&&W1(t.height)&&{[n("height")]:t.height},[n("stroke-width")]:f,...c&&{[n("class")]:c},[n("viewBox")]:`0 0 ${o} ${r}`,...t.hasA11yProp===!1?{[n("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(d=>{let[p,g,v]=d,b=t.nonScalingStroke?{[n("vector-effect")]:"non-scaling-stroke",...g}:g;return v?[p,b,v]:[p,b]})]}function F4(e,t={}){return B4(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var H4=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Fu=j(he(),1);var $z=(0,Fu.createContext)({});var q4=()=>(0,Fu.useContext)($z);var U4=(0,$d.forwardRef)(({color:e,size:t,width:a,height:n,strokeWidth:o,absoluteStrokeWidth:r,nonScalingStroke:s,className:i="",children:l,iconNode:c=[],icon:f={node:c,aliases:[],size:24},...u},d)=>{let{size:p=24,strokeWidth:g=2,absoluteStrokeWidth:v=!1,nonScalingStroke:b=!1,color:x="currentColor",className:y=""}=q4()??{},h=!!l||H4(u),[w,S,C=[]]=F4(f,{color:e??x,width:a??t??p,height:n??t??p,strokeWidth:o??g,absoluteStrokeWidth:r??v,nonScalingStroke:s??b,className:Gd(y,i),hasA11yProp:h,attributes:u});return(0,$d.createElement)(w,{ref:d,...S},[...C.map(([I,L])=>(0,$d.createElement)(I,L)),...Array.isArray(l)?l:[l]])});function Q(e,t=[],a=[]){let n=typeof e=="string"?P4(e,t,a):e,o=(0,Bh.forwardRef)(({className:r,...s},i)=>(0,Bh.createElement)(U4,{ref:i,icon:n,className:r,...s}));return n.name&&(o.displayName=z4(n.name)),o}var V4={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};V4.node;var jd=Q(V4);var G4={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};G4.node;var Cs=Q(G4);var $4={name:"bell-off",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]};$4.node;var Wd=Q($4);var j4={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};j4.node;var Xd=Q(j4);var W4={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};W4.node;var Pi=Q(W4);var X4={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};X4.node;var Oi=Q(X4);var Y4={name:"briefcase",size:24,node:[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]};Y4.node;var Yd=Q(Y4);var K4={name:"calendar-clock",size:24,node:[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v3",key:"otl347"}],["path",{d:"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338",key:"7hb8p4"}],["path",{d:"M3 9h5.859",key:"numkqi"}],["path",{d:"M8 2v3",key:"1ioesn"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]};K4.node;var Kd=Q(K4);var Z4={name:"chart-line",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],aliases:["line-chart"]};Z4.node;var $o=Q(Z4);var Q4={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};Q4.node;var $a=Q(Q4);var J4={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};J4.node;var jo=Q(J4);var eN={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};eN.node;var ra=Q(eN);var tN={name:"circle-dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};tN.node;var zi=Q(tN);var aN={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};aN.node;var Bi=Q(aN);var nN={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};nN.node;var Zd=Q(nN);var oN={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};oN.node;var ks=Q(oN);var rN={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};rN.node;var Qd=Q(rN);var sN={name:"cpu",size:24,node:[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]};sN.node;var Jd=Q(sN);var iN={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};iN.node;var ef=Q(iN);var lN={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};lN.node;var Fi=Q(lN);var uN={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};uN.node;var Wo=Q(uN);var cN={name:"file-check",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]};cN.node;var tf=Q(cN);var dN={name:"file-plus-corner",size:24,node:[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],aliases:["file-plus-2"]};dN.node;var Ls=Q(dN);var fN={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};fN.node;var af=Q(fN);var pN={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};pN.node;var Hu=Q(pN);var mN={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};mN.node;var nf=Q(mN);var hN={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};hN.node;var of=Q(hN);var gN={name:"git-pull-request",size:24,node:[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]};gN.node;var Is=Q(gN);var xN={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};xN.node;var rf=Q(xN);var vN={name:"hammer",size:24,node:[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]]};vN.node;var sf=Q(vN);var yN={name:"hard-drive",size:24,node:[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]};yN.node;var lf=Q(yN);var bN={name:"hourglass",size:24,node:[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]};bN.node;var uf=Q(bN);var wN={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};wN.node;var Hi=Q(wN);var SN={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};SN.node;var cf=Q(SN);var CN={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};CN.node;var df=Q(CN);var kN={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};kN.node;var eo=Q(kN);var LN={name:"list-ordered",size:24,node:[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]};LN.node;var ff=Q(LN);var IN={name:"list-todo",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]};IN.node;var pf=Q(IN);var NN={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};NN.node;var mf=Q(NN);var RN={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};RN.node;var qu=Q(RN);var TN={name:"megaphone",size:24,node:[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]]};TN.node;var hf=Q(TN);var MN={name:"message-circle-question-mark",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["message-circle-question"]};MN.node;var Ns=Q(MN);var EN={name:"message-square-reply",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"m10 8-3 3 3 3",key:"fp6dz7"}],["path",{d:"M17 14v-1a2 2 0 0 0-2-2H7",key:"1tkjnz"}]]};EN.node;var gf=Q(EN);var AN={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};AN.node;var Rs=Q(AN);var DN={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};DN.node;var xf=Q(DN);var _N={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};_N.node;var vf=Q(_N);var PN={name:"mouse-pointer-click",size:24,node:[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]};PN.node;var Uu=Q(PN);var ON={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};ON.node;var Ts=Q(ON);var zN={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};zN.node;var yf=Q(zN);var BN={name:"plug",size:24,node:[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]};BN.node;var bf=Q(BN);var FN={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};FN.node;var Xt=Q(FN);var HN={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};HN.node;var wf=Q(HN);var qN={name:"repeat",size:24,node:[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]};qN.node;var qi=Q(qN);var UN={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};UN.node;var Sf=Q(UN);var VN={name:"send",size:24,node:[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]};VN.node;var Cf=Q(VN);var GN={name:"shield-check",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]};GN.node;var kf=Q(GN);var $N={name:"signpost",size:24,node:[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}],["path",{d:"M2.354 10.354a1.207 1.207 0 0 1 0-1.708l2.06-2.06A2 2 0 0 1 5.828 6h12.344a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H5.828a2 2 0 0 1-1.414-.586z",key:"1tm261"}]]};$N.node;var Lf=Q($N);var jN={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};jN.node;var Xo=Q(jN);var WN={name:"split",size:24,node:[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]};WN.node;var Vu=Q(WN);var XN={name:"square-kanban",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 7v7",key:"1x2jlm"}],["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M16 7v9",key:"1hp2iy"}]],aliases:["kanban-square"]};XN.node;var Ms=Q(XN);var YN={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};YN.node;var If=Q(YN);var KN={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};KN.node;var pn=Q(KN);var ZN={name:"user-check",size:24,node:[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};ZN.node;var Nf=Q(ZN);var QN={name:"webhook",size:24,node:[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]};QN.node;var Rf=Q(QN);var JN={name:"workflow",size:24,node:[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]};JN.node;var Ui=Q(JN);var e5={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};e5.node;var Vi=Q(e5);var t5={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};t5.node;var Et=Q(t5);var a5={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};a5.node;var Es=Q(a5);var jf=j(he(),1);var to=j(he(),1);var jz=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var n5=new Map;function Wz(e){let t=n5.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),n5.set(e,t)),t}function X1(e,t){let a=o=>Object.fromEntries(Wz(o).formatToParts(e).map(r=>[r.type,r.value])),n;try{n=a(t)}catch{n=a("UTC")}return{year:Number(n.year),month:Number(n.month),day:Number(n.day),clock:`${n.hour}:${n.minute}`}}var o5=e=>Math.floor(Date.UTC(e.year,e.month-1,e.day)/864e5);function Gi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function Gu(e,t=new Date,a="UTC",n=!1){let o=new Date(e);if(Number.isNaN(o.getTime()))return e;let r=X1(o,a),s=X1(t,a),i=o5(r)-o5(s);if(i===0)return r.clock;if(i===-1)return`Yesterday ${r.clock}`;if(i===1)return`Tomorrow ${r.clock}`;let l=`${jz[r.month-1]} ${r.day}`;return`${r.year===s.year?l:`${l} ${r.year}`}${n?` ${r.clock}`:""}`}function Fh(e,t=new Date,a=Gi()){if(Number.isNaN(new Date(e.at).getTime()))return e.label;let n=Gu(e.at,t,a,!0);return/^(?:\d|Tomorrow|Yesterday)/.test(n)?`${e.label} ${n}`:`${e.label.replace(/ at$/,"")} ${n}`}function r5(e,t=new Date){let a=new Date(e).getTime();if(Number.isNaN(a))return"";let n=Math.max(0,Math.floor((t.getTime()-a)/6e4));if(n<1)return"now";if(n<60)return`${n}m`;let o=Math.floor(n/60);return o<24?`${o}h`:`${Math.floor(o/24)}d`}function Hh(e,t="UTC"){let a=new Date(e);if(Number.isNaN(a.getTime()))return e;let n=X1(a,t);return`${n.year}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")} ${n.clock}${t==="UTC"?" UTC":""}`}function s5(e,t=new Date,a=Gi()){e.querySelectorAll("time[data-when][datetime]").forEach(n=>{let o=n.getAttribute("datetime")??"";if(o===""||Number.isNaN(new Date(o).getTime()))return;if(n.getAttribute("data-when")==="exact"){let i=Xz(o,a);n.textContent!==i&&(n.textContent=i);return}let r=Gu(o,t,a),s=Hh(o,a);n.title!==s&&(n.title=s),n.textContent!==r&&(n.textContent=r)})}function Xz(e,t="UTC"){let a=new Date(e);if(Number.isNaN(a.getTime()))return e;let n=String(a.getUTCSeconds()).padStart(2,"0"),o=Hh(e,t);return t==="UTC"?o.replace(/ UTC$/,`:${n} UTC`):`${o}:${n}`}var As=j(fe(),1),Y1=!1;function K1(){Y1||(Y1=!0,queueMicrotask(()=>{Y1=!1,s5(document),window.dispatchEvent(new CustomEvent("standing-orders:workspace-rendered"))}))}function i5(e){return e.contains(document.activeElement)&&document.activeElement?.matches("input, textarea, select, [contenteditable=true]")===!0||e.querySelector("form.approve-form, details[open] form")!==null}function Yt({html:e,immutable:t=!1,className:a=""}){let n=(0,to.useRef)(null),o=(0,to.useRef)(null),r=(0,to.useRef)(!1),[s,i]=(0,to.useState)(0),[l,c]=(0,to.useState)(!1),[f,u]=(0,to.useState)(!1);return(0,to.useEffect)(()=>{let d=n.current,p=()=>i(g=>g+1);return d?.addEventListener("toggle",p,!0),()=>d?.removeEventListener("toggle",p,!0)},[]),(0,to.useLayoutEffect)(()=>{let d=n.current;if(!d||o.current===e||t&&o.current!==null)return;if(o.current!==null&&(r.current||i5(d))){let v=d.querySelector("[data-approval]"),b=new DOMParser().parseFromString(e,"text/html").querySelector("[data-approval]");!!d.querySelector("form.approve-form")&&v?.dataset.approval!==b?.dataset.approval?(c(!0),d.querySelectorAll('form.approve-form button[type="submit"], form.approve-form input[type="submit"]').forEach(y=>{y.disabled=!0})):d.querySelector("form.approve-form")||u(!0);return}let p=o.current===null;d.innerHTML=e,o.current=e;let g=p?d.querySelector("[autofocus]"):null;g!==null&&(document.activeElement===null||document.activeElement===document.body)&&g.focus(),u(!1),K1()},[e,t,s]),(0,As.jsxs)("div",{className:`so-native-region ${a}`,"data-workspace-native":!0,children:[l&&(0,As.jsxs)(dn,{tone:"error",children:["The plan changed. ",(0,As.jsx)("a",{href:window.location.href,children:"Review the current plan"})," before approving."]}),f&&(0,As.jsxs)("p",{className:"so-deferred",role:"status",children:["Updates are available. Your form is preserved. ",(0,As.jsx)("a",{href:window.location.href,children:"Reload"})]}),(0,As.jsx)("div",{ref:n,onInput:()=>{r.current=!0},onChange:()=>{r.current=!0},onBlur:()=>i(d=>d+1)})]})}function l5(e){var t,a,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(a=l5(e[t]))&&(n&&(n+=" "),n+=a)}else for(a in e)e[a]&&(n&&(n+=" "),n+=a);return n}function qh(){for(var e,t,a=0,n="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=l5(e))&&(n&&(n+=" "),n+=t);return n}var Yz=(e,t)=>{let a=new Array(e.length+t.length);for(let n=0;n<e.length;n++)a[n]=e[n];for(let n=0;n<t.length;n++)a[e.length+n]=t[n];return a},Kz=(e,t)=>({classGroupId:e,validator:t}),m5=(e=new Map,t=null,a)=>({nextPart:e,validators:t,classGroupId:a});var u5=[],Zz="arbitrary..",Qz=e=>{let t=eB(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Jz(s);let i=s.split("-"),l=i[0]===""&&i.length>1?1:0;return h5(i,l,t)},getConflictingClassGroupIds:(s,i)=>{if(i){let l=n[s],c=a[s];return l?c?Yz(c,l):l:c||u5}return a[s]||u5}}},h5=(e,t,a)=>{if(e.length-t===0)return a.classGroupId;let o=e[t],r=a.nextPart.get(o);if(r){let c=h5(e,t+1,r);if(c)return c}let s=a.validators;if(s===null)return;let i=t===0?e.join("-"):e.slice(t).join("-"),l=s.length;for(let c=0;c<l;c++){let f=s[c];if(f.validator(i))return f.classGroupId}},Jz=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let t=e.slice(1,-1),a=t.indexOf(":"),n=t.slice(0,a);return n?Zz+n:void 0})(),eB=e=>{let{theme:t,classGroups:a}=e;return tB(a,t)},tB=(e,t)=>{let a=m5();for(let n in e){let o=e[n];Q1(o,a,n,t)}return a},Q1=(e,t,a,n)=>{let o=e.length;for(let r=0;r<o;r++){let s=e[r];aB(s,t,a,n)}},aB=(e,t,a,n)=>{if(typeof e=="string"){nB(e,t,a);return}if(typeof e=="function"){oB(e,t,a,n);return}rB(e,t,a,n)},nB=(e,t,a)=>{let n=e===""?t:g5(t,e);n.classGroupId=a},oB=(e,t,a,n)=>{if(sB(e)){Q1(e(n),t,a,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Kz(a,e))},rB=(e,t,a,n)=>{let o=Object.entries(e),r=o.length;for(let s=0;s<r;s++){let[i,l]=o[s];Q1(l,g5(t,i),a,n)}},g5=(e,t)=>{let a=e,n=t.split("-"),o=n.length;for(let r=0;r<o;r++){let s=n[r],i=a.nextPart.get(s);i||(i=m5(),a.nextPart.set(s,i)),a=i}return a},sB=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,iB=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=Object.create(null),n=Object.create(null),o=(r,s)=>{a[r]=s,t++,t>e&&(t=0,n=a,a=Object.create(null))};return{get(r){let s=a[r];if(s!==void 0)return s;if((s=n[r])!==void 0)return o(r,s),s},set(r,s){r in a?a[r]=s:o(r,s)}}};var lB=[],c5=(e,t,a,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:a,maybePostfixModifierPosition:n,isExternal:o}),uB=e=>{let{prefix:t,experimentalParseClassName:a}=e,n=o=>{let r=[],s=0,i=0,l=0,c,f=o.length;for(let v=0;v<f;v++){let b=o[v];if(s===0&&i===0){if(b===":"){r.push(o.slice(l,v)),l=v+1;continue}if(b==="/"){c=v;continue}}b==="["?s++:b==="]"?s--:b==="("?i++:b===")"&&i--}let u=r.length===0?o:o.slice(l),d=u,p=!1;u.endsWith("!")?(d=u.slice(0,-1),p=!0):u.startsWith("!")&&(d=u.slice(1),p=!0);let g=c&&c>l?c-l:void 0;return c5(r,p,d,g)};if(t){let o=t+":",r=n;n=s=>s.startsWith(o)?r(s.slice(o.length)):c5(lB,!1,s,void 0,!0)}if(a){let o=n;n=r=>a({className:r,parseClassName:o})}return n},cB=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((a,n)=>{t.set(a,1e6+n)}),a=>{let n=[],o=[];for(let r=0;r<a.length;r++){let s=a[r],i=s[0]==="[",l=t.has(s);i||l?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(s)):o.push(s)}return o.length>0&&(o.sort(),n.push(...o)),n}},dB=e=>({cache:iB(e.cacheSize),parseClassName:uB(e),sortModifiers:cB(e),postfixLookupClassGroupIds:fB(e),...Qz(e)}),fB=e=>{let t=Object.create(null),a=e.postfixLookupClassGroups;if(a)for(let n=0;n<a.length;n++)t[a[n]]=!0;return t},pB=/\s+/,mB=(e,t)=>{let{parseClassName:a,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:r,postfixLookupClassGroupIds:s}=t,i=[],l=e.trim().split(pB),c="";for(let f=l.length-1;f>=0;f-=1){let u=l[f],{isExternal:d,modifiers:p,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:b}=a(u);if(d){c=u+(c.length>0?" "+c:c);continue}let x=!!b,y;if(x){let I=v.substring(0,b);y=n(I);let L=y&&s[y]?n(v):void 0;L&&L!==y&&(y=L,x=!1)}else y=n(v);if(!y){if(!x){c=u+(c.length>0?" "+c:c);continue}if(y=n(v),!y){c=u+(c.length>0?" "+c:c);continue}x=!1}let h=p.length===0?"":p.length===1?p[0]:r(p).join(":"),w=g?h+"!":h,S=w+y;if(i.indexOf(S)>-1)continue;i.push(S);let C=o(y,x);for(let I=0;I<C.length;++I){let L=C[I];i.push(w+L)}c=u+(c.length>0?" "+c:c)}return c},hB=(...e)=>{let t=0,a,n,o="";for(;t<e.length;)(a=e[t++])&&(n=x5(a))&&(o&&(o+=" "),o+=n);return o},x5=e=>{if(typeof e=="string")return e;let t,a="";for(let n=0;n<e.length;n++)e[n]&&(t=x5(e[n]))&&(a&&(a+=" "),a+=t);return a},gB=(e,...t)=>{let a,n,o,r,s=l=>{let c=t.reduce((f,u)=>u(f),e());return a=dB(c),n=a.cache.get,o=a.cache.set,r=i,i(l)},i=l=>{let c=n(l);if(c)return c;let f=mB(l,a);return o(l,f),f};return r=s,(...l)=>r(hB(...l))},xB=[],Kt=e=>{let t=a=>a[e]||xB;return t.isThemeGetter=!0,t.themeKey=e,t},v5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,y5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,vB=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,yB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bB=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,SB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ds=e=>vB.test(e),He=e=>!!e&&!Number.isNaN(Number(e)),Yo=e=>!!e&&Number.isInteger(Number(e)),Z1=e=>e.endsWith("%")&&He(e.slice(0,-1)),Ir=e=>yB.test(e),b5=()=>!0,kB=e=>bB.test(e)&&!wB.test(e),J1=()=>!1,LB=e=>SB.test(e),IB=e=>CB.test(e),NB=e=>!be(e)&&!Se(e),RB=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),TB=e=>_s(e,C5,J1),be=e=>v5.test(e),$i=e=>_s(e,k5,kB),d5=e=>_s(e,zB,He),MB=e=>_s(e,I5,b5),EB=e=>_s(e,L5,J1),f5=e=>_s(e,w5,J1),AB=e=>_s(e,S5,IB),Uh=e=>_s(e,N5,LB),Se=e=>y5.test(e),Tf=e=>ji(e,k5),DB=e=>ji(e,L5),p5=e=>ji(e,w5),_B=e=>ji(e,C5),PB=e=>ji(e,S5),Vh=e=>ji(e,N5,!0),OB=e=>ji(e,I5,!0),_s=(e,t,a)=>{let n=v5.exec(e);return n?n[1]?t(n[1]):a(n[2]):!1},ji=(e,t,a=!1)=>{let n=y5.exec(e);return n?n[1]?t(n[1]):a:!1},w5=e=>e==="position"||e==="percentage",S5=e=>e==="image"||e==="url",C5=e=>e==="length"||e==="size"||e==="bg-size",k5=e=>e==="length",zB=e=>e==="number",L5=e=>e==="family-name",I5=e=>e==="number"||e==="weight",N5=e=>e==="shadow";var BB=()=>{let e=Kt("color"),t=Kt("font"),a=Kt("text"),n=Kt("font-weight"),o=Kt("tracking"),r=Kt("leading"),s=Kt("breakpoint"),i=Kt("container"),l=Kt("spacing"),c=Kt("radius"),f=Kt("shadow"),u=Kt("inset-shadow"),d=Kt("text-shadow"),p=Kt("drop-shadow"),g=Kt("blur"),v=Kt("perspective"),b=Kt("aspect"),x=Kt("ease"),y=Kt("animate"),h=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...w(),Se,be],C=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],L=()=>[Se,be,l],T=()=>[Ds,"full","auto",...L()],M=()=>[Yo,"none","subgrid",Se,be],O=()=>["auto",{span:["full",Yo,Se,be]},Yo,Se,be],H=()=>[Yo,"auto",Se,be],z=()=>["auto","min","max","fr",Se,be],N=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],_=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...L()],D=()=>[Ds,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],q=()=>[i,Ds,"screen","full","dvw","lvw","svw","min","max","fit",...L()],U=()=>[Ds,"screen","full","lh","dvh","lvh","svh","min","max","fit",...L()],P=()=>[e,Se,be],W=()=>[...w(),p5,f5,{position:[Se,be]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],de=()=>["auto","cover","contain",_B,TB,{size:[Se,be]}],oe=()=>[Z1,Tf,$i],se=()=>["","none","full",c,Se,be],ue=()=>["",He,Tf,$i],ce=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],E=()=>[He,Z1,p5,f5],ne=()=>["","none",g,Se,be],le=()=>["none",He,Se,be],F=()=>["none",He,Se,be],G=()=>[He,Se,be],re=()=>[Ds,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ir],breakpoint:[Ir],color:[b5],container:[Ir],"drop-shadow":[Ir],ease:["in","out","in-out"],font:[NB],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ir],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ir],shadow:[Ir],spacing:["px",He],text:[Ir],"text-shadow":[Ir],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ds,be,Se,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Se,be]}],"container-named":[RB],columns:[{columns:[He,"auto",be,Se,i]}],"break-after":[{"break-after":h()}],"break-before":[{"break-before":h()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[Yo,"auto",Se,be]}],basis:[{basis:[Ds,"full","auto",i,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,Ds,"auto","initial","none",be]}],grow:[{grow:["",He,Se,be]}],shrink:[{shrink:["",He,Se,be]}],order:[{order:[Yo,"first","last","none",Se,be]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...N(),"normal"]}],"justify-items":[{"justify-items":[..._(),"normal"]}],"justify-self":[{"justify-self":["auto",..._()]}],"align-content":[{content:["normal",...N()]}],"align-items":[{items:[..._(),{baseline:["","last"]}]}],"align-self":[{self:["auto",..._(),{baseline:["","last"]}]}],"place-content":[{"place-content":N()}],"place-items":[{"place-items":[..._(),"baseline"]}],"place-self":[{"place-self":["auto",..._()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pbs:[{pbs:L()}],pbe:[{pbe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...U()]}],"min-block-size":[{"min-block":["auto",...U()]}],"max-block-size":[{"max-block":["none",...U()]}],w:[{w:[i,"screen",...D()]}],"min-w":[{"min-w":[i,"screen","none",...D()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[s]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh","none",...D()]}],"font-size":[{text:["base",a,Tf,$i]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,OB,MB]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Z1,be]}],"font-family":[{font:[DB,EB,t]}],"font-features":[{"font-features":[be]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Se,be]}],"line-clamp":[{"line-clamp":[He,"none",Se,d5]}],leading:[{leading:["none",r,...L()]}],"list-image":[{"list-image":["none",Se,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Se,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",Se,$i]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[He,"auto",Se,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"tab-size":[{tab:[Yo,Se,be]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se,be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Se,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:de()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yo,Se,be],radial:["",Se,be],conic:["",Yo,Se,be]},PB,AB]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ce(),"hidden","none"]}],"divide-style":[{divide:[...ce(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,Se,be]}],"outline-w":[{outline:["",He,Tf,$i]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","inner","none",f,Vh,Uh]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",u,Vh,Uh]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[He,$i]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",d,Vh,Uh]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[He,Se,be]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":E()}],"mask-image-linear-to-pos":[{"mask-linear-to":E()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":E()}],"mask-image-t-to-pos":[{"mask-t-to":E()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":E()}],"mask-image-r-to-pos":[{"mask-r-to":E()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":E()}],"mask-image-b-to-pos":[{"mask-b-to":E()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":E()}],"mask-image-l-to-pos":[{"mask-l-to":E()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":E()}],"mask-image-x-to-pos":[{"mask-x-to":E()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":E()}],"mask-image-y-to-pos":[{"mask-y-to":E()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[Se,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":E()}],"mask-image-radial-to-pos":[{"mask-radial-to":E()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":E()}],"mask-image-conic-to-pos":[{"mask-conic-to":E()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Se,be]}],filter:[{filter:["","none",Se,be]}],blur:[{blur:ne()}],brightness:[{brightness:[He,Se,be]}],contrast:[{contrast:[He,Se,be]}],"drop-shadow":[{"drop-shadow":["","none",p,Vh,Uh]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",He,Se,be]}],"hue-rotate":[{"hue-rotate":[He,Se,be]}],invert:[{invert:["",He,Se,be]}],saturate:[{saturate:[He,Se,be]}],sepia:[{sepia:["",He,Se,be]}],"backdrop-filter":[{"backdrop-filter":["","none",Se,be]}],"backdrop-blur":[{"backdrop-blur":ne()}],"backdrop-brightness":[{"backdrop-brightness":[He,Se,be]}],"backdrop-contrast":[{"backdrop-contrast":[He,Se,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,Se,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,Se,be]}],"backdrop-invert":[{"backdrop-invert":["",He,Se,be]}],"backdrop-opacity":[{"backdrop-opacity":[He,Se,be]}],"backdrop-saturate":[{"backdrop-saturate":[He,Se,be]}],"backdrop-sepia":[{"backdrop-sepia":["",He,Se,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Se,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",Se,be]}],ease:[{ease:["linear","initial",x,Se,be]}],delay:[{delay:[He,Se,be]}],animate:[{animate:["none",y,Se,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,Se,be]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:G()}],"skew-x":[{"skew-x":G()}],"skew-y":[{"skew-y":G()}],transform:[{transform:[Se,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"translate-none":["translate-none"],zoom:[{zoom:[Yo,Se,be]}],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Se,be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mbs":[{"scroll-mbs":L()}],"scroll-mbe":[{"scroll-mbe":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pbs":[{"scroll-pbs":L()}],"scroll-pbe":[{"scroll-pbe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Se,be]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[He,Tf,$i,d5]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}};var R5=gB(BB);function ee(...e){return R5(qh(e))}var T5=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,M5=qh,Gh=(e,t)=>a=>{var n;if(t?.variants==null)return M5(e,a?.class,a?.className);let{variants:o,defaultVariants:r}=t,s=Object.keys(o).map(c=>{let f=a?.[c],u=r?.[c];if(f===null)return null;let d=T5(f)||T5(u);return o[c][d]}),i=a&&Object.entries(a).reduce((c,f)=>{let[u,d]=f;return d===void 0||(c[u]=d),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,f)=>{let{class:u,className:d,...p}=f;return Object.entries(p).every(g=>{let[v,b]=g;return Array.isArray(b)?b.includes({...r,...i}[v]):{...r,...i}[v]===b})?[...c,u,d]:c},[]);return M5(e,s,l,a?.class,a?.className)};var E5=j(fe(),1),FB=Gh("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-[13px] font-medium transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-3.5 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",attention:"bg-attention text-on-attention hover:bg-[var(--so-signal-hover)]",destructive:"bg-destructive-soft text-destructive hover:bg-destructive/15",outline:"bg-card text-foreground shadow-[var(--so-pill-shadow)] hover:bg-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent",ghost:"text-muted-foreground hover:bg-accent hover:text-foreground",link:"text-foreground underline underline-offset-4 decoration-border hover:decoration-muted-foreground"},size:{default:"h-8 px-3 phone:h-11 phone:px-4",sm:"h-7 px-2.5 text-[12.5px] phone:h-11 phone:px-3 phone:text-[13px]",lg:"h-10 px-5",icon:"size-8 phone:size-11"}},defaultVariants:{variant:"default",size:"default"}});function J({className:e,variant:t,size:a,asChild:n=!1,type:o,...r}){return(0,E5.jsx)(n?Sh:"button",{"data-slot":"button",className:ee(FB({variant:t,size:a}),e),...n?{}:{type:o??"button"},...r})}var A5=j(fe(),1),$h=Gh("inline-flex w-fit shrink-0 items-center gap-1 whitespace-nowrap rounded-[5px] px-1.5 py-px text-[11.5px] font-medium leading-[18px] [&_svg]:size-3",{variants:{tone:{neutral:"bg-neutral-soft text-neutral-ink",success:"bg-success-soft text-success",warning:"bg-warning-soft text-warning",attention:"bg-attention-soft text-attention",danger:"bg-destructive-soft text-destructive",info:"bg-info-soft text-info"}},defaultVariants:{tone:"neutral"}});function ya({className:e,tone:t,...a}){return(0,A5.jsx)("span",{"data-slot":"badge",className:ee($h({tone:t}),e),...a})}var Mf=j(fe(),1);function ba({className:e,...t}){return(0,Mf.jsx)("section",{"data-slot":"card",className:ee("flex flex-col gap-4 rounded-[10px] border border-border bg-card p-5 text-card-foreground phone:gap-3 phone:p-3.5",e),...t})}function D5({className:e,...t}){return(0,Mf.jsx)("div",{"data-slot":"card-header",className:ee("flex items-start justify-between gap-3",e),...t})}function _5({className:e,...t}){return(0,Mf.jsx)("h2",{"data-slot":"card-title",className:ee("text-base font-semibold leading-snug",e),...t})}function P5({className:e,...t}){return(0,Mf.jsx)("p",{"data-slot":"card-description",className:ee("text-sm text-muted-foreground",e),...t})}var ia=j(he(),1);var vo=j(he(),1);var jh=j(fe(),1),mn=j(he(),1);var Wi=j(fe(),1),HB=Object.defineProperty,sa=(e,t)=>HB(e,"name",{value:t,configurable:!0});function Xi(e){let t=e+"CollectionProvider",[a,n]=gt(t),[o,r]=a(t,{collectionRef:{current:null},itemMap:new Map}),s=sa(v=>{let{scope:b,children:x}=v,y=vo.useRef(null),h=vo.useRef(new Map).current;return(0,jh.jsx)(o,{scope:b,itemMap:h,collectionRef:y,children:x})},"CollectionProvider");s.displayName=t;let i=e+"CollectionSlot",l=Ma(i),c=vo.forwardRef((v,b)=>{let{scope:x,children:y}=v,h=r(i,x),w=Te(b,h.collectionRef);return(0,jh.jsx)(l,{ref:w,children:y})});c.displayName=i;let f=e+"CollectionItemSlot",u="data-radix-collection-item",d=Ma(f),p=vo.forwardRef((v,b)=>{let{scope:x,children:y,...h}=v,w=vo.useRef(null),S=Te(b,w),C=r(f,x);return vo.useEffect(()=>(C.itemMap.set(w,{ref:w,...h}),()=>{C.itemMap.delete(w)})),(0,jh.jsx)(d,{[u]:"",ref:S,children:y})});p.displayName=f;function g(v){let b=r(e+"CollectionConsumer",v);return vo.useCallback(()=>{let y=b.collectionRef.current;if(!y)return[];let h=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(b.itemMap.values()).sort((C,I)=>h.indexOf(C.ref.current)-h.indexOf(I.ref.current))},[b.collectionRef,b.itemMap])}return sa(g,"useCollection"),[{Provider:s,Slot:c,ItemSlot:p},g,n]}sa(Xi,"createCollection");var O5=new WeakMap,eb=class Ps extends Map{static{sa(this,"OrderedDict")}#e;constructor(t){super(t),this.#e=[...super.keys()],O5.set(this,!0)}set(t,a){return O5.get(this)&&(this.has(t)?this.#e[this.#e.indexOf(t)]=t:this.#e.push(t)),super.set(t,a),this}insert(t,a,n){let o=this.has(a),r=this.#e.length,s=ab(t),i=s>=0?s:r+s,l=i<0||i>=r?-1:i;if(l===this.size||o&&l===this.size-1||l===-1)return this.set(a,n),this;let c=this.size+(o?0:1);s<0&&i++;let f=[...this.#e],u,d=!1;for(let p=i;p<c;p++)if(i===p){let g=f[p];f[p]===a&&(g=f[p+1]),o&&this.delete(a),u=this.get(g),this.set(a,n)}else{!d&&f[p-1]===a&&(d=!0);let g=f[d?p:p-1],v=u;u=this.get(g),this.delete(g),this.set(g,v)}return this}with(t,a,n){let o=new Ps(this);return o.insert(t,a,n),o}before(t){let a=this.#e.indexOf(t)-1;if(!(a<0))return this.entryAt(a)}setBefore(t,a,n){let o=this.#e.indexOf(t);return o===-1?this:this.insert(o,a,n)}after(t){let a=this.#e.indexOf(t);if(a=a===-1||a===this.size-1?-1:a+1,a!==-1)return this.entryAt(a)}setAfter(t,a,n){let o=this.#e.indexOf(t);return o===-1?this:this.insert(o+1,a,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){let a=super.delete(t);return a&&this.#e.splice(this.#e.indexOf(t),1),a}deleteAt(t){let a=this.keyAt(t);return a!==void 0?this.delete(a):!1}at(t){let a=Wh(this.#e,t);if(a!==void 0)return this.get(a)}entryAt(t){let a=Wh(this.#e,t);if(a!==void 0)return[a,this.get(a)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return Wh(this.#e,t)}from(t,a){let n=this.indexOf(t);if(n===-1)return;let o=n+a;return o<0&&(o=0),o>=this.size&&(o=this.size-1),this.at(o)}keyFrom(t,a){let n=this.indexOf(t);if(n===-1)return;let o=n+a;return o<0&&(o=0),o>=this.size&&(o=this.size-1),this.keyAt(o)}find(t,a){let n=0;for(let o of this){if(Reflect.apply(t,a,[o,n,this]))return o;n++}}findIndex(t,a){let n=0;for(let o of this){if(Reflect.apply(t,a,[o,n,this]))return n;n++}return-1}filter(t,a){let n=[],o=0;for(let r of this)Reflect.apply(t,a,[r,o,this])&&n.push(r),o++;return new Ps(n)}map(t,a){let n=[],o=0;for(let r of this)n.push([r[0],Reflect.apply(t,a,[r,o,this])]),o++;return new Ps(n)}reduce(...t){let[a,n]=t,o=0,r=n??this.at(0);for(let s of this)o===0&&t.length===1?r=s:r=Reflect.apply(a,this,[r,s,o,this]),o++;return r}reduceRight(...t){let[a,n]=t,o=n??this.at(-1);for(let r=this.size-1;r>=0;r--){let s=this.at(r);r===this.size-1&&t.length===1?o=s:o=Reflect.apply(a,this,[o,s,r,this])}return o}toSorted(t){let a=[...this.entries()].sort(t);return new Ps(a)}toReversed(){let t=new Ps;for(let a=this.size-1;a>=0;a--){let n=this.keyAt(a),o=this.get(n);t.set(n,o)}return t}toSpliced(...t){let a=[...this.entries()];return a.splice(...t),new Ps(a)}slice(t,a){let n=new Ps,o=this.size-1;if(t===void 0)return n;t<0&&(t=t+this.size),a!==void 0&&a>0&&(o=a-1);for(let r=t;r<=o;r++){let s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}every(t,a){let n=0;for(let o of this){if(!Reflect.apply(t,a,[o,n,this]))return!1;n++}return!0}some(t,a){let n=0;for(let o of this){if(Reflect.apply(t,a,[o,n,this]))return!0;n++}return!1}};function Wh(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=z5(e,t);return a===-1?void 0:e[a]}sa(Wh,"at");function z5(e,t){let a=e.length,n=ab(t),o=n>=0?n:a+n;return o<0||o>=a?-1:o}sa(z5,"toSafeIndex");function ab(e){return e!==e||e===0?0:Math.trunc(e)}sa(ab,"toSafeInteger");function qB(e){let t=e+"CollectionProvider",[a,n]=gt(t),[o,r]=a(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new eb,setItemMap:sa(()=>{},"setItemMap")}),s=sa(({state:h,...w})=>h?(0,Wi.jsx)(l,{...w,state:h}):(0,Wi.jsx)(i,{...w}),"CollectionProvider");s.displayName=t;let i=sa(h=>{let w=b();return(0,Wi.jsx)(l,{...h,state:w})},"CollectionInit");i.displayName=t+"Init";let l=sa(h=>{let{scope:w,children:S,state:C}=h,I=mn.useRef(null),[L,T]=mn.useState(null),M=Te(I,T),[O,H]=C;return mn.useEffect(()=>{if(!L)return;let z=H5(()=>{});return z.observe(L,{childList:!0,subtree:!0}),()=>{z.disconnect()}},[L]),(0,Wi.jsx)(o,{scope:w,itemMap:O,setItemMap:H,collectionRef:M,collectionRefObject:I,collectionElement:L,children:S})},"CollectionProviderImpl");l.displayName=t+"Impl";let c=e+"CollectionSlot",f=Ma(c),u=mn.forwardRef((h,w)=>{let{scope:S,children:C}=h,I=r(c,S),L=Te(w,I.collectionRef);return(0,Wi.jsx)(f,{ref:L,children:C})});u.displayName=c;let d=e+"CollectionItemSlot",p="data-radix-collection-item",g=Ma(d),v=mn.forwardRef((h,w)=>{let{scope:S,children:C,...I}=h,L=mn.useRef(null),[T,M]=mn.useState(null),O=Te(w,L,M),H=r(d,S),{setItemMap:z}=H,N=mn.useRef(I);B5(N.current,I)||(N.current=I);let _=N.current;return mn.useEffect(()=>{let A=_;return z(D=>T?D.has(T)?D.set(T,{...A,element:T}).toSorted(tb):(D.set(T,{...A,element:T}),D.toSorted(tb)):D),()=>{z(D=>!T||!D.has(T)?D:(D.delete(T),new eb(D)))}},[T,_,z]),(0,Wi.jsx)(g,{[p]:"",ref:O,children:C})});v.displayName=d;function b(){return mn.useState(new eb)}sa(b,"useInitCollection");function x(h){let{itemMap:w}=r(e+"CollectionConsumer",h);return w}return sa(x,"useCollection"),[{Provider:s,Slot:u,ItemSlot:v},{createCollectionScope:n,useCollection:x,useInitCollection:b}]}sa(qB,"createCollection");function B5(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;let a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(let o of a)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}sa(B5,"shallowEqual");function F5(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}sa(F5,"isElementPreceding");function tb(e,t){return!e[1].element||!t[1].element?0:F5(e[1].element,t[1].element)?-1:1}sa(tb,"sortByDocumentPosition");function H5(e){return new MutationObserver(a=>{for(let n of a)if(n.type==="childList"){e();return}})}sa(H5,"getChildListObserver");var Xh=j(he(),1),GB=j(fe(),1),UB=Object.defineProperty,VB=(e,t)=>UB(e,"name",{value:t,configurable:!0}),$B=Xh.createContext(void 0);function Nr(e){let t=Xh.useContext($B);return e||t||"ltr"}VB(Nr,"useDirection");var WB=j(he(),1),Yh=j(he(),1),jB=Object.defineProperty,ob=(e,t)=>jB(e,"name",{value:t,configurable:!0}),nb=!1;function q5(){let[e,t]=Yh.useState(nb);return Yh.useEffect(()=>{nb||(nb=!0,t(!0))},[]),e}ob(q5,"useIsHydrated");var U5=WB[" useSyncExternalStore ".trim().toString()];function V5(){return()=>{}}ob(V5,"subscribe");function G5(){return U5(V5,()=>!0,()=>!1)}ob(G5,"useIsHydratedModern");var $5=typeof U5=="function"?G5:q5;var Os=j(fe(),1),XB=Object.defineProperty,Yi=(e,t)=>XB(e,"name",{value:t,configurable:!0}),rb="rovingFocusGroup.onEntryFocus",YB={bubbles:!1,cancelable:!0},Kh="RovingFocusGroup",[sb,j5,KB]=Xi(Kh),[ZB,$u]=gt(Kh,[KB]),[QB,JB]=ZB(Kh),eF=ia.forwardRef(Yi(function(t,a){return(0,Os.jsx)(sb.Provider,{scope:t.__scopeRovingFocusGroup,children:(0,Os.jsx)(sb.Slot,{scope:t.__scopeRovingFocusGroup,children:(0,Os.jsx)(tF,{...t,ref:a})})})},"RovingFocusGroup")),tF=ia.forwardRef(Yi(function(t,a){let{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:u=!1,...d}=t,p=ia.useRef(null),g=Te(a,p),v=Nr(s),[b,x]=Ta({prop:i,defaultProp:l??null,onChange:c,caller:Kh}),[y,h]=ia.useState(!1),w=na(f),S=j5(n),C=ia.useRef(!1),[I,L]=ia.useState(0);return ia.useEffect(()=>{let T=p.current;if(T)return T.addEventListener(rb,w),()=>T.removeEventListener(rb,w)},[w]),(0,Os.jsx)(QB,{scope:n,orientation:o,dir:v,loop:r,currentTabStopId:b,onItemFocus:ia.useCallback(T=>x(T),[x]),onItemShiftTab:ia.useCallback(()=>h(!0),[]),onFocusableItemAdd:ia.useCallback(()=>L(T=>T+1),[]),onFocusableItemRemove:ia.useCallback(()=>L(T=>T-1),[]),children:(0,Os.jsx)(Re.div,{tabIndex:y||I===0?-1:0,"data-orientation":o,...d,ref:g,style:{outline:"none",...t.style},onMouseDown:ke(t.onMouseDown,()=>{C.current=!0}),onFocus:ke(t.onFocus,T=>{let M=!C.current;if(T.target===T.currentTarget&&M&&!y){let O=new CustomEvent(rb,YB);if(T.currentTarget.dispatchEvent(O),!O.defaultPrevented){let H=S().filter(D=>D.focusable),z=H.find(D=>D.active),N=H.find(D=>D.id===b),A=[z,N,...H].filter(Boolean).map(D=>D.ref.current);ib(A,u)}}C.current=!1}),onBlur:ke(t.onBlur,()=>h(!1))})})},"RovingFocusGroupImpl")),aF="RovingFocusGroupItem",nF=ia.forwardRef(Yi(function(t,a){let{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:i,...l}=t,c=Va(),f=s||c,u=JB(aF,n),d=u.currentTabStopId===f,p=j5(n),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:b}=u,x=$5();return Ze(()=>{if(!(!x||!o))return g(),()=>v()},[x,o,g,v]),ia.useEffect(()=>{if(!(x||!o))return g(),()=>v()},[x,o,g,v]),(0,Os.jsx)(sb.ItemSlot,{scope:n,id:f,focusable:o,active:r,children:(0,Os.jsx)(Re.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...l,ref:a,onMouseDown:ke(t.onMouseDown,y=>{o?u.onItemFocus(f):y.preventDefault()}),onFocus:ke(t.onFocus,()=>u.onItemFocus(f)),onKeyDown:ke(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;let h=X5(y,u.orientation,u.dir);if(h!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let S=p().filter(C=>C.focusable).map(C=>C.ref.current);if(h==="last")S.reverse();else if(h==="prev"||h==="next"){h==="prev"&&S.reverse();let C=S.indexOf(y.currentTarget);S=u.loop?Y5(S,C+1):S.slice(C+1)}setTimeout(()=>ib(S))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:b!=null}):i})})},"RovingFocusGroupItem")),oF={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function W5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Yi(W5,"getDirectionAwareKey");function X5(e,t,a){let n=W5(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return oF[n]}Yi(X5,"getFocusIntent");function ib(e,t=!1){let a=document.activeElement;for(let n of e)if(n===a||(n.focus({preventScroll:t}),document.activeElement!==a))return}Yi(ib,"focusFirst");function Y5(e,t){return e.map((a,n)=>e[(t+n)%e.length])}Yi(Y5,"wrapArray");var Zh=eF,Qh=nF;var rF=j(fe(),1);var ja=j(he(),1);var wa=j(he(),1);var Z5=j(he(),1);var sF=Object.defineProperty,iF=(e,t)=>sF(e,"name",{value:t,configurable:!0});function Ki(e){let[t,a]=Z5.useState(void 0);return Ze(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});let n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;let r=o[0],s,i;if("borderBoxSize"in r){let l=r.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,i=c.blockSize}else s=e.offsetWidth,i=e.offsetHeight;a({width:s,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else a(void 0)},[e]),t}iF(Ki,"useSize");var ju=j(fe(),1),_a=j(fe(),1),lF=Object.defineProperty,Da=(e,t)=>lF(e,"name",{value:t,configurable:!0}),Q5="Radio",[uF,J5]=gt(Q5),[cF,Jh]=uF(Q5);function eR(e){let{__scopeRadio:t,checked:a=!1,children:n,disabled:o,form:r,name:s,onCheck:i,required:l,value:c="on",internal_do_not_use_render:f}=e,[u,d]=wa.useState(null),[p,g]=wa.useState(null),v=wa.useRef(!1),[b,x]=wa.useReducer(w=>w+1,0),y=u?!!r||!!u.closest("form"):!0,h={checked:a,disabled:o,required:l,name:s,form:r,value:c,control:u,setControl:d,hasConsumerStoppedPropagationRef:v,userInteractionCount:b,onUserInteraction:x,isFormControl:y,bubbleInput:p,setBubbleInput:g,onCheck:Da(()=>i?.(),"onCheck")};return(0,ju.jsx)(cF,{scope:t,...h,children:tR(f)?f(h):n})}Da(eR,"RadioProvider");var dF="RadioTrigger",fF=wa.forwardRef(Da(function({__scopeRadio:t,onClick:a,...n},o){let{checked:r,disabled:s,value:i,setControl:l,onCheck:c,hasConsumerStoppedPropagationRef:f,onUserInteraction:u,isFormControl:d,bubbleInput:p}=Jh(dF,t),g=Te(o,l);return(0,ju.jsx)(Re.button,{type:"button",role:"radio","aria-checked":r,"data-state":lb(r),"data-disabled":s?"":void 0,disabled:s,value:i,...n,ref:g,onClick:ke(a,v=>{r||(u(),c()),p&&d&&(f.current=v.isPropagationStopped(),f.current||v.stopPropagation())})})},"RadioTrigger")),pF="RadioIndicator",mF=wa.forwardRef(Da(function(t,a){let{__scopeRadio:n,forceMount:o,...r}=t,s=Jh(pF,n);return(0,ju.jsx)(En,{present:o||s.checked,children:(0,ju.jsx)(Re.span,{"data-state":lb(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:a})})},"RadioIndicator")),hF="RadioBubbleInput",gF=wa.forwardRef(Da(function({__scopeRadio:t,onClick:a,...n},o){let{control:r,checked:s,required:i,disabled:l,name:c,value:f,form:u,bubbleInput:d,setBubbleInput:p,hasConsumerStoppedPropagationRef:g,userInteractionCount:v}=Jh(hF,t),b=Te(o,p),x=Ki(r),y=wa.useRef(!1),h=wa.useRef(s),w=wa.useRef(v);wa.useEffect(()=>{let C=d;if(!C)return;let I=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(I,"checked").set,M=v!==w.current;w.current=v;let O=h.current!==s;h.current=s;let H=!(M&&g.current);if(O&&T){y.current=!M;let z=new Event("click",{bubbles:H});T.call(C,s),C.dispatchEvent(z),y.current=!1}},[d,s,g,v]);let S=wa.useRef(s);return(0,ju.jsx)(Re.input,{type:"radio","aria-hidden":!0,defaultChecked:S.current,required:i,disabled:l,name:c,value:f,form:u,...n,tabIndex:-1,ref:b,onClick:ke(a,C=>{y.current&&C.stopPropagation()}),style:{...n.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function tR(e){return typeof e=="function"}Da(tR,"isFunction");function lb(e){return e?"checked":"unchecked"}Da(lb,"getState");var xF=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ub="RadioGroup",[vF,soe]=gt(ub,[$u,J5]),aR=$u(),eg=J5(),[yF,bF]=vF(ub),nR=ja.forwardRef(Da(function(t,a){let{__scopeRadioGroup:n,name:o,form:r,defaultValue:s,value:i,required:l=!1,disabled:c=!1,orientation:f,dir:u,loop:d=!0,onValueChange:p,...g}=t,v=aR(n),b=Nr(u),[x,y]=Ta({prop:i,defaultProp:s??null,onChange:p,caller:ub}),[h,w]=ja.useState(null),S=Te(a,w),C=ja.useRef(x);return ja.useEffect(()=>{let I=r?h?.ownerDocument.getElementById(r):h?.closest("form");if(I instanceof HTMLFormElement){let L=Da(()=>y(C.current),"reset");return I.addEventListener("reset",L),()=>I.removeEventListener("reset",L)}},[h,r,y]),(0,_a.jsx)(yF,{scope:n,name:o,form:r,required:l,disabled:c,value:x,onValueChange:y,children:(0,_a.jsx)(Zh,{asChild:!0,...v,orientation:f,dir:b,loop:d,children:(0,_a.jsx)(Re.div,{role:"radiogroup","aria-required":l,"aria-orientation":f,"data-disabled":c?"":void 0,dir:b,...g,ref:S})})})},"RadioGroup")),wF="RadioGroupItemProvider",SF="RadioGroupItemTrigger";function oR(e){let{__scopeRadioGroup:t,value:a,disabled:n,children:o,internal_do_not_use_render:r}=e,s=bF(wF,t),i=eg(t),l=s.disabled||n;return(0,_a.jsx)(eR,{...i,checked:s.value===a,disabled:l,required:s.required,name:s.name,form:s.form,value:a,onCheck:()=>s.onValueChange(a),internal_do_not_use_render:r,children:o})}Da(oR,"RadioGroupItemProvider");var CF=ja.forwardRef(Da(function(t,a){let{__scopeRadioGroup:n,...o}=t,r=aR(n),s=eg(n),{checked:i,disabled:l}=Jh(SF,s.__scopeRadio),c=ja.useRef(null),f=Te(a,c),u=ja.useRef(!1);return ja.useEffect(()=>{let d=Da(g=>{xF.includes(g.key)&&(u.current=!0)},"handleKeyDown"),p=Da(()=>u.current=!1,"handleKeyUp");return document.addEventListener("keydown",d),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",d),document.removeEventListener("keyup",p)}},[]),(0,_a.jsx)(Qh,{asChild:!0,...r,focusable:!l,active:i,children:(0,_a.jsx)(fF,{...s,...o,ref:f,onKeyDown:ke(o.onKeyDown,d=>{d.key==="Enter"&&d.preventDefault()}),onFocus:ke(o.onFocus,()=>{u.current&&c.current?.click()})})})},"RadioGroupItemTrigger")),rR=ja.forwardRef(Da(function(t,a){let{__scopeRadioGroup:n,value:o,disabled:r,...s}=t;return(0,_a.jsx)(oR,{__scopeRadioGroup:n,value:o,disabled:r,internal_do_not_use_render:({isFormControl:i})=>(0,_a.jsxs)(_a.Fragment,{children:[(0,_a.jsx)(CF,{...s,ref:a,__scopeRadioGroup:n}),i&&(0,_a.jsx)(kF,{__scopeRadioGroup:n})]})})},"RadioGroupItem")),kF=ja.forwardRef(Da(function(t,a){let{__scopeRadioGroup:n,...o}=t,r=eg(n);return(0,_a.jsx)(gF,{...r,...o,ref:a})},"RadioGroupItemBubbleInput")),sR=ja.forwardRef(Da(function(t,a){let{__scopeRadioGroup:n,...o}=t,r=eg(n);return(0,_a.jsx)(mF,{...r,...o,ref:a})},"RadioGroupIndicator"));var yo=j(fe(),1);function tg({className:e,...t}){return(0,yo.jsx)(nR,{"data-slot":"radio-group",className:ee("grid gap-2",e),...t})}function IF({className:e,...t}){return(0,yo.jsx)(rR,{"data-slot":"radio-group-item",className:ee("mt-0.5 aspect-square size-4 shrink-0 rounded-full border border-input text-primary outline-none focus-visible:ring-2 focus-visible:ring-ring data-[state=checked]:border-primary",e),...t,children:(0,yo.jsx)(sR,{className:"flex items-center justify-center",children:(0,yo.jsx)(Bi,{className:"size-2 fill-current"})})})}function Ef({value:e,id:t,title:a,description:n,className:o}){return(0,yo.jsxs)("label",{htmlFor:t,className:ee("flex cursor-pointer items-start gap-3 rounded-lg border border-border bg-card p-3.5 transition-colors phone:min-h-11 phone:px-3 phone:py-2.5 hover:bg-accent has-[[data-state=checked]]:border-primary has-[[data-state=checked]]:bg-accent",o),children:[(0,yo.jsx)(IF,{value:e,id:t}),(0,yo.jsxs)("span",{className:"grid gap-0.5",children:[(0,yo.jsx)("span",{className:"text-sm font-semibold",children:a}),n&&(0,yo.jsx)("span",{className:"text-[13px] text-muted-foreground phone:leading-[1.35]",children:n})]})]})}var xe=j(he(),1),wb=j(Gr(),1);var NF=Object.defineProperty,RF=(e,t)=>NF(e,"name",{value:t,configurable:!0});function ag(e,[t,a]){return Math.min(a,Math.max(t,e))}RF(ag,"clamp");var Pa=j(he(),1);var uR=["top","right","bottom","left"];var Ko=Math.min,bo=Math.max,Df=Math.round,_f=Math.floor,Zo=e=>({x:e,y:e}),TF={left:"right",right:"left",bottom:"top",top:"bottom"};function cb(e,t,a){return bo(e,Ko(t,a))}function Qo(e,t){return typeof e=="function"?e(t):e}function Rr(e){return e.split("-")[0]}function Zi(e){return e.split("-")[1]}function og(e){return e==="x"?"y":"x"}function rg(e){return e==="y"?"height":"width"}function wo(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function sg(e){return og(wo(e))}function cR(e,t,a){a===void 0&&(a=!1);let n=Zi(e),o=sg(e),r=rg(o),s=o==="x"?n===(a?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=Af(s)),[s,Af(s)]}function dR(e){let t=Af(e);return[ng(e),t,ng(t)]}function ng(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var iR=["left","right"],lR=["right","left"],MF=["top","bottom"],EF=["bottom","top"];function AF(e,t,a){switch(e){case"top":case"bottom":return a?t?lR:iR:t?iR:lR;case"left":case"right":return t?MF:EF;default:return[]}}function fR(e,t,a,n){let o=Zi(e),r=AF(Rr(e),a==="start",n);return o&&(r=r.map(s=>s+"-"+o),t&&(r=r.concat(r.map(ng)))),r}function Af(e){let t=Rr(e);return TF[t]+e.slice(t.length)}function DF(e){var t,a,n,o;return{top:(t=e.top)!=null?t:0,right:(a=e.right)!=null?a:0,bottom:(n=e.bottom)!=null?n:0,left:(o=e.left)!=null?o:0}}function db(e){return typeof e!="number"?DF(e):{top:e,right:e,bottom:e,left:e}}function Qi(e){let{x:t,y:a,width:n,height:o}=e;return{width:n,height:o,top:a,left:t,right:t+n,bottom:a+o,x:t,y:a}}function pR(e,t,a){let{reference:n,floating:o}=e,r=wo(t),s=sg(t),i=rg(s),l=Rr(t),c=r==="y",f=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,d=n[i]/2-o[i]/2,p;switch(l){case"top":p={x:f,y:n.y-o.height};break;case"bottom":p={x:f,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-o.width,y:u};break;default:p={x:n.x,y:n.y}}let g=Zi(t);return g&&(p[s]+=d*(g==="end"?1:-1)*(a&&c?-1:1)),p}async function gR(e,t){var a;t===void 0&&(t={});let{x:n,y:o,platform:r,rects:s,elements:i,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:p=0}=Qo(t,e),g=db(p),b=i[d?u==="floating"?"reference":"floating":u],x=Qi(await r.getClippingRect({element:(a=await(r.isElement==null?void 0:r.isElement(b)))==null||a?b:b.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(i.floating)),boundary:c,rootBoundary:f,strategy:l})),y=u==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,h=await(r.getOffsetParent==null?void 0:r.getOffsetParent(i.floating)),w=await(r.isElement==null?void 0:r.isElement(h))&&await(r.getScale==null?void 0:r.getScale(h))||{x:1,y:1},S=Qi(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:h,strategy:l}):y);return{top:(x.top-S.top+g.top)/w.y,bottom:(S.bottom-x.bottom+g.bottom)/w.y,left:(x.left-S.left+g.left)/w.x,right:(S.right-x.right+g.right)/w.x}}var _F=50,xR=async(e,t,a)=>{let{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:s}=a,i=s.detectOverflow?s:{...s,detectOverflow:gR},l=await(s.isRTL==null?void 0:s.isRTL(t)),c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:u}=pR(c,n,l),d=n,p=0,g={};for(let v=0;v<r.length;v++){let b=r[v];if(!b)continue;let{name:x,fn:y}=b,{x:h,y:w,data:S,reset:C}=await y({x:f,y:u,initialPlacement:n,placement:d,strategy:o,middlewareData:g,rects:c,platform:i,elements:{reference:e,floating:t}});f=h??f,u=w??u,g[x]={...g[x],...S},C&&p<_F&&(p++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:f,y:u}=pR(c,d,l)),v=-1)}return{x:f,y:u,placement:d,strategy:o,middlewareData:g}},vR=e=>({name:"arrow",options:e,async fn(t){let{x:a,y:n,placement:o,rects:r,platform:s,elements:i,middlewareData:l}=t,{element:c,padding:f=0}=Qo(e,t)||{};if(c==null)return{};let u=db(f),d={x:a,y:n},p=sg(o),g=rg(p),v=await s.getDimensions(c),b=p==="y",x=b?"top":"left",y=b?"bottom":"right",h=b?"clientHeight":"clientWidth",w=r.reference[g]+r.reference[p]-d[p]-r.floating[g],S=d[p]-r.reference[p],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c)),I=C?C[h]:0;(!I||!await(s.isElement==null?void 0:s.isElement(C)))&&(I=i.floating[h]||r.floating[g]);let L=w/2-S/2,T=I/2-v[g]/2-1,M=Ko(u[x],T),O=Ko(u[y],T),H=I-v[g]-O,z=I/2-v[g]/2+L,N=cb(M,z,H),_=!l.arrow&&Zi(o)!=null&&z!==N&&r.reference[g]/2-(z<M?M:O)-v[g]/2<0,A=_?z<M?z-M:z-H:0;return{[p]:d[p]+A,data:{[p]:N,centerOffset:z-N-A,..._&&{alignmentOffset:A}},reset:_}}});var yR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,n;let{placement:o,middlewareData:r,rects:s,initialPlacement:i,platform:l,elements:c}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...b}=Qo(e,t);if((a=r.arrow)!=null&&a.alignmentOffset)return{};let x=Rr(o),y=wo(i),h=Rr(i)===i,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=d||(h||!v?[Af(i)]:dR(i)),C=g!=="none";!d&&C&&S.push(...fR(i,v,g,w));let I=[i,...S],L=await l.detectOverflow(t,b),T=[],M=((n=r.flip)==null?void 0:n.overflows)||[];if(f&&T.push(L[x]),u){let N=cR(o,s,w);T.push(L[N[0]],L[N[1]])}if(M=[...M,{placement:o,overflows:T}],!T.every(N=>N<=0)){var O,H;let N=(((O=r.flip)==null?void 0:O.index)||0)+1,_=I[N];if(_&&(!(u==="alignment"?y!==wo(_):!1)||M.every(q=>wo(q.placement)===y?q.overflows[0]>0:!0)))return{data:{index:N,overflows:M},reset:{placement:_}};let A=(H=M.filter(D=>D.overflows[0]<=0).sort((D,q)=>D.overflows[1]-q.overflows[1])[0])==null?void 0:H.placement;if(!A)switch(p){case"bestFit":{var z;let D=(z=M.filter(q=>{if(C){let U=wo(q.placement);return U===y||U==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(U=>U>0).reduce((U,P)=>U+P,0)]).sort((q,U)=>q[1]-U[1])[0])==null?void 0:z[0];D&&(A=D);break}case"initialPlacement":A=i;break}if(o!==A)return{reset:{placement:A}}}return{}}}};function mR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hR(e){return uR.some(t=>e[t]>=0)}var bR=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:a,platform:n}=t,{strategy:o="referenceHidden",...r}=Qo(e,t);switch(o){case"referenceHidden":{let s=await n.detectOverflow(t,{...r,elementContext:"reference"}),i=mR(s,a.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:hR(i)}}}case"escaped":{let s=await n.detectOverflow(t,{...r,altBoundary:!0}),i=mR(s,a.floating);return{data:{escapedOffsets:i,escaped:hR(i)}}}default:return{}}}}};var wR=new Set(["left","top"]);async function PF(e,t){let{placement:a,platform:n,elements:o}=e,r=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=Rr(a),i=Zi(a),l=wo(a)==="y",c=wR.has(s)?-1:1,f=r&&l?-1:1,u=Qo(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return i&&typeof g=="number"&&(p=i==="end"?g*-1:g),l?{x:p*f,y:d*c}:{x:d*c,y:p*f}}var SR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,n;let{x:o,y:r,placement:s,middlewareData:i}=t,l=await PF(t,e);return s===((a=i.offset)==null?void 0:a.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:s}}}}},CR=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:a,y:n,placement:o,platform:r}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:y=>{let{x:h,y:w}=y;return{x:h,y:w}}},...c}=Qo(e,t),f={x:a,y:n},u=await r.detectOverflow(t,c),d=wo(o),p=og(d),g=f[p],v=f[d],b=(y,h)=>cb(h+u[y==="y"?"top":"left"],h,h-u[y==="y"?"bottom":"right"]);s&&(g=b(p,g)),i&&(v=b(d,v));let x=l.fn({...t,[p]:g,[d]:v});return{...x,data:{x:x.x-a,y:x.y-n,enabled:{[p]:s,[d]:i}}}}}},kR=function(e){return e===void 0&&(e={}),{options:e,fn(t){var a,n;let{x:o,y:r,placement:s,rects:i,middlewareData:l}=t,{offset:c=0,mainAxis:f=!0,crossAxis:u=!0}=Qo(e,t),d={x:o,y:r},p=wo(s),g=og(p),v=d[g],b=d[p],x=Qo(c,t),y=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:(a=x.mainAxis)!=null?a:0,crossAxis:(n=x.crossAxis)!=null?n:0};if(f){let S=g==="y"?"height":"width",C=i.reference[g]-i.floating[S]+y.mainAxis,I=i.reference[g]+i.reference[S]-y.mainAxis;v<C?v=C:v>I&&(v=I)}if(u){var h,w;let S=g==="y"?"width":"height",C=wR.has(Rr(s)),I=i.reference[p]-i.floating[S]+(C&&((h=l.offset)==null?void 0:h[p])||0)+(C?0:y.crossAxis),L=i.reference[p]+i.reference[S]+(C?0:((w=l.offset)==null?void 0:w[p])||0)-(C?y.crossAxis:0);b<I?b=I:b>L&&(b=L)}return{[g]:v,[p]:b}}}},LR=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){let{placement:a,rects:n,platform:o,elements:r}=t,{apply:s=()=>{},...i}=Qo(e,t),l=await o.detectOverflow(t,i),c=Rr(a),f=Zi(a),u=wo(a)==="y",{width:d,height:p}=n.floating,g,v;c==="top"||c==="bottom"?(g=c,v=f===(await(o.isRTL==null?void 0:o.isRTL(r.floating))?"start":"end")?"left":"right"):(v=c,g=f==="end"?"top":"bottom");let b=p-l.top-l.bottom,x=d-l.left-l.right,y=Ko(p-l[g],b),h=Ko(d-l[v],x),w=t.middlewareData.shift,S=!w,C=y,I=h;w!=null&&w.enabled.x&&(I=x),w!=null&&w.enabled.y&&(C=b),S&&!f&&(u?I=d-2*bo(l.left,l.right):C=p-2*bo(l.top,l.bottom)),await s({...t,availableWidth:I,availableHeight:C});let L=await o.getDimensions(r.floating);return d!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}};function ig(){return typeof window<"u"}function tl(e){return NR(e)?(e.nodeName||"").toLowerCase():"#document"}function Wa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jo(e){var t;return(t=(NR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function NR(e){return ig()?e instanceof Node||e instanceof Wa(e).Node:!1}function So(e){return ig()?e instanceof Element||e instanceof Wa(e).Element:!1}function Tr(e){return ig()?e instanceof HTMLElement||e instanceof Wa(e).HTMLElement:!1}function IR(e){return!ig()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wa(e).ShadowRoot}function Pf(e){let{overflow:t,overflowX:a,overflowY:n,display:o}=Co(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+a)&&o!=="inline"&&o!=="contents"}function RR(e){return/^(table|td|th)$/.test(tl(e))}function Of(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var OF=/transform|translate|scale|rotate|perspective|filter/,zF=/paint|layout|strict|content/,Ji=e=>!!e&&e!=="none",fb;function lg(e){let t=So(e)?Co(e):e;return Ji(t.transform)||Ji(t.translate)||Ji(t.scale)||Ji(t.rotate)||Ji(t.perspective)||!ug()&&(Ji(t.backdropFilter)||Ji(t.filter))||OF.test(t.willChange||"")||zF.test(t.contain||"")}function TR(e){let t=zs(e);for(;Tr(t)&&!Wu(t);){if(lg(t))return t;if(Of(t))return null;t=zs(t)}return null}function ug(){return fb==null&&(fb=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),fb}function Wu(e){return/^(html|body|#document)$/.test(tl(e))}function Co(e){return Wa(e).getComputedStyle(e)}function zf(e){return So(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zs(e){if(tl(e)==="html")return e;let t=e.assignedSlot||e.parentNode||IR(e)&&e.host||Jo(e);return IR(t)?t.host:t}function MR(e){let t=zs(e);return Wu(t)?(e.ownerDocument||e).body:Tr(t)&&Pf(t)?t:MR(t)}function el(e,t,a){var n;t===void 0&&(t=[]),a===void 0&&(a=!0);let o=MR(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),s=Wa(o);if(r){let i=cg(s);return t.concat(s,s.visualViewport||[],Pf(o)?o:[],i&&a?el(i):[])}else return t.concat(o,el(o,[],a))}function cg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function DR(e){let t=Co(e),a=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=Tr(e),r=o?e.offsetWidth:a,s=o?e.offsetHeight:n,i=Df(a)!==r||Df(n)!==s;return i&&(a=r,n=s),{width:a,height:n,$:i}}function mb(e){return So(e)?e:e.contextElement}function Xu(e){let t=mb(e);if(!Tr(t))return Zo(1);let a=t.getBoundingClientRect(),{width:n,height:o,$:r}=DR(t),s=(r?Df(a.width):a.width)/n,i=(r?Df(a.height):a.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}var BF=Zo(0);function _R(e){let t=Wa(e);return!ug()||!t.visualViewport?BF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function FF(e,t,a){return t===void 0&&(t=!1),!!a&&t&&a===Wa(e)}function al(e,t,a,n){t===void 0&&(t=!1),a===void 0&&(a=!1);let o=e.getBoundingClientRect(),r=mb(e),s=Zo(1);t&&(n?So(n)&&(s=Xu(n)):s=Xu(e));let i=FF(r,a,n)?_R(r):Zo(0),l=(o.left+i.x)/s.x,c=(o.top+i.y)/s.y,f=o.width/s.x,u=o.height/s.y;if(r&&n){let d=Wa(r),p=So(n)?Wa(n):n,g=d,v=cg(g);for(;v&&p!==g;){let b=Xu(v),x=v.getBoundingClientRect(),y=Co(v),h=x.left+(v.clientLeft+parseFloat(y.paddingLeft))*b.x,w=x.top+(v.clientTop+parseFloat(y.paddingTop))*b.y;l*=b.x,c*=b.y,f*=b.x,u*=b.y,l+=h,c+=w,g=Wa(v),v=cg(g)}}return Qi({width:f,height:u,x:l,y:c})}function dg(e,t){let a=zf(e).scrollLeft;return t?t.left+a:al(Jo(e)).left+a}function PR(e,t){let a=e.getBoundingClientRect(),n=a.left+t.scrollLeft-dg(e,a),o=a.top+t.scrollTop;return{x:n,y:o}}function HF(e){let{elements:t,rect:a,offsetParent:n,strategy:o}=e,r=o==="fixed",s=Jo(n),i=t?Of(t.floating):!1;if(n===s||i&&r)return a;let l={scrollLeft:0,scrollTop:0},c=Zo(1),f=Zo(0),u=Tr(n);if((u||!r)&&((tl(n)!=="body"||Pf(s))&&(l=zf(n)),u)){let p=al(n);c=Xu(n),f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}let d=s&&!u&&!r?PR(s,l):Zo(0);return{width:a.width*c.x,height:a.height*c.y,x:a.x*c.x-l.scrollLeft*c.x+f.x+d.x,y:a.y*c.y-l.scrollTop*c.y+f.y+d.y}}function qF(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function UF(e){let t=zf(e),a=e.ownerDocument.body,n=bo(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),o=bo(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight),r=-t.scrollLeft+dg(e),s=-t.scrollTop;return Co(a).direction==="rtl"&&(r+=bo(e.clientWidth,a.clientWidth)-n),{width:n,height:o,x:r,y:s}}var VF=25;function GF(e,t,a){a===void 0&&(a="viewport");let n=a==="layoutViewport",o=Wa(e),r=Jo(e),s=o.visualViewport,i=r.clientWidth,l=r.clientHeight,c=0,f=0;if(s){let d=!ug()||t==="fixed";n?d||(c=-s.offsetLeft,f=-s.offsetTop):(i=s.width,l=s.height,d&&(c=s.offsetLeft,f=s.offsetTop))}if(dg(r)<=0){let d=r.ownerDocument,p=d.body,g=getComputedStyle(p),v=d.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-p.clientWidth-v),x=getComputedStyle(r).scrollbarGutter==="stable both-edges"?b/2:b;x<=VF&&(i-=x)}return{width:i,height:l,x:c,y:f}}function $F(e,t){let a=al(e,!0,t==="fixed"),n=a.top+e.clientTop,o=a.left+e.clientLeft,r=Xu(e),s=e.clientWidth*r.x,i=e.clientHeight*r.y,l=o*r.x,c=n*r.y;return{width:s,height:i,x:l,y:c}}function ER(e,t,a){let n;if(t==="viewport"||t==="layoutViewport")n=GF(e,a,t);else if(t==="document")n=UF(Jo(e));else if(So(t))n=$F(t,a);else{let o=_R(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Qi(n)}function jF(e,t){let a=t.get(e);if(a)return a;let n=el(e,[],!1).filter(i=>So(i)&&tl(i)!=="body"),o=null,r=Co(e).position==="fixed",s=r?zs(e):e;for(;So(s)&&!Wu(s);){let i=Co(s),l=lg(s),c=o?o.position:r?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&i.position==="static")?n=n.filter(u=>u!==s):o=i,s=zs(s)}return t.set(e,n),n}function WF(e){let{element:t,boundary:a,rootBoundary:n,strategy:o}=e,s=[...a==="clippingAncestors"?Of(t)?[]:jF(t,this._c):[].concat(a),n],i=ER(t,s[0],o),l=i.top,c=i.right,f=i.bottom,u=i.left;for(let d=1;d<s.length;d++){let p=ER(t,s[d],o);l=bo(p.top,l),c=Ko(p.right,c),f=Ko(p.bottom,f),u=bo(p.left,u)}return{width:c-u,height:f-l,x:u,y:l}}function XF(e){let{width:t,height:a}=DR(e);return{width:t,height:a}}function YF(e,t,a){let n=Tr(t),o=Jo(t),r=a==="fixed",s=al(e,!0,r,t),i={scrollLeft:0,scrollTop:0},l=Zo(0);if((n||!r)&&((tl(t)!=="body"||Pf(o))&&(i=zf(t)),n)){let d=al(t,!0,r,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}!n&&o&&(l.x=dg(o));let c=o&&!n&&!r?PR(o,i):Zo(0),f=s.left+i.scrollLeft-l.x-c.x,u=s.top+i.scrollTop-l.y-c.y;return{x:f,y:u,width:s.width,height:s.height}}function pb(e){return Co(e).position==="static"}function AR(e,t){if(!Tr(e)||Co(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return Jo(e)===a&&(a=a.ownerDocument.body),a}function OR(e,t){let a=Wa(e);if(Of(e))return a;if(!Tr(e)){let o=zs(e);for(;o&&!Wu(o);){if(So(o)&&!pb(o))return o;o=zs(o)}return a}let n=AR(e,t);for(;n&&RR(n)&&pb(n);)n=AR(n,t);return n&&Wu(n)&&pb(n)&&!lg(n)?a:n||TR(e)||a}var KF=async function(e){let t=this.getOffsetParent||OR,a=this.getDimensions,n=await a(e.floating);return{reference:YF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ZF(e){return Co(e).direction==="rtl"}var zR={convertOffsetParentRelativeRectToViewportRelativeRect:HF,getDocumentElement:Jo,getClippingRect:WF,getOffsetParent:OR,getElementRects:KF,getClientRects:qF,getDimensions:XF,getScale:Xu,isElement:So,isRTL:ZF};function BR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function QF(e,t,a){let n=null,o,r=Jo(e);function s(){var f;clearTimeout(o),(f=n)==null||f.disconnect(),n=null}function i(f,u){f===void 0&&(f=!1),u===void 0&&(u=1),s();let d=e.getBoundingClientRect(),{left:p,top:g,width:v,height:b}=d;if(f||t(),!v||!b)return;let x=_f(g),y=_f(r.clientWidth-(p+v)),h=_f(r.clientHeight-(g+b)),w=_f(p),C={rootMargin:-x+"px "+-y+"px "+-h+"px "+-w+"px",threshold:bo(0,Ko(1,u))||1},I=!0;function L(T){let M=T[0].intersectionRatio;if(!BR(d,e.getBoundingClientRect()))return i();if(M!==u){if(!I)return i();M?i(!1,M):o=setTimeout(()=>{i(!1,1e-7)},1e3)}I=!1}try{n=new IntersectionObserver(L,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(L,C)}n.observe(e)}let l=Wa(e),c=()=>i(a);return l.addEventListener("resize",c),i(!0),()=>{l.removeEventListener("resize",c),s()}}function hb(e,t,a,n){n===void 0&&(n={});let{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=mb(e),f=o||r?[...c?el(c):[],...t?el(t):[]]:[];f.forEach(x=>{o&&x.addEventListener("scroll",a),r&&x.addEventListener("resize",a)});let u=c&&i?QF(c,a,r):null,d=-1,p=null;s&&(p=new ResizeObserver(x=>{let[y]=x;y&&y.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var h;(h=p)==null||h.observe(t)})),a()}),c&&!l&&p.observe(c),t&&p.observe(t));let g,v=l?al(e):null;l&&b();function b(){let x=al(e);v&&!BR(v,x)&&a(),v=x,g=requestAnimationFrame(b)}return a(),()=>{var x;f.forEach(y=>{o&&y.removeEventListener("scroll",a),r&&y.removeEventListener("resize",a)}),u?.(),(x=p)==null||x.disconnect(),p=null,l&&cancelAnimationFrame(g)}}var FR=SR;var HR=CR,qR=yR,UR=LR,VR=bR,gb=vR;var GR=kR,xb=(e,t,a)=>{let n=new Map,o=a??{},r={...zR,...o.platform,_c:n};return xR(e,t,{...o,platform:r})};var qt=j(he(),1),jR=j(he(),1),WR=j(Gr(),1),JF=typeof document<"u",eH=function(){},fg=JF?jR.useLayoutEffect:eH;function pg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let a,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(n=a;n--!==0;)if(!pg(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),a=o.length,a!==Object.keys(t).length)return!1;for(n=a;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=a;n--!==0;){let r=o[n];if(!(r==="_owner"&&e.$$typeof)&&!pg(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function XR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $R(e,t){let a=XR(e);return Math.round(t*a)/a}function vb(e){let t=qt.useRef(e);return fg(()=>{t.current=e}),t}function YR(e){e===void 0&&(e={});let{placement:t="bottom",strategy:a="absolute",middleware:n=[],platform:o,elements:{reference:r,floating:s}={},transform:i=!0,whileElementsMounted:l,open:c}=e,[f,u]=qt.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=qt.useState(n);pg(d,n)||p(n);let[g,v]=qt.useState(null),[b,x]=qt.useState(null),y=qt.useCallback(q=>{q!==C.current&&(C.current=q,v(q))},[]),h=qt.useCallback(q=>{q!==I.current&&(I.current=q,x(q))},[]),w=r||g,S=s||b,C=qt.useRef(null),I=qt.useRef(null),L=qt.useRef(f),T=l!=null,M=vb(l),O=vb(o),H=vb(c),z=qt.useCallback(()=>{if(!C.current||!I.current)return;let q={placement:t,strategy:a,middleware:d};O.current&&(q.platform=O.current),xb(C.current,I.current,q).then(U=>{let P={...U,isPositioned:H.current!==!1};N.current&&!pg(L.current,P)&&(L.current=P,WR.flushSync(()=>{u(P)}))})},[d,t,a,O,H]);fg(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,u(q=>({...q,isPositioned:!1})))},[c]);let N=qt.useRef(!1);fg(()=>(N.current=!0,()=>{N.current=!1}),[]),fg(()=>{if(w&&(C.current=w),S&&(I.current=S),w&&S){if(M.current)return M.current(w,S,z);z()}},[w,S,z,M,T]);let _=qt.useMemo(()=>({reference:C,floating:I,setReference:y,setFloating:h}),[y,h]),A=qt.useMemo(()=>({reference:w,floating:S}),[w,S]),D=qt.useMemo(()=>{let q={position:a,left:0,top:0};if(!A.floating)return q;let U=$R(A.floating,f.x),P=$R(A.floating,f.y);return i?{...q,transform:"translate("+U+"px, "+P+"px)",...XR(A.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:U,top:P}},[a,i,A.floating,f.x,f.y]);return qt.useMemo(()=>({...f,update:z,refs:_,elements:A,floatingStyles:D}),[f,z,_,A,D])}var tH=e=>{function t(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){let{element:n,padding:o}=typeof e=="function"?e(a):e;return n&&t(n)?n.current!=null?gb({element:n.current,padding:o}).fn(a):{}:n?gb({element:n,padding:o}).fn(a):{}}}},KR=(e,t)=>{let a=FR(e);return{name:a.name,fn:a.fn,options:[e,t]}},ZR=(e,t)=>{let a=HR(e);return{name:a.name,fn:a.fn,options:[e,t]}},QR=(e,t)=>({fn:GR(e).fn,options:[e,t]}),JR=(e,t)=>{let a=qR(e);return{name:a.name,fn:a.fn,options:[e,t]}},eT=(e,t)=>{let a=UR(e);return{name:a.name,fn:a.fn,options:[e,t]}};var tT=(e,t)=>{let a=VR(e);return{name:a.name,fn:a.fn,options:[e,t]}};var aT=(e,t)=>{let a=tH(e);return{name:a.name,fn:a.fn,options:[e,t]}};var Yu=j(fe(),1),aH=Object.defineProperty,Bs=(e,t)=>aH(e,"name",{value:t,configurable:!0});var nT="Popper",[oT,Ku]=gt(nT),[nH,rT]=oT(nT),oH=Bs(e=>{let{__scopePopper:t,children:a}=e,[n,o]=Pa.useState(null),[r,s]=Pa.useState(void 0);return(0,Yu.jsx)(nH,{scope:t,anchor:n,onAnchorChange:o,placementState:r,setPlacementState:s,children:a})},"Popper"),rH="PopperAnchor",sH=Pa.forwardRef(Bs(function(t,a){let{__scopePopper:n,virtualRef:o,...r}=t,s=rT(rH,n),i=Pa.useRef(null),l=s.onAnchorChange,c=Pa.useCallback(v=>{i.current=v,v&&l(v)},[l]),f=Te(a,c),u=Pa.useRef(null);Pa.useEffect(()=>{if(!o)return;let v=u.current;u.current=o.current,v!==u.current&&l(u.current)});let d=s.placementState&&mg(s.placementState),p=d?.[0],g=d?.[1];return o?null:(0,Yu.jsx)(Re.div,{"data-radix-popper-side":p,"data-radix-popper-align":g,...r,ref:f})},"PopperAnchor")),sT="PopperContent",[iH,Ooe]=oT(sT),lH=Pa.forwardRef(Bs(function(t,a){let{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:v,...b}=t,x=rT(sT,n),[y,h]=Pa.useState(null),w=Te(a,h),[S,C]=Pa.useState(null),I=Ki(S),L=I?.width??0,T=I?.height??0,M=o+(s!=="center"?"-"+s:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},H=Array.isArray(f)?f:[f],z=H.length>0,N={padding:O,boundary:H.filter(iT),altBoundary:z},{refs:_,floatingStyles:A,placement:D,isPositioned:q,middlewareData:U}=YR({strategy:"fixed",placement:M,whileElementsMounted:Bs((...E)=>hb(...E,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[KR({mainAxis:r+T,alignmentAxis:i}),c&&ZR({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?QR():void 0,...N}),c&&JR({...N}),eT({...N,apply:Bs(({elements:E,rects:ne,availableWidth:le,availableHeight:F})=>{let{width:G,height:re}=ne.reference,Y=E.floating.style;Y.setProperty("--radix-popper-available-width",`${le}px`),Y.setProperty("--radix-popper-available-height",`${F}px`),Y.setProperty("--radix-popper-anchor-width",`${G}px`),Y.setProperty("--radix-popper-anchor-height",`${re}px`)},"apply")}),S&&aT({element:S,padding:l}),uH({arrowWidth:L,arrowHeight:T}),p&&tT({strategy:"referenceHidden",...N,boundary:z?N.boundary:void 0})]}),P=x.setPlacementState;Ze(()=>(P(D),()=>{P(void 0)}),[D,P]);let[W,te]=mg(D),de=na(v);Ze(()=>{q&&de?.()},[q,de]);let oe=U.arrow?.x,se=U.arrow?.y,ue=U.arrow?.centerOffset!==0,[ce,V]=Pa.useState();return Ze(()=>{y&&V(window.getComputedStyle(y).zIndex)},[y]),(0,Yu.jsx)("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:q?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:(0,Yu.jsx)(iH,{scope:n,placedSide:W,placedAlign:te,onArrowChange:C,arrowX:oe,arrowY:se,shouldHideArrow:ue,children:(0,Yu.jsx)(Re.div,{"data-side":W,"data-align":te,...b,ref:w,style:{...b.style,animation:q?b.style?.animation:"none"}})})})},"PopperContent"));function iT(e){return e!==null}Bs(iT,"isNotNull");var uH=Bs(e=>({name:"transformOrigin",options:e,fn(t){let{placement:a,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,i=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,f]=mg(a),u={start:"0%",center:"50%",end:"100%"}[f],d=(o.arrow?.x??0)+i/2,p=(o.arrow?.y??0)+l/2,g="",v="";return c==="bottom"?(g=s?u:`${d}px`,v=`${-l}px`):c==="top"?(g=s?u:`${d}px`,v=`${n.floating.height+l}px`):c==="right"?(g=`${-l}px`,v=s?u:`${p}px`):c==="left"&&(g=`${n.floating.width+l}px`,v=s?u:`${p}px`),{data:{x:g,y:v}}}}),"transformOrigin");function mg(e){let[t,a="center"]=e.split("-");return[t,a]}Bs(mg,"getSideAndAlignFromPlacement");var hg=oH,gg=sH,xg=lH;var vg=j(he(),1),cH=Object.defineProperty,dH=(e,t)=>cH(e,"name",{value:t,configurable:!0});function yb(e){let t=vg.useRef({value:e,previous:e});return vg.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}dH(yb,"usePrevious");var fH=j(he(),1);var pH=j(fe(),1);var uT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});var Ee=j(fe(),1),hH=Object.defineProperty,ot=(e,t)=>hH(e,"name",{value:t,configurable:!0}),gH=[" ","Enter","ArrowUp","ArrowDown"],xH=[" ","Enter"],Zu="Select",[bg,Sb,vH]=Xi(Zu),[ol,ire]=gt(Zu,[vH,Ku]),Cb=Ku(),[yH,Fs]=ol(Zu),[bH,wH]=ol(Zu);function fT(e){let{__scopeSelect:t,children:a,open:n,defaultOpen:o,onOpenChange:r,value:s,defaultValue:i,onValueChange:l,dir:c,name:f,autoComplete:u,disabled:d,required:p,form:g,internal_do_not_use_render:v}=e,b=Cb(t),[x,y]=xe.useState(null),[h,w]=xe.useState(null),[S,C]=xe.useState(!1),I=Nr(c),[L,T]=Ta({prop:n,defaultProp:o??!1,onChange:r,caller:Zu}),[M,O]=Ta({prop:s,defaultProp:i,onChange:l,caller:Zu}),H=xe.useRef(null),z=xe.useRef(M);xe.useEffect(()=>{let te=g?x?.ownerDocument.getElementById(g):x?.form;if(te instanceof HTMLFormElement){let de=ot(()=>O(z.current),"reset");return te.addEventListener("reset",de),()=>te.removeEventListener("reset",de)}},[g,x,O]);let N=x?!!g||!!x.closest("form"):!0,[_,A]=xe.useState(new Set),D=Va(),q=Array.from(_).map(te=>te.props.value).join(";"),U=xe.useCallback(te=>{A(de=>new Set(de).add(te))},[]),P=xe.useCallback(te=>{A(de=>{let oe=new Set(de);return oe.delete(te),oe})},[]),W={required:p,trigger:x,onTriggerChange:y,valueNode:h,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:D,value:M,onValueChange:O,open:L,onOpenChange:T,dir:I,triggerPointerDownPosRef:H,disabled:d,name:f,autoComplete:u,form:g,nativeOptions:_,nativeSelectKey:q,isFormControl:N};return(0,Ee.jsx)(hg,{...b,children:(0,Ee.jsx)(yH,{scope:t,...W,children:(0,Ee.jsx)(bg.Provider,{scope:t,children:(0,Ee.jsx)(bH,{scope:t,onNativeOptionAdd:U,onNativeOptionRemove:P,children:LT(v)?v(W):a})})})})}ot(fT,"SelectProvider");var pT=ot(e=>{let{__scopeSelect:t,children:a,...n}=e;return(0,Ee.jsx)(fT,{__scopeSelect:t,...n,internal_do_not_use_render:({isFormControl:o})=>(0,Ee.jsxs)(Ee.Fragment,{children:[a,o?(0,Ee.jsx)(zH,{__scopeSelect:t}):null]})})},"Select"),SH="SelectTrigger",mT=xe.forwardRef(ot(function(t,a){let{__scopeSelect:n,disabled:o=!1,...r}=t,s=Cb(n),i=Fs(SH,n),l=i.disabled||o,c=Te(a,i.onTriggerChange),f=Sb(n),u=xe.useRef("touch"),[d,p,g]=kb(b=>{let x=f().filter(w=>!w.disabled),y=x.find(w=>w.value===i.value),h=Lb(x,b,y);h!==void 0&&i.onValueChange(h.value)}),v=ot(b=>{l||(i.onOpenChange(!0),g()),b&&(i.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})},"handleOpen");return(0,Ee.jsx)(gg,{asChild:!0,...s,children:(0,Ee.jsx)(Re.button,{type:"button",role:"combobox","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Bf(i.value)?"":void 0,...r,ref:c,onClick:ke(r.onClick,b=>{b.currentTarget.focus(),u.current!=="mouse"&&v(b)}),onPointerDown:ke(r.onPointerDown,b=>{u.current=b.pointerType;let x=b.target;x.hasPointerCapture(b.pointerId)&&x.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(v(b),b.preventDefault())}),onKeyDown:ke(r.onKeyDown,b=>{let x=d.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&p(b.key),!(x&&b.key===" ")&&gH.includes(b.key)&&(v(),b.preventDefault())})})})},"SelectTrigger")),CH="SelectValue",hT=xe.forwardRef(ot(function(t,a){let{__scopeSelect:n,className:o,style:r,children:s,placeholder:i="",...l}=t,c=Fs(CH,n),{onValueNodeHasChildrenChange:f}=c,u=s!==void 0,d=Te(a,c.onValueNodeChange);Ze(()=>{f(u)},[f,u]);let p=Bf(c.value);return(0,Ee.jsx)(Re.span,{...l,asChild:p?!1:l.asChild,ref:d,style:{pointerEvents:"none"},children:(0,Ee.jsx)(xe.Fragment,{children:p?i:s},p?"placeholder":"value")})},"SelectValue")),gT=xe.forwardRef(ot(function(t,a){let{__scopeSelect:n,children:o,...r}=t;return(0,Ee.jsx)(Re.span,{"aria-hidden":!0,...r,ref:a,children:o||"▼"})},"SelectIcon")),kH="SelectPortal",[LH,IH]=ol(kH,{forceMount:void 0}),xT=ot(e=>{let{__scopeSelect:t,forceMount:a,...n}=e;return(0,Ee.jsx)(LH,{scope:e.__scopeSelect,forceMount:a,children:(0,Ee.jsx)(Eu,{asChild:!0,...n})})},"SelectPortal"),nl="SelectContent",vT=xe.forwardRef(ot(function(t,a){let n=IH(nl,t.__scopeSelect),{forceMount:o=n.forceMount,...r}=t,s=Fs(nl,t.__scopeSelect),[i,l]=xe.useState();return Ze(()=>{l(new DocumentFragment)},[]),(0,Ee.jsx)(En,{present:o||s.open,children:({present:c})=>c?(0,Ee.jsx)(TH,{...r,ref:a}):(0,Ee.jsx)(NH,{...r,fragment:i})})},"SelectContent")),NH=xe.forwardRef(ot(function(t,a){let{__scopeSelect:n,children:o,fragment:r}=t;return r?wb.createPortal((0,Ee.jsx)(yT,{scope:n,children:(0,Ee.jsx)(bg.Slot,{scope:n,children:(0,Ee.jsx)("div",{ref:a,children:o})})}),r):null},"SelectContentFragment")),ko=10,[yT,wg]=ol(nl),RH=Ma("SelectContent.RemoveScroll"),TH=xe.forwardRef(ot(function(t,a){let{__scopeSelect:n}=t,{position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:i,side:l,sideOffset:c,align:f,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:x,...y}=t,h=Fs(nl,n),[w,S]=xe.useState(null),[C,I]=xe.useState(null),L=Te(a,S),[T,M]=xe.useState(null),[O,H]=xe.useState(null),z=Sb(n),[N,_]=xe.useState(!1),A=xe.useRef(!1);xe.useEffect(()=>{if(w)return Bu(w)},[w]),bs();let D=xe.useCallback(V=>{let[E,...ne]=z().map(G=>G.ref.current),[le]=ne.slice(-1),F=document.activeElement;for(let G of V)if(G===F||(G?.scrollIntoView({block:"nearest"}),G===E&&C&&(C.scrollTop=0),G===le&&C&&(C.scrollTop=C.scrollHeight),G?.focus(),document.activeElement!==F))return},[z,C]),q=xe.useCallback(()=>D([T,w]),[D,T,w]);xe.useEffect(()=>{N&&q()},[N,q]);let{onOpenChange:U,triggerPointerDownPosRef:P}=h;xe.useEffect(()=>{if(w){let V={x:0,y:0},E=ot(le=>{V={x:Math.abs(Math.round(le.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(le.pageY)-(P.current?.y??0))}},"handlePointerMove"),ne=ot(le=>{V.x<=10&&V.y<=10?le.preventDefault():le.composedPath().includes(w)||U(!1),document.removeEventListener("pointermove",E),P.current=null},"handlePointerUp");return P.current!==null&&(document.addEventListener("pointermove",E),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",E),document.removeEventListener("pointerup",ne,{capture:!0})}}},[w,U,P]),xe.useEffect(()=>{let V=ot(()=>U(!1),"close");return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[U]);let[W,te]=kb(V=>{let E=z().filter(F=>!F.disabled),ne=E.find(F=>F.ref.current===document.activeElement),le=Lb(E,V,ne);le&&setTimeout(()=>le.ref.current?.focus())}),de=xe.useCallback((V,E,ne)=>{let le=!A.current&&!ne;(h.value!==void 0&&h.value===E||le)&&(M(V),le&&(A.current=!0))},[h.value]),oe=xe.useCallback(()=>w?.focus(),[w]),se=xe.useCallback((V,E,ne)=>{let le=!A.current&&!ne;(h.value!==void 0&&h.value===E||le)&&H(V)},[h.value]),ue=o==="popper"?cT:MH,ce=ue===cT?{side:l,sideOffset:c,align:f,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:x}:{};return(0,Ee.jsx)(yT,{scope:n,content:w,viewport:C,onViewportChange:I,itemRefCallback:de,selectedItem:T,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:q,selectedItemText:O,position:o,isPositioned:N,searchRef:W,children:(0,Ee.jsx)(Ei,{as:RH,allowPinchZoom:!0,children:(0,Ee.jsx)(Mu,{asChild:!0,trapped:h.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:ke(r,V=>{h.trigger?.focus({preventScroll:!0}),V.preventDefault()}),children:(0,Ee.jsx)(Tu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:(0,Ee.jsx)(ue,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:V=>V.preventDefault(),...y,...ce,onPlaced:()=>_(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ke(y.onKeyDown,V=>{let E=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!E&&V.key.length===1&&te(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let le=z().filter(F=>!F.disabled).map(F=>F.ref.current);if(["ArrowUp","End"].includes(V.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){let F=V.target,G=le.indexOf(F);le=le.slice(G+1)}setTimeout(()=>D(le)),V.preventDefault()}})})})})})})},"SelectContentImpl")),MH=xe.forwardRef(ot(function(t,a){let{__scopeSelect:n,onPlaced:o,...r}=t,s=Fs(nl,n),i=wg(nl,n),[l,c]=xe.useState(null),[f,u]=xe.useState(null),d=Te(a,u),p=Sb(n),g=xe.useRef(!1),v=xe.useRef(!0),{viewport:b,selectedItem:x,selectedItemText:y,focusSelectedItem:h}=i,w=xe.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&f&&b&&x&&y){let L=s.trigger.getBoundingClientRect(),T=f.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),O=y.getBoundingClientRect();if(s.dir!=="rtl"){let F=O.left-T.left,G=M.left-F,re=L.left-G,Y=L.width+re,Le=Math.max(Y,T.width),Be=window.innerWidth-ko,yt=ag(G,[ko,Math.max(ko,Be-Le)]);l.style.minWidth=Y+"px",l.style.left=yt+"px"}else{let F=T.right-O.right,G=window.innerWidth-M.right-F,re=window.innerWidth-L.right-G,Y=L.width+re,Le=Math.max(Y,T.width),Be=window.innerWidth-ko,yt=ag(G,[ko,Math.max(ko,Be-Le)]);l.style.minWidth=Y+"px",l.style.right=yt+"px"}let H=p(),z=window.innerHeight-ko*2,N=b.scrollHeight,_=window.getComputedStyle(f),A=parseInt(_.borderTopWidth,10),D=parseInt(_.paddingTop,10),q=parseInt(_.borderBottomWidth,10),U=parseInt(_.paddingBottom,10),P=A+D+N+U+q,W=Math.min(x.offsetHeight*5,P),te=window.getComputedStyle(b),de=parseInt(te.paddingTop,10),oe=parseInt(te.paddingBottom,10),se=L.top+L.height/2-ko,ue=z-se,ce=x.offsetHeight/2,V=x.offsetTop+ce,E=A+D+V,ne=P-E;if(E<=se){let F=H.length>0&&x===H[H.length-1].ref.current;l.style.bottom="0px";let G=f.clientHeight-b.offsetTop-b.offsetHeight,re=Math.max(ue,ce+(F?oe:0)+G+q),Y=E+re;l.style.height=Y+"px"}else{let F=H.length>0&&x===H[0].ref.current;l.style.top="0px";let re=Math.max(se,A+b.offsetTop+(F?de:0)+ce)+ne;l.style.height=re+"px",b.scrollTop=E-se+b.offsetTop}l.style.margin=`${ko}px 0`,l.style.minHeight=W+"px",l.style.maxHeight=z+"px",o?.(),requestAnimationFrame(()=>g.current=!0)}},[p,s.trigger,s.valueNode,l,f,b,x,y,s.dir,o]);Ze(()=>w(),[w]);let[S,C]=xe.useState();Ze(()=>{f&&C(window.getComputedStyle(f).zIndex)},[f]);let I=xe.useCallback(L=>{L&&v.current===!0&&(w(),h?.(),v.current=!1)},[w,h]);return(0,Ee.jsx)(EH,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:I,children:(0,Ee.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:(0,Ee.jsx)(Re.div,{...r,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})},"SelectItemAlignedPosition")),cT=xe.forwardRef(ot(function(t,a){let{__scopeSelect:n,align:o="start",collisionPadding:r=ko,...s}=t,i=Cb(n);return(0,Ee.jsx)(xg,{...i,...s,ref:a,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[EH,AH]=ol(nl,{}),dT="SelectViewport",bT=xe.forwardRef(ot(function(t,a){let{__scopeSelect:n,nonce:o,...r}=t,s=wg(dT,n),i=AH(dT,n),l=Te(a,s.onViewportChange),c=xe.useRef(0);return(0,Ee.jsxs)(Ee.Fragment,{children:[(0,Ee.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,Ee.jsx)(bg.Slot,{scope:n,children:(0,Ee.jsx)(Re.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:ke(r.onScroll,f=>{let u=f.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=i;if(p?.current&&d){let g=Math.abs(c.current-u.scrollTop);if(g>0){let v=window.innerHeight-ko*2,b=parseFloat(d.style.minHeight),x=parseFloat(d.style.height),y=Math.max(b,x);if(y<v){let h=y+g,w=Math.min(v,h),S=h-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,d.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})},"SelectViewport")),DH="SelectGroup",[lre,ure]=ol(DH);var bb="SelectItem",[_H,wT]=ol(bb),ST=xe.forwardRef(ot(function(t,a){let{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...i}=t,l=Fs(bb,n),c=wg(bb,n),f=l.value===o,[u,d]=xe.useState(s??""),[p,g]=xe.useState(!1),v=na(w=>c.itemRefCallback?.(w,o,r)),b=Te(a,v),x=Va(),y=xe.useRef("touch"),h=ot(()=>{r||(l.onValueChange(o),l.onOpenChange(!1))},"handleSelect");return(0,Ee.jsx)(_H,{scope:n,value:o,disabled:r,textId:x,isSelected:f,onItemTextChange:xe.useCallback(w=>{d(S=>S||(w?.textContent??"").trim())},[]),children:(0,Ee.jsx)(bg.ItemSlot,{scope:n,value:o,disabled:r,textValue:u,children:(0,Ee.jsx)(Re.div,{role:"option","aria-labelledby":x,"data-highlighted":p?"":void 0,"aria-selected":f&&p,"data-state":f?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:b,onFocus:ke(i.onFocus,()=>g(!0)),onBlur:ke(i.onBlur,()=>g(!1)),onClick:ke(i.onClick,()=>{y.current!=="mouse"&&h()}),onPointerUp:ke(i.onPointerUp,()=>{y.current==="mouse"&&h()}),onPointerDown:ke(i.onPointerDown,w=>{y.current=w.pointerType}),onPointerMove:ke(i.onPointerMove,w=>{y.current=w.pointerType,r?c.onItemLeave?.():y.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(i.onPointerLeave,w=>{w.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:ke(i.onKeyDown,w=>{r||w.target!==w.currentTarget||c.searchRef?.current!==""&&w.key===" "||(xH.includes(w.key)&&h(),w.key===" "&&w.preventDefault())})})})})},"SelectItem")),yg="SelectItemText",CT=xe.forwardRef(ot(function(t,a){let{__scopeSelect:n,className:o,style:r,...s}=t,i=Fs(yg,n),l=wg(yg,n),c=wT(yg,n),f=wH(yg,n),[u,d]=xe.useState(null),p=na(h=>l.itemTextRefCallback?.(h,c.value,c.disabled)),g=Te(a,d,c.onItemTextChange,p),v=u?.textContent,b=xe.useMemo(()=>(0,Ee.jsx)("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:x,onNativeOptionRemove:y}=f;return Ze(()=>(x(b),()=>y(b)),[x,y,b]),(0,Ee.jsxs)(Ee.Fragment,{children:[(0,Ee.jsx)(Re.span,{id:c.textId,...s,ref:g}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren&&!Bf(i.value)?wb.createPortal(s.children,i.valueNode):null]})},"SelectItemText")),PH="SelectItemIndicator",kT=xe.forwardRef(ot(function(t,a){let{__scopeSelect:n,...o}=t;return wT(PH,n).isSelected?(0,Ee.jsx)(Re.span,{"aria-hidden":!0,...o,ref:a}):null},"SelectItemIndicator"));var OH="SelectBubbleInput",zH=xe.forwardRef(ot(function({__scopeSelect:t,...a},n){let o=Fs(OH,t),{value:r,onValueChange:s,required:i,disabled:l,name:c,autoComplete:f,form:u}=o,{nativeOptions:d,nativeSelectKey:p}=o,g=xe.useRef(null),v=Te(n,g),b=r??"",x=yb(b),y=Array.from(d).some(h=>(h.props.value??"")==="");return xe.useEffect(()=>{let h=g.current;if(!h)return;let w=window.HTMLSelectElement.prototype,C=Object.getOwnPropertyDescriptor(w,"value").set;if(x!==b&&C){let I=new Event("change",{bubbles:!0});C.call(h,b),h.dispatchEvent(I)}},[x,b]),(0,Ee.jsxs)(Re.select,{"aria-hidden":!0,required:i,tabIndex:-1,name:c,autoComplete:f,disabled:l,form:u,onChange:h=>s(h.target.value),...a,style:{...uT,...a.style},ref:v,defaultValue:b,children:[Bf(r)&&!y?(0,Ee.jsx)("option",{value:""}):null,Array.from(d)]},p)},"SelectBubbleInput"));function LT(e){return typeof e=="function"}ot(LT,"isFunction");function Bf(e){return e===""||e===void 0}ot(Bf,"shouldShowPlaceholder");function kb(e){let t=na(e),a=xe.useRef(""),n=xe.useRef(0),o=xe.useCallback(s=>{let i=a.current+s;t(i),ot((function l(c){a.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}),"updateSearch")(i)},[t]),r=xe.useCallback(()=>{a.current="",window.clearTimeout(n.current)},[]);return xe.useEffect(()=>()=>window.clearTimeout(n.current),[]),[a,o,r]}ot(kb,"useTypeaheadSearch");function Lb(e,t,a){let o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,r=a?e.indexOf(a):-1,s=IT(e,Math.max(r,0));o.length===1&&(s=s.filter(c=>c!==a));let l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==a?l:void 0}ot(Lb,"findNextItem");function IT(e,t){return e.map((a,n)=>e[(t+n)%e.length])}ot(IT,"wrapArray");var _n=j(fe(),1),Ff=pT,Hf=hT;function qf({className:e,children:t,...a}){return(0,_n.jsxs)(mT,{"data-slot":"select-trigger",className:ee("flex h-8 w-full items-center justify-between gap-2 rounded-md border border-input bg-card px-2.5 text-[13px] outline-none focus-visible:ring-2 focus-visible:ring-ring phone:h-11 phone:text-base [&>span]:truncate",e),...a,children:[t,(0,_n.jsx)(gT,{asChild:!0,children:(0,_n.jsx)(jo,{className:"size-4 opacity-60"})})]})}function Uf({className:e,children:t,position:a="popper",...n}){return(0,_n.jsx)(xT,{children:(0,_n.jsx)(vT,{"data-slot":"select-content",position:a,sideOffset:4,className:ee("relative z-[120] max-h-[min(22rem,var(--radix-select-content-available-height))] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-lg",e),...n,children:(0,_n.jsx)(bT,{className:"p-1",children:t})})})}function Qu({className:e,children:t,...a}){return(0,_n.jsxs)(ST,{"data-slot":"select-item",className:ee("relative flex w-full cursor-default select-none items-center rounded-[5px] py-1.5 pr-8 pl-2 text-[13px] outline-none data-[highlighted]:bg-accent data-[disabled]:opacity-50 phone:min-h-11",e),...a,children:[(0,_n.jsx)(CT,{children:t}),(0,_n.jsx)("span",{className:"absolute right-2 flex size-4 items-center justify-center",children:(0,_n.jsx)(kT,{children:(0,_n.jsx)($a,{className:"size-4"})})})]})}var Ut=j(he(),1);var ao=j(fe(),1),FH=Object.defineProperty,Hs=(e,t)=>FH(e,"name",{value:t,configurable:!0}),Ib="Switch",[HH,yre]=gt(Ib),[qH,Nb]=HH(Ib);function NT(e){let{__scopeSwitch:t,checked:a,children:n,defaultChecked:o,disabled:r,form:s,name:i,onCheckedChange:l,required:c,value:f="on",internal_do_not_use_render:u}=e,[d,p]=Ta({prop:a,defaultProp:o??!1,onChange:l,caller:Ib}),[g,v]=Ut.useState(null),[b,x]=Ut.useState(null),y=Ut.useRef(!1),[h,w]=Ut.useReducer(I=>I+1,0),S=g?!!s||!!g.closest("form"):!0,C={checked:d,setChecked:p,disabled:r,control:g,setControl:v,name:i,form:s,value:f,hasConsumerStoppedPropagationRef:y,userInteractionCount:h,onUserInteraction:w,required:c,defaultChecked:o,isFormControl:S,bubbleInput:b,setBubbleInput:x};return(0,ao.jsx)(qH,{scope:t,...C,children:MT(u)?u(C):n})}Hs(NT,"SwitchProvider");var UH="SwitchTrigger",VH=Ut.forwardRef(Hs(function({__scopeSwitch:t,onClick:a,...n},o){let{control:r,form:s,value:i,disabled:l,checked:c,required:f,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:p,onUserInteraction:g,isFormControl:v,bubbleInput:b}=Nb(UH,t),x=Te(o,u),y=Ut.useRef(c);return Ut.useEffect(()=>{let h=s?r?.ownerDocument.getElementById(s):r?.form;if(h instanceof HTMLFormElement){let w=Hs(()=>d(y.current),"reset");return h.addEventListener("reset",w),()=>h.removeEventListener("reset",w)}},[r,s,d]),(0,ao.jsx)(Re.button,{type:"button",role:"switch","aria-checked":c,"aria-required":f,"data-state":Rb(c),"data-disabled":l?"":void 0,disabled:l,value:i,...n,ref:x,onClick:ke(a,h=>{g(),d(w=>!w),b&&v&&(p.current=h.isPropagationStopped(),p.current||h.stopPropagation())})})},"SwitchTrigger")),RT=Ut.forwardRef(Hs(function(t,a){let{__scopeSwitch:n,name:o,checked:r,defaultChecked:s,required:i,disabled:l,value:c,onCheckedChange:f,form:u,...d}=t;return(0,ao.jsx)(NT,{__scopeSwitch:n,checked:r,defaultChecked:s,disabled:l,required:i,onCheckedChange:f,name:o,form:u,value:c,internal_do_not_use_render:({isFormControl:p})=>(0,ao.jsxs)(ao.Fragment,{children:[(0,ao.jsx)(VH,{...d,ref:a,__scopeSwitch:n}),p&&(0,ao.jsx)(jH,{__scopeSwitch:n})]})})},"Switch")),GH="SwitchThumb",TT=Ut.forwardRef(Hs(function(t,a){let{__scopeSwitch:n,...o}=t,r=Nb(GH,n);return(0,ao.jsx)(Re.span,{"data-state":Rb(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:a})},"SwitchThumb")),$H="SwitchBubbleInput",jH=Ut.forwardRef(Hs(function({__scopeSwitch:t,onClick:a,...n},o){let{control:r,hasConsumerStoppedPropagationRef:s,userInteractionCount:i,checked:l,defaultChecked:c,required:f,disabled:u,name:d,value:p,form:g,bubbleInput:v,setBubbleInput:b}=Nb($H,t),x=Te(o,b),y=Ki(r),h=Ut.useRef(!1),w=Ut.useRef(l),S=Ut.useRef(i);Ut.useEffect(()=>{let I=v;if(!I)return;let L=window.HTMLInputElement.prototype,M=Object.getOwnPropertyDescriptor(L,"checked").set,O=i!==S.current;S.current=i;let H=w.current!==l;w.current=l;let z=!(O&&s.current);if(H&&M){h.current=!O;let N=new Event("click",{bubbles:z});M.call(I,l),I.dispatchEvent(N),h.current=!1}},[v,l,s,i]);let C=Ut.useRef(l);return(0,ao.jsx)(Re.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??C.current,required:f,disabled:u,name:d,value:p,form:g,...n,tabIndex:-1,ref:x,onClick:ke(a,I=>{h.current&&I.stopPropagation()}),style:{...n.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function MT(e){return typeof e=="function"}Hs(MT,"isFunction");function Rb(e){return e?"checked":"unchecked"}Hs(Rb,"getState");var Tb=j(fe(),1);function Mb({className:e,...t}){return(0,Tb.jsx)(RT,{"data-slot":"switch",className:ee("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full phone:after:absolute phone:after:-inset-x-0.5 phone:after:-inset-y-[12px] border-2 border-transparent bg-input transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring data-[state=checked]:bg-primary",e),...t,children:(0,Tb.jsx)(TT,{className:"pointer-events-none block size-5 rounded-full bg-card shadow transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"})})}var ET=j(he(),1);var AT=j(fe(),1),XH=Object.defineProperty,YH=(e,t)=>XH(e,"name",{value:t,configurable:!0}),KH=ET.forwardRef(YH(function(t,a){return(0,AT.jsx)(Re.label,{...t,ref:a,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(t.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}})},"Label")),DT=KH;var OT=j(he(),1);var zT=j(fe(),1),QH=Object.defineProperty,PT=(e,t)=>QH(e,"name",{value:t,configurable:!0}),_T="horizontal",JH=["horizontal","vertical"],eq=OT.forwardRef(PT(function(t,a){let{decorative:n,orientation:o=_T,...r}=t,s=BT(o)?o:_T,l=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return(0,zT.jsx)(Re.div,{"data-orientation":s,...l,...r,ref:a})},"Separator"));function BT(e){return JH.includes(e)}PT(BT,"isValidOrientation");var FT=eq;var Vf=j(fe(),1);function St({className:e,...t}){return(0,Vf.jsx)(DT,{"data-slot":"label",className:ee("flex items-center gap-2 text-sm font-medium leading-none",e),...t})}function ve({className:e,type:t,...a}){return(0,Vf.jsx)("input",{type:t,"data-slot":"input",className:ee("flex h-8 w-full min-w-0 rounded-md border border-input bg-card px-2.5 text-[13px] outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring phone:h-11 phone:text-base",e),...a})}function Ot({className:e,...t}){return(0,Vf.jsx)("textarea",{"data-slot":"textarea",className:ee("flex min-h-20 w-full rounded-md border border-input bg-card px-2.5 py-2 text-[13px] outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring phone:text-base",e),...t})}function Ju({className:e,orientation:t="horizontal",...a}){return(0,Vf.jsx)(FT,{"data-slot":"separator",orientation:t,className:ee("shrink-0 bg-border",t==="horizontal"?"h-px w-full":"h-full w-px",e),...a})}var Sa=j(he(),1);var rl=j(fe(),1),aq=Object.defineProperty,Gf=(e,t)=>aq(e,"name",{value:t,configurable:!0}),Eb="Collapsible",[nq,_re]=gt(Eb),[oq,Ab]=nq(Eb),rq=Sa.forwardRef(Gf(function(t,a){let{__scopeCollapsible:n,open:o,defaultOpen:r,disabled:s,onOpenChange:i,...l}=t,[c,f]=Ta({prop:o,defaultProp:r??!1,onChange:i,caller:Eb});return(0,rl.jsx)(oq,{scope:n,disabled:s,contentId:Va(),open:c,onOpenToggle:Sa.useCallback(()=>f(u=>!u),[f]),children:(0,rl.jsx)(Re.div,{"data-state":Sg(c),"data-disabled":s?"":void 0,...l,ref:a})})},"Collapsible")),sq="CollapsibleTrigger",iq=Sa.forwardRef(Gf(function(t,a){let{__scopeCollapsible:n,...o}=t,r=Ab(sq,n);return(0,rl.jsx)(Re.button,{type:"button","aria-controls":r.open?r.contentId:void 0,"aria-expanded":r.open||!1,"data-state":Sg(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:a,onClick:ke(t.onClick,r.onOpenToggle)})},"CollapsibleTrigger")),HT="CollapsibleContent",lq=Sa.forwardRef(Gf(function(t,a){let{forceMount:n,...o}=t,r=Ab(HT,t.__scopeCollapsible);return(0,rl.jsx)(En,{present:n||r.open,children:({present:s})=>(0,rl.jsx)(uq,{...o,ref:a,present:s})})},"CollapsibleContent")),uq=Sa.forwardRef(Gf(function(t,a){let{__scopeCollapsible:n,present:o,children:r,...s}=t,i=Ab(HT,n),[l,c]=Sa.useState(o),f=Sa.useRef(null),u=Te(a,f),d=Sa.useRef(0),p=d.current,g=Sa.useRef(0),v=g.current,b=i.open||l,x=Sa.useRef(b),y=Sa.useRef(void 0);return Sa.useEffect(()=>{let h=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(h)},[]),Ze(()=>{let h=f.current;if(h){y.current=y.current||{transitionDuration:h.style.transitionDuration,animationName:h.style.animationName},h.style.transitionDuration="0s",h.style.animationName="none";let w=h.getBoundingClientRect();d.current=w.height,g.current=w.width,x.current||(h.style.transitionDuration=y.current.transitionDuration,h.style.animationName=y.current.animationName),c(o)}},[i.open,o]),(0,rl.jsx)(Re.div,{"data-state":Sg(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!b,...s,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:b&&r})},"CollapsibleContentImpl"));function Sg(e){return e?"open":"closed"}Gf(Sg,"getState");var qT=rq,UT=iq,VT=lq;var ec=qT,tc=UT,ac=VT;var pe=j(he(),1),WT=j(Gr(),1);function dq(e){if(!e||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}var fq=e=>{switch(e){case"success":return hq;case"info":return xq;case"warning":return gq;case"error":return vq;default:return null}},pq=Array(12).fill(0),mq=({visible:e,className:t})=>pe.default.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},pe.default.createElement("div",{className:"sonner-spinner"},pq.map((a,n)=>pe.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),hq=pe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},pe.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),gq=pe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},pe.default.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),xq=pe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},pe.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),vq=pe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},pe.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),yq=pe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},pe.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),pe.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),bq=()=>{let[e,t]=pe.default.useState(document.hidden);return pe.default.useEffect(()=>{let a=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},[]),e},wq=1,Sq=100,GT=e=>{var t;return typeof e?.id=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:wq++},Db=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(a=>t(a)),()=>{let a=this.subscribers.indexOf(t);this.subscribers.splice(a,1)}),this.publish=t=>{this.subscribers.forEach(a=>a(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-Sq;t<=0||(this.toasts=this.toasts.filter(a=>t>0&&this.dismissedToasts.has(a.id)?(this.dismissedToasts.delete(a.id),t--,!1):!0))},this.create=t=>{let{message:a,...n}=t,o=GT(t),r=this.pendingDismissals.get(o);r!==void 0&&(cancelAnimationFrame(r),this.pendingDismissals.delete(o),this.dismissedToasts.delete(o));let s=this.dismissedToasts.has(o),i=t.dismissible===void 0?!0:t.dismissible;return s&&(this.dismissedToasts.delete(o),this.toasts=this.toasts.filter(c=>c.id!==o)),(s?void 0:this.toasts.find(c=>c.id===o))?this.toasts=this.toasts.map(c=>c.id===o?(this.publish({...c,...t,id:o,title:a}),{...c,...t,id:o,dismissible:i,title:a}):c):this.addToast({title:a,...n,dismissible:i,id:o}),o},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(n=>{this.dismissedToasts.add(n.id),this.subscribers.forEach(o=>o({id:n.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);let a=this.pendingDismissals.get(t);return a!==void 0&&cancelAnimationFrame(a),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(n=>n({id:t,dismiss:!0}))})),t},this.message=(t,a)=>this.create({...a,message:t,type:void 0}),this.error=(t,a)=>this.create({...a,message:t,type:"error"}),this.success=(t,a)=>this.create({...a,type:"success",message:t}),this.info=(t,a)=>this.create({...a,type:"info",message:t}),this.warning=(t,a)=>this.create({...a,type:"warning",message:t}),this.loading=(t,a)=>this.create({...a,type:"loading",message:t}),this.promise=(t,a)=>{if(!a)return;let n;a.loading!==void 0&&(n=this.create({...a,promise:t,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));let o=Promise.resolve(t instanceof Function?t():t),r=n!==void 0,s,i=o.then(async c=>{if(s=["resolve",c],pe.default.isValidElement(c))r=!1,this.create({id:n,type:"default",message:c});else if(kq(c)&&!c.ok){r=!1;let u=typeof a.error=="function"?await a.error(`HTTP error! status: ${c.status}`):a.error,d=typeof a.description=="function"?await a.description(`HTTP error! status: ${c.status}`):a.description,g=typeof u=="object"&&!pe.default.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:d,...g})}else if(c instanceof Error){r=!1;let u=typeof a.error=="function"?await a.error(c):a.error,d=typeof a.description=="function"?await a.description(c):a.description,g=typeof u=="object"&&!pe.default.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:d,...g})}else if(a.success!==void 0){r=!1;let u=typeof a.success=="function"?await a.success(c):a.success,d=typeof a.description=="function"?await a.description(c):a.description,g=typeof u=="object"&&!pe.default.isValidElement(u)?u:{message:u};this.create({id:n,type:"success",description:d,...g})}}).catch(async c=>{if(s=["reject",c],a.error!==void 0){r=!1;let f=typeof a.error=="function"?await a.error(c):a.error,u=typeof a.description=="function"?await a.description(c):a.description,p=typeof f=="object"&&!pe.default.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:u,...p})}}).finally(()=>{r&&(this.dismiss(n),n=void 0),a.finally==null||a.finally.call(a)}),l=()=>new Promise((c,f)=>i.then(()=>s[0]==="reject"?f(s[1]):c(s[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(t,a)=>{let n=GT(a);return this.create({...a,jsx:t(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},hn=new Db,Cq=(e,t)=>hn.message(e,t),kq=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Lq=Cq,Iq=()=>hn.toasts,Nq=()=>hn.getActiveToasts(),gn=Object.assign(Lq,{success:hn.success,info:hn.info,warning:hn.warning,error:hn.error,custom:hn.custom,message:hn.message,promise:hn.promise,dismiss:hn.dismiss,loading:hn.loading},{getHistory:Iq,getToasts:Nq});dq("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Cg(e){return e.label!==void 0}var Rq=3,Tq="24px",Mq="16px",$T=4e3,Eq=356,Aq=14,Dq=45,_q=200;function er(...e){return e.filter(Boolean).join(" ")}function Pq(e){let[t,a]=e.split("-"),n=[];return t&&n.push(t),a&&n.push(a),n}var Oq=e=>{var t,a,n,o,r,s,i,l,c;let{invert:f,toast:u,unstyled:d,interacting:p,setHeights:g,visibleToasts:v,heights:b,index:x,toasts:y,expanded:h,removeToast:w,defaultRichColors:S,closeButton:C,style:I,cancelButtonStyle:L,actionButtonStyle:T,className:M="",descriptionClassName:O="",duration:H,position:z,gap:N,expandByDefault:_,classNames:A,icons:D,closeButtonAriaLabel:q="Close toast"}=e,[U,P]=pe.default.useState(null),[W,te]=pe.default.useState(null),[de,oe]=pe.default.useState(!1),[se,ue]=pe.default.useState(!1),[ce,V]=pe.default.useState(!1),[E,ne]=pe.default.useState(!1),[le,F]=pe.default.useState(!1),[G,re]=pe.default.useState(0),[Y,Le]=pe.default.useState(0),Be=pe.default.useRef(u.duration||H||$T),yt=pe.default.useRef(null),rt=pe.default.useRef(null),Vt=x===0,Ge=x+1<=v,tt=u.type,za=tt??"default",Rt=u.dismissible!==!1,yn=u.className||"",io=u.descriptionClassName||"",Ja=pe.default.useMemo(()=>b.findIndex(Ae=>Ae.toastId===u.id)||0,[b,u.id]),sr=pe.default.useMemo(()=>{var Ae;return(Ae=u.closeButton)!=null?Ae:C},[u.closeButton,C]),Nl=pe.default.useMemo(()=>u.duration||H||$T,[u.duration,H]),ti=pe.default.useRef(0),Hr=pe.default.useRef(0),Np=pe.default.useRef(0),qr=pe.default.useRef(null),[Vx,Gx]=z.split("-"),Rp=pe.default.useMemo(()=>b.reduce((Ae,zt,Qt)=>Qt>=Ja?Ae:Ae+zt.height,0),[b,Ja]),Tp=bq(),On=pe.default.useMemo(()=>{var Ae;return(Ae=e.swipeDirections)!=null?Ae:Pq(z)},[e.swipeDirections,z]),$x=u.invert||f,Ec=tt==="loading";Hr.current=pe.default.useMemo(()=>Ja*N+Rp,[Ja,Rp]),pe.default.useEffect(()=>{Be.current=Nl},[Nl]),pe.default.useEffect(()=>{oe(!0)},[]),pe.default.useEffect(()=>{let Ae=rt.current;if(Ae){let zt=Ae.getBoundingClientRect().height;return Le(zt),g(Qt=>[{toastId:u.id,height:zt,position:u.position},...Qt]),()=>g(Qt=>Qt.filter(La=>La.toastId!==u.id))}},[g,u.id]),pe.default.useLayoutEffect(()=>{if(!de)return;let Ae=rt.current,zt=Ae.style.height;Ae.style.height="auto";let Qt=Ae.getBoundingClientRect().height;Ae.style.height=zt,Le(Qt),g(La=>La.find(Gt=>Gt.toastId===u.id)?La.map(Gt=>Gt.toastId===u.id?{...Gt,height:Qt}:Gt):[{toastId:u.id,height:Qt,position:u.position},...La])},[de,u.title,u.description,g,u.id,u.jsx,u.action,u.cancel]);let To=pe.default.useCallback(()=>{ue(!0),re(Hr.current),g(Ae=>Ae.filter(zt=>zt.toastId!==u.id)),setTimeout(()=>{w(u)},_q)},[u,w,g,Hr]);pe.default.useEffect(()=>{if(u.promise&&tt==="loading"||u.duration===1/0||u.type==="loading")return;let Ae;return h||p||Tp?(()=>{if(Np.current<ti.current){let La=new Date().getTime()-ti.current;Be.current=Be.current-La}Np.current=new Date().getTime()})():Be.current!==1/0&&(ti.current=new Date().getTime(),Ae=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),To()},Be.current)),()=>clearTimeout(Ae)},[h,p,u,tt,Tp,To]),pe.default.useEffect(()=>{u.delete&&(To(),u.onDismiss==null||u.onDismiss.call(u,u))},[To,u.delete]);function Mp(){var Ae;if(D?.loading){var zt;return pe.default.createElement("div",{className:er(A?.loader,u==null||(zt=u.classNames)==null?void 0:zt.loader,"sonner-loader"),"data-visible":tt==="loading"},D.loading)}return pe.default.createElement(mq,{className:er(A?.loader,u==null||(Ae=u.classNames)==null?void 0:Ae.loader),visible:tt==="loading"})}let jx=u.icon||D?.[tt]||fq(tt);var Ep,Ap;return pe.default.createElement("li",{tabIndex:0,ref:rt,className:er(M,yn,A?.toast,u==null||(t=u.classNames)==null?void 0:t.toast,A?.[za],u==null||(a=u.classNames)==null?void 0:a[za]),"data-sonner-toast":"","data-rich-colors":(Ep=u.richColors)!=null?Ep:S,"data-styled":!(u.jsx||u.unstyled||d),"data-mounted":de,"data-promise":!!u.promise,"data-swiped":le,"data-removed":se,"data-visible":Ge,"data-y-position":Vx,"data-x-position":Gx,"data-index":x,"data-front":Vt,"data-swiping":ce,"data-dismissible":Rt,"data-type":tt,"data-invert":$x,"data-swipe-out":E,"data-swipe-direction":W,"data-expanded":!!(h||_&&de),"data-testid":u.testId,style:{"--index":x,"--toasts-before":x,"--z-index":y.length-x,"--offset":`${se?G:Hr.current}px`,"--initial-height":_?"auto":`${Y}px`,...I,...u.style},onDragEnd:()=>{V(!1),P(null),qr.current=null},onPointerDown:Ae=>{Ae.button!==2&&(Ec||!Rt||(yt.current=new Date,re(Hr.current),Ae.target.setPointerCapture(Ae.pointerId),Ae.target.tagName!=="BUTTON"&&(V(!0),qr.current={x:Ae.clientX,y:Ae.clientY})))},onPointerUp:()=>{var Ae,zt,Qt;if(E||!Rt)return;qr.current=null;let La=Number(((Ae=rt.current)==null?void 0:Ae.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ai=Number(((zt=rt.current)==null?void 0:zt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Gt=new Date().getTime()-((Qt=yt.current)==null?void 0:Qt.getTime()),en=U==="x"?La:ai,zn=Math.abs(en)/Gt;if((U==="x"?On.includes(La>0?"right":"left"):On.includes(ai>0?"bottom":"top"))&&(Math.abs(en)>=Dq||zn>.11)){re(Hr.current),u.onDismiss==null||u.onDismiss.call(u,u),te(U==="x"?La>0?"right":"left":ai>0?"down":"up"),To(),ne(!0);return}else{var Bn,Dc;(Bn=rt.current)==null||Bn.style.setProperty("--swipe-amount-x","0px"),(Dc=rt.current)==null||Dc.style.setProperty("--swipe-amount-y","0px")}F(!1),V(!1),P(null)},onPointerMove:Ae=>{var zt,Qt,La;if(!qr.current||!Rt||((zt=window.getSelection())==null?void 0:zt.toString().length)>0)return;let Gt=Ae.clientY-qr.current.y,en=Ae.clientX-qr.current.x;!U&&(Math.abs(en)>1||Math.abs(Gt)>1)&&P(Math.abs(en)>Math.abs(Gt)?"x":"y");let zn={x:0,y:0},Ac=Bn=>1/(1.5+Math.abs(Bn)/20);if(U==="y"){if(On.includes("top")||On.includes("bottom"))if(On.includes("top")&&Gt<0||On.includes("bottom")&&Gt>0)zn.y=Gt;else{let Bn=Gt*Ac(Gt);zn.y=Math.abs(Bn)<Math.abs(Gt)?Bn:Gt}}else if(U==="x"&&(On.includes("left")||On.includes("right")))if(On.includes("left")&&en<0||On.includes("right")&&en>0)zn.x=en;else{let Bn=en*Ac(en);zn.x=Math.abs(Bn)<Math.abs(en)?Bn:en}(Math.abs(zn.x)>0||Math.abs(zn.y)>0)&&F(!0),(Qt=rt.current)==null||Qt.style.setProperty("--swipe-amount-x",`${zn.x}px`),(La=rt.current)==null||La.style.setProperty("--swipe-amount-y",`${zn.y}px`)}},sr&&!u.jsx&&tt!=="loading"?pe.default.createElement("button",{"aria-label":q,"data-disabled":Ec,"data-close-button":!0,onClick:Ec||!Rt?()=>{}:()=>{To(),u.onDismiss==null||u.onDismiss.call(u,u)},className:er(A?.closeButton,u==null||(n=u.classNames)==null?void 0:n.closeButton)},(Ap=D?.close)!=null?Ap:yq):null,(tt||u.icon||u.promise)&&u.icon!==null&&(D?.[tt]!==null||u.icon)?pe.default.createElement("div",{"data-icon":"",className:er(A?.icon,u==null||(o=u.classNames)==null?void 0:o.icon)},tt==="loading"?u.icon||Mp():u.promise?Mp():null,tt!=="loading"?jx:null):null,pe.default.createElement("div",{"data-content":"",className:er(A?.content,u==null||(r=u.classNames)==null?void 0:r.content)},pe.default.createElement("div",{"data-title":"",className:er(A?.title,u==null||(s=u.classNames)==null?void 0:s.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?pe.default.createElement("div",{"data-description":"",className:er(O,io,A?.description,u==null||(i=u.classNames)==null?void 0:i.description)},typeof u.description=="function"?u.description():u.description):null),pe.default.isValidElement(u.cancel)?u.cancel:u.cancel&&Cg(u.cancel)?pe.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||L,onClick:Ae=>{Cg(u.cancel)&&Rt&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,Ae),To())},className:er(A?.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,pe.default.isValidElement(u.action)?u.action:u.action&&Cg(u.action)?pe.default.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||T,onClick:Ae=>{Cg(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,Ae),!Ae.defaultPrevented&&To())},className:er(A?.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function jT(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function zq(e,t){let a={};return[e,t].forEach((n,o)=>{let r=o===1,s=r?"--mobile-offset":"--offset",i=r?Mq:Tq;function l(c){["top","right","bottom","left"].forEach(f=>{a[`${s}-${f}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?a[`${s}-${c}`]=i:a[`${s}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):l(i)}),a}var XT=pe.default.forwardRef(function(t,a){let{id:n,invert:o,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:l,className:c,offset:f,mobileOffset:u,theme:d="light",richColors:p,duration:g,style:v,visibleToasts:b=Rq,toastOptions:x,dir:y=jT(),gap:h=Aq,icons:w,customAriaLabel:S,containerAriaLabel:C="Notifications"}=t,[I,L]=pe.default.useState([]),T=pe.default.useMemo(()=>n?I.filter(oe=>oe.toasterId===n):I.filter(oe=>!oe.toasterId),[I,n]),M=pe.default.useMemo(()=>Array.from(new Set([r].concat(T.filter(oe=>oe.position).map(oe=>oe.position)))),[T,r]),[O,H]=pe.default.useState([]),[z,N]=pe.default.useState(!1),[_,A]=pe.default.useState(!1),[D,q]=pe.default.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=pe.default.useRef(null),P=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=pe.default.useRef(null),te=pe.default.useRef(!1),de=pe.default.useCallback(oe=>{L(se=>{var ue;return(ue=se.find(ce=>ce.id===oe.id))!=null&&ue.delete||hn.dismiss(oe.id),se.filter(({id:ce})=>ce!==oe.id)})},[]);return pe.default.useEffect(()=>hn.subscribe(oe=>{if(oe.dismiss){requestAnimationFrame(()=>{L(se=>se.map(ue=>ue.id===oe.id?{...ue,delete:!0}:ue))});return}setTimeout(()=>{WT.default.flushSync(()=>{L(se=>{let ue=se.findIndex(ce=>ce.id===oe.id);return ue!==-1?[...se.slice(0,ue),{...se[ue],...oe},...se.slice(ue+1)]:[oe,...se]})})})}),[]),pe.default.useEffect(()=>{if(d!=="system"){q(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let oe=window.matchMedia("(prefers-color-scheme: dark)");try{oe.addEventListener("change",({matches:se})=>{q(se?"dark":"light")})}catch{oe.addListener(({matches:ue})=>{try{q(ue?"dark":"light")}catch(ce){console.error(ce)}})}},[d]),pe.default.useEffect(()=>{I.length<=1&&N(!1)},[I]),pe.default.useEffect(()=>{let oe=se=>{var ue;if(s.length>0&&s.every(E=>se[E]||se.code===E)){var V;N(!0),(V=U.current)==null||V.focus()}se.code==="Escape"&&(document.activeElement===U.current||(ue=U.current)!=null&&ue.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",oe),()=>document.removeEventListener("keydown",oe)},[s]),pe.default.useEffect(()=>{if(U.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,te.current=!1)}},[U.current]),pe.default.createElement("section",{ref:a,"aria-label":S??`${C} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},M.map((oe,se)=>{var ue;let[ce,V]=oe.split("-");return T.length?pe.default.createElement("ol",{key:oe,dir:y==="auto"?jT():y,tabIndex:-1,ref:U,className:c,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":ce,"data-x-position":V,style:{"--front-toast-height":`${((ue=O[0])==null?void 0:ue.height)||0}px`,"--width":`${Eq}px`,"--gap":`${h}px`,...v,...zq(f,u)},onBlur:E=>{te.current&&!E.currentTarget.contains(E.relatedTarget)&&(te.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:E=>{E.target instanceof HTMLElement&&E.target.dataset.dismissible==="false"||te.current||(te.current=!0,W.current=E.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{_||N(!1)},onDragEnd:()=>N(!1),onPointerDown:E=>{E.target instanceof HTMLElement&&E.target.dataset.dismissible==="false"||A(!0)},onPointerUp:()=>A(!1)},T.filter(E=>!E.position&&se===0||E.position===oe).map((E,ne)=>{var le,F;return pe.default.createElement(Oq,{key:E.id,icons:w,index:ne,toast:E,defaultRichColors:p,duration:(le=x?.duration)!=null?le:g,className:x?.className,descriptionClassName:x?.descriptionClassName,invert:o,visibleToasts:b,closeButton:(F=x?.closeButton)!=null?F:l,interacting:_,position:oe,style:x?.style,unstyled:x?.unstyled,classNames:x?.classNames,cancelButtonStyle:x?.cancelButtonStyle,actionButtonStyle:x?.actionButtonStyle,closeButtonAriaLabel:x?.closeButtonAriaLabel,removeToast:de,toasts:T.filter(G=>G.position==E.position),heights:O.filter(G=>G.position==E.position),setHeights:H,expandByDefault:i,gap:h,expanded:z,swipeDirections:t.swipeDirections})})):null}))});var KT=j(fe(),1);function YT(){return(0,KT.jsx)(XT,{position:"bottom-center",toastOptions:{classNames:{toast:"!bg-card !text-foreground !border !border-border !shadow-lg",description:"!text-muted-foreground"}}})}var Lo=j(he(),1);var Pe=j(he(),1);var lt=j(fe(),1),Bq=Object.defineProperty,ut=(e,t)=>Bq(e,"name",{value:t,configurable:!0}),_b=["Enter"," "],Fq=["ArrowDown","PageUp","Home"],QT=["ArrowUp","PageDown","End"],Hq=[...Fq,...QT],ase={ltr:[..._b,"ArrowRight"],rtl:[..._b,"ArrowLeft"]};var Lg="Menu",[Pb,qq,Uq]=Xi(Lg),[sl,zb]=gt(Lg,[Uq,Ku,$u]),Bb=Ku(),JT=$u(),[Vq,$f]=sl(Lg),[Gq,Fb]=sl(Lg),$q=ut(e=>{let{__scopeMenu:t,open:a=!1,children:n,dir:o,onOpenChange:r,modal:s=!0}=e,i=Bb(t),[l,c]=Pe.useState(null),f=Pe.useRef(!1),u=na(r),d=Nr(o);return Pe.useEffect(()=>{let p=ut(()=>{f.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=ut(()=>f.current=!1,"handlePointer");return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),Pe.useEffect(()=>{if(!a)return;let p=ut(()=>u(!1),"handleBlur");return window.addEventListener("blur",p),()=>window.removeEventListener("blur",p)},[a,u]),(0,lt.jsx)(hg,{...i,children:(0,lt.jsx)(Vq,{scope:t,open:a,onOpenChange:u,content:l,onContentChange:c,children:(0,lt.jsx)(Gq,{scope:t,onClose:Pe.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:f,dir:d,modal:s,children:n})})})},"Menu"),jq=Pe.forwardRef(ut(function(t,a){let{__scopeMenu:n,...o}=t,r=Bb(n);return(0,lt.jsx)(gg,{...r,...o,ref:a})},"MenuAnchor")),eM="MenuPortal",[Wq,Xq]=sl(eM,{forceMount:void 0}),Yq=ut(e=>{let{__scopeMenu:t,forceMount:a,children:n,container:o}=e,r=$f(eM,t);return(0,lt.jsx)(Wq,{scope:t,forceMount:a,children:(0,lt.jsx)(En,{present:a||r.open,children:(0,lt.jsx)(Eu,{asChild:!0,container:o,children:n})})})},"MenuPortal"),qs="MenuContent",[Kq,tM]=sl(qs),Zq=Pe.forwardRef(ut(function(t,a){let n=Xq(qs,t.__scopeMenu),{forceMount:o=n.forceMount,...r}=t,s=$f(qs,t.__scopeMenu),i=Fb(qs,t.__scopeMenu);return(0,lt.jsx)(Pb.Provider,{scope:t.__scopeMenu,children:(0,lt.jsx)(En,{present:o||s.open,children:(0,lt.jsx)(Pb.Slot,{scope:t.__scopeMenu,children:i.modal?(0,lt.jsx)(Qq,{...r,ref:a}):(0,lt.jsx)(Jq,{...r,ref:a})})})})},"MenuContent")),Qq=Pe.forwardRef(ut(function(t,a){let n=$f(qs,t.__scopeMenu),o=Pe.useRef(null),r=Te(a,o);return Pe.useEffect(()=>{let s=o.current;if(s)return Bu(s)},[]),(0,lt.jsx)(aM,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ke(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentModal")),Jq=Pe.forwardRef(ut(function(t,a){let n=$f(qs,t.__scopeMenu);return(0,lt.jsx)(aM,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentNonModal")),eU=Ma("MenuContent.ScrollLock"),aM=Pe.forwardRef(ut(function(t,a){let{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:f,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:g,disableOutsideScroll:v,...b}=t,x=$f(qs,n),y=Fb(qs,n),h=Bb(n),w=JT(n),S=qq(n),[C,I]=Pe.useState(null),L=Pe.useRef(null),T=Te(a,L,x.onContentChange),M=Pe.useRef(0),O=Pe.useRef(""),H=Pe.useRef(0),z=Pe.useRef(null),N=Pe.useRef("right"),_=Pe.useRef(0),A=v?Ei:Pe.Fragment,D=v?{as:eU,allowPinchZoom:!0}:void 0,q=ut(P=>{let W=O.current+P,te=S().filter(V=>!V.disabled),de=document.activeElement,oe=te.find(V=>V.ref.current===de)?.textValue,se=te.map(V=>V.textValue),ue=iM(se,W,oe),ce=te.find(V=>V.textValue===ue)?.ref.current;ut((function V(E){O.current=E,window.clearTimeout(M.current),E!==""&&(M.current=window.setTimeout(()=>V(""),1e3))}),"updateSearch")(W),ce&&setTimeout(()=>ce.focus())},"handleTypeaheadSearch");Pe.useEffect(()=>()=>window.clearTimeout(M.current),[]),bs();let U=Pe.useCallback(P=>N.current===z.current?.side&&uM(P,z.current?.area),[]);return(0,lt.jsx)(Kq,{scope:n,searchRef:O,onItemEnter:Pe.useCallback(P=>{U(P)&&P.preventDefault()},[U]),onItemLeave:Pe.useCallback(P=>{U(P)||(L.current?.focus(),I(null))},[U]),onTriggerLeave:Pe.useCallback(P=>{U(P)&&P.preventDefault()},[U]),pointerGraceTimerRef:H,onPointerGraceIntentChange:Pe.useCallback(P=>{z.current=P},[]),children:(0,lt.jsx)(A,{...D,children:(0,lt.jsx)(Mu,{asChild:!0,trapped:r,onMountAutoFocus:ke(s,P=>{P.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:(0,lt.jsx)(Tu,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:g,children:(0,lt.jsx)(Zh,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:I,onEntryFocus:ke(c,P=>{y.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,lt.jsx)(xg,{role:"menu","aria-orientation":"vertical","data-state":nM(x.open),"data-radix-menu-content":"",dir:y.dir,...h,...b,ref:T,style:{outline:"none",...b.style},onKeyDown:ke(b.onKeyDown,P=>{let te=P.target.closest("[data-radix-menu-content]")===P.currentTarget,de=P.ctrlKey||P.altKey||P.metaKey,oe=P.key.length===1;te&&(P.key==="Tab"&&P.preventDefault(),!de&&oe&&q(P.key));let se=L.current;if(P.target!==se||!Hq.includes(P.key))return;P.preventDefault();let ce=S().filter(V=>!V.disabled).map(V=>V.ref.current);QT.includes(P.key)&&ce.reverse(),rM(ce)}),onBlur:ke(t.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(M.current),O.current="")}),onPointerMove:ke(t.onPointerMove,kg(P=>{let W=P.target,te=_.current!==P.clientX;if(P.currentTarget.contains(W)&&te){let de=P.clientX>_.current?"right":"left";N.current=de,_.current=P.clientX}}))})})})})})})},"MenuContentImpl"));var tU=Pe.forwardRef(ut(function(t,a){let{__scopeMenu:n,...o}=t;return(0,lt.jsx)(Re.div,{...o,ref:a})},"MenuLabel")),Ob="MenuItem",ZT="menu.itemSelect",aU=Pe.forwardRef(ut(function(t,a){let{disabled:n=!1,onSelect:o,...r}=t,s=Pe.useRef(null),i=Fb(Ob,t.__scopeMenu),l=tM(Ob,t.__scopeMenu),c=Te(a,s),f=Pe.useRef(!1),u=ut(()=>{let d=s.current;if(!n&&d){let p=new CustomEvent(ZT,{bubbles:!0,cancelable:!0});d.addEventListener(ZT,g=>o?.(g),{once:!0}),zd(d,p),p.defaultPrevented?f.current=!1:i.onClose()}},"handleSelect");return(0,lt.jsx)(nU,{...r,ref:c,disabled:n,onClick:ke(t.onClick,u),onPointerDown:d=>{t.onPointerDown?.(d),f.current=!0},onPointerUp:ke(t.onPointerUp,d=>{f.current||d.currentTarget?.click()}),onKeyDown:ke(t.onKeyDown,d=>{n||d.target!==d.currentTarget||l.searchRef.current!==""&&d.key===" "||_b.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})},"MenuItem")),nU=Pe.forwardRef(ut(function(t,a){let{__scopeMenu:n,disabled:o=!1,textValue:r,...s}=t,i=tM(Ob,n),l=JT(n),c=Pe.useRef(null),f=Te(a,c),[u,d]=Pe.useState(!1),[p,g]=Pe.useState("");return Pe.useEffect(()=>{let v=c.current;v&&g((v.textContent??"").trim())},[s.children]),(0,lt.jsx)(Pb.ItemSlot,{scope:n,disabled:o,textValue:r??p,children:(0,lt.jsx)(Qh,{asChild:!0,...l,focusable:!o,children:(0,lt.jsx)(Re.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:f,onPointerMove:ke(t.onPointerMove,kg(v=>{o?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ke(t.onPointerLeave,kg(v=>i.onItemLeave(v))),onFocus:ke(t.onFocus,()=>d(!0)),onBlur:ke(t.onBlur,()=>d(!1))})})})},"MenuItemImpl"));var oU="MenuRadioGroup",[nse,ose]=sl(oU,{value:void 0,onValueChange:ut(()=>{},"onValueChange")});var rU="MenuItemIndicator",[rse,sse]=sl(rU,{checked:!1});var sU=Pe.forwardRef(ut(function(t,a){let{__scopeMenu:n,...o}=t;return(0,lt.jsx)(Re.div,{role:"separator","aria-orientation":"horizontal",...o,ref:a})},"MenuSeparator"));var iU="MenuSub",[ise,lse]=sl(iU);function nM(e){return e?"open":"closed"}ut(nM,"getOpenState");function oM(e){return e==="indeterminate"}ut(oM,"isIndeterminate");function lU(e){return oM(e)?"indeterminate":e?"checked":"unchecked"}ut(lU,"getCheckedState");function rM(e){let t=document.activeElement;for(let a of e)if(a===t||(a.focus(),document.activeElement!==t))return}ut(rM,"focusFirst");function sM(e,t){return e.map((a,n)=>e[(t+n)%e.length])}ut(sM,"wrapArray");function iM(e,t,a){let o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,r=a?e.indexOf(a):-1,s=sM(e,Math.max(r,0));o.length===1&&(s=s.filter(c=>c!==a));let l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==a?l:void 0}ut(iM,"getNextMatch");function lM(e,t){let{x:a,y:n}=e,o=!1;for(let r=0,s=t.length-1;r<t.length;s=r++){let i=t[r],l=t[s],c=i.x,f=i.y,u=l.x,d=l.y;f>n!=d>n&&a<(u-c)*(n-f)/(d-f)+c&&(o=!o)}return o}ut(lM,"isPointInPolygon");function uM(e,t){if(!t)return!1;let a={x:e.clientX,y:e.clientY};return lM(a,t)}ut(uM,"isPointerInGraceArea");function kg(e){return t=>t.pointerType==="mouse"?e(t):void 0}ut(kg,"whenMouse");var cM=$q,dM=jq,fM=Yq,pM=Zq;var mM=tU,hM=aU;var gM=sU;var tr=j(fe(),1),cU=Object.defineProperty,il=(e,t)=>cU(e,"name",{value:t,configurable:!0}),Hb="DropdownMenu",[dU,Lse]=gt(Hb,[zb]),ll=zb(),[fU,xM]=dU(Hb),pU=il(e=>{let{__scopeDropdownMenu:t,children:a,dir:n,open:o,defaultOpen:r,onOpenChange:s,modal:i=!0}=e,l=ll(t),c=Lo.useRef(null),[f,u]=Ta({prop:o,defaultProp:r??!1,onChange:s,caller:Hb});return(0,tr.jsx)(fU,{scope:t,triggerId:Va(),triggerRef:c,contentId:Va(),open:f,onOpenChange:u,onOpenToggle:Lo.useCallback(()=>u(d=>!d),[u]),modal:i,children:(0,tr.jsx)(cM,{...l,open:f,onOpenChange:u,dir:n,modal:i,children:a})})},"DropdownMenu"),mU="DropdownMenuTrigger",hU=Lo.forwardRef(il(function(t,a){let{__scopeDropdownMenu:n,disabled:o=!1,...r}=t,s=xM(mU,n),i=ll(n),l=Te(a,s.triggerRef);return(0,tr.jsx)(dM,{asChild:!0,...i,children:(0,tr.jsx)(Re.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:l,onPointerDown:ke(t.onPointerDown,c=>{!o&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:ke(t.onKeyDown,c=>{o||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})},"DropdownMenuTrigger")),gU=il(e=>{let{__scopeDropdownMenu:t,...a}=e,n=ll(t);return(0,tr.jsx)(fM,{...n,...a})},"DropdownMenuPortal"),xU="DropdownMenuContent",vU=Lo.forwardRef(il(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=xM(xU,n),s=ll(n),i=Lo.useRef(!1);return(0,tr.jsx)(pM,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...o,ref:a,onCloseAutoFocus:ke(t.onCloseAutoFocus,l=>{i.current||r.triggerRef.current?.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:ke(t.onInteractOutside,l=>{let c=l.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0,u=c.button===2||f;(!r.modal||u)&&(i.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent"));var yU=Lo.forwardRef(il(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=ll(n);return(0,tr.jsx)(mM,{...r,...o,ref:a})},"DropdownMenuLabel")),bU=Lo.forwardRef(il(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=ll(n);return(0,tr.jsx)(hM,{...r,...o,ref:a})},"DropdownMenuItem"));var wU=Lo.forwardRef(il(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=ll(n);return(0,tr.jsx)(gM,{...r,...o,ref:a})},"DropdownMenuSeparator"));var vM=pU,yM=hU,bM=gU,wM=vU;var SM=yU,CM=bU;var kM=wU;var nc=j(fe(),1),oc=vM,rc=yM;function sc({className:e,sideOffset:t=4,...a}){return(0,nc.jsx)(bM,{children:(0,nc.jsx)(wM,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ee("z-[120] min-w-44 overflow-hidden rounded-[10px] border-0 bg-popover p-1 text-popover-foreground shadow-[var(--so-shadow-overlay)]",e),...a})})}function ic({className:e,...t}){return(0,nc.jsx)(CM,{"data-slot":"dropdown-menu-item",className:ee("relative flex cursor-default select-none items-center gap-2 rounded-[6px] px-2 py-1.5 text-[13px] outline-none data-[highlighted]:bg-accent phone:min-h-11 [&_svg]:size-4",e),...t})}function qb({className:e,...t}){return(0,nc.jsx)(SM,{className:ee("px-2 py-1.5 text-xs font-semibold text-muted-foreground",e),...t})}var LM=({className:e,...t})=>(0,nc.jsx)(kM,{className:ee("-mx-1 my-1 h-px bg-border",e),...t});var Ye=j(fe(),1),IM=e=>e.charAt(0).toUpperCase()+e.slice(1);async function CU(e,t,a,n){let o=new URLSearchParams({csrf:a});t==="confirm"&&n&&o.set("confirm","yes");try{let r=await fetch(`/chat/proposal/${e.id}/${t}`,{method:"POST",body:o,credentials:"same-origin",headers:{accept:"application/json"},signal:AbortSignal.timeout(2e4)});if(!r.headers.get("content-type")?.includes("application/json"))return{ok:!1,said:"That didn't go through. Reload the conversation and try again."};let s=await r.json(),i=typeof s=="object"&&s!==null?s:{};return{ok:i.ok===!0,said:typeof i.said=="string"?IM(i.said):"Done."}}catch{return{ok:!1,said:"That didn't go through. Check your connection and try again."}}}function kU({card:e,csrf:t,onChanged:a}){let[n,o]=(0,jf.useState)(null),[r,s]=(0,jf.useState)(!1),i=(0,jf.useId)(),l=async d=>{o(d);let p=await CU(e,d,t,r);d==="confirm"?(p.ok?gn.success:gn.error)(p.said):p.ok||gn.error(p.said),o(null),a()},c=e.primary,f=c?.kind==="confirm"&&c.irreversible&&!r,u=e.state==="confirmed"||e.state==="refused"||e.state==="dismissed"||e.state==="expired";return(0,Ye.jsxs)("section",{"data-view":"chat-card","data-action-card":e.id,"data-card-kind":e.kind,"data-card-state":e.state,className:ee("mt-3 overflow-hidden rounded-lg border border-border bg-card text-card-foreground",e.state==="pending"&&"border-primary/40",u&&"opacity-90"),children:[(0,Ye.jsxs)("header",{className:"flex items-center gap-2 border-b border-border px-4 py-2.5 text-[13px] font-semibold text-muted-foreground",children:[(0,Ye.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.label}),e.state==="confirmed"&&(0,Ye.jsxs)("span",{className:"inline-flex items-center gap-1 text-success",children:[(0,Ye.jsx)($a,{className:"size-3.5","aria-hidden":"true"}),"Done"]}),e.state==="refused"&&(0,Ye.jsxs)("span",{className:"inline-flex items-center gap-1 text-destructive",children:[(0,Ye.jsx)(Et,{className:"size-3.5","aria-hidden":"true"}),"Not done"]})]}),e.body!==""&&(0,Ye.jsx)("div",{className:"px-4 py-3",children:(0,Ye.jsx)(Yt,{html:e.body,immutable:!0,className:"so-card-body"})}),(0,Ye.jsxs)("footer",{className:"flex flex-col gap-2 px-4 pb-3.5 pt-1",children:[e.said!==null&&(0,Ye.jsx)("p",{className:ee("text-[13px]",e.state==="refused"?"text-destructive":"text-success"),children:IM(e.said)}),e.links.length>0&&(0,Ye.jsx)("div",{className:"flex flex-wrap gap-2",children:e.links.map(d=>(0,Ye.jsx)(J,{asChild:!0,variant:"outline",size:"sm",children:(0,Ye.jsx)("a",{href:d.href,children:d.label})},d.href))}),e.note!==null&&(0,Ye.jsx)("p",{className:"text-[13px] text-muted-foreground",children:e.note}),c?.kind==="confirm"&&c.irreversible&&(0,Ye.jsxs)("label",{htmlFor:i,className:"flex items-center gap-2 text-[13px]",children:[(0,Ye.jsx)("input",{id:i,type:"checkbox",checked:r,onChange:d=>s(d.target.checked),className:"size-4 accent-[var(--so-accent)]"}),"I understand this cannot be undone"]}),(c!==null||e.dismissable)&&(0,Ye.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c?.kind==="link"&&(0,Ye.jsx)(J,{asChild:!0,size:"sm",children:(0,Ye.jsx)("a",{href:c.href,children:c.label})}),c?.kind==="confirm"&&c.native&&(0,Ye.jsxs)("form",{method:"post",action:`/chat/proposal/${e.id}/confirm`,children:[(0,Ye.jsx)("input",{type:"hidden",name:"csrf",value:t}),(0,Ye.jsx)("input",{type:"hidden",name:"return",value:window.location.pathname+window.location.search}),c.irreversible&&r&&(0,Ye.jsx)("input",{type:"hidden",name:"confirm",value:"yes"}),(0,Ye.jsx)(J,{type:"submit",size:"sm",disabled:f,children:c.label})]}),c?.kind==="confirm"&&!c.native&&(0,Ye.jsx)(J,{size:"sm",disabled:n!==null||f,onClick:()=>{l("confirm")},"data-card-confirm":!0,children:n==="confirm"?"Working…":c.label}),e.dismissable&&(0,Ye.jsx)(J,{variant:"ghost",size:"sm",disabled:n!==null,onClick:()=>{l("dismiss")},"data-card-dismiss":!0,children:n==="dismiss"?"Dismissing…":"Dismiss"})]})]})]})}function Wf({cards:e,csrf:t,onChanged:a,readOnly:n=!1}){return(0,Ye.jsx)("div",{className:"so-action-cards",children:e.map(o=>(0,Ye.jsx)(kU,{card:n?{...o,primary:null,dismissable:!1}:o,csrf:t,onChanged:a},`${o.id}:${o.state}`))})}var Ub={lead:[{command:"new",hint:"File a new task",text:"File a task: "},{command:"flow",hint:"Make a flow for how work moves",text:"Make a flow for "},{command:"status",hint:"What needs you right now",text:"What needs my attention right now?"},{command:"next",hint:"What to work on next",text:"What should we work on next?"}],task:[{command:"status",hint:"Where this task stands",text:"Where does this task stand?"},{command:"next",hint:"Take the next step",text:"Move this forward"},{command:"revise",hint:"Request changes",text:"Request changes: "},{command:"diff",hint:"Walk through the changes",text:"Walk me through the changes file by file."},{command:"log",hint:"What the checks said",text:"What does the check log say?"},{command:"steer",hint:"Guide the next attempt",text:"For the next attempt: "},{command:"stop",hint:"Stop the running attempt",text:"Stop this task."},{command:"resume",hint:"Resume a stopped attempt",text:"Resume this task."},{command:"complete",hint:"Mark the result complete",text:"Mark this result complete."}],result:[{command:"summary",hint:"What changed",text:"Summarize what changed."},{command:"diff",hint:"Walk through the changes",text:"Walk me through the changes file by file."},{command:"log",hint:"What the checks said",text:"What does the check log say?"},{command:"risks",hint:"Anything to worry about",text:"Are there any risks in this change?"},{command:"revise",hint:"Request changes",text:"Request changes: "},{command:"complete",hint:"Mark the result complete",text:"Mark this result complete."}],tasks:[{command:"new",hint:"File a new task here",text:"File a task: "},{command:"flow",hint:"Make a flow for this project",text:"Make a flow for "},{command:"status",hint:"What needs you here",text:"What needs my attention here?"},{command:"next",hint:"What to build next",text:"What should we build next?"}]};var X=j(fe(),1),Ig=()=>({text:"",requestId:crypto.randomUUID(),uncertain:!1});function LU(e){try{let t=JSON.parse(sessionStorage.getItem(e)??"null");if(t&&typeof t=="object"&&typeof t.text=="string"&&typeof t.requestId=="string")return t}catch{}return Ig()}function NM(e){return{queued:"Queued",running:"Working",failed:"Could not finish",cancelled:"Stopped",uncertain:"Delivery unconfirmed",answered:null}[e.status]}function IU(e,t){return e.split(/(\/(?:t\/[^\s<>"')]+|r\/\d+(?:\?[^\s<>"')]+)?|chat\?task=[^\s<>"')]+))/g).map((a,n)=>{if(!/^\/(?:t\/|r\/|chat\?task=)/.test(a))return a;let o=a.replace(/[.,;!]+$/,""),r=t&&o.startsWith("/chat?")?o+"&conversation="+encodeURIComponent(t):o;return(0,X.jsxs)("span",{children:[(0,X.jsx)("a",{href:r,children:r.startsWith("/r/")||r.includes("result=")?"Open result":"Open task"}),a.slice(o.length)]},n)})}function Vb({projects:e}){return(0,X.jsxs)("fieldset",{className:"so-team-projects",children:[(0,X.jsx)("legend",{children:"Projects"}),e.length===0?(0,X.jsx)("p",{children:"Add a project before creating a lead."}):e.map(t=>(0,X.jsxs)("label",{children:[(0,X.jsx)("input",{type:"checkbox",name:"projects",value:t,defaultChecked:e.length===1}),(0,X.jsx)("span",{title:t,children:t.split("/").pop()||t})]},t))]})}function NU({proposals:e,csrf:t,onChanged:a,readOnly:n}){return e.length?(0,X.jsx)("div",{className:"so-team-proposals",children:e.map(o=>o.card?(0,X.jsx)(Wf,{cards:[o.card],csrf:t,onChanged:a,readOnly:n},o.id):(0,X.jsxs)("article",{children:[(0,X.jsx)("strong",{children:o.title}),(0,X.jsx)(A1,{children:o.state==="pending"?"Proposed":o.state}),(0,X.jsx)("a",{href:o.href,children:o.state==="pending"?"Review action":"Open outcome"})]},o.id))}):null}function RM({initial:e,user:t,csrf:a,onSnapshot:n}){let[o,r]=(0,Ct.useState)(e),s=o.selected,i=`standing-orders:team-draft:${t}:${s?.id??"new"}`,[l,c]=(0,Ct.useState)(()=>LU(i)),[f,u]=(0,Ct.useState)(""),[d,p]=(0,Ct.useState)(!1),[g,v]=(0,Ct.useState)(!1),[b,x]=(0,Ct.useState)(!1),[y,h]=(0,Ct.useState)(null),[w,S]=(0,Ct.useState)(!1),[C,I]=(0,Ct.useState)(!1),L=(0,Ct.useRef)({snapshot:o,draft:l});L.current={snapshot:o,draft:l};let T=(0,Ct.useRef)(!1),M=(0,Ct.useRef)(null),O=o.leads.find(E=>E.id===s?.leadId),H=typeof window>"u"?null:new URL(window.location.href).searchParams.get("lead"),z=O?.id??o.leads.find(E=>E.id===H)?.id??o.leads[0]?.id??"",[N,_]=(0,Ct.useState)(z),A=o.leads.find(E=>E.id===N);(0,Ct.useEffect)(()=>{o.leads.some(E=>E.id===N)||_(z)},[o.leads,N,z]);let D=(0,Ct.useCallback)(E=>{c(E),I(!1);try{sessionStorage.setItem(i,JSON.stringify(E)),S(!1)}catch{S(!0)}},[i]),q=(0,Ct.useCallback)(E=>{r(E),n?.(E);let ne=L.current.draft;ne.text&&E.messages.some(le=>le.author===t&&le.requestId===ne.requestId)&&D(Ig())},[D,t,n]),U=(0,Ct.useCallback)(async()=>{let E=await fetch("/api/team"+(s?"?conversation="+encodeURIComponent(s.id):""),{credentials:"same-origin",cache:"no-store"}),ne=await E.json();if(E.status===401||E.status===403){x(!0),u(ne.message);return}if(!ne.ok||!ne.snapshot)throw new Error(ne.message||"Updates are unavailable.");q(ne.snapshot),p(!1)},[s?.id,q]);(0,Ct.useEffect)(()=>{if(b)return;let E=null,ne=()=>{E?.close(),E=null,!(document.hidden||!navigator.onLine)&&(E=new EventSource("/api/team/events"+(s?"?conversation="+encodeURIComponent(s.id):"")),E.addEventListener("change",()=>{U().catch(()=>p(!0))}),E.addEventListener("revoked",()=>{E?.close(),x(!0),u("Your access changed. Reopen Chat or sign in again.")}),E.addEventListener("unavailable",()=>{E?.close(),p(!0)}),E.onerror=()=>p(!0))};return ne(),document.addEventListener("visibilitychange",ne),window.addEventListener("online",ne),()=>{E?.close(),document.removeEventListener("visibilitychange",ne),window.removeEventListener("online",ne)}},[s?.id,U,b]),(0,Ct.useEffect)(()=>{M.current?.scrollIntoView({block:"nearest"})},[o.messages.length]);let P=o.messages.at(-1)?.id;(0,Ct.useEffect)(()=>{!s||!P||b||document.hidden||fetch("/api/team",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json","x-csrf-token":a},body:JSON.stringify({operation:"read",args:{conversationId:s.id,messageId:P}})}).catch(()=>{})},[s?.id,P,b,a]);async function W(E,ne){if(T.current||b)return null;T.current=!0,v(!0),u("");try{let F=await(await fetch("/api/team",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json","x-csrf-token":a},body:JSON.stringify({operation:E,args:ne})})).json();return F.snapshot&&q(F.snapshot),F.ok?F:(u(F.message),F.code==="delivery-unconfirmed"&&E==="send"&&D({...L.current.draft,uncertain:!0}),null)}catch{return E==="send"&&D({...L.current.draft,uncertain:!0}),u("The response was not confirmed. Check saved messages before sending again."),null}finally{T.current=!1,v(!1)}}async function te(E){if(E.preventDefault(),!s||!l.text.trim()||l.uncertain)return;await W("send",{conversationId:s.id,text:l.text,requestId:l.requestId})&&D(Ig())}async function de(E,ne){E.preventDefault();let le=new FormData(E.currentTarget),F=le.getAll("projects");if(!F.length){u("Choose at least one project.");return}let G=await W(ne,ne==="create-lead"?{name:le.get("name"),instructions:le.get("instructions")??"",projects:F}:{leadId:N,title:le.get("title"),visibility:le.get("visibility"),projects:F}),re=G?.result&&typeof G.result=="object"?G.result:{};G?.ok&&ne==="create-lead"&&typeof re.leadId=="string"?window.location.assign("/chat?lead="+encodeURIComponent(re.leadId)):G?.snapshot?.selected?window.location.assign("/chat?conversation="+encodeURIComponent(G.snapshot.selected.id)):G?.ok&&await U()}let oe=(0,X.jsxs)("form",{className:"so-team-form",onSubmit:E=>{de(E,"create-conversation")},children:[o.leads.length>1&&(0,X.jsxs)("label",{children:["Lead",(0,X.jsx)("select",{name:"leadId",value:N,onChange:E=>_(E.target.value),children:o.leads.map(E=>(0,X.jsx)("option",{value:E.id,children:E.name},E.id))})]}),(0,X.jsxs)("label",{children:["Conversation title",(0,X.jsx)(Ai,{name:"title",required:!0,maxLength:160,placeholder:"What are we working on?"})]}),(0,X.jsxs)("label",{children:["Audience",(0,X.jsxs)("select",{name:"visibility",defaultValue:"team",children:[(0,X.jsx)("option",{value:"team",children:"Team — invited people"}),(0,X.jsx)("option",{value:"private",children:"Private — only you"})]})]}),(0,X.jsx)(Vb,{projects:A?.projects??[]},N),(0,X.jsx)(_e,{type:"submit",disabled:g||!A,children:"Create conversation"})]}),se="canCreateLead"in o&&o.canCreateLead===!0,ue=new Map(o.messages.filter(E=>E.role==="assistant"&&E.turnId!==null).map(E=>[E.turnId,E.id])),ce=new Map;for(let E of o.proposals??[]){if(E.state==="drafting")continue;let ne=ue.get(E.turnId)??null,le=ce.get(ne)??[];le.push(E),ce.set(ne,le)}let V=E=>(0,X.jsx)(NU,{proposals:ce.get(E)??[],csrf:a,readOnly:b,onChanged:()=>{U().catch(()=>p(!0))}});return(0,X.jsxs)("section",{className:"so-team-chat","aria-label":"Team conversation",children:[(0,X.jsxs)("div",{className:"so-team-toolbar",children:[o.leads.length>1&&(0,X.jsxs)("label",{className:"so-team-lead-select",children:[(0,X.jsx)("span",{className:"so-sr-only",children:"Lead"}),(0,X.jsx)("select",{"aria-label":"Lead",value:z,onChange:E=>window.location.assign("/chat?lead="+encodeURIComponent(E.target.value)),children:o.leads.map(E=>(0,X.jsx)("option",{value:E.id,children:E.name},E.id))})]}),s?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)("div",{className:"so-team-title",children:[(0,X.jsx)("h2",{children:s.title}),o.leads.length===1&&(0,X.jsx)("span",{children:O?.name??"Lead"})]}),(0,X.jsxs)(Jn,{summary:s.visibility==="team"?"Team":"Private",className:"so-team-audience",children:[(0,X.jsx)("h3",{children:"People"}),(0,X.jsx)("ul",{children:o.participants.filter(E=>E.active).map(E=>(0,X.jsxs)("li",{children:[(0,X.jsx)("span",{children:E.account}),(0,X.jsx)("span",{children:E.role}),o.canManage&&E.account!==t&&(0,X.jsx)(_e,{variant:"ghost",onClick:()=>{W("member",{conversationId:s.id,account:E.account,role:E.role,active:!1,expectedRevision:s.revision})},disabled:g,children:"Remove"})]},E.account))}),o.canManage&&s.visibility==="team"&&(0,X.jsxs)("form",{className:"so-team-form",onSubmit:E=>{E.preventDefault();let ne=new FormData(E.currentTarget);W("member",{conversationId:s.id,account:ne.get("account"),role:ne.get("role"),active:!0,expectedRevision:s.revision,joinLead:!0,expectedLeadRevision:O?.revision})},children:[(0,X.jsxs)("label",{children:["Person",(0,X.jsx)("select",{name:"account",required:!0,children:o.accounts.filter(E=>!o.participants.some(ne=>ne.account===E&&ne.active)).map(E=>(0,X.jsx)("option",{children:E},E))})]}),(0,X.jsxs)("label",{children:["Access",(0,X.jsxs)("select",{name:"role",defaultValue:"contributor",children:[(0,X.jsx)("option",{value:"viewer",children:"Viewer"}),(0,X.jsx)("option",{value:"contributor",children:"Contributor"}),(0,X.jsx)("option",{value:"manager",children:"Manager"})]})]}),(0,X.jsxs)("p",{className:"so-team-small",children:["Adds access to this conversation and ",O?.name??"the lead"," for these projects: ",O?.projects.map(E=>E.split("/").pop()).join(", "),". Existing private conversations stay private."]}),(0,X.jsx)(_e,{type:"submit",disabled:g,children:"Add person"})]}),(0,X.jsxs)("p",{className:"so-team-small",children:["Projects: ",s.projects.map(E=>E.split("/").pop()).join(", ")]})]})]}):(0,X.jsx)("h2",{children:o.leads.length?"Start a conversation":"Your team lead"})]}),(0,X.jsxs)("div",{className:"so-team-content",children:[(f||b)&&(0,X.jsxs)(dn,{tone:"error",children:[f||"Your access changed.",b&&(0,X.jsxs)(X.Fragment,{children:[" ",(0,X.jsx)("a",{href:"/chat",children:"Reopen Chat"})]})]}),d&&!b&&(0,X.jsxs)(dn,{children:["Live updates disconnected. ",(0,X.jsx)(_e,{variant:"ghost",onClick:()=>{U().catch(()=>u("Updates are still unavailable. Your draft is saved."))},children:"Check messages"})]}),!s&&o.leads.length>0&&(0,X.jsxs)(X.Fragment,{children:[o.conversations.length>0&&(0,X.jsx)("nav",{className:"so-team-room-list","aria-label":"Conversations",children:o.conversations.map(E=>(0,X.jsxs)("a",{href:"/chat?conversation="+encodeURIComponent(E.id),children:[(0,X.jsx)("strong",{children:E.title}),(0,X.jsx)("span",{children:E.visibility==="team"?"Team":"Private"})]},E.id))}),oe]}),!s&&o.leads.length===0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("p",{children:se?"Create a lead, then invite people into a conversation.":"Ask a team administrator to invite you to a conversation."}),se&&(0,X.jsxs)("form",{className:"so-team-form",onSubmit:E=>{de(E,"create-lead")},children:[(0,X.jsxs)("label",{children:["Lead name",(0,X.jsx)(Ai,{name:"name",defaultValue:"Team lead",required:!0,maxLength:100})]}),(0,X.jsx)(Vb,{projects:o.projects}),(0,X.jsx)(Jn,{summary:"Working instructions",children:(0,X.jsx)(ws,{name:"instructions",rows:4,placeholder:"What should this lead focus on?"})}),(0,X.jsx)(_e,{type:"submit",disabled:g||!o.projects.length,children:"Create lead"})]})]}),s&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)("div",{className:"so-team-messages","aria-live":"polite","aria-relevant":"additions text",children:[o.messages.length===0&&(0,X.jsxs)("div",{className:"so-team-empty",children:[(0,X.jsx)("h3",{children:"What would you like to work on?"}),(0,X.jsx)("p",{children:s.visibility==="team"?"People you invite can join this conversation.":"Only you can read this conversation."})]}),o.messages.map(E=>(0,X.jsxs)("article",{className:"so-team-message so-team-message--"+E.role,"data-team-message":E.id,children:[(0,X.jsxs)("div",{className:"so-team-message-meta",children:[(0,X.jsx)("strong",{children:E.author}),NM(E)&&(0,X.jsx)(A1,{tone:["failed","uncertain"].includes(E.status)?"danger":"neutral",children:NM(E)})]}),y===E.id?(0,X.jsxs)("form",{className:"so-team-form",onSubmit:ne=>{ne.preventDefault();let le=new FormData(ne.currentTarget);W("edit",{conversationId:s.id,messageId:E.id,expectedRevision:E.revision,text:le.get("text")}).then(F=>{F&&h(null)})},children:[(0,X.jsx)(Di,{htmlFor:"team-edit-"+E.id,children:"Edit queued message"}),(0,X.jsx)(ws,{id:"team-edit-"+E.id,name:"text",defaultValue:E.text,required:!0,maxLength:2e3,rows:3}),(0,X.jsxs)("div",{children:[(0,X.jsx)(_e,{type:"submit",disabled:g,children:"Save edit"}),(0,X.jsx)(_e,{variant:"ghost",onClick:()=>h(null),children:"Cancel"})]})]}):(0,X.jsx)("p",{className:"so-team-message-text",children:IU(E.text,s.id)}),E.error&&(0,X.jsx)(dn,{tone:"error",children:E.error}),E.status==="queued"&&E.author===t&&!b&&(0,X.jsxs)("div",{className:"so-team-message-actions",children:[(0,X.jsx)(_e,{variant:"ghost",onClick:()=>h(E.id),disabled:g,children:"Edit"}),(0,X.jsx)(_e,{variant:"ghost",onClick:()=>{W("withdraw",{conversationId:s.id,messageId:E.id,expectedRevision:E.revision})},disabled:g,children:"Withdraw"})]}),V(E.id)]},E.id))]}),o.truncated&&(0,X.jsx)("p",{className:"so-team-small",children:"Showing the most recent messages."})]}),V(null),(0,X.jsx)("div",{ref:M}),(0,X.jsxs)(Jn,{summary:"Conversations",className:"so-team-settings",children:[s&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("nav",{className:"so-team-room-list","aria-label":"Other conversations",children:o.conversations.filter(E=>E.id!==s.id).map(E=>(0,X.jsx)("a",{href:"/chat?conversation="+encodeURIComponent(E.id),children:E.title},E.id))}),(0,X.jsx)("h3",{children:"New conversation"}),oe]}),(0,X.jsx)("a",{href:"/chat?private=1",children:"Previous private chat"}),o.canManage&&O&&(0,X.jsx)(Jn,{summary:"Lead settings",children:(0,X.jsxs)("form",{className:"so-team-form",onSubmit:E=>{E.preventDefault();let ne=new FormData(E.currentTarget);W("update-lead",{leadId:O.id,expectedRevision:O.revision,name:ne.get("name"),instructions:ne.get("instructions"),status:ne.get("status")})},children:[(0,X.jsxs)("label",{children:["Lead name",(0,X.jsx)(Ai,{name:"name",defaultValue:O.name,required:!0,maxLength:100})]}),(0,X.jsxs)("label",{children:["Working instructions",(0,X.jsx)(ws,{name:"instructions",defaultValue:O.instructions,rows:4})]}),(0,X.jsxs)("label",{children:["Status",(0,X.jsxs)("select",{name:"status",defaultValue:O.status,children:[(0,X.jsx)("option",{value:"active",children:"Active"}),(0,X.jsx)("option",{value:"paused",children:"Paused"})]})]}),(0,X.jsxs)("p",{className:"so-team-small",children:["Projects: ",O.projects.map(E=>E.split("/").pop()).join(", ")]}),(0,X.jsx)(_e,{type:"submit",disabled:g,children:"Save lead"})]})}),se&&o.leads.length>0&&(0,X.jsx)(Jn,{summary:"Add a lead",children:(0,X.jsxs)("form",{className:"so-team-form",onSubmit:E=>{de(E,"create-lead")},children:[(0,X.jsxs)("label",{children:["Lead name",(0,X.jsx)(Ai,{name:"name",required:!0,maxLength:100})]}),(0,X.jsx)(Vb,{projects:o.projects}),(0,X.jsxs)("label",{children:["Working instructions",(0,X.jsx)(ws,{name:"instructions",rows:3})]}),(0,X.jsx)(_e,{type:"submit",disabled:g,children:"Create lead"})]})})]})]}),s&&(0,X.jsxs)("div",{className:"so-team-composer",children:[(0,X.jsx)(RU,{snapshot:o,execute:W,busy:g}),o.canSend&&!b?(0,X.jsxs)("form",{onSubmit:E=>{te(E)},children:[(0,X.jsxs)(Di,{htmlFor:"team-message",className:"so-sr-only",children:["Message ",O?.name??"the lead"]}),(0,X.jsx)(ws,{id:"team-message",rows:3,value:l.text,placeholder:"Message "+(O?.name??"your lead"),onChange:E=>D({text:E.target.value,requestId:l.uncertain?crypto.randomUUID():l.requestId,uncertain:!1}),disabled:g||l.uncertain,maxLength:2e3}),(0,X.jsxs)("div",{className:"so-team-compose-actions",children:[o.messages.some(E=>E.status==="running")&&(0,X.jsx)(_e,{variant:"secondary",onClick:()=>{W("stop",{conversationId:s.id,messageId:o.messages.find(E=>E.status==="running")?.id})},disabled:g,children:"Stop"}),l.uncertain?(0,X.jsx)(_e,{onClick:()=>{U().then(()=>{L.current.draft.uncertain&&(I(!0),u("This message is not in saved history. You can send the saved message with its original request identity."))}).catch(()=>u("Saved messages could not be checked. Your draft is preserved."))},children:"Check messages"}):(0,X.jsx)(_e,{type:"submit",disabled:g||!l.text.trim()||!o.chatAuthorization?.enabled,children:g?"Saving…":"Send"}),l.uncertain&&C&&(0,X.jsx)(_e,{disabled:g,onClick:()=>{W("send",{conversationId:s.id,text:l.text,requestId:l.requestId}).then(E=>{E&&D(Ig())})},children:"Send saved message"})]})]}):!b&&(0,X.jsx)("p",{className:"so-team-small",children:"You can read this conversation. Ask a manager for permission to send messages."}),w&&(0,X.jsx)(dn,{children:"Keep this tab open until your message is sent; draft storage is unavailable."})]})]})}function RU({snapshot:e,execute:t,busy:a}){let n=e.chatAuthorization;return!e.selected||!n||!e.canSend?null:n.waitingReason?(0,X.jsx)(dn,{children:n.waitingReason}):n.enabled?null:(0,X.jsxs)("div",{className:"so-team-consent",children:[(0,X.jsxs)("p",{children:["Enable ",n.provider," · ",n.model," for your messages in this conversation, using the installation’s configured provider account."]}),(0,X.jsxs)("p",{children:[n.dailyTurns," turns per day",n.weeklyCeilingUsd===null?". Your provider subscription limits apply.":`, $${n.weeklyCeilingUsd} per week and $${n.conversationCeilingUsd} for this conversation.`," Execution approvals still apply."]}),(0,X.jsx)(_e,{disabled:a,onClick:()=>{t("authorize",{conversationId:e.selected.id,termsDigest:n.termsDigest,ceilingUsd:n.conversationCeilingUsd})},children:"Enable chat"})]})}var lc=j(he(),1);var Xa=j(fe(),1),Gb=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function TU(e){return!Gb(e)||!Array.isArray(e.steps)?null:{steps:e.steps.flatMap((a,n)=>!Gb(a)||!Array.isArray(a.tools)||typeof a.text!="string"?[]:[{tools:a.tools.flatMap((r,s)=>{if(typeof r!="string")return[];let i=Array.isArray(a.toolCalls)?a.toolCalls[s]:null;if(Gb(i)&&typeof i.id=="string"&&i.label===r){if(i.state==="succeeded"||i.state==="running")return[{id:i.id,label:r,state:i.state}];if(i.state==="failed"&&typeof i.reason=="string"&&i.reason.trim()!=="")return[{id:i.id,label:r,state:"failed",reason:i.reason}]}return[{id:`unknown:${n}:${s}`,label:r,state:"unknown"}]}),text:a.text}]),done:e.done===!0}}function $b(e,t,a){let[n,o]=(0,lc.useState)(null),r=(0,lc.useRef)(a);return r.current=a,(0,lc.useEffect)(()=>{if(o(null),e===null||!t||typeof EventSource>"u")return;let s=new URLSearchParams;e.taskId?s.set("task",e.taskId):e.project&&s.set("project",e.project);let i=s.toString(),l=new EventSource(`/chat/stream${i===""?"":`?${i}`}`);return l.addEventListener("turn",c=>{let f;try{f=JSON.parse(c.data)}catch{return}let u=TU(f);u!==null&&(o(u),u.done&&(l.close(),r.current()))}),l.onerror=()=>{l.close(),o(c=>c===null?null:{...c,disconnected:!0})},()=>l.close()},[e?.sessionId,e?.taskId,e?.project,t]),t?n:null}function jb({live:e,leadName:t}){let a=e?.steps??[],n=!e?.done&&!e?.disconnected,o=a.flatMap(i=>i.tools),r=[...a].reverse().find(i=>i.text.trim()!=="")?.text??"",s=n&&a.length>0&&a.at(-1).text.trim()!=="";return(0,Xa.jsxs)(Ph,{from:"assistant",className:"so-live-reply","data-live-reply":!0,children:[(0,Xa.jsx)("div",{className:"so-message-label",children:t}),(0,Xa.jsxs)(Vd,{children:[o.length>0&&(0,Xa.jsx)("ul",{className:"so-live-steps","aria-label":"Tool steps",children:o.map(i=>{let l=i.state==="running"&&!n?"unknown":i.state,c=l==="succeeded"?"Done":l==="failed"?"Failed":l==="running"?"Running":"Outcome not reported";return(0,Xa.jsx)("li",{"data-state":l,"data-done":l==="succeeded"?"true":"false",children:(0,Xa.jsxs)("div",{children:[(0,Xa.jsx)("span",{children:i.label}),(0,Xa.jsxs)("span",{className:"so-tool-status",children:[" · ",c]}),i.state==="failed"&&(0,Xa.jsx)("p",{className:"so-tool-reason",children:i.reason})]})},i.id)})}),r!==""&&(0,Xa.jsxs)("p",{className:"so-live-text",children:[r,s&&(0,Xa.jsx)("span",{className:"so-live-caret","aria-hidden":"true"})]}),n&&(s||!o.some(i=>i.state==="running"))&&(0,Xa.jsxs)("div",{className:"so-working",role:"status",children:[(0,Xa.jsx)("span",{className:"so-live-dot"}),s?"Writing…":"Thinking…"]})]})]})}var TM={task:{label:"Open task",target:"task"},approval:{label:"Review & start",target:"task"},planning:{label:"Approve plan",target:"task"},recovery:{label:"Review recovery options",target:"task"},cancel:{label:"Cancel task",target:"task"},result:{label:"Open result",target:"task"},acceptance:{label:"Inspect result",target:"task"},publish:{label:"Review publication",target:"task"},projects:{label:"Manage projects",href:"/projects"},code:{label:"Open coding workspace",href:"/code"},routines:{label:"Manage routines",href:"/routines"},flows:{label:"Open flows",href:"/flows"},recipes:{label:"Browse workflows",href:"/recipes"},workers:{label:"Manage workers",href:"/fleet"},slack:{label:"Manage Slack",href:"/settings/slack"},discord:{label:"Manage Discord",href:"/settings/discord"},lead:{label:"Name your lead",href:"/settings/lead"},integrations:{label:"Set up integrations",href:"/settings/integrations"},settings:{label:"Open settings",href:"/settings"},permissions:{label:"Review permissions",href:"/settings"},providers:{label:"Connect an agent",href:"/settings#providers"},skills:{label:"Manage skills",href:"/settings/skills"},tools:{label:"Manage tools",href:"/settings/tools"},knowledge:{label:"Edit project knowledge",href:"/settings/knowledge"},learning:{label:"Review learning history",href:"/settings/learning"},mode:{label:"Review automatic approvals",href:"/mode"},policy:{label:"Review organisation policy",href:"/settings/policy"}};function Ng(e,t,a="summary"){return`/chat?task=${encodeURIComponent(e)}&result=${t}${a==="summary"?"":`&tab=${a}`}`}function MM(e,t,a,n){let o=TM[e];if(e==="skills"||e==="tools")return TM[e].href+(typeof n=="string"&&n?"?repo="+encodeURIComponent(n):"");if("href"in o)return o.href;if(e==="acceptance")return`/review?result=${encodeURIComponent(t)}&run=${Number.isSafeInteger(a)&&Number(a)>0?a:0}&tab=checks`;if(e==="result"&&Number.isSafeInteger(a)&&Number(a)>0)return Ng(t,Number(a));let r="/chat?task="+encodeURIComponent(t);return e==="cancel"||e==="recovery"||e==="publish"?"/t/"+encodeURIComponent(t):r+(e==="approval"||e==="planning"?"#task-chat-action":"")}function MU(e){let t=e.primaryAction;if(t===null)return null;let{taskId:a,runId:n,decisionId:o}=t.target;if(o!==null)return`/d/${o}`;if(t.code==="inspect-decisions")return"/";if(t.code==="sign-in")return"/settings#providers";if(t.code==="confirm-stopped")return`/t/${encodeURIComponent(e.rootId)}#confirm-stopped`;if(t.code==="open-result"&&n!==null)return Ng(a,n);if(t.code==="open-pr"&&/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/pull\/\d+$/.test(e.publicationUrl??""))return e.publicationUrl;if(n!==null&&(t.code==="open-pr"||t.code==="retry-review"))return`/review?result=${encodeURIComponent(a)}&run=${n}`;if(n!==null&&(t.code==="inspect-run"||t.code==="reconcile-run"))return`/r/${n}`;let r=t.code==="approve-scope"?"#approve":t.code==="inspect-stop"||t.code==="resume-run"?"#task-control":t.code==="unhold"?"#task-actions":t.code==="write-scope"||t.code==="select-agent"?"#scope":t.code==="inspect-hold"?"#holds":t.code==="start-worker"||t.code==="repair-dependency"?"#run-status":"";return`/t/${encodeURIComponent(e.rootId)}?version=${encodeURIComponent(a)}`+r}function EM(e,t){let a=o=>t&&o.startsWith("/chat?")?o+"&conversation="+encodeURIComponent(t):o,n=e.items.map(o=>{let r=o.status,s=p=>p.trim().replace(/\s+/g," ").replace(/[.!?]+$/,"").toLowerCase(),i=["Waiting","Failed","Needs you"].includes(r.label)&&s(r.detail)!==""&&s(r.detail)!==s(r.label)?r.detail:void 0,l=o.resultRunId===null||o.resultTaskId===null||o.resultOutcome!=="built"&&o.resultOutcome!=="no-change"?null:Ng(o.resultTaskId,o.resultRunId),c=MM("task",o.rootId),f=o.primaryAction,u=MU(o);return{item:{id:o.rootId,title:o.title,project:o.repo,state:o.assignmentState,label:r.label,tone:r.tone,href:a(c),resultHref:l===null?null:a(l),action:f===null||u===null?null:{label:f.label,href:a(u)},updatedAt:o.updatedAt,...i===void 0?{}:{detail:i},...o.lead===void 0?{}:{lead:o.lead}},rank:r.rank}});return n.sort((o,r)=>o.rank-r.rank),{crew:n.map(o=>o.item),crewTruncated:e.nextCursor!==null}}var Yf=j(he(),1);var Ce=j(fe(),1);function Xf({command:e}){let[t,a]=(0,Yf.useState)(!1);return(0,Ce.jsxs)("span",{className:"so-first-run-command",children:[(0,Ce.jsx)("code",{children:e}),(0,Ce.jsx)(_e,{variant:"ghost",size:"sm",onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{a(!0),window.setTimeout(()=>a(!1),1500)},()=>{})},"aria-label":`Copy ${e}`,children:t?"Copied":"Copy"})]})}function AM(e,t){return e.trim()===""?t:e.includes(t)?e:`${e.trimEnd()}
51
51
  ${t}`}function EU(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.lead==="on"||t.agent===!0}function AU(e){(0,Yf.useEffect)(()=>{if(!e)return;let t=!1,a=0,n=async()=>{try{let o=await fetch(e,{headers:{accept:"application/json"},cache:"no-store"});if(o.ok&&EU(await o.json())){window.location.reload();return}}catch{}t||(a=window.setTimeout(()=>{n()},5e3))};return a=window.setTimeout(()=>{n()},3e3),()=>{t=!0,window.clearTimeout(a)}},[e])}function Wb({firstRun:e}){AU(e.recheck);let t=e.recheck!=null;return(0,Ce.jsxs)("section",{className:"so-first-run","aria-labelledby":"first-run-title","data-first-run":!0,children:[(0,Ce.jsx)("h2",{id:"first-run-title",children:"Get to your first result"}),(0,Ce.jsx)("ol",{className:"so-first-run-steps",children:e.steps.map(a=>(0,Ce.jsxs)("li",{"data-step":a.key,"data-done":a.done,children:[(0,Ce.jsx)("span",{className:"so-first-run-mark","aria-hidden":"true",children:a.done?"✓":""}),(0,Ce.jsxs)("span",{className:"so-first-run-title",children:[a.title,(0,Ce.jsx)("span",{className:"so-sr-only",children:a.done?": done":a.checking?": checking":": not yet"})]}),a.checking&&(0,Ce.jsx)("span",{className:"so-first-run-checking","aria-hidden":"true",children:"Checking…"}),a.action!==null&&(a.key==="agent"&&e.sandbox!==null?null:a.action.kind==="link"?(0,Ce.jsx)(_e,{asChild:!0,variant:"secondary",size:"sm",children:(0,Ce.jsx)("a",{href:a.action.href,children:a.action.label})}):(0,Ce.jsx)(Xf,{command:a.action.command})),a.key==="agent"&&!a.done&&e.sandbox!==null&&a.action?.kind==="command"&&(0,Ce.jsxs)("div",{className:"so-first-run-choices","data-first-run-choices":!0,children:[(0,Ce.jsxs)("div",{"data-sign-in-command":!0,children:[(0,Ce.jsx)("p",{className:"so-first-run-choice-title",children:"Sign in an agent"}),(0,Ce.jsx)("p",{className:"so-first-run-choice-hint",children:"Run this on this computer. Chat turns on by itself once you’re signed in."}),(0,Ce.jsx)(Xf,{command:a.action.command})]}),(0,Ce.jsxs)("div",{children:[(0,Ce.jsx)("p",{className:"so-first-run-choice-title",children:"Or try the sandbox"}),(0,Ce.jsx)("p",{className:"so-first-run-choice-hint",children:"Sample tasks, no spend."}),(0,Ce.jsx)(Xf,{command:e.sandbox})]})]})]},a.key))}),t&&(0,Ce.jsxs)("p",{className:"so-first-run-recheck",role:"status","data-first-run-recheck":!0,children:[(0,Ce.jsx)("span",{className:"so-live-dot","aria-hidden":"true"}),"Checking for a signed-in agent"]})]})}function DM({firstRun:e,onDraft:t}){return(0,Ce.jsxs)("div",{className:"so-first-request","data-first-request":!0,children:[e.intro&&(0,Ce.jsx)("p",{className:"so-first-request-intro","data-how-it-works":!0,children:e.intro}),e.suggestions.length>0&&(0,Ce.jsx)("div",{className:"so-suggestions so-first-request-suggestions","aria-label":"First tasks to try","data-first-tasks":!0,children:e.suggestions.map(a=>(0,Ce.jsx)("button",{type:"button",className:"so-suggestion","data-source":a.source,onClick:()=>t(a.draft),children:a.label},a.draft))}),e.lead&&(0,Ce.jsxs)("p",{className:"so-first-request-lead","data-lead-line":!0,children:[e.lead.words," · ",(0,Ce.jsx)("a",{href:e.lead.href,children:"Change"})]})]})}function _M({phone:e,csrf:t,dismissable:a=!0}){let[n,o]=(0,Yf.useState)(!1);if(n)return null;let[r,...s]=e.chatApps;return(0,Ce.jsxs)("section",{className:"so-phone-card","aria-labelledby":"phone-card-title","data-phone-card":!0,children:[(0,Ce.jsx)("h2",{id:"phone-card-title",children:"Use it from your phone"}),(0,Ce.jsxs)("div",{className:"so-phone-options",children:[(0,Ce.jsxs)("div",{children:[(0,Ce.jsx)("p",{className:"so-first-run-choice-title",children:"A chat app"}),(0,Ce.jsxs)("p",{className:"so-first-run-choice-hint",children:["Get results and approve plans in ",r?.label??"Telegram",": add the bot, then pair your phone."]}),r&&(0,Ce.jsx)(_e,{asChild:!0,variant:"secondary",size:"sm",children:(0,Ce.jsxs)("a",{href:r.href,children:["Pair ",r.label]})}),s.length>0&&(0,Ce.jsxs)("p",{className:"so-phone-others",children:["Or ",s.map((i,l)=>(0,Ce.jsxs)("span",{children:[l>0&&(l===s.length-1?" or ":", "),(0,Ce.jsx)("a",{href:i.href,children:i.label})]},i.href))]})]}),(0,Ce.jsxs)("div",{"data-phone-tailnet":!0,children:[(0,Ce.jsx)("p",{className:"so-first-run-choice-title",children:"This console over Tailscale"}),e.tailnet===null?(0,Ce.jsxs)("p",{className:"so-first-run-choice-hint",children:["Install ",(0,Ce.jsx)("a",{href:"https://tailscale.com/download",children:"Tailscale"})," on this computer and your phone, then reload this page for the address."]}):e.tailnet.restart===null?(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("p",{className:"so-first-run-choice-hint",children:"On your phone, open this and sign in:"}),(0,Ce.jsx)(Xf,{command:e.tailnet.address})]}):(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsxs)("p",{className:"so-first-run-choice-hint",children:["Start Toolroll with this, then on your phone open ",(0,Ce.jsx)("code",{children:e.tailnet.address})," and sign in:"]}),(0,Ce.jsx)(Xf,{command:e.tailnet.restart})]})]})]}),a&&(0,Ce.jsxs)("form",{method:"post",action:e.dismissHref,onSubmit:i=>{i.preventDefault(),o(!0),fetch(e.dismissHref,{method:"POST",body:new URLSearchParams({csrf:t,quiet:"1"})}).catch(()=>{})},children:[(0,Ce.jsx)("input",{type:"hidden",name:"csrf",value:t}),(0,Ce.jsx)(_e,{variant:"ghost",size:"sm",type:"submit",children:"Not now"})]})]})}function PM({steps:e}){let t=e.find(a=>a.state==="current"||a.state==="stuck");return(0,Ce.jsx)("ol",{className:"first-task-journey","aria-label":`Where this task is: ${t?.label??"Ready"}`,"data-first-task-journey":!0,children:e.map(a=>(0,Ce.jsxs)("li",{"data-step":a.key,"data-state":a.state,"aria-current":a.state==="current"||a.state==="stuck"?"step":void 0,children:[(0,Ce.jsx)("span",{className:"first-task-journey-mark","aria-hidden":"true"}),(0,Ce.jsx)("span",{children:a.label})]},a.key))})}var XM=j(he(),1);var OM=()=>!0,zM=e=>e.build==null?"the last build":`build #${e.build}`,BM=e=>e.build==null?"The last build":`Build #${e.build}`,Kf={approval:{sentence:()=>"Review the plan and approve it to start.",action:{code:"approve-scope",label:"Approve plan"}},card:{sentence:()=>"This card is waiting for your approval.",action:{code:"approve-card",label:"Approve card"}},answer:{sentence:()=>"Answer the question so the work can continue.",action:{code:"answer-decision",label:"Answer the question"},useReason:OM},questions:{sentence:()=>"Too many questions are open. Answer one so this task can start.",action:{code:"inspect-decisions",label:"Answer questions"}},"sign-in":{sentence:e=>`${e.provider??"Your agent"} needs you to sign in again. The task starts on its own after.`,action:{code:"sign-in",label:"Sign in again"},useReason:e=>/sign in|API key/i.test(e)},"confirm-stopped":{sentence:e=>`Toolroll can't confirm ${zM(e)} stopped. Nothing from it is running.`,action:{code:"confirm-stopped",label:"Confirm it stopped"}},"check-stopped":{sentence:e=>`Toolroll can't check whether ${zM(e)} stopped. Make sure nothing from it is running, then confirm.`,action:{code:"confirm-stopped",label:"Confirm it stopped"}},hold:{sentence:()=>"A hold is keeping this task from starting. Review it to release it.",action:{code:"inspect-hold",label:"Review hold"}},"choose-project":{sentence:()=>"Choose a project so a builder can start.",action:{code:"place-task",label:"Choose a project"}},"define-task":{sentence:()=>"Say what the task should do so it can be planned.",action:{code:"write-scope",label:"Define the task"}},"fix-request":{sentence:()=>"The request can't be planned as written. Edit it so the planner can start.",action:{code:"write-scope",label:"Edit the request"}},"choose-agent":{sentence:()=>"Choose an agent to build this.",action:{code:"select-agent",label:"Choose an agent"}},"fix-dependency":{sentence:()=>"A task this one waits on didn't finish. Fix or remove it so this one can start.",action:{code:"repair-dependency",label:"Fix the required task"},useReason:e=>/didn't finish|did not finish|before it finished/i.test(e),withReason:e=>`${e.replace(/[.\s]*$/,".")} Fix or remove it so this one can start.`},"add-requirement":{sentence:()=>"This project is missing something the task needs. Add it so a builder can start.",action:{code:"repair-capability",label:"Add the requirement"}},"connect-builder":{sentence:()=>"No builder works on this project yet. Connect one so the task can start.",action:{code:"start-worker",label:"Connect a builder"}},"start-builder":{sentence:()=>"The builder for this project is offline. Start it and the task begins on its own.",action:{code:"start-worker",label:"Start the builder"}},vanished:{sentence:e=>`${BM(e)} stopped without finishing. Check it, then retry.`,action:{code:"reconcile-run",label:"Check the build"}},"review-result":{sentence:()=>"Check the result, then accept it or ask for changes.",action:{code:"open-result",label:"Open result"}},rebuild:{sentence:e=>`${BM(e)} was made to an earlier plan. Build it again to the current plan.`,action:{code:"retry-task",label:"Build again"}},"earlier-version":{sentence:()=>"An earlier version of this task still needs you. Finish it first.",action:{code:"inspect-task",label:"Open earlier version"}},other:{sentence:()=>"Open the task to see what it needs from you.",action:{code:"inspect-task",label:"Open the task"},useReason:OM}};var DU=["witness","unproven","quiescence","quiescent","digest","scope digest"],aie=new RegExp(`\\b(?:${DU.join("|")})\\b`,"i");var FM=500;var HM="More";var ze=j(fe(),1),qM={neutral:"bg-muted-foreground",live:"bg-info",attention:"bg-attention",ready:"bg-transparent ring-2 ring-inset ring-success",success:"bg-success",danger:"bg-destructive"},_U={ok:(0,ze.jsx)($a,{className:"size-3.5 text-success","aria-hidden":"true"}),running:(0,ze.jsx)(zi,{className:"size-3.5 text-info","aria-hidden":"true"}),none:(0,ze.jsx)(Bi,{className:"size-3 text-muted-foreground","aria-hidden":"true"}),note:(0,ze.jsx)(pn,{className:"size-3.5 text-warning","aria-hidden":"true"}),failed:(0,ze.jsx)(Et,{className:"size-3.5 text-destructive","aria-hidden":"true"})};function Rg({status:e,as:t="h2"}){return(0,ze.jsxs)(t,{className:"flex items-center gap-2.5 text-lg font-semibold leading-snug","data-headline":e.headline,children:[(0,ze.jsx)("span",{"aria-hidden":"true",className:ee("size-2.5 shrink-0 rounded-full",qM[e.tone])}),e.headline]})}var Xb="phone:-my-3 phone:inline-block phone:py-3";function PU({detail:e,runChecks:t,csrf:a}){let n=t!==null&&a!==""&&e.action?.href===t.action,o=e.href===null?e.text:(0,ze.jsx)("a",{href:e.href,className:ee("underline decoration-border underline-offset-4 hover:decoration-muted-foreground",Xb),children:e.text});return(0,ze.jsxs)("li",{"data-status-detail":e.key,"data-mark":e.mark,className:"grid grid-cols-[14px_7.5rem_minmax(0,1fr)] items-center gap-x-2.5 py-1.5 text-[13px] phone:min-h-11 phone:grid-cols-[14px_6.25rem_minmax(0,1fr)] phone:py-1",children:[(0,ze.jsx)("span",{className:"flex items-center justify-center",children:_U[e.mark]}),(0,ze.jsx)("span",{className:"text-muted-foreground",children:e.label}),(0,ze.jsxs)("span",{className:"flex min-w-0 flex-wrap items-baseline gap-x-2.5",children:[(0,ze.jsx)("span",{className:"min-w-0 [overflow-wrap:anywhere]",children:o}),e.action!==null&&(n?(0,ze.jsxs)("form",{method:"post",action:t.action,"data-run-checks":!0,className:"inline",children:[(0,ze.jsx)("input",{type:"hidden",name:"csrf",value:a}),(0,ze.jsx)("input",{type:"hidden",name:"level",value:t.level}),(0,ze.jsx)("input",{type:"hidden",name:"return",value:t.returnTo}),(0,ze.jsx)("button",{type:"submit","data-detail-action":!0,className:ee("cursor-pointer whitespace-nowrap font-medium underline-offset-4 hover:underline",Xb),children:e.action.label})]}):e.action.href===null?(0,ze.jsx)("span",{className:"font-medium",children:e.action.label}):(0,ze.jsx)("a",{href:e.action.href,"data-detail-action":!0,className:ee("whitespace-nowrap font-medium underline-offset-4 hover:underline",Xb,e.mark==="note"&&"text-warning"),children:e.action.label}))]})]})}function Tg({status:e,runChecks:t=null,csrf:a=""}){return e.details.length===0?null:(0,ze.jsx)("ul",{"aria-label":"Status",className:"flex flex-col border-t border-border pt-2 phone:pt-1.5",children:e.details.map(n=>(0,ze.jsx)(PU,{detail:n,runChecks:t,csrf:a},n.key))})}function Yb(e,t=[]){return[...new Set([...e.details.flatMap(a=>a.why===null?[]:[`${a.label}: ${a.why}`]),...e.why,...t])]}function UM({status:e,extra:t=[]}){let a=Yb(e,t);return a.length===0?null:(0,ze.jsxs)("details",{className:"group text-[13px]","data-status-why":!0,children:[(0,ze.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 py-1 font-medium text-muted-foreground hover:text-foreground phone:min-h-11 [&::-webkit-details-marker]:hidden",children:[(0,ze.jsx)(ra,{className:"size-4 transition-transform group-open:rotate-90","aria-hidden":"true"}),HM]}),(0,ze.jsx)("div",{className:"flex flex-col gap-1 pb-1 pl-5.5 pt-1 text-muted-foreground",children:a.map(n=>(0,ze.jsx)("p",{className:"[overflow-wrap:anywhere]",children:n},n))})]})}function OU(e){return e==="attention"?"attention":e==="problem"?"danger":e==="live"?"live":e==="ready"?"ready":e==="done"?"success":"neutral"}function ul({label:e,tone:t,className:a,...n}){let o=OU(t);return(0,ze.jsxs)("span",{...n,"data-headline":e,className:ee("inline-flex w-fit shrink-0 items-center gap-1.5 whitespace-nowrap rounded-[5px] px-1.5 py-px text-[11.5px] font-medium leading-[18px]",o==="attention"?"bg-attention-soft text-attention":"bg-neutral-soft text-neutral-ink",a),children:[(0,ze.jsx)("span",{"aria-hidden":"true",className:ee("size-1.5 shrink-0 rounded-full",o==="ready"?"bg-transparent ring-[1.5px] ring-inset ring-success":qM[o])}),e]})}function Mg({form:e,csrf:t,label:a="Confirm it stopped"}){return(0,ze.jsxs)("form",{method:"post",action:e.action,id:"confirm-stopped","data-confirm-stopped":e.run,className:"flex flex-wrap items-center gap-2 phone:w-full",children:[(0,ze.jsx)("input",{type:"hidden",name:"csrf",value:t}),(0,ze.jsx)("input",{type:"hidden",name:"run",value:String(e.run)}),e.returnTo!==void 0&&(0,ze.jsx)("input",{type:"hidden",name:"return",value:e.returnTo}),e.checked===!0&&(0,ze.jsxs)("label",{className:"flex min-h-11 items-center gap-2 text-sm phone:w-full",children:[(0,ze.jsx)("input",{type:"checkbox",name:"checked",value:"yes",required:!0,className:"size-4"}),"Nothing from build #",e.run," is running"]}),(0,ze.jsx)(ve,{type:"password",name:"token",autoComplete:"current-password",required:!0,"aria-label":"Your password",placeholder:"Your password",className:"h-9 w-44 phone:h-11 phone:w-full"}),(0,ze.jsx)(J,{type:"submit",variant:"attention",className:"phone:w-full",children:a})]})}function Eg({action:e,csrf:t,label:a="Build again",className:n}){return(0,ze.jsxs)("form",{method:"post",action:e,"data-rebuild":!0,className:"phone:w-full",children:[(0,ze.jsx)("input",{type:"hidden",name:"csrf",value:t}),(0,ze.jsx)(J,{type:"submit",variant:"attention",className:ee("phone:w-full",n),"data-primary-action":!0,children:a})]})}var Us=j(he(),1);function VM(e){let t=Math.max(0,Math.floor(e/1e3));if(t<10)return"just now";if(t<60)return`${t} s ago`;let a=Math.floor(t/60);return a<60?`${a} min ago`:`${Math.floor(a/60)} h ago`}function GM(e,t){let a=Date.parse(e.at),n=Number.isNaN(a)?0:Math.max(0,t-a);return e.worker==="offline"?{text:`Worker offline · last word ${VM(n)}`,quiet:!0}:n>=3e5?{text:`No word for ${Math.floor(n/6e4)} min`,quiet:!0}:{text:`${e.what} · ${VM(n)}`,quiet:!1}}var Ag=j(fe(),1),Dg="so:workspace-nudge";function zU(e=5e3){let[t,a]=(0,Us.useState)(()=>Date.now());return(0,Us.useEffect)(()=>{let n=window.setInterval(()=>a(Date.now()),e);return()=>window.clearInterval(n)},[e]),t}function uc({activity:e,className:t}){let a=GM(e,zU());return(0,Ag.jsx)("span",{className:ee("block min-w-0 truncate text-[13px]",a.quiet?"font-medium text-warning":"text-muted-foreground",t),"data-activity":a.quiet?"quiet":"fresh",title:a.text,children:(0,Ag.jsx)("time",{dateTime:e.at,children:a.text})})}function $M({people:e}){if(e.length===0)return null;let t=e.length===1?`${e[0]} is also here`:e.length===2?`${e[0]} and ${e[1]} are also here`:`${e[0]} and ${e.length-1} others are also here`;return(0,Ag.jsx)("span",{className:"min-w-0 truncate","data-also-viewing":e.length,role:"status",title:e.join(", "),children:t})}function jM(e){let[t,a]=(0,Us.useState)([]),n=(0,Us.useRef)(e?.at??null);n.current=e?.at??null;let o=e?.href??null;return(0,Us.useEffect)(()=>{if(o===null||typeof EventSource>"u")return;let r=null,s=()=>window.dispatchEvent(new CustomEvent(Dg)),i=()=>{let f=new EventSource(o);r=f,f.addEventListener("change",u=>{try{let d=JSON.parse(u.data).at;(d===null||d!==n.current)&&s()}catch{s()}}),f.addEventListener("reload",s),f.addEventListener("here",u=>{try{let d=JSON.parse(u.data).people;Array.isArray(d)&&a(d.filter(p=>typeof p=="string"))}catch{}}),f.addEventListener("gone",()=>{f.close(),r===f&&(r=null),a([])}),f.addEventListener("error",()=>{f.readyState===EventSource.CLOSED&&(r===f&&(r=null),a([]))})},l=()=>{r?.close(),r=null,a([])},c=()=>{document.hidden?l():r===null&&i()};return document.hidden||i(),document.addEventListener("visibilitychange",c),()=>{document.removeEventListener("visibilitychange",c),l()}},[o]),t}var $=j(fe(),1);function BU(){(0,XM.useEffect)(()=>{let e=()=>{let t=decodeURIComponent(window.location.hash.slice(1)),a=t===""?null:document.getElementById(t);if(a!==null){a.closest("[data-task-details]")!==null&&window.dispatchEvent(new CustomEvent("so:show-details"));for(let n=a;n!==null;n=n.parentElement)n instanceof HTMLDetailsElement&&(n.open=!0);a.scrollIntoView({block:"start"})}};return e(),window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[])}function Vs({html:e,className:t}){return(0,$.jsx)(Yt,{html:e,immutable:!0,...t===void 0?{}:{className:t}})}function Zb({action:e,csrf:t,note:a,variant:n="default"}){return(0,$.jsxs)("form",{method:"post",action:e,"data-retry":!0,className:"flex w-full flex-col gap-1.5",children:[(0,$.jsx)("input",{type:"hidden",name:"csrf",value:t}),(0,$.jsx)("label",{htmlFor:"retry-note",className:"text-[13px] font-medium",children:"What to change next time"}),(0,$.jsxs)("div",{className:"flex flex-wrap items-end gap-2 phone:flex-col phone:items-stretch",children:[(0,$.jsx)(Ot,{id:"retry-note",name:"note",maxLength:FM,rows:1,defaultValue:a??"",placeholder:"Note for the next attempt (optional)","data-retry-note":!0,className:"min-h-9 min-w-0 flex-1 basis-72 resize-none [field-sizing:content] max-h-40 phone:min-h-11 phone:basis-auto"}),(0,$.jsx)(J,{type:"submit",variant:n,className:"phone:w-full","data-primary-action":!0,title:"Keeps the branch and workspace",children:"Retry"})]})]})}function FU({failure:e}){return e.evidence===null&&e.link===null?null:(0,$.jsxs)("p",{className:"mt-1 text-[13px] text-muted-foreground phone:leading-[1.35]","data-failure-evidence":!0,children:[e.evidence!==null&&(0,$.jsx)("span",{className:"[overflow-wrap:anywhere]",children:e.evidence}),e.link!==null&&(0,$.jsxs)($.Fragment,{children:[e.evidence!==null&&" ",(0,$.jsx)("a",{href:e.link.href,"data-failure-log":!0,className:"whitespace-nowrap font-medium text-foreground/80 underline decoration-border underline-offset-4 hover:decoration-muted-foreground phone:-my-3 phone:inline-block phone:py-3",children:e.link.label})]})]})}function HU({stop:e,csrf:t}){return(0,$.jsxs)("form",{method:"post",action:e.action,className:"task-stop-form phone:w-full","data-task-control":"stop","data-control-run":e.run,children:[(0,$.jsx)("input",{type:"hidden",name:"csrf",value:t}),(0,$.jsx)("input",{type:"hidden",name:"run",value:e.run}),(0,$.jsx)("input",{type:"hidden",name:"return",value:"task"}),(0,$.jsx)(J,{type:"submit",variant:"destructive",className:"phone:w-full","data-stop-build":!0,children:"Stop"})]})}function qU({view:e,card:t,csrf:a}){let n=t.status.headline==="Failed",o=e.confirmStopped??null,r=e.rebuild??null,s=e.retry??null,i=e.failure??null,l=e.progress?.stuck??null,c=n&&s!=null&&a!=="";return(0,$.jsxs)(ba,{"data-task-status":!0,"data-work-status":t.token,"data-headline":t.status.headline,"aria-label":"Task status",className:ee(n&&"border-destructive/50"),children:[(0,$.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-3 phone:gap-y-2.5",children:[(0,$.jsxs)("div",{className:"min-w-0 flex-1 basis-64",children:[(0,$.jsx)(Rg,{status:t.status}),(0,$.jsxs)("p",{className:ee("mt-1.5 text-sm phone:mt-1 phone:leading-[1.35]",n||l!==null?"text-foreground":"text-muted-foreground",l!==null&&"flex gap-2"),...n?{"data-failure-reason":""}:{},...e.progress!=null?{"data-build-progress":""}:{},...l!==null?{"data-build-stuck":l.step}:{},children:[l!==null&&(0,$.jsx)(pn,{className:"mt-0.5 size-3.5 shrink-0 text-warning","aria-hidden":"true"}),(0,$.jsx)("span",{className:"[overflow-wrap:anywhere]",children:t.status.sentence})]}),e.activity!=null&&(0,$.jsx)(uc,{activity:e.activity,className:"mt-1"}),e.record!=null&&(0,$.jsx)("p",{className:"mt-1 text-[13px]",children:(0,$.jsx)("a",{href:e.record.href,"data-build-record":!0,className:"text-muted-foreground underline decoration-border underline-offset-4 hover:text-foreground hover:decoration-muted-foreground phone:inline-flex phone:min-h-11 phone:items-center",children:e.record.label})}),n&&i!=null&&(0,$.jsx)(FU,{failure:i}),n&&i!=null&&!c&&(0,$.jsxs)("p",{className:"mt-1 text-[13px] text-muted-foreground","data-failure-suggestion":!0,children:["What to change: ",i.suggestion]})]}),o!=null&&a!==""?(0,$.jsx)(Mg,{form:o,csrf:a,label:t.action?.label??"Confirm it stopped"}):r!=null&&a!==""?(0,$.jsx)(Eg,{action:r.action,csrf:a,label:t.action?.label??"Build again"}):c?null:l?.action!=null||e.stop!=null?(0,$.jsxs)("div",{className:"flex flex-wrap items-center gap-2 phone:w-full phone:flex-col phone:items-stretch",children:[l?.action!=null?(0,$.jsx)(J,{asChild:!0,variant:"outline",className:"phone:w-full",children:(0,$.jsx)("a",{href:l.action.href,"data-stuck-action":!0,children:l.action.label})}):t.action!==null&&(0,$.jsx)(J,{asChild:!0,variant:"outline",className:"phone:w-full",children:(0,$.jsxs)("a",{href:t.action.href,"data-primary-action":!0,children:[t.action.label,(0,$.jsx)(Cs,{})]})}),e.stop!=null&&a!==""&&(0,$.jsx)(HU,{stop:e.stop,csrf:a})]}):t.action!==null&&(0,$.jsx)(J,{asChild:!0,variant:t.status.headline==="Needs you"?"attention":"default",className:"phone:w-full",children:(0,$.jsxs)("a",{href:t.action.href,"data-primary-action":!0,...t.action.openResult?{"data-open-result":""}:{},children:[t.action.label,(0,$.jsx)(Cs,{})]})})]}),c&&(0,$.jsx)(Zb,{action:s.action,csrf:a,note:s.note??i?.suggestion}),(0,$.jsx)(Tg,{status:t.status,runChecks:e.runChecks??null,csrf:a}),(t.notices!==null||t.reasons.length>0||t.diagnostics.length>0||t.status.why.length>0||t.status.details.some(f=>f.why!==null))&&(0,$.jsxs)("div",{className:"flex flex-col gap-1 border-t border-border pt-3 text-[13px] phone:pt-2 phone:leading-[1.35]",children:[(0,$.jsx)(UM,{status:t.status,extra:[...t.reasons,...t.diagnostics.map(f=>`${f.label} · ${f.detail}`)]}),t.notices!==null&&(0,$.jsx)(Kb,{summary:t.notices.summary,quiet:!0,children:t.notices.lines.map(f=>(0,$.jsx)("p",{className:"text-muted-foreground",children:f},f))})]}),e.earlier!=null&&(0,$.jsx)("div",{className:"border-t border-border pt-1 text-[13px]","data-earlier-attempts":e.earlier.attempts.length,children:(0,$.jsx)(Kb,{summary:e.earlier.summary,quiet:!0,children:(0,$.jsx)("ul",{className:"flex flex-col gap-1.5",children:e.earlier.attempts.map(f=>(0,$.jsxs)("li",{className:"text-muted-foreground",children:[(0,$.jsx)("a",{href:f.href,className:"font-medium text-foreground/80 underline decoration-border underline-offset-4 hover:decoration-muted-foreground phone:inline-flex phone:min-h-11 phone:items-center",children:f.label}),f.text!==null&&(0,$.jsxs)($.Fragment,{children:[" · ",f.text]})]},f.href))})})})]})}function Kb({summary:e,quiet:t,children:a}){return(0,$.jsxs)("details",{className:"group",children:[(0,$.jsxs)("summary",{className:ee("flex cursor-pointer list-none items-center gap-1.5 py-1.5 font-medium phone:min-h-11 [&::-webkit-details-marker]:hidden",t&&"text-muted-foreground hover:text-foreground"),children:[(0,$.jsx)(ra,{className:"size-4 transition-transform group-open:rotate-90","aria-hidden":"true"}),e]}),(0,$.jsx)("div",{className:"pb-2 pl-5.5 pt-1",children:a})]})}function UU({fact:e}){return(0,$.jsx)($.Fragment,{children:e.parts.map((t,a)=>typeof t=="string"?(0,$.jsx)("span",{children:t},a):"at"in t?(0,$.jsx)("time",{dateTime:t.at,title:cc(t.at),className:"tabular-nums",children:xn(t.at)},a):"seal"in t?(0,$.jsx)("code",{className:"mr-1 rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:t.seal},a):(0,$.jsx)("a",{href:t.href,className:"font-medium underline decoration-border underline-offset-4 hover:decoration-muted-foreground phone:relative phone:z-[1] phone:-my-3 phone:inline-flex phone:min-h-11 phone:items-center",children:t.label},a))})}function VU({section:e}){return(0,$.jsxs)("details",{id:e.id,open:e.open,className:"group scroll-mt-4","data-task-section":e.id,children:[(0,$.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-5 py-3.5 hover:bg-accent/50 phone:min-h-11 phone:px-3.5 phone:py-2 [&::-webkit-details-marker]:hidden",children:[(0,$.jsx)(ra,{className:"size-4 text-muted-foreground transition-transform group-open:rotate-90","aria-hidden":"true"}),(0,$.jsx)("h2",{className:"text-[15px] font-semibold",children:e.title}),e.count!==null&&e.count>0&&(0,$.jsx)(ya,{children:e.count})]}),(0,$.jsx)("div",{className:"px-5 pb-5 pt-1 phone:px-3.5 phone:pb-3.5 phone:pt-0",children:(0,$.jsx)(Vs,{html:e.html,className:"so-task-fold"})})]})}function WM({sections:e,label:t}){return e.length===0?null:(0,$.jsx)(ba,{"aria-label":t,className:"gap-0 divide-y divide-border overflow-hidden p-0 phone:p-0",children:e.map(a=>(0,$.jsx)(VU,{section:a},a.id))})}function xn(e,t=new Date){return Number.isNaN(new Date(e).getTime())?"":Gu(e,t,Gi())}var cc=e=>Hh(e,Gi());function GU({item:e}){let t=e.kind==="result"&&/failed|refused|never finished/i.test(e.title),a=e.kind==="filed"?(0,$.jsx)(Ls,{className:"size-3.5 text-muted-foreground"}):e.kind==="plan"?(0,$.jsx)(eo,{className:"size-3.5 text-muted-foreground"}):e.kind==="progress"?(0,$.jsx)(zi,{className:"size-3.5 text-info"}):e.kind==="question"?(0,$.jsx)(Ns,{className:"size-3.5 text-muted-foreground"}):e.kind==="result"?t?(0,$.jsx)(Et,{className:"size-3.5 text-destructive"}):(0,$.jsx)($a,{className:"size-3.5 text-success"}):(0,$.jsx)("span",{className:"size-1.5 rounded-full bg-muted-foreground"});return(0,$.jsx)("span",{"aria-hidden":"true",className:"relative z-[1] flex size-6 shrink-0 items-center justify-center rounded-full border border-border bg-card",children:a})}function $U({item:e}){return(0,$.jsxs)("li",{"data-thread-entry":e.key,"data-thread-kind":e.kind,className:"so-thread-entry relative flex gap-3",children:[(0,$.jsx)(GU,{item:e}),(0,$.jsxs)("div",{className:"min-w-0 flex-1 pb-5 phone:pb-4",children:[(0,$.jsxs)("p",{className:"flex min-h-6 flex-wrap items-baseline gap-x-2 text-[13px] leading-6",children:[(0,$.jsx)("span",{className:"font-medium text-foreground",children:e.title}),e.author!==""&&(0,$.jsx)("span",{className:"text-muted-foreground",children:e.author}),(0,$.jsx)("time",{dateTime:e.at,title:cc(e.at),className:"ml-auto text-xs tabular-nums text-muted-foreground",children:xn(e.at)})]}),e.text!==null&&e.text.trim()!==""&&(0,$.jsx)("p",{className:ee("mt-1 whitespace-pre-line text-sm leading-relaxed [overflow-wrap:anywhere]",e.who==="person"&&"w-fit max-w-full rounded-xl bg-[var(--so-user-bubble)] px-3 py-2"),children:e.text}),e.link!==null&&(0,$.jsx)("a",{href:e.link.href,className:"mt-1 inline-flex text-[13px] font-medium underline decoration-border underline-offset-4 hover:decoration-muted-foreground phone:min-h-11 phone:items-center",children:e.link.label}),e.html!==""&&(0,$.jsx)("div",{className:"mt-2",children:(0,$.jsx)(Vs,{html:e.html,className:"so-thread-card"})}),e.more!==null&&(0,$.jsx)("div",{className:"mt-1 text-[13px]",children:(0,$.jsx)(Kb,{summary:e.more.summary,quiet:!0,children:(0,$.jsx)(Vs,{html:e.more.html,className:"so-thread-card"})})})]})]})}function jU({items:e,chat:t,chatHref:a}){let n=[...e.map(o=>({key:`item-${o.key}`,at:o.at,node:(0,$.jsx)($U,{item:o},`item-${o.key}`)})),...t?.entries??[]].sort((o,r)=>o.at===r.at?0:o.at<r.at?-1:1);return(0,$.jsxs)("section",{"aria-label":"Thread","data-task-thread":!0,...t===null?{}:{"data-workspace-chat":""},className:"flex flex-col",children:[(0,$.jsx)("ol",{className:"so-thread relative flex flex-col",children:n.map(o=>o.node)}),t!==null?t.footer:a!==null&&(0,$.jsxs)("p",{className:"border-t border-border pt-3 text-[13px] text-muted-foreground",children:[(0,$.jsx)("a",{href:a,className:"font-medium text-foreground underline decoration-border underline-offset-4 phone:inline-flex phone:min-h-11 phone:items-center",children:"Message the agent"})," from Chat."]})]})}function WU({facts:e}){return(0,$.jsx)("dl",{className:"grid grid-cols-[8.25rem_minmax(0,1fr)] gap-x-3 gap-y-2.5 text-[13px] phone:gap-y-2",children:e.map(t=>(0,$.jsxs)("div",{className:"contents","data-detail-fact":t.label,children:[(0,$.jsx)("dt",{className:"text-muted-foreground",children:t.label}),(0,$.jsx)("dd",{className:"min-w-0 leading-snug [overflow-wrap:anywhere]",children:(0,$.jsx)(UU,{fact:t})})]},t.label))})}function _g({view:e}){let t=(e.details??[]).filter(o=>o.facts.length>0),a=e.status,n=a!==null&&(a.attempts.length>1||a.lead!==null)?a:null;return(0,$.jsxs)("div",{className:"flex flex-col gap-5 px-5 py-4 phone:gap-4 phone:px-4","data-task-details":!0,children:[t.map(o=>(0,$.jsxs)("section",{"aria-labelledby":`details-${o.title}`,className:"flex flex-col gap-2.5","data-detail-group":o.title,children:[(0,$.jsx)("h2",{id:`details-${o.title}`,className:"text-[12px] font-medium text-muted-foreground",children:o.title}),(0,$.jsx)(WU,{facts:o.facts})]},o.title)),n!==null&&(0,$.jsxs)("section",{"aria-labelledby":"details-attempts",className:"flex flex-col gap-2 border-t border-border pt-4 text-[13px]",children:[(0,$.jsxs)("h2",{id:"details-attempts",className:"flex items-center gap-1.5 text-[12px] font-medium text-muted-foreground",children:["Attempts ",(0,$.jsx)(ya,{children:n.attempts.length})]}),(0,$.jsx)("ol",{className:"flex flex-col gap-2",children:n.attempts.map(o=>(0,$.jsxs)("li",{"data-attempt-task":o.taskId,children:[(0,$.jsx)("a",{href:o.href,className:"font-medium hover:underline hover:underline-offset-4 phone:inline-flex phone:min-h-11 phone:items-center",children:o.label}),o.runId!==null&&(0,$.jsxs)($.Fragment,{children:[" · ",(0,$.jsxs)("a",{href:`/r/${o.runId}`,className:"text-muted-foreground hover:underline",children:["Run #",o.runId]})]}),o.detail!==null&&(0,$.jsx)("p",{className:"text-muted-foreground",children:o.detail})]},o.taskId))}),n.lead!==null&&(0,$.jsxs)("p",{className:"text-muted-foreground",children:["Lead: ",n.lead.label,n.lead.active?"":" · access ended"]})]}),(0,$.jsx)(WM,{sections:e.sections,label:"Task details"}),(e.manage.length>0||e.cancel!==null||e.everyTime)&&(0,$.jsxs)("section",{"aria-labelledby":"task-manage",className:"flex flex-col gap-3 phone:gap-2",children:[(0,$.jsx)("h2",{id:"task-manage",className:"text-[12px] font-medium text-muted-foreground",children:"Manage"}),(0,$.jsx)(WM,{sections:e.manage,label:"Manage"}),e.everyTime&&(0,$.jsxs)("a",{href:e.everyTime.href,"data-every-time":!0,className:"flex min-h-12 items-center gap-2 rounded-lg border border-border bg-card px-4 text-[14px] font-semibold transition-colors hover:bg-accent",children:[(0,$.jsx)(qi,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),"Do this every time…",(0,$.jsx)("span",{className:"ml-auto truncate pl-3 text-[12px] font-normal text-muted-foreground",children:e.everyTime.starter})]}),e.cancel!==null&&(0,$.jsxs)("details",{open:e.cancel.open,className:"group rounded-lg border border-destructive/30 bg-card","data-task-section":"cancel",children:[(0,$.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-4 py-3 text-[14px] font-semibold text-destructive phone:min-h-11 phone:px-3.5 phone:py-2 [&::-webkit-details-marker]:hidden",children:[(0,$.jsx)(ra,{className:"size-4 transition-transform group-open:rotate-90","aria-hidden":"true"}),"Cancel task"]}),(0,$.jsx)("div",{className:"px-4 pb-4 pt-1 phone:px-3.5 phone:pb-3.5 phone:pt-0",children:(0,$.jsx)(Vs,{html:e.cancel.html,className:"so-task-cancel"})})]})]})]})}function YM({view:e,chat:t=null,details:a=!0,csrf:n=""}){BU();let o=jM(e.live);return(0,$.jsxs)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 phone:gap-3",children:[(0,$.jsxs)("header",{className:"flex flex-col gap-3 pb-1 phone:gap-2 phone:pb-0",children:[(0,$.jsxs)("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-3 phone:gap-y-2",children:[(0,$.jsxs)("div",{className:"min-w-0 flex-1 basis-72",children:[(0,$.jsx)("h1",{className:"text-[26px] font-semibold leading-tight tracking-tight phone:text-[22px]",children:e.title}),(0,$.jsxs)("p",{className:"mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[13px] text-muted-foreground phone:mt-0.5",children:[e.project!==null&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("span",{className:"font-medium text-foreground/80",children:e.project}),(0,$.jsx)("span",{"aria-hidden":"true",children:"·"})]}),(0,$.jsx)("span",{className:"min-w-0 truncate font-mono text-xs",children:e.id}),e.scout&&(0,$.jsx)(ya,{tone:"info",children:"Scout"}),o.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,$.jsx)($M,{people:o})]})]})]}),e.tabs.length>0&&(0,$.jsx)("nav",{"aria-label":"Task view",children:(0,$.jsx)("ul",{className:"inline-flex h-10 items-center gap-1 rounded-lg bg-muted p-1 phone:h-[52px]",children:e.tabs.map(r=>(0,$.jsx)("li",{className:"h-full",children:(0,$.jsx)("a",{href:r.href,"aria-current":r.active?"page":void 0,className:ee("inline-flex h-full items-center rounded-md px-3.5 text-sm font-semibold text-muted-foreground transition-colors hover:text-foreground",r.active&&"bg-card text-foreground shadow-sm"),children:r.label})},r.href))})})]}),e.version!==null&&(0,$.jsxs)("p",{className:"rounded-md bg-info-soft px-3 py-2 text-[13px] text-info",children:[e.version.label," · ",(0,$.jsx)("a",{href:e.version.current.href,className:"font-semibold underline underline-offset-4",children:e.version.current.label})]})]}),e.journey!=null&&(0,$.jsx)(PM,{steps:e.journey}),e.status!==null?(0,$.jsx)(qU,{view:e,card:e.status,csrf:n}):(0,$.jsx)(Vs,{html:e.statusHtml}),e.approval!==""&&(0,$.jsx)(Vs,{html:e.approval,className:"so-task-approval"}),e.lead.map(r=>(0,$.jsx)(Vs,{html:r.html,className:`so-task-lead so-task-lead--${r.key}`},r.key)),e.questions!==""&&(0,$.jsx)(ba,{children:(0,$.jsx)(Vs,{html:e.questions,className:"so-task-questions"})}),(0,$.jsx)("div",{className:"mt-2 phone:mt-1",children:(0,$.jsx)(jU,{items:e.thread??[],chat:t,chatHref:e.tabs.length>0?null:e.chatHref??null})}),a&&(0,$.jsx)("div",{className:"border-t border-border pt-2",children:(0,$.jsx)(_g,{view:e})})]})}var ye=j(fe(),1);function Qb({csrf:e,path:t,destination:a,children:n,className:o}){return(0,ye.jsxs)("form",{method:"post",action:"/projects/open",className:ee("inline-flex",o),children:[(0,ye.jsx)("input",{type:"hidden",name:"csrf",value:e}),(0,ye.jsx)("input",{type:"hidden",name:"path",value:t}),(0,ye.jsx)("input",{type:"hidden",name:"return",value:a}),n]})}function XU(e){let t=xn(e);return t===""?"":/^\d/.test(t)?"Opened today":t.startsWith("Yesterday")?"Opened yesterday":`Opened ${t}`}function YU({row:e,csrf:t,returnTo:a,choosing:n}){return(0,ye.jsxs)("li",{className:ee("flex items-center gap-x-4 px-2 py-3 phone:grid phone:grid-cols-[minmax(0,1fr)_auto] phone:gap-x-2 phone:py-1.5",e.open&&"bg-accent/40"),"data-project":e.path,children:[(0,ye.jsx)(Hu,{className:"size-4 shrink-0 text-muted-foreground phone:hidden","aria-hidden":"true"}),(0,ye.jsxs)("div",{className:"min-w-0 flex-1 phone:contents",children:[(0,ye.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 phone:contents",children:[e.open?(0,ye.jsx)("a",{href:a,className:"font-semibold hover:underline hover:underline-offset-4 phone:col-start-1 phone:row-start-1 phone:-my-3 phone:justify-self-start phone:py-3 phone:leading-5",children:e.name}):(0,ye.jsx)(Qb,{csrf:t,path:e.path,destination:a,className:"phone:col-start-1 phone:row-start-1 phone:justify-self-start",children:(0,ye.jsx)("button",{type:"submit",className:"text-left font-semibold hover:underline hover:underline-offset-4 phone:-my-3 phone:py-3 phone:leading-5",children:e.name})}),(0,ye.jsx)("span",{className:"contents phone:col-span-full phone:row-start-2 phone:flex phone:flex-wrap phone:items-center phone:gap-x-2 phone:pointer-events-none phone:gap-y-[26px] phone:pt-3.5 phone:empty:hidden",children:e.peek?.map(o=>e.open?(0,ye.jsx)("a",{href:o.href,className:"inline-flex phone:pointer-events-auto phone:-my-3 phone:py-3",children:(0,ye.jsx)("span",{className:$h({tone:o.tone}),children:o.label})},o.label):(0,ye.jsx)(Qb,{csrf:t,path:e.path,destination:o.href,children:(0,ye.jsx)("button",{type:"submit",className:"inline-flex phone:pointer-events-auto phone:-my-3 phone:py-3",children:(0,ye.jsx)("span",{className:$h({tone:o.tone}),children:o.label})})},o.label))})]}),(0,ye.jsxs)("p",{className:"mt-0.5 truncate text-[13px] text-muted-foreground phone:pointer-events-none phone:col-span-full phone:row-start-3 phone:mt-1.5 phone:leading-[1.35]",title:e.path,children:[(0,ye.jsx)("span",{className:"font-mono text-xs",children:e.shortPath}),e.openedAt!==null&&(0,ye.jsxs)(ye.Fragment,{children:[" · ",XU(e.openedAt)]}),e.peek===null&&(0,ye.jsx)(ye.Fragment,{children:" · Not scanned"})]})]}),(0,ye.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5 phone:col-start-2 phone:row-start-1",children:[(0,ye.jsx)(J,{asChild:!0,variant:"ghost",size:"sm",className:"phone:w-11 phone:px-0",children:(0,ye.jsxs)("a",{href:e.knowledgeHref,"aria-label":`${e.name} knowledge`,children:[(0,ye.jsx)(Pi,{}),(0,ye.jsx)("span",{className:"phone:sr-only",children:"Knowledge"})]})}),e.checks&&(0,ye.jsx)(J,{asChild:!0,variant:"ghost",size:"sm",className:"phone:w-11 phone:px-0",children:(0,ye.jsxs)("a",{href:e.checks.href,"aria-label":`${e.name} checks: ${e.checks.level}`,children:[(0,ye.jsx)(eo,{}),(0,ye.jsxs)("span",{className:"phone:sr-only",children:["Checks · ",e.checks.level]})]})}),e.pullRequests&&(0,ye.jsx)(J,{asChild:!0,variant:"ghost",size:"sm",className:"phone:w-11 phone:px-0",children:(0,ye.jsxs)("a",{href:e.pullRequests.href,"aria-label":`${e.name} pull requests: ${e.pullRequests.on?"on":"off"}`,children:[(0,ye.jsx)(Is,{}),(0,ye.jsxs)("span",{className:"phone:sr-only",children:["Pull requests",e.pullRequests.on?"":" · Off"]})]})}),e.open?(0,ye.jsx)(ya,{tone:"success",children:"Open now"}):(0,ye.jsx)(Qb,{csrf:t,path:e.path,destination:a,children:(0,ye.jsx)(J,{type:"submit",variant:"outline",size:"sm",children:n?"Choose":"Open"})})]})]})}function KM({label:e,rows:t,...a}){return t.length===0?null:(0,ye.jsxs)("section",{"aria-label":e,className:"flex flex-col gap-2",children:[(0,ye.jsx)("h2",{className:"text-sm font-semibold text-muted-foreground",children:e}),(0,ye.jsx)("div",{className:"border-y border-border",children:(0,ye.jsx)("ul",{className:"divide-y divide-border",children:t.map(n=>(0,ye.jsx)(YU,{row:n,...a},n.path))})})]})}function ZM({view:e,csrf:t}){let a={csrf:t,returnTo:e.returnTo,choosing:e.choosing},n=e.recent.length===0&&e.available.length===0;return(0,ye.jsxs)("div",{className:"flex w-full flex-col gap-5 phone:gap-3",children:[(0,ye.jsxs)("header",{className:"flex flex-wrap items-center gap-3",children:[(0,ye.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,ye.jsx)("h1",{className:"text-[26px] font-semibold leading-tight tracking-tight phone:text-[22px]",children:e.choosing?"New task":"Projects"}),e.choosing&&(0,ye.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose the project it belongs to."})]}),!n&&(0,ye.jsx)(J,{asChild:!0,variant:"outline",size:"sm",children:(0,ye.jsxs)("a",{href:"#add-project",children:[(0,ye.jsx)(Xt,{}),"Add project"]})})]}),e.problem!==null&&(0,ye.jsx)("p",{role:"alert",className:"rounded-md bg-destructive-soft px-3 py-2 text-sm text-destructive",children:e.problem}),(0,ye.jsx)(KM,{label:"Recent",rows:e.recent,...a}),(0,ye.jsx)(KM,{label:"Available",rows:e.available,...a}),(0,ye.jsxs)("section",{id:"add-project",className:"flex scroll-mt-4 flex-col gap-3 border-t border-border pt-5 phone:gap-2 phone:pt-3",children:[(0,ye.jsx)("h2",{className:"text-base font-semibold",children:n?"Add your first project":"Add a project"}),(e.add.browse!==null||e.add.github!==null)&&(0,ye.jsxs)("div",{className:"flex flex-wrap gap-2",children:[e.add.browse!==null&&(0,ye.jsx)(J,{asChild:!0,variant:"outline",children:(0,ye.jsxs)("a",{href:e.add.browse,children:[(0,ye.jsx)(Hu,{}),"Choose a folder"]})}),e.add.github!==null&&(0,ye.jsx)(J,{asChild:!0,variant:"outline",children:(0,ye.jsxs)("a",{href:e.add.github,children:[(0,ye.jsx)(of,{}),"Add from GitHub"]})})]}),(0,ye.jsx)(Yt,{html:e.add.html,immutable:!0,className:"so-project-add"})]})]})}var Jb=j(he(),1);var Pg="Accepting needs a reason";function QM(e){let t=e.canRequest?"request-changes":null,a=e.accept===null?null:"accept";if(e.failed!=null){let n=e.runChecks&&!e.checksRunning?"run-checks":e.checksRunning?"checks-running":null,o=e.failed.acceptAnyway===!0?"accept-anyway":null;return e.failed.retry?{primary:"retry",secondary:o??n,line:null}:{primary:n,secondary:o,line:null}}return e.need!==null?{primary:e.need,secondary:t,line:null}:e.next!==null?{primary:e.next,secondary:a??t,line:null}:e.blocked!==null?{primary:t,secondary:a,line:e.blocked}:a!==null&&(e.unanswered??0)>0?{primary:"next-check",secondary:a,line:null}:a!==null&&(e.notRight??0)>0?{primary:t,secondary:a,line:null}:e.checksRunning?{primary:"checks-running",secondary:a??t,line:null}:e.accept===null?{primary:null,secondary:t,line:null}:e.accept.ready?{primary:"accept",secondary:t,line:null}:e.runChecks?{primary:"run-checks",secondary:"accept",line:null}:{primary:"accept",secondary:t,line:null}}function JM(e,t){let a=n=>`“${n[0].replace(/[.!?]+$/,"")}”${n.length>1?` and ${n.length-1} more`:""}`;return t.unanswered.length>0?{label:"Accept without your check",ready:!1,why:`Not checked yet: ${a(t.unanswered)}.`}:t.notRight.length>0?{label:"Accept anyway",ready:!1,why:`You marked ${a(t.notRight)} not right.`}:e}function eE(e,t,a){let n=e.met+t,o=Math.max(0,e.yours-t-a);return{text:`${n} of ${e.total} met${o>0?` · You check ${o}`:""}`,done:n===e.total,short:e.total-n-o>0}}function Og(e){switch(e){case"attention":return"attention";case"problem":return"danger";case"live":return"info";case"ready":case"done":return"success";default:return"neutral"}}var B=j(fe(),1),ew={attention:"bg-attention",danger:"bg-destructive",info:"bg-info",success:"bg-success",neutral:"bg-muted-foreground",warning:"bg-warning"};function cl({html:e,className:t}){return(0,B.jsx)(Yt,{html:e,immutable:!0,...t===void 0?{}:{className:t}})}var tw=e=>xn(e);function KU({view:e}){return e.results.length===0?null:(0,B.jsxs)(oc,{children:[(0,B.jsx)(rc,{asChild:!0,children:(0,B.jsxs)(J,{variant:"outline",size:"sm",children:["Results ",(0,B.jsx)("span",{className:"rounded-full bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:e.results.length}),e.attention>0&&(0,B.jsx)("span",{className:"rounded-full bg-attention px-1.5 text-xs tabular-nums text-on-attention",title:`${e.attention} need your attention`,children:e.attention}),(0,B.jsx)(jo,{})]})}),(0,B.jsxs)(sc,{align:"end",className:"max-h-[70vh] w-80 overflow-y-auto",children:[e.attention>0&&(0,B.jsxs)(qb,{className:"text-xs text-attention",children:[e.attention," need",e.attention===1?"s":""," your attention"]}),e.results.map(t=>(0,B.jsx)(ic,{asChild:!0,children:(0,B.jsxs)("a",{href:t.href,"aria-current":t.current?"page":void 0,className:ee("flex items-start gap-2.5",t.current&&"bg-accent"),children:[(0,B.jsx)("span",{"aria-hidden":"true",className:ee("mt-1.5 size-2 shrink-0 rounded-full",t.status===null?"bg-muted-foreground":ew[Og(t.status.tone)])}),(0,B.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,B.jsx)("span",{className:ee("block truncate",t.needsYou?"font-semibold":"font-medium"),children:t.title}),(0,B.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:[t.status?.label,...t.notes,tw(t.at)].filter(Boolean).join(" · ")})]})]})},t.href)),e.capped!==null&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(LM,{}),(0,B.jsxs)(qb,{className:"text-xs font-normal text-muted-foreground",children:["Showing the newest ",e.capped,"; older results open from their task."]})]})]})]})}function ZU({headline:e}){return(0,B.jsxs)("h2",{className:"flex items-center gap-2.5 text-lg font-semibold leading-snug","data-mismatch-headline":!0,children:[(0,B.jsx)("span",{"aria-hidden":"true",className:"size-2.5 shrink-0 rounded-full bg-warning"}),e]})}function QU({selected:e,acts:t,answers:a}){let{panel:n,checks:o}=e,r=g=>{if(g===null)return!1;let v=new URL(g,window.location.origin);return v.pathname==="/review"&&v.searchParams.get("result")===e.taskId&&!v.searchParams.has("tab")&&v.hash===""},s=n?.requirements==null||n.youCheck==null?null:eE(n.requirements,[...a.values()].filter(g=>g==="right").length,[...a.values()].filter(g=>g==="not-right").length),i=n?.status==null?null:{...n.status,details:n.status.details.map(g=>{let v=s!==null&&g.key==="requirements"&&g.text!=="Unverified"?{...g,text:s.text,mark:s.done?"ok":s.short?g.mark==="ok"?"note":g.mark:"none"}:g;return v.action!==null&&r(v.action.href)?{...v,action:null}:v})},l=Og(e.status.tone),c=t.primary==="rebuild"||t.primary==="confirm-stopped",f=e.noRun??(n!==null&&!c?n.outcome:i?.sentence??n?.outcome??""),u=e.mismatch,d=[...new Set([...i===null&&o?.problem===!0?[o.detail]:[],...e.problem===null?[]:[e.problem],...n?.attention??[]])].filter(g=>u===null||!u.said.includes(g)),p=i?.headline==="Failed";return(0,B.jsxs)(ba,{"data-result-status":e.status.token,"data-headline":i?.headline??e.status.label,"aria-label":"Result status",children:[(0,B.jsxs)("div",{className:"min-w-0",children:[u?.headline!=null?(0,B.jsx)(ZU,{headline:u.headline}):i!==null?(0,B.jsx)(Rg,{status:i}):(0,B.jsxs)("h2",{className:"flex items-center gap-2.5 text-lg font-semibold leading-snug",children:[(0,B.jsx)("span",{"aria-hidden":"true",className:ee("size-2.5 shrink-0 rounded-full",ew[l])}),e.status.label]}),f!==""&&(0,B.jsx)("p",{className:ee("mt-1.5 max-w-[75ch] text-sm",e.failure!=null?"text-foreground":"text-muted-foreground"),"data-result-sentence":!0,...e.failure!=null?{"data-failure-reason":""}:{},children:f}),e.failure!=null&&(e.failure.evidence!==null||e.failure.link!==null)&&(0,B.jsxs)("p",{className:"mt-1 max-w-[75ch] text-[13px] text-muted-foreground","data-failure-evidence":!0,children:[e.failure.evidence!==null&&(0,B.jsx)("span",{className:"[overflow-wrap:anywhere]",children:e.failure.evidence}),e.failure.link!==null&&(0,B.jsxs)(B.Fragment,{children:[e.failure.evidence!==null&&" ",(0,B.jsx)("a",{href:e.failure.link.href,"data-failure-log":!0,className:dc,children:e.failure.link.label})]})]})]}),u!==null&&u.rows.length>0&&(0,B.jsx)("ul",{"aria-label":"What doesn't match",className:"flex flex-col gap-1.5 border-t border-border pt-3 text-[13px] phone:pt-2","data-mismatches":u.rows.length,children:u.rows.map((g,v)=>(0,B.jsxs)("li",{"data-mismatch":!0,className:"flex gap-2",children:[(0,B.jsx)(pn,{className:"mt-0.5 size-3.5 shrink-0 text-warning","aria-hidden":"true"}),(0,B.jsxs)("span",{className:"min-w-0 [overflow-wrap:anywhere]",children:[g.text,g.path!==null&&g.absent&&(0,B.jsxs)(B.Fragment,{children:[" ",(0,B.jsx)("code",{className:"font-mono text-xs",children:g.path})," ",(0,B.jsx)("span",{className:"text-muted-foreground","data-mismatch-absent":!0,children:"— not in the saved changes"})]}),g.href!==null&&(g.path!==null||g.noteLabel!==null)&&(0,B.jsxs)(B.Fragment,{children:[" · ",(0,B.jsx)("a",{href:g.href,"data-mismatch-lines":!0,className:ee("font-medium text-foreground/80 underline decoration-border underline-offset-4 hover:decoration-muted-foreground phone:-my-3 phone:inline-block phone:py-3",g.path!==null&&"font-mono text-xs"),children:g.path!==null?`${g.path}${g.lines===null?"":`, ${g.lines}`}`:g.noteLabel})]})]})]},v))}),i!==null&&(0,B.jsx)(Tg,{status:i}),d.length>0&&(0,B.jsx)("ul",{className:"flex flex-col gap-1 text-[13px]","aria-label":"Caveats","data-result-attention":d.length,children:d.map(g=>(0,B.jsxs)("li",{"data-caveat":!0,className:"flex gap-2",children:[(0,B.jsx)(pn,{className:ee("mt-0.5 size-3.5 shrink-0",p?"text-destructive":"text-warning"),"aria-hidden":"true"}),(0,B.jsx)("span",{className:"min-w-0 [overflow-wrap:anywhere]",children:g})]},g))})]})}function JU(e){let t=document.getElementById("comment-form"),a=t?.querySelector("textarea[name=note]")??null,n=t?.closest("details")??null;if(n!==null&&!n.open&&(n.open=!0),a===null){window.location.hash="request-changes";return}let o=`Not right: “${e}” — `;a.value.includes(o)||(a.value=a.value.trim()===""?o:`${a.value.trimEnd()}
52
52
 
53
- ${o}`),a.dispatchEvent(new Event("input",{bubbles:!0})),a.scrollIntoView({block:"center",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),a.focus(),a.setSelectionRange(a.value.length,a.value.length)}function eV({excerpt:e,changesHref:t}){return(0,B.jsxs)("figure",{className:"overflow-hidden rounded-md border border-border","data-check-excerpt":e.path,children:[(0,B.jsxs)("figcaption",{className:"flex flex-wrap items-baseline gap-x-2 border-b border-border bg-muted px-3 py-1.5 text-xs text-muted-foreground",children:[(0,B.jsx)("span",{className:"font-mono text-foreground [overflow-wrap:anywhere]",children:e.path}),!e.cited&&(0,B.jsx)("span",{children:"first changed file"})]}),(0,B.jsx)("ol",{className:"font-mono text-xs leading-relaxed",children:e.lines.map((a,n)=>(0,B.jsxs)("li",{"data-kind":a.kind,className:ee("grid grid-cols-[2.5rem_1rem_minmax(0,1fr)] px-1 py-0.5",a.kind==="addition"?"bg-success-soft":a.kind==="deletion"?"bg-destructive-soft":""),children:[(0,B.jsx)("span",{className:"select-none pr-2 text-right text-muted-foreground tabular-nums",children:a.line??""}),(0,B.jsx)("span",{"aria-hidden":"true",className:"select-none text-muted-foreground",children:a.kind==="addition"?"+":a.kind==="deletion"?"−":" "}),(0,B.jsxs)("code",{className:"whitespace-pre-wrap rounded-none bg-transparent p-0 font-mono text-xs text-foreground [overflow-wrap:anywhere]",children:[(0,B.jsx)("span",{className:"sr-only",children:a.kind==="addition"?"Added: ":a.kind==="deletion"?"Removed: ":""}),a.text]})]},n))}),e.more>0&&(0,B.jsxs)("p",{className:"border-t border-border px-3 py-1.5 text-xs text-muted-foreground",children:[e.more," more changed line",e.more===1?"":"s",t===null?"":(0,B.jsxs)(B.Fragment,{children:[" in ",(0,B.jsx)("a",{href:t,"data-result-goto":"changes",className:"underline underline-offset-4",children:"Changes"})]})]})]})}function tE(e){let t=e?.youCheck??null;return t==null?[]:t.items.length>0?t.items:t.lines.map((a,n)=>({id:`line-${n}`,statement:"",words:a,note:null,excerpts:[],shots:[]}))}var zg=e=>e.statement===""?e.words:e.statement;function tV(e){let t=document.querySelector(`[data-check-item="${CSS.escape(e)}"]`);t!==null&&(t.scrollIntoView({block:"center",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),t.querySelector("[data-looks-right]")?.focus({preventScroll:!0}))}function aV({panel:e,chatHref:t,answers:a,answer:n}){let o=tE(e),r=e.tabs.find(s=>s.key==="changes")?.href??null;return(0,B.jsxs)(ba,{"aria-labelledby":"you-check-title","data-result-you-check":o.length,className:"gap-0 p-0 phone:gap-0 phone:p-0",children:[(0,B.jsx)("h2",{id:"you-check-title",className:"px-5 pb-1 pt-4 text-[15px] font-semibold phone:px-4",children:o.length===1?"You check this one":`You check these ${o.length}`}),(0,B.jsx)("ul",{className:"divide-y divide-border",children:o.map(s=>{let i=a.get(s.id)??null;return(0,B.jsxs)("li",{"data-check-item":s.id,"data-looks-right":i==="right"?"1":void 0,"data-not-right":i==="not-right"?"1":void 0,className:"flex scroll-mt-4 flex-col gap-3 px-5 py-4 phone:px-4",children:[(0,B.jsx)("p",{className:"max-w-[75ch] text-sm font-medium",children:zg(s)}),s.note!==null&&(0,B.jsxs)("p",{className:"max-w-[75ch] text-[13px] text-muted-foreground",children:["The agent says: ",s.note]}),s.excerpts.map(l=>(0,B.jsx)(eV,{excerpt:l,changesHref:r},l.path)),s.shots.length>0&&(0,B.jsx)("ul",{className:"flex flex-wrap gap-2","aria-label":"Screenshots",children:s.shots.map(l=>(0,B.jsx)("li",{children:(0,B.jsx)("a",{href:l.href,className:"block overflow-hidden rounded-md border border-border hover:border-muted-foreground",title:l.caption,children:(0,B.jsx)("img",{src:l.src,alt:l.caption,loading:"lazy",className:"h-24 w-auto max-w-[12rem] object-cover phone:h-20"})})},l.src))}),(0,B.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,B.jsxs)(J,{variant:"outline","aria-pressed":i==="right",className:"min-h-11 aria-pressed:bg-success-soft aria-pressed:text-success phone:flex-1","data-looks-right":!0,onClick:()=>n(s.id,i==="right"?null:"right"),children:[(0,B.jsx)($a,{}),"Looks right"]}),e.canRequest?(0,B.jsx)(J,{variant:"ghost","aria-pressed":i==="not-right",className:"min-h-11 aria-pressed:bg-warning-soft aria-pressed:text-foreground phone:flex-1","data-not-right":!0,onClick:()=>{let l=i==="not-right";n(s.id,l?null:"not-right"),l||JU(zg(s))},children:"Not right"}):(0,B.jsx)(J,{asChild:!0,variant:"ghost",className:"min-h-11 phone:flex-1",children:(0,B.jsx)("a",{href:t,"data-not-right":!0,children:"Not right"})})]})]},s.id)})})]})}function nV({selected:e,csrf:t,acts:a,decision:n,firstUnanswered:o}){let{next:r}=e,[s,i]=(0,Jb.useState)(!1),l=e.complete,c=e.panel?.need??null,f=e.panel?.youCheck??null,u=l===null?c?.accept??(f?.accept==null?null:{...f.accept,note:null}):null,d=[a.primary,a.secondary].filter(C=>C!==null),p=d.includes("accept")?n?.why??null:null,g=d.includes("accept")?l!==null?l.accept?.note??null:u?.note??null:null,v=g!==null||d.includes("accept-anyway"),b=a.line===Pg&&v?null:a.line??p,x=(C,I)=>{let L=I?"attention":"outline",T={"data-act":C,...I?{"data-ink-act":C,"data-primary-action":""}:{}},M="min-h-11 phone:w-full";switch(C){case"retry":return e.failure?.retry==null?null:(0,B.jsx)(Zb,{action:e.failure.retry.action,csrf:t,note:e.failure.retry.note,variant:L==="attention"?"attention":"default"},C);case"accept":{if(n===null)return null;let O=l??u;return O===null?null:(0,B.jsxs)("form",{method:"post",action:O.action,className:ee(g===null?"flex flex-wrap items-center gap-2 phone:w-full":"flex w-full max-w-sm flex-col items-start gap-2 phone:max-w-none"),...g===null?{}:{"data-accept-with-reason":""},children:[(0,B.jsx)("input",{type:"hidden",name:"csrf",value:t}),(0,B.jsx)("input",{type:"hidden",name:"run",value:String(O.run)}),l!==null?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("input",{type:"hidden",name:"receipt",value:l.receipt}),l.accept!=null&&(0,B.jsx)("input",{type:"hidden",name:"accept",value:"1"})]}):u!==null&&(0,B.jsx)("input",{type:"hidden",name:"return",value:u.returnTo}),g!==null&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("label",{htmlFor:"accept-reason",className:"text-[13px] font-medium","data-accept-needs-reason":!0,children:Pg}),(0,B.jsx)(ve,{id:"accept-reason",type:"text",name:"note",maxLength:500,required:!0,placeholder:g,className:"h-11 w-full"})]}),(0,B.jsxs)(J,{type:"submit",variant:L,className:M,...T,"data-accept-result":!0,children:[(0,B.jsx)($a,{className:"phone:hidden"}),n.label]})]},C)}case"accept-anyway":{let O=e.failure?.acceptAnyway??null;return O==null?null:(0,B.jsxs)("form",{method:"post",action:O.action,className:"flex w-full max-w-sm flex-col items-start gap-2 phone:max-w-none","data-accept-with-reason":!0,"data-accept-anyway":!0,children:[(0,B.jsx)("input",{type:"hidden",name:"csrf",value:t}),(0,B.jsx)("input",{type:"hidden",name:"run",value:String(O.run)}),(0,B.jsx)("input",{type:"hidden",name:"return",value:O.returnTo}),(0,B.jsx)("label",{htmlFor:"accept-reason",className:"text-[13px] font-medium","data-accept-needs-reason":!0,children:Pg}),(0,B.jsx)(ve,{id:"accept-reason",type:"text",name:"note",maxLength:500,required:!0,placeholder:"Why is this safe to accept?",className:"h-11 w-full"}),(0,B.jsxs)(J,{type:"submit",variant:"outline",className:M,...T,"data-accept-result":!0,children:[(0,B.jsx)($a,{className:"phone:hidden"}),"Accept anyway"]})]},C)}case"next-check":return o===null?null:(0,B.jsx)(J,{type:"button",variant:L,className:M,...T,onClick:()=>tV(o),children:"Go to your check"},C);case"checks-running":return(0,B.jsx)(J,{type:"button",variant:L,disabled:!0,"aria-disabled":"true",className:M,...T,children:"Checks running"},C);case"run-checks":return e.runChecks===null?null:(0,B.jsxs)("form",{method:"post",action:e.runChecks.action,className:"phone:w-full",children:[(0,B.jsx)("input",{type:"hidden",name:"csrf",value:t}),(0,B.jsx)("input",{type:"hidden",name:"level",value:e.runChecks.level}),(0,B.jsx)("input",{type:"hidden",name:"return",value:e.runChecks.returnTo}),(0,B.jsx)(J,{type:"submit",variant:L,className:M,...T,children:"Run checks"})]},C);case"request-changes":return(0,B.jsx)(J,{asChild:!0,variant:L,className:M,children:(0,B.jsx)("a",{href:"#request-changes",...T,children:"Request changes"})},C);case"rebuild":return c?.rebuild==null?null:(0,B.jsx)(Eg,{action:c.rebuild.action,csrf:t,label:c.label,className:"min-h-11"},C);case"confirm-stopped":return c?.confirm==null?null:(0,B.jsx)(Mg,{form:c.confirm,csrf:t,label:c.label},C);case"revise":case"draft-repair":return r===null?null:(0,B.jsx)(cl,{html:r.control,className:"so-result-next phone:w-full"},C)}};if(d.length===0&&r===null&&e.failure==null)return null;let y=n!==null&&d.includes("accept")?n.effect:null,h=a.primary!==null?a.secondary:null,w=h!==null||b!==null||r!==null||y!==null,S=s?"":"phone:hidden";return(0,B.jsxs)(ba,{"data-result-decision":a.primary??"none","aria-label":"Decision","data-dock":s?"open":"compact",className:ee("gap-2 phone:gap-2",d.length>0&&"phone:sticky phone:bottom-[-20px] phone:z-10 phone:-mx-4 phone:rounded-none phone:border-x-0 phone:px-4 phone:py-3 phone:pb-[max(12px,env(safe-area-inset-bottom))] phone:shadow-[0_-4px_16px_rgb(0_0_0/.08)]"),children:[b!==null&&(0,B.jsxs)("p",{className:ee("flex max-w-[75ch] gap-2 text-[13px]",S),"data-decision-why":!0,...a.line===null?{}:{"data-cant-accept":""},children:[(0,B.jsx)(pn,{className:"mt-0.5 size-3.5 shrink-0 text-warning","aria-hidden":"true"}),b]}),e.failure!=null&&e.failure.retry===null&&(0,B.jsxs)("p",{className:"max-w-[75ch] text-[13px]","data-failure-suggestion":!0,children:[(0,B.jsx)("span",{className:"font-semibold",children:"What to change."})," ",(0,B.jsx)("span",{className:"text-muted-foreground",children:e.failure.suggestion})]}),r!==null&&(0,B.jsxs)("p",{className:ee("max-w-[75ch] text-[13px]",S),"data-next-action":r.kind,children:[(0,B.jsxs)("span",{className:"font-semibold",children:[r.title,"."]})," ",(0,B.jsx)("span",{className:"text-muted-foreground",children:r.detail})]}),d.length>0&&(0,B.jsxs)("div",{className:ee("flex flex-wrap items-center gap-2 phone:flex-nowrap phone:items-stretch",g!==null&&"flex-col items-start gap-3 phone:flex-row phone:items-stretch phone:gap-2",s&&"phone:flex-wrap"),"data-result-acts":!0,children:[(0,B.jsx)("div",{className:"contents phone:flex phone:min-w-0 phone:flex-1 phone:flex-col",children:a.primary!==null?x(a.primary,!0):a.secondary!==null&&x(a.secondary,!1)}),h!==null&&(0,B.jsx)("div",{className:ee("contents phone:order-last phone:basis-full phone:flex-col",s?"phone:flex":"phone:hidden"),children:x(h,!1)}),w&&(0,B.jsxs)(J,{type:"button",variant:"outline",className:"hidden min-h-11 shrink-0 phone:inline-flex","aria-expanded":s,"aria-label":s?"Fewer options":"More options","data-dock-more":!0,onClick:()=>i(C=>!C),children:[s?"Less":"More",(0,B.jsx)(jo,{className:ee("transition-transform motion-reduce:transition-none",s&&"rotate-180")})]})]}),y!==null&&(0,B.jsx)("p",{className:ee("max-w-[75ch] text-[13px] text-muted-foreground",S),"data-decision-effect":!0,children:y})]})}function oV({panel:e,children:t}){return(0,B.jsxs)("div",{id:"result",...e.attributes,className:"flex scroll-mt-4 flex-col gap-4",children:[e.history!==""&&(0,B.jsx)(cl,{html:e.history}),(0,B.jsxs)(ba,{className:"gap-0 overflow-hidden p-0 phone:p-0",children:[(0,B.jsx)("nav",{role:"tablist","aria-label":"Result views",className:"flex gap-1 overflow-x-auto border-b border-border px-3 phone:px-2",children:e.tabs.map(a=>(0,B.jsxs)("a",{role:"tab",href:a.href,"data-result-tab":a.key,"aria-selected":a.active?"true":"false",...a.active?{}:{tabIndex:-1},className:"-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 border-transparent px-3 py-3 text-sm font-semibold text-muted-foreground transition-colors hover:text-foreground aria-selected:border-primary aria-selected:text-foreground phone:min-h-11",children:[a.label,a.count!==""&&(0,B.jsx)("span",{className:"rounded-full bg-muted px-1.5 text-xs font-medium tabular-nums",children:a.count})]},a.key))}),e.views.map(a=>(0,B.jsx)("div",{role:"tabpanel","data-result-view":a.key,hidden:!e.tabs.some(n=>n.key===a.key&&n.active),className:"px-5 py-4 phone:px-4",children:(0,B.jsx)(cl,{html:a.html,className:"so-result-view"})},a.key))]}),t,e.request!==null&&(0,B.jsx)(ba,{id:"request-changes",className:ee("result-request scroll-mt-4 gap-3",e.requestQuiet&&"hidden has-[details[open]]:flex"),children:(0,B.jsx)(cl,{html:e.request,className:"so-result-request"})})]})}function rV({selected:e}){let t=e.panel?.learning??"",a=e.panel,n=a?.status==null?[]:Yb(a.status),o=e.record,r=[{id:"intent",title:"Approved scope",hint:e.intent===null?null:(0,B.jsxs)(B.Fragment,{children:[e.intent.approval,e.intent.approvedAt!=null&&(0,B.jsxs)(B.Fragment,{children:[" · ",(0,B.jsx)("time",{dateTime:e.intent.approvedAt,title:cc(e.intent.approvedAt),children:xn(e.intent.approvedAt)})]})]}),body:e.intent===null?(0,B.jsx)("p",{className:"text-sm text-muted-foreground",children:"No scope was filed for this task, so there is no approved goal or boundary to review."}):(0,B.jsx)(cl,{html:e.intent.html,className:"so-result-intent"})},...e.notes.length===0?[]:[{id:"notes",title:"Notes",hint:null,count:e.notes.length,body:(0,B.jsx)("ul",{className:"flex flex-col gap-2 text-sm",children:e.notes.map((s,i)=>(0,B.jsxs)("li",{children:[(0,B.jsxs)("span",{className:"text-muted-foreground",children:[s.author," · ",tw(s.at)]})," ",s.note]},i))})}],...n.length===0?[]:[{id:"why",title:"Recorded reasons",hint:null,count:n.length,body:(0,B.jsx)("div",{className:"flex flex-col gap-1 text-[13px] text-muted-foreground","data-status-why":!0,children:n.map(s=>(0,B.jsx)("p",{className:"[overflow-wrap:anywhere]",children:s},s))})}],...a===null||a.limits.length===0?[]:[{id:"limits",title:"What was shortened",hint:null,count:a.limits.length,body:(0,B.jsx)("ul",{className:"flex flex-col gap-1 text-[13px] text-muted-foreground",children:a.limits.map(s=>(0,B.jsx)("li",{children:s},s))})}],...a?.reviewHistory==null?[]:[{id:"review-history",title:"Review history",hint:null,body:(0,B.jsx)("p",{className:"text-[13px] text-muted-foreground",children:a.reviewHistory})}],...o===null?[]:[{id:"run-record",title:"Run record",hint:`Build #${o.build}`,body:(0,B.jsxs)("div",{className:"flex flex-col gap-3 text-[13px]",children:[(0,B.jsx)("dl",{className:"grid grid-cols-[6.5rem_minmax(0,1fr)] gap-x-3 gap-y-1.5",children:o.facts.map(s=>(0,B.jsxs)("div",{className:"contents",children:[(0,B.jsx)("dt",{className:"text-muted-foreground",children:s.label}),(0,B.jsx)("dd",{className:"min-w-0 [overflow-wrap:anywhere]",children:s.value})]},s.label))}),(0,B.jsxs)("p",{className:"flex flex-wrap gap-x-4 gap-y-1",children:[e.checks?.logHref!=null&&(0,B.jsx)("a",{href:e.checks.logHref,className:dc,children:"Check output"}),(0,B.jsx)("a",{href:o.href,className:dc,children:"Full run record"})]})]})}]];return(0,B.jsxs)(ba,{"aria-label":"Result record",className:"gap-0 divide-y divide-border overflow-hidden p-0 phone:p-0",children:[t!==""&&(0,B.jsx)("div",{"data-cockpit-section":"learning",children:(0,B.jsx)(cl,{html:t,className:"so-result-learning"})}),r.map(s=>(0,B.jsxs)("details",{id:s.id,className:"group scroll-mt-4","data-cockpit-section":s.id,children:[(0,B.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-5 py-3.5 hover:bg-accent/50 phone:min-h-12 phone:px-4 [&::-webkit-details-marker]:hidden",children:[(0,B.jsx)(ra,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-90","aria-hidden":"true"}),(0,B.jsx)("h2",{className:"text-[15px] font-semibold",children:s.title}),s.count!==void 0&&(0,B.jsx)(ya,{children:s.count}),s.hint!=null&&(0,B.jsx)("span",{className:"min-w-0 truncate text-[13px] text-muted-foreground",children:s.hint})]}),(0,B.jsx)("div",{className:"px-5 pb-5 pt-1 phone:px-4",children:s.body})]},s.id))]})}var dc="font-medium text-foreground/80 underline decoration-border underline-offset-4 hover:decoration-muted-foreground phone:inline-flex phone:min-h-11 phone:items-center";function sV(e){let t=document.getElementById("run-record");t instanceof HTMLDetailsElement&&(e.preventDefault(),t.open=!0,t.scrollIntoView({block:"start",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),history.replaceState(history.state,"","#run-record"))}function iV({selected:e,csrf:t}){let[a,n]=(0,Jb.useState)(new Map),o=(p,g)=>n(v=>{let b=new Map(v);return g===null?b.delete(p):b.set(p,g),b}),r=tE(e.panel),s=r.filter(p=>!a.has(p.id)),i=r.filter(p=>a.get(p.id)==="not-right"),l={unanswered:s.map(zg),notRight:i.map(zg)},c=e.decision===null?null:{...e.decision,...JM(e.decision.base??e.decision,l)},f=e.actFacts===void 0?e.acts:QM({...e.actFacts,...e.actFacts.accept===null?{}:{accept:{ready:c?.ready??!1}},unanswered:s.length,notRight:i.length}),u=e.panel?.youCheck!=null?(0,B.jsx)(aV,{panel:e.panel,chatHref:e.chatHref,answers:a,answer:o}):null,d=(0,B.jsx)(nV,{selected:e,csrf:t,acts:f,decision:c,firstUnanswered:s[0]?.id??null});return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(QU,{selected:e,acts:f,answers:a}),e.panel!==null?(0,B.jsx)(oV,{panel:e.panel,children:(0,B.jsxs)("div",{className:"flex flex-col gap-4",children:[u,d]})}):(0,B.jsxs)("div",{className:"flex flex-col gap-4",children:[u,d]}),e.contest!==""&&(0,B.jsx)(cl,{html:e.contest}),(0,B.jsx)(rV,{selected:e})]})}function aE({view:e,csrf:t}){let a=e.selected;return(0,B.jsxs)("div",{className:"mx-auto flex w-full max-w-4xl flex-col gap-4",children:[(0,B.jsxs)("header",{className:"flex flex-col gap-3 pb-1",children:[(0,B.jsxs)("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-3",children:[(0,B.jsxs)("div",{className:"min-w-0 flex-1 basis-72",children:[(0,B.jsx)("h1",{className:"text-[26px] font-semibold leading-tight tracking-tight phone:text-[22px]",children:a?.title??"Results"}),a!==null&&(0,B.jsxs)("p",{className:"mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[13px] text-muted-foreground phone:gap-y-0","data-result-meta":!0,children:[a.project!==null&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("span",{className:"font-medium text-foreground/80",children:a.project}),(0,B.jsx)("span",{"aria-hidden":"true",children:"·"})]}),a.record!==null&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("a",{href:"#run-record",onClick:sV,className:dc,children:["Build #",a.record.build]}),(0,B.jsx)("span",{"aria-hidden":"true",children:"·"})]}),(0,B.jsx)("a",{href:a.taskHref,className:dc,children:"Open task"}),(0,B.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,B.jsx)("a",{href:a.chatHref,className:dc,children:"Discuss"})]})]}),a!==null&&(0,B.jsx)(KU,{view:e})]}),e.missing!==null&&(0,B.jsxs)("p",{role:"status",className:"rounded-md bg-muted px-3 py-2 text-[13px] text-foreground",children:[e.missing,a!==null?" Showing the newest result instead.":""]}),e.beyond&&(0,B.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"This result is older than the list in Results."})]}),a===null?e.results.length===0?(0,B.jsxs)(ba,{className:"items-start py-10",children:[(0,B.jsx)("p",{className:"text-base text-muted-foreground",children:"Nothing to review yet."}),(0,B.jsx)(J,{asChild:!0,variant:"outline",children:(0,B.jsx)("a",{href:"/work",children:"Open tasks"})})]}):(0,B.jsx)(ba,{"aria-label":"Results",className:"gap-0 overflow-hidden p-0 phone:p-0",children:(0,B.jsx)("ul",{className:"divide-y divide-border",children:e.results.map(n=>(0,B.jsxs)("li",{className:"flex items-start gap-3 px-5 py-3 phone:px-4",children:[(0,B.jsx)("span",{"aria-hidden":"true",className:ee("mt-2 size-2 shrink-0 rounded-full",n.status===null?"bg-muted-foreground":ew[Og(n.status.tone)])}),(0,B.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,B.jsx)("a",{href:n.href,className:ee("block truncate hover:underline hover:underline-offset-4",n.needsYou?"font-semibold":"font-medium"),children:n.title}),(0,B.jsx)("p",{className:"truncate text-[13px] text-muted-foreground",children:[n.status?.label,...n.notes,tw(n.at)].filter(Boolean).join(" · ")})]})]},n.href))})}):(0,B.jsx)(iV,{selected:a,csrf:t},`${a.taskId}:${a.build??""}`)]})}var Oa=j(he(),1);var lV="#171717",aw="#ffffff",uV="#efefef",Bg="#161616",nw="#0a0a0a",Gie=[[null,"Ink",lV],[null,"Violet","#6e56cf"],[null,"Chart magenta","#c0267e"],[2025,"Mocha Mousse","#a47864"],[2024,"Peach Fuzz","#ffbe98"],[2023,"Viva Magenta","#bb2649"],[2022,"Very Peri","#6667ab"],[2021,"Illuminating","#f5df4d"],[2020,"Classic Blue","#0f4c81"],[2019,"Living Coral","#ff6f61"],[2018,"Ultra Violet","#5f4b8b"],[2017,"Greenery","#88b04b"],[2016,"Rose Quartz","#f7caca"],[2016,"Serenity","#93a9d1"],[2015,"Marsala","#964f4c"],[2014,"Radiant Orchid","#ad5e99"],[2013,"Emerald","#009473"],[2012,"Tangerine Tango","#dd4124"],[2011,"Honeysuckle","#d94f70"],[2010,"Turquoise","#45b5aa"],[2009,"Mimosa","#f0c05a"],[2008,"Blue Iris","#5a5b9f"],[2007,"Chili Pepper","#9b1b30"],[2005,"Blue Turquoise","#53b0ae"],[2004,"Tigerlily","#e2583e"],[2003,"Aqua Sky","#7bc4c4"],[2002,"True Red","#bf1932"],[2001,"Fuchsia Rose","#c74375"],[2e3,"Cerulean","#9bb7d4"]].map(([e,t,a])=>({id:t.toLowerCase().replace(/[^a-z0-9]+/g,"-"),name:t,year:e,hex:a})),Hg=e=>[1,3,5].map(t=>parseInt(e.slice(t,t+2),16)/255),ow=e=>`#${e.map(t=>Math.round(Math.min(1,Math.max(0,t))*255).toString(16).padStart(2,"0")).join("")}`,rE=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,cV=e=>e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055;function Zf(e){let[t,a,n]=Hg(e).map(rE),o=Math.cbrt(.4122214708*t+.5363325363*a+.0514459929*n),r=Math.cbrt(.2119034982*t+.6806995451*a+.1073969566*n),s=Math.cbrt(.0883024619*t+.2817188376*a+.6299787005*n),i=.2104542553*o+.793617785*r-.0040720468*s,l=1.9779984951*o-2.428592205*r+.4505937099*s,c=.0259040371*o+.7827717662*r-.808675766*s;return[i,Math.hypot(l,c),(Math.atan2(c,l)*180/Math.PI+360)%360]}function nE(e,t,a){let n=t*Math.cos(a*Math.PI/180),o=t*Math.sin(a*Math.PI/180),r=(e+.3963377774*n+.2158037573*o)**3,s=(e-.1055613458*n-.0638541728*o)**3,i=(e-.0894841775*n-1.291485548*o)**3,l=[4.0767416621*r-3.3077115913*s+.2309699292*i,-1.2684380046*r+2.6097574011*s-.3413193965*i,-.0041960863*r-.7034186147*s+1.707614701*i];return l.every(c=>c>=-1e-4&&c<=1.0001)?l.map(cV):null}function Fg(e,t,a){for(let n=t;n>=0;n-=.002){let o=nE(e,n,a);if(o!==null)return ow(o)}return ow(nE(e,0,a)??[e,e,e])}var oE=e=>{let[t,a,n]=Hg(e).map(rE);return .2126*t+.7152*a+.0722*n};function fc(e,t){let[a,n]=[oE(e),oE(t)].sort((o,r)=>r-o);return(a+.05)/(n+.05)}var pc=(e,t,a)=>{let[n,o]=[Hg(e),Hg(t)];return ow(n.map((r,s)=>r*a+o[s]*(1-a)))};function sE(e){let t=e.trim().replace(/^#/,"").toLowerCase();return/^[0-9a-f]{6}$/.test(t)?`#${t}`:/^[0-9a-f]{3}$/.test(t)?`#${[...t].map(a=>a+a).join("")}`:null}function rw(e){let[t,a,n]=Zf(e),o=e,r=f=>fc(f,pc(f,aw,.12))>=4.5&&fc(f,uV)>=3;for(let f=t;!r(o)&&f>.02;f-=.005)o=Fg(f,a,n);let s=e,i=f=>fc(f,Bg)>=6&&fc(f,pc(f,Bg,.13))>=4.5;for(let f=t;!i(s)&&f<.99;f+=.005)s=Fg(f,a,n);let[l]=Zf(o),[c]=Zf(s);return{light:{signal:o,hover:Fg(Math.max(.02,l-.06),a,n),on:fc(o,"#ffffff")>=4.5?"#ffffff":nw,soft:pc(o,aw,.12),selection:pc(o,aw,.24)},dark:{signal:s,hover:Fg(Math.min(.99,c+.06),a,n),on:fc(s,nw)>=4.5?nw:"#ffffff",soft:pc(s,Bg,.13),selection:pc(s,Bg,.32)}}}var dV=[["#c4320a","red","failures","a failed one"],["#ab6400","amber","warnings","a warning"],["#218358","green","passed checks","a passed one"],["#0d74ce","blue","running work","a running one"]];function iE(e){let[,t,a]=Zf(rw(e).light.signal);if(t<.04)return"Close to grey, so what needs you won't stand out.";let n=dV.find(([o])=>{let r=Math.abs(Zf(o)[2]-a);return Math.min(r,360-r)<25});return n===void 0?null:`Close to the ${n[1]} used for ${n[2]}, so a task waiting on you can look like ${n[3]}.`}function lE(e){let t=["17:00","18:00","19:00","20:00","21:00","22:00"],a=e===null||t.includes(e)?t:[...t,e].sort();return[["off","Off"],...a.map(n=>[n,`At ${n}`])]}var uE={betterstack:{title:"Better Stack",source:"Simple Icons",path:"M1.5,10.828l-.716,6.212c-.074,.638 .17,1.271 .651,1.696l1.775,1.565c.608,.536 1.551,.014 1.421-.786l-1.423-8.726c-.161-.988-1.593-.954-1.707,.04zM13.078,18.982l-4.232-12.194c-.47-1.354-2.441-1.296-2.826,.084l-1.288,4.607c-.146,.523-.202,.826 0,1.33h.489l1.777,5.679c.275,.685 .844,1.217 1.554,1.454l2.65,.883c1.162,.387 2.271-.703 1.875-1.843zM23.025,18.016l-7.478-14.022c-.652-1.223-2.412-1.191-3.02,.055l-1.839,3.701c-.222,.456-.119,.618 .066,.883c.148,.212 .492,.229 .632,.011c.138-.214 .457-.194 .567,.035l4.808,10c.362,.814 1.121,1.382 2.004,1.499l2.544,.325c1.369,.18 2.367-1.267 1.716-2.487z"},canva:{title:"Canva",source:"svgl",path:"M12,22c5.523,0 10-4.477 10-10c0-5.523-4.477-10-10-10c-5.523,0-10,4.477-10,10c0,5.523 4.477,10 10,10zM16.551,14.378c0,1.011-1.809,4.124-4.939,4.124c-2.948,0-4.859-2.211-4.859-5.557c0-4.323 2.995-7.447 6.365-7.447c2.039,0 3.255,1.026 3.255,2.423c0,1.44-1.041,2.46-1.929,2.46c-.221,0-.332-.108-.332-.287c0-.399 .643-.998 .643-2.129c0-.953-.582-1.552-1.535-1.552c-2.039,0-4.361,2.409-4.361,6.576c0,2.46 1.221,4.24 3.194,4.24c1.706,0 3.18-1.225 4.033-2.955c.076-.152 .148-.222 .231-.222c.119,0 .234,.103 .234,.326z"},chrome:{title:"Google Chrome",source:"Simple Icons",path:"M12,2c-3.158,0-5.974,1.464-7.807,3.751l3.294,5.707c.274-2.284 2.212-4.003 4.513-4.003h8.909c-1.709-3.348-5.15-5.455-8.909-5.454zM3.609,6.558c-1.053,1.619-1.612,3.51-1.609,5.442c0,5.01 3.683,9.159 8.491,9.887l3.294-5.706c-2.115,.904-4.572,.085-5.721-1.908zM14.728,8.363c1.842,1.378 2.361,3.917 1.208,5.908l.002,.001h-.002l-4.453,7.714c.172,.008 .344,.013 .518,.013c5.523,0 10-4.477 10-10c0-1.283-.242-2.509-.682-3.637zM12,15.637c-2.008,0-3.637-1.628-3.637-3.637c0-2.008 1.628-3.637 3.637-3.637c2.008,0 3.637,1.628 3.637,3.637c0,2.008-1.628,3.637-3.637,3.637z"},claude:{title:"Claude",source:"Simple Icons",path:"M5.926,15.298l3.933-2.207l.066-.192l-.066-.106h-.192l-.658-.041l-2.247-.061l-1.949-.081l-1.888-.101l-.476-.101l-.445-.587l.046-.294l.4-.268l.572,.051l1.265,.086l1.898,.132l1.377,.081l2.04,.213h.324l.046-.132l-.111-.081l-.086-.081l-1.964-1.331l-2.126-1.407l-1.113-.81l-.602-.41l-.304-.385l-.132-.84l.547-.602l.734,.051l.187,.051l.744,.572l1.589,1.23l2.075,1.529l.304,.253l.121-.086l.015-.061l-.137-.228l-1.129-2.04l-1.205-2.075l-.536-.86l-.142-.516c-.051-.213-.086-.39-.086-.607l.623-.845l.344-.111l.83,.111l.349,.304l.516,1.179l.835,1.858l1.296,2.526l.38,.749l.202,.693l.076,.213h.132v-.121l.106-1.422l.197-1.746l.192-2.247l.066-.633l.314-.759l.623-.41l.486,.233l.4,.572l-.056,.37l-.238,1.544l-.466,2.419l-.304,1.62h.177l.202-.202l.82-1.088l1.377-1.721l.607-.683l.709-.754l.456-.359h.86l.633,.941l-.283,.972l-.886,1.124l-.734,.952l-1.053,1.417l-.658,1.134l.061,.091l.157-.015l2.379-.506l1.286-.233l1.534-.263l.693,.324l.076,.329l-.273,.673l-1.64,.405l-1.923,.385l-2.865,.678l-.035,.025l.041,.051l1.291,.121l.552,.03h1.351l2.516,.187l.658,.435l.395,.532l-.066,.405l-1.012,.516l-1.367-.324l-3.189-.759l-1.093-.273h-.152v.091l.911,.891l1.67,1.508l2.09,1.944l.106,.481l-.268,.38l-.283-.041l-1.837-1.382l-.709-.623l-1.604-1.351h-.106v.142l.369,.542l1.954,2.936l.101,.901l-.142,.294l-.506,.177l-.557-.101l-1.144-1.604l-1.179-1.807l-.952-1.62l-.116,.066l-.562,6.048l-.263,.309l-.607,.233l-.506-.385l-.268-.623l.268-1.23l.324-1.604l.263-1.275l.238-1.584l.142-.526l-.01-.035l-.116,.015l-1.194,1.64l-1.817,2.455l-1.437,1.539l-.344,.137l-.597-.309l.056-.552l.334-.491l1.989-2.531l1.2-1.569l.774-.906l-.005-.132h-.046l-5.284,3.432l-.941,.121l-.405-.38l.051-.622l.192-.202l1.589-1.093z"},cloudflare:{title:"Cloudflare",source:"Simple Icons",path:"M16.509,16.845c.148-.507 .091-.971-.155-1.315c-.225-.316-.604-.499-1.061-.52l-8.659-.112c-.054,.001-.104-.026-.133-.071c-.028-.042-.035-.099-.021-.155c.028-.084 .112-.148 .204-.156l8.736-.112c1.035-.049 2.16-.887 2.554-1.914l.499-1.301c.022-.056 .029-.113 .015-.168c-.562-2.546-2.835-4.445-5.55-4.445c-2.504,0-4.628,1.618-5.388,3.861c-.493-.366-1.119-.562-1.794-.499c-1.203,.119-2.166,1.083-2.286,2.286c-.028,.31-.007,.613 .064,.894c-1.963,.056-3.531,1.66-3.531,3.637c0,.175 .014,.352 .035,.527c.014,.083 .084,.148 .169,.148h15.981c.091,0 .176-.064 .203-.155l.12-.427zM19.266,11.281c-.077,0-.161,0-.238,.011c-.057,0-.105,.042-.127,.098l-.338,1.174c-.147,.507-.092,.971 .154,1.316c.226,.316 .606,.498 1.063,.52l1.844,.113c.056,0 .106,.026 .133,.07c.028,.043 .035,.107 .021,.156c-.028,.084-.113,.149-.204,.155l-1.921,.112c-1.041,.049-2.158,.887-2.553,1.914l-.141,.359c-.028,.071 .022,.142 .099,.142h6.598c.077,0 .147-.049 .169-.126c.112-.408 .176-.837 .176-1.28c0-2.602-2.125-4.727-4.734-4.727"},confluence:{title:"Confluence",source:"Simple Icons",path:"M2.611,17.278c-.209,.322-.447,.738-.644,1.05c-.18,.302-.084,.692 .215,.877l4.188,2.576c.147,.091 .324,.119 .492,.077c.168-.041 .312-.148 .4-.297c.168-.28 .383-.644 .618-1.03c1.659-2.739 3.328-2.407 6.334-.967l4.182,1.972c.157,.075 .338,.083 .502,.022c.163-.061 .295-.185 .365-.345l1.994-4.51c.14-.322-.003-.697-.322-.844c-1.399-.658-2.795-1.321-4.188-1.992c-5.666-2.739-10.464-2.558-14.137,3.408zM21.39,6.722c.21-.342 .448-.738 .645-1.054c.176-.301 .08-.688-.216-.872l-4.188-2.577c-.147-.091-.324-.119-.492-.077c-.168,.041-.312,.148-.4,.297c-.164,.283-.38,.644-.619,1.033c-1.659,2.738-3.328,2.404-6.334,.967l-4.166-1.975c-.157-.075-.338-.083-.501-.022c-.163,.061-.295,.185-.365,.344l-1.994,4.51c-.14,.322 .003,.697 .322,.844c.877,.413 2.619,1.238 4.188,1.992c5.65,2.738 10.454,2.555 14.12-3.408z"},discord:{title:"Discord",source:"Simple Icons",path:"M19.939,4.717c-1.485-.682-3.053-1.168-4.663-1.446c-.03-.006-.06,.009-.075,.035c-.201,.358-.424,.825-.581,1.193c-1.761-.264-3.513-.264-5.237,0c-.156-.375-.387-.834-.59-1.193c-.015-.026-.045-.04-.075-.035c-1.61,.278-3.178,.764-4.663,1.446c-.013,.005-.023,.015-.031,.026c-2.97,4.437-3.783,8.765-3.384,13.039c.002,.021 .013,.04 .03,.054c1.959,1.439 3.857,2.313 5.72,2.892c.03,.009 .062-.002 .08-.026c.441-.602 .833-1.236 1.17-1.903c.009-.018 .01-.04 .003-.059c-.008-.019-.023-.034-.042-.042c-.623-.236-1.216-.524-1.787-.852c-.021-.012-.035-.035-.036-.059c-.001-.024 .009-.048 .029-.063c.12-.09 .24-.184 .355-.278c.021-.017 .049-.021 .074-.01c3.749,1.712 7.808,1.712 11.513,0c.025-.012 .054-.008 .075,.009c.115,.095 .235,.189 .356,.279c.02,.015 .031,.038 .029,.063c-.001,.024-.015,.047-.036,.059c-.571,.333-1.169,.618-1.788,.851c-.019,.007-.035,.023-.042,.042c-.007,.019-.006,.041 .003,.06c.344,.666 .737,1.301 1.169,1.903c.018,.025 .051,.036 .08,.027c1.872-.579 3.77-1.453 5.729-2.892c.017-.012 .028-.032 .03-.053c.478-4.941-.8-9.234-3.387-13.039c-.006-.012-.017-.022-.03-.027zM8.201,15.18c-1.129,0-2.059-1.036-2.059-2.309c0-1.273 .912-2.309 2.059-2.309c1.156,0 2.077,1.045 2.059,2.309c0,1.273-.912,2.309-2.059,2.309zM15.813,15.18c-1.129,0-2.059-1.036-2.059-2.309c0-1.273 .912-2.309 2.059-2.309c1.156,0 2.077,1.045 2.059,2.309c0,1.273-.903,2.309-2.059,2.309z"},figma:{title:"Figma",source:"Simple Icons",path:"M15.85,8.983h-4.585v-8.976h4.585c2.475,0 4.488,2.013 4.488,4.488c0,2.475-2.013,4.489-4.488,4.489zM12.735,7.512h3.115c1.664,0 3.017-1.354 3.017-3.017c0-1.663-1.354-3.017-3.017-3.017h-3.115zM12.735,8.983h-4.584c-2.475,0-4.488-2.013-4.488-4.488c0-2.475 2.013-4.489 4.488-4.489h4.585v8.976zM8.151,1.477c-1.664,0-3.017,1.354-3.017,3.017c0,1.663 1.353,3.018 3.017,3.018h3.115v-6.036zM12.735,16.488h-4.584c-2.475,0-4.488-2.013-4.488-4.488c0-2.475 2.013-4.488 4.488-4.488h4.585v8.975zM8.151,8.983c-1.664,0-3.017,1.354-3.017,3.017c0,1.663 1.354,3.017 3.017,3.017h3.115v-6.035zM8.175,23.993c-2.488,0-4.513-2.013-4.513-4.488c0-2.475 2.013-4.488 4.488-4.488h4.585v4.439c0,2.502-2.046,4.537-4.56,4.537zM8.151,16.488c-1.666,.002-3.015,1.352-3.017,3.017c0,1.664 1.364,3.017 3.042,3.017c1.704,0 3.091-1.375 3.091-3.066v-2.968zM15.85,16.488h-.098c-2.475,0-4.488-2.013-4.488-4.488c0-2.475 2.013-4.488 4.488-4.488h.098c2.475,0 4.488,2.013 4.488,4.488c0,2.475-2.013,4.488-4.488,4.488zM15.753,8.983c-1.664,0-3.017,1.354-3.017,3.017c0,1.663 1.354,3.017 3.017,3.017h.098c1.664,0 3.017-1.354 3.017-3.017c0-1.663-1.354-3.017-3.017-3.017z"},github:{title:"GitHub",source:"Simple Icons",path:"M12,2.125c-5.595,0-10.126,4.534-10.126,10.126c0,4.475 2.901,8.27 6.924,9.607c.506,.095 .692-.218 .692-.487c0-.24-.008-.878-.013-1.721c-2.817,.611-3.411-1.359-3.411-1.359c-.461-1.169-1.127-1.481-1.127-1.481c-.917-.628 .071-.615 .071-.615c1.017,.071 1.551,1.043 1.551,1.043c.903,1.548 2.37,1.101 2.949,.842c.091-.655 .352-1.101 .641-1.354c-2.249-.253-4.612-1.124-4.612-5.004c0-1.105 .392-2.008 1.042-2.717c-.114-.256-.456-1.285 .089-2.68c0,0 .848-.272 2.785,1.038c.81-.225 1.671-.337 2.532-.342c.861,.005 1.721,.116 2.532,.342c1.924-1.31 2.772-1.038 2.772-1.038c.544,1.395 .203,2.424 .101,2.68c.646,.709 1.038,1.612 1.038,2.717c0,3.89-2.367,4.747-4.62,4.996c.354,.304 .684,.925 .684,1.873c0,1.355-.013,2.444-.013,2.773c0,.266 .177,.582 .696,.481c4.051-1.328 6.95-5.126 6.95-9.594c0-5.592-4.534-10.126-10.126-10.126"},gmail:{title:"Gmail",source:"Simple Icons",path:"M23.545,5.705v13.382c0,.87-.704,1.574-1.574,1.574h-3.674v-8.921l-6.297,4.724l-6.297-4.724v8.922h-3.674c-.418,0-.818-.166-1.113-.461c-.295-.295-.461-.696-.461-1.114v-13.382c0-1.946 2.221-3.058 3.778-1.89l1.47,1.104l6.297,4.722l6.297-4.724l1.47-1.102c1.556-1.167 3.778-.057 3.778,1.89z"},intercom:{title:"Intercom",source:"Simple Icons",path:"M19.5,2h-15c-1.381,0-2.5,1.119-2.5,2.5v15c0,1.382 1.119,2.5 2.5,2.5h15c1.382,0 2.5-1.118 2.5-2.5v-15c0-1.381-1.118-2.5-2.5-2.5zM14.666,5.666c0-.367 .3-.667 .668-.667c.367,0 .667,.3 .667,.667v8.907c0,.368-.3,.668-.667,.668c-.369,0-.668-.299-.668-.667zM11.333,5.328c0-.367 .298-.666 .667-.666c.369,0 .667,.299 .667,.666v9.668c0,.367-.297,.667-.667,.667c-.369,0-.667-.3-.667-.667zM8,5.666c0-.367 .299-.667 .666-.667c.369,0 .668,.3 .668,.667v8.907c0,.368-.3,.668-.668,.668c-.367,0-.666-.299-.666-.667zM4.666,7c0-.368 .3-.667 .668-.667c.367,0 .666,.298 .666,.667v5.996c0,.368-.299,.667-.666,.667c-.369,0-.668-.3-.668-.667zM19.1,17.168c-.102,.088-2.572,2.161-7.1,2.161c-4.527,0-6.997-2.072-7.101-2.161c-.279-.24-.312-.66-.072-.94c.238-.278 .658-.312 .938-.075c.039,.034 2.244,1.843 6.234,1.843c4.04,0 6.213-1.822 6.233-1.839c.278-.241 .699-.208 .94,.072c.241,.28 .208,.7-.072,.94zM19.334,12.996c0,.368-.3,.667-.667,.667c-.367,0-.667-.3-.667-.667v-5.996c0-.368 .301-.667 .668-.667c.368,0 .668,.298 .668,.667z"},jira:{title:"Jira",source:"Simple Icons",path:"M11.643,11.594h-9.642c.001,1.155 .461,2.262 1.279,3.077c.818,.815 1.927,1.272 3.081,1.269h1.775v1.714c0,2.399 1.945,4.345 4.344,4.346v-9.568c0-.463-.375-.837-.837-.837zM16.412,6.798h-9.632c0,2.4 1.946,4.345 4.346,4.345h1.774v1.715c.002,2.399 1.947,4.344 4.346,4.345v-9.571c0-.461-.373-.834-.834-.834zM21.177,2h-9.632c0,2.4 1.946,4.346 4.346,4.346h1.774v1.714c.002,2.394 1.94,4.336 4.334,4.343v-9.565c.002-.457-.365-.831-.822-.837z"},linear:{title:"Linear",source:"Simple Icons",path:"M4.405,5.483c1.899-2.213 4.67-3.486 7.587-3.483c5.528,0 10.008,4.48 10.008,10.008c0,3.033-1.35,5.753-3.483,7.588l-14.111-14.112zM3.514,6.688l13.797,13.797c-.437,.275-.896,.517-1.375,.722l-13.143-13.142c.206-.479 .448-.938 .722-1.375zM2.268,9.636l12.096,12.096c-.592,.143-1.202,.235-1.829,.268l-10.535-10.535c.033-.617 .123-1.229 .268-1.829zM2.127,13.688l8.186,8.187c-4.189-.716-7.471-3.997-8.187-8.187z"},notion:{title:"Notion",source:"Simple Icons",path:"M5.584,5.37c.635,.516 .873,.476 2.066,.397l11.244-.675c.238,0 .04-.238-.039-.277l-1.868-1.35c-.357-.277-.835-.596-1.748-.516l-10.887,.795c-.396,.039-.476,.238-.318,.397zM6.258,7.991v11.83c0,.636 .317,.874 1.033,.834l12.357-.715c.716-.039 .796-.476 .796-.993v-11.751c0-.516-.198-.794-.636-.755l-12.913,.755c-.476,.04-.636,.278-.636,.794zM18.457,8.624c.079,.357 0,.715-.357,.756l-.596,.119v8.733c-.517,.278-.994,.437-1.391,.437c-.636,0-.796-.199-1.272-.794l-3.894-6.114v5.915l1.232,.279c0,0 0,.715-.994,.715l-2.741,.158c-.079-.158 0-.556 .278-.635l.715-.198v-7.822l-.991-.08c-.08-.357 .119-.873 .675-.913l2.941-.198l4.053,6.193v-5.479l-1.034-.118c-.079-.437 .238-.755 .636-.794zM3.437,2.67l11.325-.834c1.39-.119 1.748-.04 2.622,.596l3.615,2.541c.596,.436 .795,.556 .795,1.032v13.935c0,.873-.317,1.39-1.429,1.469l-13.152,.795c-.834,.04-1.232-.079-1.669-.636l-2.662-3.454c-.476-.636-.675-1.111-.675-1.668v-12.387c0-.714 .318-1.31 1.231-1.389z"},openai:{title:"OpenAI",source:"svgl",evenodd:!0,path:"M9.367,2.175c1.818-.487 3.67,.075 4.913,1.315c1.697-.453 3.582-.014 4.912,1.317c1.331,1.331 1.77,3.216 1.317,4.913v0c1.241,1.243 1.803,3.095 1.316,4.913c-.487,1.818-1.9,3.141-3.596,3.597c-.456,1.696-1.779,3.109-3.597,3.596c-1.818,.487-3.67-.075-4.913-1.315c-1.697,.453-3.582,.014-4.913-1.317c-1.331-1.331-1.77-3.216-1.317-4.913c-1.24-1.243-1.803-3.095-1.315-4.913c.487-1.818 1.9-3.141 3.596-3.597c.456-1.696 1.779-3.109 3.597-3.596zM15.436,17.077c0,.206-.11,.397-.288,.5l-4.236,2.445c.937,.723 2.189,1.017 3.421,.687c1.737-.466 2.89-2.025 2.914-3.739v-4.36c0-.132-.071-.255-.185-.32l-1.626-.939zM9.321,17.515c-.178,.103-.398,.103-.577,0l-4.235-2.445c-.158,1.174 .214,2.405 1.116,3.307h0c1.272,1.272 3.199,1.49 4.695,.654l3.776-2.18c.114-.066 .185-.189 .185-.321v-1.877zM15.152,7.76c-.114-.066-.256-.065-.37,0l-1.626,.939l4.959,2.863c.179,.103 .289,.294 .289,.5v4.891c1.095-.45 1.975-1.388 2.305-2.62c.465-1.737-.309-3.515-1.781-4.393zM5.596,7.047c-1.095,.45-1.975,1.388-2.306,2.62c-.465,1.737 .309,3.515 1.781,4.393l3.776,2.18c.114,.066 .256,.065 .37,0l1.626-.939l-4.959-2.863c-.179-.103-.288-.294-.288-.5zM9.72,10.684v2.633l2.28,1.316l2.28-1.316v-2.633l-2.28-1.317zM13.088,3.978c-.937-.723-2.189-1.017-3.421-.687c-1.737,.466-2.89,2.025-2.914,3.739v4.36c0,.132 .071,.255 .185,.32l1.626,.939v-5.726c0-.206 .11-.397 .289-.5zM18.376,5.625c-1.272-1.272-3.199-1.49-4.695-.654l-3.776,2.18c-.114,.066-.185,.189-.185,.321v1.877l4.959-2.863c.178-.103 .398-.103 .577,0l4.235,2.445c.158-1.174-.214-2.405-1.116-3.306z"},paypal:{title:"PayPal",source:"Simple Icons",path:"M15.265,5.352h-6.031l-2.077,13.208h-4.366l2.752-17.418h7.234c3.397,0 5.768,2.076 5.857,4.988c-.586-.432-1.905-.778-3.368-.778M21.21,10.37c0,3.085-2.723,6.201-6.296,6.201h-2.256l-1.024,6.287h-4.393l1.669-10.44h3.25c3.807,0 6.647-3.288 6.472-6.288c1.589,.815 2.585,2.454 2.577,4.24M9.877,6.16h5.798c.821,0 1.757,.201 2.138,.49c-.176,2.48-2.402,4.961-5.828,4.961h-2.958z"},playwright:{title:"Playwright",source:"svgl",path:"M8.063,13.122c-.862,.245-1.428,.674-1.801,1.103c.357-.312 .835-.599 1.48-.782c.66-.187 1.223-.186 1.688-.096v-.364c-.397-.036-.852-.007-1.367,.139zM6.223,10.065l-3.203,.844c0,0 .058,.082 .166,.192l2.716-.716c0,0-.038,.496-.373,.94c.632-.478 .693-1.26 .693-1.26zM8.904,17.593c-4.508,1.214-6.892-4.01-7.614-6.721c-.334-1.252-.479-2.199-.518-2.811c-.004-.064-.002-.117 .002-.166c-.234,.014-.346,.136-.323,.487c.039,.611 .184,1.559 .518,2.811c.722,2.711 3.107,7.935 7.614,6.721c.981-.264 1.718-.746 2.272-1.36c-.51,.461-1.148,.823-1.951,1.04zM9.751,6.868v.321h1.768c-.036-.114-.073-.216-.109-.321zM11.914,9.51c.795,.226 1.216,.783 1.438,1.277l.887,.252c0,0-.121-1.727-1.683-2.17c-1.461-.415-2.36,.812-2.469,.971c.425-.303 1.046-.551 1.828-.329zM18.972,10.795c-1.462-.417-2.361,.812-2.469,.969c.425-.302 1.046-.55 1.827-.327c.794,.226 1.214,.783 1.437,1.277l.888,.253c0,0-.123-1.727-1.683-2.171zM18.091,15.347l-7.375-2.062c0,0 .08,.405 .386,.929l6.21,1.736c.511-.296 .779-.603 .779-.603zM12.978,19.785c-5.84-1.566-5.134-9.006-4.189-12.532c.389-1.453 .789-2.533 1.121-3.257c-.198-.041-.362,.064-.524,.393c-.352,.714-.803,1.877-1.238,3.506c-.945,3.526-1.651,10.966 4.189,12.532c2.752,.737 4.897-.383 6.495-2.143c-1.517,1.374-3.454,2.145-5.854,1.502zM9.751,15.849v-1.501l-4.172,1.183c0,0 .308-1.791 2.484-2.408c.66-.187 1.223-.186 1.688-.096v-6.159h2.089c-.227-.703-.447-1.244-.632-1.62c-.306-.622-.619-.21-1.33,.385c-.501,.419-1.767,1.312-3.673,1.825c-1.906,.514-3.446,.378-4.089,.266c-.911-.157-1.388-.357-1.343,.336c.039,.611 .184,1.559 .518,2.811c.722,2.711 3.107,7.935 7.614,6.721c1.177-.317 2.009-.944 2.585-1.744h-1.738zM3.019,10.909l3.203-.844c0,0-.093,1.232-1.294,1.549c-1.201,.316-1.909-.705-1.909-.705zM21.807,6.939c-.833,.146-2.83,.328-5.299-.334c-2.469-.661-4.108-1.818-4.757-2.362c-.92-.771-1.325-1.306-1.723-.496c-.352,.715-.803,1.878-1.238,3.506c-.945,3.526-1.651,10.966 4.189,12.532c5.838,1.564 8.946-5.233 9.891-8.759c.436-1.628 .627-2.86 .68-3.655c.06-.9-.558-.639-1.741-.432zM10.075,9.856c0,0 .92-1.431 2.481-.988c1.562,.444 1.683,2.17 1.683,2.17zM13.885,16.279c-2.745-.804-3.169-2.993-3.169-2.993l7.375,2.062c0,0-1.489,1.726-4.206,.931zM16.492,11.78c0,0 .919-1.43 2.479-.985c1.56,.444 1.683,2.171 1.683,2.171zM8.293,14.761l-2.714,.769c0,0 .295-1.679 2.294-2.345l-1.537-5.767l-.133,.04c-1.906,.514-3.446,.378-4.089,.266c-.911-.157-1.388-.357-1.343,.336c.039,.611 .184,1.559 .518,2.811c.722,2.711 3.107,7.935 7.614,6.721l.133-.042zM3.019,10.909l3.203-.844c0,0-.093,1.232-1.294,1.549c-1.201,.316-1.909-.705-1.909-.705zM14.009,16.309l-.124-.03c-2.745-.804-3.169-2.993-3.169-2.993l3.803,1.063l2.013-7.737l-.024-.006c-2.469-.661-4.108-1.818-4.757-2.362c-.92-.771-1.325-1.306-1.723-.496c-.352,.715-.802,1.878-1.238,3.506c-.945,3.526-1.651,10.966 4.189,12.532l.12,.027zM10.075,9.856c0,0 .92-1.431 2.481-.988c1.562,.444 1.683,2.17 1.683,2.17zM8.432,14.722l-.728,.207c.172,.969 .475,1.9 .951,2.721c.083-.018 .165-.034 .249-.057c.221-.06 .426-.133 .623-.214c-.531-.789-.883-1.697-1.095-2.657zM8.147,7.895c-.374,1.396-.709,3.405-.616,5.42c.165-.072 .339-.138 .532-.193l.135-.03c-.164-2.153 .191-4.346 .591-5.839c.101-.378 .203-.729 .304-1.056c-.163,.104-.339,.21-.539,.32c-.135,.417-.271,.872-.407,1.378z"},posthog:{title:"PostHog",source:"Simple Icons",path:"M9.854,14.5l-4.854-4.853l-4.146-4.147c-.143-.143-.358-.186-.545-.109c-.187,.078-.309,.26-.309,.463v2.586c0,.132 .053,.259 .146,.353l4.854,4.854l.147,.146l4.707,4.707l.146,.147v-.049c.065,.03 .134,.049 .207,.049h2.586c.202,0 .385-.122 .462-.309c.077-.187 .034-.402-.109-.545zM9.854,9.5l-4-4c-.106-.109-.258-.163-.409-.144c-.143,.017-.272,.093-.356,.21c-.059,.084-.09,.185-.089,.288v2.586c0,.133 .053,.259 .147,.353l9,9c.143,.143 .358,.185 .545,.108c.187-.077 .308-.26 .308-.462v-2.585c0-.133-.052-.26-.146-.354zM10.854,5.5c-.143-.143-.358-.186-.545-.109c-.187,.078-.309,.26-.309,.463v2.586c0,.133 .053,.259 .147,.353l4,4c.143,.143 .358,.185 .545,.108c.187-.077 .308-.26 .308-.462v-2.585c0-.133-.052-.26-.146-.354zM23.501,17.015c-.845-.11-1.63-.497-2.232-1.1l-4.708-4.707c-.143-.143-.358-.186-.545-.109c-.187,.078-.309,.26-.309,.463v6.585c0,.276 .224,.5 .5,.5h7.293c.276,0 .5-.224 .5-.5v-.6c0-.276-.225-.497-.499-.532zM18.107,17.047c-.442,0-.8-.358-.8-.8c0-.442 .358-.8 .8-.8c.442,0 .8,.358 .8,.8c0,.442-.358,.8-.8,.8zM.854,15.5c-.143-.143-.358-.186-.545-.109c-.187,.078-.309,.26-.309,.463v2.293c0,.276 .224,.5 .5,.5h2.293c.222,0 .39-.135 .462-.309c.079-.187 .036-.403-.109-.545l-2.292-2.292zM5,14.647l-4.146-4.147c-.143-.143-.358-.186-.545-.109c-.187,.077-.309,.26-.309,.462v2.586c0,.132 .053,.259 .146,.353l4.708,4.708l.146,.147h2.793c.202,0 .385-.122 .462-.309c.077-.187 .034-.402-.109-.545z"},sentry:{title:"Sentry",source:"Simple Icons",path:"M13.696,3.574c-.775-1.285-2.637-1.285-3.411,0l-2.806,4.806c4.362,2.178 7.243,6.505 7.57,11.369h-1.971c-.326-4.169-2.834-7.855-6.593-9.688l-2.597,4.491c2.11,.947 3.594,2.902 3.936,5.19h-4.525c-.109-.008-.207-.07-.261-.165c-.053-.096-.055-.212-.004-.309l1.254-2.132c-.425-.354-.91-.629-1.432-.81l-1.242,2.132c-.261,.448-.332,.981-.196,1.481c.135,.5 .466,.925 .917,1.18c.294,.166 .626,.254 .964,.256h6.197c.234-2.888-1.06-5.689-3.412-7.382l.985-1.706c2.969,2.039 4.639,5.495 4.393,9.088h5.249c.249-5.444-2.417-10.609-6.998-13.56l1.991-3.412c.092-.155 .292-.206 .447-.115c.226,.124 8.653,14.828 8.811,14.998c.057,.101 .055,.226-.005,.325c-.06,.1-.169,.159-.285,.157h-2.03c.026,.543 .026,1.085 0,1.625h2.038c.702,.004 1.352-.368 1.704-.975c.352-.607 .353-1.355 .002-1.963z"},shadcn:{title:"shadcn/ui",source:"Simple Icons",path:"M20.516,11.82l-8.696,8.696c-.339,.339-.339,.89 0,1.23c.339,.339 .89,.339 1.23,0l8.696-8.696c.339-.34 .339-.891 0-1.23c-.34-.339-.891-.339-1.23,0zM18.777,2.254l-16.522,16.522c-.339,.339-.339,.89 0,1.23c.34,.339 .891,.339 1.23,0l16.522-16.522c.339-.339 .339-.89 0-1.23c-.34-.339-.891-.339-1.23,0z"},slack:{title:"Slack",source:"svgl",path:"M9.336,1.99c-1.104,.001-1.998,.897-1.998,2.002c-.001,1.104 .894,2.001 1.998,2.002h1.998v-2.001c.001-1.104-.894-2.001-1.999-2.002c.001,0 .001,0 0,0M9.336,7.329h-5.327c-1.104,.001-1.999,.897-1.998,2.002c-.002,1.104 .893,2.001 1.998,2.002h5.328c1.104-.001 1.999-.897 1.998-2.002c.001-1.105-.894-2.002-1.998-2.002zM21.99,9.33c.001-1.104-.894-2.001-1.998-2.002c-1.104,.001-1.999,.897-1.998,2.002v2.002h1.998c1.104-.001 1.999-.897 1.998-2.002zM16.662,9.33v-5.339c.001-1.104-.893-2-1.998-2.002c-1.104,.001-1.999,.897-1.998,2.002v5.339c-.002,1.104 .893,2.001 1.998,2.002c1.104-.001 1.999-.897 1.998-2.002zM14.664,22.01c1.104-.001 1.999-.897 1.998-2.002c.001-1.104-.894-2.001-1.998-2.002h-1.998v2.002c-.001,1.104 .894,2 1.998,2.002zM14.664,16.671h5.328c1.104-.001 1.999-.897 1.998-2.002c.002-1.104-.893-2.001-1.998-2.002h-5.328c-1.104,.001-1.999,.897-1.998,2.002c-.001,1.105 .893,2.002 1.998,2.002zM2.01,14.669c-.001,1.104 .894,2.001 1.998,2.002c1.104-.001 1.999-.897 1.998-2.002v-2.002h-1.998c-1.104,.001-1.999,.897-1.998,2.002zM7.338,14.669v5.339c-.002,1.104 .893,2.001 1.998,2.002c1.104-.001 1.999-.897 1.998-2.002v-5.338c.002-1.104-.893-2.001-1.998-2.002c-1.105,0-1.999,.896-1.998,2.001c0,0 0,.001 0,0"},square:{title:"Square",source:"Simple Icons",path:"M5.342,2c-1.846,0-3.342,1.496-3.342,3.342v13.317c0,1.842 1.5,3.333 3.342,3.342h13.317c1.842,0 3.342-1.5 3.342-3.342v-13.325c-.005-1.842-1.499-3.333-3.342-3.333h-13.325zM6.692,5.633h10.617c.583,0 1.05,.475 1.05,1.058v10.617c0,.583-.467,1.058-1.05,1.058h-10.617c-.583,0-1.05-.475-1.05-1.058v-10.617c0-.581 .469-1.054 1.05-1.058zM9.883,9.258c-.336,0-.608,.272-.608,.608v4.242c0,.333 .267,.6 .6,.6h4.25c.333,0 .604-.267 .608-.6v-4.242c0-.336-.272-.608-.608-.608h-4.25z"},stripe:{title:"Stripe",source:"Simple Icons",path:"M13.948,9.189c-2.142-.795-3.31-1.406-3.31-2.376c0-.82 .674-1.287 1.875-1.287c2.196,0 4.453,.846 6.007,1.609l.878-5.419c-1.232-.59-3.752-1.551-7.235-1.551c-2.464,0-4.513,.645-5.978,1.846c-1.523,1.258-2.315,3.077-2.315,5.273c0,3.984 2.433,5.681 6.387,7.12c2.55,.907 3.398,1.552 3.398,2.548c0,.967-.828,1.524-2.322,1.524c-1.849,0-4.897-.908-6.894-2.08l-.888,5.479c1.717,.966 4.883,1.962 8.167,1.962c2.605,0 4.777-.615 6.241-1.788c1.641-1.287 2.49-3.192 2.49-5.653c0-4.071-2.489-5.771-6.504-7.205z"},supabase:{title:"Supabase",source:"Simple Icons",path:"M11.916,2.745c-.013-.832-1.064-1.19-1.582-.538l-7.818,9.835c-.923,1.162-.096,2.874 1.389,2.874h8.086l.095,6.339c.012,.831 1.063,1.189 1.581,.537l7.818-9.836c.923-1.161 .095-2.872-1.389-2.872h-8.139z"},teams:{title:"Microsoft Teams",source:"svgl",path:"M12,10.378h6.489c1.792,0 3.244,1.453 3.244,3.244v5.407c0,1.792-1.453,3.244-3.244,3.244c-1.792,0-3.244-1.453-3.244-3.244v-5.407c0-1.792-1.453-3.244-3.244-3.244zM4.43,12.541c0-1.792 1.453-3.244 3.244-3.244h4.326c1.792,0 3.244,1.453 3.244,3.244v6.489c0,1.792 1.453,3.244 3.244,3.244h-8.652c-2.986,0-5.407-2.421-5.407-5.407zM17.948,9.296c1.493,0 2.704-1.21 2.704-2.704c0-1.493-1.21-2.704-2.704-2.704c-1.493,0-2.704,1.21-2.704,2.704c0,1.493 1.21,2.704 2.704,2.704zM9.837,8.215c1.792,0 3.244-1.453 3.244-3.244c0-1.792-1.453-3.244-3.244-3.244c-1.792,0-3.244,1.453-3.244,3.244c0,1.792 1.453,3.244 3.244,3.244zM4.024,20.652c-.971,0-1.757-.787-1.757-1.757v-5.137c0-.971 .787-1.757 1.757-1.757h5.137c.971,0 1.757,.787 1.757,1.757v5.137c0,.971-.787,1.757-1.757,1.757zM8.474,14.761v-.906h-3.764v.906h1.323v4.037h1.117v-4.037h1.324zM8.474,14.761v-.906h-3.764v.906h1.323v4.037h1.117v-4.037h1.324z"},telegram:{title:"Telegram",source:"Simple Icons",path:"M11.953,2c-5.505,.026-9.953,4.495-9.953,10c0,5.523 4.477,10 10,10c5.523,0 10-4.477 10-10c0-5.523-4.477-10-10-10c-.016,0-.031,0-.047,0zM16.088,8.02c.083-.002 .268,.019 .388,.117c.08,.069 .131,.166 .143,.271c.013,.078 .03,.255 .017,.393c-.15,1.582-.802,5.418-1.133,7.189c-.14,.75-.416,1.001-.683,1.025c-.58,.054-1.021-.383-1.583-.752c-.88-.577-1.377-.937-2.232-1.5c-.987-.65-.347-1.008 .215-1.592c.148-.153 2.706-2.481 2.756-2.692c.006-.027 .012-.125-.047-.177c-.058-.052-.145-.034-.207-.02c-.088,.02-1.494,.95-4.217,2.788c-.4,.275-.761,.408-1.085,.4c-.357-.007-1.043-.201-1.554-.367c-.627-.204-1.124-.312-1.081-.657c.023-.18 .271-.364 .744-.552c2.915-1.27 4.858-2.107 5.832-2.512c2.777-1.155 3.354-1.356 3.73-1.362z"},vercel:{title:"Vercel",source:"Simple Icons",path:"M12,2.694l10.746,18.612h-21.492z"},webflow:{title:"Webflow",source:"Simple Icons",path:"M24,4.515l-7.658,14.97h-7.193l3.205-6.204h-.144c-2.644,3.432-6.589,5.692-12.21,6.204v-6.118c0,0 3.596-.213 5.71-2.435h-5.71v-6.417h6.417v5.278l.144-.001l2.622-5.277h4.854v5.244h.144l2.72-5.244z"},wix:{title:"Wix",source:"Simple Icons",path:"M0,7.355l2.113,9.292h.801c.726,0 1.354-.508 1.506-1.218l1.351-6.34c.016-.079 .086-.137 .167-.137c.08,0 .15,.058 .167,.137l1.352,6.34c.152,.71 .78,1.218 1.506,1.218h.805l2.113-9.292h-.565c-.62,0-1.159,.43-1.296,1.035l-1.26,5.545l-1.106-5.176c-.102-.473-.395-.883-.81-1.134c-.414-.251-.914-.319-1.38-.19c-.639,.176-1.113,.716-1.251,1.365l-1.094,5.127l-1.26-5.537c-.138-.605-.675-1.035-1.296-1.035zM13.992,7.355c-.525,0-.95,.425-.951,.95v8.342h.635c.525-.001 .95-.425 .951-.95v-8.343h-.635zM15.77,7.355l3.158,4.66l-3.14,4.632h1.325c.368,0 .712-.181 .918-.486l1.756-2.59c.022-.032 .059-.051 .099-.051c.039,0 .076,.019 .099,.051l1.754,2.59c.206,.305 .55,.486 .918,.486h1.326l-3.14-4.632l3.158-4.66h-1.326c-.368,0-.712,.181-.918,.486l-1.772,2.617c-.022,.032-.059,.051-.098,.051c-.039,0-.076-.019-.098-.051l-1.773-2.617c-.206-.304-.55-.486-.918-.486z"},zapier:{title:"Zapier",source:"Simple Icons",path:"M14.5,12.003c0,.744-.137,1.455-.384,2.113c-.656,.248-1.369,.384-2.112,.384h-.007c-.744,0-1.454-.137-2.112-.384c-.247-.657-.384-1.369-.384-2.112v-.007c0-.744 .137-1.454 .384-2.112c.658-.247 1.368-.384 2.112-.384h.008c.744,0 1.457,.137 2.113,.385c.248,.657 .384,1.368 .384,2.113zM21.863,10.333h-5.837l4.123-4.127c-.325-.457-.683-.883-1.079-1.277c-.394-.395-.821-.756-1.275-1.08l-4.128,4.124v-5.836c-.541-.087-1.094-.137-1.662-.137h-.008c-.567,0-1.122,.051-1.662,.138v5.838l-4.125-4.124c-.457,.322-.883,.684-1.278,1.078c-.395,.395-.757,.823-1.08,1.278l4.124,4.127h-5.836c0,0-.137,1.097-.137,1.663v.008c0,.567 .051,1.123 .138,1.663h5.838l-4.124,4.127c.648,.913 1.444,1.709 2.356,2.358l4.127-4.125v5.837c.54,.088 1.094,.138 1.659,.138h.014c.566,0 1.12-.05 1.659-.137v-5.837l4.127,4.125c.457-.312 .883-.677 1.274-1.075h.004c.394-.387 .755-.813 1.08-1.276l-4.125-4.124h5.837c.088-.537 .138-1.087 .138-1.65v-.026c0-.565-.05-1.119-.137-1.658"}};var sw=j(fe(),1);function cE({id:e}){let t=uE[e];return(0,sw.jsx)("svg",{viewBox:"0 0 24 24",focusable:"false","aria-hidden":"true",children:(0,sw.jsx)("path",{fill:"currentColor",fillRule:t.evenodd?"evenodd":void 0,d:t.path})})}var k=j(fe(),1),fV={"/settings/lead":(0,k.jsx)(Oi,{}),"/settings/flows":(0,k.jsx)(Ui,{}),"/settings/integrations":(0,k.jsx)(bf,{}),"/settings/models":(0,k.jsx)(Jd,{}),"/settings/skills":(0,k.jsx)(Xo,{}),"/settings/tools":(0,k.jsx)(Vi,{}),"/settings/knowledge":(0,k.jsx)(Pi,{}),"/settings/learning":(0,k.jsx)($o,{}),"/settings/sign-in":(0,k.jsx)(mf,{}),"/settings/sessions":(0,k.jsx)(cf,{}),"/settings/project":(0,k.jsx)(nf,{}),"/settings/policy":(0,k.jsx)(tf,{}),"/settings/approval":(0,k.jsx)(kf,{}),"/settings/monitoring":(0,k.jsx)(jd,{}),"/settings/retention":(0,k.jsx)(Zd,{}),"/settings/storage":(0,k.jsx)(lf,{}),"/settings/updates":(0,k.jsx)(wf,{}),"/settings/backups":(0,k.jsx)(ef,{}),"/settings/data":(0,k.jsx)(Fi,{})},dE=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-");function Er({csrf:e}){return(0,k.jsx)("input",{type:"hidden",name:"csrf",value:e})}function mc({action:e,csrf:t,children:a,className:n}){let o=(0,Oa.useRef)(null);return(0,k.jsxs)("form",{ref:o,method:"post",action:e,className:n,children:[(0,k.jsx)(Er,{csrf:t}),a(()=>setTimeout(()=>o.current?.requestSubmit(),0))]})}function Ar({title:e,description:t,children:a,id:n}){return(0,k.jsxs)(ba,{id:n,"aria-labelledby":n?`${n}-title`:void 0,children:[(0,k.jsx)(D5,{children:(0,k.jsxs)("div",{className:"grid gap-1",children:[(0,k.jsx)(_5,{id:n?`${n}-title`:void 0,children:e}),t&&(0,k.jsx)(P5,{children:t})]})}),a]})}function Mr({tone:e}){return(0,k.jsx)("span",{"aria-hidden":"true",className:ee("size-2 shrink-0 rounded-full",e==="ok"&&"bg-success",e==="warn"&&"bg-warning",e==="neutral"&&"bg-muted-foreground",e==="off"&&"border-[1.5px] border-muted-foreground")})}function pV({view:e,csrf:t}){return(0,k.jsxs)("form",{method:"post",action:"/settings/appearance",className:"flex flex-wrap items-center gap-3",children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsx)("div",{role:"group","aria-label":"Theme",className:"inline-flex rounded-lg bg-muted p-0.5",children:[["system","Match device",(0,k.jsx)(xf,{},"m")],["light","Light",(0,k.jsx)(If,{},"s")],["dark","Dark",(0,k.jsx)(vf,{},"d")]].map(([n,o,r])=>(0,k.jsxs)("button",{type:"submit",name:"theme",value:n,"aria-pressed":e.theme===n,className:ee("inline-flex h-7 items-center gap-2 rounded-md px-2.5 text-[13px] font-medium text-muted-foreground transition-colors hover:text-foreground phone:h-11 [&_svg]:size-3.5",e.theme===n&&"bg-card text-foreground shadow-[var(--so-pill-shadow)]"),children:[r,o]},n))}),(0,k.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"Saved in this browser."})]})}var qg=e=>Math.min(1,Math.max(0,e));function fE({h:e,s:t,v:a}){let n=o=>{let r=(o+e/60)%6;return a-a*t*Math.max(0,Math.min(r,4-r,1))};return`#${[n(5),n(3),n(1)].map(o=>Math.round(o*255).toString(16).padStart(2,"0")).join("")}`}function pE(e){let[t,a,n]=[1,3,5].map(i=>parseInt(e.slice(i,i+2),16)/255),o=Math.max(t,a,n),r=o-Math.min(t,a,n);return{h:(r===0?0:o===t?((a-n)/r+6)%6:o===a?(n-t)/r+2:(t-a)/r+4)*60,s:o===0?0:r/o,v:o}}function mV(e){let t=document.documentElement,a=t.dataset.theme==="dark"||t.dataset.theme!=="light"&&matchMedia("(prefers-color-scheme: dark)").matches,n=rw(e)[a?"dark":"light"];for(let[o,r]of[["signal",n.signal],["signal-hover",n.hover],["on-signal",n.on],["signal-soft",n.soft],["selection",n.selection]])t.style.setProperty(`--so-${o}`,r)}function hV({hsv:e,onChange:t}){let a=n=>{let o=n.currentTarget.getBoundingClientRect();t({h:e.h,s:qg((n.clientX-o.left)/o.width),v:1-qg((n.clientY-o.top)/o.height)})};return(0,k.jsx)("div",{role:"slider",tabIndex:0,"aria-label":"Saturation and brightness","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e.s*100),"aria-valuetext":`saturation ${Math.round(e.s*100)}%, brightness ${Math.round(e.v*100)}%`,className:"relative h-28 w-44 shrink-0 cursor-crosshair touch-none rounded-lg shadow-[inset_0_0_0_1px_rgb(0_0_0/.08)] phone:h-36 phone:w-full",style:{background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${e.h} 100% 50%))`},onPointerDown:n=>{n.currentTarget.setPointerCapture(n.pointerId),a(n)},onPointerMove:n=>{n.buttons!==0&&a(n)},onKeyDown:n=>{let o=n.shiftKey?.1:.02,r={ArrowLeft:[-o,0],ArrowRight:[o,0],ArrowUp:[0,o],ArrowDown:[0,-o]}[n.key];r!==void 0&&(n.preventDefault(),t({h:e.h,s:qg(e.s+r[0]),v:qg(e.v+r[1])}))},children:(0,k.jsx)("span",{"aria-hidden":"true",className:"pointer-events-none absolute size-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/.35)]",style:{left:`${e.s*100}%`,top:`${(1-e.v)*100}%`}})})}function gV({view:e,csrf:t}){let[a,n]=(0,Oa.useState)(e.accent),[o,r]=(0,Oa.useState)(()=>pE(e.accent)),[s,i]=(0,Oa.useState)(e.accent),[l,c]=(0,Oa.useState)(null),f=(0,Oa.useRef)(void 0),u=(v,b)=>{n(v),i(v),r(b??pE(v)),mV(v),c(null),window.clearTimeout(f.current),f.current=window.setTimeout(async()=>{let x=await fetch("/settings/appearance",{method:"POST",body:new URLSearchParams({csrf:t,accent:v,quiet:"1"})}).catch(()=>null);c(x?.ok?"Saved":"Not saved. Try again.")},400)};(0,Oa.useEffect)(()=>()=>window.clearTimeout(f.current),[]);let d=()=>{let v=sE(s);v===null?i(a):v!==a&&u(v)},p=e.accentPresets.find(v=>v.hex===a),g=iE(a);return(0,k.jsxs)("div",{className:"flex flex-col gap-3","data-accent-picker":!0,children:[(0,k.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,k.jsx)(hV,{hsv:o,onChange:v=>u(fE(v),v)}),(0,k.jsxs)("div",{className:"flex min-w-0 flex-1 basis-52 flex-col gap-2.5",children:[(0,k.jsx)("input",{type:"range",min:0,max:359,value:Math.round(o.h),"aria-label":"Hue",onChange:v=>{let b={...o,h:Number(v.target.value),s:o.s||.75,v:o.v||.75};u(fE(b),b)},className:"h-3 w-full cursor-pointer appearance-none rounded-full phone:h-11 phone:bg-[length:100%_12px] phone:bg-center phone:bg-no-repeat bg-[linear-gradient(to_right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring [&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-white [&::-moz-range-thumb]:bg-transparent [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:shadow-[0_0_0_1px_rgb(0_0_0/.35)]"}),(0,k.jsxs)("div",{className:"flex items-center gap-2",children:[(0,k.jsx)("span",{"aria-hidden":"true",className:"size-8 shrink-0 rounded-md shadow-[inset_0_0_0_1px_rgb(0_0_0/.12)]",style:{background:a}}),(0,k.jsx)(ve,{value:s,"aria-label":"Hex colour",spellCheck:!1,autoComplete:"off",className:"w-28 font-mono",onChange:v=>i(v.target.value),onBlur:d,onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),d())}}),(0,k.jsx)(J,{variant:"ghost",size:"sm",disabled:a===e.accentPresets[0].hex,onClick:()=>u(e.accentPresets[0].hex),children:"Reset"})]}),(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-2","aria-hidden":"true",children:[(0,k.jsx)("span",{className:"inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-attention px-1.5 font-mono text-[11px] leading-none text-on-attention",children:"3"}),(0,k.jsx)(ya,{tone:"attention",children:"Needs your decision"}),(0,k.jsx)("span",{className:"inline-flex h-7 items-center rounded-md bg-attention px-2.5 text-[12.5px] font-medium text-on-attention",children:"Approve"})]}),(0,k.jsxs)("p",{className:"text-[12.5px] text-muted-foreground","aria-live":"polite","data-accent-status":!0,children:[p!==void 0?(0,k.jsxs)(k.Fragment,{children:[p.name,p.year!==null&&(0,k.jsxs)("span",{className:"font-mono",children:[" ",p.year]})]}):"Custom",l!==null&&` · ${l}`]})]})]}),g!==null&&(0,k.jsx)("p",{className:"text-[12.5px] text-warning",children:g}),(0,k.jsx)("div",{role:"group","aria-label":"Presets",className:"flex flex-wrap gap-1.5",children:e.accentPresets.map(v=>(0,k.jsx)("button",{type:"button","data-preset":v.id,"aria-pressed":v.hex===a,"aria-label":`${v.name}${v.year===null?", the default":`, ${v.year}`}`,title:`${v.name}${v.year===null?"":` · ${v.year}`}`,onClick:()=>u(v.hex),style:{background:v.hex},className:ee("size-6 rounded-full shadow-[inset_0_0_0_1px_rgb(0_0_0/.12)] ring-offset-2 ring-offset-card transition-shadow phone:size-11",v.hex===a?"ring-2 ring-foreground":"hover:ring-2 hover:ring-input")},v.id))}),(0,k.jsx)("p",{className:"text-[12.5px] text-muted-foreground",children:"Presets are Pantone's colours of the year. Colours are deepened or lightened as needed so text stays readable. Saved in this browser."})]})}function mE({title:e,description:t,action:a,field:n,value:o,canManage:r,changed:s,options:i,csrf:l}){let c=(0,Oa.useId)(),f=i.find(u=>u.value===o);return(0,k.jsxs)(Ar,{title:e,description:t,children:[r?(0,k.jsx)(mc,{action:a,csrf:l,children:u=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(tg,{name:n,defaultValue:o,onValueChange:u,className:"grid gap-2 desk:grid-cols-2","aria-label":e,children:i.map(d=>(0,k.jsx)(Ef,{id:`${c}-${d.value}`,value:d.value,title:d.title,description:d.description},d.value))}),(0,k.jsx)("noscript",{children:(0,k.jsx)(J,{type:"submit",className:"mt-3",children:"Save"})})]})}):(0,k.jsxs)("p",{className:"text-sm",children:[(0,k.jsx)("strong",{children:f?.title??o})," ",(0,k.jsx)("span",{className:"text-muted-foreground",children:"· an approver can change this"})]}),s&&(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:s})]})}function xV({email:e,csrf:t}){let a=e.google.connected,n=a!==null?`${a}, through Google`:e.set?`From ${e.from} through ${e.host}${e.imapHost===""?"":` · reads ${e.imapHost}`}`:"Not set up";return(0,k.jsx)(Ar,{id:"email",title:"Email",description:"Send email steps send from this account, and Email inbox triggers read it.",children:(0,k.jsxs)(ec,{defaultOpen:!e.set&&a===null,children:[(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,k.jsxs)("span",{className:"inline-flex items-center gap-2 text-sm",children:[(0,k.jsx)(Mr,{tone:e.set||a!==null?"ok":"off"}),n]}),(0,k.jsx)(tc,{asChild:!0,children:(0,k.jsxs)(J,{variant:"ghost",size:"sm",className:"ml-auto group",children:[e.set||a!==null?"Change":"Set up",(0,k.jsx)(ra,{className:"transition-transform group-data-[state=open]:rotate-90"})]})})]}),(0,k.jsx)(ac,{children:a!==null?(0,k.jsxs)("form",{method:"post",action:"/settings/google/disconnect",className:"mt-3 grid gap-3 rounded-lg bg-muted p-4","data-google-connected":!0,children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsxs)("p",{className:"text-[13px]",children:["Signed in with Google as ",(0,k.jsx)("strong",{children:a}),". Mail is sent and read through it."]}),(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,k.jsx)(J,{type:"submit",variant:"outline",formAction:"/settings/email-test",children:"Send a test email"}),(0,k.jsx)(J,{type:"submit",variant:"outline",formAction:"/settings/email-read-test",children:"Check the inbox"}),(0,k.jsx)(J,{type:"submit",variant:"ghost",children:"Disconnect Google"})]})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("form",{method:"post",action:"/settings/email",className:"mt-3 grid gap-3 rounded-lg bg-muted p-4","data-email-settings":!0,children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"For Gmail: smtp.gmail.com, port 587, your address, and an app password. To read mail too, add imap.gmail.com."}),(0,k.jsxs)("div",{className:"grid gap-3 desk:grid-cols-[1fr_7rem]",children:[(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-host",children:"Mail server"}),(0,k.jsx)(ve,{id:"email-host",name:"host",defaultValue:e.host,placeholder:"smtp.gmail.com",required:!0})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-port",children:"Port"}),(0,k.jsx)(ve,{id:"email-port",name:"port",type:"number",min:1,max:65535,defaultValue:String(e.port),required:!0})]})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-from",children:"Send from"}),(0,k.jsx)(ve,{id:"email-from",name:"from",type:"email",defaultValue:e.from,placeholder:"you@example.com",required:!0})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-user",children:"Username"}),(0,k.jsx)(ve,{id:"email-user",name:"user",autoComplete:"username",defaultValue:e.user,placeholder:"Usually the same address"})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-password",children:"Password"}),(0,k.jsx)(ve,{id:"email-password",name:"password",type:"password",autoComplete:"off",placeholder:e.set?"Leave empty to keep the saved one":"An app password"})]}),(0,k.jsxs)("label",{className:"flex items-center gap-2 text-[13px] phone:-ml-3.5 phone:min-h-11 phone:pl-3.5",children:[(0,k.jsx)("input",{type:"checkbox",name:"secure",className:"size-4 accent-[var(--so-accent)]",defaultChecked:e.secure}),"Use SSL from the start (port 465)"]}),(0,k.jsxs)("div",{className:"grid gap-3 desk:grid-cols-[1fr_7rem]",children:[(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-imap",children:"Read mail from (optional)"}),(0,k.jsx)(ve,{id:"email-imap",name:"imapHost",defaultValue:e.imapHost,placeholder:"imap.gmail.com"})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-imap-port",children:"Port"}),(0,k.jsx)(ve,{id:"email-imap-port",name:"imapPort",type:"number",min:1,max:65535,defaultValue:String(e.imapPort)})]})]}),(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,k.jsx)(J,{type:"submit",children:"Save email"}),e.set&&(0,k.jsx)(J,{type:"submit",variant:"outline",formAction:"/settings/email-test",formNoValidate:!0,children:"Send a test email"}),e.set&&e.imapHost!==""&&(0,k.jsx)(J,{type:"submit",variant:"outline",formAction:"/settings/email-read-test",formNoValidate:!0,children:"Check the inbox"})]})]}),(0,k.jsxs)("details",{className:"mt-3 rounded-lg border px-4 py-3",open:e.google.clientId!==""&&!e.set,"data-google-setup":!0,children:[(0,k.jsx)("summary",{className:"cursor-pointer text-[13px] font-semibold phone:-my-3 phone:min-h-11 phone:py-3 phone:leading-5",children:"Or sign in with a Google account"}),(0,k.jsxs)("form",{method:"post",action:"/settings/google",className:"mt-3 grid gap-3",children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsxs)("ol",{className:"list-decimal space-y-1 pl-5 text-[13px] text-muted-foreground",children:[(0,k.jsxs)("li",{children:["In Google Cloud Console, make an OAuth client of type ",(0,k.jsx)("em",{children:"Web application"}),", and set the consent screen to ",(0,k.jsx)("em",{children:"In production"})," (while it's in Testing, Google ends the connection after 7 days)."]}),e.google.redirect===null?(0,k.jsx)("li",{children:"Open these settings on this computer (localhost) or at your https address to see the redirect address to add."}):(0,k.jsxs)("li",{children:["Add this as an authorized redirect address: ",(0,k.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-foreground","data-google-redirect":!0,children:e.google.redirect})]}),(0,k.jsx)("li",{children:"Paste the client ID and secret here, then connect. Google warns that it hasn't verified the app: it's your own, so continue."})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"google-id",children:"Client ID"}),(0,k.jsx)(ve,{id:"google-id",name:"clientId",defaultValue:e.google.clientId,placeholder:"….apps.googleusercontent.com",required:!0})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"google-secret",children:"Client secret"}),(0,k.jsx)(ve,{id:"google-secret",name:"clientSecret",type:"password",autoComplete:"off",placeholder:e.google.clientId!==""?"Leave empty to keep the saved one":""})]}),(0,k.jsx)(J,{type:"submit",className:"justify-self-start",disabled:e.google.redirect===null,children:"Connect Google"})]})]})]})})]})})}function vV({providers:e,csrf:t}){return(0,k.jsx)(Ar,{id:"providers",title:"AI providers",description:"Keys stay on this computer and are never shown again.",children:(0,k.jsx)("ul",{className:"-my-1 divide-y divide-border",children:e.map(a=>(0,k.jsx)("li",{className:"py-2",children:(0,k.jsxs)(ec,{children:[(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,k.jsx)("span",{className:"font-semibold",children:a.name}),(0,k.jsxs)("span",{className:"inline-flex items-center gap-2 text-sm text-muted-foreground",children:[(0,k.jsx)(Mr,{tone:a.tone}),a.words]}),(0,k.jsx)(tc,{asChild:!0,children:(0,k.jsxs)(J,{variant:"ghost",size:"sm",className:"ml-auto group",children:["Manage",(0,k.jsx)(ra,{className:"transition-transform group-data-[state=open]:rotate-90"})]})})]}),(0,k.jsx)(ac,{children:(0,k.jsxs)("form",{method:"post",action:"/settings/provider-key",className:"mt-3 grid gap-3 rounded-lg bg-muted p-4",children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsx)("input",{type:"hidden",name:"provider",value:a.provider}),a.connection&&(0,k.jsxs)("p",{className:"provider-connection text-sm",children:[(0,k.jsx)("strong",{children:a.connection.words})," ",a.connection.facts," · ",(0,k.jsx)("a",{className:"underline underline-offset-4",href:a.connection.checkHref,children:"Check again"})]}),(0,k.jsxs)("p",{className:"text-[13px] text-muted-foreground",children:[a.usage," · ",(0,k.jsx)("code",{className:"font-mono text-xs",children:a.envName})]}),a.subscriptionCapable&&(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:`${a.provider}-auth`,children:"Sign-in"}),(0,k.jsxs)(Ff,{name:"auth-mode",defaultValue:a.mode,children:[(0,k.jsx)(qf,{id:`${a.provider}-auth`,children:(0,k.jsx)(Hf,{})}),(0,k.jsxs)(Uf,{children:[(0,k.jsxs)(Qu,{value:"subscription",children:[a.name," subscription"]}),(0,k.jsx)(Qu,{value:"api-key",children:"API key"})]})]})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:`${a.provider}-key`,children:"API key"}),(0,k.jsx)(ve,{id:`${a.provider}-key`,type:"password",name:"value",autoComplete:"off",placeholder:a.set?"Paste to replace the stored key":"Paste a key"})]}),(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,k.jsxs)(J,{type:"submit",children:["Save ",a.name]}),a.set&&(0,k.jsxs)(ec,{children:[(0,k.jsx)(tc,{asChild:!0,children:(0,k.jsx)(J,{variant:"ghost",size:"sm",className:"text-destructive",children:"Remove the stored key"})}),(0,k.jsxs)(ac,{className:"mt-2 grid gap-2",children:[(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"Runs that use this API key stop until you add one again."}),(0,k.jsx)(J,{type:"submit",variant:"destructive",size:"sm",formAction:"/settings/provider-key-clear",children:"Remove key"})]})]})]})]})})]})},a.provider))})})}function yV({workers:e}){return(0,k.jsxs)(Ar,{id:"workers",title:"Workers",description:"How many tasks each worker runs at once, and what it is running now.",children:[e.length===0?(0,k.jsxs)("p",{className:"text-sm text-muted-foreground",children:["No worker is connected. Run ",(0,k.jsx)("code",{className:"font-mono text-xs",children:"toolroll up"})," on the computer with your projects."]}):(0,k.jsx)("ul",{className:"-my-1 divide-y divide-border",children:e.map(t=>(0,k.jsxs)("li",{className:"grid gap-1.5 py-2.5","data-worker":t.name,children:[(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,k.jsx)("span",{className:"min-w-0 break-all font-semibold",children:t.name}),(0,k.jsxs)("span",{className:"inline-flex items-center gap-2 text-sm text-muted-foreground",children:[(0,k.jsx)(Mr,{tone:t.tone}),t.state]}),(0,k.jsxs)("span",{className:"ml-auto text-sm tabular-nums","data-worker-load":!0,children:[t.busy," of ",t.capacity," running"]})]}),t.running.length===0?(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"Nothing running."}):(0,k.jsx)("ul",{className:"grid gap-1",children:t.running.map(a=>(0,k.jsxs)("li",{className:"flex min-w-0 items-baseline gap-2 text-sm",children:[(0,k.jsx)("a",{className:"min-w-0 truncate underline-offset-4 hover:underline phone:min-h-11 phone:leading-[44px]",href:a.href,children:a.title}),a.project&&(0,k.jsx)("span",{className:"shrink-0 text-[13px] text-muted-foreground",children:a.project})]},a.taskId))})]},t.name))}),e.length>0&&(0,k.jsxs)("p",{className:"mt-3 text-[13px] text-muted-foreground",children:["To change how many a worker runs at once: ",(0,k.jsx)("code",{className:"font-mono text-xs",children:"toolroll runner capacity <name> <n>"})]})]})}function bV({updates:e,csrf:t,firstResult:a}){let n=e.latest,o=n!==null&&n.newer?n:null,[r,s]=(0,Oa.useState)(!1),i=()=>{navigator.clipboard?.writeText(e.updateCommand).then(()=>{s(!0),window.setTimeout(()=>s(!1),1500)},()=>{})};return(0,k.jsxs)(Ar,{id:"updates",title:"Updates",children:[(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1","data-updates-state":o?"newer":e.check.on?n===null?"unchecked":"current":"off",children:[(0,k.jsxs)("span",{className:"text-sm",children:["This version ",(0,k.jsx)("span",{className:"font-mono text-[12.5px]",children:e.current})]}),(0,k.jsx)("span",{className:"inline-flex items-center gap-2 text-sm text-muted-foreground",children:o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Mr,{tone:"neutral"}),(0,k.jsxs)("span",{children:[(0,k.jsx)("span",{className:"font-mono text-[12.5px] text-foreground",children:o.version})," is available"]})]}):e.check.on?n===null?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Mr,{tone:"off"}),"Not checked yet"]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Mr,{tone:"ok"}),"Up to date"]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Mr,{tone:"off"}),"Checks are off"]})}),o?.security&&(0,k.jsx)(ya,{tone:"warning",children:"Security fixes"})]}),a!==null&&(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground","data-first-result":!0,children:a}),o&&(0,k.jsxs)("div",{className:"grid gap-2 rounded-lg bg-muted p-3 phone:p-3","data-update-command":!0,children:[(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,k.jsx)("code",{className:"min-w-0 flex-1 break-words font-mono text-[12.5px]",children:e.updateCommand}),(0,k.jsx)(J,{variant:"outline",size:"sm",onClick:i,children:r?"Copied":"Copy"})]}),(0,k.jsx)("p",{className:"text-[12.5px] text-muted-foreground",children:"Run it on this computer, then restart Toolroll."})]}),o&&(0,k.jsxs)(ec,{children:[(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,k.jsx)(tc,{asChild:!0,children:(0,k.jsxs)(J,{variant:"ghost",size:"sm",className:"group -ml-2.5",disabled:o.notes==="",children:["What's new in ",o.version,(0,k.jsx)(ra,{className:"transition-transform group-data-[state=open]:rotate-90"})]})}),(0,k.jsx)("a",{className:"text-[13px] underline underline-offset-4",href:o.url,target:"_blank",rel:"noreferrer",children:"Release page"})]}),(0,k.jsx)(ac,{children:(0,k.jsx)("pre",{className:"mt-2 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-lg border border-border p-3 font-sans text-[13px] leading-relaxed","data-update-notes":!0,children:o.notes})})]}),(0,k.jsx)(Ju,{}),(0,k.jsx)(mc,{action:"/settings/updates/checks",csrf:t,className:"flex items-center justify-between gap-4",children:l=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("div",{className:"grid gap-0.5",children:[(0,k.jsx)(St,{htmlFor:"update-check",children:"Check for a newer version once a day"}),(0,k.jsx)("span",{className:"text-[12.5px] text-muted-foreground",children:e.check.byEnv?"Off by TOOLROLL_NO_UPDATE_CHECK.":"One anonymous request to npm and GitHub. Nothing about you is sent."})]}),(0,k.jsx)(Mb,{id:"update-check",name:"check",value:"on",defaultChecked:e.check.on,disabled:!e.check.canManage||e.check.byEnv,onCheckedChange:l})]})}),e.workers.length>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Ju,{}),(0,k.jsx)("ul",{className:"-my-1 divide-y divide-border","aria-label":"Worker versions",children:e.workers.map(l=>(0,k.jsxs)("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 py-2","data-worker-version":l.name,children:[(0,k.jsx)("span",{className:"min-w-0 break-all text-sm font-medium",children:l.name}),(0,k.jsx)("span",{className:ee("ml-auto text-muted-foreground",l.version===null?"text-[12.5px]":"font-mono text-[12.5px]"),children:l.version??"Version not reported"}),l.older&&(0,k.jsx)(ya,{tone:"warning",children:"Older"})]},l.name))})]})]})}var wV=[["off","Off"],["first","First one"],["all","Up to 4"]];function SV({view:e,csrf:t}){let a=(0,Oa.useId)();return!e.chat&&e.services===null&&e.push===null&&e.digest===null?null:(0,k.jsxs)(Ar,{id:"notifications",title:"Notifications",children:[e.chat&&(0,k.jsx)(mc,{action:"/settings/notifications",csrf:t,className:"grid gap-4 phone:gap-3",children:n=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(tg,{name:"mode",defaultValue:e.chat.mode,onValueChange:n,className:"grid gap-2 desk:grid-cols-2","aria-label":"Chat messages",children:[(0,k.jsx)(Ef,{id:`${a}-quiet`,value:"quiet",title:"Only when I'm needed",description:"One message per task, updated as it moves."}),(0,k.jsx)(Ef,{id:`${a}-all`,value:"all",title:"Every step",description:"A new message for each update."})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:`${a}-evening`,children:"Evening digest"}),(0,k.jsxs)(Ff,{name:"digest",defaultValue:e.chat.digestAt??"off",onValueChange:n,children:[(0,k.jsx)(qf,{id:`${a}-evening`,className:"desk:max-w-72",children:(0,k.jsx)(Hf,{})}),(0,k.jsx)(Uf,{children:lE(e.chat.digestAt).map(([o,r])=>(0,k.jsx)(Qu,{value:o,children:r},o))})]}),(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"One message: what finished, what waits, what failed."})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:`${a}-screenshots`,children:"Screenshots with results"}),(0,k.jsxs)(Ff,{name:"screenshots",defaultValue:e.chat.screenshots??"off",onValueChange:n,children:[(0,k.jsx)(qf,{id:`${a}-screenshots`,className:"desk:max-w-72",children:(0,k.jsx)(Hf,{})}),(0,k.jsx)(Uf,{children:wV.map(([o,r])=>(0,k.jsx)(Qu,{value:o,children:r},o))})]})]}),(0,k.jsx)("noscript",{children:(0,k.jsx)(J,{type:"submit",children:"Save"})})]})}),e.chat?.projects&&e.chat.projects.length>0&&(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)("span",{className:"font-semibold",children:"Projects"}),(0,k.jsx)("ul",{className:"-my-1 divide-y divide-border","aria-label":"Project pings",children:e.chat.projects.map((n,o)=>(0,k.jsx)("li",{"data-project-pings":n.name,children:(0,k.jsx)(mc,{action:"/settings/notifications/mute",csrf:t,className:"flex items-center justify-between gap-4 py-2",children:r=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("input",{type:"hidden",name:"repo",value:n.repo}),(0,k.jsx)(St,{htmlFor:`${a}-mute-${o}`,className:"min-w-0 break-all",children:n.name}),(0,k.jsx)(Mb,{id:`${a}-mute-${o}`,name:"pings",value:"on",defaultChecked:!n.muted,onCheckedChange:r,"aria-label":`Pings for ${n.name}`}),(0,k.jsx)("noscript",{children:(0,k.jsx)(J,{type:"submit",size:"sm",variant:"outline",children:"Save"})})]})})},n.repo))}),(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"Off: no pings. It still shows in Tasks and the evening digest."})]}),e.chat&&e.services&&(0,k.jsx)(Ju,{}),e.services&&(e.services.configured.length===1&&!e.services.implicit?(0,k.jsxs)("div",{className:"flex items-center gap-3",children:[(0,k.jsx)("span",{className:"font-semibold capitalize",children:e.services.configured[0]}),(0,k.jsxs)("span",{className:"inline-flex items-center gap-2 text-sm text-muted-foreground",children:[(0,k.jsx)(Mr,{tone:"ok"}),"Receiving alerts"]})]}):(0,k.jsx)(mc,{action:"/settings/messaging",csrf:t,children:n=>(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{children:"Alert service"}),e.services.implicit&&(0,k.jsx)("p",{className:"text-[13px] text-warning",children:"Several are connected and none was chosen. Pick one."}),(0,k.jsx)(tg,{name:"primary",...e.services.channel===null?{}:{defaultValue:e.services.channel},onValueChange:n,className:"grid gap-2 desk:grid-cols-2",children:e.services.configured.map(o=>(0,k.jsx)(Ef,{id:`${a}-${o}`,value:o,title:o.charAt(0).toUpperCase()+o.slice(1),description:o==="telegram"?"Answer buttons and replies":"Messages with links"},o))})]})})),e.push&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Ju,{}),(0,k.jsxs)("div",{className:"grid gap-3",children:[(0,k.jsxs)("div",{className:"grid gap-1",children:[(0,k.jsx)("span",{className:"font-semibold",children:"This device"}),(0,k.jsx)("span",{className:"text-[13px] text-muted-foreground",children:e.push.available?"A notification when something needs you. On iPhone, add this app to your Home Screen first.":"Alerts need a secure (https) address for this app."})]}),e.push.available&&(0,k.jsxs)("form",{method:"post",action:"/push/subscribe",id:"push-form",className:"flex flex-wrap items-end gap-3",children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsx)("input",{type:"hidden",name:"endpoint",value:""}),(0,k.jsx)("input",{type:"hidden",name:"p256dh",value:""}),(0,k.jsx)("input",{type:"hidden",name:"auth",value:""}),(0,k.jsxs)("div",{className:"grid min-w-56 flex-1 gap-2",children:[(0,k.jsx)(St,{htmlFor:"push-password",children:"Your password"}),(0,k.jsx)(ve,{id:"push-password",type:"password",name:"token",autoComplete:"current-password"})]}),(0,k.jsx)(J,{type:"submit",id:"push-enable",variant:"outline",children:"Get alerts on this device"}),(0,k.jsx)("p",{className:"w-full text-[13px] text-muted-foreground",id:"push-state","aria-live":"polite"})]}),e.push.devices.length>0&&(0,k.jsx)("ul",{className:"grid gap-2",children:e.push.devices.map(n=>(0,k.jsxs)("li",{className:"flex flex-wrap items-center gap-3 text-sm",children:[(0,k.jsx)("span",{children:n.words}),n.state!=="ok"&&(0,k.jsx)(ya,{tone:n.state==="failing"?"warning":"neutral",children:n.state}),n.removable&&(0,k.jsxs)("form",{method:"post",action:"/push/remove",className:"ml-auto",children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsx)("input",{type:"hidden",name:"id",value:n.id}),(0,k.jsx)(J,{type:"submit",variant:"ghost",size:"sm",children:"Remove"})]})]},n.id))})]})]}),e.digest&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Ju,{}),(0,k.jsx)(mc,{action:"/settings/telegram-digest",csrf:t,className:"grid gap-2",children:n=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(St,{htmlFor:`${a}-digest`,children:"Telegram digest"}),(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"Bundle routine updates. Anything that needs you still arrives at once."}),(0,k.jsxs)(Ff,{name:"every",defaultValue:e.digest.every,onValueChange:n,children:[(0,k.jsx)(qf,{id:`${a}-digest`,className:"desk:max-w-72",children:(0,k.jsx)(Hf,{})}),(0,k.jsx)(Uf,{children:[["off","Off: send each update"],["30","Every 30 minutes"],["60","Every hour"],["240","Every 4 hours"],["720","Every 12 hours"],["1440","Once a day"]].map(([o,r])=>(0,k.jsx)(Qu,{value:o,children:r},o))})]}),e.digest.held&&(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:e.digest.held})]})})]})]})}function CV({view:e,csrf:t}){return(0,k.jsxs)(ec,{className:"rounded-lg border border-border bg-card",children:[(0,k.jsx)(tc,{asChild:!0,children:(0,k.jsxs)("button",{className:"group flex w-full items-center justify-between gap-3 px-5 py-4 text-left phone:px-4",children:[(0,k.jsxs)("span",{className:"font-semibold",children:["Telegram bot token ",(0,k.jsx)("span",{className:"ml-2 text-sm font-normal text-muted-foreground",children:e.telegram.state})]}),(0,k.jsx)(ra,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"})]})}),(0,k.jsxs)(ac,{className:"grid gap-3 border-t border-border px-5 py-4 phone:px-4",children:[(0,k.jsxs)("p",{className:"text-[13px] text-muted-foreground",children:["Current: ",e.telegram.current]}),e.telegram.delivery!=null&&(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground","data-telegram-delivery":!0,children:e.telegram.delivery}),(0,k.jsxs)("form",{method:"post",action:"/settings/telegram-token",className:"flex flex-wrap items-end gap-3",children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsxs)("div",{className:"grid min-w-56 flex-1 gap-2",children:[(0,k.jsx)(St,{htmlFor:"telegram-token-field",children:"Token from @BotFather"}),(0,k.jsx)(ve,{id:"telegram-token-field",type:"password",name:"token",autoComplete:"off"})]}),(0,k.jsx)(J,{type:"submit",variant:"outline",children:"Save token"})]}),(0,k.jsxs)("p",{className:"text-[13px] text-muted-foreground",children:["Stored privately on this computer. Then pair your phone under ",(0,k.jsx)("a",{className:"underline underline-offset-4",href:"/settings/telegram",children:"Telegram"}),"."]})]})]})}function hE({view:e,csrf:t}){let[a]=(0,Oa.useState)(e.said);return(0,Oa.useEffect)(()=>{a&&gn(a.charAt(0).toUpperCase()+a.slice(1))},[a]),(0,k.jsxs)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 phone:gap-3",children:[(0,k.jsx)("h1",{className:"sr-only",children:"Settings"}),(0,k.jsx)("nav",{"aria-label":"Settings sections",className:"grid gap-4 phone:gap-3",children:e.groups.map(n=>(0,k.jsxs)("section",{"aria-labelledby":`settings-${dE(n.title)}`,className:"grid gap-2 phone:gap-1.5",children:[(0,k.jsx)("h2",{id:`settings-${dE(n.title)}`,className:"text-sm font-semibold text-muted-foreground",children:n.title}),(0,k.jsx)("div",{className:"grid grid-cols-2 gap-2 desk:grid-cols-4 phone:gap-1.5",children:n.tiles.map(o=>(0,k.jsxs)("a",{href:o.href,className:"flex min-h-12 items-center gap-2.5 rounded-lg border border-border bg-card px-3 py-2 text-sm font-semibold phone:min-h-11 phone:gap-2 phone:px-2.5 transition-colors hover:bg-accent [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-primary",children:[o.brand===void 0?fV[o.href]:(0,k.jsx)(cE,{id:o.brand}),(0,k.jsxs)("span",{className:"grid min-w-0 gap-0.5",children:[o.label,o.status&&(0,k.jsxs)("span",{className:"flex items-center gap-1.5 text-[13px] font-normal text-muted-foreground",children:[(0,k.jsx)(Mr,{tone:o.status.tone}),o.status.words]})]})]},o.href))}),n.title==="Chat apps"&&e.phone&&(0,k.jsx)(_M,{phone:e.phone,csrf:t,dismissable:!1})]},n.title))}),(0,k.jsx)(Ar,{title:"Appearance",children:(0,k.jsx)(pV,{view:e,csrf:t})}),(0,k.jsx)(Ar,{id:"accent",title:"Accent colour",description:"The one colour that marks what needs you.",children:(0,k.jsx)(gV,{view:e,csrf:t})}),e.permission&&(0,k.jsx)(mE,{title:"Unattended permissions",description:"The starting choice for new tasks. Approved tasks keep their setting.",action:"/settings/permission-default",field:"permission-mode",value:e.permission.mode,canManage:e.permission.canManage,changed:e.permission.changed,csrf:t,options:[{value:"auto",title:"Auto",description:"Asks before risky actions."},{value:"bypassPermissions",title:"Full access",description:"Never asks and can change files anywhere on this computer. Trusted repositories only."}]}),e.quality&&(0,k.jsx)(mE,{title:"Quality mode",description:"Publishing and deploying still need their own approval.",action:"/settings/quality-default",field:"quality-mode",value:e.quality.mode,canManage:e.quality.canManage,changed:e.quality.changed,csrf:t,options:[{value:"default",title:"Default",description:"Everyday agents and the repository check."},{value:"strict",title:"Strict / release",description:"Strongest agents. Release approval stays separate."}]}),e.providers&&(0,k.jsx)(vV,{providers:e.providers,csrf:t}),e.workers&&(0,k.jsx)(yV,{workers:e.workers}),e.updates?(0,k.jsx)(bV,{updates:e.updates,csrf:t,firstResult:e.firstResult??null}):e.firstResult&&(0,k.jsx)(Ar,{title:"This installation",children:(0,k.jsx)("p",{className:"text-sm","data-first-result":!0,children:e.firstResult})}),e.email&&t&&(0,k.jsx)(xV,{email:e.email,csrf:t}),(0,k.jsx)(SV,{view:e,csrf:t}),t&&(0,k.jsx)(CV,{view:e,csrf:t})]})}var Dr=j(he(),1);var ie=j(fe(),1),kV={"/inbox":(0,ie.jsx)(Hi,{}),"/code":(0,ie.jsx)(ks,{}),"/board":(0,ie.jsx)(df,{}),"/board?view=order":(0,ie.jsx)(ff,{}),"/tasks":(0,ie.jsx)(pf,{}),"/recipes":(0,ie.jsx)(Xo,{}),"/routines":(0,ie.jsx)(qi,{}),"/workbench":(0,ie.jsx)(Yd,{})},LV={neutral:"bg-foreground",warning:"bg-warning",danger:"bg-destructive"},xE={neutral:"",warning:"text-warning",danger:"text-destructive"};function IV({tile:e}){let t=(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsxs)("p",{className:"flex min-w-0 items-baseline gap-1.5 text-[12px] leading-4",children:[(0,ie.jsx)("span",{className:"truncate font-medium text-foreground",children:e.name}),(0,ie.jsx)("span",{className:"shrink-0 text-muted-foreground",children:e.window})]}),(0,ie.jsxs)("p",{className:ee("mt-2.5 flex items-baseline tabular-nums phone:mt-1.5",e.unit==="%"?"gap-px":"gap-1"),children:[(0,ie.jsx)("span",{className:ee("text-[22px] font-semibold leading-none tracking-[-0.02em]",e.tone==="danger"&&"text-destructive"),children:e.value}),(0,ie.jsx)("span",{className:"text-[12px] text-muted-foreground",children:e.unit})]}),(0,ie.jsxs)("div",{className:"relative mt-3 h-1.5 phone:mt-2 overflow-hidden rounded-full bg-muted",role:"meter","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(Math.min(100,e.percent)),"aria-label":`${e.name} ${e.window}`,children:[(0,ie.jsx)("div",{className:ee("h-full rounded-full motion-safe:transition-[width] motion-safe:duration-500 motion-safe:ease-out",LV[e.tone]),style:{width:`${Math.min(100,Math.max(0,e.percent))}%`}}),e.marks.map(n=>(0,ie.jsx)("span",{"aria-hidden":"true",className:"absolute inset-y-0 w-0.5 bg-card",style:{left:`calc(${n}% - 1px)`}},n))]}),(0,ie.jsx)("p",{className:ee("mt-2 truncate text-[12px] leading-4 phone:mt-1.5",e.tone==="neutral"?"text-muted-foreground":xE[e.tone]),children:e.detail})]}),a="block min-w-0 rounded-[10px] border border-border bg-card px-3.5 py-3 phone:w-[152px] phone:px-3 phone:py-2.5 phone:shrink-0 phone:snap-start";return(0,ie.jsx)("li",{"data-limit":e.key,title:e.title??void 0,className:"min-w-0 phone:shrink-0",children:e.href===null?(0,ie.jsx)("div",{className:a,children:t}):(0,ie.jsx)("a",{href:e.href,className:ee(a,"transition-colors hover:border-input hover:bg-[var(--so-raised)]"),children:t})})}function gE({limits:e,id:t,className:a}){return(0,ie.jsx)("section",{"aria-label":"Usage",id:t,className:a,children:(0,ie.jsx)("ul",{className:"grid grid-cols-[repeat(auto-fill,minmax(176px,1fr))] gap-2 phone:-mx-4 phone:flex phone:snap-x phone:snap-mandatory phone:scroll-px-4 phone:overflow-x-auto phone:px-4 phone:pb-1 phone:[scrollbar-width:none]",children:e.tiles.map(n=>(0,ie.jsx)(IV,{tile:n},n.key))})})}function NV(e){let t=new Set;return e.tiles.map(a=>{let n=t.has(a.name)?a.window:a.name;return t.add(a.name),{key:a.key,text:`${n} ${Math.round(Math.max(0,a.percent))}%`,tone:a.tone}})}function RV({row:e,grouped:t}){let a="text-[12px] desk:col-start-1 desk:row-start-1 desk:justify-self-start phone:col-start-1 phone:row-start-2 phone:self-center";return e.ask===null?(0,ie.jsx)(ul,{label:e.status.label,tone:e.status.tone==="attention"?"neutral":e.status.tone,className:a}):e.chip===null&&t?(0,ie.jsx)("span",{className:ee("sr-only",a),"data-headline":e.status.label,children:e.status.label}):(0,ie.jsx)("span",{"data-ask":e.ask,...e.chip===null?{}:{"data-chip":e.chip},"data-headline":e.status.label,title:e.status.label,className:ee("inline-flex w-fit shrink-0 items-center whitespace-nowrap rounded-[5px] bg-primary px-1.5 py-px font-semibold leading-[18px] text-primary-foreground",a),children:e.chip===null?e.status.label:(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsxs)("span",{className:"sr-only",children:[e.status.label,": "]}),e.chip]})})}function iw({row:e,grouped:t=!1}){let a=e.ask!==null;return(0,ie.jsxs)("li",{"data-task":e.id,"data-work-status":e.status.token,"data-group":e.group,className:"grid grid-cols-1 gap-y-2 border-b border-border px-2 py-3 transition-colors hover:bg-[var(--so-raised)] desk:col-span-3 desk:grid-cols-subgrid desk:items-center desk:gap-x-4 phone:grid-cols-[auto_minmax(0,1fr)_auto] phone:gap-x-2 phone:gap-y-0.5 phone:py-1.5",children:[(0,ie.jsxs)("div",{className:"min-w-0 desk:col-start-2 desk:row-start-1 phone:contents",children:[(0,ie.jsx)("a",{href:e.href,className:ee("block text-[13.5px] leading-snug hover:underline hover:underline-offset-4 phone:col-[1/3] phone:row-start-1 phone:flex phone:min-h-11 phone:items-center",a?"font-semibold":"font-medium"),children:e.title}),(0,ie.jsxs)("p",{className:"mt-0.5 flex flex-wrap items-center gap-x-1.5 text-[12.5px] text-muted-foreground phone:col-[2/4] phone:row-start-2 phone:mt-0 phone:min-w-0 phone:leading-[1.35]",children:[e.project&&(0,ie.jsx)("span",{className:"text-foreground/80",children:e.project}),e.project&&(0,ie.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,ie.jsx)("span",{className:"tabular-nums",children:e.age})]}),e.detail&&(0,ie.jsx)("p",{className:ee("mt-1 text-[12.5px] phone:col-span-full phone:leading-[1.35]",e.status.label==="Failed"?"text-destructive":"text-muted-foreground"),...e.status.label==="Failed"?{"data-problem-line":""}:{},children:e.detail}),e.problem&&(0,ie.jsx)("p",{className:"mt-1 text-[12.5px] text-muted-foreground phone:col-span-full phone:leading-[1.35]",children:e.problem}),e.notes.map(n=>(0,ie.jsx)("p",{className:"mt-1 text-[12.5px] text-muted-foreground phone:col-span-full phone:leading-[1.35]",children:n},n))]}),(0,ie.jsxs)("div",{className:"flex items-center gap-3 phone:contents desk:contents",children:[(0,ie.jsx)(RV,{row:e,grouped:t}),e.action&&(0,ie.jsx)(J,{asChild:!0,variant:"outline",size:"sm",className:"desk:col-start-3 desk:row-start-1 desk:justify-self-end phone:col-start-3 phone:row-start-1 phone:self-start",children:(0,ie.jsxs)("a",{href:e.action.href,"data-primary-action":!0,children:[e.action.label,(0,ie.jsx)(Cs,{})]})})]})]})}function TV({view:e}){let t="desk:grid desk:grid-cols-[auto_minmax(0,1fr)_auto]";if(e.groups===null)return(0,ie.jsx)("ul",{className:ee(t,"border-t border-border"),children:e.rows.map(r=>(0,ie.jsx)(iw,{row:r},r.id))});let a=e.groups.map(r=>({...r,rows:e.rows.filter(s=>s.group===r.key)})).filter(r=>r.rows.length>0),n=new Set(a.map(r=>r.key)),o=e.rows.filter(r=>!n.has(r.group));return(0,ie.jsxs)("div",{className:ee(t,"flex flex-col gap-5 phone:gap-3.5 desk:gap-0"),children:[a.map((r,s)=>(0,ie.jsxs)("section",{"data-task-group":r.key,"aria-labelledby":`task-group-${r.key}`,className:"desk:contents",children:[(0,ie.jsxs)("h2",{id:`task-group-${r.key}`,className:ee("flex items-baseline gap-2 border-b border-border px-2 pb-1.5 text-[13px] font-semibold leading-5 desk:col-span-3",s>0&&"desk:mt-6"),children:[r.label,(0,ie.jsx)("span",{className:"font-mono text-[12px] font-medium tabular-nums text-muted-foreground",children:r.count})]}),(0,ie.jsx)("ul",{className:"desk:contents",children:r.rows.map(i=>(0,ie.jsx)(iw,{row:i,grouped:!0},i.id))})]},r.key)),o.length>0&&(0,ie.jsx)("ul",{className:"desk:contents",children:o.map(r=>(0,ie.jsx)(iw,{row:r},r.id))})]})}function MV({limits:e,open:t,onToggle:a,controls:n}){let o=NV(e);return(0,ie.jsxs)("button",{type:"button","aria-expanded":t,"aria-controls":n,onClick:a,"data-usage-summary":!0,className:"ml-auto inline-flex min-h-8 min-w-0 items-center gap-1.5 rounded-md px-2 text-[12.5px] text-muted-foreground transition-colors hover:bg-[var(--so-raised)] hover:text-foreground phone:hidden",children:[(0,ie.jsx)("span",{className:"sr-only",children:"Usage: "}),(0,ie.jsx)("span",{className:"truncate tabular-nums",children:o.map((r,s)=>(0,ie.jsxs)("span",{children:[s>0&&(0,ie.jsx)("span",{"aria-hidden":"true",children:" · "}),(0,ie.jsx)("span",{className:xE[r.tone],children:r.text})]},r.key))}),(0,ie.jsx)(ra,{"aria-hidden":"true",className:ee("size-3.5 shrink-0 motion-safe:transition-transform",t&&"rotate-90")})]})}function EV({label:e,className:t,children:a}){let n=(0,Dr.useRef)(null),[o,r]=(0,Dr.useState)({before:!1,after:!1});(0,Dr.useEffect)(()=>{let i=n.current;if(i===null)return;let l=()=>r(f=>{let u={before:i.scrollLeft>1,after:i.scrollLeft+i.clientWidth<i.scrollWidth-1};return u.before===f.before&&u.after===f.after?f:u});l(),i.addEventListener("scroll",l,{passive:!0});let c=typeof ResizeObserver>"u"?null:new ResizeObserver(l);return c?.observe(i),()=>{i.removeEventListener("scroll",l),c?.disconnect()}},[]);let s=o.before||o.after?`linear-gradient(to right, ${o.before?"transparent, #000 28px":"#000"}, ${o.after?"#000 calc(100% - 40px), transparent":"#000"})`:void 0;return(0,ie.jsx)("nav",{ref:n,"aria-label":e,className:ee("[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",t),"data-scrolls":o.before||o.after?o.after?"more":"end":void 0,style:s===void 0?void 0:{maskImage:s,WebkitMaskImage:s},children:a})}function vE({view:e}){let[t,a]=(0,Dr.useState)(!1),n=(0,Dr.useId)(),o=e.limits!==null&&e.limits.tiles.length>0?e.limits:null;return(0,ie.jsxs)("div",{className:"flex w-full max-w-[960px] flex-col gap-5 phone:gap-3 phone:px-0.5",children:[(0,ie.jsxs)("div",{className:"flex min-w-0 items-baseline gap-x-3 gap-y-1",children:[(0,ie.jsx)("h1",{className:"text-[22px] font-semibold leading-tight tracking-[-0.02em]",children:"Tasks"}),e.needsYou>0&&(0,ie.jsxs)("p",{className:"whitespace-nowrap text-[13px] text-muted-foreground","data-needs-you-count":!0,children:[(0,ie.jsx)("span",{className:"font-semibold tabular-nums text-foreground",children:e.needsYou})," ",e.needsYou===1?"needs":"need"," you"]}),o&&(0,ie.jsx)(MV,{limits:o,open:t,onToggle:()=>a(r=>!r),controls:n}),(0,ie.jsxs)("div",{className:ee("flex shrink-0 items-center gap-2 self-center",!o&&"ml-auto","phone:ml-auto"),children:[(0,ie.jsxs)(oc,{children:[(0,ie.jsx)(rc,{asChild:!0,children:(0,ie.jsxs)(J,{variant:"outline",size:"sm","aria-label":"Work tools",children:[(0,ie.jsx)("span",{className:"phone:hidden",children:"Work tools"}),(0,ie.jsx)(jo,{className:"phone:hidden"}),(0,ie.jsx)(Wo,{className:"desk:hidden"})]})}),(0,ie.jsx)(sc,{align:"end",children:e.tools.map(r=>(0,ie.jsx)(ic,{asChild:!0,children:(0,ie.jsxs)("a",{href:r.href,children:[kV[r.href],r.label]})},r.href))})]}),(0,ie.jsx)(J,{asChild:!0,size:"sm",className:"desk:hidden",children:(0,ie.jsxs)("a",{href:e.newTask.href,children:[(0,ie.jsx)(Xt,{}),e.newTask.label]})})]})]}),o&&t&&(0,ie.jsx)(gE,{limits:o,id:n,className:"phone:hidden"}),(0,ie.jsx)("div",{className:"flex min-w-0 items-center",children:(0,ie.jsx)(EV,{label:"Task views",className:"-mx-1 min-w-0 max-w-full overflow-x-auto px-1 phone:-mr-4 phone:max-w-none phone:pr-4",children:(0,ie.jsx)("ul",{className:"inline-flex h-8 items-center gap-0.5 rounded-lg bg-muted p-0.5 phone:h-12",children:e.tabs.map(r=>(0,ie.jsx)("li",{className:"h-full",children:(0,ie.jsxs)("a",{href:r.href,"aria-current":r.active?"page":void 0,className:ee("inline-flex h-full items-center gap-1.5 rounded-md px-2.5 text-[13px] font-medium whitespace-nowrap text-muted-foreground transition-colors hover:text-foreground",r.active&&"bg-card text-foreground shadow-[var(--so-pill-shadow)]"),children:[r.label,(0,ie.jsx)("span",{className:ee("min-w-[18px] rounded-full px-1.5 text-center font-mono text-[12px] leading-[18px] tabular-nums",r.label==="Needs you"&&r.count>0?"bg-attention text-on-attention":"text-muted-foreground"),children:r.count})]})},r.href))})})}),e.empty!==null?(0,ie.jsxs)(ba,{className:"items-start py-10",children:[(0,ie.jsx)("p",{className:"text-base text-muted-foreground",children:e.empty.text}),e.empty.action&&(0,ie.jsx)(J,{asChild:!0,variant:"outline",children:(0,ie.jsx)("a",{href:e.empty.action.href,children:e.empty.action.label})})]}):(0,ie.jsx)(TV,{view:e}),(e.pages.first||e.pages.next)&&(0,ie.jsxs)("nav",{"aria-label":"Task pages",className:"flex gap-2",children:[e.pages.first&&(0,ie.jsx)(J,{asChild:!0,variant:"outline",size:"sm",children:(0,ie.jsx)("a",{href:e.pages.first,children:"First page"})}),e.pages.next&&(0,ie.jsx)(J,{asChild:!0,variant:"outline",size:"sm",children:(0,ie.jsx)("a",{href:e.pages.next,rel:"next",children:"Next page"})})]}),o&&(0,ie.jsx)(gE,{limits:o,className:"desk:hidden"})]})}var K=j(fe()),Z=j(he());function At(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let a=0,n;a<e.length;a++)(n=At(e[a]))!==""&&(t+=(t&&" ")+n);else for(let a in e)e[a]&&(t+=(t&&" ")+a);return t}var AV={value:()=>{}};function bE(){for(var e=0,t=arguments.length,a={},n;e<t;++e){if(!(n=arguments[e]+"")||n in a||/[\s.]/.test(n))throw new Error("illegal type: "+n);a[n]=[]}return new Ug(a)}function Ug(e){this._=e}function DV(e,t){return e.trim().split(/^|\s+/).map(function(a){var n="",o=a.indexOf(".");if(o>=0&&(n=a.slice(o+1),a=a.slice(0,o)),a&&!t.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:n}})}Ug.prototype=bE.prototype={constructor:Ug,on:function(e,t){var a=this._,n=DV(e+"",a),o,r=-1,s=n.length;if(arguments.length<2){for(;++r<s;)if((o=(e=n[r]).type)&&(o=_V(a[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(o=(e=n[r]).type)a[o]=yE(a[o],e.name,t);else if(t==null)for(o in a)a[o]=yE(a[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var a in t)e[a]=t[a].slice();return new Ug(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var a=new Array(o),n=0,o,r;n<o;++n)a[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],n=0,o=r.length;n<o;++n)r[n].value.apply(t,a)},apply:function(e,t,a){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],o=0,r=n.length;o<r;++o)n[o].value.apply(t,a)}};function _V(e,t){for(var a=0,n=e.length,o;a<n;++a)if((o=e[a]).name===t)return o.value}function yE(e,t,a){for(var n=0,o=e.length;n<o;++n)if(e[n].name===t){e[n]=AV,e=e.slice(0,n).concat(e.slice(n+1));break}return a!=null&&e.push({name:t,value:a}),e}var dl=bE;var Vg="http://www.w3.org/1999/xhtml",lw={svg:"http://www.w3.org/2000/svg",xhtml:Vg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _r(e){var t=e+="",a=t.indexOf(":");return a>=0&&(t=e.slice(0,a))!=="xmlns"&&(e=e.slice(a+1)),lw.hasOwnProperty(t)?{space:lw[t],local:e}:e}function PV(e){return function(){var t=this.ownerDocument,a=this.namespaceURI;return a===Vg&&t.documentElement.namespaceURI===Vg?t.createElement(e):t.createElementNS(a,e)}}function OV(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Gg(e){var t=_r(e);return(t.local?OV:PV)(t)}function zV(){}function fl(e){return e==null?zV:function(){return this.querySelector(e)}}function wE(e){typeof e!="function"&&(e=fl(e));for(var t=this._groups,a=t.length,n=new Array(a),o=0;o<a;++o)for(var r=t[o],s=r.length,i=n[o]=new Array(s),l,c,f=0;f<s;++f)(l=r[f])&&(c=e.call(l,l.__data__,f,r))&&("__data__"in l&&(c.__data__=l.__data__),i[f]=c);return new Dt(n,this._parents)}function uw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function BV(){return[]}function Qf(e){return e==null?BV:function(){return this.querySelectorAll(e)}}function FV(e){return function(){return uw(e.apply(this,arguments))}}function SE(e){typeof e=="function"?e=FV(e):e=Qf(e);for(var t=this._groups,a=t.length,n=[],o=[],r=0;r<a;++r)for(var s=t[r],i=s.length,l,c=0;c<i;++c)(l=s[c])&&(n.push(e.call(l,l.__data__,c,s)),o.push(l));return new Dt(n,o)}function Jf(e){return function(){return this.matches(e)}}function $g(e){return function(t){return t.matches(e)}}var HV=Array.prototype.find;function qV(e){return function(){return HV.call(this.children,e)}}function UV(){return this.firstElementChild}function CE(e){return this.select(e==null?UV:qV(typeof e=="function"?e:$g(e)))}var VV=Array.prototype.filter;function GV(){return Array.from(this.children)}function $V(e){return function(){return VV.call(this.children,e)}}function kE(e){return this.selectAll(e==null?GV:$V(typeof e=="function"?e:$g(e)))}function LE(e){typeof e!="function"&&(e=Jf(e));for(var t=this._groups,a=t.length,n=new Array(a),o=0;o<a;++o)for(var r=t[o],s=r.length,i=n[o]=[],l,c=0;c<s;++c)(l=r[c])&&e.call(l,l.__data__,c,r)&&i.push(l);return new Dt(n,this._parents)}function jg(e){return new Array(e.length)}function IE(){return new Dt(this._enter||this._groups.map(jg),this._parents)}function ep(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ep.prototype={constructor:ep,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function NE(e){return function(){return e}}function jV(e,t,a,n,o,r){for(var s=0,i,l=t.length,c=r.length;s<c;++s)(i=t[s])?(i.__data__=r[s],n[s]=i):a[s]=new ep(e,r[s]);for(;s<l;++s)(i=t[s])&&(o[s]=i)}function WV(e,t,a,n,o,r,s){var i,l,c=new Map,f=t.length,u=r.length,d=new Array(f),p;for(i=0;i<f;++i)(l=t[i])&&(d[i]=p=s.call(l,l.__data__,i,t)+"",c.has(p)?o[i]=l:c.set(p,l));for(i=0;i<u;++i)p=s.call(e,r[i],i,r)+"",(l=c.get(p))?(n[i]=l,l.__data__=r[i],c.delete(p)):a[i]=new ep(e,r[i]);for(i=0;i<f;++i)(l=t[i])&&c.get(d[i])===l&&(o[i]=l)}function XV(e){return e.__data__}function RE(e,t){if(!arguments.length)return Array.from(this,XV);var a=t?WV:jV,n=this._parents,o=this._groups;typeof e!="function"&&(e=NE(e));for(var r=o.length,s=new Array(r),i=new Array(r),l=new Array(r),c=0;c<r;++c){var f=n[c],u=o[c],d=u.length,p=YV(e.call(f,f&&f.__data__,c,n)),g=p.length,v=i[c]=new Array(g),b=s[c]=new Array(g),x=l[c]=new Array(d);a(f,u,v,b,x,p,t);for(var y=0,h=0,w,S;y<g;++y)if(w=v[y]){for(y>=h&&(h=y+1);!(S=b[h])&&++h<g;);w._next=S||null}}return s=new Dt(s,n),s._enter=i,s._exit=l,s}function YV(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function TE(){return new Dt(this._exit||this._groups.map(jg),this._parents)}function ME(e,t,a){var n=this.enter(),o=this,r=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),a==null?r.remove():a(r),n&&o?n.merge(o).order():o}function EE(e){for(var t=e.selection?e.selection():e,a=this._groups,n=t._groups,o=a.length,r=n.length,s=Math.min(o,r),i=new Array(o),l=0;l<s;++l)for(var c=a[l],f=n[l],u=c.length,d=i[l]=new Array(u),p,g=0;g<u;++g)(p=c[g]||f[g])&&(d[g]=p);for(;l<o;++l)i[l]=a[l];return new Dt(i,this._parents)}function AE(){for(var e=this._groups,t=-1,a=e.length;++t<a;)for(var n=e[t],o=n.length-1,r=n[o],s;--o>=0;)(s=n[o])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function DE(e){e||(e=KV);function t(u,d){return u&&d?e(u.__data__,d.__data__):!u-!d}for(var a=this._groups,n=a.length,o=new Array(n),r=0;r<n;++r){for(var s=a[r],i=s.length,l=o[r]=new Array(i),c,f=0;f<i;++f)(c=s[f])&&(l[f]=c);l.sort(t)}return new Dt(o,this._parents).order()}function KV(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _E(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function PE(){return Array.from(this)}function OE(){for(var e=this._groups,t=0,a=e.length;t<a;++t)for(var n=e[t],o=0,r=n.length;o<r;++o){var s=n[o];if(s)return s}return null}function zE(){let e=0;for(let t of this)++e;return e}function BE(){return!this.node()}function FE(e){for(var t=this._groups,a=0,n=t.length;a<n;++a)for(var o=t[a],r=0,s=o.length,i;r<s;++r)(i=o[r])&&e.call(i,i.__data__,r,o);return this}function ZV(e){return function(){this.removeAttribute(e)}}function QV(e){return function(){this.removeAttributeNS(e.space,e.local)}}function JV(e,t){return function(){this.setAttribute(e,t)}}function eG(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function tG(e,t){return function(){var a=t.apply(this,arguments);a==null?this.removeAttribute(e):this.setAttribute(e,a)}}function aG(e,t){return function(){var a=t.apply(this,arguments);a==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,a)}}function HE(e,t){var a=_r(e);if(arguments.length<2){var n=this.node();return a.local?n.getAttributeNS(a.space,a.local):n.getAttribute(a)}return this.each((t==null?a.local?QV:ZV:typeof t=="function"?a.local?aG:tG:a.local?eG:JV)(a,t))}function Wg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function nG(e){return function(){this.style.removeProperty(e)}}function oG(e,t,a){return function(){this.style.setProperty(e,t,a)}}function rG(e,t,a){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,a)}}function qE(e,t,a){return arguments.length>1?this.each((t==null?nG:typeof t=="function"?rG:oG)(e,t,a??"")):Gs(this.node(),e)}function Gs(e,t){return e.style.getPropertyValue(t)||Wg(e).getComputedStyle(e,null).getPropertyValue(t)}function sG(e){return function(){delete this[e]}}function iG(e,t){return function(){this[e]=t}}function lG(e,t){return function(){var a=t.apply(this,arguments);a==null?delete this[e]:this[e]=a}}function UE(e,t){return arguments.length>1?this.each((t==null?sG:typeof t=="function"?lG:iG)(e,t)):this.node()[e]}function VE(e){return e.trim().split(/^|\s+/)}function cw(e){return e.classList||new GE(e)}function GE(e){this._node=e,this._names=VE(e.getAttribute("class")||"")}GE.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function $E(e,t){for(var a=cw(e),n=-1,o=t.length;++n<o;)a.add(t[n])}function jE(e,t){for(var a=cw(e),n=-1,o=t.length;++n<o;)a.remove(t[n])}function uG(e){return function(){$E(this,e)}}function cG(e){return function(){jE(this,e)}}function dG(e,t){return function(){(t.apply(this,arguments)?$E:jE)(this,e)}}function WE(e,t){var a=VE(e+"");if(arguments.length<2){for(var n=cw(this.node()),o=-1,r=a.length;++o<r;)if(!n.contains(a[o]))return!1;return!0}return this.each((typeof t=="function"?dG:t?uG:cG)(a,t))}function fG(){this.textContent=""}function pG(e){return function(){this.textContent=e}}function mG(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function XE(e){return arguments.length?this.each(e==null?fG:(typeof e=="function"?mG:pG)(e)):this.node().textContent}function hG(){this.innerHTML=""}function gG(e){return function(){this.innerHTML=e}}function xG(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function YE(e){return arguments.length?this.each(e==null?hG:(typeof e=="function"?xG:gG)(e)):this.node().innerHTML}function vG(){this.nextSibling&&this.parentNode.appendChild(this)}function KE(){return this.each(vG)}function yG(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ZE(){return this.each(yG)}function QE(e){var t=typeof e=="function"?e:Gg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function bG(){return null}function JE(e,t){var a=typeof e=="function"?e:Gg(e),n=t==null?bG:typeof t=="function"?t:fl(t);return this.select(function(){return this.insertBefore(a.apply(this,arguments),n.apply(this,arguments)||null)})}function wG(){var e=this.parentNode;e&&e.removeChild(this)}function eA(){return this.each(wG)}function SG(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function CG(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tA(e){return this.select(e?CG:SG)}function aA(e){return arguments.length?this.property("__data__",e):this.node().__data__}function kG(e){return function(t){e.call(this,t,this.__data__)}}function LG(e){return e.trim().split(/^|\s+/).map(function(t){var a="",n=t.indexOf(".");return n>=0&&(a=t.slice(n+1),t=t.slice(0,n)),{type:t,name:a}})}function IG(e){return function(){var t=this.__on;if(t){for(var a=0,n=-1,o=t.length,r;a<o;++a)r=t[a],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++n]=r;++n?t.length=n:delete this.__on}}}function NG(e,t,a){return function(){var n=this.__on,o,r=kG(t);if(n){for(var s=0,i=n.length;s<i;++s)if((o=n[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=r,o.options=a),o.value=t;return}}this.addEventListener(e.type,r,a),o={type:e.type,name:e.name,value:t,listener:r,options:a},n?n.push(o):this.__on=[o]}}function nA(e,t,a){var n=LG(e+""),o,r=n.length,s;if(arguments.length<2){var i=this.node().__on;if(i){for(var l=0,c=i.length,f;l<c;++l)for(o=0,f=i[l];o<r;++o)if((s=n[o]).type===f.type&&s.name===f.name)return f.value}return}for(i=t?NG:IG,o=0;o<r;++o)this.each(i(n[o],t,a));return this}function oA(e,t,a){var n=Wg(e),o=n.CustomEvent;typeof o=="function"?o=new o(t,a):(o=n.document.createEvent("Event"),a?(o.initEvent(t,a.bubbles,a.cancelable),o.detail=a.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function RG(e,t){return function(){return oA(this,e,t)}}function TG(e,t){return function(){return oA(this,e,t.apply(this,arguments))}}function rA(e,t){return this.each((typeof t=="function"?TG:RG)(e,t))}function*sA(){for(var e=this._groups,t=0,a=e.length;t<a;++t)for(var n=e[t],o=0,r=n.length,s;o<r;++o)(s=n[o])&&(yield s)}var dw=[null];function Dt(e,t){this._groups=e,this._parents=t}function iA(){return new Dt([[document.documentElement]],dw)}function MG(){return this}Dt.prototype=iA.prototype={constructor:Dt,select:wE,selectAll:SE,selectChild:CE,selectChildren:kE,filter:LE,data:RE,enter:IE,exit:TE,join:ME,merge:EE,selection:MG,order:AE,sort:DE,call:_E,nodes:PE,node:OE,size:zE,empty:BE,each:FE,attr:HE,style:qE,property:UE,classed:WE,text:XE,html:YE,raise:KE,lower:ZE,append:QE,insert:JE,remove:eA,clone:tA,datum:aA,on:nA,dispatch:rA,[Symbol.iterator]:sA};var Pr=iA;function la(e){return typeof e=="string"?new Dt([[document.querySelector(e)]],[document.documentElement]):new Dt([[e]],dw)}function lA(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ya(e,t){if(e=lA(e),t===void 0&&(t=e.currentTarget),t){var a=t.ownerSVGElement||t;if(a.createSVGPoint){var n=a.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}var uA={passive:!1},pl={capture:!0,passive:!1};function Xg(e){e.stopImmediatePropagation()}function $s(e){e.preventDefault(),e.stopImmediatePropagation()}function tp(e){var t=e.document.documentElement,a=la(e).on("dragstart.drag",$s,pl);"onselectstart"in t?a.on("selectstart.drag",$s,pl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ap(e,t){var a=e.document.documentElement,n=la(e).on("dragstart.drag",null);t&&(n.on("click.drag",$s,pl),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in a?n.on("selectstart.drag",null):(a.style.MozUserSelect=a.__noselect,delete a.__noselect)}var np=e=>()=>e;function op(e,{sourceEvent:t,subject:a,target:n,identifier:o,active:r,x:s,y:i,dx:l,dy:c,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:a,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:i,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:f}})}op.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function EG(e){return!e.ctrlKey&&!e.button}function AG(){return this.parentNode}function DG(e,t){return t??{x:e.x,y:e.y}}function _G(){return navigator.maxTouchPoints||"ontouchstart"in this}function Yg(){var e=EG,t=AG,a=DG,n=_G,o={},r=dl("start","drag","end"),s=0,i,l,c,f,u=0;function d(w){w.on("mousedown.drag",p).filter(n).on("touchstart.drag",b).on("touchmove.drag",x,uA).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,S){if(!(f||!e.call(this,w,S))){var C=h(this,t.call(this,w,S),w,S,"mouse");C&&(la(w.view).on("mousemove.drag",g,pl).on("mouseup.drag",v,pl),tp(w.view),Xg(w),c=!1,i=w.clientX,l=w.clientY,C("start",w))}}function g(w){if($s(w),!c){var S=w.clientX-i,C=w.clientY-l;c=S*S+C*C>u}o.mouse("drag",w)}function v(w){la(w.view).on("mousemove.drag mouseup.drag",null),ap(w.view,c),$s(w),o.mouse("end",w)}function b(w,S){if(e.call(this,w,S)){var C=w.changedTouches,I=t.call(this,w,S),L=C.length,T,M;for(T=0;T<L;++T)(M=h(this,I,w,S,C[T].identifier,C[T]))&&(Xg(w),M("start",w,C[T]))}}function x(w){var S=w.changedTouches,C=S.length,I,L;for(I=0;I<C;++I)(L=o[S[I].identifier])&&($s(w),L("drag",w,S[I]))}function y(w){var S=w.changedTouches,C=S.length,I,L;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),I=0;I<C;++I)(L=o[S[I].identifier])&&(Xg(w),L("end",w,S[I]))}function h(w,S,C,I,L,T){var M=r.copy(),O=Ya(T||C,S),H,z,N;if((N=a.call(w,new op("beforestart",{sourceEvent:C,target:d,identifier:L,active:s,x:O[0],y:O[1],dx:0,dy:0,dispatch:M}),I))!=null)return H=N.x-O[0]||0,z=N.y-O[1]||0,function _(A,D,q){var U=O,P;switch(A){case"start":o[L]=_,P=s++;break;case"end":delete o[L],--s;case"drag":O=Ya(q||D,S),P=s;break}M.call(A,w,new op(A,{sourceEvent:D,subject:N,target:d,identifier:L,active:P,x:O[0]+H,y:O[1]+z,dx:O[0]-U[0],dy:O[1]-U[1],dispatch:M}),I)}}return d.filter=function(w){return arguments.length?(e=typeof w=="function"?w:np(!!w),d):e},d.container=function(w){return arguments.length?(t=typeof w=="function"?w:np(w),d):t},d.subject=function(w){return arguments.length?(a=typeof w=="function"?w:np(w),d):a},d.touchable=function(w){return arguments.length?(n=typeof w=="function"?w:np(!!w),d):n},d.on=function(){var w=r.on.apply(r,arguments);return w===r?d:w},d.clickDistance=function(w){return arguments.length?(u=(w=+w)*w,d):Math.sqrt(u)},d}function Kg(e,t,a){e.prototype=t.prototype=a,a.constructor=e}function fw(e,t){var a=Object.create(e.prototype);for(var n in t)a[n]=t[n];return a}function ip(){}var rp=.7,Jg=1/rp,hc="\\s*([+-]?\\d+)\\s*",sp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ar="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",PG=/^#([0-9a-f]{3,8})$/,OG=new RegExp(`^rgb\\(${hc},${hc},${hc}\\)$`),zG=new RegExp(`^rgb\\(${ar},${ar},${ar}\\)$`),BG=new RegExp(`^rgba\\(${hc},${hc},${hc},${sp}\\)$`),FG=new RegExp(`^rgba\\(${ar},${ar},${ar},${sp}\\)$`),HG=new RegExp(`^hsl\\(${sp},${ar},${ar}\\)$`),qG=new RegExp(`^hsla\\(${sp},${ar},${ar},${sp}\\)$`),cA={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Kg(ip,No,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:dA,formatHex:dA,formatHex8:UG,formatHsl:VG,formatRgb:fA,toString:fA});function dA(){return this.rgb().formatHex()}function UG(){return this.rgb().formatHex8()}function VG(){return vA(this).formatHsl()}function fA(){return this.rgb().formatRgb()}function No(e){var t,a;return e=(e+"").trim().toLowerCase(),(t=PG.exec(e))?(a=t[1].length,t=parseInt(t[1],16),a===6?pA(t):a===3?new vn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):a===8?Zg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):a===4?Zg(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=OG.exec(e))?new vn(t[1],t[2],t[3],1):(t=zG.exec(e))?new vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=BG.exec(e))?Zg(t[1],t[2],t[3],t[4]):(t=FG.exec(e))?Zg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=HG.exec(e))?gA(t[1],t[2]/100,t[3]/100,1):(t=qG.exec(e))?gA(t[1],t[2]/100,t[3]/100,t[4]):cA.hasOwnProperty(e)?pA(cA[e]):e==="transparent"?new vn(NaN,NaN,NaN,0):null}function pA(e){return new vn(e>>16&255,e>>8&255,e&255,1)}function Zg(e,t,a,n){return n<=0&&(e=t=a=NaN),new vn(e,t,a,n)}function GG(e){return e instanceof ip||(e=No(e)),e?(e=e.rgb(),new vn(e.r,e.g,e.b,e.opacity)):new vn}function gc(e,t,a,n){return arguments.length===1?GG(e):new vn(e,t,a,n??1)}function vn(e,t,a,n){this.r=+e,this.g=+t,this.b=+a,this.opacity=+n}Kg(vn,gc,fw(ip,{brighter(e){return e=e==null?Jg:Math.pow(Jg,e),new vn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?rp:Math.pow(rp,e),new vn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new vn(hl(this.r),hl(this.g),hl(this.b),ex(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:mA,formatHex:mA,formatHex8:$G,formatRgb:hA,toString:hA}));function mA(){return`#${ml(this.r)}${ml(this.g)}${ml(this.b)}`}function $G(){return`#${ml(this.r)}${ml(this.g)}${ml(this.b)}${ml((isNaN(this.opacity)?1:this.opacity)*255)}`}function hA(){let e=ex(this.opacity);return`${e===1?"rgb(":"rgba("}${hl(this.r)}, ${hl(this.g)}, ${hl(this.b)}${e===1?")":`, ${e})`}`}function ex(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function hl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ml(e){return e=hl(e),(e<16?"0":"")+e.toString(16)}function gA(e,t,a,n){return n<=0?e=t=a=NaN:a<=0||a>=1?e=t=NaN:t<=0&&(e=NaN),new Io(e,t,a,n)}function vA(e){if(e instanceof Io)return new Io(e.h,e.s,e.l,e.opacity);if(e instanceof ip||(e=No(e)),!e)return new Io;if(e instanceof Io)return e;e=e.rgb();var t=e.r/255,a=e.g/255,n=e.b/255,o=Math.min(t,a,n),r=Math.max(t,a,n),s=NaN,i=r-o,l=(r+o)/2;return i?(t===r?s=(a-n)/i+(a<n)*6:a===r?s=(n-t)/i+2:s=(t-a)/i+4,i/=l<.5?r+o:2-r-o,s*=60):i=l>0&&l<1?0:s,new Io(s,i,l,e.opacity)}function yA(e,t,a,n){return arguments.length===1?vA(e):new Io(e,t,a,n??1)}function Io(e,t,a,n){this.h=+e,this.s=+t,this.l=+a,this.opacity=+n}Kg(Io,yA,fw(ip,{brighter(e){return e=e==null?Jg:Math.pow(Jg,e),new Io(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?rp:Math.pow(rp,e),new Io(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,a=this.l,n=a+(a<.5?a:1-a)*t,o=2*a-n;return new vn(pw(e>=240?e-240:e+120,o,n),pw(e,o,n),pw(e<120?e+240:e-120,o,n),this.opacity)},clamp(){return new Io(xA(this.h),Qg(this.s),Qg(this.l),ex(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=ex(this.opacity);return`${e===1?"hsl(":"hsla("}${xA(this.h)}, ${Qg(this.s)*100}%, ${Qg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function xA(e){return e=(e||0)%360,e<0?e+360:e}function Qg(e){return Math.max(0,Math.min(1,e||0))}function pw(e,t,a){return(e<60?t+(a-t)*e/60:e<180?a:e<240?t+(a-t)*(240-e)/60:t)*255}function mw(e,t,a,n,o){var r=e*e,s=r*e;return((1-3*e+3*r-s)*t+(4-6*r+3*s)*a+(1+3*e+3*r-3*s)*n+s*o)/6}function bA(e){var t=e.length-1;return function(a){var n=a<=0?a=0:a>=1?(a=1,t-1):Math.floor(a*t),o=e[n],r=e[n+1],s=n>0?e[n-1]:2*o-r,i=n<t-1?e[n+2]:2*r-o;return mw((a-n/t)*t,s,o,r,i)}}function wA(e){var t=e.length;return function(a){var n=Math.floor(((a%=1)<0?++a:a)*t),o=e[(n+t-1)%t],r=e[n%t],s=e[(n+1)%t],i=e[(n+2)%t];return mw((a-n/t)*t,o,r,s,i)}}var lp=e=>()=>e;function jG(e,t){return function(a){return e+a*t}}function WG(e,t,a){return e=Math.pow(e,a),t=Math.pow(t,a)-e,a=1/a,function(n){return Math.pow(e+n*t,a)}}function SA(e){return(e=+e)==1?tx:function(t,a){return a-t?WG(t,a,e):lp(isNaN(t)?a:t)}}function tx(e,t){var a=t-e;return a?jG(e,a):lp(isNaN(e)?t:e)}var gl=(function e(t){var a=SA(t);function n(o,r){var s=a((o=gc(o)).r,(r=gc(r)).r),i=a(o.g,r.g),l=a(o.b,r.b),c=tx(o.opacity,r.opacity);return function(f){return o.r=s(f),o.g=i(f),o.b=l(f),o.opacity=c(f),o+""}}return n.gamma=e,n})(1);function CA(e){return function(t){var a=t.length,n=new Array(a),o=new Array(a),r=new Array(a),s,i;for(s=0;s<a;++s)i=gc(t[s]),n[s]=i.r||0,o[s]=i.g||0,r[s]=i.b||0;return n=e(n),o=e(o),r=e(r),i.opacity=1,function(l){return i.r=n(l),i.g=o(l),i.b=r(l),i+""}}}var XG=CA(bA),YG=CA(wA);function kA(e,t){t||(t=[]);var a=e?Math.min(t.length,e.length):0,n=t.slice(),o;return function(r){for(o=0;o<a;++o)n[o]=e[o]*(1-r)+t[o]*r;return n}}function LA(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function IA(e,t){var a=t?t.length:0,n=e?Math.min(a,e.length):0,o=new Array(n),r=new Array(a),s;for(s=0;s<n;++s)o[s]=Or(e[s],t[s]);for(;s<a;++s)r[s]=t[s];return function(i){for(s=0;s<n;++s)r[s]=o[s](i);return r}}function NA(e,t){var a=new Date;return e=+e,t=+t,function(n){return a.setTime(e*(1-n)+t*n),a}}function Ka(e,t){return e=+e,t=+t,function(a){return e*(1-a)+t*a}}function RA(e,t){var a={},n={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?a[o]=Or(e[o],t[o]):n[o]=t[o];return function(r){for(o in a)n[o]=a[o](r);return n}}var gw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hw=new RegExp(gw.source,"g");function KG(e){return function(){return e}}function ZG(e){return function(t){return e(t)+""}}function up(e,t){var a=gw.lastIndex=hw.lastIndex=0,n,o,r,s=-1,i=[],l=[];for(e=e+"",t=t+"";(n=gw.exec(e))&&(o=hw.exec(t));)(r=o.index)>a&&(r=t.slice(a,r),i[s]?i[s]+=r:i[++s]=r),(n=n[0])===(o=o[0])?i[s]?i[s]+=o:i[++s]=o:(i[++s]=null,l.push({i:s,x:Ka(n,o)})),a=hw.lastIndex;return a<t.length&&(r=t.slice(a),i[s]?i[s]+=r:i[++s]=r),i.length<2?l[0]?ZG(l[0].x):KG(t):(t=l.length,function(c){for(var f=0,u;f<t;++f)i[(u=l[f]).i]=u.x(c);return i.join("")})}function Or(e,t){var a=typeof t,n;return t==null||a==="boolean"?lp(t):(a==="number"?Ka:a==="string"?(n=No(t))?(t=n,gl):up:t instanceof No?gl:t instanceof Date?NA:LA(t)?kA:Array.isArray(t)?IA:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?RA:Ka)(e,t)}var TA=180/Math.PI,ax={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xw(e,t,a,n,o,r){var s,i,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*a+t*n)&&(a-=e*l,n-=t*l),(i=Math.sqrt(a*a+n*n))&&(a/=i,n/=i,l/=i),e*n<t*a&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:r,rotate:Math.atan2(t,e)*TA,skewX:Math.atan(l)*TA,scaleX:s,scaleY:i}}var nx;function MA(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ax:xw(t.a,t.b,t.c,t.d,t.e,t.f)}function EA(e){return e==null?ax:(nx||(nx=document.createElementNS("http://www.w3.org/2000/svg","g")),nx.setAttribute("transform",e),(e=nx.transform.baseVal.consolidate())?(e=e.matrix,xw(e.a,e.b,e.c,e.d,e.e,e.f)):ax)}function AA(e,t,a,n){function o(c){return c.length?c.pop()+" ":""}function r(c,f,u,d,p,g){if(c!==u||f!==d){var v=p.push("translate(",null,t,null,a);g.push({i:v-4,x:Ka(c,u)},{i:v-2,x:Ka(f,d)})}else(u||d)&&p.push("translate("+u+t+d+a)}function s(c,f,u,d){c!==f?(c-f>180?f+=360:f-c>180&&(c+=360),d.push({i:u.push(o(u)+"rotate(",null,n)-2,x:Ka(c,f)})):f&&u.push(o(u)+"rotate("+f+n)}function i(c,f,u,d){c!==f?d.push({i:u.push(o(u)+"skewX(",null,n)-2,x:Ka(c,f)}):f&&u.push(o(u)+"skewX("+f+n)}function l(c,f,u,d,p,g){if(c!==u||f!==d){var v=p.push(o(p)+"scale(",null,",",null,")");g.push({i:v-4,x:Ka(c,u)},{i:v-2,x:Ka(f,d)})}else(u!==1||d!==1)&&p.push(o(p)+"scale("+u+","+d+")")}return function(c,f){var u=[],d=[];return c=e(c),f=e(f),r(c.translateX,c.translateY,f.translateX,f.translateY,u,d),s(c.rotate,f.rotate,u,d),i(c.skewX,f.skewX,u,d),l(c.scaleX,c.scaleY,f.scaleX,f.scaleY,u,d),c=f=null,function(p){for(var g=-1,v=d.length,b;++g<v;)u[(b=d[g]).i]=b.x(p);return u.join("")}}}var vw=AA(MA,"px, ","px)","deg)"),yw=AA(EA,", ",")",")");var QG=1e-12;function DA(e){return((e=Math.exp(e))+1/e)/2}function JG(e){return((e=Math.exp(e))-1/e)/2}function e$(e){return((e=Math.exp(2*e))-1)/(e+1)}var xl=(function e(t,a,n){function o(r,s){var i=r[0],l=r[1],c=r[2],f=s[0],u=s[1],d=s[2],p=f-i,g=u-l,v=p*p+g*g,b,x;if(v<QG)x=Math.log(d/c)/t,b=function(I){return[i+I*p,l+I*g,c*Math.exp(t*I*x)]};else{var y=Math.sqrt(v),h=(d*d-c*c+n*v)/(2*c*a*y),w=(d*d-c*c-n*v)/(2*d*a*y),S=Math.log(Math.sqrt(h*h+1)-h),C=Math.log(Math.sqrt(w*w+1)-w);x=(C-S)/t,b=function(I){var L=I*x,T=DA(S),M=c/(a*y)*(T*e$(t*L+S)-JG(S));return[i+M*p,l+M*g,c*T/DA(t*L+S)]}}return b.duration=x*1e3*t/Math.SQRT2,b}return o.rho=function(r){var s=Math.max(.001,+r),i=s*s,l=i*i;return e(s,i,l)},o})(Math.SQRT2,2,4);var xc=0,dp=0,cp=0,PA=1e3,ox,fp,rx=0,vl=0,sx=0,pp=typeof performance=="object"&&performance.now?performance:Date,OA=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function hp(){return vl||(OA(t$),vl=pp.now()+sx)}function t$(){vl=0}function mp(){this._call=this._time=this._next=null}mp.prototype=ix.prototype={constructor:mp,restart:function(e,t,a){if(typeof e!="function")throw new TypeError("callback is not a function");a=(a==null?hp():+a)+(t==null?0:+t),!this._next&&fp!==this&&(fp?fp._next=this:ox=this,fp=this),this._call=e,this._time=a,bw()},stop:function(){this._call&&(this._call=null,this._time=1/0,bw())}};function ix(e,t,a){var n=new mp;return n.restart(e,t,a),n}function zA(){hp(),++xc;for(var e=ox,t;e;)(t=vl-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xc}function _A(){vl=(rx=pp.now())+sx,xc=dp=0;try{zA()}finally{xc=0,n$(),vl=0}}function a$(){var e=pp.now(),t=e-rx;t>PA&&(sx-=t,rx=e)}function n$(){for(var e,t=ox,a,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(a=t._next,t._next=null,t=e?e._next=a:ox=a);fp=e,bw(n)}function bw(e){if(!xc){dp&&(dp=clearTimeout(dp));var t=e-vl;t>24?(e<1/0&&(dp=setTimeout(_A,e-pp.now()-sx)),cp&&(cp=clearInterval(cp))):(cp||(rx=pp.now(),cp=setInterval(a$,PA)),xc=1,OA(_A))}}function lx(e,t,a){var n=new mp;return t=t==null?0:+t,n.restart(o=>{n.stop(),e(o+t)},t,a),n}var o$=dl("start","end","cancel","interrupt"),r$=[],HA=0,BA=1,cx=2,ux=3,FA=4,dx=5,gp=6;function js(e,t,a,n,o,r){var s=e.__transition;if(!s)e.__transition={};else if(a in s)return;s$(e,a,{name:t,index:n,group:o,on:o$,tween:r$,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:HA})}function xp(e,t){var a=Zt(e,t);if(a.state>HA)throw new Error("too late; already scheduled");return a}function Ca(e,t){var a=Zt(e,t);if(a.state>ux)throw new Error("too late; already running");return a}function Zt(e,t){var a=e.__transition;if(!a||!(a=a[t]))throw new Error("transition not found");return a}function s$(e,t,a){var n=e.__transition,o;n[t]=a,a.timer=ix(r,0,a.time);function r(c){a.state=BA,a.timer.restart(s,a.delay,a.time),a.delay<=c&&s(c-a.delay)}function s(c){var f,u,d,p;if(a.state!==BA)return l();for(f in n)if(p=n[f],p.name===a.name){if(p.state===ux)return lx(s);p.state===FA?(p.state=gp,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete n[f]):+f<t&&(p.state=gp,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete n[f])}if(lx(function(){a.state===ux&&(a.state=FA,a.timer.restart(i,a.delay,a.time),i(c))}),a.state=cx,a.on.call("start",e,e.__data__,a.index,a.group),a.state===cx){for(a.state=ux,o=new Array(d=a.tween.length),f=0,u=-1;f<d;++f)(p=a.tween[f].value.call(e,e.__data__,a.index,a.group))&&(o[++u]=p);o.length=u+1}}function i(c){for(var f=c<a.duration?a.ease.call(null,c/a.duration):(a.timer.restart(l),a.state=dx,1),u=-1,d=o.length;++u<d;)o[u].call(e,f);a.state===dx&&(a.on.call("end",e,e.__data__,a.index,a.group),l())}function l(){a.state=gp,a.timer.stop(),delete n[t];for(var c in n)return;delete e.__transition}}function yl(e,t){var a=e.__transition,n,o,r=!0,s;if(a){t=t==null?null:t+"";for(s in a){if((n=a[s]).name!==t){r=!1;continue}o=n.state>cx&&n.state<dx,n.state=gp,n.timer.stop(),n.on.call(o?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[s]}r&&delete e.__transition}}function qA(e){return this.each(function(){yl(this,e)})}function i$(e,t){var a,n;return function(){var o=Ca(this,e),r=o.tween;if(r!==a){n=a=r;for(var s=0,i=n.length;s<i;++s)if(n[s].name===t){n=n.slice(),n.splice(s,1);break}}o.tween=n}}function l$(e,t,a){var n,o;if(typeof a!="function")throw new Error;return function(){var r=Ca(this,e),s=r.tween;if(s!==n){o=(n=s).slice();for(var i={name:t,value:a},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=i;break}l===c&&o.push(i)}r.tween=o}}function UA(e,t){var a=this._id;if(e+="",arguments.length<2){for(var n=Zt(this.node(),a).tween,o=0,r=n.length,s;o<r;++o)if((s=n[o]).name===e)return s.value;return null}return this.each((t==null?i$:l$)(a,e,t))}function vc(e,t,a){var n=e._id;return e.each(function(){var o=Ca(this,n);(o.value||(o.value={}))[t]=a.apply(this,arguments)}),function(o){return Zt(o,n).value[t]}}function fx(e,t){var a;return(typeof t=="number"?Ka:t instanceof No?gl:(a=No(t))?(t=a,gl):up)(e,t)}function u$(e){return function(){this.removeAttribute(e)}}function c$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function d$(e,t,a){var n,o=a+"",r;return function(){var s=this.getAttribute(e);return s===o?null:s===n?r:r=t(n=s,a)}}function f$(e,t,a){var n,o=a+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===n?r:r=t(n=s,a)}}function p$(e,t,a){var n,o,r;return function(){var s,i=a(this),l;return i==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=i+"",s===l?null:s===n&&l===o?r:(o=l,r=t(n=s,i)))}}function m$(e,t,a){var n,o,r;return function(){var s,i=a(this),l;return i==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=i+"",s===l?null:s===n&&l===o?r:(o=l,r=t(n=s,i)))}}function VA(e,t){var a=_r(e),n=a==="transform"?yw:fx;return this.attrTween(e,typeof t=="function"?(a.local?m$:p$)(a,n,vc(this,"attr."+e,t)):t==null?(a.local?c$:u$)(a):(a.local?f$:d$)(a,n,t))}function h$(e,t){return function(a){this.setAttribute(e,t.call(this,a))}}function g$(e,t){return function(a){this.setAttributeNS(e.space,e.local,t.call(this,a))}}function x$(e,t){var a,n;function o(){var r=t.apply(this,arguments);return r!==n&&(a=(n=r)&&g$(e,r)),a}return o._value=t,o}function v$(e,t){var a,n;function o(){var r=t.apply(this,arguments);return r!==n&&(a=(n=r)&&h$(e,r)),a}return o._value=t,o}function GA(e,t){var a="attr."+e;if(arguments.length<2)return(a=this.tween(a))&&a._value;if(t==null)return this.tween(a,null);if(typeof t!="function")throw new Error;var n=_r(e);return this.tween(a,(n.local?x$:v$)(n,t))}function y$(e,t){return function(){xp(this,e).delay=+t.apply(this,arguments)}}function b$(e,t){return t=+t,function(){xp(this,e).delay=t}}function $A(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?y$:b$)(t,e)):Zt(this.node(),t).delay}function w$(e,t){return function(){Ca(this,e).duration=+t.apply(this,arguments)}}function S$(e,t){return t=+t,function(){Ca(this,e).duration=t}}function jA(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?w$:S$)(t,e)):Zt(this.node(),t).duration}function C$(e,t){if(typeof t!="function")throw new Error;return function(){Ca(this,e).ease=t}}function WA(e){var t=this._id;return arguments.length?this.each(C$(t,e)):Zt(this.node(),t).ease}function k$(e,t){return function(){var a=t.apply(this,arguments);if(typeof a!="function")throw new Error;Ca(this,e).ease=a}}function XA(e){if(typeof e!="function")throw new Error;return this.each(k$(this._id,e))}function YA(e){typeof e!="function"&&(e=Jf(e));for(var t=this._groups,a=t.length,n=new Array(a),o=0;o<a;++o)for(var r=t[o],s=r.length,i=n[o]=[],l,c=0;c<s;++c)(l=r[c])&&e.call(l,l.__data__,c,r)&&i.push(l);return new Za(n,this._parents,this._name,this._id)}function KA(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,a=e._groups,n=t.length,o=a.length,r=Math.min(n,o),s=new Array(n),i=0;i<r;++i)for(var l=t[i],c=a[i],f=l.length,u=s[i]=new Array(f),d,p=0;p<f;++p)(d=l[p]||c[p])&&(u[p]=d);for(;i<n;++i)s[i]=t[i];return new Za(s,this._parents,this._name,this._id)}function L$(e){return(e+"").trim().split(/^|\s+/).every(function(t){var a=t.indexOf(".");return a>=0&&(t=t.slice(0,a)),!t||t==="start"})}function I$(e,t,a){var n,o,r=L$(t)?xp:Ca;return function(){var s=r(this,e),i=s.on;i!==n&&(o=(n=i).copy()).on(t,a),s.on=o}}function ZA(e,t){var a=this._id;return arguments.length<2?Zt(this.node(),a).on.on(e):this.each(I$(a,e,t))}function N$(e){return function(){var t=this.parentNode;for(var a in this.__transition)if(+a!==e)return;t&&t.removeChild(this)}}function QA(){return this.on("end.remove",N$(this._id))}function JA(e){var t=this._name,a=this._id;typeof e!="function"&&(e=fl(e));for(var n=this._groups,o=n.length,r=new Array(o),s=0;s<o;++s)for(var i=n[s],l=i.length,c=r[s]=new Array(l),f,u,d=0;d<l;++d)(f=i[d])&&(u=e.call(f,f.__data__,d,i))&&("__data__"in f&&(u.__data__=f.__data__),c[d]=u,js(c[d],t,a,d,c,Zt(f,a)));return new Za(r,this._parents,t,a)}function e6(e){var t=this._name,a=this._id;typeof e!="function"&&(e=Qf(e));for(var n=this._groups,o=n.length,r=[],s=[],i=0;i<o;++i)for(var l=n[i],c=l.length,f,u=0;u<c;++u)if(f=l[u]){for(var d=e.call(f,f.__data__,u,l),p,g=Zt(f,a),v=0,b=d.length;v<b;++v)(p=d[v])&&js(p,t,a,v,d,g);r.push(d),s.push(f)}return new Za(r,s,t,a)}var R$=Pr.prototype.constructor;function t6(){return new R$(this._groups,this._parents)}function T$(e,t){var a,n,o;return function(){var r=Gs(this,e),s=(this.style.removeProperty(e),Gs(this,e));return r===s?null:r===a&&s===n?o:o=t(a=r,n=s)}}function a6(e){return function(){this.style.removeProperty(e)}}function M$(e,t,a){var n,o=a+"",r;return function(){var s=Gs(this,e);return s===o?null:s===n?r:r=t(n=s,a)}}function E$(e,t,a){var n,o,r;return function(){var s=Gs(this,e),i=a(this),l=i+"";return i==null&&(l=i=(this.style.removeProperty(e),Gs(this,e))),s===l?null:s===n&&l===o?r:(o=l,r=t(n=s,i))}}function A$(e,t){var a,n,o,r="style."+t,s="end."+r,i;return function(){var l=Ca(this,e),c=l.on,f=l.value[r]==null?i||(i=a6(t)):void 0;(c!==a||o!==f)&&(n=(a=c).copy()).on(s,o=f),l.on=n}}function n6(e,t,a){var n=(e+="")=="transform"?vw:fx;return t==null?this.styleTween(e,T$(e,n)).on("end.style."+e,a6(e)):typeof t=="function"?this.styleTween(e,E$(e,n,vc(this,"style."+e,t))).each(A$(this._id,e)):this.styleTween(e,M$(e,n,t),a).on("end.style."+e,null)}function D$(e,t,a){return function(n){this.style.setProperty(e,t.call(this,n),a)}}function _$(e,t,a){var n,o;function r(){var s=t.apply(this,arguments);return s!==o&&(n=(o=s)&&D$(e,s,a)),n}return r._value=t,r}function o6(e,t,a){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,_$(e,t,a??""))}function P$(e){return function(){this.textContent=e}}function O$(e){return function(){var t=e(this);this.textContent=t??""}}function r6(e){return this.tween("text",typeof e=="function"?O$(vc(this,"text",e)):P$(e==null?"":e+""))}function z$(e){return function(t){this.textContent=e.call(this,t)}}function B$(e){var t,a;function n(){var o=e.apply(this,arguments);return o!==a&&(t=(a=o)&&z$(o)),t}return n._value=e,n}function s6(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,B$(e))}function i6(){for(var e=this._name,t=this._id,a=px(),n=this._groups,o=n.length,r=0;r<o;++r)for(var s=n[r],i=s.length,l,c=0;c<i;++c)if(l=s[c]){var f=Zt(l,t);js(l,e,a,c,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new Za(n,this._parents,e,a)}function l6(){var e,t,a=this,n=a._id,o=a.size();return new Promise(function(r,s){var i={value:s},l={value:function(){--o===0&&r()}};a.each(function(){var c=Ca(this,n),f=c.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(i),t._.interrupt.push(i),t._.end.push(l)),c.on=t}),o===0&&r()})}var F$=0;function Za(e,t,a,n){this._groups=e,this._parents=t,this._name=a,this._id=n}function u6(e){return Pr().transition(e)}function px(){return++F$}var zr=Pr.prototype;Za.prototype=u6.prototype={constructor:Za,select:JA,selectAll:e6,selectChild:zr.selectChild,selectChildren:zr.selectChildren,filter:YA,merge:KA,selection:t6,transition:i6,call:zr.call,nodes:zr.nodes,node:zr.node,size:zr.size,empty:zr.empty,each:zr.each,on:ZA,attr:VA,attrTween:GA,style:n6,styleTween:o6,text:r6,textTween:s6,remove:QA,tween:UA,delay:$A,duration:jA,ease:WA,easeVarying:XA,end:l6,[Symbol.iterator]:zr[Symbol.iterator]};function mx(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var H$={time:null,delay:0,duration:250,ease:mx};function q$(e,t){for(var a;!(a=e.__transition)||!(a=a[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return a}function c6(e){var t,a;e instanceof Za?(t=e._id,e=e._name):(t=px(),(a=H$).time=hp(),e=e==null?null:e+"");for(var n=this._groups,o=n.length,r=0;r<o;++r)for(var s=n[r],i=s.length,l,c=0;c<i;++c)(l=s[c])&&js(l,e,t,c,s,a||q$(l,t));return new Za(n,this._parents,e,t)}Pr.prototype.interrupt=qA;Pr.prototype.transition=c6;var vp=e=>()=>e;function ww(e,{sourceEvent:t,target:a,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function Ro(e,t,a){this.k=e,this.x=t,this.y=a}Ro.prototype={constructor:Ro,scale:function(e){return e===1?this:new Ro(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ro(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var bl=new Ro(1,0,0);yp.prototype=Ro.prototype;function yp(e){for(;!e.__zoom;)if(!(e=e.parentNode))return bl;return e.__zoom}function hx(e){e.stopImmediatePropagation()}function yc(e){e.preventDefault(),e.stopImmediatePropagation()}function U$(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function V$(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function d6(){return this.__zoom||bl}function G$(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function $$(){return navigator.maxTouchPoints||"ontouchstart"in this}function j$(e,t,a){var n=e.invertX(t[0][0])-a[0][0],o=e.invertX(t[1][0])-a[1][0],r=e.invertY(t[0][1])-a[0][1],s=e.invertY(t[1][1])-a[1][1];return e.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function gx(){var e=U$,t=V$,a=j$,n=G$,o=$$,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],i=250,l=xl,c=dl("start","zoom","end"),f,u,d,p=500,g=150,v=0,b=10;function x(N){N.property("__zoom",d6).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",M).filter(o).on("touchstart.zoom",O).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(N,_,A,D){var q=N.selection?N.selection():N;q.property("__zoom",d6),N!==q?S(N,_,A,D):q.interrupt().each(function(){C(this,arguments).event(D).start().zoom(null,typeof _=="function"?_.apply(this,arguments):_).end()})},x.scaleBy=function(N,_,A,D){x.scaleTo(N,function(){var q=this.__zoom.k,U=typeof _=="function"?_.apply(this,arguments):_;return q*U},A,D)},x.scaleTo=function(N,_,A,D){x.transform(N,function(){var q=t.apply(this,arguments),U=this.__zoom,P=A==null?w(q):typeof A=="function"?A.apply(this,arguments):A,W=U.invert(P),te=typeof _=="function"?_.apply(this,arguments):_;return a(h(y(U,te),P,W),q,s)},A,D)},x.translateBy=function(N,_,A,D){x.transform(N,function(){return a(this.__zoom.translate(typeof _=="function"?_.apply(this,arguments):_,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),s)},null,D)},x.translateTo=function(N,_,A,D,q){x.transform(N,function(){var U=t.apply(this,arguments),P=this.__zoom,W=D==null?w(U):typeof D=="function"?D.apply(this,arguments):D;return a(bl.translate(W[0],W[1]).scale(P.k).translate(typeof _=="function"?-_.apply(this,arguments):-_,typeof A=="function"?-A.apply(this,arguments):-A),U,s)},D,q)};function y(N,_){return _=Math.max(r[0],Math.min(r[1],_)),_===N.k?N:new Ro(_,N.x,N.y)}function h(N,_,A){var D=_[0]-A[0]*N.k,q=_[1]-A[1]*N.k;return D===N.x&&q===N.y?N:new Ro(N.k,D,q)}function w(N){return[(+N[0][0]+ +N[1][0])/2,(+N[0][1]+ +N[1][1])/2]}function S(N,_,A,D){N.on("start.zoom",function(){C(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(D).end()}).tween("zoom",function(){var q=this,U=arguments,P=C(q,U).event(D),W=t.apply(q,U),te=A==null?w(W):typeof A=="function"?A.apply(q,U):A,de=Math.max(W[1][0]-W[0][0],W[1][1]-W[0][1]),oe=q.__zoom,se=typeof _=="function"?_.apply(q,U):_,ue=l(oe.invert(te).concat(de/oe.k),se.invert(te).concat(de/se.k));return function(ce){if(ce===1)ce=se;else{var V=ue(ce),E=de/V[2];ce=new Ro(E,te[0]-V[0]*E,te[1]-V[1]*E)}P.zoom(null,ce)}})}function C(N,_,A){return!A&&N.__zooming||new I(N,_)}function I(N,_){this.that=N,this.args=_,this.active=0,this.sourceEvent=null,this.extent=t.apply(N,_),this.taps=0}I.prototype={event:function(N){return N&&(this.sourceEvent=N),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(N,_){return this.mouse&&N!=="mouse"&&(this.mouse[1]=_.invert(this.mouse[0])),this.touch0&&N!=="touch"&&(this.touch0[1]=_.invert(this.touch0[0])),this.touch1&&N!=="touch"&&(this.touch1[1]=_.invert(this.touch1[0])),this.that.__zoom=_,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(N){var _=la(this.that).datum();c.call(N,this.that,new ww(N,{sourceEvent:this.sourceEvent,target:x,type:N,transform:this.that.__zoom,dispatch:c}),_)}};function L(N,..._){if(!e.apply(this,arguments))return;var A=C(this,_).event(N),D=this.__zoom,q=Math.max(r[0],Math.min(r[1],D.k*Math.pow(2,n.apply(this,arguments)))),U=Ya(N);if(A.wheel)(A.mouse[0][0]!==U[0]||A.mouse[0][1]!==U[1])&&(A.mouse[1]=D.invert(A.mouse[0]=U)),clearTimeout(A.wheel);else{if(D.k===q)return;A.mouse=[U,D.invert(U)],yl(this),A.start()}yc(N),A.wheel=setTimeout(P,g),A.zoom("mouse",a(h(y(D,q),A.mouse[0],A.mouse[1]),A.extent,s));function P(){A.wheel=null,A.end()}}function T(N,..._){if(d||!e.apply(this,arguments))return;var A=N.currentTarget,D=C(this,_,!0).event(N),q=la(N.view).on("mousemove.zoom",te,!0).on("mouseup.zoom",de,!0),U=Ya(N,A),P=N.clientX,W=N.clientY;tp(N.view),hx(N),D.mouse=[U,this.__zoom.invert(U)],yl(this),D.start();function te(oe){if(yc(oe),!D.moved){var se=oe.clientX-P,ue=oe.clientY-W;D.moved=se*se+ue*ue>v}D.event(oe).zoom("mouse",a(h(D.that.__zoom,D.mouse[0]=Ya(oe,A),D.mouse[1]),D.extent,s))}function de(oe){q.on("mousemove.zoom mouseup.zoom",null),ap(oe.view,D.moved),yc(oe),D.event(oe).end()}}function M(N,..._){if(e.apply(this,arguments)){var A=this.__zoom,D=Ya(N.changedTouches?N.changedTouches[0]:N,this),q=A.invert(D),U=A.k*(N.shiftKey?.5:2),P=a(h(y(A,U),D,q),t.apply(this,_),s);yc(N),i>0?la(this).transition().duration(i).call(S,P,D,N):la(this).call(x.transform,P,D,N)}}function O(N,..._){if(e.apply(this,arguments)){var A=N.touches,D=A.length,q=C(this,_,N.changedTouches.length===D).event(N),U,P,W,te;for(hx(N),P=0;P<D;++P)W=A[P],te=Ya(W,this),te=[te,this.__zoom.invert(te),W.identifier],q.touch0?!q.touch1&&q.touch0[2]!==te[2]&&(q.touch1=te,q.taps=0):(q.touch0=te,U=!0,q.taps=1+!!f);f&&(f=clearTimeout(f)),U&&(q.taps<2&&(u=te[0],f=setTimeout(function(){f=null},p)),yl(this),q.start())}}function H(N,..._){if(this.__zooming){var A=C(this,_).event(N),D=N.changedTouches,q=D.length,U,P,W,te;for(yc(N),U=0;U<q;++U)P=D[U],W=Ya(P,this),A.touch0&&A.touch0[2]===P.identifier?A.touch0[0]=W:A.touch1&&A.touch1[2]===P.identifier&&(A.touch1[0]=W);if(P=A.that.__zoom,A.touch1){var de=A.touch0[0],oe=A.touch0[1],se=A.touch1[0],ue=A.touch1[1],ce=(ce=se[0]-de[0])*ce+(ce=se[1]-de[1])*ce,V=(V=ue[0]-oe[0])*V+(V=ue[1]-oe[1])*V;P=y(P,Math.sqrt(ce/V)),W=[(de[0]+se[0])/2,(de[1]+se[1])/2],te=[(oe[0]+ue[0])/2,(oe[1]+ue[1])/2]}else if(A.touch0)W=A.touch0[0],te=A.touch0[1];else return;A.zoom("touch",a(h(P,W,te),A.extent,s))}}function z(N,..._){if(this.__zooming){var A=C(this,_).event(N),D=N.changedTouches,q=D.length,U,P;for(hx(N),d&&clearTimeout(d),d=setTimeout(function(){d=null},p),U=0;U<q;++U)P=D[U],A.touch0&&A.touch0[2]===P.identifier?delete A.touch0:A.touch1&&A.touch1[2]===P.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(P=Ya(P,this),Math.hypot(u[0]-P[0],u[1]-P[1])<b)){var W=la(this).on("dblclick.zoom");W&&W.apply(this,arguments)}}}return x.wheelDelta=function(N){return arguments.length?(n=typeof N=="function"?N:vp(+N),x):n},x.filter=function(N){return arguments.length?(e=typeof N=="function"?N:vp(!!N),x):e},x.touchable=function(N){return arguments.length?(o=typeof N=="function"?N:vp(!!N),x):o},x.extent=function(N){return arguments.length?(t=typeof N=="function"?N:vp([[+N[0][0],+N[0][1]],[+N[1][0],+N[1][1]]]),x):t},x.scaleExtent=function(N){return arguments.length?(r[0]=+N[0],r[1]=+N[1],x):[r[0],r[1]]},x.translateExtent=function(N){return arguments.length?(s[0][0]=+N[0][0],s[1][0]=+N[1][0],s[0][1]=+N[0][1],s[1][1]=+N[1][1],x):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},x.constrain=function(N){return arguments.length?(a=N,x):a},x.duration=function(N){return arguments.length?(i=+N,x):i},x.interpolate=function(N){return arguments.length?(l=N,x):l},x.on=function(){var N=c.on.apply(c,arguments);return N===c?x:N},x.clickDistance=function(N){return arguments.length?(v=(N=+N)*N,x):Math.sqrt(v)},x.tapDistance=function(N){return arguments.length?(b=+N,x):b},x}var Pn={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:a,targetHandle:n})=>`Couldn't create edge for ${e} handle id: "${e==="source"?a:n}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Sc=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Iw=["Enter"," ","Escape"],Nw={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:a})=>`Moved selected node ${e}. New position, x: ${t}, y: ${a}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"},Ks;(function(e){e.Strict="strict",e.Loose="loose"})(Ks||(Ks={}));var Br;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Br||(Br={}));var wl;(function(e){e.Partial="partial",e.Full="full"})(wl||(wl={}));var Rw={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},nr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(nr||(nr={}));var ro;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ro||(ro={}));var we;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(we||(we={}));var f6={[we.Left]:we.Right,[we.Right]:we.Left,[we.Top]:we.Bottom,[we.Bottom]:we.Top},Tw=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,L6=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Mw=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e);var wp=(e,t=[0,0])=>{let{width:a,height:n}=so(e),o=e.origin??t,r=a*o[0],s=n*o[1];return{x:e.position.x-r,y:e.position.y-s}},Ew=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let a=!1,n=e.reduce((o,r)=>{let s=typeof r=="string",i=!t.nodeLookup&&!s?r:void 0;return t.nodeLookup&&(i=s?t.nodeLookup.get(r):Mw(r)?r:t.nodeLookup.get(r.id)),i?(a=!0,Sx(o,yx(i,t.nodeOrigin))):o},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return a?Cx(n):{x:0,y:0,width:0,height:0}},Cc=(e,t={})=>{let a={x:1/0,y:1/0,x2:-1/0,y2:-1/0},n=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(a=Sx(a,yx(o)),n=!0)}),n?Cx(a):{x:0,y:0,width:0,height:0}},bx=(e,t,[a,n,o]=[0,0,1],r=!1,s=!1)=>{let i=(t.x-a)/o,l=(t.y-n)/o,c=t.width/o,f=t.height/o,u=[];for(let d of e.values()){let{measured:p,selectable:g=!0,hidden:v=!1}=d;if(s&&!g||v)continue;let b=p.width??d.width??d.initialWidth??0,x=p.height??d.height??d.initialHeight??0,{x:y,y:h}=d.internals.positionAbsolute,w=M6(i,l,c,f,y,h,b,x),S=b*x,C=r&&w>0;(!d.internals.handleBounds||C||w>=S||d.dragging)&&u.push(d)}return u},I6=(e,t)=>{let a=new Set;return e.forEach(n=>{a.add(n.id)}),t.filter(n=>a.has(n.source)||a.has(n.target))};function W$(e,t){let a=new Map,n=t?.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{let r;if(t?.includeHiddenNodes){let{width:s,height:i}=so(o);r=s>0&&i>0}else r=!!(o.measured.width&&o.measured.height&&!o.hidden);r&&(!n||n.has(o.id))&&a.set(o.id,o)}),a}async function N6({nodes:e,width:t,height:a,panZoom:n,minZoom:o,maxZoom:r},s){if(e.size===0)return!0;let i=W$(e,s),l=Cc(i),c=Cp(l,t,a,s?.minZoom??o,s?.maxZoom??r,s?.padding??.1);return await n.setViewport(c,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0}function Aw({nodeId:e,nextPosition:t,nodeLookup:a,nodeOrigin:n=[0,0],nodeExtent:o,onError:r}){let s=a.get(e),i=s.parentId?a.get(s.parentId):void 0,{x:l,y:c}=i?i.internals.positionAbsolute:{x:0,y:0},f=s.origin??n,u=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!i)r?.("005",Pn.error005());else{let{width:p,height:g}=so(i);p&&g&&(u=[[l,c],[l+p,c+g]])}else i&&kl(s.extent)&&(u=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);let d=kl(u)?Sl(t,u,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&r?.("015",Pn.error015()),{position:{x:d.x-l+(s.measured.width??0)*f[0],y:d.y-c+(s.measured.height??0)*f[1]},positionAbsolute:d}}async function R6({nodesToRemove:e=[],edgesToRemove:t=[],nodes:a,edges:n,onBeforeDelete:o}){let r=new Set(e.map(d=>d.id)),s=[];for(let d of a){if(d.deletable===!1)continue;let p=r.has(d.id),g=!p&&d.parentId&&s.find(v=>v.id===d.parentId);(p||g)&&s.push(d)}let i=new Set(t.map(d=>d.id)),l=n.filter(d=>d.deletable!==!1),f=I6(s,l);for(let d of l)i.has(d.id)&&!f.find(g=>g.id===d.id)&&f.push(d);if(!o)return{edges:f,nodes:s};let u=await o({nodes:s,edges:f});return typeof u=="boolean"?u?{edges:f,nodes:s}:{edges:[],nodes:[]}:u}var wc=(e,t=0,a=1)=>Math.min(Math.max(e,t),a),Sl=(e={x:0,y:0},t,a)=>({x:wc(e.x,t[0][0],t[1][0]-(a?.width??0)),y:wc(e.y,t[0][1],t[1][1]-(a?.height??0))});function T6(e,t,a){let{width:n,height:o}=so(a),{x:r,y:s}=a.internals.positionAbsolute;return Sl(e,[[r,s],[r+n,s+o]],t)}var p6=(e,t,a)=>e<t?wc(Math.abs(e-t),1,t)/t:e>a?-wc(Math.abs(e-a),1,t)/t:0,wx=(e,t,a=15,n=40)=>{let o=p6(e.x,n,t.width-n)*a,r=p6(e.y,n,t.height-n)*a;return[o,r]},Sx=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Lw=({x:e,y:t,width:a,height:n})=>({x:e,y:t,x2:e+a,y2:t+n}),Cx=({x:e,y:t,x2:a,y2:n})=>({x:e,y:t,width:a-e,height:n-t}),kc=(e,t=[0,0])=>{let{x:a,y:n}=Mw(e)?e.internals.positionAbsolute:wp(e,t);return{x:a,y:n,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},yx=(e,t=[0,0])=>{let{x:a,y:n}=Mw(e)?e.internals.positionAbsolute:wp(e,t);return{x:a,y:n,x2:a+(e.measured?.width??e.width??e.initialWidth??0),y2:n+(e.measured?.height??e.height??e.initialHeight??0)}},Dw=(e,t)=>Cx(Sx(Lw(e),Lw(t))),M6=(e,t,a,n,o,r,s,i)=>{let l=Math.max(0,Math.min(e+a,o+s)-Math.max(e,o)),c=Math.max(0,Math.min(t+n,r+i)-Math.max(t,r));return Math.ceil(l*c)},Sp=(e,t)=>M6(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),_w=e=>no(e.width)&&no(e.height)&&no(e.x)&&no(e.y),no=e=>!isNaN(e)&&isFinite(e),Pw=(e,t)=>(a,n)=>{},Lc=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ic=({x:e,y:t},[a,n,o],r=!1,s=[1,1])=>{let i={x:(e-a)/o,y:(t-n)/o};return r?Lc(i,s):i},Cl=({x:e,y:t},[a,n,o])=>({x:e*o+a,y:t*o+n});function bc(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){let a=parseFloat(e);if(!Number.isNaN(a))return Math.floor(a)}if(typeof e=="string"&&e.endsWith("%")){let a=parseFloat(e);if(!Number.isNaN(a))return Math.floor(t*a*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function X$(e,t,a){if(typeof e=="string"||typeof e=="number"){let n=bc(e,a),o=bc(e,t);return{top:n,right:o,bottom:n,left:o,x:o*2,y:n*2}}if(typeof e=="object"){let n=bc(e.top??e.y??0,a),o=bc(e.bottom??e.y??0,a),r=bc(e.left??e.x??0,t),s=bc(e.right??e.x??0,t);return{top:n,right:s,bottom:o,left:r,x:r+s,y:n+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Y$(e,t,a,n,o,r){let{x:s,y:i}=Cl(e,[t,a,n]),{x:l,y:c}=Cl({x:e.x+e.width,y:e.y+e.height},[t,a,n]),f=o-l,u=r-c;return{left:Math.floor(s),top:Math.floor(i),right:Math.floor(f),bottom:Math.floor(u)}}var Cp=(e,t,a,n,o,r)=>{let s=X$(r,t,a),i=(t-s.x)/e.width,l=(a-s.y)/e.height,c=Math.min(i,l),f=wc(c,n,o),u=e.x+e.width/2,d=e.y+e.height/2,p=t/2-u*f,g=a/2-d*f,v=Y$(e,p,g,f,t,a),b={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:p-b.left+b.right,y:g-b.top+b.bottom,zoom:f}},Nc=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function kl(e){return e!=null&&e!=="parent"}function so(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Ow(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function zw(e,t={width:0,height:0},a,n,o){let r={...e},s=n.get(a);if(s){let i=s.origin||o;r.x+=s.internals.positionAbsolute.x-(t.width??0)*i[0],r.y+=s.internals.positionAbsolute.y-(t.height??0)*i[1]}return r}function Bw(e,t){if(e.size!==t.size)return!1;for(let a of e)if(!t.has(a))return!1;return!0}function E6(){let e,t;return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}}function A6(e){return{...Nw,...e||{}}}function Fw(e){return e===null?null:e?"valid":"invalid"}function bp(e,{snapGrid:t=[0,0],snapToGrid:a=!1,transform:n,containerBounds:o}){let{x:r,y:s}=oo(e),i=Ic({x:r-(o?.left??0),y:s-(o?.top??0)},n),{x:l,y:c}=a?Lc(i,t):i;return{xSnapped:l,ySnapped:c,...i}}var kx=e=>({width:e.offsetWidth,height:e.offsetHeight}),Hw=e=>e?.getRootNode?.()||window?.document,K$=["INPUT","SELECT","TEXTAREA"];function qw(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:K$.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}var Uw=e=>"clientX"in e,oo=(e,t)=>{let a=Uw(e),n=a?e.clientX:e.touches?.[0].clientX,o=a?e.clientY:e.touches?.[0].clientY;return{x:n-(t?.left??0),y:o-(t?.top??0)}},m6=(e,t,a,n,o)=>{let r=t.querySelectorAll(`.${e}`);return!r||!r.length?null:Array.from(r).map(s=>{let i=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(i.left-a.left)/n,y:(i.top-a.top)/n,...kx(s)}})};function Lx({sourceX:e,sourceY:t,targetX:a,targetY:n,sourceControlX:o,sourceControlY:r,targetControlX:s,targetControlY:i}){let l=e*.125+o*.375+s*.375+a*.125,c=t*.125+r*.375+i*.375+n*.125,f=Math.abs(l-e),u=Math.abs(c-t);return[l,c,f,u]}function xx(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function h6({pos:e,x1:t,y1:a,x2:n,y2:o,c:r}){switch(e){case we.Left:return[t-xx(t-n,r),a];case we.Right:return[t+xx(n-t,r),a];case we.Top:return[t,a-xx(a-o,r)];case we.Bottom:return[t,a+xx(o-a,r)]}}function Ix({sourceX:e,sourceY:t,sourcePosition:a=we.Bottom,targetX:n,targetY:o,targetPosition:r=we.Top,curvature:s=.25}){let[i,l]=h6({pos:a,x1:e,y1:t,x2:n,y2:o,c:s}),[c,f]=h6({pos:r,x1:n,y1:o,x2:e,y2:t,c:s}),[u,d,p,g]=Lx({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:l,targetControlX:c,targetControlY:f});return[`M${e},${t} C${i},${l} ${c},${f} ${n},${o}`,u,d,p,g]}function Vw({sourceX:e,sourceY:t,targetX:a,targetY:n}){let o=Math.abs(a-e)/2,r=a<e?a+o:a-o,s=Math.abs(n-t)/2,i=n<t?n+s:n-s;return[r,i,o,s]}function D6({sourceNode:e,targetNode:t,selected:a=!1,zIndex:n=0,elevateOnSelect:o=!1,zIndexMode:r="basic"}){if(r==="manual")return n;let s=o&&a?n+1e3:n,i=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+i}function _6({sourceNode:e,targetNode:t,width:a,height:n,transform:o}){let r=Sx(yx(e),yx(t));r.x===r.x2&&(r.x2+=1),r.y===r.y2&&(r.y2+=1);let s={x:-o[0]/o[2],y:-o[1]/o[2],width:a/o[2],height:n/o[2]};return Sp(s,Cx(r))>0}var Z$=({source:e,sourceHandle:t,target:a,targetHandle:n})=>`xy-edge__${e}${t||""}-${a}${n||""}`,Q$=(e,t)=>t.some(a=>a.source===e.source&&a.target===e.target&&(a.sourceHandle===e.sourceHandle||!a.sourceHandle&&!e.sourceHandle)&&(a.targetHandle===e.targetHandle||!a.targetHandle&&!e.targetHandle)),P6=(e,t,a={})=>{if(!e.source||!e.target)return a.onError?.("006",Pn.error006()),t;let n=a.getEdgeId||Z$,o;return Tw(e)?o={...e}:o={...e,id:n(e)},Q$(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function Nx({sourceX:e,sourceY:t,targetX:a,targetY:n}){let[o,r,s,i]=Vw({sourceX:e,sourceY:t,targetX:a,targetY:n});return[`M ${e},${t}L ${a},${n}`,o,r,s,i]}var g6={[we.Left]:{x:-1,y:0},[we.Right]:{x:1,y:0},[we.Top]:{x:0,y:-1},[we.Bottom]:{x:0,y:1}},J$=({source:e,sourcePosition:t=we.Bottom,target:a})=>t===we.Left||t===we.Right?e.x<a.x?{x:1,y:0}:{x:-1,y:0}:e.y<a.y?{x:0,y:1}:{x:0,y:-1},x6=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function ej({source:e,sourcePosition:t=we.Bottom,target:a,targetPosition:n=we.Top,center:o,offset:r,stepPosition:s}){let i=g6[t],l=g6[n],c={x:e.x+i.x*r,y:e.y+i.y*r},f={x:a.x+l.x*r,y:a.y+l.y*r},u=J$({source:c,sourcePosition:t,target:f}),d=u.x!==0?"x":"y",p=u[d],g=[],v,b,x={x:0,y:0},y={x:0,y:0},[,,h,w]=Vw({sourceX:e.x,sourceY:e.y,targetX:a.x,targetY:a.y});if(i[d]*l[d]===-1){d==="x"?(v=o.x??c.x+(f.x-c.x)*s,b=o.y??(c.y+f.y)/2):(v=o.x??(c.x+f.x)/2,b=o.y??c.y+(f.y-c.y)*s);let L=[{x:v,y:c.y},{x:v,y:f.y}],T=[{x:c.x,y:b},{x:f.x,y:b}];i[d]===p?g=d==="x"?L:T:g=d==="x"?T:L}else{let L=[{x:c.x,y:f.y}],T=[{x:f.x,y:c.y}];if(d==="x"?g=i.x===p?T:L:g=i.y===p?L:T,t===n){let N=Math.abs(e[d]-a[d]);if(N<=r){let _=Math.min(r-1,r-N);i[d]===p?x[d]=(c[d]>e[d]?-1:1)*_:y[d]=(f[d]>a[d]?-1:1)*_}}if(t!==n){let N=d==="x"?"y":"x",_=i[d]===l[N],A=c[N]>f[N],D=c[N]<f[N];(i[d]===1&&(!_&&A||_&&D)||i[d]!==1&&(!_&&D||_&&A))&&(g=d==="x"?L:T)}let M={x:c.x+x.x,y:c.y+x.y},O={x:f.x+y.x,y:f.y+y.y},H=Math.max(Math.abs(M.x-g[0].x),Math.abs(O.x-g[0].x)),z=Math.max(Math.abs(M.y-g[0].y),Math.abs(O.y-g[0].y));H>=z?(v=(M.x+O.x)/2,b=g[0].y):(v=g[0].x,b=(M.y+O.y)/2)}let S={x:c.x+x.x,y:c.y+x.y},C={x:f.x+y.x,y:f.y+y.y};return[[e,...S.x!==g[0].x||S.y!==g[0].y?[S]:[],...g,...C.x!==g[g.length-1].x||C.y!==g[g.length-1].y?[C]:[],a],v,b,h,w]}function tj(e,t,a,n){let o=Math.min(x6(e,t)/2,x6(t,a)/2,n),{x:r,y:s}=t;if(e.x===r&&r===a.x||e.y===s&&s===a.y)return`L${r} ${s}`;if(e.y===s){let c=e.x<a.x?-1:1,f=e.y<a.y?1:-1;return`L ${r+o*c},${s}Q ${r},${s} ${r},${s+o*f}`}let i=e.x<a.x?1:-1,l=e.y<a.y?-1:1;return`L ${r},${s+o*l}Q ${r},${s} ${r+o*i},${s}`}function Qs({sourceX:e,sourceY:t,sourcePosition:a=we.Bottom,targetX:n,targetY:o,targetPosition:r=we.Top,borderRadius:s=5,centerX:i,centerY:l,offset:c=20,stepPosition:f=.5}){let[u,d,p,g,v]=ej({source:{x:e,y:t},sourcePosition:a,target:{x:n,y:o},targetPosition:r,center:{x:i,y:l},offset:c,stepPosition:f}),b=`M${u[0].x} ${u[0].y}`;for(let x=1;x<u.length-1;x++)b+=tj(u[x-1],u[x],u[x+1],s);return b+=`L${u[u.length-1].x} ${u[u.length-1].y}`,[b,d,p,g,v]}function v6(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function O6(e){let{sourceNode:t,targetNode:a}=e;if(!v6(t)||!v6(a))return null;let n=t.internals.handleBounds||y6(t.handles),o=a.internals.handleBounds||y6(a.handles),r=b6(n?.source??[],e.sourceHandle),s=b6(e.connectionMode===Ks.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!r||!s)return e.onError?.("008",Pn.error008(r?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let i=r?.position||we.Bottom,l=s?.position||we.Top,c=Zs(t,r,i),f=Zs(a,s,l);return{sourceX:c.x,sourceY:c.y,targetX:f.x,targetY:f.y,sourcePosition:i,targetPosition:l}}function y6(e){if(!e)return null;let t=[],a=[];for(let n of e)n.width=n.width??1,n.height=n.height??1,n.type==="source"?t.push(n):n.type==="target"&&a.push(n);return{source:t,target:a}}function Zs(e,t,a=we.Left,n=!1){let o=(t?.x??0)+e.internals.positionAbsolute.x,r=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:i}=t??so(e);if(n)return{x:o+s/2,y:r+i/2};switch(t?.position??a){case we.Top:return{x:o+s/2,y:r};case we.Right:return{x:o+s,y:r+i/2};case we.Bottom:return{x:o+s/2,y:r+i};case we.Left:return{x:o,y:r+i/2}}}function b6(e,t){return e&&(t?e.find(a=>a.id===t):e[0])||null}function Rx(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(n=>`${n}=${e[n]}`).join("&")}`:""}function z6(e,{id:t,defaultColor:a,defaultMarkerStart:n,defaultMarkerEnd:o}){let r=new Set;return e.reduce((s,i)=>([i.markerStart||n,i.markerEnd||o].forEach(l=>{if(l&&typeof l=="object"){let c=Rx(l,t);r.has(c)||(s.push({id:c,color:l.color||a,...l}),r.add(c))}}),s),[]).sort((s,i)=>s.id.localeCompare(i.id))}var B6=1e3,aj=10,Gw={nodeOrigin:[0,0],nodeExtent:Sc,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},nj={...Gw,checkEquality:!0};function $w(e,t){let a={...e};for(let n in t)t[n]!==void 0&&(a[n]=t[n]);return a}function F6(e,t,a){let n=$w(Gw,a);for(let o of e.values())if(o.parentId)Ww(o,e,t,n);else{let r=wp(o,n.nodeOrigin),s=kl(o.extent)?o.extent:n.nodeExtent,i=Sl(r,s,so(o));o.internals.positionAbsolute=i}}function oj(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let a=[],n=[];for(let o of e.handles){let r={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?a.push(r):o.type==="target"&&n.push(r)}return{source:a,target:n}}function jw(e){return e==="manual"}function Tx(e,t,a,n={}){let o=$w(nj,n),r={i:0},s=new Map(t),i=o?.elevateNodesOnSelect&&!jw(o.zIndexMode)?B6:0,l=e.length>0,c=!1;t.clear(),a.clear();for(let f of e){let u=s.get(f.id);if(o.checkEquality&&f===u?.internals.userNode)t.set(f.id,u);else{let d=wp(f,o.nodeOrigin),p=kl(f.extent)?f.extent:o.nodeExtent,g=Sl(d,p,so(f));u={...o.defaults,...f,measured:{width:f.measured?.width,height:f.measured?.height},internals:{positionAbsolute:g,handleBounds:oj(f,u),z:H6(f,i,o.zIndexMode),userNode:f}},t.set(f.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(l=!1),f.parentId&&Ww(u,t,a,n,r),c||=f.selected??!1}return{nodesInitialized:l,hasSelectedNodes:c}}function rj(e,t){if(!e.parentId)return;let a=t.get(e.parentId);a?a.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Ww(e,t,a,n,o){let{elevateNodesOnSelect:r,nodeOrigin:s,nodeExtent:i,zIndexMode:l}=$w(Gw,n),c=e.parentId,f=t.get(c);if(!f){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}rj(e,a),o&&!f.parentId&&f.internals.rootParentIndex===void 0&&l==="auto"&&(f.internals.rootParentIndex=++o.i,f.internals.z=f.internals.z+o.i*aj),o&&f.internals.rootParentIndex!==void 0&&(o.i=f.internals.rootParentIndex);let u=r&&!jw(l)?B6:0,{x:d,y:p,z:g}=sj(e,f,s,i,u,l),{positionAbsolute:v}=e.internals,b=d!==v.x||p!==v.y;(b||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:d,y:p}:v,z:g}})}function H6(e,t,a){let n=no(e.zIndex)?e.zIndex:0;return jw(a)?n:n+(e.selected?t:0)}function sj(e,t,a,n,o,r){let{x:s,y:i}=t.internals.positionAbsolute,l=so(e),c=wp(e,a),f=kl(e.extent)?Sl(c,e.extent,l):c,u=Sl({x:s+f.x,y:i+f.y},n,l);e.extent==="parent"&&(u=T6(u,l,t));let d=H6(e,o,r),p=t.internals.z??0;return{x:u.x,y:u.y,z:p>=d?p+1:d}}function Mx(e,t,a,n=[0,0]){let o=[],r=new Map;for(let s of e){let i=t.get(s.parentId);if(!i)continue;let l=r.get(s.parentId)?.expandedRect??kc(i),c=Dw(l,s.rect);r.set(s.parentId,{expandedRect:c,parent:i})}return r.size>0&&r.forEach(({expandedRect:s,parent:i},l)=>{let c=i.internals.positionAbsolute,f=so(i),u=i.origin??n,d=s.x<c.x?Math.round(Math.abs(c.x-s.x)):0,p=s.y<c.y?Math.round(Math.abs(c.y-s.y)):0,g=Math.max(f.width,Math.round(s.width)),v=Math.max(f.height,Math.round(s.height)),b=(g-f.width)*u[0],x=(v-f.height)*u[1];(d>0||p>0||b||x)&&(o.push({id:l,type:"position",position:{x:i.position.x-d+b,y:i.position.y-p+x}}),a.get(l)?.forEach(y=>{e.some(h=>h.id===y.id)||o.push({id:y.id,type:"position",position:{x:y.position.x+d,y:y.position.y+p}})})),(f.width<s.width||f.height<s.height||d||p)&&o.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:g+(d?u[0]*d-b:0),height:v+(p?u[1]*p-x:0)}})}),o}function q6(e,t,a,n,o,r,s){let i=n?.querySelector(".xyflow__viewport"),l=!1;if(!i)return{changes:[],updatedInternals:l};let c=[],f=window.getComputedStyle(i),{m22:u}=new window.DOMMatrixReadOnly(f.transform),d=[];for(let p of e.values()){let g=t.get(p.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),l=!0;continue}let v=kx(p.nodeElement),b=g.measured.width!==v.width||g.measured.height!==v.height;if(!!(v.width&&v.height&&(b||!g.internals.handleBounds||p.force))){let y=p.nodeElement.getBoundingClientRect(),h=kl(g.extent)?g.extent:r,{positionAbsolute:w}=g.internals;if(g.parentId&&g.extent==="parent"){let C=t.get(g.parentId);C&&(w=T6(w,v,C))}else h&&(w=Sl(w,h,v));let S={...g,measured:v,internals:{...g.internals,positionAbsolute:w,handleBounds:{source:m6("source",p.nodeElement,y,u,g.id),target:m6("target",p.nodeElement,y,u,g.id)}}};t.set(g.id,S),g.parentId&&Ww(S,t,a,{nodeOrigin:o,zIndexMode:s}),l=!0,b&&(c.push({id:g.id,type:"dimensions",dimensions:v}),g.expandParent&&g.parentId&&d.push({id:g.id,parentId:g.parentId,rect:kc(S,o)}))}}if(d.length>0){let p=Mx(d,t,a,o);c.push(...p)}return{changes:c,updatedInternals:l}}async function U6({delta:e,panZoom:t,transform:a,translateExtent:n,width:o,height:r}){if(!t||!e.x&&!e.y)return!1;let s=await t.setViewportConstrained({x:a[0]+e.x,y:a[1]+e.y,zoom:a[2]},[[0,0],[o,r]],n);return!!s&&(s.x!==a[0]||s.y!==a[1]||s.k!==a[2])}function w6(e,t,a,n,o,r){let s=o,i=n.get(s)||new Map;n.set(s,i.set(a,t)),s=`${o}-${e}`;let l=n.get(s)||new Map;if(n.set(s,l.set(a,t)),r){s=`${o}-${e}-${r}`;let c=n.get(s)||new Map;n.set(s,c.set(a,t))}}function Xw(e,t,a){e.clear(),t.clear();for(let n of a){let{source:o,target:r,sourceHandle:s=null,targetHandle:i=null}=n,l={edgeId:n.id,source:o,target:r,sourceHandle:s,targetHandle:i},c=`${o}-${s}--${r}-${i}`,f=`${r}-${i}--${o}-${s}`;w6("source",l,f,e,o,s),w6("target",l,c,e,r,i),t.set(n.id,n)}}function V6(e,t){if(!e.parentId)return!1;let a=t.get(e.parentId);return a?a.selected?!0:V6(a,t):!1}function S6(e,t,a){let n=e;do{if(n?.matches?.(t))return!0;if(n===a)return!1;n=n?.parentElement}while(n);return!1}function ij(e,t,a,n){let o=new Map;for(let[r,s]of e)if((s.selected||s.id===n)&&(!s.parentId||!V6(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){let i=e.get(r);i&&o.set(r,{id:r,position:i.position||{x:0,y:0},distance:{x:a.x-i.internals.positionAbsolute.x,y:a.y-i.internals.positionAbsolute.y},extent:i.extent,parentId:i.parentId,origin:i.origin,expandParent:i.expandParent,internals:{positionAbsolute:i.internals.positionAbsolute||{x:0,y:0}},measured:{width:i.measured.width??0,height:i.measured.height??0}})}return o}function Sw({nodeId:e,dragItems:t,nodeLookup:a,dragging:n=!0}){let o=[];for(let[s,i]of t){let l=a.get(s)?.internals.userNode;l&&o.push({...l,position:i.position,dragging:n})}if(!e)return[o[0],o];let r=a.get(e)?.internals.userNode;return[r?{...r,position:t.get(e)?.position||r.position,dragging:n}:o[0],o]}function lj({dragItems:e,snapGrid:t,x:a,y:n}){let o=e.values().next().value;if(!o)return null;let r={x:a-o.distance.x,y:n-o.distance.y},s=Lc(r,t);return{x:s.x-r.x,y:s.y-r.y}}function G6({onNodeMouseDown:e,getStoreItems:t,onDragStart:a,onDrag:n,onDragStop:o}){let r={x:null,y:null},s=0,i=new Map,l=!1,c={x:0,y:0},f=null,u=!1,d=null,p=!1,g=!1,v=null;function b({noDragClassName:y,handleSelector:h,domNode:w,isSelectable:S,nodeId:C,nodeClickDistance:I=0}){d=la(w);function L({x:H,y:z}){let{nodeLookup:N,nodeExtent:_,snapGrid:A,snapToGrid:D,nodeOrigin:q,onNodeDrag:U,onSelectionDrag:P,onError:W,updateNodePositions:te}=t();r={x:H,y:z};let de=!1,oe=i.size>1,se=oe&&_?Lw(Cc(i)):null,ue=oe&&D?lj({dragItems:i,snapGrid:A,x:H,y:z}):null;for(let[ce,V]of i){if(!N.has(ce))continue;let E={x:H-V.distance.x,y:z-V.distance.y};D&&(E=ue?{x:Math.round(E.x+ue.x),y:Math.round(E.y+ue.y)}:Lc(E,A));let ne=null;if(oe&&_&&!V.extent&&se){let{positionAbsolute:G}=V.internals,re=G.x-se.x+_[0][0],Y=G.x+V.measured.width-se.x2+_[1][0],Le=G.y-se.y+_[0][1],Be=G.y+V.measured.height-se.y2+_[1][1];ne=[[re,Le],[Y,Be]]}let{position:le,positionAbsolute:F}=Aw({nodeId:ce,nextPosition:E,nodeLookup:N,nodeExtent:ne||_,nodeOrigin:q,onError:W});de=de||V.position.x!==le.x||V.position.y!==le.y,V.position=le,V.internals.positionAbsolute=F}if(g=g||de,!!de&&(te(i,!0),v&&(n||U||!C&&P))){let[ce,V]=Sw({nodeId:C,dragItems:i,nodeLookup:N});n?.(v,i,ce,V),U?.(v,ce,V),C||P?.(v,V)}}async function T(){if(!f)return;let{transform:H,panBy:z,autoPanSpeed:N,autoPanOnNodeDrag:_}=t();if(!_){l=!1,cancelAnimationFrame(s);return}let[A,D]=wx(c,f,N);(A!==0||D!==0)&&(r.x=(r.x??0)-A/H[2],r.y=(r.y??0)-D/H[2],await z({x:A,y:D})&&L(r)),s=requestAnimationFrame(T)}function M(H){let{nodeLookup:z,multiSelectionActive:N,nodesDraggable:_,transform:A,snapGrid:D,snapToGrid:q,selectNodesOnDrag:U,onNodeDragStart:P,onSelectionDragStart:W,unselectNodesAndEdges:te}=t();u=!0,(!U||!S)&&!N&&C&&(z.get(C)?.selected||te()),S&&U&&C&&e?.(C);let de=bp(H.sourceEvent,{transform:A,snapGrid:D,snapToGrid:q,containerBounds:f});if(r=de,i=ij(z,_,de,C),i.size>0&&(a||P||!C&&W)){let[oe,se]=Sw({nodeId:C,dragItems:i,nodeLookup:z});a?.(H.sourceEvent,i,oe,se),P?.(H.sourceEvent,oe,se),C||W?.(H.sourceEvent,se)}}let O=Yg().clickDistance(I).on("start",H=>{let{domNode:z,nodeDragThreshold:N,transform:_,snapGrid:A,snapToGrid:D}=t();f=z?.getBoundingClientRect()||null,p=!1,g=!1,v=H.sourceEvent,N===0&&M(H),r=bp(H.sourceEvent,{transform:_,snapGrid:A,snapToGrid:D,containerBounds:f}),c=oo(H.sourceEvent,f)}).on("drag",H=>{let{autoPanOnNodeDrag:z,transform:N,snapGrid:_,snapToGrid:A,nodeDragThreshold:D,nodeLookup:q}=t(),U=bp(H.sourceEvent,{transform:N,snapGrid:_,snapToGrid:A,containerBounds:f});if(v=H.sourceEvent,(H.sourceEvent.type==="touchmove"&&H.sourceEvent.touches.length>1||C&&!q.has(C))&&(p=!0),!p){if(!l&&z&&u&&(l=!0,T()),!u){let P=oo(H.sourceEvent,f),W=P.x-c.x,te=P.y-c.y;Math.sqrt(W*W+te*te)>D&&M(H)}(r.x!==U.xSnapped||r.y!==U.ySnapped)&&i&&u&&(c=oo(H.sourceEvent,f),L(U))}}).on("end",H=>{if(!u||p){p&&i.size>0&&t().updateNodePositions(i,!1);return}if(l=!1,u=!1,cancelAnimationFrame(s),i.size>0){let{nodeLookup:z,updateNodePositions:N,onNodeDragStop:_,onSelectionDragStop:A}=t();if(g&&(N(i,!1),g=!1),o||_||!C&&A){let[D,q]=Sw({nodeId:C,dragItems:i,nodeLookup:z,dragging:!1});o?.(H.sourceEvent,i,D,q),_?.(H.sourceEvent,D,q),C||A?.(H.sourceEvent,q)}}}).filter(H=>{let z=H.target;return!H.button&&(!y||!S6(z,`.${y}`,w))&&(!h||S6(z,h,w))});d.call(O)}function x(){d?.on(".drag",null)}return{update:b,destroy:x}}function uj(e,t,a){let n=[],o={x:e.x-a,y:e.y-a,width:a*2,height:a*2};for(let r of t.values())Sp(o,kc(r))>0&&n.push(r);return n}var cj=250;function dj(e,t,a,n){let o=[],r=1/0,s=uj(e,a,t+cj);for(let i of s){let l=[...i.internals.handleBounds?.source??[],...i.internals.handleBounds?.target??[]];for(let c of l){if(n.nodeId===c.nodeId&&n.type===c.type&&n.id===c.id)continue;let{x:f,y:u}=Zs(i,c,c.position,!0),d=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(u-e.y,2));d>t||(d<r?(o=[{...c,x:f,y:u}],r=d):d===r&&o.push({...c,x:f,y:u}))}}if(!o.length)return null;if(o.length>1){let i=n.type==="source"?"target":"source";return o.find(l=>l.type===i)??o[0]}return o[0]}function $6(e,t,a,n,o,r=!1){let s=n.get(e);if(!s)return null;let i=o==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],l=(a?i?.find(c=>c.id===a):i?.[0])??null;return l&&r?{...l,...Zs(s,l,l.position,!0)}:l}function j6(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function fj(e,t){let a=null;return t?a=!0:e&&!t&&(a=!1),a}var W6=()=>!0;function pj(e,{connectionMode:t,connectionRadius:a,handleId:n,nodeId:o,edgeUpdaterType:r,isTarget:s,domNode:i,nodeLookup:l,lib:c,autoPanOnConnect:f,flowId:u,panBy:d,cancelConnection:p,onConnectStart:g,onConnect:v,onConnectEnd:b,isValidConnection:x=W6,onReconnectEnd:y,updateConnection:h,getTransform:w,getFromHandle:S,autoPanSpeed:C,dragThreshold:I=1,handleDomNode:L}){let T=Hw(e.target),M=0,O,{x:H,y:z}=oo(e),N=j6(r,L),_=i?.getBoundingClientRect(),A=!1;if(!_||!N)return;let D=$6(o,N,n,l,t);if(!D)return;let q=oo(e,_),U=!1,P=null,W=!1,te=null;function de(){if(!f||!_)return;let[le,F]=wx(q,_,C);d({x:le,y:F}),M=requestAnimationFrame(de)}let oe={...D,nodeId:o,type:N,position:D.position},se=l.get(o),ce={inProgress:!0,isValid:null,from:Zs(se,oe,we.Left,!0),fromHandle:oe,fromPosition:oe.position,fromNode:se,to:q,toHandle:null,toPosition:f6[oe.position],toNode:null,pointer:q};function V(){A=!0,h(ce),g?.(e,{nodeId:o,handleId:n,handleType:N})}I===0&&V();function E(le){if(!A){let{x:Be,y:yt}=oo(le),rt=Be-H,Vt=yt-z;if(!(rt*rt+Vt*Vt>I*I))return;V()}if(!S()||!oe){ne(le);return}let F=w();q=oo(le,_),O=dj(Ic(q,F,!1,[1,1]),a,l,oe),U||(de(),U=!0);let G=X6(le,{handle:O,connectionMode:t,fromNodeId:o,fromHandleId:n,fromType:s?"target":"source",isValidConnection:x,doc:T,lib:c,flowId:u,nodeLookup:l});te=G.handleDomNode,P=G.connection,W=fj(!!O,G.isValid);let re=l.get(o),Y=re?Zs(re,oe,we.Left,!0):ce.from,Le={...ce,from:Y,isValid:W,to:G.toHandle&&W?Cl({x:G.toHandle.x,y:G.toHandle.y},F):q,toHandle:G.toHandle,toPosition:W&&G.toHandle?G.toHandle.position:f6[oe.position],toNode:G.toHandle?l.get(G.toHandle.nodeId):null,pointer:q};h(Le),ce=Le}function ne(le){if(!("touches"in le&&le.touches.length>0)){if(A){(O||te)&&P&&W&&v?.(P);let{inProgress:F,...G}=ce,re={...G,toPosition:ce.toHandle?ce.toPosition:null};b?.(le,re),r&&y?.(le,re)}p(),cancelAnimationFrame(M),U=!1,W=!1,P=null,te=null,T.removeEventListener("mousemove",E),T.removeEventListener("mouseup",ne),T.removeEventListener("touchmove",E),T.removeEventListener("touchend",ne)}}T.addEventListener("mousemove",E),T.addEventListener("mouseup",ne),T.addEventListener("touchmove",E),T.addEventListener("touchend",ne)}function X6(e,{handle:t,connectionMode:a,fromNodeId:n,fromHandleId:o,fromType:r,doc:s,lib:i,flowId:l,isValidConnection:c=W6,nodeLookup:f}){let u=r==="target",d=t?s.querySelector(`.${i}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:g}=oo(e),v=s.elementFromPoint(p,g),b=v?.classList.contains(`${i}-flow__handle`)?v:d,x={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){let y=j6(void 0,b),h=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),S=b.classList.contains("connectable"),C=b.classList.contains("connectableend");if(!h||!y)return x;let I={source:u?h:n,sourceHandle:u?w:o,target:u?n:h,targetHandle:u?o:w};x.connection=I;let T=S&&C&&(a===Ks.Strict?u&&y==="source"||!u&&y==="target":h!==n||w!==o);x.isValid=T&&c(I),x.toHandle=$6(h,y,w,f,a,!0)}return x}var Ex={onPointerDown:pj,isValid:X6};function Y6({domNode:e,panZoom:t,getTransform:a,getViewScale:n}){let o=la(e);function r({translateExtent:i,width:l,height:c,zoomStep:f=1,pannable:u=!0,zoomable:d=!0,inversePan:p=!1}){let g=h=>{if(h.sourceEvent.type!=="wheel"||!t)return;let w=a(),S=h.sourceEvent.ctrlKey&&Nc()?10:1,C=-h.sourceEvent.deltaY*(h.sourceEvent.deltaMode===1?.05:h.sourceEvent.deltaMode?1:.002)*f,I=w[2]*Math.pow(2,C*S);t.scaleTo(I)},v=[0,0],b=h=>{(h.sourceEvent.type==="mousedown"||h.sourceEvent.type==="touchstart")&&(v=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY])},x=h=>{let w=a();if(h.sourceEvent.type!=="mousemove"&&h.sourceEvent.type!=="touchmove"||!t)return;let S=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY],C=[S[0]-v[0],S[1]-v[1]];v=S;let I=n()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),L={x:w[0]-C[0]*I,y:w[1]-C[1]*I},T=[[0,0],[l,c]];t.setViewportConstrained({x:L.x,y:L.y,zoom:w[2]},T,i)},y=gx().on("start",b).on("zoom",u?x:null).on("zoom.wheel",d?g:null);o.call(y,{})}function s(){o.on("zoom",null)}return{update:r,destroy:s,pointer:Ya}}var Ax=e=>({x:e.x,y:e.y,zoom:e.k}),Cw=({x:e,y:t,zoom:a})=>bl.translate(e,t).scale(a),Ys=(e,t)=>e.target.closest(`.${t}`),K6=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),mj=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,kw=(e,t=0,a=mj,n=()=>{})=>{let o=typeof t=="number"&&t>0;return o||n(),o?e.transition().duration(t).ease(a).on("end",n):e},Z6=e=>{let t=e.ctrlKey&&Nc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function hj({zoomPanValues:e,noWheelClassName:t,d3Selection:a,d3Zoom:n,panOnScrollMode:o,panOnScrollSpeed:r,zoomOnPinch:s,onPanZoomStart:i,onPanZoom:l,onPanZoomEnd:c}){return f=>{if(Ys(f,t))return f.ctrlKey&&f.preventDefault(),!1;f.preventDefault(),f.stopImmediatePropagation();let u=a.property("__zoom").k||1;if(f.ctrlKey&&s){let b=Ya(f),x=Z6(f),y=u*Math.pow(2,x);n.scaleTo(a,y,b,f);return}let d=f.deltaMode===1?20:1,p=o===Br.Vertical?0:f.deltaX*d,g=o===Br.Horizontal?0:f.deltaY*d;!Nc()&&f.shiftKey&&o!==Br.Vertical&&(p=f.deltaY*d,g=0),n.translateBy(a,-(p/u)*r,-(g/u)*r,{internal:!0});let v=Ax(a.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?l?.(f,v):(e.isPanScrolling=!0,i?.(f,v)),e.panScrollTimeout=setTimeout(()=>{c?.(f,v),e.isPanScrolling=!1},150)}}function gj({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:a}){return function(n,o){let r=n.type==="wheel",s=!t&&r&&!n.ctrlKey,i=Ys(n,e);if(n.ctrlKey&&r&&i&&n.preventDefault(),s||i)return null;n.preventDefault(),a.call(this,n,o)}}function xj({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:a}){return n=>{if(n.sourceEvent?.internal)return;let o=Ax(n.transform);e.mouseButton=n.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,n.sourceEvent?.type==="mousedown"&&t(!0),a&&a?.(n.sourceEvent,o)}}function vj({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:a,onTransformChange:n,onPanZoom:o}){return r=>{e.usedRightMouseButton=!!(a&&K6(t,e.mouseButton??0)),r.sourceEvent?.sync||n([r.transform.x,r.transform.y,r.transform.k]),o&&!r.sourceEvent?.internal&&o?.(r.sourceEvent,Ax(r.transform))}}function yj({zoomPanValues:e,panOnDrag:t,panOnScroll:a,onDraggingChange:n,onPanZoomEnd:o,onPaneContextMenu:r}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,r&&K6(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&r(s.sourceEvent),e.usedRightMouseButton=!1,n(!1),o)){let i=Ax(s.transform);e.prevViewport=i,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(s.sourceEvent,i)},a?150:0)}}}function bj({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:a,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:i,noWheelClassName:l,noPanClassName:c,lib:f,connectionInProgress:u}){return d=>{let p=t||a,g=n&&d.ctrlKey,v=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Ys(d,`${f}-flow__node`)||Ys(d,`${f}-flow__edge`)||Ys(d,`${f}-flow__selection`)||Ys(d,`${f}-flow__nodesselection`)))return!0;if(!o&&!p&&!r&&!s&&!n||i||u&&!v||Ys(d,l)&&v||Ys(d,c)&&(!v||r&&v&&!t)||!n&&d.ctrlKey&&v)return!1;if(!n&&d.type==="touchstart"&&d.touches?.length>1)return d.preventDefault(),!1;if(!p&&!r&&!g&&v||!o&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(o)&&!o.includes(d.button)&&d.type==="mousedown")return!1;let b=Array.isArray(o)&&o.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||v||e)&&b}}function Q6({domNode:e,minZoom:t,maxZoom:a,translateExtent:n,viewport:o,onPanZoom:r,onPanZoomStart:s,onPanZoomEnd:i,onDraggingChange:l}){let c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),u=[[0,0],[f.width,f.height]];(typeof ResizeObserver<"u"?new ResizeObserver(z=>{let N=z[0];N&&(u=[[0,0],[N.contentRect.width,N.contentRect.height]])}):null)?.observe(e);let p=gx().extent(()=>u).scaleExtent([t,a]).translateExtent(n),g=la(e).call(p);w({x:o.x,y:o.y,zoom:wc(o.zoom,t,a)},[[0,0],[f.width,f.height]],n);let v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");p.wheelDelta(Z6);async function x(z,N){return g?new Promise(_=>{p?.interpolate(N?.interpolate==="linear"?Or:xl).transform(kw(g,N?.duration,N?.ease,()=>_(!0)),z)}):!1}function y({noWheelClassName:z,noPanClassName:N,onPaneContextMenu:_,userSelectionActive:A,panOnScroll:D,panOnDrag:q,panOnScrollMode:U,panOnScrollSpeed:P,preventScrolling:W,zoomOnPinch:te,zoomOnScroll:de,zoomOnDoubleClick:oe,panActivationKeyPressed:se=!1,zoomActivationKeyPressed:ue,lib:ce,onTransformChange:V,connectionInProgress:E,paneClickDistance:ne,selectionOnDrag:le}){A&&!c.isZoomingOrPanning&&h();let F=D&&!ue&&!A;p.clickDistance(le?1/0:!no(ne)||ne<0?0:ne);let G=F?hj({zoomPanValues:c,noWheelClassName:z,d3Selection:g,d3Zoom:p,panOnScrollMode:U,panOnScrollSpeed:P,zoomOnPinch:te,onPanZoomStart:s,onPanZoom:r,onPanZoomEnd:i}):gj({noWheelClassName:z,preventScrolling:W,d3ZoomHandler:v});g.on("wheel.zoom",G,{passive:!1});let re=xj({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:s});p.on("start",re);let Y=vj({zoomPanValues:c,panOnDrag:q,onPaneContextMenu:!!_,onPanZoom:r,onTransformChange:V});p.on("zoom",Y);let Le=yj({zoomPanValues:c,panOnDrag:q,panOnScroll:D,onPaneContextMenu:_,onPanZoomEnd:i,onDraggingChange:l});p.on("end",Le);let Be=bj({panActivationKeyPressed:se,zoomActivationKeyPressed:ue,panOnDrag:q,zoomOnScroll:de,panOnScroll:D,zoomOnDoubleClick:oe,zoomOnPinch:te,userSelectionActive:A,noPanClassName:N,noWheelClassName:z,lib:ce,connectionInProgress:E});p.filter(Be),oe?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function h(){p.on("zoom",null)}async function w(z,N,_){let A=Cw(z),D=p?.constrain()(A,N,_);return D&&await x(D),D}async function S(z,N){let _=Cw(z);return await x(_,N),_}function C(z){if(g){let N=Cw(z),_=g.property("__zoom");(_.k!==z.zoom||_.x!==z.x||_.y!==z.y)&&p?.transform(g,N,null,{sync:!0})}}function I(){let z=g?yp(g.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}async function L(z,N){return g?new Promise(_=>{p?.interpolate(N?.interpolate==="linear"?Or:xl).scaleTo(kw(g,N?.duration,N?.ease,()=>_(!0)),z)}):!1}async function T(z,N){return g?new Promise(_=>{p?.interpolate(N?.interpolate==="linear"?Or:xl).scaleBy(kw(g,N?.duration,N?.ease,()=>_(!0)),z)}):!1}function M(z){p?.scaleExtent(z)}function O(z){p?.translateExtent(z)}function H(z){let N=!no(z)||z<0?0:z;p?.clickDistance(N)}return{update:y,destroy:h,setViewport:S,setViewportConstrained:w,getViewport:I,scaleTo:L,scaleBy:T,setScaleExtent:M,setTranslateExtent:O,syncViewport:C,setClickDistance:H}}var Fr;(function(e){e.Line="line",e.Handle="handle"})(Fr||(Fr={}));var J6=["top-left","top-right","bottom-left","bottom-right"],eD=["top","right","bottom","left"];function wj({width:e,prevWidth:t,height:a,prevHeight:n,affectsX:o,affectsY:r}){let s=e-t,i=a-n,l=[s>0?1:s<0?-1:0,i>0?1:i<0?-1:0];return s&&o&&(l[0]=l[0]*-1),i&&r&&(l[1]=l[1]*-1),l}function C6(e){let t=e.includes("right")||e.includes("left"),a=e.includes("bottom")||e.includes("top"),n=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:a,affectsX:n,affectsY:o}}function Ws(e,t){return Math.max(0,t-e)}function Xs(e,t){return Math.max(0,e-t)}function vx(e,t,a){return Math.max(0,t-e,e-a)}function k6(e,t){return e?!t:t}function Sj(e,t,a,n,o,r,s,i){let{affectsX:l,affectsY:c}=t,{isHorizontal:f,isVertical:u}=t,d=f&&u,{xSnapped:p,ySnapped:g}=a,{minWidth:v,maxWidth:b,minHeight:x,maxHeight:y}=n,{x:h,y:w,width:S,height:C,aspectRatio:I}=e,L=Math.floor(f?p-e.pointerX:0),T=Math.floor(u?g-e.pointerY:0),M=S+(l?-L:L),O=C+(c?-T:T),H=-r[0]*S,z=-r[1]*C,N=vx(M,v,b),_=vx(O,x,y);if(s){let q=0,U=0;l&&L<0?q=Ws(h+L+H,s[0][0]):!l&&L>0&&(q=Xs(h+M+H,s[1][0])),c&&T<0?U=Ws(w+T+z,s[0][1]):!c&&T>0&&(U=Xs(w+O+z,s[1][1])),N=Math.max(N,q),_=Math.max(_,U)}if(i){let q=0,U=0;l&&L>0?q=Xs(h+L,i[0][0]):!l&&L<0&&(q=Ws(h+M,i[1][0])),c&&T>0?U=Xs(w+T,i[0][1]):!c&&T<0&&(U=Ws(w+O,i[1][1])),N=Math.max(N,q),_=Math.max(_,U)}if(o){if(f){let q=vx(M/I,x,y)*I;if(N=Math.max(N,q),s){let U=0;!l&&!c||l&&!c&&d?U=Xs(w+z+M/I,s[1][1])*I:U=Ws(w+z+(l?L:-L)/I,s[0][1])*I,N=Math.max(N,U)}if(i){let U=0;!l&&!c||l&&!c&&d?U=Ws(w+M/I,i[1][1])*I:U=Xs(w+(l?L:-L)/I,i[0][1])*I,N=Math.max(N,U)}}if(u){let q=vx(O*I,v,b)/I;if(_=Math.max(_,q),s){let U=0;!l&&!c||c&&!l&&d?U=Xs(h+O*I+H,s[1][0])/I:U=Ws(h+(c?T:-T)*I+H,s[0][0])/I,_=Math.max(_,U)}if(i){let U=0;!l&&!c||c&&!l&&d?U=Ws(h+O*I,i[1][0])/I:U=Xs(h+(c?T:-T)*I,i[0][0])/I,_=Math.max(_,U)}}}T=T+(T<0?_:-_),L=L+(L<0?N:-N),o&&(d?M>O*I?T=(k6(l,c)?-L:L)/I:L=(k6(l,c)?-T:T)*I:f?(T=L/I,c=l):(L=T*I,l=c));let A=l?h+L:h,D=c?w+T:w;return{width:S+(l?-L:L),height:C+(c?-T:T),x:r[0]*L*(l?-1:1)+A,y:r[1]*T*(c?-1:1)+D}}var tD={width:0,height:0,x:0,y:0},Cj={...tD,pointerX:0,pointerY:0,aspectRatio:1};function kj(e,t,a){let n=t.position.x+e.position.x,o=t.position.y+e.position.y,r=e.measured.width??0,s=e.measured.height??0,i=a[0]*r,l=a[1]*s;return[[n-i,o-l],[n+r-i,o+s-l]]}function aD({domNode:e,nodeId:t,getStoreItems:a,onChange:n,onEnd:o}){let r=la(e),s={controlDirection:C6("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function i({controlPosition:c,boundaries:f,keepAspectRatio:u,resizeDirection:d,onResizeStart:p,onResize:g,onResizeEnd:v,shouldResize:b}){let x={...tD},y={...Cj};s={boundaries:f,resizeDirection:d,keepAspectRatio:u,controlDirection:C6(c)};let h,w=null,S=[],C,I,L,T=Yg().on("start",M=>{let{nodeLookup:O,transform:H,snapGrid:z,snapToGrid:N,nodeOrigin:_,paneDomNode:A}=a();if(h=O.get(t),!h)return;w=A?.getBoundingClientRect()??null;let{xSnapped:D,ySnapped:q}=bp(M.sourceEvent,{transform:H,snapGrid:z,snapToGrid:N,containerBounds:w});x={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},y={...x,pointerX:D,pointerY:q,aspectRatio:x.width/x.height},C=void 0,I=kl(h.extent)?h.extent:void 0,h.parentId&&(h.extent==="parent"||h.expandParent)&&(C=O.get(h.parentId)),C&&h.extent==="parent"&&(I=[[0,0],[C.measured.width,C.measured.height]]),S=[],L=void 0;for(let[U,P]of O)if(P.parentId===t&&(S.push({id:U,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){let W=kj(P,h,P.origin??_);L?L=[[Math.min(W[0][0],L[0][0]),Math.min(W[0][1],L[0][1])],[Math.max(W[1][0],L[1][0]),Math.max(W[1][1],L[1][1])]]:L=W}p?.(M,{...x})}).on("drag",M=>{let{transform:O,snapGrid:H,snapToGrid:z,nodeOrigin:N}=a(),_=bp(M.sourceEvent,{transform:O,snapGrid:H,snapToGrid:z,containerBounds:w}),A=[];if(!h)return;let{x:D,y:q,width:U,height:P}=x,W={},te=h.origin??N,{width:de,height:oe,x:se,y:ue}=Sj(y,s.controlDirection,_,s.boundaries,s.keepAspectRatio,te,I,L),ce=de!==U,V=oe!==P,E=se!==D&&ce,ne=ue!==q&&V;if(!E&&!ne&&!ce&&!V)return;let le={prevValues:{...x},startX:y.x,startY:y.y,childNodes:S.map(Y=>({...Y,position:{...Y.position}}))};if((E||ne||te[0]===1||te[1]===1)&&(W.x=E?se:x.x,W.y=ne?ue:x.y,x.x=W.x,x.y=W.y,S.length>0)){let Y=se-D,Le=ue-q;for(let Be of S)Be.position={x:Be.position.x-Y+te[0]*(de-U),y:Be.position.y-Le+te[1]*(oe-P)},A.push(Be)}if((ce||V)&&(W.width=ce&&(!s.resizeDirection||s.resizeDirection==="horizontal")?de:x.width,W.height=V&&(!s.resizeDirection||s.resizeDirection==="vertical")?oe:x.height,x.width=W.width,x.height=W.height),C&&h.expandParent){let Y=te[0]*(W.width??0);W.x&&W.x<Y&&(x.x=Y,y.x=y.x-(W.x-Y));let Le=te[1]*(W.height??0);W.y&&W.y<Le&&(x.y=Le,y.y=y.y-(W.y-Le))}let F=wj({width:x.width,prevWidth:U,height:x.height,prevHeight:P,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),G={...x,direction:F};if(b?.(M,G)===!1){x=le.prevValues,y.x=le.startX,y.y=le.startY,S.forEach((Y,Le)=>{Y.position=le.childNodes[Le].position});return}g?.(M,G),n(W,A)}).on("end",M=>{v?.(M,{...x}),o?.({...x})});r.call(T)}function l(){r.on(".drag",null)}return{update:i,destroy:l}}var mD=j(he(),1),hD=j(cD(),1);var dD=e=>{let t,a=new Set,n=(f,u)=>{let d=typeof f=="function"?f(t):f;if(!Object.is(d,t)){let p=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),a.forEach(g=>g(t,p))}},o=()=>t,l={setState:n,getState:o,getInitialState:()=>c,subscribe:f=>(a.add(f),()=>a.delete(f)),destroy:()=>{(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),a.clear()}},c=t=e(n,o,l);return l},fD=e=>e?dD(e):dD;var{useDebugValue:Uj}=mD.default,{useSyncExternalStoreWithSelector:Vj}=hD.default,Gj=e=>e;function Kw(e,t=Gj,a){let n=Vj(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,a);return Uj(n),n}var pD=(e,t)=>{let a=fD(e),n=(o,r=t)=>Kw(a,o,r);return Object.assign(n,a),n},gD=(e,t)=>e?pD(e,t):pD;function kt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,o]of e)if(!Object.is(o,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let a=Object.keys(e);if(a.length!==Object.keys(t).length)return!1;for(let n of a)if(!Object.prototype.hasOwnProperty.call(t,n)||!Object.is(e[n],t[n]))return!1;return!0}var GD=j(Gr()),zx=(0,Z.createContext)(null),$j=zx.Provider,$D=Pn.error001("react");function $e(e,t){let a=(0,Z.useContext)(zx);if(a===null)throw new Error($D);return Kw(a,e,t)}function vt(){let e=(0,Z.useContext)(zx);if(e===null)throw new Error($D);return(0,Z.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var xD={display:"none"},jj={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},jD="react-flow__node-desc",WD="react-flow__edge-desc",Wj="react-flow__aria-live",Xj=e=>e.ariaLiveMessage,Yj=e=>e.ariaLabelConfig;function Kj({rfId:e}){let t=$e(Xj);return(0,K.jsx)("div",{id:`${Wj}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:jj,children:t})}function Zj({rfId:e,disableKeyboardA11y:t}){let a=$e(Yj);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)("div",{id:`${jD}-${e}`,style:xD,children:t?a["node.a11yDescription.default"]:a["node.a11yDescription.keyboardDisabled"]}),(0,K.jsx)("div",{id:`${WD}-${e}`,style:xD,children:a["edge.a11yDescription.default"]}),!t&&(0,K.jsx)(Kj,{rfId:e})]})}var Bx=(0,Z.forwardRef)(({position:e="top-left",children:t,className:a,style:n,...o},r)=>{let s=`${e}`.split("-");return(0,K.jsx)("div",{className:At(["react-flow__panel",a,...s]),style:n,ref:r,...o,children:t})});Bx.displayName="Panel";var vD="https://reactflow.dev?utm_source=attribution";function Qj({proOptions:e,position:t="bottom-right"}){return(0,Z.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,K.jsx)(Bx,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${vD}`,children:(0,K.jsx)("a",{href:vD,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var Jj=e=>{let t=[],a=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,n]of e.edgeLookup)n.selected&&a.push(n);return{selectedNodes:t,selectedEdges:a}},_x=e=>e.id;function eW(e,t){return kt(e.selectedNodes.map(_x),t.selectedNodes.map(_x))&&kt(e.selectedEdges.map(_x),t.selectedEdges.map(_x))}function tW({onSelectionChange:e}){let t=vt(),{selectedNodes:a,selectedEdges:n}=$e(Jj,eW);return(0,Z.useEffect)(()=>{let o={nodes:a,edges:n};e?.(o),t.getState().onSelectionChangeHandlers.forEach(r=>r(o))},[a,n,e]),null}var aW=e=>!!e.onSelectionChangeHandlers;function nW({onSelectionChange:e}){let t=$e(aW);return e||t?(0,K.jsx)(tW,{onSelectionChange:e}):null}var XD=[0,0],oW={x:0,y:0,zoom:1},rW=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],yD=[...rW,"rfId"],sW=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),bD={translateExtent:Sc,nodeOrigin:XD,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function iW(e){let{setNodes:t,setEdges:a,setMinZoom:n,setMaxZoom:o,setTranslateExtent:r,setNodeExtent:s,reset:i,setDefaultNodesAndEdges:l}=$e(sW,kt),c=vt();(0,Z.useEffect)(()=>(l(e.defaultNodes,e.defaultEdges),()=>{f.current=bD,i()}),[]);let f=(0,Z.useRef)(bD);return(0,Z.useEffect)(()=>{for(let u of yD){let d=e[u],p=f.current[u];d!==p&&(typeof e[u]>"u"||(u==="nodes"?t(d):u==="edges"?a(d):u==="minZoom"?n(d):u==="maxZoom"?o(d):u==="translateExtent"?r(d):u==="nodeExtent"?s(d):u==="ariaLabelConfig"?c.setState({ariaLabelConfig:A6(d)}):u==="fitView"?c.setState({fitViewQueued:d}):u==="fitViewOptions"?c.setState({fitViewOptions:d}):c.setState({[u]:d})))}f.current=e},yD.map(u=>e[u])),null}function wD(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function lW(e){let[t,a]=(0,Z.useState)(e==="system"?null:e);return(0,Z.useEffect)(()=>{if(e!=="system"){a(e);return}let n=wD(),o=()=>a(n?.matches?"dark":"light");return o(),n?.addEventListener("change",o),()=>{n?.removeEventListener("change",o)}},[e]),t!==null?t:wD()?.matches?"dark":"light"}var SD=typeof document<"u"?document:null;function kp(e=null,t={target:SD,actInsideInputWithModifier:!0}){let[a,n]=(0,Z.useState)(!1),o=(0,Z.useRef)(!1),r=(0,Z.useRef)(new Set([])),[s,i]=(0,Z.useMemo)(()=>{if(e!==null){let c=(Array.isArray(e)?e:[e]).filter(u=>typeof u=="string").map(u=>u.replace(/\+/g,`
53
+ ${o}`),a.dispatchEvent(new Event("input",{bubbles:!0})),a.scrollIntoView({block:"center",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),a.focus(),a.setSelectionRange(a.value.length,a.value.length)}function eV({excerpt:e,changesHref:t}){return(0,B.jsxs)("figure",{className:"overflow-hidden rounded-md border border-border","data-check-excerpt":e.path,children:[(0,B.jsxs)("figcaption",{className:"flex flex-wrap items-baseline gap-x-2 border-b border-border bg-muted px-3 py-1.5 text-xs text-muted-foreground",children:[(0,B.jsx)("span",{className:"font-mono text-foreground [overflow-wrap:anywhere]",children:e.path}),!e.cited&&(0,B.jsx)("span",{children:"first changed file"})]}),(0,B.jsx)("ol",{className:"font-mono text-xs leading-relaxed",children:e.lines.map((a,n)=>(0,B.jsxs)("li",{"data-kind":a.kind,className:ee("grid grid-cols-[2.5rem_1rem_minmax(0,1fr)] px-1 py-0.5",a.kind==="addition"?"bg-success-soft":a.kind==="deletion"?"bg-destructive-soft":""),children:[(0,B.jsx)("span",{className:"select-none pr-2 text-right text-muted-foreground tabular-nums",children:a.line??""}),(0,B.jsx)("span",{"aria-hidden":"true",className:"select-none text-muted-foreground",children:a.kind==="addition"?"+":a.kind==="deletion"?"−":" "}),(0,B.jsxs)("code",{className:"whitespace-pre-wrap rounded-none bg-transparent p-0 font-mono text-xs text-foreground [overflow-wrap:anywhere]",children:[(0,B.jsx)("span",{className:"sr-only",children:a.kind==="addition"?"Added: ":a.kind==="deletion"?"Removed: ":""}),a.text]})]},n))}),e.more>0&&(0,B.jsxs)("p",{className:"border-t border-border px-3 py-1.5 text-xs text-muted-foreground",children:[e.more," more changed line",e.more===1?"":"s",t===null?"":(0,B.jsxs)(B.Fragment,{children:[" in ",(0,B.jsx)("a",{href:t,"data-result-goto":"changes",className:"underline underline-offset-4",children:"Changes"})]})]})]})}function tE(e){let t=e?.youCheck??null;return t==null?[]:t.items.length>0?t.items:t.lines.map((a,n)=>({id:`line-${n}`,statement:"",words:a,note:null,excerpts:[],shots:[]}))}var zg=e=>e.statement===""?e.words:e.statement;function tV(e){let t=document.querySelector(`[data-check-item="${CSS.escape(e)}"]`);t!==null&&(t.scrollIntoView({block:"center",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),t.querySelector("[data-looks-right]")?.focus({preventScroll:!0}))}function aV({panel:e,chatHref:t,answers:a,answer:n}){let o=tE(e),r=e.tabs.find(s=>s.key==="changes")?.href??null;return(0,B.jsxs)(ba,{"aria-labelledby":"you-check-title","data-result-you-check":o.length,className:"gap-0 p-0 phone:gap-0 phone:p-0",children:[(0,B.jsx)("h2",{id:"you-check-title",className:"px-5 pb-1 pt-4 text-[15px] font-semibold phone:px-4",children:o.length===1?"You check this one":`You check these ${o.length}`}),(0,B.jsx)("ul",{className:"divide-y divide-border",children:o.map(s=>{let i=a.get(s.id)??null;return(0,B.jsxs)("li",{"data-check-item":s.id,"data-looks-right":i==="right"?"1":void 0,"data-not-right":i==="not-right"?"1":void 0,className:"flex scroll-mt-4 flex-col gap-3 px-5 py-4 phone:px-4",children:[(0,B.jsx)("p",{className:"max-w-[75ch] text-sm font-medium",children:zg(s)}),s.note!==null&&(0,B.jsxs)("p",{className:"max-w-[75ch] text-[13px] text-muted-foreground",children:["The agent says: ",s.note]}),s.excerpts.map(l=>(0,B.jsx)(eV,{excerpt:l,changesHref:r},l.path)),s.shots.length>0&&(0,B.jsx)("ul",{className:"flex flex-wrap gap-2","aria-label":"Screenshots",children:s.shots.map(l=>(0,B.jsx)("li",{children:(0,B.jsx)("a",{href:l.href,className:"block overflow-hidden rounded-md border border-border hover:border-muted-foreground",title:l.caption,children:(0,B.jsx)("img",{src:l.src,alt:l.caption,loading:"lazy",className:"h-24 w-auto max-w-[12rem] object-cover phone:h-20"})})},l.src))}),(0,B.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,B.jsxs)(J,{variant:"outline","aria-pressed":i==="right",className:"min-h-11 aria-pressed:bg-success-soft aria-pressed:text-success phone:flex-1","data-looks-right":!0,onClick:()=>n(s.id,i==="right"?null:"right"),children:[(0,B.jsx)($a,{}),"Looks right"]}),e.canRequest?(0,B.jsx)(J,{variant:"ghost","aria-pressed":i==="not-right",className:"min-h-11 aria-pressed:bg-warning-soft aria-pressed:text-foreground phone:flex-1","data-not-right":!0,onClick:()=>{let l=i==="not-right";n(s.id,l?null:"not-right"),l||JU(zg(s))},children:"Not right"}):(0,B.jsx)(J,{asChild:!0,variant:"ghost",className:"min-h-11 phone:flex-1",children:(0,B.jsx)("a",{href:t,"data-not-right":!0,children:"Not right"})})]})]},s.id)})})]})}function nV({selected:e,csrf:t,acts:a,decision:n,firstUnanswered:o}){let{next:r}=e,[s,i]=(0,Jb.useState)(!1),l=e.complete,c=e.panel?.need??null,f=e.panel?.youCheck??null,u=l===null?c?.accept??(f?.accept==null?null:{...f.accept,note:null}):null,d=[a.primary,a.secondary].filter(C=>C!==null),p=d.includes("accept")?n?.why??null:null,g=d.includes("accept")?l!==null?l.accept?.note??null:u?.note??null:null,v=g!==null||d.includes("accept-anyway"),b=a.line===Pg&&v?null:a.line??p,x=(C,I)=>{let L=I?"attention":"outline",T={"data-act":C,...I?{"data-ink-act":C,"data-primary-action":""}:{}},M="min-h-11 phone:w-full";switch(C){case"retry":return e.failure?.retry==null?null:(0,B.jsx)(Zb,{action:e.failure.retry.action,csrf:t,note:e.failure.retry.note,variant:L==="attention"?"attention":"default"},C);case"accept":{if(n===null)return null;let O=l??u;return O===null?null:(0,B.jsxs)("form",{method:"post",action:O.action,className:ee(g===null?"flex flex-wrap items-center gap-2 phone:w-full":"flex w-full max-w-sm flex-col items-start gap-2 phone:max-w-none"),...g===null?{}:{"data-accept-with-reason":""},children:[(0,B.jsx)("input",{type:"hidden",name:"csrf",value:t}),(0,B.jsx)("input",{type:"hidden",name:"run",value:String(O.run)}),l!==null?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("input",{type:"hidden",name:"receipt",value:l.receipt}),l.accept!=null&&(0,B.jsx)("input",{type:"hidden",name:"accept",value:"1"})]}):u!==null&&(0,B.jsx)("input",{type:"hidden",name:"return",value:u.returnTo}),g!==null&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("label",{htmlFor:"accept-reason",className:"text-[13px] font-medium","data-accept-needs-reason":!0,children:Pg}),(0,B.jsx)(ve,{id:"accept-reason",type:"text",name:"note",maxLength:500,required:!0,placeholder:g,className:"h-11 w-full"})]}),(0,B.jsxs)(J,{type:"submit",variant:L,className:M,...T,"data-accept-result":!0,children:[(0,B.jsx)($a,{className:"phone:hidden"}),n.label]})]},C)}case"accept-anyway":{let O=e.failure?.acceptAnyway??null;return O==null?null:(0,B.jsxs)("form",{method:"post",action:O.action,className:"flex w-full max-w-sm flex-col items-start gap-2 phone:max-w-none","data-accept-with-reason":!0,"data-accept-anyway":!0,children:[(0,B.jsx)("input",{type:"hidden",name:"csrf",value:t}),(0,B.jsx)("input",{type:"hidden",name:"run",value:String(O.run)}),(0,B.jsx)("input",{type:"hidden",name:"return",value:O.returnTo}),(0,B.jsx)("label",{htmlFor:"accept-reason",className:"text-[13px] font-medium","data-accept-needs-reason":!0,children:Pg}),(0,B.jsx)(ve,{id:"accept-reason",type:"text",name:"note",maxLength:500,required:!0,placeholder:"Why is this safe to accept?",className:"h-11 w-full"}),(0,B.jsxs)(J,{type:"submit",variant:"outline",className:M,...T,"data-accept-result":!0,children:[(0,B.jsx)($a,{className:"phone:hidden"}),"Accept anyway"]})]},C)}case"next-check":return o===null?null:(0,B.jsx)(J,{type:"button",variant:L,className:M,...T,onClick:()=>tV(o),children:"Go to your check"},C);case"checks-running":return(0,B.jsx)(J,{type:"button",variant:L,disabled:!0,"aria-disabled":"true",className:M,...T,children:"Checks running"},C);case"run-checks":return e.runChecks===null?null:(0,B.jsxs)("form",{method:"post",action:e.runChecks.action,className:"phone:w-full",children:[(0,B.jsx)("input",{type:"hidden",name:"csrf",value:t}),(0,B.jsx)("input",{type:"hidden",name:"level",value:e.runChecks.level}),(0,B.jsx)("input",{type:"hidden",name:"return",value:e.runChecks.returnTo}),(0,B.jsx)(J,{type:"submit",variant:L,className:M,...T,children:"Run checks"})]},C);case"request-changes":return(0,B.jsx)(J,{asChild:!0,variant:L,className:M,children:(0,B.jsx)("a",{href:"#request-changes",...T,children:"Request changes"})},C);case"rebuild":return c?.rebuild==null?null:(0,B.jsx)(Eg,{action:c.rebuild.action,csrf:t,label:c.label,className:"min-h-11"},C);case"confirm-stopped":return c?.confirm==null?null:(0,B.jsx)(Mg,{form:c.confirm,csrf:t,label:c.label},C);case"revise":case"draft-repair":return r===null?null:(0,B.jsx)(cl,{html:r.control,className:"so-result-next phone:w-full"},C)}};if(d.length===0&&r===null&&e.failure==null)return null;let y=n!==null&&d.includes("accept")?n.effect:null,h=a.primary!==null?a.secondary:null,w=h!==null||b!==null||r!==null||y!==null,S=s?"":"phone:hidden";return(0,B.jsxs)(ba,{"data-result-decision":a.primary??"none","aria-label":"Decision","data-dock":s?"open":"compact",className:ee("gap-2 phone:gap-2",d.length>0&&"phone:sticky phone:bottom-[-20px] phone:z-10 phone:-mx-4 phone:rounded-none phone:border-x-0 phone:px-4 phone:py-3 phone:pb-[max(12px,env(safe-area-inset-bottom))] phone:shadow-[0_-4px_16px_rgb(0_0_0/.08)]"),children:[b!==null&&(0,B.jsxs)("p",{className:ee("flex max-w-[75ch] gap-2 text-[13px]",S),"data-decision-why":!0,...a.line===null?{}:{"data-cant-accept":""},children:[(0,B.jsx)(pn,{className:"mt-0.5 size-3.5 shrink-0 text-warning","aria-hidden":"true"}),b]}),e.failure!=null&&e.failure.retry===null&&(0,B.jsxs)("p",{className:"max-w-[75ch] text-[13px]","data-failure-suggestion":!0,children:[(0,B.jsx)("span",{className:"font-semibold",children:"What to change."})," ",(0,B.jsx)("span",{className:"text-muted-foreground",children:e.failure.suggestion})]}),r!==null&&(0,B.jsxs)("p",{className:ee("max-w-[75ch] text-[13px]",S),"data-next-action":r.kind,children:[(0,B.jsxs)("span",{className:"font-semibold",children:[r.title,"."]})," ",(0,B.jsx)("span",{className:"text-muted-foreground",children:r.detail})]}),d.length>0&&(0,B.jsxs)("div",{className:ee("flex flex-wrap items-center gap-2 phone:flex-nowrap phone:items-stretch",g!==null&&"flex-col items-start gap-3 phone:flex-row phone:items-stretch phone:gap-2",s&&"phone:flex-wrap"),"data-result-acts":!0,children:[(0,B.jsx)("div",{className:"contents phone:flex phone:min-w-0 phone:flex-1 phone:flex-col",children:a.primary!==null?x(a.primary,!0):a.secondary!==null&&x(a.secondary,!1)}),h!==null&&(0,B.jsx)("div",{className:ee("contents phone:order-last phone:basis-full phone:flex-col",s?"phone:flex":"phone:hidden"),children:x(h,!1)}),w&&(0,B.jsxs)(J,{type:"button",variant:"outline",className:"hidden min-h-11 shrink-0 phone:inline-flex","aria-expanded":s,"aria-label":s?"Fewer options":"More options","data-dock-more":!0,onClick:()=>i(C=>!C),children:[s?"Less":"More",(0,B.jsx)(jo,{className:ee("transition-transform motion-reduce:transition-none",s&&"rotate-180")})]})]}),y!==null&&(0,B.jsx)("p",{className:ee("max-w-[75ch] text-[13px] text-muted-foreground",S),"data-decision-effect":!0,children:y})]})}function oV({panel:e,children:t}){return(0,B.jsxs)("div",{id:"result",...e.attributes,className:"flex scroll-mt-4 flex-col gap-4",children:[e.history!==""&&(0,B.jsx)(cl,{html:e.history}),(0,B.jsxs)(ba,{className:"gap-0 overflow-hidden p-0 phone:p-0",children:[(0,B.jsx)("nav",{role:"tablist","aria-label":"Result views",className:"flex gap-1 overflow-x-auto border-b border-border px-3 phone:px-2",children:e.tabs.map(a=>(0,B.jsxs)("a",{role:"tab",href:a.href,"data-result-tab":a.key,"aria-selected":a.active?"true":"false",...a.active?{}:{tabIndex:-1},className:"-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 border-transparent px-3 py-3 text-sm font-semibold text-muted-foreground transition-colors hover:text-foreground aria-selected:border-primary aria-selected:text-foreground phone:min-h-11",children:[a.label,a.count!==""&&(0,B.jsx)("span",{className:"rounded-full bg-muted px-1.5 text-xs font-medium tabular-nums",children:a.count})]},a.key))}),e.views.map(a=>(0,B.jsx)("div",{role:"tabpanel","data-result-view":a.key,hidden:!e.tabs.some(n=>n.key===a.key&&n.active),className:"px-5 py-4 phone:px-4",children:(0,B.jsx)(cl,{html:a.html,className:"so-result-view"})},a.key))]}),t,e.request!==null&&(0,B.jsx)(ba,{id:"request-changes",className:ee("result-request scroll-mt-4 gap-3",e.requestQuiet&&"hidden has-[details[open]]:flex"),children:(0,B.jsx)(cl,{html:e.request,className:"so-result-request"})})]})}function rV({selected:e}){let t=e.panel?.learning??"",a=e.panel,n=a?.status==null?[]:Yb(a.status),o=e.record,r=[{id:"intent",title:"Approved scope",hint:e.intent===null?null:(0,B.jsxs)(B.Fragment,{children:[e.intent.approval,e.intent.approvedAt!=null&&(0,B.jsxs)(B.Fragment,{children:[" · ",(0,B.jsx)("time",{dateTime:e.intent.approvedAt,title:cc(e.intent.approvedAt),children:xn(e.intent.approvedAt)})]})]}),body:e.intent===null?(0,B.jsx)("p",{className:"text-sm text-muted-foreground",children:"No scope was filed for this task, so there is no approved goal or boundary to review."}):(0,B.jsx)(cl,{html:e.intent.html,className:"so-result-intent"})},...e.notes.length===0?[]:[{id:"notes",title:"Notes",hint:null,count:e.notes.length,body:(0,B.jsx)("ul",{className:"flex flex-col gap-2 text-sm",children:e.notes.map((s,i)=>(0,B.jsxs)("li",{children:[(0,B.jsxs)("span",{className:"text-muted-foreground",children:[s.author," · ",tw(s.at)]})," ",s.note]},i))})}],...n.length===0?[]:[{id:"why",title:"Recorded reasons",hint:null,count:n.length,body:(0,B.jsx)("div",{className:"flex flex-col gap-1 text-[13px] text-muted-foreground","data-status-why":!0,children:n.map(s=>(0,B.jsx)("p",{className:"[overflow-wrap:anywhere]",children:s},s))})}],...a===null||a.limits.length===0?[]:[{id:"limits",title:"What was shortened",hint:null,count:a.limits.length,body:(0,B.jsx)("ul",{className:"flex flex-col gap-1 text-[13px] text-muted-foreground",children:a.limits.map(s=>(0,B.jsx)("li",{children:s},s))})}],...a?.reviewHistory==null?[]:[{id:"review-history",title:"Review history",hint:null,body:(0,B.jsx)("p",{className:"text-[13px] text-muted-foreground",children:a.reviewHistory})}],...o===null?[]:[{id:"run-record",title:"Run record",hint:`Build #${o.build}`,body:(0,B.jsxs)("div",{className:"flex flex-col gap-3 text-[13px]",children:[(0,B.jsx)("dl",{className:"grid grid-cols-[6.5rem_minmax(0,1fr)] gap-x-3 gap-y-1.5",children:o.facts.map(s=>(0,B.jsxs)("div",{className:"contents",children:[(0,B.jsx)("dt",{className:"text-muted-foreground",children:s.label}),(0,B.jsx)("dd",{className:"min-w-0 [overflow-wrap:anywhere]",children:s.value})]},s.label))}),(0,B.jsxs)("p",{className:"flex flex-wrap gap-x-4 gap-y-1",children:[e.checks?.logHref!=null&&(0,B.jsx)("a",{href:e.checks.logHref,className:dc,children:"Check output"}),(0,B.jsx)("a",{href:o.href,className:dc,children:"Full run record"})]})]})}]];return(0,B.jsxs)(ba,{"aria-label":"Result record",className:"gap-0 divide-y divide-border overflow-hidden p-0 phone:p-0",children:[t!==""&&(0,B.jsx)("div",{"data-cockpit-section":"learning",children:(0,B.jsx)(cl,{html:t,className:"so-result-learning"})}),r.map(s=>(0,B.jsxs)("details",{id:s.id,className:"group scroll-mt-4","data-cockpit-section":s.id,children:[(0,B.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-5 py-3.5 hover:bg-accent/50 phone:min-h-12 phone:px-4 [&::-webkit-details-marker]:hidden",children:[(0,B.jsx)(ra,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-90","aria-hidden":"true"}),(0,B.jsx)("h2",{className:"text-[15px] font-semibold",children:s.title}),s.count!==void 0&&(0,B.jsx)(ya,{children:s.count}),s.hint!=null&&(0,B.jsx)("span",{className:"min-w-0 truncate text-[13px] text-muted-foreground",children:s.hint})]}),(0,B.jsx)("div",{className:"px-5 pb-5 pt-1 phone:px-4",children:s.body})]},s.id))]})}var dc="font-medium text-foreground/80 underline decoration-border underline-offset-4 hover:decoration-muted-foreground phone:inline-flex phone:min-h-11 phone:items-center";function sV(e){let t=document.getElementById("run-record");t instanceof HTMLDetailsElement&&(e.preventDefault(),t.open=!0,t.scrollIntoView({block:"start",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),history.replaceState(history.state,"","#run-record"))}function iV({selected:e,csrf:t}){let[a,n]=(0,Jb.useState)(new Map),o=(p,g)=>n(v=>{let b=new Map(v);return g===null?b.delete(p):b.set(p,g),b}),r=tE(e.panel),s=r.filter(p=>!a.has(p.id)),i=r.filter(p=>a.get(p.id)==="not-right"),l={unanswered:s.map(zg),notRight:i.map(zg)},c=e.decision===null?null:{...e.decision,...JM(e.decision.base??e.decision,l)},f=e.actFacts===void 0?e.acts:QM({...e.actFacts,...e.actFacts.accept===null?{}:{accept:{ready:c?.ready??!1}},unanswered:s.length,notRight:i.length}),u=e.panel?.youCheck!=null?(0,B.jsx)(aV,{panel:e.panel,chatHref:e.chatHref,answers:a,answer:o}):null,d=(0,B.jsx)(nV,{selected:e,csrf:t,acts:f,decision:c,firstUnanswered:s[0]?.id??null});return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(QU,{selected:e,acts:f,answers:a}),e.panel!==null?(0,B.jsx)(oV,{panel:e.panel,children:(0,B.jsxs)("div",{className:"flex flex-col gap-4",children:[u,d]})}):(0,B.jsxs)("div",{className:"flex flex-col gap-4",children:[u,d]}),e.contest!==""&&(0,B.jsx)(cl,{html:e.contest}),(0,B.jsx)(rV,{selected:e})]})}function aE({view:e,csrf:t}){let a=e.selected;return(0,B.jsxs)("div",{className:"mx-auto flex w-full max-w-4xl flex-col gap-4",children:[(0,B.jsxs)("header",{className:"flex flex-col gap-3 pb-1",children:[(0,B.jsxs)("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-3",children:[(0,B.jsxs)("div",{className:"min-w-0 flex-1 basis-72",children:[(0,B.jsx)("h1",{className:"text-[26px] font-semibold leading-tight tracking-tight phone:text-[22px]",children:a?.title??"Results"}),a!==null&&(0,B.jsxs)("p",{className:"mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[13px] text-muted-foreground phone:gap-y-0","data-result-meta":!0,children:[a.project!==null&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("span",{className:"font-medium text-foreground/80",children:a.project}),(0,B.jsx)("span",{"aria-hidden":"true",children:"·"})]}),a.record!==null&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("a",{href:"#run-record",onClick:sV,className:dc,children:["Build #",a.record.build]}),(0,B.jsx)("span",{"aria-hidden":"true",children:"·"})]}),(0,B.jsx)("a",{href:a.taskHref,className:dc,children:"Open task"}),(0,B.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,B.jsx)("a",{href:a.chatHref,className:dc,children:"Discuss"})]})]}),a!==null&&(0,B.jsx)(KU,{view:e})]}),e.missing!==null&&(0,B.jsxs)("p",{role:"status",className:"rounded-md bg-muted px-3 py-2 text-[13px] text-foreground",children:[e.missing,a!==null?" Showing the newest result instead.":""]}),e.beyond&&(0,B.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"This result is older than the list in Results."})]}),a===null?e.results.length===0?(0,B.jsxs)(ba,{className:"items-start py-10",children:[(0,B.jsx)("p",{className:"text-base text-muted-foreground",children:"Nothing to review yet."}),(0,B.jsx)(J,{asChild:!0,variant:"outline",children:(0,B.jsx)("a",{href:"/work",children:"Open tasks"})})]}):(0,B.jsx)(ba,{"aria-label":"Results",className:"gap-0 overflow-hidden p-0 phone:p-0",children:(0,B.jsx)("ul",{className:"divide-y divide-border",children:e.results.map(n=>(0,B.jsxs)("li",{className:"flex items-start gap-3 px-5 py-3 phone:px-4",children:[(0,B.jsx)("span",{"aria-hidden":"true",className:ee("mt-2 size-2 shrink-0 rounded-full",n.status===null?"bg-muted-foreground":ew[Og(n.status.tone)])}),(0,B.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,B.jsx)("a",{href:n.href,className:ee("block truncate hover:underline hover:underline-offset-4",n.needsYou?"font-semibold":"font-medium"),children:n.title}),(0,B.jsx)("p",{className:"truncate text-[13px] text-muted-foreground",children:[n.status?.label,...n.notes,tw(n.at)].filter(Boolean).join(" · ")})]})]},n.href))})}):(0,B.jsx)(iV,{selected:a,csrf:t},`${a.taskId}:${a.build??""}`)]})}var Oa=j(he(),1);var lV="#171717",aw="#ffffff",uV="#efefef",Bg="#161616",nw="#0a0a0a",Gie=[[null,"Ink",lV],[null,"Violet","#6e56cf"],[null,"Chart magenta","#c0267e"],[2025,"Mocha Mousse","#a47864"],[2024,"Peach Fuzz","#ffbe98"],[2023,"Viva Magenta","#bb2649"],[2022,"Very Peri","#6667ab"],[2021,"Illuminating","#f5df4d"],[2020,"Classic Blue","#0f4c81"],[2019,"Living Coral","#ff6f61"],[2018,"Ultra Violet","#5f4b8b"],[2017,"Greenery","#88b04b"],[2016,"Rose Quartz","#f7caca"],[2016,"Serenity","#93a9d1"],[2015,"Marsala","#964f4c"],[2014,"Radiant Orchid","#ad5e99"],[2013,"Emerald","#009473"],[2012,"Tangerine Tango","#dd4124"],[2011,"Honeysuckle","#d94f70"],[2010,"Turquoise","#45b5aa"],[2009,"Mimosa","#f0c05a"],[2008,"Blue Iris","#5a5b9f"],[2007,"Chili Pepper","#9b1b30"],[2005,"Blue Turquoise","#53b0ae"],[2004,"Tigerlily","#e2583e"],[2003,"Aqua Sky","#7bc4c4"],[2002,"True Red","#bf1932"],[2001,"Fuchsia Rose","#c74375"],[2e3,"Cerulean","#9bb7d4"]].map(([e,t,a])=>({id:t.toLowerCase().replace(/[^a-z0-9]+/g,"-"),name:t,year:e,hex:a})),Hg=e=>[1,3,5].map(t=>parseInt(e.slice(t,t+2),16)/255),ow=e=>`#${e.map(t=>Math.round(Math.min(1,Math.max(0,t))*255).toString(16).padStart(2,"0")).join("")}`,rE=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,cV=e=>e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055;function Zf(e){let[t,a,n]=Hg(e).map(rE),o=Math.cbrt(.4122214708*t+.5363325363*a+.0514459929*n),r=Math.cbrt(.2119034982*t+.6806995451*a+.1073969566*n),s=Math.cbrt(.0883024619*t+.2817188376*a+.6299787005*n),i=.2104542553*o+.793617785*r-.0040720468*s,l=1.9779984951*o-2.428592205*r+.4505937099*s,c=.0259040371*o+.7827717662*r-.808675766*s;return[i,Math.hypot(l,c),(Math.atan2(c,l)*180/Math.PI+360)%360]}function nE(e,t,a){let n=t*Math.cos(a*Math.PI/180),o=t*Math.sin(a*Math.PI/180),r=(e+.3963377774*n+.2158037573*o)**3,s=(e-.1055613458*n-.0638541728*o)**3,i=(e-.0894841775*n-1.291485548*o)**3,l=[4.0767416621*r-3.3077115913*s+.2309699292*i,-1.2684380046*r+2.6097574011*s-.3413193965*i,-.0041960863*r-.7034186147*s+1.707614701*i];return l.every(c=>c>=-1e-4&&c<=1.0001)?l.map(cV):null}function Fg(e,t,a){for(let n=t;n>=0;n-=.002){let o=nE(e,n,a);if(o!==null)return ow(o)}return ow(nE(e,0,a)??[e,e,e])}var oE=e=>{let[t,a,n]=Hg(e).map(rE);return .2126*t+.7152*a+.0722*n};function fc(e,t){let[a,n]=[oE(e),oE(t)].sort((o,r)=>r-o);return(a+.05)/(n+.05)}var pc=(e,t,a)=>{let[n,o]=[Hg(e),Hg(t)];return ow(n.map((r,s)=>r*a+o[s]*(1-a)))};function sE(e){let t=e.trim().replace(/^#/,"").toLowerCase();return/^[0-9a-f]{6}$/.test(t)?`#${t}`:/^[0-9a-f]{3}$/.test(t)?`#${[...t].map(a=>a+a).join("")}`:null}function rw(e){let[t,a,n]=Zf(e),o=e,r=f=>fc(f,pc(f,aw,.12))>=4.5&&fc(f,uV)>=3;for(let f=t;!r(o)&&f>.02;f-=.005)o=Fg(f,a,n);let s=e,i=f=>fc(f,Bg)>=6&&fc(f,pc(f,Bg,.13))>=4.5;for(let f=t;!i(s)&&f<.99;f+=.005)s=Fg(f,a,n);let[l]=Zf(o),[c]=Zf(s);return{light:{signal:o,hover:Fg(Math.max(.02,l-.06),a,n),on:fc(o,"#ffffff")>=4.5?"#ffffff":nw,soft:pc(o,aw,.12),selection:pc(o,aw,.24)},dark:{signal:s,hover:Fg(Math.min(.99,c+.06),a,n),on:fc(s,nw)>=4.5?nw:"#ffffff",soft:pc(s,Bg,.13),selection:pc(s,Bg,.32)}}}var dV=[["#c4320a","red","failures","a failed one"],["#ab6400","amber","warnings","a warning"],["#218358","green","passed checks","a passed one"],["#0d74ce","blue","running work","a running one"]];function iE(e){let[,t,a]=Zf(rw(e).light.signal);if(t<.04)return"Close to grey, so what needs you won't stand out.";let n=dV.find(([o])=>{let r=Math.abs(Zf(o)[2]-a);return Math.min(r,360-r)<25});return n===void 0?null:`Close to the ${n[1]} used for ${n[2]}, so a task waiting on you can look like ${n[3]}.`}function lE(e){let t=["17:00","18:00","19:00","20:00","21:00","22:00"],a=e===null||t.includes(e)?t:[...t,e].sort();return[["off","Off"],...a.map(n=>[n,`At ${n}`])]}var uE={betterstack:{title:"Better Stack",source:"Simple Icons",path:"M1.5,10.828l-.716,6.212c-.074,.638 .17,1.271 .651,1.696l1.775,1.565c.608,.536 1.551,.014 1.421-.786l-1.423-8.726c-.161-.988-1.593-.954-1.707,.04zM13.078,18.982l-4.232-12.194c-.47-1.354-2.441-1.296-2.826,.084l-1.288,4.607c-.146,.523-.202,.826 0,1.33h.489l1.777,5.679c.275,.685 .844,1.217 1.554,1.454l2.65,.883c1.162,.387 2.271-.703 1.875-1.843zM23.025,18.016l-7.478-14.022c-.652-1.223-2.412-1.191-3.02,.055l-1.839,3.701c-.222,.456-.119,.618 .066,.883c.148,.212 .492,.229 .632,.011c.138-.214 .457-.194 .567,.035l4.808,10c.362,.814 1.121,1.382 2.004,1.499l2.544,.325c1.369,.18 2.367-1.267 1.716-2.487z"},canva:{title:"Canva",source:"svgl",path:"M12,22c5.523,0 10-4.477 10-10c0-5.523-4.477-10-10-10c-5.523,0-10,4.477-10,10c0,5.523 4.477,10 10,10zM16.551,14.378c0,1.011-1.809,4.124-4.939,4.124c-2.948,0-4.859-2.211-4.859-5.557c0-4.323 2.995-7.447 6.365-7.447c2.039,0 3.255,1.026 3.255,2.423c0,1.44-1.041,2.46-1.929,2.46c-.221,0-.332-.108-.332-.287c0-.399 .643-.998 .643-2.129c0-.953-.582-1.552-1.535-1.552c-2.039,0-4.361,2.409-4.361,6.576c0,2.46 1.221,4.24 3.194,4.24c1.706,0 3.18-1.225 4.033-2.955c.076-.152 .148-.222 .231-.222c.119,0 .234,.103 .234,.326z"},chrome:{title:"Google Chrome",source:"Simple Icons",path:"M12,2c-3.158,0-5.974,1.464-7.807,3.751l3.294,5.707c.274-2.284 2.212-4.003 4.513-4.003h8.909c-1.709-3.348-5.15-5.455-8.909-5.454zM3.609,6.558c-1.053,1.619-1.612,3.51-1.609,5.442c0,5.01 3.683,9.159 8.491,9.887l3.294-5.706c-2.115,.904-4.572,.085-5.721-1.908zM14.728,8.363c1.842,1.378 2.361,3.917 1.208,5.908l.002,.001h-.002l-4.453,7.714c.172,.008 .344,.013 .518,.013c5.523,0 10-4.477 10-10c0-1.283-.242-2.509-.682-3.637zM12,15.637c-2.008,0-3.637-1.628-3.637-3.637c0-2.008 1.628-3.637 3.637-3.637c2.008,0 3.637,1.628 3.637,3.637c0,2.008-1.628,3.637-3.637,3.637z"},claude:{title:"Claude",source:"Simple Icons",path:"M5.926,15.298l3.933-2.207l.066-.192l-.066-.106h-.192l-.658-.041l-2.247-.061l-1.949-.081l-1.888-.101l-.476-.101l-.445-.587l.046-.294l.4-.268l.572,.051l1.265,.086l1.898,.132l1.377,.081l2.04,.213h.324l.046-.132l-.111-.081l-.086-.081l-1.964-1.331l-2.126-1.407l-1.113-.81l-.602-.41l-.304-.385l-.132-.84l.547-.602l.734,.051l.187,.051l.744,.572l1.589,1.23l2.075,1.529l.304,.253l.121-.086l.015-.061l-.137-.228l-1.129-2.04l-1.205-2.075l-.536-.86l-.142-.516c-.051-.213-.086-.39-.086-.607l.623-.845l.344-.111l.83,.111l.349,.304l.516,1.179l.835,1.858l1.296,2.526l.38,.749l.202,.693l.076,.213h.132v-.121l.106-1.422l.197-1.746l.192-2.247l.066-.633l.314-.759l.623-.41l.486,.233l.4,.572l-.056,.37l-.238,1.544l-.466,2.419l-.304,1.62h.177l.202-.202l.82-1.088l1.377-1.721l.607-.683l.709-.754l.456-.359h.86l.633,.941l-.283,.972l-.886,1.124l-.734,.952l-1.053,1.417l-.658,1.134l.061,.091l.157-.015l2.379-.506l1.286-.233l1.534-.263l.693,.324l.076,.329l-.273,.673l-1.64,.405l-1.923,.385l-2.865,.678l-.035,.025l.041,.051l1.291,.121l.552,.03h1.351l2.516,.187l.658,.435l.395,.532l-.066,.405l-1.012,.516l-1.367-.324l-3.189-.759l-1.093-.273h-.152v.091l.911,.891l1.67,1.508l2.09,1.944l.106,.481l-.268,.38l-.283-.041l-1.837-1.382l-.709-.623l-1.604-1.351h-.106v.142l.369,.542l1.954,2.936l.101,.901l-.142,.294l-.506,.177l-.557-.101l-1.144-1.604l-1.179-1.807l-.952-1.62l-.116,.066l-.562,6.048l-.263,.309l-.607,.233l-.506-.385l-.268-.623l.268-1.23l.324-1.604l.263-1.275l.238-1.584l.142-.526l-.01-.035l-.116,.015l-1.194,1.64l-1.817,2.455l-1.437,1.539l-.344,.137l-.597-.309l.056-.552l.334-.491l1.989-2.531l1.2-1.569l.774-.906l-.005-.132h-.046l-5.284,3.432l-.941,.121l-.405-.38l.051-.622l.192-.202l1.589-1.093z"},cloudflare:{title:"Cloudflare",source:"Simple Icons",path:"M16.509,16.845c.148-.507 .091-.971-.155-1.315c-.225-.316-.604-.499-1.061-.52l-8.659-.112c-.054,.001-.104-.026-.133-.071c-.028-.042-.035-.099-.021-.155c.028-.084 .112-.148 .204-.156l8.736-.112c1.035-.049 2.16-.887 2.554-1.914l.499-1.301c.022-.056 .029-.113 .015-.168c-.562-2.546-2.835-4.445-5.55-4.445c-2.504,0-4.628,1.618-5.388,3.861c-.493-.366-1.119-.562-1.794-.499c-1.203,.119-2.166,1.083-2.286,2.286c-.028,.31-.007,.613 .064,.894c-1.963,.056-3.531,1.66-3.531,3.637c0,.175 .014,.352 .035,.527c.014,.083 .084,.148 .169,.148h15.981c.091,0 .176-.064 .203-.155l.12-.427zM19.266,11.281c-.077,0-.161,0-.238,.011c-.057,0-.105,.042-.127,.098l-.338,1.174c-.147,.507-.092,.971 .154,1.316c.226,.316 .606,.498 1.063,.52l1.844,.113c.056,0 .106,.026 .133,.07c.028,.043 .035,.107 .021,.156c-.028,.084-.113,.149-.204,.155l-1.921,.112c-1.041,.049-2.158,.887-2.553,1.914l-.141,.359c-.028,.071 .022,.142 .099,.142h6.598c.077,0 .147-.049 .169-.126c.112-.408 .176-.837 .176-1.28c0-2.602-2.125-4.727-4.734-4.727"},confluence:{title:"Confluence",source:"Simple Icons",path:"M2.611,17.278c-.209,.322-.447,.738-.644,1.05c-.18,.302-.084,.692 .215,.877l4.188,2.576c.147,.091 .324,.119 .492,.077c.168-.041 .312-.148 .4-.297c.168-.28 .383-.644 .618-1.03c1.659-2.739 3.328-2.407 6.334-.967l4.182,1.972c.157,.075 .338,.083 .502,.022c.163-.061 .295-.185 .365-.345l1.994-4.51c.14-.322-.003-.697-.322-.844c-1.399-.658-2.795-1.321-4.188-1.992c-5.666-2.739-10.464-2.558-14.137,3.408zM21.39,6.722c.21-.342 .448-.738 .645-1.054c.176-.301 .08-.688-.216-.872l-4.188-2.577c-.147-.091-.324-.119-.492-.077c-.168,.041-.312,.148-.4,.297c-.164,.283-.38,.644-.619,1.033c-1.659,2.738-3.328,2.404-6.334,.967l-4.166-1.975c-.157-.075-.338-.083-.501-.022c-.163,.061-.295,.185-.365,.344l-1.994,4.51c-.14,.322 .003,.697 .322,.844c.877,.413 2.619,1.238 4.188,1.992c5.65,2.738 10.454,2.555 14.12-3.408z"},discord:{title:"Discord",source:"Simple Icons",path:"M19.939,4.717c-1.485-.682-3.053-1.168-4.663-1.446c-.03-.006-.06,.009-.075,.035c-.201,.358-.424,.825-.581,1.193c-1.761-.264-3.513-.264-5.237,0c-.156-.375-.387-.834-.59-1.193c-.015-.026-.045-.04-.075-.035c-1.61,.278-3.178,.764-4.663,1.446c-.013,.005-.023,.015-.031,.026c-2.97,4.437-3.783,8.765-3.384,13.039c.002,.021 .013,.04 .03,.054c1.959,1.439 3.857,2.313 5.72,2.892c.03,.009 .062-.002 .08-.026c.441-.602 .833-1.236 1.17-1.903c.009-.018 .01-.04 .003-.059c-.008-.019-.023-.034-.042-.042c-.623-.236-1.216-.524-1.787-.852c-.021-.012-.035-.035-.036-.059c-.001-.024 .009-.048 .029-.063c.12-.09 .24-.184 .355-.278c.021-.017 .049-.021 .074-.01c3.749,1.712 7.808,1.712 11.513,0c.025-.012 .054-.008 .075,.009c.115,.095 .235,.189 .356,.279c.02,.015 .031,.038 .029,.063c-.001,.024-.015,.047-.036,.059c-.571,.333-1.169,.618-1.788,.851c-.019,.007-.035,.023-.042,.042c-.007,.019-.006,.041 .003,.06c.344,.666 .737,1.301 1.169,1.903c.018,.025 .051,.036 .08,.027c1.872-.579 3.77-1.453 5.729-2.892c.017-.012 .028-.032 .03-.053c.478-4.941-.8-9.234-3.387-13.039c-.006-.012-.017-.022-.03-.027zM8.201,15.18c-1.129,0-2.059-1.036-2.059-2.309c0-1.273 .912-2.309 2.059-2.309c1.156,0 2.077,1.045 2.059,2.309c0,1.273-.912,2.309-2.059,2.309zM15.813,15.18c-1.129,0-2.059-1.036-2.059-2.309c0-1.273 .912-2.309 2.059-2.309c1.156,0 2.077,1.045 2.059,2.309c0,1.273-.903,2.309-2.059,2.309z"},figma:{title:"Figma",source:"Simple Icons",path:"M15.85,8.983h-4.585v-8.976h4.585c2.475,0 4.488,2.013 4.488,4.488c0,2.475-2.013,4.489-4.488,4.489zM12.735,7.512h3.115c1.664,0 3.017-1.354 3.017-3.017c0-1.663-1.354-3.017-3.017-3.017h-3.115zM12.735,8.983h-4.584c-2.475,0-4.488-2.013-4.488-4.488c0-2.475 2.013-4.489 4.488-4.489h4.585v8.976zM8.151,1.477c-1.664,0-3.017,1.354-3.017,3.017c0,1.663 1.353,3.018 3.017,3.018h3.115v-6.036zM12.735,16.488h-4.584c-2.475,0-4.488-2.013-4.488-4.488c0-2.475 2.013-4.488 4.488-4.488h4.585v8.975zM8.151,8.983c-1.664,0-3.017,1.354-3.017,3.017c0,1.663 1.354,3.017 3.017,3.017h3.115v-6.035zM8.175,23.993c-2.488,0-4.513-2.013-4.513-4.488c0-2.475 2.013-4.488 4.488-4.488h4.585v4.439c0,2.502-2.046,4.537-4.56,4.537zM8.151,16.488c-1.666,.002-3.015,1.352-3.017,3.017c0,1.664 1.364,3.017 3.042,3.017c1.704,0 3.091-1.375 3.091-3.066v-2.968zM15.85,16.488h-.098c-2.475,0-4.488-2.013-4.488-4.488c0-2.475 2.013-4.488 4.488-4.488h.098c2.475,0 4.488,2.013 4.488,4.488c0,2.475-2.013,4.488-4.488,4.488zM15.753,8.983c-1.664,0-3.017,1.354-3.017,3.017c0,1.663 1.354,3.017 3.017,3.017h.098c1.664,0 3.017-1.354 3.017-3.017c0-1.663-1.354-3.017-3.017-3.017z"},github:{title:"GitHub",source:"Simple Icons",path:"M12,2.125c-5.595,0-10.126,4.534-10.126,10.126c0,4.475 2.901,8.27 6.924,9.607c.506,.095 .692-.218 .692-.487c0-.24-.008-.878-.013-1.721c-2.817,.611-3.411-1.359-3.411-1.359c-.461-1.169-1.127-1.481-1.127-1.481c-.917-.628 .071-.615 .071-.615c1.017,.071 1.551,1.043 1.551,1.043c.903,1.548 2.37,1.101 2.949,.842c.091-.655 .352-1.101 .641-1.354c-2.249-.253-4.612-1.124-4.612-5.004c0-1.105 .392-2.008 1.042-2.717c-.114-.256-.456-1.285 .089-2.68c0,0 .848-.272 2.785,1.038c.81-.225 1.671-.337 2.532-.342c.861,.005 1.721,.116 2.532,.342c1.924-1.31 2.772-1.038 2.772-1.038c.544,1.395 .203,2.424 .101,2.68c.646,.709 1.038,1.612 1.038,2.717c0,3.89-2.367,4.747-4.62,4.996c.354,.304 .684,.925 .684,1.873c0,1.355-.013,2.444-.013,2.773c0,.266 .177,.582 .696,.481c4.051-1.328 6.95-5.126 6.95-9.594c0-5.592-4.534-10.126-10.126-10.126"},gmail:{title:"Gmail",source:"Simple Icons",path:"M23.545,5.705v13.382c0,.87-.704,1.574-1.574,1.574h-3.674v-8.921l-6.297,4.724l-6.297-4.724v8.922h-3.674c-.418,0-.818-.166-1.113-.461c-.295-.295-.461-.696-.461-1.114v-13.382c0-1.946 2.221-3.058 3.778-1.89l1.47,1.104l6.297,4.722l6.297-4.724l1.47-1.102c1.556-1.167 3.778-.057 3.778,1.89z"},intercom:{title:"Intercom",source:"Simple Icons",path:"M19.5,2h-15c-1.381,0-2.5,1.119-2.5,2.5v15c0,1.382 1.119,2.5 2.5,2.5h15c1.382,0 2.5-1.118 2.5-2.5v-15c0-1.381-1.118-2.5-2.5-2.5zM14.666,5.666c0-.367 .3-.667 .668-.667c.367,0 .667,.3 .667,.667v8.907c0,.368-.3,.668-.667,.668c-.369,0-.668-.299-.668-.667zM11.333,5.328c0-.367 .298-.666 .667-.666c.369,0 .667,.299 .667,.666v9.668c0,.367-.297,.667-.667,.667c-.369,0-.667-.3-.667-.667zM8,5.666c0-.367 .299-.667 .666-.667c.369,0 .668,.3 .668,.667v8.907c0,.368-.3,.668-.668,.668c-.367,0-.666-.299-.666-.667zM4.666,7c0-.368 .3-.667 .668-.667c.367,0 .666,.298 .666,.667v5.996c0,.368-.299,.667-.666,.667c-.369,0-.668-.3-.668-.667zM19.1,17.168c-.102,.088-2.572,2.161-7.1,2.161c-4.527,0-6.997-2.072-7.101-2.161c-.279-.24-.312-.66-.072-.94c.238-.278 .658-.312 .938-.075c.039,.034 2.244,1.843 6.234,1.843c4.04,0 6.213-1.822 6.233-1.839c.278-.241 .699-.208 .94,.072c.241,.28 .208,.7-.072,.94zM19.334,12.996c0,.368-.3,.667-.667,.667c-.367,0-.667-.3-.667-.667v-5.996c0-.368 .301-.667 .668-.667c.368,0 .668,.298 .668,.667z"},jira:{title:"Jira",source:"Simple Icons",path:"M11.643,11.594h-9.642c.001,1.155 .461,2.262 1.279,3.077c.818,.815 1.927,1.272 3.081,1.269h1.775v1.714c0,2.399 1.945,4.345 4.344,4.346v-9.568c0-.463-.375-.837-.837-.837zM16.412,6.798h-9.632c0,2.4 1.946,4.345 4.346,4.345h1.774v1.715c.002,2.399 1.947,4.344 4.346,4.345v-9.571c0-.461-.373-.834-.834-.834zM21.177,2h-9.632c0,2.4 1.946,4.346 4.346,4.346h1.774v1.714c.002,2.394 1.94,4.336 4.334,4.343v-9.565c.002-.457-.365-.831-.822-.837z"},linear:{title:"Linear",source:"Simple Icons",path:"M4.405,5.483c1.899-2.213 4.67-3.486 7.587-3.483c5.528,0 10.008,4.48 10.008,10.008c0,3.033-1.35,5.753-3.483,7.588l-14.111-14.112zM3.514,6.688l13.797,13.797c-.437,.275-.896,.517-1.375,.722l-13.143-13.142c.206-.479 .448-.938 .722-1.375zM2.268,9.636l12.096,12.096c-.592,.143-1.202,.235-1.829,.268l-10.535-10.535c.033-.617 .123-1.229 .268-1.829zM2.127,13.688l8.186,8.187c-4.189-.716-7.471-3.997-8.187-8.187z"},notion:{title:"Notion",source:"Simple Icons",path:"M5.584,5.37c.635,.516 .873,.476 2.066,.397l11.244-.675c.238,0 .04-.238-.039-.277l-1.868-1.35c-.357-.277-.835-.596-1.748-.516l-10.887,.795c-.396,.039-.476,.238-.318,.397zM6.258,7.991v11.83c0,.636 .317,.874 1.033,.834l12.357-.715c.716-.039 .796-.476 .796-.993v-11.751c0-.516-.198-.794-.636-.755l-12.913,.755c-.476,.04-.636,.278-.636,.794zM18.457,8.624c.079,.357 0,.715-.357,.756l-.596,.119v8.733c-.517,.278-.994,.437-1.391,.437c-.636,0-.796-.199-1.272-.794l-3.894-6.114v5.915l1.232,.279c0,0 0,.715-.994,.715l-2.741,.158c-.079-.158 0-.556 .278-.635l.715-.198v-7.822l-.991-.08c-.08-.357 .119-.873 .675-.913l2.941-.198l4.053,6.193v-5.479l-1.034-.118c-.079-.437 .238-.755 .636-.794zM3.437,2.67l11.325-.834c1.39-.119 1.748-.04 2.622,.596l3.615,2.541c.596,.436 .795,.556 .795,1.032v13.935c0,.873-.317,1.39-1.429,1.469l-13.152,.795c-.834,.04-1.232-.079-1.669-.636l-2.662-3.454c-.476-.636-.675-1.111-.675-1.668v-12.387c0-.714 .318-1.31 1.231-1.389z"},openai:{title:"OpenAI",source:"svgl",evenodd:!0,path:"M9.367,2.175c1.818-.487 3.67,.075 4.913,1.315c1.697-.453 3.582-.014 4.912,1.317c1.331,1.331 1.77,3.216 1.317,4.913v0c1.241,1.243 1.803,3.095 1.316,4.913c-.487,1.818-1.9,3.141-3.596,3.597c-.456,1.696-1.779,3.109-3.597,3.596c-1.818,.487-3.67-.075-4.913-1.315c-1.697,.453-3.582,.014-4.913-1.317c-1.331-1.331-1.77-3.216-1.317-4.913c-1.24-1.243-1.803-3.095-1.315-4.913c.487-1.818 1.9-3.141 3.596-3.597c.456-1.696 1.779-3.109 3.597-3.596zM15.436,17.077c0,.206-.11,.397-.288,.5l-4.236,2.445c.937,.723 2.189,1.017 3.421,.687c1.737-.466 2.89-2.025 2.914-3.739v-4.36c0-.132-.071-.255-.185-.32l-1.626-.939zM9.321,17.515c-.178,.103-.398,.103-.577,0l-4.235-2.445c-.158,1.174 .214,2.405 1.116,3.307h0c1.272,1.272 3.199,1.49 4.695,.654l3.776-2.18c.114-.066 .185-.189 .185-.321v-1.877zM15.152,7.76c-.114-.066-.256-.065-.37,0l-1.626,.939l4.959,2.863c.179,.103 .289,.294 .289,.5v4.891c1.095-.45 1.975-1.388 2.305-2.62c.465-1.737-.309-3.515-1.781-4.393zM5.596,7.047c-1.095,.45-1.975,1.388-2.306,2.62c-.465,1.737 .309,3.515 1.781,4.393l3.776,2.18c.114,.066 .256,.065 .37,0l1.626-.939l-4.959-2.863c-.179-.103-.288-.294-.288-.5zM9.72,10.684v2.633l2.28,1.316l2.28-1.316v-2.633l-2.28-1.317zM13.088,3.978c-.937-.723-2.189-1.017-3.421-.687c-1.737,.466-2.89,2.025-2.914,3.739v4.36c0,.132 .071,.255 .185,.32l1.626,.939v-5.726c0-.206 .11-.397 .289-.5zM18.376,5.625c-1.272-1.272-3.199-1.49-4.695-.654l-3.776,2.18c-.114,.066-.185,.189-.185,.321v1.877l4.959-2.863c.178-.103 .398-.103 .577,0l4.235,2.445c.158-1.174-.214-2.405-1.116-3.306z"},paypal:{title:"PayPal",source:"Simple Icons",path:"M15.265,5.352h-6.031l-2.077,13.208h-4.366l2.752-17.418h7.234c3.397,0 5.768,2.076 5.857,4.988c-.586-.432-1.905-.778-3.368-.778M21.21,10.37c0,3.085-2.723,6.201-6.296,6.201h-2.256l-1.024,6.287h-4.393l1.669-10.44h3.25c3.807,0 6.647-3.288 6.472-6.288c1.589,.815 2.585,2.454 2.577,4.24M9.877,6.16h5.798c.821,0 1.757,.201 2.138,.49c-.176,2.48-2.402,4.961-5.828,4.961h-2.958z"},playwright:{title:"Playwright",source:"svgl",path:"M8.063,13.122c-.862,.245-1.428,.674-1.801,1.103c.357-.312 .835-.599 1.48-.782c.66-.187 1.223-.186 1.688-.096v-.364c-.397-.036-.852-.007-1.367,.139zM6.223,10.065l-3.203,.844c0,0 .058,.082 .166,.192l2.716-.716c0,0-.038,.496-.373,.94c.632-.478 .693-1.26 .693-1.26zM8.904,17.593c-4.508,1.214-6.892-4.01-7.614-6.721c-.334-1.252-.479-2.199-.518-2.811c-.004-.064-.002-.117 .002-.166c-.234,.014-.346,.136-.323,.487c.039,.611 .184,1.559 .518,2.811c.722,2.711 3.107,7.935 7.614,6.721c.981-.264 1.718-.746 2.272-1.36c-.51,.461-1.148,.823-1.951,1.04zM9.751,6.868v.321h1.768c-.036-.114-.073-.216-.109-.321zM11.914,9.51c.795,.226 1.216,.783 1.438,1.277l.887,.252c0,0-.121-1.727-1.683-2.17c-1.461-.415-2.36,.812-2.469,.971c.425-.303 1.046-.551 1.828-.329zM18.972,10.795c-1.462-.417-2.361,.812-2.469,.969c.425-.302 1.046-.55 1.827-.327c.794,.226 1.214,.783 1.437,1.277l.888,.253c0,0-.123-1.727-1.683-2.171zM18.091,15.347l-7.375-2.062c0,0 .08,.405 .386,.929l6.21,1.736c.511-.296 .779-.603 .779-.603zM12.978,19.785c-5.84-1.566-5.134-9.006-4.189-12.532c.389-1.453 .789-2.533 1.121-3.257c-.198-.041-.362,.064-.524,.393c-.352,.714-.803,1.877-1.238,3.506c-.945,3.526-1.651,10.966 4.189,12.532c2.752,.737 4.897-.383 6.495-2.143c-1.517,1.374-3.454,2.145-5.854,1.502zM9.751,15.849v-1.501l-4.172,1.183c0,0 .308-1.791 2.484-2.408c.66-.187 1.223-.186 1.688-.096v-6.159h2.089c-.227-.703-.447-1.244-.632-1.62c-.306-.622-.619-.21-1.33,.385c-.501,.419-1.767,1.312-3.673,1.825c-1.906,.514-3.446,.378-4.089,.266c-.911-.157-1.388-.357-1.343,.336c.039,.611 .184,1.559 .518,2.811c.722,2.711 3.107,7.935 7.614,6.721c1.177-.317 2.009-.944 2.585-1.744h-1.738zM3.019,10.909l3.203-.844c0,0-.093,1.232-1.294,1.549c-1.201,.316-1.909-.705-1.909-.705zM21.807,6.939c-.833,.146-2.83,.328-5.299-.334c-2.469-.661-4.108-1.818-4.757-2.362c-.92-.771-1.325-1.306-1.723-.496c-.352,.715-.803,1.878-1.238,3.506c-.945,3.526-1.651,10.966 4.189,12.532c5.838,1.564 8.946-5.233 9.891-8.759c.436-1.628 .627-2.86 .68-3.655c.06-.9-.558-.639-1.741-.432zM10.075,9.856c0,0 .92-1.431 2.481-.988c1.562,.444 1.683,2.17 1.683,2.17zM13.885,16.279c-2.745-.804-3.169-2.993-3.169-2.993l7.375,2.062c0,0-1.489,1.726-4.206,.931zM16.492,11.78c0,0 .919-1.43 2.479-.985c1.56,.444 1.683,2.171 1.683,2.171zM8.293,14.761l-2.714,.769c0,0 .295-1.679 2.294-2.345l-1.537-5.767l-.133,.04c-1.906,.514-3.446,.378-4.089,.266c-.911-.157-1.388-.357-1.343,.336c.039,.611 .184,1.559 .518,2.811c.722,2.711 3.107,7.935 7.614,6.721l.133-.042zM3.019,10.909l3.203-.844c0,0-.093,1.232-1.294,1.549c-1.201,.316-1.909-.705-1.909-.705zM14.009,16.309l-.124-.03c-2.745-.804-3.169-2.993-3.169-2.993l3.803,1.063l2.013-7.737l-.024-.006c-2.469-.661-4.108-1.818-4.757-2.362c-.92-.771-1.325-1.306-1.723-.496c-.352,.715-.802,1.878-1.238,3.506c-.945,3.526-1.651,10.966 4.189,12.532l.12,.027zM10.075,9.856c0,0 .92-1.431 2.481-.988c1.562,.444 1.683,2.17 1.683,2.17zM8.432,14.722l-.728,.207c.172,.969 .475,1.9 .951,2.721c.083-.018 .165-.034 .249-.057c.221-.06 .426-.133 .623-.214c-.531-.789-.883-1.697-1.095-2.657zM8.147,7.895c-.374,1.396-.709,3.405-.616,5.42c.165-.072 .339-.138 .532-.193l.135-.03c-.164-2.153 .191-4.346 .591-5.839c.101-.378 .203-.729 .304-1.056c-.163,.104-.339,.21-.539,.32c-.135,.417-.271,.872-.407,1.378z"},posthog:{title:"PostHog",source:"Simple Icons",path:"M9.854,14.5l-4.854-4.853l-4.146-4.147c-.143-.143-.358-.186-.545-.109c-.187,.078-.309,.26-.309,.463v2.586c0,.132 .053,.259 .146,.353l4.854,4.854l.147,.146l4.707,4.707l.146,.147v-.049c.065,.03 .134,.049 .207,.049h2.586c.202,0 .385-.122 .462-.309c.077-.187 .034-.402-.109-.545zM9.854,9.5l-4-4c-.106-.109-.258-.163-.409-.144c-.143,.017-.272,.093-.356,.21c-.059,.084-.09,.185-.089,.288v2.586c0,.133 .053,.259 .147,.353l9,9c.143,.143 .358,.185 .545,.108c.187-.077 .308-.26 .308-.462v-2.585c0-.133-.052-.26-.146-.354zM10.854,5.5c-.143-.143-.358-.186-.545-.109c-.187,.078-.309,.26-.309,.463v2.586c0,.133 .053,.259 .147,.353l4,4c.143,.143 .358,.185 .545,.108c.187-.077 .308-.26 .308-.462v-2.585c0-.133-.052-.26-.146-.354zM23.501,17.015c-.845-.11-1.63-.497-2.232-1.1l-4.708-4.707c-.143-.143-.358-.186-.545-.109c-.187,.078-.309,.26-.309,.463v6.585c0,.276 .224,.5 .5,.5h7.293c.276,0 .5-.224 .5-.5v-.6c0-.276-.225-.497-.499-.532zM18.107,17.047c-.442,0-.8-.358-.8-.8c0-.442 .358-.8 .8-.8c.442,0 .8,.358 .8,.8c0,.442-.358,.8-.8,.8zM.854,15.5c-.143-.143-.358-.186-.545-.109c-.187,.078-.309,.26-.309,.463v2.293c0,.276 .224,.5 .5,.5h2.293c.222,0 .39-.135 .462-.309c.079-.187 .036-.403-.109-.545l-2.292-2.292zM5,14.647l-4.146-4.147c-.143-.143-.358-.186-.545-.109c-.187,.077-.309,.26-.309,.462v2.586c0,.132 .053,.259 .146,.353l4.708,4.708l.146,.147h2.793c.202,0 .385-.122 .462-.309c.077-.187 .034-.402-.109-.545z"},sentry:{title:"Sentry",source:"Simple Icons",path:"M13.696,3.574c-.775-1.285-2.637-1.285-3.411,0l-2.806,4.806c4.362,2.178 7.243,6.505 7.57,11.369h-1.971c-.326-4.169-2.834-7.855-6.593-9.688l-2.597,4.491c2.11,.947 3.594,2.902 3.936,5.19h-4.525c-.109-.008-.207-.07-.261-.165c-.053-.096-.055-.212-.004-.309l1.254-2.132c-.425-.354-.91-.629-1.432-.81l-1.242,2.132c-.261,.448-.332,.981-.196,1.481c.135,.5 .466,.925 .917,1.18c.294,.166 .626,.254 .964,.256h6.197c.234-2.888-1.06-5.689-3.412-7.382l.985-1.706c2.969,2.039 4.639,5.495 4.393,9.088h5.249c.249-5.444-2.417-10.609-6.998-13.56l1.991-3.412c.092-.155 .292-.206 .447-.115c.226,.124 8.653,14.828 8.811,14.998c.057,.101 .055,.226-.005,.325c-.06,.1-.169,.159-.285,.157h-2.03c.026,.543 .026,1.085 0,1.625h2.038c.702,.004 1.352-.368 1.704-.975c.352-.607 .353-1.355 .002-1.963z"},shadcn:{title:"shadcn/ui",source:"Simple Icons",path:"M20.516,11.82l-8.696,8.696c-.339,.339-.339,.89 0,1.23c.339,.339 .89,.339 1.23,0l8.696-8.696c.339-.34 .339-.891 0-1.23c-.34-.339-.891-.339-1.23,0zM18.777,2.254l-16.522,16.522c-.339,.339-.339,.89 0,1.23c.34,.339 .891,.339 1.23,0l16.522-16.522c.339-.339 .339-.89 0-1.23c-.34-.339-.891-.339-1.23,0z"},slack:{title:"Slack",source:"svgl",path:"M9.336,1.99c-1.104,.001-1.998,.897-1.998,2.002c-.001,1.104 .894,2.001 1.998,2.002h1.998v-2.001c.001-1.104-.894-2.001-1.999-2.002c.001,0 .001,0 0,0M9.336,7.329h-5.327c-1.104,.001-1.999,.897-1.998,2.002c-.002,1.104 .893,2.001 1.998,2.002h5.328c1.104-.001 1.999-.897 1.998-2.002c.001-1.105-.894-2.002-1.998-2.002zM21.99,9.33c.001-1.104-.894-2.001-1.998-2.002c-1.104,.001-1.999,.897-1.998,2.002v2.002h1.998c1.104-.001 1.999-.897 1.998-2.002zM16.662,9.33v-5.339c.001-1.104-.893-2-1.998-2.002c-1.104,.001-1.999,.897-1.998,2.002v5.339c-.002,1.104 .893,2.001 1.998,2.002c1.104-.001 1.999-.897 1.998-2.002zM14.664,22.01c1.104-.001 1.999-.897 1.998-2.002c.001-1.104-.894-2.001-1.998-2.002h-1.998v2.002c-.001,1.104 .894,2 1.998,2.002zM14.664,16.671h5.328c1.104-.001 1.999-.897 1.998-2.002c.002-1.104-.893-2.001-1.998-2.002h-5.328c-1.104,.001-1.999,.897-1.998,2.002c-.001,1.105 .893,2.002 1.998,2.002zM2.01,14.669c-.001,1.104 .894,2.001 1.998,2.002c1.104-.001 1.999-.897 1.998-2.002v-2.002h-1.998c-1.104,.001-1.999,.897-1.998,2.002zM7.338,14.669v5.339c-.002,1.104 .893,2.001 1.998,2.002c1.104-.001 1.999-.897 1.998-2.002v-5.338c.002-1.104-.893-2.001-1.998-2.002c-1.105,0-1.999,.896-1.998,2.001c0,0 0,.001 0,0"},square:{title:"Square",source:"Simple Icons",path:"M5.342,2c-1.846,0-3.342,1.496-3.342,3.342v13.317c0,1.842 1.5,3.333 3.342,3.342h13.317c1.842,0 3.342-1.5 3.342-3.342v-13.325c-.005-1.842-1.499-3.333-3.342-3.333h-13.325zM6.692,5.633h10.617c.583,0 1.05,.475 1.05,1.058v10.617c0,.583-.467,1.058-1.05,1.058h-10.617c-.583,0-1.05-.475-1.05-1.058v-10.617c0-.581 .469-1.054 1.05-1.058zM9.883,9.258c-.336,0-.608,.272-.608,.608v4.242c0,.333 .267,.6 .6,.6h4.25c.333,0 .604-.267 .608-.6v-4.242c0-.336-.272-.608-.608-.608h-4.25z"},stripe:{title:"Stripe",source:"Simple Icons",path:"M13.948,9.189c-2.142-.795-3.31-1.406-3.31-2.376c0-.82 .674-1.287 1.875-1.287c2.196,0 4.453,.846 6.007,1.609l.878-5.419c-1.232-.59-3.752-1.551-7.235-1.551c-2.464,0-4.513,.645-5.978,1.846c-1.523,1.258-2.315,3.077-2.315,5.273c0,3.984 2.433,5.681 6.387,7.12c2.55,.907 3.398,1.552 3.398,2.548c0,.967-.828,1.524-2.322,1.524c-1.849,0-4.897-.908-6.894-2.08l-.888,5.479c1.717,.966 4.883,1.962 8.167,1.962c2.605,0 4.777-.615 6.241-1.788c1.641-1.287 2.49-3.192 2.49-5.653c0-4.071-2.489-5.771-6.504-7.205z"},supabase:{title:"Supabase",source:"Simple Icons",path:"M11.916,2.745c-.013-.832-1.064-1.19-1.582-.538l-7.818,9.835c-.923,1.162-.096,2.874 1.389,2.874h8.086l.095,6.339c.012,.831 1.063,1.189 1.581,.537l7.818-9.836c.923-1.161 .095-2.872-1.389-2.872h-8.139z"},teams:{title:"Microsoft Teams",source:"svgl",path:"M12,10.378h6.489c1.792,0 3.244,1.453 3.244,3.244v5.407c0,1.792-1.453,3.244-3.244,3.244c-1.792,0-3.244-1.453-3.244-3.244v-5.407c0-1.792-1.453-3.244-3.244-3.244zM4.43,12.541c0-1.792 1.453-3.244 3.244-3.244h4.326c1.792,0 3.244,1.453 3.244,3.244v6.489c0,1.792 1.453,3.244 3.244,3.244h-8.652c-2.986,0-5.407-2.421-5.407-5.407zM17.948,9.296c1.493,0 2.704-1.21 2.704-2.704c0-1.493-1.21-2.704-2.704-2.704c-1.493,0-2.704,1.21-2.704,2.704c0,1.493 1.21,2.704 2.704,2.704zM9.837,8.215c1.792,0 3.244-1.453 3.244-3.244c0-1.792-1.453-3.244-3.244-3.244c-1.792,0-3.244,1.453-3.244,3.244c0,1.792 1.453,3.244 3.244,3.244zM4.024,20.652c-.971,0-1.757-.787-1.757-1.757v-5.137c0-.971 .787-1.757 1.757-1.757h5.137c.971,0 1.757,.787 1.757,1.757v5.137c0,.971-.787,1.757-1.757,1.757zM8.474,14.761v-.906h-3.764v.906h1.323v4.037h1.117v-4.037h1.324zM8.474,14.761v-.906h-3.764v.906h1.323v4.037h1.117v-4.037h1.324z"},telegram:{title:"Telegram",source:"Simple Icons",path:"M11.953,2c-5.505,.026-9.953,4.495-9.953,10c0,5.523 4.477,10 10,10c5.523,0 10-4.477 10-10c0-5.523-4.477-10-10-10c-.016,0-.031,0-.047,0zM16.088,8.02c.083-.002 .268,.019 .388,.117c.08,.069 .131,.166 .143,.271c.013,.078 .03,.255 .017,.393c-.15,1.582-.802,5.418-1.133,7.189c-.14,.75-.416,1.001-.683,1.025c-.58,.054-1.021-.383-1.583-.752c-.88-.577-1.377-.937-2.232-1.5c-.987-.65-.347-1.008 .215-1.592c.148-.153 2.706-2.481 2.756-2.692c.006-.027 .012-.125-.047-.177c-.058-.052-.145-.034-.207-.02c-.088,.02-1.494,.95-4.217,2.788c-.4,.275-.761,.408-1.085,.4c-.357-.007-1.043-.201-1.554-.367c-.627-.204-1.124-.312-1.081-.657c.023-.18 .271-.364 .744-.552c2.915-1.27 4.858-2.107 5.832-2.512c2.777-1.155 3.354-1.356 3.73-1.362z"},vercel:{title:"Vercel",source:"Simple Icons",path:"M12,2.694l10.746,18.612h-21.492z"},webflow:{title:"Webflow",source:"Simple Icons",path:"M24,4.515l-7.658,14.97h-7.193l3.205-6.204h-.144c-2.644,3.432-6.589,5.692-12.21,6.204v-6.118c0,0 3.596-.213 5.71-2.435h-5.71v-6.417h6.417v5.278l.144-.001l2.622-5.277h4.854v5.244h.144l2.72-5.244z"},wix:{title:"Wix",source:"Simple Icons",path:"M0,7.355l2.113,9.292h.801c.726,0 1.354-.508 1.506-1.218l1.351-6.34c.016-.079 .086-.137 .167-.137c.08,0 .15,.058 .167,.137l1.352,6.34c.152,.71 .78,1.218 1.506,1.218h.805l2.113-9.292h-.565c-.62,0-1.159,.43-1.296,1.035l-1.26,5.545l-1.106-5.176c-.102-.473-.395-.883-.81-1.134c-.414-.251-.914-.319-1.38-.19c-.639,.176-1.113,.716-1.251,1.365l-1.094,5.127l-1.26-5.537c-.138-.605-.675-1.035-1.296-1.035zM13.992,7.355c-.525,0-.95,.425-.951,.95v8.342h.635c.525-.001 .95-.425 .951-.95v-8.343h-.635zM15.77,7.355l3.158,4.66l-3.14,4.632h1.325c.368,0 .712-.181 .918-.486l1.756-2.59c.022-.032 .059-.051 .099-.051c.039,0 .076,.019 .099,.051l1.754,2.59c.206,.305 .55,.486 .918,.486h1.326l-3.14-4.632l3.158-4.66h-1.326c-.368,0-.712,.181-.918,.486l-1.772,2.617c-.022,.032-.059,.051-.098,.051c-.039,0-.076-.019-.098-.051l-1.773-2.617c-.206-.304-.55-.486-.918-.486z"},zapier:{title:"Zapier",source:"Simple Icons",path:"M14.5,12.003c0,.744-.137,1.455-.384,2.113c-.656,.248-1.369,.384-2.112,.384h-.007c-.744,0-1.454-.137-2.112-.384c-.247-.657-.384-1.369-.384-2.112v-.007c0-.744 .137-1.454 .384-2.112c.658-.247 1.368-.384 2.112-.384h.008c.744,0 1.457,.137 2.113,.385c.248,.657 .384,1.368 .384,2.113zM21.863,10.333h-5.837l4.123-4.127c-.325-.457-.683-.883-1.079-1.277c-.394-.395-.821-.756-1.275-1.08l-4.128,4.124v-5.836c-.541-.087-1.094-.137-1.662-.137h-.008c-.567,0-1.122,.051-1.662,.138v5.838l-4.125-4.124c-.457,.322-.883,.684-1.278,1.078c-.395,.395-.757,.823-1.08,1.278l4.124,4.127h-5.836c0,0-.137,1.097-.137,1.663v.008c0,.567 .051,1.123 .138,1.663h5.838l-4.124,4.127c.648,.913 1.444,1.709 2.356,2.358l4.127-4.125v5.837c.54,.088 1.094,.138 1.659,.138h.014c.566,0 1.12-.05 1.659-.137v-5.837l4.127,4.125c.457-.312 .883-.677 1.274-1.075h.004c.394-.387 .755-.813 1.08-1.276l-4.125-4.124h5.837c.088-.537 .138-1.087 .138-1.65v-.026c0-.565-.05-1.119-.137-1.658"}};var sw=j(fe(),1);function cE({id:e}){let t=uE[e];return(0,sw.jsx)("svg",{viewBox:"0 0 24 24",focusable:"false","aria-hidden":"true",children:(0,sw.jsx)("path",{fill:"currentColor",fillRule:t.evenodd?"evenodd":void 0,d:t.path})})}var k=j(fe(),1),fV={"/settings/lead":(0,k.jsx)(Oi,{}),"/settings/flows":(0,k.jsx)(Ui,{}),"/settings/integrations":(0,k.jsx)(bf,{}),"/settings/models":(0,k.jsx)(Jd,{}),"/settings/skills":(0,k.jsx)(Xo,{}),"/settings/tools":(0,k.jsx)(Vi,{}),"/settings/knowledge":(0,k.jsx)(Pi,{}),"/settings/learning":(0,k.jsx)($o,{}),"/settings/sign-in":(0,k.jsx)(mf,{}),"/settings/sessions":(0,k.jsx)(cf,{}),"/settings/project":(0,k.jsx)(nf,{}),"/settings/policy":(0,k.jsx)(tf,{}),"/settings/approval":(0,k.jsx)(kf,{}),"/settings/monitoring":(0,k.jsx)(jd,{}),"/settings/retention":(0,k.jsx)(Zd,{}),"/settings/storage":(0,k.jsx)(lf,{}),"/settings/updates":(0,k.jsx)(wf,{}),"/settings/backups":(0,k.jsx)(ef,{}),"/settings/data":(0,k.jsx)(Fi,{})},dE=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-");function Er({csrf:e}){return(0,k.jsx)("input",{type:"hidden",name:"csrf",value:e})}function mc({action:e,csrf:t,children:a,className:n}){let o=(0,Oa.useRef)(null);return(0,k.jsxs)("form",{ref:o,method:"post",action:e,className:n,children:[(0,k.jsx)(Er,{csrf:t}),a(()=>setTimeout(()=>o.current?.requestSubmit(),0))]})}function Ar({title:e,description:t,children:a,id:n}){return(0,k.jsxs)(ba,{id:n,"aria-labelledby":n?`${n}-title`:void 0,children:[(0,k.jsx)(D5,{children:(0,k.jsxs)("div",{className:"grid gap-1",children:[(0,k.jsx)(_5,{id:n?`${n}-title`:void 0,children:e}),t&&(0,k.jsx)(P5,{children:t})]})}),a]})}function Mr({tone:e}){return(0,k.jsx)("span",{"aria-hidden":"true",className:ee("size-2 shrink-0 rounded-full",e==="ok"&&"bg-success",e==="warn"&&"bg-warning",e==="neutral"&&"bg-muted-foreground",e==="off"&&"border-[1.5px] border-muted-foreground")})}function pV({view:e,csrf:t}){return(0,k.jsxs)("form",{method:"post",action:"/settings/appearance",className:"flex flex-wrap items-center gap-3",children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsx)("div",{role:"group","aria-label":"Theme",className:"inline-flex rounded-lg bg-muted p-0.5",children:[["system","Match device",(0,k.jsx)(xf,{},"m")],["light","Light",(0,k.jsx)(If,{},"s")],["dark","Dark",(0,k.jsx)(vf,{},"d")]].map(([n,o,r])=>(0,k.jsxs)("button",{type:"submit",name:"theme",value:n,"aria-pressed":e.theme===n,className:ee("inline-flex h-7 items-center gap-2 rounded-md px-2.5 text-[13px] font-medium text-muted-foreground transition-colors hover:text-foreground phone:h-11 [&_svg]:size-3.5",e.theme===n&&"bg-card text-foreground shadow-[var(--so-pill-shadow)]"),children:[r,o]},n))}),(0,k.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"Saved in this browser."})]})}var qg=e=>Math.min(1,Math.max(0,e));function fE({h:e,s:t,v:a}){let n=o=>{let r=(o+e/60)%6;return a-a*t*Math.max(0,Math.min(r,4-r,1))};return`#${[n(5),n(3),n(1)].map(o=>Math.round(o*255).toString(16).padStart(2,"0")).join("")}`}function pE(e){let[t,a,n]=[1,3,5].map(i=>parseInt(e.slice(i,i+2),16)/255),o=Math.max(t,a,n),r=o-Math.min(t,a,n);return{h:(r===0?0:o===t?((a-n)/r+6)%6:o===a?(n-t)/r+2:(t-a)/r+4)*60,s:o===0?0:r/o,v:o}}function mV(e){let t=document.documentElement,a=t.dataset.theme==="dark"||t.dataset.theme!=="light"&&matchMedia("(prefers-color-scheme: dark)").matches,n=rw(e)[a?"dark":"light"];for(let[o,r]of[["signal",n.signal],["signal-hover",n.hover],["on-signal",n.on],["signal-soft",n.soft],["selection",n.selection]])t.style.setProperty(`--so-${o}`,r)}function hV({hsv:e,onChange:t}){let a=n=>{let o=n.currentTarget.getBoundingClientRect();t({h:e.h,s:qg((n.clientX-o.left)/o.width),v:1-qg((n.clientY-o.top)/o.height)})};return(0,k.jsx)("div",{role:"slider",tabIndex:0,"aria-label":"Saturation and brightness","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e.s*100),"aria-valuetext":`saturation ${Math.round(e.s*100)}%, brightness ${Math.round(e.v*100)}%`,className:"relative h-28 w-44 shrink-0 cursor-crosshair touch-none rounded-lg shadow-[inset_0_0_0_1px_rgb(0_0_0/.08)] phone:h-36 phone:w-full",style:{background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${e.h} 100% 50%))`},onPointerDown:n=>{n.currentTarget.setPointerCapture(n.pointerId),a(n)},onPointerMove:n=>{n.buttons!==0&&a(n)},onKeyDown:n=>{let o=n.shiftKey?.1:.02,r={ArrowLeft:[-o,0],ArrowRight:[o,0],ArrowUp:[0,o],ArrowDown:[0,-o]}[n.key];r!==void 0&&(n.preventDefault(),t({h:e.h,s:qg(e.s+r[0]),v:qg(e.v+r[1])}))},children:(0,k.jsx)("span",{"aria-hidden":"true",className:"pointer-events-none absolute size-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/.35)]",style:{left:`${e.s*100}%`,top:`${(1-e.v)*100}%`}})})}function gV({view:e,csrf:t}){let[a,n]=(0,Oa.useState)(e.accent),[o,r]=(0,Oa.useState)(()=>pE(e.accent)),[s,i]=(0,Oa.useState)(e.accent),[l,c]=(0,Oa.useState)(null),f=(0,Oa.useRef)(void 0),u=(v,b)=>{n(v),i(v),r(b??pE(v)),mV(v),c(null),window.clearTimeout(f.current),f.current=window.setTimeout(async()=>{let x=await fetch("/settings/appearance",{method:"POST",body:new URLSearchParams({csrf:t,accent:v,quiet:"1"})}).catch(()=>null);c(x?.ok?"Saved":"Not saved. Try again.")},400)};(0,Oa.useEffect)(()=>()=>window.clearTimeout(f.current),[]);let d=()=>{let v=sE(s);v===null?i(a):v!==a&&u(v)},p=e.accentPresets.find(v=>v.hex===a),g=iE(a);return(0,k.jsxs)("div",{className:"flex flex-col gap-3","data-accent-picker":!0,children:[(0,k.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,k.jsx)(hV,{hsv:o,onChange:v=>u(fE(v),v)}),(0,k.jsxs)("div",{className:"flex min-w-0 flex-1 basis-52 flex-col gap-2.5",children:[(0,k.jsx)("input",{type:"range",min:0,max:359,value:Math.round(o.h),"aria-label":"Hue",onChange:v=>{let b={...o,h:Number(v.target.value),s:o.s||.75,v:o.v||.75};u(fE(b),b)},className:"h-3 w-full cursor-pointer appearance-none rounded-full phone:h-11 phone:bg-[length:100%_12px] phone:bg-center phone:bg-no-repeat bg-[linear-gradient(to_right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring [&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-white [&::-moz-range-thumb]:bg-transparent [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:shadow-[0_0_0_1px_rgb(0_0_0/.35)]"}),(0,k.jsxs)("div",{className:"flex items-center gap-2",children:[(0,k.jsx)("span",{"aria-hidden":"true",className:"size-8 shrink-0 rounded-md shadow-[inset_0_0_0_1px_rgb(0_0_0/.12)]",style:{background:a}}),(0,k.jsx)(ve,{value:s,"aria-label":"Hex colour",spellCheck:!1,autoComplete:"off",className:"w-28 font-mono",onChange:v=>i(v.target.value),onBlur:d,onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),d())}}),(0,k.jsx)(J,{variant:"ghost",size:"sm",disabled:a===e.accentPresets[0].hex,onClick:()=>u(e.accentPresets[0].hex),children:"Reset"})]}),(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-2","aria-hidden":"true",children:[(0,k.jsx)("span",{className:"inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-attention px-1.5 font-mono text-[11px] leading-none text-on-attention",children:"3"}),(0,k.jsx)(ya,{tone:"attention",children:"Needs your decision"}),(0,k.jsx)("span",{className:"inline-flex h-7 items-center rounded-md bg-attention px-2.5 text-[12.5px] font-medium text-on-attention",children:"Approve"})]}),(0,k.jsxs)("p",{className:"text-[12.5px] text-muted-foreground","aria-live":"polite","data-accent-status":!0,children:[p!==void 0?(0,k.jsxs)(k.Fragment,{children:[p.name,p.year!==null&&(0,k.jsxs)("span",{className:"font-mono",children:[" ",p.year]})]}):"Custom",l!==null&&` · ${l}`]})]})]}),g!==null&&(0,k.jsx)("p",{className:"text-[12.5px] text-warning",children:g}),(0,k.jsx)("div",{role:"group","aria-label":"Presets",className:"flex flex-wrap gap-1.5",children:e.accentPresets.map(v=>(0,k.jsx)("button",{type:"button","data-preset":v.id,"aria-pressed":v.hex===a,"aria-label":`${v.name}${v.year===null?", the default":`, ${v.year}`}`,title:`${v.name}${v.year===null?"":` · ${v.year}`}`,onClick:()=>u(v.hex),style:{background:v.hex},className:ee("size-6 rounded-full shadow-[inset_0_0_0_1px_rgb(0_0_0/.12)] ring-offset-2 ring-offset-card transition-shadow phone:size-11",v.hex===a?"ring-2 ring-foreground":"hover:ring-2 hover:ring-input")},v.id))}),(0,k.jsx)("p",{className:"text-[12.5px] text-muted-foreground",children:"Presets are Pantone's colours of the year. Colours are deepened or lightened as needed so text stays readable. Saved in this browser."})]})}function mE({title:e,description:t,action:a,field:n,value:o,canManage:r,changed:s,options:i,csrf:l}){let c=(0,Oa.useId)(),f=i.find(u=>u.value===o);return(0,k.jsxs)(Ar,{title:e,description:t,children:[r?(0,k.jsx)(mc,{action:a,csrf:l,children:u=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(tg,{name:n,defaultValue:o,onValueChange:u,className:"grid gap-2 desk:grid-cols-2","aria-label":e,children:i.map(d=>(0,k.jsx)(Ef,{id:`${c}-${d.value}`,value:d.value,title:d.title,description:d.description},d.value))}),(0,k.jsx)("noscript",{children:(0,k.jsx)(J,{type:"submit",className:"mt-3",children:"Save"})})]})}):(0,k.jsxs)("p",{className:"text-sm",children:[(0,k.jsx)("strong",{children:f?.title??o})," ",(0,k.jsx)("span",{className:"text-muted-foreground",children:"· an approver can change this"})]}),s&&(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:s})]})}function xV({email:e,csrf:t}){let a=e.google.connected,n=a!==null?`${a}, through Google`:e.set?`From ${e.from} through ${e.host}${e.imapHost===""?"":` · reads ${e.imapHost}`}`:"Not set up";return(0,k.jsx)(Ar,{id:"email",title:"Email",description:"Send email steps send from this account, and Email inbox triggers read it.",children:(0,k.jsxs)(ec,{defaultOpen:!e.set&&a===null,children:[(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,k.jsxs)("span",{className:"inline-flex items-center gap-2 text-sm",children:[(0,k.jsx)(Mr,{tone:e.set||a!==null?"ok":"off"}),n]}),(0,k.jsx)(tc,{asChild:!0,children:(0,k.jsxs)(J,{variant:"ghost",size:"sm",className:"ml-auto group",children:[e.set||a!==null?"Change":"Set up",(0,k.jsx)(ra,{className:"transition-transform group-data-[state=open]:rotate-90"})]})})]}),(0,k.jsx)(ac,{children:a!==null?(0,k.jsxs)("form",{method:"post",action:"/settings/google/disconnect",className:"mt-3 grid gap-3 rounded-lg bg-muted p-4","data-google-connected":!0,children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsxs)("p",{className:"text-[13px]",children:["Signed in with Google as ",(0,k.jsx)("strong",{children:a}),". Mail is sent and read through it."]}),(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,k.jsx)(J,{type:"submit",variant:"outline",formAction:"/settings/email-test",children:"Send a test email"}),(0,k.jsx)(J,{type:"submit",variant:"outline",formAction:"/settings/email-read-test",children:"Check the inbox"}),(0,k.jsx)(J,{type:"submit",variant:"ghost",children:"Disconnect Google"})]})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("form",{method:"post",action:"/settings/email",className:"mt-3 grid gap-3 rounded-lg bg-muted p-4","data-email-settings":!0,children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"For Gmail: smtp.gmail.com, port 587, your address, and an app password. To read mail too, add imap.gmail.com."}),(0,k.jsxs)("div",{className:"grid gap-3 desk:grid-cols-[1fr_7rem]",children:[(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-host",children:"Mail server"}),(0,k.jsx)(ve,{id:"email-host",name:"host",defaultValue:e.host,placeholder:"smtp.gmail.com",required:!0})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-port",children:"Port"}),(0,k.jsx)(ve,{id:"email-port",name:"port",type:"number",min:1,max:65535,defaultValue:String(e.port),required:!0})]})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-from",children:"Send from"}),(0,k.jsx)(ve,{id:"email-from",name:"from",type:"email",defaultValue:e.from,placeholder:"you@example.com",required:!0})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-user",children:"Username"}),(0,k.jsx)(ve,{id:"email-user",name:"user",autoComplete:"username",defaultValue:e.user,placeholder:"Usually the same address"})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-password",children:"Password"}),(0,k.jsx)(ve,{id:"email-password",name:"password",type:"password",autoComplete:"off",placeholder:e.set?"Leave empty to keep the saved one":"An app password"})]}),(0,k.jsxs)("label",{className:"flex items-center gap-2 text-[13px] phone:-ml-3.5 phone:min-h-11 phone:pl-3.5",children:[(0,k.jsx)("input",{type:"checkbox",name:"secure",className:"size-4 accent-[var(--so-accent)]",defaultChecked:e.secure}),"Use SSL from the start (port 465)"]}),(0,k.jsxs)("div",{className:"grid gap-3 desk:grid-cols-[1fr_7rem]",children:[(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-imap",children:"Read mail from (optional)"}),(0,k.jsx)(ve,{id:"email-imap",name:"imapHost",defaultValue:e.imapHost,placeholder:"imap.gmail.com"})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"email-imap-port",children:"Port"}),(0,k.jsx)(ve,{id:"email-imap-port",name:"imapPort",type:"number",min:1,max:65535,defaultValue:String(e.imapPort)})]})]}),(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,k.jsx)(J,{type:"submit",children:"Save email"}),e.set&&(0,k.jsx)(J,{type:"submit",variant:"outline",formAction:"/settings/email-test",formNoValidate:!0,children:"Send a test email"}),e.set&&e.imapHost!==""&&(0,k.jsx)(J,{type:"submit",variant:"outline",formAction:"/settings/email-read-test",formNoValidate:!0,children:"Check the inbox"})]})]}),(0,k.jsxs)("details",{className:"mt-3 rounded-lg border px-4 py-3",open:e.google.clientId!==""&&!e.set,"data-google-setup":!0,children:[(0,k.jsx)("summary",{className:"cursor-pointer text-[13px] font-semibold phone:-my-3 phone:min-h-11 phone:py-3 phone:leading-5",children:"Or sign in with a Google account"}),(0,k.jsxs)("form",{method:"post",action:"/settings/google",className:"mt-3 grid gap-3",children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsxs)("ol",{className:"list-decimal space-y-1 pl-5 text-[13px] text-muted-foreground",children:[(0,k.jsxs)("li",{children:["In Google Cloud Console, make an OAuth client of type ",(0,k.jsx)("em",{children:"Web application"}),", and set the consent screen to ",(0,k.jsx)("em",{children:"In production"})," (while it's in Testing, Google ends the connection after 7 days)."]}),e.google.redirect===null?(0,k.jsx)("li",{children:"Open these settings on this computer (localhost) or at your https address to see the redirect address to add."}):(0,k.jsxs)("li",{children:["Add this as an authorized redirect address: ",(0,k.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-foreground","data-google-redirect":!0,children:e.google.redirect})]}),(0,k.jsx)("li",{children:"Paste the client ID and secret here, then connect. Google warns that it hasn't verified the app: it's your own, so continue."})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"google-id",children:"Client ID"}),(0,k.jsx)(ve,{id:"google-id",name:"clientId",defaultValue:e.google.clientId,placeholder:"….apps.googleusercontent.com",required:!0})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:"google-secret",children:"Client secret"}),(0,k.jsx)(ve,{id:"google-secret",name:"clientSecret",type:"password",autoComplete:"off",placeholder:e.google.clientId!==""?"Leave empty to keep the saved one":""})]}),(0,k.jsx)(J,{type:"submit",className:"justify-self-start",disabled:e.google.redirect===null,children:"Connect Google"})]})]})]})})]})})}function vV({providers:e,csrf:t}){return(0,k.jsx)(Ar,{id:"providers",title:"AI providers",description:"Keys stay on this computer and are never shown again.",children:(0,k.jsx)("ul",{className:"-my-1 divide-y divide-border",children:e.map(a=>(0,k.jsx)("li",{className:"py-2",children:(0,k.jsxs)(ec,{children:[(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,k.jsx)("span",{className:"font-semibold",children:a.name}),(0,k.jsxs)("span",{className:"inline-flex items-center gap-2 text-sm text-muted-foreground",children:[(0,k.jsx)(Mr,{tone:a.tone}),a.words]}),(0,k.jsx)(tc,{asChild:!0,children:(0,k.jsxs)(J,{variant:"ghost",size:"sm",className:"ml-auto group",children:["Manage",(0,k.jsx)(ra,{className:"transition-transform group-data-[state=open]:rotate-90"})]})})]}),(0,k.jsx)(ac,{children:(0,k.jsxs)("form",{method:"post",action:"/settings/provider-key",className:"mt-3 grid gap-3 rounded-lg bg-muted p-4",children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsx)("input",{type:"hidden",name:"provider",value:a.provider}),a.connection&&(0,k.jsxs)("p",{className:"provider-connection text-sm",children:[(0,k.jsx)("strong",{children:a.connection.words})," ",a.connection.facts," · ",(0,k.jsx)("a",{className:"underline underline-offset-4",href:a.connection.checkHref,children:"Check again"})]}),(0,k.jsxs)("p",{className:"text-[13px] text-muted-foreground",children:[a.usage," · ",(0,k.jsx)("code",{className:"font-mono text-xs",children:a.envName})]}),a.subscriptionCapable&&(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:`${a.provider}-auth`,children:"Sign-in"}),(0,k.jsxs)(Ff,{name:"auth-mode",defaultValue:a.mode,children:[(0,k.jsx)(qf,{id:`${a.provider}-auth`,children:(0,k.jsx)(Hf,{})}),(0,k.jsxs)(Uf,{children:[(0,k.jsxs)(Qu,{value:"subscription",children:[a.name," subscription"]}),(0,k.jsx)(Qu,{value:"api-key",children:"API key"})]})]})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:`${a.provider}-key`,children:"API key"}),(0,k.jsx)(ve,{id:`${a.provider}-key`,type:"password",name:"value",autoComplete:"off",placeholder:a.set?"Paste to replace the stored key":"Paste a key"})]}),(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,k.jsxs)(J,{type:"submit",children:["Save ",a.name]}),a.set&&(0,k.jsxs)(ec,{children:[(0,k.jsx)(tc,{asChild:!0,children:(0,k.jsx)(J,{variant:"ghost",size:"sm",className:"text-destructive",children:"Remove the stored key"})}),(0,k.jsxs)(ac,{className:"mt-2 grid gap-2",children:[(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"Runs that use this API key stop until you add one again."}),(0,k.jsx)(J,{type:"submit",variant:"destructive",size:"sm",formAction:"/settings/provider-key-clear",children:"Remove key"})]})]})]})]})})]})},a.provider))})})}function yV({workers:e}){return(0,k.jsxs)(Ar,{id:"workers",title:"Workers",description:"How many tasks each worker runs at once, and what it is running now.",children:[e.length===0?(0,k.jsxs)("p",{className:"text-sm text-muted-foreground",children:["No worker is connected. Run ",(0,k.jsx)("code",{className:"font-mono text-xs",children:"toolroll up"})," on the computer with your projects."]}):(0,k.jsx)("ul",{className:"-my-1 divide-y divide-border",children:e.map(t=>(0,k.jsxs)("li",{className:"grid gap-1.5 py-2.5","data-worker":t.name,children:[(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,k.jsx)("span",{className:"min-w-0 break-all font-semibold",children:t.name}),(0,k.jsxs)("span",{className:"inline-flex items-center gap-2 text-sm text-muted-foreground",children:[(0,k.jsx)(Mr,{tone:t.tone}),t.state]}),(0,k.jsxs)("span",{className:"ml-auto text-sm tabular-nums","data-worker-load":!0,children:[t.busy," of ",t.capacity," running"]})]}),t.running.length===0?(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"Nothing running."}):(0,k.jsx)("ul",{className:"grid gap-1",children:t.running.map(a=>(0,k.jsxs)("li",{className:"flex min-w-0 items-baseline gap-2 text-sm",children:[(0,k.jsx)("a",{className:"min-w-0 truncate underline-offset-4 hover:underline phone:min-h-11 phone:leading-[44px]",href:a.href,children:a.title}),a.project&&(0,k.jsx)("span",{className:"shrink-0 text-[13px] text-muted-foreground",children:a.project})]},a.taskId))})]},t.name))}),e.length>0&&(0,k.jsxs)("p",{className:"mt-3 text-[13px] text-muted-foreground",children:["To change how many a worker runs at once: ",(0,k.jsx)("code",{className:"font-mono text-xs",children:"toolroll runner capacity <name> <n>"})]})]})}function bV({updates:e,csrf:t,firstResult:a}){let n=e.latest,o=n!==null&&n.newer?n:null,[r,s]=(0,Oa.useState)(!1),i=()=>{navigator.clipboard?.writeText(e.updateCommand).then(()=>{s(!0),window.setTimeout(()=>s(!1),1500)},()=>{})};return(0,k.jsxs)(Ar,{id:"updates",title:"Updates",children:[(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1","data-updates-state":o?"newer":e.check.on?n===null?"unchecked":"current":"off",children:[(0,k.jsxs)("span",{className:"text-sm",children:["This version ",(0,k.jsx)("span",{className:"font-mono text-[12.5px]",children:e.current})]}),(0,k.jsx)("span",{className:"inline-flex items-center gap-2 text-sm text-muted-foreground",children:o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Mr,{tone:"neutral"}),(0,k.jsxs)("span",{children:[(0,k.jsx)("span",{className:"font-mono text-[12.5px] text-foreground",children:o.version})," is available"]})]}):e.check.on?n===null?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Mr,{tone:"off"}),"Not checked yet"]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Mr,{tone:"ok"}),"Up to date"]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Mr,{tone:"off"}),"Checks are off"]})}),o?.security&&(0,k.jsx)(ya,{tone:"warning",children:"Security fixes"})]}),a!==null&&(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground","data-first-result":!0,children:a}),o&&(0,k.jsxs)("div",{className:"grid gap-2 rounded-lg bg-muted p-3 phone:p-3","data-update-command":!0,children:[(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,k.jsx)("code",{className:"min-w-0 flex-1 break-words font-mono text-[12.5px]",children:e.updateCommand}),(0,k.jsx)(J,{variant:"outline",size:"sm",onClick:i,children:r?"Copied":"Copy"})]}),(0,k.jsx)("p",{className:"text-[12.5px] text-muted-foreground",children:"Run it on this computer, then restart Toolroll."})]}),o&&(0,k.jsxs)(ec,{children:[(0,k.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,k.jsx)(tc,{asChild:!0,children:(0,k.jsxs)(J,{variant:"ghost",size:"sm",className:"group -ml-2.5",disabled:o.notes==="",children:["What's new in ",o.version,(0,k.jsx)(ra,{className:"transition-transform group-data-[state=open]:rotate-90"})]})}),(0,k.jsx)("a",{className:"text-[13px] underline underline-offset-4",href:o.url,target:"_blank",rel:"noreferrer",children:"Release page"})]}),(0,k.jsx)(ac,{children:(0,k.jsx)("pre",{className:"mt-2 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-lg border border-border p-3 font-sans text-[13px] leading-relaxed","data-update-notes":!0,children:o.notes})})]}),(0,k.jsx)(Ju,{}),(0,k.jsx)(mc,{action:"/settings/updates/checks",csrf:t,className:"flex items-center justify-between gap-4",children:l=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("div",{className:"grid gap-0.5",children:[(0,k.jsx)(St,{htmlFor:"update-check",children:"Check for a newer version once a day"}),(0,k.jsx)("span",{className:"text-[12.5px] text-muted-foreground",children:e.check.byEnv?"Off by TOOLROLL_NO_UPDATE_CHECK.":"One anonymous request to npm and GitHub. Nothing about you is sent."})]}),(0,k.jsx)(Mb,{id:"update-check",name:"check",value:"on",defaultChecked:e.check.on,disabled:!e.check.canManage||e.check.byEnv,onCheckedChange:l})]})}),e.workers.length>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Ju,{}),(0,k.jsx)("ul",{className:"-my-1 divide-y divide-border","aria-label":"Worker versions",children:e.workers.map(l=>(0,k.jsxs)("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 py-2","data-worker-version":l.name,children:[(0,k.jsx)("span",{className:"min-w-0 break-all text-sm font-medium",children:l.name}),(0,k.jsx)("span",{className:ee("ml-auto text-muted-foreground",l.version===null?"text-[12.5px]":"font-mono text-[12.5px]"),children:l.version??"Version not reported"}),l.older&&(0,k.jsx)(ya,{tone:"warning",children:"Older"})]},l.name))})]})]})}var wV=[["off","Off"],["first","First one"],["all","Up to 4"]];function SV({view:e,csrf:t}){let a=(0,Oa.useId)();return!e.chat&&e.services===null&&e.push===null&&e.digest===null?null:(0,k.jsxs)(Ar,{id:"notifications",title:"Notifications",children:[e.chat&&(0,k.jsx)(mc,{action:"/settings/notifications",csrf:t,className:"grid gap-4 phone:gap-3",children:n=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(tg,{name:"mode",defaultValue:e.chat.mode,onValueChange:n,className:"grid gap-2 desk:grid-cols-2","aria-label":"Chat messages",children:[(0,k.jsx)(Ef,{id:`${a}-quiet`,value:"quiet",title:"Only when I'm needed",description:"One message per task, updated as it moves."}),(0,k.jsx)(Ef,{id:`${a}-all`,value:"all",title:"Every step",description:"A new message for each update."})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:`${a}-evening`,children:"Evening digest"}),(0,k.jsxs)(Ff,{name:"digest",defaultValue:e.chat.digestAt??"off",onValueChange:n,children:[(0,k.jsx)(qf,{id:`${a}-evening`,className:"desk:max-w-72",children:(0,k.jsx)(Hf,{})}),(0,k.jsx)(Uf,{children:lE(e.chat.digestAt).map(([o,r])=>(0,k.jsx)(Qu,{value:o,children:r},o))})]}),(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"One message: what finished, what waits, what failed."})]}),(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{htmlFor:`${a}-screenshots`,children:"Screenshots with results"}),(0,k.jsxs)(Ff,{name:"screenshots",defaultValue:e.chat.screenshots??"off",onValueChange:n,children:[(0,k.jsx)(qf,{id:`${a}-screenshots`,className:"desk:max-w-72",children:(0,k.jsx)(Hf,{})}),(0,k.jsx)(Uf,{children:wV.map(([o,r])=>(0,k.jsx)(Qu,{value:o,children:r},o))})]})]}),(0,k.jsx)("noscript",{children:(0,k.jsx)(J,{type:"submit",children:"Save"})})]})}),e.chat?.projects&&e.chat.projects.length>0&&(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)("span",{className:"font-semibold",children:"Projects"}),(0,k.jsx)("ul",{className:"-my-1 divide-y divide-border","aria-label":"Project pings",children:e.chat.projects.map((n,o)=>(0,k.jsx)("li",{"data-project-pings":n.name,children:(0,k.jsx)(mc,{action:"/settings/notifications/mute",csrf:t,className:"flex items-center justify-between gap-4 py-2",children:r=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("input",{type:"hidden",name:"repo",value:n.repo}),(0,k.jsx)(St,{htmlFor:`${a}-mute-${o}`,className:"min-w-0 break-all",children:n.name}),(0,k.jsx)(Mb,{id:`${a}-mute-${o}`,name:"pings",value:"on",defaultChecked:!n.muted,onCheckedChange:r,"aria-label":`Pings for ${n.name}`}),(0,k.jsx)("noscript",{children:(0,k.jsx)(J,{type:"submit",size:"sm",variant:"outline",children:"Save"})})]})})},n.repo))}),(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"Off: no pings. It still shows in Tasks and the evening digest."})]}),e.chat&&e.services&&(0,k.jsx)(Ju,{}),e.services&&(e.services.configured.length===1&&!e.services.implicit?(0,k.jsxs)("div",{className:"flex items-center gap-3",children:[(0,k.jsx)("span",{className:"font-semibold capitalize",children:e.services.configured[0]}),(0,k.jsxs)("span",{className:"inline-flex items-center gap-2 text-sm text-muted-foreground",children:[(0,k.jsx)(Mr,{tone:"ok"}),"Receiving alerts"]})]}):(0,k.jsx)(mc,{action:"/settings/messaging",csrf:t,children:n=>(0,k.jsxs)("div",{className:"grid gap-2",children:[(0,k.jsx)(St,{children:"Alert service"}),e.services.implicit&&(0,k.jsx)("p",{className:"text-[13px] text-warning",children:"Several are connected and none was chosen. Pick one."}),(0,k.jsx)(tg,{name:"primary",...e.services.channel===null?{}:{defaultValue:e.services.channel},onValueChange:n,className:"grid gap-2 desk:grid-cols-2",children:e.services.configured.map(o=>(0,k.jsx)(Ef,{id:`${a}-${o}`,value:o,title:o.charAt(0).toUpperCase()+o.slice(1),description:o==="telegram"?"Answer buttons and replies":"Messages with links"},o))})]})})),e.push&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Ju,{}),(0,k.jsxs)("div",{className:"grid gap-3",children:[(0,k.jsxs)("div",{className:"grid gap-1",children:[(0,k.jsx)("span",{className:"font-semibold",children:"This device"}),(0,k.jsx)("span",{className:"text-[13px] text-muted-foreground",children:e.push.available?"A notification when something needs you. On iPhone, add this app to your Home Screen first.":"Alerts need a secure (https) address for this app."})]}),e.push.available&&(0,k.jsxs)("form",{method:"post",action:"/push/subscribe",id:"push-form",className:"flex flex-wrap items-end gap-3",children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsx)("input",{type:"hidden",name:"endpoint",value:""}),(0,k.jsx)("input",{type:"hidden",name:"p256dh",value:""}),(0,k.jsx)("input",{type:"hidden",name:"auth",value:""}),(0,k.jsxs)("div",{className:"grid min-w-56 flex-1 gap-2",children:[(0,k.jsx)(St,{htmlFor:"push-password",children:"Your password"}),(0,k.jsx)(ve,{id:"push-password",type:"password",name:"token",autoComplete:"current-password"})]}),(0,k.jsx)(J,{type:"submit",id:"push-enable",variant:"outline",children:"Get alerts on this device"}),(0,k.jsx)("p",{className:"w-full text-[13px] text-muted-foreground",id:"push-state","aria-live":"polite"})]}),e.push.devices.length>0&&(0,k.jsx)("ul",{className:"grid gap-2",children:e.push.devices.map(n=>(0,k.jsxs)("li",{className:"flex flex-wrap items-center gap-3 text-sm",children:[(0,k.jsx)("span",{children:n.words}),n.state!=="ok"&&(0,k.jsx)(ya,{tone:n.state==="failing"?"warning":"neutral",children:n.state}),n.removable&&(0,k.jsxs)("form",{method:"post",action:"/push/remove",className:"ml-auto",children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsx)("input",{type:"hidden",name:"id",value:n.id}),(0,k.jsx)(J,{type:"submit",variant:"ghost",size:"sm",children:"Remove"})]})]},n.id))})]})]}),e.digest&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Ju,{}),(0,k.jsx)(mc,{action:"/settings/telegram-digest",csrf:t,className:"grid gap-2",children:n=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(St,{htmlFor:`${a}-digest`,children:"Telegram digest"}),(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:"Bundle routine updates. Anything that needs you still arrives at once."}),(0,k.jsxs)(Ff,{name:"every",defaultValue:e.digest.every,onValueChange:n,children:[(0,k.jsx)(qf,{id:`${a}-digest`,className:"desk:max-w-72",children:(0,k.jsx)(Hf,{})}),(0,k.jsx)(Uf,{children:[["off","Off: send each update"],["30","Every 30 minutes"],["60","Every hour"],["240","Every 4 hours"],["720","Every 12 hours"],["1440","Once a day"]].map(([o,r])=>(0,k.jsx)(Qu,{value:o,children:r},o))})]}),e.digest.held&&(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground",children:e.digest.held})]})})]})]})}function CV({view:e,csrf:t}){return(0,k.jsxs)(ec,{className:"rounded-lg border border-border bg-card",children:[(0,k.jsx)(tc,{asChild:!0,children:(0,k.jsxs)("button",{className:"group flex w-full items-center justify-between gap-3 px-5 py-4 text-left phone:px-4",children:[(0,k.jsxs)("span",{className:"font-semibold",children:["Telegram bot token ",(0,k.jsx)("span",{className:"ml-2 text-sm font-normal text-muted-foreground",children:e.telegram.state})]}),(0,k.jsx)(ra,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"})]})}),(0,k.jsxs)(ac,{className:"grid gap-3 border-t border-border px-5 py-4 phone:px-4",children:[(0,k.jsxs)("p",{className:"text-[13px] text-muted-foreground",children:["Current: ",e.telegram.current]}),e.telegram.delivery!=null&&(0,k.jsx)("p",{className:"text-[13px] text-muted-foreground","data-telegram-delivery":!0,children:e.telegram.delivery}),(0,k.jsxs)("form",{method:"post",action:"/settings/telegram-token",className:"flex flex-wrap items-end gap-3",children:[(0,k.jsx)(Er,{csrf:t}),(0,k.jsxs)("div",{className:"grid min-w-56 flex-1 gap-2",children:[(0,k.jsx)(St,{htmlFor:"telegram-token-field",children:"Token from @BotFather"}),(0,k.jsx)(ve,{id:"telegram-token-field",type:"password",name:"token",autoComplete:"off"})]}),(0,k.jsx)(J,{type:"submit",variant:"outline",children:"Save token"})]}),(0,k.jsxs)("p",{className:"text-[13px] text-muted-foreground",children:["Stored privately on this computer. Then pair your phone under ",(0,k.jsx)("a",{className:"underline underline-offset-4",href:"/settings/telegram",children:"Telegram"}),"."]})]})]})}function hE({view:e,csrf:t}){let[a]=(0,Oa.useState)(e.said);return(0,Oa.useEffect)(()=>{a&&gn(a.charAt(0).toUpperCase()+a.slice(1))},[a]),(0,k.jsxs)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 phone:gap-3",children:[(0,k.jsx)("h1",{className:"sr-only",children:"Settings"}),e.legacyWebhookWarning&&(0,k.jsxs)("p",{"data-legacy-webhooks":!0,className:"text-sm text-foreground",children:["Legacy webhooks are deprecated. Connect ",(0,k.jsx)("a",{className:"inline-flex min-h-11 items-center underline underline-offset-4 focus-visible:outline focus-visible:outline-2",href:"/settings/slack",children:"Slack"})," or ",(0,k.jsx)("a",{className:"inline-flex min-h-11 items-center underline underline-offset-4 focus-visible:outline focus-visible:outline-2",href:"/settings/discord",children:"Discord"})," in Chat settings."]}),(0,k.jsx)("nav",{"aria-label":"Settings sections",className:"grid gap-4 phone:gap-3",children:e.groups.map(n=>(0,k.jsxs)("section",{"aria-labelledby":`settings-${dE(n.title)}`,className:"grid gap-2 phone:gap-1.5",children:[(0,k.jsx)("h2",{id:`settings-${dE(n.title)}`,className:"text-sm font-semibold text-muted-foreground",children:n.title}),(0,k.jsx)("div",{className:"grid grid-cols-2 gap-2 desk:grid-cols-4 phone:gap-1.5",children:n.tiles.map(o=>(0,k.jsxs)("a",{href:o.href,className:"flex min-h-12 items-center gap-2.5 rounded-lg border border-border bg-card px-3 py-2 text-sm font-semibold phone:min-h-11 phone:gap-2 phone:px-2.5 transition-colors hover:bg-accent [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-primary",children:[o.brand===void 0?fV[o.href]:(0,k.jsx)(cE,{id:o.brand}),(0,k.jsxs)("span",{className:"grid min-w-0 gap-0.5",children:[o.label,o.status&&(0,k.jsxs)("span",{className:"flex items-center gap-1.5 text-[13px] font-normal text-muted-foreground",children:[(0,k.jsx)(Mr,{tone:o.status.tone}),o.status.words]})]})]},o.href))}),n.title==="Chat apps"&&e.phone&&(0,k.jsx)(_M,{phone:e.phone,csrf:t,dismissable:!1})]},n.title))}),(0,k.jsx)(Ar,{title:"Appearance",children:(0,k.jsx)(pV,{view:e,csrf:t})}),(0,k.jsx)(Ar,{id:"accent",title:"Accent colour",description:"The one colour that marks what needs you.",children:(0,k.jsx)(gV,{view:e,csrf:t})}),e.permission&&(0,k.jsx)(mE,{title:"Unattended permissions",description:"The starting choice for new tasks. Approved tasks keep their setting.",action:"/settings/permission-default",field:"permission-mode",value:e.permission.mode,canManage:e.permission.canManage,changed:e.permission.changed,csrf:t,options:[{value:"auto",title:"Auto",description:"Asks before risky actions."},{value:"bypassPermissions",title:"Full access",description:"Never asks and can change files anywhere on this computer. Trusted repositories only."}]}),e.quality&&(0,k.jsx)(mE,{title:"Quality mode",description:"Publishing and deploying still need their own approval.",action:"/settings/quality-default",field:"quality-mode",value:e.quality.mode,canManage:e.quality.canManage,changed:e.quality.changed,csrf:t,options:[{value:"default",title:"Default",description:"Everyday agents and the repository check."},{value:"strict",title:"Strict / release",description:"Strongest agents. Release approval stays separate."}]}),e.providers&&(0,k.jsx)(vV,{providers:e.providers,csrf:t}),e.workers&&(0,k.jsx)(yV,{workers:e.workers}),e.updates?(0,k.jsx)(bV,{updates:e.updates,csrf:t,firstResult:e.firstResult??null}):e.firstResult&&(0,k.jsx)(Ar,{title:"This installation",children:(0,k.jsx)("p",{className:"text-sm","data-first-result":!0,children:e.firstResult})}),e.email&&t&&(0,k.jsx)(xV,{email:e.email,csrf:t}),(0,k.jsx)(SV,{view:e,csrf:t}),t&&(0,k.jsx)(CV,{view:e,csrf:t})]})}var Dr=j(he(),1);var ie=j(fe(),1),kV={"/inbox":(0,ie.jsx)(Hi,{}),"/code":(0,ie.jsx)(ks,{}),"/board":(0,ie.jsx)(df,{}),"/board?view=order":(0,ie.jsx)(ff,{}),"/tasks":(0,ie.jsx)(pf,{}),"/recipes":(0,ie.jsx)(Xo,{}),"/routines":(0,ie.jsx)(qi,{}),"/workbench":(0,ie.jsx)(Yd,{})},LV={neutral:"bg-foreground",warning:"bg-warning",danger:"bg-destructive"},xE={neutral:"",warning:"text-warning",danger:"text-destructive"};function IV({tile:e}){let t=(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsxs)("p",{className:"flex min-w-0 items-baseline gap-1.5 text-[12px] leading-4",children:[(0,ie.jsx)("span",{className:"truncate font-medium text-foreground",children:e.name}),(0,ie.jsx)("span",{className:"shrink-0 text-muted-foreground",children:e.window})]}),(0,ie.jsxs)("p",{className:ee("mt-2.5 flex items-baseline tabular-nums phone:mt-1.5",e.unit==="%"?"gap-px":"gap-1"),children:[(0,ie.jsx)("span",{className:ee("text-[22px] font-semibold leading-none tracking-[-0.02em]",e.tone==="danger"&&"text-destructive"),children:e.value}),(0,ie.jsx)("span",{className:"text-[12px] text-muted-foreground",children:e.unit})]}),(0,ie.jsxs)("div",{className:"relative mt-3 h-1.5 phone:mt-2 overflow-hidden rounded-full bg-muted",role:"meter","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(Math.min(100,e.percent)),"aria-label":`${e.name} ${e.window}`,children:[(0,ie.jsx)("div",{className:ee("h-full rounded-full motion-safe:transition-[width] motion-safe:duration-500 motion-safe:ease-out",LV[e.tone]),style:{width:`${Math.min(100,Math.max(0,e.percent))}%`}}),e.marks.map(n=>(0,ie.jsx)("span",{"aria-hidden":"true",className:"absolute inset-y-0 w-0.5 bg-card",style:{left:`calc(${n}% - 1px)`}},n))]}),(0,ie.jsx)("p",{className:ee("mt-2 truncate text-[12px] leading-4 phone:mt-1.5",e.tone==="neutral"?"text-muted-foreground":xE[e.tone]),children:e.detail})]}),a="block min-w-0 rounded-[10px] border border-border bg-card px-3.5 py-3 phone:w-[152px] phone:px-3 phone:py-2.5 phone:shrink-0 phone:snap-start";return(0,ie.jsx)("li",{"data-limit":e.key,title:e.title??void 0,className:"min-w-0 phone:shrink-0",children:e.href===null?(0,ie.jsx)("div",{className:a,children:t}):(0,ie.jsx)("a",{href:e.href,className:ee(a,"transition-colors hover:border-input hover:bg-[var(--so-raised)]"),children:t})})}function gE({limits:e,id:t,className:a}){return(0,ie.jsx)("section",{"aria-label":"Usage",id:t,className:a,children:(0,ie.jsx)("ul",{className:"grid grid-cols-[repeat(auto-fill,minmax(176px,1fr))] gap-2 phone:-mx-4 phone:flex phone:snap-x phone:snap-mandatory phone:scroll-px-4 phone:overflow-x-auto phone:px-4 phone:pb-1 phone:[scrollbar-width:none]",children:e.tiles.map(n=>(0,ie.jsx)(IV,{tile:n},n.key))})})}function NV(e){let t=new Set;return e.tiles.map(a=>{let n=t.has(a.name)?a.window:a.name;return t.add(a.name),{key:a.key,text:`${n} ${Math.round(Math.max(0,a.percent))}%`,tone:a.tone}})}function RV({row:e,grouped:t}){let a="text-[12px] desk:col-start-1 desk:row-start-1 desk:justify-self-start phone:col-start-1 phone:row-start-2 phone:self-center";return e.ask===null?(0,ie.jsx)(ul,{label:e.status.label,tone:e.status.tone==="attention"?"neutral":e.status.tone,className:a}):e.chip===null&&t?(0,ie.jsx)("span",{className:ee("sr-only",a),"data-headline":e.status.label,children:e.status.label}):(0,ie.jsx)("span",{"data-ask":e.ask,...e.chip===null?{}:{"data-chip":e.chip},"data-headline":e.status.label,title:e.status.label,className:ee("inline-flex w-fit shrink-0 items-center whitespace-nowrap rounded-[5px] bg-primary px-1.5 py-px font-semibold leading-[18px] text-primary-foreground",a),children:e.chip===null?e.status.label:(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsxs)("span",{className:"sr-only",children:[e.status.label,": "]}),e.chip]})})}function iw({row:e,grouped:t=!1}){let a=e.ask!==null;return(0,ie.jsxs)("li",{"data-task":e.id,"data-work-status":e.status.token,"data-group":e.group,className:"grid grid-cols-1 gap-y-2 border-b border-border px-2 py-3 transition-colors hover:bg-[var(--so-raised)] desk:col-span-3 desk:grid-cols-subgrid desk:items-center desk:gap-x-4 phone:grid-cols-[auto_minmax(0,1fr)_auto] phone:gap-x-2 phone:gap-y-0.5 phone:py-1.5",children:[(0,ie.jsxs)("div",{className:"min-w-0 desk:col-start-2 desk:row-start-1 phone:contents",children:[(0,ie.jsx)("a",{href:e.href,className:ee("block text-[13.5px] leading-snug hover:underline hover:underline-offset-4 phone:col-[1/3] phone:row-start-1 phone:flex phone:min-h-11 phone:items-center",a?"font-semibold":"font-medium"),children:e.title}),(0,ie.jsxs)("p",{className:"mt-0.5 flex flex-wrap items-center gap-x-1.5 text-[12.5px] text-muted-foreground phone:col-[2/4] phone:row-start-2 phone:mt-0 phone:min-w-0 phone:leading-[1.35]",children:[e.project&&(0,ie.jsx)("span",{className:"text-foreground/80",children:e.project}),e.project&&(0,ie.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,ie.jsx)("span",{className:"tabular-nums",children:e.age})]}),e.detail&&(0,ie.jsx)("p",{className:ee("mt-1 text-[12.5px] phone:col-span-full phone:leading-[1.35]",e.status.label==="Failed"?"text-destructive":"text-muted-foreground"),...e.status.label==="Failed"?{"data-problem-line":""}:{},children:e.detail}),e.problem&&(0,ie.jsx)("p",{className:"mt-1 text-[12.5px] text-muted-foreground phone:col-span-full phone:leading-[1.35]",children:e.problem}),e.notes.map(n=>(0,ie.jsx)("p",{className:"mt-1 text-[12.5px] text-muted-foreground phone:col-span-full phone:leading-[1.35]",children:n},n))]}),(0,ie.jsxs)("div",{className:"flex items-center gap-3 phone:contents desk:contents",children:[(0,ie.jsx)(RV,{row:e,grouped:t}),e.action&&(0,ie.jsx)(J,{asChild:!0,variant:"outline",size:"sm",className:"desk:col-start-3 desk:row-start-1 desk:justify-self-end phone:col-start-3 phone:row-start-1 phone:self-start",children:(0,ie.jsxs)("a",{href:e.action.href,"data-primary-action":!0,children:[e.action.label,(0,ie.jsx)(Cs,{})]})})]})]})}function TV({view:e}){let t="desk:grid desk:grid-cols-[auto_minmax(0,1fr)_auto]";if(e.groups===null)return(0,ie.jsx)("ul",{className:ee(t,"border-t border-border"),children:e.rows.map(r=>(0,ie.jsx)(iw,{row:r},r.id))});let a=e.groups.map(r=>({...r,rows:e.rows.filter(s=>s.group===r.key)})).filter(r=>r.rows.length>0),n=new Set(a.map(r=>r.key)),o=e.rows.filter(r=>!n.has(r.group));return(0,ie.jsxs)("div",{className:ee(t,"flex flex-col gap-5 phone:gap-3.5 desk:gap-0"),children:[a.map((r,s)=>(0,ie.jsxs)("section",{"data-task-group":r.key,"aria-labelledby":`task-group-${r.key}`,className:"desk:contents",children:[(0,ie.jsxs)("h2",{id:`task-group-${r.key}`,className:ee("flex items-baseline gap-2 border-b border-border px-2 pb-1.5 text-[13px] font-semibold leading-5 desk:col-span-3",s>0&&"desk:mt-6"),children:[r.label,(0,ie.jsx)("span",{className:"font-mono text-[12px] font-medium tabular-nums text-muted-foreground",children:r.count})]}),(0,ie.jsx)("ul",{className:"desk:contents",children:r.rows.map(i=>(0,ie.jsx)(iw,{row:i,grouped:!0},i.id))})]},r.key)),o.length>0&&(0,ie.jsx)("ul",{className:"desk:contents",children:o.map(r=>(0,ie.jsx)(iw,{row:r},r.id))})]})}function MV({limits:e,open:t,onToggle:a,controls:n}){let o=NV(e);return(0,ie.jsxs)("button",{type:"button","aria-expanded":t,"aria-controls":n,onClick:a,"data-usage-summary":!0,className:"ml-auto inline-flex min-h-8 min-w-0 items-center gap-1.5 rounded-md px-2 text-[12.5px] text-muted-foreground transition-colors hover:bg-[var(--so-raised)] hover:text-foreground phone:hidden",children:[(0,ie.jsx)("span",{className:"sr-only",children:"Usage: "}),(0,ie.jsx)("span",{className:"truncate tabular-nums",children:o.map((r,s)=>(0,ie.jsxs)("span",{children:[s>0&&(0,ie.jsx)("span",{"aria-hidden":"true",children:" · "}),(0,ie.jsx)("span",{className:xE[r.tone],children:r.text})]},r.key))}),(0,ie.jsx)(ra,{"aria-hidden":"true",className:ee("size-3.5 shrink-0 motion-safe:transition-transform",t&&"rotate-90")})]})}function EV({label:e,className:t,children:a}){let n=(0,Dr.useRef)(null),[o,r]=(0,Dr.useState)({before:!1,after:!1});(0,Dr.useEffect)(()=>{let i=n.current;if(i===null)return;let l=()=>r(f=>{let u={before:i.scrollLeft>1,after:i.scrollLeft+i.clientWidth<i.scrollWidth-1};return u.before===f.before&&u.after===f.after?f:u});l(),i.addEventListener("scroll",l,{passive:!0});let c=typeof ResizeObserver>"u"?null:new ResizeObserver(l);return c?.observe(i),()=>{i.removeEventListener("scroll",l),c?.disconnect()}},[]);let s=o.before||o.after?`linear-gradient(to right, ${o.before?"transparent, #000 28px":"#000"}, ${o.after?"#000 calc(100% - 40px), transparent":"#000"})`:void 0;return(0,ie.jsx)("nav",{ref:n,"aria-label":e,className:ee("[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",t),"data-scrolls":o.before||o.after?o.after?"more":"end":void 0,style:s===void 0?void 0:{maskImage:s,WebkitMaskImage:s},children:a})}function vE({view:e}){let[t,a]=(0,Dr.useState)(!1),n=(0,Dr.useId)(),o=e.limits!==null&&e.limits.tiles.length>0?e.limits:null;return(0,ie.jsxs)("div",{className:"flex w-full max-w-[960px] flex-col gap-5 phone:gap-3 phone:px-0.5",children:[(0,ie.jsxs)("div",{className:"flex min-w-0 items-baseline gap-x-3 gap-y-1",children:[(0,ie.jsx)("h1",{className:"text-[22px] font-semibold leading-tight tracking-[-0.02em]",children:"Tasks"}),e.needsYou>0&&(0,ie.jsxs)("p",{className:"whitespace-nowrap text-[13px] text-muted-foreground","data-needs-you-count":!0,children:[(0,ie.jsx)("span",{className:"font-semibold tabular-nums text-foreground",children:e.needsYou})," ",e.needsYou===1?"needs":"need"," you"]}),o&&(0,ie.jsx)(MV,{limits:o,open:t,onToggle:()=>a(r=>!r),controls:n}),(0,ie.jsxs)("div",{className:ee("flex shrink-0 items-center gap-2 self-center",!o&&"ml-auto","phone:ml-auto"),children:[(0,ie.jsxs)(oc,{children:[(0,ie.jsx)(rc,{asChild:!0,children:(0,ie.jsxs)(J,{variant:"outline",size:"sm","aria-label":"Work tools",children:[(0,ie.jsx)("span",{className:"phone:hidden",children:"Work tools"}),(0,ie.jsx)(jo,{className:"phone:hidden"}),(0,ie.jsx)(Wo,{className:"desk:hidden"})]})}),(0,ie.jsx)(sc,{align:"end",children:e.tools.map(r=>(0,ie.jsx)(ic,{asChild:!0,children:(0,ie.jsxs)("a",{href:r.href,children:[kV[r.href],r.label]})},r.href))})]}),(0,ie.jsx)(J,{asChild:!0,size:"sm",className:"desk:hidden",children:(0,ie.jsxs)("a",{href:e.newTask.href,children:[(0,ie.jsx)(Xt,{}),e.newTask.label]})})]})]}),o&&t&&(0,ie.jsx)(gE,{limits:o,id:n,className:"phone:hidden"}),(0,ie.jsx)("div",{className:"flex min-w-0 items-center",children:(0,ie.jsx)(EV,{label:"Task views",className:"-mx-1 min-w-0 max-w-full overflow-x-auto px-1 phone:-mr-4 phone:max-w-none phone:pr-4",children:(0,ie.jsx)("ul",{className:"inline-flex h-8 items-center gap-0.5 rounded-lg bg-muted p-0.5 phone:h-12",children:e.tabs.map(r=>(0,ie.jsx)("li",{className:"h-full",children:(0,ie.jsxs)("a",{href:r.href,"aria-current":r.active?"page":void 0,className:ee("inline-flex h-full items-center gap-1.5 rounded-md px-2.5 text-[13px] font-medium whitespace-nowrap text-muted-foreground transition-colors hover:text-foreground",r.active&&"bg-card text-foreground shadow-[var(--so-pill-shadow)]"),children:[r.label,(0,ie.jsx)("span",{className:ee("min-w-[18px] rounded-full px-1.5 text-center font-mono text-[12px] leading-[18px] tabular-nums",r.label==="Needs you"&&r.count>0?"bg-attention text-on-attention":"text-muted-foreground"),children:r.count})]})},r.href))})})}),e.empty!==null?(0,ie.jsxs)(ba,{className:"items-start py-10",children:[(0,ie.jsx)("p",{className:"text-base text-muted-foreground",children:e.empty.text}),e.empty.action&&(0,ie.jsx)(J,{asChild:!0,variant:"outline",children:(0,ie.jsx)("a",{href:e.empty.action.href,children:e.empty.action.label})})]}):(0,ie.jsx)(TV,{view:e}),(e.pages.first||e.pages.next)&&(0,ie.jsxs)("nav",{"aria-label":"Task pages",className:"flex gap-2",children:[e.pages.first&&(0,ie.jsx)(J,{asChild:!0,variant:"outline",size:"sm",children:(0,ie.jsx)("a",{href:e.pages.first,children:"First page"})}),e.pages.next&&(0,ie.jsx)(J,{asChild:!0,variant:"outline",size:"sm",children:(0,ie.jsx)("a",{href:e.pages.next,rel:"next",children:"Next page"})})]}),o&&(0,ie.jsx)(gE,{limits:o,className:"desk:hidden"})]})}var K=j(fe()),Z=j(he());function At(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let a=0,n;a<e.length;a++)(n=At(e[a]))!==""&&(t+=(t&&" ")+n);else for(let a in e)e[a]&&(t+=(t&&" ")+a);return t}var AV={value:()=>{}};function bE(){for(var e=0,t=arguments.length,a={},n;e<t;++e){if(!(n=arguments[e]+"")||n in a||/[\s.]/.test(n))throw new Error("illegal type: "+n);a[n]=[]}return new Ug(a)}function Ug(e){this._=e}function DV(e,t){return e.trim().split(/^|\s+/).map(function(a){var n="",o=a.indexOf(".");if(o>=0&&(n=a.slice(o+1),a=a.slice(0,o)),a&&!t.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:n}})}Ug.prototype=bE.prototype={constructor:Ug,on:function(e,t){var a=this._,n=DV(e+"",a),o,r=-1,s=n.length;if(arguments.length<2){for(;++r<s;)if((o=(e=n[r]).type)&&(o=_V(a[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(o=(e=n[r]).type)a[o]=yE(a[o],e.name,t);else if(t==null)for(o in a)a[o]=yE(a[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var a in t)e[a]=t[a].slice();return new Ug(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var a=new Array(o),n=0,o,r;n<o;++n)a[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],n=0,o=r.length;n<o;++n)r[n].value.apply(t,a)},apply:function(e,t,a){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],o=0,r=n.length;o<r;++o)n[o].value.apply(t,a)}};function _V(e,t){for(var a=0,n=e.length,o;a<n;++a)if((o=e[a]).name===t)return o.value}function yE(e,t,a){for(var n=0,o=e.length;n<o;++n)if(e[n].name===t){e[n]=AV,e=e.slice(0,n).concat(e.slice(n+1));break}return a!=null&&e.push({name:t,value:a}),e}var dl=bE;var Vg="http://www.w3.org/1999/xhtml",lw={svg:"http://www.w3.org/2000/svg",xhtml:Vg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _r(e){var t=e+="",a=t.indexOf(":");return a>=0&&(t=e.slice(0,a))!=="xmlns"&&(e=e.slice(a+1)),lw.hasOwnProperty(t)?{space:lw[t],local:e}:e}function PV(e){return function(){var t=this.ownerDocument,a=this.namespaceURI;return a===Vg&&t.documentElement.namespaceURI===Vg?t.createElement(e):t.createElementNS(a,e)}}function OV(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Gg(e){var t=_r(e);return(t.local?OV:PV)(t)}function zV(){}function fl(e){return e==null?zV:function(){return this.querySelector(e)}}function wE(e){typeof e!="function"&&(e=fl(e));for(var t=this._groups,a=t.length,n=new Array(a),o=0;o<a;++o)for(var r=t[o],s=r.length,i=n[o]=new Array(s),l,c,f=0;f<s;++f)(l=r[f])&&(c=e.call(l,l.__data__,f,r))&&("__data__"in l&&(c.__data__=l.__data__),i[f]=c);return new Dt(n,this._parents)}function uw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function BV(){return[]}function Qf(e){return e==null?BV:function(){return this.querySelectorAll(e)}}function FV(e){return function(){return uw(e.apply(this,arguments))}}function SE(e){typeof e=="function"?e=FV(e):e=Qf(e);for(var t=this._groups,a=t.length,n=[],o=[],r=0;r<a;++r)for(var s=t[r],i=s.length,l,c=0;c<i;++c)(l=s[c])&&(n.push(e.call(l,l.__data__,c,s)),o.push(l));return new Dt(n,o)}function Jf(e){return function(){return this.matches(e)}}function $g(e){return function(t){return t.matches(e)}}var HV=Array.prototype.find;function qV(e){return function(){return HV.call(this.children,e)}}function UV(){return this.firstElementChild}function CE(e){return this.select(e==null?UV:qV(typeof e=="function"?e:$g(e)))}var VV=Array.prototype.filter;function GV(){return Array.from(this.children)}function $V(e){return function(){return VV.call(this.children,e)}}function kE(e){return this.selectAll(e==null?GV:$V(typeof e=="function"?e:$g(e)))}function LE(e){typeof e!="function"&&(e=Jf(e));for(var t=this._groups,a=t.length,n=new Array(a),o=0;o<a;++o)for(var r=t[o],s=r.length,i=n[o]=[],l,c=0;c<s;++c)(l=r[c])&&e.call(l,l.__data__,c,r)&&i.push(l);return new Dt(n,this._parents)}function jg(e){return new Array(e.length)}function IE(){return new Dt(this._enter||this._groups.map(jg),this._parents)}function ep(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ep.prototype={constructor:ep,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function NE(e){return function(){return e}}function jV(e,t,a,n,o,r){for(var s=0,i,l=t.length,c=r.length;s<c;++s)(i=t[s])?(i.__data__=r[s],n[s]=i):a[s]=new ep(e,r[s]);for(;s<l;++s)(i=t[s])&&(o[s]=i)}function WV(e,t,a,n,o,r,s){var i,l,c=new Map,f=t.length,u=r.length,d=new Array(f),p;for(i=0;i<f;++i)(l=t[i])&&(d[i]=p=s.call(l,l.__data__,i,t)+"",c.has(p)?o[i]=l:c.set(p,l));for(i=0;i<u;++i)p=s.call(e,r[i],i,r)+"",(l=c.get(p))?(n[i]=l,l.__data__=r[i],c.delete(p)):a[i]=new ep(e,r[i]);for(i=0;i<f;++i)(l=t[i])&&c.get(d[i])===l&&(o[i]=l)}function XV(e){return e.__data__}function RE(e,t){if(!arguments.length)return Array.from(this,XV);var a=t?WV:jV,n=this._parents,o=this._groups;typeof e!="function"&&(e=NE(e));for(var r=o.length,s=new Array(r),i=new Array(r),l=new Array(r),c=0;c<r;++c){var f=n[c],u=o[c],d=u.length,p=YV(e.call(f,f&&f.__data__,c,n)),g=p.length,v=i[c]=new Array(g),b=s[c]=new Array(g),x=l[c]=new Array(d);a(f,u,v,b,x,p,t);for(var y=0,h=0,w,S;y<g;++y)if(w=v[y]){for(y>=h&&(h=y+1);!(S=b[h])&&++h<g;);w._next=S||null}}return s=new Dt(s,n),s._enter=i,s._exit=l,s}function YV(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function TE(){return new Dt(this._exit||this._groups.map(jg),this._parents)}function ME(e,t,a){var n=this.enter(),o=this,r=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),a==null?r.remove():a(r),n&&o?n.merge(o).order():o}function EE(e){for(var t=e.selection?e.selection():e,a=this._groups,n=t._groups,o=a.length,r=n.length,s=Math.min(o,r),i=new Array(o),l=0;l<s;++l)for(var c=a[l],f=n[l],u=c.length,d=i[l]=new Array(u),p,g=0;g<u;++g)(p=c[g]||f[g])&&(d[g]=p);for(;l<o;++l)i[l]=a[l];return new Dt(i,this._parents)}function AE(){for(var e=this._groups,t=-1,a=e.length;++t<a;)for(var n=e[t],o=n.length-1,r=n[o],s;--o>=0;)(s=n[o])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function DE(e){e||(e=KV);function t(u,d){return u&&d?e(u.__data__,d.__data__):!u-!d}for(var a=this._groups,n=a.length,o=new Array(n),r=0;r<n;++r){for(var s=a[r],i=s.length,l=o[r]=new Array(i),c,f=0;f<i;++f)(c=s[f])&&(l[f]=c);l.sort(t)}return new Dt(o,this._parents).order()}function KV(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _E(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function PE(){return Array.from(this)}function OE(){for(var e=this._groups,t=0,a=e.length;t<a;++t)for(var n=e[t],o=0,r=n.length;o<r;++o){var s=n[o];if(s)return s}return null}function zE(){let e=0;for(let t of this)++e;return e}function BE(){return!this.node()}function FE(e){for(var t=this._groups,a=0,n=t.length;a<n;++a)for(var o=t[a],r=0,s=o.length,i;r<s;++r)(i=o[r])&&e.call(i,i.__data__,r,o);return this}function ZV(e){return function(){this.removeAttribute(e)}}function QV(e){return function(){this.removeAttributeNS(e.space,e.local)}}function JV(e,t){return function(){this.setAttribute(e,t)}}function eG(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function tG(e,t){return function(){var a=t.apply(this,arguments);a==null?this.removeAttribute(e):this.setAttribute(e,a)}}function aG(e,t){return function(){var a=t.apply(this,arguments);a==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,a)}}function HE(e,t){var a=_r(e);if(arguments.length<2){var n=this.node();return a.local?n.getAttributeNS(a.space,a.local):n.getAttribute(a)}return this.each((t==null?a.local?QV:ZV:typeof t=="function"?a.local?aG:tG:a.local?eG:JV)(a,t))}function Wg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function nG(e){return function(){this.style.removeProperty(e)}}function oG(e,t,a){return function(){this.style.setProperty(e,t,a)}}function rG(e,t,a){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,a)}}function qE(e,t,a){return arguments.length>1?this.each((t==null?nG:typeof t=="function"?rG:oG)(e,t,a??"")):Gs(this.node(),e)}function Gs(e,t){return e.style.getPropertyValue(t)||Wg(e).getComputedStyle(e,null).getPropertyValue(t)}function sG(e){return function(){delete this[e]}}function iG(e,t){return function(){this[e]=t}}function lG(e,t){return function(){var a=t.apply(this,arguments);a==null?delete this[e]:this[e]=a}}function UE(e,t){return arguments.length>1?this.each((t==null?sG:typeof t=="function"?lG:iG)(e,t)):this.node()[e]}function VE(e){return e.trim().split(/^|\s+/)}function cw(e){return e.classList||new GE(e)}function GE(e){this._node=e,this._names=VE(e.getAttribute("class")||"")}GE.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function $E(e,t){for(var a=cw(e),n=-1,o=t.length;++n<o;)a.add(t[n])}function jE(e,t){for(var a=cw(e),n=-1,o=t.length;++n<o;)a.remove(t[n])}function uG(e){return function(){$E(this,e)}}function cG(e){return function(){jE(this,e)}}function dG(e,t){return function(){(t.apply(this,arguments)?$E:jE)(this,e)}}function WE(e,t){var a=VE(e+"");if(arguments.length<2){for(var n=cw(this.node()),o=-1,r=a.length;++o<r;)if(!n.contains(a[o]))return!1;return!0}return this.each((typeof t=="function"?dG:t?uG:cG)(a,t))}function fG(){this.textContent=""}function pG(e){return function(){this.textContent=e}}function mG(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function XE(e){return arguments.length?this.each(e==null?fG:(typeof e=="function"?mG:pG)(e)):this.node().textContent}function hG(){this.innerHTML=""}function gG(e){return function(){this.innerHTML=e}}function xG(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function YE(e){return arguments.length?this.each(e==null?hG:(typeof e=="function"?xG:gG)(e)):this.node().innerHTML}function vG(){this.nextSibling&&this.parentNode.appendChild(this)}function KE(){return this.each(vG)}function yG(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ZE(){return this.each(yG)}function QE(e){var t=typeof e=="function"?e:Gg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function bG(){return null}function JE(e,t){var a=typeof e=="function"?e:Gg(e),n=t==null?bG:typeof t=="function"?t:fl(t);return this.select(function(){return this.insertBefore(a.apply(this,arguments),n.apply(this,arguments)||null)})}function wG(){var e=this.parentNode;e&&e.removeChild(this)}function eA(){return this.each(wG)}function SG(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function CG(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tA(e){return this.select(e?CG:SG)}function aA(e){return arguments.length?this.property("__data__",e):this.node().__data__}function kG(e){return function(t){e.call(this,t,this.__data__)}}function LG(e){return e.trim().split(/^|\s+/).map(function(t){var a="",n=t.indexOf(".");return n>=0&&(a=t.slice(n+1),t=t.slice(0,n)),{type:t,name:a}})}function IG(e){return function(){var t=this.__on;if(t){for(var a=0,n=-1,o=t.length,r;a<o;++a)r=t[a],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++n]=r;++n?t.length=n:delete this.__on}}}function NG(e,t,a){return function(){var n=this.__on,o,r=kG(t);if(n){for(var s=0,i=n.length;s<i;++s)if((o=n[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=r,o.options=a),o.value=t;return}}this.addEventListener(e.type,r,a),o={type:e.type,name:e.name,value:t,listener:r,options:a},n?n.push(o):this.__on=[o]}}function nA(e,t,a){var n=LG(e+""),o,r=n.length,s;if(arguments.length<2){var i=this.node().__on;if(i){for(var l=0,c=i.length,f;l<c;++l)for(o=0,f=i[l];o<r;++o)if((s=n[o]).type===f.type&&s.name===f.name)return f.value}return}for(i=t?NG:IG,o=0;o<r;++o)this.each(i(n[o],t,a));return this}function oA(e,t,a){var n=Wg(e),o=n.CustomEvent;typeof o=="function"?o=new o(t,a):(o=n.document.createEvent("Event"),a?(o.initEvent(t,a.bubbles,a.cancelable),o.detail=a.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function RG(e,t){return function(){return oA(this,e,t)}}function TG(e,t){return function(){return oA(this,e,t.apply(this,arguments))}}function rA(e,t){return this.each((typeof t=="function"?TG:RG)(e,t))}function*sA(){for(var e=this._groups,t=0,a=e.length;t<a;++t)for(var n=e[t],o=0,r=n.length,s;o<r;++o)(s=n[o])&&(yield s)}var dw=[null];function Dt(e,t){this._groups=e,this._parents=t}function iA(){return new Dt([[document.documentElement]],dw)}function MG(){return this}Dt.prototype=iA.prototype={constructor:Dt,select:wE,selectAll:SE,selectChild:CE,selectChildren:kE,filter:LE,data:RE,enter:IE,exit:TE,join:ME,merge:EE,selection:MG,order:AE,sort:DE,call:_E,nodes:PE,node:OE,size:zE,empty:BE,each:FE,attr:HE,style:qE,property:UE,classed:WE,text:XE,html:YE,raise:KE,lower:ZE,append:QE,insert:JE,remove:eA,clone:tA,datum:aA,on:nA,dispatch:rA,[Symbol.iterator]:sA};var Pr=iA;function la(e){return typeof e=="string"?new Dt([[document.querySelector(e)]],[document.documentElement]):new Dt([[e]],dw)}function lA(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ya(e,t){if(e=lA(e),t===void 0&&(t=e.currentTarget),t){var a=t.ownerSVGElement||t;if(a.createSVGPoint){var n=a.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}var uA={passive:!1},pl={capture:!0,passive:!1};function Xg(e){e.stopImmediatePropagation()}function $s(e){e.preventDefault(),e.stopImmediatePropagation()}function tp(e){var t=e.document.documentElement,a=la(e).on("dragstart.drag",$s,pl);"onselectstart"in t?a.on("selectstart.drag",$s,pl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ap(e,t){var a=e.document.documentElement,n=la(e).on("dragstart.drag",null);t&&(n.on("click.drag",$s,pl),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in a?n.on("selectstart.drag",null):(a.style.MozUserSelect=a.__noselect,delete a.__noselect)}var np=e=>()=>e;function op(e,{sourceEvent:t,subject:a,target:n,identifier:o,active:r,x:s,y:i,dx:l,dy:c,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:a,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:i,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:f}})}op.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function EG(e){return!e.ctrlKey&&!e.button}function AG(){return this.parentNode}function DG(e,t){return t??{x:e.x,y:e.y}}function _G(){return navigator.maxTouchPoints||"ontouchstart"in this}function Yg(){var e=EG,t=AG,a=DG,n=_G,o={},r=dl("start","drag","end"),s=0,i,l,c,f,u=0;function d(w){w.on("mousedown.drag",p).filter(n).on("touchstart.drag",b).on("touchmove.drag",x,uA).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,S){if(!(f||!e.call(this,w,S))){var C=h(this,t.call(this,w,S),w,S,"mouse");C&&(la(w.view).on("mousemove.drag",g,pl).on("mouseup.drag",v,pl),tp(w.view),Xg(w),c=!1,i=w.clientX,l=w.clientY,C("start",w))}}function g(w){if($s(w),!c){var S=w.clientX-i,C=w.clientY-l;c=S*S+C*C>u}o.mouse("drag",w)}function v(w){la(w.view).on("mousemove.drag mouseup.drag",null),ap(w.view,c),$s(w),o.mouse("end",w)}function b(w,S){if(e.call(this,w,S)){var C=w.changedTouches,I=t.call(this,w,S),L=C.length,T,M;for(T=0;T<L;++T)(M=h(this,I,w,S,C[T].identifier,C[T]))&&(Xg(w),M("start",w,C[T]))}}function x(w){var S=w.changedTouches,C=S.length,I,L;for(I=0;I<C;++I)(L=o[S[I].identifier])&&($s(w),L("drag",w,S[I]))}function y(w){var S=w.changedTouches,C=S.length,I,L;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),I=0;I<C;++I)(L=o[S[I].identifier])&&(Xg(w),L("end",w,S[I]))}function h(w,S,C,I,L,T){var M=r.copy(),O=Ya(T||C,S),H,z,N;if((N=a.call(w,new op("beforestart",{sourceEvent:C,target:d,identifier:L,active:s,x:O[0],y:O[1],dx:0,dy:0,dispatch:M}),I))!=null)return H=N.x-O[0]||0,z=N.y-O[1]||0,function _(A,D,q){var U=O,P;switch(A){case"start":o[L]=_,P=s++;break;case"end":delete o[L],--s;case"drag":O=Ya(q||D,S),P=s;break}M.call(A,w,new op(A,{sourceEvent:D,subject:N,target:d,identifier:L,active:P,x:O[0]+H,y:O[1]+z,dx:O[0]-U[0],dy:O[1]-U[1],dispatch:M}),I)}}return d.filter=function(w){return arguments.length?(e=typeof w=="function"?w:np(!!w),d):e},d.container=function(w){return arguments.length?(t=typeof w=="function"?w:np(w),d):t},d.subject=function(w){return arguments.length?(a=typeof w=="function"?w:np(w),d):a},d.touchable=function(w){return arguments.length?(n=typeof w=="function"?w:np(!!w),d):n},d.on=function(){var w=r.on.apply(r,arguments);return w===r?d:w},d.clickDistance=function(w){return arguments.length?(u=(w=+w)*w,d):Math.sqrt(u)},d}function Kg(e,t,a){e.prototype=t.prototype=a,a.constructor=e}function fw(e,t){var a=Object.create(e.prototype);for(var n in t)a[n]=t[n];return a}function ip(){}var rp=.7,Jg=1/rp,hc="\\s*([+-]?\\d+)\\s*",sp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ar="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",PG=/^#([0-9a-f]{3,8})$/,OG=new RegExp(`^rgb\\(${hc},${hc},${hc}\\)$`),zG=new RegExp(`^rgb\\(${ar},${ar},${ar}\\)$`),BG=new RegExp(`^rgba\\(${hc},${hc},${hc},${sp}\\)$`),FG=new RegExp(`^rgba\\(${ar},${ar},${ar},${sp}\\)$`),HG=new RegExp(`^hsl\\(${sp},${ar},${ar}\\)$`),qG=new RegExp(`^hsla\\(${sp},${ar},${ar},${sp}\\)$`),cA={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Kg(ip,No,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:dA,formatHex:dA,formatHex8:UG,formatHsl:VG,formatRgb:fA,toString:fA});function dA(){return this.rgb().formatHex()}function UG(){return this.rgb().formatHex8()}function VG(){return vA(this).formatHsl()}function fA(){return this.rgb().formatRgb()}function No(e){var t,a;return e=(e+"").trim().toLowerCase(),(t=PG.exec(e))?(a=t[1].length,t=parseInt(t[1],16),a===6?pA(t):a===3?new vn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):a===8?Zg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):a===4?Zg(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=OG.exec(e))?new vn(t[1],t[2],t[3],1):(t=zG.exec(e))?new vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=BG.exec(e))?Zg(t[1],t[2],t[3],t[4]):(t=FG.exec(e))?Zg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=HG.exec(e))?gA(t[1],t[2]/100,t[3]/100,1):(t=qG.exec(e))?gA(t[1],t[2]/100,t[3]/100,t[4]):cA.hasOwnProperty(e)?pA(cA[e]):e==="transparent"?new vn(NaN,NaN,NaN,0):null}function pA(e){return new vn(e>>16&255,e>>8&255,e&255,1)}function Zg(e,t,a,n){return n<=0&&(e=t=a=NaN),new vn(e,t,a,n)}function GG(e){return e instanceof ip||(e=No(e)),e?(e=e.rgb(),new vn(e.r,e.g,e.b,e.opacity)):new vn}function gc(e,t,a,n){return arguments.length===1?GG(e):new vn(e,t,a,n??1)}function vn(e,t,a,n){this.r=+e,this.g=+t,this.b=+a,this.opacity=+n}Kg(vn,gc,fw(ip,{brighter(e){return e=e==null?Jg:Math.pow(Jg,e),new vn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?rp:Math.pow(rp,e),new vn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new vn(hl(this.r),hl(this.g),hl(this.b),ex(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:mA,formatHex:mA,formatHex8:$G,formatRgb:hA,toString:hA}));function mA(){return`#${ml(this.r)}${ml(this.g)}${ml(this.b)}`}function $G(){return`#${ml(this.r)}${ml(this.g)}${ml(this.b)}${ml((isNaN(this.opacity)?1:this.opacity)*255)}`}function hA(){let e=ex(this.opacity);return`${e===1?"rgb(":"rgba("}${hl(this.r)}, ${hl(this.g)}, ${hl(this.b)}${e===1?")":`, ${e})`}`}function ex(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function hl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ml(e){return e=hl(e),(e<16?"0":"")+e.toString(16)}function gA(e,t,a,n){return n<=0?e=t=a=NaN:a<=0||a>=1?e=t=NaN:t<=0&&(e=NaN),new Io(e,t,a,n)}function vA(e){if(e instanceof Io)return new Io(e.h,e.s,e.l,e.opacity);if(e instanceof ip||(e=No(e)),!e)return new Io;if(e instanceof Io)return e;e=e.rgb();var t=e.r/255,a=e.g/255,n=e.b/255,o=Math.min(t,a,n),r=Math.max(t,a,n),s=NaN,i=r-o,l=(r+o)/2;return i?(t===r?s=(a-n)/i+(a<n)*6:a===r?s=(n-t)/i+2:s=(t-a)/i+4,i/=l<.5?r+o:2-r-o,s*=60):i=l>0&&l<1?0:s,new Io(s,i,l,e.opacity)}function yA(e,t,a,n){return arguments.length===1?vA(e):new Io(e,t,a,n??1)}function Io(e,t,a,n){this.h=+e,this.s=+t,this.l=+a,this.opacity=+n}Kg(Io,yA,fw(ip,{brighter(e){return e=e==null?Jg:Math.pow(Jg,e),new Io(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?rp:Math.pow(rp,e),new Io(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,a=this.l,n=a+(a<.5?a:1-a)*t,o=2*a-n;return new vn(pw(e>=240?e-240:e+120,o,n),pw(e,o,n),pw(e<120?e+240:e-120,o,n),this.opacity)},clamp(){return new Io(xA(this.h),Qg(this.s),Qg(this.l),ex(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=ex(this.opacity);return`${e===1?"hsl(":"hsla("}${xA(this.h)}, ${Qg(this.s)*100}%, ${Qg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function xA(e){return e=(e||0)%360,e<0?e+360:e}function Qg(e){return Math.max(0,Math.min(1,e||0))}function pw(e,t,a){return(e<60?t+(a-t)*e/60:e<180?a:e<240?t+(a-t)*(240-e)/60:t)*255}function mw(e,t,a,n,o){var r=e*e,s=r*e;return((1-3*e+3*r-s)*t+(4-6*r+3*s)*a+(1+3*e+3*r-3*s)*n+s*o)/6}function bA(e){var t=e.length-1;return function(a){var n=a<=0?a=0:a>=1?(a=1,t-1):Math.floor(a*t),o=e[n],r=e[n+1],s=n>0?e[n-1]:2*o-r,i=n<t-1?e[n+2]:2*r-o;return mw((a-n/t)*t,s,o,r,i)}}function wA(e){var t=e.length;return function(a){var n=Math.floor(((a%=1)<0?++a:a)*t),o=e[(n+t-1)%t],r=e[n%t],s=e[(n+1)%t],i=e[(n+2)%t];return mw((a-n/t)*t,o,r,s,i)}}var lp=e=>()=>e;function jG(e,t){return function(a){return e+a*t}}function WG(e,t,a){return e=Math.pow(e,a),t=Math.pow(t,a)-e,a=1/a,function(n){return Math.pow(e+n*t,a)}}function SA(e){return(e=+e)==1?tx:function(t,a){return a-t?WG(t,a,e):lp(isNaN(t)?a:t)}}function tx(e,t){var a=t-e;return a?jG(e,a):lp(isNaN(e)?t:e)}var gl=(function e(t){var a=SA(t);function n(o,r){var s=a((o=gc(o)).r,(r=gc(r)).r),i=a(o.g,r.g),l=a(o.b,r.b),c=tx(o.opacity,r.opacity);return function(f){return o.r=s(f),o.g=i(f),o.b=l(f),o.opacity=c(f),o+""}}return n.gamma=e,n})(1);function CA(e){return function(t){var a=t.length,n=new Array(a),o=new Array(a),r=new Array(a),s,i;for(s=0;s<a;++s)i=gc(t[s]),n[s]=i.r||0,o[s]=i.g||0,r[s]=i.b||0;return n=e(n),o=e(o),r=e(r),i.opacity=1,function(l){return i.r=n(l),i.g=o(l),i.b=r(l),i+""}}}var XG=CA(bA),YG=CA(wA);function kA(e,t){t||(t=[]);var a=e?Math.min(t.length,e.length):0,n=t.slice(),o;return function(r){for(o=0;o<a;++o)n[o]=e[o]*(1-r)+t[o]*r;return n}}function LA(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function IA(e,t){var a=t?t.length:0,n=e?Math.min(a,e.length):0,o=new Array(n),r=new Array(a),s;for(s=0;s<n;++s)o[s]=Or(e[s],t[s]);for(;s<a;++s)r[s]=t[s];return function(i){for(s=0;s<n;++s)r[s]=o[s](i);return r}}function NA(e,t){var a=new Date;return e=+e,t=+t,function(n){return a.setTime(e*(1-n)+t*n),a}}function Ka(e,t){return e=+e,t=+t,function(a){return e*(1-a)+t*a}}function RA(e,t){var a={},n={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?a[o]=Or(e[o],t[o]):n[o]=t[o];return function(r){for(o in a)n[o]=a[o](r);return n}}var gw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hw=new RegExp(gw.source,"g");function KG(e){return function(){return e}}function ZG(e){return function(t){return e(t)+""}}function up(e,t){var a=gw.lastIndex=hw.lastIndex=0,n,o,r,s=-1,i=[],l=[];for(e=e+"",t=t+"";(n=gw.exec(e))&&(o=hw.exec(t));)(r=o.index)>a&&(r=t.slice(a,r),i[s]?i[s]+=r:i[++s]=r),(n=n[0])===(o=o[0])?i[s]?i[s]+=o:i[++s]=o:(i[++s]=null,l.push({i:s,x:Ka(n,o)})),a=hw.lastIndex;return a<t.length&&(r=t.slice(a),i[s]?i[s]+=r:i[++s]=r),i.length<2?l[0]?ZG(l[0].x):KG(t):(t=l.length,function(c){for(var f=0,u;f<t;++f)i[(u=l[f]).i]=u.x(c);return i.join("")})}function Or(e,t){var a=typeof t,n;return t==null||a==="boolean"?lp(t):(a==="number"?Ka:a==="string"?(n=No(t))?(t=n,gl):up:t instanceof No?gl:t instanceof Date?NA:LA(t)?kA:Array.isArray(t)?IA:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?RA:Ka)(e,t)}var TA=180/Math.PI,ax={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xw(e,t,a,n,o,r){var s,i,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*a+t*n)&&(a-=e*l,n-=t*l),(i=Math.sqrt(a*a+n*n))&&(a/=i,n/=i,l/=i),e*n<t*a&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:r,rotate:Math.atan2(t,e)*TA,skewX:Math.atan(l)*TA,scaleX:s,scaleY:i}}var nx;function MA(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ax:xw(t.a,t.b,t.c,t.d,t.e,t.f)}function EA(e){return e==null?ax:(nx||(nx=document.createElementNS("http://www.w3.org/2000/svg","g")),nx.setAttribute("transform",e),(e=nx.transform.baseVal.consolidate())?(e=e.matrix,xw(e.a,e.b,e.c,e.d,e.e,e.f)):ax)}function AA(e,t,a,n){function o(c){return c.length?c.pop()+" ":""}function r(c,f,u,d,p,g){if(c!==u||f!==d){var v=p.push("translate(",null,t,null,a);g.push({i:v-4,x:Ka(c,u)},{i:v-2,x:Ka(f,d)})}else(u||d)&&p.push("translate("+u+t+d+a)}function s(c,f,u,d){c!==f?(c-f>180?f+=360:f-c>180&&(c+=360),d.push({i:u.push(o(u)+"rotate(",null,n)-2,x:Ka(c,f)})):f&&u.push(o(u)+"rotate("+f+n)}function i(c,f,u,d){c!==f?d.push({i:u.push(o(u)+"skewX(",null,n)-2,x:Ka(c,f)}):f&&u.push(o(u)+"skewX("+f+n)}function l(c,f,u,d,p,g){if(c!==u||f!==d){var v=p.push(o(p)+"scale(",null,",",null,")");g.push({i:v-4,x:Ka(c,u)},{i:v-2,x:Ka(f,d)})}else(u!==1||d!==1)&&p.push(o(p)+"scale("+u+","+d+")")}return function(c,f){var u=[],d=[];return c=e(c),f=e(f),r(c.translateX,c.translateY,f.translateX,f.translateY,u,d),s(c.rotate,f.rotate,u,d),i(c.skewX,f.skewX,u,d),l(c.scaleX,c.scaleY,f.scaleX,f.scaleY,u,d),c=f=null,function(p){for(var g=-1,v=d.length,b;++g<v;)u[(b=d[g]).i]=b.x(p);return u.join("")}}}var vw=AA(MA,"px, ","px)","deg)"),yw=AA(EA,", ",")",")");var QG=1e-12;function DA(e){return((e=Math.exp(e))+1/e)/2}function JG(e){return((e=Math.exp(e))-1/e)/2}function e$(e){return((e=Math.exp(2*e))-1)/(e+1)}var xl=(function e(t,a,n){function o(r,s){var i=r[0],l=r[1],c=r[2],f=s[0],u=s[1],d=s[2],p=f-i,g=u-l,v=p*p+g*g,b,x;if(v<QG)x=Math.log(d/c)/t,b=function(I){return[i+I*p,l+I*g,c*Math.exp(t*I*x)]};else{var y=Math.sqrt(v),h=(d*d-c*c+n*v)/(2*c*a*y),w=(d*d-c*c-n*v)/(2*d*a*y),S=Math.log(Math.sqrt(h*h+1)-h),C=Math.log(Math.sqrt(w*w+1)-w);x=(C-S)/t,b=function(I){var L=I*x,T=DA(S),M=c/(a*y)*(T*e$(t*L+S)-JG(S));return[i+M*p,l+M*g,c*T/DA(t*L+S)]}}return b.duration=x*1e3*t/Math.SQRT2,b}return o.rho=function(r){var s=Math.max(.001,+r),i=s*s,l=i*i;return e(s,i,l)},o})(Math.SQRT2,2,4);var xc=0,dp=0,cp=0,PA=1e3,ox,fp,rx=0,vl=0,sx=0,pp=typeof performance=="object"&&performance.now?performance:Date,OA=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function hp(){return vl||(OA(t$),vl=pp.now()+sx)}function t$(){vl=0}function mp(){this._call=this._time=this._next=null}mp.prototype=ix.prototype={constructor:mp,restart:function(e,t,a){if(typeof e!="function")throw new TypeError("callback is not a function");a=(a==null?hp():+a)+(t==null?0:+t),!this._next&&fp!==this&&(fp?fp._next=this:ox=this,fp=this),this._call=e,this._time=a,bw()},stop:function(){this._call&&(this._call=null,this._time=1/0,bw())}};function ix(e,t,a){var n=new mp;return n.restart(e,t,a),n}function zA(){hp(),++xc;for(var e=ox,t;e;)(t=vl-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xc}function _A(){vl=(rx=pp.now())+sx,xc=dp=0;try{zA()}finally{xc=0,n$(),vl=0}}function a$(){var e=pp.now(),t=e-rx;t>PA&&(sx-=t,rx=e)}function n$(){for(var e,t=ox,a,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(a=t._next,t._next=null,t=e?e._next=a:ox=a);fp=e,bw(n)}function bw(e){if(!xc){dp&&(dp=clearTimeout(dp));var t=e-vl;t>24?(e<1/0&&(dp=setTimeout(_A,e-pp.now()-sx)),cp&&(cp=clearInterval(cp))):(cp||(rx=pp.now(),cp=setInterval(a$,PA)),xc=1,OA(_A))}}function lx(e,t,a){var n=new mp;return t=t==null?0:+t,n.restart(o=>{n.stop(),e(o+t)},t,a),n}var o$=dl("start","end","cancel","interrupt"),r$=[],HA=0,BA=1,cx=2,ux=3,FA=4,dx=5,gp=6;function js(e,t,a,n,o,r){var s=e.__transition;if(!s)e.__transition={};else if(a in s)return;s$(e,a,{name:t,index:n,group:o,on:o$,tween:r$,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:HA})}function xp(e,t){var a=Zt(e,t);if(a.state>HA)throw new Error("too late; already scheduled");return a}function Ca(e,t){var a=Zt(e,t);if(a.state>ux)throw new Error("too late; already running");return a}function Zt(e,t){var a=e.__transition;if(!a||!(a=a[t]))throw new Error("transition not found");return a}function s$(e,t,a){var n=e.__transition,o;n[t]=a,a.timer=ix(r,0,a.time);function r(c){a.state=BA,a.timer.restart(s,a.delay,a.time),a.delay<=c&&s(c-a.delay)}function s(c){var f,u,d,p;if(a.state!==BA)return l();for(f in n)if(p=n[f],p.name===a.name){if(p.state===ux)return lx(s);p.state===FA?(p.state=gp,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete n[f]):+f<t&&(p.state=gp,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete n[f])}if(lx(function(){a.state===ux&&(a.state=FA,a.timer.restart(i,a.delay,a.time),i(c))}),a.state=cx,a.on.call("start",e,e.__data__,a.index,a.group),a.state===cx){for(a.state=ux,o=new Array(d=a.tween.length),f=0,u=-1;f<d;++f)(p=a.tween[f].value.call(e,e.__data__,a.index,a.group))&&(o[++u]=p);o.length=u+1}}function i(c){for(var f=c<a.duration?a.ease.call(null,c/a.duration):(a.timer.restart(l),a.state=dx,1),u=-1,d=o.length;++u<d;)o[u].call(e,f);a.state===dx&&(a.on.call("end",e,e.__data__,a.index,a.group),l())}function l(){a.state=gp,a.timer.stop(),delete n[t];for(var c in n)return;delete e.__transition}}function yl(e,t){var a=e.__transition,n,o,r=!0,s;if(a){t=t==null?null:t+"";for(s in a){if((n=a[s]).name!==t){r=!1;continue}o=n.state>cx&&n.state<dx,n.state=gp,n.timer.stop(),n.on.call(o?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[s]}r&&delete e.__transition}}function qA(e){return this.each(function(){yl(this,e)})}function i$(e,t){var a,n;return function(){var o=Ca(this,e),r=o.tween;if(r!==a){n=a=r;for(var s=0,i=n.length;s<i;++s)if(n[s].name===t){n=n.slice(),n.splice(s,1);break}}o.tween=n}}function l$(e,t,a){var n,o;if(typeof a!="function")throw new Error;return function(){var r=Ca(this,e),s=r.tween;if(s!==n){o=(n=s).slice();for(var i={name:t,value:a},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=i;break}l===c&&o.push(i)}r.tween=o}}function UA(e,t){var a=this._id;if(e+="",arguments.length<2){for(var n=Zt(this.node(),a).tween,o=0,r=n.length,s;o<r;++o)if((s=n[o]).name===e)return s.value;return null}return this.each((t==null?i$:l$)(a,e,t))}function vc(e,t,a){var n=e._id;return e.each(function(){var o=Ca(this,n);(o.value||(o.value={}))[t]=a.apply(this,arguments)}),function(o){return Zt(o,n).value[t]}}function fx(e,t){var a;return(typeof t=="number"?Ka:t instanceof No?gl:(a=No(t))?(t=a,gl):up)(e,t)}function u$(e){return function(){this.removeAttribute(e)}}function c$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function d$(e,t,a){var n,o=a+"",r;return function(){var s=this.getAttribute(e);return s===o?null:s===n?r:r=t(n=s,a)}}function f$(e,t,a){var n,o=a+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===n?r:r=t(n=s,a)}}function p$(e,t,a){var n,o,r;return function(){var s,i=a(this),l;return i==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=i+"",s===l?null:s===n&&l===o?r:(o=l,r=t(n=s,i)))}}function m$(e,t,a){var n,o,r;return function(){var s,i=a(this),l;return i==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=i+"",s===l?null:s===n&&l===o?r:(o=l,r=t(n=s,i)))}}function VA(e,t){var a=_r(e),n=a==="transform"?yw:fx;return this.attrTween(e,typeof t=="function"?(a.local?m$:p$)(a,n,vc(this,"attr."+e,t)):t==null?(a.local?c$:u$)(a):(a.local?f$:d$)(a,n,t))}function h$(e,t){return function(a){this.setAttribute(e,t.call(this,a))}}function g$(e,t){return function(a){this.setAttributeNS(e.space,e.local,t.call(this,a))}}function x$(e,t){var a,n;function o(){var r=t.apply(this,arguments);return r!==n&&(a=(n=r)&&g$(e,r)),a}return o._value=t,o}function v$(e,t){var a,n;function o(){var r=t.apply(this,arguments);return r!==n&&(a=(n=r)&&h$(e,r)),a}return o._value=t,o}function GA(e,t){var a="attr."+e;if(arguments.length<2)return(a=this.tween(a))&&a._value;if(t==null)return this.tween(a,null);if(typeof t!="function")throw new Error;var n=_r(e);return this.tween(a,(n.local?x$:v$)(n,t))}function y$(e,t){return function(){xp(this,e).delay=+t.apply(this,arguments)}}function b$(e,t){return t=+t,function(){xp(this,e).delay=t}}function $A(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?y$:b$)(t,e)):Zt(this.node(),t).delay}function w$(e,t){return function(){Ca(this,e).duration=+t.apply(this,arguments)}}function S$(e,t){return t=+t,function(){Ca(this,e).duration=t}}function jA(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?w$:S$)(t,e)):Zt(this.node(),t).duration}function C$(e,t){if(typeof t!="function")throw new Error;return function(){Ca(this,e).ease=t}}function WA(e){var t=this._id;return arguments.length?this.each(C$(t,e)):Zt(this.node(),t).ease}function k$(e,t){return function(){var a=t.apply(this,arguments);if(typeof a!="function")throw new Error;Ca(this,e).ease=a}}function XA(e){if(typeof e!="function")throw new Error;return this.each(k$(this._id,e))}function YA(e){typeof e!="function"&&(e=Jf(e));for(var t=this._groups,a=t.length,n=new Array(a),o=0;o<a;++o)for(var r=t[o],s=r.length,i=n[o]=[],l,c=0;c<s;++c)(l=r[c])&&e.call(l,l.__data__,c,r)&&i.push(l);return new Za(n,this._parents,this._name,this._id)}function KA(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,a=e._groups,n=t.length,o=a.length,r=Math.min(n,o),s=new Array(n),i=0;i<r;++i)for(var l=t[i],c=a[i],f=l.length,u=s[i]=new Array(f),d,p=0;p<f;++p)(d=l[p]||c[p])&&(u[p]=d);for(;i<n;++i)s[i]=t[i];return new Za(s,this._parents,this._name,this._id)}function L$(e){return(e+"").trim().split(/^|\s+/).every(function(t){var a=t.indexOf(".");return a>=0&&(t=t.slice(0,a)),!t||t==="start"})}function I$(e,t,a){var n,o,r=L$(t)?xp:Ca;return function(){var s=r(this,e),i=s.on;i!==n&&(o=(n=i).copy()).on(t,a),s.on=o}}function ZA(e,t){var a=this._id;return arguments.length<2?Zt(this.node(),a).on.on(e):this.each(I$(a,e,t))}function N$(e){return function(){var t=this.parentNode;for(var a in this.__transition)if(+a!==e)return;t&&t.removeChild(this)}}function QA(){return this.on("end.remove",N$(this._id))}function JA(e){var t=this._name,a=this._id;typeof e!="function"&&(e=fl(e));for(var n=this._groups,o=n.length,r=new Array(o),s=0;s<o;++s)for(var i=n[s],l=i.length,c=r[s]=new Array(l),f,u,d=0;d<l;++d)(f=i[d])&&(u=e.call(f,f.__data__,d,i))&&("__data__"in f&&(u.__data__=f.__data__),c[d]=u,js(c[d],t,a,d,c,Zt(f,a)));return new Za(r,this._parents,t,a)}function e6(e){var t=this._name,a=this._id;typeof e!="function"&&(e=Qf(e));for(var n=this._groups,o=n.length,r=[],s=[],i=0;i<o;++i)for(var l=n[i],c=l.length,f,u=0;u<c;++u)if(f=l[u]){for(var d=e.call(f,f.__data__,u,l),p,g=Zt(f,a),v=0,b=d.length;v<b;++v)(p=d[v])&&js(p,t,a,v,d,g);r.push(d),s.push(f)}return new Za(r,s,t,a)}var R$=Pr.prototype.constructor;function t6(){return new R$(this._groups,this._parents)}function T$(e,t){var a,n,o;return function(){var r=Gs(this,e),s=(this.style.removeProperty(e),Gs(this,e));return r===s?null:r===a&&s===n?o:o=t(a=r,n=s)}}function a6(e){return function(){this.style.removeProperty(e)}}function M$(e,t,a){var n,o=a+"",r;return function(){var s=Gs(this,e);return s===o?null:s===n?r:r=t(n=s,a)}}function E$(e,t,a){var n,o,r;return function(){var s=Gs(this,e),i=a(this),l=i+"";return i==null&&(l=i=(this.style.removeProperty(e),Gs(this,e))),s===l?null:s===n&&l===o?r:(o=l,r=t(n=s,i))}}function A$(e,t){var a,n,o,r="style."+t,s="end."+r,i;return function(){var l=Ca(this,e),c=l.on,f=l.value[r]==null?i||(i=a6(t)):void 0;(c!==a||o!==f)&&(n=(a=c).copy()).on(s,o=f),l.on=n}}function n6(e,t,a){var n=(e+="")=="transform"?vw:fx;return t==null?this.styleTween(e,T$(e,n)).on("end.style."+e,a6(e)):typeof t=="function"?this.styleTween(e,E$(e,n,vc(this,"style."+e,t))).each(A$(this._id,e)):this.styleTween(e,M$(e,n,t),a).on("end.style."+e,null)}function D$(e,t,a){return function(n){this.style.setProperty(e,t.call(this,n),a)}}function _$(e,t,a){var n,o;function r(){var s=t.apply(this,arguments);return s!==o&&(n=(o=s)&&D$(e,s,a)),n}return r._value=t,r}function o6(e,t,a){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,_$(e,t,a??""))}function P$(e){return function(){this.textContent=e}}function O$(e){return function(){var t=e(this);this.textContent=t??""}}function r6(e){return this.tween("text",typeof e=="function"?O$(vc(this,"text",e)):P$(e==null?"":e+""))}function z$(e){return function(t){this.textContent=e.call(this,t)}}function B$(e){var t,a;function n(){var o=e.apply(this,arguments);return o!==a&&(t=(a=o)&&z$(o)),t}return n._value=e,n}function s6(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,B$(e))}function i6(){for(var e=this._name,t=this._id,a=px(),n=this._groups,o=n.length,r=0;r<o;++r)for(var s=n[r],i=s.length,l,c=0;c<i;++c)if(l=s[c]){var f=Zt(l,t);js(l,e,a,c,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new Za(n,this._parents,e,a)}function l6(){var e,t,a=this,n=a._id,o=a.size();return new Promise(function(r,s){var i={value:s},l={value:function(){--o===0&&r()}};a.each(function(){var c=Ca(this,n),f=c.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(i),t._.interrupt.push(i),t._.end.push(l)),c.on=t}),o===0&&r()})}var F$=0;function Za(e,t,a,n){this._groups=e,this._parents=t,this._name=a,this._id=n}function u6(e){return Pr().transition(e)}function px(){return++F$}var zr=Pr.prototype;Za.prototype=u6.prototype={constructor:Za,select:JA,selectAll:e6,selectChild:zr.selectChild,selectChildren:zr.selectChildren,filter:YA,merge:KA,selection:t6,transition:i6,call:zr.call,nodes:zr.nodes,node:zr.node,size:zr.size,empty:zr.empty,each:zr.each,on:ZA,attr:VA,attrTween:GA,style:n6,styleTween:o6,text:r6,textTween:s6,remove:QA,tween:UA,delay:$A,duration:jA,ease:WA,easeVarying:XA,end:l6,[Symbol.iterator]:zr[Symbol.iterator]};function mx(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var H$={time:null,delay:0,duration:250,ease:mx};function q$(e,t){for(var a;!(a=e.__transition)||!(a=a[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return a}function c6(e){var t,a;e instanceof Za?(t=e._id,e=e._name):(t=px(),(a=H$).time=hp(),e=e==null?null:e+"");for(var n=this._groups,o=n.length,r=0;r<o;++r)for(var s=n[r],i=s.length,l,c=0;c<i;++c)(l=s[c])&&js(l,e,t,c,s,a||q$(l,t));return new Za(n,this._parents,e,t)}Pr.prototype.interrupt=qA;Pr.prototype.transition=c6;var vp=e=>()=>e;function ww(e,{sourceEvent:t,target:a,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function Ro(e,t,a){this.k=e,this.x=t,this.y=a}Ro.prototype={constructor:Ro,scale:function(e){return e===1?this:new Ro(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ro(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var bl=new Ro(1,0,0);yp.prototype=Ro.prototype;function yp(e){for(;!e.__zoom;)if(!(e=e.parentNode))return bl;return e.__zoom}function hx(e){e.stopImmediatePropagation()}function yc(e){e.preventDefault(),e.stopImmediatePropagation()}function U$(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function V$(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function d6(){return this.__zoom||bl}function G$(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function $$(){return navigator.maxTouchPoints||"ontouchstart"in this}function j$(e,t,a){var n=e.invertX(t[0][0])-a[0][0],o=e.invertX(t[1][0])-a[1][0],r=e.invertY(t[0][1])-a[0][1],s=e.invertY(t[1][1])-a[1][1];return e.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function gx(){var e=U$,t=V$,a=j$,n=G$,o=$$,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],i=250,l=xl,c=dl("start","zoom","end"),f,u,d,p=500,g=150,v=0,b=10;function x(N){N.property("__zoom",d6).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",M).filter(o).on("touchstart.zoom",O).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(N,_,A,D){var q=N.selection?N.selection():N;q.property("__zoom",d6),N!==q?S(N,_,A,D):q.interrupt().each(function(){C(this,arguments).event(D).start().zoom(null,typeof _=="function"?_.apply(this,arguments):_).end()})},x.scaleBy=function(N,_,A,D){x.scaleTo(N,function(){var q=this.__zoom.k,U=typeof _=="function"?_.apply(this,arguments):_;return q*U},A,D)},x.scaleTo=function(N,_,A,D){x.transform(N,function(){var q=t.apply(this,arguments),U=this.__zoom,P=A==null?w(q):typeof A=="function"?A.apply(this,arguments):A,W=U.invert(P),te=typeof _=="function"?_.apply(this,arguments):_;return a(h(y(U,te),P,W),q,s)},A,D)},x.translateBy=function(N,_,A,D){x.transform(N,function(){return a(this.__zoom.translate(typeof _=="function"?_.apply(this,arguments):_,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),s)},null,D)},x.translateTo=function(N,_,A,D,q){x.transform(N,function(){var U=t.apply(this,arguments),P=this.__zoom,W=D==null?w(U):typeof D=="function"?D.apply(this,arguments):D;return a(bl.translate(W[0],W[1]).scale(P.k).translate(typeof _=="function"?-_.apply(this,arguments):-_,typeof A=="function"?-A.apply(this,arguments):-A),U,s)},D,q)};function y(N,_){return _=Math.max(r[0],Math.min(r[1],_)),_===N.k?N:new Ro(_,N.x,N.y)}function h(N,_,A){var D=_[0]-A[0]*N.k,q=_[1]-A[1]*N.k;return D===N.x&&q===N.y?N:new Ro(N.k,D,q)}function w(N){return[(+N[0][0]+ +N[1][0])/2,(+N[0][1]+ +N[1][1])/2]}function S(N,_,A,D){N.on("start.zoom",function(){C(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(D).end()}).tween("zoom",function(){var q=this,U=arguments,P=C(q,U).event(D),W=t.apply(q,U),te=A==null?w(W):typeof A=="function"?A.apply(q,U):A,de=Math.max(W[1][0]-W[0][0],W[1][1]-W[0][1]),oe=q.__zoom,se=typeof _=="function"?_.apply(q,U):_,ue=l(oe.invert(te).concat(de/oe.k),se.invert(te).concat(de/se.k));return function(ce){if(ce===1)ce=se;else{var V=ue(ce),E=de/V[2];ce=new Ro(E,te[0]-V[0]*E,te[1]-V[1]*E)}P.zoom(null,ce)}})}function C(N,_,A){return!A&&N.__zooming||new I(N,_)}function I(N,_){this.that=N,this.args=_,this.active=0,this.sourceEvent=null,this.extent=t.apply(N,_),this.taps=0}I.prototype={event:function(N){return N&&(this.sourceEvent=N),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(N,_){return this.mouse&&N!=="mouse"&&(this.mouse[1]=_.invert(this.mouse[0])),this.touch0&&N!=="touch"&&(this.touch0[1]=_.invert(this.touch0[0])),this.touch1&&N!=="touch"&&(this.touch1[1]=_.invert(this.touch1[0])),this.that.__zoom=_,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(N){var _=la(this.that).datum();c.call(N,this.that,new ww(N,{sourceEvent:this.sourceEvent,target:x,type:N,transform:this.that.__zoom,dispatch:c}),_)}};function L(N,..._){if(!e.apply(this,arguments))return;var A=C(this,_).event(N),D=this.__zoom,q=Math.max(r[0],Math.min(r[1],D.k*Math.pow(2,n.apply(this,arguments)))),U=Ya(N);if(A.wheel)(A.mouse[0][0]!==U[0]||A.mouse[0][1]!==U[1])&&(A.mouse[1]=D.invert(A.mouse[0]=U)),clearTimeout(A.wheel);else{if(D.k===q)return;A.mouse=[U,D.invert(U)],yl(this),A.start()}yc(N),A.wheel=setTimeout(P,g),A.zoom("mouse",a(h(y(D,q),A.mouse[0],A.mouse[1]),A.extent,s));function P(){A.wheel=null,A.end()}}function T(N,..._){if(d||!e.apply(this,arguments))return;var A=N.currentTarget,D=C(this,_,!0).event(N),q=la(N.view).on("mousemove.zoom",te,!0).on("mouseup.zoom",de,!0),U=Ya(N,A),P=N.clientX,W=N.clientY;tp(N.view),hx(N),D.mouse=[U,this.__zoom.invert(U)],yl(this),D.start();function te(oe){if(yc(oe),!D.moved){var se=oe.clientX-P,ue=oe.clientY-W;D.moved=se*se+ue*ue>v}D.event(oe).zoom("mouse",a(h(D.that.__zoom,D.mouse[0]=Ya(oe,A),D.mouse[1]),D.extent,s))}function de(oe){q.on("mousemove.zoom mouseup.zoom",null),ap(oe.view,D.moved),yc(oe),D.event(oe).end()}}function M(N,..._){if(e.apply(this,arguments)){var A=this.__zoom,D=Ya(N.changedTouches?N.changedTouches[0]:N,this),q=A.invert(D),U=A.k*(N.shiftKey?.5:2),P=a(h(y(A,U),D,q),t.apply(this,_),s);yc(N),i>0?la(this).transition().duration(i).call(S,P,D,N):la(this).call(x.transform,P,D,N)}}function O(N,..._){if(e.apply(this,arguments)){var A=N.touches,D=A.length,q=C(this,_,N.changedTouches.length===D).event(N),U,P,W,te;for(hx(N),P=0;P<D;++P)W=A[P],te=Ya(W,this),te=[te,this.__zoom.invert(te),W.identifier],q.touch0?!q.touch1&&q.touch0[2]!==te[2]&&(q.touch1=te,q.taps=0):(q.touch0=te,U=!0,q.taps=1+!!f);f&&(f=clearTimeout(f)),U&&(q.taps<2&&(u=te[0],f=setTimeout(function(){f=null},p)),yl(this),q.start())}}function H(N,..._){if(this.__zooming){var A=C(this,_).event(N),D=N.changedTouches,q=D.length,U,P,W,te;for(yc(N),U=0;U<q;++U)P=D[U],W=Ya(P,this),A.touch0&&A.touch0[2]===P.identifier?A.touch0[0]=W:A.touch1&&A.touch1[2]===P.identifier&&(A.touch1[0]=W);if(P=A.that.__zoom,A.touch1){var de=A.touch0[0],oe=A.touch0[1],se=A.touch1[0],ue=A.touch1[1],ce=(ce=se[0]-de[0])*ce+(ce=se[1]-de[1])*ce,V=(V=ue[0]-oe[0])*V+(V=ue[1]-oe[1])*V;P=y(P,Math.sqrt(ce/V)),W=[(de[0]+se[0])/2,(de[1]+se[1])/2],te=[(oe[0]+ue[0])/2,(oe[1]+ue[1])/2]}else if(A.touch0)W=A.touch0[0],te=A.touch0[1];else return;A.zoom("touch",a(h(P,W,te),A.extent,s))}}function z(N,..._){if(this.__zooming){var A=C(this,_).event(N),D=N.changedTouches,q=D.length,U,P;for(hx(N),d&&clearTimeout(d),d=setTimeout(function(){d=null},p),U=0;U<q;++U)P=D[U],A.touch0&&A.touch0[2]===P.identifier?delete A.touch0:A.touch1&&A.touch1[2]===P.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(P=Ya(P,this),Math.hypot(u[0]-P[0],u[1]-P[1])<b)){var W=la(this).on("dblclick.zoom");W&&W.apply(this,arguments)}}}return x.wheelDelta=function(N){return arguments.length?(n=typeof N=="function"?N:vp(+N),x):n},x.filter=function(N){return arguments.length?(e=typeof N=="function"?N:vp(!!N),x):e},x.touchable=function(N){return arguments.length?(o=typeof N=="function"?N:vp(!!N),x):o},x.extent=function(N){return arguments.length?(t=typeof N=="function"?N:vp([[+N[0][0],+N[0][1]],[+N[1][0],+N[1][1]]]),x):t},x.scaleExtent=function(N){return arguments.length?(r[0]=+N[0],r[1]=+N[1],x):[r[0],r[1]]},x.translateExtent=function(N){return arguments.length?(s[0][0]=+N[0][0],s[1][0]=+N[1][0],s[0][1]=+N[0][1],s[1][1]=+N[1][1],x):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},x.constrain=function(N){return arguments.length?(a=N,x):a},x.duration=function(N){return arguments.length?(i=+N,x):i},x.interpolate=function(N){return arguments.length?(l=N,x):l},x.on=function(){var N=c.on.apply(c,arguments);return N===c?x:N},x.clickDistance=function(N){return arguments.length?(v=(N=+N)*N,x):Math.sqrt(v)},x.tapDistance=function(N){return arguments.length?(b=+N,x):b},x}var Pn={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:a,targetHandle:n})=>`Couldn't create edge for ${e} handle id: "${e==="source"?a:n}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Sc=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Iw=["Enter"," ","Escape"],Nw={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:a})=>`Moved selected node ${e}. New position, x: ${t}, y: ${a}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"},Ks;(function(e){e.Strict="strict",e.Loose="loose"})(Ks||(Ks={}));var Br;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Br||(Br={}));var wl;(function(e){e.Partial="partial",e.Full="full"})(wl||(wl={}));var Rw={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},nr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(nr||(nr={}));var ro;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ro||(ro={}));var we;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(we||(we={}));var f6={[we.Left]:we.Right,[we.Right]:we.Left,[we.Top]:we.Bottom,[we.Bottom]:we.Top},Tw=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,L6=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Mw=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e);var wp=(e,t=[0,0])=>{let{width:a,height:n}=so(e),o=e.origin??t,r=a*o[0],s=n*o[1];return{x:e.position.x-r,y:e.position.y-s}},Ew=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let a=!1,n=e.reduce((o,r)=>{let s=typeof r=="string",i=!t.nodeLookup&&!s?r:void 0;return t.nodeLookup&&(i=s?t.nodeLookup.get(r):Mw(r)?r:t.nodeLookup.get(r.id)),i?(a=!0,Sx(o,yx(i,t.nodeOrigin))):o},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return a?Cx(n):{x:0,y:0,width:0,height:0}},Cc=(e,t={})=>{let a={x:1/0,y:1/0,x2:-1/0,y2:-1/0},n=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(a=Sx(a,yx(o)),n=!0)}),n?Cx(a):{x:0,y:0,width:0,height:0}},bx=(e,t,[a,n,o]=[0,0,1],r=!1,s=!1)=>{let i=(t.x-a)/o,l=(t.y-n)/o,c=t.width/o,f=t.height/o,u=[];for(let d of e.values()){let{measured:p,selectable:g=!0,hidden:v=!1}=d;if(s&&!g||v)continue;let b=p.width??d.width??d.initialWidth??0,x=p.height??d.height??d.initialHeight??0,{x:y,y:h}=d.internals.positionAbsolute,w=M6(i,l,c,f,y,h,b,x),S=b*x,C=r&&w>0;(!d.internals.handleBounds||C||w>=S||d.dragging)&&u.push(d)}return u},I6=(e,t)=>{let a=new Set;return e.forEach(n=>{a.add(n.id)}),t.filter(n=>a.has(n.source)||a.has(n.target))};function W$(e,t){let a=new Map,n=t?.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{let r;if(t?.includeHiddenNodes){let{width:s,height:i}=so(o);r=s>0&&i>0}else r=!!(o.measured.width&&o.measured.height&&!o.hidden);r&&(!n||n.has(o.id))&&a.set(o.id,o)}),a}async function N6({nodes:e,width:t,height:a,panZoom:n,minZoom:o,maxZoom:r},s){if(e.size===0)return!0;let i=W$(e,s),l=Cc(i),c=Cp(l,t,a,s?.minZoom??o,s?.maxZoom??r,s?.padding??.1);return await n.setViewport(c,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0}function Aw({nodeId:e,nextPosition:t,nodeLookup:a,nodeOrigin:n=[0,0],nodeExtent:o,onError:r}){let s=a.get(e),i=s.parentId?a.get(s.parentId):void 0,{x:l,y:c}=i?i.internals.positionAbsolute:{x:0,y:0},f=s.origin??n,u=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!i)r?.("005",Pn.error005());else{let{width:p,height:g}=so(i);p&&g&&(u=[[l,c],[l+p,c+g]])}else i&&kl(s.extent)&&(u=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);let d=kl(u)?Sl(t,u,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&r?.("015",Pn.error015()),{position:{x:d.x-l+(s.measured.width??0)*f[0],y:d.y-c+(s.measured.height??0)*f[1]},positionAbsolute:d}}async function R6({nodesToRemove:e=[],edgesToRemove:t=[],nodes:a,edges:n,onBeforeDelete:o}){let r=new Set(e.map(d=>d.id)),s=[];for(let d of a){if(d.deletable===!1)continue;let p=r.has(d.id),g=!p&&d.parentId&&s.find(v=>v.id===d.parentId);(p||g)&&s.push(d)}let i=new Set(t.map(d=>d.id)),l=n.filter(d=>d.deletable!==!1),f=I6(s,l);for(let d of l)i.has(d.id)&&!f.find(g=>g.id===d.id)&&f.push(d);if(!o)return{edges:f,nodes:s};let u=await o({nodes:s,edges:f});return typeof u=="boolean"?u?{edges:f,nodes:s}:{edges:[],nodes:[]}:u}var wc=(e,t=0,a=1)=>Math.min(Math.max(e,t),a),Sl=(e={x:0,y:0},t,a)=>({x:wc(e.x,t[0][0],t[1][0]-(a?.width??0)),y:wc(e.y,t[0][1],t[1][1]-(a?.height??0))});function T6(e,t,a){let{width:n,height:o}=so(a),{x:r,y:s}=a.internals.positionAbsolute;return Sl(e,[[r,s],[r+n,s+o]],t)}var p6=(e,t,a)=>e<t?wc(Math.abs(e-t),1,t)/t:e>a?-wc(Math.abs(e-a),1,t)/t:0,wx=(e,t,a=15,n=40)=>{let o=p6(e.x,n,t.width-n)*a,r=p6(e.y,n,t.height-n)*a;return[o,r]},Sx=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Lw=({x:e,y:t,width:a,height:n})=>({x:e,y:t,x2:e+a,y2:t+n}),Cx=({x:e,y:t,x2:a,y2:n})=>({x:e,y:t,width:a-e,height:n-t}),kc=(e,t=[0,0])=>{let{x:a,y:n}=Mw(e)?e.internals.positionAbsolute:wp(e,t);return{x:a,y:n,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},yx=(e,t=[0,0])=>{let{x:a,y:n}=Mw(e)?e.internals.positionAbsolute:wp(e,t);return{x:a,y:n,x2:a+(e.measured?.width??e.width??e.initialWidth??0),y2:n+(e.measured?.height??e.height??e.initialHeight??0)}},Dw=(e,t)=>Cx(Sx(Lw(e),Lw(t))),M6=(e,t,a,n,o,r,s,i)=>{let l=Math.max(0,Math.min(e+a,o+s)-Math.max(e,o)),c=Math.max(0,Math.min(t+n,r+i)-Math.max(t,r));return Math.ceil(l*c)},Sp=(e,t)=>M6(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),_w=e=>no(e.width)&&no(e.height)&&no(e.x)&&no(e.y),no=e=>!isNaN(e)&&isFinite(e),Pw=(e,t)=>(a,n)=>{},Lc=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ic=({x:e,y:t},[a,n,o],r=!1,s=[1,1])=>{let i={x:(e-a)/o,y:(t-n)/o};return r?Lc(i,s):i},Cl=({x:e,y:t},[a,n,o])=>({x:e*o+a,y:t*o+n});function bc(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){let a=parseFloat(e);if(!Number.isNaN(a))return Math.floor(a)}if(typeof e=="string"&&e.endsWith("%")){let a=parseFloat(e);if(!Number.isNaN(a))return Math.floor(t*a*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function X$(e,t,a){if(typeof e=="string"||typeof e=="number"){let n=bc(e,a),o=bc(e,t);return{top:n,right:o,bottom:n,left:o,x:o*2,y:n*2}}if(typeof e=="object"){let n=bc(e.top??e.y??0,a),o=bc(e.bottom??e.y??0,a),r=bc(e.left??e.x??0,t),s=bc(e.right??e.x??0,t);return{top:n,right:s,bottom:o,left:r,x:r+s,y:n+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Y$(e,t,a,n,o,r){let{x:s,y:i}=Cl(e,[t,a,n]),{x:l,y:c}=Cl({x:e.x+e.width,y:e.y+e.height},[t,a,n]),f=o-l,u=r-c;return{left:Math.floor(s),top:Math.floor(i),right:Math.floor(f),bottom:Math.floor(u)}}var Cp=(e,t,a,n,o,r)=>{let s=X$(r,t,a),i=(t-s.x)/e.width,l=(a-s.y)/e.height,c=Math.min(i,l),f=wc(c,n,o),u=e.x+e.width/2,d=e.y+e.height/2,p=t/2-u*f,g=a/2-d*f,v=Y$(e,p,g,f,t,a),b={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:p-b.left+b.right,y:g-b.top+b.bottom,zoom:f}},Nc=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function kl(e){return e!=null&&e!=="parent"}function so(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Ow(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function zw(e,t={width:0,height:0},a,n,o){let r={...e},s=n.get(a);if(s){let i=s.origin||o;r.x+=s.internals.positionAbsolute.x-(t.width??0)*i[0],r.y+=s.internals.positionAbsolute.y-(t.height??0)*i[1]}return r}function Bw(e,t){if(e.size!==t.size)return!1;for(let a of e)if(!t.has(a))return!1;return!0}function E6(){let e,t;return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}}function A6(e){return{...Nw,...e||{}}}function Fw(e){return e===null?null:e?"valid":"invalid"}function bp(e,{snapGrid:t=[0,0],snapToGrid:a=!1,transform:n,containerBounds:o}){let{x:r,y:s}=oo(e),i=Ic({x:r-(o?.left??0),y:s-(o?.top??0)},n),{x:l,y:c}=a?Lc(i,t):i;return{xSnapped:l,ySnapped:c,...i}}var kx=e=>({width:e.offsetWidth,height:e.offsetHeight}),Hw=e=>e?.getRootNode?.()||window?.document,K$=["INPUT","SELECT","TEXTAREA"];function qw(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:K$.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}var Uw=e=>"clientX"in e,oo=(e,t)=>{let a=Uw(e),n=a?e.clientX:e.touches?.[0].clientX,o=a?e.clientY:e.touches?.[0].clientY;return{x:n-(t?.left??0),y:o-(t?.top??0)}},m6=(e,t,a,n,o)=>{let r=t.querySelectorAll(`.${e}`);return!r||!r.length?null:Array.from(r).map(s=>{let i=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(i.left-a.left)/n,y:(i.top-a.top)/n,...kx(s)}})};function Lx({sourceX:e,sourceY:t,targetX:a,targetY:n,sourceControlX:o,sourceControlY:r,targetControlX:s,targetControlY:i}){let l=e*.125+o*.375+s*.375+a*.125,c=t*.125+r*.375+i*.375+n*.125,f=Math.abs(l-e),u=Math.abs(c-t);return[l,c,f,u]}function xx(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function h6({pos:e,x1:t,y1:a,x2:n,y2:o,c:r}){switch(e){case we.Left:return[t-xx(t-n,r),a];case we.Right:return[t+xx(n-t,r),a];case we.Top:return[t,a-xx(a-o,r)];case we.Bottom:return[t,a+xx(o-a,r)]}}function Ix({sourceX:e,sourceY:t,sourcePosition:a=we.Bottom,targetX:n,targetY:o,targetPosition:r=we.Top,curvature:s=.25}){let[i,l]=h6({pos:a,x1:e,y1:t,x2:n,y2:o,c:s}),[c,f]=h6({pos:r,x1:n,y1:o,x2:e,y2:t,c:s}),[u,d,p,g]=Lx({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:l,targetControlX:c,targetControlY:f});return[`M${e},${t} C${i},${l} ${c},${f} ${n},${o}`,u,d,p,g]}function Vw({sourceX:e,sourceY:t,targetX:a,targetY:n}){let o=Math.abs(a-e)/2,r=a<e?a+o:a-o,s=Math.abs(n-t)/2,i=n<t?n+s:n-s;return[r,i,o,s]}function D6({sourceNode:e,targetNode:t,selected:a=!1,zIndex:n=0,elevateOnSelect:o=!1,zIndexMode:r="basic"}){if(r==="manual")return n;let s=o&&a?n+1e3:n,i=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+i}function _6({sourceNode:e,targetNode:t,width:a,height:n,transform:o}){let r=Sx(yx(e),yx(t));r.x===r.x2&&(r.x2+=1),r.y===r.y2&&(r.y2+=1);let s={x:-o[0]/o[2],y:-o[1]/o[2],width:a/o[2],height:n/o[2]};return Sp(s,Cx(r))>0}var Z$=({source:e,sourceHandle:t,target:a,targetHandle:n})=>`xy-edge__${e}${t||""}-${a}${n||""}`,Q$=(e,t)=>t.some(a=>a.source===e.source&&a.target===e.target&&(a.sourceHandle===e.sourceHandle||!a.sourceHandle&&!e.sourceHandle)&&(a.targetHandle===e.targetHandle||!a.targetHandle&&!e.targetHandle)),P6=(e,t,a={})=>{if(!e.source||!e.target)return a.onError?.("006",Pn.error006()),t;let n=a.getEdgeId||Z$,o;return Tw(e)?o={...e}:o={...e,id:n(e)},Q$(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function Nx({sourceX:e,sourceY:t,targetX:a,targetY:n}){let[o,r,s,i]=Vw({sourceX:e,sourceY:t,targetX:a,targetY:n});return[`M ${e},${t}L ${a},${n}`,o,r,s,i]}var g6={[we.Left]:{x:-1,y:0},[we.Right]:{x:1,y:0},[we.Top]:{x:0,y:-1},[we.Bottom]:{x:0,y:1}},J$=({source:e,sourcePosition:t=we.Bottom,target:a})=>t===we.Left||t===we.Right?e.x<a.x?{x:1,y:0}:{x:-1,y:0}:e.y<a.y?{x:0,y:1}:{x:0,y:-1},x6=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function ej({source:e,sourcePosition:t=we.Bottom,target:a,targetPosition:n=we.Top,center:o,offset:r,stepPosition:s}){let i=g6[t],l=g6[n],c={x:e.x+i.x*r,y:e.y+i.y*r},f={x:a.x+l.x*r,y:a.y+l.y*r},u=J$({source:c,sourcePosition:t,target:f}),d=u.x!==0?"x":"y",p=u[d],g=[],v,b,x={x:0,y:0},y={x:0,y:0},[,,h,w]=Vw({sourceX:e.x,sourceY:e.y,targetX:a.x,targetY:a.y});if(i[d]*l[d]===-1){d==="x"?(v=o.x??c.x+(f.x-c.x)*s,b=o.y??(c.y+f.y)/2):(v=o.x??(c.x+f.x)/2,b=o.y??c.y+(f.y-c.y)*s);let L=[{x:v,y:c.y},{x:v,y:f.y}],T=[{x:c.x,y:b},{x:f.x,y:b}];i[d]===p?g=d==="x"?L:T:g=d==="x"?T:L}else{let L=[{x:c.x,y:f.y}],T=[{x:f.x,y:c.y}];if(d==="x"?g=i.x===p?T:L:g=i.y===p?L:T,t===n){let N=Math.abs(e[d]-a[d]);if(N<=r){let _=Math.min(r-1,r-N);i[d]===p?x[d]=(c[d]>e[d]?-1:1)*_:y[d]=(f[d]>a[d]?-1:1)*_}}if(t!==n){let N=d==="x"?"y":"x",_=i[d]===l[N],A=c[N]>f[N],D=c[N]<f[N];(i[d]===1&&(!_&&A||_&&D)||i[d]!==1&&(!_&&D||_&&A))&&(g=d==="x"?L:T)}let M={x:c.x+x.x,y:c.y+x.y},O={x:f.x+y.x,y:f.y+y.y},H=Math.max(Math.abs(M.x-g[0].x),Math.abs(O.x-g[0].x)),z=Math.max(Math.abs(M.y-g[0].y),Math.abs(O.y-g[0].y));H>=z?(v=(M.x+O.x)/2,b=g[0].y):(v=g[0].x,b=(M.y+O.y)/2)}let S={x:c.x+x.x,y:c.y+x.y},C={x:f.x+y.x,y:f.y+y.y};return[[e,...S.x!==g[0].x||S.y!==g[0].y?[S]:[],...g,...C.x!==g[g.length-1].x||C.y!==g[g.length-1].y?[C]:[],a],v,b,h,w]}function tj(e,t,a,n){let o=Math.min(x6(e,t)/2,x6(t,a)/2,n),{x:r,y:s}=t;if(e.x===r&&r===a.x||e.y===s&&s===a.y)return`L${r} ${s}`;if(e.y===s){let c=e.x<a.x?-1:1,f=e.y<a.y?1:-1;return`L ${r+o*c},${s}Q ${r},${s} ${r},${s+o*f}`}let i=e.x<a.x?1:-1,l=e.y<a.y?-1:1;return`L ${r},${s+o*l}Q ${r},${s} ${r+o*i},${s}`}function Qs({sourceX:e,sourceY:t,sourcePosition:a=we.Bottom,targetX:n,targetY:o,targetPosition:r=we.Top,borderRadius:s=5,centerX:i,centerY:l,offset:c=20,stepPosition:f=.5}){let[u,d,p,g,v]=ej({source:{x:e,y:t},sourcePosition:a,target:{x:n,y:o},targetPosition:r,center:{x:i,y:l},offset:c,stepPosition:f}),b=`M${u[0].x} ${u[0].y}`;for(let x=1;x<u.length-1;x++)b+=tj(u[x-1],u[x],u[x+1],s);return b+=`L${u[u.length-1].x} ${u[u.length-1].y}`,[b,d,p,g,v]}function v6(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function O6(e){let{sourceNode:t,targetNode:a}=e;if(!v6(t)||!v6(a))return null;let n=t.internals.handleBounds||y6(t.handles),o=a.internals.handleBounds||y6(a.handles),r=b6(n?.source??[],e.sourceHandle),s=b6(e.connectionMode===Ks.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!r||!s)return e.onError?.("008",Pn.error008(r?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let i=r?.position||we.Bottom,l=s?.position||we.Top,c=Zs(t,r,i),f=Zs(a,s,l);return{sourceX:c.x,sourceY:c.y,targetX:f.x,targetY:f.y,sourcePosition:i,targetPosition:l}}function y6(e){if(!e)return null;let t=[],a=[];for(let n of e)n.width=n.width??1,n.height=n.height??1,n.type==="source"?t.push(n):n.type==="target"&&a.push(n);return{source:t,target:a}}function Zs(e,t,a=we.Left,n=!1){let o=(t?.x??0)+e.internals.positionAbsolute.x,r=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:i}=t??so(e);if(n)return{x:o+s/2,y:r+i/2};switch(t?.position??a){case we.Top:return{x:o+s/2,y:r};case we.Right:return{x:o+s,y:r+i/2};case we.Bottom:return{x:o+s/2,y:r+i};case we.Left:return{x:o,y:r+i/2}}}function b6(e,t){return e&&(t?e.find(a=>a.id===t):e[0])||null}function Rx(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(n=>`${n}=${e[n]}`).join("&")}`:""}function z6(e,{id:t,defaultColor:a,defaultMarkerStart:n,defaultMarkerEnd:o}){let r=new Set;return e.reduce((s,i)=>([i.markerStart||n,i.markerEnd||o].forEach(l=>{if(l&&typeof l=="object"){let c=Rx(l,t);r.has(c)||(s.push({id:c,color:l.color||a,...l}),r.add(c))}}),s),[]).sort((s,i)=>s.id.localeCompare(i.id))}var B6=1e3,aj=10,Gw={nodeOrigin:[0,0],nodeExtent:Sc,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},nj={...Gw,checkEquality:!0};function $w(e,t){let a={...e};for(let n in t)t[n]!==void 0&&(a[n]=t[n]);return a}function F6(e,t,a){let n=$w(Gw,a);for(let o of e.values())if(o.parentId)Ww(o,e,t,n);else{let r=wp(o,n.nodeOrigin),s=kl(o.extent)?o.extent:n.nodeExtent,i=Sl(r,s,so(o));o.internals.positionAbsolute=i}}function oj(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let a=[],n=[];for(let o of e.handles){let r={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?a.push(r):o.type==="target"&&n.push(r)}return{source:a,target:n}}function jw(e){return e==="manual"}function Tx(e,t,a,n={}){let o=$w(nj,n),r={i:0},s=new Map(t),i=o?.elevateNodesOnSelect&&!jw(o.zIndexMode)?B6:0,l=e.length>0,c=!1;t.clear(),a.clear();for(let f of e){let u=s.get(f.id);if(o.checkEquality&&f===u?.internals.userNode)t.set(f.id,u);else{let d=wp(f,o.nodeOrigin),p=kl(f.extent)?f.extent:o.nodeExtent,g=Sl(d,p,so(f));u={...o.defaults,...f,measured:{width:f.measured?.width,height:f.measured?.height},internals:{positionAbsolute:g,handleBounds:oj(f,u),z:H6(f,i,o.zIndexMode),userNode:f}},t.set(f.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(l=!1),f.parentId&&Ww(u,t,a,n,r),c||=f.selected??!1}return{nodesInitialized:l,hasSelectedNodes:c}}function rj(e,t){if(!e.parentId)return;let a=t.get(e.parentId);a?a.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Ww(e,t,a,n,o){let{elevateNodesOnSelect:r,nodeOrigin:s,nodeExtent:i,zIndexMode:l}=$w(Gw,n),c=e.parentId,f=t.get(c);if(!f){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}rj(e,a),o&&!f.parentId&&f.internals.rootParentIndex===void 0&&l==="auto"&&(f.internals.rootParentIndex=++o.i,f.internals.z=f.internals.z+o.i*aj),o&&f.internals.rootParentIndex!==void 0&&(o.i=f.internals.rootParentIndex);let u=r&&!jw(l)?B6:0,{x:d,y:p,z:g}=sj(e,f,s,i,u,l),{positionAbsolute:v}=e.internals,b=d!==v.x||p!==v.y;(b||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:d,y:p}:v,z:g}})}function H6(e,t,a){let n=no(e.zIndex)?e.zIndex:0;return jw(a)?n:n+(e.selected?t:0)}function sj(e,t,a,n,o,r){let{x:s,y:i}=t.internals.positionAbsolute,l=so(e),c=wp(e,a),f=kl(e.extent)?Sl(c,e.extent,l):c,u=Sl({x:s+f.x,y:i+f.y},n,l);e.extent==="parent"&&(u=T6(u,l,t));let d=H6(e,o,r),p=t.internals.z??0;return{x:u.x,y:u.y,z:p>=d?p+1:d}}function Mx(e,t,a,n=[0,0]){let o=[],r=new Map;for(let s of e){let i=t.get(s.parentId);if(!i)continue;let l=r.get(s.parentId)?.expandedRect??kc(i),c=Dw(l,s.rect);r.set(s.parentId,{expandedRect:c,parent:i})}return r.size>0&&r.forEach(({expandedRect:s,parent:i},l)=>{let c=i.internals.positionAbsolute,f=so(i),u=i.origin??n,d=s.x<c.x?Math.round(Math.abs(c.x-s.x)):0,p=s.y<c.y?Math.round(Math.abs(c.y-s.y)):0,g=Math.max(f.width,Math.round(s.width)),v=Math.max(f.height,Math.round(s.height)),b=(g-f.width)*u[0],x=(v-f.height)*u[1];(d>0||p>0||b||x)&&(o.push({id:l,type:"position",position:{x:i.position.x-d+b,y:i.position.y-p+x}}),a.get(l)?.forEach(y=>{e.some(h=>h.id===y.id)||o.push({id:y.id,type:"position",position:{x:y.position.x+d,y:y.position.y+p}})})),(f.width<s.width||f.height<s.height||d||p)&&o.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:g+(d?u[0]*d-b:0),height:v+(p?u[1]*p-x:0)}})}),o}function q6(e,t,a,n,o,r,s){let i=n?.querySelector(".xyflow__viewport"),l=!1;if(!i)return{changes:[],updatedInternals:l};let c=[],f=window.getComputedStyle(i),{m22:u}=new window.DOMMatrixReadOnly(f.transform),d=[];for(let p of e.values()){let g=t.get(p.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),l=!0;continue}let v=kx(p.nodeElement),b=g.measured.width!==v.width||g.measured.height!==v.height;if(!!(v.width&&v.height&&(b||!g.internals.handleBounds||p.force))){let y=p.nodeElement.getBoundingClientRect(),h=kl(g.extent)?g.extent:r,{positionAbsolute:w}=g.internals;if(g.parentId&&g.extent==="parent"){let C=t.get(g.parentId);C&&(w=T6(w,v,C))}else h&&(w=Sl(w,h,v));let S={...g,measured:v,internals:{...g.internals,positionAbsolute:w,handleBounds:{source:m6("source",p.nodeElement,y,u,g.id),target:m6("target",p.nodeElement,y,u,g.id)}}};t.set(g.id,S),g.parentId&&Ww(S,t,a,{nodeOrigin:o,zIndexMode:s}),l=!0,b&&(c.push({id:g.id,type:"dimensions",dimensions:v}),g.expandParent&&g.parentId&&d.push({id:g.id,parentId:g.parentId,rect:kc(S,o)}))}}if(d.length>0){let p=Mx(d,t,a,o);c.push(...p)}return{changes:c,updatedInternals:l}}async function U6({delta:e,panZoom:t,transform:a,translateExtent:n,width:o,height:r}){if(!t||!e.x&&!e.y)return!1;let s=await t.setViewportConstrained({x:a[0]+e.x,y:a[1]+e.y,zoom:a[2]},[[0,0],[o,r]],n);return!!s&&(s.x!==a[0]||s.y!==a[1]||s.k!==a[2])}function w6(e,t,a,n,o,r){let s=o,i=n.get(s)||new Map;n.set(s,i.set(a,t)),s=`${o}-${e}`;let l=n.get(s)||new Map;if(n.set(s,l.set(a,t)),r){s=`${o}-${e}-${r}`;let c=n.get(s)||new Map;n.set(s,c.set(a,t))}}function Xw(e,t,a){e.clear(),t.clear();for(let n of a){let{source:o,target:r,sourceHandle:s=null,targetHandle:i=null}=n,l={edgeId:n.id,source:o,target:r,sourceHandle:s,targetHandle:i},c=`${o}-${s}--${r}-${i}`,f=`${r}-${i}--${o}-${s}`;w6("source",l,f,e,o,s),w6("target",l,c,e,r,i),t.set(n.id,n)}}function V6(e,t){if(!e.parentId)return!1;let a=t.get(e.parentId);return a?a.selected?!0:V6(a,t):!1}function S6(e,t,a){let n=e;do{if(n?.matches?.(t))return!0;if(n===a)return!1;n=n?.parentElement}while(n);return!1}function ij(e,t,a,n){let o=new Map;for(let[r,s]of e)if((s.selected||s.id===n)&&(!s.parentId||!V6(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){let i=e.get(r);i&&o.set(r,{id:r,position:i.position||{x:0,y:0},distance:{x:a.x-i.internals.positionAbsolute.x,y:a.y-i.internals.positionAbsolute.y},extent:i.extent,parentId:i.parentId,origin:i.origin,expandParent:i.expandParent,internals:{positionAbsolute:i.internals.positionAbsolute||{x:0,y:0}},measured:{width:i.measured.width??0,height:i.measured.height??0}})}return o}function Sw({nodeId:e,dragItems:t,nodeLookup:a,dragging:n=!0}){let o=[];for(let[s,i]of t){let l=a.get(s)?.internals.userNode;l&&o.push({...l,position:i.position,dragging:n})}if(!e)return[o[0],o];let r=a.get(e)?.internals.userNode;return[r?{...r,position:t.get(e)?.position||r.position,dragging:n}:o[0],o]}function lj({dragItems:e,snapGrid:t,x:a,y:n}){let o=e.values().next().value;if(!o)return null;let r={x:a-o.distance.x,y:n-o.distance.y},s=Lc(r,t);return{x:s.x-r.x,y:s.y-r.y}}function G6({onNodeMouseDown:e,getStoreItems:t,onDragStart:a,onDrag:n,onDragStop:o}){let r={x:null,y:null},s=0,i=new Map,l=!1,c={x:0,y:0},f=null,u=!1,d=null,p=!1,g=!1,v=null;function b({noDragClassName:y,handleSelector:h,domNode:w,isSelectable:S,nodeId:C,nodeClickDistance:I=0}){d=la(w);function L({x:H,y:z}){let{nodeLookup:N,nodeExtent:_,snapGrid:A,snapToGrid:D,nodeOrigin:q,onNodeDrag:U,onSelectionDrag:P,onError:W,updateNodePositions:te}=t();r={x:H,y:z};let de=!1,oe=i.size>1,se=oe&&_?Lw(Cc(i)):null,ue=oe&&D?lj({dragItems:i,snapGrid:A,x:H,y:z}):null;for(let[ce,V]of i){if(!N.has(ce))continue;let E={x:H-V.distance.x,y:z-V.distance.y};D&&(E=ue?{x:Math.round(E.x+ue.x),y:Math.round(E.y+ue.y)}:Lc(E,A));let ne=null;if(oe&&_&&!V.extent&&se){let{positionAbsolute:G}=V.internals,re=G.x-se.x+_[0][0],Y=G.x+V.measured.width-se.x2+_[1][0],Le=G.y-se.y+_[0][1],Be=G.y+V.measured.height-se.y2+_[1][1];ne=[[re,Le],[Y,Be]]}let{position:le,positionAbsolute:F}=Aw({nodeId:ce,nextPosition:E,nodeLookup:N,nodeExtent:ne||_,nodeOrigin:q,onError:W});de=de||V.position.x!==le.x||V.position.y!==le.y,V.position=le,V.internals.positionAbsolute=F}if(g=g||de,!!de&&(te(i,!0),v&&(n||U||!C&&P))){let[ce,V]=Sw({nodeId:C,dragItems:i,nodeLookup:N});n?.(v,i,ce,V),U?.(v,ce,V),C||P?.(v,V)}}async function T(){if(!f)return;let{transform:H,panBy:z,autoPanSpeed:N,autoPanOnNodeDrag:_}=t();if(!_){l=!1,cancelAnimationFrame(s);return}let[A,D]=wx(c,f,N);(A!==0||D!==0)&&(r.x=(r.x??0)-A/H[2],r.y=(r.y??0)-D/H[2],await z({x:A,y:D})&&L(r)),s=requestAnimationFrame(T)}function M(H){let{nodeLookup:z,multiSelectionActive:N,nodesDraggable:_,transform:A,snapGrid:D,snapToGrid:q,selectNodesOnDrag:U,onNodeDragStart:P,onSelectionDragStart:W,unselectNodesAndEdges:te}=t();u=!0,(!U||!S)&&!N&&C&&(z.get(C)?.selected||te()),S&&U&&C&&e?.(C);let de=bp(H.sourceEvent,{transform:A,snapGrid:D,snapToGrid:q,containerBounds:f});if(r=de,i=ij(z,_,de,C),i.size>0&&(a||P||!C&&W)){let[oe,se]=Sw({nodeId:C,dragItems:i,nodeLookup:z});a?.(H.sourceEvent,i,oe,se),P?.(H.sourceEvent,oe,se),C||W?.(H.sourceEvent,se)}}let O=Yg().clickDistance(I).on("start",H=>{let{domNode:z,nodeDragThreshold:N,transform:_,snapGrid:A,snapToGrid:D}=t();f=z?.getBoundingClientRect()||null,p=!1,g=!1,v=H.sourceEvent,N===0&&M(H),r=bp(H.sourceEvent,{transform:_,snapGrid:A,snapToGrid:D,containerBounds:f}),c=oo(H.sourceEvent,f)}).on("drag",H=>{let{autoPanOnNodeDrag:z,transform:N,snapGrid:_,snapToGrid:A,nodeDragThreshold:D,nodeLookup:q}=t(),U=bp(H.sourceEvent,{transform:N,snapGrid:_,snapToGrid:A,containerBounds:f});if(v=H.sourceEvent,(H.sourceEvent.type==="touchmove"&&H.sourceEvent.touches.length>1||C&&!q.has(C))&&(p=!0),!p){if(!l&&z&&u&&(l=!0,T()),!u){let P=oo(H.sourceEvent,f),W=P.x-c.x,te=P.y-c.y;Math.sqrt(W*W+te*te)>D&&M(H)}(r.x!==U.xSnapped||r.y!==U.ySnapped)&&i&&u&&(c=oo(H.sourceEvent,f),L(U))}}).on("end",H=>{if(!u||p){p&&i.size>0&&t().updateNodePositions(i,!1);return}if(l=!1,u=!1,cancelAnimationFrame(s),i.size>0){let{nodeLookup:z,updateNodePositions:N,onNodeDragStop:_,onSelectionDragStop:A}=t();if(g&&(N(i,!1),g=!1),o||_||!C&&A){let[D,q]=Sw({nodeId:C,dragItems:i,nodeLookup:z,dragging:!1});o?.(H.sourceEvent,i,D,q),_?.(H.sourceEvent,D,q),C||A?.(H.sourceEvent,q)}}}).filter(H=>{let z=H.target;return!H.button&&(!y||!S6(z,`.${y}`,w))&&(!h||S6(z,h,w))});d.call(O)}function x(){d?.on(".drag",null)}return{update:b,destroy:x}}function uj(e,t,a){let n=[],o={x:e.x-a,y:e.y-a,width:a*2,height:a*2};for(let r of t.values())Sp(o,kc(r))>0&&n.push(r);return n}var cj=250;function dj(e,t,a,n){let o=[],r=1/0,s=uj(e,a,t+cj);for(let i of s){let l=[...i.internals.handleBounds?.source??[],...i.internals.handleBounds?.target??[]];for(let c of l){if(n.nodeId===c.nodeId&&n.type===c.type&&n.id===c.id)continue;let{x:f,y:u}=Zs(i,c,c.position,!0),d=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(u-e.y,2));d>t||(d<r?(o=[{...c,x:f,y:u}],r=d):d===r&&o.push({...c,x:f,y:u}))}}if(!o.length)return null;if(o.length>1){let i=n.type==="source"?"target":"source";return o.find(l=>l.type===i)??o[0]}return o[0]}function $6(e,t,a,n,o,r=!1){let s=n.get(e);if(!s)return null;let i=o==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],l=(a?i?.find(c=>c.id===a):i?.[0])??null;return l&&r?{...l,...Zs(s,l,l.position,!0)}:l}function j6(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function fj(e,t){let a=null;return t?a=!0:e&&!t&&(a=!1),a}var W6=()=>!0;function pj(e,{connectionMode:t,connectionRadius:a,handleId:n,nodeId:o,edgeUpdaterType:r,isTarget:s,domNode:i,nodeLookup:l,lib:c,autoPanOnConnect:f,flowId:u,panBy:d,cancelConnection:p,onConnectStart:g,onConnect:v,onConnectEnd:b,isValidConnection:x=W6,onReconnectEnd:y,updateConnection:h,getTransform:w,getFromHandle:S,autoPanSpeed:C,dragThreshold:I=1,handleDomNode:L}){let T=Hw(e.target),M=0,O,{x:H,y:z}=oo(e),N=j6(r,L),_=i?.getBoundingClientRect(),A=!1;if(!_||!N)return;let D=$6(o,N,n,l,t);if(!D)return;let q=oo(e,_),U=!1,P=null,W=!1,te=null;function de(){if(!f||!_)return;let[le,F]=wx(q,_,C);d({x:le,y:F}),M=requestAnimationFrame(de)}let oe={...D,nodeId:o,type:N,position:D.position},se=l.get(o),ce={inProgress:!0,isValid:null,from:Zs(se,oe,we.Left,!0),fromHandle:oe,fromPosition:oe.position,fromNode:se,to:q,toHandle:null,toPosition:f6[oe.position],toNode:null,pointer:q};function V(){A=!0,h(ce),g?.(e,{nodeId:o,handleId:n,handleType:N})}I===0&&V();function E(le){if(!A){let{x:Be,y:yt}=oo(le),rt=Be-H,Vt=yt-z;if(!(rt*rt+Vt*Vt>I*I))return;V()}if(!S()||!oe){ne(le);return}let F=w();q=oo(le,_),O=dj(Ic(q,F,!1,[1,1]),a,l,oe),U||(de(),U=!0);let G=X6(le,{handle:O,connectionMode:t,fromNodeId:o,fromHandleId:n,fromType:s?"target":"source",isValidConnection:x,doc:T,lib:c,flowId:u,nodeLookup:l});te=G.handleDomNode,P=G.connection,W=fj(!!O,G.isValid);let re=l.get(o),Y=re?Zs(re,oe,we.Left,!0):ce.from,Le={...ce,from:Y,isValid:W,to:G.toHandle&&W?Cl({x:G.toHandle.x,y:G.toHandle.y},F):q,toHandle:G.toHandle,toPosition:W&&G.toHandle?G.toHandle.position:f6[oe.position],toNode:G.toHandle?l.get(G.toHandle.nodeId):null,pointer:q};h(Le),ce=Le}function ne(le){if(!("touches"in le&&le.touches.length>0)){if(A){(O||te)&&P&&W&&v?.(P);let{inProgress:F,...G}=ce,re={...G,toPosition:ce.toHandle?ce.toPosition:null};b?.(le,re),r&&y?.(le,re)}p(),cancelAnimationFrame(M),U=!1,W=!1,P=null,te=null,T.removeEventListener("mousemove",E),T.removeEventListener("mouseup",ne),T.removeEventListener("touchmove",E),T.removeEventListener("touchend",ne)}}T.addEventListener("mousemove",E),T.addEventListener("mouseup",ne),T.addEventListener("touchmove",E),T.addEventListener("touchend",ne)}function X6(e,{handle:t,connectionMode:a,fromNodeId:n,fromHandleId:o,fromType:r,doc:s,lib:i,flowId:l,isValidConnection:c=W6,nodeLookup:f}){let u=r==="target",d=t?s.querySelector(`.${i}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:g}=oo(e),v=s.elementFromPoint(p,g),b=v?.classList.contains(`${i}-flow__handle`)?v:d,x={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){let y=j6(void 0,b),h=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),S=b.classList.contains("connectable"),C=b.classList.contains("connectableend");if(!h||!y)return x;let I={source:u?h:n,sourceHandle:u?w:o,target:u?n:h,targetHandle:u?o:w};x.connection=I;let T=S&&C&&(a===Ks.Strict?u&&y==="source"||!u&&y==="target":h!==n||w!==o);x.isValid=T&&c(I),x.toHandle=$6(h,y,w,f,a,!0)}return x}var Ex={onPointerDown:pj,isValid:X6};function Y6({domNode:e,panZoom:t,getTransform:a,getViewScale:n}){let o=la(e);function r({translateExtent:i,width:l,height:c,zoomStep:f=1,pannable:u=!0,zoomable:d=!0,inversePan:p=!1}){let g=h=>{if(h.sourceEvent.type!=="wheel"||!t)return;let w=a(),S=h.sourceEvent.ctrlKey&&Nc()?10:1,C=-h.sourceEvent.deltaY*(h.sourceEvent.deltaMode===1?.05:h.sourceEvent.deltaMode?1:.002)*f,I=w[2]*Math.pow(2,C*S);t.scaleTo(I)},v=[0,0],b=h=>{(h.sourceEvent.type==="mousedown"||h.sourceEvent.type==="touchstart")&&(v=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY])},x=h=>{let w=a();if(h.sourceEvent.type!=="mousemove"&&h.sourceEvent.type!=="touchmove"||!t)return;let S=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY],C=[S[0]-v[0],S[1]-v[1]];v=S;let I=n()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),L={x:w[0]-C[0]*I,y:w[1]-C[1]*I},T=[[0,0],[l,c]];t.setViewportConstrained({x:L.x,y:L.y,zoom:w[2]},T,i)},y=gx().on("start",b).on("zoom",u?x:null).on("zoom.wheel",d?g:null);o.call(y,{})}function s(){o.on("zoom",null)}return{update:r,destroy:s,pointer:Ya}}var Ax=e=>({x:e.x,y:e.y,zoom:e.k}),Cw=({x:e,y:t,zoom:a})=>bl.translate(e,t).scale(a),Ys=(e,t)=>e.target.closest(`.${t}`),K6=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),mj=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,kw=(e,t=0,a=mj,n=()=>{})=>{let o=typeof t=="number"&&t>0;return o||n(),o?e.transition().duration(t).ease(a).on("end",n):e},Z6=e=>{let t=e.ctrlKey&&Nc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function hj({zoomPanValues:e,noWheelClassName:t,d3Selection:a,d3Zoom:n,panOnScrollMode:o,panOnScrollSpeed:r,zoomOnPinch:s,onPanZoomStart:i,onPanZoom:l,onPanZoomEnd:c}){return f=>{if(Ys(f,t))return f.ctrlKey&&f.preventDefault(),!1;f.preventDefault(),f.stopImmediatePropagation();let u=a.property("__zoom").k||1;if(f.ctrlKey&&s){let b=Ya(f),x=Z6(f),y=u*Math.pow(2,x);n.scaleTo(a,y,b,f);return}let d=f.deltaMode===1?20:1,p=o===Br.Vertical?0:f.deltaX*d,g=o===Br.Horizontal?0:f.deltaY*d;!Nc()&&f.shiftKey&&o!==Br.Vertical&&(p=f.deltaY*d,g=0),n.translateBy(a,-(p/u)*r,-(g/u)*r,{internal:!0});let v=Ax(a.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?l?.(f,v):(e.isPanScrolling=!0,i?.(f,v)),e.panScrollTimeout=setTimeout(()=>{c?.(f,v),e.isPanScrolling=!1},150)}}function gj({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:a}){return function(n,o){let r=n.type==="wheel",s=!t&&r&&!n.ctrlKey,i=Ys(n,e);if(n.ctrlKey&&r&&i&&n.preventDefault(),s||i)return null;n.preventDefault(),a.call(this,n,o)}}function xj({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:a}){return n=>{if(n.sourceEvent?.internal)return;let o=Ax(n.transform);e.mouseButton=n.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,n.sourceEvent?.type==="mousedown"&&t(!0),a&&a?.(n.sourceEvent,o)}}function vj({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:a,onTransformChange:n,onPanZoom:o}){return r=>{e.usedRightMouseButton=!!(a&&K6(t,e.mouseButton??0)),r.sourceEvent?.sync||n([r.transform.x,r.transform.y,r.transform.k]),o&&!r.sourceEvent?.internal&&o?.(r.sourceEvent,Ax(r.transform))}}function yj({zoomPanValues:e,panOnDrag:t,panOnScroll:a,onDraggingChange:n,onPanZoomEnd:o,onPaneContextMenu:r}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,r&&K6(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&r(s.sourceEvent),e.usedRightMouseButton=!1,n(!1),o)){let i=Ax(s.transform);e.prevViewport=i,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(s.sourceEvent,i)},a?150:0)}}}function bj({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:a,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:i,noWheelClassName:l,noPanClassName:c,lib:f,connectionInProgress:u}){return d=>{let p=t||a,g=n&&d.ctrlKey,v=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Ys(d,`${f}-flow__node`)||Ys(d,`${f}-flow__edge`)||Ys(d,`${f}-flow__selection`)||Ys(d,`${f}-flow__nodesselection`)))return!0;if(!o&&!p&&!r&&!s&&!n||i||u&&!v||Ys(d,l)&&v||Ys(d,c)&&(!v||r&&v&&!t)||!n&&d.ctrlKey&&v)return!1;if(!n&&d.type==="touchstart"&&d.touches?.length>1)return d.preventDefault(),!1;if(!p&&!r&&!g&&v||!o&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(o)&&!o.includes(d.button)&&d.type==="mousedown")return!1;let b=Array.isArray(o)&&o.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||v||e)&&b}}function Q6({domNode:e,minZoom:t,maxZoom:a,translateExtent:n,viewport:o,onPanZoom:r,onPanZoomStart:s,onPanZoomEnd:i,onDraggingChange:l}){let c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),u=[[0,0],[f.width,f.height]];(typeof ResizeObserver<"u"?new ResizeObserver(z=>{let N=z[0];N&&(u=[[0,0],[N.contentRect.width,N.contentRect.height]])}):null)?.observe(e);let p=gx().extent(()=>u).scaleExtent([t,a]).translateExtent(n),g=la(e).call(p);w({x:o.x,y:o.y,zoom:wc(o.zoom,t,a)},[[0,0],[f.width,f.height]],n);let v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");p.wheelDelta(Z6);async function x(z,N){return g?new Promise(_=>{p?.interpolate(N?.interpolate==="linear"?Or:xl).transform(kw(g,N?.duration,N?.ease,()=>_(!0)),z)}):!1}function y({noWheelClassName:z,noPanClassName:N,onPaneContextMenu:_,userSelectionActive:A,panOnScroll:D,panOnDrag:q,panOnScrollMode:U,panOnScrollSpeed:P,preventScrolling:W,zoomOnPinch:te,zoomOnScroll:de,zoomOnDoubleClick:oe,panActivationKeyPressed:se=!1,zoomActivationKeyPressed:ue,lib:ce,onTransformChange:V,connectionInProgress:E,paneClickDistance:ne,selectionOnDrag:le}){A&&!c.isZoomingOrPanning&&h();let F=D&&!ue&&!A;p.clickDistance(le?1/0:!no(ne)||ne<0?0:ne);let G=F?hj({zoomPanValues:c,noWheelClassName:z,d3Selection:g,d3Zoom:p,panOnScrollMode:U,panOnScrollSpeed:P,zoomOnPinch:te,onPanZoomStart:s,onPanZoom:r,onPanZoomEnd:i}):gj({noWheelClassName:z,preventScrolling:W,d3ZoomHandler:v});g.on("wheel.zoom",G,{passive:!1});let re=xj({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:s});p.on("start",re);let Y=vj({zoomPanValues:c,panOnDrag:q,onPaneContextMenu:!!_,onPanZoom:r,onTransformChange:V});p.on("zoom",Y);let Le=yj({zoomPanValues:c,panOnDrag:q,panOnScroll:D,onPaneContextMenu:_,onPanZoomEnd:i,onDraggingChange:l});p.on("end",Le);let Be=bj({panActivationKeyPressed:se,zoomActivationKeyPressed:ue,panOnDrag:q,zoomOnScroll:de,panOnScroll:D,zoomOnDoubleClick:oe,zoomOnPinch:te,userSelectionActive:A,noPanClassName:N,noWheelClassName:z,lib:ce,connectionInProgress:E});p.filter(Be),oe?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function h(){p.on("zoom",null)}async function w(z,N,_){let A=Cw(z),D=p?.constrain()(A,N,_);return D&&await x(D),D}async function S(z,N){let _=Cw(z);return await x(_,N),_}function C(z){if(g){let N=Cw(z),_=g.property("__zoom");(_.k!==z.zoom||_.x!==z.x||_.y!==z.y)&&p?.transform(g,N,null,{sync:!0})}}function I(){let z=g?yp(g.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}async function L(z,N){return g?new Promise(_=>{p?.interpolate(N?.interpolate==="linear"?Or:xl).scaleTo(kw(g,N?.duration,N?.ease,()=>_(!0)),z)}):!1}async function T(z,N){return g?new Promise(_=>{p?.interpolate(N?.interpolate==="linear"?Or:xl).scaleBy(kw(g,N?.duration,N?.ease,()=>_(!0)),z)}):!1}function M(z){p?.scaleExtent(z)}function O(z){p?.translateExtent(z)}function H(z){let N=!no(z)||z<0?0:z;p?.clickDistance(N)}return{update:y,destroy:h,setViewport:S,setViewportConstrained:w,getViewport:I,scaleTo:L,scaleBy:T,setScaleExtent:M,setTranslateExtent:O,syncViewport:C,setClickDistance:H}}var Fr;(function(e){e.Line="line",e.Handle="handle"})(Fr||(Fr={}));var J6=["top-left","top-right","bottom-left","bottom-right"],eD=["top","right","bottom","left"];function wj({width:e,prevWidth:t,height:a,prevHeight:n,affectsX:o,affectsY:r}){let s=e-t,i=a-n,l=[s>0?1:s<0?-1:0,i>0?1:i<0?-1:0];return s&&o&&(l[0]=l[0]*-1),i&&r&&(l[1]=l[1]*-1),l}function C6(e){let t=e.includes("right")||e.includes("left"),a=e.includes("bottom")||e.includes("top"),n=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:a,affectsX:n,affectsY:o}}function Ws(e,t){return Math.max(0,t-e)}function Xs(e,t){return Math.max(0,e-t)}function vx(e,t,a){return Math.max(0,t-e,e-a)}function k6(e,t){return e?!t:t}function Sj(e,t,a,n,o,r,s,i){let{affectsX:l,affectsY:c}=t,{isHorizontal:f,isVertical:u}=t,d=f&&u,{xSnapped:p,ySnapped:g}=a,{minWidth:v,maxWidth:b,minHeight:x,maxHeight:y}=n,{x:h,y:w,width:S,height:C,aspectRatio:I}=e,L=Math.floor(f?p-e.pointerX:0),T=Math.floor(u?g-e.pointerY:0),M=S+(l?-L:L),O=C+(c?-T:T),H=-r[0]*S,z=-r[1]*C,N=vx(M,v,b),_=vx(O,x,y);if(s){let q=0,U=0;l&&L<0?q=Ws(h+L+H,s[0][0]):!l&&L>0&&(q=Xs(h+M+H,s[1][0])),c&&T<0?U=Ws(w+T+z,s[0][1]):!c&&T>0&&(U=Xs(w+O+z,s[1][1])),N=Math.max(N,q),_=Math.max(_,U)}if(i){let q=0,U=0;l&&L>0?q=Xs(h+L,i[0][0]):!l&&L<0&&(q=Ws(h+M,i[1][0])),c&&T>0?U=Xs(w+T,i[0][1]):!c&&T<0&&(U=Ws(w+O,i[1][1])),N=Math.max(N,q),_=Math.max(_,U)}if(o){if(f){let q=vx(M/I,x,y)*I;if(N=Math.max(N,q),s){let U=0;!l&&!c||l&&!c&&d?U=Xs(w+z+M/I,s[1][1])*I:U=Ws(w+z+(l?L:-L)/I,s[0][1])*I,N=Math.max(N,U)}if(i){let U=0;!l&&!c||l&&!c&&d?U=Ws(w+M/I,i[1][1])*I:U=Xs(w+(l?L:-L)/I,i[0][1])*I,N=Math.max(N,U)}}if(u){let q=vx(O*I,v,b)/I;if(_=Math.max(_,q),s){let U=0;!l&&!c||c&&!l&&d?U=Xs(h+O*I+H,s[1][0])/I:U=Ws(h+(c?T:-T)*I+H,s[0][0])/I,_=Math.max(_,U)}if(i){let U=0;!l&&!c||c&&!l&&d?U=Ws(h+O*I,i[1][0])/I:U=Xs(h+(c?T:-T)*I,i[0][0])/I,_=Math.max(_,U)}}}T=T+(T<0?_:-_),L=L+(L<0?N:-N),o&&(d?M>O*I?T=(k6(l,c)?-L:L)/I:L=(k6(l,c)?-T:T)*I:f?(T=L/I,c=l):(L=T*I,l=c));let A=l?h+L:h,D=c?w+T:w;return{width:S+(l?-L:L),height:C+(c?-T:T),x:r[0]*L*(l?-1:1)+A,y:r[1]*T*(c?-1:1)+D}}var tD={width:0,height:0,x:0,y:0},Cj={...tD,pointerX:0,pointerY:0,aspectRatio:1};function kj(e,t,a){let n=t.position.x+e.position.x,o=t.position.y+e.position.y,r=e.measured.width??0,s=e.measured.height??0,i=a[0]*r,l=a[1]*s;return[[n-i,o-l],[n+r-i,o+s-l]]}function aD({domNode:e,nodeId:t,getStoreItems:a,onChange:n,onEnd:o}){let r=la(e),s={controlDirection:C6("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function i({controlPosition:c,boundaries:f,keepAspectRatio:u,resizeDirection:d,onResizeStart:p,onResize:g,onResizeEnd:v,shouldResize:b}){let x={...tD},y={...Cj};s={boundaries:f,resizeDirection:d,keepAspectRatio:u,controlDirection:C6(c)};let h,w=null,S=[],C,I,L,T=Yg().on("start",M=>{let{nodeLookup:O,transform:H,snapGrid:z,snapToGrid:N,nodeOrigin:_,paneDomNode:A}=a();if(h=O.get(t),!h)return;w=A?.getBoundingClientRect()??null;let{xSnapped:D,ySnapped:q}=bp(M.sourceEvent,{transform:H,snapGrid:z,snapToGrid:N,containerBounds:w});x={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},y={...x,pointerX:D,pointerY:q,aspectRatio:x.width/x.height},C=void 0,I=kl(h.extent)?h.extent:void 0,h.parentId&&(h.extent==="parent"||h.expandParent)&&(C=O.get(h.parentId)),C&&h.extent==="parent"&&(I=[[0,0],[C.measured.width,C.measured.height]]),S=[],L=void 0;for(let[U,P]of O)if(P.parentId===t&&(S.push({id:U,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){let W=kj(P,h,P.origin??_);L?L=[[Math.min(W[0][0],L[0][0]),Math.min(W[0][1],L[0][1])],[Math.max(W[1][0],L[1][0]),Math.max(W[1][1],L[1][1])]]:L=W}p?.(M,{...x})}).on("drag",M=>{let{transform:O,snapGrid:H,snapToGrid:z,nodeOrigin:N}=a(),_=bp(M.sourceEvent,{transform:O,snapGrid:H,snapToGrid:z,containerBounds:w}),A=[];if(!h)return;let{x:D,y:q,width:U,height:P}=x,W={},te=h.origin??N,{width:de,height:oe,x:se,y:ue}=Sj(y,s.controlDirection,_,s.boundaries,s.keepAspectRatio,te,I,L),ce=de!==U,V=oe!==P,E=se!==D&&ce,ne=ue!==q&&V;if(!E&&!ne&&!ce&&!V)return;let le={prevValues:{...x},startX:y.x,startY:y.y,childNodes:S.map(Y=>({...Y,position:{...Y.position}}))};if((E||ne||te[0]===1||te[1]===1)&&(W.x=E?se:x.x,W.y=ne?ue:x.y,x.x=W.x,x.y=W.y,S.length>0)){let Y=se-D,Le=ue-q;for(let Be of S)Be.position={x:Be.position.x-Y+te[0]*(de-U),y:Be.position.y-Le+te[1]*(oe-P)},A.push(Be)}if((ce||V)&&(W.width=ce&&(!s.resizeDirection||s.resizeDirection==="horizontal")?de:x.width,W.height=V&&(!s.resizeDirection||s.resizeDirection==="vertical")?oe:x.height,x.width=W.width,x.height=W.height),C&&h.expandParent){let Y=te[0]*(W.width??0);W.x&&W.x<Y&&(x.x=Y,y.x=y.x-(W.x-Y));let Le=te[1]*(W.height??0);W.y&&W.y<Le&&(x.y=Le,y.y=y.y-(W.y-Le))}let F=wj({width:x.width,prevWidth:U,height:x.height,prevHeight:P,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),G={...x,direction:F};if(b?.(M,G)===!1){x=le.prevValues,y.x=le.startX,y.y=le.startY,S.forEach((Y,Le)=>{Y.position=le.childNodes[Le].position});return}g?.(M,G),n(W,A)}).on("end",M=>{v?.(M,{...x}),o?.({...x})});r.call(T)}function l(){r.on(".drag",null)}return{update:i,destroy:l}}var mD=j(he(),1),hD=j(cD(),1);var dD=e=>{let t,a=new Set,n=(f,u)=>{let d=typeof f=="function"?f(t):f;if(!Object.is(d,t)){let p=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),a.forEach(g=>g(t,p))}},o=()=>t,l={setState:n,getState:o,getInitialState:()=>c,subscribe:f=>(a.add(f),()=>a.delete(f)),destroy:()=>{(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),a.clear()}},c=t=e(n,o,l);return l},fD=e=>e?dD(e):dD;var{useDebugValue:Uj}=mD.default,{useSyncExternalStoreWithSelector:Vj}=hD.default,Gj=e=>e;function Kw(e,t=Gj,a){let n=Vj(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,a);return Uj(n),n}var pD=(e,t)=>{let a=fD(e),n=(o,r=t)=>Kw(a,o,r);return Object.assign(n,a),n},gD=(e,t)=>e?pD(e,t):pD;function kt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,o]of e)if(!Object.is(o,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let a=Object.keys(e);if(a.length!==Object.keys(t).length)return!1;for(let n of a)if(!Object.prototype.hasOwnProperty.call(t,n)||!Object.is(e[n],t[n]))return!1;return!0}var GD=j(Gr()),zx=(0,Z.createContext)(null),$j=zx.Provider,$D=Pn.error001("react");function $e(e,t){let a=(0,Z.useContext)(zx);if(a===null)throw new Error($D);return Kw(a,e,t)}function vt(){let e=(0,Z.useContext)(zx);if(e===null)throw new Error($D);return(0,Z.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var xD={display:"none"},jj={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},jD="react-flow__node-desc",WD="react-flow__edge-desc",Wj="react-flow__aria-live",Xj=e=>e.ariaLiveMessage,Yj=e=>e.ariaLabelConfig;function Kj({rfId:e}){let t=$e(Xj);return(0,K.jsx)("div",{id:`${Wj}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:jj,children:t})}function Zj({rfId:e,disableKeyboardA11y:t}){let a=$e(Yj);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)("div",{id:`${jD}-${e}`,style:xD,children:t?a["node.a11yDescription.default"]:a["node.a11yDescription.keyboardDisabled"]}),(0,K.jsx)("div",{id:`${WD}-${e}`,style:xD,children:a["edge.a11yDescription.default"]}),!t&&(0,K.jsx)(Kj,{rfId:e})]})}var Bx=(0,Z.forwardRef)(({position:e="top-left",children:t,className:a,style:n,...o},r)=>{let s=`${e}`.split("-");return(0,K.jsx)("div",{className:At(["react-flow__panel",a,...s]),style:n,ref:r,...o,children:t})});Bx.displayName="Panel";var vD="https://reactflow.dev?utm_source=attribution";function Qj({proOptions:e,position:t="bottom-right"}){return(0,Z.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,K.jsx)(Bx,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${vD}`,children:(0,K.jsx)("a",{href:vD,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var Jj=e=>{let t=[],a=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,n]of e.edgeLookup)n.selected&&a.push(n);return{selectedNodes:t,selectedEdges:a}},_x=e=>e.id;function eW(e,t){return kt(e.selectedNodes.map(_x),t.selectedNodes.map(_x))&&kt(e.selectedEdges.map(_x),t.selectedEdges.map(_x))}function tW({onSelectionChange:e}){let t=vt(),{selectedNodes:a,selectedEdges:n}=$e(Jj,eW);return(0,Z.useEffect)(()=>{let o={nodes:a,edges:n};e?.(o),t.getState().onSelectionChangeHandlers.forEach(r=>r(o))},[a,n,e]),null}var aW=e=>!!e.onSelectionChangeHandlers;function nW({onSelectionChange:e}){let t=$e(aW);return e||t?(0,K.jsx)(tW,{onSelectionChange:e}):null}var XD=[0,0],oW={x:0,y:0,zoom:1},rW=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],yD=[...rW,"rfId"],sW=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),bD={translateExtent:Sc,nodeOrigin:XD,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function iW(e){let{setNodes:t,setEdges:a,setMinZoom:n,setMaxZoom:o,setTranslateExtent:r,setNodeExtent:s,reset:i,setDefaultNodesAndEdges:l}=$e(sW,kt),c=vt();(0,Z.useEffect)(()=>(l(e.defaultNodes,e.defaultEdges),()=>{f.current=bD,i()}),[]);let f=(0,Z.useRef)(bD);return(0,Z.useEffect)(()=>{for(let u of yD){let d=e[u],p=f.current[u];d!==p&&(typeof e[u]>"u"||(u==="nodes"?t(d):u==="edges"?a(d):u==="minZoom"?n(d):u==="maxZoom"?o(d):u==="translateExtent"?r(d):u==="nodeExtent"?s(d):u==="ariaLabelConfig"?c.setState({ariaLabelConfig:A6(d)}):u==="fitView"?c.setState({fitViewQueued:d}):u==="fitViewOptions"?c.setState({fitViewOptions:d}):c.setState({[u]:d})))}f.current=e},yD.map(u=>e[u])),null}function wD(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function lW(e){let[t,a]=(0,Z.useState)(e==="system"?null:e);return(0,Z.useEffect)(()=>{if(e!=="system"){a(e);return}let n=wD(),o=()=>a(n?.matches?"dark":"light");return o(),n?.addEventListener("change",o),()=>{n?.removeEventListener("change",o)}},[e]),t!==null?t:wD()?.matches?"dark":"light"}var SD=typeof document<"u"?document:null;function kp(e=null,t={target:SD,actInsideInputWithModifier:!0}){let[a,n]=(0,Z.useState)(!1),o=(0,Z.useRef)(!1),r=(0,Z.useRef)(new Set([])),[s,i]=(0,Z.useMemo)(()=>{if(e!==null){let c=(Array.isArray(e)?e:[e]).filter(u=>typeof u=="string").map(u=>u.replace(/\+/g,`
54
54
  `).replace(`
55
55
 
56
56
  `,`