@memoarchitect/architect 0.6.0 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/assets/ChatPanel-Dp_E5vjj.js +3 -0
- package/dist/assets/{ComplianceWizard-s0BYP9sH.js → ComplianceWizard-CgtKjuZp.js} +1 -1
- package/dist/assets/{DSMView-C55GKPeE.js → DSMView-DTUyQHSu.js} +1 -1
- package/dist/assets/{Dashboard-DGiiwpMx.js → Dashboard-CwosozE0.js} +1 -1
- package/dist/assets/DhfDashboard-Dp6ryOII.js +1 -0
- package/dist/assets/{DhfSettingsPanel-BYTUIoK4.js → DhfSettingsPanel-Bx2t0sXQ.js} +1 -1
- package/dist/assets/{DhfWorkbench-CUzn_SQo.js → DhfWorkbench-BN3gpDz4.js} +3 -3
- package/dist/assets/DiagramCanvas-O_19DfTS.js +1 -0
- package/dist/assets/DiagramEditor-CNhwdNh3.js +4 -0
- package/dist/assets/ElementDetailView-rciRq5HA.js +2 -0
- package/dist/assets/{ImportView-CdHzpWCe.js → ImportView-BbzZ5hbB.js} +1 -1
- package/dist/assets/{LayerGrid-Bnv8Ww8p.js → LayerGrid-DAIv9DZ6.js} +1 -1
- package/dist/assets/{LayerTable-CeO0t2NX.js → LayerTable-BnOya4yd.js} +1 -1
- package/dist/assets/{MaxGraphCanvas-BH29OQf7.js → MaxGraphCanvas-BaVQOtM7.js} +3 -3
- package/dist/assets/{ModelDiff-DoGTGDhy.js → ModelDiff-Mm8cCWYb.js} +1 -1
- package/dist/assets/OntologyDecompositionDiagram-COmPilyD.js +1 -0
- package/dist/assets/{OntologyViewer-BGl9FWMx.js → OntologyViewer-esGC-MHX.js} +2 -2
- package/dist/assets/{RelationshipOverlay-DSzjs5U7.js → RelationshipOverlay-B9bqt4zl.js} +1 -1
- package/dist/assets/{RelationshipsSection-2CEoiF6o.js → RelationshipsSection-DttMvF2i.js} +1 -1
- package/dist/assets/{ReviewDashboard-Du0bEgrG.js → ReviewDashboard-CAZFVV_h.js} +1 -1
- package/dist/assets/ScenarioEditor-B68Qn6c9.js +3 -0
- package/dist/assets/{StatisticsDashboard-BdrXtbp4.js → StatisticsDashboard-DBs1LLID.js} +1 -1
- package/dist/assets/{SysmlCodeEditor-CGOcUFE7.js → SysmlCodeEditor-Die2RUsz.js} +1 -1
- package/dist/assets/{SysmlGenerator-CxtxOJ9I.js → SysmlGenerator-C8TebOjb.js} +1 -1
- package/dist/assets/{TabularView-BJQSVDMO.js → TabularView-_BN5T3rn.js} +1 -1
- package/dist/assets/{TraceabilityMatrix-BhDLjHki.js → TraceabilityMatrix-CKZyOf1u.js} +1 -1
- package/dist/assets/{WorkflowWizard-BWKNcz03.js → WorkflowWizard-DaqQTLpd.js} +1 -1
- package/dist/assets/elk-6l8mIQnQ.js +26 -0
- package/dist/assets/index-C8UZrEP-.js +3277 -0
- package/dist/assets/index-XtCtnAfF.css +1 -0
- package/dist/assets/layout-providers-Dr743WlP.js +1 -0
- package/dist/assets/layout-selection-CpBDhXjU.js +1 -0
- package/dist/assets/{reactflow-CX-HDacK.js → reactflow-CsCqNKB-.js} +1 -1
- package/dist/assets/{zustand-qbFpP9Up.js → zustand-CrhqMOHB.js} +1 -1
- package/dist/index.html +4 -4
- package/lib/bin/memo-architect.js +20 -2
- package/lib/bin/memo-architect.js.map +1 -1
- package/lib/commands/example.d.ts +4 -0
- package/lib/commands/example.d.ts.map +1 -1
- package/lib/commands/example.js +14 -7
- package/lib/commands/example.js.map +1 -1
- package/package.json +8 -5
- package/dist/assets/AskPanel-CbZrbBeK.js +0 -1
- package/dist/assets/DhfDashboard-BE5JabB1.js +0 -1
- package/dist/assets/DiagramCanvas-IINBJE7R.js +0 -1
- package/dist/assets/DiagramEditor-Ce5_o4RB.js +0 -4
- package/dist/assets/ElementDetailView-CZ8SUxsc.js +0 -2
- package/dist/assets/OntologyDecompositionDiagram-CerdFGpm.js +0 -1
- package/dist/assets/ScenarioEditor-BjLWOYwL.js +0 -3
- package/dist/assets/elk-B75IRfCd.js +0 -1
- package/dist/assets/index-CRFOCEAK.js +0 -3277
- package/dist/assets/index-DPzXL4uF.css +0 -1
- package/dist/assets/layout-providers-BFnfta4Z.js +0 -26
- package/dist/assets/layout-selection-CtqXOAtf.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-500:oklch(63.7% .237 25.331);--color-slate-50:oklch(98.4% .003 247.858);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-3{top:calc(var(--spacing) * 3)}.top-7{top:calc(var(--spacing) * 7)}.top-16{top:calc(var(--spacing) * 16)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-3{right:calc(var(--spacing) * 3)}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-12{bottom:calc(var(--spacing) * 12)}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.left-full{left:100%}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-6{margin-inline:calc(var(--spacing) * -6)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mr-0\.5{margin-right:calc(var(--spacing) * .5)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-5{margin-left:calc(var(--spacing) * 5)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-20{width:calc(var(--spacing) * 20)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-\[80px\]{min-width:80px}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.bg-slate-50{background-color:var(--color-slate-50)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-2{padding-left:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-all{word-break:break-all}.text-red-500{color:var(--color-red-500)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}@media(min-width:48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}:root{--color-bg:#f7f7f5;--color-surface:#fff;--color-surface-alt:#f0f0ed;--color-border:#e5e5e0;--color-border-light:#ededea;--color-text:#1a1a1a;--color-text-secondary:#6b7280;--color-text-muted:#9ca3af;--color-accent:#2dd4a8;--color-hero-from:#1b3a4b;--color-hero-to:#2d6a7a}body{background:var(--color-bg);color:var(--color-text);-webkit-font-smoothing:antialiased;margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Inter,Roboto,sans-serif}#root{flex-direction:column;height:100vh;display:flex}.react-flow__controls{overflow:hidden;border:1px solid #e5e5e0!important;border-radius:12px!important;box-shadow:0 1px 3px #0000000f!important}.react-flow__controls-button{fill:#6b7280!important;background:#fff!important;border-bottom:1px solid #ededea!important}.react-flow__controls-button:hover{background:#f0f0ed!important}.react-flow__minimap{overflow:hidden;border:1px solid #e5e5e0!important;border-radius:12px!important;box-shadow:0 1px 3px #0000000f!important}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#9ca3af}.react-flow__node{transition:box-shadow .15s,opacity .15s}.ibd-interconnection-edge .react-flow__edge-interaction{pointer-events:none}@keyframes memo-ibd-flow{to{stroke-dashoffset:-30px}}.memo-ibd-flow{stroke-dasharray:8 7;pointer-events:none;animation:.7s linear infinite memo-ibd-flow}@media(prefers-reduced-motion:reduce){.memo-ibd-flow{animation:none}}.react-flow__edge path{transition:stroke-width .15s}.react-flow__edge:hover path{stroke-width:3px}.react-flow__node:hover .react-flow__handle{opacity:1!important}.react-flow__node:hover .react-flow__handle.ibd-port-anchor,.react-flow__handle.ibd-port-anchor{opacity:0!important;pointer-events:none!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var le=Object.defineProperty;var fe=(W,E,y)=>E in W?le(W,E,{enumerable:!0,configurable:!0,writable:!0,value:y}):W[E]=y;var ee=(W,E,y)=>fe(W,typeof E!="symbol"?E+"":E,y);import{g as ge}from"./zustand-CrhqMOHB.js";import{r as pe}from"./elk-6l8mIQnQ.js";const ve="memo.layout.elk";function ue(W){return structuredClone(W)}function me(W,E){const y=(r,s)=>{if(s.has(r.id))throw new Error(`Layout result contains duplicate node id: ${r.id}`);if(s.add(r.id),r.x!==void 0&&!Number.isFinite(r.x))throw new Error(`Layout result has invalid x for ${r.id}`);if(r.y!==void 0&&!Number.isFinite(r.y))throw new Error(`Layout result has invalid y for ${r.id}`);for(const t of r.children??[])y(t,s)},C=new Set,_=new Set;if(y(W,C),y(E,_),C.size!==_.size||[...C].some(r=>!_.has(r)))throw new Error("Layout provider changed the graph node identity set");const h=r=>`${r.id}\0${r.sources.join("\0")}\0${r.targets.join("\0")}`,n=new Set((W.edges??[]).map(h)),a=new Set((E.edges??[]).map(h));if(n.size!==a.size||[...n].some(r=>!a.has(r)))throw new Error("Layout provider changed the graph edge identity or endpoints")}class we{constructor(){ee(this,"providers",new Map)}register(E){const y=this.providers.get(E.descriptor.id);if(y&&y!==E)throw new Error(`Layout provider already registered: ${E.descriptor.id}`);this.providers.set(E.descriptor.id,E)}unregister(E){return this.providers.delete(E)}get(E){return this.providers.get(E)}list(E=[]){return[...this.providers.values()].map(y=>y.descriptor).filter(y=>E.every(C=>y.capabilities.includes(C))).sort((y,C)=>y.name.localeCompare(C.name))}async layout(E,y={}){var a;const C=y.providerId??ve,_=this.providers.get(C);if(!_)throw new Error(`Layout provider not found: ${C}`);const h=_.supports(E);if(!h.supported)throw new Error(`${_.descriptor.name} cannot layout this diagram${h.reason?`: ${h.reason}`:""}`);if((a=y.signal)!=null&&a.aborted)throw y.signal.reason??new DOMException("Layout aborted","AbortError");const n=await _.layout(E,y);return me(E,n),n}async dispose(){await Promise.all([...this.providers.values()].map(E=>{var y;return(y=E.dispose)==null?void 0:y.call(E)})),this.providers.clear()}}var K=(W,E)=>()=>(E||W((E={exports:{}}).exports,E),E.exports),Z=K((W,E)=>{var y=Object.defineProperty,C=(v,l,T)=>l in v?y(v,l,{enumerable:!0,configurable:!0,writable:!0,value:T}):v[l]=T,_=(v,l)=>()=>(l||v((l={exports:{}}).exports,l),l.exports),h=(v,l,T)=>C(v,typeof l!="symbol"?l+"":l,T),n=_((v,l)=>{var T="\0",b="\0",x="",I=class{constructor(o){h(this,"_isDirected",!0),h(this,"_isMultigraph",!1),h(this,"_isCompound",!1),h(this,"_label"),h(this,"_defaultNodeLabelFn",()=>{}),h(this,"_defaultEdgeLabelFn",()=>{}),h(this,"_nodes",{}),h(this,"_in",{}),h(this,"_preds",{}),h(this,"_out",{}),h(this,"_sucs",{}),h(this,"_edgeObjs",{}),h(this,"_edgeLabels",{}),h(this,"_nodeCount",0),h(this,"_edgeCount",0),h(this,"_parent"),h(this,"_children"),o&&(this._isDirected=Object.hasOwn(o,"directed")?o.directed:!0,this._isMultigraph=Object.hasOwn(o,"multigraph")?o.multigraph:!1,this._isCompound=Object.hasOwn(o,"compound")?o.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[b]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(o){return this._label=o,this}graph(){return this._label}setDefaultNodeLabel(o){return this._defaultNodeLabelFn=o,typeof o!="function"&&(this._defaultNodeLabelFn=()=>o),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var o=this;return this.nodes().filter(e=>Object.keys(o._in[e]).length===0)}sinks(){var o=this;return this.nodes().filter(e=>Object.keys(o._out[e]).length===0)}setNodes(o,e){var d=arguments,c=this;return o.forEach(function(m){d.length>1?c.setNode(m,e):c.setNode(m)}),this}setNode(o,e){return Object.hasOwn(this._nodes,o)?(arguments.length>1&&(this._nodes[o]=e),this):(this._nodes[o]=arguments.length>1?e:this._defaultNodeLabelFn(o),this._isCompound&&(this._parent[o]=b,this._children[o]={},this._children[b][o]=!0),this._in[o]={},this._preds[o]={},this._out[o]={},this._sucs[o]={},++this._nodeCount,this)}node(o){return this._nodes[o]}hasNode(o){return Object.hasOwn(this._nodes,o)}removeNode(o){var e=this;if(Object.hasOwn(this._nodes,o)){var d=c=>e.removeEdge(e._edgeObjs[c]);delete this._nodes[o],this._isCompound&&(this._removeFromParentsChildList(o),delete this._parent[o],this.children(o).forEach(function(c){e.setParent(c)}),delete this._children[o]),Object.keys(this._in[o]).forEach(d),delete this._in[o],delete this._preds[o],Object.keys(this._out[o]).forEach(d),delete this._out[o],delete this._sucs[o],--this._nodeCount}return this}setParent(o,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e===void 0)e=b;else{e+="";for(var d=e;d!==void 0;d=this.parent(d))if(d===o)throw new Error("Setting "+e+" as parent of "+o+" would create a cycle");this.setNode(e)}return this.setNode(o),this._removeFromParentsChildList(o),this._parent[o]=e,this._children[e][o]=!0,this}_removeFromParentsChildList(o){delete this._children[this._parent[o]][o]}parent(o){if(this._isCompound){var e=this._parent[o];if(e!==b)return e}}children(o=b){if(this._isCompound){var e=this._children[o];if(e)return Object.keys(e)}else{if(o===b)return this.nodes();if(this.hasNode(o))return[]}}predecessors(o){var e=this._preds[o];if(e)return Object.keys(e)}successors(o){var e=this._sucs[o];if(e)return Object.keys(e)}neighbors(o){var e=this.predecessors(o);if(e){let c=new Set(e);for(var d of this.successors(o))c.add(d);return Array.from(c.values())}}isLeaf(o){var e;return this.isDirected()?e=this.successors(o):e=this.neighbors(o),e.length===0}filterNodes(o){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var d=this;Object.entries(this._nodes).forEach(function([P,z]){o(P)&&e.setNode(P,z)}),Object.values(this._edgeObjs).forEach(function(P){e.hasNode(P.v)&&e.hasNode(P.w)&&e.setEdge(P,d.edge(P))});var c={};function m(P){var z=d.parent(P);return z===void 0||e.hasNode(z)?(c[P]=z,z):z in c?c[z]:m(z)}return this._isCompound&&e.nodes().forEach(P=>e.setParent(P,m(P))),e}setDefaultEdgeLabel(o){return this._defaultEdgeLabelFn=o,typeof o!="function"&&(this._defaultEdgeLabelFn=()=>o),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(o,e){var d=this,c=arguments;return o.reduce(function(m,P){return c.length>1?d.setEdge(m,P,e):d.setEdge(m,P),P}),this}setEdge(){var o,e,d,c,m=!1,P=arguments[0];typeof P=="object"&&P!==null&&"v"in P?(o=P.v,e=P.w,d=P.name,arguments.length===2&&(c=arguments[1],m=!0)):(o=P,e=arguments[1],d=arguments[3],arguments.length>2&&(c=arguments[2],m=!0)),o=""+o,e=""+e,d!==void 0&&(d=""+d);var z=F(this._isDirected,o,e,d);if(Object.hasOwn(this._edgeLabels,z))return m&&(this._edgeLabels[z]=c),this;if(d!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(o),this.setNode(e),this._edgeLabels[z]=m?c:this._defaultEdgeLabelFn(o,e,d);var U=A(this._isDirected,o,e,d);return o=U.v,e=U.w,Object.freeze(U),this._edgeObjs[z]=U,D(this._preds[e],o),D(this._sucs[o],e),this._in[e][z]=U,this._out[o][z]=U,this._edgeCount++,this}edge(o,e,d){var c=arguments.length===1?B(this._isDirected,arguments[0]):F(this._isDirected,o,e,d);return this._edgeLabels[c]}edgeAsObj(){let o=this.edge(...arguments);return typeof o!="object"?{label:o}:o}hasEdge(o,e,d){var c=arguments.length===1?B(this._isDirected,arguments[0]):F(this._isDirected,o,e,d);return Object.hasOwn(this._edgeLabels,c)}removeEdge(o,e,d){var c=arguments.length===1?B(this._isDirected,arguments[0]):F(this._isDirected,o,e,d),m=this._edgeObjs[c];return m&&(o=m.v,e=m.w,delete this._edgeLabels[c],delete this._edgeObjs[c],R(this._preds[e],o),R(this._sucs[o],e),delete this._in[e][c],delete this._out[o][c],this._edgeCount--),this}inEdges(o,e){return this.isDirected()?this.filterEdges(this._in[o],o,e):this.nodeEdges(o,e)}outEdges(o,e){return this.isDirected()?this.filterEdges(this._out[o],o,e):this.nodeEdges(o,e)}nodeEdges(o,e){if(o in this._nodes)return this.filterEdges({...this._in[o],...this._out[o]},o,e)}filterEdges(o,e,d){if(o){var c=Object.values(o);return d?c.filter(function(m){return m.v===e&&m.w===d||m.v===d&&m.w===e}):c}}};function D(o,e){o[e]?o[e]++:o[e]=1}function R(o,e){--o[e]||delete o[e]}function F(o,e,d,c){var m=""+e,P=""+d;if(!o&&m>P){var z=m;m=P,P=z}return m+x+P+x+(c===void 0?T:c)}function A(o,e,d,c){var m=""+e,P=""+d;if(!o&&m>P){var z=m;m=P,P=z}var U={v:m,w:P};return c&&(U.name=c),U}function B(o,e){return F(o,e.v,e.w,e.name)}l.exports=I}),a=_((v,l)=>{l.exports="3.0.2"}),r=_((v,l)=>{l.exports={Graph:n(),version:a()}}),s=_((v,l)=>{var T=n();l.exports={write:b,read:D};function b(R){var F={options:{directed:R.isDirected(),multigraph:R.isMultigraph(),compound:R.isCompound()},nodes:x(R),edges:I(R)};return R.graph()!==void 0&&(F.value=structuredClone(R.graph())),F}function x(R){return R.nodes().map(function(F){var A=R.node(F),B=R.parent(F),o={v:F};return A!==void 0&&(o.value=A),B!==void 0&&(o.parent=B),o})}function I(R){return R.edges().map(function(F){var A=R.edge(F),B={v:F.v,w:F.w};return F.name!==void 0&&(B.name=F.name),A!==void 0&&(B.value=A),B})}function D(R){var F=new T(R.options).setGraph(R.value);return R.nodes.forEach(function(A){F.setNode(A.v,A.value),A.parent&&F.setParent(A.v,A.parent)}),R.edges.forEach(function(A){F.setEdge({v:A.v,w:A.w,name:A.name},A.value)}),F}}),t=_((v,l)=>{l.exports=b;var T=()=>1;function b(I,D,R,F){return x(I,String(D),R||T,F||function(A){return I.outEdges(A)})}function x(I,D,R,F){var A={},B=!0,o=0,e=I.nodes(),d=function(z){var U=R(z);A[z.v].distance+U<A[z.w].distance&&(A[z.w]={distance:A[z.v].distance+U,predecessor:z.v},B=!0)},c=function(){e.forEach(function(z){F(z).forEach(function(U){var H=U.v===z?U.v:U.w,te=H===U.v?U.w:U.v;d({v:H,w:te})})})};e.forEach(function(z){var U=z===D?0:Number.POSITIVE_INFINITY;A[z]={distance:U}});for(var m=e.length,P=1;P<m&&(B=!1,o++,c(),!!B);P++);if(o===m-1&&(B=!1,c(),B))throw new Error("The graph contains a negative weight cycle");return A}}),i=_((v,l)=>{l.exports=T;function T(b){var x={},I=[],D;function R(F){Object.hasOwn(x,F)||(x[F]=!0,D.push(F),b.successors(F).forEach(R),b.predecessors(F).forEach(R))}return b.nodes().forEach(function(F){D=[],R(F),D.length&&I.push(D)}),I}}),g=_((v,l)=>{var T=class{constructor(){h(this,"_arr",[]),h(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(b){return b.key})}has(b){return Object.hasOwn(this._keyIndices,b)}priority(b){var x=this._keyIndices[b];if(x!==void 0)return this._arr[x].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(b,x){var I=this._keyIndices;if(b=String(b),!Object.hasOwn(I,b)){var D=this._arr,R=D.length;return I[b]=R,D.push({key:b,priority:x}),this._decrease(R),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var b=this._arr.pop();return delete this._keyIndices[b.key],this._heapify(0),b.key}decrease(b,x){var I=this._keyIndices[b];if(x>this._arr[I].priority)throw new Error("New priority is greater than current priority. Key: "+b+" Old: "+this._arr[I].priority+" New: "+x);this._arr[I].priority=x,this._decrease(I)}_heapify(b){var x=this._arr,I=2*b,D=I+1,R=b;I<x.length&&(R=x[I].priority<x[R].priority?I:R,D<x.length&&(R=x[D].priority<x[R].priority?D:R),R!==b&&(this._swap(b,R),this._heapify(R)))}_decrease(b){for(var x=this._arr,I=x[b].priority,D;b!==0&&(D=b>>1,!(x[D].priority<I));)this._swap(b,D),b=D}_swap(b,x){var I=this._arr,D=this._keyIndices,R=I[b],F=I[x];I[b]=F,I[x]=R,D[F.key]=b,D[R.key]=x}};l.exports=T}),u=_((v,l)=>{var T=g();l.exports=x;var b=()=>1;function x(D,R,F,A){var B=function(o){return D.outEdges(o)};return I(D,String(R),F||b,A||B)}function I(D,R,F,A){var B={},o=new T,e,d,c=function(m){var P=m.v!==e?m.v:m.w,z=B[P],U=F(m),H=d.distance+U;if(U<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+m+" Weight: "+U);H<z.distance&&(z.distance=H,z.predecessor=e,o.decrease(P,H))};for(D.nodes().forEach(function(m){var P=m===R?0:Number.POSITIVE_INFINITY;B[m]={distance:P},o.add(m,P)});o.size()>0&&(e=o.removeMin(),d=B[e],d.distance!==Number.POSITIVE_INFINITY);)A(e).forEach(c);return B}}),N=_((v,l)=>{var T=u();l.exports=b;function b(x,I,D){return x.nodes().reduce(function(R,F){return R[F]=T(x,F,I,D),R},{})}}),V=_((v,l)=>{l.exports=T;function T(x,I,D){if(x[I].predecessor!==void 0)throw new Error("Invalid source vertex");if(x[D].predecessor===void 0&&D!==I)throw new Error("Invalid destination vertex");return{weight:x[D].distance,path:b(x,I,D)}}function b(x,I,D){for(var R=[],F=D;F!==I;)R.push(F),F=x[F].predecessor;return R.push(I),R.reverse()}}),Y=_((v,l)=>{l.exports=T;function T(b){var x=0,I=[],D={},R=[];function F(A){var B=D[A]={onStack:!0,lowlink:x,index:x++};if(I.push(A),b.successors(A).forEach(function(d){Object.hasOwn(D,d)?D[d].onStack&&(B.lowlink=Math.min(B.lowlink,D[d].index)):(F(d),B.lowlink=Math.min(B.lowlink,D[d].lowlink))}),B.lowlink===B.index){var o=[],e;do e=I.pop(),D[e].onStack=!1,o.push(e);while(A!==e);R.push(o)}}return b.nodes().forEach(function(A){Object.hasOwn(D,A)||F(A)}),R}}),q=_((v,l)=>{var T=Y();l.exports=b;function b(x){return T(x).filter(function(I){return I.length>1||I.length===1&&x.hasEdge(I[0],I[0])})}}),k=_((v,l)=>{l.exports=b;var T=()=>1;function b(I,D,R){return x(I,D||T,R||function(F){return I.outEdges(F)})}function x(I,D,R){var F={},A=I.nodes();return A.forEach(function(B){F[B]={},F[B][B]={distance:0},A.forEach(function(o){B!==o&&(F[B][o]={distance:Number.POSITIVE_INFINITY})}),R(B).forEach(function(o){var e=o.v===B?o.w:o.v,d=D(o);F[B][e]={distance:d,predecessor:B}})}),A.forEach(function(B){var o=F[B];A.forEach(function(e){var d=F[e];A.forEach(function(c){var m=d[B],P=o[c],z=d[c],U=m.distance+P.distance;U<z.distance&&(z.distance=U,z.predecessor=P.predecessor)})})}),F}}),L=_((v,l)=>{function T(x){var I={},D={},R=[];function F(A){if(Object.hasOwn(D,A))throw new b;Object.hasOwn(I,A)||(D[A]=!0,I[A]=!0,x.predecessors(A).forEach(F),delete D[A],R.push(A))}if(x.sinks().forEach(F),Object.keys(I).length!==x.nodeCount())throw new b;return R}var b=class extends Error{constructor(){super(...arguments)}};l.exports=T,T.CycleException=b}),p=_((v,l)=>{var T=L();l.exports=b;function b(x){try{T(x)}catch(I){if(I instanceof T.CycleException)return!1;throw I}return!0}}),j=_((v,l)=>{l.exports=T;function T(x,I,D,R,F){Array.isArray(I)||(I=[I]);var A=(x.isDirected()?x.successors:x.neighbors).bind(x),B={};return I.forEach(function(o){if(!x.hasNode(o))throw new Error("Graph does not have node: "+o);F=b(x,o,D==="post",B,A,R,F)}),F}function b(x,I,D,R,F,A,B){return Object.hasOwn(R,I)||(R[I]=!0,D||(B=A(B,I)),F(I).forEach(function(o){B=b(x,o,D,R,F,A,B)}),D&&(B=A(B,I))),B}}),M=_((v,l)=>{var T=j();l.exports=b;function b(x,I,D){return T(x,I,D,function(R,F){return R.push(F),R},[])}}),G=_((v,l)=>{var T=M();l.exports=b;function b(x,I){return T(x,I,"post")}}),S=_((v,l)=>{var T=M();l.exports=b;function b(x,I){return T(x,I,"pre")}}),$=_((v,l)=>{var T=n(),b=g();l.exports=x;function x(I,D){var R=new T,F={},A=new b,B;function o(d){var c=d.v===B?d.w:d.v,m=A.priority(c);if(m!==void 0){var P=D(d);P<m&&(F[c]=B,A.decrease(c,P))}}if(I.nodeCount()===0)return R;I.nodes().forEach(function(d){A.add(d,Number.POSITIVE_INFINITY),R.setNode(d)}),A.decrease(I.nodes()[0],0);for(var e=!1;A.size()>0;){if(B=A.removeMin(),Object.hasOwn(F,B))R.setEdge(B,F[B]);else{if(e)throw new Error("Input graph is not connected: "+I);e=!0}I.nodeEdges(B).forEach(o)}return R}}),f=_((v,l)=>{var T=u(),b=t();l.exports=x;function x(D,R,F,A){return I(D,R,F,A||function(B){return D.outEdges(B)})}function I(D,R,F,A){if(F===void 0)return T(D,R,F,A);for(var B=!1,o=D.nodes(),e=0;e<o.length;e++){for(var d=A(o[e]),c=0;c<d.length;c++){var m=d[c],P=m.v===o[e]?m.v:m.w,z=P===m.v?m.w:m.v;F({v:P,w:z})<0&&(B=!0)}if(B)return b(D,R,F,A)}return T(D,R,F,A)}}),w=_((v,l)=>{l.exports={bellmanFord:t(),components:i(),dijkstra:u(),dijkstraAll:N(),extractPath:V(),findCycles:q(),floydWarshall:k(),isAcyclic:p(),postorder:G(),preorder:S(),prim:$(),shortestPaths:f(),reduce:j(),tarjan:Y(),topsort:L()}}),O=r();E.exports={Graph:O.Graph,json:s(),alg:w(),version:O.version}}),Ee=K((W,E)=>{var y=class{constructor(){let h={};h._next=h._prev=h,this._sentinel=h}dequeue(){let h=this._sentinel,n=h._prev;if(n!==h)return C(n),n}enqueue(h){let n=this._sentinel;h._prev&&h._next&&C(h),h._next=n._next,n._next._prev=h,n._next=h,h._prev=n}toString(){let h=[],n=this._sentinel,a=n._prev;for(;a!==n;)h.push(JSON.stringify(a,_)),a=a._prev;return"["+h.join(", ")+"]"}};function C(h){h._prev._next=h._next,h._next._prev=h._prev,delete h._next,delete h._prev}function _(h,n){if(h!=="_next"&&h!=="_prev")return n}E.exports=y}),be=K((W,E)=>{var y=Z().Graph,C=Ee();E.exports=h;var _=()=>1;function h(i,g){if(i.nodeCount()<=1)return[];let u=r(i,g||_);return n(u.graph,u.buckets,u.zeroIdx).flatMap(N=>i.outEdges(N.v,N.w))}function n(i,g,u){let N=[],V=g[g.length-1],Y=g[0],q;for(;i.nodeCount();){for(;q=Y.dequeue();)a(i,g,u,q);for(;q=V.dequeue();)a(i,g,u,q);if(i.nodeCount()){for(let k=g.length-2;k>0;--k)if(q=g[k].dequeue(),q){N=N.concat(a(i,g,u,q,!0));break}}}return N}function a(i,g,u,N,V){let Y=V?[]:void 0;return i.inEdges(N.v).forEach(q=>{let k=i.edge(q),L=i.node(q.v);V&&Y.push({v:q.v,w:q.w}),L.out-=k,s(g,u,L)}),i.outEdges(N.v).forEach(q=>{let k=i.edge(q),L=q.w,p=i.node(L);p.in-=k,s(g,u,p)}),i.removeNode(N.v),Y}function r(i,g){let u=new y,N=0,V=0;i.nodes().forEach(k=>{u.setNode(k,{v:k,in:0,out:0})}),i.edges().forEach(k=>{let L=u.edge(k.v,k.w)||0,p=g(k),j=L+p;u.setEdge(k.v,k.w,j),V=Math.max(V,u.node(k.v).out+=p),N=Math.max(N,u.node(k.w).in+=p)});let Y=t(V+N+3).map(()=>new C),q=N+1;return u.nodes().forEach(k=>{s(Y,q,u.node(k))}),{graph:u,buckets:Y,zeroIdx:q}}function s(i,g,u){u.out?u.in?i[u.out-u.in+g].enqueue(u):i[i.length-1].enqueue(u):i[0].enqueue(u)}function t(i){let g=[];for(let u=0;u<i;u++)g.push(u);return g}}),X=K((W,E)=>{var y=Z().Graph;E.exports={addBorderNode:g,addDummyNode:C,applyWithChunking:V,asNonCompoundGraph:h,buildLayerMatrix:s,intersectRect:r,mapValues:S,maxRank:Y,normalizeRanks:t,notime:L,partition:q,pick:G,predecessorWeights:a,range:M,removeEmptyRanks:i,simplify:_,successorWeights:n,time:k,uniqueId:j,zipObject:$};function C(f,w,O,v){for(var l=v;f.hasNode(l);)l=j(v);return O.dummy=w,f.setNode(l,O),l}function _(f){let w=new y().setGraph(f.graph());return f.nodes().forEach(O=>w.setNode(O,f.node(O))),f.edges().forEach(O=>{let v=w.edge(O.v,O.w)||{weight:0,minlen:1},l=f.edge(O);w.setEdge(O.v,O.w,{weight:v.weight+l.weight,minlen:Math.max(v.minlen,l.minlen)})}),w}function h(f){let w=new y({multigraph:f.isMultigraph()}).setGraph(f.graph());return f.nodes().forEach(O=>{f.children(O).length||w.setNode(O,f.node(O))}),f.edges().forEach(O=>{w.setEdge(O,f.edge(O))}),w}function n(f){let w=f.nodes().map(O=>{let v={};return f.outEdges(O).forEach(l=>{v[l.w]=(v[l.w]||0)+f.edge(l).weight}),v});return $(f.nodes(),w)}function a(f){let w=f.nodes().map(O=>{let v={};return f.inEdges(O).forEach(l=>{v[l.v]=(v[l.v]||0)+f.edge(l).weight}),v});return $(f.nodes(),w)}function r(f,w){let O=f.x,v=f.y,l=w.x-O,T=w.y-v,b=f.width/2,x=f.height/2;if(!l&&!T)throw new Error("Not possible to find intersection inside of the rectangle");let I,D;return Math.abs(T)*b>Math.abs(l)*x?(T<0&&(x=-x),I=x*l/T,D=x):(l<0&&(b=-b),I=b,D=b*T/l),{x:O+I,y:v+D}}function s(f){let w=M(Y(f)+1).map(()=>[]);return f.nodes().forEach(O=>{let v=f.node(O),l=v.rank;l!==void 0&&(w[l][v.order]=O)}),w}function t(f){let w=f.nodes().map(v=>{let l=f.node(v).rank;return l===void 0?Number.MAX_VALUE:l}),O=V(Math.min,w);f.nodes().forEach(v=>{let l=f.node(v);Object.hasOwn(l,"rank")&&(l.rank-=O)})}function i(f){let w=f.nodes().map(b=>f.node(b).rank).filter(b=>b!==void 0),O=V(Math.min,w),v=[];f.nodes().forEach(b=>{let x=f.node(b).rank-O;v[x]||(v[x]=[]),v[x].push(b)});let l=0,T=f.graph().nodeRankFactor;Array.from(v).forEach((b,x)=>{b===void 0&&x%T!==0?--l:b!==void 0&&l&&b.forEach(I=>f.node(I).rank+=l)})}function g(f,w,O,v){let l={width:0,height:0};return arguments.length>=4&&(l.rank=O,l.order=v),C(f,"border",l,w)}function u(f,w=N){let O=[];for(let v=0;v<f.length;v+=w){let l=f.slice(v,v+w);O.push(l)}return O}var N=65535;function V(f,w){if(w.length>N){let O=u(w);return f.apply(null,O.map(v=>f.apply(null,v)))}else return f.apply(null,w)}function Y(f){let w=f.nodes().map(O=>{let v=f.node(O).rank;return v===void 0?Number.MIN_VALUE:v});return V(Math.max,w)}function q(f,w){let O={lhs:[],rhs:[]};return f.forEach(v=>{w(v)?O.lhs.push(v):O.rhs.push(v)}),O}function k(f,w){let O=Date.now();try{return w()}finally{console.log(f+" time: "+(Date.now()-O)+"ms")}}function L(f,w){return w()}var p=0;function j(f){var w=++p;return f+(""+w)}function M(f,w,O=1){w==null&&(w=f,f=0);let v=T=>T<w;O<0&&(v=T=>w<T);let l=[];for(let T=f;v(T);T+=O)l.push(T);return l}function G(f,w){let O={};for(let v of w)f[v]!==void 0&&(O[v]=f[v]);return O}function S(f,w){let O=w;return typeof w=="string"&&(O=v=>v[w]),Object.entries(f).reduce((v,[l,T])=>(v[l]=O(T,l),v),{})}function $(f,w){return f.reduce((O,v,l)=>(O[v]=w[l],O),{})}}),ye=K((W,E)=>{var y=be(),C=X().uniqueId;E.exports={run:_,undo:n};function _(a){(a.graph().acyclicer==="greedy"?y(a,r(a)):h(a)).forEach(s=>{let t=a.edge(s);a.removeEdge(s),t.forwardName=s.name,t.reversed=!0,a.setEdge(s.w,s.v,t,C("rev"))});function r(s){return t=>s.edge(t).weight}}function h(a){let r=[],s={},t={};function i(g){Object.hasOwn(t,g)||(t[g]=!0,s[g]=!0,a.outEdges(g).forEach(u=>{Object.hasOwn(s,u.w)?r.push(u):i(u.w)}),delete s[g])}return a.nodes().forEach(i),r}function n(a){a.edges().forEach(r=>{let s=a.edge(r);if(s.reversed){a.removeEdge(r);let t=s.forwardName;delete s.reversed,delete s.forwardName,a.setEdge(r.w,r.v,s,t)}})}}),_e=K((W,E)=>{var y=X();E.exports={run:C,undo:h};function C(n){n.graph().dummyChains=[],n.edges().forEach(a=>_(n,a))}function _(n,a){let r=a.v,s=n.node(r).rank,t=a.w,i=n.node(t).rank,g=a.name,u=n.edge(a),N=u.labelRank;if(i===s+1)return;n.removeEdge(a);let V,Y,q;for(q=0,++s;s<i;++q,++s)u.points=[],Y={width:0,height:0,edgeLabel:u,edgeObj:a,rank:s},V=y.addDummyNode(n,"edge",Y,"_d"),s===N&&(Y.width=u.width,Y.height=u.height,Y.dummy="edge-label",Y.labelpos=u.labelpos),n.setEdge(r,V,{weight:u.weight},g),q===0&&n.graph().dummyChains.push(V),r=V;n.setEdge(r,t,{weight:u.weight},g)}function h(n){n.graph().dummyChains.forEach(a=>{let r=n.node(a),s=r.edgeLabel,t;for(n.setEdge(r.edgeObj,s);r.dummy;)t=n.successors(a)[0],n.removeNode(a),s.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(s.x=r.x,s.y=r.y,s.width=r.width,s.height=r.height),a=t,r=n.node(a)})}}),ne=K((W,E)=>{var{applyWithChunking:y}=X();E.exports={longestPath:C,slack:_};function C(h){var n={};function a(r){var s=h.node(r);if(Object.hasOwn(n,r))return s.rank;n[r]=!0;let t=h.outEdges(r).map(g=>g==null?Number.POSITIVE_INFINITY:a(g.w)-h.edge(g).minlen);var i=y(Math.min,t);return i===Number.POSITIVE_INFINITY&&(i=0),s.rank=i}h.sources().forEach(a)}function _(h,n){return h.node(n.w).rank-h.node(n.v).rank-h.edge(n).minlen}}),he=K((W,E)=>{var y=Z().Graph,C=ne().slack;E.exports=_;function _(r){var s=new y({directed:!1}),t=r.nodes()[0],i=r.nodeCount();s.setNode(t,{});for(var g,u;h(s,r)<i;)g=n(s,r),u=s.hasNode(g.v)?C(r,g):-C(r,g),a(s,r,u);return s}function h(r,s){function t(i){s.nodeEdges(i).forEach(g=>{var u=g.v,N=i===u?g.w:u;!r.hasNode(N)&&!C(s,g)&&(r.setNode(N,{}),r.setEdge(i,N,{}),t(N))})}return r.nodes().forEach(t),r.nodeCount()}function n(r,s){return s.edges().reduce((t,i)=>{let g=Number.POSITIVE_INFINITY;return r.hasNode(i.v)!==r.hasNode(i.w)&&(g=C(s,i)),g<t[0]?[g,i]:t},[Number.POSITIVE_INFINITY,null])[1]}function a(r,s,t){r.nodes().forEach(i=>s.node(i).rank+=t)}}),ke=K((W,E)=>{var y=he(),C=ne().slack,_=ne().longestPath,h=Z().alg.preorder,n=Z().alg.postorder,a=X().simplify;E.exports=r,r.initLowLimValues=g,r.initCutValues=s,r.calcCutValue=i,r.leaveEdge=N,r.enterEdge=V,r.exchangeEdges=Y;function r(p){p=a(p),_(p);var j=y(p);g(j),s(j,p);for(var M,G;M=N(j);)G=V(j,p,M),Y(j,p,M,G)}function s(p,j){var M=n(p,p.nodes());M=M.slice(0,M.length-1),M.forEach(G=>t(p,j,G))}function t(p,j,M){var G=p.node(M),S=G.parent;p.edge(M,S).cutvalue=i(p,j,M)}function i(p,j,M){var G=p.node(M),S=G.parent,$=!0,f=j.edge(M,S),w=0;return f||($=!1,f=j.edge(S,M)),w=f.weight,j.nodeEdges(M).forEach(O=>{var v=O.v===M,l=v?O.w:O.v;if(l!==S){var T=v===$,b=j.edge(O).weight;if(w+=T?b:-b,k(p,M,l)){var x=p.edge(M,l).cutvalue;w+=T?-x:x}}}),w}function g(p,j){arguments.length<2&&(j=p.nodes()[0]),u(p,{},1,j)}function u(p,j,M,G,S){var $=M,f=p.node(G);return j[G]=!0,p.neighbors(G).forEach(w=>{Object.hasOwn(j,w)||(M=u(p,j,M,w,G))}),f.low=$,f.lim=M++,S?f.parent=S:delete f.parent,M}function N(p){return p.edges().find(j=>p.edge(j).cutvalue<0)}function V(p,j,M){var G=M.v,S=M.w;j.hasEdge(G,S)||(G=M.w,S=M.v);var $=p.node(G),f=p.node(S),w=$,O=!1;$.lim>f.lim&&(w=f,O=!0);var v=j.edges().filter(l=>O===L(p,p.node(l.v),w)&&O!==L(p,p.node(l.w),w));return v.reduce((l,T)=>C(j,T)<C(j,l)?T:l)}function Y(p,j,M,G){var S=M.v,$=M.w;p.removeEdge(S,$),p.setEdge(G.v,G.w,{}),g(p),s(p,j),q(p,j)}function q(p,j){var M=p.nodes().find(S=>!j.node(S).parent),G=h(p,M);G=G.slice(1),G.forEach(S=>{var $=p.node(S).parent,f=j.edge(S,$),w=!1;f||(f=j.edge($,S),w=!0),j.node(S).rank=j.node($).rank+(w?f.minlen:-f.minlen)})}function k(p,j,M){return p.hasEdge(j,M)}function L(p,j,M){return M.low<=j.lim&&j.lim<=M.lim}}),xe=K((W,E)=>{var y=ne(),C=y.longestPath,_=he(),h=ke();E.exports=n;function n(t){var i=t.graph().ranker;if(i instanceof Function)return i(t);switch(t.graph().ranker){case"network-simplex":s(t);break;case"tight-tree":r(t);break;case"longest-path":a(t);break;case"none":break;default:s(t)}}var a=C;function r(t){C(t),_(t)}function s(t){h(t)}}),Oe=K((W,E)=>{E.exports=y;function y(h){let n=_(h);h.graph().dummyChains.forEach(a=>{let r=h.node(a),s=r.edgeObj,t=C(h,n,s.v,s.w),i=t.path,g=t.lca,u=0,N=i[u],V=!0;for(;a!==s.w;){if(r=h.node(a),V){for(;(N=i[u])!==g&&h.node(N).maxRank<r.rank;)u++;N===g&&(V=!1)}if(!V){for(;u<i.length-1&&h.node(N=i[u+1]).minRank<=r.rank;)u++;N=i[u]}h.setParent(a,N),a=h.successors(a)[0]}})}function C(h,n,a,r){let s=[],t=[],i=Math.min(n[a].low,n[r].low),g=Math.max(n[a].lim,n[r].lim),u,N;u=a;do u=h.parent(u),s.push(u);while(u&&(n[u].low>i||g>n[u].lim));for(N=u,u=r;(u=h.parent(u))!==N;)t.push(u);return{path:s.concat(t.reverse()),lca:N}}function _(h){let n={},a=0;function r(s){let t=a;h.children(s).forEach(r),n[s]={low:t,lim:a++}}return h.children().forEach(r),n}}),Ne=K((W,E)=>{var y=X();E.exports={run:C,cleanup:a};function C(r){let s=y.addDummyNode(r,"root",{},"_root"),t=h(r),i=Object.values(t),g=y.applyWithChunking(Math.max,i)-1,u=2*g+1;r.graph().nestingRoot=s,r.edges().forEach(V=>r.edge(V).minlen*=u);let N=n(r)+1;r.children().forEach(V=>_(r,s,u,N,g,t,V)),r.graph().nodeRankFactor=u}function _(r,s,t,i,g,u,N){let V=r.children(N);if(!V.length){N!==s&&r.setEdge(s,N,{weight:0,minlen:t});return}let Y=y.addBorderNode(r,"_bt"),q=y.addBorderNode(r,"_bb"),k=r.node(N);r.setParent(Y,N),k.borderTop=Y,r.setParent(q,N),k.borderBottom=q,V.forEach(L=>{_(r,s,t,i,g,u,L);let p=r.node(L),j=p.borderTop?p.borderTop:L,M=p.borderBottom?p.borderBottom:L,G=p.borderTop?i:2*i,S=j!==M?1:g-u[N]+1;r.setEdge(Y,j,{weight:G,minlen:S,nestingEdge:!0}),r.setEdge(M,q,{weight:G,minlen:S,nestingEdge:!0})}),r.parent(N)||r.setEdge(s,Y,{weight:0,minlen:g+u[N]})}function h(r){var s={};function t(i,g){var u=r.children(i);u&&u.length&&u.forEach(N=>t(N,g+1)),s[i]=g}return r.children().forEach(i=>t(i,1)),s}function n(r){return r.edges().reduce((s,t)=>s+r.edge(t).weight,0)}function a(r){var s=r.graph();r.removeNode(s.nestingRoot),delete s.nestingRoot,r.edges().forEach(t=>{var i=r.edge(t);i.nestingEdge&&r.removeEdge(t)})}}),Ie=K((W,E)=>{var y=X();E.exports=C;function C(h){function n(a){let r=h.children(a),s=h.node(a);if(r.length&&r.forEach(n),Object.hasOwn(s,"minRank")){s.borderLeft=[],s.borderRight=[];for(let t=s.minRank,i=s.maxRank+1;t<i;++t)_(h,"borderLeft","_bl",a,s,t),_(h,"borderRight","_br",a,s,t)}}h.children().forEach(n)}function _(h,n,a,r,s,t){let i={width:0,height:0,rank:t,borderType:n},g=s[n][t-1],u=y.addDummyNode(h,"border",i,a);s[n][t]=u,h.setParent(u,r),g&&h.setEdge(g,u,{weight:1})}}),je=K((W,E)=>{E.exports={adjust:y,undo:C};function y(t){let i=t.graph().rankdir.toLowerCase();(i==="lr"||i==="rl")&&_(t)}function C(t){let i=t.graph().rankdir.toLowerCase();(i==="bt"||i==="rl")&&n(t),(i==="lr"||i==="rl")&&(r(t),_(t))}function _(t){t.nodes().forEach(i=>h(t.node(i))),t.edges().forEach(i=>h(t.edge(i)))}function h(t){let i=t.width;t.width=t.height,t.height=i}function n(t){t.nodes().forEach(i=>a(t.node(i))),t.edges().forEach(i=>{let g=t.edge(i);g.points.forEach(a),Object.hasOwn(g,"y")&&a(g)})}function a(t){t.y=-t.y}function r(t){t.nodes().forEach(i=>s(t.node(i))),t.edges().forEach(i=>{let g=t.edge(i);g.points.forEach(s),Object.hasOwn(g,"x")&&s(g)})}function s(t){let i=t.x;t.x=t.y,t.y=i}}),Le=K((W,E)=>{var y=X();E.exports=C;function C(_){let h={},n=_.nodes().filter(i=>!_.children(i).length),a=n.map(i=>_.node(i).rank),r=y.applyWithChunking(Math.max,a),s=y.range(r+1).map(()=>[]);function t(i){if(h[i])return;h[i]=!0;let g=_.node(i);s[g.rank].push(i),_.successors(i).forEach(t)}return n.sort((i,g)=>_.node(i).rank-_.node(g).rank).forEach(t),s}}),Ce=K((W,E)=>{var y=X().zipObject;E.exports=C;function C(h,n){let a=0;for(let r=1;r<n.length;++r)a+=_(h,n[r-1],n[r]);return a}function _(h,n,a){let r=y(a,a.map((N,V)=>V)),s=n.flatMap(N=>h.outEdges(N).map(V=>({pos:r[V.w],weight:h.edge(V).weight})).sort((V,Y)=>V.pos-Y.pos)),t=1;for(;t<a.length;)t<<=1;let i=2*t-1;t-=1;let g=new Array(i).fill(0),u=0;return s.forEach(N=>{let V=N.pos+t;g[V]+=N.weight;let Y=0;for(;V>0;)V%2&&(Y+=g[V+1]),V=V-1>>1,g[V]+=N.weight;u+=N.weight*Y}),u}}),Me=K((W,E)=>{E.exports=y;function y(C,_=[]){return _.map(h=>{let n=C.inEdges(h);if(n.length){let a=n.reduce((r,s)=>{let t=C.edge(s),i=C.node(s.v);return{sum:r.sum+t.weight*i.order,weight:r.weight+t.weight}},{sum:0,weight:0});return{v:h,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:h}})}}),Te=K((W,E)=>{var y=X();E.exports=C;function C(n,a){let r={};n.forEach((t,i)=>{let g=r[t.v]={indegree:0,in:[],out:[],vs:[t.v],i};t.barycenter!==void 0&&(g.barycenter=t.barycenter,g.weight=t.weight)}),a.edges().forEach(t=>{let i=r[t.v],g=r[t.w];i!==void 0&&g!==void 0&&(g.indegree++,i.out.push(r[t.w]))});let s=Object.values(r).filter(t=>!t.indegree);return _(s)}function _(n){let a=[];function r(t){return i=>{i.merged||(i.barycenter===void 0||t.barycenter===void 0||i.barycenter>=t.barycenter)&&h(t,i)}}function s(t){return i=>{i.in.push(t),--i.indegree===0&&n.push(i)}}for(;n.length;){let t=n.pop();a.push(t),t.in.reverse().forEach(r(t)),t.out.forEach(s(t))}return a.filter(t=>!t.merged).map(t=>y.pick(t,["vs","i","barycenter","weight"]))}function h(n,a){let r=0,s=0;n.weight&&(r+=n.barycenter*n.weight,s+=n.weight),a.weight&&(r+=a.barycenter*a.weight,s+=a.weight),n.vs=a.vs.concat(n.vs),n.barycenter=r/s,n.weight=s,n.i=Math.min(a.i,n.i),a.merged=!0}}),Pe=K((W,E)=>{var y=X();E.exports=C;function C(n,a){let r=y.partition(n,Y=>Object.hasOwn(Y,"barycenter")),s=r.lhs,t=r.rhs.sort((Y,q)=>q.i-Y.i),i=[],g=0,u=0,N=0;s.sort(h(!!a)),N=_(i,t,N),s.forEach(Y=>{N+=Y.vs.length,i.push(Y.vs),g+=Y.barycenter*Y.weight,u+=Y.weight,N=_(i,t,N)});let V={vs:i.flat(!0)};return u&&(V.barycenter=g/u,V.weight=u),V}function _(n,a,r){let s;for(;a.length&&(s=a[a.length-1]).i<=r;)a.pop(),n.push(s.vs),r++;return r}function h(n){return(a,r)=>a.barycenter<r.barycenter?-1:a.barycenter>r.barycenter?1:n?r.i-a.i:a.i-r.i}}),Re=K((W,E)=>{var y=Me(),C=Te(),_=Pe();E.exports=h;function h(r,s,t,i){let g=r.children(s),u=r.node(s),N=u?u.borderLeft:void 0,V=u?u.borderRight:void 0,Y={};N&&(g=g.filter(p=>p!==N&&p!==V));let q=y(r,g);q.forEach(p=>{if(r.children(p.v).length){let j=h(r,p.v,t,i);Y[p.v]=j,Object.hasOwn(j,"barycenter")&&a(p,j)}});let k=C(q,t);n(k,Y);let L=_(k,i);if(N&&(L.vs=[N,L.vs,V].flat(!0),r.predecessors(N).length)){let p=r.node(r.predecessors(N)[0]),j=r.node(r.predecessors(V)[0]);Object.hasOwn(L,"barycenter")||(L.barycenter=0,L.weight=0),L.barycenter=(L.barycenter*L.weight+p.order+j.order)/(L.weight+2),L.weight+=2}return L}function n(r,s){r.forEach(t=>{t.vs=t.vs.flatMap(i=>s[i]?s[i].vs:i)})}function a(r,s){r.barycenter!==void 0?(r.barycenter=(r.barycenter*r.weight+s.barycenter*s.weight)/(r.weight+s.weight),r.weight+=s.weight):(r.barycenter=s.barycenter,r.weight=s.weight)}}),Fe=K((W,E)=>{var y=Z().Graph,C=X();E.exports=_;function _(n,a,r,s){s||(s=n.nodes());let t=h(n),i=new y({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(g=>n.node(g));return s.forEach(g=>{let u=n.node(g),N=n.parent(g);(u.rank===a||u.minRank<=a&&a<=u.maxRank)&&(i.setNode(g),i.setParent(g,N||t),n[r](g).forEach(V=>{let Y=V.v===g?V.w:V.v,q=i.edge(Y,g),k=q!==void 0?q.weight:0;i.setEdge(Y,g,{weight:n.edge(V).weight+k})}),Object.hasOwn(u,"minRank")&&i.setNode(g,{borderLeft:u.borderLeft[a],borderRight:u.borderRight[a]}))}),i}function h(n){for(var a;n.hasNode(a=C.uniqueId("_root")););return a}}),De=K((W,E)=>{E.exports=y;function y(C,_,h){let n={},a;h.forEach(r=>{let s=C.parent(r),t,i;for(;s;){if(t=C.parent(s),t?(i=n[t],n[t]=s):(i=a,a=s),i&&i!==s){_.setEdge(i,s);return}s=t}})}}),Se=K((W,E)=>{var y=Le(),C=Ce(),_=Re(),h=Fe(),n=De(),a=Z().Graph,r=X();E.exports=s;function s(u,N={}){if(typeof N.customOrder=="function"){N.customOrder(u,s);return}let V=r.maxRank(u),Y=t(u,r.range(1,V+1),"inEdges"),q=t(u,r.range(V-1,-1,-1),"outEdges"),k=y(u);if(g(u,k),N.disableOptimalOrderHeuristic)return;let L=Number.POSITIVE_INFINITY,p,j=N.constraints||[];for(let M=0,G=0;G<4;++M,++G){i(M%2?Y:q,M%4>=2,j),k=r.buildLayerMatrix(u);let S=C(u,k);S<L?(G=0,p=Object.assign({},k),L=S):S===L&&(p=structuredClone(k))}g(u,p)}function t(u,N,V){let Y=new Map,q=(k,L)=>{Y.has(k)||Y.set(k,[]),Y.get(k).push(L)};for(let k of u.nodes()){let L=u.node(k);if(typeof L.rank=="number"&&q(L.rank,k),typeof L.minRank=="number"&&typeof L.maxRank=="number")for(let p=L.minRank;p<=L.maxRank;p++)p!==L.rank&&q(p,k)}return N.map(function(k){return h(u,k,V,Y.get(k)||[])})}function i(u,N,V){let Y=new a;u.forEach(function(q){V.forEach(p=>Y.setEdge(p.left,p.right));let k=q.graph().root,L=_(q,k,Y,N);L.vs.forEach((p,j)=>q.node(p).order=j),n(q,Y,L.vs)})}function g(u,N){Object.values(N).forEach(V=>V.forEach((Y,q)=>u.node(Y).order=q))}}),Ge=K((W,E)=>{var y=Z().Graph,C=X();E.exports={positionX:V,findType1Conflicts:_,findType2Conflicts:h,addConflict:a,hasConflict:r,verticalAlignment:s,horizontalCompaction:t,alignCoordinates:u,findSmallestWidthAlignment:g,balance:N};function _(k,L){let p={};function j(M,G){let S=0,$=0,f=M.length,w=G[G.length-1];return G.forEach((O,v)=>{let l=n(k,O),T=l?k.node(l).order:f;(l||O===w)&&(G.slice($,v+1).forEach(b=>{k.predecessors(b).forEach(x=>{let I=k.node(x),D=I.order;(D<S||T<D)&&!(I.dummy&&k.node(b).dummy)&&a(p,x,b)})}),$=v+1,S=T)}),G}return L.length&&L.reduce(j),p}function h(k,L){let p={};function j(G,S,$,f,w){let O;C.range(S,$).forEach(v=>{O=G[v],k.node(O).dummy&&k.predecessors(O).forEach(l=>{let T=k.node(l);T.dummy&&(T.order<f||T.order>w)&&a(p,l,O)})})}function M(G,S){let $=-1,f,w=0;return S.forEach((O,v)=>{if(k.node(O).dummy==="border"){let l=k.predecessors(O);l.length&&(f=k.node(l[0]).order,j(S,w,v,$,f),w=v,$=f)}j(S,w,S.length,f,G.length)}),S}return L.length&&L.reduce(M),p}function n(k,L){if(k.node(L).dummy)return k.predecessors(L).find(p=>k.node(p).dummy)}function a(k,L,p){if(L>p){let M=L;L=p,p=M}let j=k[L];j||(k[L]=j={}),j[p]=!0}function r(k,L,p){if(L>p){let j=L;L=p,p=j}return!!k[L]&&Object.hasOwn(k[L],p)}function s(k,L,p,j){let M={},G={},S={};return L.forEach($=>{$.forEach((f,w)=>{M[f]=f,G[f]=f,S[f]=w})}),L.forEach($=>{let f=-1;$.forEach(w=>{let O=j(w);if(O.length){O=O.sort((l,T)=>S[l]-S[T]);let v=(O.length-1)/2;for(let l=Math.floor(v),T=Math.ceil(v);l<=T;++l){let b=O[l];G[w]===w&&f<S[b]&&!r(p,w,b)&&(G[b]=w,G[w]=M[w]=M[b],f=S[b])}}})}),{root:M,align:G}}function t(k,L,p,j,M){let G={},S=i(k,L,p,M),$=M?"borderLeft":"borderRight";function f(v,l){let T=S.nodes().slice(),b={},x=T.pop();for(;x;){if(b[x])v(x);else{b[x]=!0,T.push(x);for(let I of l(x))T.push(I)}x=T.pop()}}function w(v){G[v]=S.inEdges(v).reduce((l,T)=>Math.max(l,G[T.v]+S.edge(T)),0)}function O(v){let l=S.outEdges(v).reduce((b,x)=>Math.min(b,G[x.w]-S.edge(x)),Number.POSITIVE_INFINITY),T=k.node(v);l!==Number.POSITIVE_INFINITY&&T.borderType!==$&&(G[v]=Math.max(G[v],l))}return f(w,S.predecessors.bind(S)),f(O,S.successors.bind(S)),Object.keys(j).forEach(v=>G[v]=G[p[v]]),G}function i(k,L,p,j){let M=new y,G=k.graph(),S=Y(G.nodesep,G.edgesep,j);return L.forEach($=>{let f;$.forEach(w=>{let O=p[w];if(M.setNode(O),f){var v=p[f],l=M.edge(v,O);M.setEdge(v,O,Math.max(S(k,w,f),l||0))}f=w})}),M}function g(k,L){return Object.values(L).reduce((p,j)=>{let M=Number.NEGATIVE_INFINITY,G=Number.POSITIVE_INFINITY;Object.entries(j).forEach(([$,f])=>{let w=q(k,$)/2;M=Math.max(f+w,M),G=Math.min(f-w,G)});let S=M-G;return S<p[0]&&(p=[S,j]),p},[Number.POSITIVE_INFINITY,null])[1]}function u(k,L){let p=Object.values(L),j=C.applyWithChunking(Math.min,p),M=C.applyWithChunking(Math.max,p);["u","d"].forEach(G=>{["l","r"].forEach(S=>{let $=G+S,f=k[$];if(f===L)return;let w=Object.values(f),O=j-C.applyWithChunking(Math.min,w);S!=="l"&&(O=M-C.applyWithChunking(Math.max,w)),O&&(k[$]=C.mapValues(f,v=>v+O))})})}function N(k,L){return C.mapValues(k.ul,(p,j)=>{if(L)return k[L.toLowerCase()][j];{let M=Object.values(k).map(G=>G[j]).sort((G,S)=>G-S);return(M[1]+M[2])/2}})}function V(k){let L=C.buildLayerMatrix(k),p=Object.assign(_(k,L),h(k,L)),j={},M;["u","d"].forEach(S=>{M=S==="u"?L:Object.values(L).reverse(),["l","r"].forEach($=>{$==="r"&&(M=M.map(v=>Object.values(v).reverse()));let f=(S==="u"?k.predecessors:k.successors).bind(k),w=s(k,M,p,f),O=t(k,M,w.root,w.align,$==="r");$==="r"&&(O=C.mapValues(O,v=>-v)),j[S+$]=O})});let G=g(k,j);return u(j,G),N(j,k.graph().align)}function Y(k,L,p){return(j,M,G)=>{let S=j.node(M),$=j.node(G),f=0,w;if(f+=S.width/2,Object.hasOwn(S,"labelpos"))switch(S.labelpos.toLowerCase()){case"l":w=-S.width/2;break;case"r":w=S.width/2;break}if(w&&(f+=p?w:-w),w=0,f+=(S.dummy?L:k)/2,f+=($.dummy?L:k)/2,f+=$.width/2,Object.hasOwn($,"labelpos"))switch($.labelpos.toLowerCase()){case"l":w=$.width/2;break;case"r":w=-$.width/2;break}return w&&(f+=p?w:-w),w=0,f}}function q(k,L){return k.node(L).width}}),Ve=K((W,E)=>{var y=X(),C=Ge().positionX;E.exports=_;function _(n){n=y.asNonCompoundGraph(n),h(n),Object.entries(C(n)).forEach(([a,r])=>n.node(a).x=r)}function h(n){let a=y.buildLayerMatrix(n),r=n.graph().ranksep,s=n.graph().rankalign,t=0;a.forEach(i=>{let g=i.reduce((u,N)=>{let V=n.node(N).height;return u>V?u:V},0);i.forEach(u=>{let N=n.node(u);s==="top"?N.y=t+N.height/2:s==="bottom"?N.y=t+g-N.height/2:N.y=t+g/2}),t+=g+r})}}),Ae=K((W,E)=>{var y=ye(),C=_e(),_=xe(),h=X().normalizeRanks,n=Oe(),a=X().removeEmptyRanks,r=Ne(),s=Ie(),t=je(),i=Se(),g=Ve(),u=X(),N=Z().Graph;E.exports=V;function V(e,d={}){let c=d.debugTiming?u.time:u.notime;return c("layout",()=>{let m=c(" buildLayoutGraph",()=>f(e));return c(" runLayout",()=>Y(m,c,d)),c(" updateInputGraph",()=>q(e,m)),m})}function Y(e,d,c){d(" makeSpaceForEdgeLabels",()=>w(e)),d(" removeSelfEdges",()=>R(e)),d(" acyclic",()=>y.run(e)),d(" nestingGraph.run",()=>r.run(e)),d(" rank",()=>_(u.asNonCompoundGraph(e))),d(" injectEdgeLabelProxies",()=>O(e)),d(" removeEmptyRanks",()=>a(e)),d(" nestingGraph.cleanup",()=>r.cleanup(e)),d(" normalizeRanks",()=>h(e)),d(" assignRankMinMax",()=>v(e)),d(" removeEdgeLabelProxies",()=>l(e)),d(" normalize.run",()=>C.run(e)),d(" parentDummyChains",()=>n(e)),d(" addBorderSegments",()=>s(e)),d(" order",()=>i(e,c)),d(" insertSelfEdges",()=>F(e)),d(" adjustCoordinateSystem",()=>t.adjust(e)),d(" position",()=>g(e)),d(" positionSelfEdges",()=>A(e)),d(" removeBorderNodes",()=>D(e)),d(" normalize.undo",()=>C.undo(e)),d(" fixupEdgeLabelCoords",()=>x(e)),d(" undoCoordinateSystem",()=>t.undo(e)),d(" translateGraph",()=>T(e)),d(" assignNodeIntersects",()=>b(e)),d(" reversePoints",()=>I(e)),d(" acyclic.undo",()=>y.undo(e))}function q(e,d){e.nodes().forEach(c=>{let m=e.node(c),P=d.node(c);m&&(m.x=P.x,m.y=P.y,m.order=P.order,m.rank=P.rank,d.children(c).length&&(m.width=P.width,m.height=P.height))}),e.edges().forEach(c=>{let m=e.edge(c),P=d.edge(c);m.points=P.points,Object.hasOwn(P,"x")&&(m.x=P.x,m.y=P.y)}),e.graph().width=d.graph().width,e.graph().height=d.graph().height}var k=["nodesep","edgesep","ranksep","marginx","marginy"],L={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},p=["acyclicer","ranker","rankdir","align","rankalign"],j=["width","height","rank"],M={width:0,height:0},G=["minlen","weight","width","height","labeloffset"],S={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},$=["labelpos"];function f(e){let d=new N({multigraph:!0,compound:!0}),c=o(e.graph());return d.setGraph(Object.assign({},L,B(c,k),u.pick(c,p))),e.nodes().forEach(m=>{let P=o(e.node(m)),z=B(P,j);Object.keys(M).forEach(U=>{z[U]===void 0&&(z[U]=M[U])}),d.setNode(m,z),d.setParent(m,e.parent(m))}),e.edges().forEach(m=>{let P=o(e.edge(m));d.setEdge(m,Object.assign({},S,B(P,G),u.pick(P,$)))}),d}function w(e){let d=e.graph();d.ranksep/=2,e.edges().forEach(c=>{let m=e.edge(c);m.minlen*=2,m.labelpos.toLowerCase()!=="c"&&(d.rankdir==="TB"||d.rankdir==="BT"?m.width+=m.labeloffset:m.height+=m.labeloffset)})}function O(e){e.edges().forEach(d=>{let c=e.edge(d);if(c.width&&c.height){let m=e.node(d.v),P={rank:(e.node(d.w).rank-m.rank)/2+m.rank,e:d};u.addDummyNode(e,"edge-proxy",P,"_ep")}})}function v(e){let d=0;e.nodes().forEach(c=>{let m=e.node(c);m.borderTop&&(m.minRank=e.node(m.borderTop).rank,m.maxRank=e.node(m.borderBottom).rank,d=Math.max(d,m.maxRank))}),e.graph().maxRank=d}function l(e){e.nodes().forEach(d=>{let c=e.node(d);c.dummy==="edge-proxy"&&(e.edge(c.e).labelRank=c.rank,e.removeNode(d))})}function T(e){let d=Number.POSITIVE_INFINITY,c=0,m=Number.POSITIVE_INFINITY,P=0,z=e.graph(),U=z.marginx||0,H=z.marginy||0;function te(J){let Q=J.x,re=J.y,se=J.width,ae=J.height;d=Math.min(d,Q-se/2),c=Math.max(c,Q+se/2),m=Math.min(m,re-ae/2),P=Math.max(P,re+ae/2)}e.nodes().forEach(J=>te(e.node(J))),e.edges().forEach(J=>{let Q=e.edge(J);Object.hasOwn(Q,"x")&&te(Q)}),d-=U,m-=H,e.nodes().forEach(J=>{let Q=e.node(J);Q.x-=d,Q.y-=m}),e.edges().forEach(J=>{let Q=e.edge(J);Q.points.forEach(re=>{re.x-=d,re.y-=m}),Object.hasOwn(Q,"x")&&(Q.x-=d),Object.hasOwn(Q,"y")&&(Q.y-=m)}),z.width=c-d+U,z.height=P-m+H}function b(e){e.edges().forEach(d=>{let c=e.edge(d),m=e.node(d.v),P=e.node(d.w),z,U;c.points?(z=c.points[0],U=c.points[c.points.length-1]):(c.points=[],z=P,U=m),c.points.unshift(u.intersectRect(m,z)),c.points.push(u.intersectRect(P,U))})}function x(e){e.edges().forEach(d=>{let c=e.edge(d);if(Object.hasOwn(c,"x"))switch((c.labelpos==="l"||c.labelpos==="r")&&(c.width-=c.labeloffset),c.labelpos){case"l":c.x-=c.width/2+c.labeloffset;break;case"r":c.x+=c.width/2+c.labeloffset;break}})}function I(e){e.edges().forEach(d=>{let c=e.edge(d);c.reversed&&c.points.reverse()})}function D(e){e.nodes().forEach(d=>{if(e.children(d).length){let c=e.node(d),m=e.node(c.borderTop),P=e.node(c.borderBottom),z=e.node(c.borderLeft[c.borderLeft.length-1]),U=e.node(c.borderRight[c.borderRight.length-1]);c.width=Math.abs(U.x-z.x),c.height=Math.abs(P.y-m.y),c.x=z.x+c.width/2,c.y=m.y+c.height/2}}),e.nodes().forEach(d=>{e.node(d).dummy==="border"&&e.removeNode(d)})}function R(e){e.edges().forEach(d=>{if(d.v===d.w){var c=e.node(d.v);c.selfEdges||(c.selfEdges=[]),c.selfEdges.push({e:d,label:e.edge(d)}),e.removeEdge(d)}})}function F(e){var d=u.buildLayerMatrix(e);d.forEach(c=>{var m=0;c.forEach((P,z)=>{var U=e.node(P);U.order=z+m,(U.selfEdges||[]).forEach(H=>{u.addDummyNode(e,"selfedge",{width:H.label.width,height:H.label.height,rank:U.rank,order:z+ ++m,e:H.e,label:H.label},"_se")}),delete U.selfEdges})})}function A(e){e.nodes().forEach(d=>{var c=e.node(d);if(c.dummy==="selfedge"){var m=e.node(c.e.v),P=m.x+m.width/2,z=m.y,U=c.x-P,H=m.height/2;e.setEdge(c.e,c.label),e.removeNode(d),c.label.points=[{x:P+2*U/3,y:z-H},{x:P+5*U/6,y:z-H},{x:P+U,y:z},{x:P+5*U/6,y:z+H},{x:P+2*U/3,y:z+H}],c.label.x=c.x,c.label.y=c.y}})}function B(e,d){return u.mapValues(u.pick(e,d),Number)}function o(e){var d={};return e&&Object.entries(e).forEach(([c,m])=>{typeof c=="string"&&(c=c.toLowerCase()),d[c]=m}),d}}),Be=K((W,E)=>{var y=X(),C=Z().Graph;E.exports={debugOrdering:_};function _(h){let n=y.buildLayerMatrix(h),a=new C({compound:!0,multigraph:!0}).setGraph({});return h.nodes().forEach(r=>{a.setNode(r,{label:r}),a.setParent(r,"layer"+h.node(r).rank)}),h.edges().forEach(r=>a.setEdge(r.v,r.w,{},r.name)),n.forEach((r,s)=>{let t="layer"+s;a.setNode(t,{rank:"same"}),r.reduce((i,g)=>(a.setEdge(i,g,{style:"invis"}),g))}),a}}),ze=K((W,E)=>{E.exports="2.0.4"}),Ye=K((W,E)=>{E.exports={graphlib:Z(),layout:Ae(),debug:Be(),util:{time:X().time,notime:X().notime},version:ze()}});const ie=Ye();/*! For license information please see dagre.esm.js.LEGAL.txt */const We=W=>(W.children??[]).some(E=>{var y,C;return(((y=E.children)==null?void 0:y.length)??0)>0||(((C=E.ports)==null?void 0:C.length)??0)>0}),qe=W=>{switch(W){case"UP":return"BT";case"RIGHT":return"LR";case"LEFT":return"RL";default:return"TB"}};class $e{constructor(){ee(this,"descriptor",{id:"memo.layout.dagre",name:"Dagre",version:ie.version,contractVersion:"1",license:"MIT",description:"Fast directed layout for flat graphs and trees.",mode:"automatic",capabilities:["flat-graph","deterministic"]})}supports(E){const y=!We(E);return{supported:y,...y?{}:{reason:"compound nodes and explicit ports require a different provider"}}}async layout(E){const y=ue(E),C=E.layoutOptions??{},_=new ie.graphlib.Graph({multigraph:!0}).setGraph({rankdir:qe(C["elk.direction"]),nodesep:Number(C["elk.spacing.nodeNode"]??40),ranksep:Number(C["elk.layered.spacing.nodeNodeBetweenLayers"]??80),marginx:20,marginy:20}).setDefaultEdgeLabel(()=>({}));for(const n of y.children??[])_.setNode(n.id,{width:n.width??1,height:n.height??1});for(const n of y.edges??[]){const a=n.sources[0],r=n.targets[0];a&&r&&_.hasNode(a)&&_.hasNode(r)&&_.setEdge(a,r,{},n.id)}ie.layout(_);for(const n of y.children??[]){const a=_.node(n.id);a&&(n.x=a.x-(n.width??1)/2,n.y=a.y-(n.height??1)/2)}for(const n of y.edges??[]){const a=n.sources[0],r=n.targets[0];if(!a||!r||!_.hasEdge(a,r,n.id))continue;const s=_.edge(a,r,n.id),t=(s==null?void 0:s.points)??[];t.length>=2&&(n.sections=[{id:`${n.id}-section`,startPoint:t[0],endPoint:t[t.length-1],bendPoints:t.slice(1,-1)}])}const h=_.graph();return y.width=h.width,y.height=h.height,y}}var Ue=pe();const de=ge(Ue),Ke=5e3;class Xe{constructor(){ee(this,"descriptor",{id:"memo.layout.elk",name:"ELK",version:"0.9.3",contractVersion:"1",license:"EPL-2.0",description:"Layered and hierarchical engineering layouts with ports and orthogonal routes.",mode:"automatic",capabilities:["flat-graph","compound-graph","explicit-ports","orthogonal-routes","fixed-nodes","deterministic","cancellable","worker-runtime"]});ee(this,"instance");ee(this,"chain",Promise.resolve())}supports(){return{supported:!0}}layout(E,y={}){const C=()=>this.runBounded(E,y),_=this.chain.then(C,C);return this.chain=_.then(()=>{},()=>{}),_}dispose(){this.reset()}getInstance(){return this.instance||(this.instance=typeof Worker>"u"?new de:new de({workerFactory:E=>new Worker(new URL("/assets/elk-worker.min-BgEwn2y-.js",import.meta.url))})),this.instance}reset(){var E,y;try{(y=(E=this.instance)==null?void 0:E.terminateWorker)==null||y.call(E)}catch{}this.instance=void 0}runBounded(E,y){return new Promise((C,_)=>{var t,i;let h=!1;const n=g=>{var u;h||(h=!0,clearTimeout(s),(u=y.signal)==null||u.removeEventListener("abort",a),g())},a=()=>n(()=>{var g;this.reset(),_(((g=y.signal)==null?void 0:g.reason)??new DOMException("Layout aborted","AbortError"))}),r=y.timeoutMs??Ke,s=setTimeout(()=>n(()=>{this.reset(),_(new Error(`ELK layout timed out after ${r/1e3}s`))}),r);if((t=y.signal)==null||t.addEventListener("abort",a,{once:!0}),(i=y.signal)!=null&&i.aborted)return a();this.getInstance().layout(E).then(g=>n(()=>C(g)),g=>n(()=>_(g)))})}}const ce=W=>(W.id==="root"||Number.isFinite(W.x)&&Number.isFinite(W.y))&&(W.children??[]).every(ce);class He{constructor(){ee(this,"descriptor",{id:"memo.layout.fixed",name:"Fixed / authored",version:"1.0.0",contractVersion:"1",license:"Internal",description:"Preserves existing authored geometry without automatic rearrangement.",mode:"preserve",capabilities:["flat-graph","compound-graph","explicit-ports","fixed-nodes","deterministic"]})}supports(E){const y=ce(E);return{supported:y,...y?{}:{reason:"every node must already have finite x/y coordinates"}}}async layout(E){return ue(E)}}const oe=new we;oe.register(new Xe);oe.register(new $e);oe.register(new He);function er(W,E){return oe.layout(W,E)}export{ve as D,er as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as Be,B as ne,R as He,G as kt,F as ge,V as rn,u as nt,H as xn}from"./index-C8UZrEP-.js";import{r as wn,D as In}from"./layout-providers-Dr743WlP.js";import{j as O}from"./reactflow-CsCqNKB-.js";import{a as ye}from"./zustand-CrhqMOHB.js";const Ve=new Set(["composedOf","composes","decomposedBy","aggregation"]);function rt(t,e){const n=new Map;for(const l of t)n.set(l.id,l);const o=new Map,s=new Set;for(const l of e)Ve.has(l.type)&&(!n.has(l.sourceId)||!n.has(l.targetId)||l.sourceId!==l.targetId&&(s.has(l.targetId)||(o.has(l.sourceId)||o.set(l.sourceId,[]),o.get(l.sourceId).push(l.targetId),s.add(l.targetId))));return{roots:[...n.keys()].filter(l=>!s.has(l)),childrenMap:o,elements:n}}function Xs(t){if(t.elements.size===0)return null;const e=new Set,n=s=>{if(!e.has(s)){e.add(s);for(const c of t.childrenMap.get(s)??[])n(c)}};t.roots[0]&&n(t.roots[0]);const o=[...t.elements.keys()].filter(s=>!e.has(s));return t.roots.length===1&&o.length===0?null:{rootIds:t.roots,disconnectedIds:o}}const bn=new Set(["name","title","description","shortDescription","longDescription","sourceReference","rationaleText","semantics","protocolSemantics","queryDescription","dataSourceDescription","documentUsage","doc"]);function Sn(t,e=4){const n=[];t.shortId&&n.push({key:"id",value:t.shortId});for(const[o,s]of Object.entries(t.attributes)){if(n.length>=e)break;if(bn.has(o)||o.includes(".")||o==="id"&&n.some(l=>l.key==="id"))continue;const c=s.split("::").pop().trim();!c||c.length>28||n.push({key:o,value:c})}return n.slice(0,e)}const Ge={layout:(t,e)=>wn(t,e)},Mn=(t,e,n,o=10)=>{const s=n.x-o,c=n.x+n.width+o,l=n.y-o,i=n.y+n.height+o;return t.y===e.y?t.y>=l&&t.y<=i&&Math.max(t.x,e.x)>=s&&Math.min(t.x,e.x)<=c:t.x===e.x?t.x>=s&&t.x<=c&&Math.max(t.y,e.y)>=l&&Math.min(t.y,e.y)<=i:!1},an=(t,e,n,o)=>t.y===e.y&&n.y===o.y&&t.y===n.y?Math.max(Math.min(t.x,e.x),Math.min(n.x,o.x))<Math.min(Math.max(t.x,e.x),Math.max(n.x,o.x)):t.x===e.x&&n.x===o.x&&t.x===n.x?Math.max(Math.min(t.y,e.y),Math.min(n.y,o.y))<Math.min(Math.max(t.y,e.y),Math.max(n.y,o.y)):!1,cn=(t,e,n,o)=>{const s=t.y===e.y,c=n.y===o.y;if(s===c)return!1;const l=s?t:n,i=s?e:o,a=s?n:t,f=s?o:e;return a.x>Math.min(l.x,i.x)&&a.x<Math.max(l.x,i.x)&&l.y>Math.min(a.y,f.y)&&l.y<Math.max(a.y,f.y)},En=26,Ct=(t,e,n)=>e==="left"?{x:t.x-n,y:t.y}:e==="right"?{x:t.x+n,y:t.y}:e==="top"?{x:t.x,y:t.y-n}:{x:t.x,y:t.y+n};function qe(t,e,n=18){const o=new Map,s=[],c=Math.max(12,n*.75),l=[...t].sort((i,a)=>Math.abs(a.source.x-a.target.x)+Math.abs(a.source.y-a.target.y)-(Math.abs(i.source.x-i.target.x)+Math.abs(i.source.y-i.target.y)));for(const i of l){const{source:a,target:f}=i,p=Math.abs(a.x-f.x)+Math.abs(a.y-f.y),g=Math.min(En,p/3),x=!!i.sourceSide&&g>.5,m=!!i.targetSide&&g>.5,u=x?Ct(a,i.sourceSide,g):a,h=m?Ct(f,i.targetSide,g):f,d=(r,w)=>w.x>r.x-c&&w.x<r.x+r.width+c&&w.y>r.y-c&&w.y<r.y+r.height+c,S=e.filter(r=>r.id!==i.sourceNodeId&&r.id!==i.targetNodeId&&!d(r,a)&&!d(r,f)),b=new Set([u.x,h.x,(u.x+h.x)/2,u.x-n,u.x+n,h.x-n,h.x+n]),E=new Set([u.y,h.y,(u.y+h.y)/2,u.y-n,u.y+n,h.y-n,h.y+n]);for(const r of S)b.add(r.x-c),b.add(r.x+r.width+c),E.add(r.y-c),E.add(r.y+r.height+c);for(const[r,w]of s)b.add(r.x),b.add(w.x),E.add(r.y),E.add(w.y);const M=[...b].sort((r,w)=>r-w),N=[...E].sort((r,w)=>r-w),_=[],$=new Map,W=(r,w)=>`${r.toFixed(3)}:${w.toFixed(3)}`,H=r=>S.some(w=>r.x>w.x-c&&r.x<w.x+w.width+c&&r.y>w.y-c&&r.y<w.y+w.height+c);for(const r of N)for(const w of M){const k={x:w,y:r};H(k)&&W(w,r)!==W(u.x,u.y)&&W(w,r)!==W(h.x,h.y)||($.set(W(w,r),_.length),_.push(k))}const K=new Map,re=(r,w)=>{K.has(r)||K.set(r,[]),K.has(w)||K.set(w,[]),K.get(r).push(w),K.get(w).push(r)},Ie=(r,w)=>!S.some(k=>Mn(r,w,k,c-1));for(const r of N){const w=M.map(k=>$.get(W(k,r))).filter(k=>k!==void 0);for(let k=1;k<w.length;k++)Ie(_[w[k-1]],_[w[k]])&&re(w[k-1],w[k])}for(const r of M){const w=N.map(k=>$.get(W(r,k))).filter(k=>k!==void 0);for(let k=1;k<w.length;k++)Ie(_[w[k-1]],_[w[k]])&&re(w[k-1],w[k])}const fe=$.get(W(u.x,u.y)),Y=$.get(W(h.x,h.y)),Ee=(r,w)=>`${r}:${w}`,be=fe===void 0?[]:[{node:fe,dir:"N",g:0,f:Math.abs(u.x-h.x)+Math.abs(u.y-h.y)}],le=new Map(fe===void 0?[]:[[Ee(fe,"N"),0]]),ve=new Map;be[0]&&ve.set(Ee(be[0].node,be[0].dir),be[0]);let xe;const pe=(r,w,k)=>!k||k==="left"&&w.x<r.x||k==="right"&&w.x>r.x||k==="top"&&w.y<r.y||k==="bottom"&&w.y>r.y,Me=(r,w,k)=>!k||(k==="left"?w.x<=r.x:k==="right"?w.x>=r.x:k==="top"?w.y<=r.y:w.y>=r.y),v=x?Me:pe,R=m?Me:pe;for(;be.length>0;){be.sort((w,k)=>w.f-k.f);const r=be.shift();if(r.node===Y){xe=r;break}for(const w of K.get(r.node)??[]){const k=_[r.node],L=_[w];if(r.node===fe&&!v(k,L,i.sourceSide)||w===Y&&!R(L,k,i.targetSide))continue;const D=k.y===L.y?"H":"V",Q=Math.abs(k.x-L.x)+Math.abs(k.y-L.y);let B=r.dir!=="N"&&r.dir!==D?90:0;for(const[U,z]of s)an(k,L,U,z)?B+=4e3:cn(k,L,U,z)&&(B+=600);const Z=Math.abs(k.x-h.x)+Math.abs(k.y-h.y),J=Math.abs(L.x-h.x)+Math.abs(L.y-h.y);J>Z&&(B+=(J-Z)*1.5);const y=r.g+Q+B,A=Ee(w,D);if(y>=(le.get(A)??Number.POSITIVE_INFINITY))continue;const P={node:w,dir:D,g:y,f:y+J,parent:Ee(r.node,r.dir)};le.set(A,y),ve.set(A,P),be.push(P)}}let F=[];if(xe){let r=xe;for(;r;)F.push(_[r.node]),r=r.parent?ve.get(r.parent):void 0;F.reverse()}if(F.length<2){const r=(u.x+h.x)/2;F=[u,{x:r,y:u.y},{x:r,y:h.y},h]}x&&F.unshift(a),m&&F.push(f);const ie=F.filter((r,w)=>w===0||w===F.length-1||!(F[w-1].x===r.x&&r.x===F[w+1].x||F[w-1].y===r.y&&r.y===F[w+1].y));o.set(i.id,ie);for(let r=1;r<ie.length;r++)s.push([ie[r-1],ie[r]])}return o}const At=(t,e)=>{const n=Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x),o=Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y);return n>0&&o>0?n*o:0},vn=(t,e,n)=>{if(t.y===e.y){if(t.y<n.y||t.y>n.y+n.height)return 0;const o=Math.min(Math.max(t.x,e.x),n.x+n.width)-Math.max(Math.min(t.x,e.x),n.x);return Math.max(o,0)}if(t.x===e.x){if(t.x<n.x||t.x>n.x+n.width)return 0;const o=Math.min(Math.max(t.y,e.y),n.y+n.height)-Math.max(Math.min(t.y,e.y),n.y);return Math.max(o,0)}return 0};function it(t,e){var i;const n=new Map,o=[],s=a=>a.slice(1).reduce((f,p,g)=>f+Math.abs(p.x-a[g].x)+Math.abs(p.y-a[g].y),0),c=t.flatMap(a=>a.points.slice(1).map((f,p)=>({edgeId:a.id,a:a.points[p],b:f}))),l=[...t].sort((a,f)=>s(f.points)-s(a.points));for(const a of l){const{points:f,width:p,height:g}=a;if(f.length<2)continue;const x=[];for(let h=1;h<f.length;h++){const d=f[h-1],S=f[h],b=Math.abs(S.x-d.x)+Math.abs(S.y-d.y),E=Math.abs(S.x-d.x)>=Math.abs(S.y-d.y),M=g/2+4;for(const N of b>=p*1.5?[.5,.3,.7]:[.5,.25,.75]){const _={x:d.x+(S.x-d.x)*N,y:d.y+(S.y-d.y)*N};for(const $ of[-1,1])x.push({center:E?{x:_.x,y:_.y+$*M}:{x:_.x+$*(p/2+4),y:_.y},segmentLength:b})}}let m=((i=x[0])==null?void 0:i.center)??f[0],u=Number.POSITIVE_INFINITY;for(const h of x){const d={x:h.center.x-p/2,y:h.center.y-g/2,width:p,height:g};let S=0;for(const b of o)S+=At(d,b)*3;for(const b of e)S+=At(d,b)*4;for(const b of c)b.edgeId!==a.id&&(S+=vn(b.a,b.b,d)*12*2.5);S+=Math.max(0,p*1.4-h.segmentLength)*2,S<u&&(u=S,m=h.center)}n.set(a.id,m),o.push({x:m.x-p/2,y:m.y-g/2,width:p,height:g})}return n}const at=20,ct=t=>t.length*6.4+12;function kn(t){const{connectors:e,rects:n}=t,o=t.obstacles??[...n.entries()].map(([m,u])=>({id:m,...u})),s=[],c=new Map;for(const m of e){const u=n.get(m.sourceId),h=n.get(m.targetId);if(!u||!h||m.sourceId===m.targetId)continue;const d=N=>({x:N.x+N.width/2,y:N.y+N.height/2}),S=Math.abs(d(h).x-d(u).x)>=Math.abs(d(h).y-d(u).y),b=S?d(h).x>=d(u).x:d(h).y>=d(u).y,E=S?b?"right":"left":b?"bottom":"top",M=S?b?"left":"right":b?"top":"bottom";c.set(m.id,{source:E,target:M}),s.push({connectorId:m.id,nodeId:m.sourceId,side:E,otherCentre:d(h)}),s.push({connectorId:m.id,nodeId:m.targetId,side:M,otherCentre:d(u)})}const l=new Map,i=(m,u)=>`${m}\0${u}`,a=new Map;for(const m of s){const u=`${m.nodeId}\0${m.side}`;a.set(u,[...a.get(u)??[],m])}for(const m of a.values()){const u=n.get(m[0].nodeId),h=m[0].side==="left"||m[0].side==="right",d=[...m].sort((E,M)=>h?E.otherCentre.y-M.otherCentre.y:E.otherCentre.x-M.otherCentre.x),S=(h?u.height:u.width)*.7,b=(h?u.y+u.height/2:u.x+u.width/2)-S/2;d.forEach((E,M)=>{const N=d.length===1?(h?u.height:u.width)/2:b+S*(M/(d.length-1))-(h?u.y:u.x);l.set(i(E.connectorId,E.nodeId),{x:E.side==="left"?u.x:E.side==="right"?u.x+u.width:u.x+(h?u.width/2:N),y:E.side==="top"?u.y:E.side==="bottom"?u.y+u.height:u.y+(h?N:u.height/2)})})}const f=[];for(const m of e){const u=c.get(m.id);u&&f.push({id:m.id,source:l.get(i(m.id,m.sourceId)),target:l.get(i(m.id,m.targetId)),sourceNodeId:m.sourceId,targetNodeId:m.targetId,sourceSide:u.source,targetSide:u.target})}const p=qe(f,o,t.channelGap),g=it(e.flatMap(m=>{const u=p.get(m.id);return m.label&&u&&u.length>=2?[{id:m.id,points:u,width:ct(m.label),height:at}]:[]}),o),x=new Map;for(const[m,u]of p)x.set(m,{points:u,labelPoint:g.get(m)});return x}function Cn(t,e,n=1.5){if(t<=0||e<=0)return Number.POSITIVE_INFINITY;const o=1+1.35*Math.abs(Math.log(t/e/n));return t*e*o}function An(t,e=1.25){return t<=1?Math.max(t,1):Math.min(t,Math.max(2,Math.round(Math.sqrt(t*e))))}function ln(t,e){const n=new Set(t.map(f=>f.id)),o=new Map,s=new Map(t.map(f=>[f.id,0]));for(const f of e)!n.has(f.source)||!n.has(f.target)||f.source===f.target||(o.has(f.source)||o.set(f.source,[]),o.get(f.source).push(f.target),s.set(f.target,(s.get(f.target)??0)+1));const c=t.map(f=>f.id),l=c.filter(f=>(s.get(f)??0)===0),i=[],a=new Set;for(;l.length;){const f=l.shift();if(!a.has(f)){a.add(f),i.push(f);for(const p of o.get(f)??[])s.set(p,(s.get(p)??1)-1),s.get(p)===0&&l.push(p)}}for(const f of c)a.has(f)||i.push(f);return i}function On(t,e,n,o,s){const c=new Map(t.map(h=>[h.id,h])),l=ln(t,e).map(h=>c.get(h)),i=An(t.length,s),a=Math.ceil(t.length/i),f=l.map((h,d)=>{const S=Math.floor(d/i),b=d%i,E=S%2===0?b:i-1-b;return{node:h,row:S,col:E}}),p=Array.from({length:i},()=>0),g=Array.from({length:a},()=>0);for(const{node:h,row:d,col:S}of f)p[S]=Math.max(p[S],h.width),g[d]=Math.max(g[d],h.height);const x=p.map((h,d)=>d===0?0:p.slice(0,d).reduce((S,b)=>S+b,0)+n*d),m=g.map((h,d)=>d===0?0:g.slice(0,d).reduce((S,b)=>S+b,0)+o*d),u=f.map(({node:h,row:d,col:S})=>({...h,x:x[S]+(p[S]-h.width)/2,y:m[d]+(g[d]-h.height)/2}));return{strategy:"balanced-board",width:p.reduce((h,d)=>h+d,0)+n*Math.max(i-1,0),height:g.reduce((h,d)=>h+d,0)+o*Math.max(a-1,0),children:u}}function Nn(t,e,n,o){const s={x:t.x+t.width/2,y:t.y+t.height/2},c={x:e.x+e.width/2,y:e.y+e.height/2},l={x:n.x+n.width/2,y:n.y+n.height/2},i={x:o.x+o.width/2,y:o.y+o.height/2},a=(f,p,g)=>(p.x-f.x)*(g.y-f.y)-(p.y-f.y)*(g.x-f.x);return a(s,c,l)*a(s,c,i)<0&&a(l,i,s)*a(l,i,c)<0}function Ot(t,e,n=1.5){const o=new Map(t.children.map(u=>[u.id,u]));let s=0,c=0,l=0,i=0;const a=e.filter(u=>o.has(u.source)&&o.has(u.target));for(const u of a){const h=o.get(u.source),d=o.get(u.target);s+=Math.abs(h.x+h.width/2-(d.x+d.width/2))+Math.abs(h.y+h.height/2-(d.y+d.height/2));const S=d.x+d.width/2-(h.x+h.width/2),b=Math.abs(d.y+d.height/2-(h.y+h.height/2));S<=0&&(l+=55e3),l+=Math.max(0,b-Math.max(S,0))*80,Math.abs(S)>8&&b>8&&(i+=18e3)}for(let u=0;u<a.length;u++)for(let h=u+1;h<a.length;h++){const d=a[u],S=a[h];d.source===S.source||d.source===S.target||d.target===S.source||d.target===S.target||Nn(o.get(d.source),o.get(d.target),o.get(S.source),o.get(S.target))&&c++}const f=qe(a.map(u=>{const h=o.get(u.source),d=o.get(u.target);return{id:u.id,source:{x:h.x+h.width,y:h.y+h.height/2},target:{x:d.x,y:d.y+d.height/2},sourceNodeId:u.source,targetNodeId:u.target,sourceSide:"right",targetSide:"left"}}),t.children);let p=0,g=0,x=0;const m=[];for(const[u,h]of f){g+=Math.max(0,h.length-2);for(let d=1;d<h.length;d++)p+=Math.abs(h[d].x-h[d-1].x)+Math.abs(h[d].y-h[d-1].y),m.push({edgeId:u,a:h[d-1],b:h[d]})}for(let u=0;u<m.length;u++)for(let h=u+1;h<m.length;h++){const d=m[u],S=m[h];d.edgeId!==S.edgeId&&(an(d.a,d.b,S.a,S.b)||cn(d.a,d.b,S.a,S.b))&&x++}return Cn(t.width,t.height,n)+s*18+l+i+c*Math.max(t.width*t.height*.35,5e4)+p*6+g*4e3+x*Math.max(t.width*t.height*.45,7e4)}async function Nt(t){const{nodes:e,edges:n}=t;if(e.length===0)return{strategy:"balanced-board",width:0,height:0,children:[]};const o=t.targetAspect??1.5,s=t.gapX??54,c=t.gapY??58,l=a=>{const f=new Map(e.map(d=>[d.id,d])),p=ln(e,n).map(d=>f.get(d));let g=0;const x=Math.max(...a==="RIGHT"?p.map(d=>d.height):p.map(d=>d.width));let m=p.map(d=>{const S={...d,x:a==="RIGHT"?g:(x-d.width)/2,y:a==="DOWN"?g:(x-d.height)/2};return g+=a==="RIGHT"?d.width+s:d.height+c,S});if(a==="RIGHT"&&n.some(d=>d.sourceAnchorY!==void 0&&d.targetAnchorY!==void 0)){new Map(m.map(M=>[M.id,M]));const d=new Map,S=[...m].sort((M,N)=>N.width*N.height-M.width*M.height)[0];d.set(S.id,0);let b=!0;for(;b;){b=!1;for(const M of n){if(M.sourceAnchorY===void 0||M.targetAnchorY===void 0)continue;const N=d.get(M.source),_=d.get(M.target);N!==void 0&&_===void 0?(d.set(M.target,N+M.sourceAnchorY-M.targetAnchorY),b=!0):_!==void 0&&N===void 0&&(d.set(M.source,_+M.targetAnchorY-M.sourceAnchorY),b=!0)}}m=m.map(M=>({...M,y:d.get(M.id)??M.y}));const E=Math.min(...m.map(M=>M.y));m=m.map(M=>({...M,y:M.y-E}))}const u=Math.max(...m.map(d=>d.x+d.width)),h=Math.max(...m.map(d=>d.y+d.height));return{strategy:a==="RIGHT"?"layered-right":"layered-down",width:u,height:h,children:m}};if(t.directedFlowAxis==="RIGHT")return l("RIGHT");if(t.directedFlowAxis==="DOWN")return l("DOWN");const i=[On(e,n,s,c,o),l("RIGHT"),l("DOWN")];if(e.length>=3&&n.length>0)try{const a=new Map(e.filter(h=>{var d;return(d=h.ports)==null?void 0:d.length}).map(h=>[h.id,h])),f={left:"WEST",right:"EAST",top:"NORTH",bottom:"SOUTH"},p=new Set((t.graphPorts??[]).map(h=>h.id)),g=(t.graphPorts??[]).map(h=>({id:h.id,width:1,height:1,layoutOptions:{"elk.layered.layering.layerConstraint":h.side==="right"?"LAST_SEPARATE":"FIRST_SEPARATE"}})),m=(await Ge.layout({id:`resolver-${t.id}`,layoutOptions:{"elk.algorithm":"layered","elk.direction":"RIGHT","elk.edgeRouting":"ORTHOGONAL","elk.aspectRatio":String(o),"elk.padding":"[top=0,left=0,bottom=0,right=0]","elk.spacing.nodeNode":String(c),"elk.layered.spacing.nodeNodeBetweenLayers":String(s),"elk.layered.nodePlacement.strategy":"BRANDES_KOEPF","elk.layered.nodePlacement.favorStraightEdges":"true","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.crossingMinimization.semiInteractive":"true","elk.layered.thoroughness":"18","elk.layered.wrapping.strategy":e.length>5?"MULTI_EDGE":"OFF","elk.layered.wrapping.additionalEdgeSpacing":"18","elk.separateConnectedComponents":"true","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES","elk.randomSeed":"1"},children:[...g,...e.map(h=>{var d;return(d=h.ports)!=null&&d.length?{id:h.id,width:h.width,height:h.height,layoutOptions:{"elk.portConstraints":"FIXED_SIDE"},ports:h.ports.map(S=>({id:S.id,width:8,height:8,layoutOptions:{"elk.port.side":f[S.side]}}))}:{id:h.id,width:h.width,height:h.height}})],edges:n.map(h=>({id:h.id,sources:[a.has(h.source)&&h.sourcePort?h.sourcePort:h.source],targets:[a.has(h.target)&&h.targetPort?h.targetPort:h.target]}))},{providerId:t.layoutProviderId})).children??[],u=m.filter(h=>!p.has(h.id));if(u.length===e.length){const h=new Map(e.map(M=>[M.id,M])),d=Math.min(...u.map(M=>M.x??0)),S=Math.min(...u.map(M=>M.y??0)),b=u.map(M=>{const N=M.ports;return{...h.get(M.id),x:(M.x??0)-d,y:(M.y??0)-S,...N!=null&&N.length?{portY:new Map(N.map(_=>[_.id,_.y??0]))}:{}}}),E=m.filter(M=>p.has(M.id));i.push({strategy:"elk-layered",width:Math.max(...b.map(M=>M.x+M.width)),height:Math.max(...b.map(M=>M.y+M.height)),...E.length?{graphPortY:new Map(E.map(M=>[M.id,(M.y??0)-S]))}:{},children:b})}}catch{}return i.reduce((a,f)=>Ot(f,n,o)<Ot(a,n,o)?f:a)}async function Tn(t,e){var b;const n=Object.values(t.elements),o=e!=null&&e.viewpointFilter?n.filter(e.viewpointFilter):n,s=new Set(o.map(E=>E.id)),c=(b=e==null?void 0:e.relationshipTypes)!=null&&b.length?new Set(e.relationshipTypes.map(E=>E.toLowerCase())):void 0,l=t.relationships.filter(E=>s.has(E.sourceId)&&s.has(E.targetId)&&(!c||c.has(E.type.toLowerCase()))),i=o.length,a=i>60?"RIGHT":"DOWN",f=i>40?"24":i>20?"32":"40",p=i>40?"60":i>20?"80":"100",g=e!=null&&e.compartments?new Map(o.map(E=>[E.id,Sn(E)])):void 0,x=E=>Math.max(E.name.length*7.5+48,E.kind.length*6.8+48,130),m=E=>{const M=g==null?void 0:g.get(E.id);return 52+(M!=null&&M.length?M.length*15+10:0)},u={id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":a,"elk.spacing.nodeNode":f,"elk.layered.spacing.nodeNodeBetweenLayers":p,"elk.layered.spacing.edgeNodeBetweenLayers":"24","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.compaction.postCompaction.strategy":"EDGE_LENGTH","elk.layered.wrapping.strategy":"MULTI_EDGE","elk.layered.wrapping.additionalEdgeSpacing":"16","elk.separateConnectedComponents":"true","elk.spacing.componentComponent":"56","elk.aspectRatio":"1.6","elk.padding":"[top=20, left=20, bottom=20, right=20]"},children:o.map(E=>({id:E.id,width:x(E),height:m(E)})),edges:l.map((E,M)=>({id:E.id||`e-${M}`,sources:[E.sourceId],targets:[E.targetId]}))};let h;try{h=await Ge.layout(u,{providerId:e==null?void 0:e.layoutProviderId})}catch(E){console.warn("ELK layout failed, retrying without edge wrapping:",E),delete u.layoutOptions["elk.layered.wrapping.strategy"],delete u.layoutOptions["elk.layered.wrapping.additionalEdgeSpacing"],h=await Ge.layout(u,{providerId:e==null?void 0:e.layoutProviderId})}const d=(h.children||[]).map(E=>{const M=t.elements[E.id],N=Be[M==null?void 0:M.layer]||"#666",_=g==null?void 0:g.get(E.id);return{id:E.id,type:"diagramNode",position:{x:E.x||0,y:E.y||0},data:{label:(M==null?void 0:M.name)||E.id,kind:(M==null?void 0:M.kind)??"",layer:(M==null?void 0:M.layer)??"",construct:M==null?void 0:M.construct,color:N,..._!=null&&_.length?{compartments:_}:{}}}}),S=l.map((E,M)=>{const N=He[E.type]||"#9CA3AF",_=E.type.toLowerCase(),$=E.type==="flow",W=E.type==="succession",H=_==="composedof"||_==="decomposedby"||_==="aggregation"||_==="composes";return{id:E.id||`e-${M}`,source:E.sourceId,target:E.targetId,label:H?void 0:E.type,type:W?"smoothstep":"default",animated:$,style:{stroke:N,strokeWidth:H?2.5:$?2:ne.defaultWidth,strokeDasharray:H||$?void 0:E.type==="traceTo"?"5 3":void 0},labelStyle:{fontSize:"10px",fill:"#6B7280",fontWeight:500},labelBgPadding:ne.labelBgPadding,labelBgBorderRadius:ne.labelBgRadius,labelBgStyle:ne.labelBgStyle,markerEnd:{type:H?"arrow":"arrowclosed",color:N,width:ne.arrowSize,height:ne.arrowSize}}});return{nodes:d,edges:S}}function dn(t){var l;const e=new Set((((l=t.registries)==null?void 0:l.kinds)??[]).filter(i=>{var a;return(a=i.namespace)==null?void 0:a.some(f=>f==="logical"||f==="implementation"||f==="realization")}).map(i=>i.name)),n=new Map;for(const i of Object.values(t.elements))e.has(i.kind)&&n.set(i.id,i);const o=new Map,s=new Set;for(const i of t.relationships)(i.type==="composedOf"||i.type==="aggregation")&&n.has(i.sourceId)&&n.has(i.targetId)&&(o.has(i.sourceId)||o.set(i.sourceId,[]),o.get(i.sourceId).push(i.targetId),s.add(i.targetId));return{roots:[...n.keys()].filter(i=>!s.has(i)),childrenMap:o,elements:n}}const De=64,Je=100,Tt=110,_t=300,Pt=44;function lt(t){return Math.max(t.name.length*8+80,220)}async function _n(t,e){const n=e.tree??dn(t);if(n.roots.length===0)return{nodes:[],edges:[]};const o=e.positionCache??new Map,s=x=>e.nodeDirections.get(x)||"vertical",c=x=>(n.childrenMap.get(x)||[]).filter(m=>n.elements.has(m)),l=x=>{const m=n.elements.get(x),u=lt(m),h=c(x);if(!e.expandedNodes.has(x)||h.length===0)return{width:u,height:De};const d=h.map(l);if(s(x)==="vertical"){const E=d.reduce((N,_)=>N+_.width,0)+(d.length-1)*Je,M=Math.max(...d.map(N=>N.height));return{width:Math.max(u,E),height:De+Tt+M}}const S=Math.max(...d.map(E=>E.width)),b=d.reduce((E,M)=>E+M.height,0)+(d.length-1)*Pt;return{width:u+_t+S,height:Math.max(De,b)}},i=[],a=[],f=He.composedOf,p=(x,m,u,h)=>{const d=n.elements.get(x),S=lt(d),b=c(x),E=e.expandedNodes.has(x);let M=o.get(x);M||(M={x:u-S/2,y:h-De/2},o.set(x,M));const N={element:d,layerColor:Be[d.layer]||"#666",isExpanded:E,hasChildren:b.length>0,childCount:b.length,direction:s(x),onToggleExpand:()=>e.callbacks.onToggleExpand(x),onToggleDirection:()=>e.callbacks.onToggleDirection(x),showDirectionButton:!0,label:d.name};if(i.push({id:x,type:"decompositionNode",position:{x:M.x,y:M.y},data:N,style:{width:S,height:De}}),m){const $=s(m);a.push({id:`decomp-${m}-${x}`,source:m,target:x,sourceHandle:$==="vertical"?"bottom":"right",targetHandle:$==="vertical"?"top":"left",type:"smoothstep",style:{stroke:f,strokeWidth:ne.defaultWidth},markerEnd:{type:"arrowclosed",color:f,width:ne.arrowSize,height:ne.arrowSize}})}if(!E||b.length===0)return;const _=b.map(l);if(s(x)==="vertical"){const $=_.reduce((K,re)=>K+re.width,0)+(_.length-1)*Je;let W=M.x+S/2-$/2;const H=M.y+De+Tt+De/2;b.forEach((K,re)=>{p(K,x,W+_[re].width/2,H),W+=_[re].width+Je})}else{const $=M.x+S+_t;let W=M.y+De+20;b.forEach((H,K)=>{const re=n.elements.get(H);p(H,x,$+lt(re)/2,W+De/2),W+=_[K].height+Pt})}};let g=0;for(const x of n.roots){if(!n.elements.has(x))continue;const m=l(x);p(x,null,g+m.width/2,100),g+=m.width+Je*2}return{nodes:i,edges:a}}const dt=240,ht=80,We=20;function Pn(t,e){const n=e.tree??dn(t);if(n.roots.length===0)return{nodes:[],edges:[]};const o=[];function s(g,x,m,u,h){const d=n.elements.get(g);if(!d)return{width:0,height:0};const S=Be[d.layer]||"#666",b=n.childrenMap.get(g)||[],E=b.length>0,M=e.expandedNodes.has(g);let N=dt,_=ht;if(M&&E){let H=We,K=ht+We,re=0,Ie=0;for(const fe of b){if(!n.elements.has(fe))continue;const Y=s(fe,g,m+1,H,K);H+Y.width>800&&H>We&&(H=We,K+=re+We,re=0,c(fe),s(fe,g,m+1,H,K)),H+=Y.width+We,re=Math.max(re,Y.height),Ie=Math.max(Ie,H)}N=Math.max(dt,Ie),_=K+re+We}const $=kt[m%kt.length],W={element:d,layerColor:S,isExpanded:M,hasChildren:E,childCount:b.length,direction:"vertical",onToggleExpand:()=>e.callbacks.onToggleExpand(g),onToggleDirection:()=>{},showDirectionButton:!1,depthBgColor:$,isContainer:E,label:d.name};return o.push({id:g,type:"decompositionNode",position:{x:u,y:h},...x?{parentId:x,extent:"parent"}:{},data:W,style:{width:M&&E?N:dt,height:M&&E?_:ht}}),{width:N,height:_}}function c(g){const x=new Set([g]),m=u=>{for(const h of n.childrenMap.get(u)||[])x.add(h),m(h)};m(g);for(let u=o.length-1;u>=0;u--)x.has(o[u].id)&&o.splice(u,1)}let l=0;for(const g of n.roots){if(!n.elements.has(g))continue;const x=s(g,null,0,l,0);l+=x.width+40}const i=new Map(o.map(g=>[g.id,g])),a=[],f=new Set,p=g=>{if(f.has(g.id))return;const x=g.parentId?i.get(g.parentId):void 0;x&&p(x),f.add(g.id),a.push(g)};for(const g of o)p(g);return{nodes:a,edges:[]}}function Fn(t){var l;const e=new Set((((l=t.registries)==null?void 0:l.kinds)??[]).filter(i=>{var a;return(a=i.namespace)==null?void 0:a.includes("functional")}).map(i=>i.name)),n=new Map;for(const i of Object.values(t.elements))e.has(i.kind)&&n.set(i.id,i);const o=new Map,s=new Set;for(const i of t.relationships)(i.type==="decomposedBy"||i.type==="composedOf")&&n.has(i.sourceId)&&n.has(i.targetId)&&(o.has(i.sourceId)||o.set(i.sourceId,[]),o.get(i.sourceId).push(i.targetId),s.add(i.targetId));return{roots:[...n.keys()].filter(i=>!s.has(i)),childrenMap:o,elements:n}}async function Ks(t,e){const n=Fn(t);if(n.roots.length===0)return{nodes:[],edges:[]};const o=new Set,s=[];function c(p){if(n.elements.has(p)&&(o.add(p),e.expandedNodes.has(p)))for(const g of n.childrenMap.get(p)||[])n.elements.has(g)&&(s.push({parentId:p,childId:g}),c(g))}for(const p of n.roots)c(p);const l={id:"root",layoutOptions:{"elk.algorithm":"mrtree","elk.direction":"DOWN","elk.spacing.nodeNode":"40","elk.mrtree.searchOrder":"DFS"},children:[...o].map(p=>{const g=n.elements.get(p);return{id:p,width:Math.max(g.name.length*8+80,220),height:56}}),edges:s.map((p,g)=>({id:`fbs-${g}`,sources:[p.parentId],targets:[p.childId]}))},a=((await Ge.layout(l,{providerId:e.layoutProviderId})).children||[]).map(p=>{const g=n.elements.get(p.id),x=Be[g.layer]||"#E67E22",m=(n.childrenMap.get(p.id)||[]).length,u=e.nodeDirections.get(p.id)||"vertical",h={element:g,layerColor:x,isExpanded:e.expandedNodes.has(p.id),hasChildren:m>0,childCount:m,direction:u,onToggleExpand:()=>e.callbacks.onToggleExpand(p.id),onToggleDirection:()=>e.callbacks.onToggleDirection(p.id),showDirectionButton:!0,label:g.name};return{id:p.id,type:"decompositionNode",position:{x:p.x||0,y:p.y||0},data:h}}),f=s.map((p,g)=>{const x=e.nodeDirections.get(p.parentId)||"vertical";return{id:`fbs-e-${g}`,source:p.parentId,target:p.childId,sourceHandle:x==="vertical"?"bottom":"right",targetHandle:x==="vertical"?"top":"left",type:"default",style:{stroke:He.decomposedBy,strokeWidth:ne.defaultWidth},markerEnd:{type:"arrowclosed",color:He.decomposedBy,width:ne.arrowSize,height:ne.arrowSize}}});return{nodes:a,edges:f}}const Us=["graph","tree","containment"];function Vs(t){const e=t==null?void 0:t.layoutHint;return e==="tree"||e==="containment"||e==="graph"?e:"graph"}function Dn(t,e){const n=Object.values(t.elements);return e?n.filter(e):n}function Rn(t,e){return rt(Dn(t,e),t.relationships)}async function qs(t,e){if(e.mode==="graph")return Tn(t,{viewpointFilter:e.viewpointFilter,relationshipTypes:e.relationshipTypes,compartments:!0,layoutProviderId:e.layoutProviderId});const n=Rn(t,e.viewpointFilter);return e.mode==="tree"?_n(t,{expandedNodes:e.expandedNodes,nodeDirections:e.nodeDirections,callbacks:e.callbacks,tree:n,positionCache:e.positionCache}):Pn(t,{expandedNodes:e.expandedNodes,callbacks:{onToggleExpand:e.callbacks.onToggleExpand},tree:n})}const Ft="__inner",Zs={in:"#16A34A",out:"#D97706",inout:"#2563EB"},Ln={data:"#3498DB",energy:"#D97706",material:"#16A34A",control:"#6B7280"};function Bn(t,e){const n=t??"";return/energy|power|voltage|current|thermal|heat/i.test(n)?"energy":/material|fluid|gas|liquid|drug|dose|batch|consumable/i.test(n)?"material":e&&/succession|control/i.test(e)?"control":"data"}function hn(t){return t.construct==="port"||t.kind.endsWith("Port")}function Dt(t){var o,s;const e=(o=t.portSpec)==null?void 0:o.direction;if(e==="in"||e==="out"||e==="inout")return e;const n=(s=(t.attributes.direction??"").split("::").pop())==null?void 0:s.trim();if(n==="bidirectional")return"inout";if(n==="in"||n==="out"||n==="inout")return n}const Oe=24,Js=Oe,gt=Oe,et=30,Re=70,ut=62,Qe=18,Rt=14,Lt=128,ze=38,Ye=18,ft=90,Bt=184,jn=168,Wn=(t,e=7.2)=>t.length*e+20,Hn=t=>Math.min(Math.max(Wn(t,7.1),132),216);function gn(t){var o,s;const e=(o=t.portSpec)==null?void 0:o.direction,n=e==="in"||e==="out"||e==="inout"?e:(s=(t.attributes.direction??"").split("::").pop())==null?void 0:s.trim();if(n==="in")return"in";if(n==="out"||n==="inout"||n==="bidirectional"||/out(put)?$/i.test(t.name))return"out";if(/in(put)?$/i.test(t.name))return"in"}function zn(t,e,n){return gn(t)??(e>n?"out":"in")}const Gn=t=>t==="in"?"left":"right";function $n(t,e){const n=t.filter(s=>!e.isConnected(s)&&!e.hasChildParts(s)&&e.portCount(s)===0),o=new Set(n);return{flowKids:t.filter(s=>!o.has(s)),orphanKids:n}}function Yn(t,e,n){const o=new Map,s=new Map;for(const[i,a]of t)a.owner&&(e(a.owner)?o.set(i,a.owner):t.has(a.owner)&&s.set(i,a.owner));for(const i of n)!Ve.has(i.type)||!t.has(i.targetId)||o.has(i.targetId)||s.has(i.targetId)||(e(i.sourceId)?o.set(i.targetId,i.sourceId):t.has(i.sourceId)&&s.set(i.targetId,i.sourceId));const c=new Map,l=(i,a)=>{const f=c.get(i)??o.get(i);if(f)return c.set(i,f),f;const p=s.get(i);if(!p||a.has(p))return;a.add(p);const g=l(p,a);return g&&c.set(i,g),g};for(const i of t.keys())l(i,new Set([i]));return{ownerPart:c,parentPort:s}}function jt(t,e,n){if(e==="none")return;if(e==="all")return t;let o=t;const s=new Set([o]);for(;n.has(o);){const c=n.get(o);if(s.has(c))break;s.add(c),o=c}return o}function Xn(t,e,n){const o=new Set,s=c=>{if(!(o.has(c)||!e(c))){o.add(c);for(const l of t.get(c)??[])s(l)}};return s(n),o}function Kn(t,e){const n=e.size??Oe,o=e.pitch??ze,s=e.nestedPitch??et,c=new Map;for(const l of["left","right"]){const i=t.filter(g=>e.sideOf(g)===l),a=i.length,f=Math.max(e.bodyBottom-e.bodyTop,0);let p=-1/0;i.forEach((g,x)=>{var u;let m=a===1&&e.singleCenterY!==void 0?e.singleCenterY:e.bodyTop+(a===1?f/2:(x+.5)/a*f);m=Math.max(m,e.bodyTop+o/2,p+o),p=m+((((u=e.weightOf)==null?void 0:u.call(e,g))??1)-1)*s,c.set(g,{x:l==="left"?-n/2:e.width-n/2,y:m-n/2,side:l})})}return c}function Wt(t,e){for(const n of["left","right"]){const o=[...t].filter(([c,l])=>l.side===n&&e.has(c)).map(([c])=>c);if(o.length<2)continue;const s=o.map(c=>t.get(c).y).sort((c,l)=>c-l);[...o].sort((c,l)=>e.get(c)-e.get(l)).forEach((c,l)=>{t.get(c).y=s[l]})}}async function Qs(t,e){var J;const n=Object.values(t.elements),o=e!=null&&e.viewpointFilter?n.filter(e.viewpointFilter):n,s=new Map,c=[];for(const y of o)hn(y)?s.set(y.id,y):c.push(y);if(c.length===0)return{nodes:[],edges:[]};const l=(e==null?void 0:e.portDisplay)??"all",i=l!=="none",a=rt(c,t.relationships),f=e!=null&&e.focusId&&a.elements.has(e.focusId)?e.focusId:void 0,p=f?Xn(a.childrenMap,y=>a.elements.has(y),f):null,g=y=>a.elements.has(y)&&(!p||p.has(y)),x=y=>{var A;return(A=e==null?void 0:e.collapsedNodes)!=null&&A.has(y)?[]:(a.childrenMap.get(y)??[]).filter(g)},{ownerPart:m,parentPort:u}=Yn(s,g,t.relationships);for(const y of[...s.keys()])m.has(y)||s.delete(y);const h=y=>jt(y,"ports",u),d=new Map;for(const[y,A]of m)!s.has(y)||u.has(y)||(d.has(A)||d.set(A,[]),d.get(A).push(y));const S=new Map;if(l==="all")for(const[y]of u){if(!s.has(y))continue;const A=h(y);!s.has(A)||A===y||(S.has(A)||S.set(A,[]),S.get(A).push(y))}const b=y=>{var A;return 1+(((A=S.get(y))==null?void 0:A.length)??0)},E=(J=e==null?void 0:e.relationshipTypes)!=null&&J.length?new Set(e.relationshipTypes.map(y=>y.toLowerCase())):void 0,M=y=>s.has(y)||g(y),N=t.relationships.filter(y=>!Ve.has(y.type)&&(!E||E.has(y.type.toLowerCase()))&&M(y.sourceId)&&M(y.targetId)&&y.sourceId!==y.targetId),_=new Set;for(const y of N)for(const A of[y.sourceId,y.targetId]){if(!s.has(A))continue;let P=A;for(;P&&!_.has(P);)_.add(P),P=u.get(P)}for(const[y,A]of d)d.set(y,A.filter(P=>_.has(P)));const $=new Set(N.filter(y=>g(y.sourceId)).map(y=>y.sourceId)),W=new Set(N.filter(y=>g(y.targetId)).map(y=>y.targetId)),H=y=>m.get(y)??y,K=new Map;for(const[y,A]of a.childrenMap)for(const P of A)g(P)&&K.set(P,y);const re=new Map,Ie=y=>{const A=re.get(y);if(A)return A;const P=s.get(y);let U=gn(P);if(!U){const z=u.get(y);if(z&&s.has(z))U=Ie(z);else{let se=0,X=0;for(const ee of N)ee.sourceId===y&&se++,ee.targetId===y&&X++;U=zn(P,se,X)}}return re.set(y,U),U},fe=y=>Gn(Ie(y)),Y=y=>({left:y.some(A=>fe(A)==="left")?Lt:Rt,right:y.some(A=>fe(A)==="right")?Lt:Rt}),Ee=y=>Hn(y.name),be=(y,A)=>{const P={left:0,right:0};for(const ae of A)P[fe(ae)]+=ze+(b(ae)-1)*et;const U=Math.max(P.left,P.right,12),z=Math.max(ut+U+10,jn),se=Y(A),X=Math.max(Ee(y),118),ee=Math.max(se.left+X+se.right,Bt),me=Kn(A,{width:ee,bodyTop:ut,bodyBottom:z-Qe/2,sideOf:fe,weightOf:b,singleCenterY:Math.max(z/2,ut+Oe/2)});return{width:ee,height:z,childPos:new Map,portPos:me}},le=new Map,ve=new Map,xe=async y=>{const A=x(y),P=i?d.get(y)??[]:[],U=a.elements.get(y);if(A.length===0){const q=be(U,P);return le.set(y,q),q}const z=new Map;for(const q of A)z.set(q,await xe(q));const se=new Set(A),X=new Set(P),ee=q=>{if(s.has(q)){const j=h(q);if(X.has(j))return j}let oe=H(q);for(;oe&&!se.has(oe);)oe=K.get(oe);return oe},me=(q,oe)=>{var te;if(!s.has(q)||m.get(q)!==oe)return;const j=h(q);return(te=d.get(oe))!=null&&te.includes(j)?j:void 0},ae=[],ke=new Set;N.forEach((q,oe)=>{const j=ee(q.sourceId),te=ee(q.targetId);j&&te&&j!==te&&(ae.push({id:`ic-${oe}`,source:j,target:te,sourcePort:me(q.sourceId,j),targetPort:me(q.targetId,te)}),se.has(j)&&ke.add(j),se.has(te)&&ke.add(te))});const{flowKids:I,orphanKids:C}=$n(A,{isConnected:q=>ke.has(q),hasChildParts:q=>(a.childrenMap.get(q)??[]).some(g),portCount:q=>{var oe;return((oe=d.get(q))==null?void 0:oe.length)??0}}),T=Y(P),V=new Map;let G=0,de=0;if(I.length>0){const q=j=>(d.get(j)??[]).map(te=>({id:te,side:fe(te)})),oe=await Nt({id:`container-${y}`,nodes:I.map(j=>({id:j,width:z.get(j).width,height:z.get(j).height,ports:q(j)})),edges:ae,graphPorts:P.map(j=>({id:j,side:fe(j)})),gapX:54,gapY:58,targetAspect:2.4,layoutProviderId:e==null?void 0:e.layoutProviderId});for(const j of oe.children){const te=j.x+T.left,ce=j.y+Re;V.set(j.id,{x:te,y:ce}),G=Math.max(G,te-T.left+j.width),de=Math.max(de,ce+j.height),j.portY&&Wt(z.get(j.id).portPos,j.portY)}oe.graphPortY&&ve.set(y,new Map([...oe.graphPortY].map(([j,te])=>[j,te+Re])))}if(I.length>0&&ae.length>0){const q=(Re+Math.max(de,Re))/2,oe=new Map(ve.get(y)??[]),j=(ce,ue)=>{if(X.has(ce))return oe.get(ce)??q;const Ae=V.get(ce),he=z.get(ce);if(!Ae||!he)return;const we=ue?he.portPos.get(ue):void 0;return we?Ae.y+we.y+Oe/2:Ae.y+he.height/2},te=ce=>ce.reduce((ue,Ae)=>ue+Ae,0)/ce.length;for(let ce=0;ce<2;ce++){const ue=new Map,Ae=(he,we)=>{he===void 0||we===void 0||(ue.has(he)||ue.set(he,[]),ue.get(he).push(we))};for(const he of ae){const we=j(he.source,he.sourcePort),Fe=j(he.target,he.targetPort);Ae(he.sourcePort??(X.has(he.source)?he.source:void 0),Fe),Ae(he.targetPort??(X.has(he.target)?he.target:void 0),we)}for(const he of I){const we=z.get(he),Fe=new Map;for(const $e of we.portPos.keys()){const Ze=ue.get($e);Ze!=null&&Ze.length&&Fe.set($e,te(Ze))}Fe.size>1&&Wt(we.portPos,Fe)}for(const he of P){const we=ue.get(he);we!=null&&we.length&&oe.set(he,te(we))}}oe.size>0&&ve.set(y,oe)}if(C.length>0){const q=Math.max(...C.map(we=>z.get(we).width)),oe=Math.max(G,q),j=Math.max(1,Math.min(C.length,Math.floor((oe+Ye)/(q+Ye))||1)),te=de>0?de+Ye:Re;let ce=0,ue=te,Ae=0,he=0;for(const we of C){const Fe=z.get(we),$e=T.left+ce*(q+Ye);V.set(we,{x:$e,y:ue}),G=Math.max(G,$e-T.left+Fe.width),Ae=Math.max(Ae,Fe.height),he=Math.max(he,ue+Fe.height),ce++,ce>=j&&(ce=0,ue+=Ae+Ye,Ae=0)}de=Math.max(de,he)}const Se=Math.min(Ee(U)+32,248);let Ne=Math.max(T.left+G+T.right,Se,Bt),Te=Math.max(de+Qe,Re+Qe+8);const Pe=new Map,je=ve.get(y)??new Map;for(const q of["left","right"]){const oe=P.filter(te=>fe(te)===q).sort((te,ce)=>(je.get(te)??0)-(je.get(ce)??0));let j=-1/0;for(const te of oe){const ce=Math.max(Te/2,Re+Oe/2);let ue=je.get(te)??(oe.length===1?ce:Re+ze/2);ue=Math.max(ue,Re+ze/2,j+ze);const Ae=ue+(b(te)-1)*et;j=Ae,Pe.set(te,{x:q==="left"?-Oe/2:Ne-Oe/2,y:ue-Oe/2,side:q}),Te=Math.max(Te,Ae+ze/2+Qe)}}for(const[q,oe]of Pe)oe.side==="right"&&(oe.x=Ne-Oe/2);const Ce={width:Ne,height:Te,childPos:V,portPos:Pe};return le.set(y,Ce),Ce},pe=f?[f]:a.roots.filter(y=>g(y));for(const y of pe)await xe(y);const Me=new Map;if(pe.length===1)Me.set(pe[0],{x:0,y:0});else{const y=X=>{let ee=H(X);const me=new Set;for(;ee&&K.has(ee)&&!me.has(ee);)me.add(ee),ee=K.get(ee);return ee&&pe.includes(ee)?ee:pe.includes(X)?X:ee},A=new Set(pe),P=[],U=(X,ee)=>{var me;if(s.has(X)&&m.get(X)===ee){const ae=h(X),ke=(me=le.get(ee))==null?void 0:me.portPos.get(ae);if(ke)return ke.y+Oe/2}return le.get(ee).height/2};N.forEach((X,ee)=>{const me=y(X.sourceId),ae=y(X.targetId);me&&ae&&me!==ae&&A.has(me)&&A.has(ae)&&P.push({id:`root-${ee}`,source:me,target:ae,sourceAnchorY:U(X.sourceId,me),targetAnchorY:U(X.targetId,ae)})});const z=await Nt({id:"interconnection-roots",nodes:pe.map(X=>({id:X,width:le.get(X).width,height:le.get(X).height})),edges:P,gapX:ft,gapY:ft,directedFlowAxis:"RIGHT",layoutProviderId:e==null?void 0:e.layoutProviderId});for(const X of z.children)Me.set(X.id,{x:X.x,y:X.y});let se=0;for(const X of pe)Me.has(X)||(Me.set(X,{x:se,y:0}),se+=le.get(X).width+ft)}const v=new Map;for(const[y,A]of d){const P=le.get(y);if(!P)continue;const U=[];for(const z of A){const se=P.portPos.get(z);if(!se)continue;const X=s.get(z);U.push({id:z,name:X.name,x:se.x,y:se.y,side:se.side,direction:Dt(X)??Ie(z)});const ee=se.y+Oe/2,me=se.x+(Oe-gt)/2;(S.get(z)??[]).forEach((ae,ke)=>{const I=s.get(ae);U.push({id:ae,name:I.name,x:me,y:ee+et*(ke+1)-gt/2,side:se.side,direction:Dt(I)??Ie(ae),size:gt,nested:!0})})}v.set(y,U)}const R=[],F=new Map,ie=(y,A,P,U={x:0,y:0})=>{var I;const z=a.elements.get(y),se=le.get(y),X=Be[z.layer]||"#64748B",ee=P??Me.get(y),me=A?{x:U.x+ee.x,y:U.y+ee.y}:ee;F.set(y,me);const ae=(a.childrenMap.get(y)??[]).some(g),ke=ae;R.push({id:y,type:"interconnectionNode",position:ee,...A?{parentId:A,extent:"parent"}:{},data:{label:z.name,kind:z.kind,layer:z.layer,color:X,isContainer:ke,isFrame:!A&&ke,hasChildren:ae,isCollapsed:((I=e==null?void 0:e.collapsedNodes)==null?void 0:I.has(y))??!1,onToggleCollapse:ae&&(e!=null&&e.onToggleCollapse)?()=>e.onToggleCollapse(y):void 0,ports:v.get(y)??[],implicitIn:i&&W.has(y),implicitOut:i&&$.has(y),onPortMove:e!=null&&e.onPortMove?(C,T)=>e.onPortMove(y,C,T):void 0},style:{width:se.width,height:se.height}});for(const[C,T]of se.childPos)ie(C,y,T,me)};for(const y of pe)ie(y);const r=(y,A)=>{let P=y;const U=new Set;for(;P&&!U.has(P);){if(P===A)return!0;U.add(P),P=K.get(P)}return!1},w=(y,A)=>{const P=m.get(y),U=H(A);return r(U,P)?`${y}${Ft}`:y},k=y=>s.has(y)?jt(y,l,u):void 0,L=N.flatMap((y,A)=>{const P=k(y.sourceId),U=k(y.targetId),z=s.has(y.sourceId)?m.get(y.sourceId):y.sourceId,se=s.has(y.targetId)?m.get(y.targetId):y.targetId;if(!le.has(z)||!le.has(se))return[];const X=Bn(y.flowItem,y.type),ee=Ln[X],me=y.flowItem||(y.type.toLowerCase()==="exchangeswith"?void 0:y.type),ae=P?w(P,y.targetId):"right",ke=U?w(U,y.sourceId):"left",I=Ce=>Ce==="left"?"right":Ce==="right"?"left":Ce==="top"?"bottom":"top",C=(Ce,q,oe,j)=>{var ce;if(!q)return j;const te=((ce=(v.get(Ce)??[]).find(ue=>ue.id===q))==null?void 0:ce.side)??j;return oe.endsWith(Ft)?I(te):te},T=C(z,P,ae,"right"),V=C(se,U,ke,"left"),G=y.id||`ic-e-${A}`,de=(Ce,q,oe)=>{const j=F.get(Ce),te=le.get(Ce);if(q){const ce=(v.get(Ce)??[]).find(ue=>ue.id===q);if(ce){const ue=ce.size??Oe;return{x:j.x+ce.x+ue/2,y:j.y+ce.y+ue/2}}}return{x:j.x+(oe?te.width:0),y:j.y+te.height/2}},Se=de(z,P,!0),Ne=de(se,U,!1),Te=F.get(z),Pe=F.get(se);return[{edge:{id:G,source:z,target:se,sourceHandle:ae,targetHandle:ke,type:"interconnectionEdge",className:"ibd-interconnection-edge",label:me,animated:y.type==="flow",style:{stroke:ee,strokeWidth:Math.max(2,ne.defaultWidth)},labelStyle:{fontSize:ge.badge,fill:"#4B5563",fontWeight:600},labelBgPadding:ne.labelBgPadding,labelBgBorderRadius:ne.labelBgRadius,labelBgStyle:{...ne.labelBgStyle,fillOpacity:.96,stroke:"#E2E8F0",strokeWidth:1},markerEnd:{type:"arrowclosed",color:ee,width:ne.arrowSize,height:ne.arrowSize},data:{flowCategory:X,sourceOffset:{x:Se.x-Te.x,y:Se.y-Te.y},targetOffset:{x:Ne.x-Pe.x,y:Ne.y-Pe.y},sourcePortId:P,targetPortId:U,sourceSide:T,targetSide:V}},route:{id:G,source:Se,target:Ne,sourceNodeId:z,targetNodeId:se,sourceSide:T,targetSide:V}}]}),D=R.filter(y=>!y.data.isFrame).map(y=>{const A=F.get(y.id),P=le.get(y.id);return{id:y.id,x:A.x,y:A.y,width:P.width,height:P.height}}),Q=qe(L.map(y=>y.route),D),B=it(L.flatMap(({edge:y})=>{const A=Q.get(y.id);return y.label&&A&&A.length>=2?[{id:y.id,points:A,width:ct(String(y.label)),height:at}]:[]}),D),Z=L.map(({edge:y})=>({...y,data:{...y.data,points:Q.get(y.id)??[],labelPoint:B.get(y.id)}}));return{nodes:R,edges:Z}}function Le(t){return t.kind==="ForkNode"||t.kind==="JoinNode"}function eo(t,e){const n=new Set(t.filter(s=>!Le(s)).map(s=>s.id)),o=new Set;for(const s of e.relationships)s.type!=="flow"&&s.type!=="succession"||(n.has(s.sourceId)&&o.add(s.sourceId),n.has(s.targetId)&&o.add(s.targetId));return t.filter(s=>!Le(s)&&!o.has(s.id))}function Un(t,e,n=new Set,o){const s=Object.values(t.elements),l=(e?s.filter(e):s).filter(g=>g.construct==="action"||g.kind==="ActionUsage"||g.kind==="ActionDefinition"),i=l.filter(g=>g.parentAction);if(i.length===0)return l;const a=new Map(l.map(g=>[g.id,g])),f=[],p=g=>{const x=l.filter(m=>m.parentAction===g.id);if(n.has(g.id)&&x.length>0){for(const m of x)p(m);return}f.push(g)};if(o){for(const g of l.filter(x=>x.parentAction===o))p(g);return f}for(const g of i){const x=g.parentAction?a.get(g.parentAction):void 0;x!=null&&x.parentAction||p(g)}return f}function Vn(t,e,n=new Set,o){const s=Object.values(t.elements),l=(e?s.filter(e):s).filter(u=>u.construct==="action"||u.kind==="ActionUsage"||u.kind==="ActionDefinition"),i=[],a=new Map,f=new Map,p=u=>l.filter(h=>h.parentAction===u),g=(u,h)=>{i.push(u),h&&(a.set(u.id,h),f.has(h)||f.set(h,[]),f.get(h).push(u.id));const d=p(u.id);if(!(d.length===0||!n.has(u.id))){f.set(u.id,[]);for(const S of d)g(S,u.id)}};if(o){for(const u of p(o))g(u);return{actions:i,parentOf:a,childrenOf:f}}const x=new Map(l.map(u=>[u.id,u])),m=l.filter(u=>u.parentAction);if(m.length===0)return{actions:l,parentOf:a,childrenOf:f};for(const u of m){const h=u.parentAction?x.get(u.parentAction):void 0;h!=null&&h.parentAction||g(u)}return{actions:i,parentOf:a,childrenOf:f}}function qn(t,e){const n=t.attributes.actionType,o=n?e.elements[n]:void 0,s=((o==null?void 0:o.construct)==="action"?o.parameters:t.parameters)??[];return{inPorts:s.filter(c=>c.direction==="in"||c.direction==="inout").map(c=>c.name),outPorts:s.filter(c=>c.direction==="out"||c.direction==="inout").map(c=>c.name)}}const Ht=["#4A90D9","#E67E22","#2ECC71","#9B59B6","#E74C3C","#1ABC9C","#F39C12","#7B68EE"],mt="Unallocated",Zn="Unstaged";function Et(t,e,n="all"){const o=new Map;for(const a of e.relationships)Ve.has(a.type)&&!o.has(a.targetId)&&o.set(a.targetId,a.sourceId);const s=[t],c=new Set(s);let l=t;for(;o.has(l);){const a=o.get(l);if(c.has(a))break;s.unshift(a),c.add(a),l=a}if(n==="all")return{id:t,level:s.length};const i=Math.min(Math.max(n,1),s.length)-1;return{id:s[i],level:i+1}}function Jn(t,e,n="all"){var s;const o=Et(t,e,n).id;return((s=e.elements[o])==null?void 0:s.name)??o}function to(t,e){const n=[...new Set(t)].map(s=>Et(s,e).level);if(n.length===0)return[];const o=Math.min(...n);return o<=1?[]:Array.from({length:o},(s,c)=>c+1)}function Qn(t,e,n="allocation",o="all"){var i,a;const s=new Map,c=[],l=new Map;for(const f of t){if(Le(f))continue;const p=f.allocatedTo?Et(f.allocatedTo,e,o).id:mt,g=n==="stage"?f.attributes.stage||f.attributes.phase||Zn:p;if(s.set(f.id,g),!l.has(g)){const x={id:g,label:n==="allocation"&&g!==mt?((i=e.elements[g])==null?void 0:i.name)??g:g,color:Ht[l.size%Ht.length],inspectElementId:n==="allocation"&&g!==mt?g:((a=Object.values(e.elements).find(m=>m.id===g||m.name===g))==null?void 0:a.id)??f.id};l.set(g,x),c.push(x)}}return{laneOf:s,lanes:c}}const es=18,ts=36,ns=20,Xe=36,zt=16,Gt=120,pt=32,$t=64,Yt=10;function ss(t,e,n){if(Le(t))return n==="vertical"?{width:$t,height:Yt}:{width:Yt,height:$t};const s=Math.max(e.inPorts.length,e.outPorts.length,0)*es;return{width:Math.max(t.name.length*9+40,140),height:ts+s+(s>0?8:0)+(t.allocatedTo?ns:0)}}function Xt(t){const e=t??"";return/energy|power|voltage|current|thermal|heat/i.test(e)?"energy":/material|fluid|gas|liquid|batch|consumable/i.test(e)?"material":"data"}const yt={control:"#4B5563",data:"#3498DB",energy:"#D97706",material:"#16A34A"};async function no(t,e){var v,R,F,ie;const n=(e==null?void 0:e.nesting)??"flat",o=n==="nested"?Vn(t,e==null?void 0:e.viewpointFilter,e==null?void 0:e.expandedActionIds,e==null?void 0:e.focusActionId):{actions:Un(t,e==null?void 0:e.viewpointFilter,e==null?void 0:e.expandedActionIds,e==null?void 0:e.focusActionId),childrenOf:new Map},s=o.actions;if(s.length===0)return{nodes:[],edges:[]};const c=new Set(s.map(r=>r.id)),{laneOf:l,lanes:i}=Qn(s,t,e==null?void 0:e.laneGrouping,e==null?void 0:e.displayLevel),a=(e==null?void 0:e.direction)??"horizontal",f=n!=="nested"&&((e==null?void 0:e.swimlanes)??!0)&&i.length>=1,p=t.relationships.filter(r=>r.type==="succession"),g=t.relationships.filter(r=>r.type==="flow"),x=new Map;for(const r of n==="nested"?[]:(e==null?void 0:e.expandedActionIds)??[]){const w=Object.values(t.elements).filter(D=>D.parentAction===r);if(w.length===0)continue;const k=((v=p.find(D=>D.sourceId===`${r}__start`))==null?void 0:v.targetId)??w[0].id,L=((R=p.find(D=>D.targetId===`${r}__done`))==null?void 0:R.sourceId)??w[w.length-1].id;x.set(r,{first:k,last:L})}const m=r=>r.map(w=>{var k,L;return{...w,sourceId:((k=x.get(w.sourceId))==null?void 0:k.last)??w.sourceId,targetId:((L=x.get(w.targetId))==null?void 0:L.first)??w.targetId}}),u=m(p),h=m(g),d=new Set;for(const r of u){const w=r.sourceId.endsWith("__start")?r.sourceId.slice(0,-7):void 0,k=r.targetId.endsWith("__done")?r.targetId.slice(0,-6):void 0;w&&!x.has(w)&&c.has(r.targetId)&&d.add(r.sourceId),k&&!x.has(k)&&c.has(r.sourceId)&&d.add(r.targetId)}const S=new Set([...c,...d]),b=h.filter(r=>S.has(r.sourceId)&&S.has(r.targetId)&&(!(e!=null&&e.visibleFlowKinds)||e.visibleFlowKinds.has(Xt(r.flowItem)))),E=new Set(b.map(r=>`${r.sourceId}\0${r.targetId}`)),M=u.filter(r=>S.has(r.sourceId)&&S.has(r.targetId)&&(!(e!=null&&e.visibleFlowKinds)||e.visibleFlowKinds.has("control"))&&!E.has(`${r.sourceId}\0${r.targetId}`)),N=new Map(s.map(r=>[r.id,qn(r,t)])),_=new Map(s.map(r=>[r.id,r])),$=new Map,W=new Map;if(n==="nested"){for(const[r,w]of o.childrenOf)$.set(r,w.filter(k=>S.has(k)));for(const r of d){const w=r.endsWith("__start")?r.slice(0,-7):r.slice(0,-6);$.has(w)&&$.get(w).push(r)}for(const[r,w]of $)for(const k of w)W.set(k,r)}const H=r=>{const w=_.get(r);return w?ss(w,N.get(r),a):{width:28,height:28}},K=r=>{const w=$.get(r)??[];return w.length===0?{id:r,...H(r)}:{id:r,layoutOptions:{"elk.algorithm":"layered","elk.direction":a==="vertical"?"DOWN":"RIGHT","elk.padding":"[top=44,left=24,bottom=24,right=24]","elk.spacing.nodeNode":"36","elk.layered.spacing.nodeNodeBetweenLayers":"68","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"},children:w.map(K)}},re=[...d,...s.map(r=>r.id)].filter(r=>!W.has(r)),Ie={id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":a==="vertical"?"DOWN":"RIGHT","elk.spacing.nodeNode":"40","elk.layered.spacing.nodeNodeBetweenLayers":"80","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.separateConnectedComponents":"true","elk.spacing.componentComponent":"56",...n==="nested"?{"elk.hierarchyHandling":"INCLUDE_CHILDREN"}:{}},children:re.map(K),edges:[...b,...M].map((r,w)=>({id:`afe-${w}`,sources:[r.sourceId],targets:[r.targetId]}))},fe=await Ge.layout(Ie,{providerId:e==null?void 0:e.layoutProviderId}),Y=new Map,Ee=r=>{Y.set(r.id,{x:r.x??0,y:r.y??0,width:r.width??140,height:r.height??56});for(const w of r.children??[])Ee(w)};for(const r of fe.children??[])Ee(r);const be=new Map(i.map(r=>[r.id,r.color])),le=[];if(f&&a==="horizontal"){const r=new Map;for(const Q of s){if(Le(Q))continue;const B=Y.get(Q.id),Z=l.get(Q.id);r.has(Z)||r.set(Z,[]),r.get(Z).push(B.y)}const w=[...i].sort((Q,B)=>{const Z=J=>J.reduce((y,A)=>y+A,0)/J.length;return Z(r.get(Q.id)??[0])-Z(r.get(B.id)??[0])});let k=1/0,L=-1/0;for(const Q of s){const B=Y.get(Q.id);k=Math.min(k,B.x),L=Math.max(L,B.x+B.width)}let D=0;for(const Q of w){const B=s.filter(A=>l.get(A.id)===Q.id);B.sort((A,P)=>Y.get(A.id).x-Y.get(P.id).x||Y.get(A.id).y-Y.get(P.id).y);const Z=Math.min(...B.map(A=>Y.get(A.id).y));let J=0;const y=[];for(const A of B){const P=Y.get(A.id);let U=D+Xe+(P.y-Z);for(const z of y)P.x<z.x1&&P.x+P.width>z.x0&&(U=Math.max(U,z.bottom+16));Y.set(A.id,{...P,y:U}),y.push({x0:P.x,x1:P.x+P.width,bottom:U+P.height}),J=Math.max(J,U+P.height-D)}J+=Xe,le.push({id:`__lane_${Q.id}`,type:"actionFlowLane",position:{x:k-Gt,y:D},data:{label:Q.label,color:Q.color,orientation:"row",inspectElementId:Q.inspectElementId,memberIds:B.map(A=>A.id),isFrame:!0},style:{width:L-k+Gt+Xe,height:J},draggable:!1,selectable:!1,zIndex:-1}),D+=J+zt}}else if(f){let r=1/0,w=-1/0;for(const L of s){const D=Y.get(L.id);r=Math.min(r,D.y),w=Math.max(w,D.y+D.height)}let k=0;for(const L of i){const D=s.filter(Z=>l.get(Z.id)===L.id).sort((Z,J)=>Y.get(Z.id).y-Y.get(J.id).y||Y.get(Z.id).x-Y.get(J.id).x),B=Math.max(...D.map(Z=>Y.get(Z.id).width))+Xe*2;for(const Z of D){const J=Y.get(Z.id);Y.set(Z.id,{...J,x:k+(B-J.width)/2})}le.push({id:`__lane_${L.id}`,type:"actionFlowLane",position:{x:k,y:r-pt},data:{label:L.label,color:L.color,orientation:"column",inspectElementId:L.inspectElementId,memberIds:D.map(Z=>Z.id),isFrame:!0},style:{width:B,height:w-r+pt+Xe},draggable:!1,selectable:!1,zIndex:-1}),k+=B+zt}}const ve=n==="nested"?[]:s.filter(Le);if(ve.length>0)for(const r of ve){const w=Y.get(r.id),k=[];for(const D of[...M,...b]){const Q=D.sourceId===r.id?D.targetId:D.targetId===r.id?D.sourceId:void 0;if(Q===void 0)continue;const B=Y.get(Q);B&&k.push(a==="vertical"?B.x+B.width/2:B.y+B.height/2)}if(k.length===0)continue;const L=k.reduce((D,Q)=>D+Q,0)/k.length;Y.set(r.id,a==="vertical"?{...w,x:L-w.width/2}:{...w,y:L-w.height/2})}for(const r of n==="nested"?[]:d){const w=Y.get(r);if(!w)continue;const k=[];for(const B of M){const Z=B.sourceId===r?B.targetId:B.targetId===r?B.sourceId:void 0;if(!Z)continue;const J=Y.get(Z);J&&k.push(a==="vertical"?J.x+J.width/2:J.y+J.height/2)}if(k.length===0)continue;const L=k.reduce((B,Z)=>B+Z,0)/k.length,D=s.filter(B=>!Le(B)).map(B=>Y.get(B.id)).filter(B=>!!B),Q=r.endsWith("__start");if(a==="vertical"){const B=Math.min(...D.map(J=>J.y)),Z=Math.max(...D.map(J=>J.y+J.height));Y.set(r,{...w,x:L-w.width/2,y:Q?B-w.height-pt-16:Z+24})}else{const B=Math.min(...D.map(J=>J.x)),Z=Math.max(...D.map(J=>J.x+J.width));Y.set(r,{...w,x:Q?B-w.width-24:Z+24,y:L-w.height/2})}}const xe=[...le],pe=r=>{const w=W.get(r);return w?{parentId:w,extent:"parent"}:{}};for(const r of d){const w=Y.get(r),k=r.endsWith("__start"),L={label:k?"Start":"Done",nodeType:k?"start":"done",laneColor:"#374151",layerColor:"#374151",inPorts:[],outPorts:[],flowDirection:a};xe.push({id:r,type:"actionFlowNode",position:{x:w.x,y:w.y},...pe(r),data:L})}for(const r of s){const w=Y.get(r.id);if(Le(r)){const Z={element:r,label:r.name,nodeType:r.kind==="ForkNode"?"fork":"join",laneColor:"#374151",layerColor:"#374151",inPorts:[],outPorts:[],flowDirection:a};xe.push({id:r.id,type:"actionFlowNode",position:{x:w.x,y:w.y},style:{width:w.width,height:w.height},...pe(r.id),data:Z});continue}const k=N.get(r.id),L=l.get(r.id),D=r.allocatedTo?Jn(r.allocatedTo,t,e==null?void 0:e.displayLevel):void 0,Q=(((F=$.get(r.id))==null?void 0:F.length)??0)>0,B={element:r,label:r.name,nodeType:"action",parameters:r.parameters,allocatedTo:D,laneColor:be.get(L)??"#9CA3AF",layerColor:Be[r.layer]||"#FF6B6B",inPorts:k.inPorts,outPorts:k.outPorts,hasChildren:Object.values(t.elements).some(Z=>Z.parentAction===r.id),isExpanded:((ie=e==null?void 0:e.expandedActionIds)==null?void 0:ie.has(r.id))??!1,isFrame:Q,onToggleExpand:e!=null&&e.onToggleAction?()=>e.onToggleAction(r.id):void 0,onDrillIn:e!=null&&e.onDrillInAction?()=>e.onDrillInAction(r.id):void 0,flowDirection:a};xe.push({id:r.id,type:"actionFlowNode",position:{x:w.x,y:w.y},...Q?{style:{width:w.width,height:w.height}}:{},...pe(r.id),data:B})}if(W.size>0){const r=new Map(xe.map(D=>[D.id,D])),w=[],k=new Set,L=D=>{if(k.has(D.id))return;k.add(D.id);const Q=D.parentId?r.get(D.parentId):void 0;Q&&L(Q),w.push(D)};for(const D of xe)L(D);xe.length=0,xe.push(...w)}const Me=[];for(const r of b){const w=Xt(r.flowItem),k=yt[w],L=r.flowItem?/signal|error|status|code|report|alarm|response|command|data|reading/i.test(r.flowItem):!1;Me.push({id:r.id,source:r.sourceId,target:r.targetId,label:void 0,type:"smoothstep",animated:!1,style:{stroke:k,strokeWidth:ne.flowWidth,strokeDasharray:L?"6 3":void 0},labelStyle:{fontSize:ge.badge,fill:k,fontWeight:600},labelBgStyle:ne.labelBgStyle,labelBgPadding:ne.labelBgPadding,labelBgBorderRadius:ne.labelBgRadius,markerEnd:{type:"arrowclosed",color:k,width:ne.arrowSize,height:ne.arrowSize},data:{flowCategory:w,flowItem:r.flowItem}})}for(const r of M)Me.push({id:r.id,source:r.sourceId,target:r.targetId,type:"smoothstep",animated:!1,style:{stroke:yt.control,strokeWidth:1.5},markerEnd:{type:"arrowclosed",color:yt.control,width:12,height:12},data:{flowCategory:"control"}});return{nodes:xe,edges:Me}}function os(t){return t.attributes.sourceState&&t.attributes.targetState?!0:t.kind==="Transition"||t.kind.endsWith("Transition")}function rs(t){return t.kind.endsWith("State")||t.kind.endsWith("Machine")||t.kind.endsWith("Mode")}function is(t,e){const n=Object.values(t.elements),o=e?n.filter(e):n,s=[],c=[],l=[];for(const i of o)os(i)?c.push(i):rs(i)?s.push(i):l.push(i);return{states:s,transitions:c,annotations:l}}const Kt=46;function as(t){return t.length>Kt?`${t.slice(0,Kt-1)}…`:t}function cs(t){const e=t.attributes.trigger??"",n=t.attributes.guardSummary??t.attributes.guard??"",o=n&&!/^none\b/i.test(n),s=e||t.name;return as(o?`${s} [${n}]`:s)}function ls(t,e){const n=new Map;for(const s of e)n.set(s.name,s.id),n.set(s.id,s.id);const o=[];for(const s of t){const c=n.get(s.attributes.sourceState??""),l=n.get(s.attributes.targetState??"");!c||!l||o.push({element:s,sourceId:c,targetId:l,label:cs(s)})}return o}function ds(t,e={}){const n=e.collapsedStateIds??new Set,o=e.focusStateId&&t.elements.has(e.focusStateId)?e.focusStateId:void 0,s=x=>(t.childrenMap.get(x)??[]).filter(m=>t.elements.has(m)),c=o?s(o):[],l=c.length>0?c:t.roots.filter(x=>t.elements.has(x)),i=new Set,a=new Map,f=new Map,p=(x,m)=>{a.set(x,m),f.set(m,(f.get(m)??0)+1);for(const u of s(x))p(u,m)},g=x=>{i.add(x);const m=s(x);if(n.has(x)){for(const u of m)p(u,x);return}for(const u of m)g(u)};for(const x of l)g(x);return{visible:i,liftTo:a,hiddenCount:f,roots:l}}function hs(t,e){const n=s=>e.visible.has(s)?s:e.liftTo.get(s),o=[];for(const s of t){const c=n(s.sourceId),l=n(s.targetId);if(!c||!l)continue;const i=s.sourceId===s.targetId;c===l&&!i||o.push({...s,sourceId:c,targetId:l})}return o}const gs="#FF6B6B",us="#95A5A6",Ut="#64748B";async function so(t,e){const{states:n,transitions:o,annotations:s}=is(t,e==null?void 0:e.viewpointFilter);if(n.length===0&&s.length===0)return{nodes:[],edges:[]};const c=rt(n,t.relationships),l=ds(c,{focusStateId:e==null?void 0:e.focusStateId,collapsedStateIds:e==null?void 0:e.collapsedStateIds}),i=hs(ls(o,n),l);if(l.visible.size===0&&s.length===0)return{nodes:[],edges:[]};const a=b=>({width:Math.max(b.name.length*7.5+56,150),height:(c.childrenMap.get(b.id)??[]).some(E=>c.elements.has(E))?74:54}),f=b=>{const E=c.elements.get(b),M=(c.childrenMap.get(b)??[]).filter(N=>l.visible.has(N));return M.length===0?{id:b,...a(E)}:{id:b,layoutOptions:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.padding":"[top=48,left=28,bottom=28,right=28]","elk.spacing.nodeNode":"72","elk.layered.spacing.nodeNodeBetweenLayers":"120","elk.spacing.edgeNode":"32","elk.edgeRouting":"ORTHOGONAL","elk.layered.cycleBreaking.strategy":"MODEL_ORDER","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"},children:M.map(f)}},p={id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.edgeRouting":"ORTHOGONAL","elk.spacing.nodeNode":"72","elk.layered.spacing.nodeNodeBetweenLayers":"120","elk.spacing.edgeNode":"32","elk.spacing.edgeLabel":"8","elk.layered.cycleBreaking.strategy":"MODEL_ORDER","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES","elk.separateConnectedComponents":"true","elk.spacing.componentComponent":"64","elk.padding":"[top=20, left=20, bottom=20, right=20]"},children:l.roots.map(f),edges:i.map((b,E)=>({id:`st-${E}`,sources:[b.sourceId],targets:[b.targetId]}))},g=await Ge.layout(p,{providerId:e==null?void 0:e.layoutProviderId}),x=[],m=new Map,u=(b,E,M={x:0,y:0})=>{var _,$;const N=c.elements.get(b.id);if(N){const W=!!((_=b.children)!=null&&_.length),H=N.kind.endsWith("Machine"),K={x:M.x+(b.x??0),y:M.y+(b.y??0)};m.set(b.id,{...K,width:b.width??150,height:b.height??54,isContainer:W}),x.push({id:b.id,type:"stateNode",position:{x:b.x??0,y:b.y??0},...E?{parentId:E,extent:"parent"}:{},data:{label:N.name,kind:N.kind,color:gs,isContainer:W,isMachine:H,subtitle:N.attributes.modeKind,hasChildren:(c.childrenMap.get(b.id)??[]).some(re=>c.elements.has(re)),isCollapsed:!!(($=e==null?void 0:e.collapsedStateIds)!=null&&$.has(b.id)),hiddenCount:l.hiddenCount.get(b.id)??0,onToggleCollapse:e!=null&&e.onToggleCollapse?()=>e.onToggleCollapse(b.id):void 0,onDrillIn:e!=null&&e.onDrillIn?()=>e.onDrillIn(b.id):void 0},style:{width:b.width??150,height:b.height??54}});for(const re of b.children??[])u(re,b.id,K);return}};for(const b of g.children??[])u(b);if(s.length>0){let b=0,E=800;for(const W of g.children??[])b=Math.max(b,(W.y??0)+(W.height??0)),E=Math.max(E,(W.x??0)+(W.width??0));const M=240,N=48,_=14,$=Math.max(2,Math.floor(E/(M+_)));s.forEach((W,H)=>{x.push({id:W.id,type:"stateNode",position:{x:H%$*(M+_),y:b+56+Math.floor(H/$)*(N+_)},data:{label:W.name,kind:W.kind,color:us,isNote:!0},style:{width:M,height:N}})})}const h=[...m.entries()].filter(([,b])=>!b.isContainer).map(([b,E])=>({id:b,x:E.x,y:E.y,width:E.width,height:E.height})),d=kn({connectors:i.map((b,E)=>({id:b.element.id||`st-e-${E}`,sourceId:b.sourceId,targetId:b.targetId,label:b.label})),rects:m,obstacles:h,channelGap:26}),S=i.map((b,E)=>{const M=b.element.id||`st-e-${E}`,N=d.get(M),_={id:M,source:b.sourceId,target:b.targetId,label:b.label,style:{stroke:Ut,strokeWidth:ne.defaultWidth},markerEnd:{type:"arrowclosed",color:Ut,width:ne.arrowSize,height:ne.arrowSize}};return N?{..._,type:"interconnectionEdge",data:{points:N.points,labelPoint:N.labelPoint}}:{..._,type:"smoothstep",labelStyle:{fontSize:ge.badge,fill:"#6B7280",fontWeight:500},labelBgPadding:ne.labelBgPadding,labelBgBorderRadius:ne.labelBgRadius,labelBgStyle:ne.labelBgStyle}});return{nodes:x,edges:S}}const fs=/(?:Actor|User)$/,ms=new Set(["UseCase"]),un=new Set(["initiates","participatesin","performs","interactswith","includes","extends"]),_e=t=>t.toLowerCase();function fn(t){return fs.test(t.kind)||t.construct==="actor"}function vt(t){return ms.has(t.kind)||t.construct==="use case"}function oo(t){const e=new Set(Object.values(t.elements).filter(vt).map(s=>s.id)),n=new Map;for(const s of t.relationships.filter(c=>_e(c.type)==="includes"&&e.has(c.sourceId)&&e.has(c.targetId)))n.set(s.targetId,[...n.get(s.targetId)??[],s.sourceId]);const o=(s,c=new Set)=>{if(c.has(s))return 0;const l=n.get(s)??[];return l.length===0?0:1+Math.min(...l.map(i=>o(i,new Set([...c,s]))))};return Math.max(0,...[...e].map(s=>o(s)))}function ro(t){const e=Object.values(t.elements),n=new Set(e.filter(vt).map(s=>s.id)),o=new Set(t.relationships.filter(s=>un.has(_e(s.type))).flatMap(s=>n.has(s.sourceId)?[s.targetId]:n.has(s.targetId)?[s.sourceId]:[]));return e.filter(fn).filter(s=>o.has(s.id)).map(s=>({id:s.id,name:s.name})).sort((s,c)=>s.name.localeCompare(c.name))}function io(t){var s,c;const e=`${(t==null?void 0:t.layoutHint)??""};${(t==null?void 0:t.styleHint)??""}`,n=/(?:usecase:)?level\s*=\s*(all|\d+)/i.exec(e),o=/(?:edge|routing)\s*=\s*(straight|orthogonal|elbow|rounded|curved|arc)/i.exec(e);return{level:(n==null?void 0:n[1])==="all"?"all":n?Number(n[1]):"all",edgeStyle:{orthogonal:"elbow"}[((s=o==null?void 0:o[1])==null?void 0:s.toLowerCase())??""]??((c=o==null?void 0:o[1])==null?void 0:c.toLowerCase())??"straight"}}function ao(t,e={}){const n=Object.values(t.elements).filter(I=>!e.viewpointFilter||e.viewpointFilter(I)),o=n.filter(vt),s=t.relationships.filter(I=>un.has(_e(I.type))),c=new Map;for(const I of s.filter(C=>_e(C.type)==="includes")){const C=c.get(I.targetId)??[];C.push(I.sourceId),c.set(I.targetId,C)}const l=(I,C=new Set)=>{if(C.has(I))return 0;const T=c.get(I)??[];return T.length===0?0:1+Math.min(...T.map(V=>l(V,new Set([...C,I]))))},i=e.level??"all",a=new Set(o.filter(I=>i==="all"||l(I.id)<=i).map(I=>I.id));let f=!0;for(;f;){f=!1;for(const I of s.filter(C=>_e(C.type)==="extends"))if(a.has(I.sourceId)||a.has(I.targetId))for(const C of[I.sourceId,I.targetId])!a.has(C)&&o.some(T=>T.id===C)&&(a.add(C),f=!0)}const p=e.hiddenActorIds??new Set;for(const I of s){const C=a.has(I.sourceId)?I.targetId:a.has(I.targetId)?I.sourceId:void 0;C&&p.has(C)&&(a.delete(I.sourceId),a.delete(I.targetId))}const g=o.filter(I=>a.has(I.id)),x=n.filter(fn).filter(I=>!p.has(I.id)).filter(I=>s.some(C=>C.sourceId===I.id&&a.has(C.targetId)||C.targetId===I.id&&a.has(C.sourceId))),m=new Set([...x,...g].map(I=>I.id));if(g.length===0)return{nodes:[],edges:[]};const u=new Set(s.filter(I=>_e(I.type)==="extends").map(I=>I.sourceId)),h=new Map;for(const I of g){if(u.has(I.id))continue;const C=l(I.id);h.set(C,[...h.get(C)??[],I])}const S=[...h.keys()].sort((I,C)=>I-C).map(I=>[...h.get(I)??[]]);if(S.length===1&&S[0].length>4){const I=S[0],C=Math.min(3,Math.ceil(I.length/4)),T=Math.ceil(I.length/C);S.splice(0,1,...Array.from({length:C},(V,G)=>I.slice(G*T,(G+1)*T)))}const b=new Map;S.forEach((I,C)=>I.forEach(T=>b.set(T.id,C)));const E=new Map;for(const I of s.filter(C=>_e(C.type)==="extends")){const C=g.find(G=>G.id===I.sourceId),T=b.get(I.targetId);if(!C||T===void 0||b.has(C.id))continue;const V=S[T];V.splice(V.findIndex(G=>G.id===I.targetId)+1,0,C),b.set(C.id,T),E.set(I.targetId,[...E.get(I.targetId)??[],C])}const M=new Set([...E.values()].flat().map(I=>I.id)),N=I=>s.filter(C=>C.sourceId===I||C.targetId===I).map(C=>C.sourceId===I?C.targetId:C.sourceId),_=new Map,$=()=>S.forEach(I=>I.forEach((C,T)=>_.set(C.id,T)));$(),x.forEach((I,C)=>_.set(I.id,C));const W=I=>{const C=N(I).map(T=>_.get(T)).filter(T=>T!==void 0);return C.length===0?_.get(I)??0:C.reduce((T,V)=>T+V,0)/C.length};for(let I=0;I<3;I++){const C=I%2===0?S:[...S].reverse();for(const T of C){const V=T.filter(G=>!M.has(G.id));V.sort((G,de)=>W(G.id)-W(de.id)),T.splice(0,T.length,...V.flatMap(G=>[G,...E.get(G.id)??[]])),$()}x.sort((T,V)=>W(T.id)-W(V.id)),x.forEach((T,V)=>_.set(T.id,V))}const H=176,K=88,re=104,Ie=40,fe=104,Y=88,Ee=116,be=48,le=62,ve=44,xe=76,pe=20,Me=Math.max(1,...S.map(I=>I.length)),v=Math.max(520,S.length*H+Math.max(S.length-1,0)*re+be*2),R=Math.max(300,Me*K+(Me-1)*Ie+le+ve),F=I=>be+I*(H+re)+H/2,ie=new Map;for(const I of x){const C=N(I.id).map(V=>b.get(V)).filter(V=>V!==void 0).map(F),T=C.length?C.reduce((V,G)=>V+G,0)/C.length:0;ie.set(I.id,C.length===0||T<=v/2?"left":"right")}const r=x.filter(I=>ie.get(I.id)==="left"),w=x.filter(I=>ie.get(I.id)==="right"),k=pe+(r.length?fe+xe:0),L=pe,D=[{id:"__use_case_boundary__",type:"useCaseBoundary",position:{x:k,y:L},data:{label:e.systemName||"System Boundary",isFrame:!0,kind:"System Boundary"},style:{width:v,height:R},draggable:!1,selectable:!1,zIndex:-1}],Q=new Map,B=L+le,Z=R-le-ve;S.forEach((I,C)=>{const T=I.length*K+(I.length-1)*Ie;let V=B+(Z-T)/2;for(const G of I){const de={x:k+be+C*(H+re),y:V};Q.set(G.id,de),D.push({id:G.id,type:"useCase",position:de,data:{label:G.name,kind:G.kind,color:"#E67E22",level:l(G.id)},style:{width:H,height:K}}),V+=K+Ie}});for(const I of["left","right"]){const T=(I==="left"?r:w).map(G=>{const de=N(G.id).map(Se=>Q.get(Se)).filter(Se=>!!Se).map(Se=>Se.y);return{actor:G,y:de.length?de.reduce((Se,Ne)=>Se+Ne,0)/de.length:L+le}}).sort((G,de)=>G.y-de.y);let V=-1/0;for(const{actor:G,y:de}of T){const Se=Math.max(de,V+Ee-Y,pe);V=Se+Y,D.push({id:G.id,type:"useCaseActor",position:{x:I==="left"?pe:k+v+xe,y:Se},data:{label:G.name,kind:G.kind,color:"#334155",side:I},style:{width:fe,height:Y}})}}const J=e.edgeStyle??"straight",y=s.filter(I=>m.has(I.sourceId)&&m.has(I.targetId)).map(I=>{const C=w.some(G=>G.id===I.sourceId),T=C?I.targetId:I.sourceId,V=C?I.sourceId:I.targetId;return{edge:{id:I.id,source:T,target:V,label:/^(includes|extends)$/.test(_e(I.type))?`«${_e(I.type)}»`:void 0,type:"useCaseEdge",data:{routing:J},style:{stroke:"#64748B",strokeWidth:1.4,strokeDasharray:/^(includes|extends)$/.test(_e(I.type))?"5 4":void 0}},source:T,target:V}}),A=new Map(D.map(I=>[I.id,I])),P=I=>{var C,T;return{width:Number(((C=I.style)==null?void 0:C.width)??150),height:Number(((T=I.style)==null?void 0:T.height)??82)}},U=(I,C)=>{const T=P(A.get(I));return C==="left"?{x:0,y:T.height/2}:C==="right"?{x:T.width,y:T.height/2}:C==="top"?{x:T.width/2,y:0}:{x:T.width/2,y:T.height}},z=(I,C)=>{const T=A.get(I),V=U(I,C);return{x:T.position.x+V.x,y:T.position.y+V.y}},se=y.map(({edge:I,source:C,target:T})=>{var Pe,je;const V=x.find(Ce=>Ce.id===C),G=x.find(Ce=>Ce.id===T),de=!V&&!G&&b.get(C)!==void 0&&b.get(C)===b.get(T),Se=de&&(((Pe=Q.get(C))==null?void 0:Pe.y)??0)<(((je=Q.get(T))==null?void 0:je.y)??0),Ne=V?w.includes(V)?"left":"right":de?Se?"bottom":"top":"right",Te=G?w.includes(G)?"left":"right":de?Se?"top":"bottom":"left";return{id:I.id,source:z(C,Ne),target:z(T,Te),sourceNodeId:C,targetNodeId:T,sourceSide:Ne,targetSide:Te}}),X=D.filter(I=>I.type==="useCase"||I.type==="useCaseActor").map(I=>({id:I.id,x:I.position.x,y:I.position.y,...P(I)})),ee=J==="straight"?new Map:qe(se,X,28),me=it(y.flatMap(({edge:I})=>{const C=ee.get(I.id),T=I.label;return T&&C&&C.length>=2?[{id:I.id,points:C,width:ct(T),height:at}]:[]}),X),ae=new Map(se.map(I=>[I.id,I])),ke=y.map(({edge:I})=>({...I,data:{...I.data,points:ee.get(I.id)??[],labelPoint:me.get(I.id),sourceOffset:U(I.source,ae.get(I.id).sourceSide),targetOffset:U(I.target,ae.get(I.id).targetSide),sourceSide:ae.get(I.id).sourceSide,targetSide:ae.get(I.id).targetSide}}));return{nodes:D,edges:ke}}const Vt=new Set(["includesStep",...Ve]);function qt(t){return t.kind.endsWith("Step")||!!t.attributes.stepOrder}function ps(t){if(!t)return;const e=t.split(":");return(e.length>1?e[e.length-1]:e[0]).trim()||void 0}function ys(t,e){const n=t.split(":")[0].trim(),o=e.elements[n];if(o)return o.name;for(const s of Object.values(e.elements))if(s.attributes.id===n)return s.name;return t}const Zt=t=>{const e=Number(t.attributes.stepOrder);return Number.isFinite(e)?e:0};function xs(t,e){const n=Object.values(t.elements),o=e?n.filter(e):n,s=o.filter(qt),c=new Set(s.map(h=>h.id)),l=o.filter(h=>!qt(h)&&t.relationships.some(d=>Vt.has(d.type)&&d.sourceId===h.id&&c.has(d.targetId))),i=[],a=new Map,f=h=>{const d=h.split(":")[0].trim()||h;return a.has(d)||(a.set(d,i.length),i.push({id:d,label:ys(h,t)})),a.get(d)},p=h=>[...h].sort((d,S)=>Zt(d)-Zt(S)).map(d=>({step:d,lane:f(d.attributes.allocatedFunction??d.allocatedTo??d.id),item:ps(d.attributes.exchangeItem)})),g=h=>{var S;const d=t.relationships.find(b=>b.type==="realizesScenario"&&b.sourceId===h.id);return d?(S=t.elements[d.targetId])==null?void 0:S.name:void 0},x=new Set,m=[];for(const h of l){const d=t.relationships.filter(S=>Vt.has(S.type)&&S.sourceId===h.id&&c.has(S.targetId)).map(S=>t.elements[S.targetId]);for(const S of d)x.add(S.id);m.push({chain:h,scenario:g(h),occurrences:p(d)})}const u=s.filter(h=>!x.has(h.id));return u.length>0&&m.push({occurrences:p(u)}),{lifelines:i,sections:m.filter(h=>h.occurrences.length>0)}}const Ke=240,ws=52,Is=68,bs=40,Ss=24,Jt=14;function co(t,e){const n=xs(t,e==null?void 0:e.viewpointFilter);if(n.lifelines.length===0)return{nodes:[],edges:[]};const o=[],s=[],c=p=>p*Ke+Ke/2;let l=ws+28;const i=[];for(const p of n.sections){const g=l;l+=bs;const x=p.occurrences.map(m=>{const u={...m,y:l};return l+=Is,u});i.push({section:p,top:g,bottom:l,placed:x}),l+=Ss}const a=l,f=n.lifelines.length*Ke;return n.lifelines.forEach((p,g)=>{o.push({id:`__lifeline_${p.id}`,type:"seqLifeline",position:{x:g*Ke,y:0},data:{label:p.label},style:{width:Ke,height:a},draggable:!1,selectable:!1,zIndex:-2})}),i.forEach(({section:p,top:g,bottom:x,placed:m},u)=>{var h;o.push({id:`__section_${u}`,type:"seqSection",position:{x:-24,y:g},data:{label:((h=p.chain)==null?void 0:h.name)??"Steps",scenario:p.scenario},style:{width:f+48,height:x-g},draggable:!1,selectable:!1,zIndex:-1}),m.forEach((d,S)=>{if(o.push({id:d.step.id,type:"seqOccurrence",position:{x:c(d.lane)-Jt/2,y:d.y-Jt/2},data:{label:d.step.name,kind:d.step.kind},draggable:!1,zIndex:2}),S<m.length-1){const b=m[S+1],E=b.lane>=d.lane,M=b.lane===d.lane;s.push({id:`seq-${u}-${S}`,source:d.step.id,target:b.step.id,sourceHandle:M||E?"right":"left",targetHandle:M?"right":E?"left":"right",type:M?"smoothstep":"straight",label:d.item,style:{stroke:"#3498DB",strokeWidth:ne.flowWidth},labelStyle:{fontSize:ge.badge,fill:"#4A90D9",fontWeight:600},labelBgPadding:ne.labelBgPadding,labelBgBorderRadius:ne.labelBgRadius,labelBgStyle:ne.labelBgStyle,markerEnd:{type:"arrowclosed",color:"#3498DB",width:ne.arrowSize,height:ne.arrowSize},zIndex:1})}})}),{nodes:o,edges:s}}const Ms=new Set(["interactswith","exchangeswith","appliesincontext","connectsphysically"]),Qt=/(?:Actor|User)$/,en=t=>t.toLowerCase(),tn=t=>t.kind==="UseContext"||/environment|context/i.test(t.name)||/environment/i.test(String(t.attributes.entityKind??"")),Es=t=>/systemofinterest|system-of-interest/i.test(String(t.attributes.contextRole??""))||String(t.attributes.isSystemOfInterest??"").toLowerCase()==="true",Ue=76,mn=170,vs=238,nn=30,sn=104,xt=240,wt=108,It=92,bt=74,St=40,on=t=>Math.min(Math.max(t.length*7.4+28,mn),vs);function ks(t,e,n){const o=new Map,s=[];for(const c of t){const l=e.some(a=>a.sourceId===c&&a.targetId===n),i=e.some(a=>a.sourceId===n&&a.targetId===c);l&&!i?o.set(c,"left"):i&&!l?o.set(c,"right"):s.push(c)}for(const c of s){const l=[...o.values()].filter(a=>a==="left").length,i=o.size-l;o.set(c,l<=i?"left":"right")}return o}function lo(t,e){var Me;const n=Object.values(t.elements),o=t.relationships.filter(v=>Ms.has(en(v.type))),s=new Set(o.flatMap(v=>[v.sourceId,v.targetId])),c=n.filter(v=>s.has(v.id)&&!hn(v));if(c.length===0)return{nodes:[],edges:[]};const l=v=>o.filter(R=>R.sourceId===v.id||R.targetId===v.id).length,i=c.find(Es)??c.find(v=>/system/i.test(v.name))??[...c].sort((v,R)=>l(R)-l(v))[0],a=c.filter(v=>v.id!==i.id),f=new Set([i.id,...a.map(v=>v.id)]),p=o.filter(v=>f.has(v.sourceId)&&f.has(v.targetId)),g=ks(a.map(v=>v.id),p,i.id),x=v=>Qt.test(v.kind)?0:tn(v)?1:2,m=v=>a.filter(R=>g.get(R.id)===v).sort((R,F)=>x(R)-x(F)||R.name.localeCompare(F.name)),u={left:m("left"),right:m("right")},h=v=>v.length===0?0:v.length*Ue+(v.length-1)*nn,d=v=>v.length===0?0:Math.max(...v.map(R=>on(R.name))),S=xt+It*2,b=wt+bt*2,E=St+Math.max(b,h(u.left),h(u.right))/2,M=d(u.left),N=St+(M>0?M+sn:0),_=E-b/2,$=N+S+sn,W=[{id:"__context_boundary__",type:"contextBoundary",position:{x:N,y:_},data:{label:`${e??i.name} — System Boundary`,isFrame:!0},style:{width:S,height:b},draggable:!1,selectable:!1,zIndex:-1},{id:i.id,type:"contextSystem",position:{x:N+It,y:_+bt},data:{label:i.name,kind:i.kind},style:{width:xt,height:wt}}],H=new Map;for(const v of["left","right"]){const R=u[v];let F=E-h(R)/2;for(const ie of R){const r=on(ie.name),w=v==="left"?St+M-r:$;H.set(ie.id,{x:w,y:F,width:r,height:Ue,side:v}),W.push({id:ie.id,type:"contextExternal",position:{x:w,y:F},data:{label:ie.name,kind:ie.kind,category:tn(ie)?"environment":Qt.test(ie.kind)?"person":"system"},style:{width:r,height:Ue}}),F+=Ue+nn}}const K={x:N+It,y:_+bt,width:xt,height:wt},re={left:[],right:[]};for(const v of p){const R=v.sourceId===i.id?v.targetId:v.sourceId;if(v.sourceId!==i.id&&v.targetId!==i.id)continue;const F=(Me=H.get(R))==null?void 0:Me.side;F&&!re[F].includes(v.id)&&re[F].push(v.id)}for(const v of["left","right"])re[v].sort((R,F)=>{const ie=r=>{var k;const w=p.find(L=>L.id===r);return((k=H.get(w.sourceId===i.id?w.targetId:w.sourceId))==null?void 0:k.y)??0};return ie(R)-ie(F)});const Ie=(v,R)=>{const F=re[R],ie=Math.max(F.indexOf(v),0);return{x:R==="left"?K.x:K.x+K.width,y:K.y+K.height*(ie+.5)/Math.max(F.length,1)}},fe=(v,R)=>{const F=H.get(v);return{x:R==="left"?F.x:F.x+F.width,y:F.y+F.height/2}},Y=(v,R)=>{var r;if(v===i.id)return((r=H.get(R))==null?void 0:r.side)==="right"?"right":"left";const F=H.get(v);return(R===i.id?K:H.get(R)).x+(R===i.id?K.width:H.get(R).width)/2>=F.x+F.width/2?"right":"left"},Ee=p.map(v=>{const R=Y(v.sourceId,v.targetId),F=Y(v.targetId,v.sourceId),ie=(r,w)=>r===i.id?Ie(v.id,w):fe(r,w);return{rel:v,sourceSide:R,targetSide:F,source:ie(v.sourceId,R),target:ie(v.targetId,F)}}),be=W.filter(v=>!v.data.isFrame).map(v=>{var R,F;return{id:v.id,x:v.position.x,y:v.position.y,width:Number(((R=v.style)==null?void 0:R.width)??mn),height:Number(((F=v.style)==null?void 0:F.height)??Ue)}}),le=qe(Ee.map(v=>({id:v.rel.id,source:v.source,target:v.target,sourceNodeId:v.rel.sourceId,targetNodeId:v.rel.targetId,sourceSide:v.sourceSide,targetSide:v.targetSide})),be,24),ve=new Map(Ee.map(v=>[v.rel.id,`«${en(v.rel.type)}»`])),xe=it(Ee.flatMap(v=>{const R=le.get(v.rel.id),F=ve.get(v.rel.id);return R&&R.length>=2?[{id:v.rel.id,points:R,width:ct(F),height:at}]:[]}),be),pe=Ee.map(v=>{const R=(F,ie,r)=>{const w=F===i.id?K:H.get(F);return{x:r.x-w.x,y:r.y-w.y,side:ie}};return{id:v.rel.id,source:v.rel.sourceId,target:v.rel.targetId,type:"useCaseEdge",label:ve.get(v.rel.id),style:{stroke:"#0F766E",strokeWidth:1.5},data:{routing:"rounded",points:le.get(v.rel.id)??[v.source,v.target],labelPoint:xe.get(v.rel.id),sourceSide:v.sourceSide,targetSide:v.targetSide,sourceOffset:R(v.rel.sourceId,v.sourceSide,v.source),targetOffset:R(v.rel.targetId,v.targetSide,v.target)}}});return{nodes:W,edges:pe}}const Cs=new Set(["name","title","description","shortDescription","longDescription","sourceReference","rationaleText","semantics","queryDescription","dataSourceDescription","doc"]),As=7,Mt=80;function Os(t,e){const n=t.attributes[e];return n===void 0?void 0:(n.includes("::")?n.split("::").pop().trim():n)||void 0}function Ns(t){const e=new Map;for(const n of t)for(const o of Object.keys(n.attributes))Cs.has(o)||o.includes(".")||e.set(o,(e.get(o)??0)+1);return[...e.entries()].sort((n,o)=>o[1]-n[1]).slice(0,As).map(([n])=>n)}function Ts(t){const e=new Map;for(const o of t)e.has(o.kind)||e.set(o.kind,[]),e.get(o.kind).push(o);const n=[];for(const[o,s]of e){const c=Ns(s),l=s.map(a=>({element:a,values:c.map(f=>Os(a,f))})),i=c.map((a,f)=>{const p=l.map(g=>g.values[f]).filter(g=>g!==void 0);return p.length>0&&p.every(g=>Number.isFinite(Number(g)))});n.push({kind:o,columns:c,numeric:i,rows:l})}return n.sort((o,s)=>s.rows.length-o.rows.length)}function _s(t,e,n){const o=n==="asc"?1:-1;return[...t.rows].sort((c,l)=>{if(e<0)return c.element.name.localeCompare(l.element.name)*o;const i=c.values[e],a=l.values[e];return i===void 0&&a===void 0?0:i===void 0?1:a===void 0?-1:t.numeric[e]?(Number(i)-Number(a))*o:i.localeCompare(a)*o})}function Ps(t,e,n){const o=new Map(t.map(g=>[g.id,g])),s=n!=null&&n.length?new Set(n.map(g=>g.toLowerCase())):void 0,c=e.filter(g=>o.has(g.sourceId)&&o.has(g.targetId)&&g.sourceId!==g.targetId&&(!s||s.has(g.type.toLowerCase())));if(c.length===0)return;const l=new Set,i=new Set,a=new Map,f=new Set;for(const g of c){l.add(g.sourceId),i.add(g.targetId),f.add(g.type);const x=`${g.sourceId}|${g.targetId}`;a.has(x)||a.set(x,[]),a.get(x).includes(g.type)||a.get(x).push(g.type)}const p=(g,x)=>g.kind.localeCompare(x.kind)||g.name.localeCompare(x.name);return{rows:[...l].map(g=>o.get(g)).sort(p),cols:[...i].map(g=>o.get(g)).sort(p),cells:a,relTypes:[...f].sort()}}const st={padding:"6px 10px",fontSize:ge.xs,fontWeight:600,color:"#374151",textAlign:"left",borderBottom:"2px solid #E5E5E0",background:"#FAFAF8",position:"sticky",top:0,cursor:"pointer",whiteSpace:"nowrap",userSelect:"none"},ot={padding:"5px 10px",fontSize:ge.xs,color:"#374151",borderBottom:"1px solid #F0F0ED",verticalAlign:"top"};function Fs(t){return t.length>Mt?`${t.slice(0,Mt-1)}…`:t}function Ds({section:t,search:e}){var g;const n=nt(x=>x.selectElement),[o,s]=ye.useState(-1),[c,l]=ye.useState("asc"),i=ye.useMemo(()=>{const x=_s(t,o,c);if(!e)return x;const m=e.toLowerCase();return x.filter(u=>u.element.name.toLowerCase().includes(m)||u.values.some(h=>h==null?void 0:h.toLowerCase().includes(m)))},[t,o,c,e]);if(i.length===0)return null;const a=Be[(g=t.rows[0])==null?void 0:g.element.layer]||"#6B7280",f=x=>{o===x?l(m=>m==="asc"?"desc":"asc"):(s(x),l("asc"))},p=x=>o===x?c==="asc"?" ↑":" ↓":"";return O.jsxs("div",{style:{marginBottom:28},children:[O.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[O.jsx("span",{style:{width:8,height:8,borderRadius:2,background:a,display:"inline-block"}}),O.jsx("span",{style:{fontSize:ge.sm,fontWeight:700,color:"#1B3A4B"},children:t.kind}),O.jsx("span",{style:{fontSize:ge.xs,color:"#9CA3AF"},children:i.length})]}),O.jsxs("table",{style:{borderCollapse:"collapse",width:"100%",background:"#FFFFFF",borderRadius:8,overflow:"hidden",border:"1px solid #E5E5E0"},children:[O.jsx("thead",{children:O.jsxs("tr",{children:[O.jsxs("th",{style:st,onClick:()=>f(-1),children:["Element",p(-1)]}),t.columns.map((x,m)=>O.jsxs("th",{style:st,onClick:()=>f(m),children:[x,p(m)]},x))]})}),O.jsx("tbody",{children:i.map(x=>O.jsxs("tr",{onMouseEnter:m=>{m.currentTarget.style.background="#F7F7F5"},onMouseLeave:m=>{m.currentTarget.style.background="transparent"},children:[O.jsx("td",{style:{...ot,whiteSpace:"nowrap"},children:O.jsx("button",{onClick:()=>n(x.element.id),style:{background:"none",border:"none",padding:0,fontSize:ge.xs,fontWeight:600,color:"#1B6FD9",cursor:"pointer",textDecoration:"none"},title:"Open element detail",children:x.element.name})}),x.values.map((m,u)=>O.jsx("td",{style:ot,title:m&&m.length>Mt?m:void 0,children:m?Fs(m):O.jsx("span",{style:{color:"#D1D5DB"},children:"—"})},u))]},x.element.id))})]})]})}function Rs({elements:t,model:e,relationshipTypes:n}){const o=nt(l=>l.selectElement),s=ye.useMemo(()=>Ps(t,e.relationships,n),[t,e.relationships,n]);if(!s)return O.jsx("div",{style:{color:"#9CA3AF",fontSize:ge.sm,padding:24},children:"No relationships among this view's elements."});const c=(l,i=!1)=>O.jsx("button",{onClick:()=>o(l.id),style:{background:"none",border:"none",padding:0,cursor:"pointer",fontSize:"10px",fontWeight:600,color:"#374151",...i?{writingMode:"vertical-rl",transform:"rotate(180deg)",maxHeight:120}:{},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},title:`${l.kind} · open detail`,children:l.name});return O.jsxs("div",{children:[O.jsx("div",{className:"flex gap-3 mb-2",style:{fontSize:ge.xs,color:"#6B7280"},children:s.relTypes.map(l=>O.jsxs("span",{className:"flex items-center gap-1",children:[O.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:He[l]||"#6B7280",display:"inline-block"}}),l]},l))}),O.jsxs("table",{style:{borderCollapse:"collapse",background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[O.jsx("thead",{children:O.jsxs("tr",{children:[O.jsx("th",{style:{...st,cursor:"default"}}),s.cols.map(l=>O.jsx("th",{style:{...st,cursor:"default",verticalAlign:"bottom",padding:"8px 4px"},children:c(l,!0)},l.id))]})}),O.jsx("tbody",{children:s.rows.map(l=>O.jsxs("tr",{children:[O.jsx("td",{style:{...ot,whiteSpace:"nowrap",background:"#FAFAF8"},children:c(l)}),s.cols.map(i=>{const a=s.cells.get(`${l.id}|${i.id}`);return O.jsx("td",{style:{...ot,textAlign:"center",padding:"4px 6px"},title:a==null?void 0:a.join(", "),children:a==null?void 0:a.map(f=>O.jsx("span",{style:{width:9,height:9,borderRadius:"50%",margin:1,background:He[f]||"#6B7280",display:"inline-block"}},f))},i.id)})]},l.id))})]})]})}function ho({diagram:t,model:e,viewpointFilter:n}){const[o,s]=ye.useState("table"),[c,l]=ye.useState(""),i=ye.useMemo(()=>{const p=Object.values(e.elements);return n?p.filter(n):p},[e,n]),a=ye.useMemo(()=>Ts(i),[i]),f=rn.grid;return O.jsx("div",{className:"flex-1 overflow-auto",style:{background:"#F7F7F5"},children:O.jsxs("div",{style:{padding:"16px 20px",maxWidth:1240},children:[O.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[O.jsx("span",{className:"px-1.5 py-0.5 rounded font-semibold",style:{background:f.color+"20",color:f.color,fontSize:ge.badge},title:f.fullName,children:f.label}),O.jsx("span",{style:{fontSize:ge.md,fontWeight:700,color:"#1a1a1a"},children:t.name}),O.jsxs("span",{style:{fontSize:ge.xs,color:"#9CA3AF"},children:[i.length," elements"]}),O.jsx("div",{className:"flex rounded overflow-hidden ml-2",style:{border:"1px solid #E5E5E0"},children:["table","matrix"].map(p=>O.jsx("button",{onClick:()=>s(p),className:"px-2 py-0.5 text-xs font-medium capitalize",style:{background:o===p?"#1B3A4B":"#FFFFFF",color:o===p?"#FFFFFF":"#6B7280",border:"none",cursor:"pointer"},children:p},p))}),o==="table"&&O.jsx("input",{value:c,onChange:p=>l(p.target.value),placeholder:"Filter rows…",className:"px-2 py-1 rounded focus:outline-none ml-auto",style:{fontSize:ge.xs,border:"1px solid #E5E5E0",background:"#FFFFFF",color:"#1a1a1a",width:200}})]}),o==="table"?a.map(p=>O.jsx(Ds,{section:p,search:c},p.kind)):O.jsx(Rs,{elements:i,model:e,relationshipTypes:t.relationshipTypes}),o==="table"&&a.length===0&&O.jsx("div",{style:{color:"#9CA3AF",fontSize:ge.sm,padding:24},children:"This view selects no elements."})]})})}const Ls=8;function pn(t,e,n){const o=(e.get(t.id)??[]).filter(s=>n.has(s)).map(s=>pn(n.get(s),e,n));return o.sort(tt),{id:t.id,label:t.name,element:t,kind:t.kind,layer:t.layer,children:o,count:1+o.reduce((s,c)=>s+c.count,0)}}const tt=(t,e)=>(t.kind??"").localeCompare(e.kind??"")||t.label.localeCompare(e.label);function Bs(t,e){const n=rt(t,e),o=new Map,s=[];for(const c of n.roots){const l=n.elements.get(c),i=pn(l,n.childrenMap,n.elements),a=l.package;if(!a){s.push(i);continue}if(!o.has(a)){const p=a.split("::").pop()??a,g={id:`pkg:${a}`,label:p,title:a,children:[],count:0};o.set(a,g),s.push(g)}const f=o.get(a);f.children.push(i),f.count+=i.count}for(const c of o.values()){const l=new Set(c.children.map(a=>a.kind));if(c.children.length<=Ls||l.size<=1){c.children.sort(tt);continue}const i=new Map;for(const a of c.children){const f=a.kind??"—";i.has(f)||i.set(f,[]),i.get(f).push(a)}c.children=[...i.entries()].sort((a,f)=>a[0].localeCompare(f[0])).map(([a,f])=>{var p;return{id:`kind:${c.id}:${a}`,label:a,kind:a,layer:(p=f[0])==null?void 0:p.layer,children:f.sort(tt),count:f.reduce((g,x)=>g+x.count,0)}})}return s.sort(tt),s}function js(t,e){const n=e.trim().toLowerCase();if(!n)return;const o=new Set,s=new Set,c=(l,i)=>{const a=l.label.toLowerCase().includes(n)||(l.kind??"").toLowerCase().includes(n);let f=!1;for(const p of l.children)c(p,[...i,l.id])&&(f=!0);if(a||f){o.add(l.id);for(const p of i)o.add(p),s.add(p);return f&&s.add(l.id),!0}return!1};for(const l of t)c(l,[]);return{visible:o,expanded:s}}function Ws(t){if(!t)return"·";const e=t.replace(/[^A-Za-z]/g,"").match(/[A-Z]/g);return e&&e.length>=2?e.slice(0,2).join(""):t.slice(0,2).toUpperCase()}const Hs=26;function yn({node:t,depth:e,expanded:n,visible:o,forceExpanded:s,onToggle:c}){const l=nt(m=>m.selectElement),i=nt(m=>m.selectedElementId);if(o&&!o.has(t.id))return null;const a=n.has(t.id)||!!(s!=null&&s.has(t.id)),f=t.children.length>0,p=!t.element,g=Be[t.layer??""]||"#95A5A6",x=t.element&&t.id===i;return O.jsxs(O.Fragment,{children:[O.jsxs("div",{className:"flex items-center gap-1.5",style:{height:Hs,paddingLeft:8+e*18,cursor:"pointer",background:x?"#2DD4A818":void 0,borderRadius:6},onMouseEnter:m=>{x||(m.currentTarget.style.background="#F0F0ED")},onMouseLeave:m=>{m.currentTarget.style.background=x?"#2DD4A818":"transparent"},onClick:()=>{f&&c(t.id),t.element&&l(t.id)},title:t.title??t.kind,children:[O.jsx("span",{style:{width:12,textAlign:"center",flexShrink:0,fontSize:"9px",color:"#9CA3AF",transform:a?"rotate(90deg)":"none",transition:"transform 120ms ease",visibility:f?"visible":"hidden"},children:"▶"}),p?O.jsx("span",{style:{fontSize:"10px",flexShrink:0},children:t.id.startsWith("pkg:")?"📦":"▣"}):O.jsx("span",{style:{flexShrink:0,width:20,height:16,borderRadius:4,background:g+"22",color:g,fontSize:"8px",fontWeight:800,display:"inline-flex",alignItems:"center",justifyContent:"center",letterSpacing:"0.02em"},title:t.kind,children:Ws(t.kind)}),O.jsx("span",{style:{fontSize:ge.xs,fontWeight:p?700:500,color:p?"#1B3A4B":"#374151",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.label}),f&&O.jsx("span",{style:{fontSize:"9px",color:"#9CA3AF"},children:t.count})]}),a&&t.children.map(m=>O.jsx(yn,{node:m,depth:e+1,expanded:n,visible:o,forceExpanded:s,onToggle:c},m.id))]})}function go({diagram:t,model:e,viewpointFilter:n}){const[o,s]=ye.useState(new Set),[c,l]=ye.useState(""),i=ye.useMemo(()=>{const u=Object.values(e.elements);return n?u.filter(n):u},[e,n]),a=ye.useMemo(()=>Bs(i,e.relationships),[i,e.relationships]),f=ye.useMemo(()=>js(a,c),[a,c]),p=ye.useCallback(u=>{s(h=>{const d=new Set(h);return d.has(u)?d.delete(u):d.add(u),d})},[]),g=ye.useCallback((u,h)=>{for(const d of u)d.children.length>0&&(h.add(d.id),g(d.children,h));return h},[]),x=rn.browser,m=i.length;return O.jsx("div",{className:"flex-1 overflow-auto",style:{background:"#F7F7F5"},children:O.jsxs("div",{style:{padding:"16px 20px",maxWidth:860},children:[O.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[O.jsx("span",{className:"px-1.5 py-0.5 rounded font-semibold",style:{background:x.color+"20",color:x.color,fontSize:ge.badge},title:x.fullName,children:x.label}),O.jsx("span",{style:{fontSize:ge.md,fontWeight:700,color:"#1a1a1a"},children:t.name}),O.jsxs("span",{style:{fontSize:ge.xs,color:"#9CA3AF"},children:[m," elements"]}),O.jsx("button",{onClick:()=>s(g(a,new Set)),className:"px-2 py-0.5 text-xs font-medium rounded ml-2",style:{background:"#FFFFFF",color:"#374151",border:"1px solid #E5E5E0",cursor:"pointer"},children:"Expand All"}),O.jsx("button",{onClick:()=>s(new Set),className:"px-2 py-0.5 text-xs font-medium rounded",style:{background:"#FFFFFF",color:"#374151",border:"1px solid #E5E5E0",cursor:"pointer"},children:"Collapse All"}),O.jsx("input",{value:c,onChange:u=>l(u.target.value),placeholder:"Filter by name or kind…",className:"px-2 py-1 rounded focus:outline-none ml-auto",style:{fontSize:ge.xs,border:"1px solid #E5E5E0",background:"#FFFFFF",color:"#1a1a1a",width:220}})]}),O.jsxs("div",{style:{background:"#FFFFFF",border:"1px solid #E5E5E0",borderRadius:10,padding:"10px 8px"},children:[a.length===0&&O.jsx("div",{style:{color:"#9CA3AF",fontSize:ge.sm,padding:16},children:"This view selects no elements."}),a.map(u=>O.jsx(yn,{node:u,depth:0,expanded:o,visible:f==null?void 0:f.visible,forceExpanded:f==null?void 0:f.expanded,onToggle:p},u.id)),f&&a.every(u=>!f.visible.has(u.id))&&O.jsxs("div",{style:{color:"#9CA3AF",fontSize:ge.sm,padding:16},children:["No matches for “",c,"”."]})]})]})})}function uo({x:t,y:e,sourceElement:n,targetElement:o,registries:s,onSelect:c,onCancel:l}){const i=ye.useRef(null),[a,f]=ye.useState(""),p=ye.useRef(null);ye.useEffect(()=>{var S;(S=p.current)==null||S.focus()},[]),ye.useEffect(()=>{const S=b=>{i.current&&!i.current.contains(b.target)&&l()};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[l]),ye.useEffect(()=>{const S=b=>{b.key==="Escape"&&l()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[l]);const g=ye.useMemo(()=>xn(n,o,s),[n,o,s]),x=ye.useMemo(()=>{const S=a.trim().toLowerCase();return S?g.filter(b=>b.definition.label.toLowerCase().includes(S)||b.definition.name.toLowerCase().includes(S)):g},[g,a]),m=260,u=320,h=Math.min(t,window.innerWidth-m-8),d=Math.min(e,window.innerHeight-u-8);return O.jsxs("div",{ref:i,className:"fixed z-50 flex flex-col shadow-xl rounded-xl overflow-hidden",style:{left:h,top:d,width:m,maxHeight:u,background:"#FFFFFF",border:"1px solid #E5E5E0",boxShadow:"0 8px 32px rgba(0,0,0,0.16)"},children:[O.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid #E5E5E0",flexShrink:0},children:[O.jsx("div",{style:{fontSize:ge.xs,fontWeight:600,color:"#374151",marginBottom:4},children:"Relationship Type"}),O.jsxs("div",{style:{fontSize:"10px",color:"#9CA3AF",marginBottom:4},children:[n.kind," → ",o.kind]}),O.jsx("input",{ref:p,value:a,onChange:S=>f(S.target.value),placeholder:"Search…","aria-label":"Search relationship types",className:"w-full px-2 py-1 rounded focus:outline-none",style:{fontSize:ge.xs,background:"#F7F7F5",border:"1px solid #E5E5E0",color:"#374151"}})]}),O.jsxs("div",{className:"flex-1 overflow-y-auto py-1",children:[x.map(S=>{const{definition:b,direction:E,sourceId:M,targetId:N}=S,_=E==="incoming";return O.jsxs("button",{onClick:()=>c({type:b.name,sourceId:M,targetId:N,direction:E}),className:"w-full flex items-center gap-2.5 px-3 py-1.5 text-left",style:{background:"none",border:"none",cursor:"pointer"},onMouseEnter:$=>{$.currentTarget.style.background="#F7F7F5"},onMouseLeave:$=>{$.currentTarget.style.background="none"},children:[O.jsx("div",{style:{width:10,height:10,borderRadius:"50%",flexShrink:0,background:He[b.name]??"#6B7280"}}),O.jsxs("div",{style:{minWidth:0},children:[O.jsxs("div",{style:{fontSize:ge.xs,fontWeight:500,color:"#1a1a1a"},children:[b.label,_&&O.jsx("span",{style:{color:"#9CA3AF",fontWeight:400},children:" (reversed)"})]}),O.jsxs("div",{className:"truncate",style:{fontSize:"10px",color:"#9CA3AF"},children:[b.sourceEnd.name," → ",b.targetEnd.name]})]})]},`${b.name}-${E}`)}),x.length===0&&O.jsx("div",{className:"p-3 text-center",style:{color:"#9CA3AF",fontSize:ge.xs},children:g.length===0?`The ontology defines no relationship between a ${n.kind} and a ${o.kind}.`:"No matching types"})]})]})}function fo(t){var e,n,o;return((o=(n=(e=t)==null?void 0:e.canvas)==null?void 0:n.layout)==null?void 0:o.provider)??In}export{qe as A,go as B,Ve as C,Us as G,Js as I,Zs as P,uo as R,_n as a,Pn as b,Ks as c,ao as d,lo as e,Qs as f,no as g,so as h,co as i,qs as j,Tn as k,Ft as l,ro as m,to as n,eo as o,rs as p,io as q,Vs as r,fo as s,Rn as t,oo as u,Xs as v,Fn as w,dn as x,ho as y,Ln as z};
|
|
@@ -6,4 +6,4 @@ var se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var H;function te(){if(H)return r;H=1;var o=Symbol.for("react.element"),a=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),V=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),h=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=h&&e[h]||e["@@iterator"],typeof e=="function"?e:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,F={};function m(e,t,n){this.props=e,this.context=t,this.refs=F,this.updater=n||E}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function U(){}U.prototype=m.prototype;function O(e,t,n){this.props=e,this.context=t,this.refs=F,this.updater=n||E}var x=O.prototype=new U;x.constructor=O,A(x,m.prototype),x.isPureReactComponent=!0;var L=Array.isArray,M=Object.prototype.hasOwnProperty,I={current:null},N={key:!0,ref:!0,__self:!0,__source:!0};function B(e,t,n){var c,u={},i=null,l=null;if(t!=null)for(c in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)M.call(t,c)&&!N.hasOwnProperty(c)&&(u[c]=t[c]);var f=arguments.length-2;if(f===1)u.children=n;else if(1<f){for(var s=Array(f),d=0;d<f;d++)s[d]=arguments[d+2];u.children=s}if(e&&e.defaultProps)for(c in f=e.defaultProps,f)u[c]===void 0&&(u[c]=f[c]);return{$$typeof:o,type:e,key:i,ref:l,props:u,_owner:I.current}}function Q(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function P(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function X(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var W=/\/+/g;function q(e,t){return typeof e=="object"&&e!==null&&e.key!=null?X(""+e.key):t.toString(36)}function R(e,t,n,c,u){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case o:case a:l=!0}}if(l)return l=e,u=u(l),e=c===""?"."+q(l,0):c,L(u)?(n="",e!=null&&(n=e.replace(W,"$&/")+"/"),R(u,t,n,"",function(d){return d})):u!=null&&(P(u)&&(u=Q(u,n+(!u.key||l&&l.key===u.key?"":(""+u.key).replace(W,"$&/")+"/")+e)),t.push(u)),1;if(l=0,c=c===""?".":c+":",L(e))for(var f=0;f<e.length;f++){i=e[f];var s=c+q(i,f);l+=R(i,t,n,s,u)}else if(s=$(e),typeof s=="function")for(e=s.call(e),f=0;!(i=e.next()).done;)i=i.value,s=c+q(i,f++),l+=R(i,t,n,s,u);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function g(e,t,n){if(e==null)return e;var c=[],u=0;return R(e,c,"","",function(i){return t.call(n,i,u++)}),c}function Y(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var p={current:null},k={transition:null},Z={ReactCurrentDispatcher:p,ReactCurrentBatchConfig:k,ReactCurrentOwner:I};function z(){throw Error("act(...) is not supported in production builds of React.")}return r.Children={map:g,forEach:function(e,t,n){g(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return g(e,function(){t++}),t},toArray:function(e){return g(e,function(t){return t})||[]},only:function(e){if(!P(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},r.Component=m,r.Fragment=y,r.Profiler=S,r.PureComponent=O,r.StrictMode=v,r.Suspense=C,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,r.act=z,r.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var c=A({},e.props),u=e.key,i=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,l=I.current),t.key!==void 0&&(u=""+t.key),e.type&&e.type.defaultProps)var f=e.type.defaultProps;for(s in t)M.call(t,s)&&!N.hasOwnProperty(s)&&(c[s]=t[s]===void 0&&f!==void 0?f[s]:t[s])}var s=arguments.length-2;if(s===1)c.children=n;else if(1<s){f=Array(s);for(var d=0;d<s;d++)f[d]=arguments[d+2];c.children=f}return{$$typeof:o,type:e.type,key:u,ref:i,props:c,_owner:l}},r.createContext=function(e){return e={$$typeof:V,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:D,_context:e},e.Consumer=e},r.createElement=B,r.createFactory=function(e){var t=B.bind(null,e);return t.type=e,t},r.createRef=function(){return{current:null}},r.forwardRef=function(e){return{$$typeof:b,render:e}},r.isValidElement=P,r.lazy=function(e){return{$$typeof:w,_payload:{_status:-1,_result:e},_init:Y}},r.memo=function(e,t){return{$$typeof:_,type:e,compare:t===void 0?null:t}},r.startTransition=function(e){var t=k.transition;k.transition={};try{e()}finally{k.transition=t}},r.unstable_act=z,r.useCallback=function(e,t){return p.current.useCallback(e,t)},r.useContext=function(e){return p.current.useContext(e)},r.useDebugValue=function(){},r.useDeferredValue=function(e){return p.current.useDeferredValue(e)},r.useEffect=function(e,t){return p.current.useEffect(e,t)},r.useId=function(){return p.current.useId()},r.useImperativeHandle=function(e,t,n){return p.current.useImperativeHandle(e,t,n)},r.useInsertionEffect=function(e,t){return p.current.useInsertionEffect(e,t)},r.useLayoutEffect=function(e,t){return p.current.useLayoutEffect(e,t)},r.useMemo=function(e,t){return p.current.useMemo(e,t)},r.useReducer=function(e,t,n){return p.current.useReducer(e,t,n)},r.useRef=function(e){return p.current.useRef(e)},r.useState=function(e){return p.current.useState(e)},r.useSyncExternalStore=function(e,t,n){return p.current.useSyncExternalStore(e,t,n)},r.useTransition=function(){return p.current.useTransition()},r.version="18.3.1",r}var G;function re(){return G||(G=1,T.exports=te()),T.exports}var ne=re();const j=ee(ne),J=o=>{let a;const y=new Set,v=(_,w)=>{const h=typeof _=="function"?_(a):_;if(!Object.is(h,a)){const $=a;a=w??(typeof h!="object"||h===null)?h:Object.assign({},a,h),y.forEach(E=>E(a,$))}},S=()=>a,b={setState:v,getState:S,getInitialState:()=>C,subscribe:_=>(y.add(_),()=>y.delete(_))},C=a=o(v,S,b);return b},oe=(o=>o?J(o):J),ue=o=>o;function ce(o,a=ue){const y=j.useSyncExternalStore(o.subscribe,j.useCallback(()=>a(o.getState()),[o,a]),j.useCallback(()=>a(o.getInitialState()),[o,a]));return j.useDebugValue(y),y}const K=o=>{const a=oe(o),y=v=>ce(a,v);return Object.assign(y,a),y},ie=(o=>o?K(o):K);export{j as W,ne as a,
|
|
9
|
+
*/var H;function te(){if(H)return r;H=1;var o=Symbol.for("react.element"),a=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),V=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),h=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=h&&e[h]||e["@@iterator"],typeof e=="function"?e:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,F={};function m(e,t,n){this.props=e,this.context=t,this.refs=F,this.updater=n||E}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function U(){}U.prototype=m.prototype;function O(e,t,n){this.props=e,this.context=t,this.refs=F,this.updater=n||E}var x=O.prototype=new U;x.constructor=O,A(x,m.prototype),x.isPureReactComponent=!0;var L=Array.isArray,M=Object.prototype.hasOwnProperty,I={current:null},N={key:!0,ref:!0,__self:!0,__source:!0};function B(e,t,n){var c,u={},i=null,l=null;if(t!=null)for(c in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)M.call(t,c)&&!N.hasOwnProperty(c)&&(u[c]=t[c]);var f=arguments.length-2;if(f===1)u.children=n;else if(1<f){for(var s=Array(f),d=0;d<f;d++)s[d]=arguments[d+2];u.children=s}if(e&&e.defaultProps)for(c in f=e.defaultProps,f)u[c]===void 0&&(u[c]=f[c]);return{$$typeof:o,type:e,key:i,ref:l,props:u,_owner:I.current}}function Q(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function P(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function X(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var W=/\/+/g;function q(e,t){return typeof e=="object"&&e!==null&&e.key!=null?X(""+e.key):t.toString(36)}function R(e,t,n,c,u){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case o:case a:l=!0}}if(l)return l=e,u=u(l),e=c===""?"."+q(l,0):c,L(u)?(n="",e!=null&&(n=e.replace(W,"$&/")+"/"),R(u,t,n,"",function(d){return d})):u!=null&&(P(u)&&(u=Q(u,n+(!u.key||l&&l.key===u.key?"":(""+u.key).replace(W,"$&/")+"/")+e)),t.push(u)),1;if(l=0,c=c===""?".":c+":",L(e))for(var f=0;f<e.length;f++){i=e[f];var s=c+q(i,f);l+=R(i,t,n,s,u)}else if(s=$(e),typeof s=="function")for(e=s.call(e),f=0;!(i=e.next()).done;)i=i.value,s=c+q(i,f++),l+=R(i,t,n,s,u);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function g(e,t,n){if(e==null)return e;var c=[],u=0;return R(e,c,"","",function(i){return t.call(n,i,u++)}),c}function Y(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var p={current:null},k={transition:null},Z={ReactCurrentDispatcher:p,ReactCurrentBatchConfig:k,ReactCurrentOwner:I};function z(){throw Error("act(...) is not supported in production builds of React.")}return r.Children={map:g,forEach:function(e,t,n){g(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return g(e,function(){t++}),t},toArray:function(e){return g(e,function(t){return t})||[]},only:function(e){if(!P(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},r.Component=m,r.Fragment=y,r.Profiler=S,r.PureComponent=O,r.StrictMode=v,r.Suspense=C,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,r.act=z,r.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var c=A({},e.props),u=e.key,i=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,l=I.current),t.key!==void 0&&(u=""+t.key),e.type&&e.type.defaultProps)var f=e.type.defaultProps;for(s in t)M.call(t,s)&&!N.hasOwnProperty(s)&&(c[s]=t[s]===void 0&&f!==void 0?f[s]:t[s])}var s=arguments.length-2;if(s===1)c.children=n;else if(1<s){f=Array(s);for(var d=0;d<s;d++)f[d]=arguments[d+2];c.children=f}return{$$typeof:o,type:e.type,key:u,ref:i,props:c,_owner:l}},r.createContext=function(e){return e={$$typeof:V,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:D,_context:e},e.Consumer=e},r.createElement=B,r.createFactory=function(e){var t=B.bind(null,e);return t.type=e,t},r.createRef=function(){return{current:null}},r.forwardRef=function(e){return{$$typeof:b,render:e}},r.isValidElement=P,r.lazy=function(e){return{$$typeof:w,_payload:{_status:-1,_result:e},_init:Y}},r.memo=function(e,t){return{$$typeof:_,type:e,compare:t===void 0?null:t}},r.startTransition=function(e){var t=k.transition;k.transition={};try{e()}finally{k.transition=t}},r.unstable_act=z,r.useCallback=function(e,t){return p.current.useCallback(e,t)},r.useContext=function(e){return p.current.useContext(e)},r.useDebugValue=function(){},r.useDeferredValue=function(e){return p.current.useDeferredValue(e)},r.useEffect=function(e,t){return p.current.useEffect(e,t)},r.useId=function(){return p.current.useId()},r.useImperativeHandle=function(e,t,n){return p.current.useImperativeHandle(e,t,n)},r.useInsertionEffect=function(e,t){return p.current.useInsertionEffect(e,t)},r.useLayoutEffect=function(e,t){return p.current.useLayoutEffect(e,t)},r.useMemo=function(e,t){return p.current.useMemo(e,t)},r.useReducer=function(e,t,n){return p.current.useReducer(e,t,n)},r.useRef=function(e){return p.current.useRef(e)},r.useState=function(e){return p.current.useState(e)},r.useSyncExternalStore=function(e,t,n){return p.current.useSyncExternalStore(e,t,n)},r.useTransition=function(){return p.current.useTransition()},r.version="18.3.1",r}var G;function re(){return G||(G=1,T.exports=te()),T.exports}var ne=re();const j=ee(ne),J=o=>{let a;const y=new Set,v=(_,w)=>{const h=typeof _=="function"?_(a):_;if(!Object.is(h,a)){const $=a;a=w??(typeof h!="object"||h===null)?h:Object.assign({},a,h),y.forEach(E=>E(a,$))}},S=()=>a,b={setState:v,getState:S,getInitialState:()=>C,subscribe:_=>(y.add(_),()=>y.delete(_))},C=a=o(v,S,b);return b},oe=(o=>o?J(o):J),ue=o=>o;function ce(o,a=ue){const y=j.useSyncExternalStore(o.subscribe,j.useCallback(()=>a(o.getState()),[o,a]),j.useCallback(()=>a(o.getInitialState()),[o,a]));return j.useDebugValue(y),y}const K=o=>{const a=oe(o),y=v=>ce(a,v);return Object.assign(y,a),y},ie=(o=>o?K(o):K);export{j as W,ne as a,ie as b,se as c,ee as g,re as r};
|
package/dist/index.html
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
10
|
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@700;800;900&display=swap" rel="stylesheet">
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/zustand-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/reactflow-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-C8UZrEP-.js"></script>
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/zustand-CrhqMOHB.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/reactflow-CsCqNKB-.js">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/index-XtCtnAfF.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="root"></div>
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import { architectBuildCommand } from '../commands/build.js';
|
|
4
4
|
import { architectDevCommand } from '../commands/dev.js';
|
|
5
|
-
import { architectExampleCommand } from '../commands/example.js';
|
|
5
|
+
import { architectExampleCommand, listArchitectExamples, listArchitectTemplates, } from '../commands/example.js';
|
|
6
6
|
const program = new Command();
|
|
7
7
|
program
|
|
8
8
|
.name('memo-architect')
|
|
9
9
|
.description('MEMO Architect — interactive and distributable model workbench')
|
|
10
|
-
.version('0.6.
|
|
10
|
+
.version('0.6.3')
|
|
11
11
|
.option('--example <name>', 'Open a bundled example project (e.g. gpca, standard-sysml-diagrams). A local checkout is opened in place; an installed package is opened read-only in a disposable copy')
|
|
12
12
|
.option('--read-only', 'Always open the example in a disposable copy, even from a local checkout')
|
|
13
13
|
.option('-p, --port <port>', 'Server port', '3000')
|
|
@@ -51,6 +51,24 @@ program
|
|
|
51
51
|
const open = resolveOption(this, 'open', options.open);
|
|
52
52
|
await architectDevCommand({ port: Number.parseInt(String(port), 10), open });
|
|
53
53
|
});
|
|
54
|
+
program
|
|
55
|
+
.command('examples')
|
|
56
|
+
.description('List bundled example IDs accepted by --example')
|
|
57
|
+
.action(() => {
|
|
58
|
+
console.log('Available examples:');
|
|
59
|
+
for (const id of listArchitectExamples())
|
|
60
|
+
console.log(` ${id}`);
|
|
61
|
+
console.log('\nOpen one with: memo-architect --example <id>');
|
|
62
|
+
});
|
|
63
|
+
program
|
|
64
|
+
.command('templates')
|
|
65
|
+
.description('List project templates available through MEMO Tools')
|
|
66
|
+
.action(() => {
|
|
67
|
+
console.log('Available project templates:');
|
|
68
|
+
for (const id of listArchitectTemplates())
|
|
69
|
+
console.log(` ${id}`);
|
|
70
|
+
console.log('\nCreate one with: memo init <project> --template <id>');
|
|
71
|
+
});
|
|
54
72
|
program
|
|
55
73
|
.command('build')
|
|
56
74
|
.description('Build a static Architect viewer with embedded project data')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memo-architect.js","sourceRoot":"","sources":["../../src/bin/memo-architect.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"memo-architect.js","sourceRoot":"","sources":["../../src/bin/memo-architect.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACH,uBAAuB,EAAE,qBAAqB,EAAE,sBAAsB,GACzE,MAAM,wBAAwB,CAAC;AAEhC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACF,IAAI,CAAC,gBAAgB,CAAC;KACtB,WAAW,CAAC,gEAAgE,CAAC;KAC7E,OAAO,CAAC,OAAO,CAAC;KAChB,MAAM,CAAC,kBAAkB,EAAE,yKAAyK,CAAC;KACrM,MAAM,CAAC,aAAa,EAAE,0EAA0E,CAAC;KACjG,MAAM,CAAC,mBAAmB,EAAE,aAAa,EAAE,MAAM,CAAC;KAClD,MAAM,CAAC,WAAW,EAAE,uBAAuB,CAAC;KAC5C,MAAM,CAAC,KAAK,EAAE,OAA8E,EAAE,EAAE;IAC7F,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,uBAAuB,CAAC;YAC1B,IAAI,EAAE,OAAO,CAAC,OAAO;YACrB,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;YACvC,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC7B,CAAC,CAAC;QACH,OAAO;IACX,CAAC;IACD,OAAO,CAAC,IAAI,EAAE,CAAC;AACnB,CAAC,CAAC,CAAC;AAEP;;;;;;;;GAQG;AACH,SAAS,aAAa,CAAI,OAAgB,EAAE,IAAY,EAAE,KAAQ;IAC9D,IAAI,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAC/D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,IAAI,MAAM,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,KAAK;QAAE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC,IAAI,CAAM,CAAC;IAClF,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,OAAO;KACF,OAAO,CAAC,KAAK,CAAC;KACd,WAAW,CAAC,wCAAwC,CAAC;KACrD,MAAM,CAAC,mBAAmB,EAAE,aAAa,EAAE,MAAM,CAAC;KAClD,MAAM,CAAC,WAAW,EAAE,uBAAuB,CAAC;KAC5C,MAAM,CAAC,KAAK,WAA0B,OAAwC;IAC3E,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,mBAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AACjF,CAAC,CAAC,CAAC;AAEP,OAAO;KACF,OAAO,CAAC,UAAU,CAAC;KACnB,WAAW,CAAC,gDAAgD,CAAC;KAC7D,MAAM,CAAC,GAAG,EAAE;IACT,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACnC,KAAK,MAAM,EAAE,IAAI,qBAAqB,EAAE;QAAE,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC;AAEP,OAAO;KACF,OAAO,CAAC,WAAW,CAAC;KACpB,WAAW,CAAC,qDAAqD,CAAC;KAClE,MAAM,CAAC,GAAG,EAAE;IACT,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAC5C,KAAK,MAAM,EAAE,IAAI,sBAAsB,EAAE;QAAE,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;AAC1E,CAAC,CAAC,CAAC;AAEP,OAAO;KACF,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,4DAA4D,CAAC;KACzE,MAAM,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,CAAC;KACxD,MAAM,CAAC,cAAc,EAAE,qDAAqD,CAAC;KAC7E,MAAM,CAAC,KAAK,EAAE,OAAiD,EAAE,EAAE;IAChE,MAAM,qBAAqB,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC;AAEP,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/** IDs accepted by `memo-architect --example`. */
|
|
2
|
+
export declare function listArchitectExamples(): string[];
|
|
3
|
+
/** Project templates supplied by the same ontology content package. */
|
|
4
|
+
export declare function listArchitectTemplates(): string[];
|
|
1
5
|
/**
|
|
2
6
|
* Open a bundled example.
|
|
3
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../../src/commands/example.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../../src/commands/example.ts"],"names":[],"mappings":"AAuEA,kDAAkD;AAClD,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAED,uEAAuE;AACvE,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAEjD;AA2BD;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAAC,OAAO,EAAE;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyChB"}
|