trybeacon 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +17 -17
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/code-graph/route.js +1 -1
- package/.next/server/app/api/code-graph/route.js.nft.json +1 -1
- package/.next/server/app/api/context/feature/route.js +1 -1
- package/.next/server/app/api/context/feature/route.js.nft.json +1 -1
- package/.next/server/app/api/context/file/route.js +1 -1
- package/.next/server/app/api/context/file/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/activate/route.js +1 -1
- package/.next/server/app/api/workspace/activate/route.js.nft.json +1 -1
- package/.next/server/app/apple-icon.png/route.js +1 -1
- package/.next/server/app/apple-icon.png/route.js.nft.json +1 -1
- package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/docs.html +1 -1
- package/.next/server/app/docs.rsc +3 -3
- package/.next/server/app/docs.segments/_full.segment.rsc +3 -3
- package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_index.segment.rsc +2 -2
- package/.next/server/app/docs.segments/_tree.segment.rsc +3 -3
- package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
- package/.next/server/app/feedback.html +1 -1
- package/.next/server/app/feedback.rsc +2 -2
- package/.next/server/app/feedback.segments/_full.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/_index.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
- package/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/.next/server/app/help.html +1 -1
- package/.next/server/app/help.rsc +19 -20
- package/.next/server/app/help.segments/_full.segment.rsc +19 -20
- package/.next/server/app/help.segments/_head.segment.rsc +1 -1
- package/.next/server/app/help.segments/_index.segment.rsc +2 -2
- package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/help.segments/help.segment.rsc +1 -1
- package/.next/server/app/icon.svg/route.js +1 -1
- package/.next/server/app/icon.svg/route.js.nft.json +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +4 -4
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +3 -3
- package/.next/server/app/map/page.js +2 -2
- package/.next/server/app/map/page.js.nft.json +1 -1
- package/.next/server/app/map/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/plan/page.js +2 -2
- package/.next/server/app/plan/page.js.nft.json +1 -1
- package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +17 -17
- package/.next/server/chunks/1130.js +1 -1
- package/.next/server/chunks/1172.js +1 -0
- package/.next/server/chunks/1813.js +1 -0
- package/.next/server/chunks/{299.js → 29.js} +2 -2
- package/.next/server/chunks/2933.js +2 -2
- package/.next/server/chunks/3777.js +1 -0
- package/.next/server/chunks/4490.js +1 -1
- package/.next/server/instrumentation.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/8319-67498a0aab3f714f.js +1 -0
- package/.next/static/chunks/8811-57b200845c2e1f2d.js +1 -0
- package/.next/static/chunks/app/map/{page-621463528037d2d0.js → page-7c6a7f7b53bcc669.js} +1 -1
- package/.next/static/chunks/app/page-ccb55081f850db63.js +1 -0
- package/.next/static/chunks/app/plan/{page-95a91a84bb930fc3.js → page-d281cb104d352713.js} +1 -1
- package/.next/static/css/c1d125c7e7e0530c.css +1 -0
- package/.next/static/css/e63457bec0b3ee27.css +1 -0
- package/.next/trace +37 -37
- package/.next/trace-build +1 -1
- package/package.json +1 -1
- package/.next/server/chunks/3530.js +0 -1
- package/.next/server/chunks/389.js +0 -1
- package/.next/server/chunks/5592.js +0 -1
- package/.next/server/chunks/814.js +0 -1
- package/.next/static/chunks/5916-65b61f02167fdaa0.js +0 -1
- package/.next/static/chunks/6946-4322e809b92dc543.js +0 -1
- package/.next/static/chunks/app/page-e0a78bc449569419.js +0 -1
- package/.next/static/css/5f11ad1787eeef64.css +0 -1
- package/.next/static/css/fb92764fca78149e.css +0 -1
- /package/.next/static/{gRhUG5vdhfWUACit2_jxj → vkXAuKrDgeKgSM-4XYCAy}/_buildManifest.js +0 -0
- /package/.next/static/{gRhUG5vdhfWUACit2_jxj → vkXAuKrDgeKgSM-4XYCAy}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5916],{4474:(e,t,s)=>{s.d(t,{$:()=>i});var n=s(95155),a=s(6539),r=s(18460),l=s(91337);let o=(0,r.F)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function i({className:e,variant:t="default",size:s="default",...r}){return(0,n.jsx)(a.Button,{"data-slot":"button",className:(0,l.cn)(o({variant:t,size:s,className:e})),...r})}},18874:(e,t,s)=>{s.d(t,{F1:()=>o,e6:()=>r,qA:()=>a,ru:()=>l});let n={auth:"#4ea1ff",firms:"#c792ea",search:"#7bd389",storage:"#ffb86b",petitions:"#ff7a45",monitoring:"#f5b942",admin:"#ff6b9d"};function a(e){return e&&n[e]||"#8a8a8a"}let r={GET:"#7bd389",POST:"#4ea1ff",PUT:"#ffb86b",PATCH:"#ffb86b",DELETE:"#ff3860"},l={read:"#4ea1ff",write:"#ffb86b","read-write":"#c792ea"};function o(e,t){let s=new Set([e]);for(let n of t)n.source===e&&s.add(n.target),n.target===e&&s.add(n.source);return s}},26518:(e,t,s)=>{s.d(t,{bq:()=>w,eb:()=>C,gC:()=>k,l6:()=>y,yv:()=>N});var n=s(95155);s(12115);var a=s(40595),r=s(41294),l=s(75681),o=s(17314),i=s(37265),d=s(23107),c=s(70826),u=s(67564),m=s(1938),p=s(15433),x=s(5919),h=s(45450),f=s(88988),g=s(91337),b=s(12363),v=s(64577),j=s(94088);let y=a.H;function N({className:e,...t}){return(0,n.jsx)(r.y,{"data-slot":"select-value",className:(0,g.cn)("flex flex-1 text-left",e),...t})}function w({className:e,size:t="default",children:s,...a}){return(0,n.jsxs)(l.b,{"data-slot":"select-trigger","data-size":t,className:(0,g.cn)("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[s,(0,n.jsx)(o.w,{render:(0,n.jsx)(b.A,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function k({className:e,children:t,side:s="bottom",sideOffset:a=4,align:r="center",alignOffset:l=0,alignItemWithTrigger:o=!0,...m}){return(0,n.jsx)(i.V,{children:(0,n.jsx)(d.l,{side:s,sideOffset:a,align:r,alignOffset:l,alignItemWithTrigger:o,className:"isolate z-50",children:(0,n.jsxs)(c.t,{"data-slot":"select-content","data-align-trigger":o,className:(0,g.cn)("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...m,children:[(0,n.jsx)(E,{}),(0,n.jsx)(u.B,{children:t}),(0,n.jsx)(S,{})]})})})}function C({className:e,children:t,...s}){return(0,n.jsxs)(m.e,{"data-slot":"select-item",className:(0,g.cn)("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...s,children:[(0,n.jsx)(p.h,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),(0,n.jsx)(x.h,{render:(0,n.jsx)("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:(0,n.jsx)(v.A,{className:"pointer-events-none"})})]})}function E({className:e,...t}){return(0,n.jsx)(h.w,{"data-slot":"select-scroll-up-button",className:(0,g.cn)("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:(0,n.jsx)(j.A,{})})}function S({className:e,...t}){return(0,n.jsx)(f.d,{"data-slot":"select-scroll-down-button",className:(0,g.cn)("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:(0,n.jsx)(b.A,{})})}},26856:(e,t,s)=>{s.d(t,{DbMapClient:()=>Q});var n=s(95155),a=s(12115),r=s(73321),l=s(81750),o=s(6266);s(53255);var i=s(81499),d=s(51128),c=s(65738),u=s(9005),m=s(2125),p=s(91337),x=s(18874);let h=(0,a.createContext)(null);function f(){let e=(0,a.useContext)(h);if(!e)throw Error("useDbEdit must be used inside DbEditContext");return e}var g=s(95635);let b={danger:"bg-red-500/15 text-red-300",warn:"bg-amber-500/15 text-amber-300"};function v({badges:e,className:t}){return e.length?(0,n.jsx)("span",{className:(0,p.cn)("flex shrink-0 items-center gap-0.5",t),children:e.map(e=>(0,n.jsx)("span",{title:e.title,className:(0,p.cn)("rounded px-1 text-[8px] font-semibold uppercase tracking-wide",b[e.tone]),children:e.label},e.label))}):null}let j=/pass(word)?|token|secret|api[_-]?key|credential|priv(ate)?[_-]?key|hash|salt/i,y=/auth|login|logout|session|token|password|oauth|sso|credential/i,N="nodrag nopan",w=g.x,k="nodrag nopan",C=["GET","POST","PUT","PATCH","DELETE"];var E=s(32133),S=s(82099),A=s(4474);let z=[{id:"claude",label:"Prompt p/ Claude Code",fn:function(e){let t=["Implement this database schema in this project, following its existing stack and conventions:",""];for(let s of e.tables){let e=`Table \`${s.name}\``+(s.domain?` (domain: ${s.domain})`:"")+(s.description?` — ${s.description}`:"");for(let n of(t.push(e),s.columns)){let e=[n.isPk&&"PK",n.isFk&&"FK",!1===n.nullable&&"NOT NULL"].filter(Boolean).join(", ");t.push(` - ${n.name}: ${n.type}`+(e?` [${e}]`:"")+(n.note?` — ${n.note}`:""))}t.push("")}if(e.relations.length){for(let s of(t.push("Foreign keys:"),e.relations))t.push(` - ${s.fromTable}.${s.fromColumn} -> ${s.toTable}.${s.toColumn}`);t.push("")}return t.push("Create the models/migrations using the project's existing ORM and patterns, wire the relationships, and keep table and column names exactly as given."),t.join("\n")}},{id:"dbml",label:"DBML",fn:function(e){let t=[];for(let s of e.tables){for(let e of(t.push(`Table ${s.name} {`),s.columns)){let s=[e.isPk&&"pk",!1===e.nullable&&!e.isPk&&"not null",e.note&&`note: '${e.note.replace(/'/g,"")}'`].filter(Boolean).join(", ");t.push(` ${e.name} ${e.type}`+(s?` [${s}]`:""))}t.push("}","")}for(let s of e.relations)t.push(`Ref: ${s.fromTable}.${s.fromColumn} > ${s.toTable}.${s.toColumn}`);return t.join("\n").trim()}},{id:"sql",label:"SQL DDL",fn:function(e){let t=[];for(let s of e.tables){t.push(`CREATE TABLE ${s.name} (`);let n=s.columns.map(e=>{let t=[` ${e.name} ${e.type}`];return e.isPk?t.push("PRIMARY KEY"):!1===e.nullable&&t.push("NOT NULL"),t.join(" ")}),a=e.relations.filter(e=>e.fromTable===s.name).map(e=>` FOREIGN KEY (${e.fromColumn}) REFERENCES ${e.toTable}(${e.toColumn})`);t.push([...n,...a].join(",\n")),t.push(");","")}return t.join("\n").trim()}}];function T({draftGraph:e}){let[t,s]=(0,a.useState)(null);if(0===e.tables.length)return null;async function r(t){await navigator.clipboard.writeText(t.fn(e)).catch(()=>{}),s(t.id),setTimeout(()=>s(null),1500)}return(0,n.jsxs)("div",{className:"space-y-2 rounded-xl border border-sky-400/20 bg-sky-500/[0.04] p-3",children:[(0,n.jsxs)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-sky-300",children:["Rascunho \xb7 ",e.tables.length," tabelas"]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,n.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"copiar:"}),z.map(e=>(0,n.jsx)(A.$,{size:"sm",variant:"outline",className:"h-6 px-2 text-[11px]",onClick:()=>r(e),children:t===e.id?"✓":e.label},e.id))]})]})}function I({selected:e,tables:t,relations:s,endpoints:a,draftGraph:r,onClose:l,commentsContent:o,commentsCount:i=0,activeTab:d,onTabChange:c,onAddComment:m,topOffset:p}){let x,h,f=new Map(t.map(e=>[e.id,e.name])),g=!!o,b=d??"details",v=e?.kind==="table"?t.find(t=>t.id===e.id)?.name??null:e?.kind==="endpoint"&&(h=a.find(t=>t.id===e.id))?`${h.method} ${h.path}`:null;if(e?.kind==="table"){let r=t.find(t=>t.id===e.id);x=r?(0,n.jsx)(D,{table:r,relations:s,endpoints:a,nameById:f}):null}else if(e?.kind==="endpoint"){let t=a.find(t=>t.id===e.id);x=t?(0,n.jsx)(M,{ep:t,nameById:f}):null}else x=(0,n.jsx)($,{tables:t,relations:s,endpoints:a});return(0,n.jsxs)(S.b,{className:"absolute bottom-3 right-3 z-10 flex w-80 flex-col rounded-2xl",style:{top:p??12},children:[g?(0,n.jsxs)("div",{className:"flex items-center justify-between border-b border-white/10 px-1 py-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,n.jsx)(R,{active:"details"===b,onClick:()=>c?.("details"),children:"Details"}),(0,n.jsxs)(R,{active:"comments"===b,onClick:()=>c?.("comments"),children:["Comments",i>0&&(0,n.jsx)("span",{className:"ml-1 rounded-full bg-white/10 px-1 text-[9px] font-semibold leading-4",children:i})]})]}),(0,n.jsx)("button",{onClick:l,title:"Close panel",className:"mr-1 rounded-md p-1 text-muted-foreground transition-colors hover:bg-white/10 hover:text-foreground",children:(0,n.jsx)(u.A,{className:"size-4"})})]}):(0,n.jsxs)("div",{className:"flex items-center justify-between border-b border-white/10 px-3.5 py-2.5",children:[(0,n.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Panel"}),(0,n.jsx)("button",{onClick:l,title:"Close panel",className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-white/10 hover:text-foreground",children:(0,n.jsx)(u.A,{className:"size-4"})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto",children:"comments"===b&&g?(0,n.jsx)("div",{className:"p-3",children:o}):(0,n.jsxs)(n.Fragment,{children:[r.tables.length>0&&(0,n.jsx)("div",{className:"border-b border-white/10 p-3.5",children:(0,n.jsx)(T,{draftGraph:r})}),(0,n.jsxs)("div",{className:"p-4",children:[m&&v&&(0,n.jsxs)("button",{type:"button",onClick:()=>m(v),className:"mb-3 flex w-full items-center justify-center gap-1.5 rounded-lg border border-white/10 bg-white/[0.03] px-3 py-1.5 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground",children:[(0,n.jsx)(E.A,{className:"size-3.5"}),"Comment on this ",e?.kind==="endpoint"?"endpoint":"table"]}),x]})]})})]})}function R({active:e,onClick:t,children:s}){return(0,n.jsx)("button",{type:"button",onClick:t,className:(0,p.cn)("flex items-center gap-1 rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors",e?"bg-white/10 text-foreground":"text-muted-foreground hover:text-foreground"),children:s})}function D({table:e,relations:t,endpoints:s,nameById:a}){let r=t.filter(t=>t.fromTableId===e.id),l=t.filter(t=>t.toTableId===e.id),o=s.map(t=>({e:t,u:t.tables.find(t=>t.tableId===e.id)})).filter(e=>e.u);return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs uppercase tracking-wide",style:{color:(0,x.qA)(e.domain)},children:e.domain??"table"}),(0,n.jsx)("h2",{className:"font-mono text-lg font-semibold",children:e.name}),e.description&&(0,n.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e.description})]}),(0,n.jsx)(P,{title:`Columns (${e.columns.length})`,children:(0,n.jsx)("ul",{className:"space-y-0.5",children:e.columns.map(e=>(0,n.jsxs)("li",{className:"flex items-center gap-1.5 text-xs",children:[e.isPk?(0,n.jsx)(i.A,{className:"size-3 text-amber-400"}):e.isFk?(0,n.jsx)(d.A,{className:"size-3 text-sky-400"}):(0,n.jsx)("span",{className:"size-3"}),(0,n.jsx)("span",{className:"font-mono",children:e.name}),(0,n.jsxs)("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground",children:[e.type,!e.nullable&&" \xb7NN"]})]},e.name))})}),r.length>0&&(0,n.jsx)(P,{title:"References (FK out)",children:(0,n.jsx)("ul",{className:"space-y-1 text-xs",children:r.map(e=>(0,n.jsxs)("li",{className:"font-mono text-muted-foreground",children:[e.fromColumn," → ",a.get(e.toTableId),".",e.toColumn]},e.id))})}),l.length>0&&(0,n.jsx)(P,{title:"Referenced by (FK in)",children:(0,n.jsx)("ul",{className:"space-y-1 text-xs",children:l.map(e=>(0,n.jsxs)("li",{className:"font-mono text-muted-foreground",children:[a.get(e.fromTableId),".",e.fromColumn]},e.id))})}),o.length>0&&(0,n.jsx)(P,{title:`Used by endpoints (${o.length})`,children:(0,n.jsx)("ul",{className:"space-y-1 text-xs",children:o.map(({e,u:t})=>(0,n.jsxs)("li",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{style:{color:x.e6[e.method]},className:"font-bold",children:e.method}),(0,n.jsx)("span",{className:"truncate font-mono",children:e.path}),(0,n.jsx)("span",{className:"ml-auto",style:{color:x.ru[t.access]},children:t.access})]},e.id))})})]})}function M({ep:e,nameById:t}){return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"rounded px-1.5 py-0.5 text-[11px] font-bold",style:{background:`${x.e6[e.method]}22`,color:x.e6[e.method]},children:e.method}),(0,n.jsx)("h2",{className:"mt-2 font-mono text-base font-semibold",children:e.path}),e.description&&(0,n.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e.description})]}),(0,n.jsx)(P,{title:`Tables used (${e.tables.length})`,children:(0,n.jsx)("ul",{className:"space-y-1 text-xs",children:e.tables.map(e=>(0,n.jsxs)("li",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"font-mono",children:t.get(e.tableId)}),(0,n.jsx)("span",{className:"ml-auto",style:{color:x.ru[e.access]},children:e.access})]},e.tableId))})})]})}function $({tables:e,relations:t,endpoints:s}){return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-sm font-semibold",children:"Database"}),(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Live schema derived from your code. Click a table or endpoint to see details. Drag to rearrange — positions are saved."})]}),(0,n.jsxs)("dl",{className:"grid grid-cols-3 gap-2 text-center",children:[(0,n.jsx)(L,{label:"tables",value:e.length}),(0,n.jsx)(L,{label:"FKs",value:t.length}),(0,n.jsx)(L,{label:"endpoints",value:s.length})]}),(0,n.jsx)(P,{title:"Legend",children:(0,n.jsxs)("ul",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,n.jsxs)("li",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(i.A,{className:"size-3 text-amber-400"})," primary key"]}),(0,n.jsxs)("li",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(d.A,{className:"size-3 text-sky-400"})," foreign key"]}),(0,n.jsx)("li",{children:"— gray line: FK relation between tables"}),(0,n.jsx)("li",{children:"– – dashed line: endpoint uses table (read/write)"})]})})]})}function P({title:e,children:t}){return(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:e}),t]})}function L({label:e,value:t}){return(0,n.jsxs)("div",{className:"rounded-lg border border-white/10 bg-white/[0.03] py-2",children:[(0,n.jsx)("div",{className:"text-lg font-semibold",children:t}),(0,n.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e})]})}var O=s(56614),F=s(62311);let _=new Set(["GET","HEAD","OPTIONS"]),H=e=>e.trim().toLowerCase();var B=s(80846),U=s(17356),K=s(45486),X=s(15330),G=s(60976),Z=s(64577),Y=s(57144);let W={dbTable:function({id:e,data:t,selected:s}){var r;let l,o,h="DRAFT"===t.source,g="added"===t.diffStatus?"#7bd389":"modified"===t.diffStatus?"#ffb86b":"#4ea1ff",b="added"===t.diffStatus?"new":"modified"===t.diffStatus?"changed":"draft",y=t.diffChanges?.length?t.diffChanges.join("\n"):"draft",k=h?g:(0,x.qA)(t.domain),C=(r={domain:t.domain,columns:t.columns},l=[],(o=r.columns.filter(e=>j.test(e.name)).map(e=>e.name)).length&&l.push({label:"secrets",tone:"danger",title:`stores credentials: ${o.join(", ")}`}),r.domain&&/auth/i.test(r.domain)&&l.push({label:"auth",tone:"warn",title:"auth-domain table"}),l),E=f(),[S,A]=(0,a.useState)(t.name),[z,T]=(0,a.useState)(t.columns),[I,R]=(0,a.useState)(!1);(0,a.useEffect)(()=>{A(t.name),T(t.columns)},[t.rev]);let D=e=>e.stopPropagation(),M=t=>{T(t),E.patchTable(e,{columns:t})};return h?(0,n.jsxs)("div",{className:(0,p.cn)("w-[252px] overflow-hidden rounded-md border border-dashed bg-card text-card-foreground shadow-sm",s&&"ring-2 ring-[var(--accent,#f5b942)]"),style:{borderColor:`${g}88`},children:[(0,n.jsx)(w,{}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1.5",style:{background:`${k}1f`},children:[(0,n.jsx)("span",{title:y,className:"inline-block size-1.5 shrink-0 rounded-full",style:{background:g}}),(0,n.jsx)("input",{value:S,onChange:e=>A(e.target.value),onBlur:()=>{let s=S.trim();s&&s!==t.name&&E.patchTable(e,{name:s})},onKeyDown:e=>{D(e),"Enter"===e.key&&e.currentTarget.blur()},placeholder:"table",className:(0,p.cn)(N,"min-w-0 flex-1 bg-transparent font-mono text-sm font-semibold outline-none")}),(0,n.jsx)(v,{badges:C}),(0,n.jsx)("span",{title:y,className:"shrink-0 rounded px-1 text-[9px] uppercase tracking-wide",style:{background:`${g}26`,color:g},children:b}),(0,n.jsx)("button",{type:"button",onClick:t=>{D(t),I?E.deleteTable(e):R(!0)},onBlur:()=>R(!1),title:"Delete table",className:(0,p.cn)(N,"shrink-0 transition-colors",I?"text-red-300":"text-muted-foreground hover:text-red-300"),children:(0,n.jsx)(c.A,{className:"size-3"})})]}),(0,n.jsxs)("div",{className:"divide-y divide-border/40",children:[z.map((e,t)=>(0,n.jsxs)("div",{className:"flex items-center gap-1 px-2 py-0.5 text-[11px]",children:[(0,n.jsx)("button",{type:"button",onClick:e=>{D(e),M(z.map((e,s)=>s===t?{...e,isPk:!e.isPk}:e))},title:"Primary key",className:(0,p.cn)(N,"shrink-0",e.isPk?"text-amber-400":"text-muted-foreground/40 hover:text-amber-400"),children:(0,n.jsx)(i.A,{className:"size-3"})}),(0,n.jsx)("button",{type:"button",onClick:e=>{D(e),M(z.map((e,s)=>s===t?{...e,isFk:!e.isFk}:e))},title:"Foreign key",className:(0,p.cn)(N,"shrink-0",e.isFk?"text-sky-400":"text-muted-foreground/40 hover:text-sky-400"),children:(0,n.jsx)(d.A,{className:"size-3"})}),(0,n.jsx)("input",{value:e.name,onChange:e=>T(s=>s.map((s,n)=>n===t?{...s,name:e.target.value}:s)),onBlur:()=>M(z),onKeyDown:D,placeholder:"column",className:(0,p.cn)(N,"min-w-0 flex-1 bg-transparent font-mono outline-none")}),(0,n.jsx)("input",{value:e.type,onChange:e=>T(s=>s.map((s,n)=>n===t?{...s,type:e.target.value}:s)),onBlur:()=>M(z),onKeyDown:D,placeholder:"type",className:(0,p.cn)(N,"w-16 shrink-0 bg-transparent text-right font-mono text-[10px] text-muted-foreground outline-none")}),(0,n.jsx)("button",{type:"button",onClick:e=>{D(e),M(z.filter((e,s)=>s!==t))},title:"Remove column",className:(0,p.cn)(N,"shrink-0 text-muted-foreground/40 hover:text-red-300"),children:(0,n.jsx)(u.A,{className:"size-3"})})]},t)),(0,n.jsxs)("button",{type:"button",onClick:e=>{D(e),M([...z,{name:"",type:"text",isPk:!1,isFk:!1,nullable:!0,note:null}])},className:(0,p.cn)(N,"flex w-full items-center gap-1 px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground"),children:[(0,n.jsx)(m.A,{className:"size-3"})," column"]})]})]}):(0,n.jsxs)("div",{className:(0,p.cn)("w-[232px] overflow-hidden rounded-md border bg-card text-card-foreground shadow-sm",s&&"ring-2 ring-[var(--accent,#f5b942)]"),style:{borderColor:`${k}55`},children:[(0,n.jsx)(w,{}),(0,n.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",style:{background:`${k}1f`},children:[(0,n.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-sm font-semibold",children:["INTROSPECTION"===t.source&&(0,n.jsx)("span",{title:"live — derived from your code",className:"inline-block size-1.5 rounded-full bg-emerald-400"}),t.name]}),(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(v,{badges:C}),t.domain&&(0,n.jsx)("span",{className:"text-[10px] uppercase tracking-wide",style:{color:k},children:t.domain})]})]}),(0,n.jsx)("div",{className:"divide-y divide-border/40",children:t.columns.map(e=>(0,n.jsxs)("div",{className:"flex items-center gap-1.5 px-2.5 py-1 text-[11px]",children:[e.isPk?(0,n.jsx)(i.A,{className:"size-3 shrink-0 text-amber-400"}):e.isFk?(0,n.jsx)(d.A,{className:"size-3 shrink-0 text-sky-400"}):(0,n.jsx)("span",{className:"size-3 shrink-0"}),(0,n.jsx)("span",{className:(0,p.cn)("font-mono",e.isPk&&"font-semibold"),children:e.name}),(0,n.jsx)("span",{className:"ml-auto truncate font-mono text-[10px] text-muted-foreground",children:e.type})]},e.name))})]})},endpoint:function({id:e,data:t,selected:s}){var r;let l,o=x.e6[t.method]??"#8a8a8a",i="DRAFT"===t.source,d="added"===t.diffStatus?"#7bd389":"modified"===t.diffStatus?"#ffb86b":"#4ea1ff",u="added"===t.diffStatus?"new":"modified"===t.diffStatus?"changed":"draft",m=t.diffChanges?.length?t.diffChanges.join("\n"):"draft",h=(r={method:t.method,domain:t.domain,path:t.path},l=[],/^delete$/i.test(r.method.trim())&&l.push({label:"DELETE",tone:"danger",title:"destructive: deletes data"}),(r.domain&&/auth/i.test(r.domain)||y.test(r.path))&&l.push({label:"auth",tone:"warn",title:"auth-related endpoint"}),l),b=f(),[j,N]=(0,a.useState)(t.path),[w,E]=(0,a.useState)(!1);(0,a.useEffect)(()=>{N(t.path)},[t.rev]);let S=e=>e.stopPropagation();return(0,n.jsxs)("div",{className:(0,p.cn)("group flex w-[240px] items-center gap-2 rounded-md border bg-card px-2.5 py-1.5 text-card-foreground shadow-sm",i?"border-dashed":"border-border",s&&"ring-2 ring-[var(--accent,#f5b942)]"),style:i?{borderColor:`${d}88`,background:`${d}0f`}:void 0,children:[(0,n.jsx)(g.x,{}),"INTROSPECTION"===t.source&&(0,n.jsx)("span",{title:"live — derived from your code",className:"inline-block size-1.5 shrink-0 rounded-full bg-emerald-400"}),i?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("select",{value:t.method,onChange:t=>b.patchEndpoint(e,{method:t.target.value}),onPointerDown:S,className:(0,p.cn)(k,"shrink-0 rounded bg-transparent text-[10px] font-bold outline-none"),style:{color:o},title:"Method",children:C.map(e=>(0,n.jsx)("option",{value:e,className:"bg-card text-foreground",children:e},e))}),(0,n.jsx)("input",{value:j,onChange:e=>N(e.target.value),onBlur:()=>{let s=j.trim();s&&s!==t.path&&b.patchEndpoint(e,{path:s})},onKeyDown:e=>{S(e),"Enter"===e.key&&e.currentTarget.blur()},className:(0,p.cn)(k,"min-w-0 flex-1 bg-transparent font-mono text-[11px] outline-none")}),(0,n.jsx)(v,{badges:h}),(0,n.jsx)("span",{title:m,className:"shrink-0 rounded px-1 py-0.5 text-[8px] font-semibold uppercase",style:{background:`${d}26`,color:d},children:u}),(0,n.jsx)("button",{type:"button",onClick:t=>{S(t),w?b.deleteEndpoint(e):E(!0)},onBlur:()=>E(!1),title:"Delete",className:(0,p.cn)(k,"shrink-0 transition-colors",w?"text-red-300":"text-muted-foreground hover:text-red-300"),children:(0,n.jsx)(c.A,{className:"size-3"})})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-bold",style:{background:`${o}22`,color:o},children:t.method}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px]",children:t.path}),(0,n.jsx)(v,{badges:h}),(0,n.jsx)("button",{type:"button",onClick:t=>{S(t),w?b.deleteRealEndpoint(e):E(!0)},onBlur:()=>E(!1),title:w?"Click again to delete":"Delete endpoint",className:(0,p.cn)(k,"shrink-0 opacity-0 transition-opacity group-hover:opacity-100",w?"text-red-300 opacity-100":"text-muted-foreground hover:text-red-300"),children:(0,n.jsx)(c.A,{className:"size-3"})})]})]})}},q={deletable:Y.I},V="beacon:db-draft",J={proposedAt:0,status:"pending",tables:[],relations:[],endpoints:[]};function Q({tables:e,relations:t,endpoints:s,draft:i,workspaceId:d,embedded:u=!1,draftRef:m,onEdit:f,controlRef:g,commentsContent:b,commentsCount:v=0,onAddComment:j}){let y=(0,r.useRouter)(),[N,w]=(0,a.useState)(!0),[k,C]=(0,a.useState)(null),[E,S]=(0,a.useState)(null),[A,z]=(0,a.useState)(!1),[T,R]=(0,a.useState)("details"),[D,M]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(g)return g.current={open:()=>{z(!0),R("details")},close:()=>{z(!1),R("details")},openComments:()=>{z(!0),R("comments")}},()=>{g&&(g.current=null)}},[g]);let[$,P]=(0,a.useState)(new Set),[L,Y]=(0,a.useState)(new Set),[ee,et]=(0,a.useState)(new Set),[es,en]=(0,a.useState)(()=>({past:[],present:i??J,future:[],rev:0,edited:!1})),ea=es.present,er=(0,a.useCallback)(e=>{en(t=>{let s=e(t.present);return s===t.present?t:{past:[...t.past,t.present].slice(-100),present:s,future:[],rev:t.rev+1,edited:!0}})},[]),el=(0,a.useCallback)(e=>{en(t=>{let s=e(t.present);return s===t.present?t:{...t,present:s}})},[]),eo=(0,a.useCallback)(()=>en(e=>e.past.length?{past:e.past.slice(0,-1),present:e.past[e.past.length-1],future:[e.present,...e.future],rev:e.rev+1,edited:!0}:e),[]),ei=(0,a.useCallback)(()=>en(e=>e.future.length?{past:[...e.past,e.present],present:e.future[0],future:e.future.slice(1),rev:e.rev+1,edited:!0}:e),[]),ed=(0,a.useCallback)(e=>en(t=>({past:[],present:e,future:[],rev:t.rev+1,edited:!1})),[]),ec=(0,a.useRef)(!1),eu=i?.proposedAt??0;(0,a.useEffect)(()=>{let e=null;if(ec.current)i&&i.proposedAt!==ea.proposedAt?e=i:!i&&(ea.tables.length>0||ea.endpoints.length>0)&&(e=J);else{ec.current=!0;let t=null;try{let e=localStorage.getItem(V);if(e){let s=JSON.parse(e);s.workspaceId===d&&s.doc&&i&&s.doc.proposedAt===i.proposedAt&&(t=s.doc)}}catch{}e=t??i??null}e&&ed(e)},[eu]),(0,a.useEffect)(()=>{try{ea.tables.length>0||ea.endpoints.length>0?localStorage.setItem(V,JSON.stringify({workspaceId:d,doc:ea})):localStorage.removeItem(V)}catch{}},[ea,d]),(0,a.useEffect)(()=>{m&&(m.current=ea)},[m,ea]);let em=(0,a.useRef)(!1);(0,a.useEffect)(()=>{es.edited&&!em.current&&(em.current=!0,f?.())},[es.edited,f]);let ep=(0,a.useMemo)(()=>ea.tables.map(e=>({id:e.id,name:e.name,domain:e.domain,description:e.description,source:"DRAFT",x:e.x,y:e.y,columns:e.columns})),[ea]),ex=(0,a.useMemo)(()=>ea.endpoints.map(e=>({id:e.id,method:e.method,path:e.path,domain:e.domain,description:e.description,source:"DRAFT",x:e.x,y:e.y,tables:e.links.map(e=>({tableId:e.tableId,access:e.access}))})),[ea]),eh=(0,a.useMemo)(()=>[...e,...ep],[e,ep]),ef=(0,a.useMemo)(()=>[...s,...ex],[s,ex]),eg=(0,a.useMemo)(()=>new Map,[]),eb=(0,a.useMemo)(()=>u?function(e,t){let s=new Map(e.map(e=>[H(e.name),e])),n=new Map;for(let e of t){let t=s.get(H(e.name));if(!t){n.set(e.id,{status:"added",changes:["new table"]});continue}let a=function(e,t){let s=new Map(e.map(e=>[H(e.name),e])),n=new Set(t.map(e=>H(e.name))),a=[];for(let e of t){let t=s.get(H(e.name));if(!t){a.push(`+ column ${e.name} (${e.type})`);continue}let n=[];H(t.type)!==H(e.type)&&n.push(`type ${t.type}→${e.type}`),t.isPk!==e.isPk&&n.push(e.isPk?"now PK":"no longer PK"),t.isFk!==e.isFk&&n.push(e.isFk?"now FK":"no longer FK"),t.nullable!==e.nullable&&n.push(e.nullable?"now nullable":"now required"),n.length&&a.push(`~ column ${e.name}: ${n.join(", ")}`)}for(let t of e)n.has(H(t.name))||a.push(`- column ${t.name}`);return a}(t.columns,e.columns);n.set(e.id,{status:a.length?"modified":"unchanged",changes:a})}return n}(e,ep):eg,[u,e,ep,eg]),ev=(0,a.useMemo)(()=>u?function(e,t){let s=e=>`${H(e.method)} ${H(e.path)}`,n=new Set(e.map(s)),a=new Map;for(let e of t)a.set(e.id,n.has(s(e))?{status:"unchanged",changes:[]}:{status:"added",changes:["new endpoint"]});return a}(s,ex):eg,[u,s,ex,eg]),ej=(0,a.useMemo)(()=>[...t,...ea.relations.map(e=>({id:e.id,fromTableId:e.fromTableId,toTableId:e.toTableId,fromColumn:e.fromColumn,toColumn:e.toColumn,label:e.label}))],[t,ea.relations]),ey=(0,a.useMemo)(()=>{let e=new Map;for(let t of ef)for(let s of t.tables)e.set(s.tableId,(e.get(s.tableId)??0)+1);return e},[ef]),eN=(0,a.useMemo)(()=>{let e=new Map;return eh.forEach(t=>e.set(t.id,t.x)),ef.forEach(t=>e.set(t.id,t.x)),e},[eh,ef]),ew=(0,a.useCallback)((e,t)=>(eN.get(e)??0)<=(eN.get(t)??0)?{sourceHandle:"sr",targetHandle:"tl"}:{sourceHandle:"sl",targetHandle:"tr"},[eN]),ek=(0,a.useMemo)(()=>new Set([...ea.tables.map(e=>e.id),...ea.endpoints.map(e=>e.id)]),[ea]),eC=(0,a.useMemo)(()=>new Set(e.map(e=>e.id)),[e]),eE=(0,a.useCallback)(()=>[...eh.map(e=>({id:e.id,type:"dbTable",position:{x:e.x,y:e.y},data:{name:e.name,domain:e.domain,columns:e.columns,usageCount:ey.get(e.id)??0,source:e.source,rev:es.rev,diffStatus:eb.get(e.id)?.status,diffChanges:eb.get(e.id)?.changes}})),...ef.map(e=>({id:e.id,type:"endpoint",position:{x:e.x,y:e.y},data:{method:e.method,path:e.path,domain:e.domain,source:e.source,rev:es.rev,diffStatus:ev.get(e.id)?.status,diffChanges:ev.get(e.id)?.changes}}))],[eh,ef,ey,es.rev,eb,ev]),[eS,eA,ez]=(0,l.ck)(eE());(0,a.useEffect)(()=>{eA(e=>{let t=new Map(e.map(e=>[e.id,e.position]));return eE().map(e=>({...e,position:t.get(e.id)??e.position}))})},[eE,eA]);let eT=(0,a.useCallback)((e,t,s,n)=>{fetch("/api/db/position",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:e,id:t,x:s,y:n})})},[]),eI=(0,a.useCallback)((e,t)=>{let{x:s,y:n}=t.position;ek.has(t.id)?el(e=>e.tables.some(e=>e.id===t.id)?{...e,tables:e.tables.map(e=>e.id===t.id?{...e,x:s,y:n}:e)}:e.endpoints.some(e=>e.id===t.id)?{...e,endpoints:e.endpoints.map(e=>e.id===t.id?{...e,x:s,y:n}:e)}:e):eT("endpoint"===t.type?"endpoint":"table",t.id,s,n)},[ek,el,eT]),eR=(0,a.useMemo)(()=>ej.map(e=>({id:`fk-${e.id}`,source:e.fromTableId,target:e.toTableId,...ew(e.fromTableId,e.toTableId),type:"deletable",label:e.label??void 0,markerEnd:{type:o.TG.ArrowClosed,color:"#6b6b6b"},style:{stroke:"#6b6b6b"}})),[ej,ew]),eD=(0,a.useMemo)(()=>ef.flatMap(e=>e.tables.map(t=>{let s=x.ru[t.access]??"#5a5a5a";return{id:`u-${e.id}-${t.tableId}`,source:e.id,target:t.tableId,...ew(e.id,t.tableId),type:"default",markerEnd:{type:o.TG.ArrowClosed,color:s},style:{stroke:s,strokeDasharray:"4 4",opacity:.7}}})),[ef,ew]),eM=(0,a.useMemo)(()=>N?[...eR,...eD]:eR,[eR,eD,N]),e$=(0,a.useMemo)(()=>{if(E){let e=eM.find(e=>e.id===E);return e?new Set([e.source,e.target]):null}return k?(0,x.F1)(k.id,eM):null},[k,E,eM]),eP=(0,a.useMemo)(()=>new Map(eh.map(e=>[e.id,{domain:e.domain,source:e.source}])),[eh]),eL=(0,a.useMemo)(()=>new Map(ef.map(e=>[e.id,{method:e.method,source:e.source}])),[ef]),eO=(0,a.useMemo)(()=>{let e=new Set;if(!N)for(let t of eL.keys())e.add(t);for(let[t,s]of eP)!$.size||s.domain&&$.has(s.domain)||e.add(t),L.size&&!L.has(s.source)&&e.add(t);for(let[t,s]of eL)ee.size&&!ee.has(s.method)&&e.add(t),L.size&&!L.has(s.source)&&e.add(t);return e},[N,eP,eL,$,L,ee]),eF=(0,a.useMemo)(()=>eS.map(e=>{let t=eO.has(e.id);return e$?{...e,hidden:t,style:{...e.style,opacity:e$.has(e.id)?1:.45,transition:"opacity 120ms"}}:t?{...e,hidden:t}:e}),[eS,eO,e$]),e_=(0,a.useMemo)(()=>eM.map(e=>{let t=eO.has(e.source)||eO.has(e.target);return k||E?(E?e.id===E:k&&(e.source===k.id||e.target===k.id))?{...e,hidden:t,zIndex:20,style:{...e.style,opacity:1,strokeWidth:2.5}}:{...e,hidden:t,selectable:!1,label:void 0,markerEnd:void 0,style:{...e.style,opacity:.08}}:t?{...e,hidden:t}:e}),[eM,k,E,eO]),eH=(0,a.useMemo)(()=>Array.from(new Set(eh.map(e=>e.domain).filter(e=>!!e))).sort(),[eh]),eB=(0,a.useMemo)(()=>Array.from(new Set([...eh.map(e=>e.source),...ef.map(e=>e.source)])).sort(),[eh,ef]),eU=(0,a.useMemo)(()=>Array.from(new Set(ef.map(e=>e.method))).sort(),[ef]);function eK(e,t){t(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})}let eX=+!N+$.size+L.size+ee.size,eG=(0,a.useCallback)(()=>{w(!0),P(new Set),Y(new Set),et(new Set)},[]),eZ=(0,a.useCallback)(e=>{let{source:t,target:s}=e;t&&s&&t!==s&&er(e=>{if(!(e.tables.some(e=>e.id===s)||eC.has(s)))return e;let n=e.endpoints.find(e=>e.id===t);return n?n.links.some(e=>e.tableId===s)?e:{...e,endpoints:e.endpoints.map(e=>{var n;return e.id===t?{...e,links:[...e.links,{tableId:s,access:(n=e.method,_.has(n.trim().toUpperCase())?"read":"write")}]}:e})}:e.tables.find(e=>e.id===t)?e.relations.some(e=>e.fromTableId===t&&e.toTableId===s)?e:{...e,relations:[...e.relations,{id:crypto.randomUUID(),fromTableId:t,toTableId:s,fromColumn:"fk",toColumn:"id",label:null}]}:e})},[er,eC]),eY=(0,a.useMemo)(()=>({patchEndpoint:(e,t)=>er(s=>({...s,endpoints:s.endpoints.map(s=>s.id===e?{...s,...t}:s)})),deleteEndpoint:e=>er(t=>({...t,endpoints:t.endpoints.filter(t=>t.id!==e)})),patchTable:(e,t)=>er(s=>({...s,tables:s.tables.map(s=>s.id===e?{...s,...t}:s)})),deleteTable:e=>er(t=>({...t,tables:t.tables.filter(t=>t.id!==e),relations:t.relations.filter(t=>t.fromTableId!==e&&t.toTableId!==e),endpoints:t.endpoints.map(t=>({...t,links:t.links.filter(t=>t.tableId!==e)}))})),deleteRealEndpoint:e=>{fetch(`/api/endpoints/${e}`,{method:"DELETE"}).then(e=>{e.ok&&y.refresh()})}}),[er,y]);(0,a.useEffect)(()=>{let e=e=>{if(!(e.metaKey||e.ctrlKey))return;let t=e.target;if(t&&/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))return;let s=e.key.toLowerCase();"z"===s?(e.preventDefault(),e.shiftKey?ei():eo()):"y"===s&&(e.preventDefault(),ei())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[eo,ei]);let eW=(0,a.useCallback)(async()=>{M(!0);try{if((await fetch("/api/draft/approve",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(ea)})).ok){try{localStorage.removeItem(V)}catch{}ed(J),y.refresh()}}finally{M(!1)}},[ea,ed,y]),eq=(0,a.useCallback)(async()=>{M(!0);try{await fetch("/api/draft",{method:"DELETE"})}catch{}try{localStorage.removeItem(V)}catch{}ed(J),y.refresh(),M(!1)},[ed,y]),eV=(0,a.useMemo)(()=>{let e;return e=new Map(ea.tables.map(e=>[e.id,e.name])),{tables:ea.tables.map(e=>({name:e.name,domain:e.domain,description:e.description,columns:e.columns.map(e=>({name:e.name,type:e.type,isPk:e.isPk,isFk:e.isFk,nullable:e.nullable,note:e.note}))})),relations:ea.relations.flatMap(t=>{let s=e.get(t.fromTableId),n=e.get(t.toTableId);return s&&n?[{fromTable:s,fromColumn:t.fromColumn,toTable:n,toColumn:t.toColumn,label:t.label}]:[]}),endpoints:ea.endpoints.map(t=>({method:t.method,path:t.path,domain:t.domain,description:t.description,uses:t.links.flatMap(t=>{let s=e.get(t.tableId);return s?[{table:s,access:t.access}]:[]})}))}},[ea]),eJ=ea.tables.length>0||ea.endpoints.length>0,eQ=es.past.length>0,e0=es.future.length>0;return(0,n.jsx)(h.Provider,{value:eY,children:(0,n.jsxs)("div",{className:(0,p.cn)("relative w-full",u?"h-full":"h-screen"),children:[(0,n.jsxs)(l.Gc,{nodes:eF,edges:e_,nodeTypes:W,edgeTypes:q,connectionMode:o.WZ.Loose,connectionLineStyle:{stroke:"var(--accent-2,#ff7a45)",strokeWidth:1.5,strokeDasharray:"4 4"},onNodesChange:ez,onConnect:eZ,onNodeClick:(e,t)=>{let s="endpoint"===t.type?"endpoint":"table";C({id:t.id,kind:s}),S(null),z(!0),R("details")},onEdgeClick:(e,t)=>{S(t.id),C(null)},onPaneClick:()=>{C(null),S(null)},onNodeDragStop:eI,onEdgesDelete:e=>{for(let t of e)if(t.id.startsWith("fk-")){let e=t.id.slice(3);fetch(`/api/db/relations/${e}`,{method:"DELETE"})}},onNodesDelete:e=>{for(let t of e)ek.has(t.id)||("endpoint"===t.type?fetch(`/api/endpoints/${t.id}`,{method:"DELETE"}):"dbTable"===t.type&&fetch(`/api/db/tables/${t.id}`,{method:"DELETE"}))},deleteKeyCode:["Backspace","Delete"],colorMode:"dark",fitView:!0,minZoom:.15,panOnScroll:!0,zoomActivationKeyCode:["Meta","Control"],proOptions:{hideAttribution:!0},children:[(0,n.jsx)(l.VS,{gap:22,color:"#2a2a32"}),(0,n.jsx)(l.H2,{position:"bottom-right",className:"!overflow-hidden !rounded-xl !border !border-white/10 [&_button]:!border-white/10 [&_button]:!bg-card/70 [&_button]:!text-foreground [&_button]:!backdrop-blur"}),!u&&(0,n.jsx)(l.of,{pannable:!0,zoomable:!0,position:"bottom-left",style:{width:140,height:90},className:"!rounded-xl !border !border-white/10 !bg-card/50 !backdrop-blur",nodeColor:"#555"}),!u&&(0,n.jsx)(l.Zk,{position:"top-center",className:"glass rounded-full px-1 py-0.5",children:(0,n.jsx)(F.Z,{active:"DATABASE",tabs:[{value:"ROADMAP",label:"Roadmap",href:"/map?view=ROADMAP"},{value:"ARCHITECTURE",label:"Architecture",href:"/map?view=ARCHITECTURE"},{value:"FILES",label:"Files",href:"/map?view=FILES"},{value:"DATABASE",label:"Database",href:"/map?view=DATABASE"}]})}),(0,n.jsxs)(l.Zk,{position:"top-right",className:(0,p.cn)("flex items-center gap-1 transition-[margin] duration-200",A&&"!mr-[332px]",u&&"hidden"),children:[(0,n.jsxs)(O.er,{title:"Filters",trigger:(e,t)=>(0,n.jsxs)("button",{type:"button",onClick:t,title:"Filters",className:(0,p.cn)("glass relative flex size-8 items-center justify-center rounded-lg transition-colors",e||eX>0?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,n.jsx)(B.A,{className:"size-4"}),eX>0&&(0,n.jsx)("span",{className:"absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-[var(--accent-2,#ff7a45)] px-1 text-[9px] font-semibold text-white",children:eX})]}),children:[(0,n.jsx)(O.r1,{title:"Show",children:(0,n.jsx)(O.vu,{tone:"accent",on:N,onClick:()=>w(e=>!e),children:"endpoints"})}),eH.length>0&&(0,n.jsx)(O.r1,{title:"Domain",children:eH.map(e=>(0,n.jsx)(O.vu,{on:$.has(e),onClick:()=>eK(e,P),children:e},e))}),eU.length>0&&(0,n.jsx)(O.r1,{title:"Method",children:eU.map(e=>(0,n.jsx)(O.vu,{on:ee.has(e),onClick:()=>eK(e,et),children:e},e))}),eB.length>0&&(0,n.jsx)(O.r1,{title:"Source",children:eB.map(e=>(0,n.jsx)(O.vu,{on:L.has(e),onClick:()=>eK(e,Y),children:e.toLowerCase()},e))}),eX>0&&(0,n.jsx)("button",{type:"button",onClick:eG,className:"mt-1 w-full rounded-md border border-white/10 px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-white/5 hover:text-foreground",children:"clear filters"})]}),(0,n.jsx)(O.er,{title:"Legend",trigger:(e,t)=>(0,n.jsx)("button",{type:"button",onClick:t,title:"Legend",className:(0,p.cn)("glass flex size-8 items-center justify-center rounded-lg transition-colors",e?"text-foreground":"text-muted-foreground hover:text-foreground"),children:(0,n.jsx)(U.A,{className:"size-4"})}),children:(0,n.jsxs)("ul",{className:"space-y-1.5 text-[10.5px] text-muted-foreground",children:[(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"inline-block h-px w-6 bg-[#6b6b6b]"}),(0,n.jsx)("span",{children:"foreign key \xb7 drag from a table handle"})]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"inline-block h-0 w-6 border-t border-dashed",style:{borderColor:"#4ea1ff"}}),(0,n.jsx)("span",{children:"endpoint read \xb7 GET / POST / etc"})]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"inline-block h-0 w-6 border-t border-dashed",style:{borderColor:"#ffb86b"}}),(0,n.jsx)("span",{children:"endpoint write"})]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"inline-block rounded border border-dashed border-sky-400/50 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-sky-300",children:"draft"}),(0,n.jsx)("span",{children:"agent-proposed \xb7 approve to persist"})]})]})}),!A&&(0,n.jsx)("button",{onClick:()=>z(!0),title:"Show panel",className:"glass flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:text-foreground",children:(0,n.jsx)(K.A,{className:"size-4"})})]}),eJ&&(0,n.jsxs)(l.Zk,{position:"bottom-center",className:"glass flex items-center gap-1 rounded-xl p-1.5",children:[(0,n.jsxs)("button",{onClick:eo,disabled:!eQ,title:"Undo (⌘Z)",className:"flex items-center gap-1 rounded-md px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-white/10 hover:text-foreground disabled:opacity-30 disabled:hover:bg-transparent",children:[(0,n.jsx)(X.A,{className:"size-3.5"})," undo"]}),(0,n.jsxs)("button",{onClick:ei,disabled:!e0,title:"Redo (⇧⌘Z)",className:"flex items-center gap-1 rounded-md px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-white/10 hover:text-foreground disabled:opacity-30 disabled:hover:bg-transparent",children:[(0,n.jsx)(G.A,{className:"size-3.5"})," redo"]}),!u&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"mx-1 h-4 w-px bg-white/10"}),(0,n.jsxs)("button",{onClick:eq,disabled:D,title:"Discard draft",className:"flex items-center gap-1 rounded-md px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-red-500/15 hover:text-red-300 disabled:opacity-40",children:[(0,n.jsx)(c.A,{className:"size-3.5"})," discard"]}),(0,n.jsxs)("button",{onClick:eW,disabled:D,title:"Approve and persist to the schema",className:"flex items-center gap-1 rounded-md border border-emerald-500/40 bg-emerald-500/15 px-2.5 py-1 text-[11px] font-semibold text-emerald-300 transition-colors hover:bg-emerald-500/25 disabled:opacity-40",children:[(0,n.jsx)(Z.A,{className:"size-3.5"})," approve draft"]})]})]})]}),A&&(0,n.jsx)(I,{selected:k,tables:eh,relations:ej,endpoints:ef,draftGraph:eV,onClose:()=>{z(!1),R("details")},commentsContent:b,commentsCount:v,activeTab:T,onTabChange:R,onAddComment:j,topOffset:u?64:void 0})]})})}},40153:(e,t,s)=>{s.d(t,{MapClient:()=>eh});var n=s(95155),a=s(12115),r=s(6266),l=s(81750);s(53255);var o=s(17356),i=s(2125),d=s(15480),c=s(65377),u=s(17494),m=s(80846),p=s(45486),x=s(95635),h=s(65408),f=s(8962),g=s(84824),b=s(5736),v=s(86272),j=s(65738),y=s(40638),N=s(26518);let w=["PENDING","IN_PROGRESS","DONE","BLOCKED","CANCELLED","DEPRIORITIZED"],k=["KEEP","REBUILD","REPLACE","DROP"],C=["IN_PROGRESS","PENDING","BLOCKED","DONE","DEPRIORITIZED","CANCELLED"],E={DONE:{label:"Done",className:"border-emerald-500/30 bg-emerald-500/15 text-emerald-300"},IN_PROGRESS:{label:"In progress",className:"border-sky-500/30 bg-sky-500/15 text-sky-300"},PENDING:{label:"Pending",className:"border-amber-500/30 bg-amber-500/10 text-amber-200"},BLOCKED:{label:"Blocked",className:"border-orange-500/30 bg-orange-500/15 text-orange-300"},CANCELLED:{label:"Cancelled",className:"border-zinc-500/30 bg-zinc-500/10 text-zinc-400 line-through"},DEPRIORITIZED:{label:"Deprioritized",className:"border-zinc-600/40 bg-zinc-600/10 text-zinc-400"},KEEP:{label:"Keep",className:"border-emerald-500/30 bg-emerald-500/15 text-emerald-300"},REBUILD:{label:"Rebuild",className:"border-violet-500/30 bg-violet-500/15 text-violet-300"},REPLACE:{label:"Replace",className:"border-rose-500/30 bg-rose-500/15 text-rose-300"},DROP:{label:"Drop",className:"border-zinc-500/30 bg-zinc-500/10 text-zinc-400 line-through"}},S=["bg-emerald-500/15 text-emerald-300","bg-sky-500/15 text-sky-300","bg-violet-500/15 text-violet-300","bg-amber-500/15 text-amber-200","bg-rose-500/15 text-rose-300","bg-cyan-500/15 text-cyan-300","bg-fuchsia-500/15 text-fuchsia-300","bg-lime-500/15 text-lime-300","bg-orange-500/15 text-orange-300","bg-teal-500/15 text-teal-300","bg-indigo-500/15 text-indigo-300","bg-pink-500/15 text-pink-300"];function A(e){let t=(e??"").trim().toUpperCase();if(!t)return"bg-white/[0.06] text-muted-foreground";let s=0;for(let e=0;e<t.length;e++)s=31*s+t.charCodeAt(e)>>>0;return S[s%S.length]}let z=(0,a.createContext)(null);var T=s(60874),I=s(91337);let R=[{v:0,l:"P0 \xb7 critical"},{v:1,l:"P1 \xb7 high"},{v:2,l:"P2 \xb7 medium"},{v:3,l:"P3 \xb7 low"}],D="nodrag nopan";function M({id:e,data:t,selected:s}){let{categories:r,statuses:l,patch:o,isExpanded:i,toggleExpand:d,openDetailed:c,removeNode:u,editingTitleId:m,onAskAgent:w}=function(){let e=(0,a.useContext)(z);if(!e)throw Error("useNodeEdit must be used inside NodeEditContext");return e}(),k=i(e),[C,S]=(0,a.useState)(!1),[$,P]=(0,a.useState)(!1),[L,O]=(0,a.useState)(t.title),[F,_]=(0,a.useState)(t.cluster??""),[H,B]=(0,a.useState)(t.plain??""),U=0===t.priority,K="CANCELLED"===t.status||"DROP"===t.status,X="DEPRIORITIZED"===t.status,G="DRAFT"===t.source,Z="IN_PROGRESS"===t.status,Y="INIT"===t.source&&"ROADMAP"===t.view,W=e=>e.stopPropagation();return(0,n.jsxs)("div",{className:(0,I.cn)("rounded-lg border bg-card px-2.5 py-2 text-card-foreground shadow-sm transition",k?"w-80":t.isChild?"w-56":"w-64",G?"border-dashed border-sky-400/50 bg-sky-500/[0.06]":Y?"border-dashed border-violet-400/60 bg-violet-500/[0.07] shadow-[0_0_0_1px_rgba(167,139,250,0.18)]":U?"border-[#ff3860]/60 shadow-[0_0_0_1px_rgba(255,56,96,0.15)]":"border-border",Z&&"border-sky-400/60 shadow-[0_0_0_1px_rgba(56,160,255,0.25)]",t.isNext&&"border-emerald-400/70 shadow-[0_0_0_2px_rgba(52,211,153,0.35)]",s&&"ring-2 ring-[var(--accent,#f5b942)]",K&&"opacity-60",X&&"opacity-70 border-dashed"),children:[(0,n.jsx)(x.x,{}),t.isNext&&(0,n.jsx)("div",{className:"mb-1 inline-flex items-center gap-1 rounded bg-emerald-500/15 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-emerald-300",children:"work on next"}),(0,n.jsxs)("div",{className:"flex items-start gap-1.5",children:[Z&&(0,n.jsx)("span",{title:"em andamento",className:"mt-1.5 inline-block size-2 shrink-0 animate-pulse rounded-full bg-sky-400"}),t.isCriterion&&!Z&&(0,n.jsx)("span",{title:"Success criterion",className:"mt-1.5 inline-block size-1.5 shrink-0 rounded-full bg-[var(--accent,#f5b942)]"}),(0,n.jsx)("textarea",{rows:1,value:L,autoFocus:m===e,placeholder:"Title…",onFocus:t=>{m===e&&t.currentTarget.select()},onChange:e=>O(e.target.value),onBlur:()=>{let s=L.trim();s&&s!==t.title&&o(e,{title:s},!0)},onKeyDown:e=>{W(e),"Enter"!==e.key||e.shiftKey||(e.preventDefault(),e.currentTarget.blur())},className:(0,I.cn)(D,"field-sizing-content w-full resize-none bg-transparent text-sm font-medium leading-snug outline-none placeholder:text-muted-foreground/60",K&&"line-through")}),(0,n.jsx)("button",{type:"button",onClick:t=>{W(t),d(e)},title:k?"Collapse":"Expand",className:(0,I.cn)(D,"mt-0.5 shrink-0 text-muted-foreground hover:text-foreground"),children:k?(0,n.jsx)(h.A,{className:"size-3.5"}):(0,n.jsx)(f.A,{className:"size-3.5"})})]}),((t.signals?.untested??0)>0||t.signals?.auth)&&(0,n.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[(t.signals?.untested??0)>0&&(0,n.jsxs)("span",{title:`${t.signals.untested} of ${t.signals.total} attached file(s) have no test importing them`,className:"flex items-center gap-1 rounded bg-amber-500/15 px-1 text-[9px] font-semibold uppercase tracking-wide text-amber-300",children:[(0,n.jsx)(g.A,{className:"size-2.5"}),t.signals.untested," untested"]}),t.signals?.auth&&(0,n.jsxs)("span",{title:"touches auth-sensitive files",className:"flex items-center gap-1 rounded bg-red-500/15 px-1 text-[9px] font-semibold uppercase tracking-wide text-red-300",children:[(0,n.jsx)(b.A,{className:"size-2.5"})," auth"]})]}),t.role&&(0,n.jsx)("div",{className:(0,I.cn)("mt-0.5 text-[10px] leading-snug text-muted-foreground",!k&&"line-clamp-1"),children:t.role}),(0,n.jsxs)("div",{className:"mt-2 flex items-center gap-1.5",children:["ROADMAP"===t.view?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{title:t.isChild?"Sub-task of a feature":"Feature — top-level roadmap item",className:(0,I.cn)("shrink-0 rounded px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide",t.isChild?"bg-zinc-500/15 text-zinc-300":"bg-sky-500/15 text-sky-300"),children:t.isChild?"sub-task":"feature"}),Y&&(0,n.jsxs)("span",{className:"flex items-center gap-1 rounded bg-violet-500/15 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-violet-300",children:[(0,n.jsx)(v.A,{className:"size-2.5"})," IA"]}),(0,n.jsx)("input",{list:`cats-${e}`,value:F,placeholder:"category",onChange:e=>_(e.target.value),onBlur:()=>{let s=F.trim()||null;s!==(t.cluster??null)&&o(e,{cluster:s},!0)},onKeyDown:e=>{W(e),"Enter"===e.key&&e.currentTarget.blur()},className:(0,I.cn)(D,"field-sizing-content min-w-12 max-w-[65%] rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide outline-none focus:brightness-125",A(F))})]}):(0,n.jsxs)(n.Fragment,{children:[t.isChild&&(0,n.jsx)("span",{title:"Sub-component",className:"shrink-0 rounded bg-zinc-500/15 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-zinc-300",children:"sub"}),(0,n.jsx)("input",{list:`cats-${e}`,value:F,placeholder:"domain",title:"Architecture domain — the lane this component lives in",onChange:e=>_(e.target.value),onBlur:()=>{let s=F.trim()||null;s!==(t.cluster??null)&&o(e,{cluster:s},!0)},onKeyDown:e=>{W(e),"Enter"===e.key&&e.currentTarget.blur()},className:(0,I.cn)(D,"field-sizing-content min-w-12 max-w-[65%] rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide outline-none focus:brightness-125",A(F))})]}),(0,n.jsx)("datalist",{id:`cats-${e}`,children:r.map(e=>(0,n.jsx)("option",{value:e},e))}),(0,n.jsxs)(N.l6,{value:t.status,onValueChange:t=>o(e,{status:t},!0),children:[(0,n.jsx)(N.bq,{className:(0,I.cn)(D,"ml-auto h-6 shrink-0 gap-1 rounded border px-1.5 py-0 text-[10px] font-medium",E[t.status]?.className??"border-white/10"),children:(0,n.jsx)(N.yv,{children:e=>E[e]?.label??e})}),(0,n.jsx)(N.gC,{alignItemWithTrigger:!1,children:l.map(e=>(0,n.jsx)(N.eb,{value:e,children:E[e]?.label??e},e))})]})]}),k&&(0,n.jsxs)("div",{className:"mt-2 space-y-2 border-t border-white/10 pt-2",children:[$||!H.trim()?(0,n.jsx)("textarea",{autoFocus:$,value:H,placeholder:"Description (markdown)…",onChange:e=>B(e.target.value),onBlur:()=>{P(!1);let s=H.trim()||null;s!==(t.plain??null)&&o(e,{plain:s},!0)},onKeyDown:W,rows:3,className:(0,I.cn)(D,"field-sizing-content max-h-[24rem] min-h-[4.5rem] w-full resize-y rounded bg-white/[0.04] px-1.5 py-1 text-xs outline-none placeholder:text-muted-foreground/50 focus:bg-white/[0.08]")}):(0,n.jsx)("div",{onClick:e=>{W(e),P(!0)},title:"Click to edit",className:"cursor-text rounded bg-white/[0.02] px-1.5 py-1 text-xs hover:bg-white/[0.05]",children:(0,n.jsx)(T.pO,{markdown:H,variant:"compact",className:"text-[12px]"})}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)(N.l6,{value:String(t.priority),onValueChange:t=>o(e,{priority:Number(t)},!0),children:[(0,n.jsx)(N.bq,{className:(0,I.cn)(D,"h-6 gap-1 rounded border-white/10 px-1.5 py-0 text-[10px]"),children:(0,n.jsx)(N.yv,{children:e=>R.find(t=>String(t.v)===e)?.l??e})}),(0,n.jsx)(N.gC,{alignItemWithTrigger:!1,children:R.map(e=>(0,n.jsx)(N.eb,{value:String(e.v),children:e.l},e.v))})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsxs)("button",{type:"button",onClick:t=>{W(t),C?u(e):S(!0)},onBlur:()=>S(!1),title:"Delete node",className:(0,I.cn)(D,"flex items-center gap-1 rounded px-1.5 py-1 text-[10px] transition-colors",C?"bg-red-500/20 text-red-300":"text-muted-foreground hover:bg-white/5 hover:text-red-300"),children:[(0,n.jsx)(j.A,{className:"size-3"}),C&&"Delete?"]}),w&&(0,n.jsxs)("button",{type:"button",onClick:e=>{W(e),w(`feature: ${t.title}`)},title:"Ask the agent a question about this feature (answered in its next round)",className:(0,I.cn)(D,"flex items-center gap-1 rounded px-1.5 py-1 text-[10px] text-sky-300/90 hover:bg-sky-500/15 hover:text-sky-300"),children:[(0,n.jsx)(y.A,{className:"size-3"})," Ask"]}),(0,n.jsxs)("button",{type:"button",onClick:t=>{W(t),c(e)},className:(0,I.cn)(D,"flex items-center gap-1 rounded px-1.5 py-1 text-[10px] text-muted-foreground hover:bg-white/5 hover:text-foreground"),children:[(0,n.jsx)(p.A,{className:"size-3"})," Details"]})]})]})]})]})}var $=s(57144),P=s(73321),L=s(9005),O=s(32133),F=s(82099),_=s(4474),H=s(70521),B=s(74350);function U({className:e,type:t,...s}){return(0,n.jsx)("input",{type:t,"data-slot":"input",className:(0,I.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...s})}function K({className:e,...t}){return(0,n.jsx)("textarea",{"data-slot":"textarea",className:(0,I.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}var X=s(61388);function G({className:e,...t}){return(0,n.jsx)(X.b,{"data-slot":"label",className:(0,I.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var Z=s(9339);let Y=(0,Z.createServerReference)("404ad81c9cf90aad3f674a9acfee3ab66477669023",Z.callServer,void 0,Z.findSourceMapURL,"createNodeAction"),W=(0,Z.createServerReference)("60e949e2cc6edd6b63e3bf61dcae500611d9215041",Z.callServer,void 0,Z.findSourceMapURL,"updateNodeAction");function q({open:e,onOpenChange:t,mode:s,view:r,heading:l,nodeId:o,parentId:i,position:d,defaults:c}){let u=(0,P.useRouter)(),[m,p]=(0,a.useState)(c?.title??""),[x,h]=(0,a.useState)(c?.role??""),[f,g]=(0,a.useState)(c?.plain??""),[b,v]=(0,a.useState)(c?.cluster??""),[j,y]=(0,a.useState)(c?.status??("ARCHITECTURE"===r?"REBUILD":"PENDING")),[C,S]=(0,a.useState)(!1),A="ARCHITECTURE"===r?k:w;async function z(){if(m.trim()){S(!0);try{"create"===s?await Y({view:r,title:m.trim(),role:x.trim()||null,plain:f.trim()||null,cluster:b.trim()||null,parentId:i??null,status:j,x:d?.x??60,y:d?.y??60}):o&&await W(o,{title:m.trim(),role:x.trim()||null,plain:f.trim()||null,cluster:b.trim()||null,status:j}),t(!1),u.refresh()}finally{S(!1)}}}return(0,n.jsx)(B.lG,{open:e,onOpenChange:t,children:(0,n.jsxs)(B.Cf,{children:[(0,n.jsx)(B.c7,{children:(0,n.jsx)(B.L3,{children:l})}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(G,{htmlFor:"nf-title",children:"Title"}),(0,n.jsx)(U,{id:"nf-title",value:m,autoFocus:!0,onChange:e=>p(e.target.value)})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(G,{htmlFor:"nf-role",children:"Role (one line)"}),(0,n.jsx)(U,{id:"nf-role",value:x,onChange:e=>h(e.target.value)})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(G,{htmlFor:"nf-plain",children:"Description"}),(0,n.jsx)(K,{id:"nf-plain",rows:3,value:f,onChange:e=>g(e.target.value)})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(G,{children:"Status"}),(0,n.jsxs)(N.l6,{value:j,onValueChange:e=>null!=e&&y(e),children:[(0,n.jsx)(N.bq,{children:(0,n.jsx)(N.yv,{children:e=>E[e]?.label??e})}),(0,n.jsx)(N.gC,{children:A.map(e=>(0,n.jsx)(N.eb,{value:e,children:E[e]?.label??e},e))})]})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(G,{htmlFor:"nf-cluster",children:"Cluster / lane"}),(0,n.jsx)(U,{id:"nf-cluster",value:b,onChange:e=>v(e.target.value)})]})]})]}),(0,n.jsxs)(B.Es,{children:[(0,n.jsx)(_.$,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),(0,n.jsx)(_.$,{onClick:z,disabled:C||!m.trim(),children:C?"Saving…":"Save"})]})]})})}let V=(0,Z.createServerReference)("407df97c2a5c303f8f9ef0aed1710e6705ed9c560f",Z.callServer,void 0,Z.findSourceMapURL,"acceptSuggestionAction"),J=(0,Z.createServerReference)("40123ca5565c67d7dd21f7c70a875eae2d39c096ee",Z.callServer,void 0,Z.findSourceMapURL,"deleteNodeAction"),Q=(0,Z.createServerReference)("605e2e3c4da2f47895738489205db931d77858cda0",Z.callServer,void 0,Z.findSourceMapURL,"setStatusAction"),ee=(0,Z.createServerReference)("40d4566fae8a6d78be6006ddf01d626d1acac40110",Z.callServer,void 0,Z.findSourceMapURL,"cancelAction"),et=(0,Z.createServerReference)("4056015b0c74fe19b3c9877daa3e613868954be1ac",Z.callServer,void 0,Z.findSourceMapURL,"deprioritizeAction");function es({view:e,selected:t,allNodes:s,onClose:a,commentsContent:r,commentsCount:l=0,activeTab:o,onTabChange:i,onAddComment:d,topOffset:c}){let u=!!r,m=o??"details";return(0,n.jsxs)(F.b,{className:"absolute bottom-3 right-3 z-10 flex w-80 flex-col rounded-2xl",style:{top:c??12},children:[u?(0,n.jsxs)("div",{className:"flex items-center justify-between border-b border-white/10 px-1 py-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,n.jsx)(en,{active:"details"===m,onClick:()=>i?.("details"),children:"Details"}),(0,n.jsxs)(en,{active:"comments"===m,onClick:()=>i?.("comments"),children:["Comments",l>0&&(0,n.jsx)("span",{className:"ml-1 rounded-full bg-white/10 px-1 text-[9px] font-semibold leading-4",children:l})]})]}),(0,n.jsx)("button",{onClick:a,title:"Close panel",className:"mr-1 rounded-md p-1 text-muted-foreground transition-colors hover:bg-white/10 hover:text-foreground",children:(0,n.jsx)(L.A,{className:"size-4"})})]}):(0,n.jsxs)("div",{className:"flex items-center justify-between border-b border-white/10 px-3.5 py-2.5",children:[(0,n.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Details"}),(0,n.jsx)("button",{onClick:a,title:"Close panel",className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-white/10 hover:text-foreground",children:(0,n.jsx)(L.A,{className:"size-4"})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,n.jsx)("div",{className:"p-3",children:"comments"===m&&u?r:t?(0,n.jsxs)(n.Fragment,{children:[d&&(0,n.jsxs)("button",{type:"button",onClick:()=>d(t.title),className:"mb-3 flex w-full items-center justify-center gap-1.5 rounded-lg border border-white/10 bg-white/[0.03] px-3 py-1.5 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground",children:[(0,n.jsx)(O.A,{className:"size-3.5"}),"Comment on this ","ARCHITECTURE"===e?"component":"feature"]}),(0,n.jsx)(ea,{node:t,view:e},t.id)]}):(0,n.jsx)(er,{view:e,nodes:s})})})]})}function en({active:e,onClick:t,children:s}){return(0,n.jsx)("button",{type:"button",onClick:t,className:(0,I.cn)("flex items-center gap-1 rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors",e?"bg-white/10 text-foreground":"text-muted-foreground hover:text-foreground"),children:s})}function ea({node:e,view:t}){var s;let r=(0,P.useRouter)(),[l,o]=(0,a.useTransition)(),[i,d]=(0,a.useState)(!1),[c,u]=(0,a.useState)(!1),m="ARCHITECTURE"===t?k:w,p=e=>o(async()=>{await e(),r.refresh()});return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:[(s=e.cluster,s?.trim()||"—"),0===e.priority&&(0,n.jsx)("span",{className:"ml-2 text-[#ff7a90]",children:"\xb7 critical path"})]}),(0,n.jsx)("h2",{className:"mt-1 text-lg font-semibold leading-tight",children:e.title})]}),"INIT"===e.source&&(0,n.jsxs)("div",{className:"rounded-lg border border-violet-400/30 bg-violet-500/[0.06] p-2.5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-violet-300",children:[(0,n.jsx)(v.A,{className:"size-3.5"})," AI suggestion"]}),(0,n.jsx)("p",{className:"mt-1 text-[11px] leading-snug text-muted-foreground",children:"Suggested direction surfaced when mapping the repo. Accept to turn it into your own feature, or dismiss."}),(0,n.jsxs)("div",{className:"mt-2 flex gap-1.5",children:[(0,n.jsx)(_.$,{size:"sm",className:"h-7 px-2.5 text-xs",disabled:l,onClick:()=>p(()=>V(e.id)),children:"Accept"}),(0,n.jsx)(_.$,{size:"sm",variant:"outline",className:"h-7 px-2.5 text-xs text-muted-foreground",disabled:l,onClick:()=>p(()=>J(e.id)),children:"Dismiss"})]})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:"Status"}),(0,n.jsxs)(N.l6,{value:e.status,onValueChange:t=>null!=t&&p(()=>Q(e.id,t)),children:[(0,n.jsx)(N.bq,{className:"h-8",disabled:l,children:(0,n.jsx)(N.yv,{children:e=>E[e]?.label??e})}),(0,n.jsx)(N.gC,{children:m.map(e=>(0,n.jsx)(N.eb,{value:e,children:E[e]?.label??e},e))})]})]}),e.plain&&(0,n.jsx)("div",{className:"rounded-md border border-white/5 bg-card/40 px-2.5 py-2 text-sm",children:(0,n.jsx)(T.pO,{markdown:e.plain,variant:"compact",className:"text-[12.5px]"})}),e.sourceRef&&(0,n.jsx)("div",{className:"rounded-md border border-border bg-card px-2 py-1.5 font-mono text-xs text-muted-foreground",children:e.sourceRef}),e.files.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("h3",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["Files (",e.files.length,")"]}),(0,n.jsx)("ul",{className:"space-y-0.5",children:e.files.map(e=>(0,n.jsx)("li",{children:(0,n.jsx)("button",{onClick:()=>fetch(`/api/open?path=${encodeURIComponent(e)}`).catch(()=>{}),title:`Open ${e} in editor`,className:"block w-full truncate rounded px-1.5 py-0.5 text-left font-mono text-[11px] text-muted-foreground transition-colors hover:bg-white/5 hover:text-foreground",children:e})},e))})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-1.5 pt-1",children:[(0,n.jsx)(_.$,{size:"sm",variant:"outline",onClick:()=>d(!0),children:"Edit"}),(0,n.jsx)(_.$,{size:"sm",variant:"outline",onClick:()=>u(!0),children:"+ Sub-node"}),(0,n.jsx)(_.$,{size:"sm",variant:"outline",disabled:l,onClick:()=>p(()=>ee(e.id)),children:"Cancel"}),(0,n.jsx)(_.$,{size:"sm",variant:"outline",disabled:l,onClick:()=>p(()=>et(e.id)),children:"Deprioritize"}),(0,n.jsxs)(H.Lt,{children:[(0,n.jsx)(H.tv,{render:(0,n.jsx)(_.$,{size:"sm",variant:"outline",className:"text-red-300",children:"Delete"})}),(0,n.jsxs)(H.EO,{children:[(0,n.jsxs)(H.wd,{children:[(0,n.jsxs)(H.r7,{children:["Delete “",e.title,"”?"]}),(0,n.jsx)(H.$v,{children:"This removes the node and all its sub-nodes. It can’t be undone."})]}),(0,n.jsxs)(H.ck,{children:[(0,n.jsx)(H.Zr,{children:"Cancel"}),(0,n.jsx)(H.Rx,{onClick:()=>p(()=>J(e.id)),children:"Delete"})]})]})]})]}),i&&(0,n.jsx)(q,{open:!0,onOpenChange:d,mode:"edit",view:t,heading:"Edit node",nodeId:e.id,defaults:{title:e.title,role:e.role,plain:e.plain,status:e.status,cluster:e.cluster}}),c&&(0,n.jsx)(q,{open:!0,onOpenChange:u,mode:"create",view:t,heading:"New sub-node",parentId:e.id,position:{x:e.x,y:e.y+120},defaults:{cluster:e.cluster}})]})}function er({view:e,nodes:t}){let s=t.filter(e=>0===e.priority).length;return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-sm font-semibold",children:"ROADMAP"===e?"Roadmap":"Architecture"}),(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Click a node for details and actions. Drag to rearrange — positions are saved."})]}),(0,n.jsxs)("dl",{className:"grid grid-cols-2 gap-2 text-center",children:[(0,n.jsx)(el,{label:"nodes",value:t.length}),(0,n.jsx)(el,{label:"critical",value:s})]})]})}function el({label:e,value:t}){return(0,n.jsxs)("div",{className:"rounded-md border border-border bg-card py-2",children:[(0,n.jsx)("div",{className:"text-lg font-semibold",children:t}),(0,n.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e})]})}var eo=s(18874),ei=s(62311),ed=s(56614);let ec=[{value:"cluster",label:"Theme"},{value:"status",label:"Status"},{value:"priority",label:"Priority"}],eu=new Set(["title","role","plain","cluster","status","priority"]),em={roadmapNode:M,archNode:M},ep={deletable:$.I},ex={CONTAINS:{stroke:"#7c7c8a"},DEPENDS:{stroke:"#f5b942",dash:"6 4"},RELATES:{stroke:"#8a8a95",dash:"4 4"},REPLACES:{stroke:"#ff6b9d"}};function eh({view:e,nodes:t,edges:s,workOnNextId:x=null,embedded:h=!1,commentsContent:f,commentsCount:g=0,controlRef:b,onAskAgent:v,onAddComment:j}){let y=(0,a.useMemo)(()=>t.map(e=>({id:e.id,type:"ROADMAP"===e.view?"roadmapNode":"archNode",position:{x:e.x,y:e.y},data:{title:e.title,role:e.role,plain:e.plain,status:e.status,priority:e.priority,cluster:e.cluster,view:e.view,source:e.source,sourceRef:e.sourceRef,isCriterion:e.isCriterion,isChild:null!=e.parentId,parentId:e.parentId,signals:e.signals}})),[t]),N=(0,a.useMemo)(()=>{let e;return e=new Set(t.map(e=>e.id)),[...t.filter(t=>t.parentId&&e.has(t.parentId)).map(e=>({id:`c-${e.id}`,source:e.parentId,sourceHandle:"sb",target:e.id,targetHandle:"tt",type:"smoothstep",style:{stroke:ex.CONTAINS.stroke}})),...s.filter(t=>e.has(t.fromId)&&e.has(t.toId)).map(e=>{let t=ex[e.kind]??ex.RELATES,s="DEPENDS"===e.kind?"depends on":void 0;return{id:e.id,source:e.fromId,sourceHandle:e.sourceHandle??void 0,target:e.toId,targetHandle:e.targetHandle??void 0,label:e.label??s,type:"deletable",markerEnd:{type:r.TG.ArrowClosed,color:t.stroke},style:{stroke:t.stroke,strokeDasharray:t.dash}}})]},[t,s]),[S,A]=(0,a.useState)(y),[T,R]=(0,a.useState)(N),[D,M]=(0,a.useState)(null),[$,P]=(0,a.useState)(null),[L,O]=(0,a.useState)(null),[F,_]=(0,a.useState)(!1),[H,B]=(0,a.useState)("details"),U=(0,a.useRef)(!1),K=(0,a.useRef)("details");(0,a.useEffect)(()=>{U.current=F},[F]),(0,a.useEffect)(()=>{K.current=H},[H]),(0,a.useEffect)(()=>{if(b)return b.current={open:()=>{if(U.current){_(!1),B("details");return}_(!0),B("details")},close:()=>{_(!1),B("details")},openComments:()=>{_(!0),B("comments")}},()=>{b&&(b.current=null)}},[b]);let[X,G]=(0,a.useState)(new Set),[Z,Y]=(0,a.useState)(null),[W,q]=(0,a.useState)(!1),V=(0,a.useRef)(0),J=(0,a.useRef)(null);(0,a.useEffect)(()=>A(y),[y]),(0,a.useEffect)(()=>R(N),[N]);let Q=(0,a.useCallback)((e,t,s)=>{A(s=>s.map(s=>s.id===e?{...s,data:{...s.data,...t}}:s)),s&&fetch(`/api/nodes/${e}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(Object.fromEntries(Object.entries(t).filter(([e])=>eu.has(e))))})},[]),ee=(0,a.useMemo)(()=>Array.from(new Set(S.map(e=>e.data.cluster).filter(e=>!!e))).sort(),[S]),et=(0,a.useCallback)(e=>G(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s}),[]),en=(0,a.useCallback)(e=>{M(e),_(!0),B("details")},[]),ea=(0,a.useCallback)(e=>{A(t=>t.filter(t=>t.id!==e)),M(t=>t===e?null:t),fetch(`/api/nodes/${e}`,{method:"DELETE"})},[]),er=(0,a.useCallback)(async()=>{let t=V.current++%8*28,s=80+t,n=80+t;try{let t=await fetch("/api/nodes",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({view:e,title:"New node",status:"ARCHITECTURE"===e?"REBUILD":"PENDING",x:s,y:n})});if(!t.ok)return;let a=await t.json();A(t=>[...t,{id:a.id,type:"ROADMAP"===e?"roadmapNode":"archNode",position:{x:s,y:n},data:{title:a.title,role:a.role,plain:a.plain,status:a.status,priority:a.priority,cluster:a.cluster,view:a.view,source:a.source,sourceRef:a.sourceRef,isCriterion:!1,isChild:null!=a.parentId,parentId:a.parentId??null}}]),G(e=>new Set(e).add(a.id)),Y(a.id),M(a.id)}catch{}},[e]),el=(0,a.useMemo)(()=>({view:e,categories:ee,statuses:"ARCHITECTURE"===e?k:w,patch:Q,isExpanded:e=>X.has(e),toggleExpand:et,openDetailed:en,removeNode:ea,editingTitleId:Z,onAskAgent:v}),[e,ee,Q,X,et,en,ea,Z,v]),[ef,eg]=(0,a.useState)(null),[eb,ev]=(0,a.useState)(""),[ej,ey]=(0,a.useState)(new Set),[eN,ew]=(0,a.useState)(new Set),[ek,eC]=(0,a.useState)(new Set),eE=(0,a.useMemo)(()=>Array.from(new Set(t.map(e=>e.status))),[t]),eS=(0,a.useMemo)(()=>Array.from(new Set(t.map(e=>e.cluster).filter(e=>!!e))).sort(),[t]),eA=(0,a.useMemo)(()=>Array.from(new Set(t.map(e=>e.priority))).sort((e,t)=>e-t),[t]),ez=(0,a.useCallback)(e=>(!ej.size||!!ej.has(e.status))&&(!eN.size||!!e.cluster&&!!eN.has(e.cluster))&&(!ek.size||!!ek.has(e.priority)),[ej,eN,ek]),eT=ej.size+eN.size+ek.size,eI=(0,a.useCallback)(()=>{ey(new Set),ew(new Set),eC(new Set)},[]),eR=(0,a.useMemo)(()=>S.map(e=>({...e,hidden:!ez(e.data)})),[S,ez]),eD=(0,a.useMemo)(()=>new Set(eR.filter(e=>e.hidden).map(e=>e.id)),[eR]),eM=(0,a.useMemo)(()=>T.map(e=>({...e,hidden:eD.has(e.source)||eD.has(e.target)})),[T,eD]),e$=(0,a.useMemo)(()=>{if($){let e=eM.find(e=>e.id===$);return e?new Set([e.source,e.target]):null}return D?(0,eo.F1)(D,eM.filter(e=>!e.hidden)):null},[D,$,eM]),eP=(0,a.useMemo)(()=>eR.map(e=>{let t=x&&e.id===x?{...e,data:{...e.data,isNext:!0}}:e;return!e$||t.hidden?t:{...t,style:{...t.style,opacity:e$.has(e.id)?1:.45,transition:"opacity 120ms"}}}),[eR,e$,x]),eL=(0,a.useMemo)(()=>{if(!ef||"ROADMAP"!==e)return[];let t=new Map(eP.map(e=>[e.id,e])),s=new Map;for(let e of eP){var n;if(e.hidden)continue;let a=(n=((e.data.parentId?t.get(e.data.parentId):void 0)??e).data,"status"===ef?E[n.status]?.label??n.status:"priority"===ef?`P${n.priority}`:n.cluster?.trim()||"—"),r=e.measured?.width??(e.data.isChild?224:256),l=e.measured?.height??96,o=e.position.x,i=e.position.y,d=s.get(a);d?(d.minX=Math.min(d.minX,o),d.minY=Math.min(d.minY,i),d.maxX=Math.max(d.maxX,o+r),d.maxY=Math.max(d.maxY,i+l)):s.set(a,{label:a,minX:o,minY:i,maxX:o+r,maxY:i+l})}return Array.from(s.values()).map(e=>({label:e.label,x:e.minX-20,y:e.minY-20-26,w:e.maxX-e.minX+40,h:e.maxY-e.minY+40+26}))},[eP,ef,e]),eO=(0,a.useMemo)(()=>{let e=D??L;return $||e?eM.map(t=>t.hidden?t:($?t.id===$:t.source===e||t.target===e)?{...t,zIndex:20,style:{...t.style,opacity:1,strokeWidth:2.5}}:{...t,selectable:!1,label:void 0,markerEnd:void 0,style:{...t.style,opacity:.06}}):eM.map(e=>e.hidden?e:{...e,label:void 0,style:{...e.style,opacity:.18}})},[eM,D,$,L]),eF=(0,a.useCallback)(e=>A(t=>(0,l._0)(e,t)),[]),e_=(0,a.useCallback)(e=>R(t=>(0,l.zW)(e,t)),[]),eH=(0,a.useCallback)(async e=>{if(!e.source||!e.target||e.source===e.target)return;let t=await fetch("/api/edges",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({fromId:e.source,toId:e.target,kind:"DEPENDS",sourceHandle:e.sourceHandle??null,targetHandle:e.targetHandle??null})});if(!t.ok)return;let s=await t.json(),n=ex.DEPENDS;R(t=>t.some(e=>e.id===s.id)?t:[...t,{id:s.id,source:s.fromId,sourceHandle:e.sourceHandle??void 0,target:s.toId,targetHandle:e.targetHandle??void 0,label:"depends on",type:"deletable",markerEnd:{type:r.TG.ArrowClosed,color:n.stroke},style:{stroke:n.stroke,strokeDasharray:n.dash}}])},[]),eB=(0,a.useCallback)(async(t,s,n)=>{let a=await fetch("/api/nodes",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({view:e,title:"New node",parentId:t.id,cluster:t.data.cluster??null,status:"ARCHITECTURE"===e?"REBUILD":"PENDING",x:s,y:n})});if(!a.ok)return;let r=await a.json();A(a=>[...a,{id:r.id,type:"ROADMAP"===e?"roadmapNode":"archNode",position:{x:s,y:n},data:{title:r.title,role:r.role,plain:r.plain,status:r.status,priority:r.priority,cluster:r.cluster,view:r.view,source:r.source,sourceRef:r.sourceRef,isCriterion:!1,isChild:!0,parentId:t.id}}]),R(e=>[...e,{id:`c-${r.id}`,source:t.id,target:r.id,type:"smoothstep",style:{stroke:ex.CONTAINS.stroke}}]),G(e=>new Set(e).add(r.id)),Y(r.id),M(r.id)},[e]),eU=(0,a.useCallback)(async(e,t)=>{if(t.isValid||!t.fromNode||!J.current)return;let s=e.changedTouches,n=s?.[0]?.clientX??e.clientX,a=s?.[0]?.clientY??e.clientY,{x:r,y:l}=J.current.screenToFlowPosition({x:n,y:a});await eB(t.fromNode,r,l)},[eB]);(0,a.useEffect)(()=>{if(!W)return;let e=e=>{"Escape"===e.key&&q(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[W]);let eK=(0,a.useMemo)(()=>t.find(e=>e.id===D)??null,[t,D]),eX=(0,a.useCallback)((e,t,s)=>{fetch(`/api/nodes/${e}/position`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({x:t,y:s})})},[]),eG=(0,a.useCallback)(e=>{M(e),P(null);let t=J.current?.getNode(e);if(!t||!J.current)return;let s=t.measured?.width??128,n=t.measured?.height??48;J.current.setCenter(t.position.x+s/2,t.position.y+n/2,{zoom:1.2,duration:600})},[]),eZ=(0,a.useCallback)(e=>{let t=function(e,t,s={}){let n=s.colW??320,a=s.rowH??150,r=s.childIndent??24,l=s.laneGap??56,o=s.bandGap??110,i=s.maxCols??4,d=s.maxBandW??6*n,c=new Set(e.map(e=>e.id)),u=e=>!e.parentId||!c.has(e.parentId),m=e.filter(u),p=new Map;for(let t of e){if(u(t))continue;let e=p.get(t.parentId);e?e.push(t):p.set(t.parentId,[t])}let x="status"===t?e=>e.status:"priority"===t?e=>String(e.priority):e=>(e.cluster??"").trim()||"—",h=new Map;for(let e of m){let t=x(e),s=h.get(t);s?s.push(e):h.set(t,[e])}let f=(function(e,t,s){if("status"===e)return[...C];if("priority"===e)return["0","1","2","3"];let n=Array.from(new Set(t.map(s))),a=n.filter(e=>"—"!==e).sort();return n.includes("—")?[...a,"—"]:a})(t,m,x).filter(e=>h.has(e)),g=new Map,b=0,v=0,j=0;for(let e of f){let t=h.get(e),s=Math.max(1,Math.min(i,Math.ceil(Math.sqrt(t.length)))),c=s*n;b>0&&b+c>d&&(b=0,v+=j+o,j=0);let u=Array(s).fill(0);for(let e of t){let t=0;for(let e=1;e<s;e++)u[e]<u[t]&&(t=e);let l=b+t*n,o=v+u[t]*a;g.set(e.id,{x:l,y:o});let i=p.get(e.id)??[];i.forEach((e,t)=>{g.set(e.id,{x:l+r,y:o+(t+1)*a})}),u[t]+=1+i.length}j=Math.max(j,u.reduce((e,t)=>Math.max(e,t),0)*a),b+=c+l}return g}(S.map(e=>({id:e.id,parentId:e.data.parentId??null,cluster:e.data.cluster,status:e.data.status,priority:e.data.priority})),e);A(e=>e.map(e=>{let s=t.get(e.id);return s?{...e,position:s}:e}));let s=Array.from(t,([e,t])=>({id:e,x:t.x,y:t.y}));s.length&&fetch("/api/nodes/positions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({batch:s})}),eg(e),requestAnimationFrame(()=>J.current?.fitView({duration:600,padding:.2}))},[S]),eY=(0,a.useMemo)(()=>{let e=eb.trim().toLowerCase();return e?S.filter(t=>ez(t.data)&&t.data.title.toLowerCase().includes(e)).slice(0,8):[]},[S,eb,ez]);function eW(e,t){t(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})}return(0,n.jsx)(z.Provider,{value:el,children:(0,n.jsxs)("div",{className:(0,I.cn)("relative w-full",h?"h-full":"h-screen"),children:[(0,n.jsxs)(l.Gc,{nodes:eP,edges:eO,nodeTypes:em,edgeTypes:ep,connectionMode:r.WZ.Loose,connectionLineStyle:{stroke:"var(--accent-2,#ff7a45)",strokeWidth:1.5,strokeDasharray:"4 4"},onInit:e=>{J.current=e},onNodesChange:eF,onEdgesChange:e_,onConnect:eH,onConnectEnd:eU,onNodeMouseEnter:(e,t)=>O(t.id),onNodeMouseLeave:()=>O(null),onEdgesDelete:e=>{for(let t of e)t.id.startsWith("c-")||fetch(`/api/edges/${t.id}`,{method:"DELETE"})},onNodesDelete:e=>{for(let t of e)fetch(`/api/nodes/${t.id}`,{method:"DELETE"}),M(e=>e===t.id?null:e)},onNodeClick:(e,t)=>{if(W){if(q(!1),t.data.isChild)return;eB(t,t.position.x+300,t.position.y+60);return}if(M(t.id),P(null),B("details"),h){let t=e.target;t?.closest("input, textarea, select, button, [role='combobox']")||_(!0)}},onEdgeClick:(e,t)=>{P(t.id),M(null),B("details")},onPaneClick:()=>{W?q(!1):(M(null),P(null))},onNodeDragStop:(e,t)=>eX(t.id,t.position.x,t.position.y),deleteKeyCode:["Backspace","Delete"],colorMode:"dark",fitView:!0,minZoom:.2,panOnScroll:!0,zoomActivationKeyCode:["Meta","Control"],proOptions:{hideAttribution:!0},children:[(0,n.jsx)(l.VS,{gap:22,color:"#2a2a32"}),eL.length>0&&(0,n.jsx)(l.DX,{children:eL.map(e=>(0,n.jsx)("div",{style:{position:"absolute",transform:`translate(${e.x}px, ${e.y}px)`,width:e.w,height:e.h,pointerEvents:"none",zIndex:0},className:"rounded-2xl border border-white/[0.08] bg-white/[0.015]",children:(0,n.jsx)("div",{className:"px-3 py-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground/70",children:e.label})},e.label))}),(0,n.jsx)(l.H2,{position:"bottom-right",className:"!overflow-hidden !rounded-xl !border !border-white/10 [&_button]:!border-white/10 [&_button]:!bg-card/70 [&_button]:!text-foreground [&_button]:!backdrop-blur"}),(0,n.jsx)(l.Zk,{position:"bottom-right",style:{marginBottom:152},children:(0,n.jsx)(ed.er,{title:"Legend",trigger:(e,t)=>(0,n.jsx)("button",{type:"button",onClick:t,title:"Legend",className:(0,I.cn)("glass flex size-8 items-center justify-center rounded-lg transition-colors",e?"text-foreground":"text-muted-foreground hover:text-foreground"),children:(0,n.jsx)(o.A,{className:"size-4"})}),children:(0,n.jsxs)("ul",{className:"space-y-1.5 text-[10.5px] text-muted-foreground",children:[(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"inline-block rounded bg-sky-500/15 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-sky-300",children:"feature"}),(0,n.jsx)("span",{children:"top-level card \xb7 can have sub-tasks"})]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"inline-block rounded bg-zinc-500/15 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-zinc-300",children:"sub-task"}),(0,n.jsx)("span",{children:"child of a feature"})]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"inline-block h-px w-6 bg-[#33333a]"}),(0,n.jsx)("span",{children:"contains \xb7 drag the bottom handle to empty canvas"})]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"inline-block h-0 w-6 border-t border-dashed",style:{borderColor:"#f5b942"}}),(0,n.jsx)("span",{children:"depends on \xb7 drag between two cards"})]})]})})}),!h&&(0,n.jsx)(l.of,{pannable:!0,zoomable:!0,position:"bottom-left",style:{width:140,height:90},className:"!rounded-xl !border !border-white/10 !bg-card/50 !backdrop-blur",nodeColor:e=>e.data?.priority===0?"#ff3860":"#555"}),(0,n.jsxs)(l.Zk,{position:"bottom-center",className:"!mb-4 flex flex-col items-center gap-2",children:[W&&(0,n.jsxs)("div",{className:"glass rounded-full px-3 py-1 text-[11px] text-muted-foreground",children:["Click a ","ARCHITECTURE"===e?"component":"feature"," to attach the"," ","ARCHITECTURE"===e?"sub-component":"sub-task"," \xb7 Esc to cancel"]}),"ROADMAP"===e&&(0,n.jsxs)("div",{className:"glass flex items-center gap-1 rounded-full p-1",children:[(0,n.jsx)("span",{className:"pl-2 pr-0.5 text-[11px] text-muted-foreground",children:"Group by"}),ec.map(e=>(0,n.jsx)("button",{onClick:()=>eZ(e.value),title:`Arrange features into lanes by ${e.label.toLowerCase()}`,className:(0,I.cn)("h-7 rounded-full px-2.5 text-[11px] font-medium transition-colors",ef===e.value?"bg-white/[0.12] text-foreground":"text-muted-foreground hover:bg-white/[0.06] hover:text-foreground"),children:e.label},e.value))]}),(0,n.jsxs)("div",{className:"glass flex items-center gap-1 rounded-full p-1",children:[(0,n.jsxs)("button",{onClick:()=>void er(),title:"ARCHITECTURE"===e?"Add component":"Add feature",className:"flex h-8 items-center gap-1.5 rounded-full px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-white/[0.06]",children:[(0,n.jsx)(i.A,{className:"size-3.5 text-[var(--accent-2,#ff7a45)]"}),"ARCHITECTURE"===e?"Component":"Feature"]}),(0,n.jsx)("span",{"aria-hidden":!0,className:"mx-0.5 h-5 w-px bg-white/10"}),(0,n.jsxs)("button",{onClick:()=>q(e=>!e),title:"ARCHITECTURE"===e?"Add sub-component (click a component next)":"Add sub-task (click a feature next)",className:(0,I.cn)("flex h-8 items-center gap-1.5 rounded-full px-3 text-[12px] font-medium transition-colors",W?"bg-white/[0.1] text-foreground":"text-muted-foreground hover:bg-white/[0.06] hover:text-foreground"),children:[(0,n.jsx)(d.A,{className:"size-3.5"}),"ARCHITECTURE"===e?"Sub-component":"Sub-task"]})]})]}),!h&&(0,n.jsx)(l.Zk,{position:"top-center",className:"glass rounded-full px-1 py-0.5",children:(0,n.jsx)(ei.Z,{active:e,tabs:[{value:"ROADMAP",label:"Roadmap",href:"/map?view=ROADMAP"},{value:"ARCHITECTURE",label:"Architecture",href:"/map?view=ARCHITECTURE"},{value:"FILES",label:"Files",href:"/map?view=FILES"},{value:"DATABASE",label:"Database",href:"/map?view=DATABASE"}]})}),(0,n.jsxs)(l.Zk,{position:"top-right",className:(0,I.cn)("flex items-center gap-1 transition-[margin] duration-200",F&&"!mr-[332px]",h&&"hidden"),children:[(0,n.jsxs)(ed.er,{title:"Search",trigger:(e,t)=>(0,n.jsx)("button",{type:"button",onClick:t,title:"Search features",className:(0,I.cn)("glass flex size-8 items-center justify-center rounded-lg transition-colors",e?"text-foreground":"text-muted-foreground hover:text-foreground"),children:(0,n.jsx)(c.A,{className:"size-4"})}),children:[(0,n.jsx)("input",{autoFocus:!0,value:eb,onChange:e=>ev(e.target.value),placeholder:"Find a feature…",className:"w-full rounded-md border border-white/10 bg-white/[0.04] px-2 py-1 text-[12px] outline-none placeholder:text-muted-foreground/50 focus:bg-white/[0.08]"}),(0,n.jsxs)("div",{className:"mt-2 max-h-64 space-y-0.5 overflow-y-auto",children:[eb.trim()&&0===eY.length&&(0,n.jsx)("div",{className:"px-1 py-1 text-[11px] text-muted-foreground",children:"No matches"}),eY.map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>eG(e.id),className:"block w-full truncate rounded-md px-2 py-1 text-left text-[12px] text-muted-foreground transition-colors hover:bg-white/5 hover:text-foreground",children:e.data.title},e.id))]})]}),"ROADMAP"===e&&x&&(0,n.jsx)("button",{type:"button",onClick:()=>eG(x),title:"Jump to the next feature to work on",className:"glass flex size-8 items-center justify-center rounded-lg text-emerald-300 transition-colors hover:text-emerald-200",children:(0,n.jsx)(u.A,{className:"size-4"})}),(0,n.jsxs)(ed.er,{title:"Filters",trigger:(e,t)=>(0,n.jsxs)("button",{type:"button",onClick:t,title:"Filters",className:(0,I.cn)("glass relative flex size-8 items-center justify-center rounded-lg transition-colors",e||eT>0?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,n.jsx)(m.A,{className:"size-4"}),eT>0&&(0,n.jsx)("span",{className:"absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-[var(--accent-2,#ff7a45)] px-1 text-[9px] font-semibold text-white",children:eT})]}),children:[eE.length>0&&(0,n.jsx)(ed.r1,{title:"Status",children:eE.map(e=>(0,n.jsx)(ed.vu,{on:ej.has(e),onClick:()=>eW(e,ey),children:E[e]?.label??e},e))}),eS.length>0&&(0,n.jsx)(ed.r1,{title:"Cluster",children:eS.map(e=>(0,n.jsx)(ed.vu,{on:eN.has(e),onClick:()=>eW(e,ew),children:e},e))}),eA.length>0&&(0,n.jsx)(ed.r1,{title:"Priority",children:eA.map(e=>(0,n.jsxs)(ed.vu,{on:ek.has(e),onClick:()=>eW(e,eC),children:["P",e]},e))}),eT>0&&(0,n.jsx)("button",{type:"button",onClick:eI,className:"mt-1 w-full rounded-md border border-white/10 px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-white/5 hover:text-foreground",children:"clear filters"})]}),!F&&(0,n.jsx)("button",{onClick:()=>{_(!0),B("details")},title:"Show panel",className:"glass flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:text-foreground",children:(0,n.jsx)(p.A,{className:"size-4"})})]})]}),F&&(0,n.jsx)(es,{view:e,selected:eK,allNodes:t,onClose:()=>{_(!1),B("details")},commentsContent:f,commentsCount:g,activeTab:H,onTabChange:B,onAddComment:j,topOffset:h?64:void 0})]})})}},56614:(e,t,s)=>{s.d(t,{er:()=>l,r1:()=>o,vu:()=>i});var n=s(95155),a=s(12115),r=s(91337);function l({trigger:e,title:t,align:s="right",children:o}){let[i,d]=(0,a.useState)(!1),c=(0,a.useRef)(null);return(0,a.useEffect)(()=>{if(!i)return;let e=e=>{c.current?.contains(e.target)||d(!1)},t=e=>{"Escape"===e.key&&d(!1)};return window.addEventListener("mousedown",e),window.addEventListener("keydown",t),()=>{window.removeEventListener("mousedown",e),window.removeEventListener("keydown",t)}},[i]),(0,n.jsxs)("div",{ref:c,className:"relative",children:[e(i,()=>d(e=>!e)),i&&(0,n.jsxs)("div",{className:(0,r.cn)("glass absolute top-full z-30 mt-1.5 w-64 rounded-xl p-3 shadow-xl","right"===s?"right-0":"left-0"),children:[t&&(0,n.jsx)("div",{className:"mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:t}),o]})]})}function o({title:e,children:t}){return(0,n.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,n.jsx)("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80",children:e}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1",children:t})]})}function i({on:e,onClick:t,children:s,tone:a="default"}){return(0,n.jsx)("button",{type:"button",onClick:t,className:(0,r.cn)("rounded-md border px-2 py-0.5 text-[11px] font-medium transition-colors",{default:e?"border-foreground/40 bg-white/10 text-foreground":"border-white/10 text-muted-foreground hover:text-foreground",danger:e?"border-red-500/40 bg-red-500/15 text-red-300":"border-white/10 text-muted-foreground hover:text-foreground",accent:e?"border-sky-500/40 bg-sky-500/15 text-sky-300":"border-white/10 text-muted-foreground hover:text-foreground"}[a]),children:s})}},57144:(e,t,s)=>{s.d(t,{I:()=>c});var n=s(95155),a=s(81750),r=s(6266),l=s(65738);function o(e){let{x:t,y:s}=e.internals.positionAbsolute,n=e.measured?.width??0,a=e.measured?.height??0;return{x:t,y:s,w:n,h:a,cx:t+n/2,cy:s+a/2}}function i(e,t){let s=o(e),n=o(t),a=s.w/2||1,r=s.h/2||1,l=(n.cx-s.cx)/(2*a)-(n.cy-s.cy)/(2*r),i=(n.cx-s.cx)/(2*a)+(n.cy-s.cy)/(2*r),d=1/(Math.abs(l)+Math.abs(i)||1);return{x:a*d*(l+i)+s.cx,y:r*d*(-l+i)+s.cy}}function d(e,t){let s=o(e),n=Math.round(t.x),a=Math.round(t.y);return n<=Math.round(s.x)+1?r.yX.Left:n>=Math.round(s.x+s.w)-1?r.yX.Right:a<=Math.round(s.y)+1?r.yX.Top:r.yX.Bottom}function c(e){let t,s,{deleteElements:o}=(0,a.VH)(),c=(0,a.JY)(e.source),u=(0,a.JY)(e.target),m=c&&u?(t=i(c,u),s=i(u,c),{sx:t.x,sy:t.y,tx:s.x,ty:s.y,sourcePos:d(c,t),targetPos:d(u,s)}):null,[p,x,h]=(0,r.Fp)(m?{sourceX:m.sx,sourceY:m.sy,sourcePosition:m.sourcePos,targetX:m.tx,targetY:m.ty,targetPosition:m.targetPos}:{sourceX:e.sourceX,sourceY:e.sourceY,sourcePosition:e.sourcePosition,targetX:e.targetX,targetY:e.targetY,targetPosition:e.targetPosition});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.tE,{id:e.id,path:p,style:e.style,markerEnd:e.markerEnd,interactionWidth:20}),e.label&&(0,n.jsx)(a.rV,{children:(0,n.jsx)("div",{style:{position:"absolute",transform:`translate(-50%, -120%) translate(${x}px, ${h}px)`,fontSize:11,color:"#cfcfcf",background:"#161616",padding:"1px 4px",borderRadius:4,pointerEvents:"none"},children:e.label})}),e.selected&&(0,n.jsx)(a.rV,{children:(0,n.jsx)("div",{className:"nodrag nopan",style:{position:"absolute",transform:`translate(-50%, 0) translate(${x}px, ${h+14}px)`,pointerEvents:"all",zIndex:1e3},children:(0,n.jsx)("button",{type:"button",onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),o({edges:[{id:e.id}]})},title:"Delete (or press Backspace)",className:"flex size-7 items-center justify-center rounded-full border border-white/20 bg-card/95 text-red-300 shadow-lg backdrop-blur-md transition-colors hover:bg-red-500/25 hover:text-red-200",children:(0,n.jsx)(l.A,{className:"size-3.5"})})})})]})}},60874:(e,t,s)=>{s.d(t,{F8:()=>b,NG:()=>x,QH:()=>h,Vq:()=>g,aM:()=>y,cV:()=>w,kz:()=>j,n$:()=>m,pO:()=>l,vB:()=>v});var n=s(95155),a=s(12115),r=s(91337);function l({markdown:e,className:t,variant:s="reading"}){let o=(0,a.useMemo)(()=>m(e),[e]),i="reading"===s;return(0,n.jsx)("div",{className:(0,r.cn)("min-w-0 [overflow-wrap:anywhere]",i?"mx-auto w-full max-w-[66ch] space-y-4 text-[15px] leading-[1.6]":"space-y-3.5 text-[13px] leading-relaxed",t),children:o.map((e,t)=>(0,n.jsx)(N,{block:e,variant:s},t))})}function o(e){let t=e.trim();return t.includes("|")&&t.includes("-")&&/^[\s|:-]+$/.test(t)}function i(e){return""!==e.trim()&&e.includes("|")}function d(e){let t=e.trim();return t.startsWith("|")&&(t=t.slice(1)),t.endsWith("|")&&(t=t.slice(0,-1)),t.split("|").map(e=>e.trim())}function c(e){let t=e.trim(),s=t.startsWith(":"),n=t.endsWith(":");return s&&n?"center":n?"right":s?"left":null}let u=/^\s*```[^\s`]*\s*$/;function m(e){let t=e.split("\n"),s=[],n=[],a=()=>{n.length&&(s.push({kind:"p",text:n.join("\n")}),n=[])},r=null,l=()=>{null!==r&&(s.push({kind:"quote",text:r.join("\n")}),r=null)},m=e=>Math.min(6,Math.floor(e.length/2)),p=null,x=null;for(let e=0;e<t.length;e++){let h=t[e];if(null!==p){u.test(h)?(s.push({kind:"code",text:p.join("\n")}),p=null):p.push(h);continue}let f=h.match(/^>\s?(.*)$/);if(f){a(),x=null,(r??=[]).push(f[1]);continue}if(l(),u.test(h)){a(),x=null,p=[];continue}if(/^\s*$/.test(h)){a(),x=null;continue}let g=h.match(/^#### +(.+)$/);if(g){a(),x=null,s.push({kind:"h4",text:g[1]});continue}let b=h.match(/^### +(.+)$/);if(b){a(),x=null,s.push({kind:"h3",text:b[1]});continue}let v=h.match(/^## +(.+)$/);if(v){a(),x=null,s.push({kind:"h2",text:v[1]});continue}let j=h.match(/^# +(.+)$/);if(j){a(),x=null,s.push({kind:"h1",text:j[1]});continue}if(i(h)&&e+1<t.length&&o(t[e+1])){a(),x=null;let n=[d(h)],r=d(t[e+1]).map(c),l=e+2;for(;l<t.length&&i(t[l])&&!o(t[l]);)n.push(d(t[l])),l++;s.push({kind:"table",text:t.slice(e,l).join("\n"),rows:n,align:r}),e=l-1;continue}let y=h.match(/^(\s*)(\d+)\. +(.+)$/);if(y){a(),s.push({kind:"ol",text:y[3],depth:m(y[1]),marker:y[2]}),x=s.length-1;continue}let N=h.match(/^(\s*)- +(.+)$/);if(N){a(),s.push({kind:"ul",text:N[2],depth:m(N[1])}),x=s.length-1;continue}if(null!==x&&0===n.length){s[x].text+=" "+h.trim();continue}n.push(h)}return a(),l(),null!==p&&s.push({kind:"code",text:p.join("\n")}),s}let p=/("(?:\\.|[^"\\])*")(\s*:)?|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g;function x({text:e}){let t=function(e){let t=e.trim();if(!t||"{"!==t[0]&&"["!==t[0])return null;try{return JSON.stringify(JSON.parse(t),null,2)}catch{return null}}(e);return(0,n.jsx)("pre",{className:"overflow-x-auto rounded-lg border border-white/10 bg-white/[0.06] p-3 text-[12px] leading-relaxed",children:(0,n.jsx)("code",{className:"whitespace-pre font-mono [overflow-wrap:normal]",children:t?function(e){let t,s=[],a=0,r=0,l=e=>(0,n.jsx)("span",{className:"text-foreground/45",children:e},r++);for(p.lastIndex=0;null!==(t=p.exec(e));){if(t.index>a&&s.push(l(e.slice(a,t.index))),void 0!==t[1]){let e=void 0!==t[2];s.push((0,n.jsx)("span",{className:e?"text-sky-300":"text-emerald-300/90",children:t[1]},r++)),e&&t[2]&&s.push(l(t[2]))}else void 0!==t[3]?s.push((0,n.jsx)("span",{className:"text-purple-300",children:t[3]},r++)):void 0!==t[4]&&s.push((0,n.jsx)("span",{className:"text-amber-300",children:t[4]},r++));a=p.lastIndex}return a<e.length&&s.push(l(e.slice(a))),s}(t):(0,n.jsx)("span",{className:"text-foreground/85",children:e})})})}function h({block:e}){let t=e.rows??[];if(0===t.length)return null;let[s,...a]=t,l=e.align??[],o=e=>"center"===l[e]?"text-center":"right"===l[e]?"text-right":"text-left";return(0,n.jsx)("div",{className:"overflow-x-auto rounded-lg border border-white/10",children:(0,n.jsxs)("table",{className:"w-full border-collapse text-[13px] [overflow-wrap:normal]",children:[(0,n.jsx)("thead",{children:(0,n.jsx)("tr",{className:"border-b border-white/15 bg-white/[0.04]",children:s.map((e,t)=>(0,n.jsx)("th",{className:(0,r.cn)("whitespace-nowrap px-3 py-1.5 font-semibold text-foreground",o(t)),children:(0,n.jsx)(w,{text:e})},t))})}),(0,n.jsx)("tbody",{children:a.map((e,t)=>(0,n.jsx)("tr",{className:"border-b border-white/5 last:border-0",children:e.map((e,t)=>(0,n.jsx)("td",{className:(0,r.cn)("px-3 py-1.5 align-top text-foreground/90",o(t)),children:(0,n.jsx)(w,{text:e})},t))},t))})]})})}let f=["h1","h2","h3","h4"];function g(e){return f.includes(e)}function b(e){let t=f.indexOf(e);return t<0?0:t}function v(e){return`plan-h-${e}`}function j(e){return e.replace(/[`*]/g,"").trim()}function y(e,t,s,a){let l="reading"===s;switch(e.kind){case"h1":return(0,n.jsx)("h1",{id:a,className:l?"scroll-mt-24 text-xl font-semibold tracking-tight text-foreground":"text-base font-semibold text-foreground",children:t});case"h2":return(0,n.jsx)("h2",{id:a,className:l?"mt-6 scroll-mt-24 border-b border-white/10 pb-1 text-lg font-semibold text-foreground":"mt-3 text-sm font-semibold text-muted-foreground",children:t});case"h3":return(0,n.jsx)("h3",{id:a,className:l?"mt-4 scroll-mt-24 text-base font-semibold text-foreground":"mt-2 text-[13px] font-semibold text-foreground",children:t});case"h4":return(0,n.jsx)("h4",{id:a,className:l?"mt-3 scroll-mt-24 text-sm font-semibold text-muted-foreground":"mt-2 text-[13px] font-semibold text-muted-foreground",children:t});case"ul":case"ol":{let s=e.depth??0;return(0,n.jsxs)("div",{className:(0,r.cn)("flex gap-2",l?"text-foreground/95":"text-foreground/90"),style:{marginLeft:`${.75+1.25*s}rem`},children:[(0,n.jsx)("span",{className:"shrink-0 select-none text-muted-foreground tabular-nums",children:"ol"===e.kind?`${e.marker}.`:"•"}),(0,n.jsx)("span",{className:"min-w-0 flex-1",children:t})]})}case"quote":return(0,n.jsx)("blockquote",{className:(0,r.cn)("whitespace-pre-wrap border-l-2 pl-3 italic",l?"border-white/15 text-foreground/80":"border-white/10 text-foreground/75"),children:t});default:return(0,n.jsx)("p",{className:(0,r.cn)("whitespace-pre-wrap",l?"text-foreground/95":"text-foreground/90"),children:t})}}function N({block:e,variant:t}){return"code"===e.kind?(0,n.jsx)(x,{text:e.text}):"table"===e.kind?(0,n.jsx)(h,{block:e}):(0,n.jsx)(n.Fragment,{children:y(e,(0,n.jsx)(w,{text:e.text}),t)})}function w({text:e}){let t=e.split(/(`[^`]+`|\*\*[\s\S]+?\*\*|\*[^*]+\*)/g);return(0,n.jsx)(n.Fragment,{children:t.map((e,t)=>/^`[^`]+`$/.test(e)?(0,n.jsx)("code",{className:"rounded bg-white/5 px-1 font-mono text-[12px]",children:e.slice(1,-1)},t):/^\*\*[\s\S]+\*\*$/.test(e)?(0,n.jsx)("strong",{className:"font-semibold text-foreground",children:(0,n.jsx)(w,{text:e.slice(2,-2)})},t):/^\*[^*]+\*$/.test(e)?(0,n.jsx)("em",{className:"text-muted-foreground",children:(0,n.jsx)(w,{text:e.slice(1,-1)})},t):(0,n.jsx)("span",{children:e},t))})}},62311:(e,t,s)=>{s.d(t,{Z:()=>m});var n=s(95155),a=s(98500),r=s.n(a),l=s(25640),o=s(83599),i=s(94192),d=s(34306),c=s(91337);let u={ROADMAP:l.A,ARCHITECTURE:o.A,FILES:i.A,DATABASE:d.A};function m({tabs:e,active:t}){return(0,n.jsx)("div",{className:"flex items-center gap-0.5",children:e.map(e=>{let s=e.value===t,a=e.Icon??u[e.value];return(0,n.jsxs)(r(),{href:e.href,className:(0,c.cn)("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[12px] font-medium tracking-tight transition-colors",s?"bg-white/10 text-foreground":"text-muted-foreground/80 hover:bg-white/5 hover:text-foreground"),children:[a?(0,n.jsx)(a,{className:"size-3"}):null,(0,n.jsx)("span",{children:e.label})]},e.value)})})}},70521:(e,t,s)=>{s.d(t,{$v:()=>N,EO:()=>b,Lt:()=>x,Rx:()=>w,Zr:()=>k,ck:()=>j,r7:()=>y,tv:()=>h,wd:()=>v});var n=s(95155);s(12115);var a=s(25381),r=s(7121),l=s(51880),o=s(35176),i=s(11248),d=s(82022),c=s(98758),u=s(45362),m=s(91337),p=s(4474);function x({...e}){return(0,n.jsx)(a.V,{"data-slot":"alert-dialog",...e})}function h({...e}){return(0,n.jsx)(r.t,{"data-slot":"alert-dialog-trigger",...e})}function f({...e}){return(0,n.jsx)(l.Z,{"data-slot":"alert-dialog-portal",...e})}function g({className:e,...t}){return(0,n.jsx)(o.X,{"data-slot":"alert-dialog-overlay",className:(0,m.cn)("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function b({className:e,size:t="default",...s}){return(0,n.jsxs)(f,{children:[(0,n.jsx)(g,{}),(0,n.jsx)(i.h,{"data-slot":"alert-dialog-content","data-size":t,className:(0,m.cn)("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s})]})}function v({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,m.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function j({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,m.cn)("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function y({className:e,...t}){return(0,n.jsx)(d.L,{"data-slot":"alert-dialog-title",className:(0,m.cn)("font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function N({className:e,...t}){return(0,n.jsx)(c.r,{"data-slot":"alert-dialog-description",className:(0,m.cn)("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function w({className:e,variant:t,size:s,...a}){return(0,n.jsx)(u.H,{"data-slot":"alert-dialog-action",className:(0,m.cn)(e),render:(0,n.jsx)(p.$,{variant:t,size:s}),...a})}function k({className:e,variant:t="outline",size:s="default",...a}){return(0,n.jsx)(u.H,{"data-slot":"alert-dialog-cancel",className:(0,m.cn)(e),render:(0,n.jsx)(p.$,{variant:t,size:s}),...a})}},74350:(e,t,s)=>{s.d(t,{Cf:()=>g,Es:()=>v,L3:()=>j,c7:()=>b,lG:()=>x,rr:()=>y});var n=s(95155);s(12115);var a=s(17112),r=s(51880),l=s(35176),o=s(11248),i=s(45362),d=s(82022),c=s(98758),u=s(91337),m=s(4474),p=s(9005);function x({...e}){return(0,n.jsx)(a.D,{"data-slot":"dialog",...e})}function h({...e}){return(0,n.jsx)(r.Z,{"data-slot":"dialog-portal",...e})}function f({className:e,...t}){return(0,n.jsx)(l.X,{"data-slot":"dialog-overlay",className:(0,u.cn)("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function g({className:e,children:t,showCloseButton:s=!0,...a}){return(0,n.jsxs)(h,{children:[(0,n.jsx)(f,{}),(0,n.jsxs)(o.h,{"data-slot":"dialog-content",className:(0,u.cn)("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a,children:[t,s&&(0,n.jsxs)(i.H,{"data-slot":"dialog-close",render:(0,n.jsx)(m.$,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[(0,n.jsx)(p.A,{}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function b({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"dialog-header",className:(0,u.cn)("flex flex-col gap-2",e),...t})}function v({className:e,showCloseButton:t=!1,children:s,...a}){return(0,n.jsxs)("div",{"data-slot":"dialog-footer",className:(0,u.cn)("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...a,children:[s,t&&(0,n.jsx)(i.H,{render:(0,n.jsx)(m.$,{variant:"outline"}),children:"Close"})]})}function j({className:e,...t}){return(0,n.jsx)(d.L,{"data-slot":"dialog-title",className:(0,u.cn)("font-heading text-base leading-none font-medium",e),...t})}function y({className:e,...t}){return(0,n.jsx)(c.r,{"data-slot":"dialog-description",className:(0,u.cn)("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}},82099:(e,t,s)=>{s.d(t,{b:()=>r});var n=s(95155);s(12115);var a=s(91337);function r({className:e,children:t,...s}){return(0,n.jsxs)("div",{className:(0,a.cn)("glass relative isolate overflow-hidden",e),...s,children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 -z-10 rounded-[inherit]",style:{background:"radial-gradient(90% 60% at 0% 0%, oklch(1 0 0 / 0.04), transparent 42%)"}}),(0,n.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 -z-10 rounded-[inherit] opacity-[0.035] mix-blend-overlay",style:{backgroundImage:"url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E\")",backgroundSize:"120px 120px"}}),t]})}},91337:(e,t,s)=>{s.d(t,{cn:()=>r});var n=s(29722),a=s(622);function r(...e){return(0,a.QP)((0,n.$)(e))}},95635:(e,t,s)=>{s.d(t,{x:()=>l});var n=s(95155),a=s(81750),r=s(6266);function l(){let e="!h-2 !w-2 !border-0 !bg-zinc-400";return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.h7,{type:"target",position:r.yX.Top,id:"tt",className:e}),(0,n.jsx)(a.h7,{type:"source",position:r.yX.Top,id:"st",className:e}),(0,n.jsx)(a.h7,{type:"target",position:r.yX.Right,id:"tr",className:e}),(0,n.jsx)(a.h7,{type:"source",position:r.yX.Right,id:"sr",className:e}),(0,n.jsx)(a.h7,{type:"target",position:r.yX.Bottom,id:"tb",className:e}),(0,n.jsx)(a.h7,{type:"source",position:r.yX.Bottom,id:"sb",className:e}),(0,n.jsx)(a.h7,{type:"target",position:r.yX.Left,id:"tl",className:e}),(0,n.jsx)(a.h7,{type:"source",position:r.yX.Left,id:"sl",className:e})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6946],{2125:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},5736:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},6266:(t,e,n)=>{"use strict";n.d(e,{Do:()=>p,WZ:()=>h,TG:()=>y,ny:()=>f,yX:()=>g,xN:()=>m,Qc:()=>d,I$:()=>n6,aQ:()=>rr,di:()=>ri,kO:()=>rf,rN:()=>nH,bi:()=>nG,_s:()=>ny,_7:()=>e3,aE:()=>eG,kr:()=>ni,Hm:()=>nF,tM:()=>eq,tn:()=>eO,xc:()=>eC,us:()=>np,IO:()=>eQ,e_:()=>nE,Fp:()=>nN,Mi:()=>nt,HF:()=>eV,Eo:()=>nx,b5:()=>nR,Tq:()=>eJ,qX:()=>nT,q1:()=>nk,M_:()=>nV,oj:()=>nw,aZ:()=>eZ,aW:()=>nY,uD:()=>nf,Jo:()=>eK,U$:()=>eU,X6:()=>ne,oN:()=>nO,ah:()=>nj,R4:()=>ns,r8:()=>n1,ZO:()=>eL,bK:()=>eR,b$:()=>eX,uj:()=>nP,v5:()=>nb,Ue:()=>nc,Er:()=>nM,oB:()=>eY,kf:()=>nr,mW:()=>nn,Q6:()=>nm,QE:()=>nd,kM:()=>e6,No:()=>n5,Ff:()=>na,zj:()=>nu,s_:()=>no,vS:()=>nU,qn:()=>n4,uL:()=>n2,YN:()=>ng});var r,i,o,a,u,l,s,c,h,f,d,p,y,g,m,v=n(32521);function x(){}function w(t){return null==t?x:function(){return this.querySelector(t)}}function _(){return[]}function b(t){return null==t?_:function(){return this.querySelectorAll(t)}}function M(t){return function(){return this.matches(t)}}function k(t){return function(e){return e.matches(t)}}var A=Array.prototype.find;function E(){return this.firstElementChild}var $=Array.prototype.filter;function z(){return Array.from(this.children)}function N(t){return Array(t.length)}function S(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function T(t,e,n,r,i,o){for(var a,u=0,l=e.length,s=o.length;u<s;++u)(a=e[u])?(a.__data__=o[u],r[u]=a):n[u]=new S(t,o[u]);for(;u<l;++u)(a=e[u])&&(i[u]=a)}function P(t,e,n,r,i,o,a){var u,l,s,c=new Map,h=e.length,f=o.length,d=Array(h);for(u=0;u<h;++u)(l=e[u])&&(d[u]=s=a.call(l,l.__data__,u,e)+"",c.has(s)?i[u]=l:c.set(s,l));for(u=0;u<f;++u)s=a.call(t,o[u],u,o)+"",(l=c.get(s))?(r[u]=l,l.__data__=o[u],c.delete(s)):n[u]=new S(t,o[u]);for(u=0;u<h;++u)(l=e[u])&&c.get(d[u])===l&&(i[u]=l)}function I(t){return t.__data__}function H(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}S.prototype={constructor:S,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var j="http://www.w3.org/1999/xhtml";let B={svg:"http://www.w3.org/2000/svg",xhtml:j,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function C(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),B.hasOwnProperty(e)?{space:B[e],local:t}:t}function L(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function O(t,e){return t.style.getPropertyValue(e)||L(t).getComputedStyle(t,null).getPropertyValue(e)}function q(t){return t.trim().split(/^|\s+/)}function R(t){return t.classList||new D(t)}function D(t){this._node=t,this._names=q(t.getAttribute("class")||"")}function V(t,e){for(var n=R(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function X(t,e){for(var n=R(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Y(){this.textContent=""}function F(){this.innerHTML=""}function W(){this.nextSibling&&this.parentNode.appendChild(this)}function K(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Z(t){var e=C(t);return(e.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===j&&e.documentElement.namespaceURI===j?e.createElement(t):e.createElementNS(n,t)}})(e)}function U(){return null}function Q(){var t=this.parentNode;t&&t.removeChild(this)}function G(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function J(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function tt(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r<o;++r)(n=e[r],t.type&&n.type!==t.type||n.name!==t.name)?e[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?e.length=i:delete this.__on}}}function te(t,e,n){return function(){var r,i=this.__on,o=function(t){e.call(this,t,this.__data__)};if(i){for(var a=0,u=i.length;a<u;++a)if((r=i[a]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),r.value=e;return}}this.addEventListener(t.type,o,n),r={type:t.type,name:t.name,value:e,listener:o,options:n},i?i.push(r):this.__on=[r]}}function tn(t,e,n){var r=L(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}D.prototype={add:function(t){0>this._names.indexOf(t)&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var tr=[null];function ti(t,e){this._groups=t,this._parents=e}function to(){return new ti([[document.documentElement]],tr)}function ta(t){return"string"==typeof t?new ti([[document.querySelector(t)]],[document.documentElement]):new ti([[t]],tr)}function tu(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}ti.prototype=to.prototype={constructor:ti,select:function(t){"function"!=typeof t&&(t=w(t));for(var e=this._groups,n=e.length,r=Array(n),i=0;i<n;++i)for(var o,a,u=e[i],l=u.length,s=r[i]=Array(l),c=0;c<l;++c)(o=u[c])&&(a=t.call(o,o.__data__,c,u))&&("__data__"in o&&(a.__data__=o.__data__),s[c]=a);return new ti(r,this._parents)},selectAll:function(t){if("function"==typeof t){var e;e=t,t=function(){var t;return t=e.apply(this,arguments),null==t?[]:Array.isArray(t)?t:Array.from(t)}}else t=b(t);for(var n=this._groups,r=n.length,i=[],o=[],a=0;a<r;++a)for(var u,l=n[a],s=l.length,c=0;c<s;++c)(u=l[c])&&(i.push(t.call(u,u.__data__,c,l)),o.push(u));return new ti(i,o)},selectChild:function(t){var e;return this.select(null==t?E:(e="function"==typeof t?t:k(t),function(){return A.call(this.children,e)}))},selectChildren:function(t){var e;return this.selectAll(null==t?z:(e="function"==typeof t?t:k(t),function(){return $.call(this.children,e)}))},filter:function(t){"function"!=typeof t&&(t=M(t));for(var e=this._groups,n=e.length,r=Array(n),i=0;i<n;++i)for(var o,a=e[i],u=a.length,l=r[i]=[],s=0;s<u;++s)(o=a[s])&&t.call(o,o.__data__,s,a)&&l.push(o);return new ti(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,I);var n=e?P:T,r=this._parents,i=this._groups;"function"!=typeof t&&(v=t,t=function(){return v});for(var o=i.length,a=Array(o),u=Array(o),l=Array(o),s=0;s<o;++s){var c=r[s],h=i[s],f=h.length,d="object"==typeof(m=t.call(c,c&&c.__data__,s,r))&&"length"in m?m:Array.from(m),p=d.length,y=u[s]=Array(p),g=a[s]=Array(p);n(c,h,y,g,l[s]=Array(f),d,e);for(var m,v,x,w,_=0,b=0;_<p;++_)if(x=y[_]){for(_>=b&&(b=_+1);!(w=g[b])&&++b<p;);x._next=w||null}}return(a=new ti(a,r))._enter=u,a._exit=l,a},enter:function(){return new ti(this._enter||this._groups.map(N),this._parents)},exit:function(){return new ti(this._exit||this._groups.map(N),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(i=e(i))&&(i=i.selection()),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),u=Array(i),l=0;l<a;++l)for(var s,c=n[l],h=r[l],f=c.length,d=u[l]=Array(f),p=0;p<f;++p)(s=c[p]||h[p])&&(d[p]=s);for(;l<i;++l)u[l]=n[l];return new ti(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=H);for(var n=this._groups,r=n.length,i=Array(r),o=0;o<r;++o){for(var a,u=n[o],l=u.length,s=i[o]=Array(l),c=0;c<l;++c)(a=u[c])&&(s[c]=a);s.sort(e)}return new ti(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let t=0;for(let e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,o=e[n],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,e){var n=C(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof e?n.local?function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}:function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}:n.local?function(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}:function(t,e){return function(){this.setAttribute(t,e)}})(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof e?function(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}:function(t,e,n){return function(){this.style.setProperty(t,e,n)}})(t,e,null==n?"":n)):O(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?function(t){return function(){delete this[t]}}:"function"==typeof e?function(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}:function(t,e){return function(){this[t]=e}})(t,e)):this.node()[t]},classed:function(t,e){var n=q(t+"");if(arguments.length<2){for(var r=R(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?function(t,e){return function(){(e.apply(this,arguments)?V:X)(this,t)}}:e?function(t){return function(){V(this,t)}}:function(t){return function(){X(this,t)}})(n,e))},text:function(t){return arguments.length?this.each(null==t?Y:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}:function(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?F:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}:function(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(W)},lower:function(){return this.each(K)},append:function(t){var e="function"==typeof t?t:Z(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:Z(t),r=null==e?U:"function"==typeof e?e:w(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(Q)},clone:function(t){return this.select(t?J:G)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,o=(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}),a=o.length;if(arguments.length<2){var u=this.node().__on;if(u){for(var l,s=0,c=u.length;s<c;++s)for(r=0,l=u[s];r<a;++r)if((i=o[r]).type===l.type&&i.name===l.name)return l.value}return}for(r=0,u=e?te:tt;r<a;++r)this.each(u(o[r],e,n));return this},dispatch:function(t,e){return this.each(("function"==typeof e?function(t,e){return function(){return tn(this,t,e.apply(this,arguments))}}:function(t,e){return function(){return tn(this,t,e)}})(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,i=t[e],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};let tl={passive:!1},ts={capture:!0,passive:!1};function tc(t){t.stopImmediatePropagation()}function th(t){t.preventDefault(),t.stopImmediatePropagation()}function tf(t){var e=t.document.documentElement,n=ta(t).on("dragstart.drag",th,ts);"onselectstart"in e?n.on("selectstart.drag",th,ts):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function td(t,e){var n=t.document.documentElement,r=ta(t).on("dragstart.drag",null);e&&(r.on("click.drag",th,ts),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}let tp=t=>()=>t;function ty(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:u,dx:l,dy:s,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:s,enumerable:!0,configurable:!0},_:{value:c}})}function tg(t){return!t.ctrlKey&&!t.button}function tm(){return this.parentNode}function tv(t,e){return null==e?{x:t.x,y:t.y}:e}function tx(){return navigator.maxTouchPoints||"ontouchstart"in this}function tw(t){return((t=Math.exp(t))+1/t)/2}ty.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let t_=function t(e,n,r){function i(t,i){var o,a,u=t[0],l=t[1],s=t[2],c=i[0],h=i[1],f=i[2],d=c-u,p=h-l,y=d*d+p*p;if(y<1e-12)a=Math.log(f/s)/e,o=function(t){return[u+t*d,l+t*p,s*Math.exp(e*t*a)]};else{var g=Math.sqrt(y),m=(f*f-s*s+r*y)/(2*s*n*g),v=(f*f-s*s-r*y)/(2*f*n*g),x=Math.log(Math.sqrt(m*m+1)-m);a=(Math.log(Math.sqrt(v*v+1)-v)-x)/e,o=function(t){var r,i,o=t*a,c=tw(x),h=s/(n*g)*(c*(((r=Math.exp(2*(r=e*o+x)))-1)/(r+1))-((i=Math.exp(i=x))-1/i)/2);return[u+h*d,l+h*p,s*c/tw(e*o+x)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4);var tb=n(87977);function tM(t,e,n){var r=new tb.M4;return e=null==e?0:+e,r.restart(n=>{r.stop(),t(n+e)},e,n),r}var tk=(0,v.A)("start","end","cancel","interrupt"),tA=[];function tE(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(l){var s,c,h,f;if(1!==n.state)return u();for(s in i)if((f=i[s]).name===n.name){if(3===f.state)return tM(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[s]):+s<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[s])}if(tM(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(s=0,n.state=3,r=Array(h=n.tween.length),c=-1;s<h;++s)(f=n.tween[s].value.call(t,t.__data__,n.index,n.group))&&(r[++c]=f);r.length=c+1}}function a(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=5,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var r in n.state=6,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=(0,tb.O1)(function(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)},0,n.time)}(t,n,{name:e,index:r,group:i,on:tk,tween:tA,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function t$(t,e){var n=tN(t,e);if(n.state>0)throw Error("too late; already scheduled");return n}function tz(t,e){var n=tN(t,e);if(n.state>3)throw Error("too late; already running");return n}function tN(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw Error("transition not found");return n}function tS(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o){if((n=o[i]).name!==e){a=!1;continue}r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]}a&&delete t.__transition}}function tT(t,e){return t*=1,e*=1,function(n){return t*(1-n)+e*n}}var tP=180/Math.PI,tI={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tH(t,e,n,r,i,o){var a,u,l;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,l/=u),t*r<e*n&&(t=-t,e=-e,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*tP,skewX:Math.atan(l)*tP,scaleX:a,scaleY:u}}function tj(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var u,l,s,c,h=[],f=[];return o=t(o),a=t(a),!function(t,r,i,o,a,u){if(t!==i||r!==o){var l=a.push("translate(",null,e,null,n);u.push({i:l-4,x:tT(t,i)},{i:l-2,x:tT(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,h,f),u=o.rotate,l=a.rotate,u!==l?(u-l>180?l+=360:l-u>180&&(u+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:tT(u,l)})):l&&h.push(i(h)+"rotate("+l+r),s=o.skewX,c=a.skewX,s!==c?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:tT(s,c)}):c&&h.push(i(h)+"skewX("+c+r),!function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:tT(t,n)},{i:u-2,x:tT(e,r)})}else(1!==n||1!==r)&&o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,h,f),o=a=null,function(t){for(var e,n=-1,r=f.length;++n<r;)h[(e=f[n]).i]=e.x(t);return h.join("")}}}var tB=tj(function(t){let e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?tI:tH(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),tC=tj(function(t){return null==t?tI:(c||(c=document.createElementNS("http://www.w3.org/2000/svg","g")),c.setAttribute("transform",t),t=c.transform.baseVal.consolidate())?tH((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):tI},", ",")",")");function tL(t,e,n){var r=t._id;return t.each(function(){var t=tz(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return tN(t,r).value[e]}}function tO(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function tq(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function tR(){}var tD="\\s*([+-]?\\d+)\\s*",tV="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tX="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tY=/^#([0-9a-f]{3,8})$/,tF=RegExp(`^rgb\\(${tD},${tD},${tD}\\)$`),tW=RegExp(`^rgb\\(${tX},${tX},${tX}\\)$`),tK=RegExp(`^rgba\\(${tD},${tD},${tD},${tV}\\)$`),tZ=RegExp(`^rgba\\(${tX},${tX},${tX},${tV}\\)$`),tU=RegExp(`^hsl\\(${tV},${tX},${tX}\\)$`),tQ=RegExp(`^hsla\\(${tV},${tX},${tX},${tV}\\)$`),tG={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function tJ(){return this.rgb().formatHex()}function t0(){return this.rgb().formatRgb()}function t1(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=tY.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?t2(e):3===n?new t4(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?t5(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?t5(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=tF.exec(t))?new t4(e[1],e[2],e[3],1):(e=tW.exec(t))?new t4(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=tK.exec(t))?t5(e[1],e[2],e[3],e[4]):(e=tZ.exec(t))?t5(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=tU.exec(t))?ee(e[1],e[2]/100,e[3]/100,1):(e=tQ.exec(t))?ee(e[1],e[2]/100,e[3]/100,e[4]):tG.hasOwnProperty(t)?t2(tG[t]):"transparent"===t?new t4(NaN,NaN,NaN,0):null}function t2(t){return new t4(t>>16&255,t>>8&255,255&t,1)}function t5(t,e,n,r){return r<=0&&(t=e=n=NaN),new t4(t,e,n,r)}function t3(t,e,n,r){var i;return 1==arguments.length?((i=t)instanceof tR||(i=t1(i)),i)?new t4((i=i.rgb()).r,i.g,i.b,i.opacity):new t4:new t4(t,e,n,null==r?1:r)}function t4(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function t7(){return`#${et(this.r)}${et(this.g)}${et(this.b)}`}function t8(){let t=t6(this.opacity);return`${1===t?"rgb(":"rgba("}${t9(this.r)}, ${t9(this.g)}, ${t9(this.b)}${1===t?")":`, ${t})`}`}function t6(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function t9(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function et(t){return((t=t9(t))<16?"0":"")+t.toString(16)}function ee(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new er(t,e,n,r)}function en(t){if(t instanceof er)return new er(t.h,t.s,t.l,t.opacity);if(t instanceof tR||(t=t1(t)),!t)return new er;if(t instanceof er)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,l=(o+i)/2;return u?(a=e===o?(n-r)/u+(n<r)*6:n===o?(r-e)/u+2:(e-n)/u+4,u/=l<.5?o+i:2-o-i,a*=60):u=l>0&&l<1?0:a,new er(a,u,l,t.opacity)}function er(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function ei(t){return(t=(t||0)%360)<0?t+360:t}function eo(t){return Math.max(0,Math.min(1,t||0))}function ea(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}function eu(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}tO(tR,t1,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:tJ,formatHex:tJ,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return en(this).formatHsl()},formatRgb:t0,toString:t0}),tO(t4,t3,tq(tR,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new t4(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new t4(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new t4(t9(this.r),t9(this.g),t9(this.b),t6(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:t7,formatHex:t7,formatHex8:function(){return`#${et(this.r)}${et(this.g)}${et(this.b)}${et((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:t8,toString:t8})),tO(er,function(t,e,n,r){return 1==arguments.length?en(t):new er(t,e,n,null==r?1:r)},tq(tR,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new er(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new er(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new t4(ea(t>=240?t-240:t+120,i,r),ea(t,i,r),ea(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new er(ei(this.h),eo(this.s),eo(this.l),t6(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=t6(this.opacity);return`${1===t?"hsl(":"hsla("}${ei(this.h)}, ${100*eo(this.s)}%, ${100*eo(this.l)}%${1===t?")":`, ${t})`}`}}));let el=t=>()=>t;function es(t,e){var n=e-t;return n?function(e){return t+e*n}:el(isNaN(t)?e:t)}let ec=function t(e){var n,r=1==(n=+e)?es:function(t,e){var r,i,o;return e-t?(r=t,i=e,r=Math.pow(r,o=n),i=Math.pow(i,o)-r,o=1/o,function(t){return Math.pow(r+t*i,o)}):el(isNaN(t)?e:t)};function i(t,e){var n=r((t=t3(t)).r,(e=t3(e)).r),i=r(t.g,e.g),o=r(t.b,e.b),a=es(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function eh(t){return function(e){var n,r,i=e.length,o=Array(i),a=Array(i),u=Array(i);for(n=0;n<i;++n)r=t3(e[n]),o[n]=r.r||0,a[n]=r.g||0,u[n]=r.b||0;return o=t(o),a=t(a),u=t(u),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=u(t),r+""}}}eh(function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r<e-1?t[r+2]:2*o-i;return eu((n-r/e)*e,a,i,o,u)}}),eh(function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],u=t[(r+2)%e];return eu((n-r/e)*e,i,o,a,u)}});var ef=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ed=RegExp(ef.source,"g");function ep(t,e){var n,r,i,o,a,u=ef.lastIndex=ed.lastIndex=0,l=-1,s=[],c=[];for(t+="",e+="";(i=ef.exec(t))&&(o=ed.exec(e));)(a=o.index)>u&&(a=e.slice(u,a),s[l]?s[l]+=a:s[++l]=a),(i=i[0])===(o=o[0])?s[l]?s[l]+=o:s[++l]=o:(s[++l]=null,c.push({i:l,x:tT(i,o)})),u=ed.lastIndex;return u<e.length&&(a=e.slice(u),s[l]?s[l]+=a:s[++l]=a),s.length<2?c[0]?(n=c[0].x,function(t){return n(t)+""}):(r=e,function(){return r}):(e=c.length,function(t){for(var n,r=0;r<e;++r)s[(n=c[r]).i]=n.x(t);return s.join("")})}function ey(t,e){var n;return("number"==typeof e?tT:e instanceof t1?ec:(n=t1(e))?(e=n,ec):ep)(t,e)}var eg=to.prototype.constructor;function em(t){return function(){this.style.removeProperty(t)}}var ev=0;function ex(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}var ew=to.prototype;ex.prototype=(function(t){return to().transition(t)}).prototype={constructor:ex,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=w(t));for(var r=this._groups,i=r.length,o=Array(i),a=0;a<i;++a)for(var u,l,s=r[a],c=s.length,h=o[a]=Array(c),f=0;f<c;++f)(u=s[f])&&(l=t.call(u,u.__data__,f,s))&&("__data__"in u&&(l.__data__=u.__data__),h[f]=l,tE(h[f],e,n,f,h,tN(u,n)));return new ex(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=b(t));for(var r=this._groups,i=r.length,o=[],a=[],u=0;u<i;++u)for(var l,s=r[u],c=s.length,h=0;h<c;++h)if(l=s[h]){for(var f,d=t.call(l,l.__data__,h,s),p=tN(l,n),y=0,g=d.length;y<g;++y)(f=d[y])&&tE(f,e,n,y,d,p);o.push(d),a.push(l)}return new ex(o,a,e,n)},selectChild:ew.selectChild,selectChildren:ew.selectChildren,filter:function(t){"function"!=typeof t&&(t=M(t));for(var e=this._groups,n=e.length,r=Array(n),i=0;i<n;++i)for(var o,a=e[i],u=a.length,l=r[i]=[],s=0;s<u;++s)(o=a[s])&&t.call(o,o.__data__,s,a)&&l.push(o);return new ex(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw Error();for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=Array(r),u=0;u<o;++u)for(var l,s=e[u],c=n[u],h=s.length,f=a[u]=Array(h),d=0;d<h;++d)(l=s[d]||c[d])&&(f[d]=l);for(;u<r;++u)a[u]=e[u];return new ex(a,this._parents,this._name,this._id)},selection:function(){return new eg(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=++ev,r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],l=u.length,s=0;s<l;++s)if(a=u[s]){var c=tN(a,e);tE(a,t,n,s,u,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ex(r,this._parents,t,n)},call:ew.call,nodes:ew.nodes,node:ew.node,size:ew.size,empty:ew.empty,each:ew.each,on:function(t,e){var n,r,i,o,a,u,l=this._id;return arguments.length<2?tN(this.node(),l).on.on(t):this.each((n=l,r=t,i=e,u=(r+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})?t$:tz,function(){var t=u(this,n),e=t.on;e!==o&&(a=(o=e).copy()).on(r,i),t.on=a}))},attr:function(t,e){var n=C(t),r="transform"===n?tC:ey;return this.attrTween(t,"function"==typeof e?(n.local?function(t,e,n){var r,i,o;return function(){var a,u,l=n(this);return null==l?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local))===(u=l+"")?null:a===r&&u===i?o:(i=u,o=e(r=a,l))}}:function(t,e,n){var r,i,o;return function(){var a,u,l=n(this);return null==l?void this.removeAttribute(t):(a=this.getAttribute(t))===(u=l+"")?null:a===r&&u===i?o:(i=u,o=e(r=a,l))}})(n,r,tL(this,"attr."+t,e)):null==e?(n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(n):(n.local?function(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=e(r=a,n)}}:function(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=e(r=a,n)}})(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw Error();var r=C(t);return this.tween(n,(r.local?function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e){this.setAttributeNS(t.space,t.local,i.call(this,e))}),n}return i._value=e,i}:function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e){this.setAttribute(t,i.call(this,e))}),n}return i._value=e,i})(r,e))},style:function(t,e,n){var r,i,o,a,u,l,s,c,h,f,d,p,y,g,m,v,x,w,_,b,M,k="transform"==(t+="")?tB:ey;return null==e?this.styleTween(t,(r=t,function(){var t=O(this,r),e=(this.style.removeProperty(r),O(this,r));return t===e?null:t===i&&e===o?a:a=k(i=t,o=e)})).on("end.style."+t,em(t)):"function"==typeof e?this.styleTween(t,(u=t,l=tL(this,"style."+t,e),function(){var t=O(this,u),e=l(this),n=e+"";return null==e&&(this.style.removeProperty(u),n=e=O(this,u)),t===n?null:t===s&&n===c?h:(c=n,h=k(s=t,e))})).each((f=this._id,x="end."+(v="style."+(d=t)),function(){var t=tz(this,f),e=t.on,n=null==t.value[v]?m||(m=em(d)):void 0;(e!==p||g!==n)&&(y=(p=e).copy()).on(x,g=n),t.on=y})):this.styleTween(t,(w=t,M=e+"",function(){var t=O(this,w);return t===M?null:t===_?b:b=k(_=t,e)}),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw Error();return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(e){this.style.setProperty(t,o.call(this,e),n)}),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){var e,n;return this.tween("text","function"==typeof t?(e=tL(this,"text",t),function(){var t=e(this);this.textContent=null==t?"":t}):(n=null==t?"":t+"",function(){this.textContent=n}))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw Error();return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){this.textContent=r.call(this,t)}),e}return r._value=t,r}(t))},remove:function(){var t;return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=tN(this.node(),n).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==e?function(t,e){var n,r;return function(){var i=tz(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,u=r.length;a<u;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}}i.tween=r}}:function(t,e,n){var r,i;if("function"!=typeof n)throw Error();return function(){var o=tz(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var u={name:e,value:n},l=0,s=i.length;l<s;++l)if(i[l].name===e){i[l]=u;break}l===s&&i.push(u)}o.tween=i}})(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){t$(this,t).delay=+e.apply(this,arguments)}}:function(t,e){return e*=1,function(){t$(this,t).delay=e}})(e,t)):tN(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){tz(this,t).duration=+e.apply(this,arguments)}}:function(t,e){return e*=1,function(){tz(this,t).duration=e}})(e,t)):tN(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw Error();return function(){tz(this,t).ease=e}}(e,t)):tN(this.node(),e).ease},easeVarying:function(t){var e;if("function"!=typeof t)throw Error();return this.each((e=this._id,function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw Error();tz(this,e).ease=n}))},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var u={value:a},l={value:function(){0==--i&&o()}};n.each(function(){var n=tz(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(l)),n.on=e}),0===i&&o()})},[Symbol.iterator]:ew[Symbol.iterator]};var e_={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};to.prototype.interrupt=function(t){return this.each(function(){tS(this,t)})},to.prototype.transition=function(t){var e,n;t instanceof ex?(e=t._id,t=t._name):(e=++ev,(n=e_).time=(0,tb.tB)(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],l=u.length,s=0;s<l;++s)(a=u[s])&&tE(a,t,e,s,u,n||function(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw Error(`transition ${e} not found`);return n}(a,e));return new ex(r,this._parents,t,e)};let eb=t=>()=>t;function eM(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ek(t,e,n){this.k=t,this.x=e,this.y=n}ek.prototype={constructor:ek,scale:function(t){return 1===t?this:new ek(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new ek(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var eA=new ek(1,0,0);function eE(t){for(;!t.__zoom;)if(!(t=t.parentNode))return eA;return t.__zoom}function e$(t){t.stopImmediatePropagation()}function ez(t){t.preventDefault(),t.stopImmediatePropagation()}function eN(t){return(!t.ctrlKey||"wheel"===t.type)&&!t.button}function eS(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function eT(){return this.__zoom||eA}function eP(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function eI(){return navigator.maxTouchPoints||"ontouchstart"in this}function eH(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function ej(){var t,e,n,r=eN,i=eS,o=eH,a=eP,u=eI,l=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],c=250,h=t_,f=(0,v.A)("start","zoom","end"),d=0,p=10;function y(t){t.property("__zoom",eT).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",A).filter(u).on("touchstart.zoom",E).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new ek(e,t.x,t.y)}function m(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new ek(t.k,r,i)}function x(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n,r){t.on("start.zoom",function(){_(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(r).end()}).tween("zoom",function(){var t=arguments,o=_(this,t).event(r),a=i.apply(this,t),u=null==n?x(a):"function"==typeof n?n.apply(this,t):n,l=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),s=this.__zoom,c="function"==typeof e?e.apply(this,t):e,f=h(s.invert(u).concat(l/s.k),c.invert(u).concat(l/c.k));return function(t){if(1===t)t=c;else{var e=f(t),n=l/e[2];t=new ek(n,u[0]-e[0]*n,u[1]-e[1]*n)}o.zoom(null,t)}})}function _(t,e,n){return!n&&t.__zooming||new b(t,e)}function b(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function M(t,...e){if(r.apply(this,arguments)){var n=_(this,e).event(t),i=this.__zoom,u=Math.max(l[0],Math.min(l[1],i.k*Math.pow(2,a.apply(this,arguments)))),c=tu(t);if(n.wheel)(n.mouse[0][0]!==c[0]||n.mouse[0][1]!==c[1])&&(n.mouse[1]=i.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(i.k===u)return;n.mouse=[c,i.invert(c)],tS(this),n.start()}ez(t),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",o(m(g(i,u),n.mouse[0],n.mouse[1]),n.extent,s))}}function k(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,a=_(this,e,!0).event(t),u=ta(t.view).on("mousemove.zoom",function(t){if(ez(t),!a.moved){var e=t.clientX-c,n=t.clientY-h;a.moved=e*e+n*n>d}a.event(t).zoom("mouse",o(m(a.that.__zoom,a.mouse[0]=tu(t,i),a.mouse[1]),a.extent,s))},!0).on("mouseup.zoom",function(t){u.on("mousemove.zoom mouseup.zoom",null),td(t.view,a.moved),ez(t),a.event(t).end()},!0),l=tu(t,i),c=t.clientX,h=t.clientY;tf(t.view),e$(t),a.mouse=[l,this.__zoom.invert(l)],tS(this),a.start()}}function A(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=tu(t.changedTouches?t.changedTouches[0]:t,this),u=n.invert(a),l=n.k*(t.shiftKey?.5:2),h=o(m(g(n,l),a,u),i.apply(this,e),s);ez(t),c>0?ta(this).transition().duration(c).call(w,h,a,t):ta(this).call(y.transform,h,a,t)}}function E(n,...i){if(r.apply(this,arguments)){var o,a,u,l,s=n.touches,c=s.length,h=_(this,i,n.changedTouches.length===c).event(n);for(e$(n),a=0;a<c;++a)l=[l=tu(u=s[a],this),this.__zoom.invert(l),u.identifier],h.touch0?h.touch1||h.touch0[2]===l[2]||(h.touch1=l,h.taps=0):(h.touch0=l,o=!0,h.taps=1+!!t);t&&(t=clearTimeout(t)),o&&(h.taps<2&&(e=l[0],t=setTimeout(function(){t=null},500)),tS(this),h.start())}}function $(t,...e){if(this.__zooming){var n,r,i,a,u=_(this,e).event(t),l=t.changedTouches,c=l.length;for(ez(t),n=0;n<c;++n)i=tu(r=l[n],this),u.touch0&&u.touch0[2]===r.identifier?u.touch0[0]=i:u.touch1&&u.touch1[2]===r.identifier&&(u.touch1[0]=i);if(r=u.that.__zoom,u.touch1){var h=u.touch0[0],f=u.touch0[1],d=u.touch1[0],p=u.touch1[1],y=(y=d[0]-h[0])*y+(y=d[1]-h[1])*y,v=(v=p[0]-f[0])*v+(v=p[1]-f[1])*v;r=g(r,Math.sqrt(y/v)),i=[(h[0]+d[0])/2,(h[1]+d[1])/2],a=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!u.touch0)return;i=u.touch0[0],a=u.touch0[1]}u.zoom("touch",o(m(r,i,a),u.extent,s))}}function z(t,...r){if(this.__zooming){var i,o,a=_(this,r).event(t),u=t.changedTouches,l=u.length;for(e$(t),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),i=0;i<l;++i)o=u[i],a.touch0&&a.touch0[2]===o.identifier?delete a.touch0:a.touch1&&a.touch1[2]===o.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(o=tu(o,this),Math.hypot(e[0]-o[0],e[1]-o[1])<p)){var s=ta(this).on("dblclick.zoom");s&&s.apply(this,arguments)}}}return y.transform=function(t,e,n,r){var i=t.selection?t.selection():t;i.property("__zoom",eT),t!==i?w(t,e,n,r):i.interrupt().each(function(){_(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()})},y.scaleBy=function(t,e,n,r){y.scaleTo(t,function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n},n,r)},y.scaleTo=function(t,e,n,r){y.transform(t,function(){var t=i.apply(this,arguments),r=this.__zoom,a=null==n?x(t):"function"==typeof n?n.apply(this,arguments):n,u=r.invert(a),l="function"==typeof e?e.apply(this,arguments):e;return o(m(g(r,l),a,u),t,s)},n,r)},y.translateBy=function(t,e,n,r){y.transform(t,function(){return o(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),i.apply(this,arguments),s)},null,r)},y.translateTo=function(t,e,n,r,a){y.transform(t,function(){var t=i.apply(this,arguments),a=this.__zoom,u=null==r?x(t):"function"==typeof r?r.apply(this,arguments):r;return o(eA.translate(u[0],u[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,s)},r,a)},b.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=ta(this.that).datum();f.call(t,this.that,new eM(t,{sourceEvent:this.sourceEvent,target:y,type:t,transform:this.that.__zoom,dispatch:f}),e)}},y.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:eb(+t),y):a},y.filter=function(t){return arguments.length?(r="function"==typeof t?t:eb(!!t),y):r},y.touchable=function(t){return arguments.length?(u="function"==typeof t?t:eb(!!t),y):u},y.extent=function(t){return arguments.length?(i="function"==typeof t?t:eb([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),y):i},y.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],y):[l[0],l[1]]},y.translateExtent=function(t){return arguments.length?(s[0][0]=+t[0][0],s[1][0]=+t[1][0],s[0][1]=+t[0][1],s[1][1]=+t[1][1],y):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},y.constrain=function(t){return arguments.length?(o=t,y):o},y.duration=function(t){return arguments.length?(c=+t,y):c},y.interpolate=function(t){return arguments.length?(h=t,y):h},y.on=function(){var t=f.on.apply(f,arguments);return t===f?y:t},y.clickDistance=function(t){return arguments.length?(d=(t*=1)*t,y):Math.sqrt(d)},y.tapDistance=function(t){return arguments.length?(p=+t,y):p},y}function eB(t,e){var n,r,i=typeof e;return null==e||"boolean"===i?el(e):("number"===i?tT:"string"===i?(r=t1(e))?(e=r,ec):ep:e instanceof t1?ec:e instanceof Date?function(t,e){var n=new Date;return t*=1,e*=1,function(r){return n.setTime(t*(1-r)+e*r),n}}:!ArrayBuffer.isView(n=e)||n instanceof DataView?Array.isArray(e)?function(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=Array(i),a=Array(r);for(n=0;n<i;++n)o[n]=eB(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?function(t,e){var n,r={},i={};for(n in(null===t||"object"!=typeof t)&&(t={}),(null===e||"object"!=typeof e)&&(e={}),e)n in t?r[n]=eB(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}:tT:function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}})(t,e)}eE.prototype=ek.prototype;let eC={error001:(t="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${t}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${t} handle id: "${"source"===t?n:r}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:t=>`Edge with id "${t}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},eL=[[-1/0,-1/0],[1/0,1/0]],eO=["Enter"," ","Escape"],eq={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};(r=h||(h={})).Strict="strict",r.Loose="loose",(i=f||(f={})).Free="free",i.Vertical="vertical",i.Horizontal="horizontal",(o=d||(d={})).Partial="partial",o.Full="full";let eR={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};(a=p||(p={})).Bezier="default",a.Straight="straight",a.Step="step",a.SmoothStep="smoothstep",a.SimpleBezier="simplebezier",(u=y||(y={})).Arrow="arrow",u.ArrowClosed="arrowclosed",(l=g||(g={})).Left="left",l.Top="top",l.Right="right",l.Bottom="bottom";let eD={[g.Left]:g.Right,[g.Right]:g.Left,[g.Top]:g.Bottom,[g.Bottom]:g.Top};function eV(t){return null===t?null:t?"valid":"invalid"}let eX=t=>"id"in t&&"source"in t&&"target"in t,eY=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),eF=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),eW=(t,e=[0,0])=>{let{width:n,height:r}=nf(t),i=t.origin??e,o=n*i[0],a=r*i[1];return{x:t.position.x-o,y:t.position.y-a}},eK=(t,e={nodeOrigin:[0,0]})=>0===t.length?{x:0,y:0,width:0,height:0}:e8(t.reduce((t,n)=>{let r="string"==typeof n,i=e.nodeLookup||r?void 0:n;return e.nodeLookup&&(i=r?e.nodeLookup.get(n):eF(n)?n:e.nodeLookup.get(n.id)),e4(t,i?e9(i,e.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),eZ=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return t.forEach(t=>{(void 0===e.filter||e.filter(t))&&(n=e4(n,e9(t)),r=!0)}),r?e8(n):{x:0,y:0,width:0,height:0}},eU=(t,e,[n,r,i]=[0,0,1],o=!1,a=!1)=>{let u={...na(e,[n,r,i]),width:e.width/i,height:e.height/i},l=[];for(let e of t.values()){let{measured:t,selectable:n=!0,hidden:r=!1}=e;if(a&&!n||r)continue;let i=t.width??e.width??e.initialWidth??null,s=t.height??e.height??e.initialHeight??null,c=ne(u,e6(e)),h=(i??0)*(s??0),f=o&&c>0;(!e.internals.handleBounds||f||c>=h||e.dragging)&&l.push(e)}return l};async function eQ({nodes:t,width:e,height:n,panZoom:r,minZoom:i,maxZoom:o},a){let u,l;if(0===t.size)return!0;let s=ns(eZ((u=new Map,l=a?.nodes?new Set(a.nodes.map(t=>t.id)):null,t.forEach(t=>{t.measured.width&&t.measured.height&&(a?.includeHiddenNodes||!t.hidden)&&(!l||l.has(t.id))&&u.set(t.id,t)}),u)),e,n,a?.minZoom??i,a?.maxZoom??o,a?.padding??.1);return await r.setViewport(s,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),!0}function eG({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){let a=n.get(t),u=a.parentId?n.get(a.parentId):void 0,{x:l,y:s}=u?u.internals.positionAbsolute:{x:0,y:0},c=a.origin??r,h=a.extent||i;if("parent"!==a.extent||a.expandParent)u&&nh(a.extent)&&(h=[[a.extent[0][0]+l,a.extent[0][1]+s],[a.extent[1][0]+l,a.extent[1][1]+s]]);else if(u){let t=u.measured.width,e=u.measured.height;t&&e&&(h=[[l,s],[l+t,s+e]])}else o?.("005",eC.error005());let f=nh(h)?e1(e,h,a.measured):e;return(void 0===a.measured.width||void 0===a.measured.height)&&o?.("015",eC.error015()),{position:{x:f.x-l+(a.measured.width??0)*c[0],y:f.y-s+(a.measured.height??0)*c[1]},positionAbsolute:f}}async function eJ({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:r,onBeforeDelete:i}){let o,a=new Set(t.map(t=>t.id)),u=[];for(let t of n){if(!1===t.deletable)continue;let e=a.has(t.id),n=!e&&t.parentId&&u.find(e=>e.id===t.parentId);(e||n)&&u.push(t)}let l=new Set(e.map(t=>t.id)),s=r.filter(t=>!1!==t.deletable),c=(o=new Set,u.forEach(t=>{o.add(t.id)}),s.filter(t=>o.has(t.source)||o.has(t.target)));for(let t of s)l.has(t.id)&&!c.find(e=>e.id===t.id)&&c.push(t);if(!i)return{edges:c,nodes:u};let h=await i({nodes:u,edges:c});return"boolean"==typeof h?h?{edges:c,nodes:u}:{edges:[],nodes:[]}:h}let e0=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),e1=(t={x:0,y:0},e,n)=>({x:e0(t.x,e[0][0],e[1][0]-(n?.width??0)),y:e0(t.y,e[0][1],e[1][1]-(n?.height??0))});function e2(t,e,n){let{width:r,height:i}=nf(n),{x:o,y:a}=n.internals.positionAbsolute;return e1(t,[[o,a],[o+r,a+i]],e)}let e5=(t,e,n)=>t<e?e0(Math.abs(t-e),1,e)/e:t>n?-e0(Math.abs(t-n),1,e)/e:0,e3=(t,e,n=15,r=40)=>[e5(t.x,r,e.width-r)*n,e5(t.y,r,e.height-r)*n],e4=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),e7=({x:t,y:e,width:n,height:r})=>({x:t,y:e,x2:t+n,y2:e+r}),e8=({x:t,y:e,x2:n,y2:r})=>({x:t,y:e,width:n-t,height:r-e}),e6=(t,e=[0,0])=>{let{x:n,y:r}=eF(t)?t.internals.positionAbsolute:eW(t,e);return{x:n,y:r,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},e9=(t,e=[0,0])=>{let{x:n,y:r}=eF(t)?t.internals.positionAbsolute:eW(t,e);return{x:n,y:r,x2:n+(t.measured?.width??t.width??t.initialWidth??0),y2:r+(t.measured?.height??t.height??t.initialHeight??0)}},nt=(t,e)=>e8(e4(e7(t),e7(e))),ne=(t,e)=>Math.ceil(Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x))*Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y))),nn=t=>nr(t.width)&&nr(t.height)&&nr(t.x)&&nr(t.y),nr=t=>!isNaN(t)&&isFinite(t),ni=(t,e)=>(t,e)=>{},no=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),na=({x:t,y:e},[n,r,i],o=!1,a=[1,1])=>{let u={x:(t-n)/i,y:(e-r)/i};return o?no(u,a):u},nu=({x:t,y:e},[n,r,i])=>({x:t*i+n,y:e*i+r});function nl(t,e){if("number"==typeof t)return Math.floor((e-e/(1+t))*.5);if("string"==typeof t&&t.endsWith("px")){let e=parseFloat(t);if(!Number.isNaN(e))return Math.floor(e)}if("string"==typeof t&&t.endsWith("%")){let n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}let ns=(t,e,n,r,i,o)=>{let a=function(t,e,n){if("string"==typeof t||"number"==typeof t){let r=nl(t,n),i=nl(t,e);return{top:r,right:i,bottom:r,left:i,x:2*i,y:2*r}}if("object"==typeof t){let r=nl(t.top??t.y??0,n),i=nl(t.bottom??t.y??0,n),o=nl(t.left??t.x??0,e),a=nl(t.right??t.x??0,e);return{top:r,right:a,bottom:i,left:o,x:o+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(o,e,n),u=e0(Math.min((e-a.x)/t.width,(n-a.y)/t.height),r,i),l=t.x+t.width/2,s=t.y+t.height/2,c=e/2-l*u,h=n/2-s*u,f=function(t,e,n,r,i,o){let{x:a,y:u}=nu(t,[e,n,r]),{x:l,y:s}=nu({x:t.x+t.width,y:t.y+t.height},[e,n,r]);return{left:Math.floor(a),top:Math.floor(u),right:Math.floor(i-l),bottom:Math.floor(o-s)}}(t,c,h,u,e,n),d={left:Math.min(f.left-a.left,0),top:Math.min(f.top-a.top,0),right:Math.min(f.right-a.right,0),bottom:Math.min(f.bottom-a.bottom,0)};return{x:c-d.left+d.right,y:h-d.top+d.bottom,zoom:u}},nc=()=>"u">typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function nh(t){return null!=t&&"parent"!==t}function nf(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function nd(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function np(t,e={width:0,height:0},n,r,i){let o={...t},a=r.get(n);if(a){let t=a.origin||i;o.x+=a.internals.positionAbsolute.x-(e.width??0)*t[0],o.y+=a.internals.positionAbsolute.y-(e.height??0)*t[1]}return o}function ny(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function ng(){let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}}function nm(t){return{...eq,...t||{}}}function nv(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:o,y:a}=nk(t),u=na({x:o-(i?.left??0),y:a-(i?.top??0)},r),{x:l,y:s}=n?no(u,e):u;return{xSnapped:l,ySnapped:s,...u}}let nx=t=>({width:t.offsetWidth,height:t.offsetHeight}),nw=t=>t?.getRootNode?.()||window?.document,n_=["INPUT","SELECT","TEXTAREA"];function nb(t){let e=t.composedPath?.()?.[0]||t.target;return e?.nodeType===1&&(n_.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey"))}let nM=t=>"clientX"in t,nk=(t,e)=>{let n=nM(t),r=n?t.clientX:t.touches?.[0].clientX,i=n?t.clientY:t.touches?.[0].clientY;return{x:r-(e?.left??0),y:i-(e?.top??0)}},nA=(t,e,n,r,i)=>{let o=e.querySelectorAll(`.${t}`);return o&&o.length?Array.from(o).map(e=>{let o=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),type:t,nodeId:i,position:e.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...nx(e)}}):null};function nE({sourceX:t,sourceY:e,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:a,targetControlY:u}){let l=.125*t+.375*i+.375*a+.125*n,s=.125*e+.375*o+.375*u+.125*r,c=Math.abs(l-t),h=Math.abs(s-e);return[l,s,c,h]}function n$(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function nz({pos:t,x1:e,y1:n,x2:r,y2:i,c:o}){switch(t){case g.Left:return[e-n$(e-r,o),n];case g.Right:return[e+n$(r-e,o),n];case g.Top:return[e,n-n$(n-i,o)];case g.Bottom:return[e,n+n$(i-n,o)]}}function nN({sourceX:t,sourceY:e,sourcePosition:n=g.Bottom,targetX:r,targetY:i,targetPosition:o=g.Top,curvature:a=.25}){let[u,l]=nz({pos:n,x1:t,y1:e,x2:r,y2:i,c:a}),[s,c]=nz({pos:o,x1:r,y1:i,x2:t,y2:e,c:a}),[h,f,d,p]=nE({sourceX:t,sourceY:e,targetX:r,targetY:i,sourceControlX:u,sourceControlY:l,targetControlX:s,targetControlY:c});return[`M${t},${e} C${u},${l} ${s},${c} ${r},${i}`,h,f,d,p]}function nS({sourceX:t,sourceY:e,targetX:n,targetY:r}){let i=Math.abs(n-t)/2,o=Math.abs(r-e)/2;return[n<t?n+i:n-i,r<e?r+o:r-o,i,o]}function nT({sourceNode:t,targetNode:e,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:o="basic"}){if("manual"===o)return r;let a=Math.max(t.parentId||i&&t.selected?t.internals.z:0,e.parentId||i&&e.selected?e.internals.z:0);return(i&&n?r+1e3:r)+a}function nP({sourceNode:t,targetNode:e,width:n,height:r,transform:i}){let o=e4(e9(t),e9(e));return o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1),ne({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},e8(o))>0}let nI=({source:t,sourceHandle:e,target:n,targetHandle:r})=>`xy-edge__${t}${e||""}-${n}${r||""}`,nH=(t,e,n={})=>{let r,i;if(!t.source||!t.target)return n.onError?.("006",eC.error006()),e;let o=n.getEdgeId||nI;return(i=r=eX(t)?{...t}:{...t,id:o(t)},e.some(t=>t.source===i.source&&t.target===i.target&&(t.sourceHandle===i.sourceHandle||!t.sourceHandle&&!i.sourceHandle)&&(t.targetHandle===i.targetHandle||!t.targetHandle&&!i.targetHandle)))?e:(null===r.sourceHandle&&delete r.sourceHandle,null===r.targetHandle&&delete r.targetHandle,e.concat(r))};function nj({sourceX:t,sourceY:e,targetX:n,targetY:r}){let[i,o,a,u]=nS({sourceX:t,sourceY:e,targetX:n,targetY:r});return[`M ${t},${e}L ${n},${r}`,i,o,a,u]}let nB={[g.Left]:{x:-1,y:0},[g.Right]:{x:1,y:0},[g.Top]:{x:0,y:-1},[g.Bottom]:{x:0,y:1}},nC=({source:t,sourcePosition:e=g.Bottom,target:n})=>e===g.Left||e===g.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},nL=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function nO({sourceX:t,sourceY:e,sourcePosition:n=g.Bottom,targetX:r,targetY:i,targetPosition:o=g.Top,borderRadius:a=5,centerX:u,centerY:l,offset:s=20,stepPosition:c=.5}){let[h,f,d,p,y]=function({source:t,sourcePosition:e=g.Bottom,target:n,targetPosition:r=g.Top,center:i,offset:o,stepPosition:a}){let u,l,s=nB[e],c=nB[r],h={x:t.x+s.x*o,y:t.y+s.y*o},f={x:n.x+c.x*o,y:n.y+c.y*o},d=nC({source:h,sourcePosition:e,target:f}),p=0!==d.x?"x":"y",y=d[p],m=[],v={x:0,y:0},x={x:0,y:0},[,,w,_]=nS({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(s[p]*c[p]==-1){"x"===p?(u=i.x??h.x+(f.x-h.x)*a,l=i.y??(h.y+f.y)/2):(u=i.x??(h.x+f.x)/2,l=i.y??h.y+(f.y-h.y)*a);let t=[{x:u,y:h.y},{x:u,y:f.y}],e=[{x:h.x,y:l},{x:f.x,y:l}];m=s[p]===y?"x"===p?t:e:"x"===p?e:t}else{let i=[{x:h.x,y:f.y}],a=[{x:f.x,y:h.y}];if(m="x"===p?s.x===y?a:i:s.y===y?i:a,e===r){let e=Math.abs(t[p]-n[p]);if(e<=o){let r=Math.min(o-1,o-e);s[p]===y?v[p]=(h[p]>t[p]?-1:1)*r:x[p]=(f[p]>n[p]?-1:1)*r}}if(e!==r){let t="x"===p?"y":"x",e=s[p]===c[t],n=h[t]>f[t],r=h[t]<f[t];(1===s[p]&&(!e&&n||e&&r)||1!==s[p]&&(!e&&r||e&&n))&&(m="x"===p?i:a)}let d={x:h.x+v.x,y:h.y+v.y},g={x:f.x+x.x,y:f.y+x.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(g.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(g.y-m[0].y))?(u=(d.x+g.x)/2,l=m[0].y):(u=m[0].x,l=(d.y+g.y)/2)}let b={x:h.x+v.x,y:h.y+v.y},M={x:f.x+x.x,y:f.y+x.y};return[[t,...b.x!==m[0].x||b.y!==m[0].y?[b]:[],...m,...M.x!==m[m.length-1].x||M.y!==m[m.length-1].y?[M]:[],n],u,l,w,_]}({source:{x:t,y:e},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:u,y:l},offset:s,stepPosition:c}),m=`M${h[0].x} ${h[0].y}`;for(let t=1;t<h.length-1;t++)m+=function(t,e,n,r){let i=Math.min(nL(t,e)/2,nL(e,n)/2,r),{x:o,y:a}=e;if(t.x===o&&o===n.x||t.y===a&&a===n.y)return`L${o} ${a}`;if(t.y===a){let e=t.x<n.x?-1:1,r=t.y<n.y?1:-1;return`L ${o+i*e},${a}Q ${o},${a} ${o},${a+i*r}`}let u=t.x<n.x?1:-1,l=t.y<n.y?-1:1;return`L ${o},${a+i*l}Q ${o},${a} ${o+i*u},${a}`}(h[t-1],h[t],h[t+1],a);return[m+=`L${h[h.length-1].x} ${h[h.length-1].y}`,f,d,p,y]}function nq(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function nR(t){let{sourceNode:e,targetNode:n}=t;if(!nq(e)||!nq(n))return null;let r=e.internals.handleBounds||nD(e.handles),i=n.internals.handleBounds||nD(n.handles),o=nX(r?.source??[],t.sourceHandle),a=nX(t.connectionMode===h.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),t.targetHandle);if(!o||!a)return t.onError?.("008",eC.error008(!o?"source":"target",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;let u=o?.position||g.Bottom,l=a?.position||g.Top,s=nV(e,o,u),c=nV(n,a,l);return{sourceX:s.x,sourceY:s.y,targetX:c.x,targetY:c.y,sourcePosition:u,targetPosition:l}}function nD(t){if(!t)return null;let e=[],n=[];for(let r of t)r.width=r.width??1,r.height=r.height??1,"source"===r.type?e.push(r):"target"===r.type&&n.push(r);return{source:e,target:n}}function nV(t,e,n=g.Left,r=!1){let i=(e?.x??0)+t.internals.positionAbsolute.x,o=(e?.y??0)+t.internals.positionAbsolute.y,{width:a,height:u}=e??nf(t);if(r)return{x:i+a/2,y:o+u/2};switch(e?.position??n){case g.Top:return{x:i+a/2,y:o};case g.Right:return{x:i+a,y:o+u/2};case g.Bottom:return{x:i+a/2,y:o+u};case g.Left:return{x:i,y:o+u/2}}}function nX(t,e){return t&&(e?t.find(t=>t.id===e):t[0])||null}function nY(t,e){if(!t)return"";if("string"==typeof t)return t;let n=e?`${e}__`:"";return`${n}${Object.keys(t).sort().map(e=>`${e}=${t[e]}`).join("&")}`}function nF(t,{id:e,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let o=new Set;return t.reduce((t,a)=>([a.markerStart||r,a.markerEnd||i].forEach(r=>{if(r&&"object"==typeof r){let i=nY(r,e);o.has(i)||(t.push({id:i,color:r.color||n,...r}),o.add(i))}}),t),[]).sort((t,e)=>t.id.localeCompare(e.id))}let nW={nodeOrigin:[0,0],nodeExtent:eL,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},nK={...nW,checkEquality:!0};function nZ(t,e){let n={...t};for(let t in e)void 0!==e[t]&&(n[t]=e[t]);return n}function nU(t,e,n){let r=nZ(nW,n);for(let n of t.values())if(n.parentId)nJ(n,t,e,r);else{let t=e1(eW(n,r.nodeOrigin),nh(n.extent)?n.extent:r.nodeExtent,nf(n));n.internals.positionAbsolute=t}}function nQ(t){return"manual"===t}function nG(t,e,n,r={}){let i=nZ(nK,r),o={i:0},a=new Map(e),u=i?.elevateNodesOnSelect&&!nQ(i.zIndexMode)?1e3:0,l=t.length>0,s=!1;for(let c of(e.clear(),n.clear(),t)){let t=a.get(c.id);if(i.checkEquality&&c===t?.internals.userNode)e.set(c.id,t);else{let n=e1(eW(c,i.nodeOrigin),nh(c.extent)?c.extent:i.nodeExtent,nf(c));t={...i.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:n,handleBounds:function(t,e){if(!t.handles)return t.measured?e?.internals.handleBounds:void 0;let n=[],r=[];for(let e of t.handles){let i={id:e.id,width:e.width??1,height:e.height??1,nodeId:t.id,x:e.x,y:e.y,position:e.position,type:e.type};"source"===e.type?n.push(i):"target"===e.type&&r.push(i)}return{source:n,target:r}}(c,t),z:n0(c,u,i.zIndexMode),userNode:c}},e.set(c.id,t)}void 0!==t.measured&&void 0!==t.measured.width&&void 0!==t.measured.height||t.hidden||(l=!1),c.parentId&&nJ(t,e,n,r,o),s||=c.selected??!1}return{nodesInitialized:l,hasSelectedNodes:s}}function nJ(t,e,n,r,i){let{elevateNodesOnSelect:o,nodeOrigin:a,nodeExtent:u,zIndexMode:l}=nZ(nW,r),s=t.parentId,c=e.get(s);if(!c)return void console.warn(`Parent node ${s} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(t,e){if(!t.parentId)return;let n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}(t,n),i&&!c.parentId&&void 0===c.internals.rootParentIndex&&"auto"===l&&(c.internals.rootParentIndex=++i.i,c.internals.z=c.internals.z+10*i.i),i&&void 0!==c.internals.rootParentIndex&&(i.i=c.internals.rootParentIndex);let{x:h,y:f,z:d}=function(t,e,n,r,i,o){let{x:a,y:u}=e.internals.positionAbsolute,l=nf(t),s=eW(t,n),c=nh(t.extent)?e1(s,t.extent,l):s,h=e1({x:a+c.x,y:u+c.y},r,l);"parent"===t.extent&&(h=e2(h,l,e));let f=n0(t,i,o),d=e.internals.z??0;return{x:h.x,y:h.y,z:d>=f?d+1:f}}(t,c,a,u,o&&!nQ(l)?1e3:0,l),{positionAbsolute:p}=t.internals,y=h!==p.x||f!==p.y;(y||d!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:y?{x:h,y:f}:p,z:d}})}function n0(t,e,n){let r=nr(t.zIndex)?t.zIndex:0;return nQ(n)?r:r+(t.selected?e:0)}function n1(t,e,n,r=[0,0]){let i=[],o=new Map;for(let n of t){let t=e.get(n.parentId);if(!t)continue;let r=nt(o.get(n.parentId)?.expandedRect??e6(t),n.rect);o.set(n.parentId,{expandedRect:r,parent:t})}return o.size>0&&o.forEach(({expandedRect:e,parent:o},a)=>{let u=o.internals.positionAbsolute,l=nf(o),s=o.origin??r,c=e.x<u.x?Math.round(Math.abs(u.x-e.x)):0,h=e.y<u.y?Math.round(Math.abs(u.y-e.y)):0,f=Math.max(l.width,Math.round(e.width)),d=Math.max(l.height,Math.round(e.height)),p=(f-l.width)*s[0],y=(d-l.height)*s[1];(c>0||h>0||p||y)&&(i.push({id:a,type:"position",position:{x:o.position.x-c+p,y:o.position.y-h+y}}),n.get(a)?.forEach(e=>{t.some(t=>t.id===e.id)||i.push({id:e.id,type:"position",position:{x:e.position.x+c,y:e.position.y+h}})})),(l.width<e.width||l.height<e.height||c||h)&&i.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:f+(c?s[0]*c-p:0),height:d+(h?s[1]*h-y:0)}})}),i}function n2(t,e,n,r,i,o,a){let u=r?.querySelector(".xyflow__viewport"),l=!1;if(!u)return{changes:[],updatedInternals:l};let s=[],c=window.getComputedStyle(u),{m22:h}=new window.DOMMatrixReadOnly(c.transform),f=[];for(let r of t.values()){let t=e.get(r.id);if(!t)continue;if(t.hidden){e.set(t.id,{...t,internals:{...t.internals,handleBounds:void 0}}),l=!0;continue}let u=nx(r.nodeElement),c=t.measured.width!==u.width||t.measured.height!==u.height;if(u.width&&u.height&&(c||!t.internals.handleBounds||r.force)){let d=r.nodeElement.getBoundingClientRect(),p=nh(t.extent)?t.extent:o,{positionAbsolute:y}=t.internals;t.parentId&&"parent"===t.extent?y=e2(y,u,e.get(t.parentId)):p&&(y=e1(y,p,u));let g={...t,measured:u,internals:{...t.internals,positionAbsolute:y,handleBounds:{source:nA("source",r.nodeElement,d,h,t.id),target:nA("target",r.nodeElement,d,h,t.id)}}};e.set(t.id,g),t.parentId&&nJ(g,e,n,{nodeOrigin:i,zIndexMode:a}),l=!0,c&&(s.push({id:t.id,type:"dimensions",dimensions:u}),t.expandParent&&t.parentId&&f.push({id:t.id,parentId:t.parentId,rect:e6(g,i)}))}}if(f.length>0){let t=n1(f,e,n,i);s.push(...t)}return{changes:s,updatedInternals:l}}async function n5({delta:t,panZoom:e,transform:n,translateExtent:r,width:i,height:o}){if(!e||!t.x&&!t.y)return!1;let a=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[i,o]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function n3(t,e,n,r,i,o){let a=i,u=r.get(a)||new Map;r.set(a,u.set(n,e)),a=`${i}-${t}`;let l=r.get(a)||new Map;if(r.set(a,l.set(n,e)),o){a=`${i}-${t}-${o}`;let u=r.get(a)||new Map;r.set(a,u.set(n,e))}}function n4(t,e,n){for(let r of(t.clear(),e.clear(),n)){let{source:n,target:i,sourceHandle:o=null,targetHandle:a=null}=r,u={edgeId:r.id,source:n,target:i,sourceHandle:o,targetHandle:a},l=`${n}-${o}--${i}-${a}`;n3("source",u,`${i}-${a}--${n}-${o}`,t,n,o),n3("target",u,l,t,i,a),e.set(r.id,r)}}function n7(t,e,n){let r=t;do{if(r?.matches?.(e))return!0;if(r===n)break;r=r?.parentElement}while(r);return!1}function n8({nodeId:t,dragItems:e,nodeLookup:n,dragging:r=!0}){let i=[];for(let[t,o]of e){let e=n.get(t)?.internals.userNode;e&&i.push({...e,position:o.position,dragging:r})}if(!t)return[i[0],i];let o=n.get(t)?.internals.userNode;return[o?{...o,position:e.get(t)?.position||o.position,dragging:r}:i[0],i]}function n6({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},a=0,u=new Map,l=!1,s={x:0,y:0},c=null,h=!1,f=null,d=!1,p=!1,y=null;return{update:function({noDragClassName:g,handleSelector:m,domNode:x,isSelectable:w,nodeId:_,nodeClickDistance:b=0}){function M({x:t,y:n}){let{nodeLookup:i,nodeExtent:a,snapGrid:l,snapToGrid:s,nodeOrigin:c,onNodeDrag:h,onSelectionDrag:f,onError:d,updateNodePositions:g}=e();o={x:t,y:n};let m=!1,v=u.size>1,x=v&&a?e7(eZ(u)):null,w=v&&s?function({dragItems:t,snapGrid:e,x:n,y:r}){let i=t.values().next().value;if(!i)return null;let o={x:n-i.distance.x,y:r-i.distance.y},a=no(o,e);return{x:a.x-o.x,y:a.y-o.y}}({dragItems:u,snapGrid:l,x:t,y:n}):null;for(let[e,r]of u){if(!i.has(e))continue;let o={x:t-r.distance.x,y:n-r.distance.y};s&&(o=w?{x:Math.round(o.x+w.x),y:Math.round(o.y+w.y)}:no(o,l));let u=null;if(v&&a&&!r.extent&&x){let{positionAbsolute:t}=r.internals,e=t.x-x.x+a[0][0],n=t.x+r.measured.width-x.x2+a[1][0];u=[[e,t.y-x.y+a[0][1]],[n,t.y+r.measured.height-x.y2+a[1][1]]]}let{position:h,positionAbsolute:f}=eG({nodeId:e,nextPosition:o,nodeLookup:i,nodeExtent:u||a,nodeOrigin:c,onError:d});m=m||r.position.x!==h.x||r.position.y!==h.y,r.position=h,r.internals.positionAbsolute=f}if(p=p||m,m&&(g(u,!0),y&&(r||h||!_&&f))){let[t,e]=n8({nodeId:_,dragItems:u,nodeLookup:i});r?.(y,u,t,e),h?.(y,t,e),_||f?.(y,e)}}async function k(){if(!c)return;let{transform:t,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=e();if(!i){l=!1,cancelAnimationFrame(a);return}let[u,h]=e3(s,c,r);(0!==u||0!==h)&&(o.x=(o.x??0)-u/t[2],o.y=(o.y??0)-h/t[2],await n({x:u,y:h})&&M(o)),a=requestAnimationFrame(k)}function A(r){let{nodeLookup:i,multiSelectionActive:a,nodesDraggable:l,transform:s,snapGrid:f,snapToGrid:d,selectNodesOnDrag:p,onNodeDragStart:y,onSelectionDragStart:g,unselectNodesAndEdges:m}=e();h=!0,p&&w||a||!_||i.get(_)?.selected||m(),w&&p&&_&&t?.(_);let v=nv(r.sourceEvent,{transform:s,snapGrid:f,snapToGrid:d,containerBounds:c});if(o=v,(u=function(t,e,n,r){let i=new Map;for(let[o,a]of t)if((a.selected||a.id===r)&&(!a.parentId||!function t(e,n){if(!e.parentId)return!1;let r=n.get(e.parentId);return!!r&&(!!r.selected||t(r,n))}(a,t))&&(a.draggable||e&&void 0===a.draggable)){let e=t.get(o);e&&i.set(o,{id:o,position:e.position||{x:0,y:0},distance:{x:n.x-e.internals.positionAbsolute.x,y:n.y-e.internals.positionAbsolute.y},extent:e.extent,parentId:e.parentId,origin:e.origin,expandParent:e.expandParent,internals:{positionAbsolute:e.internals.positionAbsolute||{x:0,y:0}},measured:{width:e.measured.width??0,height:e.measured.height??0}})}return i}(i,l,v,_)).size>0&&(n||y||!_&&g)){let[t,e]=n8({nodeId:_,dragItems:u,nodeLookup:i});n?.(r.sourceEvent,u,t,e),y?.(r.sourceEvent,t,e),_||g?.(r.sourceEvent,e)}}f=ta(x);let E=(function(){var t,e,n,r,i=tg,o=tm,a=tv,u=tx,l={},s=(0,v.A)("start","drag","end"),c=0,h=0;function f(t){t.on("mousedown.drag",d).filter(u).on("touchstart.drag",g).on("touchmove.drag",m,tl).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(a,u){if(!r&&i.call(this,a,u)){var l=w(this,o.call(this,a,u),a,u,"mouse");l&&(ta(a.view).on("mousemove.drag",p,ts).on("mouseup.drag",y,ts),tf(a.view),tc(a),n=!1,t=a.clientX,e=a.clientY,l("start",a))}}function p(r){if(th(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>h}l.mouse("drag",r)}function y(t){ta(t.view).on("mousemove.drag mouseup.drag",null),td(t.view,n),th(t),l.mouse("end",t)}function g(t,e){if(i.call(this,t,e)){var n,r,a=t.changedTouches,u=o.call(this,t,e),l=a.length;for(n=0;n<l;++n)(r=w(this,u,t,e,a[n].identifier,a[n]))&&(tc(t),r("start",t,a[n]))}}function m(t){var e,n,r=t.changedTouches,i=r.length;for(e=0;e<i;++e)(n=l[r[e].identifier])&&(th(t),n("drag",t,r[e]))}function x(t){var e,n,i=t.changedTouches,o=i.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),e=0;e<o;++e)(n=l[i[e].identifier])&&(tc(t),n("end",t,i[e]))}function w(t,e,n,r,i,o){var u,h,d,p=s.copy(),y=tu(o||n,e);if(null!=(d=a.call(t,new ty("beforestart",{sourceEvent:n,target:f,identifier:i,active:c,x:y[0],y:y[1],dx:0,dy:0,dispatch:p}),r)))return u=d.x-y[0]||0,h=d.y-y[1]||0,function n(o,a,s){var g,m=y;switch(o){case"start":l[i]=n,g=c++;break;case"end":delete l[i],--c;case"drag":y=tu(s||a,e),g=c}p.call(o,t,new ty(o,{sourceEvent:a,subject:d,target:f,identifier:i,active:g,x:y[0]+u,y:y[1]+h,dx:y[0]-m[0],dy:y[1]-m[1],dispatch:p}),r)}}return f.filter=function(t){return arguments.length?(i="function"==typeof t?t:tp(!!t),f):i},f.container=function(t){return arguments.length?(o="function"==typeof t?t:tp(t),f):o},f.subject=function(t){return arguments.length?(a="function"==typeof t?t:tp(t),f):a},f.touchable=function(t){return arguments.length?(u="function"==typeof t?t:tp(!!t),f):u},f.on=function(){var t=s.on.apply(s,arguments);return t===s?f:t},f.clickDistance=function(t){return arguments.length?(h=(t*=1)*t,f):Math.sqrt(h)},f})().clickDistance(b).on("start",t=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:a,snapToGrid:u}=e();c=n?.getBoundingClientRect()||null,d=!1,p=!1,y=t.sourceEvent,0===r&&A(t),o=nv(t.sourceEvent,{transform:i,snapGrid:a,snapToGrid:u,containerBounds:c}),s=nk(t.sourceEvent,c)}).on("drag",t=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:a,nodeDragThreshold:f,nodeLookup:p}=e(),g=nv(t.sourceEvent,{transform:r,snapGrid:i,snapToGrid:a,containerBounds:c});if(y=t.sourceEvent,("touchmove"===t.sourceEvent.type&&t.sourceEvent.touches.length>1||_&&!p.has(_))&&(d=!0),!d){if(!l&&n&&h&&(l=!0,k()),!h){let e=nk(t.sourceEvent,c),n=e.x-s.x,r=e.y-s.y;Math.sqrt(n*n+r*r)>f&&A(t)}(o.x!==g.xSnapped||o.y!==g.ySnapped)&&u&&h&&(s=nk(t.sourceEvent,c),M(g))}}).on("end",t=>{if(!h||d){d&&u.size>0&&e().updateNodePositions(u,!1);return}if(l=!1,h=!1,cancelAnimationFrame(a),u.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:o,onSelectionDragStop:a}=e();if(p&&(r(u,!1),p=!1),i||o||!_&&a){let[e,r]=n8({nodeId:_,dragItems:u,nodeLookup:n,dragging:!1});i?.(t.sourceEvent,u,e,r),o?.(t.sourceEvent,e,r),_||a?.(t.sourceEvent,r)}}}).filter(t=>{let e=t.target;return!t.button&&(!g||!n7(e,`.${g}`,x))&&(!m||n7(e,m,x))});f.call(E)},destroy:function(){f?.on(".drag",null)}}}function n9(t,e,n,r,i,o=!1){let a=r.get(t);if(!a)return null;let u="strict"===i?a.internals.handleBounds?.[e]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],l=(n?u?.find(t=>t.id===n):u?.[0])??null;return l&&o?{...l,...nV(a,l,l.position,!0)}:l}function rt(t,e){return t?t:e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null}let re=()=>!0;function rn(t,{handle:e,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:a,lib:u,flowId:l,isValidConnection:s=re,nodeLookup:c}){let f="target"===o,d=e?a.querySelector(`.${u}-flow__handle[data-id="${l}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x:p,y}=nk(t),g=a.elementFromPoint(p,y),m=g?.classList.contains(`${u}-flow__handle`)?g:d,v={handleDomNode:m,isValid:!1,connection:null,toHandle:null};if(m){let t=rt(void 0,m),e=m.getAttribute("data-nodeid"),o=m.getAttribute("data-handleid"),a=m.classList.contains("connectable"),u=m.classList.contains("connectableend");if(!e||!t)return v;let l={source:f?e:r,sourceHandle:f?o:i,target:f?r:e,targetHandle:f?i:o};v.connection=l,v.isValid=a&&u&&(n===h.Strict?f&&"source"===t||!f&&"target"===t:e!==r||o!==i)&&s(l),v.toHandle=n9(e,t,o,c,n,!0)}return v}let rr={onPointerDown:function(t,{connectionMode:e,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:a,domNode:u,nodeLookup:l,lib:s,autoPanOnConnect:c,flowId:h,panBy:f,cancelConnection:d,onConnectStart:p,onConnect:y,onConnectEnd:m,isValidConnection:v=re,onReconnectEnd:x,updateConnection:w,getTransform:_,getFromHandle:b,autoPanSpeed:M,dragThreshold:k=1,handleDomNode:A}){let E,$=nw(t.target),z=0,{x:N,y:S}=nk(t),T=rt(o,A),P=u?.getBoundingClientRect(),I=!1;if(!P||!T)return;let H=n9(i,T,r,l,e);if(!H)return;let j=nk(t,P),B=!1,C=null,L=!1,O=null,q={...H,nodeId:i,type:T,position:H.position},R=l.get(i),D={inProgress:!0,isValid:null,from:nV(R,q,g.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:R,to:j,toHandle:null,toPosition:eD[q.position],toNode:null,pointer:j};function V(){I=!0,w(D),p?.(t,{nodeId:i,handleId:r,handleType:T})}function X(t){var o,u;let d;if(!I){let{x:e,y:n}=nk(t),r=e-N,i=n-S;if(!(r*r+i*i>k*k))return;V()}if(!b()||!q)return void Y(t);let p=_();E=function(t,e,n,r){let i=[],o=1/0;for(let a of function(t,e,n){let r=[],i={x:t.x-n,y:t.y-n,width:2*n,height:2*n};for(let t of e.values())ne(i,e6(t))>0&&r.push(t);return r}(t,n,e+250))for(let n of[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]]){if(r.nodeId===n.nodeId&&r.type===n.type&&r.id===n.id)continue;let{x:u,y:l}=nV(a,n,n.position,!0),s=Math.sqrt(Math.pow(u-t.x,2)+Math.pow(l-t.y,2));s>e||(s<o?(i=[{...n,x:u,y:l}],o=s):s===o&&i.push({...n,x:u,y:l}))}if(!i.length)return null;if(i.length>1){let t="source"===r.type?"target":"source";return i.find(e=>e.type===t)??i[0]}return i[0]}(na(j=nk(t,P),p,!1,[1,1]),n,l,q),B||(!function t(){if(!c||!P)return;let[e,n]=e3(j,P,M);f({x:e,y:n}),z=requestAnimationFrame(t)}(),B=!0);let y=rn(t,{handle:E,connectionMode:e,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:v,doc:$,lib:s,flowId:h,nodeLookup:l});O=y.handleDomNode,C=y.connection,o=!!E,u=y.isValid,d=null,u?d=!0:o&&!u&&(d=!1),L=d;let m=l.get(i),x=m?nV(m,q,g.Left,!0):D.from,A={...D,from:x,isValid:L,to:y.toHandle&&L?nu({x:y.toHandle.x,y:y.toHandle.y},p):j,toHandle:y.toHandle,toPosition:L&&y.toHandle?y.toHandle.position:eD[q.position],toNode:y.toHandle?l.get(y.toHandle.nodeId):null,pointer:j};w(A),D=A}function Y(t){if(!("touches"in t)||!(t.touches.length>0)){if(I){(E||O)&&C&&L&&y?.(C);let{inProgress:e,...n}=D,r={...n,toPosition:D.toHandle?D.toPosition:null};m?.(t,r),o&&x?.(t,r)}d(),cancelAnimationFrame(z),B=!1,L=!1,C=null,O=null,$.removeEventListener("mousemove",X),$.removeEventListener("mouseup",Y),$.removeEventListener("touchmove",X),$.removeEventListener("touchend",Y)}}0===k&&V(),$.addEventListener("mousemove",X),$.addEventListener("mouseup",Y),$.addEventListener("touchmove",X),$.addEventListener("touchend",Y)},isValid:rn};function ri({domNode:t,panZoom:e,getTransform:n,getViewScale:r}){let i=ta(t);return{update:function({translateExtent:t,width:o,height:a,zoomStep:u=1,pannable:l=!0,zoomable:s=!0,inversePan:c=!1}){let h=[0,0],f=ej().on("start",t=>{("mousedown"===t.sourceEvent.type||"touchstart"===t.sourceEvent.type)&&(h=[t.sourceEvent.clientX??t.sourceEvent.touches[0].clientX,t.sourceEvent.clientY??t.sourceEvent.touches[0].clientY])}).on("zoom",l?i=>{let u=n();if("mousemove"!==i.sourceEvent.type&&"touchmove"!==i.sourceEvent.type||!e)return;let l=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],s=[l[0]-h[0],l[1]-h[1]];h=l;let f=r()*Math.max(u[2],Math.log(u[2]))*(c?-1:1),d={x:u[0]-s[0]*f,y:u[1]-s[1]*f};e.setViewportConstrained({x:d.x,y:d.y,zoom:u[2]},[[0,0],[o,a]],t)}:null).on("zoom.wheel",s?t=>{if("wheel"!==t.sourceEvent.type||!e)return;let r=n(),i=t.sourceEvent.ctrlKey&&nc()?10:1,o=-t.sourceEvent.deltaY*(1===t.sourceEvent.deltaMode?.05:t.sourceEvent.deltaMode?1:.002)*u,a=r[2]*Math.pow(2,o*i);e.scaleTo(a)}:null);i.call(f,{})},destroy:function(){i.on("zoom",null)},pointer:tu}}let ro=t=>({x:t.x,y:t.y,zoom:t.k}),ra=({x:t,y:e,zoom:n})=>eA.translate(t,e).scale(n),ru=(t,e)=>t.target.closest(`.${e}`),rl=(t,e)=>2===e&&Array.isArray(t)&&t.includes(2),rs=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,rc=(t,e=0,n=rs,r=()=>{})=>{let i="number"==typeof e&&e>0;return i||r(),i?t.transition().duration(e).ease(n).on("end",r):t},rh=t=>{let e=t.ctrlKey&&nc()?10:1;return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*e};function rf({domNode:t,minZoom:e,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:o,onPanZoomStart:a,onPanZoomEnd:u,onDraggingChange:l}){let s={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=t.getBoundingClientRect(),h=ej().scaleExtent([e,n]).translateExtent(r),d=ta(t).call(h);v({x:i.x,y:i.y,zoom:e0(i.zoom,e,n)},[[0,0],[c.width,c.height]],r);let p=d.on("wheel.zoom"),y=d.on("dblclick.zoom");async function g(t,e){return!!d&&new Promise(n=>{h?.interpolate(e?.interpolate==="linear"?eB:t_).transform(rc(d,e?.duration,e?.ease,()=>n(!0)),t)})}function m(){h.on("zoom",null)}async function v(t,e,n){let r=ra(t),i=h?.constrain()(r,e,n);return i&&await g(i),i}return h.wheelDelta(rh),{update:function({noWheelClassName:t,noPanClassName:e,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:c,panOnScrollMode:g,panOnScrollSpeed:v,preventScrolling:x,zoomOnPinch:w,zoomOnScroll:_,zoomOnDoubleClick:b,zoomActivationKeyPressed:M,lib:k,onTransformChange:A,connectionInProgress:E,paneClickDistance:$,selectionOnDrag:z}){r&&!s.isZoomingOrPanning&&m();let N=i&&!M&&!r;h.clickDistance(z?1/0:!nr($)||$<0?0:$);let S=N?function({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:a,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:s}){return c=>{if(ru(c,e))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();let h=n.property("__zoom").k||1;if(c.ctrlKey&&a){let t=tu(c),e=h*Math.pow(2,rh(c));r.scaleTo(n,e,t,c);return}let d=1===c.deltaMode?20:1,p=i===f.Vertical?0:c.deltaX*d,y=i===f.Horizontal?0:c.deltaY*d;!nc()&&c.shiftKey&&i!==f.Vertical&&(p=c.deltaY*d,y=0),r.translateBy(n,-(p/h)*o,-(y/h)*o,{internal:!0});let g=ro(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(l?.(c,g),t.panScrollTimeout=setTimeout(()=>{s?.(c,g),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,u?.(c,g))}}({zoomPanValues:s,noWheelClassName:t,d3Selection:d,d3Zoom:h,panOnScrollMode:g,panOnScrollSpeed:v,zoomOnPinch:w,onPanZoomStart:a,onPanZoom:o,onPanZoomEnd:u}):function({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(r,i){let o="wheel"===r.type,a=!e&&o&&!r.ctrlKey,u=ru(r,t);if(r.ctrlKey&&o&&u&&r.preventDefault(),a||u)return null;r.preventDefault(),n.call(this,r,i)}}({noWheelClassName:t,preventScrolling:x,d3ZoomHandler:p});d.on("wheel.zoom",S,{passive:!1});let T=function({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=ro(r.transform);t.mouseButton=r.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=i,r.sourceEvent?.type==="mousedown"&&e(!0),n&&n?.(r.sourceEvent,i)}}({zoomPanValues:s,onDraggingChange:l,onPanZoomStart:a});h.on("start",T);let P=function({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{t.usedRightMouseButton=!!(n&&rl(e,t.mouseButton??0)),o.sourceEvent?.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!o.sourceEvent?.internal&&i?.(o.sourceEvent,ro(o.transform))}}({zoomPanValues:s,panOnDrag:c,onPaneContextMenu:!!n,onPanZoom:o,onTransformChange:A});h.on("zoom",P);let I=function({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return a=>{if(!a.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,o&&rl(e,t.mouseButton??0)&&!t.usedRightMouseButton&&a.sourceEvent&&o(a.sourceEvent),t.usedRightMouseButton=!1,r(!1),i)){let e=ro(a.transform);t.prevViewport=e,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{i?.(a.sourceEvent,e)},150*!!n)}}}({zoomPanValues:s,panOnDrag:c,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:u,onDraggingChange:l});h.on("end",I);let H=function({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:a,noWheelClassName:u,noPanClassName:l,lib:s,connectionInProgress:c}){return h=>{let f=t||e,d=n&&h.ctrlKey,p="wheel"===h.type;if(1===h.button&&"mousedown"===h.type&&(ru(h,`${s}-flow__node`)||ru(h,`${s}-flow__edge`)))return!0;if(!r&&!f&&!i&&!o&&!n||a||c&&!p||ru(h,u)&&p||ru(h,l)&&(!p||i&&p&&!t)||!n&&h.ctrlKey&&p)return!1;if(!n&&"touchstart"===h.type&&h.touches?.length>1)return h.preventDefault(),!1;if(!f&&!i&&!d&&p||!r&&("mousedown"===h.type||"touchstart"===h.type)||Array.isArray(r)&&!r.includes(h.button)&&"mousedown"===h.type)return!1;let y=Array.isArray(r)&&r.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||p)&&y}}({zoomActivationKeyPressed:M,panOnDrag:c,zoomOnScroll:_,panOnScroll:i,zoomOnDoubleClick:b,zoomOnPinch:w,userSelectionActive:r,noPanClassName:e,noWheelClassName:t,lib:k,connectionInProgress:E});h.filter(H),b?d.on("dblclick.zoom",y):d.on("dblclick.zoom",null)},destroy:m,setViewport:async function t(t,e){let n=ra(t);return await g(n,e),n},setViewportConstrained:v,getViewport:function(){let t=d?eE(d.node()):{x:0,y:0,k:1};return{x:t.x,y:t.y,zoom:t.k}},scaleTo:async function t(t,e){return!!d&&new Promise(n=>{h?.interpolate(e?.interpolate==="linear"?eB:t_).scaleTo(rc(d,e?.duration,e?.ease,()=>n(!0)),t)})},scaleBy:async function t(t,e){return!!d&&new Promise(n=>{h?.interpolate(e?.interpolate==="linear"?eB:t_).scaleBy(rc(d,e?.duration,e?.ease,()=>n(!0)),t)})},setScaleExtent:function(t){h?.scaleExtent(t)},setTranslateExtent:function(t){h?.translateExtent(t)},syncViewport:function(t){if(d){let e=ra(t),n=d.property("__zoom");(n.k!==t.zoom||n.x!==t.x||n.y!==t.y)&&h?.transform(d,e,null,{sync:!0})}},setClickDistance:function(t){let e=!nr(t)||t<0?0:t;h?.clickDistance(e)}}}(s=m||(m={})).Line="line",s.Handle="handle"},8962:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]])},9005:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},9339:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={callServer:function(){return o.callServer},createServerReference:function(){return u.createServerReference},findSourceMapURL:function(){return a.findSourceMapURL}};for(var i in r)Object.defineProperty(e,i,{enumerable:!0,get:r[i]});let o=n(77304),a=n(4060),u=n(77197)},15330:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]])},15480:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]])},17112:(t,e,n)=>{"use strict";n.d(e,{D:()=>a});var r=n(12115),i=n(63699),o=n(94257);function a(t){let e=r.useContext(i.Ts)?"drawer":"dialog";return(0,o.G)(t,e)}},17356:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},17494:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},25640:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("map-pinned",[["path",{d:"M18 8c0 3.613-3.869 7.429-5.393 8.795a1 1 0 0 1-1.214 0C9.87 15.429 6 11.613 6 8a6 6 0 0 1 12 0",key:"11u0oz"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M8.714 14h-3.71a1 1 0 0 0-.948.683l-2.004 6A1 1 0 0 0 3 22h18a1 1 0 0 0 .948-1.316l-2-6a1 1 0 0 0-.949-.684h-3.712",key:"q8zwxj"}]])},32133:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("message-square-plus",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]])},32521:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r={value:()=>{}};function i(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw Error("illegal type: "+t);r[t]=[]}return new o(r)}function o(t){this._=t}function a(t,e,n){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=r,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}o.prototype=i.prototype={constructor:o,on:function(t,e){var n,r=this._,i=(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw Error("unknown type: "+t);return{type:t,name:e}}),o=-1,u=i.length;if(arguments.length<2){for(;++o<u;)if((n=(t=i[o]).type)&&(n=function(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}(r[n],t.name)))return n;return}if(null!=e&&"function"!=typeof e)throw Error("invalid callback: "+e);for(;++o<u;)if(n=(t=i[o]).type)r[n]=a(r[n],t.name,e);else if(null==e)for(n in r)r[n]=a(r[n],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new o(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw Error("unknown type: "+t);for(r=this._[t],o=0,n=r.length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};let u=i},34306:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},40638:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("message-circle-question-mark",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},45486:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("panel-right",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]])},50916:(t,e,n)=>{"use strict";n.d(e,{h:()=>h,n:()=>s});var r=n(12115),i=n(94577);let o=t=>{let e,n=new Set,r=(t,r)=>{let i="function"==typeof t?t(e):t;if(!Object.is(i,e)){let t=e;e=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},e,i),n.forEach(n=>n(e,t))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>a,subscribe:t=>(n.add(t),()=>n.delete(t)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=e=t(r,i,o);return o},{useDebugValue:a}=r,{useSyncExternalStoreWithSelector:u}=i,l=t=>t;function s(t,e=l,n){let r=u(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return a(r),r}let c=(t,e)=>{let n=t?o(t):o,r=(t,r=e)=>s(n,t,r);return Object.assign(r,n),r},h=(t,e)=>t?c(t,e):c},51128:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]])},53255:()=>{},60976:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("redo-2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]])},61388:(t,e,n)=>{"use strict";n.d(e,{b:()=>p});var r=n(12115),i=n.t(r,2);function o(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}n(47650);var a=n(95155),u=Symbol.for("react.lazy"),l=i[" use ".trim().toString()];function s(t){var e;return null!=t&&"object"==typeof t&&"$$typeof"in t&&t.$$typeof===u&&"_payload"in t&&"object"==typeof(e=t._payload)&&null!==e&&"then"in e}var c=Symbol("radix.slottable");function h(t){return r.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===c}var f=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,e)=>{var n,i;let u,c,f,d=(i=n=`Primitive.${e}`,(u=r.forwardRef((t,e)=>{let{children:n,...i}=t;if(s(n)&&"function"==typeof l&&(n=l(n._payload)),r.isValidElement(n)){var a;let t,u,l=(a=n,(u=(t=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?a.ref:(u=(t=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?a.props.ref:a.props.ref||a.ref),s=function(t,e){let n={...e};for(let r in e){let i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...t)=>{let e=o(...t);return i(...t),e}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}(i,n.props);return n.type!==r.Fragment&&(s.ref=e?function(...t){return e=>{let n=!1,r=t.map(t=>{let r=o(t,e);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let e=0;e<r.length;e++){let n=r[e];"function"==typeof n?n():o(t[e],null)}}}}(e,l):l),r.cloneElement(n,s)}return r.Children.count(n)>1?r.Children.only(null):null})).displayName=`${i}.SlotClone`,c=u,(f=r.forwardRef((t,e)=>{let{children:n,...i}=t;s(n)&&"function"==typeof l&&(n=l(n._payload));let o=r.Children.toArray(n),u=o.find(h);if(u){let t=u.props.children,n=o.map(e=>e!==u?e:r.Children.count(t)>1?r.Children.only(null):r.isValidElement(t)?t.props.children:null);return(0,a.jsx)(c,{...i,ref:e,children:r.isValidElement(t)?r.cloneElement(t,void 0,n):null})}return(0,a.jsx)(c,{...i,ref:e,children:n})})).displayName=`${n}.Slot`,f),p=r.forwardRef((t,n)=>{let{asChild:r,...i}=t;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,a.jsx)(r?d:e,{...i,ref:n})});return p.displayName=`Primitive.${e}`,{...t,[e]:p}},{}),d=r.forwardRef((t,e)=>(0,a.jsx)(f.label,{...t,ref:e,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));d.displayName="Label";var p=d},65377:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},65408:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]])},69684:(t,e,n)=>{"use strict";n.d(e,{A:()=>function t(e){if("string"==typeof e||"number"==typeof e)return""+e;let n="";if(Array.isArray(e))for(let r=0,i;r<e.length;r++)""!==(i=t(e[r]))&&(n+=(n&&" ")+i);else for(let t in e)e[t]&&(n+=(n&&" ")+t);return n}})},80846:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]])},81499:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},83599:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]])},84824:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]])},86272:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]])},87977:(t,e,n)=>{"use strict";n.d(e,{M4:()=>y,O1:()=>g,tB:()=>d});var r,i,o=0,a=0,u=0,l=0,s=0,c=0,h="object"==typeof performance&&performance.now?performance:Date,f="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function d(){return s||(f(p),s=h.now()+c)}function p(){s=0}function y(){this._call=this._time=this._next=null}function g(t,e,n){var r=new y;return r.restart(t,e,n),r}function m(){s=(l=h.now())+c,o=a=0;try{d(),++o;for(var t,e=r;e;)(t=s-e._time)>=0&&e._call.call(void 0,t),e=e._next;--o}finally{o=0,function(){for(var t,e,n=r,o=1/0;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:r=e);i=t,x(o)}(),s=0}}function v(){var t=h.now(),e=t-l;e>1e3&&(c-=e,l=t)}function x(t){!o&&(a&&(a=clearTimeout(a)),t-s>24?(t<1/0&&(a=setTimeout(m,t-h.now()-c)),u&&(u=clearInterval(u))):(u||(l=h.now(),u=setInterval(v,1e3)),o=1,f(m)))}y.prototype=g.prototype={constructor:y,restart:function(t,e,n){if("function"!=typeof t)throw TypeError("callback is not a function");n=(null==n?d():+n)+(null==e?0:+e),this._next||i===this||(i?i._next=this:r=this,i=this),this._call=t,this._time=n,x()},stop:function(){this._call&&(this._call=null,this._time=1/0,x())}}},94192:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});let r=(0,n(30772).A)("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]])},99026:(t,e,n)=>{"use strict";function r(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(let[n,r]of t)if(!Object.is(r,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}let n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(t[r],e[r]))return!1;return!0}n.d(e,{x:()=>r})}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{31698:(e,s,a)=>{"use strict";a.d(s,{Landing:()=>h});var t=a(95155),n=a(12115),r=a(98500),l=a.n(r),o=a(52965),i=a(39593);a(93340);let c=i.EO,d=[{n:"01",title:"Install",body:"One binary. No account, nothing to configure.",cmd:(0,t.jsx)("span",{className:"text-foreground",children:c})},{n:"02",title:"Run it in your repo",body:"Registers the repo, starts one shared local server, and opens the panel in your browser.",cmd:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"w-signal",children:"$"})," ",(0,t.jsx)("span",{className:"text-foreground",children:"beacon"})]})},{n:"03",title:"Map your codebase",body:(0,t.jsxs)(t.Fragment,{children:["In your terminal session, run ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"/beacon-init"}),". Beacon reads the repo and draws its architecture, schema, and roadmap."]}),cmd:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-foreground",children:"/beacon-init"})," ",(0,t.jsx)("span",{className:"w-muted",children:"\xb7 beacon doctor"})]})},{n:"04",title:"Propose your first plan",body:(0,t.jsxs)(t.Fragment,{children:["Ask the agent to plan a feature. It calls ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"beacon_propose_plan"})," ","and the plan renders live on the ",(0,t.jsx)("span",{className:"text-foreground",children:"/plan"})," canvas — features, tables, and endpoints."]})},{n:"05",title:"Review & close the loop",body:(0,t.jsxs)(t.Fragment,{children:["Annotate inline, edit the boards, then ",(0,t.jsx)("span",{className:"text-foreground",children:"Approve"}),","," ",(0,t.jsx)("span",{className:"text-foreground",children:"Submit\xa0feedback"}),", or ",(0,t.jsx)("span",{className:"text-foreground",children:"Discard"}),". Your verdict flows straight back to your terminal session."]})}],x=[{label:"Reuse first",body:"Beacon blocks duplicate features — check the map before you create."},{label:"Design data first",body:(0,t.jsxs)(t.Fragment,{children:["Plan tables and endpoints before code; review the schema as a draft on"," ",(0,t.jsx)("span",{className:"text-foreground",children:"/db"}),"."]})},{label:"Close every loop",body:"Register finished work so the map and context stay accurate next session."}],m={boxShadow:"0 0 0 1px var(--border), 0 0 24px -9px rgba(255,122,69,0.75)"};function h(){let e=(0,n.useRef)(null),[s,a]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let s=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(e.target.classList.add("in"),s.unobserve(e.target))})},{threshold:.12});return e.current?.querySelectorAll(".w-reveal").forEach(e=>s.observe(e)),()=>s.disconnect()},[]),(0,t.jsxs)("div",{className:"welcome",ref:e,children:[(0,t.jsx)("div",{className:"welcome-bg","aria-hidden":!0}),(0,t.jsx)("header",{className:"fixed inset-x-0 top-0 z-50",children:(0,t.jsx)("div",{className:"mx-auto max-w-6xl px-6",children:(0,t.jsxs)("div",{className:"w-load mt-4 glass flex items-center justify-between rounded-full py-2.5 pl-5 pr-3",style:{animationDelay:".05s"},children:[(0,t.jsxs)(l(),{href:"#top",className:"flex items-center gap-2.5",children:[(0,t.jsx)(o._,{size:20,className:"text-foreground"}),(0,t.jsx)("span",{className:"font-semibold tracking-tight",children:"Beacon"})]}),(0,t.jsxs)("nav",{className:"flex items-center gap-6 text-sm w-muted",children:[(0,t.jsx)("a",{href:"#start",className:"transition-colors hover:text-foreground",children:"How it works"}),(0,t.jsx)("a",{href:"/docs",className:"transition-colors hover:text-foreground",children:"Docs"})]})]})})}),(0,t.jsx)("span",{id:"top"}),(0,t.jsxs)("section",{className:"flex min-h-screen flex-col items-center px-6 pb-12 pt-20 text-center",children:[(0,t.jsxs)("div",{className:"w-load glass-soft mb-6 flex items-center gap-2 rounded-full px-3.5 py-1.5",style:{animationDelay:".12s"},children:[(0,t.jsx)("span",{className:"w-live h-1.5 w-1.5 rounded-full",style:{background:"#ff7a45",boxShadow:"0 0 8px #ff7a45"}}),(0,t.jsx)("span",{className:"w-mono w-eyebrow w-muted",children:"Local \xb7 no account \xb7 no API key"})]}),(0,t.jsxs)("h1",{className:"w-load max-w-4xl font-semibold text-[clamp(2.25rem,5vw,3.6rem)]",style:{letterSpacing:"-0.025em",lineHeight:1.06,animationDelay:".18s"},children:["Plan features on a canvas,",(0,t.jsx)("br",{}),"not in a wall of text."]}),(0,t.jsx)("p",{className:"w-load w-muted mt-5 max-w-xl text-[1.02rem] leading-relaxed",style:{animationDelay:".26s"},children:"Beacon is the visual planning surface for the coding agent in your terminal. Your session proposes the plan — you review, annotate, and approve with a click."}),(0,t.jsxs)("div",{className:"w-load mt-8 w-full max-w-2xl",style:{animationDelay:".34s"},children:[(0,t.jsxs)("div",{className:"glass overflow-hidden rounded-lg text-left",style:{boxShadow:"0 24px 70px -22px rgba(0,0,0,.85), inset 0 1px 0 oklch(1 0 0 /.08), 0 18px 60px -30px rgba(255,122,69,.4)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[(0,t.jsx)("span",{className:"h-3 w-3 rounded-full",style:{background:"#ff7a45",boxShadow:"0 0 7px rgba(255,122,69,.7)"}}),(0,t.jsx)("span",{className:"h-3 w-3 rounded-full",style:{background:"oklch(1 0 0 / .16)"}}),(0,t.jsx)("span",{className:"h-3 w-3 rounded-full",style:{background:"oklch(1 0 0 / .16)"}}),(0,t.jsx)("span",{className:"w-mono ml-2 text-[0.72rem] w-muted",children:"install — bash"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 px-5 py-5",children:[(0,t.jsxs)("code",{className:"w-mono w-scrollbar-none flex-1 overflow-x-auto whitespace-nowrap text-[0.95rem]",children:[(0,t.jsx)("span",{className:"w-signal select-none",children:"$"}),(0,t.jsx)("span",{className:"ml-2",children:c}),(0,t.jsx)("span",{className:"w-caret ml-1 inline-block h-4 w-2 align-middle",style:{background:"#ff7a45"}})]}),(0,t.jsx)("button",{onClick:function(){navigator.clipboard?.writeText(c),a(!0),setTimeout(()=>a(!1),1600)},className:"glass-soft w-hover grid h-10 w-10 shrink-0 place-items-center rounded-md","aria-label":"Copy install command",children:s?(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#ff7a45",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}):(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]}),(0,t.jsxs)("p",{className:"w-mono w-muted mt-4 text-[0.8rem]",children:["then run ",(0,t.jsx)("span",{className:"text-foreground",children:"beacon"})," inside any repo"]})]}),(0,t.jsxs)("a",{href:"#start",className:"w-load mt-auto pt-16 flex flex-col items-center gap-2 w-muted transition-colors hover:text-foreground",style:{animationDelay:".6s"},children:[(0,t.jsx)("span",{className:"w-mono w-eyebrow",children:"How it works"}),(0,t.jsx)("svg",{className:"w-cue",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"m6 9 6 6 6-6"})})]})]}),(0,t.jsxs)("section",{id:"start",className:"px-6 py-28",children:[(0,t.jsxs)("div",{className:"mx-auto max-w-2xl",children:[(0,t.jsxs)("div",{className:"w-reveal mb-16 text-center",children:[(0,t.jsx)("p",{className:"w-mono w-eyebrow w-signal mb-4",children:"Get the best out of Beacon"}),(0,t.jsx)("h2",{className:"text-[clamp(1.9rem,4vw,2.75rem)] font-semibold tracking-tight",children:"From install to your first approved plan"}),(0,t.jsx)("div",{className:"w-accent-line mx-auto mt-6 h-px w-40"})]}),(0,t.jsxs)("ol",{className:"relative",children:[(0,t.jsx)("span",{className:"w-beam absolute bottom-7 left-[1.45rem] top-5 w-px","aria-hidden":!0}),d.map((e,s)=>(0,t.jsxs)("li",{className:`w-reveal relative pl-[4.75rem] ${s<d.length-1?"pb-6":""}`,children:[(0,t.jsx)("span",{className:"w-mono glass absolute left-0 top-0 grid h-[2.9rem] w-[2.9rem] place-items-center rounded-lg text-[0.82rem] font-semibold text-foreground",style:m,children:e.n}),(0,t.jsxs)("div",{className:"glass w-hover rounded-lg p-5",children:[(0,t.jsx)("h3",{className:"mb-1.5 font-semibold",children:e.title}),(0,t.jsx)("p",{className:`w-muted text-[0.92rem] leading-relaxed ${e.cmd?"mb-3":""}`,children:e.body}),e.cmd&&(0,t.jsx)("code",{className:"w-mono glass-soft inline-block rounded-md px-3 py-1.5 text-[0.78rem]",children:e.cmd})]})]},e.n))]})]}),(0,t.jsx)("div",{className:"mx-auto mt-28 grid max-w-5xl gap-5 md:grid-cols-3",children:x.map(e=>(0,t.jsxs)("div",{className:"w-reveal glass w-hover rounded-lg p-6",children:[(0,t.jsx)("p",{className:"w-mono w-eyebrow w-signal mb-3",children:e.label}),(0,t.jsx)("p",{className:"w-muted text-[0.95rem] leading-relaxed",children:e.body})]},e.label))})]}),(0,t.jsx)("footer",{className:"px-6 pb-12 pt-8",children:(0,t.jsxs)("div",{className:"mx-auto max-w-5xl",children:[(0,t.jsx)("div",{className:"w-accent-line mb-8 h-px w-full opacity-60"}),(0,t.jsxs)("div",{className:"flex flex-col items-center justify-between gap-5 md:flex-row",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(o._,{size:26,className:"text-foreground"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-semibold leading-tight",children:"Beacon"}),(0,t.jsx)("p",{className:"w-mono w-muted text-[0.72rem]",children:"the visual planning surface for your terminal"})]})]}),(0,t.jsxs)("nav",{className:"flex items-center gap-6 text-sm w-muted",children:[(0,t.jsx)("a",{href:"/docs",className:"transition-colors hover:text-foreground",children:"Docs"}),(0,t.jsx)("a",{href:"#",className:"transition-colors hover:text-foreground",children:"Changelog"})]}),(0,t.jsxs)("p",{className:"w-mono w-muted text-[0.72rem]",children:["Created by"," ",(0,t.jsxs)("a",{href:"https://www.instagram.com/wenzorithelly/",target:"_blank",rel:"noreferrer",className:"w-signal inline-flex items-center gap-1 underline decoration-dotted underline-offset-2 transition-opacity hover:opacity-80",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,t.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"5",ry:"5"}),(0,t.jsx)("path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"}),(0,t.jsx)("line",{x1:"17.5",y1:"6.5",x2:"17.51",y2:"6.5"})]}),"Wenzo"]}),(0,t.jsx)("span",{className:"mx-2 opacity-40",children:"\xb7"}),"\xa9 2026 Beacon"]})]})]})})]})}},39593:(e,s,a)=>{"use strict";a.d(s,{EO:()=>l,S2:()=>n,W6:()=>r});var t=a(41463);let n="https://api.github.com/repos/wenzorithelly/beacon/releases/latest",r=(t.env.NEXT_PUBLIC_BEACON_SITE_URL??"https://www.trybeacon.sh").replace(/\/$/,""),l=`curl -fsSL ${r}/install.sh | sh`},52965:(e,s,a)=>{"use strict";a.d(s,{_:()=>n});var t=a(95155);function n({size:e=18,className:s}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"11 1.5 74 74",fill:"none",className:s,"aria-hidden":"true",children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"beacon-mark-beam",x1:"0",y1:"1",x2:"0",y2:"0",children:[(0,t.jsx)("stop",{offset:"0",stopColor:"#ffb27a",stopOpacity:"0.9"}),(0,t.jsx)("stop",{offset:"0.55",stopColor:"#ff7a45",stopOpacity:"0.3"}),(0,t.jsx)("stop",{offset:"1",stopColor:"#ff7a45",stopOpacity:"0"})]})}),(0,t.jsx)("path",{d:"M48 30 L40 4 L56 4 Z",fill:"url(#beacon-mark-beam)"}),(0,t.jsx)("path",{d:"M48 33 L72.5 73 L23.5 73 Z",fill:"currentColor",stroke:"currentColor",strokeWidth:2.4,strokeLinejoin:"round"}),(0,t.jsx)("circle",{cx:"48",cy:"31",r:"5.2",fill:"var(--accent-2, #ff7a45)",style:{filter:"drop-shadow(0 0 4px var(--accent-2, #ff7a45))"}}),(0,t.jsx)("circle",{cx:"48",cy:"31",r:"2",fill:"#ffd9c2"})]})}},72543:(e,s,a)=>{Promise.resolve().then(a.bind(a,31698))},93340:()=>{}},e=>{e.O(0,[1477,8500,8441,3794,7358],()=>e(e.s=72543)),_N_E=e.O()}]);
|