@collective-intelligence/ui-react 0.1.1 → 0.1.3

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/README.md +3 -1
  2. package/dist/components/icons/index.js +1 -1
  3. package/dist/components/illustrations/index.d.ts +8 -8
  4. package/dist/components/illustrations/index.js +1 -1
  5. package/dist/components/ui/index.js +20 -1
  6. package/dist/components/ui-extensions/atoms/ThemeToggle/index.js +1 -1
  7. package/dist/components/ui-extensions/hooks/use-mobile.js +1 -1
  8. package/dist/components/ui-extensions/index.d.ts +12 -0
  9. package/dist/components/ui-extensions/index.js +6 -6
  10. package/dist/hooks/index.js +1 -1
  11. package/dist/hooks/operations.js +1 -1
  12. package/dist/hooks/use-debounced-callback.js +1 -1
  13. package/dist/hooks/use-mount-action.js +1 -1
  14. package/dist/index-1hg2mydq.js +2 -0
  15. package/dist/index-1kd3e9cz.js +2 -0
  16. package/dist/index-24awe3d6.js +2 -0
  17. package/dist/index-38cmkpwj.js +6 -0
  18. package/dist/index-42q094m7.js +2 -0
  19. package/dist/index-75cf149h.js +2 -0
  20. package/dist/index-7gzq3np4.js +2 -0
  21. package/dist/index-87bxrmfq.js +42 -0
  22. package/dist/index-9nkdbb33.js +2 -0
  23. package/dist/index-ckt9z566.js +2 -0
  24. package/dist/index-db7hx21g.js +2 -0
  25. package/dist/index-k79cbjh7.js +2 -0
  26. package/dist/index-q2bgrvjz.js +2 -0
  27. package/dist/index-rgye3pe5.js +2 -0
  28. package/dist/index-s7dyqth2.js +2 -0
  29. package/dist/index-vs10z2rc.js +2 -0
  30. package/dist/index-whabarfn.js +2 -0
  31. package/dist/index-x6g6brsv.js +2 -0
  32. package/dist/index-ycc4mvy6.js +2 -0
  33. package/dist/index.js +1 -1
  34. package/dist/resources.d.ts +2 -1
  35. package/dist/resources.js +1 -1
  36. package/dist/tokens/theme.js +1 -1
  37. package/dist/utils/cn.js +1 -1
  38. package/package.json +3 -3
  39. package/dist/index-225zhfvs.js +0 -2
  40. package/dist/index-4djc1w16.js +0 -2
  41. package/dist/index-5m33z54y.js +0 -25
  42. package/dist/index-eevg910d.js +0 -2
  43. package/dist/index-f91yzwpm.js +0 -2
  44. package/dist/index-fdh3nr3r.js +0 -2
  45. package/dist/index-fmpwyc92.js +0 -2
  46. package/dist/index-gzgwcnnv.js +0 -42
  47. package/dist/index-kghpgv95.js +0 -2
  48. package/dist/index-m283d3wz.js +0 -2
  49. package/dist/index-mtc4857g.js +0 -2
  50. package/dist/index-y8r5sgrk.js +0 -2
  51. package/dist/index-yaz3187s.js +0 -2
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import{$ as q4,Ab as p$,Ac as ZM,Bc as XM,Cb as v$,Db as j$,Ec as o$,Fb as x$,Fc as l$,Ga as D3,Jb as c$,N as S4,P as N1,Tb as I4,V as $3,Vb as V$,W as $2,Wb as z$,X as P2,Xb as w$,Y as Z2,Z as g5,aa as C5,ba as K4,ca as u5,ea as G2,f as j5,g as x5,ga as _1,h as c5,ha as E1,ia as R1,ka as g$,pb as D4,qb as a$,rb as s$,sb as e$,tb as P3,ub as Z3,vc as K1,yc as d$,z as x1,zc as r$}from"../../index-5m33z54y.js";import{Gc as aX}from"../../index-fmpwyc92.js";import{Ed as H1,dd as n1,id as a1,kd as s1,ld as rP,md as e1,nd as oP,od as o}from"../../index-eevg910d.js";import{Fd as sX}from"../../index-yaz3187s.js";import{Gd as W4,Id as J4,Jd as Y4}from"../../index-4djc1w16.js";import{_d as f0,ae as S}from"../../index-gzgwcnnv.js";import{Ah as W1,Fh as u1,Gf as w0,Hf as Y1,Jf as J1,Lf as b5,Lg as C2,Og as h1,Pf as S3,Qf as x0,Ue as E4,Vf as q3,Vg as D5,We as F3,Xf as FM,Yf as M2,Zf as Q1,ag as K3,cg as G4,ef as c0,eg as F4,ig as dP,lf as d5,mg as u4,ng as Q4,og as g2,oh as y$,rf as T4,rh as B3,sf as h5,sg as p5}from"../../index-fdh3nr3r.js";import{Ih as f}from"../../index-mtc4857g.js";import"../../index-225zhfvs.js";import{jsx as a4,jsxs as s4}from"react/jsx-runtime";var n4=({children:M,loading:$=!1,fullWidth:P=!1,className:Z,disabled:X,variant:H,size:W,...J})=>s4(S,{variant:H,size:W,className:f(P&&"w-full",Z),disabled:X===!0||$,...J,children:[$&&a4(u1,{size:20,className:"mr-2"}),M]}),e4=n4;import*as iM from"react";import{jsx as lM,jsxs as $6}from"react/jsx-runtime";var M6=({children:M,className:$,type:P="button",...Z},X)=>$6(S,{ref:X,type:P,variant:"ghost",size:"sm",className:f("h-9 rounded-full border border-dashed border-border/80 bg-background px-3 text-xs font-medium text-muted-foreground shadow-xs transition-[transform,color,background-color,border-color] hover:border-primary/35 hover:bg-muted/45 hover:text-foreground active:scale-[0.98]",$),...Z,children:[lM("span",{className:"mr-2 inline-flex size-5 items-center justify-center rounded-full border border-border/70 bg-muted/45 text-foreground",children:lM(h1,{className:"size-3.5"})}),M]}),x2=iM.forwardRef(M6);x2.displayName="AddItemButton";var P6=x2;import{forwardRef as Z6}from"react";import{jsx as H6}from"react/jsx-runtime";var tM=(M,$,P)=>{if($<1||$>12||P<1||P>31)return!1;let Z=new Date(M,$-1,P);return Z.getFullYear()===M&&Z.getMonth()===$-1&&Z.getDate()===P},X6=(M)=>{let $=M.trim();if(!$)return null;let P=/^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/u.exec($);if(P){let{year:X,month:H,day:W}=P.groups??{};return tM(Number(X),Number(H),Number(W))?`${X}-${H}-${W}`:null}let Z=/^(?<day>\d{1,2})[/\-.](?<month>\d{1,2})[/\-.](?<year>\d{4})$/u.exec($);if(Z){let{day:X,month:H,year:W}=Z.groups??{},J=Number(X),Y=Number(H),Q=Number(W);if(!tM(Q,Y,J))return null;return`${Q}-${String(Y).padStart(2,"0")}-${String(J).padStart(2,"0")}`}return null},nM=Z6(function({onPaste:$,...P},Z){return H6(o,{ref:Z,type:"date",onPaste:(H)=>{let W=H.clipboardData.getData("text"),J=X6(W);if(J!==null&&J!==""){H.preventDefault();let Y=H.currentTarget,Q=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set?.bind(Y);if(Q!==void 0)Q(J),Y.dispatchEvent(new Event("input",{bubbles:!0}))}$?.(H)},...P})});nM.displayName="DateInput";var W6=nM;import*as aM from"react";import{jsx as Y6}from"react/jsx-runtime";var sM=f0("font-display font-bold leading-[1.06] tracking-tight text-foreground",{defaultVariants:{size:"lg"},variants:{size:{lg:"text-[1.5rem] sm:text-[1.85rem]",md:"text-[1.15rem] sm:text-[1.25rem]",sm:"text-[1rem]",xl:"text-[2.1rem] sm:text-[2.5rem]"}}}),J6=({as:M="h2",size:$,className:P,...Z},X)=>Y6(M,{ref:X,className:f(sM({size:$}),P),...Z}),eM=aM.forwardRef(J6);eM.displayName="DisplayHeading";var Q6=eM;import*as $1 from"react";import{jsx as p1,jsxs as $$,Fragment as M$}from"react/jsx-runtime";var c2=$1.forwardRef(function({value:$,label:P,variant:Z="icon",copyLabel:X="Copy",copiedLabel:H="Copied",errorMessage:W="Failed to copy to clipboard",resetDelay:J=1500,className:Y,onClick:Q,...U},G){let[F,B]=$1.useState(!1),q=$1.useRef(null);$1.useEffect(()=>()=>{if(q.current!==null)clearTimeout(q.current)},[]);let N=async(A)=>{Q?.(A);try{if(await navigator.clipboard.writeText($),B(!0),q.current!==null)clearTimeout(q.current);q.current=setTimeout(()=>{B(!1)},J)}catch{K1.error(W)}};if(Z==="button")return p1(S,{ref:G,type:"button",variant:"outline",onClick:(A)=>{N(A)},"aria-label":`Copy ${P}`,className:f("shrink-0",Y),...U,children:F?$$(M$,{children:[p1(w0,{className:"mr-1 size-4"}),H]}):$$(M$,{children:[p1(x0,{className:"mr-1 size-4"}),X]})});return p1("button",{ref:G,type:"button",onClick:(A)=>{N(A)},"aria-label":`Copy ${P}`,className:f("flex size-8 shrink-0 items-center justify-center rounded-md border border-border bg-card text-muted-foreground transition hover:border-primary/40 hover:text-primary",Y),...U,children:F?p1(w0,{className:"size-3.5 text-primary"}):p1(x0,{className:"size-3.5"})})});c2.displayName="CopyButton";var f6=c2;import{jsx as t5,jsxs as U6}from"react/jsx-runtime";var P$="#a3d54a",Z$=({className:M,...$})=>U6("svg",{...$,"aria-hidden":"true",className:f("size-6 shrink-0",M),"data-slot":"collective-intelligence-loader",fill:"none",viewBox:"0 0 24 24",children:[t5("polyline",{className:"origin-center motion-safe:animate-[ci-breathe-left_1.8s_ease-in-out_infinite]",points:"10,5.5 4.5,12 10,18.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.2}),t5("polyline",{className:"origin-center motion-safe:animate-[ci-breathe-right_1.8s_ease-in-out_infinite]",points:"14,5.5 19.5,12 14,18.5",stroke:P$,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.2}),t5("circle",{className:"origin-center [transform-box:fill-box] motion-safe:animate-[ci-pulse-dot_1.8s_ease-in-out_infinite]",cx:12,cy:12,fill:P$,r:2.3})]});Z$.displayName="CollectiveIntelligenceLoader";var G6=Z$;import{jsx as q6}from"react/jsx-runtime";var F6=({children:M,className:$})=>q6("div",{className:f("text-destructive text-sm text-center",$),children:M}),K6=F6;import*as X$ from"react";import{jsx as N6}from"react/jsx-runtime";var B6=({value:M,fallback:$="—",locale:P,className:Z,...X},H)=>N6("span",{ref:H,className:f("tabular-nums",Z),...X,children:M===null||M===void 0?$:new Intl.NumberFormat(P).format(M)}),H$=X$.forwardRef(B6);H$.displayName="FormattedNumber";var L6=H$;import*as W$ from"react";import{jsx as w6}from"react/jsx-runtime";var V6={accent:"bg-[color-mix(in_oklab,var(--chart-1)_12%,var(--card))] text-[color-mix(in_oklab,var(--chart-1)_85%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-1)_22%,var(--border))]",gold:"bg-[color-mix(in_oklab,var(--chart-3)_15%,var(--card))] text-[color-mix(in_oklab,var(--chart-3)_65%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-3)_28%,var(--border))]",neutral:"bg-(--bg-surface-alt)/70 text-(--text-secondary) border-(--border-subtle)",sage:"bg-[color-mix(in_oklab,var(--chart-2)_14%,var(--card))] text-[color-mix(in_oklab,var(--chart-2)_70%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-2)_26%,var(--border))]",sky:"bg-[color-mix(in_oklab,var(--chart-4)_14%,var(--card))] text-[color-mix(in_oklab,var(--chart-4)_70%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-4)_26%,var(--border))]",violet:"bg-[color-mix(in_oklab,var(--chart-5)_14%,var(--card))] text-[color-mix(in_oklab,var(--chart-5)_70%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-5)_26%,var(--border))]"},z6={lg:"size-12 rounded-lg text-[17px] [&_svg]:size-6",md:"size-10 rounded-lg text-[15px] [&_svg]:size-5",sm:"size-8 rounded-md text-[13px] [&_svg]:size-4"},J$=W$.forwardRef(function({tone:$="neutral",size:P="md",initial:Z,className:X,children:H,...W},J){return w6("span",{ref:J,"aria-hidden":!0,className:f("inline-flex shrink-0 select-none items-center justify-center border font-display font-bold",z6[P],V6[$],X),...W,children:H??(Z!==void 0&&Z!==""?Z.slice(0,2).toUpperCase():null)})});J$.displayName="IconTile";var T6=J$;import*as Y$ from"react";import{jsx as k6}from"react/jsx-runtime";var O6={accent:"text-(--accent)",copper:"text-(--text-muted)",default:"text-(--text-muted)",muted:"text-(--text-muted)"},A6=({as:M="span",tone:$="default",className:P,...Z},X)=>k6(M,{ref:X,className:f("inline-block text-[11px] font-semibold uppercase tracking-[0.06em]",O6[$],P),...Z}),v1=Y$.forwardRef(A6);v1.displayName="Kicker";var _6=v1;import*as Q$ from"react";import{jsx as S6}from"react/jsx-runtime";var E6=(M)=>`+${M}`,R6=({expanded:M,hiddenCount:$,collapsedLabel:P=E6,expandedLabel:Z="Show less",onToggle:X,className:H,...W},J)=>S6("button",{ref:J,type:"button",onClick:X,className:f("inline-flex items-center gap-1 rounded-full border border-dashed border-muted-foreground/40 bg-muted/20 px-2.5 py-1 text-[11px] font-medium text-muted-foreground hover:bg-muted/40 hover:text-foreground transition-colors",H),...W,children:M?Z:P($)}),f$=Q$.forwardRef(R6);f$.displayName="ShowMoreTag";var D6=f$;import*as U$ from"react";import{jsx as I6}from"react/jsx-runtime";var y6=f0("font-sans leading-none tabular-nums text-primary",{defaultVariants:{size:"md"},variants:{size:{lg:"text-[1.4rem]",md:"text-[1.1rem]",sm:"text-[0.95rem]",xl:"text-[2rem]"}}}),m6=({size:M,className:$,...P},Z)=>I6("span",{ref:Z,className:f(y6({size:M}),$),...P}),j1=U$.forwardRef(m6);j1.displayName="SerifNumeral";var b6=j1;import{jsx as n5,jsxs as C6}from"react/jsx-runtime";var a5=9,G$=2*Math.PI*a5,g6=(M,$,P)=>{if(!Number.isFinite(M)||!Number.isFinite($)||!Number.isFinite(P))return 0;if(P<=$)return 0;return Math.min(1,Math.max(0,(M-$)/(P-$)))},F$=({className:M,classes:$,label:P,max:Z=100,min:X=0,title:H,value:W,"aria-label":J,...Y})=>{let Q=g6(W,X,Z),U=Math.round(Q*100),G=X+Q*(Z-X),F=G$*(1-Q);return n5("span",{"aria-label":J??`${P}: ${U}%`,"aria-valuemax":Z,"aria-valuemin":X,"aria-valuenow":G,className:f("grid size-8 shrink-0 place-items-center text-muted-foreground",$?.root,M),title:H??`${P} ${U}%`,...Y,children:C6("svg",{"aria-hidden":"true",className:f("size-6 -rotate-90",$?.svg),viewBox:"0 0 24 24",children:[n5("circle",{className:f("stroke-muted",$?.track),cx:"12",cy:"12",fill:"none",r:a5,strokeWidth:"3"}),n5("circle",{className:f("stroke-foreground transition-[stroke-dashoffset]",$?.indicator),cx:"12",cy:"12",fill:"none",r:a5,strokeDasharray:G$,strokeDashoffset:F,strokeLinecap:"round",strokeWidth:"3"})]})})};F$.displayName="Ring";var u6=F$;import*as B$ from"react";import{jsx as K$,jsxs as v6}from"react/jsx-runtime";var q$={danger:"bg-destructive",neutral:"bg-muted-foreground/40",primary:"bg-primary",success:"bg-emerald-500",warning:"bg-amber-500"},h6={md:"size-2",sm:"size-1.5"},p6=({tone:M="neutral",pulse:$=!1,size:P="sm",className:Z,...X},H)=>v6("span",{ref:H,className:f("relative inline-flex shrink-0",h6[P],Z),...X,children:[$&&K$("span",{"aria-hidden":!0,className:f("absolute inline-flex h-full w-full animate-ping rounded-full opacity-60",q$[M])}),K$("span",{"aria-hidden":!0,className:f("relative inline-flex h-full w-full rounded-full",q$[M])})]}),d2=B$.forwardRef(p6);d2.displayName="StatusDot";var j6=d2;import*as T$ from"react";import{jsx as L$,jsxs as N$}from"react/jsx-runtime";var x6={neutral:"border-(--border-subtle) bg-card text-muted-foreground",warning:"border-[color-mix(in_oklab,var(--warning)_40%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_12%,var(--card))] text-[color-mix(in_oklab,var(--warning)_75%,var(--foreground))]"},c6=({tooltip:M,tone:$="neutral",icon:P,className:Z,children:X,...H},W)=>N$(V$,{children:[L$(z$,{asChild:!0,children:N$(x1,{ref:W,variant:"outline",className:f(x6[$],Z),...H,children:[P,X]})}),L$(w$,{children:M})]}),O$=T$.forwardRef(c6);O$.displayName="TooltipBadge";var d6=O$;import*as A$ from"react";import{jsx as o6}from"react/jsx-runtime";var r6={body1:{className:"text-base",tag:"p"},body2:{className:"text-sm",tag:"p"},h1:{className:"text-2xl font-semibold",tag:"h1"},h2:{className:"text-xl font-bold",tag:"h2"},h3:{className:"text-lg font-semibold",tag:"h3"},h4:{className:"text-base font-medium",tag:"h4"},subtitle1:{className:"text-base font-normal text-muted-foreground",tag:"h6"},subtitle2:{className:"text-sm font-medium text-muted-foreground",tag:"h6"}},r2=A$.forwardRef(function({variant:$="body1",as:P,className:Z,...X},H){let{tag:W,className:J}=r6[$];return o6(P??W,{ref:H,className:f(J,Z),...X})});r2.displayName="Typography";import{jsx as i6}from"react/jsx-runtime";var l6=({children:M,as:$="form",className:P,onSubmit:Z,...X})=>{let H=(W)=>{W.preventDefault(),Z?.(W)};return i6($,{className:f("flex flex-col gap-4 min-w-[300px]",P),onSubmit:H,...X,children:M})},t6=l6;import{jsx as e6}from"react/jsx-runtime";var k$={},c1=(...M)=>{for(let $ of M)if($!==void 0)return $;return 1},n6=(M=k$)=>({"--list-cols":c1(M.cols),"--list-cols-2xl":c1(M.cols2xl,M.colsXl,M.colsLg,M.colsMd,M.colsSm,M.cols),"--list-cols-lg":c1(M.colsLg,M.colsMd,M.colsSm,M.cols),"--list-cols-md":c1(M.colsMd,M.colsSm,M.cols),"--list-cols-sm":c1(M.colsSm,M.cols),"--list-cols-xl":c1(M.colsXl,M.colsLg,M.colsMd,M.colsSm,M.cols)}),a6=["grid","gap-4","[grid-template-columns:repeat(var(--list-cols),minmax(0,1fr))]","sm:[grid-template-columns:repeat(var(--list-cols-sm),minmax(0,1fr))]","md:[grid-template-columns:repeat(var(--list-cols-md),minmax(0,1fr))]","lg:[grid-template-columns:repeat(var(--list-cols-lg),minmax(0,1fr))]","xl:[grid-template-columns:repeat(var(--list-cols-xl),minmax(0,1fr))]","2xl:[grid-template-columns:repeat(var(--list-cols-2xl),minmax(0,1fr))]"].join(" "),s6=({cols:M=k$,children:$,...P})=>e6("div",{className:a6,style:n6(M),...P,children:$});import{jsx as $8}from"react/jsx-runtime";var M8=({className:M,spaced:$=!1,...P})=>$8("div",{className:f("animate-[rise-in_500ms_cubic-bezier(0.16,1,0.3,1)_both]",$&&"space-y-6",M),...P});var P8=M8;import{jsx as w2,jsxs as d1}from"react/jsx-runtime";var Z8=(M)=>M!==null&&M!==void 0&&M.constructor===String,z2=(M)=>M!==null&&M!==void 0&&M!==!1&&M!==""&&M!==0,X8=({title:M,description:$,icon:P,kicker:Z,status:X,actions:H,className:W})=>d1("header",{className:f("space-y-2",W),children:[z2(Z)?d1("div",{className:"flex items-center gap-2 text-(--text-muted) [&_svg]:h-3.5 [&_svg]:w-3.5",children:[z2(P)?w2("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-sm bg-(--bg-accent-soft) text-(--accent)",children:P}):null,w2("span",{className:"text-[12px] font-medium tracking-tight [&_span.sep]:mx-1.5 [&_span.sep]:text-(--accent)",children:Z8(Z)?Z.split("·").map((J,Y,Q)=>d1("span",{children:[J.trim(),Y<Q.length-1?w2("span",{className:"sep","aria-hidden":!0,children:"·"}):null]},Y)):Z})]}):null,d1("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[d1("div",{className:"min-w-0 flex-1 space-y-1.5",children:[w2("h1",{className:"font-display text-[27px] font-bold leading-tight tracking-[-0.02em] text-(--text-primary)",children:M}),z2($)?w2("p",{className:"max-w-2xl text-[14px] leading-relaxed text-(--text-secondary)",children:$}):null]}),z2(H)||z2(X)?d1("div",{className:"flex shrink-0 items-center gap-2 pt-1",children:[X,H]}):null]})]}),H8=X8;import*as E$ from"react";import{jsx as o2,jsxs as _$}from"react/jsx-runtime";var s5=(M)=>M!==void 0&&M!==null&&M!==!1&&M!==0&&M!==""&&!Number.isNaN(M),R$=E$.forwardRef(function({icon:$,title:P,description:Z,action:X,className:H,...W},J){return _$("div",{ref:J,className:f("flex items-start gap-3",H),...W,children:[s5($)?o2("span",{"aria-hidden":!0,className:"mt-0.5 inline-flex shrink-0 items-center justify-center rounded-md bg-muted p-2 text-muted-foreground [&_svg]:h-4 [&_svg]:w-4",children:$}):null,_$("div",{className:"min-w-0 flex-1",children:[o2("h3",{className:"text-[15px] font-semibold leading-snug text-foreground",children:P}),s5(Z)?o2("p",{className:"mt-0.5 text-sm leading-relaxed text-muted-foreground",children:Z}):null]}),s5(X)?o2("div",{className:"shrink-0",children:X}):null]})});R$.displayName="SectionHeader";var W8=R$;import{jsx as S$,jsxs as Y8}from"react/jsx-runtime";var J8=({title:M,toolbar:$})=>Y8("div",{className:"flex items-center justify-between mb-12",children:[S$(r2,{variant:"h2",children:M}),Boolean($)&&S$("div",{className:"flex items-center gap-2",children:$})]}),Q8=J8;import*as i2 from"react";import{jsx as T0,jsxs as l2}from"react/jsx-runtime";var D$=(M,$,P)=>{if(M.length>=$)return M;return[...M,...Array.from({length:$-M.length},P)]},f8=[],e5=({values:M,defaultValues:$=f8,onValuesChange:P,addLabel:Z,getRemoveLabel:X,actions:H,minItems:W=0,disabled:J=!1,renderItem:Y,createItem:Q,validateItem:U,classes:G,className:F,id:B,...q})=>{let N=i2.useId(),[A,w]=i2.useState(()=>D$($,W,Q)),L=D$(M??A,W,Q),V=Boolean(H),T=(_)=>{if(M===void 0)w(_);P?.(_)};return l2("div",{"data-slot":"array-input",className:f("space-y-2",G?.root,F),...q,children:[T0("div",{className:"space-y-2",children:L.map((_,z)=>{let O=z===0&&B!==void 0&&B!==""?B:`${N}-${z}`,k=U?.(_,z);return l2("div",{className:f("flex items-center gap-3",G?.row),children:[Y({disabled:J,id:O,index:z,onValueChange:(I)=>{let R=[...L];R[z]=I,T(R)},validationMessage:k,value:_}),L.length>W?T0(S,{type:"button",variant:"ghost",size:"icon",disabled:J,"aria-label":X(z),className:f("size-10 shrink-0 text-muted-foreground hover:text-destructive",G?.removeButton),onClick:()=>{T(L.filter((I,R)=>R!==z))},children:T0(y$,{"aria-hidden":"true",className:"size-4"})}):null]},z)})}),l2("div",{className:f("flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",G?.actionRow),children:[T0(x2,{disabled:J,className:G?.addButton,onClick:()=>{T([...L,Q()])},children:Z}),V?T0("div",{className:f("sm:ml-auto",G?.actions),children:H}):null]})]})},U8=(M)=>{let{createItem:$,getItemLabel:P,inputProps:Z,placeholder:X,required:H=!1,renderItem:W,...J}=M,{className:Y,...Q}=Z??{};if(W!==void 0)return T0(e5,{...J,createItem:$??(()=>""),renderItem:W});return T0(e5,{...J,createItem:$??(()=>""),renderItem:(U)=>{let{disabled:G,id:F,index:B,onValueChange:q,validationMessage:N,value:A}=U;return l2("div",{className:"min-w-0 flex-1",children:[T0(o,{...Q,id:F,"aria-label":P(B),"aria-invalid":Boolean(N),value:A,placeholder:X,required:H,disabled:G,className:f("w-full",Y,J.classes?.input),onChange:(w)=>{q(w.target.value)}}),N!==void 0&&N!==""?T0("p",{className:"mt-1 text-xs text-destructive",role:"alert",children:N}):null]})}})},G8=(M)=>T0(e5,{...M}),F8=(M)=>M.createItem!==void 0&&M.renderItem!==void 0,m$=(M)=>{if(F8(M))return T0(G8,{...M});return T0(U8,{...M})};m$.displayName="ArrayInput";var q8=m$;import*as r1 from"react";var P1=(M,$)=>{let P=[];for(let Z of M){let X=P.findIndex((H)=>$(Z,H)<0);if(X===-1)P.push(Z);else P.splice(X,0,Z)}return P};var O0={hour:9,interval:1,minute:0,mode:"day",monthday:1,weekdays:[1,2,3,4,5]},MM=/^\*\/(?<step>\d+)$/u,K8=(M)=>{let $=[];for(let P of M.split(",")){let Z=/^(?<start>\d+)-(?<end>\d+)$/u.exec(P);if(Z){let X=Number(Z.groups?.start),H=Number(Z.groups?.end);if(X>H)return null;for(let W=X;W<=H;W+=1)$.push(W)}else if(/^\d+$/u.test(P))$.push(Number(P));else return null}return $},B8=(M,$,P,Z)=>{if($==="*"&&P==="*"&&Z==="*"){let X=MM.exec(M),H=Number(X?.groups?.step);return X&&H>=1&&H<=59?{...O0,interval:H,mode:"minutes"}:null}return},N8=(M,$,P,Z)=>{if($!=="*"||P!=="*")return;let X=MM.exec(M);if(X){let H=Number(X.groups?.step);return H>=1&&H<=23?{...O0,interval:H,minute:Z,mode:"hours"}:null}return},L8=(M,$,P)=>{let Z=MM.exec(M);if(Z){let H=Number(Z.groups?.step);if(H%7===0&&H>=7&&H<=28)return{...O0,hour:$,interval:H/7,minute:P,mode:"weeks"};return H>=1&&H<=31?{...O0,hour:$,interval:H,minute:P,mode:"days"}:null}let X=Number(M);return/^\d+$/u.test(M)&&X>=1&&X<=31?{...O0,hour:$,minute:P,mode:"month",monthday:X}:null},V8=(M,$,P)=>{let Z=K8(M);if(!Z||Z.some((H)=>H<0||H>7))return null;let X=P1(new Set(Z.map((H)=>H===7?0:H)),(H,W)=>H-W);return{...O0,hour:$,minute:P,mode:"week",weekdays:X}},T2=(M)=>{let $=M.trim().split(/\s+/u);if($.length!==5)return null;let[P,Z,X,H,W]=$;if(H!=="*")return null;let J=B8(P,Z,X,W);if(J!==void 0)return J;if(!/^\d+$/u.test(P))return null;let Y=Number(P);if(Y<0||Y>59)return null;let Q=N8(Z,X,W,Y);if(Q!==void 0)return Q;if(!/^\d+$/u.test(Z))return null;let U=Number(Z);if(U<0||U>23)return null;if(X==="*"&&W==="*")return{...O0,hour:U,minute:Y,mode:"day"};if(W==="*")return L8(X,U,Y);if(X==="*")return V8(W,U,Y);return null},Z1=(M)=>{let $=Math.max(1,Math.floor(M.interval));switch(M.mode){case"minutes":return`*/${Math.min($,59)} * * * *`;case"hours":return`${M.minute} */${Math.min($,23)} * * *`;case"day":return`${M.minute} ${M.hour} * * *`;case"days":return`${M.minute} ${M.hour} */${Math.min($,31)} * *`;case"week":{let P=M.weekdays.length>0?P1(new Set(M.weekdays),(Z,X)=>Z-X).join(","):"*";return`${M.minute} ${M.hour} * * ${P}`}case"weeks":return`${M.minute} ${M.hour} */${Math.min($*7,28)} * *`;case"month":return`${M.minute} ${M.hour} ${Math.min(Math.max(M.monthday,1),31)} * *`;default:throw Error("Unsupported cron mode")}},I$=(M,$,P)=>{if(M==="*")return!0;for(let Z of M.split(",")){let X=/^(?<base>\*|\d+|\d+-\d+)\/(?<increment>\d+)$/u.exec(Z);if(X){let W=X.groups?.base??"";if(W!=="*"&&!I$(W,$,P))return!1;let J=Number(X.groups?.increment);if(!Number.isFinite(J)||J<1)return!1;continue}let H=/^(?<start>\d+)-(?<end>\d+)$/u.exec(Z);if(H){let W=Number(H.groups?.start),J=Number(H.groups?.end);if(W<$||J>P||W>J)return!1;continue}if(/^\d+$/u.test(Z)){let W=Number(Z);if(W<$||W>P)return!1;continue}return!1}return!0},z8=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],w8=(M,$)=>{let P=String(M).padStart(2,"0"),Z=String($).padStart(2,"0");return`${P}:${Z}`},t2=(M)=>{let $=T2(M);if(!$)return M;let P=w8($.hour,$.minute);switch($.mode){case"minutes":return $.interval===1?"Every minute":`Every ${$.interval} minutes`;case"hours":return $.interval===1?`Every hour at :${String($.minute).padStart(2,"0")}`:`Every ${$.interval} hours at :${String($.minute).padStart(2,"0")}`;case"day":return`Every day at ${P}`;case"days":return $.interval===1?`Every day at ${P}`:`Every ${$.interval} days at ${P}`;case"week":{if($.weekdays.length===0)return`Weekly at ${P}`;let Z=P1($.weekdays,(J,Y)=>J-Y),X=Z.length===5&&Z.every((J,Y)=>J===Y+1),H=Z.length===2&&Z[0]===0&&Z[1]===6;if(X)return`Weekdays at ${P}`;if(H)return`Weekends at ${P}`;return`${Z.map((J)=>z8[J].slice(0,3)).join(", ")} at ${P}`}case"weeks":return $.interval===1?`Every week at ${P}`:`Every ${$.interval} weeks at ${P}`;case"month":return`Day ${$.monthday} of every month at ${P}`;default:throw Error("Unsupported cron mode")}},$M=(M)=>{let $=M.trim().split(/\s+/u);if($.length!==5)return!1;let P=[[0,59],[0,23],[1,31],[1,12],[0,7]];return $.every((Z,X)=>I$(Z,P[X][0],P[X][1]))};import*as C$ from"react";var b$=(M)=>{let Z=new Intl.DateTimeFormat("en-US",{timeZone:M,timeZoneName:"shortOffset"}).formatToParts(new Date).find((Y)=>Y.type==="timeZoneName")?.value??"GMT",X=/(?<sign>[+-])(?<hours>\d{1,2})(?::(?<minutes>\d{2}))?/u.exec(Z);if(!X)return 0;let H=X.groups?.sign==="-"?-1:1,W=Number(X.groups?.hours??0),J=Number(X.groups?.minutes??0);return H*(W*60+J)},T8=(M)=>{let $=b$(M),P=$>=0?"+":"-",Z=Math.abs($),X=String(Math.floor(Z/60)).padStart(2,"0"),H=String(Z%60).padStart(2,"0");return`${P}${X}:${H}`},n2=null,PM=()=>{if(n2)return n2;let M="supportedValuesOf"in Intl?Intl.supportedValuesOf("timeZone"):["UTC"];return n2=P1(["UTC",...M].map(($)=>({label:`${$} (UTC${T8($)})`,offset:b$($),value:$})),($,P)=>$.offset-P.offset||$.value.localeCompare(P.value)).map(({value:$,label:P})=>({label:P,value:$})),n2};import{jsx as O8}from"react/jsx-runtime";var a2=({value:M,onChange:$,className:P,width:Z="100%",disabled:X,placeholder:H="Select timezone"})=>{let W=C$.useMemo(()=>PM(),[]);return O8(g$,{options:W,value:M,onChange:(J)=>{$(J||"UTC")},placeholder:H,searchPlaceholder:"Search timezone...",emptyMessage:"No timezone found.",className:f("bg-transparent font-normal",P),width:Z,disabled:X})};import{jsx as g,jsxs as P0,Fragment as D8}from"react/jsx-runtime";var i$=[{label:"X minutes",value:"minutes"},{label:"X hours",value:"hours"},{label:"Day",value:"day"},{label:"X days",value:"days"},{label:"Week",value:"week"},{label:"X weeks",value:"weeks"},{label:"Month",value:"month"}],A8=[{label:"Monday",short:"Mon",value:1},{label:"Tuesday",short:"Tue",value:2},{label:"Wednesday",short:"Wed",value:3},{label:"Thursday",short:"Thu",value:4},{label:"Friday",short:"Fri",value:5},{label:"Saturday",short:"Sat",value:6},{label:"Sunday",short:"Sun",value:0}],k8=(M)=>i$.some(($)=>$.value===M),u$=(M)=>{let $=M.trim();if(!$)return{custom:Z1(O0),simple:O0,view:"simple"};let P=T2($);if(P)return{custom:$,simple:P,view:"simple"};return{custom:$,simple:O0,view:"advanced"}},_8=(M,$)=>{let P=$===1;switch(M.value){case"minutes":return P?"minute":"minutes";case"hours":return P?"hour":"hours";case"day":return"day";case"days":return P?"day":"days";case"week":return"week";case"weeks":return P?"week":"weeks";case"month":return"month";default:throw Error("Unsupported cron mode")}},s2=(M,$,P)=>Math.max($,Math.min(P,M)),h$=(M)=>String(M).padStart(2,"0"),E8=({hour:M,minute:$,onChange:P})=>P0("div",{className:"flex items-center gap-1",children:[g(o,{type:"number",min:0,max:23,value:h$(M),onChange:(Z)=>{P(s2(Number(Z.target.value)||0,0,23),$)},className:"w-16 text-center font-mono"}),g("span",{className:"text-muted-foreground",children:":"}),g(o,{type:"number",min:0,max:59,value:h$($),onChange:(Z)=>{P(M,s2(Number(Z.target.value)||0,0,59))},className:"w-16 text-center font-mono"})]}),R8=({state:M,onChange:$,timezone:P,onTimezoneChange:Z})=>{let X=M.mode==="minutes"||M.mode==="hours"||M.mode==="days"||M.mode==="weeks",H=M.mode!=="minutes"&&M.mode!=="hours",W=M.mode==="hours",J=M.mode==="week",Y=M.mode==="month";return P0("div",{className:"space-y-3",children:[g("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end",children:P0("div",{className:"space-y-2",children:[g("span",{className:"text-xs font-medium text-muted-foreground",children:"Every"}),P0("div",{className:f("grid gap-2",X?"grid-cols-[88px_minmax(0,1fr)]":"grid-cols-1"),children:[X&&g(o,{type:"number",min:1,value:M.interval,onChange:(Q)=>{$({interval:Math.max(1,Number(Q.target.value)||1)})},className:"font-mono"}),P0(p$,{value:M.mode,onValueChange:(Q)=>{if(k8(Q))$({mode:Q})},children:[g(j$,{className:"flex-1",children:g(v$,{})}),g(c$,{children:i$.map((Q)=>g(x$,{value:Q.value,children:_8(Q,M.interval)},Q.value))})]})]})]})}),J&&P0("div",{className:"space-y-2",children:[g("span",{className:"text-xs font-medium text-muted-foreground",children:"On"}),g(o$,{type:"multiple",variant:"outline",size:"sm",value:M.weekdays.map(String),onValueChange:(Q)=>{$({weekdays:Q.length?P1(Q.map(Number),(U,G)=>U-G):[1]})},className:"w-full",children:A8.map((Q)=>g(l$,{value:String(Q.value),"aria-label":Q.label,className:"text-xs",children:Q.short},Q.value))})]}),Y&&P0("div",{className:"space-y-2",children:[g("span",{className:"text-xs font-medium text-muted-foreground",children:"On day"}),g(o,{type:"number",min:1,max:31,value:M.monthday,onChange:(Q)=>{$({monthday:s2(Number(Q.target.value)||1,1,31)})},className:"w-24"})]}),(H||P!==void 0&&Z)&&P0("div",{className:f("grid gap-3",H&&P!==void 0&&Z?"lg:grid-cols-[auto_minmax(0,1fr)] lg:items-end":"grid-cols-1"),children:[H&&P0("div",{className:"space-y-2",children:[g("span",{className:"text-xs font-medium text-muted-foreground",children:"At"}),g(E8,{hour:M.hour,minute:M.minute,onChange:(Q,U)=>{$({hour:Q,minute:U})}})]}),P!==void 0&&Z&&P0("div",{className:"space-y-2",children:[g("span",{className:"text-xs font-medium text-muted-foreground",children:"Timezone"}),g(a2,{value:P,onChange:Z})]})]}),W&&P0("div",{className:"space-y-2",children:[g("span",{className:"text-xs font-medium text-muted-foreground",children:"At minute"}),g(o,{type:"number",min:0,max:59,value:M.minute,onChange:(Q)=>{$({minute:s2(Number(Q.target.value)||0,0,59)})},className:"w-24"})]})]})},S8=({value:M,onChange:$,className:P,showPreview:Z=!0,timezone:X,onTimezoneChange:H})=>{let[W,J]=r1.useState(()=>u$(M)),[Y,Q]=r1.useState(M),[U,G]=r1.useState(M);if(M!==Y){if(Q(M),M!==U)G(M),J(u$(M))}let F=r1.useCallback((L)=>{let V=L.view==="simple"?Z1(L.simple):L.custom;G(V),$(V)},[$]),B=(L)=>{J((V)=>{let T={...V.simple,...L},_={...V,custom:Z1(T),simple:T};return F(_),_})},q=(L)=>{J((V)=>{let T={...V,custom:L};return F(T),T})},N=(L)=>{J((V)=>{if(L===V.view)return V;if(L==="advanced"){let z=Z1(V.simple),O={...V,custom:z,view:L};return F(O),O}let T=T2(V.custom),_=T?{...V,simple:T,view:L}:{...V,view:L};return F(_),_})},A=$M(W.custom),w=null;if(W.view==="simple")w=t2(Z1(W.simple));else if(A)w=t2(W.custom);return P0("div",{className:f("space-y-4",P),children:[P0(d$,{value:W.view,onValueChange:(L)=>{if(L==="simple"||L==="advanced")N(L)},children:[P0(r$,{className:"grid w-full grid-cols-2 rounded-md bg-muted/70 p-1 sm:w-[320px]",children:[g(ZM,{value:"simple",className:"text-xs",children:"Simple"}),g(ZM,{value:"advanced",className:"text-xs",children:"Advanced"})]}),g(XM,{value:"simple",className:"space-y-3 pt-3",children:g(R8,{state:W.simple,onChange:B,timezone:X,onTimezoneChange:H})}),P0(XM,{value:"advanced",className:"space-y-2 pt-3",children:[g("span",{className:"text-xs font-medium text-muted-foreground",children:"Cron Expression"}),g(o,{value:W.custom,onChange:(L)=>{q(L.target.value)},placeholder:"0 9 * * 1-5",className:f("font-mono text-sm",!A&&W.custom.trim()&&"border-destructive focus-visible:ring-destructive/40"),spellCheck:!1}),g("p",{className:"text-[11px] text-muted-foreground",children:"Format: minute hour day-of-month month day-of-week"})]})]}),W.view==="advanced"&&X!==void 0&&H&&P0("div",{className:"space-y-2",children:[g("span",{className:"text-xs font-medium text-muted-foreground",children:"Timezone"}),g(a2,{value:X,onChange:H})]}),Z&&g("div",{className:"flex min-h-8 flex-wrap items-center gap-2 rounded-md bg-muted/35 px-3 py-2 text-xs",children:w===null?g("span",{className:"text-destructive",children:"Invalid cron expression"}):P0(D8,{children:[g("span",{className:"text-muted-foreground",children:w}),g(x1,{variant:"secondary",className:"ml-auto font-mono text-[11px]",children:W.view==="simple"?Z1(W.simple):W.custom})]})})]})};import{jsx as HM}from"react/jsx-runtime";var y8={both:"w-full h-full",horizontal:"w-full h-auto",none:"",vertical:"h-full w-auto"},m8=({src:M,alt:$="",className:P="",width:Z,height:X,fill:H="horizontal",style:W})=>{if(H==="both")return HM("div",{className:f("relative overflow-hidden rounded-lg shadow-md",P),style:{height:X,width:Z,...W},children:HM("img",{src:M,alt:$,className:"object-cover w-full h-full absolute inset-0"})});return HM("img",{src:M,alt:$,width:Z,height:X,className:f("object-cover rounded-lg shadow-md",y8[H],P),style:{height:H==="vertical"?"100%":X,width:H==="horizontal"?"100%":Z,...W}})},I8=m8;import{jsx as e2,jsxs as t$}from"react/jsx-runtime";var b8=({title:M,className:$,children:P,...Z})=>t$("section",{"data-slot":"summary-list",className:f("space-y-2",$),...Z,children:[M?e2("h3",{className:"text-sm font-semibold tracking-tight",children:M}):null,e2("dl",{className:"divide-y divide-border overflow-hidden rounded-lg border border-border bg-card",children:P})]}),g8=({label:M,value:$,muted:P=!1,className:Z,...X})=>t$("div",{"data-slot":"summary-item",className:f("grid gap-1 px-4 py-3 sm:grid-cols-[minmax(8rem,14rem)_1fr] sm:gap-4",Z),...X,children:[e2("dt",{className:"text-sm text-muted-foreground",children:M}),e2("dd",{className:f("min-w-0 break-words text-sm",P?"text-muted-foreground":"font-medium text-foreground"),children:$})]});import*as WM from"react";import{jsx as B1,jsxs as n$}from"react/jsx-runtime";var C8=({className:M,...$})=>B1(a$,{"data-slot":"choice-card-group",className:f("grid gap-3",M),...$}),u8=({title:M,description:$,media:P,footer:Z,className:X,...H})=>{let W=WM.useId(),J=WM.useId(),Y=Boolean($);return n$(s$,{"data-slot":"choice-card","aria-labelledby":W,"aria-describedby":Y?J:void 0,className:f("group/choice relative flex h-full min-w-0 flex-col items-start gap-4 rounded-lg border border-border bg-card p-5 text-left shadow-(--shadow-sm) outline-none transition-[border-color,background-color,box-shadow] dark:shadow-none","hover:border-foreground/25 focus-visible:ring-[3px] focus-visible:ring-ring/50","data-[state=checked]:border-primary data-[state=checked]:bg-primary/[0.04] data-[state=checked]:ring-1 data-[state=checked]:ring-primary/25","disabled:cursor-not-allowed disabled:bg-muted/30 disabled:opacity-65 disabled:hover:border-border",X),...H,children:[B1("span",{"aria-hidden":!0,className:"absolute top-4 right-4 flex size-5 items-center justify-center rounded-full border border-input bg-background text-primary-foreground transition-colors group-data-[state=checked]/choice:border-primary group-data-[state=checked]/choice:bg-primary",children:B1(e$,{children:B1(w0,{className:"size-3",strokeWidth:3})})}),P,n$("span",{className:"block min-w-0 space-y-1 pr-7",children:[B1("span",{id:W,className:"block font-semibold tracking-tight",children:M}),Y?B1("span",{id:J,className:"block text-sm leading-relaxed text-muted-foreground",children:$}):null]}),Z?B1("span",{className:"mt-auto block w-full",children:Z}):null]})};import*as o1 from"react";import{jsx as X1,jsxs as M3}from"react/jsx-runtime";var X3=o1.forwardRef(function({className:$,...P},Z){return X1("div",{ref:Z,className:f("grid gap-2",$),...P})}),H3=({className:M,...$})=>X1(P3,{className:f("grid gap-2",M),...$}),h8=(M)=>M!==void 0&&M!==null&&M!==!1&&M!==0&&M!==""&&!Number.isNaN(M),M5=o1.forwardRef(function({title:$,description:P,disabled:Z=!1,control:X,className:H,children:W,...J},Y){return M3("label",{ref:Y,className:f("flex min-w-0 items-start gap-3 rounded-md border border-border p-3","has-[[data-state=checked]]:border-primary/50 has-[[data-state=checked]]:bg-primary/5",Z?"cursor-not-allowed bg-muted/30 opacity-65":"cursor-pointer hover:bg-muted/50",H),...J,children:[X,M3("span",{className:"min-w-0 flex-1",children:[X1("span",{className:"block truncate text-sm font-medium",children:$}),h8(P)?X1("span",{className:"mt-1 block truncate text-xs text-muted-foreground",children:P}):null,W]})]})}),W3=(M)=>Object.prototype.toString.call(M)==="[object String]",p8=({value:M,title:$,radioLabel:P,disabled:Z=!1,onClick:X,...H})=>{let W=o1.useId(),J=P??(W3($)?$:void 0);return X1(M5,{disabled:Z,title:$,onClick:(Y)=>{if(X?.(Y),Y.defaultPrevented||Z)return;let Q=document.querySelector(`#${W}`);if(Q!==null&&Y.target instanceof Node&&Q.contains(Y.target))return;Y.preventDefault(),Q?.click()},control:X1(Z3,{"aria-label":J,className:"mt-1",disabled:Z,id:W,value:M}),...H})},v8=({checked:M,title:$,checkboxLabel:P,disabled:Z=!1,onClick:X,onCheckedChange:H,...W})=>{let J=o1.useId(),Y=P??(W3($)?$:void 0);return X1(M5,{disabled:Z,title:$,onClick:(Q)=>{if(X?.(Q),Q.defaultPrevented||Z)return;let U=document.querySelector(`#${J}`);if(U!==null&&Q.target instanceof Node&&U.contains(Q.target))return;Q.preventDefault(),H(!M)},control:X1($3,{"aria-label":Y,checked:M,className:"mt-0.5",disabled:Z,id:J,onCheckedChange:(Q)=>{if(!Z)H(Q===!0)}}),...W})};X3.displayName="CardOptionsBlock";H3.displayName="RadioCardOptionsBlock";M5.displayName="CardOption";import*as J3 from"react";import{jsx as O2,jsxs as JM}from"react/jsx-runtime";var j8=({title:M,description:$,command:P,copyLabel:Z=M,copyErrorMessage:X,className:H,...W},J)=>JM("div",{ref:J,className:f("space-y-2",H),...W,children:[JM("div",{children:[O2("p",{className:"text-sm font-medium",children:M}),$===void 0?null:O2("p",{className:"text-sm text-muted-foreground",children:$})]}),JM("div",{className:"flex items-start gap-2",children:[O2("pre",{className:"flex-1 overflow-x-auto rounded-md border bg-muted px-3 py-2 font-mono text-xs",children:O2("code",{children:P})}),O2(c2,{value:P,label:Z,errorMessage:X})]})]}),Y3=J3.forwardRef(j8);Y3.displayName="CommandStep";var x8=Y3;import{forwardRef as c8,useId as d8}from"react";import{jsx as A2,jsxs as Q3}from"react/jsx-runtime";var f3=c8(function({currency:$,label:P="Amount",hint:Z,hideLabel:X=!1,hideHint:H=!1,error:W,className:J,wrapperClassName:Y,id:Q,decimals:U=2,step:G,placeholder:F,...B},q){let N=d8(),A=Q??N,w=`Enter amount in ${$}`,L=G??1/10**U,V=F??(U>0?`0.${"0".repeat(U)}`:"0"),T=W!==null&&W!==void 0&&W.length>0;return Q3("div",{className:f("w-full space-y-2",Y),children:[!X&&A2(H1,{htmlFor:A,children:P}),Q3("div",{className:"relative",children:[A2("span",{className:"-translate-y-1/2 absolute top-1/2 left-3 text-sm text-muted-foreground",children:$}),A2(o,{ref:q,className:f("bg-background pl-12",T&&"border-destructive",J),id:A,min:"0",placeholder:V,step:L,type:"number",...B})]}),T?A2("p",{className:"text-xs text-destructive",children:W}):!H&&A2("p",{className:"text-xs text-muted-foreground",children:Z??w})]})});f3.displayName="CurrencyInput";var r8=f3;import*as U3 from"react";import{jsx as $5,jsxs as YM}from"react/jsx-runtime";var G3=U3.forwardRef(function({index:$,label:P,hint:Z,className:X,children:H,...W},J){let Y=Boolean($),Q=Boolean(Z);return YM("div",{ref:J,className:f("grid gap-x-4",Y?"grid-cols-[2.25rem_1fr] sm:grid-cols-[2.5rem_1fr]":"grid-cols-1",X),...W,children:[Y?$5("div",{className:"flex h-6 items-center justify-end pt-[2px]",children:$5(j1,{children:$})}):null,YM("div",{className:"min-w-0 space-y-1.5",children:[YM("div",{className:"flex items-baseline justify-between gap-2",children:[$5(v1,{children:P}),Q?$5("span",{className:"text-[10px] text-muted-foreground",children:Z}):null]}),H]})]})});G3.displayName="FieldRow";var o8=G3;import{jsx as v,jsxs as E0,Fragment as e8}from"react/jsx-runtime";var l8=(M)=>{if(M===0)return"0 Bytes";let $=1024,P=["Bytes","KB","MB","GB"],Z=Math.floor(Math.log(M)/Math.log($));return`${Math.round(M/$**Z*100)/100} ${P[Z]}`},i8={downloadFile:"Download file",downloadingFile:"Downloading file",dragActive:"Drop the file here",dragInactive:"Drag & drop a file here, or click to select",errorRetry:"Please try again",fileTypeHint:"PDF, DOC, DOCX up to 10MB"},t8=({active:M,activeLabel:$,inactiveLabel:P,hint:Z})=>E0("div",{className:"flex w-full items-center gap-3",children:[v("div",{className:f("flex h-10 w-10 shrink-0 items-center justify-center rounded-full transition-colors",M?"bg-[color-mix(in_oklab,var(--primary)_14%,var(--card))]":"bg-muted"),children:v(B3,{className:f("h-5 w-5",M?"text-primary":"text-muted-foreground")})}),E0("div",{children:[v("p",{className:"text-sm font-medium text-foreground",children:M?$:P}),v("p",{className:"text-xs text-muted-foreground",children:Z})]})]}),n8=({message:M,retryLabel:$})=>E0("div",{className:"flex w-full items-center gap-3",children:[v("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-destructive/10",children:v(W1,{className:"h-5 w-5 text-destructive"})}),E0("div",{children:[v("p",{className:"text-sm font-medium text-destructive",children:M}),v("p",{className:"text-xs text-destructive/80",children:$})]})]}),a8=({file:M,downloading:$,downloadLabel:P,downloadingLabel:Z,onDownload:X,onRemove:H})=>E0("div",{className:"flex w-full items-center justify-between",children:[E0("div",{className:"flex items-center gap-3",children:[M.previewUrl!==void 0&&M.previewUrl!==null&&M.previewUrl!==""?E0(e8,{children:[v("span",{"aria-hidden":"true",className:"h-20 w-28 shrink-0 rounded-md border border-input bg-background bg-contain bg-center bg-no-repeat",style:{backgroundImage:`url(${M.previewUrl})`}}),v("span",{className:"sr-only",children:M.name})]}):v("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[color-mix(in_oklab,var(--success)_14%,var(--card))]",children:v(F3,{className:"h-5 w-5 text-(--success)"})}),E0("div",{className:"flex flex-col",children:[E0("div",{className:"flex items-center gap-2",children:[v(K3,{className:"h-4 w-4 text-muted-foreground"}),v("span",{className:"text-sm font-medium text-foreground",children:M.name})]}),v("span",{className:"text-xs text-muted-foreground",children:l8(M.size)})]})]}),E0("div",{className:"flex shrink-0 items-center gap-1",children:[X?v(S,{"aria-label":$?Z:P,className:"h-8 w-8 rounded-full p-0",disabled:$,onClick:X,size:"sm",title:$?Z:P,type:"button",variant:"ghost",children:$?v(c0,{className:"h-4 w-4 animate-spin"}):v(q3,{className:"h-4 w-4"})}):null,H?v(S,{className:"h-8 w-8 rounded-full p-0 hover:bg-destructive/10",onClick:H,size:"sm",type:"button",variant:"ghost",children:v(W1,{className:"h-4 w-4 text-destructive"})}):null]})]}),s8=(M)=>{let{rootProps:$,inputProps:P,isDragActive:Z,selectedFile:X,error:H,onRemoveFile:W,onDownloadFile:J,isDownloadingFile:Y,disabled:Q,className:U,labels:G}=M,F={...i8,...G},B=X!==void 0&&X!==null,q=H!==void 0&&H!==null&&H!=="";return v("div",{className:f("w-full",U),children:E0("div",{...$,className:f("relative flex min-h-24 cursor-pointer items-center justify-center rounded-lg border-2 border-dashed bg-transparent px-4 py-5 transition-all",Z===!0?"border-primary bg-[color-mix(in_oklab,var(--primary)_8%,var(--card))]":"border-input hover:border-input",B&&"border-[color-mix(in_oklab,var(--success)_60%,var(--border))] bg-[color-mix(in_oklab,var(--success)_10%,transparent)]",q&&"border-destructive bg-[color-mix(in_oklab,var(--destructive)_10%,var(--card))]",Q===!0&&"cursor-not-allowed opacity-60",$?.className),children:[v("input",{...P}),!B&&!q?v(t8,{active:Boolean(Z),activeLabel:F.dragActive,hint:F.fileTypeHint,inactiveLabel:F.dragInactive}):null,X!==void 0&&X!==null&&!q?v(a8,{downloadLabel:F.downloadFile,downloading:Boolean(Y),downloadingLabel:F.downloadingFile,file:X,onDownload:J,onRemove:W}):null,H!==void 0&&H!==null&&H!==""?v(n8,{message:H,retryLabel:F.errorRetry}):null]})})},M9=s8;import{jsx as N3,jsxs as P9}from"react/jsx-runtime";var $9=f0("inline-flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full border font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{active:!1,size:"md"},variants:{active:{false:"border-(--border-subtle) bg-(--bg-surface)/60 text-(--text-secondary) hover:border-(--border-default) hover:text-(--text-primary)",true:"border-[color-mix(in_oklab,var(--accent)_35%,var(--border))] bg-(--bg-accent-soft) text-(--text-primary)"},size:{md:"h-8 px-3.5 text-[13px]",sm:"h-7 px-3 text-[12px]"}}}),L3=({options:M,value:$,onValueChange:P,label:Z,size:X,className:H,classes:W,...J})=>N3("div",{"aria-label":Z,className:f("flex flex-wrap items-center gap-1.5",W?.root,H),...J,children:M.map((Y)=>{let Q=Y.value===$;return P9("button",{type:"button","aria-pressed":Q,disabled:Y.disabled,onClick:()=>{P(Y.value)},className:f($9({active:Q,size:X}),W?.chip),children:[Y.label,Y.count===void 0?null:N3("span",{className:f("tabular-nums text-[11px] text-(--text-muted)",W?.count),children:Y.count})]},Y.value)})});L3.displayName="FilterChips";var Z9=L3;import*as l1 from"react";import{jsx as d0,jsxs as U9}from"react/jsx-runtime";var X9=52,H9=26,Z5=4,P5=20,W9=(M)=>({"--flow-lane":M}),z3=l1.createContext(null),w3=(M)=>{let $=l1.useContext(z3);if(!$)throw Error(`${M} must be rendered inside a FlowBand.`);return $},J9=({lanes:M=1,stepHeight:$=X9,laneHeight:P=H9,className:Z,style:X,children:H,...W})=>{let J=Math.max($,M*P+(M-1)*Z5),Y=l1.useMemo(()=>({height:J,stepHeight:$}),[J,$]);return d0(z3.Provider,{value:Y,children:d0("div",{className:f("flex min-w-0 items-stretch gap-1",Z),style:{height:J,...X},...W,children:H})})},Y9=({className:M,style:$,children:P,...Z})=>{let{stepHeight:X}=w3("FlowStep");return d0("div",{className:f("flex min-w-0 flex-1 items-stretch self-center",M),style:{height:X,...$},...Z,children:P})},V3=({centers:M,height:$,colors:P,merge:Z=!1})=>{let X=$/2,H=7;return d0("svg",{"aria-hidden":!0,width:P5,height:$,viewBox:`0 0 ${P5} ${$}`,className:"shrink-0",style:Z?{transform:"scaleX(-1)"}:void 0,children:M.map((W,J)=>{let Y=P[J];return d0("path",{style:W9(Y),d:`M0 ${X}H7C13 ${X} ${P5-6} ${W} ${P5} ${W}`,fill:"none",strokeWidth:1.5,strokeLinecap:"round",className:Y!==void 0&&Y!==""?"stroke-[color-mix(in_oklab,var(--flow-lane)_45%,var(--border))]":"stroke-border"},J)})})},Q9=(M,$)=>{let P=($-Z5*(M-1))/M;return Array.from({length:M},(Z,X)=>X*(P+Z5)+P/2)},f9=({lanes:M,fork:$=!0,rejoin:P=!0,label:Z,className:X,...H})=>{let{height:W}=w3("FlowBranch"),J=Q9(M.length,W),Y=M.map((Q)=>Q.color);return U9("div",{"aria-label":Z,className:f("flex min-w-0 flex-1 items-stretch",X),...H,children:[$&&d0(V3,{centers:J,height:W,colors:Y}),d0("div",{className:"flex min-w-0 flex-1 flex-col",style:{gap:Z5},children:M.map((Q)=>d0("div",{className:"flex min-w-0 flex-1 items-stretch overflow-hidden",children:Q.content},Q.key))}),P&&d0(V3,{centers:J,height:W,colors:Y,merge:!0})]})};import*as T3 from"react";import{jsx as QM,jsxs as F9}from"react/jsx-runtime";var G9=({index:M,className:$,children:P,...Z},X)=>F9("div",{ref:X,className:f("grid grid-cols-[1.75rem_1fr] gap-x-3 leading-relaxed",$),...Z,children:[QM("div",{className:"pt-[1px] text-right",children:QM(j1,{className:"opacity-80",children:M})}),QM("p",{className:"text-[13px] text-muted-foreground",children:P})]}),O3=T3.forwardRef(G9);O3.displayName="GuideStep";var q9=O3;import*as t1 from"react";import{jsx as U0,jsxs as i1,Fragment as B9}from"react/jsx-runtime";var A3=t1.forwardRef(function({className:$,variant:P="island",...Z},X){return U0(N1,{ref:X,variant:P,className:f("p-0",$),...Z})});A3.displayName="HierarchyTree";var k3=t1.forwardRef(function({title:$,icon:P,count:Z,actions:X,className:H,...W},J){return i1("div",{ref:J,"data-slot":"hierarchy-tree-header",className:f("flex flex-wrap items-center gap-3 border-b border-border px-4 py-3",H),...W,children:[i1("div",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",children:[P!==void 0&&P!==null?U0("span",{className:"shrink-0 text-muted-foreground [&_svg]:h-4 [&_svg]:w-4",children:P}):null,U0("span",{className:"min-w-0 truncate",children:$}),Z!==void 0&&Z!==null?U0("span",{className:"rounded-full bg-muted px-2 py-0.5 text-xs font-normal text-muted-foreground",children:Z}):null]}),X!==void 0&&X!==null?U0("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:X}):null]})});k3.displayName="HierarchyTreeHeader";var _3=t1.forwardRef(function({className:$,...P},Z){return U0("div",{ref:Z,"data-slot":"hierarchy-tree-body",className:f("min-w-0",$),...P})});_3.displayName="HierarchyTreeBody";var K9=[],E3=t1.forwardRef(function({depth:$,rails:P=K9,isLastChild:Z=!1,hasChildren:X=!1,contentClassName:H,className:W,children:J,...Y},Q){let U=Math.max(1,$);return i1("div",{ref:Q,"data-slot":"hierarchy-tree-row","data-depth":U,className:f("group flex items-stretch transition-colors hover:bg-muted/40",U===1&&"border-t border-border first:border-t-0",W),...Y,children:[U>1?i1("div",{"aria-hidden":!0,className:"flex shrink-0 pl-5",children:[P.map((G,F)=>U0("span",{className:"relative w-5",children:G?U0("span",{className:"absolute inset-y-0 left-0 border-l border-(--border-subtle)"}):null},F)),U0("span",{className:"relative w-5",children:Z?U0("span",{className:f("absolute left-0 top-0 h-[22px] rounded-bl-md border-b border-l border-(--border-subtle)",X?"w-full":"w-14")}):i1(B9,{children:[U0("span",{className:"absolute inset-y-0 left-0 border-l border-(--border-subtle)"}),U0("span",{className:f("absolute left-0 top-[22px] border-t border-(--border-subtle)",X?"w-full":"w-14")})]})})]}):null,U0("div",{className:f("flex min-w-0 flex-1 items-start gap-2 py-3 pl-2 pr-3",H),children:J})]})});E3.displayName="HierarchyTreeRow";var R3=t1.forwardRef(function({expanded:$,count:P,visible:Z=!0,className:X,...H},W){return i1(S,{ref:W,type:"button",variant:"ghost",size:"sm",className:f("h-6 shrink-0 gap-0.5 px-1 text-xs text-muted-foreground",!Z&&"invisible",X),...H,children:[U0(J1,{className:f("h-3.5 w-3.5 transition-transform",$&&"rotate-90")}),P]})});R3.displayName="HierarchyTreeToggle";var N9=A3;import L9,{useState as V9}from"react";import{jsx as s,jsxs as L0}from"react/jsx-runtime";var z9=f0("font-mono text-sm rounded-md overflow-hidden flex flex-col",{defaultVariants:{size:"md",variant:"default"},variants:{size:{lg:"p-4 text-base",md:"p-3",sm:"p-2 text-xs"},variant:{default:"bg-card border border-border",filled:"bg-muted",outlined:"border border-border"}}}),fM=({value:M,ancestors:$})=>{if(M===null||M===void 0)return M;if(M===!0||M===!1)return M;let P=Object.prototype.toString.call(M);if(P==="[object String]"){let Z=JSON.stringify(M);return Z===void 0?P:Z.slice(1,-1)}if(P==="[object Number]")return Number(M);if(Array.isArray(M)){if($.has(M))return"[Circular]";$.add(M);let Z=M.map((X)=>fM({ancestors:$,value:X}));return $.delete(M),Z}if(M instanceof Object){if($.has(M))return"[Circular]";$.add(M);let Z=Object.fromEntries(Object.entries(M).map(([X,H])=>[X,fM({ancestors:$,value:H})]));return $.delete(M),Z}return P},w9=(M)=>{if(M===null||M===void 0)return"text-gray-500 dark:text-gray-400";if(String(M)===M)return"text-green-600 dark:text-green-400";if(M===!0||M===!1)return"text-amber-600 dark:text-amber-400";return"text-blue-600 dark:text-blue-400"},T9=(M)=>{if(M===null)return"null";if(M===void 0)return"undefined";if(String(M)===M)return`"${M}"`;return String(M)},O9=(M)=>M,A9=(M)=>M!==null&&Object(M)===M,k9=(M,$)=>{if(M)return s("span",{className:"w-4"});return $?s(Y1,{className:"w-4 h-4"}):s(J1,{className:"w-4 h-4"})},_9=(M)=>M?{close:"]",open:"["}:{close:"}",open:"{"},E9=(M,$,P)=>M?{name:null,path:`${P}[${$}]`}:{name:String($),path:`${P}.${$}`},R9=({data:M,className:$,classes:P,variant:Z,size:X,expandAll:H=!1,expandRoot:W=!0,indentSize:J=16,showLineNumbers:Y=!1,showToolbar:Q=!1,maxHeight:U,maxWidth:G,renderValue:F})=>{let B=L9.useMemo(()=>fM({ancestors:new WeakSet,value:M}),[M]),[q,N]=V9(()=>{let O={};if(W)O.root=!0;return O}),A=(O,k)=>{if(O==="root"&&q[O]===void 0)return W;return q[O]??k},w=(O)=>{N((k)=>({...k,[O]:!A(O,H)}))},L=(O)=>{N({})},V=()=>{try{let O=JSON.stringify(B,null,2);navigator.clipboard.writeText(O),K1.success("Copied to clipboard",{description:"JSON data has been copied to clipboard",duration:3000})}catch(O){console.error("Failed to copy JSON to clipboard",O),K1.error("Copy failed",{description:"Failed to copy JSON to clipboard",duration:3000})}},T={maxWidth:G??"auto"},_=(O,k,I,R,u)=>{let r=[],x=A9(k),t=Array.isArray(k),X0=x&&Object.keys(k).length===0,W0=_9(t),j={marginLeft:I*J},G0=O9(R),c=u;if(!x){let C=F?.(k,R);return r.push(L0("div",{className:"flex",children:[Y&&s("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:c}),L0("div",{className:"flex min-w-0",style:j,children:[s("span",{"aria-hidden":!0,className:"mr-1 w-4 shrink-0"}),O!==null&&L0("span",{className:"shrink-0 text-purple-600 dark:text-purple-400",children:[`"${O}":`,s("span",{className:"text-gray-600 dark:text-gray-400 mr-1",children:" "})]}),C??s("span",{className:f("min-w-0 break-all",w9(k)),children:T9(k)})]})]},G0)),[r,c+1]}let J0=A(R,H),y=k9(X0,J0);if(r.push(L0("div",{className:"flex items-start group",children:[Y&&s("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:c}),L0("div",{className:"flex items-start",style:j,children:[s("button",{onClick:()=>{w(R)},className:"mr-1 w-4 h-4 mt-0.5 focus:outline-none opacity-60 hover:opacity-100","aria-label":J0?"Collapse":"Expand",tabIndex:0,type:"button",children:y}),L0("div",{children:[O!==null&&L0("span",{className:"text-purple-600 dark:text-purple-400",children:[`"${O}":`,s("span",{className:"text-gray-600 dark:text-gray-400 mr-1",children:" "})]}),s("span",{className:"text-gray-600 dark:text-gray-400",children:W0.open}),X0||!J0?L0("span",{className:"text-gray-600 dark:text-gray-400",children:[X0?"":"...",W0.close]}):null]})]})]},`${G0}-open`)),c+=1,J0&&!X0){let C=c,b=t?k.map((n,F0)=>[F0,n]):Object.entries(k);for(let[n,F0]of b){let a=E9(t,n,R),[t0,D]=_(a.name,F0,I+1,a.path,C);r.push(...t0),C=D}return r.push(L0("div",{className:"flex",children:[Y&&s("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:C}),s("div",{className:"text-gray-600 dark:text-gray-400",style:j,children:W0.close})]},`${G0}-close`)),C+=1,[r,C]}return[r,c]},[z]=_(null,B,0,"root",1);return L0("div",{className:f(z9({size:X,variant:Z}),P?.root,$),style:T,children:[Q&&L0("div",{className:f("flex justify-between items-center px-3 py-2 border-b border-border bg-muted/50",P?.toolbar),children:[s("div",{className:"text-sm font-medium",children:"JSON Viewer"}),L0("div",{className:"flex gap-2",children:[s(S,{size:"sm",variant:"outline",onClick:()=>{L(!0)},children:"Expand All"}),s(S,{size:"sm",variant:"outline",onClick:()=>{L(!1)},children:"Collapse All"}),L0(S,{size:"sm",variant:"outline",onClick:V,children:[s(x0,{className:"w-4 h-4 mr-1"}),"Copy"]})]})]}),s("div",{className:f("overflow-auto flex-1",P?.content),style:{maxHeight:U??void 0},children:z})]})},UM=R9;import{useId as S9,useState as D9}from"react";import y9 from"react-markdown";import{jsx as r0,jsxs as GM,Fragment as I9}from"react/jsx-runtime";var y3=({mode:M,onModeChange:$,labels:P,disabled:Z=!1,className:X})=>{let H=M==="write"?"preview":"write",W=H==="write"?P.write:P.preview,J=H==="write"?P.writeTitle??P.write:P.previewTitle??P.preview;return r0(S,{type:"button",variant:"ghost",size:"icon",className:f("size-7",X),disabled:Z,"aria-label":W,title:J,onClick:()=>{$(H)},children:H==="preview"?r0(Q1,{className:"size-3.5 text-muted-foreground"}):r0(S3,{className:"size-3.5 text-muted-foreground"})})},m9=({label:M,value:$,onValueChange:P,emptyPreview:Z,toggleLabels:X,mode:H,defaultMode:W="write",onModeChange:J,previewValue:Y=$,disabled:Q=!1,placeholder:U,editorId:G,showHeader:F=!0,footer:B,className:q,editorClassName:N,previewClassName:A,textareaProps:w})=>{let L=S9(),V=G??L,[T,_]=D9(W),z=H??T,O=(k)=>{if(H===void 0)_(k);J?.(k)};return GM("div",{className:f("grid gap-2",q),children:[F&&GM("div",{className:"flex items-center justify-between gap-3",children:[r0(H1,{htmlFor:z==="write"?V:void 0,children:M}),r0(y3,{mode:z,onModeChange:O,labels:X,disabled:Q})]}),z==="write"?GM(I9,{children:[r0(D3,{...w,id:V,value:$,disabled:Q,placeholder:U,"aria-label":F?w?.["aria-label"]:w?.["aria-label"]??M,className:f("min-h-48 resize-y font-mono text-sm",N),onChange:(k)=>{P(k.target.value)}}),B]}):r0("div",{"aria-label":`${M} ${X.preview}`,className:f("prose prose-sm max-w-none rounded-lg border bg-muted/30 p-4 dark:prose-invert [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",A),children:Y.trim()?r0(y9,{children:Y}):r0("div",{className:"not-prose text-muted-foreground",children:Z})})]})};import{jsx as X5,jsxs as g9}from"react/jsx-runtime";var b9=({open:M,onOpenChange:$,title:P="JSON Viewer",data:Z,jsonViewerProps:X})=>X5(n1,{open:M,onOpenChange:$,children:g9(a1,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[X5(s1,{children:X5(e1,{children:P})}),X5(UM,{data:Z,className:"min-h-0 flex-1",variant:"filled",size:"sm",showToolbar:!0,expandAll:!1,expandRoot:!0,...X})]})});import{jsx as m3,jsxs as I3}from"react/jsx-runtime";var C9=({href:M,children:$,className:P,external:Z=!1,linkComponent:X})=>{let H=f("inline-flex items-center gap-1 text-primary hover:underline",P);if(Z||!X)return I3("a",{href:M,...Z?{rel:"noopener noreferrer",target:"_blank"}:{},className:H,children:[$,m3(FM,{className:"h-3 w-3"})]});return I3(X,{to:M,className:H,children:[$,m3(FM,{className:"h-3 w-3"})]})};import{useState as u9}from"react";import{jsx as H5,jsxs as p9}from"react/jsx-runtime";var h9=({value:M,isSensitive:$=!1,className:P,maskChar:Z="•",showToggle:X=!0})=>{let[H,W]=u9(!$),Y=H?M:(()=>{if(M.startsWith("{")||M.startsWith("["))return`{ ${Z.repeat(10)} }`;return Z.repeat(Math.min(M.length,20))})(),Q=Y.slice(0,50)+(Y.length>50?"...":"");return p9("div",{className:f("flex items-center gap-2",P),children:[H5("code",{className:"text-sm bg-muted px-2 py-1 rounded flex-1 break-all",children:Q}),$&&X&&H5(S,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>{W(!H)},title:H?"Hide value":"Show value",children:H?H5(M2,{className:"h-3 w-3"}):H5(Q1,{className:"h-3 w-3"})})]})};import*as C3 from"react";import{jsx as b3,jsxs as g3}from"react/jsx-runtime";var u3=C3.forwardRef(function({icon:$,text:P,trailing:Z,className:X,...H},W){return g3("div",{ref:W,className:f("flex min-w-0 items-center gap-2",X),...H,children:[g3("div",{className:"flex min-w-0 flex-1 items-center gap-2 border-b border-dashed border-border py-2 text-[13px] text-muted-foreground",children:[$!==null&&$!==void 0?b3("span",{className:"text-primary/70",children:$}):null,b3("span",{className:"min-w-0 truncate",children:P})]}),Z]})});u3.displayName="MutedPlaceholder";var v9=u3;import{useMemo as j9,useState as x9}from"react";import{jsx as V0,jsxs as W5}from"react/jsx-runtime";var qM=({value:M,ancestors:$})=>{if(M===null||M===void 0)return M;if(M===!0||M===!1)return M;let P=Object.prototype.toString.call(M);if(P==="[object String]")return String.prototype.valueOf.call(M);if(P==="[object Number]")return Number(M);if(Array.isArray(M)){if($.has(M))return;$.add(M);let Z=M.map((X)=>qM({ancestors:$,value:X}));return $.delete(M),Z}if(M instanceof Object){if($.has(M))return;$.add(M);let Z=Object.fromEntries(Object.entries(M).map(([X,H])=>[X,qM({ancestors:$,value:H})]));return $.delete(M),Z}return},g0=(M)=>{if(M instanceof Object&&!Array.isArray(M))return M;return},f1=(M)=>Array.isArray(M)?M:void 0,h3=(M)=>Object.prototype.toString.call(M)==="[object String]"&&M===String.prototype.valueOf.call(M),KM=(M)=>h3(M)?M:void 0,c9=(M)=>f1(M)?.filter(h3)??[],d9=(M)=>{let $=f1(M.anyOf);if(!$)return M;let P=$.filter((Z)=>g0(Z)?.type!=="null");return P.length===1?g0(P[0])??M:M},p3=(M)=>{let $=KM(M.type);if($!==void 0&&$!=="")return $;if(f1(M.enum))return"enum";if(f1(M.oneOf)||f1(M.anyOf))return"variant";if(g0(M.properties))return"object";return"value"},v3=(M,$="schema")=>{let P=g0(M.properties);if(P){let X=new Set(c9(M.required));return Object.entries(P).flatMap(([H,W])=>{let J=g0(W);return J?[{name:H,path:`${$}.properties.${H}`,required:X.has(H),schema:J}]:[]})}if(p3(M)==="array"){let X=g0(M.items);return X?[{name:"Items",path:`${$}.items`,required:!0,schema:X}]:[]}let Z=f1(M.oneOf)??f1(M.anyOf)??f1(M.allOf);if(!Z)return[];return Z.flatMap((X,H)=>{let W=g0(X);return W?[{name:`Option ${H+1}`,path:`${$}.option.${H}`,required:!0,schema:W}]:[]})},BM=(M,$,P=new Set)=>{let Z=d9(M),X=KM(Z.$ref);if(X===void 0||X===""||!X.startsWith("#/$defs/")||P.has(X))return Z;let H=g0(g0($.$defs)?.[X.slice(8)]);if(!H)return Z;return BM(H,$,new Set([...P,X]))},j3=({child:M,depth:$,root:P,defaultExpandedDepth:Z})=>{let X=BM(M.schema,P),H=v3(X,M.path),[W,J]=x9($<Z),Y=p3(X),Q=KM(X.description),U=H.length>0,G=W?`Collapse ${M.name}`:`Expand ${M.name}`;return W5($2,{open:W,onOpenChange:J,children:[W5("div",{className:f("flex min-w-0 items-start border-b border-border/70 bg-background px-2.5 py-2 last:border-b-0",U&&"gap-2"),style:{paddingLeft:`${10+$*16}px`},children:[U?V0(P2,{"aria-label":G,className:"mt-0.5 shrink-0 rounded-sm text-muted-foreground outline-none transition hover:text-foreground focus-visible:ring-2 focus-visible:ring-primary/40",children:V0(J1,{className:f("size-3.5 transition-transform",W&&"rotate-90")})}):null,W5("div",{className:"min-w-0 flex-1",children:[W5("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[V0("span",{className:"break-all text-xs font-medium text-foreground",children:M.name}),V0("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:Y}),M.required?V0("span",{className:"text-[10px] font-medium text-destructive",children:"required"}):null]}),Q!==void 0&&Q!==""?V0("p",{className:"mt-0.5 text-xs leading-snug text-muted-foreground",children:Q}):null]})]}),U?V0(Z2,{children:V0("div",{className:"border-l border-border/70",children:H.map((F)=>V0(j3,{child:F,defaultExpandedDepth:Z,depth:$+1,root:P},F.path))})}):null]})},r9=({schema:M,className:$,defaultExpandedDepth:P=1,emptyLabel:Z="No fields"})=>{let X=j9(()=>qM({ancestors:new WeakSet,value:M}),[M]),H=g0(X);if(!H)return V0("p",{className:f("text-xs text-muted-foreground",$),children:Z});let W=BM(H,H),J=v3(W);if(!J.length)return V0("p",{className:f("text-xs text-muted-foreground",$),children:Z});return V0("div",{"aria-label":"Object schema",className:f("overflow-hidden rounded-lg border border-border",$),children:J.map((Y)=>V0(j3,{child:Y,defaultExpandedDepth:P,depth:0,root:H},Y.path))})};import C0,{createContext as D2,useContext as f2,useEffect as d,useState as R0,useCallback as S0,useMemo as i,useRef as Z0,memo as s9,useReducer as e9,cloneElement as gY,forwardRef as CY}from"react";import{createPortal as M7,unstable_batchedUpdates as F5}from"react-dom";import{useMemo as LM,useLayoutEffect as o9,useEffect as c3,useRef as X2,useCallback as J5}from"react";function d3(){for(var M=arguments.length,$=Array(M),P=0;P<M;P++)$[P]=arguments[P];return LM(()=>(Z)=>{$.forEach((X)=>X(Z))},$)}var k2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function L1(M){let $=Object.prototype.toString.call(M);return $==="[object Window]"||$==="[object global]"}function Y5(M){return"nodeType"in M}function Y0(M){var $,P;if(!M)return window;if(L1(M))return M;if(!Y5(M))return window;return($=(P=M.ownerDocument)==null?void 0:P.defaultView)!=null?$:window}function Q5(M){let{Document:$}=Y0(M);return M instanceof $}function H2(M){if(L1(M))return!1;return M instanceof Y0(M).HTMLElement}function VM(M){return M instanceof Y0(M).SVGElement}function V1(M){if(!M)return document;if(L1(M))return M.document;if(!Y5(M))return document;if(Q5(M))return M;if(H2(M)||VM(M))return M.ownerDocument;return document}var A0=k2?o9:c3;function f5(M){let $=X2(M);return A0(()=>{$.current=M}),J5(function(){for(var P=arguments.length,Z=Array(P),X=0;X<P;X++)Z[X]=arguments[X];return $.current==null?void 0:$.current(...Z)},[])}function r3(){let M=X2(null),$=J5((Z,X)=>{M.current=setInterval(Z,X)},[]),P=J5(()=>{if(M.current!==null)clearInterval(M.current),M.current=null},[]);return[$,P]}function W2(M,$){if($===void 0)$=[M];let P=X2(M);return A0(()=>{if(P.current!==M)P.current=M},$),P}function J2(M,$){let P=X2();return LM(()=>{let Z=M(P.current);return P.current=Z,Z},[...$])}function _2(M){let $=f5(M),P=X2(null),Z=J5((X)=>{if(X!==P.current)$==null||$(X,P.current);P.current=X},[]);return[P,Z]}function U5(M){let $=X2();return c3(()=>{$.current=M},[M]),$.current}var NM={};function z1(M,$){return LM(()=>{if($)return $;let P=NM[M]==null?0:NM[M]+1;return NM[M]=P,M+"-"+P},[M,$])}function o3(M){return function($){for(var P=arguments.length,Z=Array(P>1?P-1:0),X=1;X<P;X++)Z[X-1]=arguments[X];return Z.reduce((H,W)=>{let J=Object.entries(W);for(let[Y,Q]of J){let U=H[Y];if(U!=null)H[Y]=U+M*Q}return H},{...$})}}var w1=o3(1),T1=o3(-1);function l9(M){return"clientX"in M&&"clientY"in M}function E2(M){if(!M)return!1;let{KeyboardEvent:$}=Y0(M.target);return $&&M instanceof $}function i9(M){if(!M)return!1;let{TouchEvent:$}=Y0(M.target);return $&&M instanceof $}function G5(M){if(i9(M)){if(M.touches&&M.touches.length){let{clientX:$,clientY:P}=M.touches[0];return{x:$,y:P}}else if(M.changedTouches&&M.changedTouches.length){let{clientX:$,clientY:P}=M.changedTouches[0];return{x:$,y:P}}}if(l9(M))return{x:M.clientX,y:M.clientY};return null}var U1=Object.freeze({Translate:{toString(M){if(!M)return;let{x:$,y:P}=M;return"translate3d("+($?Math.round($):0)+"px, "+(P?Math.round(P):0)+"px, 0)"}},Scale:{toString(M){if(!M)return;let{scaleX:$,scaleY:P}=M;return"scaleX("+$+") scaleY("+P+")"}},Transform:{toString(M){if(!M)return;return[U1.Translate.toString(M),U1.Scale.toString(M)].join(" ")}},Transition:{toString(M){let{property:$,duration:P,easing:Z}=M;return $+" "+P+"ms "+Z}}}),x3="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function l3(M){if(M.matches(x3))return M;return M.querySelector(x3)}import i3,{useState as t9,useCallback as n9}from"react";var a9={display:"none"};function t3(M){let{id:$,value:P}=M;return i3.createElement("div",{id:$,style:a9},P)}function n3(M){let{id:$,announcement:P,ariaLiveType:Z="assertive"}=M,X={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return i3.createElement("div",{id:$,style:X,role:"status","aria-live":Z,"aria-atomic":!0},P)}function a3(){let[M,$]=t9("");return{announce:n9((Z)=>{if(Z!=null)$(Z)},[]),announcement:M}}var fP=D2(null);function $7(M){let $=f2(fP);d(()=>{if(!$)throw Error("useDndMonitor must be used within a children of <DndContext>");return $(M)},[M,$])}function P7(){let[M]=R0(()=>new Set),$=S0((Z)=>{return M.add(Z),()=>M.delete(Z)},[M]);return[S0((Z)=>{let{type:X,event:H}=Z;M.forEach((W)=>{var J;return(J=W[X])==null?void 0:J.call(W,H)})},[M]),$]}var Z7={draggable:`
2
+ import{mo,yt,go,te,ho,Ut,Ve,ce,vo,xo,bo,yo,Co,lt,Ct,ct,We,wo,So,Ge}from"../../index-q2bgrvjz.js";import{p,n}from"../../index-87bxrmfq.js";import{f,m}from"../../index-s7dyqth2.js";import{M,D,V,ro,T,Z,g,b}from"../../index-7gzq3np4.js";import{$e,Ye,Ke,ue,Rt,oe,Xe,de,fe,pe,ae,Ze,me,Je,Y,A,R,P,I,mt,Qe,Lt,kt,Mt,Dt,Tt,Nt,At,Et,Ot,_t,Ft,He,et,tt,ot,K,zt,Ht,gt,ht,Wt,Gt}from"../../index-38cmkpwj.js";import{at,rt,nt}from"../../index-whabarfn.js";import{no}from"../../index-ckt9z566.js";import{vt}from"../../index-24awe3d6.js";import{ut,k,dt,_e,Fe,ft,Be}from"../../index-vs10z2rc.js";import{v,C}from"../../index-9nkdbb33.js";import"../../index-1hg2mydq.js";import{e}from"../../index-x6g6brsv.js";import{jsx as sc,jsxs as ic}from"react/jsx-runtime";var ac=({children:t,loading:r=!1,fullWidth:o=!1,className:a,disabled:s,variant:i,size:l,...c})=>ic(n,{variant:i,size:l,className:e(o&&"w-full",a),disabled:s===!0||r,...c,children:[r&&sc(Ge,{size:20,className:"mr-2"}),t]}),lc=ac;import*as Ja from"react";import{jsx as $a,jsxs as dc}from"react/jsx-runtime";var cc=({children:t,className:r,type:o="button",...a},s)=>dc(n,{ref:s,type:o,variant:"ghost",size:"sm",className:e("h-9 rounded-full border border-dashed border-border/80 bg-background px-3 text-xs font-medium text-muted-foreground shadow-xs transition-[transform,color,background-color,border-color] hover:border-primary/35 hover:bg-muted/45 hover:text-foreground active:scale-[0.98]",r),...a,children:[$a("span",{className:"mr-2 inline-flex size-5 items-center justify-center rounded-full border border-border/70 bg-muted/45 text-foreground",children:$a(We,{className:"size-3.5"})}),t]}),Vn=Ja.forwardRef(cc);Vn.displayName="AddItemButton";var uc=Vn;import{forwardRef as pc}from"react";import{jsx as fc}from"react/jsx-runtime";var ja=(t,r,o)=>{if(r<1||r>12||o<1||o>31)return!1;let a=new Date(t,r-1,o);return a.getFullYear()===t&&a.getMonth()===r-1&&a.getDate()===o},mc=(t)=>{let r=t.trim();if(!r)return null;let o=/^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/u.exec(r);if(o){let{year:s,month:i,day:l}=o.groups??{};return ja(Number(s),Number(i),Number(l))?`${s}-${i}-${l}`:null}let a=/^(?<day>\d{1,2})[/\-.](?<month>\d{1,2})[/\-.](?<year>\d{4})$/u.exec(r);if(a){let{day:s,month:i,year:l}=a.groups??{},c=Number(s),d=Number(i),u=Number(l);if(!ja(u,d,c))return null;return`${u}-${String(d).padStart(2,"0")}-${String(c).padStart(2,"0")}`}return null},Ga=pc(function({onPaste:r,...o},a){return fc(g,{ref:a,type:"date",onPaste:(i)=>{let l=i.clipboardData.getData("text"),c=mc(l);if(c!==null&&c!==""){i.preventDefault();let d=i.currentTarget,u=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set?.bind(d);if(u!==void 0)u(c),d.dispatchEvent(new Event("input",{bubbles:!0}))}r?.(i)},...o})});Ga.displayName="DateInput";var gc=Ga;import*as Wa from"react";import{jsx as vc}from"react/jsx-runtime";var Xa=p("font-display font-bold leading-[1.06] tracking-tight text-foreground",{defaultVariants:{size:"lg"},variants:{size:{lg:"text-[1.5rem] sm:text-[1.85rem]",md:"text-[1.15rem] sm:text-[1.25rem]",sm:"text-[1rem]",xl:"text-[2.1rem] sm:text-[2.5rem]"}}}),bc=({as:t="h2",size:r,className:o,...a},s)=>vc(t,{ref:s,className:e(Xa({size:r}),o),...a}),Ua=Wa.forwardRef(bc);Ua.displayName="DisplayHeading";var hc=Ua;import*as xr from"react";import{jsx as Gr,jsxs as Ya,Fragment as Ka}from"react/jsx-runtime";var Bn=xr.forwardRef(function({value:r,label:o,variant:a="icon",copyLabel:s="Copy",copiedLabel:i="Copied",errorMessage:l="Failed to copy to clipboard",resetDelay:c=1500,className:d,onClick:u,...h},x){let[y,S]=xr.useState(!1),w=xr.useRef(null);xr.useEffect(()=>()=>{if(w.current!==null)clearTimeout(w.current)},[]);let L=async(z)=>{u?.(z);try{if(await navigator.clipboard.writeText(r),S(!0),w.current!==null)clearTimeout(w.current);w.current=setTimeout(()=>{S(!1)},c)}catch{K.error(l)}};if(a==="button")return Gr(n,{ref:x,type:"button",variant:"outline",onClick:(z)=>{L(z)},"aria-label":`Copy ${o}`,className:e("shrink-0",d),...h,children:y?Ya(Ka,{children:[Gr(f,{className:"mr-1 size-4"}),i]}):Ya(Ka,{children:[Gr(te,{className:"mr-1 size-4"}),s]})});return Gr("button",{ref:x,type:"button",onClick:(z)=>{L(z)},"aria-label":`Copy ${o}`,className:e("flex size-8 shrink-0 items-center justify-center rounded-md border border-border bg-card text-muted-foreground transition hover:border-primary/40 hover:text-primary",d),...h,children:y?Gr(f,{className:"size-3.5 text-primary"}):Gr(te,{className:"size-3.5"})})});Bn.displayName="CopyButton";var xc=Bn;import{jsx as Wo,jsxs as yc}from"react/jsx-runtime";var qa="#a3d54a",Za=({className:t,...r})=>yc("svg",{...r,"aria-hidden":"true",className:e("size-6 shrink-0",t),"data-slot":"collective-intelligence-loader",fill:"none",viewBox:"0 0 24 24",children:[Wo("polyline",{className:"origin-center motion-safe:animate-[ci-breathe-left_1.8s_ease-in-out_infinite]",points:"10,5.5 4.5,12 10,18.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.2}),Wo("polyline",{className:"origin-center motion-safe:animate-[ci-breathe-right_1.8s_ease-in-out_infinite]",points:"14,5.5 19.5,12 14,18.5",stroke:qa,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.2}),Wo("circle",{className:"origin-center [transform-box:fill-box] motion-safe:animate-[ci-pulse-dot_1.8s_ease-in-out_infinite]",cx:12,cy:12,fill:qa,r:2.3})]});Za.displayName="CollectiveIntelligenceLoader";var wc=Za;import{jsx as Rc}from"react/jsx-runtime";var Nc=({children:t,className:r})=>Rc("div",{className:e("text-destructive text-sm text-center",r),children:t}),Cc=Nc;import*as Qa from"react";import{jsx as Pc}from"react/jsx-runtime";var Sc=({value:t,fallback:r="—",locale:o,className:a,...s},i)=>Pc("span",{ref:i,className:e("tabular-nums",a),...s,children:t===null||t===void 0?r:new Intl.NumberFormat(o).format(t)}),es=Qa.forwardRef(Sc);es.displayName="FormattedNumber";var Tc=es;import*as ts from"react";import{jsx as Dc}from"react/jsx-runtime";var kc={accent:"bg-[color-mix(in_oklab,var(--chart-1)_12%,var(--card))] text-[color-mix(in_oklab,var(--chart-1)_85%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-1)_22%,var(--border))]",gold:"bg-[color-mix(in_oklab,var(--chart-3)_15%,var(--card))] text-[color-mix(in_oklab,var(--chart-3)_65%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-3)_28%,var(--border))]",neutral:"bg-(--bg-surface-alt)/70 text-(--text-secondary) border-(--border-subtle)",sage:"bg-[color-mix(in_oklab,var(--chart-2)_14%,var(--card))] text-[color-mix(in_oklab,var(--chart-2)_70%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-2)_26%,var(--border))]",sky:"bg-[color-mix(in_oklab,var(--chart-4)_14%,var(--card))] text-[color-mix(in_oklab,var(--chart-4)_70%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-4)_26%,var(--border))]",violet:"bg-[color-mix(in_oklab,var(--chart-5)_14%,var(--card))] text-[color-mix(in_oklab,var(--chart-5)_70%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-5)_26%,var(--border))]"},Lc={lg:"size-12 rounded-lg text-[17px] [&_svg]:size-6",md:"size-10 rounded-lg text-[15px] [&_svg]:size-5",sm:"size-8 rounded-md text-[13px] [&_svg]:size-4"},rs=ts.forwardRef(function({tone:r="neutral",size:o="md",initial:a,className:s,children:i,...l},c){return Dc("span",{ref:c,"aria-hidden":!0,className:e("inline-flex shrink-0 select-none items-center justify-center border font-display font-bold",Lc[o],kc[r],s),...l,children:i??(a!==void 0&&a!==""?a.slice(0,2).toUpperCase():null)})});rs.displayName="IconTile";var Ec=rs;import*as ns from"react";import{jsx as Ac}from"react/jsx-runtime";var Mc={accent:"text-(--accent)",copper:"text-(--text-muted)",default:"text-(--text-muted)",muted:"text-(--text-muted)"},Ic=({as:t="span",tone:r="default",className:o,...a},s)=>Ac(t,{ref:s,className:e("inline-block text-[11px] font-semibold uppercase tracking-[0.06em]",Mc[r],o),...a}),Wr=ns.forwardRef(Ic);Wr.displayName="Kicker";var Oc=Wr;import*as os from"react";import{jsx as Bc}from"react/jsx-runtime";var Hc=(t)=>`+${t}`,Vc=({expanded:t,hiddenCount:r,collapsedLabel:o=Hc,expandedLabel:a="Show less",onToggle:s,className:i,...l},c)=>Bc("button",{ref:c,type:"button",onClick:s,className:e("inline-flex items-center gap-1 rounded-full border border-dashed border-muted-foreground/40 bg-muted/20 px-2.5 py-1 text-[11px] font-medium text-muted-foreground hover:bg-muted/40 hover:text-foreground transition-colors",i),...l,children:t?a:o(r)}),as=os.forwardRef(Vc);as.displayName="ShowMoreTag";var Fc=as;import*as ss from"react";import{jsx as $c}from"react/jsx-runtime";var _c=p("font-sans leading-none tabular-nums text-primary",{defaultVariants:{size:"md"},variants:{size:{lg:"text-[1.4rem]",md:"text-[1.1rem]",sm:"text-[0.95rem]",xl:"text-[2rem]"}}}),zc=({size:t,className:r,...o},a)=>$c("span",{ref:a,className:e(_c({size:t}),r),...o}),Xr=ss.forwardRef(zc);Xr.displayName="SerifNumeral";var Jc=Xr;import{jsx as Xo,jsxs as Gc}from"react/jsx-runtime";var Uo=9,is=2*Math.PI*Uo,jc=(t,r,o)=>{if(!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(o))return 0;if(o<=r)return 0;return Math.min(1,Math.max(0,(t-r)/(o-r)))},ls=({className:t,classes:r,label:o,max:a=100,min:s=0,title:i,value:l,"aria-label":c,...d})=>{let u=jc(l,s,a),h=Math.round(u*100),x=s+u*(a-s),y=is*(1-u);return Xo("span",{"aria-label":c??`${o}: ${h}%`,"aria-valuemax":a,"aria-valuemin":s,"aria-valuenow":x,className:e("grid size-8 shrink-0 place-items-center text-muted-foreground",r?.root,t),title:i??`${o} ${h}%`,...d,children:Gc("svg",{"aria-hidden":"true",className:e("size-6 -rotate-90",r?.svg),viewBox:"0 0 24 24",children:[Xo("circle",{className:e("stroke-muted",r?.track),cx:"12",cy:"12",fill:"none",r:Uo,strokeWidth:"3"}),Xo("circle",{className:e("stroke-foreground transition-[stroke-dashoffset]",r?.indicator),cx:"12",cy:"12",fill:"none",r:Uo,strokeDasharray:is,strokeDashoffset:y,strokeLinecap:"round",strokeWidth:"3"})]})})};ls.displayName="Ring";var Wc=ls;import*as us from"react";import{jsx as ds,jsxs as Kc}from"react/jsx-runtime";var cs={danger:"bg-destructive",neutral:"bg-muted-foreground/40",primary:"bg-primary",success:"bg-emerald-500",warning:"bg-amber-500"},Xc={md:"size-2",sm:"size-1.5"},Uc=({tone:t="neutral",pulse:r=!1,size:o="sm",className:a,...s},i)=>Kc("span",{ref:i,className:e("relative inline-flex shrink-0",Xc[o],a),...s,children:[r&&ds("span",{"aria-hidden":!0,className:e("absolute inline-flex h-full w-full animate-ping rounded-full opacity-60",cs[t])}),ds("span",{"aria-hidden":!0,className:e("relative inline-flex h-full w-full rounded-full",cs[t])})]}),Fn=us.forwardRef(Uc);Fn.displayName="StatusDot";var Yc=Fn;import*as fs from"react";import{jsx as ms,jsxs as ps}from"react/jsx-runtime";var qc={neutral:"border-(--border-subtle) bg-card text-muted-foreground",warning:"border-[color-mix(in_oklab,var(--warning)_40%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_12%,var(--card))] text-[color-mix(in_oklab,var(--warning)_75%,var(--foreground))]"},Zc=({tooltip:t,tone:r="neutral",icon:o,className:a,children:s,...i},l)=>ps(et,{children:[ms(tt,{asChild:!0,children:ps(ue,{ref:l,variant:"outline",className:e(qc[r],a),...i,children:[o,s]})}),ms(ot,{children:t})]}),gs=fs.forwardRef(Zc);gs.displayName="TooltipBadge";var Qc=gs;import*as bs from"react";import{jsx as td}from"react/jsx-runtime";var ed={body1:{className:"text-base",tag:"p"},body2:{className:"text-sm",tag:"p"},h1:{className:"text-2xl font-semibold",tag:"h1"},h2:{className:"text-xl font-bold",tag:"h2"},h3:{className:"text-lg font-semibold",tag:"h3"},h4:{className:"text-base font-medium",tag:"h4"},subtitle1:{className:"text-base font-normal text-muted-foreground",tag:"h6"},subtitle2:{className:"text-sm font-medium text-muted-foreground",tag:"h6"}},_n=bs.forwardRef(function({variant:r="body1",as:o,className:a,...s},i){let{tag:l,className:c}=ed[r];return td(o??l,{ref:i,className:e(c,a),...s})});_n.displayName="Typography";import{jsx as nd}from"react/jsx-runtime";var rd=({children:t,as:r="form",className:o,onSubmit:a,...s})=>{let i=(l)=>{l.preventDefault(),a?.(l)};return nd(r,{className:e("flex flex-col gap-4 min-w-[300px]",o),onSubmit:i,...s,children:t})},od=rd;import{jsx as ld}from"react/jsx-runtime";var vs={},Ur=(...t)=>{for(let r of t)if(r!==void 0)return r;return 1},ad=(t=vs)=>({"--list-cols":Ur(t.cols),"--list-cols-2xl":Ur(t.cols2xl,t.colsXl,t.colsLg,t.colsMd,t.colsSm,t.cols),"--list-cols-lg":Ur(t.colsLg,t.colsMd,t.colsSm,t.cols),"--list-cols-md":Ur(t.colsMd,t.colsSm,t.cols),"--list-cols-sm":Ur(t.colsSm,t.cols),"--list-cols-xl":Ur(t.colsXl,t.colsLg,t.colsMd,t.colsSm,t.cols)}),sd=["grid","gap-4","[grid-template-columns:repeat(var(--list-cols),minmax(0,1fr))]","sm:[grid-template-columns:repeat(var(--list-cols-sm),minmax(0,1fr))]","md:[grid-template-columns:repeat(var(--list-cols-md),minmax(0,1fr))]","lg:[grid-template-columns:repeat(var(--list-cols-lg),minmax(0,1fr))]","xl:[grid-template-columns:repeat(var(--list-cols-xl),minmax(0,1fr))]","2xl:[grid-template-columns:repeat(var(--list-cols-2xl),minmax(0,1fr))]"].join(" "),id=({cols:t=vs,children:r,...o})=>ld("div",{className:sd,style:ad(t),...o,children:r});import{jsx as dd}from"react/jsx-runtime";var cd=({className:t,spaced:r=!1,...o})=>dd("div",{className:e("animate-[rise-in_500ms_cubic-bezier(0.16,1,0.3,1)_both]",r&&"space-y-6",t),...o});var ud=cd;import{jsx as hn,jsxs as Kr}from"react/jsx-runtime";var pd=(t)=>t!==null&&t!==void 0&&t.constructor===String,vn=(t)=>t!==null&&t!==void 0&&t!==!1&&t!==""&&t!==0,md=({title:t,description:r,icon:o,kicker:a,status:s,actions:i,className:l})=>Kr("header",{className:e("space-y-2",l),children:[vn(a)?Kr("div",{className:"flex items-center gap-2 text-(--text-muted) [&_svg]:h-3.5 [&_svg]:w-3.5",children:[vn(o)?hn("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-sm bg-(--bg-accent-soft) text-(--accent)",children:o}):null,hn("span",{className:"text-[12px] font-medium tracking-tight [&_span.sep]:mx-1.5 [&_span.sep]:text-(--accent)",children:pd(a)?a.split("·").map((c,d,u)=>Kr("span",{children:[c.trim(),d<u.length-1?hn("span",{className:"sep","aria-hidden":!0,children:"·"}):null]},d)):a})]}):null,Kr("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[Kr("div",{className:"min-w-0 flex-1 space-y-1.5",children:[hn("h1",{className:"font-display text-[27px] font-bold leading-tight tracking-[-0.02em] text-(--text-primary)",children:t}),vn(r)?hn("p",{className:"max-w-2xl text-[14px] leading-relaxed text-(--text-secondary)",children:r}):null]}),vn(i)||vn(s)?Kr("div",{className:"flex shrink-0 items-center gap-2 pt-1",children:[s,i]}):null]})]}),fd=md;import*as xs from"react";import{jsx as zn,jsxs as hs}from"react/jsx-runtime";var Ko=(t)=>t!==void 0&&t!==null&&t!==!1&&t!==0&&t!==""&&!Number.isNaN(t),ys=xs.forwardRef(function({icon:r,title:o,description:a,action:s,className:i,...l},c){return hs("div",{ref:c,className:e("flex items-start gap-3",i),...l,children:[Ko(r)?zn("span",{"aria-hidden":!0,className:"mt-0.5 inline-flex shrink-0 items-center justify-center rounded-md bg-muted p-2 text-muted-foreground [&_svg]:h-4 [&_svg]:w-4",children:r}):null,hs("div",{className:"min-w-0 flex-1",children:[zn("h3",{className:"text-[15px] font-semibold leading-snug text-foreground",children:o}),Ko(a)?zn("p",{className:"mt-0.5 text-sm leading-relaxed text-muted-foreground",children:a}):null]}),Ko(s)?zn("div",{className:"shrink-0",children:s}):null]})});ys.displayName="SectionHeader";var gd=ys;import{jsx as ws,jsxs as vd}from"react/jsx-runtime";var bd=({title:t,toolbar:r})=>vd("div",{className:"flex items-center justify-between mb-12",children:[ws(_n,{variant:"h2",children:t}),Boolean(r)&&ws("div",{className:"flex items-center gap-2",children:r})]}),hd=bd;import*as Jn from"react";import{jsx as It,jsxs as $n}from"react/jsx-runtime";var Ns=(t,r,o)=>{if(t.length>=r)return t;return[...t,...Array.from({length:r-t.length},o)]},xd=[],Yo=({values:t,defaultValues:r=xd,onValuesChange:o,addLabel:a,getRemoveLabel:s,actions:i,minItems:l=0,disabled:c=!1,renderItem:d,createItem:u,validateItem:h,classes:x,className:y,id:S,...w})=>{let L=Jn.useId(),[z,B]=Jn.useState(()=>Ns(r,l,u)),E=Ns(t??z,l,u),O=Boolean(i),F=(j)=>{if(t===void 0)B(j);o?.(j)};return $n("div",{"data-slot":"array-input",className:e("space-y-2",x?.root,y),...w,children:[It("div",{className:"space-y-2",children:E.map((j,H)=>{let _=H===0&&S!==void 0&&S!==""?S:`${L}-${H}`,J=h?.(j,H);return $n("div",{className:e("flex items-center gap-3",x?.row),children:[d({disabled:c,id:_,index:H,onValueChange:(Q)=>{let W=[...E];W[H]=Q,F(W)},validationMessage:J,value:j}),E.length>l?It(n,{type:"button",variant:"ghost",size:"icon",disabled:c,"aria-label":s(H),className:e("size-10 shrink-0 text-muted-foreground hover:text-destructive",x?.removeButton),onClick:()=>{F(E.filter((Q,W)=>W!==H))},children:It(wo,{"aria-hidden":"true",className:"size-4"})}):null]},H)})}),$n("div",{className:e("flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",x?.actionRow),children:[It(Vn,{disabled:c,className:x?.addButton,onClick:()=>{F([...E,u()])},children:a}),O?It("div",{className:e("sm:ml-auto",x?.actions),children:i}):null]})]})},yd=(t)=>{let{createItem:r,getItemLabel:o,inputProps:a,placeholder:s,required:i=!1,renderItem:l,...c}=t,{className:d,...u}=a??{};if(l!==void 0)return It(Yo,{...c,createItem:r??(()=>""),renderItem:l});return It(Yo,{...c,createItem:r??(()=>""),renderItem:(h)=>{let{disabled:x,id:y,index:S,onValueChange:w,validationMessage:L,value:z}=h;return $n("div",{className:"min-w-0 flex-1",children:[It(g,{...u,id:y,"aria-label":o(S),"aria-invalid":Boolean(L),value:z,placeholder:s,required:i,disabled:x,className:e("w-full",d,c.classes?.input),onChange:(B)=>{w(B.target.value)}}),L!==void 0&&L!==""?It("p",{className:"mt-1 text-xs text-destructive",role:"alert",children:L}):null]})}})},wd=(t)=>It(Yo,{...t}),Nd=(t)=>t.createItem!==void 0&&t.renderItem!==void 0,Rs=(t)=>{if(Nd(t))return It(wd,{...t});return It(yd,{...t})};Rs.displayName="ArrayInput";var Rd=Rs;import*as Yr from"react";var yr=(t,r)=>{let o=[];for(let a of t){let s=o.findIndex((i)=>r(a,i)<0);if(s===-1)o.push(a);else o.splice(s,0,a)}return o};var Vt={hour:9,interval:1,minute:0,mode:"day",monthday:1,weekdays:[1,2,3,4,5]},qo=/^\*\/(?<step>\d+)$/u,Cd=(t)=>{let r=[];for(let o of t.split(",")){let a=/^(?<start>\d+)-(?<end>\d+)$/u.exec(o);if(a){let s=Number(a.groups?.start),i=Number(a.groups?.end);if(s>i)return null;for(let l=s;l<=i;l+=1)r.push(l)}else if(/^\d+$/u.test(o))r.push(Number(o));else return null}return r},Sd=(t,r,o,a)=>{if(r==="*"&&o==="*"&&a==="*"){let s=qo.exec(t),i=Number(s?.groups?.step);return s&&i>=1&&i<=59?{...Vt,interval:i,mode:"minutes"}:null}return},Pd=(t,r,o,a)=>{if(r!=="*"||o!=="*")return;let s=qo.exec(t);if(s){let i=Number(s.groups?.step);return i>=1&&i<=23?{...Vt,interval:i,minute:a,mode:"hours"}:null}return},Td=(t,r,o)=>{let a=qo.exec(t);if(a){let i=Number(a.groups?.step);if(i%7===0&&i>=7&&i<=28)return{...Vt,hour:r,interval:i/7,minute:o,mode:"weeks"};return i>=1&&i<=31?{...Vt,hour:r,interval:i,minute:o,mode:"days"}:null}let s=Number(t);return/^\d+$/u.test(t)&&s>=1&&s<=31?{...Vt,hour:r,minute:o,mode:"month",monthday:s}:null},kd=(t,r,o)=>{let a=Cd(t);if(!a||a.some((i)=>i<0||i>7))return null;let s=yr(new Set(a.map((i)=>i===7?0:i)),(i,l)=>i-l);return{...Vt,hour:r,minute:o,mode:"week",weekdays:s}},xn=(t)=>{let r=t.trim().split(/\s+/u);if(r.length!==5)return null;let[o,a,s,i,l]=r;if(i!=="*")return null;let c=Sd(o,a,s,l);if(c!==void 0)return c;if(!/^\d+$/u.test(o))return null;let d=Number(o);if(d<0||d>59)return null;let u=Pd(a,s,l,d);if(u!==void 0)return u;if(!/^\d+$/u.test(a))return null;let h=Number(a);if(h<0||h>23)return null;if(s==="*"&&l==="*")return{...Vt,hour:h,minute:d,mode:"day"};if(l==="*")return Td(s,h,d);if(s==="*")return kd(l,h,d);return null},wr=(t)=>{let r=Math.max(1,Math.floor(t.interval));switch(t.mode){case"minutes":return`*/${Math.min(r,59)} * * * *`;case"hours":return`${t.minute} */${Math.min(r,23)} * * *`;case"day":return`${t.minute} ${t.hour} * * *`;case"days":return`${t.minute} ${t.hour} */${Math.min(r,31)} * *`;case"week":{let o=t.weekdays.length>0?yr(new Set(t.weekdays),(a,s)=>a-s).join(","):"*";return`${t.minute} ${t.hour} * * ${o}`}case"weeks":return`${t.minute} ${t.hour} */${Math.min(r*7,28)} * *`;case"month":return`${t.minute} ${t.hour} ${Math.min(Math.max(t.monthday,1),31)} * *`;default:throw Error("Unsupported cron mode")}},Cs=(t,r,o)=>{if(t==="*")return!0;for(let a of t.split(",")){let s=/^(?<base>\*|\d+|\d+-\d+)\/(?<increment>\d+)$/u.exec(a);if(s){let l=s.groups?.base??"";if(l!=="*"&&!Cs(l,r,o))return!1;let c=Number(s.groups?.increment);if(!Number.isFinite(c)||c<1)return!1;continue}let i=/^(?<start>\d+)-(?<end>\d+)$/u.exec(a);if(i){let l=Number(i.groups?.start),c=Number(i.groups?.end);if(l<r||c>o||l>c)return!1;continue}if(/^\d+$/u.test(a)){let l=Number(a);if(l<r||l>o)return!1;continue}return!1}return!0},Ld=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Dd=(t,r)=>{let o=String(t).padStart(2,"0"),a=String(r).padStart(2,"0");return`${o}:${a}`},jn=(t)=>{let r=xn(t);if(!r)return t;let o=Dd(r.hour,r.minute);switch(r.mode){case"minutes":return r.interval===1?"Every minute":`Every ${r.interval} minutes`;case"hours":return r.interval===1?`Every hour at :${String(r.minute).padStart(2,"0")}`:`Every ${r.interval} hours at :${String(r.minute).padStart(2,"0")}`;case"day":return`Every day at ${o}`;case"days":return r.interval===1?`Every day at ${o}`:`Every ${r.interval} days at ${o}`;case"week":{if(r.weekdays.length===0)return`Weekly at ${o}`;let a=yr(r.weekdays,(c,d)=>c-d),s=a.length===5&&a.every((c,d)=>c===d+1),i=a.length===2&&a[0]===0&&a[1]===6;if(s)return`Weekdays at ${o}`;if(i)return`Weekends at ${o}`;return`${a.map((c)=>Ld[c].slice(0,3)).join(", ")} at ${o}`}case"weeks":return r.interval===1?`Every week at ${o}`:`Every ${r.interval} weeks at ${o}`;case"month":return`Day ${r.monthday} of every month at ${o}`;default:throw Error("Unsupported cron mode")}},Zo=(t)=>{let r=t.trim().split(/\s+/u);if(r.length!==5)return!1;let o=[[0,59],[0,23],[1,31],[1,12],[0,7]];return r.every((a,s)=>Cs(a,o[s][0],o[s][1]))};import*as Ps from"react";var Ss=(t)=>{let a=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"shortOffset"}).formatToParts(new Date).find((d)=>d.type==="timeZoneName")?.value??"GMT",s=/(?<sign>[+-])(?<hours>\d{1,2})(?::(?<minutes>\d{2}))?/u.exec(a);if(!s)return 0;let i=s.groups?.sign==="-"?-1:1,l=Number(s.groups?.hours??0),c=Number(s.groups?.minutes??0);return i*(l*60+c)},Ed=(t)=>{let r=Ss(t),o=r>=0?"+":"-",a=Math.abs(r),s=String(Math.floor(a/60)).padStart(2,"0"),i=String(a%60).padStart(2,"0");return`${o}${s}:${i}`},Gn=null,Qo=()=>{if(Gn)return Gn;let t="supportedValuesOf"in Intl?Intl.supportedValuesOf("timeZone"):["UTC"];return Gn=yr(["UTC",...t].map((r)=>({label:`${r} (UTC${Ed(r)})`,offset:Ss(r),value:r})),(r,o)=>r.offset-o.offset||r.value.localeCompare(o.value)).map(({value:r,label:o})=>({label:o,value:r})),Gn};import{jsx as Md}from"react/jsx-runtime";var Wn=({value:t,onChange:r,className:o,width:a="100%",disabled:s,placeholder:i="Select timezone"})=>{let l=Ps.useMemo(()=>Qo(),[]);return Md(mt,{options:l,value:t,onChange:(c)=>{r(c||"UTC")},placeholder:i,searchPlaceholder:"Search timezone...",emptyMessage:"No timezone found.",className:e("bg-transparent font-normal",o),width:a,disabled:s})};import{jsx as re,jsxs as De,Fragment as Fd}from"react/jsx-runtime";var Ls=[{label:"X minutes",value:"minutes"},{label:"X hours",value:"hours"},{label:"Day",value:"day"},{label:"X days",value:"days"},{label:"Week",value:"week"},{label:"X weeks",value:"weeks"},{label:"Month",value:"month"}],Id=[{label:"Monday",short:"Mon",value:1},{label:"Tuesday",short:"Tue",value:2},{label:"Wednesday",short:"Wed",value:3},{label:"Thursday",short:"Thu",value:4},{label:"Friday",short:"Fri",value:5},{label:"Saturday",short:"Sat",value:6},{label:"Sunday",short:"Sun",value:0}],Ad=(t)=>Ls.some((r)=>r.value===t),Ts=(t)=>{let r=t.trim();if(!r)return{custom:wr(Vt),simple:Vt,view:"simple"};let o=xn(r);if(o)return{custom:r,simple:o,view:"simple"};return{custom:r,simple:Vt,view:"advanced"}},Od=(t,r)=>{let o=r===1;switch(t.value){case"minutes":return o?"minute":"minutes";case"hours":return o?"hour":"hours";case"day":return"day";case"days":return o?"day":"days";case"week":return"week";case"weeks":return o?"week":"weeks";case"month":return"month";default:throw Error("Unsupported cron mode")}},Xn=(t,r,o)=>Math.max(r,Math.min(o,t)),ks=(t)=>String(t).padStart(2,"0"),Hd=({hour:t,minute:r,onChange:o})=>De("div",{className:"flex items-center gap-1",children:[re(g,{type:"number",min:0,max:23,value:ks(t),onChange:(a)=>{o(Xn(Number(a.target.value)||0,0,23),r)},className:"w-16 text-center font-mono"}),re("span",{className:"text-muted-foreground",children:":"}),re(g,{type:"number",min:0,max:59,value:ks(r),onChange:(a)=>{o(t,Xn(Number(a.target.value)||0,0,59))},className:"w-16 text-center font-mono"})]}),Vd=({state:t,onChange:r,timezone:o,onTimezoneChange:a})=>{let s=t.mode==="minutes"||t.mode==="hours"||t.mode==="days"||t.mode==="weeks",i=t.mode!=="minutes"&&t.mode!=="hours",l=t.mode==="hours",c=t.mode==="week",d=t.mode==="month";return De("div",{className:"space-y-3",children:[re("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end",children:De("div",{className:"space-y-2",children:[re("span",{className:"text-xs font-medium text-muted-foreground",children:"Every"}),De("div",{className:e("grid gap-2",s?"grid-cols-[88px_minmax(0,1fr)]":"grid-cols-1"),children:[s&&re(g,{type:"number",min:1,value:t.interval,onChange:(u)=>{r({interval:Math.max(1,Number(u.target.value)||1)})},className:"font-mono"}),De(At,{value:t.mode,onValueChange:(u)=>{if(Ad(u))r({mode:u})},children:[re(Ot,{className:"flex-1",children:re(Et,{})}),re(Ft,{children:Ls.map((u)=>re(_t,{value:u.value,children:Od(u,t.interval)},u.value))})]})]})]})}),c&&De("div",{className:"space-y-2",children:[re("span",{className:"text-xs font-medium text-muted-foreground",children:"On"}),re(Wt,{type:"multiple",variant:"outline",size:"sm",value:t.weekdays.map(String),onValueChange:(u)=>{r({weekdays:u.length?yr(u.map(Number),(h,x)=>h-x):[1]})},className:"w-full",children:Id.map((u)=>re(Gt,{value:String(u.value),"aria-label":u.label,className:"text-xs",children:u.short},u.value))})]}),d&&De("div",{className:"space-y-2",children:[re("span",{className:"text-xs font-medium text-muted-foreground",children:"On day"}),re(g,{type:"number",min:1,max:31,value:t.monthday,onChange:(u)=>{r({monthday:Xn(Number(u.target.value)||1,1,31)})},className:"w-24"})]}),(i||o!==void 0&&a)&&De("div",{className:e("grid gap-3",i&&o!==void 0&&a?"lg:grid-cols-[auto_minmax(0,1fr)] lg:items-end":"grid-cols-1"),children:[i&&De("div",{className:"space-y-2",children:[re("span",{className:"text-xs font-medium text-muted-foreground",children:"At"}),re(Hd,{hour:t.hour,minute:t.minute,onChange:(u,h)=>{r({hour:u,minute:h})}})]}),o!==void 0&&a&&De("div",{className:"space-y-2",children:[re("span",{className:"text-xs font-medium text-muted-foreground",children:"Timezone"}),re(Wn,{value:o,onChange:a})]})]}),l&&De("div",{className:"space-y-2",children:[re("span",{className:"text-xs font-medium text-muted-foreground",children:"At minute"}),re(g,{type:"number",min:0,max:59,value:t.minute,onChange:(u)=>{r({minute:Xn(Number(u.target.value)||0,0,59)})},className:"w-24"})]})]})},Bd=({value:t,onChange:r,className:o,showPreview:a=!0,timezone:s,onTimezoneChange:i})=>{let[l,c]=Yr.useState(()=>Ts(t)),[d,u]=Yr.useState(t),[h,x]=Yr.useState(t);if(t!==d){if(u(t),t!==h)x(t),c(Ts(t))}let y=Yr.useCallback((E)=>{let O=E.view==="simple"?wr(E.simple):E.custom;x(O),r(O)},[r]),S=(E)=>{c((O)=>{let F={...O.simple,...E},j={...O,custom:wr(F),simple:F};return y(j),j})},w=(E)=>{c((O)=>{let F={...O,custom:E};return y(F),F})},L=(E)=>{c((O)=>{if(E===O.view)return O;if(E==="advanced"){let H=wr(O.simple),_={...O,custom:H,view:E};return y(_),_}let F=xn(O.custom),j=F?{...O,simple:F,view:E}:{...O,view:E};return y(j),j})},z=Zo(l.custom),B=null;if(l.view==="simple")B=jn(wr(l.simple));else if(z)B=jn(l.custom);return De("div",{className:e("space-y-4",o),children:[De(zt,{value:l.view,onValueChange:(E)=>{if(E==="simple"||E==="advanced")L(E)},children:[De(Ht,{className:"grid w-full grid-cols-2 rounded-md bg-muted/70 p-1 sm:w-[320px]",children:[re(gt,{value:"simple",className:"text-xs",children:"Simple"}),re(gt,{value:"advanced",className:"text-xs",children:"Advanced"})]}),re(ht,{value:"simple",className:"space-y-3 pt-3",children:re(Vd,{state:l.simple,onChange:S,timezone:s,onTimezoneChange:i})}),De(ht,{value:"advanced",className:"space-y-2 pt-3",children:[re("span",{className:"text-xs font-medium text-muted-foreground",children:"Cron Expression"}),re(g,{value:l.custom,onChange:(E)=>{w(E.target.value)},placeholder:"0 9 * * 1-5",className:e("font-mono text-sm",!z&&l.custom.trim()&&"border-destructive focus-visible:ring-destructive/40"),spellCheck:!1}),re("p",{className:"text-[11px] text-muted-foreground",children:"Format: minute hour day-of-month month day-of-week"})]})]}),l.view==="advanced"&&s!==void 0&&i&&De("div",{className:"space-y-2",children:[re("span",{className:"text-xs font-medium text-muted-foreground",children:"Timezone"}),re(Wn,{value:s,onChange:i})]}),a&&re("div",{className:"flex min-h-8 flex-wrap items-center gap-2 rounded-md bg-muted/35 px-3 py-2 text-xs",children:B===null?re("span",{className:"text-destructive",children:"Invalid cron expression"}):De(Fd,{children:[re("span",{className:"text-muted-foreground",children:B}),re(ue,{variant:"secondary",className:"ml-auto font-mono text-[11px]",children:l.view==="simple"?wr(l.simple):l.custom})]})})]})};import{jsx as ea}from"react/jsx-runtime";var _d={both:"w-full h-full",horizontal:"w-full h-auto",none:"",vertical:"h-full w-auto"},zd=({src:t,alt:r="",className:o="",width:a,height:s,fill:i="horizontal",style:l})=>{if(i==="both")return ea("div",{className:e("relative overflow-hidden rounded-lg shadow-md",o),style:{height:s,width:a,...l},children:ea("img",{src:t,alt:r,className:"object-cover w-full h-full absolute inset-0"})});return ea("img",{src:t,alt:r,width:a,height:s,className:e("object-cover rounded-lg shadow-md",_d[i],o),style:{height:i==="vertical"?"100%":s,width:i==="horizontal"?"100%":a,...l}})},$d=zd;import{jsx as Un,jsxs as Ds}from"react/jsx-runtime";var Jd=({title:t,className:r,children:o,...a})=>Ds("section",{"data-slot":"summary-list",className:e("space-y-2",r),...a,children:[t?Un("h3",{className:"text-sm font-semibold tracking-tight",children:t}):null,Un("dl",{className:"divide-y divide-border overflow-hidden rounded-lg border border-border bg-card",children:o})]}),jd=({label:t,value:r,muted:o=!1,className:a,...s})=>Ds("div",{"data-slot":"summary-item",className:e("grid gap-1 px-4 py-3 sm:grid-cols-[minmax(8rem,14rem)_1fr] sm:gap-4",a),...s,children:[Un("dt",{className:"text-sm text-muted-foreground",children:t}),Un("dd",{className:e("min-w-0 break-words text-sm",o?"text-muted-foreground":"font-medium text-foreground"),children:r})]});import*as ta from"react";import{jsx as kr,jsxs as Es}from"react/jsx-runtime";var Gd=({className:t,...r})=>kr(kt,{"data-slot":"choice-card-group",className:e("grid gap-3",t),...r}),Wd=({title:t,description:r,media:o,footer:a,className:s,...i})=>{let l=ta.useId(),c=ta.useId(),d=Boolean(r);return Es(Mt,{"data-slot":"choice-card","aria-labelledby":l,"aria-describedby":d?c:void 0,className:e("group/choice relative flex h-full min-w-0 flex-col items-start gap-4 rounded-lg border border-border bg-card p-5 text-left shadow-(--shadow-sm) outline-none transition-[border-color,background-color,box-shadow] dark:shadow-none","hover:border-foreground/25 focus-visible:ring-[3px] focus-visible:ring-ring/50","data-[state=checked]:border-primary data-[state=checked]:bg-primary/[0.04] data-[state=checked]:ring-1 data-[state=checked]:ring-primary/25","disabled:cursor-not-allowed disabled:bg-muted/30 disabled:opacity-65 disabled:hover:border-border",s),...i,children:[kr("span",{"aria-hidden":!0,className:"absolute top-4 right-4 flex size-5 items-center justify-center rounded-full border border-input bg-background text-primary-foreground transition-colors group-data-[state=checked]/choice:border-primary group-data-[state=checked]/choice:bg-primary",children:kr(Dt,{children:kr(f,{className:"size-3",strokeWidth:3})})}),o,Es("span",{className:"block min-w-0 space-y-1 pr-7",children:[kr("span",{id:l,className:"block font-semibold tracking-tight",children:t}),d?kr("span",{id:c,className:"block text-sm leading-relaxed text-muted-foreground",children:r}):null]}),a?kr("span",{className:"mt-auto block w-full",children:a}):null]})};import*as qr from"react";import{jsx as Nr,jsxs as Ms}from"react/jsx-runtime";var Is=qr.forwardRef(function({className:r,...o},a){return Nr("div",{ref:a,className:e("grid gap-2",r),...o})}),As=({className:t,...r})=>Nr(Tt,{className:e("grid gap-2",t),...r}),Xd=(t)=>t!==void 0&&t!==null&&t!==!1&&t!==0&&t!==""&&!Number.isNaN(t),Kn=qr.forwardRef(function({title:r,description:o,disabled:a=!1,control:s,className:i,children:l,...c},d){return Ms("label",{ref:d,className:e("flex min-w-0 items-start gap-3 rounded-md border border-border p-3","has-[[data-state=checked]]:border-primary/50 has-[[data-state=checked]]:bg-primary/5",a?"cursor-not-allowed bg-muted/30 opacity-65":"cursor-pointer hover:bg-muted/50",i),...c,children:[s,Ms("span",{className:"min-w-0 flex-1",children:[Nr("span",{className:"block truncate text-sm font-medium",children:r}),Xd(o)?Nr("span",{className:"mt-1 block truncate text-xs text-muted-foreground",children:o}):null,l]})]})}),Os=(t)=>Object.prototype.toString.call(t)==="[object String]",Ud=({value:t,title:r,radioLabel:o,disabled:a=!1,onClick:s,...i})=>{let l=qr.useId(),c=o??(Os(r)?r:void 0);return Nr(Kn,{disabled:a,title:r,onClick:(d)=>{if(s?.(d),d.defaultPrevented||a)return;let u=document.querySelector(`#${l}`);if(u!==null&&d.target instanceof Node&&u.contains(d.target))return;d.preventDefault(),u?.click()},control:Nr(Nt,{"aria-label":c,className:"mt-1",disabled:a,id:l,value:t}),...i})},Kd=({checked:t,title:r,checkboxLabel:o,disabled:a=!1,onClick:s,onCheckedChange:i,...l})=>{let c=qr.useId(),d=o??(Os(r)?r:void 0);return Nr(Kn,{disabled:a,title:r,onClick:(u)=>{if(s?.(u),u.defaultPrevented||a)return;let h=document.querySelector(`#${c}`);if(h!==null&&u.target instanceof Node&&h.contains(u.target))return;u.preventDefault(),i(!t)},control:Nr(Xe,{"aria-label":d,checked:t,className:"mt-0.5",disabled:a,id:c,onCheckedChange:(u)=>{if(!a)i(u===!0)}}),...l})};Is.displayName="CardOptionsBlock";As.displayName="RadioCardOptionsBlock";Kn.displayName="CardOption";import*as Hs from"react";import{jsx as yn,jsxs as ra}from"react/jsx-runtime";var Yd=({title:t,description:r,command:o,copyLabel:a=t,copyErrorMessage:s,className:i,...l},c)=>ra("div",{ref:c,className:e("space-y-2",i),...l,children:[ra("div",{children:[yn("p",{className:"text-sm font-medium",children:t}),r===void 0?null:yn("p",{className:"text-sm text-muted-foreground",children:r})]}),ra("div",{className:"flex items-start gap-2",children:[yn("pre",{className:"flex-1 overflow-x-auto rounded-md border bg-muted px-3 py-2 font-mono text-xs",children:yn("code",{children:o})}),yn(Bn,{value:o,label:a,errorMessage:s})]})]}),Vs=Hs.forwardRef(Yd);Vs.displayName="CommandStep";var qd=Vs;import{forwardRef as Zd,useId as Qd}from"react";import{jsx as wn,jsxs as Bs}from"react/jsx-runtime";var Fs=Zd(function({currency:r,label:o="Amount",hint:a,hideLabel:s=!1,hideHint:i=!1,error:l,className:c,wrapperClassName:d,id:u,decimals:h=2,step:x,placeholder:y,...S},w){let L=Qd(),z=u??L,B=`Enter amount in ${r}`,E=x??1/10**h,O=y??(h>0?`0.${"0".repeat(h)}`:"0"),F=l!==null&&l!==void 0&&l.length>0;return Bs("div",{className:e("w-full space-y-2",d),children:[!s&&wn(b,{htmlFor:z,children:o}),Bs("div",{className:"relative",children:[wn("span",{className:"-translate-y-1/2 absolute top-1/2 left-3 text-sm text-muted-foreground",children:r}),wn(g,{ref:w,className:e("bg-background pl-12",F&&"border-destructive",c),id:z,min:"0",placeholder:O,step:E,type:"number",...S})]}),F?wn("p",{className:"text-xs text-destructive",children:l}):!i&&wn("p",{className:"text-xs text-muted-foreground",children:a??B})]})});Fs.displayName="CurrencyInput";var eu=Fs;import*as _s from"react";import{jsx as Yn,jsxs as na}from"react/jsx-runtime";var zs=_s.forwardRef(function({index:r,label:o,hint:a,className:s,children:i,...l},c){let d=Boolean(r),u=Boolean(a);return na("div",{ref:c,className:e("grid gap-x-4",d?"grid-cols-[2.25rem_1fr] sm:grid-cols-[2.5rem_1fr]":"grid-cols-1",s),...l,children:[d?Yn("div",{className:"flex h-6 items-center justify-end pt-[2px]",children:Yn(Xr,{children:r})}):null,na("div",{className:"min-w-0 space-y-1.5",children:[na("div",{className:"flex items-baseline justify-between gap-2",children:[Yn(Wr,{children:o}),u?Yn("span",{className:"text-[10px] text-muted-foreground",children:a}):null]}),i]})]})});zs.displayName="FieldRow";var tu=zs;import{jsx as ge,jsxs as jt,Fragment as lu}from"react/jsx-runtime";var ru=(t)=>{if(t===0)return"0 Bytes";let r=1024,o=["Bytes","KB","MB","GB"],a=Math.floor(Math.log(t)/Math.log(r));return`${Math.round(t/r**a*100)/100} ${o[a]}`},nu={downloadFile:"Download file",downloadingFile:"Downloading file",dragActive:"Drop the file here",dragInactive:"Drag & drop a file here, or click to select",errorRetry:"Please try again",fileTypeHint:"PDF, DOC, DOCX up to 10MB"},ou=({active:t,activeLabel:r,inactiveLabel:o,hint:a})=>jt("div",{className:"flex w-full items-center gap-3",children:[ge("div",{className:e("flex h-10 w-10 shrink-0 items-center justify-center rounded-full transition-colors",t?"bg-[color-mix(in_oklab,var(--primary)_14%,var(--card))]":"bg-muted"),children:ge(So,{className:e("h-5 w-5",t?"text-primary":"text-muted-foreground")})}),jt("div",{children:[ge("p",{className:"text-sm font-medium text-foreground",children:t?r:o}),ge("p",{className:"text-xs text-muted-foreground",children:a})]})]}),au=({message:t,retryLabel:r})=>jt("div",{className:"flex w-full items-center gap-3",children:[ge("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-destructive/10",children:ge(C,{className:"h-5 w-5 text-destructive"})}),jt("div",{children:[ge("p",{className:"text-sm font-medium text-destructive",children:t}),ge("p",{className:"text-xs text-destructive/80",children:r})]})]}),su=({file:t,downloading:r,downloadLabel:o,downloadingLabel:a,onDownload:s,onRemove:i})=>jt("div",{className:"flex w-full items-center justify-between",children:[jt("div",{className:"flex items-center gap-3",children:[t.previewUrl!==void 0&&t.previewUrl!==null&&t.previewUrl!==""?jt(lu,{children:[ge("span",{"aria-hidden":"true",className:"h-20 w-28 shrink-0 rounded-md border border-input bg-background bg-contain bg-center bg-no-repeat",style:{backgroundImage:`url(${t.previewUrl})`}}),ge("span",{className:"sr-only",children:t.name})]}):ge("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[color-mix(in_oklab,var(--success)_14%,var(--card))]",children:ge(mo,{className:"h-5 w-5 text-(--success)"})}),jt("div",{className:"flex flex-col",children:[jt("div",{className:"flex items-center gap-2",children:[ge(vo,{className:"h-4 w-4 text-muted-foreground"}),ge("span",{className:"text-sm font-medium text-foreground",children:t.name})]}),ge("span",{className:"text-xs text-muted-foreground",children:ru(t.size)})]})]}),jt("div",{className:"flex shrink-0 items-center gap-1",children:[s?ge(n,{"aria-label":r?a:o,className:"h-8 w-8 rounded-full p-0",disabled:r,onClick:s,size:"sm",title:r?a:o,type:"button",variant:"ghost",children:r?ge(k,{className:"h-4 w-4 animate-spin"}):ge(ho,{className:"h-4 w-4"})}):null,i?ge(n,{className:"h-8 w-8 rounded-full p-0 hover:bg-destructive/10",onClick:i,size:"sm",type:"button",variant:"ghost",children:ge(C,{className:"h-4 w-4 text-destructive"})}):null]})]}),iu=(t)=>{let{rootProps:r,inputProps:o,isDragActive:a,selectedFile:s,error:i,onRemoveFile:l,onDownloadFile:c,isDownloadingFile:d,disabled:u,className:h,labels:x}=t,y={...nu,...x},S=s!==void 0&&s!==null,w=i!==void 0&&i!==null&&i!=="";return ge("div",{className:e("w-full",h),children:jt("div",{...r,className:e("relative flex min-h-24 cursor-pointer items-center justify-center rounded-lg border-2 border-dashed bg-transparent px-4 py-5 transition-all",a===!0?"border-primary bg-[color-mix(in_oklab,var(--primary)_8%,var(--card))]":"border-input hover:border-input",S&&"border-[color-mix(in_oklab,var(--success)_60%,var(--border))] bg-[color-mix(in_oklab,var(--success)_10%,transparent)]",w&&"border-destructive bg-[color-mix(in_oklab,var(--destructive)_10%,var(--card))]",u===!0&&"cursor-not-allowed opacity-60",r?.className),children:[ge("input",{...o}),!S&&!w?ge(ou,{active:Boolean(a),activeLabel:y.dragActive,hint:y.fileTypeHint,inactiveLabel:y.dragInactive}):null,s!==void 0&&s!==null&&!w?ge(su,{downloadLabel:y.downloadFile,downloading:Boolean(d),downloadingLabel:y.downloadingFile,file:s,onDownload:c,onRemove:l}):null,i!==void 0&&i!==null&&i!==""?ge(au,{message:i,retryLabel:y.errorRetry}):null]})})},cu=iu;import{jsx as $s,jsxs as uu}from"react/jsx-runtime";var du=p("inline-flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full border font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{active:!1,size:"md"},variants:{active:{false:"border-(--border-subtle) bg-(--bg-surface)/60 text-(--text-secondary) hover:border-(--border-default) hover:text-(--text-primary)",true:"border-[color-mix(in_oklab,var(--accent)_35%,var(--border))] bg-(--bg-accent-soft) text-(--text-primary)"},size:{md:"h-8 px-3.5 text-[13px]",sm:"h-7 px-3 text-[12px]"}}}),Js=({options:t,value:r,onValueChange:o,label:a,size:s,className:i,classes:l,...c})=>$s("div",{"aria-label":a,className:e("flex flex-wrap items-center gap-1.5",l?.root,i),...c,children:t.map((d)=>{let u=d.value===r;return uu("button",{type:"button","aria-pressed":u,disabled:d.disabled,onClick:()=>{o(d.value)},className:e(du({active:u,size:s}),l?.chip),children:[d.label,d.count===void 0?null:$s("span",{className:e("tabular-nums text-[11px] text-(--text-muted)",l?.count),children:d.count})]},d.value)})});Js.displayName="FilterChips";var pu=Js;import*as Zr from"react";import{jsx as lr,jsxs as yu}from"react/jsx-runtime";var mu=52,fu=26,Zn=4,qn=20,gu=(t)=>({"--flow-lane":t}),Gs=Zr.createContext(null),Ws=(t)=>{let r=Zr.useContext(Gs);if(!r)throw Error(`${t} must be rendered inside a FlowBand.`);return r},bu=({lanes:t=1,stepHeight:r=mu,laneHeight:o=fu,className:a,style:s,children:i,...l})=>{let c=Math.max(r,t*o+(t-1)*Zn),d=Zr.useMemo(()=>({height:c,stepHeight:r}),[c,r]);return lr(Gs.Provider,{value:d,children:lr("div",{className:e("flex min-w-0 items-stretch gap-1",a),style:{height:c,...s},...l,children:i})})},vu=({className:t,style:r,children:o,...a})=>{let{stepHeight:s}=Ws("FlowStep");return lr("div",{className:e("flex min-w-0 flex-1 items-stretch self-center",t),style:{height:s,...r},...a,children:o})},js=({centers:t,height:r,colors:o,merge:a=!1})=>{let s=r/2,i=7;return lr("svg",{"aria-hidden":!0,width:qn,height:r,viewBox:`0 0 ${qn} ${r}`,className:"shrink-0",style:a?{transform:"scaleX(-1)"}:void 0,children:t.map((l,c)=>{let d=o[c];return lr("path",{style:gu(d),d:`M0 ${s}H7C13 ${s} ${qn-6} ${l} ${qn} ${l}`,fill:"none",strokeWidth:1.5,strokeLinecap:"round",className:d!==void 0&&d!==""?"stroke-[color-mix(in_oklab,var(--flow-lane)_45%,var(--border))]":"stroke-border"},c)})})},hu=(t,r)=>{let o=(r-Zn*(t-1))/t;return Array.from({length:t},(a,s)=>s*(o+Zn)+o/2)},xu=({lanes:t,fork:r=!0,rejoin:o=!0,label:a,className:s,...i})=>{let{height:l}=Ws("FlowBranch"),c=hu(t.length,l),d=t.map((u)=>u.color);return yu("div",{"aria-label":a,className:e("flex min-w-0 flex-1 items-stretch",s),...i,children:[r&&lr(js,{centers:c,height:l,colors:d}),lr("div",{className:"flex min-w-0 flex-1 flex-col",style:{gap:Zn},children:t.map((u)=>lr("div",{className:"flex min-w-0 flex-1 items-stretch overflow-hidden",children:u.content},u.key))}),o&&lr(js,{centers:c,height:l,colors:d,merge:!0})]})};import*as Xs from"react";import{jsx as oa,jsxs as Nu}from"react/jsx-runtime";var wu=({index:t,className:r,children:o,...a},s)=>Nu("div",{ref:s,className:e("grid grid-cols-[1.75rem_1fr] gap-x-3 leading-relaxed",r),...a,children:[oa("div",{className:"pt-[1px] text-right",children:oa(Xr,{className:"opacity-80",children:t})}),oa("p",{className:"text-[13px] text-muted-foreground",children:o})]}),Us=Xs.forwardRef(wu);Us.displayName="GuideStep";var Ru=Us;import*as en from"react";import{jsx as Ue,jsxs as Qr,Fragment as Su}from"react/jsx-runtime";var Ks=en.forwardRef(function({className:r,variant:o="island",...a},s){return Ue(oe,{ref:s,variant:o,className:e("p-0",r),...a})});Ks.displayName="HierarchyTree";var Ys=en.forwardRef(function({title:r,icon:o,count:a,actions:s,className:i,...l},c){return Qr("div",{ref:c,"data-slot":"hierarchy-tree-header",className:e("flex flex-wrap items-center gap-3 border-b border-border px-4 py-3",i),...l,children:[Qr("div",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",children:[o!==void 0&&o!==null?Ue("span",{className:"shrink-0 text-muted-foreground [&_svg]:h-4 [&_svg]:w-4",children:o}):null,Ue("span",{className:"min-w-0 truncate",children:r}),a!==void 0&&a!==null?Ue("span",{className:"rounded-full bg-muted px-2 py-0.5 text-xs font-normal text-muted-foreground",children:a}):null]}),s!==void 0&&s!==null?Ue("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:s}):null]})});Ys.displayName="HierarchyTreeHeader";var qs=en.forwardRef(function({className:r,...o},a){return Ue("div",{ref:a,"data-slot":"hierarchy-tree-body",className:e("min-w-0",r),...o})});qs.displayName="HierarchyTreeBody";var Cu=[],Zs=en.forwardRef(function({depth:r,rails:o=Cu,isLastChild:a=!1,hasChildren:s=!1,contentClassName:i,className:l,children:c,...d},u){let h=Math.max(1,r);return Qr("div",{ref:u,"data-slot":"hierarchy-tree-row","data-depth":h,className:e("group flex items-stretch transition-colors hover:bg-muted/40",h===1&&"border-t border-border first:border-t-0",l),...d,children:[h>1?Qr("div",{"aria-hidden":!0,className:"flex shrink-0 pl-5",children:[o.map((x,y)=>Ue("span",{className:"relative w-5",children:x?Ue("span",{className:"absolute inset-y-0 left-0 border-l border-(--border-subtle)"}):null},y)),Ue("span",{className:"relative w-5",children:a?Ue("span",{className:e("absolute left-0 top-0 h-[22px] rounded-bl-md border-b border-l border-(--border-subtle)",s?"w-full":"w-14")}):Qr(Su,{children:[Ue("span",{className:"absolute inset-y-0 left-0 border-l border-(--border-subtle)"}),Ue("span",{className:e("absolute left-0 top-[22px] border-t border-(--border-subtle)",s?"w-full":"w-14")})]})})]}):null,Ue("div",{className:e("flex min-w-0 flex-1 items-start gap-2 py-3 pl-2 pr-3",i),children:c})]})});Zs.displayName="HierarchyTreeRow";var Qs=en.forwardRef(function({expanded:r,count:o,visible:a=!0,className:s,...i},l){return Qr(n,{ref:l,type:"button",variant:"ghost",size:"sm",className:e("h-6 shrink-0 gap-0.5 px-1 text-xs text-muted-foreground",!a&&"invisible",s),...i,children:[Ue(m,{className:e("h-3.5 w-3.5 transition-transform",r&&"rotate-90")}),o]})});Qs.displayName="HierarchyTreeToggle";var Pu=Ks;import Tu,{useState as ku}from"react";import{jsx as Pe,jsxs as wt}from"react/jsx-runtime";var Lu=p("font-mono text-sm rounded-md overflow-hidden flex flex-col",{defaultVariants:{size:"md",variant:"default"},variants:{size:{lg:"p-4 text-base",md:"p-3",sm:"p-2 text-xs"},variant:{default:"bg-card border border-border",filled:"bg-muted",outlined:"border border-border"}}}),aa=({value:t,ancestors:r})=>{if(t===null||t===void 0)return t;if(t===!0||t===!1)return t;let o=Object.prototype.toString.call(t);if(o==="[object String]"){let a=JSON.stringify(t);return a===void 0?o:a.slice(1,-1)}if(o==="[object Number]")return Number(t);if(Array.isArray(t)){if(r.has(t))return"[Circular]";r.add(t);let a=t.map((s)=>aa({ancestors:r,value:s}));return r.delete(t),a}if(t instanceof Object){if(r.has(t))return"[Circular]";r.add(t);let a=Object.fromEntries(Object.entries(t).map(([s,i])=>[s,aa({ancestors:r,value:i})]));return r.delete(t),a}return o},Du=(t)=>{if(t===null||t===void 0)return"text-gray-500 dark:text-gray-400";if(String(t)===t)return"text-green-600 dark:text-green-400";if(t===!0||t===!1)return"text-amber-600 dark:text-amber-400";return"text-blue-600 dark:text-blue-400"},Eu=(t)=>{if(t===null)return"null";if(t===void 0)return"undefined";if(String(t)===t)return`"${t}"`;return String(t)},Mu=(t)=>t,Iu=(t)=>t!==null&&Object(t)===t,Au=(t,r)=>{if(t)return Pe("span",{className:"w-4"});return r?Pe(v,{className:"w-4 h-4"}):Pe(m,{className:"w-4 h-4"})},Ou=(t)=>t?{close:"]",open:"["}:{close:"}",open:"{"},Hu=(t,r,o)=>t?{name:null,path:`${o}[${r}]`}:{name:String(r),path:`${o}.${r}`},Vu=({data:t,className:r,classes:o,variant:a,size:s,expandAll:i=!1,expandRoot:l=!0,indentSize:c=16,showLineNumbers:d=!1,showToolbar:u=!1,maxHeight:h,maxWidth:x,renderValue:y})=>{let S=Tu.useMemo(()=>aa({ancestors:new WeakSet,value:t}),[t]),[w,L]=ku(()=>{let _={};if(l)_.root=!0;return _}),z=(_,J)=>{if(_==="root"&&w[_]===void 0)return l;return w[_]??J},B=(_)=>{L((J)=>({...J,[_]:!z(_,i)}))},E=(_)=>{L({})},O=()=>{try{let _=JSON.stringify(S,null,2);navigator.clipboard.writeText(_),K.success("Copied to clipboard",{description:"JSON data has been copied to clipboard",duration:3000})}catch(_){console.error("Failed to copy JSON to clipboard",_),K.error("Copy failed",{description:"Failed to copy JSON to clipboard",duration:3000})}},F={maxWidth:x??"auto"},j=(_,J,Q,W,se)=>{let ye=[],ve=Iu(J),Re=Array.isArray(J),Me=ve&&Object.keys(J).length===0,Ae=Ou(Re),be={marginLeft:Q*c},qe=Mu(W),he=se;if(!ve){let ne=y?.(J,W);return ye.push(wt("div",{className:"flex",children:[d&&Pe("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:he}),wt("div",{className:"flex min-w-0",style:be,children:[Pe("span",{"aria-hidden":!0,className:"mr-1 w-4 shrink-0"}),_!==null&&wt("span",{className:"shrink-0 text-purple-600 dark:text-purple-400",children:[`"${_}":`,Pe("span",{className:"text-gray-600 dark:text-gray-400 mr-1",children:" "})]}),ne??Pe("span",{className:e("min-w-0 break-all",Du(J)),children:Eu(J)})]})]},qe)),[ye,he+1]}let Oe=z(W,i),U=Au(Me,Oe);if(ye.push(wt("div",{className:"flex items-start group",children:[d&&Pe("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:he}),wt("div",{className:"flex items-start",style:be,children:[Pe("button",{onClick:()=>{B(W)},className:"mr-1 w-4 h-4 mt-0.5 focus:outline-none opacity-60 hover:opacity-100","aria-label":Oe?"Collapse":"Expand",tabIndex:0,type:"button",children:U}),wt("div",{children:[_!==null&&wt("span",{className:"text-purple-600 dark:text-purple-400",children:[`"${_}":`,Pe("span",{className:"text-gray-600 dark:text-gray-400 mr-1",children:" "})]}),Pe("span",{className:"text-gray-600 dark:text-gray-400",children:Ae.open}),Me||!Oe?wt("span",{className:"text-gray-600 dark:text-gray-400",children:[Me?"":"...",Ae.close]}):null]})]})]},`${qe}-open`)),he+=1,Oe&&!Me){let ne=he,ee=Re?J.map((Ce,st)=>[st,Ce]):Object.entries(J);for(let[Ce,st]of ee){let Se=Hu(Re,Ce,W),[mr,X]=j(Se.name,st,Q+1,Se.path,ne);ye.push(...mr),ne=X}return ye.push(wt("div",{className:"flex",children:[d&&Pe("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:ne}),Pe("div",{className:"text-gray-600 dark:text-gray-400",style:be,children:Ae.close})]},`${qe}-close`)),ne+=1,[ye,ne]}return[ye,he]},[H]=j(null,S,0,"root",1);return wt("div",{className:e(Lu({size:s,variant:a}),o?.root,r),style:F,children:[u&&wt("div",{className:e("flex justify-between items-center px-3 py-2 border-b border-border bg-muted/50",o?.toolbar),children:[Pe("div",{className:"text-sm font-medium",children:"JSON Viewer"}),wt("div",{className:"flex gap-2",children:[Pe(n,{size:"sm",variant:"outline",onClick:()=>{E(!0)},children:"Expand All"}),Pe(n,{size:"sm",variant:"outline",onClick:()=>{E(!1)},children:"Collapse All"}),wt(n,{size:"sm",variant:"outline",onClick:O,children:[Pe(te,{className:"w-4 h-4 mr-1"}),"Copy"]})]})]}),Pe("div",{className:e("overflow-auto flex-1",o?.content),style:{maxHeight:h??void 0},children:H})]})},sa=Vu;import{useId as Bu,useState as Fu}from"react";import _u from"react-markdown";import{jsx as cr,jsxs as ia,Fragment as $u}from"react/jsx-runtime";var ei=({mode:t,onModeChange:r,labels:o,disabled:a=!1,className:s})=>{let i=t==="write"?"preview":"write",l=i==="write"?o.write:o.preview,c=i==="write"?o.writeTitle??o.write:o.previewTitle??o.preview;return cr(n,{type:"button",variant:"ghost",size:"icon",className:e("size-7",s),disabled:a,"aria-label":l,title:c,onClick:()=>{r(i)},children:i==="preview"?cr(ce,{className:"size-3.5 text-muted-foreground"}):cr(go,{className:"size-3.5 text-muted-foreground"})})},zu=({label:t,value:r,onValueChange:o,emptyPreview:a,toggleLabels:s,mode:i,defaultMode:l="write",onModeChange:c,previewValue:d=r,disabled:u=!1,placeholder:h,editorId:x,showHeader:y=!0,footer:S,className:w,editorClassName:L,previewClassName:z,textareaProps:B})=>{let E=Bu(),O=x??E,[F,j]=Fu(l),H=i??F,_=(J)=>{if(i===void 0)j(J);c?.(J)};return ia("div",{className:e("grid gap-2",w),children:[y&&ia("div",{className:"flex items-center justify-between gap-3",children:[cr(b,{htmlFor:H==="write"?O:void 0,children:t}),cr(ei,{mode:H,onModeChange:_,labels:s,disabled:u})]}),H==="write"?ia($u,{children:[cr(Qe,{...B,id:O,value:r,disabled:u,placeholder:h,"aria-label":y?B?.["aria-label"]:B?.["aria-label"]??t,className:e("min-h-48 resize-y font-mono text-sm",L),onChange:(J)=>{o(J.target.value)}}),S]}):cr("div",{"aria-label":`${t} ${s.preview}`,className:e("prose prose-sm max-w-none rounded-lg border bg-muted/30 p-4 dark:prose-invert [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",z),children:d.trim()?cr(_u,{children:d}):cr("div",{className:"not-prose text-muted-foreground",children:a})})]})};import{jsx as Qn,jsxs as ju}from"react/jsx-runtime";var Ju=({open:t,onOpenChange:r,title:o="JSON Viewer",data:a,jsonViewerProps:s})=>Qn(M,{open:t,onOpenChange:r,children:ju(D,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[Qn(V,{children:Qn(T,{children:o})}),Qn(sa,{data:a,className:"min-h-0 flex-1",variant:"filled",size:"sm",showToolbar:!0,expandAll:!1,expandRoot:!0,...s})]})});import*as ri from"react";import{jsx as ti,jsxs as la}from"react/jsx-runtime";var ni=ri.forwardRef(function({id:r,label:o,optionalLabel:a,help:s,error:i,className:l,children:c,...d},u){return la("div",{ref:u,className:e("grid content-start gap-2",l),...d,children:[la(b,{htmlFor:r,children:[o,a===void 0?null:la("span",{className:"font-normal text-muted-foreground",children:["(",a,")"]})]}),c,i===void 0?null:ti("p",{role:"alert",className:"text-sm text-destructive",children:i}),i===void 0&&s!==void 0&&s!==""?ti("p",{className:"text-xs leading-relaxed text-muted-foreground",children:s}):null]})});ni.displayName="LabeledField";var Gu=ni;import{jsx as oi,jsxs as ai}from"react/jsx-runtime";var Wu=({href:t,children:r,className:o,external:a=!1,linkComponent:s})=>{let i=e("inline-flex items-center gap-1 text-primary hover:underline",o);if(a||!s)return ai("a",{href:t,...a?{rel:"noopener noreferrer",target:"_blank"}:{},className:i,children:[r,oi(Ut,{className:"h-3 w-3"})]});return ai(s,{to:t,className:i,children:[r,oi(Ut,{className:"h-3 w-3"})]})};import{useState as Xu}from"react";import{jsx as eo,jsxs as Ku}from"react/jsx-runtime";var Uu=({value:t,isSensitive:r=!1,className:o,maskChar:a="•",showToggle:s=!0})=>{let[i,l]=Xu(!r),d=i?t:(()=>{if(t.startsWith("{")||t.startsWith("["))return`{ ${a.repeat(10)} }`;return a.repeat(Math.min(t.length,20))})(),u=d.slice(0,50)+(d.length>50?"...":"");return Ku("div",{className:e("flex items-center gap-2",o),children:[eo("code",{className:"text-sm bg-muted px-2 py-1 rounded flex-1 break-all",children:u}),r&&s&&eo(n,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>{l(!i)},title:i?"Hide value":"Show value",children:i?eo(Ve,{className:"h-3 w-3"}):eo(ce,{className:"h-3 w-3"})})]})};import*as li from"react";import{jsx as si,jsxs as ii}from"react/jsx-runtime";var ci=li.forwardRef(function({icon:r,text:o,trailing:a,className:s,...i},l){return ii("div",{ref:l,className:e("flex min-w-0 items-center gap-2",s),...i,children:[ii("div",{className:"flex min-w-0 flex-1 items-center gap-2 border-b border-dashed border-border py-2 text-[13px] text-muted-foreground",children:[r!==null&&r!==void 0?si("span",{className:"text-primary/70",children:r}):null,si("span",{className:"min-w-0 truncate",children:o})]}),a]})});ci.displayName="MutedPlaceholder";var Yu=ci;import{useMemo as qu,useState as Zu}from"react";import{jsx as St,jsxs as to}from"react/jsx-runtime";var ca=({value:t,ancestors:r})=>{if(t===null||t===void 0)return t;if(t===!0||t===!1)return t;let o=Object.prototype.toString.call(t);if(o==="[object String]")return String.prototype.valueOf.call(t);if(o==="[object Number]")return Number(t);if(Array.isArray(t)){if(r.has(t))return;r.add(t);let a=t.map((s)=>ca({ancestors:r,value:s}));return r.delete(t),a}if(t instanceof Object){if(r.has(t))return;r.add(t);let a=Object.fromEntries(Object.entries(t).map(([s,i])=>[s,ca({ancestors:r,value:i})]));return r.delete(t),a}return},tr=(t)=>{if(t instanceof Object&&!Array.isArray(t))return t;return},Rr=(t)=>Array.isArray(t)?t:void 0,di=(t)=>Object.prototype.toString.call(t)==="[object String]"&&t===String.prototype.valueOf.call(t),da=(t)=>di(t)?t:void 0,Qu=(t)=>Rr(t)?.filter(di)??[],ep=(t)=>{let r=Rr(t.anyOf);if(!r)return t;let o=r.filter((a)=>tr(a)?.type!=="null");return o.length===1?tr(o[0])??t:t},ui=(t)=>{let r=da(t.type);if(r!==void 0&&r!=="")return r;if(Rr(t.enum))return"enum";if(Rr(t.oneOf)||Rr(t.anyOf))return"variant";if(tr(t.properties))return"object";return"value"},pi=(t,r="schema")=>{let o=tr(t.properties);if(o){let s=new Set(Qu(t.required));return Object.entries(o).flatMap(([i,l])=>{let c=tr(l);return c?[{name:i,path:`${r}.properties.${i}`,required:s.has(i),schema:c}]:[]})}if(ui(t)==="array"){let s=tr(t.items);return s?[{name:"Items",path:`${r}.items`,required:!0,schema:s}]:[]}let a=Rr(t.oneOf)??Rr(t.anyOf)??Rr(t.allOf);if(!a)return[];return a.flatMap((s,i)=>{let l=tr(s);return l?[{name:`Option ${i+1}`,path:`${r}.option.${i}`,required:!0,schema:l}]:[]})},ua=(t,r,o=new Set)=>{let a=ep(t),s=da(a.$ref);if(s===void 0||s===""||!s.startsWith("#/$defs/")||o.has(s))return a;let i=tr(tr(r.$defs)?.[s.slice(8)]);if(!i)return a;return ua(i,r,new Set([...o,s]))},mi=({child:t,depth:r,root:o,defaultExpandedDepth:a})=>{let s=ua(t.schema,o),i=pi(s,t.path),[l,c]=Zu(r<a),d=ui(s),u=da(s.description),h=i.length>0,x=l?`Collapse ${t.name}`:`Expand ${t.name}`;return to(de,{open:l,onOpenChange:c,children:[to("div",{className:e("flex min-w-0 items-start border-b border-border/70 bg-background px-2.5 py-2 last:border-b-0",h&&"gap-2"),style:{paddingLeft:`${10+r*16}px`},children:[h?St(fe,{"aria-label":x,className:"mt-0.5 shrink-0 rounded-sm text-muted-foreground outline-none transition hover:text-foreground focus-visible:ring-2 focus-visible:ring-primary/40",children:St(m,{className:e("size-3.5 transition-transform",l&&"rotate-90")})}):null,to("div",{className:"min-w-0 flex-1",children:[to("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[St("span",{className:"break-all text-xs font-medium text-foreground",children:t.name}),St("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:d}),t.required?St("span",{className:"text-[10px] font-medium text-destructive",children:"required"}):null]}),u!==void 0&&u!==""?St("p",{className:"mt-0.5 text-xs leading-snug text-muted-foreground",children:u}):null]})]}),h?St(pe,{children:St("div",{className:"border-l border-border/70",children:i.map((y)=>St(mi,{child:y,defaultExpandedDepth:a,depth:r+1,root:o},y.path))})}):null]})},tp=({schema:t,className:r,defaultExpandedDepth:o=1,emptyLabel:a="No fields"})=>{let s=qu(()=>ca({ancestors:new WeakSet,value:t}),[t]),i=tr(s);if(!i)return St("p",{className:e("text-xs text-muted-foreground",r),children:a});let l=ua(i,i),c=pi(l);if(!c.length)return St("p",{className:e("text-xs text-muted-foreground",r),children:a});return St("div",{"aria-label":"Object schema",className:e("overflow-hidden rounded-lg border border-border",r),children:c.map((d)=>St(mi,{child:d,defaultExpandedDepth:o,depth:0,root:i},d.path))})};import rr,{createContext as Tn,useContext as ln,useEffect as xe,useState as Xt,useCallback as Kt,useMemo as Ne,useRef as Ee,memo as lp,useReducer as cp,cloneElement as Uh,forwardRef as Kh}from"react";import{createPortal as dp,unstable_batchedUpdates as uo}from"react-dom";import{useMemo as ma,useLayoutEffect as rp,useEffect as gi,useRef as tn,useCallback as oo}from"react";function bi(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return ma(()=>(a)=>{r.forEach((s)=>s(a))},r)}var Nn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Lr(t){let r=Object.prototype.toString.call(t);return r==="[object Window]"||r==="[object global]"}function ao(t){return"nodeType"in t}function ze(t){var r,o;if(!t)return window;if(Lr(t))return t;if(!ao(t))return window;return(r=(o=t.ownerDocument)==null?void 0:o.defaultView)!=null?r:window}function so(t){let{Document:r}=ze(t);return t instanceof r}function rn(t){if(Lr(t))return!1;return t instanceof ze(t).HTMLElement}function fa(t){return t instanceof ze(t).SVGElement}function Dr(t){if(!t)return document;if(Lr(t))return t.document;if(!ao(t))return document;if(so(t))return t;if(rn(t)||fa(t))return t.ownerDocument;return document}var Bt=Nn?rp:gi;function io(t){let r=tn(t);return Bt(()=>{r.current=t}),oo(function(){for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return r.current==null?void 0:r.current(...a)},[])}function vi(){let t=tn(null),r=oo((a,s)=>{t.current=setInterval(a,s)},[]),o=oo(()=>{if(t.current!==null)clearInterval(t.current),t.current=null},[]);return[r,o]}function nn(t,r){if(r===void 0)r=[t];let o=tn(t);return Bt(()=>{if(o.current!==t)o.current=t},r),o}function on(t,r){let o=tn();return ma(()=>{let a=t(o.current);return o.current=a,a},[...r])}function Rn(t){let r=io(t),o=tn(null),a=oo((s)=>{if(s!==o.current)r==null||r(s,o.current);o.current=s},[]);return[o,a]}function lo(t){let r=tn();return gi(()=>{r.current=t},[t]),r.current}var pa={};function Er(t,r){return ma(()=>{if(r)return r;let o=pa[t]==null?0:pa[t]+1;return pa[t]=o,t+"-"+o},[t,r])}function hi(t){return function(r){for(var o=arguments.length,a=Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];return a.reduce((i,l)=>{let c=Object.entries(l);for(let[d,u]of c){let h=i[d];if(h!=null)i[d]=h+t*u}return i},{...r})}}var Mr=hi(1),Ir=hi(-1);function np(t){return"clientX"in t&&"clientY"in t}function Cn(t){if(!t)return!1;let{KeyboardEvent:r}=ze(t.target);return r&&t instanceof r}function op(t){if(!t)return!1;let{TouchEvent:r}=ze(t.target);return r&&t instanceof r}function co(t){if(op(t)){if(t.touches&&t.touches.length){let{clientX:r,clientY:o}=t.touches[0];return{x:r,y:o}}else if(t.changedTouches&&t.changedTouches.length){let{clientX:r,clientY:o}=t.changedTouches[0];return{x:r,y:o}}}if(np(t))return{x:t.clientX,y:t.clientY};return null}var Cr=Object.freeze({Translate:{toString(t){if(!t)return;let{x:r,y:o}=t;return"translate3d("+(r?Math.round(r):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:r,scaleY:o}=t;return"scaleX("+r+") scaleY("+o+")"}},Transform:{toString(t){if(!t)return;return[Cr.Translate.toString(t),Cr.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:r,duration:o,easing:a}=t;return r+" "+o+"ms "+a}}}),fi="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function xi(t){if(t.matches(fi))return t;return t.querySelector(fi)}import yi,{useState as ap,useCallback as sp}from"react";var ip={display:"none"};function wi(t){let{id:r,value:o}=t;return yi.createElement("div",{id:r,style:ip},o)}function Ni(t){let{id:r,announcement:o,ariaLiveType:a="assertive"}=t,s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return yi.createElement("div",{id:r,style:s,role:"status","aria-live":a,"aria-atomic":!0},o)}function Ri(){let[t,r]=ap("");return{announce:sp((a)=>{if(a!=null)r(a)},[]),announcement:t}}var Hi=Tn(null);function up(t){let r=ln(Hi);xe(()=>{if(!r)throw Error("useDndMonitor must be used within a children of <DndContext>");return r(t)},[t,r])}function pp(){let[t]=Xt(()=>new Set),r=Kt((a)=>(t.add(a),()=>t.delete(a)),[t]);return[Kt((a)=>{let{type:s,event:i}=a;t.forEach((l)=>{var c;return(c=l[s])==null?void 0:c.call(l,i)})},[t]),r]}var mp={draggable:`
3
3
  To pick up a draggable item, press the space bar.
4
4
  While dragging, use the arrow keys to move the item.
5
5
  Press space again to drop the item in its new position, or press escape to cancel.
6
- `},X7={onDragStart(M){let{active:$}=M;return"Picked up draggable item "+$.id+"."},onDragOver(M){let{active:$,over:P}=M;if(P)return"Draggable item "+$.id+" was moved over droppable area "+P.id+".";return"Draggable item "+$.id+" is no longer over a droppable area."},onDragEnd(M){let{active:$,over:P}=M;if(P)return"Draggable item "+$.id+" was dropped over droppable area "+P.id;return"Draggable item "+$.id+" was dropped."},onDragCancel(M){let{active:$}=M;return"Dragging was cancelled. Draggable item "+$.id+" was dropped."}};function H7(M){let{announcements:$=X7,container:P,hiddenTextDescribedById:Z,screenReaderInstructions:X=Z7}=M,{announce:H,announcement:W}=a3(),J=z1("DndLiveRegion"),[Y,Q]=R0(!1);if(d(()=>{Q(!0)},[]),$7(i(()=>({onDragStart(G){let{active:F}=G;H($.onDragStart({active:F}))},onDragMove(G){let{active:F,over:B}=G;if($.onDragMove)H($.onDragMove({active:F,over:B}))},onDragOver(G){let{active:F,over:B}=G;H($.onDragOver({active:F,over:B}))},onDragEnd(G){let{active:F,over:B}=G;H($.onDragEnd({active:F,over:B}))},onDragCancel(G){let{active:F,over:B}=G;H($.onDragCancel({active:F,over:B}))}}),[H,$])),!Y)return null;let U=C0.createElement(C0.Fragment,null,C0.createElement(t3,{id:Z,value:X.draggable}),C0.createElement(n3,{id:J,announcement:W}));return P?M7(U,P):U}var l;(function(M){M.DragStart="dragStart",M.DragMove="dragMove",M.DragEnd="dragEnd",M.DragCancel="dragCancel",M.DragOver="dragOver",M.RegisterDroppable="registerDroppable",M.SetDroppableDisabled="setDroppableDisabled",M.UnregisterDroppable="unregisterDroppable"})(l||(l={}));function K5(){}function _M(M,$){return i(()=>({sensor:M,options:$!=null?$:{}}),[M,$])}function UP(){for(var M=arguments.length,$=Array(M),P=0;P<M;P++)$[P]=arguments[P];return i(()=>[...$].filter((Z)=>Z!=null),[...$])}var D0=Object.freeze({x:0,y:0});function GP(M,$){return Math.sqrt(Math.pow(M.x-$.x,2)+Math.pow(M.y-$.y,2))}function FP(M,$){let{data:{value:P}}=M,{data:{value:Z}}=$;return P-Z}function W7(M,$){let{data:{value:P}}=M,{data:{value:Z}}=$;return Z-P}function s3(M){let{left:$,top:P,height:Z,width:X}=M;return[{x:$,y:P},{x:$+X,y:P},{x:$,y:P+Z},{x:$+X,y:P+Z}]}function EM(M,$){if(!M||M.length===0)return null;let[P]=M;return $?P[$]:P}function e3(M,$,P){if($===void 0)$=M.left;if(P===void 0)P=M.top;return{x:$+M.width*0.5,y:P+M.height*0.5}}var qP=(M)=>{let{collisionRect:$,droppableRects:P,droppableContainers:Z}=M,X=e3($,$.left,$.top),H=[];for(let W of Z){let{id:J}=W,Y=P.get(J);if(Y){let Q=GP(e3(Y),X);H.push({id:J,data:{droppableContainer:W,value:Q}})}}return H.sort(FP)},KP=(M)=>{let{collisionRect:$,droppableRects:P,droppableContainers:Z}=M,X=s3($),H=[];for(let W of Z){let{id:J}=W,Y=P.get(J);if(Y){let Q=s3(Y),U=X.reduce((F,B,q)=>{return F+GP(Q[q],B)},0),G=Number((U/4).toFixed(4));H.push({id:J,data:{droppableContainer:W,value:G}})}}return H.sort(FP)};function J7(M,$){let P=Math.max($.top,M.top),Z=Math.max($.left,M.left),X=Math.min($.left+$.width,M.left+M.width),H=Math.min($.top+$.height,M.top+M.height),W=X-Z,J=H-P;if(Z<X&&P<H){let Y=$.width*$.height,Q=M.width*M.height,U=W*J,G=U/(Y+Q-U);return Number(G.toFixed(4))}return 0}var Y7=(M)=>{let{collisionRect:$,droppableRects:P,droppableContainers:Z}=M,X=[];for(let H of Z){let{id:W}=H,J=P.get(W);if(J){let Y=J7(J,$);if(Y>0)X.push({id:W,data:{droppableContainer:H,value:Y}})}}return X.sort(W7)};function Q7(M,$,P){return{...M,scaleX:$&&P?$.width/P.width:1,scaleY:$&&P?$.height/P.height:1}}function BP(M,$){return M&&$?{x:M.left-$.left,y:M.top-$.top}:D0}function f7(M){return function(P){for(var Z=arguments.length,X=Array(Z>1?Z-1:0),H=1;H<Z;H++)X[H-1]=arguments[H];return X.reduce((W,J)=>({...W,top:W.top+M*J.y,bottom:W.bottom+M*J.y,left:W.left+M*J.x,right:W.right+M*J.x}),{...P})}}var U7=f7(1);function G7(M){if(M.startsWith("matrix3d(")){let $=M.slice(9,-1).split(/, /);return{x:+$[12],y:+$[13],scaleX:+$[0],scaleY:+$[5]}}else if(M.startsWith("matrix(")){let $=M.slice(7,-1).split(/, /);return{x:+$[4],y:+$[5],scaleX:+$[0],scaleY:+$[3]}}return null}function F7(M,$,P){let Z=G7($);if(!Z)return M;let{scaleX:X,scaleY:H,x:W,y:J}=Z,Y=M.left-W-(1-X)*parseFloat(P),Q=M.top-J-(1-H)*parseFloat(P.slice(P.indexOf(" ")+1)),U=X?M.width/X:M.width,G=H?M.height/H:M.height;return{width:U,height:G,top:Q,right:Y+U,bottom:Q+G,left:Y}}var q7={ignoreTransform:!1};function O1(M,$){if($===void 0)$=q7;let P=M.getBoundingClientRect();if($.ignoreTransform){let{transform:Q,transformOrigin:U}=Y0(M).getComputedStyle(M);if(Q)P=F7(P,Q,U)}let{top:Z,left:X,width:H,height:W,bottom:J,right:Y}=P;return{top:Z,left:X,width:H,height:W,bottom:J,right:Y}}function MP(M){return O1(M,{ignoreTransform:!0})}function K7(M){let{innerWidth:$,innerHeight:P}=M;return{top:0,left:0,right:$,bottom:P,width:$,height:P}}function B7(M,$){if($===void 0)$=Y0(M).getComputedStyle(M);return $.position==="fixed"}function N7(M,$){if($===void 0)$=Y0(M).getComputedStyle(M);let P=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((X)=>{let H=$[X];return typeof H==="string"?P.test(H):!1})}function y2(M,$){let P=[];function Z(X){if($!=null&&P.length>=$)return P;if(!X)return P;if(Q5(X)&&X.scrollingElement!=null&&!P.includes(X.scrollingElement))return P.push(X.scrollingElement),P;if(!H2(X)||VM(X))return P;if(P.includes(X))return P;let H=Y0(M).getComputedStyle(X);if(X!==M){if(N7(X,H))P.push(X)}if(B7(X,H))return P;return Z(X.parentNode)}if(!M)return P;return Z(M)}function NP(M){let[$]=y2(M,1);return $!=null?$:null}function zM(M){if(!k2||!M)return null;if(L1(M))return M;if(!Y5(M))return null;if(Q5(M)||M===V1(M).scrollingElement)return window;if(H2(M))return M;return null}function LP(M){if(L1(M))return M.scrollX;return M.scrollLeft}function VP(M){if(L1(M))return M.scrollY;return M.scrollTop}function OM(M){return{x:LP(M),y:VP(M)}}var e;(function(M){M[M.Forward=1]="Forward",M[M.Backward=-1]="Backward"})(e||(e={}));function zP(M){if(!k2||!M)return!1;return M===document.scrollingElement}function wP(M){let $={x:0,y:0},P=zP(M)?{height:window.innerHeight,width:window.innerWidth}:{height:M.clientHeight,width:M.clientWidth},Z={x:M.scrollWidth-P.width,y:M.scrollHeight-P.height},X=M.scrollTop<=$.y,H=M.scrollLeft<=$.x,W=M.scrollTop>=Z.y,J=M.scrollLeft>=Z.x;return{isTop:X,isLeft:H,isBottom:W,isRight:J,maxScroll:Z,minScroll:$}}var L7={x:0.2,y:0.2};function V7(M,$,P,Z,X){let{top:H,left:W,right:J,bottom:Y}=P;if(Z===void 0)Z=10;if(X===void 0)X=L7;let{isTop:Q,isBottom:U,isLeft:G,isRight:F}=wP(M),B={x:0,y:0},q={x:0,y:0},N={height:$.height*X.y,width:$.width*X.x};if(!Q&&H<=$.top+N.height)B.y=e.Backward,q.y=Z*Math.abs(($.top+N.height-H)/N.height);else if(!U&&Y>=$.bottom-N.height)B.y=e.Forward,q.y=Z*Math.abs(($.bottom-N.height-Y)/N.height);if(!F&&J>=$.right-N.width)B.x=e.Forward,q.x=Z*Math.abs(($.right-N.width-J)/N.width);else if(!G&&W<=$.left+N.width)B.x=e.Backward,q.x=Z*Math.abs(($.left+N.width-W)/N.width);return{direction:B,speed:q}}function z7(M){if(M===document.scrollingElement){let{innerWidth:H,innerHeight:W}=window;return{top:0,left:0,right:H,bottom:W,width:H,height:W}}let{top:$,left:P,right:Z,bottom:X}=M.getBoundingClientRect();return{top:$,left:P,right:Z,bottom:X,width:M.clientWidth,height:M.clientHeight}}function TP(M){return M.reduce(($,P)=>{return w1($,OM(P))},D0)}function w7(M){return M.reduce(($,P)=>{return $+LP(P)},0)}function T7(M){return M.reduce(($,P)=>{return $+VP(P)},0)}function O7(M,$){if($===void 0)$=O1;if(!M)return;let{top:P,left:Z,bottom:X,right:H}=$(M);if(!NP(M))return;if(X<=0||H<=0||P>=window.innerHeight||Z>=window.innerWidth)M.scrollIntoView({block:"center",inline:"center"})}var A7=[["x",["left","right"],w7],["y",["top","bottom"],T7]];class N5{constructor(M,$){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let P=y2($),Z=TP(P);this.rect={...M},this.width=M.width,this.height=M.height;for(let[X,H,W]of A7)for(let J of H)Object.defineProperty(this,J,{get:()=>{let Y=W(P),Q=Z[X]-Y;return this.rect[J]+Q},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Y2{constructor(M){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(($)=>{var P;return(P=this.target)==null?void 0:P.removeEventListener(...$)})},this.target=M}add(M,$,P){var Z;(Z=this.target)==null||Z.addEventListener(M,$,P),this.listeners.push([M,$,P])}}function k7(M){let{EventTarget:$}=Y0(M);return M instanceof $?M:V1(M)}function wM(M,$){let P=Math.abs(M.x),Z=Math.abs(M.y);if(typeof $==="number")return Math.sqrt(P**2+Z**2)>$;if("x"in $&&"y"in $)return P>$.x&&Z>$.y;if("x"in $)return P>$.x;if("y"in $)return Z>$.y;return!1}var k0;(function(M){M.Click="click",M.DragStart="dragstart",M.Keydown="keydown",M.ContextMenu="contextmenu",M.Resize="resize",M.SelectionChange="selectionchange",M.VisibilityChange="visibilitychange"})(k0||(k0={}));function $P(M){M.preventDefault()}function _7(M){M.stopPropagation()}var m;(function(M){M.Space="Space",M.Down="ArrowDown",M.Right="ArrowRight",M.Left="ArrowLeft",M.Up="ArrowUp",M.Esc="Escape",M.Enter="Enter",M.Tab="Tab"})(m||(m={}));var OP={start:[m.Space,m.Enter],cancel:[m.Esc],end:[m.Space,m.Enter,m.Tab]},E7=(M,$)=>{let{currentCoordinates:P}=$;switch(M.code){case m.Right:return{...P,x:P.x+25};case m.Left:return{...P,x:P.x-25};case m.Down:return{...P,y:P.y+25};case m.Up:return{...P,y:P.y-25}}return};class m2{constructor(M){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=M;let{event:{target:$}}=M;this.props=M,this.listeners=new Y2(V1($)),this.windowListeners=new Y2(Y0($)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(k0.Resize,this.handleCancel),this.windowListeners.add(k0.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(k0.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:M,onStart:$}=this.props,P=M.node.current;if(P)O7(P);$(D0)}handleKeyDown(M){if(E2(M)){let{active:$,context:P,options:Z}=this.props,{keyboardCodes:X=OP,coordinateGetter:H=E7,scrollBehavior:W="smooth"}=Z,{code:J}=M;if(X.end.includes(J)){this.handleEnd(M);return}if(X.cancel.includes(J)){this.handleCancel(M);return}let{collisionRect:Y}=P.current,Q=Y?{x:Y.left,y:Y.top}:D0;if(!this.referenceCoordinates)this.referenceCoordinates=Q;let U=H(M,{active:$,context:P.current,currentCoordinates:Q});if(U){let G=T1(U,Q),F={x:0,y:0},{scrollableAncestors:B}=P.current;for(let q of B){let N=M.code,{isTop:A,isRight:w,isLeft:L,isBottom:V,maxScroll:T,minScroll:_}=wP(q),z=z7(q),O={x:Math.min(N===m.Right?z.right-z.width/2:z.right,Math.max(N===m.Right?z.left:z.left+z.width/2,U.x)),y:Math.min(N===m.Down?z.bottom-z.height/2:z.bottom,Math.max(N===m.Down?z.top:z.top+z.height/2,U.y))},k=N===m.Right&&!w||N===m.Left&&!L,I=N===m.Down&&!V||N===m.Up&&!A;if(k&&O.x!==U.x){let R=q.scrollLeft+G.x,u=N===m.Right&&R<=T.x||N===m.Left&&R>=_.x;if(u&&!G.y){q.scrollTo({left:R,behavior:W});return}if(u)F.x=q.scrollLeft-R;else F.x=N===m.Right?q.scrollLeft-T.x:q.scrollLeft-_.x;if(F.x)q.scrollBy({left:-F.x,behavior:W});break}else if(I&&O.y!==U.y){let R=q.scrollTop+G.y,u=N===m.Down&&R<=T.y||N===m.Up&&R>=_.y;if(u&&!G.x){q.scrollTo({top:R,behavior:W});return}if(u)F.y=q.scrollTop-R;else F.y=N===m.Down?q.scrollTop-T.y:q.scrollTop-_.y;if(F.y)q.scrollBy({top:-F.y,behavior:W});break}}this.handleMove(M,w1(T1(U,this.referenceCoordinates),F))}}}handleMove(M,$){let{onMove:P}=this.props;M.preventDefault(),P($)}handleEnd(M){let{onEnd:$}=this.props;M.preventDefault(),this.detach(),$()}handleCancel(M){let{onCancel:$}=this.props;M.preventDefault(),this.detach(),$()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}m2.activators=[{eventName:"onKeyDown",handler:(M,$,P)=>{let{keyboardCodes:Z=OP,onActivation:X}=$,{active:H}=P,{code:W}=M.nativeEvent;if(Z.start.includes(W)){let J=H.activatorNode.current;if(J&&M.target!==J)return!1;return M.preventDefault(),X==null||X({event:M.nativeEvent}),!0}return!1}}];function PP(M){return Boolean(M&&"distance"in M)}function ZP(M){return Boolean(M&&"delay"in M)}class L5{constructor(M,$,P){var Z;if(P===void 0)P=k7(M.event.target);this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=M,this.events=$;let{event:X}=M,{target:H}=X;this.props=M,this.events=$,this.document=V1(H),this.documentListeners=new Y2(this.document),this.listeners=new Y2(P),this.windowListeners=new Y2(Y0(H)),this.initialCoordinates=(Z=G5(X))!=null?Z:D0,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:M,props:{options:{activationConstraint:$,bypassActivationConstraint:P}}}=this;if(this.listeners.add(M.move.name,this.handleMove,{passive:!1}),this.listeners.add(M.end.name,this.handleEnd),M.cancel)this.listeners.add(M.cancel.name,this.handleCancel);if(this.windowListeners.add(k0.Resize,this.handleCancel),this.windowListeners.add(k0.DragStart,$P),this.windowListeners.add(k0.VisibilityChange,this.handleCancel),this.windowListeners.add(k0.ContextMenu,$P),this.documentListeners.add(k0.Keydown,this.handleKeydown),$){if(P!=null&&P({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ZP($)){this.timeoutId=setTimeout(this.handleStart,$.delay),this.handlePending($);return}if(PP($)){this.handlePending($);return}}this.handleStart()}detach(){if(this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null)clearTimeout(this.timeoutId),this.timeoutId=null}handlePending(M,$){let{active:P,onPending:Z}=this.props;Z(P,M,this.initialCoordinates,$)}handleStart(){let{initialCoordinates:M}=this,{onStart:$}=this.props;if(M)this.activated=!0,this.documentListeners.add(k0.Click,_7,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(k0.SelectionChange,this.removeTextSelection),$(M)}handleMove(M){var $;let{activated:P,initialCoordinates:Z,props:X}=this,{onMove:H,options:{activationConstraint:W}}=X;if(!Z)return;let J=($=G5(M))!=null?$:D0,Y=T1(Z,J);if(!P&&W){if(PP(W)){if(W.tolerance!=null&&wM(Y,W.tolerance))return this.handleCancel();if(wM(Y,W.distance))return this.handleStart()}if(ZP(W)){if(wM(Y,W.tolerance))return this.handleCancel()}this.handlePending(W,Y);return}if(M.cancelable)M.preventDefault();H(J)}handleEnd(){let{onAbort:M,onEnd:$}=this.props;if(this.detach(),!this.activated)M(this.props.active);$()}handleCancel(){let{onAbort:M,onCancel:$}=this.props;if(this.detach(),!this.activated)M(this.props.active);$()}handleKeydown(M){if(M.code===m.Esc)this.handleCancel()}removeTextSelection(){var M;(M=this.document.getSelection())==null||M.removeAllRanges()}}var R7={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class I2 extends L5{constructor(M){let{event:$}=M,P=V1($.target);super(M,R7,P)}}I2.activators=[{eventName:"onPointerDown",handler:(M,$)=>{let{nativeEvent:P}=M,{onActivation:Z}=$;if(!P.isPrimary||P.button!==0)return!1;return Z==null||Z({event:P}),!0}}];var S7={move:{name:"mousemove"},end:{name:"mouseup"}},AM;(function(M){M[M.RightClick=2]="RightClick"})(AM||(AM={}));class AP extends L5{constructor(M){super(M,S7,V1(M.event.target))}}AP.activators=[{eventName:"onMouseDown",handler:(M,$)=>{let{nativeEvent:P}=M,{onActivation:Z}=$;if(P.button===AM.RightClick)return!1;return Z==null||Z({event:P}),!0}}];var TM={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class kP extends L5{constructor(M){super(M,TM)}static setup(){return window.addEventListener(TM.move.name,M,{capture:!1,passive:!1}),function(){window.removeEventListener(TM.move.name,M)};function M(){}}}kP.activators=[{eventName:"onTouchStart",handler:(M,$)=>{let{nativeEvent:P}=M,{onActivation:Z}=$,{touches:X}=P;if(X.length>1)return!1;return Z==null||Z({event:P}),!0}}];var R2;(function(M){M[M.Pointer=0]="Pointer",M[M.DraggableRect=1]="DraggableRect"})(R2||(R2={}));var B5;(function(M){M[M.TreeOrder=0]="TreeOrder",M[M.ReversedTreeOrder=1]="ReversedTreeOrder"})(B5||(B5={}));function D7(M){let{acceleration:$,activator:P=R2.Pointer,canScroll:Z,draggingRect:X,enabled:H,interval:W=5,order:J=B5.TreeOrder,pointerCoordinates:Y,scrollableAncestors:Q,scrollableAncestorRects:U,delta:G,threshold:F}=M,B=m7({delta:G,disabled:!H}),[q,N]=r3(),A=Z0({x:0,y:0}),w=Z0({x:0,y:0}),L=i(()=>{switch(P){case R2.Pointer:return Y?{top:Y.y,bottom:Y.y,left:Y.x,right:Y.x}:null;case R2.DraggableRect:return X}},[P,X,Y]),V=Z0(null),T=S0(()=>{let z=V.current;if(!z)return;let O=A.current.x*w.current.x,k=A.current.y*w.current.y;z.scrollBy(O,k)},[]),_=i(()=>J===B5.TreeOrder?[...Q].reverse():Q,[J,Q]);d(()=>{if(!H||!Q.length||!L){N();return}for(let z of _){if((Z==null?void 0:Z(z))===!1)continue;let O=Q.indexOf(z),k=U[O];if(!k)continue;let{direction:I,speed:R}=V7(z,k,L,$,F);for(let u of["x","y"])if(!B[u][I[u]])R[u]=0,I[u]=0;if(R.x>0||R.y>0){N(),V.current=z,q(T,W),A.current=R,w.current=I;return}}A.current={x:0,y:0},w.current={x:0,y:0},N()},[$,T,Z,N,H,W,JSON.stringify(L),JSON.stringify(B),q,Q,_,U,JSON.stringify(F)])}var y7={x:{[e.Backward]:!1,[e.Forward]:!1},y:{[e.Backward]:!1,[e.Forward]:!1}};function m7(M){let{delta:$,disabled:P}=M,Z=U5($);return J2((X)=>{if(P||!Z||!X)return y7;let H={x:Math.sign($.x-Z.x),y:Math.sign($.y-Z.y)};return{x:{[e.Backward]:X.x[e.Backward]||H.x===-1,[e.Forward]:X.x[e.Forward]||H.x===1},y:{[e.Backward]:X.y[e.Backward]||H.y===-1,[e.Forward]:X.y[e.Forward]||H.y===1}}},[P,$,Z])}function I7(M,$){let P=$!=null?M.get($):void 0,Z=P?P.node.current:null;return J2((X)=>{var H;if($==null)return null;return(H=Z!=null?Z:X)!=null?H:null},[Z,$])}function b7(M,$){return i(()=>M.reduce((P,Z)=>{let{sensor:X}=Z,H=X.activators.map((W)=>({eventName:W.eventName,handler:$(W.handler,Z)}));return[...P,...H]},[]),[M,$])}var S2;(function(M){M[M.Always=0]="Always",M[M.BeforeDragging=1]="BeforeDragging",M[M.WhileDragging=2]="WhileDragging"})(S2||(S2={}));var kM;(function(M){M.Optimized="optimized"})(kM||(kM={}));var XP=new Map;function g7(M,$){let{dragging:P,dependencies:Z,config:X}=$,[H,W]=R0(null),{frequency:J,measure:Y,strategy:Q}=X,U=Z0(M),G=A(),F=W2(G),B=S0(function(w){if(w===void 0)w=[];if(F.current)return;W((L)=>{if(L===null)return w;return L.concat(w.filter((V)=>!L.includes(V)))})},[F]),q=Z0(null),N=J2((w)=>{if(G&&!P)return XP;if(!w||w===XP||U.current!==M||H!=null){let L=new Map;for(let V of M){if(!V)continue;if(H&&H.length>0&&!H.includes(V.id)&&V.rect.current){L.set(V.id,V.rect.current);continue}let T=V.node.current,_=T?new N5(Y(T),T):null;if(V.rect.current=_,_)L.set(V.id,_)}return L}return w},[M,H,P,G,Y]);return d(()=>{U.current=M},[M]),d(()=>{if(G)return;B()},[P,G]),d(()=>{if(H&&H.length>0)W(null)},[JSON.stringify(H)]),d(()=>{if(G||typeof J!=="number"||q.current!==null)return;q.current=setTimeout(()=>{B(),q.current=null},J)},[J,G,B,...Z]),{droppableRects:N,measureDroppableContainers:B,measuringScheduled:H!=null};function A(){switch(Q){case S2.Always:return!1;case S2.BeforeDragging:return P;default:return!P}}}function _P(M,$){return J2((P)=>{if(!M)return null;if(P)return P;return typeof $==="function"?$(M):M},[$,M])}function C7(M,$){return _P(M,$)}function u7(M){let{callback:$,disabled:P}=M,Z=f5($),X=i(()=>{if(P||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:H}=window;return new H(Z)},[Z,P]);return d(()=>{return()=>X==null?void 0:X.disconnect()},[X]),X}function V5(M){let{callback:$,disabled:P}=M,Z=f5($),X=i(()=>{if(P||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:H}=window;return new H(Z)},[P]);return d(()=>{return()=>X==null?void 0:X.disconnect()},[X]),X}function h7(M){return new N5(O1(M),M)}function HP(M,$,P){if($===void 0)$=h7;let[Z,X]=R0(null);function H(){X((Y)=>{if(!M)return null;if(M.isConnected===!1){var Q;return(Q=Y!=null?Y:P)!=null?Q:null}let U=$(M);if(JSON.stringify(Y)===JSON.stringify(U))return Y;return U})}let W=u7({callback(Y){if(!M)return;for(let Q of Y){let{type:U,target:G}=Q;if(U==="childList"&&G instanceof HTMLElement&&G.contains(M)){H();break}}}}),J=V5({callback:H});return A0(()=>{if(H(),M)J==null||J.observe(M),W==null||W.observe(document.body,{childList:!0,subtree:!0});else J==null||J.disconnect(),W==null||W.disconnect()},[M]),Z}function p7(M){let $=_P(M);return BP(M,$)}var WP=[];function v7(M){let $=Z0(M),P=J2((Z)=>{if(!M)return WP;if(Z&&Z!==WP&&M&&$.current&&M.parentNode===$.current.parentNode)return Z;return y2(M)},[M]);return d(()=>{$.current=M},[M]),P}function j7(M){let[$,P]=R0(null),Z=Z0(M),X=S0((H)=>{let W=zM(H.target);if(!W)return;P((J)=>{if(!J)return null;return J.set(W,OM(W)),new Map(J)})},[]);return d(()=>{let H=Z.current;if(M!==H){W(H);let J=M.map((Y)=>{let Q=zM(Y);if(Q)return Q.addEventListener("scroll",X,{passive:!0}),[Q,OM(Q)];return null}).filter((Y)=>Y!=null);P(J.length?new Map(J):null),Z.current=M}return()=>{W(M),W(H)};function W(J){J.forEach((Y)=>{let Q=zM(Y);Q==null||Q.removeEventListener("scroll",X)})}},[X,M]),i(()=>{if(M.length)return $?Array.from($.values()).reduce((H,W)=>w1(H,W),D0):TP(M);return D0},[M,$])}function JP(M,$){if($===void 0)$=[];let P=Z0(null);return d(()=>{P.current=null},$),d(()=>{let Z=M!==D0;if(Z&&!P.current)P.current=M;if(!Z&&P.current)P.current=null},[M]),P.current?T1(M,P.current):D0}function x7(M){d(()=>{if(!k2)return;let $=M.map((P)=>{let{sensor:Z}=P;return Z.setup==null?void 0:Z.setup()});return()=>{for(let P of $)P==null||P()}},M.map(($)=>{let{sensor:P}=$;return P}))}function c7(M,$){return i(()=>{return M.reduce((P,Z)=>{let{eventName:X,handler:H}=Z;return P[X]=(W)=>{H(W,$)},P},{})},[M,$])}function EP(M){return i(()=>M?K7(M):null,[M])}var YP=[];function d7(M,$){if($===void 0)$=O1;let[P]=M,Z=EP(P?Y0(P):null),[X,H]=R0(YP);function W(){H(()=>{if(!M.length)return YP;return M.map((Y)=>zP(Y)?Z:new N5($(Y),Y))})}let J=V5({callback:W});return A0(()=>{J==null||J.disconnect(),W(),M.forEach((Y)=>J==null?void 0:J.observe(Y))},[M]),X}function r7(M){if(!M)return null;if(M.children.length>1)return M;let $=M.children[0];return H2($)?$:M}function o7(M){let{measure:$}=M,[P,Z]=R0(null),X=S0((Q)=>{for(let{target:U}of Q)if(H2(U)){Z((G)=>{let F=$(U);return G?{...G,width:F.width,height:F.height}:F});break}},[$]),H=V5({callback:X}),W=S0((Q)=>{let U=r7(Q);if(H==null||H.disconnect(),U)H==null||H.observe(U);Z(U?$(U):null)},[$,H]),[J,Y]=_2(W);return i(()=>({nodeRef:J,rect:P,setRef:Y}),[P,J,Y])}var l7=[{sensor:I2,options:{}},{sensor:m2,options:{}}],i7={current:{}},q5={draggable:{measure:MP},droppable:{measure:MP,strategy:S2.WhileDragging,frequency:kM.Optimized},dragOverlay:{measure:O1}};class Q2 extends Map{get(M){var $;return M!=null?($=super.get(M))!=null?$:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((M)=>{let{disabled:$}=M;return!$})}getNodeFor(M){var $,P;return($=(P=this.get(M))==null?void 0:P.node.current)!=null?$:void 0}}var t7={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Q2,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:K5},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:q5,measureDroppableContainers:K5,windowRect:null,measuringScheduled:!1},n7={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:K5,draggableNodes:new Map,over:null,measureDroppableContainers:K5},z5=D2(n7),RP=D2(t7);function a7(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Q2}}}function s7(M,$){switch($.type){case l.DragStart:return{...M,draggable:{...M.draggable,initialCoordinates:$.initialCoordinates,active:$.active}};case l.DragMove:if(M.draggable.active==null)return M;return{...M,draggable:{...M.draggable,translate:{x:$.coordinates.x-M.draggable.initialCoordinates.x,y:$.coordinates.y-M.draggable.initialCoordinates.y}}};case l.DragEnd:case l.DragCancel:return{...M,draggable:{...M.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case l.RegisterDroppable:{let{element:P}=$,{id:Z}=P,X=new Q2(M.droppable.containers);return X.set(Z,P),{...M,droppable:{...M.droppable,containers:X}}}case l.SetDroppableDisabled:{let{id:P,key:Z,disabled:X}=$,H=M.droppable.containers.get(P);if(!H||Z!==H.key)return M;let W=new Q2(M.droppable.containers);return W.set(P,{...H,disabled:X}),{...M,droppable:{...M.droppable,containers:W}}}case l.UnregisterDroppable:{let{id:P,key:Z}=$,X=M.droppable.containers.get(P);if(!X||Z!==X.key)return M;let H=new Q2(M.droppable.containers);return H.delete(P),{...M,droppable:{...M.droppable,containers:H}}}default:return M}}function e7(M){let{disabled:$}=M,{active:P,activatorEvent:Z,draggableNodes:X}=f2(z5),H=U5(Z),W=U5(P==null?void 0:P.id);return d(()=>{if($)return;if(!Z&&H&&W!=null){if(!E2(H))return;if(document.activeElement===H.target)return;let J=X.get(W);if(!J)return;let{activatorNode:Y,node:Q}=J;if(!Y.current&&!Q.current)return;requestAnimationFrame(()=>{for(let U of[Y.current,Q.current]){if(!U)continue;let G=l3(U);if(G){G.focus();break}}})}},[Z,$,X,W,H]),null}function MZ(M,$){let{transform:P,...Z}=$;return M!=null&&M.length?M.reduce((X,H)=>{return H({transform:X,...Z})},P):P}function $Z(M){return i(()=>({draggable:{...q5.draggable,...M==null?void 0:M.draggable},droppable:{...q5.droppable,...M==null?void 0:M.droppable},dragOverlay:{...q5.dragOverlay,...M==null?void 0:M.dragOverlay}}),[M==null?void 0:M.draggable,M==null?void 0:M.droppable,M==null?void 0:M.dragOverlay])}function PZ(M){let{activeNode:$,measure:P,initialRect:Z,config:X=!0}=M,H=Z0(!1),{x:W,y:J}=typeof X==="boolean"?{x:X,y:X}:X;A0(()=>{if(!W&&!J||!$){H.current=!1;return}if(H.current||!Z)return;let Q=$==null?void 0:$.node.current;if(!Q||Q.isConnected===!1)return;let U=P(Q),G=BP(U,Z);if(!W)G.x=0;if(!J)G.y=0;if(H.current=!0,Math.abs(G.x)>0||Math.abs(G.y)>0){let F=NP(Q);if(F)F.scrollBy({top:G.y,left:G.x})}},[$,W,J,Z,P])}var SP=D2({...D0,scaleX:1,scaleY:1}),G1;(function(M){M[M.Uninitialized=0]="Uninitialized",M[M.Initializing=1]="Initializing",M[M.Initialized=2]="Initialized"})(G1||(G1={}));var DP=s9(function($){var P,Z,X,H;let{id:W,accessibility:J,autoScroll:Y=!0,children:Q,sensors:U=l7,collisionDetection:G=Y7,measuring:F,modifiers:B,...q}=$,N=e9(s7,void 0,a7),[A,w]=N,[L,V]=P7(),[T,_]=R0(G1.Uninitialized),z=T===G1.Initialized,{draggable:{active:O,nodes:k,translate:I},droppable:{containers:R}}=A,u=O!=null?k.get(O):null,r=Z0({initial:null,translated:null}),x=i(()=>{var H0;return O!=null?{id:O,data:(H0=u==null?void 0:u.data)!=null?H0:i7,rect:r}:null},[O,u]),t=Z0(null),[X0,W0]=R0(null),[j,G0]=R0(null),c=W2(q,Object.values(q)),J0=z1("DndDescribedBy",W),y=i(()=>R.getEnabled(),[R]),C=$Z(F),{droppableRects:b,measureDroppableContainers:n,measuringScheduled:F0}=g7(y,{dragging:z,dependencies:[I.x,I.y],config:C.droppable}),a=I7(k,O),t0=i(()=>j?G5(j):null,[j]),D=t4(),q0=C7(a,C.draggable.measure);PZ({activeNode:O!=null?k.get(O):null,config:D.layoutShiftCompensation,initialRect:q0,measure:C.draggable.measure});let p=HP(a,C.draggable.measure,q0),K2=HP(a?a.parentElement:null),m0=Z0({activatorEvent:null,active:null,activeNode:a,collisionRect:null,collisions:null,droppableRects:b,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),y1=R.getNodeFor((P=m0.current.over)==null?void 0:P.id),v0=o7({measure:C.dragOverlay.measure}),m1=(Z=v0.nodeRef.current)!=null?Z:a,I1=z?(X=v0.rect)!=null?X:p:null,pM=Boolean(v0.nodeRef.current&&v0.rect),vM=p7(pM?null:p),o5=EP(m1?Y0(m1):null),n0=v7(z?y1!=null?y1:a:null),v2=d7(n0),j2=MZ(B,{transform:{x:I.x-vM.x,y:I.y-vM.y,scaleX:1,scaleY:1},activatorEvent:j,active:x,activeNodeRect:p,containerNodeRect:K2,draggingNodeRect:I1,over:m0.current.over,overlayNodeRect:v0.rect,scrollableAncestors:n0,scrollableAncestorRects:v2,windowRect:o5}),jM=t0?w1(t0,I):null,xM=j7(n0),x4=JP(xM),c4=JP(xM,[p]),b1=w1(j2,x4),g1=I1?U7(I1,j2):null,B2=x&&g1?G({active:x,collisionRect:g1,droppableRects:b,droppableContainers:y,pointerCoordinates:jM}):null,cM=EM(B2,"id"),[a0,dM]=R0(null),d4=pM?j2:w1(j2,c4),r4=Q7(d4,(H=a0==null?void 0:a0.rect)!=null?H:null,p),l5=Z0(null),rM=S0((H0,K0)=>{let{sensor:B0,options:s0}=K0;if(t.current==null)return;let z0=k.get(t.current);if(!z0)return;let N0=H0.nativeEvent,I0=new B0({active:t.current,activeNode:z0,event:N0,options:s0,context:m0,onAbort($0){if(!k.get($0))return;let{onDragAbort:b0}=c.current,j0={id:$0};b0==null||b0(j0),L({type:"onDragAbort",event:j0})},onPending($0,e0,b0,j0){if(!k.get($0))return;let{onDragPending:L2}=c.current,M1={id:$0,constraint:e0,initialCoordinates:b0,offset:j0};L2==null||L2(M1),L({type:"onDragPending",event:M1})},onStart($0){let e0=t.current;if(e0==null)return;let b0=k.get(e0);if(!b0)return;let{onDragStart:j0}=c.current,N2={activatorEvent:N0,active:{id:e0,data:b0.data,rect:r}};F5(()=>{j0==null||j0(N2),_(G1.Initializing),w({type:l.DragStart,initialCoordinates:$0,active:e0}),L({type:"onDragStart",event:N2}),W0(l5.current),G0(N0)})},onMove($0){w({type:l.DragMove,coordinates:$0})},onEnd:C1(l.DragEnd),onCancel:C1(l.DragCancel)});l5.current=I0;function C1($0){return async function(){let{active:b0,collisions:j0,over:N2,scrollAdjustedTranslate:L2}=m0.current,M1=null;if(b0&&L2){let{cancelDrop:V2}=c.current;if(M1={activatorEvent:N0,active:b0,collisions:j0,delta:L2,over:N2},$0===l.DragEnd&&typeof V2==="function"){if(await Promise.resolve(V2(M1)))$0=l.DragCancel}}t.current=null,F5(()=>{w({type:$0}),_(G1.Uninitialized),dM(null),W0(null),G0(null),l5.current=null;let V2=$0===l.DragEnd?"onDragEnd":"onDragCancel";if(M1){let i5=c.current[V2];i5==null||i5(M1),L({type:V2,event:M1})}})}}},[k]),o4=S0((H0,K0)=>{return(B0,s0)=>{let z0=B0.nativeEvent,N0=k.get(s0);if(t.current!==null||!N0||z0.dndKit||z0.defaultPrevented)return;let I0={active:N0};if(H0(B0,K0.options,I0)===!0)z0.dndKit={capturedBy:K0.sensor},t.current=s0,rM(B0,K0)}},[k,rM]),oM=b7(U,o4);x7(U),A0(()=>{if(p&&T===G1.Initializing)_(G1.Initialized)},[p,T]),d(()=>{let{onDragMove:H0}=c.current,{active:K0,activatorEvent:B0,collisions:s0,over:z0}=m0.current;if(!K0||!B0)return;let N0={active:K0,activatorEvent:B0,collisions:s0,delta:{x:b1.x,y:b1.y},over:z0};F5(()=>{H0==null||H0(N0),L({type:"onDragMove",event:N0})})},[b1.x,b1.y]),d(()=>{let{active:H0,activatorEvent:K0,collisions:B0,droppableContainers:s0,scrollAdjustedTranslate:z0}=m0.current;if(!H0||t.current==null||!K0||!z0)return;let{onDragOver:N0}=c.current,I0=s0.get(cM),C1=I0&&I0.rect.current?{id:I0.id,rect:I0.rect.current,data:I0.data,disabled:I0.disabled}:null,$0={active:H0,activatorEvent:K0,collisions:B0,delta:{x:z0.x,y:z0.y},over:C1};F5(()=>{dM(C1),N0==null||N0($0),L({type:"onDragOver",event:$0})})},[cM]),A0(()=>{m0.current={activatorEvent:j,active:x,activeNode:a,collisionRect:g1,collisions:B2,droppableRects:b,draggableNodes:k,draggingNode:m1,draggingNodeRect:I1,droppableContainers:R,over:a0,scrollableAncestors:n0,scrollAdjustedTranslate:b1},r.current={initial:I1,translated:g1}},[x,a,B2,g1,k,m1,I1,b,R,a0,n0,b1]),D7({...D,delta:I,draggingRect:g1,pointerCoordinates:jM,scrollableAncestors:n0,scrollableAncestorRects:v2});let l4=i(()=>{return{active:x,activeNode:a,activeNodeRect:p,activatorEvent:j,collisions:B2,containerNodeRect:K2,dragOverlay:v0,draggableNodes:k,droppableContainers:R,droppableRects:b,over:a0,measureDroppableContainers:n,scrollableAncestors:n0,scrollableAncestorRects:v2,measuringConfiguration:C,measuringScheduled:F0,windowRect:o5}},[x,a,p,j,B2,K2,v0,k,R,b,a0,n,n0,v2,C,F0,o5]),i4=i(()=>{return{activatorEvent:j,activators:oM,active:x,activeNodeRect:p,ariaDescribedById:{draggable:J0},dispatch:w,draggableNodes:k,over:a0,measureDroppableContainers:n}},[j,oM,x,p,w,J0,k,a0,n]);return C0.createElement(fP.Provider,{value:V},C0.createElement(z5.Provider,{value:i4},C0.createElement(RP.Provider,{value:l4},C0.createElement(SP.Provider,{value:r4},Q)),C0.createElement(e7,{disabled:(J==null?void 0:J.restoreFocus)===!1})),C0.createElement(H7,{...J,hiddenTextDescribedById:J0}));function t4(){let H0=(X0==null?void 0:X0.autoScrollEnabled)===!1,K0=typeof Y==="object"?Y.enabled===!1:Y===!1,B0=z&&!H0&&!K0;if(typeof Y==="object")return{...Y,enabled:B0};return{enabled:B0}}}),ZZ=D2(null),QP="button",XZ="Draggable";function yP(M){let{id:$,data:P,disabled:Z=!1,attributes:X}=M,H=z1(XZ),{activators:W,activatorEvent:J,active:Y,activeNodeRect:Q,ariaDescribedById:U,draggableNodes:G,over:F}=f2(z5),{role:B=QP,roleDescription:q="draggable",tabIndex:N=0}=X!=null?X:{},A=(Y==null?void 0:Y.id)===$,w=f2(A?SP:ZZ),[L,V]=_2(),[T,_]=_2(),z=c7(W,$),O=W2(P);A0(()=>{return G.set($,{id:$,key:H,node:L,activatorNode:T,data:O}),()=>{let I=G.get($);if(I&&I.key===H)G.delete($)}},[G,$]);let k=i(()=>({role:B,tabIndex:N,"aria-disabled":Z,"aria-pressed":A&&B===QP?!0:void 0,"aria-roledescription":q,"aria-describedby":U.draggable}),[Z,B,N,A,q,U.draggable]);return{active:Y,activatorEvent:J,activeNodeRect:Q,attributes:k,isDragging:A,listeners:Z?void 0:z,node:L,over:F,setNodeRef:V,setActivatorNodeRef:_,transform:w}}function mP(){return f2(RP)}var HZ="Droppable",WZ={timeout:25};function IP(M){let{data:$,disabled:P=!1,id:Z,resizeObserverConfig:X}=M,H=z1(HZ),{active:W,dispatch:J,over:Y,measureDroppableContainers:Q}=f2(z5),U=Z0({disabled:P}),G=Z0(!1),F=Z0(null),B=Z0(null),{disabled:q,updateMeasurementsFor:N,timeout:A}={...WZ,...X},w=W2(N!=null?N:Z),L=S0(()=>{if(!G.current){G.current=!0;return}if(B.current!=null)clearTimeout(B.current);B.current=setTimeout(()=>{Q(Array.isArray(w.current)?w.current:[w.current]),B.current=null},A)},[A]),V=V5({callback:L,disabled:q||!W}),T=S0((k,I)=>{if(!V)return;if(I)V.unobserve(I),G.current=!1;if(k)V.observe(k)},[V]),[_,z]=_2(T),O=W2($);return d(()=>{if(!V||!_.current)return;V.disconnect(),G.current=!1,V.observe(_.current)},[_,V]),d(()=>{return J({type:l.RegisterDroppable,element:{id:Z,key:H,disabled:P,node:_,rect:F,data:O}}),()=>J({type:l.UnregisterDroppable,key:H,id:Z})},[Z]),d(()=>{if(P!==U.current.disabled)J({type:l.SetDroppableDisabled,id:Z,key:H,disabled:P}),U.current.disabled=P},[Z,H,P,J]),{active:W,rect:F,isOver:(Y==null?void 0:Y.id)===Z,node:_,over:Y,setNodeRef:z}}import bP,{useMemo as O5,useRef as RM,useEffect as A5,useState as JZ,useContext as YZ}from"react";function _5(M,$,P){let Z=M.slice();return Z.splice(P<0?Z.length+P:P,0,Z.splice($,1)[0]),Z}function QZ(M,$){return M.reduce((P,Z,X)=>{let H=$.get(Z);if(H)P[X]=H;return P},Array(M.length))}function w5(M){return M!==null&&M>=0}function fZ(M,$){if(M===$)return!0;if(M.length!==$.length)return!1;for(let P=0;P<M.length;P++)if(M[P]!==$[P])return!1;return!0}function UZ(M){if(typeof M==="boolean")return{draggable:M,droppable:M};return M}var gP=(M)=>{let{rects:$,activeIndex:P,overIndex:Z,index:X}=M,H=_5($,Z,P),W=$[X],J=H[X];if(!J||!W)return null;return{x:J.left-W.left,y:J.top-W.top,scaleX:J.width/W.width,scaleY:J.height/W.height}};var T5={scaleX:1,scaleY:1},CP=(M)=>{var $;let{activeIndex:P,activeNodeRect:Z,index:X,rects:H,overIndex:W}=M,J=($=H[P])!=null?$:Z;if(!J)return null;if(X===P){let Q=H[W];if(!Q)return null;return{x:0,y:P<W?Q.top+Q.height-(J.top+J.height):Q.top-J.top,...T5}}let Y=GZ(H,X,P);if(X>P&&X<=W)return{x:0,y:-J.height-Y,...T5};if(X<P&&X>=W)return{x:0,y:J.height+Y,...T5};return{x:0,y:0,...T5}};function GZ(M,$,P){let Z=M[$],X=M[$-1],H=M[$+1];if(!Z)return 0;if(P<$)return X?Z.top-(X.top+X.height):H?H.top-(Z.top+Z.height):0;return H?H.top-(Z.top+Z.height):X?Z.top-(X.top+X.height):0}var uP="Sortable",hP=bP.createContext({activeIndex:-1,containerId:uP,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:gP,disabled:{draggable:!1,droppable:!1}});function pP(M){let{children:$,id:P,items:Z,strategy:X=gP,disabled:H=!1}=M,{active:W,dragOverlay:J,droppableRects:Y,over:Q,measureDroppableContainers:U}=mP(),G=z1(uP,P),F=Boolean(J.rect!==null),B=O5(()=>Z.map((z)=>typeof z==="object"&&("id"in z)?z.id:z),[Z]),q=W!=null,N=W?B.indexOf(W.id):-1,A=Q?B.indexOf(Q.id):-1,w=RM(B),L=!fZ(B,w.current),V=A!==-1&&N===-1||L,T=UZ(H);A0(()=>{if(L&&q)U(B)},[L,B,q,U]),A5(()=>{w.current=B},[B]);let _=O5(()=>({activeIndex:N,containerId:G,disabled:T,disableTransforms:V,items:B,overIndex:A,useDragOverlay:F,sortedRects:QZ(B,Y),strategy:X}),[N,G,T.draggable,T.droppable,V,B,A,Y,F,X]);return bP.createElement(hP.Provider,{value:_},$)}var FZ=(M)=>{let{id:$,items:P,activeIndex:Z,overIndex:X}=M;return _5(P,Z,X).indexOf($)},qZ=(M)=>{let{containerId:$,isSorting:P,wasDragging:Z,index:X,items:H,newIndex:W,previousItems:J,previousContainerId:Y,transition:Q}=M;if(!Q||!Z)return!1;if(J!==H&&X===W)return!1;if(P)return!0;return W!==X&&$===Y},KZ={duration:200,easing:"ease"},vP="transform",BZ=U1.Transition.toString({property:vP,duration:0,easing:"linear"}),NZ={roleDescription:"sortable"};function LZ(M){let{disabled:$,index:P,node:Z,rect:X}=M,[H,W]=JZ(null),J=RM(P);return A0(()=>{if(!$&&P!==J.current&&Z.current){let Y=X.current;if(Y){let Q=O1(Z.current,{ignoreTransform:!0}),U={x:Y.left-Q.left,y:Y.top-Q.top,scaleX:Y.width/Q.width,scaleY:Y.height/Q.height};if(U.x||U.y)W(U)}}if(P!==J.current)J.current=P},[$,P,Z,X]),A5(()=>{if(H)W(null)},[H]),H}function jP(M){let{animateLayoutChanges:$=qZ,attributes:P,disabled:Z,data:X,getNewIndex:H=FZ,id:W,strategy:J,resizeObserverConfig:Y,transition:Q=KZ}=M,{items:U,containerId:G,activeIndex:F,disabled:B,disableTransforms:q,sortedRects:N,overIndex:A,useDragOverlay:w,strategy:L}=YZ(hP),V=VZ(Z,B),T=U.indexOf(W),_=O5(()=>({sortable:{containerId:G,index:T,items:U},...X}),[G,X,T,U]),z=O5(()=>U.slice(U.indexOf(W)),[U,W]),{rect:O,node:k,isOver:I,setNodeRef:R}=IP({id:W,data:_,disabled:V.droppable,resizeObserverConfig:{updateMeasurementsFor:z,...Y}}),{active:u,activatorEvent:r,activeNodeRect:x,attributes:t,setNodeRef:X0,listeners:W0,isDragging:j,over:G0,setActivatorNodeRef:c,transform:J0}=yP({id:W,data:_,attributes:{...NZ,...P},disabled:V.draggable}),y=d3(R,X0),C=Boolean(u),b=C&&!q&&w5(F)&&w5(A),n=!w&&j,F0=n&&b?J0:null,a=J!=null?J:L,t0=b?F0!=null?F0:a({rects:N,activeNodeRect:x,activeIndex:F,overIndex:A,index:T}):null,D=w5(F)&&w5(A)?H({id:W,items:U,activeIndex:F,overIndex:A}):T,q0=u==null?void 0:u.id,p=RM({activeId:q0,items:U,newIndex:D,containerId:G}),K2=U!==p.current.items,m0=$({active:u,containerId:G,isDragging:j,isSorting:C,id:W,index:T,items:U,newIndex:p.current.newIndex,previousItems:p.current.items,previousContainerId:p.current.containerId,transition:Q,wasDragging:p.current.activeId!=null}),y1=LZ({disabled:!m0,index:T,node:k,rect:O});return A5(()=>{if(C&&p.current.newIndex!==D)p.current.newIndex=D;if(G!==p.current.containerId)p.current.containerId=G;if(U!==p.current.items)p.current.items=U},[C,D,G,U]),A5(()=>{if(q0===p.current.activeId)return;if(q0!=null&&p.current.activeId==null){p.current.activeId=q0;return}let m1=setTimeout(()=>{p.current.activeId=q0},50);return()=>clearTimeout(m1)},[q0]),{active:u,activeIndex:F,attributes:t,data:_,rect:O,index:T,newIndex:D,items:U,isOver:I,isSorting:C,isDragging:j,listeners:W0,node:k,overIndex:A,over:G0,setNodeRef:y,setActivatorNodeRef:c,setDroppableNodeRef:R,setDraggableNodeRef:X0,transform:y1!=null?y1:t0,transition:v0()};function v0(){if(y1||K2&&p.current.newIndex===T)return BZ;if(n&&!E2(r)||!Q)return;if(C||m0)return U1.Transition.toString({...Q,property:vP});return}}function VZ(M,$){var P,Z;if(typeof M==="boolean")return{draggable:M,droppable:!1};return{draggable:(P=M==null?void 0:M.draggable)!=null?P:$.draggable,droppable:(Z=M==null?void 0:M.droppable)!=null?Z:$.droppable}}function k5(M){if(!M)return!1;let $=M.data.current;if($&&"sortable"in $&&typeof $.sortable==="object"&&"containerId"in $.sortable&&"items"in $.sortable&&"index"in $.sortable)return!0;return!1}var zZ=[m.Down,m.Right,m.Up,m.Left],xP=(M,$)=>{let{context:{active:P,collisionRect:Z,droppableRects:X,droppableContainers:H,over:W,scrollableAncestors:J}}=$;if(zZ.includes(M.code)){if(M.preventDefault(),!P||!Z)return;let Y=[];H.getEnabled().forEach((G)=>{if(!G||G!=null&&G.disabled)return;let F=X.get(G.id);if(!F)return;switch(M.code){case m.Down:if(Z.top<F.top)Y.push(G);break;case m.Up:if(Z.top>F.top)Y.push(G);break;case m.Left:if(Z.left>F.left)Y.push(G);break;case m.Right:if(Z.left<F.left)Y.push(G);break}});let Q=KP({active:P,collisionRect:Z,droppableRects:X,droppableContainers:Y,pointerCoordinates:null}),U=EM(Q,"id");if(U===(W==null?void 0:W.id)&&Q.length>1)U=Q[1].id;if(U!=null){let G=H.get(P.id),F=H.get(U),B=F?X.get(F.id):null,q=F==null?void 0:F.node.current;if(q&&B&&G&&F){let A=y2(q).some((z,O)=>J[O]!==z),w=cP(G,F),L=wZ(G,F),V=A||!w?{x:0,y:0}:{x:L?Z.width-B.width:0,y:L?Z.height-B.height:0},T={x:B.left,y:B.top};return V.x&&V.y?T:T1(T,V)}}}return};function cP(M,$){if(!k5(M)||!k5($))return!1;return M.data.current.sortable.containerId===$.data.current.sortable.containerId}function wZ(M,$){if(!k5(M)||!k5($))return!1;if(!cP(M,$))return!1;return M.data.current.sortable.index<$.data.current.sortable.index}import{Fragment as TZ}from"react";import{jsx as F1,Fragment as kZ}from"react/jsx-runtime";var OZ=({id:M,label:$,children:P})=>{let{attributes:Z,listeners:X,setNodeRef:H,transform:W,transition:J,isDragging:Y}=jP({id:M}),Q={opacity:Y?0.5:1,position:"relative",transform:U1.Transform.toString(W),transition:J,zIndex:Y?10:"auto"},U=F1("button",{type:"button",className:"touch-none cursor-grab text-muted-foreground/40 hover:text-muted-foreground active:cursor-grabbing",...Z,...X,title:$!==void 0&&$!==""?`Drag ${$} to reorder`:"Drag to reorder","aria-label":$!==void 0&&$!==""?`Drag ${$} to reorder`:"Drag handle",children:F1(dP,{className:"h-3.5 w-3.5"})});return F1("div",{ref:H,style:Q,children:P(U)})},AZ=({items:M,onReorder:$,getItemLabel:P,renderItem:Z,disabled:X=!1})=>{let H=UP(_M(I2,{activationConstraint:{distance:4}}),_M(m2,{coordinateGetter:xP})),W=(J)=>{let{active:Y,over:Q}=J;if(!Q||Y.id===Q.id)return;let U=M.findIndex((F)=>F.id===Y.id),G=M.findIndex((F)=>F.id===Q.id);if(U===-1||G===-1)return;$(_5(M,U,G))};if(X)return M.map((J)=>F1(TZ,{children:Z(J,null)},J.id));return F1(DP,{sensors:H,collisionDetection:qP,onDragEnd:W,children:F1(pP,{items:M.map((J)=>J.id),strategy:CP,children:M.map((J)=>F1(OZ,{id:J.id,label:P?.(J),children:(Y)=>F1(kZ,{children:Z(J,Y)})},J.id))})})},_Z=AZ;import*as lP from"react";import{jsx as b2,jsxs as SM}from"react/jsx-runtime";var iP=({open:M,onOpenChange:$,title:P,description:Z,confirmLabel:X,cancelLabel:H="Cancel",confirmVariant:W="default",pendingLabel:J="Processing...",onConfirm:Y})=>{let[Q,U]=lP.useState(!1),G=async()=>{U(!0);try{await Y(),$(!1)}catch(F){throw U(!1),F}U(!1)};return b2(n1,{open:M,onOpenChange:$,children:SM(a1,{children:[SM(s1,{children:[b2(e1,{children:P}),b2(oP,{children:Z})]}),SM(rP,{children:[b2(S,{variant:"outline",onClick:()=>{$(!1)},disabled:Q,children:H}),b2(S,{variant:W,onClick:()=>{G()},disabled:Q,children:Q?J:X})]})]})})};iP.displayName="ConfirmDialog";var EZ=iP;import*as nP from"react";import{jsx as E5,jsxs as tP}from"react/jsx-runtime";var aP=nP.forwardRef(function({step:$,total:P,title:Z,helper:X,action:H,className:W,...J},Y){let Q=Boolean(H);return tP("div",{ref:Y,className:f("flex flex-wrap items-start justify-between gap-4",W),...J,children:[tP("div",{className:"min-w-0 space-y-1.5",children:[E5(v1,{tone:"accent",className:"tracking-[0.16em]",children:`Step ${$} of ${P}`}),E5("h2",{className:"text-lg font-semibold tracking-tight",children:Z}),E5("p",{className:"max-w-xl text-sm leading-relaxed text-muted-foreground",children:X})]}),Q?E5("div",{className:"shrink-0",children:H}):null]})});aP.displayName="StageHeader";var RZ=aP;import{jsx as q1,jsxs as DM}from"react/jsx-runtime";var SZ=f0("flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border [&_svg]:h-[18px] [&_svg]:w-[18px]",{defaultVariants:{tone:"default"},variants:{tone:{accent:"border-[color-mix(in_oklab,var(--accent)_28%,var(--border))] bg-[color-mix(in_oklab,var(--accent)_10%,var(--card))] text-(--accent)",danger:"border-[color-mix(in_oklab,var(--danger)_30%,var(--border))] bg-[color-mix(in_oklab,var(--danger)_12%,var(--card))] text-(--danger)",default:"border-border bg-muted/40 text-(--text-muted)",success:"border-[color-mix(in_oklab,var(--success)_30%,var(--border))] bg-[color-mix(in_oklab,var(--success)_12%,var(--card))] text-(--success)",warning:"border-[color-mix(in_oklab,var(--warning)_30%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_12%,var(--card))] text-(--warning)"}}}),DZ=f0("shrink-0 [&_svg]:h-4 [&_svg]:w-4",{defaultVariants:{tone:"default"},variants:{tone:{accent:"text-(--accent)",danger:"text-(--danger)",default:"text-(--text-muted)",success:"text-(--success)",warning:"text-(--warning)"}}}),R5=(M)=>M!==null&&M!==void 0&&M!==!1&&M!==0&&M!==0n&&M!==""&&!Number.isNaN(M),sP=({variant:M="tile",icon:$,label:P,value:Z,detail:X,tone:H,className:W,...J})=>{if(M==="compact")return DM(N1,{className:f("gap-1 px-4 py-3.5",W),...J,children:[DM("span",{className:"flex items-center justify-between gap-2",children:[q1("span",{className:"text-[11px] font-medium uppercase tracking-[0.14em] text-(--text-muted)",children:P}),R5($)?q1("span",{className:f(DZ({tone:H})),"aria-hidden":!0,children:$}):null]}),q1("span",{className:"text-[22px] font-semibold leading-none tabular-nums tracking-tight text-(--text-primary)",children:Z}),R5(X)?q1("span",{className:"text-xs text-(--text-muted)",children:X}):null]});return DM(N1,{className:f("flex flex-col items-center gap-2.5 px-4 py-5 text-center","transition-colors hover:border-[color-mix(in_oklab,var(--accent)_22%,var(--border))]",W),...J,children:[R5($)?q1("span",{className:f(SZ({tone:H})),"aria-hidden":!0,children:$}):null,q1("span",{className:"text-[26px] font-semibold leading-none tabular-nums tracking-tight text-(--text-primary)",children:Z}),q1("span",{className:"text-[11px] font-medium uppercase tracking-[0.14em] text-(--text-muted)",children:P}),R5(X)?q1("span",{className:"text-xs text-(--text-muted)",children:X}):null]})};sP.displayName="StatTile";var yZ=sP;import*as M4 from"react";import{jsx as eP,jsxs as gZ}from"react/jsx-runtime";var mZ={danger:"border-[color-mix(in_oklab,var(--danger)_40%,var(--border))] bg-[color-mix(in_oklab,var(--danger)_8%,var(--card))] text-(--danger)",live:"border-[color-mix(in_oklab,var(--primary)_45%,var(--border))] bg-[color-mix(in_oklab,var(--primary)_8%,var(--card))] text-primary",neutral:"border-border bg-card text-muted-foreground",success:"border-[color-mix(in_oklab,var(--success)_38%,var(--border))] bg-[color-mix(in_oklab,var(--success)_8%,var(--card))] text-(--success)",warning:"border-[color-mix(in_oklab,var(--warning)_42%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_9%,var(--card))] text-(--warning)"},IZ={danger:"danger",live:"primary",neutral:"neutral",success:"success",warning:"warning"},bZ=({tone:M,active:$=!1,label:P,className:Z,children:X,...H},W)=>{let J="border-border bg-card text-muted-foreground";if(M)J=mZ[M];else if($)J="border-[color-mix(in_oklab,var(--primary)_45%,var(--border))] bg-[color-mix(in_oklab,var(--primary)_8%,var(--card))] text-primary";return gZ("div",{ref:W,className:f("inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.16em]",J,Z),...H,children:[M?eP(d2,{tone:IZ[M],pulse:M==="live"}):eP("span",{"aria-hidden":!0,className:f("h-1.5 w-1.5 rounded-full",$?"bg-primary shadow-[0_0_0_3px_color-mix(in_oklab,var(--primary)_22%,transparent)]":"bg-muted-foreground")}),X??P]})},$4=M4.forwardRef(bZ);$4.displayName="StatusPill";var CZ=$4;import*as y5 from"react";import{jsx as S5,jsxs as pZ}from"react/jsx-runtime";var uZ=f0("relative min-w-0",{defaultVariants:{size:"md",variant:"pill"},variants:{size:{md:"",sm:""},variant:{pill:"",plain:""}}}),hZ=f0("pl-9 [&::-webkit-search-cancel-button]:appearance-none",{defaultVariants:{size:"md",variant:"pill"},variants:{size:{md:"",sm:"h-8 text-[13px]"},variant:{pill:"rounded-full bg-(--bg-surface)",plain:"bg-(--bg-surface)"}}}),P4=({value:M,defaultValue:$,onValueChange:P,clearLabel:Z,variant:X,size:H,className:W,classes:J,...Y})=>{let[Q,U]=y5.useState($??""),G=M!==void 0,F=G?M:Q,B=y5.useRef(null),q=(N)=>{if(!G)U(N);P?.(N)};return pZ("div",{className:f(uZ({size:H,variant:X}),J?.root,W),children:[S5(D5,{"aria-hidden":!0,className:f("pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",J?.icon)}),S5(o,{ref:B,type:"search",value:F,onChange:(N)=>{q(N.target.value)},className:f(hZ({size:H,variant:X}),F!==void 0&&F!==""&&Z!==void 0?"pr-9":void 0,J?.input),...Y}),F!==void 0&&F!==""&&Z!==void 0?S5("button",{type:"button","aria-label":Z,onClick:()=>{q(""),B.current?.focus()},className:f("absolute right-2.5 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-(--bg-surface-alt) hover:text-(--text-primary) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",J?.clear),children:S5(W1,{className:"h-3.5 w-3.5"})}):null]})};P4.displayName="SearchField";var vZ=P4;import{jsx as m5,jsxs as Z4}from"react/jsx-runtime";var X4=({title:M,description:$,value:P,options:Z,onValueChange:X,align:H="center",className:W,...J})=>Z4("section",{className:f("flex min-w-0 flex-col gap-3 sm:flex-row sm:justify-between",H==="center"?"sm:items-center":"sm:items-start",W),...J,children:[Z4("div",{className:"min-w-0",children:[m5("h3",{className:"truncate text-sm font-semibold",children:M}),$!==void 0&&$!==null&&$!==!1&&$!==""&&$!==0?m5("p",{className:"mt-1 text-sm text-muted-foreground",children:$}):null]}),m5("div",{className:"inline-flex shrink-0 rounded-md border border-border bg-background p-1 shadow-xs",children:Z.map((Y)=>m5(S,{type:"button",size:"sm",variant:Y.value===P?"secondary":"ghost",disabled:Y.disabled,className:f("h-8 rounded-sm px-3",Y.value===P&&"bg-primary/10 text-primary hover:bg-primary/15"),"aria-label":Y.ariaLabel,"aria-pressed":Y.value===P,onClick:()=>{X(Y.value)},children:Y.label},Y.value))})]});X4.displayName="SectionSwitcher";import*as u0 from"react";import{jsx as y0}from"react/jsx-runtime";var H4=u0.createContext({value:1}),yM=()=>u0.useContext(H4),jZ=({value:M,defaultValue:$=1,indicators:P,className:Z,...X})=>{let H=M??$,W=u0.useMemo(()=>({indicators:P,value:H}),[H,P]);return y0(H4.Provider,{value:W,children:y0("div",{"data-slot":"stepper",className:f("space-y-8",Z),...X})})},xZ=({className:M,...$})=>y0("nav",{"data-slot":"stepper-nav","data-orientation":"horizontal",className:f("group/stepper-nav flex items-start justify-between gap-2",M),...$}),mM=u0.createContext({state:"inactive",step:1}),cZ=({step:M,loading:$,className:P,...Z})=>{let{value:X}=yM(),H="inactive";if($===!0)H="loading";else if(M<X)H="completed";else if(M===X)H="active";let W=u0.useMemo(()=>({state:H,step:M}),[H,M]);return y0(mM.Provider,{value:W,children:y0("div",{"data-slot":"stepper-item","data-state":H,"data-step":M,className:f("group/step relative flex-1 items-start",P),...Z})})},dZ=({className:M,...$})=>y0("div",{"data-slot":"stepper-trigger",className:f("flex flex-col items-center gap-2.5",M),...$}),rZ=({className:M,children:$,...P})=>{let{indicators:Z}=yM(),{state:X}=u0.useContext(mM),H=Z?.completed,W=Z?.loading,J=$;if(X==="completed"&&Boolean(H))J=H;else if(X==="loading"&&Boolean(W))J=W;return y0("div",{"data-slot":"stepper-indicator","data-state":X,className:f("flex size-7 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold transition-colors",X==="completed"&&"border-primary bg-primary text-primary-foreground",X==="active"&&"border-primary bg-primary text-primary-foreground",X==="loading"&&"border-primary bg-primary text-primary-foreground",X==="inactive"&&"border-muted-foreground/30 bg-background text-muted-foreground",M),...P,children:J})},oZ=({className:M,...$})=>{let{state:P}=u0.useContext(mM);return y0("span",{"data-slot":"stepper-title","data-state":P,className:f("text-sm font-medium",(P==="completed"||P==="active")&&"text-foreground",P==="inactive"&&"text-muted-foreground",M),...$})},lZ=({className:M,...$})=>y0("div",{"data-slot":"stepper-separator",className:f("h-0.5 rounded-full bg-muted-foreground/30 transition-colors","group-data-[state=completed]/step:bg-primary",M),...$}),iZ=({className:M,...$})=>y0("div",{"data-slot":"stepper-panel",className:f(M),...$}),tZ=({value:M,className:$,...P})=>{let{value:Z}=yM();if(M!==Z)return null;return y0("div",{"data-slot":"stepper-content",className:f($),...P})};import*as k1 from"react";import{jsx as A1,jsxs as eZ}from"react/jsx-runtime";var IM=k1.createContext({}),nZ=({className:M,size:$,variant:P,...Z})=>{let X=k1.useMemo(()=>({size:$,variant:P}),[$,P]);return A1(IM.Provider,{value:X,children:A1("fieldset",{"data-slot":"split-button",className:f("inline-flex min-w-0 items-stretch",M),...Z})})},aZ=({className:M,...$})=>{let{size:P,variant:Z}=k1.useContext(IM);return A1(S,{"data-slot":"split-button-action",className:f("rounded-r-none",M),size:P,variant:Z,...$})},sZ=({align:M="end",children:$,contentClassName:P,disabled:Z,label:X,modal:H,onOpenChange:W,open:J})=>{let{size:Y,variant:Q}=k1.useContext(IM);return eZ(W4,{modal:H,onOpenChange:W,open:J,children:[A1(J4,{asChild:!0,children:A1(S,{"aria-label":X,"data-slot":"split-button-menu",className:"-ml-px rounded-l-none border-l border-l-current/20 px-2",disabled:Z,size:Y,variant:Q,children:A1(Y1,{})})}),A1(Y4,{align:M,className:P,children:$})]})};import*as U2 from"react";import{jsx as h0,jsxs as I5}from"react/jsx-runtime";var MX=({items:M,title:$,triggerAriaLabel:P="Technical details",copyLabel:Z="Copy",trigger:X,align:H="end",side:W,onCopy:J,className:Y,classes:Q})=>{let[U,G]=U2.useState(null),F=U2.useRef(null);U2.useEffect(()=>()=>{if(F.current!==null)window.clearTimeout(F.current)},[]);let B=(q)=>{if(navigator.clipboard.writeText(q.value),G(q.label),F.current!==null)window.clearTimeout(F.current);F.current=window.setTimeout(()=>{G(null)},1500),J?.(q)};return I5(_1,{children:[h0(E1,{asChild:!0,children:X??h0(S,{type:"button",variant:"ghost",size:"icon","aria-label":P,className:f("h-8 w-8 text-muted-foreground hover:text-foreground",Q?.root,Q?.trigger,Y),children:h0(Q4,{className:"h-4 w-4"})})}),I5(R1,{align:H,side:W,className:f("w-80 p-3",Q?.content),children:[$!==void 0&&$!==null?h0("div",{className:"mb-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:$}):null,h0("dl",{className:"space-y-2.5",children:M.map((q)=>I5("div",{className:f("min-w-0",Q?.row),children:[h0("dt",{className:f("text-[11px] font-medium text-muted-foreground",Q?.label),children:q.label}),I5("dd",{className:"mt-0.5 flex min-w-0 items-start gap-1",children:[h0("code",{className:f("min-w-0 flex-1 select-all break-all rounded bg-muted/60 px-1.5 py-1 font-mono text-xs leading-relaxed text-foreground",Q?.value),children:q.value}),q.copyable===!1?null:h0(S,{type:"button",variant:"ghost",size:"icon","aria-label":`${Z} ${q.label}`,className:"h-6 w-6 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>{B(q)},children:U===q.label?h0(w0,{className:"h-3.5 w-3.5"}):h0(x0,{className:"h-3.5 w-3.5"})})]})]},q.label))})]})]})};var $X=MX;import*as F2 from"react";import{jsx as M0,jsxs as o0,Fragment as U4}from"react/jsx-runtime";var PX={disabled:!1,emptyMessage:"No option found.",loading:!1,loadingMessage:"Loading options...",modal:!1,placeholder:"Select option...",searchPlaceholder:"Search...",width:"200px"},ZX=1,XX=0.5,HX=(M)=>M.children!==void 0,B4=(M)=>M.flatMap(($)=>{if(!$.children)return[$];let P=B4($.children);return P.length>0?[{...$,children:P}]:[]}),N4=(M,$=[])=>M.flatMap((P)=>P.children?N4(P.children,[...$,P]):[{ancestorIds:$.map((Z)=>Z.id),node:P,path:$.map((Z)=>Z.label).join(" / ")}]),f4=(M)=>({paddingLeft:`${XX+M*ZX}rem`}),L4=F2.forwardRef(function($,P){let Z={...PX,...$},{nodes:X,value:H,onChange:W,selectedLabel:J,placeholder:Y,searchPlaceholder:Q,emptyMessage:U,id:G,className:F,width:B,disabled:q,loading:N,loadingMessage:A,onSearchChange:w,modal:L}=Z,[V,T]=F2.useState(!1),[_,z]=F2.useState(""),[O,k]=F2.useState(()=>new Set),I=B4(X),R=N4(I),u=R.find((y)=>y.node.id===H),r=_.trim().toLowerCase(),x=(y)=>{if(y)k(new Set(u?.ancestorIds));else if(_!=="")z(""),w?.("");T(y)},t=(y)=>{z(y),w?.(y)},X0=(y)=>{k((C)=>{let b=new Set(C);if(!b.delete(y))b.add(y);return b})},W0=(y)=>{W(y),x(!1)},j=(y)=>o0(U4,{children:[M0(w0,{"aria-hidden":!0,className:f(H===y.id?"opacity-100":"opacity-0")}),y.icon]}),G0=(y,C)=>y.flatMap((b)=>{if(!HX(b))return[o0(G2,{value:b.id,style:f4(C),onSelect:()=>{W0(b.id)},children:[j(b),M0("span",{className:"min-w-0 truncate",title:b.label,children:b.label})]},b.id)];let n=O.has(b.id),F0=n?G4:F4;return[o0(G2,{value:b.id,"aria-expanded":n,style:f4(C),onSelect:()=>{X0(b.id)},children:[M0(J1,{"aria-hidden":!0,className:f(n&&"rotate-90")}),b.icon??M0(F0,{"aria-hidden":!0}),M0("span",{className:"min-w-0 truncate",title:b.label,children:b.label})]},b.id),...n&&b.children?G0(b.children,C+1):[]]}),c=r===""?[]:R.filter((y)=>w!==void 0||`${y.path} / ${y.node.label}`.toLowerCase().includes(r)),J0=u?.node.label??J;return o0(_1,{modal:L,open:V,onOpenChange:x,children:[M0(E1,{asChild:!0,children:o0(S,{ref:P,id:G,variant:"outline","aria-expanded":V,"aria-busy":N,className:f("justify-between",F),style:{width:B},disabled:q,children:[J0===void 0?M0("span",{className:"min-w-0 truncate text-muted-foreground",children:Y}):M0("span",{className:"min-w-0 truncate",children:J0}),N?M0(c0,{"aria-hidden":!0,className:"ml-2 size-4 shrink-0 animate-spin text-muted-foreground"}):M0(b5,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),M0(R1,{className:"p-0",style:{width:"var(--radix-popover-trigger-width)"},children:o0(g5,{shouldFilter:!1,children:[M0(q4,{"aria-label":Q,placeholder:Q,value:_,onValueChange:t}),M0(C5,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.5rem))]",children:N?o0("div",{"aria-live":"polite",className:"flex items-center justify-center gap-2 px-3 py-6 text-sm text-muted-foreground",children:[M0(c0,{"aria-hidden":!0,className:"size-4 animate-spin"}),A]}):o0(U4,{children:[M0(K4,{children:U}),M0(u5,{children:r===""?G0(I,0):c.map((y)=>o0(G2,{value:y.node.id,onSelect:()=>{W0(y.node.id)},children:[j(y.node),M0("span",{className:"min-w-0 truncate",title:y.node.label,children:y.node.label}),y.path===""?null:M0("span",{className:"ml-auto min-w-0 shrink truncate pl-2 text-xs text-muted-foreground",title:y.path,children:y.path})]},y.node.id))})]})})]})})]})});L4.displayName="TreeSelect";import*as z4 from"react";import{jsx as V4,jsxs as JX}from"react/jsx-runtime";var WX=({value:M,state:$="value",trailing:P,monospace:Z=!0,className:X,...H},W)=>{let J=$==="secret";return JX("div",{ref:W,className:f("flex min-w-0 items-center gap-2",X),...H,children:[V4("div",{className:f("flex min-w-0 flex-1 items-center border-b py-2",J?"border-[color-mix(in_oklab,var(--primary)_45%,var(--border))]":"border-border"),children:V4("code",{className:f("block min-w-0 flex-1 overflow-x-auto whitespace-nowrap text-[13px] text-foreground",Z?"font-mono":"font-sans"),children:M})}),P]})},w4=z4.forwardRef(WX);w4.displayName="ValueRow";var YX=w4;import{forwardRef as O4,useCallback as S1,useLayoutEffect as A4,useId as QX,useRef as k4,useState as Q0}from"react";import{jsx as K,jsxs as E,Fragment as u2}from"react/jsx-runtime";var fX=({mode:M,onModeChange:$,disabled:P})=>E("div",{role:"tablist","aria-label":"Value source",className:"relative inline-flex h-7 items-center rounded-full border border-border/70 bg-muted/40 p-0.5 text-[10px] font-medium tracking-[0.08em] uppercase shadow-inner",children:[K("span",{"aria-hidden":!0,className:f("absolute top-0.5 bottom-0.5 w-[calc(50%-2px)] rounded-full bg-background shadow-xs ring-1 ring-border/60 transition-transform duration-200 ease-out",M==="inline"&&"translate-x-[calc(100%+0px)]")}),E("button",{type:"button",role:"tab","aria-selected":M==="linked",disabled:P,onClick:()=>{$("linked")},className:f("relative z-10 flex items-center gap-1 rounded-full px-2.5 py-1 transition-colors",M==="linked"?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[K(p5,{className:"h-3 w-3"}),"Linked"]}),E("button",{type:"button",role:"tab","aria-selected":M==="inline",disabled:P,onClick:()=>{$("inline")},className:f("relative z-10 flex items-center gap-1 rounded-full px-2.5 py-1 transition-colors",M==="inline"?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[K(C2,{className:"h-3 w-3"}),"Inline"]})]}),UX=({variableKey:M,initialValue:$,isSecret:P,loading:Z,saving:X,onSubmit:H,onCancel:W})=>{let[J,Y]=Q0($),[Q,U]=Q0(!1),G=k4(null);return A4(()=>{if(!Z)G.current?.focus()},[Z]),E("form",{role:"presentation",onSubmit:(F)=>{F.preventDefault(),H(J)},onKeyDown:(F)=>{if(F.key==="Escape")F.preventDefault(),W()},className:"space-y-3 p-3",children:[E("div",{className:"flex items-start justify-between gap-2",children:[E("div",{className:"min-w-0",children:[K("p",{className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground",children:"Editing linked variable"}),K("p",{className:"mt-0.5 truncate font-mono text-xs text-foreground",children:M})]}),K("button",{type:"button",onClick:W,"aria-label":"Close editor",className:"rounded p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:K(W1,{className:"h-3.5 w-3.5"})})]}),E("div",{className:"space-y-1",children:[K(H1,{htmlFor:"linked-value",className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:P?"Secret value":"Value"}),E("div",{className:"relative",children:[K(o,{ref:G,id:"linked-value",type:Q?"text":"password",value:J,onChange:(F)=>{Y(F.target.value)},placeholder:Z?"Loading current value…":"Enter value",disabled:Z||X,className:"h-8 pr-8 font-mono text-xs",autoComplete:"off",spellCheck:!1}),K("button",{type:"button",onClick:()=>{U((F)=>!F)},"aria-label":Q?"Hide value":"Reveal value",className:"absolute inset-y-0 right-1 my-auto flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:Q?K(M2,{className:"h-3.5 w-3.5"}):K(Q1,{className:"h-3.5 w-3.5"})})]})]}),E("div",{className:"flex items-center justify-between gap-2 pt-1",children:[E("p",{className:"text-[10px] leading-relaxed text-muted-foreground",children:["Updates the linked secret. Other connectors using"," ",K("span",{className:"font-mono",children:M})," will pick it up on their next run."]}),K(S,{type:"submit",size:"sm",disabled:Z||X,className:"h-7 px-3 text-xs",children:X?E(u2,{children:[K(c0,{className:"h-3 w-3 animate-spin"}),"Saving"]}):"Save"})]})]})},GX=({suggestedName:M,onSubmit:$,onCancel:P})=>{let[Z,X]=Q0(M),[H,W]=Q0(""),[J,Y]=Q0(!0),[Q,U]=Q0(!1),G=k4(null);A4(()=>{G.current?.focus(),G.current?.select()},[]);let F=Z.trim(),B=F.length>0;return E("form",{role:"presentation",onSubmit:(q)=>{if(q.preventDefault(),B)$({key:F,secret:J,value:H})},onClick:(q)=>{q.stopPropagation()},onKeyDown:(q)=>{if(q.key==="Escape")q.preventDefault(),q.stopPropagation(),P()},className:"flex flex-col",children:[E("div",{className:"flex items-center gap-2 border-b border-border/60 bg-muted/15 px-3 py-2",children:[K("button",{type:"button",onClick:P,"aria-label":"Back to picker",className:"-ml-1 flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground",children:K(T4,{className:"h-3.5 w-3.5"})}),K("span",{className:"flex-1 text-[10.5px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:"New variable"}),K(h1,{className:"h-3 w-3 text-muted-foreground/60"})]}),E("div",{className:"space-y-2.5 px-3 py-2.5",children:[E("div",{className:"space-y-1",children:[K(H1,{htmlFor:"var-key",className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground/70",children:"Name"}),E("div",{className:"relative",children:[K("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-2.5 flex items-center text-muted-foreground/60",children:K(g2,{className:"h-3 w-3"})}),K(o,{ref:G,id:"var-key",value:Z,onChange:(q)=>{X(q.target.value.toUpperCase())},placeholder:"VARIABLE_NAME",className:"h-8 pl-7 font-mono text-[12.5px] tracking-tight",autoComplete:"off",spellCheck:!1})]})]}),E("div",{className:"space-y-1",children:[K(H1,{htmlFor:"var-value",className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground/70",children:"Value"}),E("div",{className:"relative",children:[K(o,{id:"var-value",type:Q?"text":"password",value:H,onChange:(q)=>{W(q.target.value)},placeholder:"Encrypted at rest",className:"h-8 pr-8 font-mono text-[12.5px]",autoComplete:"off",spellCheck:!1}),K("button",{type:"button",onClick:()=>{U((q)=>!q)},"aria-label":Q?"Hide value":"Reveal value",className:"absolute inset-y-0 right-1 my-auto flex h-6 w-6 items-center justify-center rounded text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground",children:Q?K(M2,{className:"h-3.5 w-3.5"}):K(Q1,{className:"h-3.5 w-3.5"})})]})]}),E("label",{className:"flex cursor-pointer items-center gap-2 select-none text-[11px] text-muted-foreground",children:[K("input",{type:"checkbox",checked:J,onChange:(q)=>{Y(q.target.checked)},className:"h-3 w-3 accent-primary"}),E("span",{className:"flex items-center gap-1",children:[K(g2,{className:"h-3 w-3"}),"Mark as secret"]})]})]}),E("button",{type:"submit",disabled:!B,className:"group/save flex w-full items-center gap-2.5 border-t border-border/60 bg-gradient-to-r from-muted/30 to-muted/10 px-3 py-2.5 text-left text-xs transition-colors hover:from-muted/50 hover:to-muted/30 disabled:cursor-not-allowed disabled:opacity-50",children:[K("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary ring-1 ring-primary/15",children:K(w0,{className:"h-3 w-3"})}),E("span",{className:"flex min-w-0 flex-1 flex-col",children:[K("span",{className:"text-[12px] font-medium leading-tight",children:"Create variable"}),K("span",{className:"truncate text-[10px] leading-tight text-muted-foreground",children:B?E(u2,{children:["Link this field to"," ",K("span",{className:"font-mono text-foreground/80",children:F})]}):"Enter a name to continue"})]}),K(h5,{className:"h-3.5 w-3.5 text-muted-foreground/60 transition-transform group-hover/save:translate-x-0.5 group-disabled/save:translate-x-0"})]})]})},_4=O4(function({selected:$,value:P,placeholder:Z,disabled:X,open:H,onOpen:W},J){let Y=Boolean(P),Q=Boolean($);return E("button",{ref:J,type:"button","aria-expanded":H,disabled:X,onClick:W,className:f("group/trigger relative flex h-9 w-full items-center gap-2 rounded-md border bg-background px-2.5 text-left text-sm shadow-xs transition-all outline-none","hover:border-ring/50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","disabled:cursor-not-allowed disabled:opacity-50",Y?"border-primary/20 bg-primary/[0.03]":"border-input"),children:[K("span",{"aria-hidden":!0,className:f("flex h-5 w-5 shrink-0 items-center justify-center rounded-sm transition-colors",Y?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:K(p5,{className:"h-3 w-3"})}),Y?E("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[K("span",{className:"truncate font-mono text-[12.5px] tracking-tight",children:P}),!Q&&K("span",{title:"Not in your variables list",className:"rounded-sm border border-dashed border-muted-foreground/40 px-1 py-px text-[9px] uppercase tracking-wider text-muted-foreground",children:"Unresolved"})]}):K("span",{className:"flex-1 truncate text-muted-foreground",children:Z}),K(b5,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60 transition-colors group-hover/trigger:text-muted-foreground"})]})});_4.displayName="LinkedTrigger";var FX=({value:M,onChange:$,onBlur:P,placeholder:Z,disabled:X,masked:H,inputId:W})=>{let[J,Y]=Q0(!1),Q=H&&!J?"password":"text";return E("div",{className:f("group/inline relative flex h-9 w-full items-center rounded-md border border-input bg-background pl-2.5 pr-1 shadow-xs transition-all","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]"),children:[K("span",{"aria-hidden":!0,className:"mr-2 flex h-5 w-5 shrink-0 items-center justify-center rounded-sm bg-muted text-muted-foreground",children:K(C2,{className:"h-3 w-3"})}),K("input",{id:W,type:Q,value:M,onChange:(U)=>{$(U.target.value)},onBlur:P,placeholder:Z,disabled:X,autoComplete:"off",spellCheck:!1,className:"flex-1 bg-transparent font-mono text-[12.5px] tracking-tight outline-none placeholder:font-sans placeholder:tracking-normal placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"}),H&&K("button",{type:"button",onClick:()=>{Y((U)=>!U)},"aria-label":J?"Hide value":"Reveal value",className:"flex h-7 w-7 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:J?K(M2,{className:"h-3.5 w-3.5"}):K(Q1,{className:"h-3.5 w-3.5"})})]})},qX=({options:M,value:$,onSelect:P})=>E("div",{className:"px-1",children:[E("div",{className:"flex items-center justify-between px-2 pt-2 pb-1",children:[K("span",{className:"text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:"Linked variables"}),K("span",{className:"text-[10px] tabular-nums text-muted-foreground/60",children:M.length})]}),K(u5,{className:"!p-0 [&_[cmdk-group-heading]]:hidden",children:M.map((Z)=>{let X=$===Z.key;return E(G2,{value:Z.key,keywords:[Z.key,Z.description??""],onSelect:()=>{P(Z.key)},className:f("group/row relative my-px cursor-pointer rounded-md px-2 py-1.5 transition-colors","data-[selected=true]:bg-muted/60 data-[selected=true]:text-foreground",X&&"bg-primary/[0.05]"),children:[X&&K("span",{"aria-hidden":!0,className:"absolute inset-y-1.5 left-0 w-[2px] rounded-r bg-primary"}),K("span",{"aria-hidden":!0,className:f("flex h-5 w-5 shrink-0 items-center justify-center rounded-sm transition-colors",X?"bg-primary/15 text-primary":"bg-muted/60 text-muted-foreground/70 group-hover/row:bg-muted"),children:K(g2,{className:"h-3 w-3"})}),E("div",{className:"flex min-w-0 flex-1 flex-col",children:[K("span",{className:f("truncate font-mono text-[12.5px] tracking-tight",X&&"text-primary"),children:Z.key}),Z.description!==void 0&&Z.description!==""&&K("span",{className:"truncate text-[10.5px] leading-tight text-muted-foreground",children:Z.description})]}),X?K(w0,{className:"h-3.5 w-3.5 shrink-0 text-primary"}):K("span",{"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 text-transparent transition-colors group-data-[selected=true]/row:text-muted-foreground/40",children:K(h5,{className:"h-3.5 w-3.5"})})]},Z.key)})})]}),KX=()=>E("div",{className:"space-y-1.5 px-2 py-3",children:[E("div",{className:"flex items-center justify-between px-1 pb-1",children:[K("span",{className:"text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/60",children:"Loading"}),K(c0,{className:"h-3 w-3 animate-spin text-muted-foreground/60"})]}),[0.95,0.7,0.85].map((M,$)=>E("div",{className:"flex items-center gap-2 rounded-md px-2 py-1.5",style:{opacity:1-$*0.18},children:[K("div",{className:"h-5 w-5 shrink-0 animate-pulse rounded-sm bg-muted/70"}),K("div",{className:"h-3 animate-pulse rounded bg-muted/70",style:{width:`${M*100}%`}})]},$))]}),BX=({query:M,canCreate:$,onCreate:P})=>{let Z=M.trim();return E("div",{className:"flex flex-col items-center gap-2 px-4 py-7 text-center",children:[K("span",{"aria-hidden":!0,className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted/60 text-muted-foreground/70",children:K(g2,{className:"h-4 w-4"})}),E("div",{className:"space-y-0.5",children:[K("p",{className:"text-[12px] font-medium text-foreground",children:Z?E(u2,{children:["No variables match"," ",E("span",{className:"font-mono text-foreground",children:['"',Z,'"']})]}):"No variables yet"}),K("p",{className:"text-[10.5px] leading-snug text-muted-foreground",children:"Variables let you reuse secrets across connectors and rotate them in one place."})]}),$&&E(S,{type:"button",size:"sm",variant:"outline",onClick:P,className:"mt-1 h-7 text-[11px]",children:[K(h1,{className:"h-3 w-3"}),Z?`Create "${Z.toUpperCase().replaceAll(/[^A-Z0-9_]/gu,"_")}"`:"Create variable"]})]})},NX=({options:M,optionsLoading:$,optionsFetching:P,value:Z,query:X,onQueryChange:H,onSelect:W,onCreate:J,suggestedName:Y,showCreate:Q,onShowCreate:U})=>{if(Q&&J)return K(GX,{suggestedName:Y??X.trim(),onSubmit:(F)=>{J(F)},onCancel:()=>{U(!1)}});let G=K(qX,{options:M,value:Z,onSelect:W});if($)G=K(KX,{});else if(M.length===0)G=K(BX,{query:X,canCreate:Boolean(J),onCreate:()=>{U(!0)}});return E("div",{className:"flex flex-col",children:[E("div",{className:"relative flex items-center gap-2 border-b border-border/60 bg-muted/15 px-3 py-2",children:[K(D5,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/70"}),K("input",{autoFocus:!0,type:"text",value:X,onChange:(F)=>{H(F.target.value)},placeholder:"Search variables…",autoComplete:"off",spellCheck:!1,className:"flex-1 bg-transparent text-xs tracking-tight outline-none placeholder:text-muted-foreground/60"}),E("div",{className:"flex h-4 w-4 items-center justify-center",children:[P&&!$&&K(c0,{className:"h-3 w-3 animate-spin text-muted-foreground/70"}),!P&&X&&K("button",{type:"button",onClick:()=>{H("")},"aria-label":"Clear search",className:"rounded p-0.5 text-muted-foreground/60 transition-colors hover:bg-muted hover:text-foreground",children:K(W1,{className:"h-3 w-3"})})]})]}),K(g5,{shouldFilter:!1,className:"rounded-none bg-transparent",loop:!0,children:K(C5,{className:"max-h-[280px] py-1",children:G})}),J&&E("button",{type:"button",onClick:()=>{U(!0)},className:"group/cta flex w-full items-center gap-2.5 border-t border-border/60 bg-gradient-to-r from-muted/30 to-muted/10 px-3 py-2.5 text-left text-xs transition-colors hover:from-muted/50 hover:to-muted/30",children:[K("span",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-primary/10 text-primary ring-1 ring-primary/15",children:K(h1,{className:"h-3 w-3"})}),E("span",{className:"flex min-w-0 flex-1 flex-col",children:[K("span",{className:"text-[12px] font-medium leading-tight",children:"Create new variable"}),K("span",{className:"text-[10px] leading-tight text-muted-foreground",children:"Encrypted at rest · reusable across connectors"})]}),K(h5,{className:"h-3.5 w-3.5 text-muted-foreground/60 transition-transform group-hover/cta:translate-x-0.5"})]})]})},LX=O4(function({value:$,mode:P,onChange:Z,onBlur:X,options:H,optionsLoading:W,optionsFetching:J,onSearch:Y,onCreate:Q,onResolve:U,onUpdate:G,suggestedName:F,placeholder:B="Select variable…",disabled:q=!1,masked:N=!0,className:A},w){let[L,V]=Q0(!1),[T,_]=Q0(""),[z,O]=Q0(!1),[k,I]=Q0(!1),[R,u]=Q0(null),[r,x]=Q0(!1),[t,X0]=Q0(!1),[W0,j]=Q0(null),G0=QX(),c=S1((D)=>{if(D===P)return;Z("",D),O(!1),_("")},[P,Z]),J0=S1((D)=>{Z(D===$?"":D,"linked"),V(!1),O(!1)},[$,Z]),y=S1((D)=>{Z(D,"inline")},[Z]),C=S1(async(D)=>{if(!Q)return;let q0=await Q(D);O(!1),V(!1),Z(q0.key,"linked")},[Q,Z]),b=S1(async()=>{if(!$||!U)return;I(!0),x(!0),j(null);try{let D=await U($);u(D??{key:$,secret:!0,value:null})}catch(D){j(D instanceof Error?D.message:"Failed to load variable"),u({key:$,secret:!0,value:null})}x(!1)},[$,U]),n=S1(async(D)=>{if(!G||!$)return;X0(!0);try{await G({key:$,value:D}),I(!1)}catch(q0){throw X0(!1),q0}X0(!1)},[G,$]),F0=S1((D)=>{_(D),Y?.(D)},[Y]),a=H.find((D)=>D.key===$),t0=P==="linked"&&Boolean($)&&Boolean(G);return E("div",{className:f("space-y-1.5",A),children:[E("div",{className:"flex items-center gap-1.5",children:[K("div",{className:"min-w-0 flex-1",children:P==="linked"?E(_1,{open:L,onOpenChange:(D)=>{if(V(D),!D)O(!1),X?.()},modal:!0,children:[K(E1,{asChild:!0,children:K(_4,{ref:w,selected:a,value:$,placeholder:B,disabled:q,open:L,onOpen:()=>{V(!0)}})}),K(R1,{className:"w-[--radix-popover-trigger-width] min-w-[300px] overflow-hidden border-border/80 p-0 shadow-xl",side:"bottom",align:"start",sideOffset:6,children:K(NX,{options:H,optionsLoading:Boolean(W),optionsFetching:Boolean(J),value:$,query:T,onQueryChange:F0,onSelect:J0,onCreate:Q?C:void 0,suggestedName:F,showCreate:z,onShowCreate:O})})]}):K(FX,{inputId:G0,value:$,onChange:y,onBlur:()=>X?.(),placeholder:B||"Enter value",disabled:q,masked:N})}),t0&&E(_1,{open:k,onOpenChange:(D)=>{if(I(D),!D)u(null),j(null);else if(!R)b()},modal:!0,children:[K(E1,{asChild:!0,children:K(S,{type:"button",variant:"outline",size:"icon",disabled:q,"aria-label":"Edit linked variable value",title:"Edit linked variable value",className:"h-9 w-9 shrink-0 border-input text-muted-foreground hover:text-foreground",children:K(C2,{className:"h-3.5 w-3.5"})})}),E(R1,{align:"end",side:"bottom",sideOffset:6,className:"w-80 p-0 shadow-lg",children:[W0!==null&&W0!==""&&K("div",{className:"border-b border-destructive/30 bg-destructive/5 px-3 py-2 text-[11px] text-destructive",children:W0}),K(UX,{variableKey:$,initialValue:R?.value??"",isSecret:R?.secret??!0,loading:r,saving:t,onSubmit:(D)=>{n(D)},onCancel:()=>{I(!1)}},`${$}:${R?.value??""}`)]})]}),K(fX,{mode:P,onModeChange:c,disabled:q})]}),K("p",{className:"flex items-center gap-1.5 text-[10.5px] leading-tight text-muted-foreground/80",children:P==="linked"?E(u2,{children:[K(p5,{className:"h-3 w-3"}),K("span",{children:"Reads from an org variable. Rotate values in one place; every connector picks it up."})]}):E(u2,{children:[K(C2,{className:"h-3 w-3"}),E("span",{children:["Stored inline on this connector. Use"," ",K("span",{className:"font-medium text-foreground/80",children:"Linked"})," ","to share across connectors."]})]})})]})});import{useMemo as VX}from"react";import{jsx as v5,jsxs as bM}from"react/jsx-runtime";var zX=(M)=>{let $="",P=0,Z=" ",X=M.replaceAll(/>\s*</gu,`>
6
+ `},fp={onDragStart(t){let{active:r}=t;return"Picked up draggable item "+r.id+"."},onDragOver(t){let{active:r,over:o}=t;if(o)return"Draggable item "+r.id+" was moved over droppable area "+o.id+".";return"Draggable item "+r.id+" is no longer over a droppable area."},onDragEnd(t){let{active:r,over:o}=t;if(o)return"Draggable item "+r.id+" was dropped over droppable area "+o.id;return"Draggable item "+r.id+" was dropped."},onDragCancel(t){let{active:r}=t;return"Dragging was cancelled. Draggable item "+r.id+" was dropped."}};function gp(t){let{announcements:r=fp,container:o,hiddenTextDescribedById:a,screenReaderInstructions:s=mp}=t,{announce:i,announcement:l}=Ri(),c=Er("DndLiveRegion"),[d,u]=Xt(!1);if(xe(()=>{u(!0)},[]),up(Ne(()=>({onDragStart(x){let{active:y}=x;i(r.onDragStart({active:y}))},onDragMove(x){let{active:y,over:S}=x;if(r.onDragMove)i(r.onDragMove({active:y,over:S}))},onDragOver(x){let{active:y,over:S}=x;i(r.onDragOver({active:y,over:S}))},onDragEnd(x){let{active:y,over:S}=x;i(r.onDragEnd({active:y,over:S}))},onDragCancel(x){let{active:y,over:S}=x;i(r.onDragCancel({active:y,over:S}))}}),[i,r])),!d)return null;let h=rr.createElement(rr.Fragment,null,rr.createElement(wi,{id:a,value:s.draggable}),rr.createElement(Ni,{id:c,announcement:l}));return o?dp(h,o):h}var we;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(we||(we={}));function fo(){}function wa(t,r){return Ne(()=>({sensor:t,options:r!=null?r:{}}),[t,r])}function Vi(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return Ne(()=>[...r].filter((a)=>a!=null),[...r])}var Yt=Object.freeze({x:0,y:0});function Bi(t,r){return Math.sqrt(Math.pow(t.x-r.x,2)+Math.pow(t.y-r.y,2))}function Fi(t,r){let{data:{value:o}}=t,{data:{value:a}}=r;return o-a}function bp(t,r){let{data:{value:o}}=t,{data:{value:a}}=r;return a-o}function Ci(t){let{left:r,top:o,height:a,width:s}=t;return[{x:r,y:o},{x:r+s,y:o},{x:r,y:o+a},{x:r+s,y:o+a}]}function Na(t,r){if(!t||t.length===0)return null;let[o]=t;return r?o[r]:o}function Si(t,r,o){if(r===void 0)r=t.left;if(o===void 0)o=t.top;return{x:r+t.width*0.5,y:o+t.height*0.5}}var _i=(t)=>{let{collisionRect:r,droppableRects:o,droppableContainers:a}=t,s=Si(r,r.left,r.top),i=[];for(let l of a){let{id:c}=l,d=o.get(c);if(d){let u=Bi(Si(d),s);i.push({id:c,data:{droppableContainer:l,value:u}})}}return i.sort(Fi)},zi=(t)=>{let{collisionRect:r,droppableRects:o,droppableContainers:a}=t,s=Ci(r),i=[];for(let l of a){let{id:c}=l,d=o.get(c);if(d){let u=Ci(d),h=s.reduce((y,S,w)=>y+Bi(u[w],S),0),x=Number((h/4).toFixed(4));i.push({id:c,data:{droppableContainer:l,value:x}})}}return i.sort(Fi)};function vp(t,r){let o=Math.max(r.top,t.top),a=Math.max(r.left,t.left),s=Math.min(r.left+r.width,t.left+t.width),i=Math.min(r.top+r.height,t.top+t.height),l=s-a,c=i-o;if(a<s&&o<i){let d=r.width*r.height,u=t.width*t.height,h=l*c,x=h/(d+u-h);return Number(x.toFixed(4))}return 0}var hp=(t)=>{let{collisionRect:r,droppableRects:o,droppableContainers:a}=t,s=[];for(let i of a){let{id:l}=i,c=o.get(l);if(c){let d=vp(c,r);if(d>0)s.push({id:l,data:{droppableContainer:i,value:d}})}}return s.sort(bp)};function xp(t,r,o){return{...t,scaleX:r&&o?r.width/o.width:1,scaleY:r&&o?r.height/o.height:1}}function $i(t,r){return t&&r?{x:t.left-r.left,y:t.top-r.top}:Yt}function yp(t){return function(o){for(var a=arguments.length,s=Array(a>1?a-1:0),i=1;i<a;i++)s[i-1]=arguments[i];return s.reduce((l,c)=>({...l,top:l.top+t*c.y,bottom:l.bottom+t*c.y,left:l.left+t*c.x,right:l.right+t*c.x}),{...o})}}var wp=yp(1);function Np(t){if(t.startsWith("matrix3d(")){let r=t.slice(9,-1).split(/, /);return{x:+r[12],y:+r[13],scaleX:+r[0],scaleY:+r[5]}}else if(t.startsWith("matrix(")){let r=t.slice(7,-1).split(/, /);return{x:+r[4],y:+r[5],scaleX:+r[0],scaleY:+r[3]}}return null}function Rp(t,r,o){let a=Np(r);if(!a)return t;let{scaleX:s,scaleY:i,x:l,y:c}=a,d=t.left-l-(1-s)*parseFloat(o),u=t.top-c-(1-i)*parseFloat(o.slice(o.indexOf(" ")+1)),h=s?t.width/s:t.width,x=i?t.height/i:t.height;return{width:h,height:x,top:u,right:d+h,bottom:u+x,left:d}}var Cp={ignoreTransform:!1};function Ar(t,r){if(r===void 0)r=Cp;let o=t.getBoundingClientRect();if(r.ignoreTransform){let{transform:u,transformOrigin:h}=ze(t).getComputedStyle(t);if(u)o=Rp(o,u,h)}let{top:a,left:s,width:i,height:l,bottom:c,right:d}=o;return{top:a,left:s,width:i,height:l,bottom:c,right:d}}function Pi(t){return Ar(t,{ignoreTransform:!0})}function Sp(t){let{innerWidth:r,innerHeight:o}=t;return{top:0,left:0,right:r,bottom:o,width:r,height:o}}function Pp(t,r){if(r===void 0)r=ze(t).getComputedStyle(t);return r.position==="fixed"}function Tp(t,r){if(r===void 0)r=ze(t).getComputedStyle(t);let o=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((s)=>{let i=r[s];return typeof i==="string"?o.test(i):!1})}function kn(t,r){let o=[];function a(s){if(r!=null&&o.length>=r)return o;if(!s)return o;if(so(s)&&s.scrollingElement!=null&&!o.includes(s.scrollingElement))return o.push(s.scrollingElement),o;if(!rn(s)||fa(s))return o;if(o.includes(s))return o;let i=ze(t).getComputedStyle(s);if(s!==t){if(Tp(s,i))o.push(s)}if(Pp(s,i))return o;return a(s.parentNode)}if(!t)return o;return a(t)}function Ji(t){let[r]=kn(t,1);return r!=null?r:null}function ga(t){if(!Nn||!t)return null;if(Lr(t))return t;if(!ao(t))return null;if(so(t)||t===Dr(t).scrollingElement)return window;if(rn(t))return t;return null}function ji(t){if(Lr(t))return t.scrollX;return t.scrollLeft}function Gi(t){if(Lr(t))return t.scrollY;return t.scrollTop}function ha(t){return{x:ji(t),y:Gi(t)}}var Te;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Te||(Te={}));function Wi(t){if(!Nn||!t)return!1;return t===document.scrollingElement}function Xi(t){let r={x:0,y:0},o=Wi(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},a={x:t.scrollWidth-o.width,y:t.scrollHeight-o.height},s=t.scrollTop<=r.y,i=t.scrollLeft<=r.x,l=t.scrollTop>=a.y,c=t.scrollLeft>=a.x;return{isTop:s,isLeft:i,isBottom:l,isRight:c,maxScroll:a,minScroll:r}}var kp={x:0.2,y:0.2};function Lp(t,r,o,a,s){let{top:i,left:l,right:c,bottom:d}=o;if(a===void 0)a=10;if(s===void 0)s=kp;let{isTop:u,isBottom:h,isLeft:x,isRight:y}=Xi(t),S={x:0,y:0},w={x:0,y:0},L={height:r.height*s.y,width:r.width*s.x};if(!u&&i<=r.top+L.height)S.y=Te.Backward,w.y=a*Math.abs((r.top+L.height-i)/L.height);else if(!h&&d>=r.bottom-L.height)S.y=Te.Forward,w.y=a*Math.abs((r.bottom-L.height-d)/L.height);if(!y&&c>=r.right-L.width)S.x=Te.Forward,w.x=a*Math.abs((r.right-L.width-c)/L.width);else if(!x&&l<=r.left+L.width)S.x=Te.Backward,w.x=a*Math.abs((r.left+L.width-l)/L.width);return{direction:S,speed:w}}function Dp(t){if(t===document.scrollingElement){let{innerWidth:i,innerHeight:l}=window;return{top:0,left:0,right:i,bottom:l,width:i,height:l}}let{top:r,left:o,right:a,bottom:s}=t.getBoundingClientRect();return{top:r,left:o,right:a,bottom:s,width:t.clientWidth,height:t.clientHeight}}function Ui(t){return t.reduce((r,o)=>Mr(r,ha(o)),Yt)}function Ep(t){return t.reduce((r,o)=>r+ji(o),0)}function Mp(t){return t.reduce((r,o)=>r+Gi(o),0)}function Ip(t,r){if(r===void 0)r=Ar;if(!t)return;let{top:o,left:a,bottom:s,right:i}=r(t);if(!Ji(t))return;if(s<=0||i<=0||o>=window.innerHeight||a>=window.innerWidth)t.scrollIntoView({block:"center",inline:"center"})}var Ap=[["x",["left","right"],Ep],["y",["top","bottom"],Mp]];class Ro{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let o=kn(r),a=Ui(o);this.rect={...t},this.width=t.width,this.height=t.height;for(let[s,i,l]of Ap)for(let c of i)Object.defineProperty(this,c,{get:()=>{let d=l(o),u=a[s]-d;return this.rect[c]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class an{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((r)=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...r)})},this.target=t}add(t,r,o){var a;(a=this.target)==null||a.addEventListener(t,r,o),this.listeners.push([t,r,o])}}function Op(t){let{EventTarget:r}=ze(t);return t instanceof r?t:Dr(t)}function ba(t,r){let o=Math.abs(t.x),a=Math.abs(t.y);if(typeof r==="number")return Math.sqrt(o**2+a**2)>r;if("x"in r&&"y"in r)return o>r.x&&a>r.y;if("x"in r)return o>r.x;if("y"in r)return a>r.y;return!1}var $t;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})($t||($t={}));function Ti(t){t.preventDefault()}function Hp(t){t.stopPropagation()}var q;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(q||(q={}));var Ki={start:[q.Space,q.Enter],cancel:[q.Esc],end:[q.Space,q.Enter,q.Tab]},Vp=(t,r)=>{let{currentCoordinates:o}=r;switch(t.code){case q.Right:return{...o,x:o.x+25};case q.Left:return{...o,x:o.x-25};case q.Down:return{...o,y:o.y+25};case q.Up:return{...o,y:o.y-25}}return};class Ln{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;let{event:{target:r}}=t;this.props=t,this.listeners=new an(Dr(r)),this.windowListeners=new an(ze(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add($t.Resize,this.handleCancel),this.windowListeners.add($t.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add($t.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:t,onStart:r}=this.props,o=t.node.current;if(o)Ip(o);r(Yt)}handleKeyDown(t){if(Cn(t)){let{active:r,context:o,options:a}=this.props,{keyboardCodes:s=Ki,coordinateGetter:i=Vp,scrollBehavior:l="smooth"}=a,{code:c}=t;if(s.end.includes(c)){this.handleEnd(t);return}if(s.cancel.includes(c)){this.handleCancel(t);return}let{collisionRect:d}=o.current,u=d?{x:d.left,y:d.top}:Yt;if(!this.referenceCoordinates)this.referenceCoordinates=u;let h=i(t,{active:r,context:o.current,currentCoordinates:u});if(h){let x=Ir(h,u),y={x:0,y:0},{scrollableAncestors:S}=o.current;for(let w of S){let L=t.code,{isTop:z,isRight:B,isLeft:E,isBottom:O,maxScroll:F,minScroll:j}=Xi(w),H=Dp(w),_={x:Math.min(L===q.Right?H.right-H.width/2:H.right,Math.max(L===q.Right?H.left:H.left+H.width/2,h.x)),y:Math.min(L===q.Down?H.bottom-H.height/2:H.bottom,Math.max(L===q.Down?H.top:H.top+H.height/2,h.y))},J=L===q.Right&&!B||L===q.Left&&!E,Q=L===q.Down&&!O||L===q.Up&&!z;if(J&&_.x!==h.x){let W=w.scrollLeft+x.x,se=L===q.Right&&W<=F.x||L===q.Left&&W>=j.x;if(se&&!x.y){w.scrollTo({left:W,behavior:l});return}if(se)y.x=w.scrollLeft-W;else y.x=L===q.Right?w.scrollLeft-F.x:w.scrollLeft-j.x;if(y.x)w.scrollBy({left:-y.x,behavior:l});break}else if(Q&&_.y!==h.y){let W=w.scrollTop+x.y,se=L===q.Down&&W<=F.y||L===q.Up&&W>=j.y;if(se&&!x.x){w.scrollTo({top:W,behavior:l});return}if(se)y.y=w.scrollTop-W;else y.y=L===q.Down?w.scrollTop-F.y:w.scrollTop-j.y;if(y.y)w.scrollBy({top:-y.y,behavior:l});break}}this.handleMove(t,Mr(Ir(h,this.referenceCoordinates),y))}}}handleMove(t,r){let{onMove:o}=this.props;t.preventDefault(),o(r)}handleEnd(t){let{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){let{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ln.activators=[{eventName:"onKeyDown",handler:(t,r,o)=>{let{keyboardCodes:a=Ki,onActivation:s}=r,{active:i}=o,{code:l}=t.nativeEvent;if(a.start.includes(l)){let c=i.activatorNode.current;if(c&&t.target!==c)return!1;return t.preventDefault(),s==null||s({event:t.nativeEvent}),!0}return!1}}];function ki(t){return Boolean(t&&"distance"in t)}function Li(t){return Boolean(t&&"delay"in t)}class Po{constructor(t,r,o){var a;if(o===void 0)o=Op(t.event.target);this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;let{event:s}=t,{target:i}=s;this.props=t,this.events=r,this.document=Dr(i),this.documentListeners=new an(this.document),this.listeners=new an(o),this.windowListeners=new an(ze(i)),this.initialCoordinates=(a=co(s))!=null?a:Yt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel)this.listeners.add(t.cancel.name,this.handleCancel);if(this.windowListeners.add($t.Resize,this.handleCancel),this.windowListeners.add($t.DragStart,Ti),this.windowListeners.add($t.VisibilityChange,this.handleCancel),this.windowListeners.add($t.ContextMenu,Ti),this.documentListeners.add($t.Keydown,this.handleKeydown),r){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Li(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(ki(r)){this.handlePending(r);return}}this.handleStart()}detach(){if(this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null)clearTimeout(this.timeoutId),this.timeoutId=null}handlePending(t,r){let{active:o,onPending:a}=this.props;a(o,t,this.initialCoordinates,r)}handleStart(){let{initialCoordinates:t}=this,{onStart:r}=this.props;if(t)this.activated=!0,this.documentListeners.add($t.Click,Hp,{capture:!0}),this.removeTextSelection(),this.documentListeners.add($t.SelectionChange,this.removeTextSelection),r(t)}handleMove(t){var r;let{activated:o,initialCoordinates:a,props:s}=this,{onMove:i,options:{activationConstraint:l}}=s;if(!a)return;let c=(r=co(t))!=null?r:Yt,d=Ir(a,c);if(!o&&l){if(ki(l)){if(l.tolerance!=null&&ba(d,l.tolerance))return this.handleCancel();if(ba(d,l.distance))return this.handleStart()}if(Li(l)){if(ba(d,l.tolerance))return this.handleCancel()}this.handlePending(l,d);return}if(t.cancelable)t.preventDefault();i(c)}handleEnd(){let{onAbort:t,onEnd:r}=this.props;if(this.detach(),!this.activated)t(this.props.active);r()}handleCancel(){let{onAbort:t,onCancel:r}=this.props;if(this.detach(),!this.activated)t(this.props.active);r()}handleKeydown(t){if(t.code===q.Esc)this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}var Bp={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Dn extends Po{constructor(t){let{event:r}=t,o=Dr(r.target);super(t,Bp,o)}}Dn.activators=[{eventName:"onPointerDown",handler:(t,r)=>{let{nativeEvent:o}=t,{onActivation:a}=r;if(!o.isPrimary||o.button!==0)return!1;return a==null||a({event:o}),!0}}];var Fp={move:{name:"mousemove"},end:{name:"mouseup"}},xa;(function(t){t[t.RightClick=2]="RightClick"})(xa||(xa={}));class Yi extends Po{constructor(t){super(t,Fp,Dr(t.event.target))}}Yi.activators=[{eventName:"onMouseDown",handler:(t,r)=>{let{nativeEvent:o}=t,{onActivation:a}=r;if(o.button===xa.RightClick)return!1;return a==null||a({event:o}),!0}}];var va={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class qi extends Po{constructor(t){super(t,va)}static setup(){return window.addEventListener(va.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(va.move.name,t)};function t(){}}}qi.activators=[{eventName:"onTouchStart",handler:(t,r)=>{let{nativeEvent:o}=t,{onActivation:a}=r,{touches:s}=o;if(s.length>1)return!1;return a==null||a({event:o}),!0}}];var Sn;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Sn||(Sn={}));var No;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(No||(No={}));function _p(t){let{acceleration:r,activator:o=Sn.Pointer,canScroll:a,draggingRect:s,enabled:i,interval:l=5,order:c=No.TreeOrder,pointerCoordinates:d,scrollableAncestors:u,scrollableAncestorRects:h,delta:x,threshold:y}=t,S=$p({delta:x,disabled:!i}),[w,L]=vi(),z=Ee({x:0,y:0}),B=Ee({x:0,y:0}),E=Ne(()=>{switch(o){case Sn.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case Sn.DraggableRect:return s}},[o,s,d]),O=Ee(null),F=Kt(()=>{let H=O.current;if(!H)return;let _=z.current.x*B.current.x,J=z.current.y*B.current.y;H.scrollBy(_,J)},[]),j=Ne(()=>c===No.TreeOrder?[...u].reverse():u,[c,u]);xe(()=>{if(!i||!u.length||!E){L();return}for(let H of j){if((a==null?void 0:a(H))===!1)continue;let _=u.indexOf(H),J=h[_];if(!J)continue;let{direction:Q,speed:W}=Lp(H,J,E,r,y);for(let se of["x","y"])if(!S[se][Q[se]])W[se]=0,Q[se]=0;if(W.x>0||W.y>0){L(),O.current=H,w(F,l),z.current=W,B.current=Q;return}}z.current={x:0,y:0},B.current={x:0,y:0},L()},[r,F,a,L,i,l,JSON.stringify(E),JSON.stringify(S),w,u,j,h,JSON.stringify(y)])}var zp={x:{[Te.Backward]:!1,[Te.Forward]:!1},y:{[Te.Backward]:!1,[Te.Forward]:!1}};function $p(t){let{delta:r,disabled:o}=t,a=lo(r);return on((s)=>{if(o||!a||!s)return zp;let i={x:Math.sign(r.x-a.x),y:Math.sign(r.y-a.y)};return{x:{[Te.Backward]:s.x[Te.Backward]||i.x===-1,[Te.Forward]:s.x[Te.Forward]||i.x===1},y:{[Te.Backward]:s.y[Te.Backward]||i.y===-1,[Te.Forward]:s.y[Te.Forward]||i.y===1}}},[o,r,a])}function Jp(t,r){let o=r!=null?t.get(r):void 0,a=o?o.node.current:null;return on((s)=>{var i;if(r==null)return null;return(i=a!=null?a:s)!=null?i:null},[a,r])}function jp(t,r){return Ne(()=>t.reduce((o,a)=>{let{sensor:s}=a,i=s.activators.map((l)=>({eventName:l.eventName,handler:r(l.handler,a)}));return[...o,...i]},[]),[t,r])}var Pn;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Pn||(Pn={}));var ya;(function(t){t.Optimized="optimized"})(ya||(ya={}));var Di=new Map;function Gp(t,r){let{dragging:o,dependencies:a,config:s}=r,[i,l]=Xt(null),{frequency:c,measure:d,strategy:u}=s,h=Ee(t),x=z(),y=nn(x),S=Kt(function(B){if(B===void 0)B=[];if(y.current)return;l((E)=>{if(E===null)return B;return E.concat(B.filter((O)=>!E.includes(O)))})},[y]),w=Ee(null),L=on((B)=>{if(x&&!o)return Di;if(!B||B===Di||h.current!==t||i!=null){let E=new Map;for(let O of t){if(!O)continue;if(i&&i.length>0&&!i.includes(O.id)&&O.rect.current){E.set(O.id,O.rect.current);continue}let F=O.node.current,j=F?new Ro(d(F),F):null;if(O.rect.current=j,j)E.set(O.id,j)}return E}return B},[t,i,o,x,d]);return xe(()=>{h.current=t},[t]),xe(()=>{if(x)return;S()},[o,x]),xe(()=>{if(i&&i.length>0)l(null)},[JSON.stringify(i)]),xe(()=>{if(x||typeof c!=="number"||w.current!==null)return;w.current=setTimeout(()=>{S(),w.current=null},c)},[c,x,S,...a]),{droppableRects:L,measureDroppableContainers:S,measuringScheduled:i!=null};function z(){switch(u){case Pn.Always:return!1;case Pn.BeforeDragging:return o;default:return!o}}}function Zi(t,r){return on((o)=>{if(!t)return null;if(o)return o;return typeof r==="function"?r(t):t},[r,t])}function Wp(t,r){return Zi(t,r)}function Xp(t){let{callback:r,disabled:o}=t,a=io(r),s=Ne(()=>{if(o||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:i}=window;return new i(a)},[a,o]);return xe(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function To(t){let{callback:r,disabled:o}=t,a=io(r),s=Ne(()=>{if(o||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:i}=window;return new i(a)},[o]);return xe(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Up(t){return new Ro(Ar(t),t)}function Ei(t,r,o){if(r===void 0)r=Up;let[a,s]=Xt(null);function i(){s((d)=>{if(!t)return null;if(t.isConnected===!1){var u;return(u=d!=null?d:o)!=null?u:null}let h=r(t);if(JSON.stringify(d)===JSON.stringify(h))return d;return h})}let l=Xp({callback(d){if(!t)return;for(let u of d){let{type:h,target:x}=u;if(h==="childList"&&x instanceof HTMLElement&&x.contains(t)){i();break}}}}),c=To({callback:i});return Bt(()=>{if(i(),t)c==null||c.observe(t),l==null||l.observe(document.body,{childList:!0,subtree:!0});else c==null||c.disconnect(),l==null||l.disconnect()},[t]),a}function Kp(t){let r=Zi(t);return $i(t,r)}var Mi=[];function Yp(t){let r=Ee(t),o=on((a)=>{if(!t)return Mi;if(a&&a!==Mi&&t&&r.current&&t.parentNode===r.current.parentNode)return a;return kn(t)},[t]);return xe(()=>{r.current=t},[t]),o}function qp(t){let[r,o]=Xt(null),a=Ee(t),s=Kt((i)=>{let l=ga(i.target);if(!l)return;o((c)=>{if(!c)return null;return c.set(l,ha(l)),new Map(c)})},[]);return xe(()=>{let i=a.current;if(t!==i){l(i);let c=t.map((d)=>{let u=ga(d);if(u)return u.addEventListener("scroll",s,{passive:!0}),[u,ha(u)];return null}).filter((d)=>d!=null);o(c.length?new Map(c):null),a.current=t}return()=>{l(t),l(i)};function l(c){c.forEach((d)=>{let u=ga(d);u==null||u.removeEventListener("scroll",s)})}},[s,t]),Ne(()=>{if(t.length)return r?Array.from(r.values()).reduce((i,l)=>Mr(i,l),Yt):Ui(t);return Yt},[t,r])}function Ii(t,r){if(r===void 0)r=[];let o=Ee(null);return xe(()=>{o.current=null},r),xe(()=>{let a=t!==Yt;if(a&&!o.current)o.current=t;if(!a&&o.current)o.current=null},[t]),o.current?Ir(t,o.current):Yt}function Zp(t){xe(()=>{if(!Nn)return;let r=t.map((o)=>{let{sensor:a}=o;return a.setup==null?void 0:a.setup()});return()=>{for(let o of r)o==null||o()}},t.map((r)=>{let{sensor:o}=r;return o}))}function Qp(t,r){return Ne(()=>t.reduce((o,a)=>{let{eventName:s,handler:i}=a;return o[s]=(l)=>{i(l,r)},o},{}),[t,r])}function Qi(t){return Ne(()=>t?Sp(t):null,[t])}var Ai=[];function em(t,r){if(r===void 0)r=Ar;let[o]=t,a=Qi(o?ze(o):null),[s,i]=Xt(Ai);function l(){i(()=>{if(!t.length)return Ai;return t.map((d)=>Wi(d)?a:new Ro(r(d),d))})}let c=To({callback:l});return Bt(()=>{c==null||c.disconnect(),l(),t.forEach((d)=>c==null?void 0:c.observe(d))},[t]),s}function tm(t){if(!t)return null;if(t.children.length>1)return t;let r=t.children[0];return rn(r)?r:t}function rm(t){let{measure:r}=t,[o,a]=Xt(null),s=Kt((u)=>{for(let{target:h}of u)if(rn(h)){a((x)=>{let y=r(h);return x?{...x,width:y.width,height:y.height}:y});break}},[r]),i=To({callback:s}),l=Kt((u)=>{let h=tm(u);if(i==null||i.disconnect(),h)i==null||i.observe(h);a(h?r(h):null)},[r,i]),[c,d]=Rn(l);return Ne(()=>({nodeRef:c,rect:o,setRef:d}),[o,c,d])}var nm=[{sensor:Dn,options:{}},{sensor:Ln,options:{}}],om={current:{}},po={draggable:{measure:Pi},droppable:{measure:Pi,strategy:Pn.WhileDragging,frequency:ya.Optimized},dragOverlay:{measure:Ar}};class sn extends Map{get(t){var r;return t!=null?(r=super.get(t))!=null?r:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((t)=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,o;return(r=(o=this.get(t))==null?void 0:o.node.current)!=null?r:void 0}}var am={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new sn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:fo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:po,measureDroppableContainers:fo,windowRect:null,measuringScheduled:!1},sm={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:fo,draggableNodes:new Map,over:null,measureDroppableContainers:fo},ko=Tn(sm),el=Tn(am);function im(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new sn}}}function lm(t,r){switch(r.type){case we.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:r.initialCoordinates,active:r.active}};case we.DragMove:if(t.draggable.active==null)return t;return{...t,draggable:{...t.draggable,translate:{x:r.coordinates.x-t.draggable.initialCoordinates.x,y:r.coordinates.y-t.draggable.initialCoordinates.y}}};case we.DragEnd:case we.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case we.RegisterDroppable:{let{element:o}=r,{id:a}=o,s=new sn(t.droppable.containers);return s.set(a,o),{...t,droppable:{...t.droppable,containers:s}}}case we.SetDroppableDisabled:{let{id:o,key:a,disabled:s}=r,i=t.droppable.containers.get(o);if(!i||a!==i.key)return t;let l=new sn(t.droppable.containers);return l.set(o,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:l}}}case we.UnregisterDroppable:{let{id:o,key:a}=r,s=t.droppable.containers.get(o);if(!s||a!==s.key)return t;let i=new sn(t.droppable.containers);return i.delete(o),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function cm(t){let{disabled:r}=t,{active:o,activatorEvent:a,draggableNodes:s}=ln(ko),i=lo(a),l=lo(o==null?void 0:o.id);return xe(()=>{if(r)return;if(!a&&i&&l!=null){if(!Cn(i))return;if(document.activeElement===i.target)return;let c=s.get(l);if(!c)return;let{activatorNode:d,node:u}=c;if(!d.current&&!u.current)return;requestAnimationFrame(()=>{for(let h of[d.current,u.current]){if(!h)continue;let x=xi(h);if(x){x.focus();break}}})}},[a,r,s,l,i]),null}function dm(t,r){let{transform:o,...a}=r;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...a}),o):o}function um(t){return Ne(()=>({draggable:{...po.draggable,...t==null?void 0:t.draggable},droppable:{...po.droppable,...t==null?void 0:t.droppable},dragOverlay:{...po.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function pm(t){let{activeNode:r,measure:o,initialRect:a,config:s=!0}=t,i=Ee(!1),{x:l,y:c}=typeof s==="boolean"?{x:s,y:s}:s;Bt(()=>{if(!l&&!c||!r){i.current=!1;return}if(i.current||!a)return;let u=r==null?void 0:r.node.current;if(!u||u.isConnected===!1)return;let h=o(u),x=$i(h,a);if(!l)x.x=0;if(!c)x.y=0;if(i.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){let y=Ji(u);if(y)y.scrollBy({top:x.y,left:x.x})}},[r,l,c,a,o])}var tl=Tn({...Yt,scaleX:1,scaleY:1}),Sr;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Sr||(Sr={}));var rl=lp(function(r){var o,a,s,i;let{id:l,accessibility:c,autoScroll:d=!0,children:u,sensors:h=nm,collisionDetection:x=hp,measuring:y,modifiers:S,...w}=r,L=cp(lm,void 0,im),[z,B]=L,[E,O]=pp(),[F,j]=Xt(Sr.Uninitialized),H=F===Sr.Initialized,{draggable:{active:_,nodes:J,translate:Q},droppable:{containers:W}}=z,se=_!=null?J.get(_):null,ye=Ee({initial:null,translated:null}),ve=Ne(()=>{var Ie;return _!=null?{id:_,data:(Ie=se==null?void 0:se.data)!=null?Ie:om,rect:ye}:null},[_,se]),Re=Ee(null),[Me,Ae]=Xt(null),[be,qe]=Xt(null),he=nn(w,Object.values(w)),Oe=Er("DndDescribedBy",l),U=Ne(()=>W.getEnabled(),[W]),ne=um(y),{droppableRects:ee,measureDroppableContainers:Ce,measuringScheduled:st}=Gp(U,{dragging:H,dependencies:[Q.x,Q.y],config:ne.droppable}),Se=Jp(J,_),mr=Ne(()=>be?co(be):null,[be]),X=oc(),it=Wp(Se,ne.draggable.measure);pm({activeNode:_!=null?J.get(_):null,config:X.layoutShiftCompensation,initialRect:it,measure:ne.draggable.measure});let le=Ei(Se,ne.draggable.measure,it),pn=Ei(Se?Se.parentElement:null),Zt=Ee({activatorEvent:null,active:null,activeNode:Se,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:J,draggingNode:null,draggingNodeRect:null,droppableContainers:W,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Fr=W.getNodeFor((o=Zt.current.over)==null?void 0:o.id),sr=rm({measure:ne.dragOverlay.measure}),_r=(a=sr.nodeRef.current)!=null?a:Se,zr=H?(s=sr.rect)!=null?s:le:null,Aa=Boolean(sr.nodeRef.current&&sr.rect),Oa=Kp(Aa?null:le),Jo=Qi(_r?ze(_r):null),fr=Yp(H?Fr!=null?Fr:Se:null),On=em(fr),Hn=dm(S,{transform:{x:Q.x-Oa.x,y:Q.y-Oa.y,scaleX:1,scaleY:1},activatorEvent:be,active:ve,activeNodeRect:le,containerNodeRect:pn,draggingNodeRect:zr,over:Zt.current.over,overlayNodeRect:sr.rect,scrollableAncestors:fr,scrollableAncestorRects:On,windowRect:Jo}),Ha=mr?Mr(mr,Q):null,Va=qp(fr),ql=Ii(Va),Zl=Ii(Va,[le]),$r=Mr(Hn,ql),Jr=zr?wp(zr,Hn):null,mn=ve&&Jr?x({active:ve,collisionRect:Jr,droppableRects:ee,droppableContainers:U,pointerCoordinates:Ha}):null,Ba=Na(mn,"id"),[gr,Fa]=Xt(null),Ql=Aa?Hn:Mr(Hn,Zl),ec=xp(Ql,(i=gr==null?void 0:gr.rect)!=null?i:null,le),jo=Ee(null),_a=Kt((Ie,pt)=>{let{sensor:bt,options:br}=pt;if(Re.current==null)return;let Pt=J.get(Re.current);if(!Pt)return;let xt=Ie.nativeEvent,Qt=new bt({active:Re.current,activeNode:Pt,event:xt,options:br,context:Zt,onAbort(Le){if(!J.get(Le))return;let{onDragAbort:er}=he.current,ir={id:Le};er==null||er(ir),E({type:"onDragAbort",event:ir})},onPending(Le,vr,er,ir){if(!J.get(Le))return;let{onDragPending:gn}=he.current,hr={id:Le,constraint:vr,initialCoordinates:er,offset:ir};gn==null||gn(hr),E({type:"onDragPending",event:hr})},onStart(Le){let vr=Re.current;if(vr==null)return;let er=J.get(vr);if(!er)return;let{onDragStart:ir}=he.current,fn={activatorEvent:xt,active:{id:vr,data:er.data,rect:ye}};uo(()=>{ir==null||ir(fn),j(Sr.Initializing),B({type:we.DragStart,initialCoordinates:Le,active:vr}),E({type:"onDragStart",event:fn}),Ae(jo.current),qe(xt)})},onMove(Le){B({type:we.DragMove,coordinates:Le})},onEnd:jr(we.DragEnd),onCancel:jr(we.DragCancel)});jo.current=Qt;function jr(Le){return async function(){let{active:er,collisions:ir,over:fn,scrollAdjustedTranslate:gn}=Zt.current,hr=null;if(er&&gn){let{cancelDrop:bn}=he.current;if(hr={activatorEvent:xt,active:er,collisions:ir,delta:gn,over:fn},Le===we.DragEnd&&typeof bn==="function"){if(await Promise.resolve(bn(hr)))Le=we.DragCancel}}Re.current=null,uo(()=>{B({type:Le}),j(Sr.Uninitialized),Fa(null),Ae(null),qe(null),jo.current=null;let bn=Le===we.DragEnd?"onDragEnd":"onDragCancel";if(hr){let Go=he.current[bn];Go==null||Go(hr),E({type:bn,event:hr})}})}}},[J]),tc=Kt((Ie,pt)=>(bt,br)=>{let Pt=bt.nativeEvent,xt=J.get(br);if(Re.current!==null||!xt||Pt.dndKit||Pt.defaultPrevented)return;let Qt={active:xt};if(Ie(bt,pt.options,Qt)===!0)Pt.dndKit={capturedBy:pt.sensor},Re.current=br,_a(bt,pt)},[J,_a]),za=jp(h,tc);Zp(h),Bt(()=>{if(le&&F===Sr.Initializing)j(Sr.Initialized)},[le,F]),xe(()=>{let{onDragMove:Ie}=he.current,{active:pt,activatorEvent:bt,collisions:br,over:Pt}=Zt.current;if(!pt||!bt)return;let xt={active:pt,activatorEvent:bt,collisions:br,delta:{x:$r.x,y:$r.y},over:Pt};uo(()=>{Ie==null||Ie(xt),E({type:"onDragMove",event:xt})})},[$r.x,$r.y]),xe(()=>{let{active:Ie,activatorEvent:pt,collisions:bt,droppableContainers:br,scrollAdjustedTranslate:Pt}=Zt.current;if(!Ie||Re.current==null||!pt||!Pt)return;let{onDragOver:xt}=he.current,Qt=br.get(Ba),jr=Qt&&Qt.rect.current?{id:Qt.id,rect:Qt.rect.current,data:Qt.data,disabled:Qt.disabled}:null,Le={active:Ie,activatorEvent:pt,collisions:bt,delta:{x:Pt.x,y:Pt.y},over:jr};uo(()=>{Fa(jr),xt==null||xt(Le),E({type:"onDragOver",event:Le})})},[Ba]),Bt(()=>{Zt.current={activatorEvent:be,active:ve,activeNode:Se,collisionRect:Jr,collisions:mn,droppableRects:ee,draggableNodes:J,draggingNode:_r,draggingNodeRect:zr,droppableContainers:W,over:gr,scrollableAncestors:fr,scrollAdjustedTranslate:$r},ye.current={initial:zr,translated:Jr}},[ve,Se,mn,Jr,J,_r,zr,ee,W,gr,fr,$r]),_p({...X,delta:Q,draggingRect:Jr,pointerCoordinates:Ha,scrollableAncestors:fr,scrollableAncestorRects:On});let rc=Ne(()=>({active:ve,activeNode:Se,activeNodeRect:le,activatorEvent:be,collisions:mn,containerNodeRect:pn,dragOverlay:sr,draggableNodes:J,droppableContainers:W,droppableRects:ee,over:gr,measureDroppableContainers:Ce,scrollableAncestors:fr,scrollableAncestorRects:On,measuringConfiguration:ne,measuringScheduled:st,windowRect:Jo}),[ve,Se,le,be,mn,pn,sr,J,W,ee,gr,Ce,fr,On,ne,st,Jo]),nc=Ne(()=>({activatorEvent:be,activators:za,active:ve,activeNodeRect:le,ariaDescribedById:{draggable:Oe},dispatch:B,draggableNodes:J,over:gr,measureDroppableContainers:Ce}),[be,za,ve,le,B,Oe,J,gr,Ce]);return rr.createElement(Hi.Provider,{value:O},rr.createElement(ko.Provider,{value:nc},rr.createElement(el.Provider,{value:rc},rr.createElement(tl.Provider,{value:ec},u)),rr.createElement(cm,{disabled:(c==null?void 0:c.restoreFocus)===!1})),rr.createElement(gp,{...c,hiddenTextDescribedById:Oe}));function oc(){let Ie=(Me==null?void 0:Me.autoScrollEnabled)===!1,pt=typeof d==="object"?d.enabled===!1:d===!1,bt=H&&!Ie&&!pt;if(typeof d==="object")return{...d,enabled:bt};return{enabled:bt}}}),mm=Tn(null),Oi="button",fm="Draggable";function nl(t){let{id:r,data:o,disabled:a=!1,attributes:s}=t,i=Er(fm),{activators:l,activatorEvent:c,active:d,activeNodeRect:u,ariaDescribedById:h,draggableNodes:x,over:y}=ln(ko),{role:S=Oi,roleDescription:w="draggable",tabIndex:L=0}=s!=null?s:{},z=(d==null?void 0:d.id)===r,B=ln(z?tl:mm),[E,O]=Rn(),[F,j]=Rn(),H=Qp(l,r),_=nn(o);Bt(()=>(x.set(r,{id:r,key:i,node:E,activatorNode:F,data:_}),()=>{let Q=x.get(r);if(Q&&Q.key===i)x.delete(r)}),[x,r]);let J=Ne(()=>({role:S,tabIndex:L,"aria-disabled":a,"aria-pressed":z&&S===Oi?!0:void 0,"aria-roledescription":w,"aria-describedby":h.draggable}),[a,S,L,z,w,h.draggable]);return{active:d,activatorEvent:c,activeNodeRect:u,attributes:J,isDragging:z,listeners:a?void 0:H,node:E,over:y,setNodeRef:O,setActivatorNodeRef:j,transform:B}}function ol(){return ln(el)}var gm="Droppable",bm={timeout:25};function al(t){let{data:r,disabled:o=!1,id:a,resizeObserverConfig:s}=t,i=Er(gm),{active:l,dispatch:c,over:d,measureDroppableContainers:u}=ln(ko),h=Ee({disabled:o}),x=Ee(!1),y=Ee(null),S=Ee(null),{disabled:w,updateMeasurementsFor:L,timeout:z}={...bm,...s},B=nn(L!=null?L:a),E=Kt(()=>{if(!x.current){x.current=!0;return}if(S.current!=null)clearTimeout(S.current);S.current=setTimeout(()=>{u(Array.isArray(B.current)?B.current:[B.current]),S.current=null},z)},[z]),O=To({callback:E,disabled:w||!l}),F=Kt((J,Q)=>{if(!O)return;if(Q)O.unobserve(Q),x.current=!1;if(J)O.observe(J)},[O]),[j,H]=Rn(F),_=nn(r);return xe(()=>{if(!O||!j.current)return;O.disconnect(),x.current=!1,O.observe(j.current)},[j,O]),xe(()=>(c({type:we.RegisterDroppable,element:{id:a,key:i,disabled:o,node:j,rect:y,data:_}}),()=>c({type:we.UnregisterDroppable,key:i,id:a})),[a]),xe(()=>{if(o!==h.current.disabled)c({type:we.SetDroppableDisabled,id:a,key:i,disabled:o}),h.current.disabled=o},[a,i,o,c]),{active:l,rect:y,isOver:(d==null?void 0:d.id)===a,node:j,over:d,setNodeRef:H}}import sl,{useMemo as Eo,useRef as Ra,useEffect as Mo,useState as vm,useContext as hm}from"react";function Ao(t,r,o){let a=t.slice();return a.splice(o<0?a.length+o:o,0,a.splice(r,1)[0]),a}function xm(t,r){return t.reduce((o,a,s)=>{let i=r.get(a);if(i)o[s]=i;return o},Array(t.length))}function Lo(t){return t!==null&&t>=0}function ym(t,r){if(t===r)return!0;if(t.length!==r.length)return!1;for(let o=0;o<t.length;o++)if(t[o]!==r[o])return!1;return!0}function wm(t){if(typeof t==="boolean")return{draggable:t,droppable:t};return t}var il=(t)=>{let{rects:r,activeIndex:o,overIndex:a,index:s}=t,i=Ao(r,a,o),l=r[s],c=i[s];if(!c||!l)return null;return{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}};var Do={scaleX:1,scaleY:1},ll=(t)=>{var r;let{activeIndex:o,activeNodeRect:a,index:s,rects:i,overIndex:l}=t,c=(r=i[o])!=null?r:a;if(!c)return null;if(s===o){let u=i[l];if(!u)return null;return{x:0,y:o<l?u.top+u.height-(c.top+c.height):u.top-c.top,...Do}}let d=Nm(i,s,o);if(s>o&&s<=l)return{x:0,y:-c.height-d,...Do};if(s<o&&s>=l)return{x:0,y:c.height+d,...Do};return{x:0,y:0,...Do}};function Nm(t,r,o){let a=t[r],s=t[r-1],i=t[r+1];if(!a)return 0;if(o<r)return s?a.top-(s.top+s.height):i?i.top-(a.top+a.height):0;return i?i.top-(a.top+a.height):s?a.top-(s.top+s.height):0}var cl="Sortable",dl=sl.createContext({activeIndex:-1,containerId:cl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:il,disabled:{draggable:!1,droppable:!1}});function ul(t){let{children:r,id:o,items:a,strategy:s=il,disabled:i=!1}=t,{active:l,dragOverlay:c,droppableRects:d,over:u,measureDroppableContainers:h}=ol(),x=Er(cl,o),y=Boolean(c.rect!==null),S=Eo(()=>a.map((H)=>typeof H==="object"&&("id"in H)?H.id:H),[a]),w=l!=null,L=l?S.indexOf(l.id):-1,z=u?S.indexOf(u.id):-1,B=Ra(S),E=!ym(S,B.current),O=z!==-1&&L===-1||E,F=wm(i);Bt(()=>{if(E&&w)h(S)},[E,S,w,h]),Mo(()=>{B.current=S},[S]);let j=Eo(()=>({activeIndex:L,containerId:x,disabled:F,disableTransforms:O,items:S,overIndex:z,useDragOverlay:y,sortedRects:xm(S,d),strategy:s}),[L,x,F.draggable,F.droppable,O,S,z,d,y,s]);return sl.createElement(dl.Provider,{value:j},r)}var Rm=(t)=>{let{id:r,items:o,activeIndex:a,overIndex:s}=t;return Ao(o,a,s).indexOf(r)},Cm=(t)=>{let{containerId:r,isSorting:o,wasDragging:a,index:s,items:i,newIndex:l,previousItems:c,previousContainerId:d,transition:u}=t;if(!u||!a)return!1;if(c!==i&&s===l)return!1;if(o)return!0;return l!==s&&r===d},Sm={duration:200,easing:"ease"},pl="transform",Pm=Cr.Transition.toString({property:pl,duration:0,easing:"linear"}),Tm={roleDescription:"sortable"};function km(t){let{disabled:r,index:o,node:a,rect:s}=t,[i,l]=vm(null),c=Ra(o);return Bt(()=>{if(!r&&o!==c.current&&a.current){let d=s.current;if(d){let u=Ar(a.current,{ignoreTransform:!0}),h={x:d.left-u.left,y:d.top-u.top,scaleX:d.width/u.width,scaleY:d.height/u.height};if(h.x||h.y)l(h)}}if(o!==c.current)c.current=o},[r,o,a,s]),Mo(()=>{if(i)l(null)},[i]),i}function ml(t){let{animateLayoutChanges:r=Cm,attributes:o,disabled:a,data:s,getNewIndex:i=Rm,id:l,strategy:c,resizeObserverConfig:d,transition:u=Sm}=t,{items:h,containerId:x,activeIndex:y,disabled:S,disableTransforms:w,sortedRects:L,overIndex:z,useDragOverlay:B,strategy:E}=hm(dl),O=Lm(a,S),F=h.indexOf(l),j=Eo(()=>({sortable:{containerId:x,index:F,items:h},...s}),[x,s,F,h]),H=Eo(()=>h.slice(h.indexOf(l)),[h,l]),{rect:_,node:J,isOver:Q,setNodeRef:W}=al({id:l,data:j,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:H,...d}}),{active:se,activatorEvent:ye,activeNodeRect:ve,attributes:Re,setNodeRef:Me,listeners:Ae,isDragging:be,over:qe,setActivatorNodeRef:he,transform:Oe}=nl({id:l,data:j,attributes:{...Tm,...o},disabled:O.draggable}),U=bi(W,Me),ne=Boolean(se),ee=ne&&!w&&Lo(y)&&Lo(z),Ce=!B&&be,st=Ce&&ee?Oe:null,Se=c!=null?c:E,mr=ee?st!=null?st:Se({rects:L,activeNodeRect:ve,activeIndex:y,overIndex:z,index:F}):null,X=Lo(y)&&Lo(z)?i({id:l,items:h,activeIndex:y,overIndex:z}):F,it=se==null?void 0:se.id,le=Ra({activeId:it,items:h,newIndex:X,containerId:x}),pn=h!==le.current.items,Zt=r({active:se,containerId:x,isDragging:be,isSorting:ne,id:l,index:F,items:h,newIndex:le.current.newIndex,previousItems:le.current.items,previousContainerId:le.current.containerId,transition:u,wasDragging:le.current.activeId!=null}),Fr=km({disabled:!Zt,index:F,node:J,rect:_});return Mo(()=>{if(ne&&le.current.newIndex!==X)le.current.newIndex=X;if(x!==le.current.containerId)le.current.containerId=x;if(h!==le.current.items)le.current.items=h},[ne,X,x,h]),Mo(()=>{if(it===le.current.activeId)return;if(it!=null&&le.current.activeId==null){le.current.activeId=it;return}let _r=setTimeout(()=>{le.current.activeId=it},50);return()=>clearTimeout(_r)},[it]),{active:se,activeIndex:y,attributes:Re,data:j,rect:_,index:F,newIndex:X,items:h,isOver:Q,isSorting:ne,isDragging:be,listeners:Ae,node:J,overIndex:z,over:qe,setNodeRef:U,setActivatorNodeRef:he,setDroppableNodeRef:W,setDraggableNodeRef:Me,transform:Fr!=null?Fr:mr,transition:sr()};function sr(){if(Fr||pn&&le.current.newIndex===F)return Pm;if(Ce&&!Cn(ye)||!u)return;if(ne||Zt)return Cr.Transition.toString({...u,property:pl});return}}function Lm(t,r){var o,a;if(typeof t==="boolean")return{draggable:t,droppable:!1};return{draggable:(o=t==null?void 0:t.draggable)!=null?o:r.draggable,droppable:(a=t==null?void 0:t.droppable)!=null?a:r.droppable}}function Io(t){if(!t)return!1;let r=t.data.current;if(r&&"sortable"in r&&typeof r.sortable==="object"&&"containerId"in r.sortable&&"items"in r.sortable&&"index"in r.sortable)return!0;return!1}var Dm=[q.Down,q.Right,q.Up,q.Left],fl=(t,r)=>{let{context:{active:o,collisionRect:a,droppableRects:s,droppableContainers:i,over:l,scrollableAncestors:c}}=r;if(Dm.includes(t.code)){if(t.preventDefault(),!o||!a)return;let d=[];i.getEnabled().forEach((x)=>{if(!x||x!=null&&x.disabled)return;let y=s.get(x.id);if(!y)return;switch(t.code){case q.Down:if(a.top<y.top)d.push(x);break;case q.Up:if(a.top>y.top)d.push(x);break;case q.Left:if(a.left>y.left)d.push(x);break;case q.Right:if(a.left<y.left)d.push(x);break}});let u=zi({active:o,collisionRect:a,droppableRects:s,droppableContainers:d,pointerCoordinates:null}),h=Na(u,"id");if(h===(l==null?void 0:l.id)&&u.length>1)h=u[1].id;if(h!=null){let x=i.get(o.id),y=i.get(h),S=y?s.get(y.id):null,w=y==null?void 0:y.node.current;if(w&&S&&x&&y){let z=kn(w).some((H,_)=>c[_]!==H),B=gl(x,y),E=Em(x,y),O=z||!B?{x:0,y:0}:{x:E?a.width-S.width:0,y:E?a.height-S.height:0},F={x:S.left,y:S.top};return O.x&&O.y?F:Ir(F,O)}}}return};function gl(t,r){if(!Io(t)||!Io(r))return!1;return t.data.current.sortable.containerId===r.data.current.sortable.containerId}function Em(t,r){if(!Io(t)||!Io(r))return!1;if(!gl(t,r))return!1;return t.data.current.sortable.index<r.data.current.sortable.index}import{Fragment as Mm}from"react";import{jsx as Pr,Fragment as Om}from"react/jsx-runtime";var Im=({id:t,label:r,children:o})=>{let{attributes:a,listeners:s,setNodeRef:i,transform:l,transition:c,isDragging:d}=ml({id:t}),u={opacity:d?0.5:1,position:"relative",transform:Cr.Transform.toString(l),transition:c,zIndex:d?10:"auto"},h=Pr("button",{type:"button",className:"touch-none cursor-grab text-muted-foreground/40 hover:text-muted-foreground active:cursor-grabbing",...a,...s,title:r!==void 0&&r!==""?`Drag ${r} to reorder`:"Drag to reorder","aria-label":r!==void 0&&r!==""?`Drag ${r} to reorder`:"Drag handle",children:Pr(ft,{className:"h-3.5 w-3.5"})});return Pr("div",{ref:i,style:u,children:o(h)})},Am=({items:t,onReorder:r,getItemLabel:o,renderItem:a,disabled:s=!1})=>{let i=Vi(wa(Dn,{activationConstraint:{distance:4}}),wa(Ln,{coordinateGetter:fl})),l=(c)=>{let{active:d,over:u}=c;if(!u||d.id===u.id)return;let h=t.findIndex((y)=>y.id===d.id),x=t.findIndex((y)=>y.id===u.id);if(h===-1||x===-1)return;r(Ao(t,h,x))};if(s)return t.map((c)=>Pr(Mm,{children:a(c,null)},c.id));return Pr(rl,{sensors:i,collisionDetection:_i,onDragEnd:l,children:Pr(ul,{items:t.map((c)=>c.id),strategy:ll,children:t.map((c)=>Pr(Im,{id:c.id,label:o?.(c),children:(d)=>Pr(Om,{children:a(c,d)})},c.id))})})},Hm=Am;import*as bl from"react";import{jsx as En,jsxs as Ca}from"react/jsx-runtime";var vl=({open:t,onOpenChange:r,title:o,description:a,confirmLabel:s,cancelLabel:i="Cancel",confirmVariant:l="default",pendingLabel:c="Processing...",onConfirm:d})=>{let[u,h]=bl.useState(!1),x=async()=>{h(!0);try{await d(),r(!1)}catch(y){throw h(!1),y}h(!1)};return En(M,{open:t,onOpenChange:r,children:Ca(D,{children:[Ca(V,{children:[En(T,{children:o}),En(Z,{children:a})]}),Ca(ro,{children:[En(n,{variant:"outline",onClick:()=>{r(!1)},disabled:u,children:i}),En(n,{variant:l,onClick:()=>{x()},disabled:u,children:u?c:s})]})]})})};vl.displayName="ConfirmDialog";var Vm=vl;import*as xl from"react";import{jsx as Oo,jsxs as hl}from"react/jsx-runtime";var yl=xl.forwardRef(function({step:r,total:o,title:a,helper:s,action:i,className:l,...c},d){let u=Boolean(i);return hl("div",{ref:d,className:e("flex flex-wrap items-start justify-between gap-4",l),...c,children:[hl("div",{className:"min-w-0 space-y-1.5",children:[Oo(Wr,{tone:"accent",className:"tracking-[0.16em]",children:`Step ${r} of ${o}`}),Oo("h2",{className:"text-lg font-semibold tracking-tight",children:a}),Oo("p",{className:"max-w-xl text-sm leading-relaxed text-muted-foreground",children:s})]}),u?Oo("div",{className:"shrink-0",children:i}):null]})});yl.displayName="StageHeader";var Bm=yl;import{jsx as Tr,jsxs as Sa}from"react/jsx-runtime";var Fm=p("flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border [&_svg]:h-[18px] [&_svg]:w-[18px]",{defaultVariants:{tone:"default"},variants:{tone:{accent:"border-[color-mix(in_oklab,var(--accent)_28%,var(--border))] bg-[color-mix(in_oklab,var(--accent)_10%,var(--card))] text-(--accent)",danger:"border-[color-mix(in_oklab,var(--danger)_30%,var(--border))] bg-[color-mix(in_oklab,var(--danger)_12%,var(--card))] text-(--danger)",default:"border-border bg-muted/40 text-(--text-muted)",success:"border-[color-mix(in_oklab,var(--success)_30%,var(--border))] bg-[color-mix(in_oklab,var(--success)_12%,var(--card))] text-(--success)",warning:"border-[color-mix(in_oklab,var(--warning)_30%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_12%,var(--card))] text-(--warning)"}}}),_m=p("shrink-0 [&_svg]:h-4 [&_svg]:w-4",{defaultVariants:{tone:"default"},variants:{tone:{accent:"text-(--accent)",danger:"text-(--danger)",default:"text-(--text-muted)",success:"text-(--success)",warning:"text-(--warning)"}}}),Ho=(t)=>t!==null&&t!==void 0&&t!==!1&&t!==0&&t!==0n&&t!==""&&!Number.isNaN(t),wl=({variant:t="tile",icon:r,label:o,value:a,detail:s,tone:i,className:l,...c})=>{if(t==="compact")return Sa(oe,{className:e("gap-1 px-4 py-3.5",l),...c,children:[Sa("span",{className:"flex items-center justify-between gap-2",children:[Tr("span",{className:"text-[11px] font-medium uppercase tracking-[0.14em] text-(--text-muted)",children:o}),Ho(r)?Tr("span",{className:e(_m({tone:i})),"aria-hidden":!0,children:r}):null]}),Tr("span",{className:"text-[22px] font-semibold leading-none tabular-nums tracking-tight text-(--text-primary)",children:a}),Ho(s)?Tr("span",{className:"text-xs text-(--text-muted)",children:s}):null]});return Sa(oe,{className:e("flex flex-col items-center gap-2.5 px-4 py-5 text-center","transition-colors hover:border-[color-mix(in_oklab,var(--accent)_22%,var(--border))]",l),...c,children:[Ho(r)?Tr("span",{className:e(Fm({tone:i})),"aria-hidden":!0,children:r}):null,Tr("span",{className:"text-[26px] font-semibold leading-none tabular-nums tracking-tight text-(--text-primary)",children:a}),Tr("span",{className:"text-[11px] font-medium uppercase tracking-[0.14em] text-(--text-muted)",children:o}),Ho(s)?Tr("span",{className:"text-xs text-(--text-muted)",children:s}):null]})};wl.displayName="StatTile";var zm=wl;import*as Rl from"react";import{jsx as Nl,jsxs as Gm}from"react/jsx-runtime";var $m={danger:"border-[color-mix(in_oklab,var(--danger)_40%,var(--border))] bg-[color-mix(in_oklab,var(--danger)_8%,var(--card))] text-(--danger)",live:"border-[color-mix(in_oklab,var(--primary)_45%,var(--border))] bg-[color-mix(in_oklab,var(--primary)_8%,var(--card))] text-primary",neutral:"border-border bg-card text-muted-foreground",success:"border-[color-mix(in_oklab,var(--success)_38%,var(--border))] bg-[color-mix(in_oklab,var(--success)_8%,var(--card))] text-(--success)",warning:"border-[color-mix(in_oklab,var(--warning)_42%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_9%,var(--card))] text-(--warning)"},Jm={danger:"danger",live:"primary",neutral:"neutral",success:"success",warning:"warning"},jm=({tone:t,active:r=!1,label:o,className:a,children:s,...i},l)=>{let c="border-border bg-card text-muted-foreground";if(t)c=$m[t];else if(r)c="border-[color-mix(in_oklab,var(--primary)_45%,var(--border))] bg-[color-mix(in_oklab,var(--primary)_8%,var(--card))] text-primary";return Gm("div",{ref:l,className:e("inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.16em]",c,a),...i,children:[t?Nl(Fn,{tone:Jm[t],pulse:t==="live"}):Nl("span",{"aria-hidden":!0,className:e("h-1.5 w-1.5 rounded-full",r?"bg-primary shadow-[0_0_0_3px_color-mix(in_oklab,var(--primary)_22%,transparent)]":"bg-muted-foreground")}),s??o]})},Cl=Rl.forwardRef(jm);Cl.displayName="StatusPill";var Wm=Cl;import*as Bo from"react";import{jsx as Vo,jsxs as Km}from"react/jsx-runtime";var Xm=p("relative min-w-0",{defaultVariants:{size:"md",variant:"pill"},variants:{size:{md:"",sm:""},variant:{pill:"",plain:""}}}),Um=p("pl-9 [&::-webkit-search-cancel-button]:appearance-none",{defaultVariants:{size:"md",variant:"pill"},variants:{size:{md:"",sm:"h-8 text-[13px]"},variant:{pill:"rounded-full bg-(--bg-surface)",plain:"bg-(--bg-surface)"}}}),Sl=({value:t,defaultValue:r,onValueChange:o,clearLabel:a,variant:s,size:i,className:l,classes:c,...d})=>{let[u,h]=Bo.useState(r??""),x=t!==void 0,y=x?t:u,S=Bo.useRef(null),w=(L)=>{if(!x)h(L);o?.(L)};return Km("div",{className:e(Xm({size:i,variant:s}),c?.root,l),children:[Vo(Be,{"aria-hidden":!0,className:e("pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",c?.icon)}),Vo(g,{ref:S,type:"search",value:y,onChange:(L)=>{w(L.target.value)},className:e(Um({size:i,variant:s}),y!==void 0&&y!==""&&a!==void 0?"pr-9":void 0,c?.input),...d}),y!==void 0&&y!==""&&a!==void 0?Vo("button",{type:"button","aria-label":a,onClick:()=>{w(""),S.current?.focus()},className:e("absolute right-2.5 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-(--bg-surface-alt) hover:text-(--text-primary) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",c?.clear),children:Vo(C,{className:"h-3.5 w-3.5"})}):null]})};Sl.displayName="SearchField";var Ym=Sl;import{jsx as Fo,jsxs as Pl}from"react/jsx-runtime";var Tl=({title:t,description:r,value:o,options:a,onValueChange:s,align:i="center",className:l,...c})=>Pl("section",{className:e("flex min-w-0 flex-col gap-3 sm:flex-row sm:justify-between",i==="center"?"sm:items-center":"sm:items-start",l),...c,children:[Pl("div",{className:"min-w-0",children:[Fo("h3",{className:"truncate text-sm font-semibold",children:t}),r!==void 0&&r!==null&&r!==!1&&r!==""&&r!==0?Fo("p",{className:"mt-1 text-sm text-muted-foreground",children:r}):null]}),Fo("div",{className:"inline-flex shrink-0 rounded-md border border-border bg-background p-1 shadow-xs",children:a.map((d)=>Fo(n,{type:"button",size:"sm",variant:d.value===o?"secondary":"ghost",disabled:d.disabled,className:e("h-8 rounded-sm px-3",d.value===o&&"bg-primary/10 text-primary hover:bg-primary/15"),"aria-label":d.ariaLabel,"aria-pressed":d.value===o,onClick:()=>{s(d.value)},children:d.label},d.value))})]});Tl.displayName="SectionSwitcher";import*as nr from"react";import{jsx as qt}from"react/jsx-runtime";var kl=nr.createContext({value:1}),Pa=()=>nr.useContext(kl),qm=({value:t,defaultValue:r=1,indicators:o,className:a,...s})=>{let i=t??r,l=nr.useMemo(()=>({indicators:o,value:i}),[i,o]);return qt(kl.Provider,{value:l,children:qt("div",{"data-slot":"stepper",className:e("space-y-8",a),...s})})},Zm=({className:t,...r})=>qt("nav",{"data-slot":"stepper-nav","data-orientation":"horizontal",className:e("group/stepper-nav flex items-start justify-between gap-2",t),...r}),Ta=nr.createContext({state:"inactive",step:1}),Qm=({step:t,loading:r,className:o,...a})=>{let{value:s}=Pa(),i="inactive";if(r===!0)i="loading";else if(t<s)i="completed";else if(t===s)i="active";let l=nr.useMemo(()=>({state:i,step:t}),[i,t]);return qt(Ta.Provider,{value:l,children:qt("div",{"data-slot":"stepper-item","data-state":i,"data-step":t,className:e("group/step relative flex-1 items-start",o),...a})})},ef=({className:t,...r})=>qt("div",{"data-slot":"stepper-trigger",className:e("flex flex-col items-center gap-2.5",t),...r}),tf=({className:t,children:r,...o})=>{let{indicators:a}=Pa(),{state:s}=nr.useContext(Ta),i=a?.completed,l=a?.loading,c=r;if(s==="completed"&&Boolean(i))c=i;else if(s==="loading"&&Boolean(l))c=l;return qt("div",{"data-slot":"stepper-indicator","data-state":s,className:e("flex size-7 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold transition-colors",s==="completed"&&"border-primary bg-primary text-primary-foreground",s==="active"&&"border-primary bg-primary text-primary-foreground",s==="loading"&&"border-primary bg-primary text-primary-foreground",s==="inactive"&&"border-muted-foreground/30 bg-background text-muted-foreground",t),...o,children:c})},rf=({className:t,...r})=>{let{state:o}=nr.useContext(Ta);return qt("span",{"data-slot":"stepper-title","data-state":o,className:e("text-sm font-medium",(o==="completed"||o==="active")&&"text-foreground",o==="inactive"&&"text-muted-foreground",t),...r})},nf=({className:t,...r})=>qt("div",{"data-slot":"stepper-separator",className:e("h-0.5 rounded-full bg-muted-foreground/30 transition-colors","group-data-[state=completed]/step:bg-primary",t),...r}),of=({className:t,...r})=>qt("div",{"data-slot":"stepper-panel",className:e(t),...r}),af=({value:t,className:r,...o})=>{let{value:a}=Pa();if(t!==a)return null;return qt("div",{"data-slot":"stepper-content",className:e(r),...o})};import*as Hr from"react";import{jsx as Or,jsxs as df}from"react/jsx-runtime";var ka=Hr.createContext({}),sf=({className:t,size:r,variant:o,...a})=>{let s=Hr.useMemo(()=>({size:r,variant:o}),[r,o]);return Or(ka.Provider,{value:s,children:Or("fieldset",{"data-slot":"split-button",className:e("inline-flex min-w-0 items-stretch",t),...a})})},lf=({className:t,...r})=>{let{size:o,variant:a}=Hr.useContext(ka);return Or(n,{"data-slot":"split-button-action",className:e("rounded-r-none",t),size:o,variant:a,...r})},cf=({align:t="end",children:r,contentClassName:o,disabled:a,label:s,modal:i,onOpenChange:l,open:c})=>{let{size:d,variant:u}=Hr.useContext(ka);return df(at,{modal:i,onOpenChange:l,open:c,children:[Or(rt,{asChild:!0,children:Or(n,{"aria-label":s,"data-slot":"split-button-menu",className:"-ml-px rounded-l-none border-l border-l-current/20 px-2",disabled:a,size:d,variant:u,children:Or(v,{})})}),Or(nt,{align:t,className:o,children:r})]})};import*as cn from"react";import{jsx as or,jsxs as _o}from"react/jsx-runtime";var uf=({items:t,title:r,triggerAriaLabel:o="Technical details",copyLabel:a="Copy",trigger:s,align:i="end",side:l,onCopy:c,className:d,classes:u})=>{let[h,x]=cn.useState(null),y=cn.useRef(null);cn.useEffect(()=>()=>{if(y.current!==null)window.clearTimeout(y.current)},[]);let S=(w)=>{if(navigator.clipboard.writeText(w.value),x(w.label),y.current!==null)window.clearTimeout(y.current);y.current=window.setTimeout(()=>{x(null)},1500),c?.(w)};return _o(R,{children:[or(P,{asChild:!0,children:s??or(n,{type:"button",variant:"ghost",size:"icon","aria-label":o,className:e("h-8 w-8 text-muted-foreground hover:text-foreground",u?.root,u?.trigger,d),children:or(Co,{className:"h-4 w-4"})})}),_o(I,{align:i,side:l,className:e("w-80 p-3",u?.content),children:[r!==void 0&&r!==null?or("div",{className:"mb-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:r}):null,or("dl",{className:"space-y-2.5",children:t.map((w)=>_o("div",{className:e("min-w-0",u?.row),children:[or("dt",{className:e("text-[11px] font-medium text-muted-foreground",u?.label),children:w.label}),_o("dd",{className:"mt-0.5 flex min-w-0 items-start gap-1",children:[or("code",{className:e("min-w-0 flex-1 select-all break-all rounded bg-muted/60 px-1.5 py-1 font-mono text-xs leading-relaxed text-foreground",u?.value),children:w.value}),w.copyable===!1?null:or(n,{type:"button",variant:"ghost",size:"icon","aria-label":`${a} ${w.label}`,className:"h-6 w-6 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>{S(w)},children:h===w.label?or(f,{className:"h-3.5 w-3.5"}):or(te,{className:"h-3.5 w-3.5"})})]})]},w.label))})]})]})};var pf=uf;import*as dn from"react";import{jsx as ke,jsxs as dr,Fragment as Dl}from"react/jsx-runtime";var mf={disabled:!1,emptyMessage:"No option found.",loading:!1,loadingMessage:"Loading options...",modal:!1,placeholder:"Select option...",searchPlaceholder:"Search...",width:"200px"},ff=1,gf=0.5,bf=(t)=>t.children!==void 0,El=(t)=>t.flatMap((r)=>{if(!r.children)return[r];let o=El(r.children);return o.length>0?[{...r,children:o}]:[]}),Ml=(t,r=[])=>t.flatMap((o)=>o.children?Ml(o.children,[...r,o]):[{ancestorIds:r.map((a)=>a.id),node:o,path:r.map((a)=>a.label).join(" / ")}]),Ll=(t)=>({paddingLeft:`${gf+t*ff}rem`}),Il=dn.forwardRef(function(r,o){let a={...mf,...r},{nodes:s,value:i,onChange:l,selectedLabel:c,placeholder:d,searchPlaceholder:u,emptyMessage:h,id:x,className:y,width:S,disabled:w,loading:L,loadingMessage:z,onSearchChange:B,modal:E}=a,[O,F]=dn.useState(!1),[j,H]=dn.useState(""),[_,J]=dn.useState(()=>new Set),Q=El(s),W=Ml(Q),se=W.find((U)=>U.node.id===i),ye=j.trim().toLowerCase(),ve=(U)=>{if(U)J(new Set(se?.ancestorIds));else if(j!=="")H(""),B?.("");F(U)},Re=(U)=>{H(U),B?.(U)},Me=(U)=>{J((ne)=>{let ee=new Set(ne);if(!ee.delete(U))ee.add(U);return ee})},Ae=(U)=>{l(U),ve(!1)},be=(U)=>dr(Dl,{children:[ke(f,{"aria-hidden":!0,className:e(i===U.id?"opacity-100":"opacity-0")}),U.icon]}),qe=(U,ne)=>U.flatMap((ee)=>{if(!bf(ee))return[dr(A,{value:ee.id,style:Ll(ne),onSelect:()=>{Ae(ee.id)},children:[be(ee),ke("span",{className:"min-w-0 truncate",title:ee.label,children:ee.label})]},ee.id)];let Ce=_.has(ee.id),st=Ce?xo:bo;return[dr(A,{value:ee.id,"aria-expanded":Ce,style:Ll(ne),onSelect:()=>{Me(ee.id)},children:[ke(m,{"aria-hidden":!0,className:e(Ce&&"rotate-90")}),ee.icon??ke(st,{"aria-hidden":!0}),ke("span",{className:"min-w-0 truncate",title:ee.label,children:ee.label})]},ee.id),...Ce&&ee.children?qe(ee.children,ne+1):[]]}),he=ye===""?[]:W.filter((U)=>B!==void 0||`${U.path} / ${U.node.label}`.toLowerCase().includes(ye)),Oe=se?.node.label??c;return dr(R,{modal:E,open:O,onOpenChange:ve,children:[ke(P,{asChild:!0,children:dr(n,{ref:o,id:x,variant:"outline","aria-expanded":O,"aria-busy":L,className:e("justify-between",y),style:{width:S},disabled:w,children:[Oe===void 0?ke("span",{className:"min-w-0 truncate text-muted-foreground",children:d}):ke("span",{className:"min-w-0 truncate",children:Oe}),L?ke(k,{"aria-hidden":!0,className:"ml-2 size-4 shrink-0 animate-spin text-muted-foreground"}):ke(Fe,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),ke(I,{className:"p-0",style:{width:"var(--radix-popover-trigger-width)"},children:dr(ae,{shouldFilter:!1,children:[ke(Ze,{"aria-label":u,placeholder:u,value:j,onValueChange:Re}),ke(me,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.5rem))]",children:L?dr("div",{"aria-live":"polite",className:"flex items-center justify-center gap-2 px-3 py-6 text-sm text-muted-foreground",children:[ke(k,{"aria-hidden":!0,className:"size-4 animate-spin"}),z]}):dr(Dl,{children:[ke(Je,{children:h}),ke(Y,{children:ye===""?qe(Q,0):he.map((U)=>dr(A,{value:U.node.id,onSelect:()=>{Ae(U.node.id)},children:[be(U.node),ke("span",{className:"min-w-0 truncate",title:U.node.label,children:U.node.label}),U.path===""?null:ke("span",{className:"ml-auto min-w-0 shrink truncate pl-2 text-xs text-muted-foreground",title:U.path,children:U.path})]},U.node.id))})]})})]})})]})});Il.displayName="TreeSelect";import*as Ol from"react";import{jsx as Al,jsxs as hf}from"react/jsx-runtime";var vf=({value:t,state:r="value",trailing:o,monospace:a=!0,className:s,...i},l)=>{let c=r==="secret";return hf("div",{ref:l,className:e("flex min-w-0 items-center gap-2",s),...i,children:[Al("div",{className:e("flex min-w-0 flex-1 items-center border-b py-2",c?"border-[color-mix(in_oklab,var(--primary)_45%,var(--border))]":"border-border"),children:Al("code",{className:e("block min-w-0 flex-1 overflow-x-auto whitespace-nowrap text-[13px] text-foreground",a?"font-mono":"font-sans"),children:t})}),o]})},Hl=Ol.forwardRef(vf);Hl.displayName="ValueRow";var xf=Hl;import{forwardRef as Vl,useCallback as Vr,useLayoutEffect as Bl,useId as yf,useRef as Fl,useState as je}from"react";import{jsx as N,jsxs as G,Fragment as Mn}from"react/jsx-runtime";var wf=({mode:t,onModeChange:r,disabled:o})=>G("div",{role:"tablist","aria-label":"Value source",className:"relative inline-flex h-7 items-center rounded-full border border-border/70 bg-muted/40 p-0.5 text-[10px] font-medium tracking-[0.08em] uppercase shadow-inner",children:[N("span",{"aria-hidden":!0,className:e("absolute top-0.5 bottom-0.5 w-[calc(50%-2px)] rounded-full bg-background shadow-xs ring-1 ring-border/60 transition-transform duration-200 ease-out",t==="inline"&&"translate-x-[calc(100%+0px)]")}),G("button",{type:"button",role:"tab","aria-selected":t==="linked",disabled:o,onClick:()=>{r("linked")},className:e("relative z-10 flex items-center gap-1 rounded-full px-2.5 py-1 transition-colors",t==="linked"?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[N(Ct,{className:"h-3 w-3"}),"Linked"]}),G("button",{type:"button",role:"tab","aria-selected":t==="inline",disabled:o,onClick:()=>{r("inline")},className:e("relative z-10 flex items-center gap-1 rounded-full px-2.5 py-1 transition-colors",t==="inline"?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[N(ct,{className:"h-3 w-3"}),"Inline"]})]}),Nf=({variableKey:t,initialValue:r,isSecret:o,loading:a,saving:s,onSubmit:i,onCancel:l})=>{let[c,d]=je(r),[u,h]=je(!1),x=Fl(null);return Bl(()=>{if(!a)x.current?.focus()},[a]),G("form",{role:"presentation",onSubmit:(y)=>{y.preventDefault(),i(c)},onKeyDown:(y)=>{if(y.key==="Escape")y.preventDefault(),l()},className:"space-y-3 p-3",children:[G("div",{className:"flex items-start justify-between gap-2",children:[G("div",{className:"min-w-0",children:[N("p",{className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground",children:"Editing linked variable"}),N("p",{className:"mt-0.5 truncate font-mono text-xs text-foreground",children:t})]}),N("button",{type:"button",onClick:l,"aria-label":"Close editor",className:"rounded p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:N(C,{className:"h-3.5 w-3.5"})})]}),G("div",{className:"space-y-1",children:[N(b,{htmlFor:"linked-value",className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:o?"Secret value":"Value"}),G("div",{className:"relative",children:[N(g,{ref:x,id:"linked-value",type:u?"text":"password",value:c,onChange:(y)=>{d(y.target.value)},placeholder:a?"Loading current value…":"Enter value",disabled:a||s,className:"h-8 pr-8 font-mono text-xs",autoComplete:"off",spellCheck:!1}),N("button",{type:"button",onClick:()=>{h((y)=>!y)},"aria-label":u?"Hide value":"Reveal value",className:"absolute inset-y-0 right-1 my-auto flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:u?N(Ve,{className:"h-3.5 w-3.5"}):N(ce,{className:"h-3.5 w-3.5"})})]})]}),G("div",{className:"flex items-center justify-between gap-2 pt-1",children:[G("p",{className:"text-[10px] leading-relaxed text-muted-foreground",children:["Updates the linked secret. Other connectors using"," ",N("span",{className:"font-mono",children:t})," will pick it up on their next run."]}),N(n,{type:"submit",size:"sm",disabled:a||s,className:"h-7 px-3 text-xs",children:s?G(Mn,{children:[N(k,{className:"h-3 w-3 animate-spin"}),"Saving"]}):"Save"})]})]})},Rf=({suggestedName:t,onSubmit:r,onCancel:o})=>{let[a,s]=je(t),[i,l]=je(""),[c,d]=je(!0),[u,h]=je(!1),x=Fl(null);Bl(()=>{x.current?.focus(),x.current?.select()},[]);let y=a.trim(),S=y.length>0;return G("form",{role:"presentation",onSubmit:(w)=>{if(w.preventDefault(),S)r({key:y,secret:c,value:i})},onClick:(w)=>{w.stopPropagation()},onKeyDown:(w)=>{if(w.key==="Escape")w.preventDefault(),w.stopPropagation(),o()},className:"flex flex-col",children:[G("div",{className:"flex items-center gap-2 border-b border-border/60 bg-muted/15 px-3 py-2",children:[N("button",{type:"button",onClick:o,"aria-label":"Back to picker",className:"-ml-1 flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground",children:N(dt,{className:"h-3.5 w-3.5"})}),N("span",{className:"flex-1 text-[10.5px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:"New variable"}),N(We,{className:"h-3 w-3 text-muted-foreground/60"})]}),G("div",{className:"space-y-2.5 px-3 py-2.5",children:[G("div",{className:"space-y-1",children:[N(b,{htmlFor:"var-key",className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground/70",children:"Name"}),G("div",{className:"relative",children:[N("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-2.5 flex items-center text-muted-foreground/60",children:N(lt,{className:"h-3 w-3"})}),N(g,{ref:x,id:"var-key",value:a,onChange:(w)=>{s(w.target.value.toUpperCase())},placeholder:"VARIABLE_NAME",className:"h-8 pl-7 font-mono text-[12.5px] tracking-tight",autoComplete:"off",spellCheck:!1})]})]}),G("div",{className:"space-y-1",children:[N(b,{htmlFor:"var-value",className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground/70",children:"Value"}),G("div",{className:"relative",children:[N(g,{id:"var-value",type:u?"text":"password",value:i,onChange:(w)=>{l(w.target.value)},placeholder:"Encrypted at rest",className:"h-8 pr-8 font-mono text-[12.5px]",autoComplete:"off",spellCheck:!1}),N("button",{type:"button",onClick:()=>{h((w)=>!w)},"aria-label":u?"Hide value":"Reveal value",className:"absolute inset-y-0 right-1 my-auto flex h-6 w-6 items-center justify-center rounded text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground",children:u?N(Ve,{className:"h-3.5 w-3.5"}):N(ce,{className:"h-3.5 w-3.5"})})]})]}),G("label",{className:"flex cursor-pointer items-center gap-2 select-none text-[11px] text-muted-foreground",children:[N("input",{type:"checkbox",checked:c,onChange:(w)=>{d(w.target.checked)},className:"h-3 w-3 accent-primary"}),G("span",{className:"flex items-center gap-1",children:[N(lt,{className:"h-3 w-3"}),"Mark as secret"]})]})]}),G("button",{type:"submit",disabled:!S,className:"group/save flex w-full items-center gap-2.5 border-t border-border/60 bg-gradient-to-r from-muted/30 to-muted/10 px-3 py-2.5 text-left text-xs transition-colors hover:from-muted/50 hover:to-muted/30 disabled:cursor-not-allowed disabled:opacity-50",children:[N("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary ring-1 ring-primary/15",children:N(f,{className:"h-3 w-3"})}),G("span",{className:"flex min-w-0 flex-1 flex-col",children:[N("span",{className:"text-[12px] font-medium leading-tight",children:"Create variable"}),N("span",{className:"truncate text-[10px] leading-tight text-muted-foreground",children:S?G(Mn,{children:["Link this field to"," ",N("span",{className:"font-mono text-foreground/80",children:y})]}):"Enter a name to continue"})]}),N(_e,{className:"h-3.5 w-3.5 text-muted-foreground/60 transition-transform group-hover/save:translate-x-0.5 group-disabled/save:translate-x-0"})]})]})},_l=Vl(function({selected:r,value:o,placeholder:a,disabled:s,open:i,onOpen:l},c){let d=Boolean(o),u=Boolean(r);return G("button",{ref:c,type:"button","aria-expanded":i,disabled:s,onClick:l,className:e("group/trigger relative flex h-9 w-full items-center gap-2 rounded-md border bg-background px-2.5 text-left text-sm shadow-xs transition-all outline-none","hover:border-ring/50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","disabled:cursor-not-allowed disabled:opacity-50",d?"border-primary/20 bg-primary/[0.03]":"border-input"),children:[N("span",{"aria-hidden":!0,className:e("flex h-5 w-5 shrink-0 items-center justify-center rounded-sm transition-colors",d?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:N(Ct,{className:"h-3 w-3"})}),d?G("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[N("span",{className:"truncate font-mono text-[12.5px] tracking-tight",children:o}),!u&&N("span",{title:"Not in your variables list",className:"rounded-sm border border-dashed border-muted-foreground/40 px-1 py-px text-[9px] uppercase tracking-wider text-muted-foreground",children:"Unresolved"})]}):N("span",{className:"flex-1 truncate text-muted-foreground",children:a}),N(Fe,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60 transition-colors group-hover/trigger:text-muted-foreground"})]})});_l.displayName="LinkedTrigger";var Cf=({value:t,onChange:r,onBlur:o,placeholder:a,disabled:s,masked:i,inputId:l})=>{let[c,d]=je(!1),u=i&&!c?"password":"text";return G("div",{className:e("group/inline relative flex h-9 w-full items-center rounded-md border border-input bg-background pl-2.5 pr-1 shadow-xs transition-all","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]"),children:[N("span",{"aria-hidden":!0,className:"mr-2 flex h-5 w-5 shrink-0 items-center justify-center rounded-sm bg-muted text-muted-foreground",children:N(ct,{className:"h-3 w-3"})}),N("input",{id:l,type:u,value:t,onChange:(h)=>{r(h.target.value)},onBlur:o,placeholder:a,disabled:s,autoComplete:"off",spellCheck:!1,className:"flex-1 bg-transparent font-mono text-[12.5px] tracking-tight outline-none placeholder:font-sans placeholder:tracking-normal placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"}),i&&N("button",{type:"button",onClick:()=>{d((h)=>!h)},"aria-label":c?"Hide value":"Reveal value",className:"flex h-7 w-7 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:c?N(Ve,{className:"h-3.5 w-3.5"}):N(ce,{className:"h-3.5 w-3.5"})})]})},Sf=({options:t,value:r,onSelect:o})=>G("div",{className:"px-1",children:[G("div",{className:"flex items-center justify-between px-2 pt-2 pb-1",children:[N("span",{className:"text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:"Linked variables"}),N("span",{className:"text-[10px] tabular-nums text-muted-foreground/60",children:t.length})]}),N(Y,{className:"!p-0 [&_[cmdk-group-heading]]:hidden",children:t.map((a)=>{let s=r===a.key;return G(A,{value:a.key,keywords:[a.key,a.description??""],onSelect:()=>{o(a.key)},className:e("group/row relative my-px cursor-pointer rounded-md px-2 py-1.5 transition-colors","data-[selected=true]:bg-muted/60 data-[selected=true]:text-foreground",s&&"bg-primary/[0.05]"),children:[s&&N("span",{"aria-hidden":!0,className:"absolute inset-y-1.5 left-0 w-[2px] rounded-r bg-primary"}),N("span",{"aria-hidden":!0,className:e("flex h-5 w-5 shrink-0 items-center justify-center rounded-sm transition-colors",s?"bg-primary/15 text-primary":"bg-muted/60 text-muted-foreground/70 group-hover/row:bg-muted"),children:N(lt,{className:"h-3 w-3"})}),G("div",{className:"flex min-w-0 flex-1 flex-col",children:[N("span",{className:e("truncate font-mono text-[12.5px] tracking-tight",s&&"text-primary"),children:a.key}),a.description!==void 0&&a.description!==""&&N("span",{className:"truncate text-[10.5px] leading-tight text-muted-foreground",children:a.description})]}),s?N(f,{className:"h-3.5 w-3.5 shrink-0 text-primary"}):N("span",{"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 text-transparent transition-colors group-data-[selected=true]/row:text-muted-foreground/40",children:N(_e,{className:"h-3.5 w-3.5"})})]},a.key)})})]}),Pf=()=>G("div",{className:"space-y-1.5 px-2 py-3",children:[G("div",{className:"flex items-center justify-between px-1 pb-1",children:[N("span",{className:"text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/60",children:"Loading"}),N(k,{className:"h-3 w-3 animate-spin text-muted-foreground/60"})]}),[0.95,0.7,0.85].map((t,r)=>G("div",{className:"flex items-center gap-2 rounded-md px-2 py-1.5",style:{opacity:1-r*0.18},children:[N("div",{className:"h-5 w-5 shrink-0 animate-pulse rounded-sm bg-muted/70"}),N("div",{className:"h-3 animate-pulse rounded bg-muted/70",style:{width:`${t*100}%`}})]},r))]}),Tf=({query:t,canCreate:r,onCreate:o})=>{let a=t.trim();return G("div",{className:"flex flex-col items-center gap-2 px-4 py-7 text-center",children:[N("span",{"aria-hidden":!0,className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted/60 text-muted-foreground/70",children:N(lt,{className:"h-4 w-4"})}),G("div",{className:"space-y-0.5",children:[N("p",{className:"text-[12px] font-medium text-foreground",children:a?G(Mn,{children:["No variables match"," ",G("span",{className:"font-mono text-foreground",children:['"',a,'"']})]}):"No variables yet"}),N("p",{className:"text-[10.5px] leading-snug text-muted-foreground",children:"Variables let you reuse secrets across connectors and rotate them in one place."})]}),r&&G(n,{type:"button",size:"sm",variant:"outline",onClick:o,className:"mt-1 h-7 text-[11px]",children:[N(We,{className:"h-3 w-3"}),a?`Create "${a.toUpperCase().replaceAll(/[^A-Z0-9_]/gu,"_")}"`:"Create variable"]})]})},kf=({options:t,optionsLoading:r,optionsFetching:o,value:a,query:s,onQueryChange:i,onSelect:l,onCreate:c,suggestedName:d,showCreate:u,onShowCreate:h})=>{if(u&&c)return N(Rf,{suggestedName:d??s.trim(),onSubmit:(y)=>{c(y)},onCancel:()=>{h(!1)}});let x=N(Sf,{options:t,value:a,onSelect:l});if(r)x=N(Pf,{});else if(t.length===0)x=N(Tf,{query:s,canCreate:Boolean(c),onCreate:()=>{h(!0)}});return G("div",{className:"flex flex-col",children:[G("div",{className:"relative flex items-center gap-2 border-b border-border/60 bg-muted/15 px-3 py-2",children:[N(Be,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/70"}),N("input",{autoFocus:!0,type:"text",value:s,onChange:(y)=>{i(y.target.value)},placeholder:"Search variables…",autoComplete:"off",spellCheck:!1,className:"flex-1 bg-transparent text-xs tracking-tight outline-none placeholder:text-muted-foreground/60"}),G("div",{className:"flex h-4 w-4 items-center justify-center",children:[o&&!r&&N(k,{className:"h-3 w-3 animate-spin text-muted-foreground/70"}),!o&&s&&N("button",{type:"button",onClick:()=>{i("")},"aria-label":"Clear search",className:"rounded p-0.5 text-muted-foreground/60 transition-colors hover:bg-muted hover:text-foreground",children:N(C,{className:"h-3 w-3"})})]})]}),N(ae,{shouldFilter:!1,className:"rounded-none bg-transparent",loop:!0,children:N(me,{className:"max-h-[280px] py-1",children:x})}),c&&G("button",{type:"button",onClick:()=>{h(!0)},className:"group/cta flex w-full items-center gap-2.5 border-t border-border/60 bg-gradient-to-r from-muted/30 to-muted/10 px-3 py-2.5 text-left text-xs transition-colors hover:from-muted/50 hover:to-muted/30",children:[N("span",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-primary/10 text-primary ring-1 ring-primary/15",children:N(We,{className:"h-3 w-3"})}),G("span",{className:"flex min-w-0 flex-1 flex-col",children:[N("span",{className:"text-[12px] font-medium leading-tight",children:"Create new variable"}),N("span",{className:"text-[10px] leading-tight text-muted-foreground",children:"Encrypted at rest · reusable across connectors"})]}),N(_e,{className:"h-3.5 w-3.5 text-muted-foreground/60 transition-transform group-hover/cta:translate-x-0.5"})]})]})},Lf=Vl(function({value:r,mode:o,onChange:a,onBlur:s,options:i,optionsLoading:l,optionsFetching:c,onSearch:d,onCreate:u,onResolve:h,onUpdate:x,suggestedName:y,placeholder:S="Select variable…",disabled:w=!1,masked:L=!0,className:z},B){let[E,O]=je(!1),[F,j]=je(""),[H,_]=je(!1),[J,Q]=je(!1),[W,se]=je(null),[ye,ve]=je(!1),[Re,Me]=je(!1),[Ae,be]=je(null),qe=yf(),he=Vr((X)=>{if(X===o)return;a("",X),_(!1),j("")},[o,a]),Oe=Vr((X)=>{a(X===r?"":X,"linked"),O(!1),_(!1)},[r,a]),U=Vr((X)=>{a(X,"inline")},[a]),ne=Vr(async(X)=>{if(!u)return;let it=await u(X);_(!1),O(!1),a(it.key,"linked")},[u,a]),ee=Vr(async()=>{if(!r||!h)return;Q(!0),ve(!0),be(null);try{let X=await h(r);se(X??{key:r,secret:!0,value:null})}catch(X){be(X instanceof Error?X.message:"Failed to load variable"),se({key:r,secret:!0,value:null})}ve(!1)},[r,h]),Ce=Vr(async(X)=>{if(!x||!r)return;Me(!0);try{await x({key:r,value:X}),Q(!1)}catch(it){throw Me(!1),it}Me(!1)},[x,r]),st=Vr((X)=>{j(X),d?.(X)},[d]),Se=i.find((X)=>X.key===r),mr=o==="linked"&&Boolean(r)&&Boolean(x);return G("div",{className:e("space-y-1.5",z),children:[G("div",{className:"flex items-center gap-1.5",children:[N("div",{className:"min-w-0 flex-1",children:o==="linked"?G(R,{open:E,onOpenChange:(X)=>{if(O(X),!X)_(!1),s?.()},modal:!0,children:[N(P,{asChild:!0,children:N(_l,{ref:B,selected:Se,value:r,placeholder:S,disabled:w,open:E,onOpen:()=>{O(!0)}})}),N(I,{className:"w-[--radix-popover-trigger-width] min-w-[300px] overflow-hidden border-border/80 p-0 shadow-xl",side:"bottom",align:"start",sideOffset:6,children:N(kf,{options:i,optionsLoading:Boolean(l),optionsFetching:Boolean(c),value:r,query:F,onQueryChange:st,onSelect:Oe,onCreate:u?ne:void 0,suggestedName:y,showCreate:H,onShowCreate:_})})]}):N(Cf,{inputId:qe,value:r,onChange:U,onBlur:()=>s?.(),placeholder:S||"Enter value",disabled:w,masked:L})}),mr&&G(R,{open:J,onOpenChange:(X)=>{if(Q(X),!X)se(null),be(null);else if(!W)ee()},modal:!0,children:[N(P,{asChild:!0,children:N(n,{type:"button",variant:"outline",size:"icon",disabled:w,"aria-label":"Edit linked variable value",title:"Edit linked variable value",className:"h-9 w-9 shrink-0 border-input text-muted-foreground hover:text-foreground",children:N(ct,{className:"h-3.5 w-3.5"})})}),G(I,{align:"end",side:"bottom",sideOffset:6,className:"w-80 p-0 shadow-lg",children:[Ae!==null&&Ae!==""&&N("div",{className:"border-b border-destructive/30 bg-destructive/5 px-3 py-2 text-[11px] text-destructive",children:Ae}),N(Nf,{variableKey:r,initialValue:W?.value??"",isSecret:W?.secret??!0,loading:ye,saving:Re,onSubmit:(X)=>{Ce(X)},onCancel:()=>{Q(!1)}},`${r}:${W?.value??""}`)]})]}),N(wf,{mode:o,onModeChange:he,disabled:w})]}),N("p",{className:"flex items-center gap-1.5 text-[10.5px] leading-tight text-muted-foreground/80",children:o==="linked"?G(Mn,{children:[N(Ct,{className:"h-3 w-3"}),N("span",{children:"Reads from an org variable. Rotate values in one place; every connector picks it up."})]}):G(Mn,{children:[N(ct,{className:"h-3 w-3"}),G("span",{children:["Stored inline on this connector. Use"," ",N("span",{className:"font-medium text-foreground/80",children:"Linked"})," ","to share across connectors."]})]})})]})});import{useMemo as Df}from"react";import{jsx as zo,jsxs as La}from"react/jsx-runtime";var Ef=(t)=>{let r="",o=0,a=" ",s=t.replaceAll(/>\s*</gu,`>
7
7
  <`).split(`
8
- `);for(let H of X){let W=H.trim();if(!W)continue;if(W.startsWith("</"))P=Math.max(0,P-1);if($+=`${Z.repeat(P)+W}
9
- `,W.startsWith("<")&&!W.startsWith("</")&&!W.startsWith("<?")&&!W.endsWith("/>")&&!/<\/[^>]+>$/u.test(W))P+=1}return $.trim()},wX=({open:M,onOpenChange:$,title:P="XML Viewer",data:Z})=>{let X=VX(()=>zX(Z??""),[Z]);return v5(n1,{open:M,onOpenChange:$,children:bM(a1,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[bM(s1,{className:"flex flex-row items-center justify-between gap-2",children:[v5(e1,{children:P}),bM(S,{type:"button",variant:"outline",size:"sm",onClick:()=>{navigator.clipboard.writeText(X),K1.success("Copied to clipboard")},children:[v5(x0,{className:"h-3.5 w-3.5 mr-1"}),"Copy"]})]}),v5("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md bg-muted p-4 text-xs font-mono whitespace-pre",children:X})]})})};import{jsx as q2,jsxs as gM}from"react/jsx-runtime";var TX=({title:M,children:$,details:P,className:Z,open:X,defaultOpen:H=!1,onOpenChange:W,classes:J})=>gM(j5,{variant:"destructive",className:f("border-destructive/25 bg-destructive/5","has-[>svg]:grid-cols-[1rem_minmax(0,1fr)]",J?.root,Z),children:[q2(E4,{"aria-hidden":"true"}),M!==void 0&&M!==null&&q2(x5,{className:f("line-clamp-none min-w-0 break-words text-foreground",J?.title),children:M}),q2(c5,{className:f("min-w-0 break-words",J?.message),children:$}),P!==void 0&&gM($2,{open:X,defaultOpen:H,onOpenChange:W,className:f("col-start-2 mt-3 min-w-0",J?.details),children:[gM(P2,{type:"button",className:f("group inline-flex max-w-full items-center gap-1.5 rounded-sm text-left","text-xs font-medium text-foreground underline-offset-4 hover:underline","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",J?.trigger),children:[q2(Y1,{"aria-hidden":"true",className:"size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-180 motion-reduce:transition-none"}),P.label]}),q2(Z2,{children:q2("div",{className:f("mt-3 min-w-0 rounded-md border border-border bg-background/70 p-3 text-sm text-foreground",J?.content),children:P.content})})]})]});import{jsx as l0,jsxs as CM,Fragment as _X}from"react/jsx-runtime";var R4=(M)=>Math.max(0,Math.min(100,Math.round(M))),uM=(M)=>R4(M.value??0),OX=(M)=>{if(M.length===0)return 0;return R4(M.reduce(($,P)=>$+uM(P),0)/M.length)},AX=({lane:M})=>{let $=M.fillClassName??"bg-primary";if(M.mode==="indeterminate")return CM(_X,{children:[l0("div",{className:f("absolute inset-y-0 w-1/3 rounded-full motion-reduce:w-full motion-reduce:opacity-40",$),"data-slot":"lane-progress-indeterminate",style:{animation:"lane-progress-indeterminate 1.35s linear infinite"}}),l0("style",{children:`@keyframes lane-progress-indeterminate {
8
+ `);for(let i of s){let l=i.trim();if(!l)continue;if(l.startsWith("</"))o=Math.max(0,o-1);if(r+=`${a.repeat(o)+l}
9
+ `,l.startsWith("<")&&!l.startsWith("</")&&!l.startsWith("<?")&&!l.endsWith("/>")&&!/<\/[^>]+>$/u.test(l))o+=1}return r.trim()},Mf=({open:t,onOpenChange:r,title:o="XML Viewer",data:a})=>{let s=Df(()=>Ef(a??""),[a]);return zo(M,{open:t,onOpenChange:r,children:La(D,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[La(V,{className:"flex flex-row items-center justify-between gap-2",children:[zo(T,{children:o}),La(n,{type:"button",variant:"outline",size:"sm",onClick:()=>{navigator.clipboard.writeText(s),K.success("Copied to clipboard")},children:[zo(te,{className:"h-3.5 w-3.5 mr-1"}),"Copy"]})]}),zo("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md bg-muted p-4 text-xs font-mono whitespace-pre",children:s})]})})};import{jsx as un,jsxs as Da}from"react/jsx-runtime";var If=({title:t,children:r,details:o,className:a,open:s,defaultOpen:i=!1,onOpenChange:l,classes:c})=>Da($e,{variant:"destructive",className:e("border-destructive/25 bg-destructive/5","has-[>svg]:grid-cols-[1rem_minmax(0,1fr)]",c?.root,a),children:[un(ut,{"aria-hidden":"true"}),t!==void 0&&t!==null&&un(Ye,{className:e("line-clamp-none min-w-0 break-words text-foreground",c?.title),children:t}),un(Ke,{className:e("min-w-0 break-words",c?.message),children:r}),o!==void 0&&Da(de,{open:s,defaultOpen:i,onOpenChange:l,className:e("col-start-2 mt-3 min-w-0",c?.details),children:[Da(fe,{type:"button",className:e("group inline-flex max-w-full items-center gap-1.5 rounded-sm text-left","text-xs font-medium text-foreground underline-offset-4 hover:underline","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",c?.trigger),children:[un(v,{"aria-hidden":"true",className:"size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-180 motion-reduce:transition-none"}),o.label]}),un(pe,{children:un("div",{className:e("mt-3 min-w-0 rounded-md border border-border bg-background/70 p-3 text-sm text-foreground",c?.content),children:o.content})})]})]});import{jsx as ur,jsxs as Ea,Fragment as Vf}from"react/jsx-runtime";var zl=(t)=>Math.max(0,Math.min(100,Math.round(t))),Ma=(t)=>zl(t.value??0),Af=(t)=>{if(t.length===0)return 0;return zl(t.reduce((r,o)=>r+Ma(o),0)/t.length)},Of=({lane:t})=>{let r=t.fillClassName??"bg-primary";if(t.mode==="indeterminate")return Ea(Vf,{children:[ur("div",{className:e("absolute inset-y-0 w-1/3 rounded-full motion-reduce:w-full motion-reduce:opacity-40",r),"data-slot":"lane-progress-indeterminate",style:{animation:"lane-progress-indeterminate 1.35s linear infinite"}}),ur("style",{children:`@keyframes lane-progress-indeterminate {
10
10
  0% { transform: translateX(-120%); }
11
11
  100% { transform: translateX(320%); }
12
12
  }
@@ -17,8 +17,8 @@ import{$ as q4,Ab as p$,Ac as ZM,Bc as XM,Cb as v$,Db as j$,Ec as o$,Fb as x$,Fc
17
17
  transform: none;
18
18
  width: 100%;
19
19
  }
20
- }`})]});return l0("div",{className:f("h-full transition-all",$),style:{width:`${uM(M)}%`}})},kX=({className:M,detail:$,label:P,lanes:Z})=>{let X=Z.some((W)=>W.mode==="indeterminate"),H=OX(Z);return CM("div",{className:f("flex w-full min-w-0 max-w-full flex-col gap-1.5",M),children:[CM("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-baseline gap-3",children:[l0("span",{className:"truncate text-xs font-medium",title:P,children:P}),$!==null&&$!==void 0&&$!==""?l0("span",{className:"shrink-0 text-[11px] text-muted-foreground",title:$,children:$}):null]}),l0("progress",{"aria-label":P,className:"sr-only",max:100,value:X?void 0:H}),l0("div",{"aria-hidden":"true",className:"flex h-2 w-full gap-0.5","data-slot":"lane-progress",children:Z.map((W,J)=>l0("div",{className:"relative min-w-0 flex-1 overflow-hidden rounded-full bg-muted","data-mode":W.mode??"determinate","data-slot":"lane-progress-lane","data-value":uM(W),children:l0(AX,{lane:W})},J))})]})};import*as y4 from"react";import{jsx as h,jsxs as _0}from"react/jsx-runtime";var D1=(M)=>Boolean(M)&&M!==0,EX=({context:M})=>h("div",{className:"sr-only","data-slot":"lifecycle-status-card-status","aria-live":"polite",children:M.statusLabel}),RX=({error:M})=>{let[$,P]=y4.useState(!1);return _0(j5,{variant:M.tone==="destructive"?"destructive":"default","data-slot":"lifecycle-status-card-error",children:[h(d5,{"aria-hidden":!0}),D1(M.title)?h(x5,{children:M.title}):null,_0(c5,{children:[D1(M.summary)?h("p",{children:M.summary}):null,D1(M.detail)?_0("div",{className:"mt-2 space-y-2",children:[h(S,{"aria-expanded":$,onClick:()=>{P((Z)=>!Z)},size:"sm",type:"button",variant:"link",children:$?"Hide details":"Show details"}),$?h("p",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/50 p-2 text-foreground",children:M.detail}):null]}):null]})]})},SX=(M)=>Object.prototype.toString.call(M)==="[object Function]",i0=(M,$)=>SX(M)?M($):M,DX=(M)=>{let $;if(M?.mode!=="indeterminate"){if(M?.value!==void 0)({value:$}=M);else if(M?.completed!==void 0&&M.total!==void 0&&M.total>0)$=Math.round(M.completed/M.total*100)}return $},yX=(M)=>{if(M==="danger")return"destructive";return M==="success"?"soft":"outline"},mX=(M)=>{switch(M){case"success":return"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900/60 dark:bg-emerald-950/30 dark:text-emerald-300";case"danger":return"border-destructive/25 bg-destructive/10 text-destructive";case"warning":return"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300";case"muted":return"border-border bg-muted text-muted-foreground";case void 0:case"active":case"default":return"border-primary/20 bg-primary/10 text-primary";default:return"border-primary/20 bg-primary/10 text-primary"}},IX=(M)=>{switch(M){case"success":return"bg-emerald-500";case"danger":return"bg-destructive";case"warning":return"bg-amber-500";case"muted":return"bg-muted-foreground";case void 0:case"active":case"default":return"bg-primary";default:return"bg-primary"}},bX=({model:M})=>h("span",{className:f("flex size-9 items-center justify-center rounded-md border",mX(M.tone)),children:h("span",{className:f("flex size-4 items-center justify-center",M.iconAnimated===!0&&"animate-spin"),"aria-hidden":!0,children:M.icon})}),gX=({model:M})=>{let{progress:$}=M,P=DX($),Z=$?.label??M.currentStep;if(!$&&!D1(Z))return null;return _0("div",{className:"space-y-2","data-slot":"lifecycle-status-card-progress",children:[_0("div",{className:"flex min-h-5 items-center justify-between gap-3 text-sm",children:[h("span",{className:"min-w-0 truncate text-muted-foreground",children:Z??"Waiting for updates"}),$?.completed!==void 0&&$.total!==void 0?_0("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:[$.completed," of ",$.total]}):null]}),P===void 0?_0("div",{"aria-label":"Progress",className:"relative h-2 overflow-hidden rounded-full bg-primary/15","data-progress-mode":"indeterminate",children:[h("div",{className:"absolute inset-y-0 w-1/3 rounded-full bg-primary/45",style:{animation:"lifecycle-status-card-indeterminate 1.35s ease-in-out infinite"}}),h("style",{children:`@keyframes lifecycle-status-card-indeterminate {
20
+ }`})]});return ur("div",{className:e("h-full transition-all",r),style:{width:`${Ma(t)}%`}})},Hf=({className:t,detail:r,label:o,lanes:a})=>{let s=a.some((l)=>l.mode==="indeterminate"),i=Af(a);return Ea("div",{className:e("flex w-full min-w-0 max-w-full flex-col gap-1.5",t),children:[Ea("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-baseline gap-3",children:[ur("span",{className:"truncate text-xs font-medium",title:o,children:o}),r!==null&&r!==void 0&&r!==""?ur("span",{className:"shrink-0 text-[11px] text-muted-foreground",title:r,children:r}):null]}),ur("progress",{"aria-label":o,className:"sr-only",max:100,value:s?void 0:i}),ur("div",{"aria-hidden":"true",className:"flex h-2 w-full gap-0.5","data-slot":"lane-progress",children:a.map((l,c)=>ur("div",{className:"relative min-w-0 flex-1 overflow-hidden rounded-full bg-muted","data-mode":l.mode??"determinate","data-slot":"lane-progress-lane","data-value":Ma(l),children:ur(Of,{lane:l})},c))})]})};import*as $l from"react";import{jsx as ie,jsxs as Jt}from"react/jsx-runtime";var Br=(t)=>Boolean(t)&&t!==0,Bf=({context:t})=>ie("div",{className:"sr-only","data-slot":"lifecycle-status-card-status","aria-live":"polite",children:t.statusLabel}),Ff=({error:t})=>{let[r,o]=$l.useState(!1);return Jt($e,{variant:t.tone==="destructive"?"destructive":"default","data-slot":"lifecycle-status-card-error",children:[ie(yt,{"aria-hidden":!0}),Br(t.title)?ie(Ye,{children:t.title}):null,Jt(Ke,{children:[Br(t.summary)?ie("p",{children:t.summary}):null,Br(t.detail)?Jt("div",{className:"mt-2 space-y-2",children:[ie(n,{"aria-expanded":r,onClick:()=>{o((a)=>!a)},size:"sm",type:"button",variant:"link",children:r?"Hide details":"Show details"}),r?ie("p",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/50 p-2 text-foreground",children:t.detail}):null]}):null]})]})},_f=(t)=>Object.prototype.toString.call(t)==="[object Function]",pr=(t,r)=>_f(t)?t(r):t,zf=(t)=>{let r;if(t?.mode!=="indeterminate"){if(t?.value!==void 0)({value:r}=t);else if(t?.completed!==void 0&&t.total!==void 0&&t.total>0)r=Math.round(t.completed/t.total*100)}return r},$f=(t)=>{if(t==="danger")return"destructive";return t==="success"?"soft":"outline"},Jf=(t)=>{switch(t){case"success":return"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900/60 dark:bg-emerald-950/30 dark:text-emerald-300";case"danger":return"border-destructive/25 bg-destructive/10 text-destructive";case"warning":return"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300";case"muted":return"border-border bg-muted text-muted-foreground";case void 0:case"active":case"default":return"border-primary/20 bg-primary/10 text-primary";default:return"border-primary/20 bg-primary/10 text-primary"}},jf=(t)=>{switch(t){case"success":return"bg-emerald-500";case"danger":return"bg-destructive";case"warning":return"bg-amber-500";case"muted":return"bg-muted-foreground";case void 0:case"active":case"default":return"bg-primary";default:return"bg-primary"}},Gf=({model:t})=>ie("span",{className:e("flex size-9 items-center justify-center rounded-md border",Jf(t.tone)),children:ie("span",{className:e("flex size-4 items-center justify-center",t.iconAnimated===!0&&"animate-spin"),"aria-hidden":!0,children:t.icon})}),Wf=({model:t})=>{let{progress:r}=t,o=zf(r),a=r?.label??t.currentStep;if(!r&&!Br(a))return null;return Jt("div",{className:"space-y-2","data-slot":"lifecycle-status-card-progress",children:[Jt("div",{className:"flex min-h-5 items-center justify-between gap-3 text-sm",children:[ie("span",{className:"min-w-0 truncate text-muted-foreground",children:a??"Waiting for updates"}),r?.completed!==void 0&&r.total!==void 0?Jt("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:[r.completed," of ",r.total]}):null]}),o===void 0?Jt("div",{"aria-label":"Progress",className:"relative h-2 overflow-hidden rounded-full bg-primary/15","data-progress-mode":"indeterminate",children:[ie("div",{className:"absolute inset-y-0 w-1/3 rounded-full bg-primary/45",style:{animation:"lifecycle-status-card-indeterminate 1.35s ease-in-out infinite"}}),ie("style",{children:`@keyframes lifecycle-status-card-indeterminate {
21
21
  0% { transform: translateX(-120%); }
22
22
  55% { transform: translateX(150%); }
23
23
  100% { transform: translateX(330%); }
24
- }`})]}):h(D4,{"aria-label":"Progress","data-progress-mode":"determinate",value:P})]})},CX=({milestones:M})=>{if(M===void 0||M.length===0)return null;return h("ol",{className:"space-y-3","data-slot":"lifecycle-status-card-milestones",children:M.map(($)=>_0("li",{className:"grid grid-cols-[auto_1fr] gap-3",children:[h("span",{"aria-hidden":!0,className:f("mt-1.5 size-2 rounded-full",IX($.tone))}),_0("div",{className:"min-w-0",children:[h("div",{className:"text-sm font-medium leading-5 text-foreground",children:$.label}),D1($.description)?h("div",{className:"text-sm leading-5 text-muted-foreground",children:$.description}):null]})]},$.id))})},uX=({context:M,slots:$})=>_0("div",{className:"grid grid-cols-[auto_1fr] gap-3 sm:grid-cols-[auto_1fr_auto]",children:[h("div",{className:"pt-0.5",children:i0($?.icon,M)??h(bX,{model:M.model})}),_0("div",{className:"min-w-0 space-y-1",children:[h("h3",{className:"text-[15px] font-semibold leading-6 text-foreground",children:i0($?.title,M)??M.title}),h("div",{className:"text-sm leading-6 text-muted-foreground",children:i0($?.description,M)??M.description})]}),h(x1,{className:"col-start-2 w-fit sm:col-start-auto",variant:yX(M.model.tone),children:M.statusLabel})]}),hX=({model:M,slots:$,className:P,...Z})=>{let X={description:M.description,model:M,statusLabel:M.statusLabel,title:M.title},H=i0($?.actions,X),W=i0($?.completedState,X)??M.completedState,J=h(N1,{className:f("w-full gap-0 overflow-hidden py-0",P),"data-status-tone":M.tone??"default",...Z,children:_0(S4,{className:"space-y-5 p-5 sm:p-6",children:[h(EX,{context:X}),i0($?.header,X)??h(uX,{context:X,slots:$}),i0($?.progressBody,X)??h(gX,{model:M}),i0($?.milestoneList,X)??h(CX,{milestones:M.milestones}),D1(W)?h("div",{"data-slot":"lifecycle-status-card-completed",children:W}):null,M.error?i0($?.errorPanel,X)??h(RX,{error:M.error}):null,D1(H)?h("div",{className:"flex min-h-9 flex-wrap items-center gap-2 border-t border-border pt-4","data-slot":"lifecycle-status-card-actions",children:H}):null]})});return $?.shell?$.shell({...X,children:J}):J};import*as b4 from"react";import{jsx as m4}from"react/jsx-runtime";var pX=({rows:M=5,rowClassName:$,className:P,...Z},X)=>m4("div",{ref:X,"aria-label":"Loading",className:f("flex flex-col gap-2",P),...Z,children:Array.from({length:M}).map((H,W)=>m4(I4,{className:f("h-10 w-full",$)},W))}),g4=b4.forwardRef(pX);g4.displayName="SkeletonRows";var vX=g4;import*as h4 from"react";import{jsx as h2,jsxs as C4}from"react/jsx-runtime";var p4=h4.forwardRef(function({icon:$,illustration:P,title:Z,description:X,action:H,secondaryAction:W,size:J="md",variant:Y="bare",className:Q,...U},G){let F=J==="sm",B=Boolean(P),q=!F&&!B,N=$??h2(u4,{className:"h-6 w-6"}),A=Boolean(X),w=Boolean(H)||Boolean(W),L=null;if(B)L=h2("div",{className:f("flex items-center justify-center","[&_svg]:w-auto",F?"mb-3 [&_svg]:h-16":"mb-5 [&_svg]:h-24"),children:P});else if(q)L=h2("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-md bg-(--bg-accent-soft) text-(--accent)",children:N});return C4("div",{ref:G,"data-slot":"empty-state","data-size":J,"data-variant":Y,className:f("mx-auto flex w-full max-w-130 flex-col items-center justify-center rounded-lg px-6 text-center",Y==="framed"&&"border border-dashed border-(--border-default)",F?"py-8":"px-8 py-14",Q),...U,children:[L,h2("h3",{className:f("font-semibold text-(--text-primary)",F?"text-[14px]":"text-[15px]"),children:Z}),A?h2("p",{className:f("mt-1 max-w-sm leading-relaxed text-(--text-secondary)",F?"text-[12px]":"text-[13px]"),children:X}):null,w?C4("div",{className:f("flex flex-wrap items-center justify-center gap-2",F?"mt-4":"mt-5"),children:[H,W]}):null]})});p4.displayName="EmptyState";var jX=p4;import*as v4 from"react";import{jsx as p0,jsxs as p2,Fragment as cX}from"react/jsx-runtime";var xX=(M)=>Object.prototype.toString.call(M)==="[object String]",j4=v4.forwardRef(function({title:$="Something went wrong",message:P,detail:Z,detailLabel:X="Show technical details",detailHeading:H="Inner error detail",defaultOpen:W=!1,className:J,...Y},Q){let U=Boolean(Z);return p0($2,{ref:Q,defaultOpen:W&&U,"data-slot":"technical-error-disclosure",className:f("rounded-md border border-destructive/25 bg-destructive/[0.035] p-4 text-sm","shadow-[inset_0_1px_0_rgba(255,255,255,0.48)]",J),...Y,children:p2("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-3",children:[p0("span",{className:"mt-0.5 flex size-7 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:p0(d5,{className:"size-4","aria-hidden":"true"})}),p2("div",{className:"min-w-0",children:[p0("div",{className:"font-semibold text-foreground",children:$}),p0("div",{className:"mt-1 leading-6 text-muted-foreground",children:P}),U?p2(cX,{children:[p2(P2,{className:f("group mt-3 inline-flex items-center gap-1.5 rounded-md","text-xs font-medium text-destructive underline-offset-4","transition-[color,transform] hover:underline","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-ring focus-visible:ring-offset-2","active:translate-y-px"),children:[p0(Y1,{className:"size-3.5 transition-transform group-data-[state=open]:rotate-180","aria-hidden":"true"}),X]}),p0(Z2,{children:p2("div",{className:"mt-3 rounded-md border border-destructive/15 bg-background/70 p-3",children:[p0("div",{className:"mb-2 text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:H}),xX(Z)?p0("pre",{className:"max-h-52 overflow-auto whitespace-pre-wrap break-words font-mono text-xs leading-5 text-foreground",children:Z}):p0("div",{className:"text-xs leading-5 text-foreground",children:Z})]})})]}):null]})]})})});j4.displayName="TechnicalErrorDisclosure";var dX=j4;import{jsx as hM,jsxs as oX}from"react/jsx-runtime";var rX=({icon:M,title:$="Loading...",className:P,spinnerSize:Z=30})=>oX("div",{className:f("min-h-screen flex flex-col items-center justify-center gap-6 bg-background",P),children:[M!==void 0&&M!==null&&M!==!1&&M!==""&&M!==0&&hM("div",{children:M}),hM("h1",{className:"text-2xl font-semibold text-center",children:$}),hM(u1,{size:Z})]}),lX=rX;import{jsx as r5,jsxs as tX}from"react/jsx-runtime";var iX=({children:M,className:$,classes:P,loading:Z=!1,coverImage:X})=>r5("div",{className:f("min-h-screen flex items-center justify-center",P?.root,$),children:tX("div",{className:f("flex flex-col md:flex-row w-full min-h-[100vh] max-h-[100vh] overflow-hidden",P?.content),children:[r5("div",{className:f("hidden md:flex flex-1 items-center justify-center overflow-hidden bg-black",P?.left),children:X}),r5("div",{className:f("flex-1 flex flex-col items-center justify-center gap-4 bg-background p-6 md:p-8",P?.right),children:Z?r5(u1,{size:48}):M})]})}),nX=iX;export{aX as useIsMobile,T2 as parseCron,$M as isValidCron,PM as getTimezoneOptions,sM as displayHeadingVariants,t2 as describeCron,O0 as defaultSimpleState,Z1 as buildCron,wX as XmlViewerDialog,LX as VariableReferenceField,YX as ValueRow,r2 as Typography,L4 as TreeSelect,d6 as TooltipBadge,a2 as TimezonePicker,sX as ThemeToggle,dX as TechnicalErrorDisclosure,$X as TechnicalDetailsPopover,Q8 as TableHead,b8 as SummaryList,g8 as SummaryItem,dZ as StepperTrigger,oZ as StepperTitle,lZ as StepperSeparator,iZ as StepperPanel,xZ as StepperNav,cZ as StepperItem,rZ as StepperIndicator,tZ as StepperContent,jZ as Stepper,CZ as StatusPill,j6 as StatusDot,yZ as StatTile,RZ as StageHeader,sZ as SplitButtonMenu,aZ as SplitButtonAction,nZ as SplitButton,nX as SplashScreenLayout,_Z as SortableList,vX as SkeletonRows,D6 as ShowMoreTag,b6 as SerifNumeral,X4 as SectionSwitcher,W8 as SectionHeader,vZ as SearchField,u6 as Ring,H3 as RadioCardOptionsBlock,p8 as RadioCardOption,H8 as PageTitle,P8 as PageRoot,r9 as ObjectSchemaExplorer,v9 as MutedPlaceholder,h9 as MaskedValue,y3 as MarkdownEditorPreviewToggle,m9 as MarkdownEditorPreview,C9 as LinkedItem,hX as LifecycleStatusCard,kX as LaneProgress,_6 as Kicker,b9 as JsonViewerDialog,UM as JsonViewer,T6 as IconTile,R3 as HierarchyTreeToggle,E3 as HierarchyTreeRow,k3 as HierarchyTreeHeader,_3 as HierarchyTreeBody,N9 as HierarchyTree,q9 as GuideStep,s6 as Grid,L6 as FormattedNumber,t6 as FormFrame,Y9 as FlowStep,f9 as FlowBranch,J9 as FlowBand,Z9 as FilterChips,M9 as FileDropArea,o8 as FieldRow,K6 as ErrorMessage,TX as ErrorAlert,jX as EmptyState,Q6 as DisplayHeading,W6 as DateInput,r8 as CurrencyInput,S8 as CronBuilder,I8 as CoverImage,f6 as CopyButton,EZ as ConfirmDialog,x8 as CommandStep,G6 as CollectiveIntelligenceLoader,C8 as ChoiceCardGroup,u8 as ChoiceCard,v8 as CheckboxCardOption,X3 as CardOptionsBlock,M5 as CardOption,q8 as ArrayInput,lX as AppLoadingLayout,P6 as AddItemButton,e4 as ActionButton};
24
+ }`})]}):ie(Lt,{"aria-label":"Progress","data-progress-mode":"determinate",value:o})]})},Xf=({milestones:t})=>{if(t===void 0||t.length===0)return null;return ie("ol",{className:"space-y-3","data-slot":"lifecycle-status-card-milestones",children:t.map((r)=>Jt("li",{className:"grid grid-cols-[auto_1fr] gap-3",children:[ie("span",{"aria-hidden":!0,className:e("mt-1.5 size-2 rounded-full",jf(r.tone))}),Jt("div",{className:"min-w-0",children:[ie("div",{className:"text-sm font-medium leading-5 text-foreground",children:r.label}),Br(r.description)?ie("div",{className:"text-sm leading-5 text-muted-foreground",children:r.description}):null]})]},r.id))})},Uf=({context:t,slots:r})=>Jt("div",{className:"grid grid-cols-[auto_1fr] gap-3 sm:grid-cols-[auto_1fr_auto]",children:[ie("div",{className:"pt-0.5",children:pr(r?.icon,t)??ie(Gf,{model:t.model})}),Jt("div",{className:"min-w-0 space-y-1",children:[ie("h3",{className:"text-[15px] font-semibold leading-6 text-foreground",children:pr(r?.title,t)??t.title}),ie("div",{className:"text-sm leading-6 text-muted-foreground",children:pr(r?.description,t)??t.description})]}),ie(ue,{className:"col-start-2 w-fit sm:col-start-auto",variant:$f(t.model.tone),children:t.statusLabel})]}),Kf=({model:t,slots:r,className:o,...a})=>{let s={description:t.description,model:t,statusLabel:t.statusLabel,title:t.title},i=pr(r?.actions,s),l=pr(r?.completedState,s)??t.completedState,c=ie(oe,{className:e("w-full gap-0 overflow-hidden py-0",o),"data-status-tone":t.tone??"default",...a,children:Jt(Rt,{className:"space-y-5 p-5 sm:p-6",children:[ie(Bf,{context:s}),pr(r?.header,s)??ie(Uf,{context:s,slots:r}),pr(r?.progressBody,s)??ie(Wf,{model:t}),pr(r?.milestoneList,s)??ie(Xf,{milestones:t.milestones}),Br(l)?ie("div",{"data-slot":"lifecycle-status-card-completed",children:l}):null,t.error?pr(r?.errorPanel,s)??ie(Ff,{error:t.error}):null,Br(i)?ie("div",{className:"flex min-h-9 flex-wrap items-center gap-2 border-t border-border pt-4","data-slot":"lifecycle-status-card-actions",children:i}):null]})});return r?.shell?r.shell({...s,children:c}):c};import*as jl from"react";import{jsx as Jl}from"react/jsx-runtime";var Yf=({rows:t=5,rowClassName:r,className:o,...a},s)=>Jl("div",{ref:s,"aria-label":"Loading",className:e("flex flex-col gap-2",o),...a,children:Array.from({length:t}).map((i,l)=>Jl(He,{className:e("h-10 w-full",r)},l))}),Gl=jl.forwardRef(Yf);Gl.displayName="SkeletonRows";var qf=Gl;import*as Xl from"react";import{jsx as In,jsxs as Wl}from"react/jsx-runtime";var Ul=Xl.forwardRef(function({icon:r,illustration:o,title:a,description:s,action:i,secondaryAction:l,size:c="md",variant:d="bare",className:u,...h},x){let y=c==="sm",S=Boolean(o),w=!y&&!S,L=r??In(yo,{className:"h-6 w-6"}),z=Boolean(s),B=Boolean(i)||Boolean(l),E=null;if(S)E=In("div",{className:e("flex items-center justify-center","[&_svg]:w-auto",y?"mb-3 [&_svg]:h-16":"mb-5 [&_svg]:h-24"),children:o});else if(w)E=In("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-md bg-(--bg-accent-soft) text-(--accent)",children:L});return Wl("div",{ref:x,"data-slot":"empty-state","data-size":c,"data-variant":d,className:e("mx-auto flex w-full max-w-130 flex-col items-center justify-center rounded-lg px-6 text-center",d==="framed"&&"border border-dashed border-(--border-default)",y?"py-8":"px-8 py-14",u),...h,children:[E,In("h3",{className:e("font-semibold text-(--text-primary)",y?"text-[14px]":"text-[15px]"),children:a}),z?In("p",{className:e("mt-1 max-w-sm leading-relaxed text-(--text-secondary)",y?"text-[12px]":"text-[13px]"),children:s}):null,B?Wl("div",{className:e("flex flex-wrap items-center justify-center gap-2",y?"mt-4":"mt-5"),children:[i,l]}):null]})});Ul.displayName="EmptyState";var Zf=Ul;import*as Kl from"react";import{jsx as ar,jsxs as An,Fragment as eg}from"react/jsx-runtime";var Qf=(t)=>Object.prototype.toString.call(t)==="[object String]",Yl=Kl.forwardRef(function({title:r="Something went wrong",message:o,detail:a,detailLabel:s="Show technical details",detailHeading:i="Inner error detail",defaultOpen:l=!1,className:c,...d},u){let h=Boolean(a);return ar(de,{ref:u,defaultOpen:l&&h,"data-slot":"technical-error-disclosure",className:e("rounded-md border border-destructive/25 bg-destructive/[0.035] p-4 text-sm","shadow-[inset_0_1px_0_rgba(255,255,255,0.48)]",c),...d,children:An("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-3",children:[ar("span",{className:"mt-0.5 flex size-7 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:ar(yt,{className:"size-4","aria-hidden":"true"})}),An("div",{className:"min-w-0",children:[ar("div",{className:"font-semibold text-foreground",children:r}),ar("div",{className:"mt-1 leading-6 text-muted-foreground",children:o}),h?An(eg,{children:[An(fe,{className:e("group mt-3 inline-flex items-center gap-1.5 rounded-md","text-xs font-medium text-destructive underline-offset-4","transition-[color,transform] hover:underline","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-ring focus-visible:ring-offset-2","active:translate-y-px"),children:[ar(v,{className:"size-3.5 transition-transform group-data-[state=open]:rotate-180","aria-hidden":"true"}),s]}),ar(pe,{children:An("div",{className:"mt-3 rounded-md border border-destructive/15 bg-background/70 p-3",children:[ar("div",{className:"mb-2 text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:i}),Qf(a)?ar("pre",{className:"max-h-52 overflow-auto whitespace-pre-wrap break-words font-mono text-xs leading-5 text-foreground",children:a}):ar("div",{className:"text-xs leading-5 text-foreground",children:a})]})})]}):null]})]})})});Yl.displayName="TechnicalErrorDisclosure";var tg=Yl;import{jsx as Ia,jsxs as ng}from"react/jsx-runtime";var rg=({icon:t,title:r="Loading...",className:o,spinnerSize:a=30})=>ng("div",{className:e("min-h-screen flex flex-col items-center justify-center gap-6 bg-background",o),children:[t!==void 0&&t!==null&&t!==!1&&t!==""&&t!==0&&Ia("div",{children:t}),Ia("h1",{className:"text-2xl font-semibold text-center",children:r}),Ia(Ge,{size:a})]}),og=rg;import{jsx as $o,jsxs as sg}from"react/jsx-runtime";var ag=({children:t,className:r,classes:o,loading:a=!1,coverImage:s})=>$o("div",{className:e("min-h-screen flex items-center justify-center",o?.root,r),children:sg("div",{className:e("flex flex-col md:flex-row w-full min-h-[100vh] max-h-[100vh] overflow-hidden",o?.content),children:[$o("div",{className:e("hidden md:flex flex-1 items-center justify-center overflow-hidden bg-black",o?.left),children:s}),$o("div",{className:e("flex-1 flex flex-col items-center justify-center gap-4 bg-background p-6 md:p-8",o?.right),children:a?$o(Ge,{size:48}):t})]})}),ig=ag;export{lc as ActionButton,uc as AddItemButton,og as AppLoadingLayout,Rd as ArrayInput,Kn as CardOption,Is as CardOptionsBlock,Kd as CheckboxCardOption,Wd as ChoiceCard,Gd as ChoiceCardGroup,wc as CollectiveIntelligenceLoader,qd as CommandStep,Vm as ConfirmDialog,xc as CopyButton,$d as CoverImage,Bd as CronBuilder,eu as CurrencyInput,gc as DateInput,hc as DisplayHeading,Zf as EmptyState,If as ErrorAlert,Cc as ErrorMessage,tu as FieldRow,cu as FileDropArea,pu as FilterChips,bu as FlowBand,xu as FlowBranch,vu as FlowStep,od as FormFrame,Tc as FormattedNumber,id as Grid,Ru as GuideStep,Pu as HierarchyTree,qs as HierarchyTreeBody,Ys as HierarchyTreeHeader,Zs as HierarchyTreeRow,Qs as HierarchyTreeToggle,Ec as IconTile,sa as JsonViewer,Ju as JsonViewerDialog,Oc as Kicker,Gu as LabeledField,Hf as LaneProgress,Kf as LifecycleStatusCard,Wu as LinkedItem,zu as MarkdownEditorPreview,ei as MarkdownEditorPreviewToggle,Uu as MaskedValue,Yu as MutedPlaceholder,tp as ObjectSchemaExplorer,ud as PageRoot,fd as PageTitle,Ud as RadioCardOption,As as RadioCardOptionsBlock,Wc as Ring,Ym as SearchField,gd as SectionHeader,Tl as SectionSwitcher,Jc as SerifNumeral,Fc as ShowMoreTag,qf as SkeletonRows,Hm as SortableList,ig as SplashScreenLayout,sf as SplitButton,lf as SplitButtonAction,cf as SplitButtonMenu,Bm as StageHeader,zm as StatTile,Yc as StatusDot,Wm as StatusPill,qm as Stepper,af as StepperContent,tf as StepperIndicator,Qm as StepperItem,Zm as StepperNav,of as StepperPanel,nf as StepperSeparator,rf as StepperTitle,ef as StepperTrigger,jd as SummaryItem,Jd as SummaryList,hd as TableHead,pf as TechnicalDetailsPopover,tg as TechnicalErrorDisclosure,no as ThemeToggle,Wn as TimezonePicker,Qc as TooltipBadge,Il as TreeSelect,_n as Typography,xf as ValueRow,Lf as VariableReferenceField,Mf as XmlViewerDialog,wr as buildCron,Vt as defaultSimpleState,jn as describeCron,Xa as displayHeadingVariants,Qo as getTimezoneOptions,Zo as isValidCron,xn as parseCron,vt as useIsMobile};