@diagc/cli 1.13.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/assets/studio/assets/{index-DnTnVIet.css → index-CArMYPmp.css} +1 -1
- package/assets/studio/assets/{index-BK_mpx_Q.js → index-Cz1UWfzr.js} +2 -2
- package/assets/studio/index.html +2 -2
- package/assets/viewer/index.html +3 -3
- package/assets/viewer/shared/viewer.css +1 -1
- package/assets/viewer/shared/viewer.js +2 -2
- package/package.json +2 -2
|
@@ -16,11 +16,11 @@ Error generating stack: `+e.message+`
|
|
|
16
16
|
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}xne.displayName=`MiniMap`,(0,_.memo)(xne);var Sne=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Cne={[vp.Line]:`right`,[vp.Handle]:`bottom-right`};function wne({nodeId:e,position:t,variant:n=vp.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:v}){let y=Nm(),b=typeof e==`string`?e:y,x=qp(),S=(0,_.useRef)(null),C=n===vp.Handle,w=Kp((0,_.useCallback)(Sne(C&&p),[C,p]),Vp),T=(0,_.useRef)(null),E=t??Cne[n];return(0,_.useEffect)(()=>{if(!(!S.current||!b))return T.current||=jp({domNode:S.current,nodeId:b,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=x.getState(),o=[],s={x:e.x,y:e.y},c=r.get(b);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=Rf([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...Wd({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:b,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:b,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:b,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:v,shouldResize:m}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,h,g,v,m]),(0,D.jsx)(`div`,{className:fa([`react-flow__resize-control`,`nodrag`,...E.split(`-`),n,r]),ref:S,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}var Ph=(0,_.memo)(wne);function Tne({nodeId:e,isVisible:t=!0,handleClassName:n,handleStyle:r,lineClassName:i,lineStyle:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,autoScale:f=!0,shouldResize:p,onResizeStart:m,onResize:h,onResizeEnd:g}){return t?(0,D.jsxs)(D.Fragment,{children:[bp.map(t=>(0,D.jsx)(Ph,{className:i,style:a,nodeId:e,position:t,variant:vp.Line,color:o,minWidth:s,minHeight:c,maxWidth:l,maxHeight:u,onResizeStart:m,keepAspectRatio:d,autoScale:f,shouldResize:p,onResize:h,onResizeEnd:g},t)),yp.map(t=>(0,D.jsx)(Ph,{className:n,style:r,nodeId:e,position:t,color:o,minWidth:s,minHeight:c,maxWidth:l,maxHeight:u,onResizeStart:m,keepAspectRatio:d,autoScale:f,shouldResize:p,onResize:h,onResizeEnd:g},t))]}):null}var Ene=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Dne=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),One=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),kne=e=>{let t=One(e);return t.charAt(0).toUpperCase()+t.slice(1)},Fh={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ane=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},jne=(0,_.createContext)({}),Mne=()=>(0,_.useContext)(jne),Nne=(0,_.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Mne()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,_.createElement)(`svg`,{ref:c,...Fh,width:t??l??Fh.width,height:t??l??Fh.height,stroke:e??f,strokeWidth:m,className:Ene(`lucide`,p,i),...!a&&!Ane(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Ih=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(Nne,{ref:i,iconNode:t,className:Ene(`lucide-${Dne(kne(e))}`,`lucide-${e}`,n),...r}));return n.displayName=kne(e),n},Pne=Ih(`app-window`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),Lh=Ih(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),Rh=Ih(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),Fne=Ih(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Ine=Ih(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),Lne=Ih(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),Rne=Ih(`brick-wall`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 9v6`,key:`199k2o`}],[`path`,{d:`M16 15v6`,key:`8rj2es`}],[`path`,{d:`M16 3v6`,key:`1j6rpj`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 15v6`,key:`1stoo3`}],[`path`,{d:`M8 3v6`,key:`vlvjmk`}]]),zne=Ih(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Bne=Ih(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Vne=Ih(`component`,[[`path`,{d:`M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z`,key:`1uwlt4`}],[`path`,{d:`M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z`,key:`10291m`}],[`path`,{d:`M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z`,key:`1tqoq1`}],[`path`,{d:`M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z`,key:`1x6lto`}]]),Hne=Ih(`container`,[[`path`,{d:`M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z`,key:`1t2lqe`}],[`path`,{d:`M10 21.9V14L2.1 9.1`,key:`o7czzq`}],[`path`,{d:`m10 14 11.9-6.9`,key:`zm5e20`}],[`path`,{d:`M14 19.8v-8.1`,key:`159ecu`}],[`path`,{d:`M18 17.5V9.4`,key:`11uown`}]]),Une=Ih(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Wne=Ih(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),zh=Ih(`door-open`,[[`path`,{d:`M11 20H2`,key:`nlcfvz`}],[`path`,{d:`M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z`,key:`au4z13`}],[`path`,{d:`M11 4H8a2 2 0 0 0-2 2v14`,key:`74r1mk`}],[`path`,{d:`M14 12h.01`,key:`1jfl7z`}],[`path`,{d:`M22 20h-3`,key:`vhrsz`}]]),Gne=Ih(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),Kne=Ih(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Bh=Ih(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),Vh=Ih(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),qne=Ih(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Jne=Ih(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),Hh=Ih(`lock-open`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]),Yne=Ih(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Uh=Ih(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),Xne=Ih(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),Zne=Ih(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Qne=Ih(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Wh=Ih(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Gh=Ih(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Kh=Ih(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),qh=Ih(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Jh=Ih(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),$ne=Ih(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Yh=Ih(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),ere=Ih(`split`,[[`path`,{d:`M16 3h5v5`,key:`1806ms`}],[`path`,{d:`M8 3H3v5`,key:`15dfkv`}],[`path`,{d:`M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3`,key:`1qrqzj`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}]]),tre=Ih(`square-function`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3`,key:`m1af9g`}],[`path`,{d:`M9 11.2h5.7`,key:`3zgcl2`}]]),nre=Ih(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),rre=Ih(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ire={database:Wne,postgres:Wne,table:nre,user:Ih(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),users:Ih(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),cloud:Bne,mail:Uh,service:Fne,system:Ine,queue:Jne,server:$ne,kubernetes:Hne,infra:Vh,comment:Zne,browser:Kne,spa:Pne,mobile:Yh,desktop:Wh,api:Ih(`webhook`,[[`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`,key:`q3hayz`}],[`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06`,key:`1go1hn`}],[`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`,key:`qlwsc0`}]]),function:tre,cli:rre,blob:Lh,search:Jh,component:Vne,interface:qh,class:Lne,node:Une,instance:Rh,plus:Kh,minus:Qne,dot:zne,decision:Gne,environment:qne,region:Xne,zone:Bh,network:Gh,"subnet-public":Hh,"subnet-private":Yne,"load-balancer":ere,gateway:zh,firewall:Rne,internet:Kne};Object.keys(ire);function are(e){let t=new Map(Object.entries({...ire,...e}));return{resolve:e=>t.get(e),register:(e,n)=>{t.set(e,n)}}}function ore({path:e,nameOf:t,onCrumb:n}){return e.length===0?null:(0,D.jsx)(Jp,{position:`top-left`,className:`dg-breadcrumbs`,children:(0,D.jsxs)(`nav`,{className:`dg-breadcrumbs-nav`,"aria-label":`Nested zoom breadcrumb`,children:[(0,D.jsx)(`button`,{type:`button`,className:`dg-crumb dg-crumb-home`,title:`Zoom out to the bird’s-eye view`,onClick:()=>n(null),children:`⌂`}),e.map((r,i)=>{let a=i===e.length-1;return(0,D.jsxs)(`span`,{className:`dg-crumb-item`,children:[(0,D.jsx)(`span`,{className:`dg-crumb-sep`,"aria-hidden":`true`,children:`›`}),(0,D.jsx)(`button`,{type:`button`,className:`dg-crumb${a?` dg-crumb-current`:``}`,"aria-current":a?`page`:void 0,onClick:()=>n(r),children:t(r)})]},r)})]})})}var k=new Set,sre={nodes:k,edges:k,active:!1,variant:`loop`,activeKey:null,focusId:null,toggle:()=>void 0,clear:()=>void 0},Xh=(0,_.createContext)(sre);function Zh(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Qh(e,t,n,r){switch(e){case rd.Left:return{x:t.x-Zh(t.x-n.x,r),y:t.y};case rd.Right:return{x:t.x+Zh(n.x-t.x,r),y:t.y};case rd.Top:return{x:t.x,y:t.y-Zh(t.y-n.y,r)};case rd.Bottom:default:return{x:t.x,y:t.y+Zh(n.y-t.y,r)}}}function cre(e,t){let n={x:e.sourceX,y:e.sourceY},r={x:e.targetX,y:e.targetY};return[n,Qh(e.sourcePosition,n,r,t),Qh(e.targetPosition,r,n,t),r]}var $h=.6,lre=24,ure=160;function eg(e,t,n=`left`,r){let i={x:e.sourceX,y:e.sourceY},a={x:e.targetX,y:e.targetY},o=a.x-i.x,s=a.y-i.y,c=Math.hypot(o,s);if(c===0)return[i,i,i,i];let l=o/c,u=s/c,d=n===`right`?-1:1,f=-u*d,p=l*d,m=r??Math.min(ure,Math.max(lre,t*c*$h));return[i,{x:i.x+c/3*l+f*m,y:i.y+c/3*u+p*m},{x:i.x+l*(2*c/3)+f*m,y:i.y+u*(2*c/3)+p*m},a]}function tg(e,t,n=`left`,r){let[i,a,o,s]=eg(e,t,n,r);return`M${i.x},${i.y} C${a.x},${a.y} ${o.x},${o.y} ${s.x},${s.y}`}function dre([e,t,n,r],i){let a=1-i,o=a*a*a,s=3*a*a*i,c=3*a*i*i,l=i*i*i;return{x:o*e.x+s*t.x+c*n.x+l*r.x,y:o*e.y+s*t.y+c*n.y+l*r.y}}function fre([e,t,n,r],i){let a=1-i,o=3*a*a,s=6*a*i,c=3*i*i;return{x:o*(t.x-e.x)+s*(n.x-t.x)+c*(r.x-n.x),y:o*(t.y-e.y)+s*(n.y-t.y)+c*(r.y-n.y)}}function ng(e){let t=e.targetX-e.sourceX,n=e.targetY-e.sourceY,r=Math.hypot(t,n);return r===0?{x:0,y:0}:{x:t/r,y:n/r}}function pre({shape:e,params:t,curvature:n,side:r=`left`,bulge:i}){if(e===`curved`)return cre(t,n??.25);if(e===`bow`)return eg(t,n??.25,r,i)}function mre(e,t){let n=pre(e);if(n!==void 0)return dre(n,t);let{params:r}=e;return{x:r.sourceX+(r.targetX-r.sourceX)*t,y:r.sourceY+(r.targetY-r.sourceY)*t}}function rg(e,t){let n=pre(e);if(n===void 0)return ng(e.params);let r=fre(n,t),i=Math.hypot(r.x,r.y);return i===0?ng(e.params):{x:r.x/i,y:r.y/i}}function hre(e){return{point:t=>mre(e,t),tangent:t=>rg(e,t)}}function gre(e){let t=e[0]??{x:0,y:0},n=[],r=0;for(let t=1;t<e.length;t++){let i=Math.hypot(e[t].x-e[t-1].x,e[t].y-e[t-1].y);n.push(i),r+=i}let i=e=>{let t=Math.min(1,Math.max(0,e))*r;for(let e=0;e<n.length;e++){let r=n[e];if(r>0&&(t<=r||e===n.length-1))return{i:e,u:Math.min(1,t/r)};t-=r}return{i:Math.max(0,n.length-1),u:0}};return{point:n=>{if(r===0)return t;let{i:a,u:o}=i(n),s=e[a],c=e[a+1];return{x:s.x+(c.x-s.x)*o,y:s.y+(c.y-s.y)*o}},tangent:t=>{if(r===0)return{x:0,y:0};let{i:a}=i(t),o=e[a],s=e[a+1],c=n[a];return c===0?{x:0,y:0}:{x:(s.x-o.x)/c,y:(s.y-o.y)/c}}}}function ig(e,t){let n=e.point(t),r=e.tangent(t);return{point:n,tangent:r,normal:{x:-r.y,y:r.x}}}function ag(e,t,n=40){let r=.5,i=1/0;for(let a=0;a<=n;a++){let o=a/n,s=e.point(o),c=(s.x-t.x)**2+(s.y-t.y)**2;c<i&&(i=c,r=o)}let a=e.point(r),o=e.tangent(r),s=-o.y,c=o.x;return c>0&&(s=-s,c=-c),{t:r,perp:(t.x-a.x)*s+(t.y-a.y)*c}}function og(e,t){let n=e[0]??t,r=1/0;for(let i=0;i+1<e.length;i++){let a=e[i],o=e[i+1],s=o.x-a.x,c=o.y-a.y,l=s*s+c*c,u=l===0?0:Math.min(1,Math.max(0,((t.x-a.x)*s+(t.y-a.y)*c)/l)),d={x:a.x+u*s,y:a.y+u*c},f=(d.x-t.x)**2+(d.y-t.y)**2;f<r&&(r=f,n=d)}return n}function _re(e,t){if(e.length<2)return``;if(e.length===2)return`M${e[0].x},${e[0].y} L${e[1].x},${e[1].y}`;let n=`M${e[0].x},${e[0].y}`;for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1],s=Math.hypot(a.x-i.x,a.y-i.y)||1,c=Math.hypot(o.x-a.x,o.y-a.y)||1,l=Math.min(t,s/2,c/2),u=a.x-(a.x-i.x)/s*l,d=a.y-(a.y-i.y)/s*l,f=a.x+(o.x-a.x)/c*l,p=a.y+(o.y-a.y)/c*l;n+=` L${u},${d} Q${a.x},${a.y} ${f},${p}`}let r=e[e.length-1];return n+=` L${r.x},${r.y}`,n}function sg(e,t=10){let n=e.map(e=>({...e}));for(let e=1;e+2<n.length;){let r=n[e-1],i=n[e],a=n[e+1],o=n[e+2],s=i.y===a.y&&Math.abs(a.x-i.x)>0&&Math.abs(a.x-i.x)<=t&&r.x===i.x&&a.x===o.x,c=i.x===a.x&&Math.abs(a.y-i.y)>0&&Math.abs(a.y-i.y)<=t&&r.y===i.y&&a.y===o.y;if(!s&&!c){e++;continue}let l=s?i.x:i.y;for(let t=e;t>=0;t--){let e=n[t];if((s?e.x:e.y)!==l)break;s?e.x=a.x:e.y=a.y}n.splice(e,2)}return n}function cg(e){let t=(e,t)=>e===void 0||t===void 0?void 0:e.x===t.x&&e.y!==t.y?t.y>e.y?`bottom`:`top`:e.y===t.y&&e.x!==t.x?t.x>e.x?`right`:`left`:void 0;return{from:t(e[0],e[1]),to:t(e[e.length-1],e[e.length-2])}}function lg(e,t,n){let r=e.map(e=>({...e}));if(r.length<2)return r;let i=(e,t,n,r)=>t<n?n:t>r?r:e-n<=r-e?n:r,a=(e,t,n)=>{if(n===void 0||n.width<=0||n.height<=0)return;let r=n.x+n.width,a=n.y+n.height;e.x===t.x&&e.x>=n.x&&e.x<=r?e.y=i(e.y,t.y,n.y,a):e.y===t.y&&e.y>=n.y&&e.y<=a&&(e.x=i(e.x,t.x,n.x,r))};return a(r[0],r[1],t),a(r[r.length-1],r[r.length-2],n),r}var ug=20,dg=16,fg={sm:{char:5.5,line:13},md:{char:7.2,line:17},lg:{char:11,line:26}};function pg(e,t=`md`){let{char:n,line:r}=fg[t],i=260-ug,a=0,o=0;for(let t of e.split(`
|
|
17
17
|
`)){let e=t.length*n;o=Math.max(o,Math.min(e,i)),a+=Math.max(1,Math.ceil(e/i))}return{width:Math.min(260,Math.max(120,Math.round(o+ug))),height:Math.round(Math.max(1,a)*r+dg)}}var vre=7,mg=8;function hg(e){return Math.round(e.length*vre+mg)}var gg=180,_g=16;function vg(e){let t=0,n=0;for(let r of e.split(`
|
|
18
18
|
`)){let e=hg(r);t=Math.max(t,Math.min(e,gg)),n+=Math.max(1,Math.ceil(e/gg))}return{width:t,height:n*_g+3}}var yre=14,bre=8,xre=3;function Sre(e){return e>bre?`top`:e<-8?`bottom`:`center`}function yg(e,t,n){let r=e.point(t);if(n!==`top`&&n!==`bottom`)return r;let i=e.tangent(t),a=-i.y,o=i.x;o>0&&(a=-a,o=-o);let s=n===`top`?1:-1;return{x:r.x+s*yre*a,y:r.y+s*yre*o}}var bg=e=>(e.t===void 0||e.t===.5)&&(e.side??`center`)===`center`;function Cre({data:e,curve:t,label:n,labelSpot:r}){let[i,a]=(0,_.useState)(null),o=xg(e,t),s=e.editableLabels===!0,c=it(e.kind),l=e=>c?ct(e,24).join(`
|
|
19
|
-
`):e,u=c?` dg-edge-label-wrap`:``;return(0,D.jsxs)(D.Fragment,{children:[e.labels===void 0&&e.label!==void 0&&(0,D.jsx)(Th,{children:(0,D.jsx)(`div`,{className:`dg-edge-label dg-edge-chip${u}`,style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${n.x}px, ${n.y}px)`},children:l(e.label)})}),e.labels!==void 0&&e.labels.map(n=>{let c=n.t??.5,d=n.side??`center`,f=r!==void 0&&e.labels?.length===1&&bg(n)?r:yg(t,c,d),p=o.drag!==null&&o.drag.labelId===n.id?o.drag:null,m=p?.x??f.x,h=p?.y??f.y,g=i!==null&&i.labelId===n.id;return(0,D.jsx)(Th,{children:(0,D.jsx)(`div`,{className:`dg-edge-label dg-edge-label-${d}${u} nodrag nopan`,style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${m}px, ${h}px)`,pointerEvents:`all`},...o.handlers(n.id,g),onDoubleClick:e=>{s&&(e.stopPropagation(),a({labelId:n.id,t:c,side:d,x:f.x,y:f.y}))},children:g?(0,D.jsx)(Cg,{label:n.text,onCommit:t=>{a(null),t!==null&&e.onEditLabel?.(n.id,t.trim())}}):l(n.text)})},n.id)}),s&&e.pendingAdd!==void 0&&(0,D.jsx)(Sg,{data:e,curve:t,at:e.pendingAdd})]})}function xg(e,t){let n=wm(),[r,i]=(0,_.useState)(null),a=(0,_.useRef)(null),o=(e,r)=>{let{t:i,perp:a}=ag(t,n.screenToFlowPosition({x:e,y:r}));return{t:i,side:Sre(a)}},s=t=>e.editableLabels===!0||e.movableLabels===!0&&t.altKey;return{drag:r,handlers:(n,r)=>({onPointerDown:e=>{!s(e)||r||(e.stopPropagation(),a.current={labelId:n,startX:e.clientX,startY:e.clientY,moved:!1},typeof e.currentTarget.setPointerCapture==`function`&&e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:e=>{let r=a.current;if(r===null||r.labelId!==n||!r.moved&&Math.hypot(e.clientX-r.startX,e.clientY-r.startY)<xre)return;r.moved=!0;let{t:s,side:c}=o(e.clientX,e.clientY),l=yg(t,s,c);i({labelId:n,x:l.x,y:l.y})},onPointerUp:t=>{let r=a.current;if(a.current=null,!(r===null||r.labelId!==n)){if(typeof t.currentTarget.releasePointerCapture==`function`&&t.currentTarget.releasePointerCapture(t.pointerId),r.moved){let{t:r,side:i}=o(t.clientX,t.clientY);e.onMoveLabel?.(n,r,i)}i(null)}}})}}function Sg({data:e,curve:t,at:n}){let{t:r,perp:i}=ag(t,n),a=Sre(i),o=yg(t,r,a);return(0,D.jsx)(Th,{children:(0,D.jsx)(`div`,{className:`dg-edge-label-edit nodrag nopan`,style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${o.x}px, ${o.y}px)`,pointerEvents:`all`},children:(0,D.jsx)(Cg,{label:``,onCommit:t=>{t!==null&&t.trim()!==``&&e.onAddLabel?.(t.trim(),r,a),e.onPendingAddConsumed?.()}})})})}function Cg({label:e,onCommit:t}){let n=(0,_.useRef)(!1),r=e=>{n.current||(n.current=!0,t?.(e))};return(0,D.jsx)(`input`,{"aria-label":`Edge label`,defaultValue:e,autoFocus:!0,onFocus:e=>e.target.select(),onBlur:e=>r(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?r(e.target.value):e.key===`Escape`&&r(null)}})}var wg={arrow:{refX:9,el:(0,D.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`})},dot:{refX:5,el:(0,D.jsx)(`circle`,{cx:`5`,cy:`5`,r:`4`})},square:{refX:5,el:(0,D.jsx)(`rect`,{x:`1.2`,y:`1.2`,width:`7.6`,height:`7.6`})},diamond:{refX:5,el:(0,D.jsx)(`path`,{d:`M5,0 L10,5 L5,10 L0,5 z`})},crowsfoot:{refX:10,el:(0,D.jsx)(`path`,{d:`M10,1 L0,5 L10,9 M0,5 L10,5`,fill:`none`})},one:{refX:8,el:(0,D.jsx)(`path`,{d:`M5,1 L5,9`,fill:`none`})},none:void 0},Tg={refX:9,el:(0,D.jsx)(`path`,{d:`M1,1 L9,5 L1,9`,fill:`none`})},Eg=new Set([`crowsfoot`,`one`,`open-arrow`]);function Dg({end:e,start:t,stroke:n,size:r}){return(0,D.jsxs)(D.Fragment,{children:[e!==void 0&&(0,D.jsx)(Og,{marker:e,stroke:n,size:r}),t!==void 0&&(0,D.jsx)(Og,{marker:t,stroke:n,size:r})]})}function Og({marker:e,stroke:t,size:n}){return(0,D.jsx)(`defs`,{children:(0,D.jsx)(`marker`,{id:e.id,viewBox:`0 0 10 10`,refX:e.shape.refX,refY:`5`,markerWidth:n,markerHeight:n,markerUnits:`userSpaceOnUse`,orient:`auto-start-reverse`,fill:t,...Eg.has(e.style)?{stroke:t,strokeWidth:1.2}:{},children:e.shape.el})})}var kg=12,Ag=6,jg=3,Mg=12;function wre({curve:e,data:t,profile:n,look:r}){let i=n.edge?.marks===!0,a=i&&t.polarity!==void 0?ig(e,.82):void 0,o=i&&t.delay===!0?ig(e,.5):void 0,s=r.kind.zigzag===!0?ig(e,.5):void 0;return(0,D.jsxs)(D.Fragment,{children:[a!==void 0&&t.polarity!==void 0&&(0,D.jsx)(`text`,{className:`dg-polarity`,x:a.point.x+a.normal.x*kg,y:a.point.y+a.normal.y*kg,textAnchor:`middle`,dominantBaseline:`central`,style:r.polarityColor===void 0?void 0:{fill:r.stroke},children:t.polarity===`-`?`−`:`+`}),o!==void 0&&(0,D.jsx)(`g`,{className:`dg-delay`,children:[-3,jg].map(e=>{let t=o.point.x+o.tangent.x*e,n=o.point.y+o.tangent.y*e;return(0,D.jsx)(`line`,{x1:t-o.normal.x*Ag,y1:n-o.normal.y*Ag,x2:t+o.normal.x*Ag,y2:n+o.normal.y*Ag},e)})}),s!==void 0&&(0,D.jsx)(`polyline`,{className:`dg-edge-zigzag`,points:[[-12,4],[2,-2],[-2,2],[Mg,-4]].map(([e,t])=>{let{point:n,tangent:r,normal:i}=s;return`${n.x+e*r.x+t*i.x},${n.y+e*r.y+t*i.y}`}).join(` `),fill:`none`,strokeWidth:1.75,stroke:r.stroke})]})}function Ng({comments:e,links:t}){if(e===0&&t===0)return;let n=[];return e>0&&n.push(`${e} comment${e===1?``:`s`}`),t>0&&n.push(`${t} link${t===1?``:`s`}`),{text:e>0?String(e):`↗`,title:n.join(`, `)}}var Pg=(0,_.createContext)(null);function Fg({className:e,target:t,edge:n,state:r,title:i,text:a,style:o}){let s=(0,_.useContext)(Pg);if(s===null||t===void 0)return(0,D.jsx)(`span`,{className:e,"data-edge":n,"data-state":r,title:i,style:o,children:a});let c=s.isOpen(Me(t));return(0,D.jsx)(`button`,{type:`button`,className:`${e} nodrag${n===void 0?``:` nopan`}`,"data-edge":n,"data-state":r,title:i,"aria-expanded":c,"aria-label":`${i} — ${c?`hide`:`show`}`,style:o,onMouseDown:Lg,onClick:e=>{e.stopPropagation(),s.toggle(t)},children:a})}function Ig({className:e,edge:t,state:n,style:r,onAdd:i,onPointerDown:a}){return(0,D.jsx)(`button`,{type:`button`,className:e,"data-edge":t,"data-state":n,"aria-label":`Add a threat`,title:`Add a threat`,style:r,onMouseDown:Lg,onPointerDown:a,onClick:e=>{e.stopPropagation(),i()},children:`+`})}var Lg=e=>e.stopPropagation();function Rg({open:e,total:t}){return{state:e>0?`open`:`handled`,text:e>0?String(e):`✓`,title:`${e} open of ${t} threat${t===1?``:`s`}`}}var zg=10,Tre=24,Ere=e=>({x:e.point.x+e.normal.x*zg,y:e.point.y+e.normal.y*zg});function Bg(e,t){let n=ig(e,t),r=Ere(n);return{frame:n,at:r,transform:`translate(-50%, -50%) translate(${r.x}px, ${r.y}px)`}}function Dre({id:e,data:t,curve:n,profile:r}){let{threatBadge:i,addThreat:a}=Ore(t,r),o=i!==void 0||a!==void 0?Bg(n,.75):void 0,s=t.annotations===void 0?void 0:Ng(t.annotations),c=s===void 0?void 0:Bg(n,.25),l=(0,_.useContext)(Pg),u=t.threatRelation===void 0?void 0:{relation:t.threatRelation};return kre(l,{relation:i!==void 0||s!==void 0?t.threatRelation:void 0,spot:i===void 0?c:o,curve:n}),(0,D.jsxs)(D.Fragment,{children:[o!==void 0&&i!==void 0&&(0,D.jsx)(Th,{children:(0,D.jsx)(Fg,{className:`dg-threat-badge dg-edge-threat`,target:u,edge:e,state:i.state,title:i.title,text:i.text,style:{transform:o.transform}})}),c!==void 0&&s!==void 0&&(0,D.jsx)(Th,{children:(0,D.jsx)(Fg,{className:`dg-comment-badge dg-edge-comment`,target:u,edge:e,title:s.title,text:s.text,style:{transform:c.transform}})}),o!==void 0&&a!==void 0&&(0,D.jsx)(Th,{children:(0,D.jsx)(Ig,{className:`dg-threat-badge dg-edge-threat nodrag nopan`,edge:e,state:`empty`,style:{transform:o.transform},onAdd:a})})]})}function Ore(e,t){let n=e.threats!==void 0&&e.threats.total>0?e.threats:void 0,r=n===void 0&&e.onAddThreat!==void 0&&t.offersThreats===!0?e.onAddThreat:void 0;return{threatBadge:n===void 0?void 0:Rg(n),addThreat:r}}function kre(e,t){let{relation:n,curve:r}=t,i=t.spot?.at.x,a=t.spot?.at.y,o=t.spot?.frame.normal.x,s=t.spot?.frame.normal.y,c=(0,_.useRef)([]),l=``;e!==null&&n!==void 0&&(c.current=Array.from({length:25},(e,t)=>{let n=r.point(t/Tre);return{x:Math.round(n.x),y:Math.round(n.y)}}),l=c.current.map(e=>`${e.x},${e.y}`).join(`;`)),(0,_.useEffect)(()=>{e!==null&&n!==void 0&&i!==void 0&&a!==void 0&&o!==void 0&&s!==void 0&&e.placeBadge(n,{x:i,y:a},{x:o,y:s},c.current)},[e,n,i,a,o,s,l])}function Are(e,t,n){let r=t?.relStyle,i=t?.kindRegistry.resolve(t.kind)??{},a=r?.width??i.width??1.5,o=r?.line??(i.dashed===!0?`dashed`:`solid`),s=r?.animated??i.animated===!0;return{kind:i,...jre(t,n),strokeWidth:a,line:o,animated:s,dashArray:Hg(o,a,s,t?.edgeLook?.dash),...Ug(e,{end:r?.end??i.endMarker??`arrow`,start:i.startMarker},t?.edgeLook?.openArrow),markerSize:10+a*2}}function Vg(e){return{stroke:e.stroke,strokeWidth:e.strokeWidth,...e.dashArray===void 0?{}:{strokeDasharray:e.dashArray},...e.line===`dotted`?{strokeLinecap:`round`}:{},...e.animated?{animation:`dg-flow 0.7s linear infinite`}:{}}}function jre(e,t){let n=e?.polarity===void 0?void 0:t.edge?.polarityColors?.[e.polarity];return{stroke:e?.relStyle?.color??e?.tint??e?.notationColor??n??`var(--dg-edge)`,polarityColor:n}}function Hg(e,t,n,r){return e===`dashed`?r?.dashed??`6 4`:e===`dotted`?`0.1 ${Math.max(5,t*3)}`:n?`6 4`:r?.solid}function Ug(e,t,n){let r=e.replace(/[^a-zA-Z0-9_-]/g,`_`);return{end:Wg(`dg-end-${r}`,t.end,n),start:Wg(`dg-start-${r}`,t.start,n)}}function Wg(e,t,n){if(t===void 0)return;if(t===`arrow`&&n===!0)return{id:e,style:`open-arrow`,shape:Tg};let r=wg[t];return r===void 0?void 0:{id:e,style:t,shape:r}}var Gg=e=>({x:e.internals.positionAbsolute.x,y:e.internals.positionAbsolute.y,width:e.measured?.width??0,height:e.measured?.height??0});function Kg(e,t){let n=Gg(e),r=Gg(t),i=n.width/2||1,a=n.height/2||1,o=n.x+i,s=n.y+a,c=r.x+(r.width/2||1),l=r.y+(r.height/2||1),u=(c-o)/(2*i)-(l-s)/(2*a),d=(c-o)/(2*i)+(l-s)/(2*a),f=1/(Math.abs(u)+Math.abs(d)||1),p=f*u,m=f*d;return{x:i*(p+m)+o,y:a*(-p+m)+s}}function qg(e,t){let n=Gg(e),r=Math.round(n.x),i=Math.round(n.y),a=Math.round(t.x),o=Math.round(t.y);return a<=r+1?rd.Left:a>=r+n.width-1?rd.Right:o<=i+1?rd.Top:o>=i+n.height-1?rd.Bottom:rd.Top}var Jg=e=>e!=null&&T.includes(e)?e:void 0,Yg={top:rd.Top,right:rd.Right,bottom:rd.Bottom,left:rd.Left};function Xg(e){switch(e){case rd.Top:return`top`;case rd.Right:return`right`;case rd.Bottom:return`bottom`;case rd.Left:return`left`}}function Mre(e,t,n){let r=e??(t.source===n.from?t.target===n.to?null:`target`:`source`);if(r===`source`)return{end:`from`,side:t.source===n.from?Jg(t.sourceHandle)??null:null};if(r===`target`)return{end:`to`,side:t.target===n.to?Jg(t.targetHandle)??null:null}}function Zg(e,t){let n=Gg(e);switch(t){case`top`:return{x:n.x+n.width/2,y:n.y};case`bottom`:return{x:n.x+n.width/2,y:n.y+n.height};case`left`:return{x:n.x,y:n.y+n.height/2};case`right`:return{x:n.x+n.width,y:n.y+n.height/2}}}function Qg(e,t,n){let r=n?.sourceSide===void 0?Kg(e,t):Zg(e,n.sourceSide),i=n?.targetSide===void 0?Kg(t,e):Zg(t,n.targetSide);return{sx:r.x,sy:r.y,tx:i.x,ty:i.y,sourcePos:n?.sourceSide===void 0?qg(e,r):Yg[n.sourceSide],targetPos:n?.targetSide===void 0?qg(t,i):Yg[n.targetSide]}}var $g=5,e_=16;function Nre({ends:e,data:t}){let n=t.onSetSide;if(n===void 0||t.fixedSideDotsShown!==!0||t.constituentCount!==1)return null;let r=e.tx-e.sx,i=e.ty-e.sy,a=Math.hypot(r,i)||1,o=-i/a*e_,s=r/a*e_,c=t.relStyle?.fromSide!==void 0,l=t.relStyle?.toSide!==void 0;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(t_,{end:`from`,cx:e.sx+o,cy:e.sy+s,fixed:c,onToggle:()=>n(`from`,c?null:Xg(e.sourcePos))}),(0,D.jsx)(t_,{end:`to`,cx:e.tx+o,cy:e.ty+s,fixed:l,onToggle:()=>n(`to`,l?null:Xg(e.targetPos))})]})}function t_({end:e,cx:t,cy:n,fixed:r,onToggle:i}){return(0,D.jsx)(`circle`,{className:`dg-edge-pin${r?` pinned`:``}`,"data-end":e,cx:t,cy:n,r:$g,role:`button`,"aria-label":`${r?`Unpin`:`Pin`} ${e===`from`?`source`:`target`} end`,onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),i()}})}var n_=7.2,Pre=20,Fre=24,r_=16,Ire=160,Lre=340;function i_(e,t=``){let n=e=>Fre+e.name.length*n_+r_+(e.type?.length??0)*n_,r=e.reduce((e,t)=>Math.max(e,n(t)),0),i=t.length*n_;return{width:Math.min(Lre,Math.max(Ire,Math.round(Math.max(r,i)+Pre))),height:30+e.length*22}}function a_(e,t,n){let r=t,i=e=>{e.columns!==void 0&&e.node.type===`db-table`&&n?.[e.id]===void 0&&(r===t&&(r=new Map(t)),r.set(e.id,i_(e.columns,e.node.name))),e.children.forEach(i)};return e.forEach(i),r}function o_(e){return 30+e*22+22/2}function s_(e,t,n){if(n===void 0||t.columns===void 0||e.pos!==rd.Left&&e.pos!==rd.Right)return e;let r=t.columns.findIndex(e=>e.name===n);return r<0?e:{x:e.pos===rd.Left?t.x:t.x+t.width,y:t.y+o_(r),pos:e.pos}}function Rre(e,t){let n=qte(e.source),r=qte(e.target),i=(n?.measured?.width??0)>0&&(r?.measured?.width??0)>0,a=t?.relStyle,o={ends:i&&n!==void 0&&r!==void 0?Qg(n,r,{sourceSide:a?.fromSide,targetSide:a?.toSide}):{sx:e.sourceX,sy:e.sourceY,tx:e.targetX,ty:e.targetY,sourcePos:e.sourcePosition,targetPos:e.targetPosition},measured:i,selfLoop:e.source===e.target,source:c_(n),target:c_(r)};return{...o,...zre(o,t)}}function c_(e){if(e!==void 0)return{node:e,rect:{x:e.internals.positionAbsolute.x,y:e.internals.positionAbsolute.y,width:e.measured?.width??0,height:e.measured?.height??0,columns:e.data.columns}}}function zre(e,t){let{ends:n,measured:r,source:i,target:a}=e,o={x:n.sx,y:n.sy},s={x:n.tx,y:n.ty};if(r&&t?.fromColumn!==void 0&&i?.rect.columns!==void 0){let e=s_({x:n.sx,y:n.sy,pos:n.sourcePos},i.rect,t.fromColumn);o={x:e.x,y:e.y}}let c=t?.toColumn??a?.rect.columns?.find(e=>e.pk===!0)?.name;if(r&&c!==void 0&&a?.rect.columns!==void 0&&(t?.fromColumn!==void 0||t?.toColumn!==void 0)){let e=s_({x:n.tx,y:n.ty,pos:n.targetPos},a.rect,c);s={x:e.x,y:e.y}}return{from:o,to:s}}function l_(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function Bre(e,t){return e[0]===t[0]&&e[1]===t[1]}function u_(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)l_(e,s,i);let c=function(e,t,n){let r=[];for(let t of e){let e=[...t];Bre(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!a.length)return i;let o=[],s=a[0].ymin,c=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;t<a.length&&!(a[t].ymin>s);t++)e=t;a.splice(0,e+1).forEach((e=>{o.push({s,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=s))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),(n!==1||c%t==0)&&o.length>1)for(let e=0;e<o.length;e+=2){let t=e+1;if(t>=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach((e=>{e.edge.x=e.edge.x+n*e.edge.islope})),c++}return i}(o,a,r);if(i){for(let e of o)l_(e,s,-i);(function(e,t,n){let r=[];e.forEach((e=>r.push(...e))),l_(r,t,n)})(c,s,-i)}return c}function d_(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.round(Math.max(r,.1));let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),u_(e,r,n,i||1)}var f_=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=d_(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}};function p_(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var Vre=class extends f_{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);let r=d_(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(let[e,t]of r)p_([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},Hre=class extends f_{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},Ure=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=d_(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=p_(o),s=e/r,c=Math.ceil(s)-1,l=e-c*r,u=(o[0][0]+o[1][0])/2-r/4,d=Math.min(o[0][1],o[1][1]);for(let e=0;e<c;e++){let o=d+l+e*r,s=u-a+2*Math.random()*a,c=o-a+2*Math.random()*a,f=this.helper.ellipse(s,c,i,i,t);n.push(...f.ops)}}return{type:`fillSketch`,ops:n}}},m_=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=d_(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{let a=p_(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,c=e[0],l=e[1];c[0]>l[0]&&(c=e[1],l=e[0]);let u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let e=0;e<o;e++){let a=e*(n+r),o=a+n,l=[c[0]+a*Math.cos(u)+s*Math.cos(u),c[1]+a*Math.sin(u)+s*Math.sin(u)],d=[c[0]+o*Math.cos(u)+s*Math.cos(u),c[1]+o*Math.sin(u)+s*Math.sin(u)];i.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],t))}})),i}},Wre=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=d_(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach((e=>{let i=p_(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;e<a;e++){let i=2*e*t,a=2*(e+1)*t,s=Math.sqrt(2*t**2),l=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],u=[o[0]+a*Math.cos(c),o[1]+a*Math.sin(c)],d=[l[0]+s*Math.cos(c+Math.PI/4),l[1]+s*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}},h_={},g_=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},__=0,v_=1,y_=2,b_={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function x_(e,t){return e.type===t}function S_(e){let t=[],n=function(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:__,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:v_,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:y_,text:``},t}(e),r=`BOD`,i=0,a=n[i];for(;!x_(a,y_);){let o=0,s=[];if(r===`BOD`){if(a.text!==`M`&&a.text!==`m`)return S_(`M0,0`+e);i++,o=b_[a.text],r=a.text}else x_(a,v_)?o=b_[r]:(i++,o=b_[a.text],r=a.text);if(!(i+o<n.length))throw Error(`Path data ended short`);for(let e=i;e<i+o;e++){let t=n[e];if(!x_(t,v_))throw Error(`Param not a number: `+r+`,`+t.text);s[s.length]=+t.text}if(typeof b_[r]!=`number`)throw Error(`Bad segment: `+r);{let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}}return t}function C_(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function Gre(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,c=0;for(let{key:l,data:u}of e){switch(l){case`M`:t.push({key:`M`,data:[...u]}),[r,i]=u,[a,o]=u;break;case`C`:t.push({key:`C`,data:[...u]}),r=u[4],i=u[5],s=u[2],c=u[3];break;case`L`:t.push({key:`L`,data:[...u]}),[r,i]=u;break;case`H`:r=u[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=u[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-c)):(e=r,a=i),t.push({key:`C`,data:[e,a,...u]}),s=u[0],c=u[1],r=u[2],i=u[3];break}case`T`:{let[e,a]=u,o=0,l=0;n===`Q`||n===`T`?(o=r+(r-s),l=i+(i-c)):(o=r,l=i);let d=r+2*(o-r)/3,f=i+2*(l-i)/3,p=e+2*(o-e)/3,m=a+2*(l-a)/3;t.push({key:`C`,data:[d,f,p,m,e,a]}),s=o,c=l,r=e,i=a;break}case`Q`:{let[e,n,a,o]=u,l=r+2*(e-r)/3,d=i+2*(n-i)/3,f=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:`C`,data:[l,d,f,p,a,o]}),s=e,c=n,r=a,i=o;break}case`A`:{let e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],c=u[5],l=u[6];e===0||n===0?(t.push({key:`C`,data:[r,i,c,l,c,l]}),r=c,i=l):(r!==c||i!==l)&&(Kre(r,i,c,l,e,n,a,o,s).forEach((function(e){t.push({key:`C`,data:e})})),r=c,i=l);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=l}return t}function w_(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Kre(e,t,n,r,i,a,o,s,c,l){let u=(d=o,Math.PI*d/180);var d;let f=[],p=0,m=0,h=0,g=0;if(l)[p,m,h,g]=l;else{[e,t]=w_(e,t,-u),[n,r]=w_(n,r,-u);let o=(e-n)/2,l=(t-r)/2,d=o*o/(i*i)+l*l/(a*a);d>1&&(d=Math.sqrt(d),i*=d,a*=d);let f=i*i,_=a*a,v=f*_-f*l*l-_*o*o,y=f*l*l+_*o*o,b=(s===c?-1:1)*Math.sqrt(Math.abs(v/y));h=b*i*l/a+(e+n)/2,g=b*-a*o/i+(t+r)/2,p=Math.asin(parseFloat(((t-g)/a).toFixed(9))),m=Math.asin(parseFloat(((r-g)/a).toFixed(9))),e<h&&(p=Math.PI-p),n<h&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),c&&p>m&&(p-=2*Math.PI),!c&&m>p&&(m-=2*Math.PI)}let _=m-p;if(Math.abs(_)>120*Math.PI/180){let e=m,t=n,s=r;m=c&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=Kre(n=h+i*Math.cos(m),r=g+a*Math.sin(m),t,s,i,a,o,0,c,[m,e,h,g])}_=m-p;let v=Math.cos(p),y=Math.sin(p),b=Math.cos(m),x=Math.sin(m),S=Math.tan(_/4),C=4/3*i*S,w=4/3*a*S,T=[e,t],E=[e+C*y,t-w*v],ee=[n+C*x,r-w*b],te=[n,r];if(E[0]=2*T[0]-E[0],E[1]=2*T[1]-E[1],l)return[E,ee,te].concat(f);{f=[E,ee,te].concat(f);let e=[];for(let t=0;t<f.length;t+=3){let n=w_(f[t][0],f[t][1],u),r=w_(f[t+1][0],f[t+1][1],u),i=w_(f[t+2][0],f[t+2][1],u);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}var qre={randOffset:function(e,t){return L_(e,t)},randOffsetWithRange:function(e,t,n){return I_(e,t,n)},ellipse:function(e,t,n,r,i){return k_(e,t,i,O_(n,r,i)).opset},doubleLineOps:function(e,t,n,r,i){return R_(e,t,n,r,i,!0)}};function T_(e,t,n,r,i){return{type:`path`,ops:R_(e,t,n,r,i)}}function E_(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(...R_(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...R_(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?T_(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function Jre(e,t,n,r,i){return function(e,t){return E_(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function D_(e,t){if(e.length){let n=typeof e[0][0]==`number`?[e]:e,r=B_(n[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:B_(n[0],1.5*(1+.22*t.roughness),P_(t));for(let e=1;e<n.length;e++){let a=n[e];if(a.length){let e=B_(a,1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:B_(a,1.5*(1+.22*t.roughness),P_(t));for(let t of e)t.op!==`move`&&r.push(t);for(let e of n)e.op!==`move`&&i.push(e)}}return{type:`path`,ops:r.concat(i)}}return{type:`path`,ops:[]}}function O_(e,t,n){let r=Math.sqrt(2*Math.PI*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=2*Math.PI/i,o=Math.abs(e/2),s=Math.abs(t/2),c=1-n.curveFitting;return o+=L_(o*c,n),s+=L_(s*c,n),{increment:a,rx:o,ry:s}}function k_(e,t,n,r){let[i,a]=Yre(r.increment,e,t,r.rx,r.ry,1,r.increment*I_(.1,I_(.4,1,n),n),n),o=V_(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=Yre(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=V_(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function A_(e,t,n,r,i,a,o,s,c){let l=e,u=t,d=Math.abs(n/2),f=Math.abs(r/2);d+=L_(.01*d,c),f+=L_(.01*f,c);let p=i,m=a;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);let h=2*Math.PI/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=H_(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=H_(g,l,u,d,f,p,m,1.5,c);_.push(...e)}return o&&(s?_.push(...R_(l,u,l+d*Math.cos(p),u+f*Math.sin(p),c),...R_(l,u,l+d*Math.cos(m),u+f*Math.sin(m),c)):_.push({op:`lineTo`,data:[l,u]},{op:`lineTo`,data:[l+d*Math.cos(p),u+f*Math.sin(p)]})),{type:`path`,ops:_}}function j_(e,t){let n=Gre(C_(S_(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(...R_(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,c,l]=o;r.push(...Xre(e,n,i,s,c,l,a,t)),a=[c,l];break}case`Z`:r.push(...R_(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function M_(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+L_(e,t),r[0][1]+L_(e,t)]});for(let a=1;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+L_(e,t),r[a][1]+L_(e,t)]})}}return{type:`fillPath`,ops:n}}function N_(e,t){return function(e,t){let n=e.fillStyle||`hachure`;if(!h_[n])switch(n){case`zigzag`:h_[n]||(h_[n]=new Vre(t));break;case`cross-hatch`:h_[n]||(h_[n]=new Hre(t));break;case`dots`:h_[n]||(h_[n]=new Ure(t));break;case`dashed`:h_[n]||(h_[n]=new m_(t));break;case`zigzag-line`:h_[n]||(h_[n]=new Wre(t));break;default:n=`hachure`,h_[n]||(h_[n]=new f_(t))}return h_[n]}(t,qre).fillPolygons(e,t)}function P_(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function F_(e){return e.randomizer||=new g_(e.seed||0),e.randomizer.next()}function I_(e,t,n,r=1){return n.roughness*r*(F_(n)*(t-e)+e)}function L_(e,t,n=1){return I_(-e,e,t,n)}function R_(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=z_(e,t,n,r,i,!0,!1);if(o)return s;let c=z_(e,t,n,r,i,!0,!0);return s.concat(c)}function z_(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=c/10);let d=u/2,f=.2+.2*F_(i),p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=L_(p,i,l),m=L_(m,i,l);let h=[],g=()=>L_(d,i,l),_=()=>L_(u,i,l),v=i.preserveVertices;return a&&(o?h.push({op:`move`,data:[e+(v?0:g()),t+(v?0:g())]}):h.push({op:`move`,data:[e+(v?0:L_(u,i,l)),t+(v?0:L_(u,i,l))]})),o?h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(v?0:g()),r+(v?0:g())]}):h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+_(),m+t+(r-t)*f+_(),p+e+2*(n-e)*f+_(),m+t+2*(r-t)*f+_(),n+(v?0:_()),r+(v?0:_())]}),h}function B_(e,t,n){if(!e.length)return[];let r=[];r.push([e[0][0]+L_(t,n),e[0][1]+L_(t,n)]),r.push([e[0][0]+L_(t,n),e[0][1]+L_(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+L_(t,n),e[i][1]+L_(t,n)]),i===e.length-1&&r.push([e[i][0]+L_(t,n),e[i][1]+L_(t,n)]);return V_(r,null,n)}function V_(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+L_(e,n),t[1]+L_(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...z_(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function Yre(e,t,n,r,i,a,o,s){let c=[],l=[];if(s.roughness===0){e/=4,l.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=2*Math.PI;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];c.push(e),l.push(e)}l.push([t+r*Math.cos(0),n+i*Math.sin(0)]),l.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let u=L_(.5,s)-Math.PI/2;l.push([L_(a,s)+t+.9*r*Math.cos(u-e),L_(a,s)+n+.9*i*Math.sin(u-e)]);let d=2*Math.PI+u-.01;for(let o=u;o<d;o+=e){let e=[L_(a,s)+t+r*Math.cos(o),L_(a,s)+n+i*Math.sin(o)];c.push(e),l.push(e)}l.push([L_(a,s)+t+r*Math.cos(u+2*Math.PI+.5*o),L_(a,s)+n+i*Math.sin(u+2*Math.PI+.5*o)]),l.push([L_(a,s)+t+.98*r*Math.cos(u+o),L_(a,s)+n+.98*i*Math.sin(u+o)]),l.push([L_(a,s)+t+.9*r*Math.cos(u+.5*o),L_(a,s)+n+.9*i*Math.sin(u+.5*o)])}return[l,c]}function H_(e,t,n,r,i,a,o,s,c){let l=a+L_(.1,c),u=[];u.push([L_(s,c)+t+.9*r*Math.cos(l-e),L_(s,c)+n+.9*i*Math.sin(l-e)]);for(let a=l;a<=o;a+=e)u.push([L_(s,c)+t+r*Math.cos(a),L_(s,c)+n+i*Math.sin(a)]);return u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),V_(u,null,c)}function Xre(e,t,n,r,i,a,o,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],u=[0,0],d=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let p=0;p<d;p++)p===0?c.push({op:`move`,data:[o[0],o[1]]}):c.push({op:`move`,data:[o[0]+(f?0:L_(l[0],s)),o[1]+(f?0:L_(l[0],s))]}),u=f?[i,a]:[i+L_(l[p],s),a+L_(l[p],s)],c.push({op:`bcurveTo`,data:[e+L_(l[p],s),t+L_(l[p],s),n+L_(l[p],s),r+L_(l[p],s),u[0],u[1]]});return c}function U_(e){return[...e]}function Zre(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(U_(e[0]),U_(e[1]),U_(e[2]),U_(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(U_(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function W_(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function G_(e,t,n){let r=W_(t,n);if(r===0)return W_(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),W_(e,K_(t,n,i))}function K_(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function q_(e,t,n,r){let i=r||[];if(function(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}(e,t)<n){let n=e[t+0];i.length?(a=i[i.length-1],o=n,Math.sqrt(W_(a,o)))>1&&i.push(n):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=K_(a,o,r),u=K_(o,s,r),d=K_(s,c,r),f=K_(l,u,r),p=K_(u,d,r),m=K_(f,p,r);q_([a,l,f,m],0,n,i),q_([m,p,d,c],0,n,i)}var a,o;return i}function J_(e,t){return Y_(e,0,e.length,t)}function Y_(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=G_(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(Y_(e,t,l+1,r,a),Y_(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function X_(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)q_(e,3*n,t,r);return n&&n>0?Y_(r,0,r.length,n):r}var Z_=`none`,Q_=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[T_(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=Jre(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(M_([i],a)):o.push(N_([i],a))}return a.stroke!==Z_&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=O_(n,r,a),c=k_(e,t,a,s);if(a.fill)if(a.fillStyle===`solid`){let n=k_(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(N_([c.estimatedPoints],a));return a.stroke!==Z_&&o.push(c.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[E_(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=A_(e,t,n,r,i,a,o,!0,c);if(o&&c.fill)if(c.fillStyle===`solid`){let o=Object.assign({},c);o.disableMultiStroke=!0;let s=A_(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(function(e,t,n,r,i,a,o){let s=e,c=t,l=Math.abs(n/2),u=Math.abs(r/2);l+=L_(.01*l,o),u+=L_(.01*u,o);let d=i,f=a;for(;d<0;)d+=2*Math.PI,f+=2*Math.PI;f-d>2*Math.PI&&(d=0,f=2*Math.PI);let p=(f-d)/o.curveStepCount,m=[];for(let e=d;e<=f;e+=p)m.push([s+l*Math.cos(e),c+u*Math.sin(e)]);return m.push([s+l*Math.cos(f),c+u*Math.sin(f)]),m.push([s,c]),N_([m],o)}(e,t,n,r,i,a,c));return c.stroke!==Z_&&l.push(u),this._d(`arc`,l,c)}curve(e,t){let n=this._o(t),r=[],i=D_(e,n);if(n.fill&&n.fill!==Z_)if(n.fillStyle===`solid`){let t=D_(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=[],i=e;if(i.length){let e=typeof i[0][0]==`number`?[i]:i;for(let r of e)r.length<3?t.push(...r):r.length===3?t.push(...X_(Zre([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...X_(Zre(r),10,(1+n.roughness)/2))}t.length&&r.push(N_([t],n))}return n.stroke!==Z_&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=E_(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(M_([e],n)):r.push(N_([e],n))),n.stroke!==Z_&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==Z_,a=n.stroke!==Z_,o=!!(n.simplification&&n.simplification<1),s=function(e,t,n){let r=Gre(C_(S_(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...X_(s,t)),s=[]},l=()=>{c(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:l(),o=[t[0],t[1]],a.push(o);break;case`L`:c(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:c(),a.push([o[0],o[1]])}if(l(),!n)return i;let u=[];for(let e of i){let t=J_(e,n);t.length&&u.push(t)}return u}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=j_(e,n);if(i)if(n.fillStyle===`solid`)if(s.length===1){let t=j_(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(M_(s,n));else r.push(N_(s,n));return a&&(o?s.forEach((e=>{r.push(E_(e,!1,n))})):r.push(c)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Z_};break;case`fillPath`:t={d:this.opsToPath(e),stroke:Z_,strokeWidth:0,fill:n.fill||Z_};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||Z_,strokeWidth:n,fill:Z_}}_mergedShape(e){return e.filter(((e,t)=>t===0||e.op!==`move`))}},$_=class{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext(`2d`),this.gen=new Q_(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(let a of t)switch(a.type){case`path`:r.save(),r.strokeStyle=n.stroke===`none`?`transparent`:n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case`fillPath`:{r.save(),r.fillStyle=n.fill||``;let t=e.shape===`curve`||e.shape===`polygon`||e.shape===`path`?`evenodd`:`nonzero`;this._drawToContext(r,a,i,t),r.restore();break}case`fillSketch`:this.fillSketch(r,a,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||``,e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r=`nonzero`){e.beginPath();for(let r of t.ops){let t=typeof n==`number`&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case`move`:e.moveTo(t[0],t[1]);break;case`bcurveTo`:e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case`lineTo`:e.lineTo(t[0],t[1])}}t.type===`fillPath`?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a),a}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a),a}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a),a}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c),c}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){let n=this.gen.path(e,t);return this.draw(n),n}},ev=`http://www.w3.org/2000/svg`,Qre=class{constructor(e,t){this.svg=e,this.gen=new Q_(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(ev,`g`),a=e.options.fixedDecimalPlaceDigits;for(let o of t){let t=null;switch(o.type){case`path`:t=r.createElementNS(ev,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,n.stroke),t.setAttribute(`stroke-width`,n.strokeWidth+``),t.setAttribute(`fill`,`none`),n.strokeLineDash&&t.setAttribute(`stroke-dasharray`,n.strokeLineDash.join(` `).trim()),n.strokeLineDashOffset&&t.setAttribute(`stroke-dashoffset`,`${n.strokeLineDashOffset}`);break;case`fillPath`:t=r.createElementNS(ev,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,`none`),t.setAttribute(`stroke-width`,`0`),t.setAttribute(`fill`,n.fill||``),e.shape!==`curve`&&e.shape!==`polygon`||t.setAttribute(`fill-rule`,`evenodd`);break;case`fillSketch`:t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let i=e.createElementNS(ev,`path`);return i.setAttribute(`d`,this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute(`stroke`,n.fill||``),i.setAttribute(`stroke-width`,r+``),i.setAttribute(`fill`,`none`),n.fillLineDash&&i.setAttribute(`stroke-dasharray`,n.fillLineDash.join(` `).trim()),n.fillLineDashOffset&&i.setAttribute(`stroke-dashoffset`,`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c)}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n)}path(e,t){let n=this.gen.path(e,t);return this.draw(n)}},tv={canvas:(e,t)=>new $_(e,t),svg:(e,t)=>new Qre(e,t),generator:e=>new Q_(e),newSeed:()=>Q_.newSeed()}.generator(),nv=`sentinel-fill`,A=`sentinel-stroke`;function rv(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0||1}var iv=({style:e,seed:t})=>({roughness:e.roughness,bowing:e.bowing,strokeWidth:e.strokeWidth,fillStyle:e.fillStyle,...e.fillWeight===void 0?{}:{fillWeight:e.fillWeight},...e.hachureGap===void 0?{}:{hachureGap:e.hachureGap},fill:nv,stroke:A,seed:t});function $re(e){let t=t=>e.filter(t).map(e=>e.d).join(` `);return{fill:t(e=>e.fill===nv),hatch:t(e=>e.stroke===nv),stroke:t(e=>e.stroke===A)}}function av(e,t){let n=Math.min(e*.2,24);return[[n,1],[e-n,1],[e-1,t/2],[e-n,t-1],[n,t-1],[1,t/2]]}var ov={left:14,width:16,height:12};function eie(e,t,n,r=(e,t,n)=>[`L ${n} ${t}`]){let i=e-1,a=t-1,o=Math.max(0,Math.min(n,(i-1)/2,(a-1)/2));return[`M ${1+o} 1`,`L ${i-o} 1`,`Q ${i} 1 ${i} ${1+o}`,`L ${i} ${a-o}`,`Q ${i} ${a} ${i-o} ${a}`,...r(i-o,a,1+o),`Q 1 ${a} 1 ${a-o}`,`L 1 ${1+o}`,`Q 1 1 ${1+o} 1`,`Z`].join(` `)}function tie(e,t,n){return eie(e,t,n,(e,t,n)=>{let r=Math.max(n,Math.min(n+ov.left,e));return[`L ${Math.min(r+ov.width,e)} ${t}`,`L ${r} ${t+ov.height}`,`L ${r} ${t}`,`L ${n} ${t}`]})}function sv(e,t,n,r=0){let i=Math.max(2,t.width),a=Math.max(2,t.height),o=iv(n);return $re((e===`circle`?[tv.circle(i/2,a/2,Math.min(i,a)-2,o)]:e===`person`?[tv.circle(i/2,Math.min(a*.22,18),Math.min(i,a)*.32,o),tv.rectangle(i*.12,Math.min(a*.38,30),i*.76,a-Math.min(a*.38,30)-1,o)]:e===`hexagon`?[tv.polygon(av(i,a),o)]:e===`cylinder`?[tv.rectangle(1,8,i-2,a-10,o),tv.ellipse(i/2,8,i-6,14,o)]:e===`bubble`?[tv.path(tie(i,a,r),o)]:e===`diamond`?[tv.polygon([[i/2,1],[i-1,a/2],[i/2,a-1],[1,a/2]],o)]:e===`bar`?[tv.rectangle(1,1,i-2,a-2,{...o,fillStyle:`solid`})]:e===`start-dot`?[tv.circle(i/2,a/2,Math.min(i,a)-2,{...o,fillStyle:`solid`})]:e===`end-bullseye`?[tv.circle(i/2,a/2,Math.min(i,a)-2,o),tv.circle(i/2,a/2,(Math.min(i,a)-2)*.55,{...o,fillStyle:`solid`})]:e===`send-signal`?[tv.polygon([[1,1],[i-15,1],[i-1,a/2],[i-15,a-1],[1,a-1]],o)]:e===`receive-signal`?[tv.polygon([[1,1],[i-1,1],[i-1,a-1],[1,a-1],[15,a/2]],o)]:e===`note`?[tv.polygon([[1,1],[i-15,1],[i-1,15],[i-1,a-1],[1,a-1]],o),tv.linearPath([[i-15,1],[i-15,15],[i-1,15]],o)]:e===`ellipse`?[tv.ellipse(i/2,a/2,i-2,a-2,o)]:e===`store`?[tv.line(1,1,i-1,1,o),tv.line(1,a-1,i-1,a-1,o)]:r>0?[tv.path(eie(i,a,r),o)]:[tv.rectangle(1,1,i-2,a-2,o)]).flatMap(e=>tv.toPaths(e)))}function cv(e,t,n){let r=Math.max(2,t);return $re(tv.toPaths(tv.circle(e.x,e.y,r,iv(n))))}function lv(e,t){let n={...iv(t),fill:void 0,disableMultiStroke:!0},r=tv.toPaths(tv.path(e,n)).filter(e=>e.stroke===A).map(e=>e.d).join(` `);return r===``?e:r}function uv(e){let t=new Map;for(let n of e){if(n.from===n.to)continue;let e=n.from<n.to,r=e?`${n.from}\0${n.to}`:`${n.to}\0${n.from}`,i=t.get(r)??[];i.push({id:n.id,forward:e}),t.set(r,i)}let n=new Map;for(let e of t.values())e.forEach(({id:e,forward:t},r)=>{if(r===0)return;let i=Math.ceil(r/2)*32*(r%2==1?1:-1);n.set(e,t?i:-i)});return n}var dv=e=>Math.abs(e)*4/3;function fv(e){let t=e.shape===`curved`,n=t&&!e.profileBows?e.parallelBow??0:0;return n===0?{bowed:t&&e.profileBows,side:e.side??`left`,bulge:void 0}:{bowed:!0,side:n>0?`left`:`right`,bulge:dv(n)}}var pv=28,mv=18,hv=.2,gv=10,_v=4,vv=16,nie=4.5,yv=e=>pv+e*mv,bv=e=>Math.max(rie(e),vv),rie=e=>Math.max(e*hv,Math.min(e/2-_v,gv),0);function iie(e,t,n,r){let i=yv(n),a=i*4/3,o=t===`DOWN`||t===`UP`,s=o?e.height:e.width,c=rie(s),l=(bv(s)-c)*nie,u=(t,n)=>o?{x:e.x+e.width+n,y:e.y+s/2+t}:{x:e.x+s/2+t,y:e.y-n},d=i+10+(o?r/2:0);return{from:u(-c,0),c1:u(-c-l,a),c2:u(c+l,a),to:u(c,0),label:u(0,d)}}function aie(e,t,n=0,r=0){let{from:i,c1:a,c2:o,to:s,label:c}=iie(e,t,n,r);return{path:`M ${i.x} ${i.y} C ${a.x} ${a.y} ${o.x} ${o.y} ${s.x} ${s.y}`,labelX:c.x,labelY:c.y}}function oie(e,t,n=0){let{from:r,c1:i,c2:a,to:o}=iie(e,t,n,0),s=e=>[r[e],i[e],a[e],o[e]],c=(e,[t,n,r,i])=>(1-e)**3*t+3*(1-e)**2*e*n+3*(1-e)*e**2*r+e**3*i,l=(e,[t,n,r,i])=>3*(1-e)**2*(n-t)+6*(1-e)*e*(r-n)+3*e**2*(i-r);return{point:e=>({x:c(e,s(`x`)),y:c(e,s(`y`))}),tangent:e=>{let t=l(e,s(`x`)),n=l(e,s(`y`)),r=Math.hypot(t,n)||1;return{x:t/r,y:n/r}}}}function xv(e){let t=new Map,n=new Map;for(let r of e){if(r.from!==r.to)continue;let e=t.get(r.from)??0;n.set(r.id,e),t.set(r.from,e+1)}return n}function Sv(e,t,n,r){let i=Cv(t,n),{path:a,curve:o,label:s,labelSpot:c}=t.selfLoop?Ev(t,n):i!==void 0&&n!==void 0?Tv(i,t,n):Dv(t,n,r);return{path:a,renderPath:(0,_.useMemo)(()=>n?.stylePreset?.rough===void 0?a:lv(a,{style:n.stylePreset.rough,seed:rv(e)}),[n?.stylePreset,a,e]),curve:o,label:s,labelSpot:c}}function Cv(e,t){let n=t?.route;if(t===void 0||n===void 0||n.length<2||t.fromColumn!==void 0||t.toColumn!==void 0)return;let r=t.relStyle;return r?.shape===void 0&&(r?.fromSide===void 0||r.fromSide===cg(n).from)&&(r?.toSide===void 0||r.toSide===cg(n).to)&&wv(e.source,t.routeFrom)&&wv(e.target,t.routeTo)?n:void 0}var wv=(e,t)=>e!==void 0&&t!==void 0&&Math.abs(e.node.internals.positionAbsolute.x-t.x)<.5&&Math.abs(e.node.internals.positionAbsolute.y-t.y)<.5;function Tv(e,t,n){let r=e=>!t.measured||e===void 0?void 0:{...e.rect,height:e.rect.height+Ov(e.node.data)},i=lg(sg(e),r(t.source),r(t.target)),a=gre(i),o=n.labelSpot===void 0?void 0:og(i,n.labelSpot);return{path:_re(i,n.routeCorner??8),curve:a,label:o??a.point(.5),labelSpot:o}}function Ev(e,t){let n=t?.selfLoop?.direction??`RIGHT`,r=t?.selfLoop?.index??0,i=e.source?.rect??{x:e.from.x,y:e.from.y,width:0,height:0},a=aie(i,n,r,t?.selfLoop?.labelWidth),o={x:a.labelX,y:a.labelY};return{path:a.path,curve:oie(i,n,r),label:o,labelSpot:o}}function Dv(e,t,n){let r=t?.relStyle,i=r?.shape??`curved`,a={sourceX:e.from.x,sourceY:e.from.y,targetX:e.to.x,targetY:e.to.y,sourcePosition:e.ends.sourcePos,targetPosition:e.ends.targetPos},o=r?.curvature??n.edgeCurvature,{bowed:s,side:c,bulge:l}=fv({shape:i,profileBows:n.edge?.bowed===!0,side:r?.bow,parallelBow:t?.parallelBow}),u=hre({shape:s?`bow`:i,params:a,curvature:o,side:c,bulge:l}),d,f,p;if(i===`straight`)[d,f,p]=pf({sourceX:a.sourceX,sourceY:a.sourceY,targetX:a.targetX,targetY:a.targetY});else if(i===`step`)[d,f,p]=_f(a);else if(s){let e=u.point(.5);d=tg(a,o??.25,c,l),f=e.x,p=e.y}else[d,f,p]=of({...a,...o===void 0?{}:{curvature:o}});return{path:d,curve:u,label:{x:f,y:p},labelSpot:void 0}}function Ov(e){return e.state!==`leaf`||e.label===``?0:e.image===void 0&&e.typeId!==void 0&&e.typeRegistry.resolve(e.typeId).captionBelow===!0?vg(e.label).height:e.image===void 0||e.shape!==void 0||e.typeId!==void 0&&e.typeRegistry.resolve(e.typeId).cornerBadge===!0?0:20}function kv({id:e,source:t,target:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,data:l}){let u=Rre({source:t,target:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c},l),d=ua(l?.notation),{path:f,renderPath:p,curve:m,label:h,labelSpot:g}=Sv(e,u,l,d),v=Are(e,l,d);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`g`,{className:jv((0,_.useContext)(Xh),e),children:[(0,D.jsx)(Dg,{end:v.end,start:v.start,stroke:v.stroke,size:v.markerSize}),(0,D.jsx)($m,{id:e,path:p,...v.end===void 0?{}:{markerEnd:`url(#${v.end.id})`},...v.start===void 0?{}:{markerStart:`url(#${v.start.id})`},style:Vg(v)}),(0,D.jsx)(`path`,{d:f,fill:`none`,stroke:`transparent`,strokeWidth:14,children:(0,D.jsx)(`title`,{children:Av(l)})}),l!==void 0&&(0,D.jsx)(wre,{curve:m,data:l,profile:d,look:v})]}),l!==void 0&&(0,D.jsx)(Nre,{ends:u.ends,data:l}),l!==void 0&&(0,D.jsx)(Cre,{data:l,curve:m,label:h,labelSpot:g}),l!==void 0&&(0,D.jsx)(Dre,{id:e,data:l,curve:m,profile:d})]})}function Av(e){return`${e?.kind??``}${e!==void 0&&e.constituentCount>1?` ×${e.constituentCount}`:``}${e?.labels===void 0&&e?.label!==void 0?` — ${e.label}`:``}`}function jv(e,t){return e.active?e.edges.has(t)?e.variant===`loop`?`dg-loop-edge-hl`:void 0:e.variant===`loop`?`dg-loop-edge-dim`:`dg-focus-edge-dim`:void 0}var Mv={fill:14,stroke:100},Nv=.35;function sie({id:e,kind:t,width:n,height:r,color:i,preset:a,fill:o=`preset`}){let s=a.rough,c=(0,_.useMemo)(()=>rv(e),[e]),l=s!==void 0&&s.fillStyle!==`solid`&&o===`preset`,u=(0,_.useMemo)(()=>{if(s===void 0)return null;let e=a.cornerRadius??0,i={width:n,height:r},o=sv(t,i,{style:{...s,fillStyle:`solid`},seed:c},e);return l?{...sv(t,i,{style:s,seed:c},e),fill:o.fill}:o},[t,n,r,c,s,l,a.cornerRadius]);if(u===null||s===void 0)return null;let d=a.colorMix??Mv,f=(e,t)=>i===void 0?void 0:`color-mix(in srgb, ${i} ${e}%, var(${t}))`,p=f(d.fill,`--dg-node-fill`),m=f(d.stroke,`--dg-node-stroke`);return(0,D.jsxs)(`svg`,{className:`dg-sketch-shape`,width:n,height:r,viewBox:`0 0 ${n} ${r}`,"aria-hidden":`true`,children:[o!==`none`&&u.fill!==``&&(0,D.jsx)(`path`,{className:`dg-sketch-fill`,d:u.fill,style:p===void 0?void 0:{fill:p}}),l&&u.hatch!==``&&(0,D.jsx)(`path`,{className:`dg-sketch-hatch`,d:u.hatch,style:{strokeWidth:s.fillWeight??1,opacity:s.hatchOpacity??Nv,stroke:m}}),(0,D.jsx)(`path`,{className:`dg-sketch-stroke`,d:u.stroke,style:{strokeWidth:s.strokeWidth,stroke:m}})]})}var Pv=e=>e.startsWith(`var(`)?e:`color-mix(in srgb, ${e} var(--dg-outline-ink, 100%), var(--dg-text))`;function Fv(e){if(e!==void 0)return{borderColor:e,background:`color-mix(in srgb, ${e} var(--dg-node-accent-tint, 14%), var(--dg-node-fill))`}}var cie=e=>e===`circle`||e===`cylinder`||e===`hexagon`||e===`bubble`||e===`person`||e===`diamond`||e===`bar`||e===`start-dot`||e===`end-bullseye`||e===`send-signal`||e===`receive-signal`||e===`note`||e===`ellipse`||e===`store`?e:`box`,Iv=(e,t,n)=>t!==void 0&&n.startsWith(`/library/`)?`${t}${n.slice(9)}`:n.startsWith(`/`)||/^https?:/.test(n)?n:`${e??``}${n}`,Lv=(e,t,{id:n,width:r,height:i},a=`preset`)=>e.stylePreset?.rough!==void 0&&r!==void 0&&i!==void 0&&r>0&&i>0?(0,D.jsx)(sie,{id:n,kind:cie(t),width:r,height:i,preset:e.stylePreset,fill:a,color:e.color===void 0?void 0:a===`none`?Pv(e.color):e.color}):null;function lie({id:e,data:t,selected:n}){if(t.resizeAxis!==`x`||t.onResize===void 0||n!==!0)return null;let r=t.onResize,i=(t,n)=>r(e,n.width,n.height,{x:n.x,y:n.y});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Ph,{position:`left`,resizeDirection:`horizontal`,minWidth:lr.DAY,className:`dg-x-resize`,onResizeEnd:i}),(0,D.jsx)(Ph,{position:`right`,resizeDirection:`horizontal`,minWidth:lr.DAY,className:`dg-x-resize`,onResizeEnd:i})]})}var Rv=(e,t)=>t.node?.typelessAsText===!0&&e.typeId===void 0&&e.state!==`leaf`,zv=(e,t)=>e.icon===void 0?e.typeId===void 0?void 0:e.icons.resolve(t.icon??``):e.icons.resolve(e.icon);function j({data:e}){return e.metaBadges!==void 0&&e.metaBadges.length>0?(0,D.jsx)(`span`,{className:`dg-meta`,children:e.metaBadges.map(e=>(0,D.jsx)(`span`,{className:`dg-meta-badge`,children:e},e))}):null}function uie(e,t,n,r){let i=r.focusId,a=i===null?void 0:t.chips?.find(e=>e.refId===i),o=t.typeId!==void 0&&n.node?.actorOutline?.(t.typeId)===!0,s=a===void 0?i!==null&&o&&e!==i&&r.nodes.has(e)?t.color??`var(--dg-accent)`:void 0:a.color??`var(--dg-accent)`;return{hitStyle:s===void 0?void 0:{"--dg-hit":s},hitAttrs:s===void 0?{}:{"data-plan-hit":!0}}}var Bv=e=>e.dropTarget===!0?{"data-drop-target":!0}:{};function die({data:e,style:t}){let n=e.typeId===void 0?void 0:Ar(t.label??e.typeId,e.technology);return n!==void 0&&n!==``?(0,D.jsx)(`span`,{className:`dg-type`,children:n}):null}var fie=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(zm,{id:`top`,type:`source`,position:rd.Top,className:`dg-handle`}),(0,D.jsx)(zm,{id:`right`,type:`source`,position:rd.Right,className:`dg-handle`}),(0,D.jsx)(zm,{id:`bottom`,type:`source`,position:rd.Bottom,className:`dg-handle`}),(0,D.jsx)(zm,{id:`left`,type:`source`,position:rd.Left,className:`dg-handle`})]});function pie({data:e}){if(e.link===void 0)return null;let t=e.link;return(0,D.jsx)(`button`,{type:`button`,className:`dg-link-badge`,title:t,"aria-label":`Open ${t}`,onClick:n=>{n.stopPropagation(),e.onOpenLink===void 0?/^https?:/.test(t)&&window.open(t,`_blank`,`noopener`):e.onOpenLink(t)},children:`🔗`})}function mie({id:e,data:t}){let n=t.threats;if(n===void 0||n.total===0){if(t.onAddThreat===void 0||ua(t.notation).offersThreats!==!0)return null;let n=t.onAddThreat;return(0,D.jsx)(Ig,{className:`dg-threat-badge nodrag`,state:`empty`,onAdd:()=>n({node:e})})}let{state:r,text:i,title:a}=Rg(n);return(0,D.jsx)(Fg,{className:`dg-threat-badge`,target:Vv(e,t),state:r,title:a,text:i})}function hie({id:e,data:t}){let n=t.annotations===void 0?void 0:Ng(t.annotations);return n===void 0?null:(0,D.jsx)(Fg,{className:`dg-comment-badge`,target:Vv(e,t),title:n.title,text:n.text})}var Vv=(e,t)=>t.external===!0?void 0:{node:e};function Hv({id:e,data:t,selected:n,side:r}){if(n!==!0||t.quickAdd===void 0)return null;let i=t.quickAdd.label(e,r);if(i===void 0)return null;let a=t.quickAdd.run;return(0,D.jsx)(`button`,{type:`button`,className:`dg-quick-add nodrag`,title:r===`before`?i:`${i} (Tab)`,"aria-label":i,"data-side":r,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),r===void 0?a(e):a(e,r)},children:`+`})}function Uv({id:e,data:t,selected:n,uses:r}){return(0,D.jsxs)(D.Fragment,{children:[r.includes(`link`)&&(0,D.jsx)(pie,{data:t}),r.includes(`threat`)&&(0,D.jsx)(mie,{id:e,data:t}),r.includes(`comment`)&&(0,D.jsx)(hie,{id:e,data:t}),r.includes(`quickAdd`)&&(0,D.jsx)(Hv,{id:e,data:t,selected:n}),r.includes(`handles`)&&fie]})}function Wv({id:e,data:t,selected:n,parts:r}){let i=t.typeId===ne;return(0,D.jsxs)(`div`,{className:`${i?`dg-activity-frame`:`dg-activity-lane`}${r.loopClass}`,style:t.color===void 0?void 0:{"--dg-act-accent":t.color},children:[(0,D.jsx)(`span`,{className:`dg-activity-strip`,children:(0,D.jsx)(`span`,{className:`dg-activity-name`,children:r.name})}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`handles`]}),!i&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Hv,{id:e,data:t,selected:n,side:`before`}),(0,D.jsx)(Hv,{id:e,data:t,selected:n,side:`after`})]})]})}function gie({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-activity-region${r.loopClass}`,children:[(t.label!==``||t.labelEditing===!0)&&(0,D.jsx)(`span`,{className:`dg-activity-region-name`,children:r.name}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`handles`]})]})}function Gv(e,t){let n=new Set(e.containment.map(e=>e.parent)),r=[...e.nodes.filter(e=>!n.has(e.id)),...e.nodes.filter(e=>n.has(e.id))],i=new Map,a=new Map;for(let e of r){if(e.type===void 0||a.has(e.type))continue;let n=t.resolve(e.type).fill??`type:${e.type}`,r=i.get(n)??i.size;i.set(n,r),a.set(e.type,r)}return a}function _ie(e,t,n){if(!(e.palette===void 0||e.palette.length===0))return{palette:e.palette,slots:Gv(t,n)}}function vie(e,t,n){if(t!==void 0)return t;let r=e===void 0?void 0:n.slots.get(e);return r===void 0?void 0:n.palette[r%n.palette.length]}function yie(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e)?.[1];if(t===void 0)return;let n=t.length===3?[...t].map(e=>e+e).join(``):t,[r,i,a]=[0,2,4].map(e=>{let t=parseInt(n.slice(e,e+2),16)/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4});return .2126*r+.7152*i+.0722*a>.179?`#000`:`#fff`}function bie({chip:e,className:t,zoneId:n,onSetRole:r}){let[i,a]=(0,_.useState)(!1),o=(0,_.useRef)(null),s=(0,_.useRef)(null),c=(0,_.useRef)(null),l=(0,_.useId)(),u=e=>{a(!1),e&&s.current?.focus()};(0,_.useEffect)(()=>{if(!i)return;c.current?.querySelector(`[role="menuitem"]`)?.focus();let e=e=>{let t=e.target;o.current?.contains(t)||c.current?.contains(t)||u(!1)};return document.addEventListener(`mousedown`,e,!0),()=>document.removeEventListener(`mousedown`,e,!0)},[i]);let d=[...Vt.filter(t=>t!==e.role).map(e=>({id:e,label:ra[e].title,next:e})),{id:`remove`,label:`Remove`,next:null}],f=t=>{r(n,e.refId,t),u(!0)},p=e=>{if(e.key===`Escape`)e.preventDefault(),u(!0);else if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=[...c.current?.querySelectorAll(`[role="menuitem"]`)??[]];t[(t.indexOf(document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()}},m=i?s.current?.getBoundingClientRect():void 0;return(0,D.jsxs)(`span`,{className:`dg-role-chip-anchor`,ref:o,children:[(0,D.jsx)(`button`,{ref:s,type:`button`,className:`${t} nodrag`,title:e.title,"aria-haspopup":`menu`,"aria-expanded":i,"aria-controls":i?l:void 0,style:e.color===void 0?void 0:{"--dg-chip":e.color},onMouseDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),a(e=>!e)},children:e.text}),i&&m!==void 0&&(0,Hp.createPortal)((0,D.jsx)(`div`,{id:l,ref:c,className:`dg-role-chip-menu nodrag nopan`,style:{position:`fixed`,top:m.bottom,left:m.left},role:`menu`,"aria-label":e.title,onKeyDown:p,children:d.map(e=>(0,D.jsx)(`button`,{type:`button`,role:`menuitem`,className:`dg-role-chip-menu-item`,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),f(e.next)},children:e.label},e.id))}),document.body)]})}function xie({id:e,data:t,profile:n,focusId:r}){let i=t.state!==`leaf`,a=Rv(t,n);return(0,D.jsxs)(`span`,{className:`dg-badges`,children:[t.promoted&&(0,D.jsx)(`span`,{className:`dg-badge`,"data-testid":`promoted-marker`,title:`Promoted shared node`,children:`▲`}),t.sharedMembers.length>0&&(0,D.jsxs)(`span`,{className:`dg-badge`,"data-testid":`shared-badge`,title:`Shared members: ${t.sharedMembers.join(`, `)}`,children:[`⚭ `,t.sharedMembers.length]}),t.chips?.map(i=>{let a=`dg-badge dg-role-chip${r!==null&&i.refId===r?` dg-role-chip-active`:``}`,o=`${i.role}:${i.refId}`;return t.onSetRole!==void 0&&n.node?.roleChips===!0?(0,D.jsx)(bie,{chip:i,className:a,zoneId:e,onSetRole:t.onSetRole},o):(0,D.jsx)(`span`,{className:a,title:i.title,style:i.color===void 0?void 0:{"--dg-chip":i.color},children:i.text},o)}),i&&!a&&t.onEnterNode!==void 0&&(0,D.jsx)(`button`,{type:`button`,className:`dg-enter`,"data-testid":`enter-chip`,title:`Enter — zoom into this node as its own diagram`,"aria-label":`Enter node`,onClick:n=>{n.stopPropagation(),t.onEnterNode?.(e)},children:`⤢`}),i&&!a&&(0,D.jsx)(Kv,{id:e,data:t}),a&&(0,D.jsx)(Kv,{id:e,data:t,group:!0})]})}function Kv({id:e,data:t,group:n=!1}){let r=t.state===`expanded`,i=n?r?`Collapse group`:`Expand group`:r?`Collapse`:`Expand`;return(0,D.jsx)(`button`,{type:`button`,className:n?`dg-disclose`:`dg-fold`,"data-testid":n?`disclose-chip`:`fold-chip`,title:i,"aria-label":i,"aria-expanded":n?void 0:r,onClick:n=>{n.stopPropagation(),t.onToggleExpand?.(e,r?`collapsed`:`expanded`)},children:r?`▾`:`▸`})}var Sie=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`);function Cie(e){return e.map(e=>{let t=e.text.split(`
|
|
19
|
+
`):e,u=`${c?` dg-edge-label-wrap`:``}${e.diff===void 0?``:` dg-diff-${e.diff}`}`;return(0,D.jsxs)(D.Fragment,{children:[e.labels===void 0&&e.label!==void 0&&(0,D.jsx)(Th,{children:(0,D.jsx)(`div`,{className:`dg-edge-label dg-edge-chip${u}`,style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${n.x}px, ${n.y}px)`},children:l(e.label)})}),e.labels!==void 0&&e.labels.map(n=>{let c=n.t??.5,d=n.side??`center`,f=r!==void 0&&e.labels?.length===1&&bg(n)?r:yg(t,c,d),p=o.drag!==null&&o.drag.labelId===n.id?o.drag:null,m=p?.x??f.x,h=p?.y??f.y,g=i!==null&&i.labelId===n.id;return(0,D.jsx)(Th,{children:(0,D.jsx)(`div`,{className:`dg-edge-label dg-edge-label-${d}${u} nodrag nopan`,style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${m}px, ${h}px)`,pointerEvents:`all`},...o.handlers(n.id,g),onDoubleClick:e=>{s&&(e.stopPropagation(),a({labelId:n.id,t:c,side:d,x:f.x,y:f.y}))},children:g?(0,D.jsx)(Cg,{label:n.text,onCommit:t=>{a(null),t!==null&&e.onEditLabel?.(n.id,t.trim())}}):l(n.text)})},n.id)}),s&&e.pendingAdd!==void 0&&(0,D.jsx)(Sg,{data:e,curve:t,at:e.pendingAdd})]})}function xg(e,t){let n=wm(),[r,i]=(0,_.useState)(null),a=(0,_.useRef)(null),o=(e,r)=>{let{t:i,perp:a}=ag(t,n.screenToFlowPosition({x:e,y:r}));return{t:i,side:Sre(a)}},s=t=>e.editableLabels===!0||e.movableLabels===!0&&t.altKey;return{drag:r,handlers:(n,r)=>({onPointerDown:e=>{!s(e)||r||(e.stopPropagation(),a.current={labelId:n,startX:e.clientX,startY:e.clientY,moved:!1},typeof e.currentTarget.setPointerCapture==`function`&&e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:e=>{let r=a.current;if(r===null||r.labelId!==n||!r.moved&&Math.hypot(e.clientX-r.startX,e.clientY-r.startY)<xre)return;r.moved=!0;let{t:s,side:c}=o(e.clientX,e.clientY),l=yg(t,s,c);i({labelId:n,x:l.x,y:l.y})},onPointerUp:t=>{let r=a.current;if(a.current=null,!(r===null||r.labelId!==n)){if(typeof t.currentTarget.releasePointerCapture==`function`&&t.currentTarget.releasePointerCapture(t.pointerId),r.moved){let{t:r,side:i}=o(t.clientX,t.clientY);e.onMoveLabel?.(n,r,i)}i(null)}}})}}function Sg({data:e,curve:t,at:n}){let{t:r,perp:i}=ag(t,n),a=Sre(i),o=yg(t,r,a);return(0,D.jsx)(Th,{children:(0,D.jsx)(`div`,{className:`dg-edge-label-edit nodrag nopan`,style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${o.x}px, ${o.y}px)`,pointerEvents:`all`},children:(0,D.jsx)(Cg,{label:``,onCommit:t=>{t!==null&&t.trim()!==``&&e.onAddLabel?.(t.trim(),r,a),e.onPendingAddConsumed?.()}})})})}function Cg({label:e,onCommit:t}){let n=(0,_.useRef)(!1),r=e=>{n.current||(n.current=!0,t?.(e))};return(0,D.jsx)(`input`,{"aria-label":`Edge label`,defaultValue:e,autoFocus:!0,onFocus:e=>e.target.select(),onBlur:e=>r(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?r(e.target.value):e.key===`Escape`&&r(null)}})}var wg={arrow:{refX:9,el:(0,D.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`})},dot:{refX:5,el:(0,D.jsx)(`circle`,{cx:`5`,cy:`5`,r:`4`})},square:{refX:5,el:(0,D.jsx)(`rect`,{x:`1.2`,y:`1.2`,width:`7.6`,height:`7.6`})},diamond:{refX:5,el:(0,D.jsx)(`path`,{d:`M5,0 L10,5 L5,10 L0,5 z`})},crowsfoot:{refX:10,el:(0,D.jsx)(`path`,{d:`M10,1 L0,5 L10,9 M0,5 L10,5`,fill:`none`})},one:{refX:8,el:(0,D.jsx)(`path`,{d:`M5,1 L5,9`,fill:`none`})},none:void 0},Tg={refX:9,el:(0,D.jsx)(`path`,{d:`M1,1 L9,5 L1,9`,fill:`none`})},Eg=new Set([`crowsfoot`,`one`,`open-arrow`]);function Dg({end:e,start:t,stroke:n,size:r}){return(0,D.jsxs)(D.Fragment,{children:[e!==void 0&&(0,D.jsx)(Og,{marker:e,stroke:n,size:r}),t!==void 0&&(0,D.jsx)(Og,{marker:t,stroke:n,size:r})]})}function Og({marker:e,stroke:t,size:n}){return(0,D.jsx)(`defs`,{children:(0,D.jsx)(`marker`,{id:e.id,viewBox:`0 0 10 10`,refX:e.shape.refX,refY:`5`,markerWidth:n,markerHeight:n,markerUnits:`userSpaceOnUse`,orient:`auto-start-reverse`,fill:t,...Eg.has(e.style)?{stroke:t,strokeWidth:1.2}:{},children:e.shape.el})})}var kg=12,Ag=6,jg=3,Mg=12;function wre({curve:e,data:t,profile:n,look:r}){let i=n.edge?.marks===!0,a=i&&t.polarity!==void 0?ig(e,.82):void 0,o=i&&t.delay===!0?ig(e,.5):void 0,s=r.kind.zigzag===!0?ig(e,.5):void 0;return(0,D.jsxs)(D.Fragment,{children:[a!==void 0&&t.polarity!==void 0&&(0,D.jsx)(`text`,{className:`dg-polarity`,x:a.point.x+a.normal.x*kg,y:a.point.y+a.normal.y*kg,textAnchor:`middle`,dominantBaseline:`central`,style:r.polarityColor===void 0?void 0:{fill:r.stroke},children:t.polarity===`-`?`−`:`+`}),o!==void 0&&(0,D.jsx)(`g`,{className:`dg-delay`,children:[-3,jg].map(e=>{let t=o.point.x+o.tangent.x*e,n=o.point.y+o.tangent.y*e;return(0,D.jsx)(`line`,{x1:t-o.normal.x*Ag,y1:n-o.normal.y*Ag,x2:t+o.normal.x*Ag,y2:n+o.normal.y*Ag},e)})}),s!==void 0&&(0,D.jsx)(`polyline`,{className:`dg-edge-zigzag`,points:[[-12,4],[2,-2],[-2,2],[Mg,-4]].map(([e,t])=>{let{point:n,tangent:r,normal:i}=s;return`${n.x+e*r.x+t*i.x},${n.y+e*r.y+t*i.y}`}).join(` `),fill:`none`,strokeWidth:1.75,stroke:r.stroke})]})}function Ng({comments:e,links:t}){if(e===0&&t===0)return;let n=[];return e>0&&n.push(`${e} comment${e===1?``:`s`}`),t>0&&n.push(`${t} link${t===1?``:`s`}`),{text:e>0?String(e):`↗`,title:n.join(`, `)}}var Pg=(0,_.createContext)(null);function Fg({className:e,target:t,edge:n,state:r,title:i,text:a,style:o}){let s=(0,_.useContext)(Pg);if(s===null||t===void 0)return(0,D.jsx)(`span`,{className:e,"data-edge":n,"data-state":r,title:i,style:o,children:a});let c=s.isOpen(Me(t));return(0,D.jsx)(`button`,{type:`button`,className:`${e} nodrag${n===void 0?``:` nopan`}`,"data-edge":n,"data-state":r,title:i,"aria-expanded":c,"aria-label":`${i} — ${c?`hide`:`show`}`,style:o,onMouseDown:Lg,onClick:e=>{e.stopPropagation(),s.toggle(t)},children:a})}function Ig({className:e,edge:t,state:n,style:r,onAdd:i,onPointerDown:a}){return(0,D.jsx)(`button`,{type:`button`,className:e,"data-edge":t,"data-state":n,"aria-label":`Add a threat`,title:`Add a threat`,style:r,onMouseDown:Lg,onPointerDown:a,onClick:e=>{e.stopPropagation(),i()},children:`+`})}var Lg=e=>e.stopPropagation();function Rg({open:e,total:t}){return{state:e>0?`open`:`handled`,text:e>0?String(e):`✓`,title:`${e} open of ${t} threat${t===1?``:`s`}`}}var zg=10,Tre=24,Ere=e=>({x:e.point.x+e.normal.x*zg,y:e.point.y+e.normal.y*zg});function Bg(e,t){let n=ig(e,t),r=Ere(n);return{frame:n,at:r,transform:`translate(-50%, -50%) translate(${r.x}px, ${r.y}px)`}}function Dre({id:e,data:t,curve:n,profile:r}){let{threatBadge:i,addThreat:a}=Ore(t,r),o=i!==void 0||a!==void 0?Bg(n,.75):void 0,s=t.annotations===void 0?void 0:Ng(t.annotations),c=s===void 0?void 0:Bg(n,.25),l=(0,_.useContext)(Pg),u=t.threatRelation===void 0?void 0:{relation:t.threatRelation};return kre(l,{relation:i!==void 0||s!==void 0?t.threatRelation:void 0,spot:i===void 0?c:o,curve:n}),(0,D.jsxs)(D.Fragment,{children:[o!==void 0&&i!==void 0&&(0,D.jsx)(Th,{children:(0,D.jsx)(Fg,{className:`dg-threat-badge dg-edge-threat`,target:u,edge:e,state:i.state,title:i.title,text:i.text,style:{transform:o.transform}})}),c!==void 0&&s!==void 0&&(0,D.jsx)(Th,{children:(0,D.jsx)(Fg,{className:`dg-comment-badge dg-edge-comment`,target:u,edge:e,title:s.title,text:s.text,style:{transform:c.transform}})}),o!==void 0&&a!==void 0&&(0,D.jsx)(Th,{children:(0,D.jsx)(Ig,{className:`dg-threat-badge dg-edge-threat nodrag nopan`,edge:e,state:`empty`,style:{transform:o.transform},onAdd:a})})]})}function Ore(e,t){let n=e.threats!==void 0&&e.threats.total>0?e.threats:void 0,r=n===void 0&&e.onAddThreat!==void 0&&t.offersThreats===!0?e.onAddThreat:void 0;return{threatBadge:n===void 0?void 0:Rg(n),addThreat:r}}function kre(e,t){let{relation:n,curve:r}=t,i=t.spot?.at.x,a=t.spot?.at.y,o=t.spot?.frame.normal.x,s=t.spot?.frame.normal.y,c=(0,_.useRef)([]),l=``;e!==null&&n!==void 0&&(c.current=Array.from({length:25},(e,t)=>{let n=r.point(t/Tre);return{x:Math.round(n.x),y:Math.round(n.y)}}),l=c.current.map(e=>`${e.x},${e.y}`).join(`;`)),(0,_.useEffect)(()=>{e!==null&&n!==void 0&&i!==void 0&&a!==void 0&&o!==void 0&&s!==void 0&&e.placeBadge(n,{x:i,y:a},{x:o,y:s},c.current)},[e,n,i,a,o,s,l])}function Are(e,t,n){let r=t?.relStyle,i=t?.kindRegistry.resolve(t.kind)??{},a=r?.width??i.width??1.5,o=r?.line??(i.dashed===!0?`dashed`:`solid`),s=r?.animated??i.animated===!0;return{kind:i,...jre(t,n),strokeWidth:a,line:o,animated:s,dashArray:Hg(o,a,s,t?.edgeLook?.dash),...Ug(e,{end:r?.end??i.endMarker??`arrow`,start:i.startMarker},t?.edgeLook?.openArrow),markerSize:10+a*2}}function Vg(e){return{stroke:e.stroke,strokeWidth:e.strokeWidth,...e.dashArray===void 0?{}:{strokeDasharray:e.dashArray},...e.line===`dotted`?{strokeLinecap:`round`}:{},...e.animated?{animation:`dg-flow 0.7s linear infinite`}:{}}}function jre(e,t){let n=e?.polarity===void 0?void 0:t.edge?.polarityColors?.[e.polarity];return{stroke:e?.relStyle?.color??e?.tint??e?.notationColor??n??`var(--dg-edge)`,polarityColor:n}}function Hg(e,t,n,r){return e===`dashed`?r?.dashed??`6 4`:e===`dotted`?`0.1 ${Math.max(5,t*3)}`:n?`6 4`:r?.solid}function Ug(e,t,n){let r=e.replace(/[^a-zA-Z0-9_-]/g,`_`);return{end:Wg(`dg-end-${r}`,t.end,n),start:Wg(`dg-start-${r}`,t.start,n)}}function Wg(e,t,n){if(t===void 0)return;if(t===`arrow`&&n===!0)return{id:e,style:`open-arrow`,shape:Tg};let r=wg[t];return r===void 0?void 0:{id:e,style:t,shape:r}}var Gg=e=>({x:e.internals.positionAbsolute.x,y:e.internals.positionAbsolute.y,width:e.measured?.width??0,height:e.measured?.height??0});function Kg(e,t){let n=Gg(e),r=Gg(t),i=n.width/2||1,a=n.height/2||1,o=n.x+i,s=n.y+a,c=r.x+(r.width/2||1),l=r.y+(r.height/2||1),u=(c-o)/(2*i)-(l-s)/(2*a),d=(c-o)/(2*i)+(l-s)/(2*a),f=1/(Math.abs(u)+Math.abs(d)||1),p=f*u,m=f*d;return{x:i*(p+m)+o,y:a*(-p+m)+s}}function qg(e,t){let n=Gg(e),r=Math.round(n.x),i=Math.round(n.y),a=Math.round(t.x),o=Math.round(t.y);return a<=r+1?rd.Left:a>=r+n.width-1?rd.Right:o<=i+1?rd.Top:o>=i+n.height-1?rd.Bottom:rd.Top}var Jg=e=>e!=null&&T.includes(e)?e:void 0,Yg={top:rd.Top,right:rd.Right,bottom:rd.Bottom,left:rd.Left};function Xg(e){switch(e){case rd.Top:return`top`;case rd.Right:return`right`;case rd.Bottom:return`bottom`;case rd.Left:return`left`}}function Mre(e,t,n){let r=e??(t.source===n.from?t.target===n.to?null:`target`:`source`);if(r===`source`)return{end:`from`,side:t.source===n.from?Jg(t.sourceHandle)??null:null};if(r===`target`)return{end:`to`,side:t.target===n.to?Jg(t.targetHandle)??null:null}}function Zg(e,t){let n=Gg(e);switch(t){case`top`:return{x:n.x+n.width/2,y:n.y};case`bottom`:return{x:n.x+n.width/2,y:n.y+n.height};case`left`:return{x:n.x,y:n.y+n.height/2};case`right`:return{x:n.x+n.width,y:n.y+n.height/2}}}function Qg(e,t,n){let r=n?.sourceSide===void 0?Kg(e,t):Zg(e,n.sourceSide),i=n?.targetSide===void 0?Kg(t,e):Zg(t,n.targetSide);return{sx:r.x,sy:r.y,tx:i.x,ty:i.y,sourcePos:n?.sourceSide===void 0?qg(e,r):Yg[n.sourceSide],targetPos:n?.targetSide===void 0?qg(t,i):Yg[n.targetSide]}}var $g=5,e_=16;function Nre({ends:e,data:t}){let n=t.onSetSide;if(n===void 0||t.fixedSideDotsShown!==!0||t.constituentCount!==1)return null;let r=e.tx-e.sx,i=e.ty-e.sy,a=Math.hypot(r,i)||1,o=-i/a*e_,s=r/a*e_,c=t.relStyle?.fromSide!==void 0,l=t.relStyle?.toSide!==void 0;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(t_,{end:`from`,cx:e.sx+o,cy:e.sy+s,fixed:c,onToggle:()=>n(`from`,c?null:Xg(e.sourcePos))}),(0,D.jsx)(t_,{end:`to`,cx:e.tx+o,cy:e.ty+s,fixed:l,onToggle:()=>n(`to`,l?null:Xg(e.targetPos))})]})}function t_({end:e,cx:t,cy:n,fixed:r,onToggle:i}){return(0,D.jsx)(`circle`,{className:`dg-edge-pin${r?` pinned`:``}`,"data-end":e,cx:t,cy:n,r:$g,role:`button`,"aria-label":`${r?`Unpin`:`Pin`} ${e===`from`?`source`:`target`} end`,onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),i()}})}var n_=7.2,Pre=20,Fre=24,r_=16,Ire=160,Lre=340;function i_(e,t=``){let n=e=>Fre+e.name.length*n_+r_+(e.type?.length??0)*n_,r=e.reduce((e,t)=>Math.max(e,n(t)),0),i=t.length*n_;return{width:Math.min(Lre,Math.max(Ire,Math.round(Math.max(r,i)+Pre))),height:30+e.length*22}}function a_(e,t,n){let r=t,i=e=>{e.columns!==void 0&&e.node.type===`db-table`&&n?.[e.id]===void 0&&(r===t&&(r=new Map(t)),r.set(e.id,i_(e.columns,e.node.name))),e.children.forEach(i)};return e.forEach(i),r}function o_(e){return 30+e*22+22/2}function s_(e,t,n){if(n===void 0||t.columns===void 0||e.pos!==rd.Left&&e.pos!==rd.Right)return e;let r=t.columns.findIndex(e=>e.name===n);return r<0?e:{x:e.pos===rd.Left?t.x:t.x+t.width,y:t.y+o_(r),pos:e.pos}}function Rre(e,t){let n=qte(e.source),r=qte(e.target),i=(n?.measured?.width??0)>0&&(r?.measured?.width??0)>0,a=t?.relStyle,o={ends:i&&n!==void 0&&r!==void 0?Qg(n,r,{sourceSide:a?.fromSide,targetSide:a?.toSide}):{sx:e.sourceX,sy:e.sourceY,tx:e.targetX,ty:e.targetY,sourcePos:e.sourcePosition,targetPos:e.targetPosition},measured:i,selfLoop:e.source===e.target,source:c_(n),target:c_(r)};return{...o,...zre(o,t)}}function c_(e){if(e!==void 0)return{node:e,rect:{x:e.internals.positionAbsolute.x,y:e.internals.positionAbsolute.y,width:e.measured?.width??0,height:e.measured?.height??0,columns:e.data.columns}}}function zre(e,t){let{ends:n,measured:r,source:i,target:a}=e,o={x:n.sx,y:n.sy},s={x:n.tx,y:n.ty};if(r&&t?.fromColumn!==void 0&&i?.rect.columns!==void 0){let e=s_({x:n.sx,y:n.sy,pos:n.sourcePos},i.rect,t.fromColumn);o={x:e.x,y:e.y}}let c=t?.toColumn??a?.rect.columns?.find(e=>e.pk===!0)?.name;if(r&&c!==void 0&&a?.rect.columns!==void 0&&(t?.fromColumn!==void 0||t?.toColumn!==void 0)){let e=s_({x:n.tx,y:n.ty,pos:n.targetPos},a.rect,c);s={x:e.x,y:e.y}}return{from:o,to:s}}function l_(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function Bre(e,t){return e[0]===t[0]&&e[1]===t[1]}function u_(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)l_(e,s,i);let c=function(e,t,n){let r=[];for(let t of e){let e=[...t];Bre(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!a.length)return i;let o=[],s=a[0].ymin,c=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;t<a.length&&!(a[t].ymin>s);t++)e=t;a.splice(0,e+1).forEach((e=>{o.push({s,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=s))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),(n!==1||c%t==0)&&o.length>1)for(let e=0;e<o.length;e+=2){let t=e+1;if(t>=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach((e=>{e.edge.x=e.edge.x+n*e.edge.islope})),c++}return i}(o,a,r);if(i){for(let e of o)l_(e,s,-i);(function(e,t,n){let r=[];e.forEach((e=>r.push(...e))),l_(r,t,n)})(c,s,-i)}return c}function d_(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.round(Math.max(r,.1));let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),u_(e,r,n,i||1)}var f_=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=d_(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}};function p_(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var Vre=class extends f_{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);let r=d_(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(let[e,t]of r)p_([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},Hre=class extends f_{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},Ure=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=d_(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=p_(o),s=e/r,c=Math.ceil(s)-1,l=e-c*r,u=(o[0][0]+o[1][0])/2-r/4,d=Math.min(o[0][1],o[1][1]);for(let e=0;e<c;e++){let o=d+l+e*r,s=u-a+2*Math.random()*a,c=o-a+2*Math.random()*a,f=this.helper.ellipse(s,c,i,i,t);n.push(...f.ops)}}return{type:`fillSketch`,ops:n}}},m_=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=d_(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{let a=p_(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,c=e[0],l=e[1];c[0]>l[0]&&(c=e[1],l=e[0]);let u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let e=0;e<o;e++){let a=e*(n+r),o=a+n,l=[c[0]+a*Math.cos(u)+s*Math.cos(u),c[1]+a*Math.sin(u)+s*Math.sin(u)],d=[c[0]+o*Math.cos(u)+s*Math.cos(u),c[1]+o*Math.sin(u)+s*Math.sin(u)];i.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],t))}})),i}},Wre=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=d_(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach((e=>{let i=p_(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;e<a;e++){let i=2*e*t,a=2*(e+1)*t,s=Math.sqrt(2*t**2),l=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],u=[o[0]+a*Math.cos(c),o[1]+a*Math.sin(c)],d=[l[0]+s*Math.cos(c+Math.PI/4),l[1]+s*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}},h_={},g_=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},__=0,v_=1,y_=2,b_={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function x_(e,t){return e.type===t}function S_(e){let t=[],n=function(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:__,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:v_,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:y_,text:``},t}(e),r=`BOD`,i=0,a=n[i];for(;!x_(a,y_);){let o=0,s=[];if(r===`BOD`){if(a.text!==`M`&&a.text!==`m`)return S_(`M0,0`+e);i++,o=b_[a.text],r=a.text}else x_(a,v_)?o=b_[r]:(i++,o=b_[a.text],r=a.text);if(!(i+o<n.length))throw Error(`Path data ended short`);for(let e=i;e<i+o;e++){let t=n[e];if(!x_(t,v_))throw Error(`Param not a number: `+r+`,`+t.text);s[s.length]=+t.text}if(typeof b_[r]!=`number`)throw Error(`Bad segment: `+r);{let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}}return t}function C_(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function Gre(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,c=0;for(let{key:l,data:u}of e){switch(l){case`M`:t.push({key:`M`,data:[...u]}),[r,i]=u,[a,o]=u;break;case`C`:t.push({key:`C`,data:[...u]}),r=u[4],i=u[5],s=u[2],c=u[3];break;case`L`:t.push({key:`L`,data:[...u]}),[r,i]=u;break;case`H`:r=u[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=u[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-c)):(e=r,a=i),t.push({key:`C`,data:[e,a,...u]}),s=u[0],c=u[1],r=u[2],i=u[3];break}case`T`:{let[e,a]=u,o=0,l=0;n===`Q`||n===`T`?(o=r+(r-s),l=i+(i-c)):(o=r,l=i);let d=r+2*(o-r)/3,f=i+2*(l-i)/3,p=e+2*(o-e)/3,m=a+2*(l-a)/3;t.push({key:`C`,data:[d,f,p,m,e,a]}),s=o,c=l,r=e,i=a;break}case`Q`:{let[e,n,a,o]=u,l=r+2*(e-r)/3,d=i+2*(n-i)/3,f=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:`C`,data:[l,d,f,p,a,o]}),s=e,c=n,r=a,i=o;break}case`A`:{let e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],c=u[5],l=u[6];e===0||n===0?(t.push({key:`C`,data:[r,i,c,l,c,l]}),r=c,i=l):(r!==c||i!==l)&&(Kre(r,i,c,l,e,n,a,o,s).forEach((function(e){t.push({key:`C`,data:e})})),r=c,i=l);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=l}return t}function w_(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Kre(e,t,n,r,i,a,o,s,c,l){let u=(d=o,Math.PI*d/180);var d;let f=[],p=0,m=0,h=0,g=0;if(l)[p,m,h,g]=l;else{[e,t]=w_(e,t,-u),[n,r]=w_(n,r,-u);let o=(e-n)/2,l=(t-r)/2,d=o*o/(i*i)+l*l/(a*a);d>1&&(d=Math.sqrt(d),i*=d,a*=d);let f=i*i,_=a*a,v=f*_-f*l*l-_*o*o,y=f*l*l+_*o*o,b=(s===c?-1:1)*Math.sqrt(Math.abs(v/y));h=b*i*l/a+(e+n)/2,g=b*-a*o/i+(t+r)/2,p=Math.asin(parseFloat(((t-g)/a).toFixed(9))),m=Math.asin(parseFloat(((r-g)/a).toFixed(9))),e<h&&(p=Math.PI-p),n<h&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),c&&p>m&&(p-=2*Math.PI),!c&&m>p&&(m-=2*Math.PI)}let _=m-p;if(Math.abs(_)>120*Math.PI/180){let e=m,t=n,s=r;m=c&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=Kre(n=h+i*Math.cos(m),r=g+a*Math.sin(m),t,s,i,a,o,0,c,[m,e,h,g])}_=m-p;let v=Math.cos(p),y=Math.sin(p),b=Math.cos(m),x=Math.sin(m),S=Math.tan(_/4),C=4/3*i*S,w=4/3*a*S,T=[e,t],E=[e+C*y,t-w*v],ee=[n+C*x,r-w*b],te=[n,r];if(E[0]=2*T[0]-E[0],E[1]=2*T[1]-E[1],l)return[E,ee,te].concat(f);{f=[E,ee,te].concat(f);let e=[];for(let t=0;t<f.length;t+=3){let n=w_(f[t][0],f[t][1],u),r=w_(f[t+1][0],f[t+1][1],u),i=w_(f[t+2][0],f[t+2][1],u);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}var qre={randOffset:function(e,t){return L_(e,t)},randOffsetWithRange:function(e,t,n){return I_(e,t,n)},ellipse:function(e,t,n,r,i){return k_(e,t,i,O_(n,r,i)).opset},doubleLineOps:function(e,t,n,r,i){return R_(e,t,n,r,i,!0)}};function T_(e,t,n,r,i){return{type:`path`,ops:R_(e,t,n,r,i)}}function E_(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(...R_(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...R_(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?T_(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function Jre(e,t,n,r,i){return function(e,t){return E_(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function D_(e,t){if(e.length){let n=typeof e[0][0]==`number`?[e]:e,r=B_(n[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:B_(n[0],1.5*(1+.22*t.roughness),P_(t));for(let e=1;e<n.length;e++){let a=n[e];if(a.length){let e=B_(a,1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:B_(a,1.5*(1+.22*t.roughness),P_(t));for(let t of e)t.op!==`move`&&r.push(t);for(let e of n)e.op!==`move`&&i.push(e)}}return{type:`path`,ops:r.concat(i)}}return{type:`path`,ops:[]}}function O_(e,t,n){let r=Math.sqrt(2*Math.PI*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=2*Math.PI/i,o=Math.abs(e/2),s=Math.abs(t/2),c=1-n.curveFitting;return o+=L_(o*c,n),s+=L_(s*c,n),{increment:a,rx:o,ry:s}}function k_(e,t,n,r){let[i,a]=Yre(r.increment,e,t,r.rx,r.ry,1,r.increment*I_(.1,I_(.4,1,n),n),n),o=V_(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=Yre(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=V_(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function A_(e,t,n,r,i,a,o,s,c){let l=e,u=t,d=Math.abs(n/2),f=Math.abs(r/2);d+=L_(.01*d,c),f+=L_(.01*f,c);let p=i,m=a;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);let h=2*Math.PI/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=H_(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=H_(g,l,u,d,f,p,m,1.5,c);_.push(...e)}return o&&(s?_.push(...R_(l,u,l+d*Math.cos(p),u+f*Math.sin(p),c),...R_(l,u,l+d*Math.cos(m),u+f*Math.sin(m),c)):_.push({op:`lineTo`,data:[l,u]},{op:`lineTo`,data:[l+d*Math.cos(p),u+f*Math.sin(p)]})),{type:`path`,ops:_}}function j_(e,t){let n=Gre(C_(S_(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(...R_(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,c,l]=o;r.push(...Xre(e,n,i,s,c,l,a,t)),a=[c,l];break}case`Z`:r.push(...R_(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function M_(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+L_(e,t),r[0][1]+L_(e,t)]});for(let a=1;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+L_(e,t),r[a][1]+L_(e,t)]})}}return{type:`fillPath`,ops:n}}function N_(e,t){return function(e,t){let n=e.fillStyle||`hachure`;if(!h_[n])switch(n){case`zigzag`:h_[n]||(h_[n]=new Vre(t));break;case`cross-hatch`:h_[n]||(h_[n]=new Hre(t));break;case`dots`:h_[n]||(h_[n]=new Ure(t));break;case`dashed`:h_[n]||(h_[n]=new m_(t));break;case`zigzag-line`:h_[n]||(h_[n]=new Wre(t));break;default:n=`hachure`,h_[n]||(h_[n]=new f_(t))}return h_[n]}(t,qre).fillPolygons(e,t)}function P_(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function F_(e){return e.randomizer||=new g_(e.seed||0),e.randomizer.next()}function I_(e,t,n,r=1){return n.roughness*r*(F_(n)*(t-e)+e)}function L_(e,t,n=1){return I_(-e,e,t,n)}function R_(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=z_(e,t,n,r,i,!0,!1);if(o)return s;let c=z_(e,t,n,r,i,!0,!0);return s.concat(c)}function z_(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=c/10);let d=u/2,f=.2+.2*F_(i),p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=L_(p,i,l),m=L_(m,i,l);let h=[],g=()=>L_(d,i,l),_=()=>L_(u,i,l),v=i.preserveVertices;return a&&(o?h.push({op:`move`,data:[e+(v?0:g()),t+(v?0:g())]}):h.push({op:`move`,data:[e+(v?0:L_(u,i,l)),t+(v?0:L_(u,i,l))]})),o?h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(v?0:g()),r+(v?0:g())]}):h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+_(),m+t+(r-t)*f+_(),p+e+2*(n-e)*f+_(),m+t+2*(r-t)*f+_(),n+(v?0:_()),r+(v?0:_())]}),h}function B_(e,t,n){if(!e.length)return[];let r=[];r.push([e[0][0]+L_(t,n),e[0][1]+L_(t,n)]),r.push([e[0][0]+L_(t,n),e[0][1]+L_(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+L_(t,n),e[i][1]+L_(t,n)]),i===e.length-1&&r.push([e[i][0]+L_(t,n),e[i][1]+L_(t,n)]);return V_(r,null,n)}function V_(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+L_(e,n),t[1]+L_(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...z_(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function Yre(e,t,n,r,i,a,o,s){let c=[],l=[];if(s.roughness===0){e/=4,l.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=2*Math.PI;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];c.push(e),l.push(e)}l.push([t+r*Math.cos(0),n+i*Math.sin(0)]),l.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let u=L_(.5,s)-Math.PI/2;l.push([L_(a,s)+t+.9*r*Math.cos(u-e),L_(a,s)+n+.9*i*Math.sin(u-e)]);let d=2*Math.PI+u-.01;for(let o=u;o<d;o+=e){let e=[L_(a,s)+t+r*Math.cos(o),L_(a,s)+n+i*Math.sin(o)];c.push(e),l.push(e)}l.push([L_(a,s)+t+r*Math.cos(u+2*Math.PI+.5*o),L_(a,s)+n+i*Math.sin(u+2*Math.PI+.5*o)]),l.push([L_(a,s)+t+.98*r*Math.cos(u+o),L_(a,s)+n+.98*i*Math.sin(u+o)]),l.push([L_(a,s)+t+.9*r*Math.cos(u+.5*o),L_(a,s)+n+.9*i*Math.sin(u+.5*o)])}return[l,c]}function H_(e,t,n,r,i,a,o,s,c){let l=a+L_(.1,c),u=[];u.push([L_(s,c)+t+.9*r*Math.cos(l-e),L_(s,c)+n+.9*i*Math.sin(l-e)]);for(let a=l;a<=o;a+=e)u.push([L_(s,c)+t+r*Math.cos(a),L_(s,c)+n+i*Math.sin(a)]);return u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),V_(u,null,c)}function Xre(e,t,n,r,i,a,o,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],u=[0,0],d=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let p=0;p<d;p++)p===0?c.push({op:`move`,data:[o[0],o[1]]}):c.push({op:`move`,data:[o[0]+(f?0:L_(l[0],s)),o[1]+(f?0:L_(l[0],s))]}),u=f?[i,a]:[i+L_(l[p],s),a+L_(l[p],s)],c.push({op:`bcurveTo`,data:[e+L_(l[p],s),t+L_(l[p],s),n+L_(l[p],s),r+L_(l[p],s),u[0],u[1]]});return c}function U_(e){return[...e]}function Zre(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(U_(e[0]),U_(e[1]),U_(e[2]),U_(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(U_(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function W_(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function G_(e,t,n){let r=W_(t,n);if(r===0)return W_(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),W_(e,K_(t,n,i))}function K_(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function q_(e,t,n,r){let i=r||[];if(function(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}(e,t)<n){let n=e[t+0];i.length?(a=i[i.length-1],o=n,Math.sqrt(W_(a,o)))>1&&i.push(n):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=K_(a,o,r),u=K_(o,s,r),d=K_(s,c,r),f=K_(l,u,r),p=K_(u,d,r),m=K_(f,p,r);q_([a,l,f,m],0,n,i),q_([m,p,d,c],0,n,i)}var a,o;return i}function J_(e,t){return Y_(e,0,e.length,t)}function Y_(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=G_(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(Y_(e,t,l+1,r,a),Y_(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function X_(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)q_(e,3*n,t,r);return n&&n>0?Y_(r,0,r.length,n):r}var Z_=`none`,Q_=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[T_(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=Jre(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(M_([i],a)):o.push(N_([i],a))}return a.stroke!==Z_&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=O_(n,r,a),c=k_(e,t,a,s);if(a.fill)if(a.fillStyle===`solid`){let n=k_(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(N_([c.estimatedPoints],a));return a.stroke!==Z_&&o.push(c.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[E_(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=A_(e,t,n,r,i,a,o,!0,c);if(o&&c.fill)if(c.fillStyle===`solid`){let o=Object.assign({},c);o.disableMultiStroke=!0;let s=A_(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(function(e,t,n,r,i,a,o){let s=e,c=t,l=Math.abs(n/2),u=Math.abs(r/2);l+=L_(.01*l,o),u+=L_(.01*u,o);let d=i,f=a;for(;d<0;)d+=2*Math.PI,f+=2*Math.PI;f-d>2*Math.PI&&(d=0,f=2*Math.PI);let p=(f-d)/o.curveStepCount,m=[];for(let e=d;e<=f;e+=p)m.push([s+l*Math.cos(e),c+u*Math.sin(e)]);return m.push([s+l*Math.cos(f),c+u*Math.sin(f)]),m.push([s,c]),N_([m],o)}(e,t,n,r,i,a,c));return c.stroke!==Z_&&l.push(u),this._d(`arc`,l,c)}curve(e,t){let n=this._o(t),r=[],i=D_(e,n);if(n.fill&&n.fill!==Z_)if(n.fillStyle===`solid`){let t=D_(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=[],i=e;if(i.length){let e=typeof i[0][0]==`number`?[i]:i;for(let r of e)r.length<3?t.push(...r):r.length===3?t.push(...X_(Zre([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...X_(Zre(r),10,(1+n.roughness)/2))}t.length&&r.push(N_([t],n))}return n.stroke!==Z_&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=E_(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(M_([e],n)):r.push(N_([e],n))),n.stroke!==Z_&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==Z_,a=n.stroke!==Z_,o=!!(n.simplification&&n.simplification<1),s=function(e,t,n){let r=Gre(C_(S_(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...X_(s,t)),s=[]},l=()=>{c(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:l(),o=[t[0],t[1]],a.push(o);break;case`L`:c(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:c(),a.push([o[0],o[1]])}if(l(),!n)return i;let u=[];for(let e of i){let t=J_(e,n);t.length&&u.push(t)}return u}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=j_(e,n);if(i)if(n.fillStyle===`solid`)if(s.length===1){let t=j_(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(M_(s,n));else r.push(N_(s,n));return a&&(o?s.forEach((e=>{r.push(E_(e,!1,n))})):r.push(c)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Z_};break;case`fillPath`:t={d:this.opsToPath(e),stroke:Z_,strokeWidth:0,fill:n.fill||Z_};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||Z_,strokeWidth:n,fill:Z_}}_mergedShape(e){return e.filter(((e,t)=>t===0||e.op!==`move`))}},$_=class{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext(`2d`),this.gen=new Q_(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(let a of t)switch(a.type){case`path`:r.save(),r.strokeStyle=n.stroke===`none`?`transparent`:n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case`fillPath`:{r.save(),r.fillStyle=n.fill||``;let t=e.shape===`curve`||e.shape===`polygon`||e.shape===`path`?`evenodd`:`nonzero`;this._drawToContext(r,a,i,t),r.restore();break}case`fillSketch`:this.fillSketch(r,a,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||``,e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r=`nonzero`){e.beginPath();for(let r of t.ops){let t=typeof n==`number`&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case`move`:e.moveTo(t[0],t[1]);break;case`bcurveTo`:e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case`lineTo`:e.lineTo(t[0],t[1])}}t.type===`fillPath`?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a),a}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a),a}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a),a}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c),c}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){let n=this.gen.path(e,t);return this.draw(n),n}},ev=`http://www.w3.org/2000/svg`,Qre=class{constructor(e,t){this.svg=e,this.gen=new Q_(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(ev,`g`),a=e.options.fixedDecimalPlaceDigits;for(let o of t){let t=null;switch(o.type){case`path`:t=r.createElementNS(ev,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,n.stroke),t.setAttribute(`stroke-width`,n.strokeWidth+``),t.setAttribute(`fill`,`none`),n.strokeLineDash&&t.setAttribute(`stroke-dasharray`,n.strokeLineDash.join(` `).trim()),n.strokeLineDashOffset&&t.setAttribute(`stroke-dashoffset`,`${n.strokeLineDashOffset}`);break;case`fillPath`:t=r.createElementNS(ev,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,`none`),t.setAttribute(`stroke-width`,`0`),t.setAttribute(`fill`,n.fill||``),e.shape!==`curve`&&e.shape!==`polygon`||t.setAttribute(`fill-rule`,`evenodd`);break;case`fillSketch`:t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let i=e.createElementNS(ev,`path`);return i.setAttribute(`d`,this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute(`stroke`,n.fill||``),i.setAttribute(`stroke-width`,r+``),i.setAttribute(`fill`,`none`),n.fillLineDash&&i.setAttribute(`stroke-dasharray`,n.fillLineDash.join(` `).trim()),n.fillLineDashOffset&&i.setAttribute(`stroke-dashoffset`,`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c)}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n)}path(e,t){let n=this.gen.path(e,t);return this.draw(n)}},tv={canvas:(e,t)=>new $_(e,t),svg:(e,t)=>new Qre(e,t),generator:e=>new Q_(e),newSeed:()=>Q_.newSeed()}.generator(),nv=`sentinel-fill`,A=`sentinel-stroke`;function rv(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0||1}var iv=({style:e,seed:t})=>({roughness:e.roughness,bowing:e.bowing,strokeWidth:e.strokeWidth,fillStyle:e.fillStyle,...e.fillWeight===void 0?{}:{fillWeight:e.fillWeight},...e.hachureGap===void 0?{}:{hachureGap:e.hachureGap},fill:nv,stroke:A,seed:t});function $re(e){let t=t=>e.filter(t).map(e=>e.d).join(` `);return{fill:t(e=>e.fill===nv),hatch:t(e=>e.stroke===nv),stroke:t(e=>e.stroke===A)}}function av(e,t){let n=Math.min(e*.2,24);return[[n,1],[e-n,1],[e-1,t/2],[e-n,t-1],[n,t-1],[1,t/2]]}var ov={left:14,width:16,height:12};function eie(e,t,n,r=(e,t,n)=>[`L ${n} ${t}`]){let i=e-1,a=t-1,o=Math.max(0,Math.min(n,(i-1)/2,(a-1)/2));return[`M ${1+o} 1`,`L ${i-o} 1`,`Q ${i} 1 ${i} ${1+o}`,`L ${i} ${a-o}`,`Q ${i} ${a} ${i-o} ${a}`,...r(i-o,a,1+o),`Q 1 ${a} 1 ${a-o}`,`L 1 ${1+o}`,`Q 1 1 ${1+o} 1`,`Z`].join(` `)}function tie(e,t,n){return eie(e,t,n,(e,t,n)=>{let r=Math.max(n,Math.min(n+ov.left,e));return[`L ${Math.min(r+ov.width,e)} ${t}`,`L ${r} ${t+ov.height}`,`L ${r} ${t}`,`L ${n} ${t}`]})}function sv(e,t,n,r=0){let i=Math.max(2,t.width),a=Math.max(2,t.height),o=iv(n);return $re((e===`circle`?[tv.circle(i/2,a/2,Math.min(i,a)-2,o)]:e===`person`?[tv.circle(i/2,Math.min(a*.22,18),Math.min(i,a)*.32,o),tv.rectangle(i*.12,Math.min(a*.38,30),i*.76,a-Math.min(a*.38,30)-1,o)]:e===`hexagon`?[tv.polygon(av(i,a),o)]:e===`cylinder`?[tv.rectangle(1,8,i-2,a-10,o),tv.ellipse(i/2,8,i-6,14,o)]:e===`bubble`?[tv.path(tie(i,a,r),o)]:e===`diamond`?[tv.polygon([[i/2,1],[i-1,a/2],[i/2,a-1],[1,a/2]],o)]:e===`bar`?[tv.rectangle(1,1,i-2,a-2,{...o,fillStyle:`solid`})]:e===`start-dot`?[tv.circle(i/2,a/2,Math.min(i,a)-2,{...o,fillStyle:`solid`})]:e===`end-bullseye`?[tv.circle(i/2,a/2,Math.min(i,a)-2,o),tv.circle(i/2,a/2,(Math.min(i,a)-2)*.55,{...o,fillStyle:`solid`})]:e===`send-signal`?[tv.polygon([[1,1],[i-15,1],[i-1,a/2],[i-15,a-1],[1,a-1]],o)]:e===`receive-signal`?[tv.polygon([[1,1],[i-1,1],[i-1,a-1],[1,a-1],[15,a/2]],o)]:e===`note`?[tv.polygon([[1,1],[i-15,1],[i-1,15],[i-1,a-1],[1,a-1]],o),tv.linearPath([[i-15,1],[i-15,15],[i-1,15]],o)]:e===`ellipse`?[tv.ellipse(i/2,a/2,i-2,a-2,o)]:e===`store`?[tv.line(1,1,i-1,1,o),tv.line(1,a-1,i-1,a-1,o)]:r>0?[tv.path(eie(i,a,r),o)]:[tv.rectangle(1,1,i-2,a-2,o)]).flatMap(e=>tv.toPaths(e)))}function cv(e,t,n){let r=Math.max(2,t);return $re(tv.toPaths(tv.circle(e.x,e.y,r,iv(n))))}function lv(e,t){let n={...iv(t),fill:void 0,disableMultiStroke:!0},r=tv.toPaths(tv.path(e,n)).filter(e=>e.stroke===A).map(e=>e.d).join(` `);return r===``?e:r}function uv(e){let t=new Map;for(let n of e){if(n.from===n.to)continue;let e=n.from<n.to,r=e?`${n.from}\0${n.to}`:`${n.to}\0${n.from}`,i=t.get(r)??[];i.push({id:n.id,forward:e}),t.set(r,i)}let n=new Map;for(let e of t.values())e.forEach(({id:e,forward:t},r)=>{if(r===0)return;let i=Math.ceil(r/2)*32*(r%2==1?1:-1);n.set(e,t?i:-i)});return n}var dv=e=>Math.abs(e)*4/3;function fv(e){let t=e.shape===`curved`,n=t&&!e.profileBows?e.parallelBow??0:0;return n===0?{bowed:t&&e.profileBows,side:e.side??`left`,bulge:void 0}:{bowed:!0,side:n>0?`left`:`right`,bulge:dv(n)}}var pv=28,mv=18,hv=.2,gv=10,_v=4,vv=16,nie=4.5,yv=e=>pv+e*mv,bv=e=>Math.max(rie(e),vv),rie=e=>Math.max(e*hv,Math.min(e/2-_v,gv),0);function iie(e,t,n,r){let i=yv(n),a=i*4/3,o=t===`DOWN`||t===`UP`,s=o?e.height:e.width,c=rie(s),l=(bv(s)-c)*nie,u=(t,n)=>o?{x:e.x+e.width+n,y:e.y+s/2+t}:{x:e.x+s/2+t,y:e.y-n},d=i+10+(o?r/2:0);return{from:u(-c,0),c1:u(-c-l,a),c2:u(c+l,a),to:u(c,0),label:u(0,d)}}function aie(e,t,n=0,r=0){let{from:i,c1:a,c2:o,to:s,label:c}=iie(e,t,n,r);return{path:`M ${i.x} ${i.y} C ${a.x} ${a.y} ${o.x} ${o.y} ${s.x} ${s.y}`,labelX:c.x,labelY:c.y}}function oie(e,t,n=0){let{from:r,c1:i,c2:a,to:o}=iie(e,t,n,0),s=e=>[r[e],i[e],a[e],o[e]],c=(e,[t,n,r,i])=>(1-e)**3*t+3*(1-e)**2*e*n+3*(1-e)*e**2*r+e**3*i,l=(e,[t,n,r,i])=>3*(1-e)**2*(n-t)+6*(1-e)*e*(r-n)+3*e**2*(i-r);return{point:e=>({x:c(e,s(`x`)),y:c(e,s(`y`))}),tangent:e=>{let t=l(e,s(`x`)),n=l(e,s(`y`)),r=Math.hypot(t,n)||1;return{x:t/r,y:n/r}}}}function xv(e){let t=new Map,n=new Map;for(let r of e){if(r.from!==r.to)continue;let e=t.get(r.from)??0;n.set(r.id,e),t.set(r.from,e+1)}return n}function Sv(e,t,n,r){let i=Cv(t,n),{path:a,curve:o,label:s,labelSpot:c}=t.selfLoop?Ev(t,n):i!==void 0&&n!==void 0?Tv(i,t,n):Dv(t,n,r);return{path:a,renderPath:(0,_.useMemo)(()=>n?.stylePreset?.rough===void 0?a:lv(a,{style:n.stylePreset.rough,seed:rv(e)}),[n?.stylePreset,a,e]),curve:o,label:s,labelSpot:c}}function Cv(e,t){let n=t?.route;if(t===void 0||n===void 0||n.length<2||t.fromColumn!==void 0||t.toColumn!==void 0)return;let r=t.relStyle;return r?.shape===void 0&&(r?.fromSide===void 0||r.fromSide===cg(n).from)&&(r?.toSide===void 0||r.toSide===cg(n).to)&&wv(e.source,t.routeFrom)&&wv(e.target,t.routeTo)?n:void 0}var wv=(e,t)=>e!==void 0&&t!==void 0&&Math.abs(e.node.internals.positionAbsolute.x-t.x)<.5&&Math.abs(e.node.internals.positionAbsolute.y-t.y)<.5;function Tv(e,t,n){let r=e=>!t.measured||e===void 0?void 0:{...e.rect,height:e.rect.height+Ov(e.node.data)},i=lg(sg(e),r(t.source),r(t.target)),a=gre(i),o=n.labelSpot===void 0?void 0:og(i,n.labelSpot);return{path:_re(i,n.routeCorner??8),curve:a,label:o??a.point(.5),labelSpot:o}}function Ev(e,t){let n=t?.selfLoop?.direction??`RIGHT`,r=t?.selfLoop?.index??0,i=e.source?.rect??{x:e.from.x,y:e.from.y,width:0,height:0},a=aie(i,n,r,t?.selfLoop?.labelWidth),o={x:a.labelX,y:a.labelY};return{path:a.path,curve:oie(i,n,r),label:o,labelSpot:o}}function Dv(e,t,n){let r=t?.relStyle,i=r?.shape??`curved`,a={sourceX:e.from.x,sourceY:e.from.y,targetX:e.to.x,targetY:e.to.y,sourcePosition:e.ends.sourcePos,targetPosition:e.ends.targetPos},o=r?.curvature??n.edgeCurvature,{bowed:s,side:c,bulge:l}=fv({shape:i,profileBows:n.edge?.bowed===!0,side:r?.bow,parallelBow:t?.parallelBow}),u=hre({shape:s?`bow`:i,params:a,curvature:o,side:c,bulge:l}),d,f,p;if(i===`straight`)[d,f,p]=pf({sourceX:a.sourceX,sourceY:a.sourceY,targetX:a.targetX,targetY:a.targetY});else if(i===`step`)[d,f,p]=_f(a);else if(s){let e=u.point(.5);d=tg(a,o??.25,c,l),f=e.x,p=e.y}else[d,f,p]=of({...a,...o===void 0?{}:{curvature:o}});return{path:d,curve:u,label:{x:f,y:p},labelSpot:void 0}}function Ov(e){return e.state!==`leaf`||e.label===``?0:e.image===void 0&&e.typeId!==void 0&&e.typeRegistry.resolve(e.typeId).captionBelow===!0?vg(e.label).height:e.image===void 0||e.shape!==void 0||e.typeId!==void 0&&e.typeRegistry.resolve(e.typeId).cornerBadge===!0?0:20}function kv({id:e,source:t,target:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,data:l}){let u=Rre({source:t,target:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c},l),d=ua(l?.notation),{path:f,renderPath:p,curve:m,label:h,labelSpot:g}=Sv(e,u,l,d),v=Are(e,l,d);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`g`,{className:jv((0,_.useContext)(Xh),e),children:[(0,D.jsx)(Dg,{end:v.end,start:v.start,stroke:v.stroke,size:v.markerSize}),(0,D.jsx)($m,{id:e,path:p,...v.end===void 0?{}:{markerEnd:`url(#${v.end.id})`},...v.start===void 0?{}:{markerStart:`url(#${v.start.id})`},style:Vg(v)}),(0,D.jsx)(`path`,{d:f,fill:`none`,stroke:`transparent`,strokeWidth:14,children:(0,D.jsx)(`title`,{children:Av(l)})}),l!==void 0&&(0,D.jsx)(wre,{curve:m,data:l,profile:d,look:v})]}),l!==void 0&&(0,D.jsx)(Nre,{ends:u.ends,data:l}),l!==void 0&&(0,D.jsx)(Cre,{data:l,curve:m,label:h,labelSpot:g}),l!==void 0&&(0,D.jsx)(Dre,{id:e,data:l,curve:m,profile:d})]})}function Av(e){return`${e?.kind??``}${e!==void 0&&e.constituentCount>1?` ×${e.constituentCount}`:``}${e?.labels===void 0&&e?.label!==void 0?` — ${e.label}`:``}`}function jv(e,t){return e.active?e.edges.has(t)?e.variant===`loop`?`dg-loop-edge-hl`:void 0:e.variant===`loop`?`dg-loop-edge-dim`:`dg-focus-edge-dim`:void 0}var Mv={fill:14,stroke:100},Nv=.35;function sie({id:e,kind:t,width:n,height:r,color:i,preset:a,fill:o=`preset`}){let s=a.rough,c=(0,_.useMemo)(()=>rv(e),[e]),l=s!==void 0&&s.fillStyle!==`solid`&&o===`preset`,u=(0,_.useMemo)(()=>{if(s===void 0)return null;let e=a.cornerRadius??0,i={width:n,height:r},o=sv(t,i,{style:{...s,fillStyle:`solid`},seed:c},e);return l?{...sv(t,i,{style:s,seed:c},e),fill:o.fill}:o},[t,n,r,c,s,l,a.cornerRadius]);if(u===null||s===void 0)return null;let d=a.colorMix??Mv,f=(e,t)=>i===void 0?void 0:`color-mix(in srgb, ${i} ${e}%, var(${t}))`,p=f(d.fill,`--dg-node-fill`),m=f(d.stroke,`--dg-node-stroke`);return(0,D.jsxs)(`svg`,{className:`dg-sketch-shape`,width:n,height:r,viewBox:`0 0 ${n} ${r}`,"aria-hidden":`true`,children:[o!==`none`&&u.fill!==``&&(0,D.jsx)(`path`,{className:`dg-sketch-fill`,d:u.fill,style:p===void 0?void 0:{fill:p}}),l&&u.hatch!==``&&(0,D.jsx)(`path`,{className:`dg-sketch-hatch`,d:u.hatch,style:{strokeWidth:s.fillWeight??1,opacity:s.hatchOpacity??Nv,stroke:m}}),(0,D.jsx)(`path`,{className:`dg-sketch-stroke`,d:u.stroke,style:{strokeWidth:s.strokeWidth,stroke:m}})]})}var Pv=e=>e.startsWith(`var(`)?e:`color-mix(in srgb, ${e} var(--dg-outline-ink, 100%), var(--dg-text))`;function Fv(e){if(e!==void 0)return{borderColor:e,background:`color-mix(in srgb, ${e} var(--dg-node-accent-tint, 14%), var(--dg-node-fill))`}}var cie=e=>e===`circle`||e===`cylinder`||e===`hexagon`||e===`bubble`||e===`person`||e===`diamond`||e===`bar`||e===`start-dot`||e===`end-bullseye`||e===`send-signal`||e===`receive-signal`||e===`note`||e===`ellipse`||e===`store`?e:`box`,Iv=(e,t,n)=>t!==void 0&&n.startsWith(`/library/`)?`${t}${n.slice(9)}`:n.startsWith(`/`)||/^https?:/.test(n)?n:`${e??``}${n}`,Lv=(e,t,{id:n,width:r,height:i},a=`preset`)=>e.stylePreset?.rough!==void 0&&r!==void 0&&i!==void 0&&r>0&&i>0?(0,D.jsx)(sie,{id:n,kind:cie(t),width:r,height:i,preset:e.stylePreset,fill:a,color:e.color===void 0?void 0:a===`none`?Pv(e.color):e.color}):null;function lie({id:e,data:t,selected:n}){if(t.resizeAxis!==`x`||t.onResize===void 0||n!==!0)return null;let r=t.onResize,i=(t,n)=>r(e,n.width,n.height,{x:n.x,y:n.y});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Ph,{position:`left`,resizeDirection:`horizontal`,minWidth:lr.DAY,className:`dg-x-resize`,onResizeEnd:i}),(0,D.jsx)(Ph,{position:`right`,resizeDirection:`horizontal`,minWidth:lr.DAY,className:`dg-x-resize`,onResizeEnd:i})]})}var Rv=(e,t)=>t.node?.typelessAsText===!0&&e.typeId===void 0&&e.state!==`leaf`,zv=(e,t)=>e.icon===void 0?e.typeId===void 0?void 0:e.icons.resolve(t.icon??``):e.icons.resolve(e.icon);function j({data:e}){return e.metaBadges!==void 0&&e.metaBadges.length>0?(0,D.jsx)(`span`,{className:`dg-meta`,children:e.metaBadges.map(e=>(0,D.jsx)(`span`,{className:`dg-meta-badge`,children:e},e))}):null}function uie(e,t,n,r){let i=r.focusId,a=i===null?void 0:t.chips?.find(e=>e.refId===i),o=t.typeId!==void 0&&n.node?.actorOutline?.(t.typeId)===!0,s=a===void 0?i!==null&&o&&e!==i&&r.nodes.has(e)?t.color??`var(--dg-accent)`:void 0:a.color??`var(--dg-accent)`;return{hitStyle:s===void 0?void 0:{"--dg-hit":s},hitAttrs:s===void 0?{}:{"data-plan-hit":!0}}}var Bv=e=>e.dropTarget===!0?{"data-drop-target":!0}:{};function die({data:e,style:t}){let n=e.typeId===void 0?void 0:Ar(t.label??e.typeId,e.technology);return n!==void 0&&n!==``?(0,D.jsx)(`span`,{className:`dg-type`,children:n}):null}var fie=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(zm,{id:`top`,type:`source`,position:rd.Top,className:`dg-handle`}),(0,D.jsx)(zm,{id:`right`,type:`source`,position:rd.Right,className:`dg-handle`}),(0,D.jsx)(zm,{id:`bottom`,type:`source`,position:rd.Bottom,className:`dg-handle`}),(0,D.jsx)(zm,{id:`left`,type:`source`,position:rd.Left,className:`dg-handle`})]});function pie({data:e}){if(e.link===void 0)return null;let t=e.link;return(0,D.jsx)(`button`,{type:`button`,className:`dg-link-badge`,title:t,"aria-label":`Open ${t}`,onClick:n=>{n.stopPropagation(),e.onOpenLink===void 0?/^https?:/.test(t)&&window.open(t,`_blank`,`noopener`):e.onOpenLink(t)},children:`🔗`})}function mie({id:e,data:t}){let n=t.threats;if(n===void 0||n.total===0){if(t.onAddThreat===void 0||ua(t.notation).offersThreats!==!0)return null;let n=t.onAddThreat;return(0,D.jsx)(Ig,{className:`dg-threat-badge nodrag`,state:`empty`,onAdd:()=>n({node:e})})}let{state:r,text:i,title:a}=Rg(n);return(0,D.jsx)(Fg,{className:`dg-threat-badge`,target:Vv(e,t),state:r,title:a,text:i})}function hie({id:e,data:t}){let n=t.annotations===void 0?void 0:Ng(t.annotations);return n===void 0?null:(0,D.jsx)(Fg,{className:`dg-comment-badge`,target:Vv(e,t),title:n.title,text:n.text})}var Vv=(e,t)=>t.external===!0?void 0:{node:e};function Hv({id:e,data:t,selected:n,side:r}){if(n!==!0||t.quickAdd===void 0)return null;let i=t.quickAdd.label(e,r);if(i===void 0)return null;let a=t.quickAdd.run;return(0,D.jsx)(`button`,{type:`button`,className:`dg-quick-add nodrag`,title:r===`before`?i:`${i} (Tab)`,"aria-label":i,"data-side":r,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),r===void 0?a(e):a(e,r)},children:`+`})}function Uv({id:e,data:t,selected:n,uses:r}){return(0,D.jsxs)(D.Fragment,{children:[r.includes(`link`)&&(0,D.jsx)(pie,{data:t}),r.includes(`threat`)&&(0,D.jsx)(mie,{id:e,data:t}),r.includes(`comment`)&&(0,D.jsx)(hie,{id:e,data:t}),r.includes(`quickAdd`)&&(0,D.jsx)(Hv,{id:e,data:t,selected:n}),r.includes(`handles`)&&fie]})}function Wv({id:e,data:t,selected:n,parts:r}){let i=t.typeId===ne;return(0,D.jsxs)(`div`,{className:`${i?`dg-activity-frame`:`dg-activity-lane`}${r.loopClass}`,style:t.color===void 0?void 0:{"--dg-act-accent":t.color},children:[(0,D.jsx)(`span`,{className:`dg-activity-strip`,children:(0,D.jsx)(`span`,{className:`dg-activity-name`,children:r.name})}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`handles`]}),!i&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Hv,{id:e,data:t,selected:n,side:`before`}),(0,D.jsx)(Hv,{id:e,data:t,selected:n,side:`after`})]})]})}function gie({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-activity-region${r.loopClass}`,children:[(t.label!==``||t.labelEditing===!0)&&(0,D.jsx)(`span`,{className:`dg-activity-region-name`,children:r.name}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`handles`]})]})}function Gv(e,t){let n=new Set(e.containment.map(e=>e.parent)),r=[...e.nodes.filter(e=>!n.has(e.id)),...e.nodes.filter(e=>n.has(e.id))],i=new Map,a=new Map;for(let e of r){if(e.type===void 0||a.has(e.type))continue;let n=t.resolve(e.type).fill??`type:${e.type}`,r=i.get(n)??i.size;i.set(n,r),a.set(e.type,r)}return a}function _ie(e,t,n){if(!(e.palette===void 0||e.palette.length===0))return{palette:e.palette,slots:Gv(t,n)}}function vie(e,t,n){if(t!==void 0)return t;let r=e===void 0?void 0:n.slots.get(e);return r===void 0?void 0:n.palette[r%n.palette.length]}function yie(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e)?.[1];if(t===void 0)return;let n=t.length===3?[...t].map(e=>e+e).join(``):t,[r,i,a]=[0,2,4].map(e=>{let t=parseInt(n.slice(e,e+2),16)/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4});return .2126*r+.7152*i+.0722*a>.179?`#000`:`#fff`}function bie({chip:e,className:t,zoneId:n,onSetRole:r}){let[i,a]=(0,_.useState)(!1),o=(0,_.useRef)(null),s=(0,_.useRef)(null),c=(0,_.useRef)(null),l=(0,_.useId)(),u=e=>{a(!1),e&&s.current?.focus()};(0,_.useEffect)(()=>{if(!i)return;c.current?.querySelector(`[role="menuitem"]`)?.focus();let e=e=>{let t=e.target;o.current?.contains(t)||c.current?.contains(t)||u(!1)};return document.addEventListener(`mousedown`,e,!0),()=>document.removeEventListener(`mousedown`,e,!0)},[i]);let d=[...Vt.filter(t=>t!==e.role).map(e=>({id:e,label:ra[e].title,next:e})),{id:`remove`,label:`Remove`,next:null}],f=t=>{r(n,e.refId,t),u(!0)},p=e=>{if(e.key===`Escape`)e.preventDefault(),u(!0);else if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=[...c.current?.querySelectorAll(`[role="menuitem"]`)??[]];t[(t.indexOf(document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()}},m=i?s.current?.getBoundingClientRect():void 0;return(0,D.jsxs)(`span`,{className:`dg-role-chip-anchor`,ref:o,children:[(0,D.jsx)(`button`,{ref:s,type:`button`,className:`${t} nodrag`,title:e.title,"aria-haspopup":`menu`,"aria-expanded":i,"aria-controls":i?l:void 0,style:e.color===void 0?void 0:{"--dg-chip":e.color},onMouseDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),a(e=>!e)},children:e.text}),i&&m!==void 0&&(0,Hp.createPortal)((0,D.jsx)(`div`,{id:l,ref:c,className:`dg-role-chip-menu nodrag nopan`,style:{position:`fixed`,top:m.bottom,left:m.left},role:`menu`,"aria-label":e.title,onKeyDown:p,children:d.map(e=>(0,D.jsx)(`button`,{type:`button`,role:`menuitem`,className:`dg-role-chip-menu-item`,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),f(e.next)},children:e.label},e.id))}),document.body)]})}function xie({id:e,data:t,profile:n,focusId:r}){let i=t.state!==`leaf`,a=Rv(t,n);return(0,D.jsxs)(`span`,{className:`dg-badges`,children:[t.promoted&&(0,D.jsx)(`span`,{className:`dg-badge`,"data-testid":`promoted-marker`,title:`Promoted shared node`,children:`▲`}),t.sharedMembers.length>0&&(0,D.jsxs)(`span`,{className:`dg-badge`,"data-testid":`shared-badge`,title:`Shared members: ${t.sharedMembers.join(`, `)}`,children:[`⚭ `,t.sharedMembers.length]}),t.chips?.map(i=>{let a=`dg-badge dg-role-chip${r!==null&&i.refId===r?` dg-role-chip-active`:``}`,o=`${i.role}:${i.refId}`;return t.onSetRole!==void 0&&n.node?.roleChips===!0?(0,D.jsx)(bie,{chip:i,className:a,zoneId:e,onSetRole:t.onSetRole},o):(0,D.jsx)(`span`,{className:a,title:i.title,style:i.color===void 0?void 0:{"--dg-chip":i.color},children:i.text},o)}),i&&!a&&t.onEnterNode!==void 0&&(0,D.jsx)(`button`,{type:`button`,className:`dg-enter`,"data-testid":`enter-chip`,title:`Enter — zoom into this node as its own diagram`,"aria-label":`Enter node`,onClick:n=>{n.stopPropagation(),t.onEnterNode?.(e)},children:`⤢`}),i&&!a&&(0,D.jsx)(Kv,{id:e,data:t}),a&&(0,D.jsx)(Kv,{id:e,data:t,group:!0})]})}function Kv({id:e,data:t,group:n=!1}){let r=t.state===`expanded`,i=n?r?`Collapse group`:`Expand group`:r?`Collapse`:`Expand`;return(0,D.jsx)(`button`,{type:`button`,className:n?`dg-disclose`:`dg-fold`,"data-testid":n?`disclose-chip`:`fold-chip`,title:i,"aria-label":i,"aria-expanded":n?void 0:r,onClick:n=>{n.stopPropagation(),t.onToggleExpand?.(e,r?`collapsed`:`expanded`)},children:r?`▾`:`▸`})}var Sie=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`);function Cie(e){return e.map(e=>{let t=e.text.split(`
|
|
20
20
|
`).map(Sie).join(`<br>`);return e.italic===!0&&(t=`<i>${t}</i>`),e.bold===!0&&(t=`<b>${t}</b>`),t}).join(``)}function wie(e,t,n){let r=e.tagName.toLowerCase(),i=t||r===`b`||r===`strong`,a=n||r===`i`||r===`em`,o=e.style.fontWeight;if(o!==``){let e=Number.parseInt(o,10);o===`bold`||o===`bolder`||!Number.isNaN(e)&&e>=600?i=!0:(o===`normal`||o===`lighter`||!Number.isNaN(e)&&e<600)&&(i=!1)}let s=e.style.fontStyle;return s===`italic`||s===`oblique`?a=!0:s===`normal`&&(a=!1),{bold:i,italic:a}}function Tie(e){let t=[],n=(e,n,r)=>t.push({text:e,...n?{bold:!0}:{},...r?{italic:!0}:{}}),r=(e,i,a)=>{for(let o of Array.from(e.childNodes))if(o.nodeType===Node.TEXT_NODE)n(o.textContent??``,i,a);else if(o.nodeType===Node.ELEMENT_NODE){let e=o,s=e.tagName.toLowerCase();if(s===`br`)n(`
|
|
21
21
|
`,i,a);else{(s===`div`||s===`p`)&&t.length>0&&t.push({text:`
|
|
22
22
|
`});let n=wie(e,i,a);r(e,n.bold,n.italic)}}};return r(e,!1,!1),ge(t)}function Eie(e){return e.map((e,t)=>({key:t,text:e.text,bold:e.bold===!0,italic:e.italic===!0}))}function Die({runs:e,onCommit:t,onTab:n}){let r=(0,_.useRef)(null),i=(0,_.useRef)(!1),[a,o]=(0,_.useState)(null);(0,_.useEffect)(()=>{let t=r.current;if(t===null)return;t.innerHTML=Cie(e),t.focus();let n=document.createRange();n.selectNodeContents(t),n.collapse(!1);let i=window.getSelection();i?.removeAllRanges(),i?.addRange(n)},[]);let s=e=>{i.current||(i.current=!0,t(e))},c=()=>s(r.current===null?[]:Tie(r.current)),l=()=>{let e=window.getSelection();if(e===null||e.isCollapsed||e.rangeCount===0){o(null);return}let t=e.getRangeAt(0).getBoundingClientRect();o({position:`fixed`,left:t.left,top:Math.max(0,t.top-30)})},u=e=>{document.execCommand(e),r.current?.focus(),l()};return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`div`,{ref:r,className:`dg-label-input dg-rich-input nodrag nopan`,role:`textbox`,"aria-label":`Edit text`,contentEditable:!0,suppressContentEditableWarning:!0,onBlur:c,onMouseUp:l,onKeyUp:l,onDoubleClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onPaste:e=>{e.preventDefault();let t=e.clipboardData.getData(`text/plain`);document.execCommand(`insertText`,!1,t)},onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`?s(null):e.key===`Tab`&&!e.shiftKey?(e.preventDefault(),c(),n?.()):e.key===`Enter`&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),c()):(e.metaKey||e.ctrlKey)&&(e.key===`b`||e.key===`B`)?(e.preventDefault(),u(`bold`)):(e.metaKey||e.ctrlKey)&&(e.key===`i`||e.key===`I`)&&(e.preventDefault(),u(`italic`))}}),a!==null&&(0,Hp.createPortal)((0,D.jsxs)(`div`,{className:`dg-rich-toolbar nodrag nopan`,style:a,onMouseDown:e=>e.preventDefault(),children:[(0,D.jsx)(`button`,{type:`button`,"aria-label":`Bold`,onClick:()=>u(`bold`),children:(0,D.jsx)(`b`,{children:`B`})}),(0,D.jsx)(`button`,{type:`button`,"aria-label":`Italic`,onClick:()=>u(`italic`),children:(0,D.jsx)(`i`,{children:`I`})})]}),document.body)]})}function qv(e){let{id:t,data:n,selected:r,width:i,height:a,profile:o,parts:s}=e,{style:c,loopClass:l,ghost:u,highlight:d}=s,{hitStyle:f,hitAttrs:p}=uie(t,n,o,d),m=Jv(n,o),h=Xv(n,c);return(0,D.jsxs)(`div`,{className:m?`dg-node dg-text-node${u.className}${l}`:`${h.className}${u.className}${l}`,style:n.stylePreset?.rough!==void 0||m||h.neutralGlyph?f:{...$v(c.shape,h.accent),...f},"data-type":n.typeId,...p,...Bv(n),...u.title,children:[(0,D.jsx)(lie,{id:t,data:n,selected:r}),!m&&Lv(n,c.shape,{id:t,width:i,height:a}),c.shape===`diamond`&&n.stylePreset?.rough===void 0&&(0,D.jsx)(ey,{accent:h.accent}),(0,D.jsx)(ty,{...e}),(0,D.jsx)(die,{data:n,style:c}),(0,D.jsx)(j,{data:n}),(0,D.jsx)(Uv,{id:t,data:n,selected:r,uses:[`link`,`threat`,`comment`,`quickAdd`,`handles`]})]})}var Jv=(e,t)=>t.node?.typelessAsText===!0&&e.typeId===void 0&&(e.state===`leaf`||e.state===`collapsed`)&&e.image===void 0,Yv=e=>e===`bar`||e===`start-dot`||e===`end-bullseye`;function Xv(e,t){if(e.hue!==void 0)return Qv(e,t,e.hue);let n=t.outline===!0&&e.color!==void 0?Pv(e.color):void 0,r=n!==void 0,i=e.color===void 0&&t.fill!==void 0?{background:t.fill,borderColor:t.fill,color:t.textOn}:void 0;return{className:`dg-node dg-shape-${t.shape}${t.dashed===!0?` dg-dashed`:``}${r?` dg-c4-outline`:``}${i!==void 0&&e.stylePreset?.rough===void 0?` dg-solid`:``}`,accent:{...i??(n===void 0?Fv(e.color):{borderColor:n,color:n}),...e.textColor===void 0?{}:{color:e.textColor}},neutralGlyph:Yv(t.shape)}}var Zv=new Set([`box`,`rounded`,`cylinder`,`pill`,`hexagon`,`person`]);function Qv(e,t,n){let r=yie(n);return{className:`dg-node dg-shape-${t.shape}${t.dashed===!0?` dg-dashed`:``}`,accent:{"--dg-hue":n,...r===void 0?{}:{"--dg-hue-ink":r},...Zv.has(t.shape)?{}:Fv(n),...e.textColor===void 0?{}:{color:e.textColor}},neutralGlyph:Yv(t.shape)}}function $v(e,t){if(e!==`diamond`)return t;let n={...t};return delete n.background,delete n.borderColor,n}function ey({accent:e}){return(0,D.jsx)(`svg`,{className:`dg-diamond-glyph`,viewBox:`0 0 100 100`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:(0,D.jsx)(`polygon`,{points:`50,1 99,50 50,99 1,50`,vectorEffect:`non-scaling-stroke`,fill:String(e.background??`var(--dg-node-fill)`),stroke:e.borderColor??`var(--dg-node-stroke)`})})}function ty({id:e,data:t,profile:n,parts:r}){let{style:i,ghost:a,highlight:o,onTab:s}=r,c=zv(t,i);return(0,D.jsxs)(`div`,{className:i.captionBelow===!0?`dg-node-row dg-glyph-caption`:`dg-node-row`,children:[a.arrow,t.image!==void 0&&(0,D.jsx)(`img`,{className:`dg-image-thumb`,src:Iv(t.assetBase,t.libraryBase,t.image),alt:``,draggable:!1}),c!==void 0&&(0,D.jsx)(c,{size:16,className:`dg-icon`}),t.labelEditing===!0?(0,D.jsx)(Die,{runs:t.rich??(t.label===``?[]:[{text:t.label}]),onCommit:e=>(t.onRichCommit??(e=>{}))(e),onTab:s}):(0,D.jsx)(ry,{data:t}),t.state===`collapsed`&&!Rv(t,n)&&(0,D.jsx)(`span`,{className:`dg-count`,children:t.hiddenCount}),(0,D.jsx)(xie,{id:e,data:t,profile:n,focusId:o.focusId})]})}var ny=e=>e===`sm`?` dg-fs-sm`:e===`lg`?` dg-fs-lg`:``;function ry({data:e}){let t={whiteSpace:`pre-wrap`,color:e.textColor,textAlign:e.textAlign};return e.rich===void 0?(0,D.jsx)(`span`,{className:`dg-label${ny(e.fontScale)}`,style:t,children:e.label}):(0,D.jsx)(`span`,{className:`dg-label dg-rich-label${ny(e.fontScale)}`,style:t,children:Eie(e.rich).map(e=>{let t=e.text;return e.italic&&(t=(0,D.jsx)(`i`,{children:t})),e.bold&&(t=(0,D.jsx)(`b`,{children:t})),(0,D.jsx)(`span`,{children:t},e.key)})})}function iy({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-cld-group${r.loopClass}`,children:[(0,D.jsxs)(`span`,{className:`dg-group-tag`,children:[(0,D.jsx)(`span`,{className:`dg-label`,children:t.label}),(0,D.jsx)(Kv,{id:e,data:t,group:!0})]}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`handles`]})]})}function ay({id:e,data:t,selected:n,width:r,height:i,parts:a}){let{name:o,loopClass:s,ghost:c}=a,l=t.textColor??t.color;return(0,D.jsxs)(`div`,{className:`dg-node dg-circle-node${c.className}${s}`,style:t.stylePreset?.rough===void 0?Fv(t.color):void 0,...c.title,children:[Lv(t,`circle`,{id:e,width:r,height:i}),(t.label!==``||t.labelEditing===!0)&&(0,D.jsx)(`span`,{className:`dg-commit-tag`,style:l===void 0?void 0:{color:l},children:o}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`link`,`quickAdd`,`handles`]})]})}function Oie({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-fb-cause${r.loopClass}`,style:t.textColor===void 0?void 0:{color:t.textColor},children:[r.name,(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}function oy({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-fb-head${r.loopClass}`,children:[(0,D.jsx)(`span`,{className:`dg-fb-spine`,"aria-hidden":`true`}),(0,D.jsx)(`span`,{className:`dg-fb-head-box`,children:r.name}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}function sy({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-lane${r.loopClass}`,children:[(0,D.jsx)(`span`,{className:`dg-lane-label`,style:t.color===void 0?void 0:{...Fv(t.color),color:t.textColor??t.color},children:r.name}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}function cy({data:e,parts:t}){return(0,D.jsx)(`div`,{className:`dg-git-stage${t.loopClass}`,style:e.color===void 0?void 0:{"--dg-stage":e.color},children:(0,D.jsx)(`span`,{className:`dg-git-stage-name`,style:e.textColor===void 0?void 0:{color:e.textColor},children:t.name})})}function ly({id:e,data:t,selected:n,width:r,height:i,profile:a,parts:o}){let{style:s,name:c,loopClass:l,highlight:u}=o,{hitStyle:d,hitAttrs:f}=uie(e,t,a,u),p=zv(t,s),m=s.outline===!0&&t.color!==void 0?Pv(t.color):void 0,h=m!==void 0,g=s.cornerBadge===!0,_=t.hue!==void 0&&t.color!==void 0?{"--dg-hue":Pv(t.color)}:void 0;return(0,D.jsxs)(`div`,{className:`dg-group${s.dashed===!0?` dg-dashed`:``}${h?` dg-group-outline`:``}${g?` dg-group-corner`:``}${l}`,style:t.stylePreset?.rough===void 0?{...m===void 0?Fv(t.color):{borderColor:m,color:t.textColor??m},..._,...t.textColor===void 0?{}:{color:t.textColor},...d}:d,"data-type":t.typeId,...f,...Bv(t),children:[(0,D.jsx)(lie,{id:e,data:t,selected:n}),Lv(t,s.shape,{id:e,width:r,height:i},h?`none`:`wash`),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`threat`,`comment`,`quickAdd`]}),(0,D.jsxs)(`div`,{className:`dg-group-header`,children:[t.image!==void 0&&(0,D.jsx)(`img`,{className:g?`dg-corner-badge`:`dg-image-thumb`,src:Iv(t.assetBase,t.libraryBase,t.image),alt:``,draggable:!1}),p!==void 0&&(0,D.jsx)(p,{size:14,className:`dg-icon`}),c,(0,D.jsx)(j,{data:t}),(0,D.jsx)(xie,{id:e,data:t,profile:a,focusId:u.focusId})]}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`handles`]})]})}function kie({id:e,data:t,selected:n,parts:r}){let{name:i,loopClass:a,ghost:o}=r;return(0,D.jsxs)(D.Fragment,{children:[t.onResize!==void 0&&(0,D.jsx)(Tne,{isVisible:n===!0,keepAspectRatio:!0,minWidth:40,minHeight:40,onResizeEnd:(n,r)=>t.onResize?.(e,r.width,r.height,{x:r.x,y:r.y})}),(0,D.jsxs)(`div`,{className:`dg-node dg-image-node${o.className}${a}`,style:t.textColor===void 0?void 0:{color:t.textColor},...o.title,children:[(0,D.jsx)(`img`,{className:`dg-image`,src:Iv(t.assetBase,t.libraryBase,t.image),alt:t.label,draggable:!1}),(0,D.jsxs)(`div`,{className:`dg-image-caption`,children:[o.arrow,i]}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`link`,`quickAdd`,`handles`]})]})]})}function Aie({id:e,data:t,selected:n,width:r,height:i,parts:a}){return(0,D.jsxs)(`div`,{className:`dg-sm-machine${a.loopClass}`,style:t.color===void 0?void 0:{"--dg-sm-accent":t.color},"data-type":t.typeId,children:[Lv(t,`box`,{id:e,width:r,height:i},`none`),(0,D.jsxs)(`span`,{className:`dg-sm-machine-tab`,children:[`sm `,a.name]}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}function uy({id:e,data:t,selected:n,width:r,height:i,parts:a}){let{name:o,loopClass:s,ghost:c}=a;return(0,D.jsxs)(`div`,{className:`dg-node dg-event-node${c.className}${s}`,style:t.stylePreset?.rough!==void 0||t.color===void 0?void 0:{color:t.color},"data-type":t.typeId,...c.title,children:[Lv(t,`diamond`,{id:e,width:r,height:i}),(t.label!==``||t.labelEditing===!0)&&(0,D.jsx)(`span`,{className:`dg-event-tag`,children:o}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`link`,`comment`,`quickAdd`,`handles`]})]})}function jie({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-sm-region${t.regionSeparator===void 0?``:` dg-sm-region-sep-${t.regionSeparator}`}${r.loopClass}`,"data-type":t.typeId,children:[(t.label!==``||t.labelEditing===!0)&&(0,D.jsx)(`span`,{className:`dg-sm-region-name`,children:r.name}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}function Mie({id:e,data:t,selected:n,parts:r}){let{style:i,name:a,loopClass:o,ghost:s}=r,c=`url("${Iv(t.assetBase,t.libraryBase,t.shape)}")`,l=t.textColor??t.color;return(0,D.jsxs)(`div`,{className:`dg-node dg-shape-node${s.className}${o}`,...s.title,children:[(0,D.jsx)(`span`,{className:`dg-shape-fill`,"aria-hidden":`true`,style:{WebkitMaskImage:c,maskImage:c,background:t.color??`var(--dg-shape-default)`}}),(0,D.jsxs)(`div`,{className:`dg-shape-label`,style:l===void 0?void 0:{color:l},children:[s.arrow,a,(0,D.jsx)(die,{data:t,style:i})]}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`link`,`quickAdd`,`handles`]})]})}var dy=new Set([Je,Ye,Xe,Ze,Qe]),fy=`M3 3 L21 21 M21 3 L3 21`;function py({id:e,data:t,selected:n,width:r,height:i,parts:a}){let{loopClass:o,name:s}=a,c=t.typeId!==Qe;return(0,D.jsxs)(`div`,{className:`dg-sm-glyph${c?` dg-sm-ring`:``}${o}`,"data-type":t.typeId,children:[c&&Lv({...t,color:void 0},`circle`,{id:e,width:r,height:i}),(0,D.jsx)(Nie,{type:t.typeId}),(t.label!==``||t.labelEditing===!0)&&(0,D.jsx)(`div`,{className:`dg-node-row dg-glyph-caption`,children:s}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}function Nie({type:e}){return e===`sm-history`?`H`:e===`sm-deep-history`?`H*`:e!==`sm-exit`&&e!==`sm-terminate`?null:(0,D.jsx)(`svg`,{className:`dg-sm-x`,"data-testid":e===`sm-exit`?`sm-exit-x`:`sm-terminate-x`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,D.jsx)(`path`,{d:fy})})}function Pie({id:e,data:t,selected:n,width:r,height:i,parts:a}){let{style:o,name:s,loopClass:c,ghost:l}=a,u=t.state===`expanded`,d=t.stylePreset?.rough===void 0?{...Fv(t.color),...t.textColor===void 0?{}:{color:t.textColor}}:void 0,f=t.composite===!0&&!u,p=t.behaviors??[];return(0,D.jsxs)(`div`,{className:u?`dg-group dg-sm-state dg-sm-state-open${c}`:`dg-node dg-shape-rounded dg-sm-state${l.className}${c}`,style:d,"data-type":t.typeId,...Bv(t),...l.title,children:[Lv(t,o.shape,{id:e,width:r,height:i},u?`wash`:`preset`),u?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`threat`,`comment`,`quickAdd`]}),(0,D.jsxs)(`div`,{className:`dg-group-header`,children:[s,(0,D.jsx)(j,{data:t})]}),p.length>0&&(0,D.jsx)(`div`,{className:`dg-sm-open-behaviors`,children:(0,D.jsx)(my,{lines:p})})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`dg-node-row dg-sm-state-name`,children:[l.arrow,s,f&&(0,D.jsx)(Fie,{})]}),p.length>0&&(0,D.jsx)(my,{lines:p}),(0,D.jsx)(j,{data:t}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`link`,`threat`,`comment`,`quickAdd`]})]}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`handles`]})]})}function my({lines:e}){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`hr`,{className:`dg-sm-divider`}),(0,D.jsx)(`ul`,{className:`dg-sm-behaviors`,children:e.map((e,t)=>(0,D.jsx)(`li`,{className:`dg-sm-behavior`,children:e},t))})]})}function Fie(){return(0,D.jsxs)(`svg`,{className:`dg-sm-composite-glyph`,"data-testid":`sm-composite-glyph`,viewBox:`0 0 24 12`,width:`24`,height:`12`,"aria-hidden":`true`,children:[(0,D.jsx)(`rect`,{x:`1`,y:`2`,width:`8`,height:`8`,rx:`4`}),(0,D.jsx)(`rect`,{x:`15`,y:`2`,width:`8`,height:`8`,rx:`4`}),(0,D.jsx)(`line`,{x1:`9`,y1:`6`,x2:`15`,y2:`6`})]})}var hy=[`uuid`,`int`,`bigint`,`text`,`varchar`,`bool`,`timestamp`,`timestamptz`,`jsonb`,`numeric`],gy=`dg-col-types`,_y=e=>e.pk===!0?`🔑`:e.fk===!0?`FK`:``,vy=e=>e.pk!==!0&&e.fk!==!0?{...e,pk:!0,fk:!1}:e.pk===!0?{...e,pk:!1,fk:!0}:{...e,pk:!1,fk:!1},Iie=(e,t)=>{if(!t.has(e))return e;for(let n=2;;n++)if(!t.has(`${e}_${n}`))return`${e}_${n}`},yy=e=>e.stopPropagation();function by({id:e,data:t,selected:n,titleEditor:r}){let i=t.columns??[],a=t.onColumnsChange,o=a!==void 0,s=(e,t)=>a?.(i.map((n,r)=>r===e?t:n)),c=e=>a?.(i.filter((t,n)=>n!==e)),l=(e,t)=>{let n=e+t;if(n<0||n>=i.length)return;let r=i.slice();[r[e],r[n]]=[r[n],r[e]],a?.(r)},u=()=>a?.([...i,{name:Iie(`column`,new Set(i.map(e=>e.name))),type:``}]);return(0,D.jsxs)(`div`,{className:`dg-node dg-table${o?` dg-table-edit`:``}`,style:t.color===void 0?void 0:{borderColor:t.color},children:[(0,D.jsx)(`div`,{className:`dg-table-header`,style:{height:30},children:r??(0,D.jsx)(`span`,{className:`dg-table-title`,children:t.label})}),(0,D.jsx)(`div`,{className:`dg-table-body`,children:i.map((e,t)=>o?(0,D.jsx)(Rie,{column:e,first:t===0,last:t===i.length-1,onSet:e=>s(t,e),onMove:e=>l(t,e),onRemove:()=>c(t)},t):(0,D.jsx)(Lie,{column:e},e.name))}),o&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`button`,{type:`button`,className:`dg-table-add nodrag nopan`,onPointerDown:yy,onClick:e=>{yy(e),u()},children:`+ add column`}),(0,D.jsx)(`datalist`,{id:gy,children:hy.map(e=>(0,D.jsx)(`option`,{value:e},e))})]}),(0,D.jsx)(pie,{data:t}),(0,D.jsx)(Hv,{id:e,data:t,selected:n})]})}function xy({column:e}){return(0,D.jsx)(zm,{id:e.name,type:`source`,position:rd.Right,className:`dg-handle dg-row-handle`,style:{top:22/2}})}function Lie({column:e}){return(0,D.jsxs)(`div`,{className:`dg-table-row`,style:{height:22},children:[(0,D.jsx)(`span`,{className:`dg-table-key`,"aria-hidden":`true`,children:_y(e)}),(0,D.jsx)(`span`,{className:`dg-table-col${e.pk===!0?` dg-pk`:``}`,children:e.name}),e.type!==void 0&&(0,D.jsx)(`span`,{className:`dg-table-type`,children:e.type}),(0,D.jsx)(xy,{column:e})]})}function Rie({column:e,first:t,last:n,onSet:r,onMove:i,onRemove:a}){return(0,D.jsxs)(`div`,{className:`dg-table-row dg-table-row-edit`,style:{height:22},children:[(0,D.jsx)(`button`,{type:`button`,className:`dg-table-badge nodrag nopan`,title:`Cycle none / PK / FK`,onPointerDown:yy,onClick:t=>{yy(t),r(vy(e))},children:_y(e)===``?`○`:_y(e)}),(0,D.jsx)(`input`,{className:`dg-table-name-input nodrag nopan`,"aria-label":`Column name`,value:e.name,onPointerDown:yy,onChange:t=>r({...e,name:t.target.value})}),(0,D.jsx)(`input`,{className:`dg-table-type-input nodrag nopan`,"aria-label":`Column type`,list:gy,value:e.type??``,onPointerDown:yy,onChange:t=>r({...e,type:t.target.value})}),(0,D.jsx)(`button`,{type:`button`,className:`dg-table-move nodrag nopan`,"aria-label":`Move up`,disabled:t,onPointerDown:yy,onClick:e=>{yy(e),i(-1)},children:`↑`}),(0,D.jsx)(`button`,{type:`button`,className:`dg-table-move nodrag nopan`,"aria-label":`Move down`,disabled:n,onPointerDown:yy,onClick:e=>{yy(e),i(1)},children:`↓`}),(0,D.jsx)(`button`,{type:`button`,className:`dg-table-del nodrag nopan`,"aria-label":`Delete column`,onPointerDown:yy,onClick:e=>{yy(e),a()},children:`✕`}),(0,D.jsx)(xy,{column:e})]})}function zie({id:e,data:t,selected:n,parts:r}){return(0,D.jsx)(by,{id:e,data:t,selected:n,titleEditor:t.labelEditing===!0?r.name:void 0})}function Bie({id:e,data:t,selected:n,parts:r}){return(0,D.jsxs)(`div`,{className:`dg-sm-zone${r.loopClass}`,style:t.color===void 0?void 0:{"--dg-sm-zone":t.color},"data-type":t.typeId,children:[(0,D.jsxs)(`div`,{className:`dg-sm-zone-head`,children:[(0,D.jsx)(`span`,{className:`dg-sm-zone-title`,children:r.name}),t.zoneNote!==void 0&&(0,D.jsx)(`span`,{className:`dg-sm-zone-note`,children:t.zoneNote})]}),(0,D.jsx)(Uv,{id:e,data:t,selected:n,uses:[`quickAdd`,`handles`]})]})}var Sy=[{match:e=>e.typeId===ze,Body:Aie},{match:e=>e.typeId===Ve,Body:jie},{match:e=>e.typeId===He,Body:Bie},{match:e=>e.typeId===Be,Body:Pie},{match:e=>e.typeId!==void 0&&dy.has(e.typeId),Body:py},{match:(e,t,n)=>n.shape===`table`&&e.state===`leaf`,Body:zie},{match:(e,t,n)=>n.shape===`circle`&&e.state===`leaf`,Body:ay},{match:e=>e.typeId===`plan-event`&&e.state===`leaf`,Body:uy},{match:e=>e.shape!==void 0&&e.state===`leaf`,Body:Mie},{match:(e,t,n)=>e.image!==void 0&&e.state===`leaf`&&n.cornerBadge!==!0,Body:kie},{match:(e,t)=>e.typeId!==void 0&&t.node?.isLane?.(e.typeId)===!0,Body:sy},{match:e=>e.typeId===Dt,Body:oy},{match:e=>e.typeId===kt,Body:Oie},{match:e=>e.typeId===_t,Body:cy},{match:e=>fe(e.typeId),Body:Wv},{match:e=>e.typeId===ie,Body:gie},{match:(e,t)=>Rv(e,t)&&e.state===`expanded`,Body:iy},{match:e=>e.state===`expanded`,Body:ly},{match:()=>!0,Body:qv}];function Cy({label:e,onCommit:t,onTab:n,ariaLabel:r=`Rename`}){let i=(0,_.useRef)(!1),a=e=>{i.current||(i.current=!0,t?.(e))};return(0,D.jsx)(`input`,{className:`dg-label-input nodrag nopan`,"aria-label":r,defaultValue:e,autoFocus:!0,onFocus:e=>e.target.select(),onBlur:e=>a(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?a(e.target.value):e.key===`Escape`?a(null):e.key===`Tab`&&!e.shiftKey&&(e.preventDefault(),a(e.target.value),n?.())},onDoubleClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function wy({id:e,data:t,selected:n,width:r,height:i}){let a=t.typeId===void 0?{shape:`box`}:t.typeRegistry.resolve(t.typeId),o=ua(t.notation),s=(0,_.useContext)(Xh),c=s.active?s.nodes.has(e)?s.variant===`loop`?` dg-loop-node-hl`:``:s.variant===`loop`?` dg-loop-node-dim`:` dg-focus-node-dim`:``,l=t.quickAdd,u=l===void 0?void 0:()=>l.run(e),d=t.labelEditing===!0?(0,D.jsx)(Cy,{label:t.label,onCommit:t.onLabelCommit,onTab:u}):(0,D.jsx)(`span`,{className:`dg-label`,children:t.label}),f=t.external===!0,p={className:f?` dg-ghost`:``,title:f?{title:`${t.label} — click to enter`}:{},arrow:f?(0,D.jsx)(`span`,{className:`dg-external-arrow`,"aria-hidden":`true`,children:`↗`}):null},{Body:m}=Sy.find(e=>e.match(t,o,a));return(0,D.jsx)(m,{id:e,data:t,selected:n,width:r,height:i,profile:o,parts:{style:a,name:d,loopClass:c,highlight:s,ghost:p,onTab:u}})}var Ty={open:`open`,mitigated:`mitigated`,accepted:`accepted`,"not-applicable":`n/a`},Ey=24,Vie=240,Hie=[0,20,40,60,80,100,120],Dy=8,Uie=28,Oy=2;function Wie(e,t){switch(t){case`ellipse`:return{x:e.x+16+9,y:e.y+8+9};case`group`:return{x:e.x+e.width-48-9,y:e.y+4+9};default:return{x:e.x-6+9,y:e.y-6+9}}}function Gie(e){let t=[];for(let{rect:n,kind:r}of e){if(r===`box`){t.push(n);continue}let{x:e,y:i,width:a,height:o}=n;t.push({x:e,y:i,width:a,height:Uie}),t.push({x:e,y:i+o-Oy,width:a,height:Oy}),t.push({x:e,y:i,width:Oy,height:o}),t.push({x:e+a-Oy,y:i,width:Oy,height:o})}return t}function ky(e){return e.map(e=>({x:e.x-Dy/2,y:e.y-Dy/2,width:Dy,height:Dy}))}var Ay=(e,t)=>{let n=Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x),r=Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y);return n>0&&r>0?n*r:0},jy=(e,t)=>{let n=Math.max(t.x-e.x,0,e.x-(t.x+t.width)),r=Math.max(t.y-e.y,0,e.y-(t.y+t.height));return Math.hypot(n,r)};function Kie(e,t){let{badge:n,element:r,size:i,away:a}=e,o=r??{x:n.x-9,y:n.y-9,width:18,height:18},{width:s,height:c}=i,l=o.y-14-c,u=o.y+o.height+14,d=o.x-14-s,f=o.x+o.width+14,p={x:0,y:-1},m={x:0,y:1},h={x:-1,y:0},g={x:1,y:0},_=[{at:{x:n.x+Ey-s,y:l},out:p},{at:{x:n.x-Ey,y:l},out:p},{at:{x:d,y:n.y-Ey},out:h},{at:{x:f,y:n.y-Ey},out:g},{at:{x:n.x+Ey-s,y:u},out:m},{at:{x:n.x-Ey,y:u},out:m},{at:{x:d,y:n.y+Ey-c},out:h},{at:{x:f,y:n.y+Ey-c},out:g}],v=[_];if(a!==void 0){let e=e=>(e.at.x+s/2-n.x)*a.x+(e.at.y+c/2-n.y)*a.y;v=[_.filter(t=>e(t)>0),_.filter(t=>e(t)<=0)]}let y,b=1/0;for(let e of v)for(let r of Hie)for(let i of e){let e={x:i.at.x+i.out.x*r,y:i.at.y+i.out.y*r},a={...e,width:s,height:c};if(jy(n,a)>Vie)continue;let o=0;for(let e of t)o+=Ay(a,e);if(o===0)return e;o<b&&(y=e,b=o)}return y??_[0].at}var qie=16,Jie=10,Yie=16,Xie=6,My=5,Zie=24,Ny=6.2,Qie=5.6,$ie=162,eae=47,Py=12,tae=22,nae=26,rae=13;function iae(e,t){let{name:n,threats:r,comments:i=[],links:a=[]}=e,o=(e,t,n)=>Math.max(1,Math.ceil(e.length*n/t)),s=qie+o(n,$ie,Ny)*Yie+Xie;for(let e of r){let n=Ty[e.status??`open`],r=t||(e.description??``)!==``||(e.mitigation??``)!==``,i=220-eae-(Py+n.length*Qie)-(r?tae:0);s+=o(e.title,i,Ny)*Yie+My}if(i.length>0){s+=nae;for(let e of i)s+=o(e.text,220-2*Jie,Ny)*Yie+(e.by!==void 0||e.at!==void 0?rae:0)+My}return a.length>0&&(s+=nae+a.length*21),t&&(s+=Zie),s}var Fy=7,aae=12,Iy=2,Ly=11,oae=4;function sae(e,t){let{width:n,height:r}=t,i=[{side:`top`,gap:-e.y},{side:`bottom`,gap:e.y-r},{side:`left`,gap:-e.x},{side:`right`,gap:e.x-n}],a=i[0];for(let e of i)e.gap>a.gap&&(a=e);if(a.gap<=0)return null;let o=(e,t)=>Math.min(Math.max(t,19),e-aae-Fy),s,c;switch(a.side){case`top`:{let t=o(n,e.x);s=[{x:t-Fy,y:Iy},{x:t+Fy,y:Iy}],c={x:t,y:Iy};break}case`bottom`:{let t=o(n,e.x);s=[{x:t-Fy,y:r-Iy},{x:t+Fy,y:r-Iy}],c={x:t,y:r-Iy};break}case`left`:{let t=o(r,e.y);s=[{x:Iy,y:t-Fy},{x:Iy,y:t+Fy}],c={x:Iy,y:t};break}default:{let t=o(r,e.y);s=[{x:n-Iy,y:t-Fy},{x:n-Iy,y:t+Fy}],c={x:n-Iy,y:t}}}let l=e.x-c.x,u=e.y-c.y,d=Math.hypot(l,u);if(d-Ly<oae)return null;let f={x:e.x-l/d*Ly,y:e.y-u/d*Ly};return{side:a.side,base:s,tip:f}}var Ry=e=>e.stopPropagation();function cae({data:e,positionAbsoluteX:t,positionAbsoluteY:n,width:r,height:i}){let[a,o]=(0,_.useState)(null),s=e.editing?a??e.editingId:void 0,[c,l]=(0,_.useState)(()=>new Set);(0,_.useEffect)(()=>{e.editing||o(null)},[e.editing]);let u=e.threats.filter(ln).length,d=Rg({open:u,total:e.threats.length}),f=()=>{o(null),e.onEndEdit?.()},p=e=>l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),m=r!==void 0&&i!==void 0&&r>0&&i>0?sae({x:e.badge.x-(t??0),y:e.badge.y-(n??0)},{width:r,height:i}):null;return(0,D.jsxs)(`div`,{className:`dg-note`,"data-target":Me(e.target),style:{width:220},children:[m!==null&&(0,D.jsx)(`svg`,{className:`dg-note-tail`,"data-side":m.side,"aria-hidden":`true`,children:(0,D.jsx)(`path`,{d:`M${m.base[0].x} ${m.base[0].y} L${m.tip.x} ${m.tip.y} L${m.base[1].x} ${m.base[1].y}`})}),(0,D.jsxs)(`div`,{className:`dg-note-head`,children:[(0,D.jsx)(`span`,{className:`dg-note-name`,children:e.name}),e.threats.length>0&&(0,D.jsx)(`span`,{className:`dg-note-count`,"data-state":d.state,title:d.title,children:`${u} / ${e.threats.length}`})]}),e.threats.length>0&&(0,D.jsx)(`ul`,{className:`dg-note-rows`,children:e.threats.map(t=>(0,D.jsx)(lae,{threat:t,data:e,renaming:s===t.id,expanded:c.has(t.id),onRename:()=>o(t.id),onRenamed:f,onToggle:()=>p(t.id)},t.id))}),e.comments.length>0&&(0,D.jsx)(fae,{comments:e.comments}),e.links.length>0&&(0,D.jsx)(pae,{links:e.links,onOpenLink:e.onOpenLink}),e.editing&&e.onAddThreat!==void 0&&(0,D.jsx)(Ig,{className:`dg-note-add nodrag nopan`,onAdd:()=>e.onAddThreat?.(e.target),onPointerDown:Ry})]})}function lae({threat:e,data:t,renaming:n,expanded:r,onRename:i,onRenamed:a,onToggle:o}){let s=e.status??`open`,c=(e.description??``)!==``||(e.mitigation??``)!==``,l=r&&(t.editing||c);return(0,D.jsxs)(`li`,{className:`dg-note-row`,"data-open":ln(e)?`true`:`false`,children:[(0,D.jsxs)(`div`,{className:`dg-note-line`,children:[(0,D.jsx)(`span`,{className:`dg-stride`,"data-category":e.category,title:cn[e.category],children:e.category}),n?(0,D.jsx)(`span`,{className:`nodrag nopan`,onMouseDown:Ry,onPointerDown:Ry,children:(0,D.jsx)(Cy,{label:e.title,ariaLabel:`Rename threat`,onCommit:n=>{t.onRetitleThreat?.(t.target,e.id,n===null?``:n.trim()),a()}})}):(0,D.jsx)(`span`,{className:`dg-note-title`,onDoubleClick:t.editing?e=>{e.stopPropagation(),i()}:void 0,children:e.title}),(0,D.jsx)(uae,{threat:e,status:s,data:t}),(t.editing||c)&&(0,D.jsx)(`button`,{type:`button`,className:`dg-note-expand nodrag nopan`,"aria-expanded":l,"aria-label":l?`Hide details`:`Show details`,onMouseDown:Ry,onPointerDown:Ry,onClick:e=>{e.stopPropagation(),o()},children:l?`▾`:`▸`})]}),l&&(0,D.jsx)(dae,{threat:e,data:t})]})}function uae({threat:e,status:t,data:n}){let r=Ty[t];return!n.editing||n.onSetThreatStatus===void 0?(0,D.jsx)(`span`,{className:`dg-note-status`,"data-status":t,children:r}):(0,D.jsx)(`button`,{type:`button`,className:`dg-note-status nodrag nopan`,"data-status":t,"aria-label":`Set status`,title:`Status: ${r} — click to change`,onMouseDown:Ry,onPointerDown:Ry,onClick:t=>{t.stopPropagation(),n.onSetThreatStatus?.(n.target,e.id,gn(e))},children:r})}function dae({threat:e,data:t}){return(0,D.jsx)(`div`,{className:`dg-note-details`,children:t.editing&&t.onEditThreatText!==void 0?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(mae,{label:`Description`,value:e.description??``,onCommit:n=>t.onEditThreatText?.(t.target,e.id,`description`,n)}),(0,D.jsx)(mae,{label:`Mitigation`,value:e.mitigation??``,onCommit:n=>t.onEditThreatText?.(t.target,e.id,`mitigation`,n)})]}):(0,D.jsxs)(D.Fragment,{children:[(e.description??``)!==``&&(0,D.jsx)(`p`,{className:`dg-note-text`,children:e.description}),(e.mitigation??``)!==``&&(0,D.jsxs)(`p`,{className:`dg-note-text`,children:[(0,D.jsx)(`span`,{className:`dg-note-text-label`,children:`Mitigation`}),` `,e.mitigation]})]})})}function fae({comments:e}){return(0,D.jsxs)(`section`,{className:`dg-note-section`,"aria-label":`Comments`,children:[(0,D.jsx)(`h4`,{className:`dg-note-section-title`,children:`Comments`}),(0,D.jsx)(`ul`,{className:`dg-note-comments`,children:e.map(e=>(0,D.jsxs)(`li`,{className:`dg-note-comment`,children:[(0,D.jsx)(`p`,{className:`dg-note-text`,children:e.text}),(e.by!==void 0||e.at!==void 0)&&(0,D.jsx)(`span`,{className:`dg-note-meta`,children:[e.by,e.at].filter(e=>e!==void 0).join(` · `)})]},e.id))})]})}function pae({links:e,onOpenLink:t}){return(0,D.jsxs)(`section`,{className:`dg-note-section`,"aria-label":`Links`,children:[(0,D.jsx)(`h4`,{className:`dg-note-section-title`,children:`Links`}),(0,D.jsx)(`ul`,{className:`dg-note-links`,children:e.map(e=>(0,D.jsx)(`li`,{children:(0,D.jsx)(`a`,{className:`dg-note-link nodrag nopan`,.../^https?:/.test(e.url)?{href:e.url,target:`_blank`,rel:`noopener noreferrer`}:{},onMouseDown:Ry,onPointerDown:Ry,onClick:n=>{n.stopPropagation(),t!==void 0&&(n.preventDefault(),t(e.url))},children:e.label})},`${e.label}\u0000${e.url}`))})]})}function mae({label:e,value:t,onCommit:n}){let[r,i]=(0,_.useState)(t);(0,_.useEffect)(()=>{i(t)},[t]);let a=(0,_.useRef)(!1);return(0,D.jsx)(`textarea`,{className:`dg-note-field nodrag nopan`,"aria-label":e,placeholder:e,rows:2,value:r,onMouseDown:Ry,onPointerDown:Ry,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(i(t),a.current=!0,e.target.blur())},onBlur:()=>{if(a.current){a.current=!1;return}let e=r.trim();e!==t.trim()&&n(e)}})}var hae={diagram:wy,note:cae},zy={diagram:kv};function By({data:e,...t}){return{...xe(t),type:`diagram`,data:e}}function gae({data:e,...t}){return{...xe(t),type:`note`,data:e,selectable:!1,zIndex:2}}function Vy({data:e,...t}){return{...xe(t),type:`diagram`,data:e}}function Hy(e){let t=e.length/2;if(t===0)return``;let n=t=>e[2*t],r=t=>e[2*t+1];if(t===1)return`M ${n(0)} ${r(0)} L ${n(0)} ${r(0)}`;if(t===2)return`M ${n(0)} ${r(0)} L ${n(1)} ${r(1)}`;let i=[`M ${n(0)} ${r(0)}`];for(let e=1;e<t-1;e++)i.push(`Q ${n(e)} ${r(e)} ${(n(e)+n(e+1))/2} ${(r(e)+r(e+1))/2}`);return i.push(`L ${n(t-1)} ${r(t-1)}`),i.join(` `)}function _ae(e,t=.75){let n=e.length/2;if(n<=2)return e;let r=Array(n).fill(!1);r[0]=!0,r[n-1]=!0;let i=[[0,n-1]];for(;i.length>0;){let[n,a]=i.pop(),o=e[2*n],s=e[2*n+1],c=e[2*a],l=e[2*a+1],u=c-o,d=l-s,f=Math.hypot(u,d),p=-1,m=t;for(let t=n+1;t<a;t++){let n=e[2*t],r=e[2*t+1],i=f===0?Math.hypot(n-o,r-s):Math.abs(d*n-u*r+c*s-l*o)/f;i>m&&(p=t,m=i)}p!==-1&&(r[p]=!0,i.push([n,p],[p,a]))}let a=[];for(let t=0;t<n;t++)r[t]&&a.push(e[2*t],e[2*t+1]);return a}function vae(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e){let e=(a.width??3)/2;for(let o=0;o<a.points.length;o+=2){let s=a.points[o],c=a.points[o+1];t=Math.min(t,s-e),r=Math.max(r,s+e),n=Math.min(n,c-e),i=Math.max(i,c+e)}}if(t!==1/0)return{x:t,y:n,width:r-t,height:i-n}}function yae(e,t){return e===null?null:{points:e,width:t?.width??3,color:t?.color}}var bae=12;function xae({strokes:e,live:t,visible:n,erasing:r,onErase:i}){let{x:a,y:o,zoom:s}=kh();return(0,D.jsx)(`svg`,{className:`dg-drawings`,"aria-hidden":`true`,style:n?void 0:{display:`none`},children:(0,D.jsxs)(`g`,{transform:`translate(${a} ${o}) scale(${s})`,children:[e.map(e=>(0,D.jsx)(`path`,{className:`dg-stroke`,"data-stroke-id":e.id,d:Hy(e.points),stroke:e.color??`var(--dg-ink)`,strokeWidth:e.width??3},e.id)),r&&e.map(e=>(0,D.jsx)(`path`,{className:`dg-stroke-hit`,"data-stroke-id":e.id,d:Hy(e.points),strokeWidth:Math.max(e.width??3,bae/s),onClick:()=>i?.(e.id)},`hit-${e.id}`)),t!=null&&t.points.length>=2&&(0,D.jsx)(`path`,{className:`dg-stroke dg-stroke-live`,d:Hy(t.points),stroke:t.color??`var(--dg-ink)`,strokeWidth:t.width})]})})}function Sae({trails:e,live:t}){let{x:n,y:r,zoom:i}=kh(),a=(e,t,n)=>{let r=Hy(t);return(0,D.jsxs)(`g`,{className:`dg-laser-trail ${n?`dg-laser-fade`:`dg-laser-live`}`,children:[(0,D.jsx)(`path`,{className:`dg-laser-halo`,d:r,vectorEffect:`non-scaling-stroke`}),(0,D.jsx)(`path`,{className:`dg-laser-core`,d:r,vectorEffect:`non-scaling-stroke`})]},e)};return(0,D.jsx)(`svg`,{className:`dg-laser`,"aria-hidden":`true`,children:(0,D.jsxs)(`g`,{transform:`translate(${n} ${r}) scale(${i})`,children:[e.map(e=>a(e.id,e.points,!0)),t!==null&&t.length>=2&&a(`live`,t,!1)]})})}function Cae({enabled:e,toFlow:t,onStroke:n,simplify:r=!0}){let[i,a]=(0,_.useState)(null),o=(0,_.useRef)(null),s=(0,_.useRef)(null),c=(0,_.useCallback)(e=>{let n=o.current;if(n===null)return;let r=e.nativeEvent,i=typeof r.getCoalescedEvents==`function`?r.getCoalescedEvents():[];for(let e of i.length>0?i:[r]){let r=t({x:e.clientX,y:e.clientY});n.push(r.x,r.y)}a([...n])},[t]),l=(0,_.useCallback)(n=>{if(!e||n.button!==0||n.target?.closest?.(`.react-flow__panel`)!==null)return;if(s.current!==null){n.stopPropagation(),n.preventDefault();return}n.stopPropagation(),n.preventDefault(),n.currentTarget.setPointerCapture?.(n.pointerId),s.current=n.pointerId;let r=t({x:n.clientX,y:n.clientY});o.current=[r.x,r.y],a([r.x,r.y])},[e,t]),u=(0,_.useCallback)(e=>{s.current===e.pointerId&&(e.stopPropagation(),c(e))},[c]),d=(0,_.useCallback)((e,t)=>{if(s.current!==e.pointerId)return;e.stopPropagation();let i=o.current;if(o.current=null,s.current=null,a(null),t&&i!==null){let e=i.map(e=>Math.round(e));n(r?_ae(e):e)}},[n,r]);return{live:i,handlers:{onPointerDownCapture:l,onPointerMoveCapture:u,onPointerUpCapture:(0,_.useCallback)(e=>d(e,!0),[d]),onPointerCancelCapture:(0,_.useCallback)(e=>d(e,!1),[d])}}}var wae=1e3;function Uy({enabled:e,toFlow:t}){let[n,r]=(0,_.useState)([]),i=(0,_.useRef)(0),a=(0,_.useRef)(new Set),o=(0,_.useCallback)(e=>{let t=i.current++;r(n=>[...n,{id:t,points:e}]);let n=setTimeout(()=>{a.current.delete(n),r(e=>e.filter(e=>e.id!==t))},wae);a.current.add(n)},[]);(0,_.useEffect)(()=>{let e=a.current;return()=>{for(let t of e)clearTimeout(t);e.clear()}},[]);let s=Cae({enabled:e,toFlow:t,onStroke:o,simplify:!1});return{live:s.live,trails:n,handlers:s.handlers}}function Tae(e){let t=e.target,n=t?.tagName;return n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t?.isContentEditable===!0?!1:!(e.metaKey||e.ctrlKey||e.altKey)}function Wy(e){let t=(0,_.useRef)(e.fit);t.current=e.fit,(0,_.useEffect)(()=>{if(e.chromeless||!e.builtinKeys)return;let n=e=>{e.repeat||e.key.toLowerCase()!==`f`||!Tae(e)||(e.preventDefault(),t.current())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e.chromeless,e.builtinKeys])}function Gy(e){let[t,n]=(0,_.useState)(!1),r=e.editing&&e.tool===`pen`&&e.drillRoot===void 0&&!t,i=e.editing&&e.tool===`eraser`&&e.drillRoot===void 0&&!t,a=r||t;(0,_.useEffect)(()=>{n(!1)},[e.modelId]),(0,_.useEffect)(()=>{if(e.chromeless)return;let t=t=>{Tae(t)&&(t.key===`Escape`?n(!1):e.builtinKeys&&t.key.toLowerCase()===`l`&&!t.repeat&&(t.preventDefault(),n(e=>!e)))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.chromeless,e.builtinKeys]);let o=Cae({enabled:r&&e.onAddStroke!==void 0,toFlow:e.toFlow,onStroke:t=>e.onAddStroke?.({points:t,...e.pen?.color===void 0?{}:{color:e.pen.color},width:e.pen?.width??3})}),s=Uy({enabled:t,toFlow:e.toFlow});return{laserOn:t,setLaserOn:n,penActive:r,eraserActive:i,gestureCaptured:a,pen:o,laser:s,gestureHandlers:(0,_.useMemo)(()=>{let e=e=>t=>{s.handlers[e](t),o.handlers[e](t)};return{onPointerDownCapture:e(`onPointerDownCapture`),onPointerMoveCapture:e(`onPointerMoveCapture`),onPointerUpCapture:e(`onPointerUpCapture`),onPointerCancelCapture:e(`onPointerCancelCapture`)}},[s.handlers,o.handlers])}}function Eae(e){let t=(0,_.useMemo)(()=>e.drawings?.planes[Ae(e.model,e.plane)]??[],[e.drawings,e.model,e.plane]),n=(0,_.useRef)([]);n.current=t;let[r,i]=(0,_.useState)(!0);return(0,_.useEffect)(()=>{i(!0)},[e.model.id]),{strokes:t,strokesRef:n,drawingsVisible:r,setDrawingsVisible:i}}function Dae({lines:e}){let{zoom:t}=kh();if(e.length===0)return null;let n=1/t,r=`${4/t} ${3/t}`;return(0,D.jsx)(Dh,{children:(0,D.jsx)(`svg`,{className:`dg-guides`,"aria-hidden":`true`,children:e.map((e,t)=>e.axis===`x`?(0,D.jsx)(`line`,{className:`dg-guide`,x1:e.at,x2:e.at,y1:e.from,y2:e.to,strokeWidth:n,strokeDasharray:r},t):(0,D.jsx)(`line`,{className:`dg-guide`,y1:e.at,y2:e.at,x1:e.from,x2:e.to,strokeWidth:n,strokeDasharray:r},t))})})}var Oae=[{mode:`left`,glyph:`⇤`,label:`Align left`},{mode:`centerX`,glyph:`⇹`,label:`Align centre`},{mode:`right`,glyph:`⇥`,label:`Align right`},{mode:`top`,glyph:`⤒`,label:`Align top`},{mode:`middle`,glyph:`⇳`,label:`Align middle`},{mode:`bottom`,glyph:`⤓`,label:`Align bottom`}];function kae({ids:e,onAlign:t,onDistribute:n}){if(e.length<2)return null;let r=e.length>=3;return(0,D.jsxs)(Jp,{position:`top-center`,className:`dg-selection-toolbar`,"aria-label":`Arrange selection`,children:[Oae.map(e=>(0,D.jsx)(`button`,{type:`button`,className:`dg-arrange-btn`,title:e.label,"aria-label":e.label,onClick:()=>t(e.mode),children:e.glyph},e.mode)),(0,D.jsx)(`span`,{className:`dg-arrange-sep`}),(0,D.jsx)(`button`,{type:`button`,className:`dg-arrange-btn`,title:`Distribute horizontally (3+ nodes)`,"aria-label":`Distribute horizontally`,disabled:!r,onClick:()=>n(`x`),children:`⋯`}),(0,D.jsx)(`button`,{type:`button`,className:`dg-arrange-btn`,title:`Distribute vertically (3+ nodes)`,"aria-label":`Distribute vertically`,disabled:!r,onClick:()=>n(`y`),children:`⋮`})]})}var Ky={layers:`Layers`,kinds:`Connections`,types:`Elements`,marks:`Marks`,items:`Notes`},qy=[`layers`,`kinds`,`types`,`marks`,`items`],Jy=`var(--dg-node-stroke, var(--dg-border))`,Yy=.75;function Aae({name:e,at:t,x:n,color:r}){let i=wg[e];return i===void 0?null:(0,D.jsx)(`g`,{transform:`translate(${n} 6) scale(${t===`start`?-.75:Yy} ${Yy}) translate(${-i.refX} -5)`,...Eg.has(e)?{stroke:r,strokeWidth:1.25,vectorEffect:`non-scaling-stroke`,fill:`none`}:{fill:r},children:i.el})}function jae({style:e,color:t}){let n=e.width??1.5,r=e.dashed===!0||e.animated===!0?`6 4`:void 0,i=e.endMarker??`arrow`,a=wg[i];return(0,D.jsxs)(`svg`,{className:`dg-legend-swatch`,viewBox:`0 0 24 12`,width:`24`,height:`12`,"aria-hidden":`true`,children:[(0,D.jsx)(`line`,{x1:`1`,y1:`6`,x2:a!==void 0&&!Eg.has(i)?23-(a.refX-2)*Yy:23,y2:`6`,stroke:t,strokeWidth:n,strokeDasharray:r}),e.zigzag===!0&&(0,D.jsx)(`polyline`,{points:`8,9 12.5,4.5 10.5,7.5 15,3`,fill:`none`,stroke:t,strokeWidth:1.25}),e.startMarker!==void 0&&(0,D.jsx)(Aae,{name:e.startMarker,at:`start`,x:1,color:t}),(0,D.jsx)(Aae,{name:i,at:`end`,x:23,color:t})]})}function Mae({s:e,stroke:t}){let n={fill:`var(--dg-surface)`,stroke:t,strokeDasharray:e.dashed===!0?`4 3`:void 0};switch(e.shape){case`cylinder`:return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`ellipse`,{cx:`12`,cy:`4`,rx:`8`,ry:`3`,fill:`var(--dg-surface)`,stroke:t}),(0,D.jsx)(`path`,{d:`M4 4 v8 a8 3 0 0 0 16 0 v-8`,fill:`var(--dg-surface)`,stroke:t})]});case`pill`:return(0,D.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`10`,rx:`5`,...n});case`rounded`:return(0,D.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`10`,rx:`4.5`,...n});case`hexagon`:return(0,D.jsx)(`polygon`,{points:`6,3 18,3 22,8 18,13 6,13 2,8`,fill:`var(--dg-surface)`,stroke:t});case`bubble`:return(0,D.jsx)(`path`,{d:`M 4 3 L 20 3 Q 22 3 22 5 L 22 11 Q 22 13 20 13 L 10 13 L 6 16 L 6 13 L 4 13 Q 2 13 2 11 L 2 5 Q 2 3 4 3 Z`,...n});case`person`:return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`path`,{d:`M5 15 v-3 a4 4 0 0 1 4 -4 h6 a4 4 0 0 1 4 4 v3 z`,...n}),(0,D.jsx)(`circle`,{cx:`12`,cy:`4.5`,r:`3`,...n})]});case`table`:return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`12`,rx:`1.5`,...n}),(0,D.jsx)(`path`,{d:`M2 6.5 h20 M2 10.25 h20`,fill:`none`,stroke:t})]});case`circle`:return(0,D.jsx)(`circle`,{cx:`12`,cy:`8`,r:`5.5`,...n});case`ellipse`:return(0,D.jsx)(`ellipse`,{cx:`12`,cy:`8`,rx:`10`,ry:`5.5`,...n});case`diamond`:return(0,D.jsx)(`polygon`,{points:`12,1.5 20,8 12,14.5 4,8`,...n});case`bar`:return(0,D.jsx)(`rect`,{x:`10.5`,y:`1`,width:`3`,height:`14`,rx:`1`,fill:t});case`start-dot`:return(0,D.jsx)(`circle`,{cx:`12`,cy:`8`,r:`5`,fill:t});case`end-bullseye`:return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`circle`,{cx:`12`,cy:`8`,r:`6`,fill:`var(--dg-surface)`,stroke:t}),(0,D.jsx)(`circle`,{cx:`12`,cy:`8`,r:`3.25`,fill:t})]});case`send-signal`:return(0,D.jsx)(`polygon`,{points:`2,3 17,3 22,8 17,13 2,13`,...n});case`receive-signal`:return(0,D.jsx)(`polygon`,{points:`2,3 22,3 22,13 2,13 7,8`,...n});case`note`:return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`polygon`,{points:`2,2 17,2 22,7 22,14 2,14`,...n}),(0,D.jsx)(`path`,{d:`M17 2 v5 h5`,fill:`none`,stroke:t})]});case`store`:return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`line`,{x1:`2`,y1:`3.5`,x2:`22`,y2:`3.5`,stroke:t}),(0,D.jsx)(`line`,{x1:`2`,y1:`12.5`,x2:`22`,y2:`12.5`,stroke:t})]});case`box`:return(0,D.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`10`,rx:`2`,...n})}}function Nae({mark:e}){let t=e===`threat-open`?Rg({open:1,total:1}):e===`threat-handled`?Rg({open:0,total:1}):void 0;return(0,D.jsx)(`span`,{className:`dg-legend-swatch dg-legend-mark`,"data-mark":e,"aria-hidden":`true`,children:t===void 0?(0,D.jsx)(`span`,{className:`dg-table-key`,children:e===`pk`?`🔑`:`FK`}):(0,D.jsx)(`span`,{className:`dg-legend-badge`,"data-state":t.state,children:t.text})})}function Pae({swatch:e,icons:t}){if(e===void 0)return(0,D.jsx)(`span`,{className:`dg-legend-swatch`,"aria-hidden":`true`});if(e.draw===`chip`)return(0,D.jsx)(`span`,{className:`dg-legend-swatch dg-legend-chip`,style:{background:e.color},"aria-hidden":`true`});if(e.draw===`mark`)return(0,D.jsx)(Nae,{mark:e.mark});if(e.draw===`line`)return(0,D.jsx)(jae,{style:e.style,color:e.color??`var(--dg-edge)`});let n=e.icon===void 0?void 0:t?.resolve(e.icon),r=e.color===void 0?Jy:e.style.outline===!0?Pv(e.color):e.color;return(0,D.jsxs)(`span`,{className:`dg-legend-swatch dg-legend-shape`,children:[(0,D.jsx)(`svg`,{viewBox:`0 0 24 16`,width:`24`,height:`16`,"aria-hidden":`true`,children:(0,D.jsx)(Mae,{s:e.style,stroke:r})}),n!==void 0&&(0,D.jsx)(n,{size:9,className:`dg-legend-icon`})]})}function Fae({rows:e,title:t=`Legend`,interactive:n,onToggleLayer:r,onToggleDrawings:i,icons:a,onMeasure:o}){let[s,c]=(0,_.useState)(!1),l=(0,_.useRef)(null),u=(0,_.useRef)(null);if((0,_.useEffect)(()=>{if(o===void 0||l.current===null)return;let{width:e,height:t}=l.current.getBoundingClientRect(),n={width:Math.ceil(e),height:Math.ceil(t)},r=u.current;r!==null&&r.width===n.width&&r.height===n.height||(u.current=n,o(n))},[o,e,s]),e.length===0)return null;let d=qy.map(t=>[t,e.filter(e=>e.section===t)]).filter(([,e])=>e.length>0);return(0,D.jsxs)(`div`,{className:`dg-legend`,ref:l,children:[(0,D.jsxs)(`div`,{className:`dg-legend-head`,children:[(0,D.jsx)(`span`,{className:`dg-legend-title`,children:t}),n&&(0,D.jsx)(`button`,{type:`button`,className:`dg-legend-collapse`,"aria-label":s?`Expand legend`:`Collapse legend`,"aria-expanded":!s,onClick:()=>c(e=>!e),children:(0,D.jsx)(`span`,{"aria-hidden":`true`,children:s?`▸`:`▾`})})]}),!s&&(0,D.jsx)(`div`,{className:`dg-legend-body`,children:d.map(([e,t])=>(0,D.jsxs)(`div`,{className:`dg-legend-section`,children:[(0,D.jsx)(`div`,{className:`dg-legend-section-title`,children:Ky[e]}),t.map(e=>{let t=(0,D.jsx)(Pae,{swatch:e.swatch,icons:a}),n=e.layer;return e.drawings===!0&&i!==void 0?(0,D.jsxs)(`button`,{type:`button`,className:`dg-legend-row dg-legend-toggle${e.active===!0?``:` dg-legend-off`}`,"aria-pressed":e.active===!0,onClick:i,children:[t,(0,D.jsx)(`span`,{className:`dg-legend-label`,children:e.label})]},e.id):n!==void 0&&r!==void 0?(0,D.jsxs)(`button`,{type:`button`,className:`dg-legend-row dg-legend-toggle${e.active===!0?``:` dg-legend-off`}`,"aria-pressed":e.active===!0,onClick:()=>r(n),children:[t,(0,D.jsx)(`span`,{className:`dg-legend-label`,children:e.label})]},e.id):(0,D.jsxs)(`div`,{className:`dg-legend-row${(n!==void 0||e.drawings===!0)&&e.active!==!0?` dg-legend-off`:``}`,children:[t,(0,D.jsx)(`span`,{className:`dg-legend-label`,children:e.label})]},e.id)})]},e))})]})}function Iae({legend:e,interactive:t,onToggleLayer:n,onToggleDrawings:r,icons:i}){return!e.showLegend||e.legendRowList.length===0?null:(0,D.jsx)(Jp,{position:e.legendConfig?.position??`bottom-right`,children:(0,D.jsx)(Fae,{rows:e.legendRowList,title:e.legendConfig?.title,interactive:t,onToggleLayer:n,onToggleDrawings:t?r:void 0,icons:i,onMeasure:e.setLegendSize})})}var Lae=e=>(e.behaviors??[]).map(e=>Ie(e)),Xy=15.4,Zy=e=>Lae(e).flatMap(e=>e.split(`
|
|
23
|
-
`));function Rae(e){let t=Zy(e);return t.length===0?0:Math.ceil(9+t.length*Xy)}var Qy={TITLE_STRIP_W:28,LANE_STRIP_W:28,LANE_MIN_W:320,LANE_MIN_H:120,PAD:24};function $y(e,t){let n=new Map;return ke(e,we(e,t)).forEach((e,t)=>{let r=`${e.parent}\u0000${e.child}`;n.has(r)||n.set(r,t)}),(e,t)=>n.get(`${e}\u0000${t}`)??2**53-1}function zae(e,t,n){if(!t.nodes.some(e=>e.type===`activity-frame`))return e;let r=$y(t,n),i=!1,a=e=>{let t=e.children.map(a);if(e.node.type===`activity-frame`){let n=[...t].sort((t,n)=>r(e.id,t.id)-r(e.id,n.id));n.some((e,n)=>e!==t[n])&&(t=n)}return t.every((t,n)=>t===e.children[n])?e:(i=!0,{...e,children:t})},o=e.roots.map(a);return i?{...e,roots:o}:e}function eb(e,t,n,{plane:r,sizes:i}={}){if(!n.nodes.some(e=>e.type===`activity-frame`))return e;let a=new Map(n.nodes.map(e=>[e.id,e.type])),o=new Map(e),{TITLE_STRIP_W:s,LANE_MIN_W:c,LANE_MIN_H:l,PAD:u}=Qy,d=$y(n,r),f=e=>{let t=e.children.filter(e=>a.get(e.id)===`activity-lane`&&o.has(e.id)).sort((t,n)=>d(e.id,t.id)-d(e.id,n.id));if(t.length===0){let t=o.get(e.id);o.set(e.id,{...t,width:Math.max(t.width,s+c),height:Math.max(t.height,l)});return}let n=[],r=c;for(let e of t){let t=0,a=0;for(let n of e.children){let e=o.get(n.id);e!==void 0&&(t=Math.max(t,e.x+e.width),a=Math.max(a,e.y+e.height))}let s=i?.[e.id];n.push(Math.max(l,a+u,s?.h??0)),r=Math.max(r,t+u,s?.w??0)}let f=0;t.forEach((e,t)=>{let i=o.get(e.id);o.set(e.id,{...i,x:s,y:f,width:r,height:n[t]}),f+=n[t]});let p=o.get(e.id);o.set(e.id,{...p,width:s+r,height:f})},p=e=>{a.get(e.id)===`activity-frame`&&o.has(e.id)&&f(e),e.children.forEach(p)};return t.roots.forEach(p),o}function Bae(e,t,n){let r=[...e].sort((e,t)=>e.y-t.y),i=r.findIndex(e=>e.id===t);if(i===-1)return 0;let a=n+r[i].height/2;return r.filter(e=>e.id!==t&&e.y+e.height/2<a).length-i}var Vae={"elk.nodeLabels.placement":`OUTSIDE V_TOP H_CENTER`},Hae={"elk.nodeLabels.placement":`OUTSIDE H_RIGHT V_CENTER`};function Uae(e,t,n){let r=new Map;for(let t of e)t.from===t.to&&r.set(t.from,[...r.get(t.from)??[],t]);let i=t===`RIGHT`||t===`LEFT`,a=new Map;for(let[e,t]of r){let r=yv(t.length-1),o=t.map(n).filter(e=>e!==void 0),s=Math.max(0,...o.map(e=>e.width)),c=Math.max(0,...o.map(e=>e.height)),l=e=>r+(o.length>0?10+e:0);a.set(e,i?{width:Math.max(1,s),height:l(c/2),text:`self-loops`,layoutOptions:Vae}:{width:l(s),height:Math.max(2*bv(0),c),text:`self-loops`,layoutOptions:Hae})}return a}var Wae={width:200,height:88};function tb(e){return{width:e.width,height:e.height+(e.reserveBottom??0)}}var nb=`layered`,rb=new Set([`force`,`stress`,`mrtree`,`radial`]);function ib(e){return rb.has(e?.algorithm??`layered`)}function ab(e){let t=e?.algorithm??`layered`,n=e?.spacing,r=String(n===void 0?40:n),i=r,a={"elk.algorithm":t,"elk.direction":e?.direction??`DOWN`,"elk.spacing.nodeNode":r,"elk.spacing.edgeNode":`20`,"elk.spacing.edgeEdge":`12`,"elk.spacing.componentComponent":`48`,"elk.spacing.edgeLabel":`6`,"elk.separateConnectedComponents":`true`,...ib(e)?{}:{"elk.hierarchyHandling":`INCLUDE_CHILDREN`}};return t===`layered`&&(a[`elk.layered.spacing.nodeNodeBetweenLayers`]=i,a[`elk.layered.thoroughness`]=`10`,a[`elk.layered.crossingMinimization.strategy`]=`LAYER_SWEEP`,a[`elk.layered.nodePlacement.strategy`]=`BRANDES_KOEPF`,a[`elk.layered.nodePlacement.bk.fixedAlignment`]=`BALANCED`,e?.aspectRatio!==void 0&&(a[`elk.layered.wrapping.strategy`]=`MULTI_EDGE`,a[`elk.aspectRatio`]=String(e.aspectRatio))),t===`stress`&&(a[`elk.stress.desiredEdgeLength`]=`240`),(t===`layered`||e?.edgeRouting===`orthogonal`)&&(a[`elk.edgeRouting`]=`ORTHOGONAL`),a}function ob(e){let t=new Map,n=(e,r)=>{t.set(e.id,r),e.children.forEach(t=>n(t,e.id))};e.roots.forEach(e=>n(e,null));let r=e=>{let n=[],r=e;for(;r!=null;)n.push(r),r=t.get(r);return n.reverse()},i=new Map;for(let t of e.layoutEdges){let e=r(t.from),n=r(t.to);if(e.length===0||n.length===0)continue;let a=0;for(;a<e.length&&a<n.length&&e[a]===n[a];)a++;let o=a===0?null:e[a-1],s=e[a],c=n[a];if(s===void 0||c===void 0||s===c)continue;let l=i.get(o)??[];l.push({id:t.id,sources:[s],targets:[c]}),i.set(o,l)}return i}var sb={top:36,left:16,bottom:16,right:16},cb={top:Qy.PAD,left:Qy.LANE_STRIP_W+Qy.PAD,bottom:Qy.PAD,right:Qy.PAD},lb={top:0,left:Qy.TITLE_STRIP_W,bottom:0,right:0};function ub(e){if(e.node.type===`activity-lane`)return cb;if(e.node.type===`activity-frame`)return lb;if(e.node.type===`sm-zone`)return db(e.node)===void 0?Gae:fb;let t=e.node.type===`sm-state`?Rae(e.node):0;return t>0?{...sb,top:sb.top+t}:sb}var db=e=>e.description!==void 0&&e.description.trim()!==``?e.description.trim():void 0,Gae={...sb,top:36},fb={...sb,top:53},Kae=24;function pb(e){if(e.node.type!==`sm-zone`)return 0;let t=db(e.node),n=Qr(e.node.name,12)*1.08;return Math.ceil(Math.max(n,t===void 0?0:Qr(t,11)))+Kae}var mb=e=>`[top=${e.top}.0,left=${e.left}.0,bottom=${e.bottom}.0,right=${e.right}.0]`,hb=mb({top:0,left:0,bottom:0,right:0});function qae(e,t){let n=e?.spacing??40;return t?n:Math.round(n*1.2)}function Jae(e){return Object.fromEntries(Object.entries(e).filter(([e])=>e.includes(`.spacing.`)))}var gb=6,_b=12,Yae=18,Xae=14;function vb(e){return e.labels!==void 0&&e.labels.length>0?e.labels.reduce((e,t)=>t.text.length>e.length?t.text:e,``):e.label??``}var Zae={"elk.edgeLabels.inline":`true`};function yb(e){let t=vb(e).trim();if(t===``)return;let n=it(e.kind)?ct(t,24):[t],r=Math.min(Math.max(...n.map(e=>[...e].length)),24);return{width:Math.round(r*gb+_b),height:Yae+(n.length-1)*Xae}}var bb={"elk.nodeLabels.placement":`OUTSIDE V_BOTTOM H_CENTER`},xb=`note-link`,Sb=new Set([ce,Ue]);function Cb(e){let t=e=>Sb.has(e.node.type)||e.children.some(t);return e.roots.some(t)}var wb=(e,t)=>!t&&[`DOWN`,`UP`].includes(e?.direction??`DOWN`),Qae=(e,t)=>({"elk.nodeSize.constraints":`MINIMUM_SIZE`,"elk.nodeSize.minimum":t?`(0.0, ${e}.0)`:`(${e}.0, 0.0)`}),Tb=(e,t)=>{let n=pb(t);return{...e.sharedContainerOptions,"elk.padding":mb(ub(t)),...n>0?Qae(n,e.swapsMinimum):{}}};function Eb(e,t){e.emitted.add(t.id);let n=e.substitute?.prelaid.get(t.id);if(n!==void 0)return{id:t.id,width:n.width,height:n.height};let r=e.substitute?.packs.get(t.id);if(r!==void 0)return{id:t.id,children:[...t.children.filter(e=>!r.members.has(e.id)).map(t=>Eb(e,t)),{id:r.id,width:r.width,height:r.height}],layoutOptions:Tb(e,t)};if(t.state===`expanded`){let n=e.byOwner?.get(t.id),r=n!==void 0&&n.length>0;return r&&(e.attachedToContainer=!0),{id:t.id,children:t.children.map(t=>Eb(e,t)),layoutOptions:Tb(e,t),...r?{edges:n}:{}}}if(t.state===`collapsed`){let n=e.sizes?.get(t.id)??Wae,r=e.loopRooms.get(t.id);return{id:t.id,width:n.width,height:n.height,...r===void 0?{}:{labels:[r]}}}return $ae(e,t)}function $ae(e,t){let n=e.sizes?.get(t.id)?.caption,r=[...n===void 0?[]:[{...n,text:`caption`,layoutOptions:bb}],...e.loopRooms.has(t.id)?[e.loopRooms.get(t.id)]:[]];return{id:t.id,...tb(e.sizes?.get(t.id)??nr),...r.length>0?{labels:r}:{},...e.fromStart&&Sb.has(t.node.type)?{layoutOptions:{"elk.layered.layering.layerConstraint":`FIRST`}}:{}}}function eoe(e,t){let n=t?.get(e.id);return n===void 0?e:{...e,layoutOptions:{...e.layoutOptions,"elk.partitioning.partition":String(n)}}}var toe=`__order__`,noe={"elk.layered.priority.direction":`100`};function roe(e,t,n){return e.layoutEdges.filter(e=>e.from!==e.to&&(t.substitute===void 0||t.emitted.has(e.from)&&t.emitted.has(e.to))).map(e=>{let r=vb(e).trim(),i=yb(e),a=t.fromStart&&e.kind===xb;return a&&n.add(e.id),{id:e.id,sources:[a?e.to:e.from],targets:[a?e.from:e.to],...i===void 0?{}:{labels:[{...i,text:r,layoutOptions:Zae}]},...e.kind===`__order__`?{layoutOptions:noe}:{}}})}function Db(e,t){let n=new Map(e.layoutEdges.map(e=>[e.id,e]));return t.some(e=>{let t=n.get(e.id);return t===void 0||e.sources[0]!==t.from||e.targets[0]!==t.to})}function Ob(e,t,n){return{...ab(e),...t===void 0?{}:{"elk.padding":hb},...n===void 0?{}:{"elk.partitioning.activate":`true`}}}var ioe=(e,t)=>(t?.algorithm??`layered`)===`layered`&&Cb(e);function kb(e,t,n,r){let i=r?.substitute,a=r?.partitions!==void 0&&r.partitions.size>0?r.partitions:void 0,o=Ob(n,i,a),s=ioe(e,n),c=s?{"elk.layered.cycleBreaking.strategy":`DEPTH_FIRST`}:{};Object.assign(o,c);let l=ib(n)&&r?.flat!==!0,u={sizes:t,substitute:i,byOwner:l?ob(e):void 0,sharedContainerOptions:l?o:{...Jae(o),...c},fromStart:s,emitted:new Set,attachedToContainer:!1,loopRooms:Uae(e.edges,n?.direction??`DOWN`,yb),swapsMinimum:wb(n,l)},d=(i?.roots??e.roots).map(e=>eoe(Eb(u,e),a)),f=new Set,p=l?u.byOwner?.get(null)??[]:roe(e,u,f),m=u.attachedToContainer||l&&Db(e,p);return{graph:{id:me,layoutOptions:o,children:d,edges:p},lifted:m,reversed:f}}function Ab(e,t){if(e.node.color!==void 0)return e.node.color;let n=t.nodeColors?.get(e.id);if(n!==void 0)return n;let r=t.typeColors;if(r!==void 0)return(e.node.type===void 0?void 0:r[e.node.type])??r[`*`]}function jb(e,t){return t.map(t=>e.node.metadata?.[t]).filter(e=>e!=null).map(String)}function Mb(e){let t=e.node.comments?.length??0,n=e.node.links?.length??0;return t>0||n>0?{comments:t,links:n}:void 0}function Nb(e,t){let n=hn(e.node.threats),r=Ab(e,t),i={label:e.node.name,state:e.state,promoted:e.promoted,sharedMembers:e.sharedMembers,hiddenCount:t.hiddenCounts.get(e.id)??0,metaBadges:jb(e,t.metaKeys),typeRegistry:t.typeRegistry,icons:t.icons,typeId:e.node.type,icon:e.node.icon,color:r,hue:t.hues===void 0?void 0:vie(e.node.type,r,t.hues),textColor:e.node.textColor,technology:e.node.technology,rich:e.node.rich,textAlign:e.node.textAlign,fontScale:e.node.fontScale,onToggleExpand:t.onToggleExpand,onEnterNode:e.state===`leaf`?void 0:t.onEnterNode,external:e.external!==void 0,image:e.node.image,shape:e.node.shape,link:e.node.link,columns:e.columns??e.node.columns,quickAdd:t.editing?t.quickAdd:void 0,onSetRole:t.editing?t.onSetRole:void 0,onAddThreat:t.editing?t.onAddThreat:void 0,stylePreset:t.stylePreset,notation:t.notation,threats:n.total>0?n:void 0,annotations:Mb(e),chips:t.nodeChips?.get(e.id),...e.node.type===`sm-state`?{behaviors:Lae(e.node),composite:e.state!==`leaf`}:{},...e.node.type===`sm-zone`&&db(e.node)!==void 0?{zoneNote:db(e.node)}:{}},a=t.regionSeparators?.get(e.id);return a!==void 0&&(i.regionSeparator=a),t.labelEditingId===e.id&&Pb(i,e,t),(e.node.image!==void 0||e.node.shape!==void 0)&&(i.assetBase=t.assetBase,i.libraryBase=t.libraryBase),e.node.link!==void 0&&(i.onOpenLink=t.onOpenLink),t.editing&&aoe(i,e,t),i}function Pb(e,t,n){e.labelEditing=!0,e.onLabelCommit=e=>{n.endLabelEdit?.();let r=e?.trim()??``;r!==``&&r!==t.node.name&&n.onRenameNode?.(t.id,r)},e.onRichCommit=e=>{n.endLabelEdit?.(),e!==null&&he(e).trim()!==``&&n.onSetNodeRich?.(t.id,e)}}function aoe(e,t,n){t.node.type===`db-table`&&n.onSetTableColumns!==void 0&&(e.onColumnsChange=e=>{let r=t.node.columns??[];n.onSetTableColumns?.(t.id,Sn(r,t.columns??r,e))}),n.onResize!==void 0&&(t.node.image!==void 0&&(e.onResize=n.onResize),n.resizable?.(t.node)===`x`&&(e.resizeAxis=`x`,e.onResize=n.onResize))}function ooe(e,t){let n=e.labels??[],r=Gn(e),i=r===void 0?void 0:t?.[r.id];return i===void 0?n:n.map(e=>{let t=i[e.id];return t===void 0?e:{...e,t:t.t,side:t.side}})}function soe(e){return e.constituents.reduce((e,t)=>{let n=hn(t.threats);return{open:e.open+n.open,total:e.total+n.total}},{open:0,total:0})}function coe(e){let t=e.constituents.reduce((e,t)=>e+(t.comments?.length??0),0);return t>0?{comments:t,links:0}:void 0}function loe(e,t){let n=soe(e),r={kind:e.kind,constituentCount:e.constituents.length,kindRegistry:t.kindRegistry,label:e.label,labels:e.labels===void 0?void 0:ooe(e,t.labelMoves),tint:e.tint,relStyle:e.style,stylePreset:t.stylePreset,edgeLook:t.edgeLook,notation:t.notation,polarity:e.polarity,delay:e.delay,notationColor:t.edgeColors?.get(e.id),threats:n.total>0?n:void 0,annotations:coe(e)},i=Gn(e);i!==void 0&&(r.threatRelation=i.id),i?.fromColumn!==void 0&&(r.fromColumn=i.fromColumn),i?.toColumn!==void 0&&(r.toColumn=i.toColumn),i!==void 0&&(t.editing?uoe(r,e,i,t):Fb(r,i,t)),e.from===e.to&&(r.selfLoop={direction:t.flowDirection,index:t.selfLoopIndex.get(e.id)??0,labelWidth:yb(e)?.width??0});let a=t.parallelBow.get(e.id);return a!==void 0&&(r.parallelBow=a),t.routing!==void 0&&Ib(r,e,t,t.routing),r}function uoe(e,t,n,r){if(e.editableLabels=!0,e.onAddLabel=(e,t,i)=>r.onAddEdgeLabel?.(n.id,e,t,i),e.onEditLabel=(e,t)=>r.onEditEdgeLabel?.(n.id,e,t),e.onMoveLabel=(e,t,i)=>r.onMoveEdgeLabel?.(n.id,e,t,i),r.onAddThreat!==void 0){let t=r.onAddThreat;e.onAddThreat=()=>t({relation:n.id})}Bn(n,t.from,t.to)&&r.onSetEdgeSide!==void 0&&(e.onSetSide=(e,t)=>r.onSetEdgeSide?.(n.id,e,t),n.id===r.fixedSideRelation&&(e.fixedSideDotsShown=!0)),r.pendingAdd?.edgeId===t.id&&(e.pendingAdd={x:r.pendingAdd.x,y:r.pendingAdd.y},e.onPendingAddConsumed=r.onPendingAddConsumed)}function Fb(e,t,n){n.onViewMoveEdgeLabel!==void 0&&(e.movableLabels=!0,e.onMoveLabel=(e,r,i)=>n.onViewMoveEdgeLabel?.(t.id,e,r,i))}function Ib(e,t,n,r){let i=n.routes.get(t.id),a=n.laidAt.get(t.from),o=n.laidAt.get(t.to);if(i===void 0||i.length<2||a===void 0||o===void 0)return;e.route=i,e.routeCorner=n.edgeLook?.corner??r.corner,e.routeFrom=a,e.routeTo=o;let s=n.labelSpots.get(t.id);s!==void 0&&(e.labelSpot=s)}var Lb=new WeakMap,Rb=new WeakMap,doe=`metaKeys.hiddenCounts.typeRegistry.icons.typeColors.onOpenLink.onToggleExpand.onEnterNode.editing.labelEditingId.endLabelEdit.onRenameNode.onSetNodeRich.assetBase.libraryBase.onResize.onSetTableColumns.quickAdd.onSetRole.onAddThreat.stylePreset.notation.nodeColors.hues.nodeChips.resizable.regionSeparators`.split(`.`),foe=[`kindRegistry`,`editing`,`onAddEdgeLabel`,`onEditEdgeLabel`,`onMoveEdgeLabel`,`onSetEdgeSide`,`onAddThreat`,`fixedSideRelation`,`pendingAdd`,`onPendingAddConsumed`,`stylePreset`,`edgeLook`,`notation`,`routing`,`routes`,`laidAt`,`labelSpots`,`labelMoves`,`onViewMoveEdgeLabel`,`edgeColors`,`flowDirection`,`selfLoopIndex`,`parallelBow`],poe=e=>(t,n)=>e.every(e=>t[e]===n[e]),zb=poe(doe),moe=poe(foe);function Bb(e,t){let n=Lb.get(e);if(n!==void 0&&zb(n.ctx,t))return n.data;let r=Nb(e,t);return Lb.set(e,{ctx:t,data:r}),r}function hoe(e,t){let n=Rb.get(e);if(n!==void 0&&moe(n.ctx,t))return n.data;let r=loe(e,t);return Rb.set(e,{ctx:t,data:r}),r}var Vb=[`layers`,`kinds`,`marks`],Hb=new Set([`bar`,`start-dot`,`end-bullseye`]);function Ub(e,t){let n=new Map(t.map((e,t)=>[e,t]));return[...e].sort((e,t)=>{let r=n.get(e),i=n.get(t);return r!==void 0&&i!==void 0?r-i:r===void 0?i===void 0?e.localeCompare(t):1:-1})}function Wb(e){let t=e.model,n=ut(t,e.plane?.id),r=e.plane?.id??t.planes[0]?.id,i=e=>Ee(e,r);if(e.root!==void 0&&n.childrenOf.has(e.root)){let{model:r}=Kn(t,n,e.root);return{nodes:r.nodes,relations:r.relations.filter(i)}}let a=new Set(n.childrenOf.keys());return{nodes:t.nodes.filter(e=>a.has(e.id)),relations:t.relations.filter(e=>i(e)&&a.has(e.from)&&a.has(e.to))}}function Gb(e){let{nodes:t,relations:n}=Wb(e),r=new Set;for(let e of t){e.layer!==void 0&&r.add(e.layer);for(let t of e.columns??[])t.layer!==void 0&&r.add(t.layer)}for(let t of n){let n=Pn(e.model,t);n!==void 0&&r.add(n)}return r}function Kb(e){let t=Gb(e),n=new Set(e.activeLayers??e.plane?.layers??[]),r=[];for(let i of e.model.layers){if(!t.has(i.id))continue;let a=n.has(i.id);!a&&!e.canToggleLayers||r.push({id:`layers:${i.id}`,section:`layers`,label:i.name,swatch:{draw:`chip`,color:i.tint??`var(--dg-edge)`},layer:i.id,active:a})}return r}function goe(e){let t=new Map,n=[];for(let r of e.compiled.edges)t.has(r.kind)?t.get(r.kind)!==r.tint&&t.set(r.kind,void 0):(n.push(r.kind),t.set(r.kind,r.tint));return Ub(n,Object.keys(Er)).map(n=>{let r=t.get(n),i=e.kindRegistry.resolve(n);return{id:`kinds:${n}`,section:`kinds`,label:i.legendLabel??n,swatch:{draw:`line`,style:i,color:r},vocabulary:i.legendLabel!==void 0||void 0}})}function qb(e){let t=new Map,n={nodeColors:e.nodeColors,typeColors:e.model.typeColors},r=e=>{for(let i of e){let e=i.node.type;if(e!==void 0){let r=Ab(i,n);t.has(e)?t.get(e)!==r&&t.set(e,void 0):t.set(e,r)}r(i.children)}};return r(e.compiled.roots),Ub([...t.keys()],Object.keys(Tr)).map(n=>{let r=e.typeRegistry.resolve(n),i=Hb.has(r.shape)?void 0:e.hues===void 0?t.get(n):vie(n,t.get(n),e.hues),a=r.label;return{id:`types:${n}`,section:`types`,label:r.legendLabel??(a===void 0||a===``?n:a),swatch:{draw:`shape`,style:r,color:i,icon:r.icon},vocabulary:r.legendLabel!==void 0||void 0}})}function _oe(e){let t=new Set,n=e=>{e.total!==0&&t.add(e.open>0?`threat-open`:`threat-handled`)},r=e=>{for(let i of e){n(hn(i.node.threats));for(let e of i.columns??i.node.columns??[])e.pk===!0?t.add(`pk`):e.fk===!0&&t.add(`fk`);r(i.children)}};r(e.compiled.roots);for(let t of e.compiled.edges)n(t.constituents.reduce((e,t)=>{let n=hn(t.threats);return{open:e.open+n.open,total:e.total+n.total}},{open:0,total:0}));let i={"threat-open":`Open threats`,"threat-handled":`All threats handled`,pk:`Primary key`,fk:`Foreign key column`};return Object.keys(i).filter(e=>t.has(e)).map(e=>({id:`marks:${e}`,section:`marks`,label:i[e],swatch:{draw:`mark`,mark:e},vocabulary:!0}))}function voe(e){let t=new Set,n=e=>{for(let r of e){let{type:e,stateKind:i,color:a}=r.node;e===`sm-state`&&i!==void 0&&a===void 0&&t.add(i),n(r.children)}};n(e.compiled.roots);let r=e.typeRegistry.resolve(Be);return E.filter(e=>t.has(e)).map(e=>({id:`marks:state-${e}`,section:`marks`,label:ki[e],swatch:{draw:`shape`,style:r,color:Oi[e]},vocabulary:!0}))}function yoe(e,t){if(e.kind!==void 0)return{draw:`line`,style:t.kindRegistry.resolve(e.kind),color:e.color};if(e.type!==void 0){let n=t.typeRegistry.resolve(e.type),r=e.icon??n.icon;return{draw:`shape`,style:n,color:e.color,icon:r}}if(e.color!==void 0)return{draw:`chip`,color:e.color}}function boe(e){return e.drawings===void 0?[]:[{id:`layers:$drawings`,section:`layers`,label:`Drawings`,swatch:{draw:`line`,style:{width:2.5},color:`var(--dg-ink)`},drawings:!0,active:e.drawings.active}]}function xoe(e){let t=e.config.show??Vb,n=t.includes(`types`)?qb(e):e.config.show===void 0?qb(e).filter(e=>e.vocabulary===!0):[],r=[...t.includes(`layers`)?[...Kb(e),...boe(e)]:[],...t.includes(`kinds`)?goe(e):[],...n,...t.includes(`marks`)?[...voe(e),..._oe(e)]:[]],i=[];return(e.config.items??[]).forEach((t,n)=>{let a=t.kind===void 0?t.type===void 0?void 0:`types:${t.type}`:`kinds:${t.kind}`,o=a===void 0?void 0:r.find(e=>e.id===a);if(o!==void 0){o.label=t.label,t.color!==void 0&&(o.swatch?.draw===`line`||o.swatch?.draw===`shape`)&&(o.swatch={...o.swatch,color:t.color}),t.icon!==void 0&&o.swatch!==void 0&&o.swatch.draw===`shape`&&(o.swatch={...o.swatch,icon:t.icon});return}let s=yoe(t,e);i.push({id:`items:${n}`,section:`items`,label:t.label,swatch:s})}),[...r,...i]}var Soe={};function Jb(e){let[t,n]=(0,_.useState)(e.model.legend!==void 0),[r,i]=(0,_.useState)(null),a=e.model.legend;(0,_.useEffect)(()=>{n(a!==void 0)},[e.model.id,a]);let o=(0,_.useMemo)(()=>Ce(e.model.planes,e.plane),[e.model.planes,e.plane]),s=(0,_.useMemo)(()=>{let t=xoe({model:e.model,compiled:e.compiled,plane:o,root:e.drillRoot,activeLayers:e.activeLayers,nodeColors:e.nodeColors,hues:e.hues,typeRegistry:e.typeRegistry,kindRegistry:e.kindRegistry,config:a??Soe,canToggleLayers:e.canToggleLayers,drawings:e.strokes.length>0?{active:e.drawingsVisible}:void 0});return a!==void 0||t.some(e=>e.vocabulary===!0)?t:[]},[a,e.model,e.compiled,o,e.drillRoot,e.activeLayers,e.typeRegistry,e.kindRegistry,e.canToggleLayers,e.strokes,e.drawingsVisible,e.nodeColors,e.hues]),c=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let e=a?.position??`bottom-right`;c.current=!t||r===null||s.length===0?null:{side:e.startsWith(`top`)?`top`:`bottom`,px:r.height+16}},[t,r,s,a]),{legendConfig:a,showLegend:t,setShowLegend:n,setLegendSize:i,legendRowList:s,legendReserveRef:c}}function Yb(e){let t;for(let n of e){if(n===void 0)return;if(t===void 0)t=n;else if(t!==n)return}return t}function Coe(e){let t=new Map;for(let n of e){let e=`${n.from}\0${n.to}`,r=t.get(e);if(r===void 0){t.set(e,{from:n.from,to:n.to,polarity:n.polarity,edgeIds:[n.id]});continue}r.edgeIds.push(n.id),r.polarity=Yb([r.polarity,n.polarity])}return t}function Xb(e){let t=0;for(let n of e){if(n.polarity===void 0)return`unknown`;n.polarity===`-`&&t++}return t%2==0?`R`:`B`}function woe(e,t){return{key:e.join(`→`),nodes:[...e],edgeIds:t.flatMap(e=>e.edgeIds),kind:Xb(t)}}var Zb=(e,t)=>e<t?-1:+(e>t);function Qb(e,t){let n=t?.maxLength??20,r=t?.maxLoops??50,i=t?.budget??2e5,a=[...Coe(e).values()],o=new Set;for(let e of a)o.add(e.from),o.add(e.to);let s=[...o].sort(Zb),c=new Map(s.map((e,t)=>[e,t])),l=s.length,u=Array.from({length:l},()=>[]),d=[];for(let e of a){if(e.from===e.to){d.push(e);continue}let t=c.get(e.from),n=c.get(e.to);t===void 0||n===void 0||u[t]?.push({to:n,arc:e})}for(let e of u)e.sort((e,t)=>e.to-t.to);d.sort((e,t)=>Zb(e.from,t.from));let f=[],p=0,m=!1;for(let e of d)f.push(woe([e.from],[e]));let h=[],g=[],_=new Set;function v(e,t){if(m)return;let r=u[t];if(r!==void 0)for(let{to:t,arc:a}of r){if(p>=i){m=!0;return}if(p++,t===e){h.length>=2&&f.push(woe(h,[...g,a]));continue}if(t>e&&!_.has(t)&&h.length<n){let n=s[t];if(n===void 0)continue;if(_.add(t),h.push(n),g.push(a),v(e,t),g.pop(),h.pop(),_.delete(t),m)return}}}for(let e=0;e<l&&!m;e++){let t=s[e];t!==void 0&&(h.length=0,g.length=0,_.clear(),h.push(t),_.add(e),v(e,e))}return f.sort((e,t)=>e.nodes.length-t.nodes.length||Zb(e.key,t.key)),{loops:f.slice(0,r),truncated:m||f.length>r}}var Toe=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),Eoe=6;function Doe(e,t,n){let r=[{x:e,y:t}],i=Math.max(24,n);for(let n=1;n<=Eoe;n++){let a=n*i,o=Math.max(4,Math.floor(2*Math.PI*a/i));for(let n=0;n<o;n++){let i=-Math.PI/2+2*Math.PI*n/o;r.push({x:e+Math.cos(i)*a,y:t+Math.sin(i)*a})}}return r}function $b(e,t,n){let r=Math.max(n.x,Math.min(e.x,n.x+n.width)),i=Math.max(n.y,Math.min(e.y,n.y+n.height)),a=e.x-r,o=e.y-i;return a*a+o*o<t*t}var ex=1e-6;function Ooe(e){if(e.length<3)return`none`;let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=e[(n+1)%e.length];r===void 0||i===void 0||(t+=r.x*i.y-i.x*r.y)}return t/=2,Math.abs(t)<ex?`none`:t>0?`cw`:`ccw`}function koe(e,t,n){let r=n?.labelRadius??15,i=n?.minLabelGap??36,a=n?.nodeMargin??8,o=n?.obstacles??[...t.values()],s=r+a,c=i*i,l=[...e.filter(e=>e.nodes.every(e=>t.has(e)))].sort((e,t)=>e.nodes.length-t.nodes.length||Zb(e.key,t.key)),u=[],d=[];for(let e of l){let n=e.nodes.map(e=>t.get(e)).filter(e=>e!==void 0).map(Toe);if(n.length===0)continue;let r=n.reduce((e,t)=>e+t.x,0)/n.length,a=n.reduce((e,t)=>e+t.y,0)/n.length,l=Ooe(n),f={x:r,y:a};for(let e of Doe(r,a,i))if(!o.some(t=>$b(e,s,t))&&!d.some(t=>{let n=t.x-e.x,r=t.y-e.y;return n*n+r*r<c})){f=e;break}d.push(f),u.push({key:e.key,kind:e.kind,x:f.x,y:f.y,direction:l})}return u}function tx(e){let t=new Map(e.map(e=>[e.id,e])),n=new Set;function r(e){let i=t.get(e);if(i===void 0)return{x:0,y:0};if(i.parentId===void 0||n.has(e))return i.position;n.add(e);let a=r(i.parentId);return n.delete(e),{x:i.position.x+a.x,y:i.position.y+a.y}}let i=new Map;for(let t of e){let e=t.measured?.width,n=t.measured?.height;if(e===void 0||n===void 0)continue;let a=r(t.id);i.set(t.id,{x:a.x,y:a.y,width:e,height:n})}return i}function nx(e){let t=e.profile.canvasOverlay===`loop-labels`,n=(0,_.useMemo)(()=>t?e.compiled.edges.map(e=>{let t=Yb(e.constituents.map(e=>e.polarity));return{id:e.id,from:e.from,to:e.to,polarity:t}}):null,[e.compiled,t]),{onCldEdges:r}=e;(0,_.useEffect)(()=>{r?.(n??[])},[n,r]);let[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!0),[u,d]=(0,_.useState)(null),f=e.externalHighlight,{profile:p,model:m,plane:h}=e,g=(0,_.useMemo)(()=>{if(!c||o===null)return null;let t=new Set([o]),n=new Set;for(let r of e.compiled.edges)r.from===o?(t.add(r.to),n.add(r.id)):r.to===o&&(t.add(r.from),n.add(r.id));for(let e of p.related?.(m,h,o)??[])t.add(e);return{nodes:t,edges:n}},[c,o,e.compiled.edges,p,m,h]),v=(0,_.useMemo)(()=>{let e=f==null?u===null?null:{nodes:u.nodes,edges:u.edges}:{nodes:new Set(f.nodes),edges:new Set(f.edges)},t=e??g;return{nodes:t?.nodes??k,edges:t?.edges??k,active:t!==null,variant:e===null?`focus`:`loop`,activeKey:u?.key??null,focusId:o,toggle:(e,t,n)=>d(r=>r?.key===e?null:{key:e,nodes:new Set(t),edges:new Set(n)}),clear:()=>d(null)}},[u,f,g,o]);return(0,_.useEffect)(()=>{d(null),s(null)},[e.compiled]),{cld:t,loopEdges:n,showLoops:i,setShowLoops:a,selectedNode:o,setSelectedNode:s,focusConnected:c,setFocusConnected:l,loopHighlight:v}}var Aoe=8,rx=14,ix=`stroke='black' stroke-width='1.4' fill='none' stroke-linecap='round'`,joe={plus:`<rect x='1.5' y='6.25' width='5' height='1.5'/><rect x='3.25' y='4.5' width='1.5' height='5'/>`,dash:`<rect x='1.5' y='6.25' width='5' height='1.5'/>`,equals:`<rect x='1.5' y='4.8' width='5' height='1.3'/><rect x='1.5' y='7.9' width='5' height='1.3'/>`,pipe:`<rect x='3.25' y='1' width='1.5' height='12'/>`,colon:`<circle cx='4' cy='4.5' r='1'/><circle cx='4' cy='9.5' r='1'/>`,dot:`<circle cx='4' cy='7' r='1'/>`,baseDot:`<circle cx='4' cy='10' r='1.05'/>`,tick:`<rect x='3.35' y='2.5' width='1.3' height='4'/>`,slash:`<path d='M1.8 12 L6.2 2' ${ix}/>`,backslash:`<path d='M1.8 2 L6.2 12' ${ix}/>`,openParen:`<path d='M5.6 1.5 Q1.6 7 5.6 12.5' ${ix}/>`,closeParen:`<path d='M2.4 1.5 Q6.4 7 2.4 12.5' ${ix}/>`},Moe=[[0,0],[1,0],[2,0],[2,1],[2,2],[1,2],[0,2],[0,1]];function ax(e){let t=e.map((e,t)=>{let[n,r]=Moe[t];return`<g transform='translate(${n*Aoe} ${r*rx})'>${joe[e]}</g>`});return`url("data:image/svg+xml,${`<svg xmlns='http://www.w3.org/2000/svg' width='${3*Aoe}' height='${3*rx}'>${t.join(``)}</svg>`.replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/#/g,`%23`)}")`}function Noe(){return{"--dg-ascii-box":ax([`plus`,`dash`,`plus`,`pipe`,`plus`,`dash`,`plus`,`pipe`]),"--dg-ascii-table":ax([`plus`,`equals`,`plus`,`pipe`,`plus`,`equals`,`plus`,`pipe`]),"--dg-ascii-hex":ax([`slash`,`dash`,`backslash`,`pipe`,`slash`,`dash`,`backslash`,`pipe`]),"--dg-ascii-pill":ax([`baseDot`,`dash`,`baseDot`,`closeParen`,`tick`,`dash`,`tick`,`openParen`]),"--dg-ascii-group":ax([`dot`,`dot`,`dot`,`colon`,`dot`,`dot`,`dot`,`colon`])}}var ox={id:`clean`,label:`Clean`},sx={id:`sketch`,label:`Sketch`,rough:{roughness:1.15,bowing:1,strokeWidth:1.5,fillStyle:`solid`},fontFamily:`'Kalam', system-ui, sans-serif`,colorMix:{fill:14,stroke:100}},cx={id:`hand-drawn`,label:`Hand-drawn`,rough:{roughness:.9,bowing:.8,strokeWidth:1.2,fillStyle:`hachure`,fillWeight:.8,hachureGap:5,hatchOpacity:.45},cornerRadius:14,fontFamily:`'Caveat', 'Kalam', cursive`,colorMix:{fill:22,stroke:85}},lx={id:`blueprint`,label:`Blueprint`,fontFamily:`ui-monospace, 'Cascadia Mono', 'Source Code Pro', monospace`,cssVars:{"--dg-canvas-bg":`#0d2740`,"--dg-surface":`#0d2740`,"--dg-node-fill":`#103052`,"--dg-node-stroke":`#9ec8e8`,"--dg-group-fill":`#0f2c4a`,"--dg-group-stroke":`#5f8ab0`,"--dg-text":`#e4f1fb`,"--dg-text-muted":`#8fb3cf`,"--dg-border":`#2a4a6b`,"--dg-edge":`#9ec8e8`,"--dg-edge-label-bg":`#103052`}},ux={id:`pencil`,label:`Pencil`,rough:{roughness:.3,bowing:.1,strokeWidth:1.4,fillStyle:`hachure`,fillWeight:.55,hachureGap:5,hatchOpacity:.5},cornerRadius:16,fontFamily:`'Caveat', 'Kalam', cursive`,colorMix:{fill:22,stroke:85}},dx={id:`marker`,label:`Marker`,rough:{roughness:1.6,bowing:1.2,strokeWidth:2.5,fillStyle:`zigzag`,fillWeight:1.8,hachureGap:7,hatchOpacity:.25},cornerRadius:8,fontFamily:`'Kalam', system-ui, sans-serif`,colorMix:{fill:28,stroke:100}},fx=`'diagc Inter', 'Inter', system-ui, sans-serif`,px=`'diagc JetBrains Mono', 'JetBrains Mono', ui-monospace, monospace`,mx=[`#3b82f6`,`#f59e0b`,`#10b981`,`#8b5cf6`,`#f43f5e`,`#06b6d4`,`#84cc16`,`#d946ef`],hx=e=>`color-mix(in srgb, var(--dg-text) ${e}%, var(--dg-bg))`,Poe={id:`soft`,label:`Soft`,fontFamily:fx,cssVars:{"--dg-edge":hx(38)}},gx=C(x),_x=[ox,sx,cx,ux,lx,dx,Poe,{id:`pastel`,label:`Pastel`,fontFamily:fx,palette:mx,cssVars:{"--dg-edge":hx(38)}},{id:`cards`,label:`Cards`,fontFamily:fx,palette:mx,cssVars:{"--dg-edge":hx(40)}},{id:`layered`,label:`Layered`,fontFamily:fx,grid:`none`,cssVars:{"--dg-canvas-bg":`color-mix(in srgb, #3b82f6 3%, var(--dg-bg))`,"--dg-edge":`color-mix(in srgb, #64748b 75%, var(--dg-text))`}},{id:`neon`,label:`Neon`,fontFamily:`'diagc Chakra Petch', 'Chakra Petch', system-ui, sans-serif`,palette:[`#00e5ff`,`#ff2bd6`,`#f2ff3d`,`#5cff7a`,`#ff9d2b`,`#b18cff`,`#ff4d6d`],grid:`lines`,cssVars:{...gx,"--dg-canvas-bg":`#07080f`,"--dg-bg":`#07080f`,"--dg-surface":`#0b0d17`,"--dg-node-fill":`#0b0d17`,"--dg-node-stroke":`#00e5ff`,"--dg-group-fill":`rgba(255, 43, 214, 0.035)`,"--dg-group-stroke":`#ff2bd6`,"--dg-text":`#e8f9ff`,"--dg-text-muted":`#86a4bb`,"--dg-border":`#1f2a3d`,"--dg-edge":`#22d3ee`,"--dg-edge-label-bg":`#07080f`,"--dg-accent":`#00e5ff`,"--dg-badge-bg":`#ff2bd6`,"--dg-badge-text":`#07080f`,"--dg-ink":`#e8f9ff`,"--dg-table-header-bg":`#111a2e`,"--dg-table-header-text":`#e8f9ff`,"--dg-table-border":`#22d3ee`,"--dg-table-row-text":`#c6e6f2`,"--dg-table-type-text":`#86a4bb`,"--dg-table-pk":`#f2ff3d`,"--dg-table-fk":`#ff79e6`}},{id:`terminal`,label:`Terminal`,fontFamily:px,palette:[`#39ff88`,`#5ef2ff`,`#ffb000`,`#ff79c6`,`#bd93f9`,`#ff5555`,`#f1fa8c`],grid:`none`,cssVars:{...gx,"--dg-canvas-bg":`#050805`,"--dg-bg":`#050805`,"--dg-surface":`#0a110b`,"--dg-node-fill":`#0a110b`,"--dg-node-stroke":`#39ff88`,"--dg-group-fill":`rgba(255, 176, 0, 0.03)`,"--dg-group-stroke":`#ffb000`,"--dg-text":`#d4ffe2`,"--dg-text-muted":`#6fbf8a`,"--dg-border":`#1d3a24`,"--dg-edge":`#2fd16f`,"--dg-edge-label-bg":`#050805`,"--dg-accent":`#39ff88`,"--dg-badge-bg":`#39ff88`,"--dg-badge-text":`#050805`,"--dg-ink":`#d4ffe2`,"--dg-table-header-bg":`#0f2414`,"--dg-table-header-text":`#d4ffe2`,"--dg-table-border":`#2fd16f`,"--dg-table-row-text":`#b9f5cb`,"--dg-table-type-text":`#6fbf8a`,"--dg-table-pk":`#ffb000`,"--dg-table-fk":`#5ef2ff`}},{id:`ascii`,label:`ASCII`,fontFamily:px,palette:mx,grid:`none`,edges:{corner:0,dash:{solid:`5 3`,dashed:`5 11`},openArrow:!0},cssVars:{"--dg-canvas-bg":`var(--dg-bg)`,"--dg-edge":hx(62),...Noe()}},{id:`dos`,label:`DOS`,fontFamily:px,palette:[`#aaaaaa`,`#00aaaa`,`#00aa00`,`#55ffff`,`#ffff55`,`#55ff55`,`#ff55ff`,`#ff5555`],grid:`none`,edges:{corner:0},cssVars:{...gx,"--dg-canvas-bg":`#0000aa`,"--dg-bg":`#0000aa`,"--dg-surface":`#0000aa`,"--dg-node-fill":`#aaaaaa`,"--dg-node-stroke":`#ffffff`,"--dg-group-fill":`transparent`,"--dg-group-stroke":`#ffffff`,"--dg-text":`#ffffff`,"--dg-text-muted":`#55ffff`,"--dg-border":`#5555ff`,"--dg-edge":`#ffffff`,"--dg-edge-label-bg":`#0000aa`,"--dg-accent":`#ffff55`,"--dg-badge-bg":`#ffff55`,"--dg-badge-text":`#000000`,"--dg-ink":`#ffffff`,"--dg-table-header-bg":`#00aaaa`,"--dg-table-header-text":`#000000`,"--dg-table-border":`#ffffff`,"--dg-table-row-text":`#000000`,"--dg-table-type-text":`#0000aa`,"--dg-table-pk":`#000000`,"--dg-table-fk":`#0000aa`}}],vx=e=>_x.find(t=>t.id===e)??ox,yx=e=>_x.some(t=>t.id===e);function bx(e){return[`dg-canvas`,e.chromeless&&`dg-no-chrome`,e.editing&&`dg-mode-edit`,!e.editing&&e.altHeld&&`dg-alt-move`,e.dragging&&`dg-dragging`,e.preset.id!==`clean`&&`dg-style-${e.preset.id}`,e.preset.rough!==void 0&&`dg-style-rough`,e.preset.fontFamily!==void 0&&`dg-style-font`,e.notationClass,e.penActive&&`dg-tool-pen`,e.eraserActive&&`dg-tool-eraser`,e.laserOn&&`dg-tool-laser`].filter(e=>typeof e==`string`).join(` `)}function xx(e){return{width:`100%`,height:`100%`,"--dg-style-font":e.fontFamily,...e.cssVars??{}}}function Sx(e,t){return t===void 0?e.grid===`none`?null:e.grid===`lines`?{variant:Ah.Lines,gap:32}:{}:{gap:t,className:`dg-grid-on`}}var Cx=([,e])=>()=>e(e=>!e);function wx(e){let{dim:t,laser:n,drawings:r,legend:i,loops:a}=e;return[{key:`dim`,on:t[0],offered:!0,flip:Cx(t),className:`dg-focus-toggle${t[0]?``:` dg-focus-toggle-off`}`,title:t[0]?`Stop dimming unconnected on select`:`Dim unconnected on select`,label:t[0]?`Stop dimming unconnected on select`:`Dim unconnected on select`,glyph:`◎`},{key:`laser`,on:n[0],offered:!0,flip:Cx(n),className:`dg-laser-toggle${n[0]?` dg-laser-toggle-on`:``}`,title:n[0]?`Laser pointer off`:`Laser pointer`,label:`Laser pointer`,glyph:`◉`},{key:`drawings`,on:r[0],offered:e.drawingsOffered,flip:Cx(r),className:`dg-drawings-toggle${r[0]?``:` dg-drawings-toggle-off`}`,title:r[0]?`Hide drawings`:`Show drawings`,label:r[0]?`Hide drawings`:`Show drawings`,glyph:`✎`},{key:`legend`,on:i[0],offered:e.legendOffered,flip:Cx(i),className:`dg-legend-toggle-btn${i[0]?``:` dg-legend-toggle-btn-off`}`,title:i[0]?`Hide legend`:`Show legend`,label:i[0]?`Hide legend`:`Show legend`,glyph:`▤`},{key:`loops`,on:a[0],offered:e.loopsOffered,flip:()=>{a[0]&&e.clearLoopHighlight(),a[1](e=>!e)},className:`dg-loop-toggle${a[0]?``:` dg-loop-toggle-off`}`,title:a[0]?`Hide loop badges`:`Show loop badges`,label:a[0]?`Hide loop badges`:`Show loop badges`,glyph:`↻`}]}var Tx=(e,t)=>e.find(e=>e.key===t);function Foe(e){let t=t=>{let n=e.keyHints?.[t]??(t===`laser`&&e.builtinKeys!==!1?`L`:void 0);return n!==void 0&&n!==``?` (${n})`:``};return(0,D.jsxs)(sne,{children:[e.toggles.filter(e=>e.offered).map(e=>(0,D.jsx)(jh,{className:e.className,title:`${e.title}${t(e.key)}`,"aria-label":e.label,"aria-pressed":e.on,onClick:e.flip,children:e.glyph},e.key)),e.onToggleTheme!==void 0&&(0,D.jsx)(jh,{className:`dg-theme-toggle`,title:e.colorMode===`dark`?`Light theme`:`Dark theme`,"aria-label":e.colorMode===`dark`?`Switch to light theme`:`Switch to dark theme`,onClick:e.onToggleTheme,children:e.colorMode===`dark`?`☀`:`☾`})]})}var Ex=48,Dx=Ex/2,Ox=15,Ioe=`M ${Dx} ${Dx-Ox} A ${Ox} ${Ox} 0 1 1 ${Dx-Ox} ${Dx}`;function Loe({placement:e,rough:t,active:n,dimmed:r,onSelect:i}){let a=(0,_.useMemo)(()=>t===void 0?null:cv({x:Dx,y:Dx},Ox*2,{style:t,seed:rv(e.key)}),[e.key,t]),o=e.kind===`unknown`?`?`:e.kind,s=e.kind!==`unknown`&&e.direction!==`none`,c=`dg-loop-arrow-${e.key.replace(/[^a-zA-Z0-9_-]/g,`_`)}`;return(0,D.jsx)(`div`,{className:`dg-loop-badge${n?` active`:``}${r?` dimmed`:``}`,"data-kind":e.kind,role:`button`,"aria-pressed":n,title:`Highlight this loop`,onClick:e=>{e.stopPropagation(),i?.()},style:{position:`absolute`,transform:`translate(${e.x-Dx}px, ${e.y-Dx}px)`,pointerEvents:`auto`},children:(0,D.jsxs)(`svg`,{width:Ex,height:Ex,viewBox:`0 0 ${Ex} ${Ex}`,"aria-hidden":`true`,children:[s&&(0,D.jsx)(`defs`,{children:(0,D.jsx)(`marker`,{id:c,viewBox:`0 0 10 10`,refX:`5`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,D.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--dg-text-muted)`})})}),a===null?(0,D.jsx)(`circle`,{className:`dg-loop-badge-circle`,cx:Dx,cy:Dx,r:Ox}):(0,D.jsxs)(D.Fragment,{children:[a.fill===``?(0,D.jsx)(`circle`,{className:`dg-loop-badge-fill`,cx:Dx,cy:Dx,r:Ox}):(0,D.jsx)(`path`,{className:`dg-loop-badge-fill`,d:a.fill}),(0,D.jsx)(`path`,{className:`dg-loop-badge-circle`,d:a.stroke})]}),s&&(0,D.jsx)(`path`,{className:`dg-loop-badge-arc`,d:Ioe,markerEnd:`url(#${c})`,style:e.direction===`ccw`?{transform:`scale(-1,1)`,transformOrigin:`${Dx}px ${Dx}px`}:void 0}),(0,D.jsx)(`text`,{x:Dx,y:Dx,textAnchor:`middle`,dominantBaseline:`central`,children:o})]})})}function Roe({edges:e,rough:t,nodeFilter:n}){let{loops:r}=(0,_.useMemo)(()=>Qb(e),[e]),i=(0,_.useMemo)(()=>n==null?r:r.filter(e=>e.nodes.includes(n)),[r,n]),a=(0,_.useMemo)(()=>new Map(i.map(e=>[e.key,e])),[i]),o=(0,_.useContext)(Xh),s=Oh(),c=(0,_.useMemo)(()=>tx(s),[s]),l=(0,_.useMemo)(()=>s.filter(e=>e.data.state!==`expanded`).map(e=>c.get(e.id)).filter(e=>e!==void 0),[s,c]);return(0,D.jsx)(Dh,{children:(0,D.jsx)(`div`,{className:`dg-loop-layer`,children:(0,_.useMemo)(()=>koe(i,c,{obstacles:l,labelRadius:Dx,minLabelGap:56}),[i,c,l]).map(e=>{let n=a.get(e.key);return(0,D.jsx)(Loe,{placement:e,rough:t,active:o.activeKey===e.key,dimmed:o.active&&o.activeKey!==e.key,onSelect:n===void 0?void 0:()=>o.toggle(e.key,n.nodes,n.edgeIds)},e.key)})})})}var zoe=4;function Boe({model:e,plane:t}){let n=Oh(),r=(0,_.useMemo)(()=>tx(n),[n]);return(0,D.jsx)(Dh,{children:(0,D.jsx)(`svg`,{className:`dg-git-lanes`,"aria-hidden":`true`,children:(0,_.useMemo)(()=>{let n=oi(e,t),i=ci(e,t),{MARGIN:a,LABEL_W:o}=ri,s=[];for(let t of n.lanes){let c=Ct(n,t.id),l=r.get(t.id);if(c===void 0||l===void 0||xt(e,c.id))continue;let u=r.get(c.id);if(u===void 0)continue;let d=u.x+u.width+zoe,f=l.x+l.width-a-o;f<=d||s.push({id:t.id,x1:d,x2:f,y:u.y+u.height/2,color:i.get(t.id)})}return s},[e,t,r]).map(e=>(0,D.jsx)(`line`,{className:`dg-git-tail`,x1:e.x1,y1:e.y,x2:e.x2,y2:e.y,stroke:e.color??`var(--dg-edge)`},e.id))})})}var Voe=8,Hoe=[`th`,`st`,`nd`,`rd`];function Uoe(e){let t=e%100;return`${e}${t>=11&&t<=13?`th`:Hoe[e%10]??`th`}`}var Woe=(e,t)=>e===0?t>1?`Decisions`:`Decision`:`${Uoe(e)} order`;function Goe(e,t,n){let r=n===`DOWN`||n===`UP`,i=new Map,a=1/0,o=-1/0;for(let[n,s]of t){let t=e.get(n);if(t===void 0)continue;let c=r?t.y:t.x,l=r?t.y+t.height:t.x+t.width,u=i.get(s);i.set(s,u===void 0?{lo:c,hi:l}:{lo:Math.min(u.lo,c),hi:Math.max(u.hi,l)}),a=Math.min(a,r?t.x:t.y),o=Math.max(o,r?t.x+t.width:t.y+t.height)}let s=a-20-(r?96:28),c=o+20-s;return[...i.entries()].sort(([e],[t])=>e-t).map(([e,{lo:t,hi:n}])=>{let i=t-20,a=n-t+40,o=r?{x:s,y:i,width:c,height:a}:{x:i,y:s,width:a,height:c};return{order:e,...o,header:{x:o.x+Voe,y:o.y+Voe}}})}function Koe({model:e,direction:t}){let n=Oh(),r=(0,_.useMemo)(()=>an(e).orders,[e]),i=(0,_.useMemo)(()=>e.nodes.filter(e=>e.type===`so-decision`&&r.get(e.id)===0).length,[e,r]),a=(0,_.useMemo)(()=>Goe(tx(n),r,t),[n,r,t]);return a.length===0?null:(0,D.jsx)(Dh,{children:(0,D.jsx)(`svg`,{className:`dg-order-bands`,"aria-hidden":`true`,children:a.map((e,t)=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`rect`,{className:`dg-order-band${t%2==1?` dg-order-band-alt`:``}`,x:e.x,y:e.y,width:e.width,height:e.height,rx:6}),(0,D.jsx)(`text`,{className:`dg-order-band-header`,x:e.header.x,y:e.header.y,dominantBaseline:`hanging`,children:Woe(e.order,i)})]},e.order))})})}var qoe=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Joe=3,kx=e=>((e+4)%7+7)%7,Ax=e=>Number(Gt(e).slice(0,4)),jx=e=>Number(Gt(e).slice(5,7))-1,Mx=e=>Date.parse(`${e}T00:00:00Z`)/864e5;function Yoe(e){let t=e+(3-(kx(e)+6)%7),n=Ax(t),r=Mx(`${String(n)}-01-04`),i=r-(kx(r)+6)%7;return Math.floor((t-i)/7)+1}var Nx=e=>{let t=Ax(e),n=jx(e);return Mx(n===11?`${String(t+1)}-01-01`:`${String(t)}-${String(n+2).padStart(2,`0`)}-01`)};function Px(e,t){let n=e.start-7,r=e.end+8,i=e=>fr(e,t),a=[];for(let e=n;e<r;e=Nx(e)){let t=Math.min(Nx(e),r);a.push({x:i(e),width:i(t)-i(e),label:`${qoe[jx(e)]} ${String(Ax(e))}`})}let o=[];for(let e=n;e<r;){let t=e+((8-kx(e))%7||7),n=Math.min(t,r),a=n-e;o.push({x:i(e),width:a*lr.DAY,label:a>=Joe?`W${String(Yoe(e)).padStart(2,`0`)}`:``}),e=n}return{x0:i(n),x1:i(r),months:a,weeks:o}}function Fx(e=new Date){let t=e=>String(e).padStart(2,`0`);return`${String(e.getFullYear())}-${t(e.getMonth()+1)}-${t(e.getDate())}`}var Ix=lr.HEADER_H/2;function Lx({model:e,plane:t,today:n}){let r=Oh(),i=(0,_.useMemo)(()=>tx(r),[r]),a=dr(e,t),o=(0,_.useMemo)(()=>a.range!==void 0&&a.origin!==void 0?Px(a.range,a.origin):void 0,[a]);if(o===void 0||a.origin===void 0||a.range===void 0)return null;let{DAY:s,HEADER_H:c,PAD:l}=lr,u=a.origin,d=0;for(let e of i.values())d=Math.max(d,e.y+e.height);d+=l;let f=new Map(e.nodes.map(e=>[e.id,e])),p=a.events.filter(e=>!a.parent.has(e)&&zt(f.get(e))),m=n==null?void 0:Wt(n),h=m!==void 0&&m>=a.range.start-7&&m<a.range.end+8?fr(m,u)+s/2:void 0;return(0,D.jsx)(Dh,{children:(0,D.jsxs)(`svg`,{className:`dg-time-axis`,"aria-hidden":`true`,children:[(0,D.jsx)(`rect`,{className:`dg-time-axis-frame`,x:o.x0,y:-c,width:o.x1-o.x0,height:c}),o.months.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`line`,{className:`dg-time-axis-tick`,x1:e.x,y1:-c,x2:e.x,y2:0}),(0,D.jsx)(`text`,{className:`dg-time-axis-month`,x:e.x+6,y:-c+Ix/2,dominantBaseline:`middle`,children:e.label})]},e.x)),o.weeks.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`line`,{className:`dg-time-axis-tick`,x1:e.x,y1:-Ix,x2:e.x,y2:0}),(0,D.jsx)(`line`,{className:`dg-time-axis-grid`,x1:e.x,y1:0,x2:e.x,y2:d}),e.label!==``&&(0,D.jsx)(`text`,{className:`dg-time-axis-week`,x:e.x+4,y:-Ix/2,dominantBaseline:`middle`,children:e.label})]},e.x)),p.map(e=>{let t=qt(f.get(e));if(t===void 0)return null;let n=fr(t,u)+s/2;return(0,D.jsx)(`line`,{className:`dg-time-axis-event`,x1:n,y1:0,x2:n,y2:d},e)}),h!==void 0&&(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`line`,{className:`dg-time-axis-today`,x1:h,y1:-Ix,x2:h,y2:d}),(0,D.jsx)(`text`,{className:`dg-time-axis-today-label`,x:h+4,y:-Ix/2,dominantBaseline:`middle`,children:`today`})]})]})})}function Rx(e){return e.placed?(0,D.jsxs)(D.Fragment,{children:[e.loopEdges!==null&&(0,D.jsx)(Roe,{edges:e.loopEdges,rough:e.rough,nodeFilter:e.loopNodeFilter}),e.overlay===`git-lanes`&&(0,D.jsx)(Boe,{model:e.model,plane:e.plane}),e.overlay===`order-bands`&&(0,D.jsx)(Koe,{model:e.model,direction:e.flowDirection}),e.overlay===`time-axis`&&(0,D.jsx)(Lx,{model:e.model,plane:e.plane,today:e.today})]}):null}var zx=()=>typeof document.elementsFromPoint==`function`?document.elementsFromPoint.bind(document):void 0;function Bx(e,t=zx()){if(t===void 0)return null;let{target:n}=e;if(!(n instanceof Element)||n.closest(`.react-flow__edge`)===null)return null;for(let n of t(e.clientX,e.clientY)){if(!(n instanceof HTMLElement)||n.closest(`.react-flow__node`)===null)continue;let e=n.closest(`button, a`);if(e instanceof HTMLElement)return e}return null}function Vx(e){let t=Bx(e);return t===null?!1:(e.stopPropagation(),e.preventDefault(),t.click(),!0)}var Hx=(e,t)=>e.map(e=>e.selected===!0==(e.id===t)?e:{...e,selected:e.id===t}),Ux=e=>e.map(e=>e.selected===!0?{...e,selected:!1}:e),Wx=(e,t)=>e.map(e=>{let n=e.data.dropTarget===!0,r=e.id===t;return n===r?e:{...e,data:{...e.data,dropTarget:r}}}),Gx=500,Kx=40;function qx(){let e=(0,_.useRef)(null),t=(0,_.useRef)(null),n=(e,t)=>e!==null&&Date.now()-e.at<Gx&&Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY)<Kx,r=(e,t,n)=>{e.current={id:t,clientX:n.clientX,clientY:n.clientY,at:Date.now()}};return{recordNodeClick:(t,n)=>r(e,t,n),clearNodeClick:()=>{e.current=null},consumeNodeDrill:(t,r,i)=>{let a=e.current;return a!==null&&a.id===t&&i>=2&&n(a,r)?(e.current=null,!0):!1},takePaneNodeDrill:(t,r)=>{let i=e.current;return i!==null&&r>=2&&n(i,t)?(e.current=null,i.id):null},recordEdgeClick:(e,n)=>r(t,e,n),clearEdgeClick:()=>{t.current=null},consumeEdgeAdd:(e,r)=>{let i=t.current;return i!==null&&i.id===e&&n(i,r)?(t.current=null,!0):!1},takePaneEdgeAdd:e=>{let r=t.current;return r!==null&&n(r,e)?(t.current=null,r.id):null},clearAll:()=>{e.current=null,t.current=null}}}function Jx(e){let{props:t,editing:n,edit:r,reactFlow:i,compiled:a,enterNode:o,setLabelEdit:s}=e,{selectOnAppearRef:c,setFixedSideRelation:l,setAddLabelAt:u,setSelectedNode:d,loopHighlight:f}=e,p=(0,_.useRef)(null),m=qx(),h=(e,t)=>{let n=i.screenToFlowPosition({x:t.clientX,y:t.clientY});u({edgeId:e,x:n.x,y:n.y})},g=(0,_.useRef)(t.onMultiSelect);g.current=t.onMultiSelect;let v=(0,_.useRef)([]),y=(0,_.useCallback)(({nodes:e})=>{let t=e.map(e=>e.id),n=v.current;t.length===n.length&&t.every((e,t)=>e===n[t])||(v.current=t,c.current=null,g.current?.(t))},[]);return{onNodeClick:(r,i)=>{if(l(null),m.clearEdgeClick(),i.type===`note`){m.clearNodeClick(),Yx(e,i);return}let s=a.externals?.get(i.id);if(s!==void 0){m.clearNodeClick(),o(s);return}if(!n&&(r.ctrlKey||r.metaKey)&&t.onCompareSelect!==void 0){m.clearNodeClick(),t.onCompareSelect(i.id);return}d(i.id),t.onSelect?.({kind:`node`,id:i.id}),n||r.shiftKey?m.clearNodeClick():m.consumeNodeDrill(i.id,r,r.detail)?o(i.id):m.recordNodeClick(i.id,r)},onNodeDoubleClick:(e,t)=>{n&&t.type!==`note`&&s({kind:`node`,id:t.id})},onReconnectStart:(e,t,n)=>{p.current=n},onReconnect:(t,n)=>Xx(e,p.current,t,n),onReconnectEnd:()=>{p.current=null},onConnect:e=>{e.source!==null&&e.target!==null&&r?.onConnect?.(e.source,e.target,e.sourceHandle,e.targetHandle)},onEdgeClick:(e,r)=>{let i=a.edges.find(e=>e.id===r.id),o=i===void 0?void 0:Gn(i)?.id;l(n&&o!==void 0?o:null),d(null),m.clearNodeClick(),t.onSelect?.({kind:`edge`,id:r.id,constituentIds:i?.constituents.map(e=>e.id)}),n&&o!==void 0?m.consumeEdgeAdd(r.id,e)?h(r.id,e):m.recordEdgeClick(r.id,e):m.clearEdgeClick()},onPaneClick:r=>{if(n){let e=m.takePaneEdgeAdd(r);if(e!==null){h(e,r);return}}let i=n?null:m.takePaneNodeDrill(r,r.detail);if(i!==null){o(i);return}r.detail===2?Zx(e,r):(l(null),m.clearAll(),d(null),t.onSelect?.(null),f.clear())},deleteKeyCode:n&&r?.onDeleteSelection!==void 0?[`Backspace`,`Delete`]:null,onDelete:t=>Qx(e,t),onSelectionChange:y}}function Yx(e,t){let{props:n,editing:r,compiled:i,setRfNodes:a,setFixedSideRelation:o,setSelectedNode:s}=e,c=t.data.target;if(je(c)){s(c.node),a(e=>Hx(e,c.node)),n.onSelect?.({kind:`node`,id:c.node});return}let l=i.edges.find(e=>Gn(e)?.id===c.relation);l!==void 0&&(r&&o(c.relation),s(null),a(Ux),n.onSelect?.({kind:`edge`,id:l.id,constituentIds:[c.relation]}))}function Xx(e,t,n,r){let{editing:i,edit:a,compiled:o}=e;if(!i||r.source===null||r.target===null)return;let s=o.edges.find(e=>e.id===n.id),c=s===void 0?void 0:Gn(s);if(c===void 0)return;let l=Mre(t,{source:r.source,target:r.target,sourceHandle:r.sourceHandle,targetHandle:r.targetHandle},c);a?.onReconnect?.(c.id,r.source,r.target,l)}function Zx(e,t){let{editing:n,edit:r,reactFlow:i,setLabelEdit:a}=e;if(n&&r?.onCreateAt!==void 0){let e=r.onCreateAt(i.screenToFlowPosition({x:t.clientX,y:t.clientY}));typeof e==`string`&&a({kind:`node`,id:e})}else i.fitView({padding:.1,duration:500})}function Qx(e,{nodes:t,edges:n}){let r=t.map(e=>e.id),i=n.filter(e=>e.selected===!0).flatMap(t=>e.compiled.edges.find(e=>e.id===t.id)?.constituents.map(e=>e.id)??[]);(r.length>0||i.length>0)&&e.edit?.onDeleteSelection?.({nodeIds:r,relationIds:i})}var $x=e=>()=>e.offered?(e.flip(),!0):!1;function eS(e){let{reactFlow:t,toggles:n}=e,{canArrange:r,selectedIds:i,alignSelection:a,distributeSelection:o}=e.arrange,s={toggleLaser:$x(Tx(n,`laser`)),toggleDim:$x(Tx(n,`dim`)),toggleLegend:$x(Tx(n,`legend`)),toggleDrawings:$x(Tx(n,`drawings`)),toggleLoops:$x(Tx(n,`loops`)),zoomIn:()=>(t.zoomIn(),!0),zoomOut:()=>(t.zoomOut(),!0),fitView:()=>{let n=e.layoutApiRef?.current;return n==null?t.fitView():n.fitView(),!0},align:e=>!r||i.length<2?!1:(a(e),!0),distribute:e=>!r||i.length<3?!1:(o(e),!0)};return(0,_.useEffect)(()=>{let t=e.canvasCommandsRef;if(t!==void 0)return t.current=s,()=>{t.current=null}}),s}var tS=new Map,nS=.5;function rS(e,t,n,r=()=>!1){let i,a,o=t=>(i??e).get(t),s=(t,n)=>{i??=new Map(e),i.set(t,n)},c=e=>{if(e.children.forEach(c),e.state!==`expanded`||r(e))return;let t=o(e.id);if(t===void 0)return;let i=e.children.map(e=>o(e.id)).filter(e=>e!==void 0);if(i.length===0)return;let l=n(e),u=Math.min(...i.map(e=>e.x))-l.left,d=Math.min(...i.map(e=>e.y))-l.top,f=u<-.5?u:0,p=d<-.5?d:0;if(f!==0||p!==0){for(let t of e.children){let e=o(t.id);e!==void 0&&s(t.id,{...e,x:e.x-f,y:e.y-p})}(a??=new Map).set(e.id,{dx:f,dy:p})}let m=(e,t)=>t>e+nS?t:e,h=m(t.width-f,Math.max(...i.map(e=>e.x+e.width))-f+l.right),g=m(t.height-p,Math.max(...i.map(e=>e.y+e.height))-p+l.bottom);(f!==0||p!==0||h!==t.width||g!==t.height)&&s(e.id,{...t,x:t.x+f,y:t.y+p,width:h,height:g})};return t.forEach(c),{geometry:i??e,shifts:a??tS}}function iS(e,t,n,r){return{x:e.x+(t.x-n.x)-(r?.dx??0),y:e.y+(t.y-n.y)-(r?.dy??0)}}var aS={x:0,y:0};function oS(e,t,{bases:n,shifts:r},i=()=>!1){let a=new Map(t.map(e=>[e.id,e])),o=e=>{let t=e===void 0?void 0:a.get(e);if(t===void 0)return aS;let n=o(t.parentId);return{x:n.x+t.position.x,y:n.y+t.position.y}},s={};for(let[t,c]of Object.entries(e)){let e=a.get(t)?.parentId,l=o(e),u=iS(c,l,(e===void 0?void 0:n.get(e))??l,r.get(t));s[t]=e!==void 0&&i(e)?{x:Math.max(0,u.x),y:Math.max(0,u.y)}:u}return s}function sS(e){let{editing:t,edit:n,rfNodesRef:r,containerBasesRef:i,containerShiftsRef:a,arrangedRef:o,setViewPositions:s}=e;return(0,_.useCallback)(e=>{if(Object.keys(e).length===0)return;let c=e=>r.current.find(t=>t.id===e)?.data?.typeId,l=oS(e,r.current,{bases:i.current,shifts:a.current},e=>fe(c(e))),u=o.current,d=Object.fromEntries(Object.entries(l).map(([e,t])=>{let n=u?.get(e);return[e,n===void 0?{dx:0,dy:0}:{dx:t.x-n.x,dy:t.y-n.y}]}));if(t)if(n?.onNodesMoved!==void 0)n.onNodesMoved(l,d);else for(let[e,t]of Object.entries(l))n?.onNodeMoved?.(e,t);else s(e=>({...e,...l}))},[t,n])}function cS(e,t,n){return t.node?.alwaysExpanded?.(e)===!0||e.type!==void 0&&n.resolve(e.type).alwaysExpanded===!0}function lS(e){let t=(0,_.useMemo)(()=>ua(e.notation),[e.notation]),n=(0,_.useMemo)(()=>e.typeRegistry??Or(t.typeStyles),[e.typeRegistry,t]);return{profile:t,typeRegistry:n,kindRegistry:(0,_.useMemo)(()=>e.kindRegistry??kr(t.kindStyles),[e.kindRegistry,t]),isAlwaysExpanded:(0,_.useCallback)(r=>{let i=e.model.nodes.find(e=>e.id===r);return i!==void 0&&cS(i,t,n)},[e.model.nodes,t,n]),nodeColors:(0,_.useMemo)(()=>t.node?.colorOf?.(e.model,e.plane),[t,e.model,e.plane]),nodeChips:(0,_.useMemo)(()=>t.node?.chips?.(e.model,e.plane),[t,e.model,e.plane])}}function uS(e){let{props:t,profile:n,typeRegistry:r,focus:i,drillRoot:a,visibleRef:o}=e,s=(0,_.useMemo)(()=>{let e=t.model.nodes.filter(e=>cS(e,n,r));if(e.length===0)return t.pins;let i={...t.pins??{}};for(let t of e)i[t.id]=`expanded`;return i},[n,t.pins,t.model.nodes,r]),c=(0,_.useMemo)(()=>{let e=ree(t.model,{focus:a===void 0?i:void 0,pins:s,activeLayers:t.activeLayers,plane:t.plane,root:a}),r=n.edge?.hidden;return r===void 0||!e.edges.some(e=>r(e.kind))?e:{...e,edges:e.edges.filter(e=>!r(e.kind))}},[t.model,t.plane,i,a,s,t.activeLayers,n]),l=(0,_.useRef)(c);return l.current=c,(0,_.useEffect)(()=>{let e=[],t=n=>{e.push(n.id),n.children.forEach(t)};c.roots.forEach(t),o.current=e},[c]),{compiled:c,compiledRef:l}}function dS(e,t,n=[]){if(!e.has(t))return[];let r=new Set(n),i=[t],a=new Set([t]),o=t;for(;;){let t=e.get(o)??[],n=t.find(e=>r.has(e))??t[0];if(n===void 0||a.has(n))break;i.unshift(n),a.add(n),o=n}return i}function fS(e,t){let n=e.indexOf(t);return n<0?[]:e.slice(0,n+1)}function pS(e,t,n){let r=ut(e,t),i=new Set;for(let e of n){let t=[...r.parentsOf.get(e)??[]];for(;t.length>0;){let e=t.pop();e===void 0||i.has(e)||(i.add(e),t.push(...r.parentsOf.get(e)??[]))}}return[...i]}function mS(e,t){let n=new Set(t.nodes.map(e=>e.id)),r=e.findIndex(e=>!n.has(e));return r<0?e:e.slice(0,r)}function hS(e,t){let n=t.next;return e.seen.modelId===n.modelId?e.seen.plane===n.plane?e.seen.model===n.model?e.seen.enteredPathProp===n.enteredPathProp?{seen:n,transition:`none`}:{seen:n,transition:`entered-path`}:{seen:n,transition:`model-edit`}:{seen:n,transition:`plane-switch`}:{seen:n,transition:`model-switch`}}function Xoe(e){let[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(()=>e.enteredPathProp===void 0?[]:mS(e.enteredPathProp,e.model)),a=(0,_.useRef)([]);a.current=r;let{onEnteredPathChange:o}=e;(0,_.useEffect)(()=>{o?.(r)},[r,o]);let s=(0,_.useRef)(null),c=()=>({modelId:e.model.id,model:e.model,plane:e.plane,enteredPathProp:e.enteredPathProp}),[l,u]=(0,_.useReducer)(hS,void 0,()=>({seen:c(),transition:`none`})),d=r;if(l.seen.modelId===e.model.id?l.seen.plane===e.plane?l.seen.model!==e.model&&(u({type:`sync`,next:c()}),i(t=>mS(t,e.model)),d=mS(r,e.model)):(u({type:`sync`,next:c()}),n(pS(e.model,e.plane,e.visibleRef.current)),i([]),d=[],e.onPlaneSwitch()):(u({type:`sync`,next:c()}),e.visibleRef.current=[],n([]),i([]),d=[],s.current=`jump`),l.seen.enteredPathProp!==e.enteredPathProp&&(u({type:`sync`,next:c()}),e.enteredPathProp!==void 0)){let t=mS(e.enteredPathProp,e.model);(t.length!==d.length||t.some((e,t)=>e!==d[t]))&&(s.current??=`glide`,i(t),n([]))}let f=(0,_.useMemo)(()=>ut(e.model,e.plane),[e.model,e.plane]),p=r.length>0?r[r.length-1]:void 0,{isAlwaysExpanded:m}=e;return{enteredPath:r,drillRoot:p,focus:t,enterNode:(0,_.useCallback)(e=>{if(m(e)||(f.childrenOf.get(e)?.length??0)===0)return;let t=dS(f.parentsOf,e,a.current);t.length!==0&&(s.current=`glide`,i(t),n([]))},[f,m]),exitTo:e=>{let t=e===null?[]:fS(r,e);s.current=`glide`,i(t),n([])},pendingRootFitRef:s}}var gS=`note:`,_S=e=>e.startsWith(gS);function vS(e){let{abs:t,obstacles:n}=yS(e.compiled.roots,e.geometry);for(let t of e.compiled.edges){let r=Gn(t),i=r===void 0?void 0:e.badgeSpots.get(r.id);i!==void 0&&n.push(...ky(i.line))}let r=[...Zoe(e.compiled.roots,t,e.typeRegistry),...Qoe(e.compiled.edges,t,e.badgeSpots,e.nameOf)],i=[];for(let a of r){let r=bS(a,e,{abs:t,obstacles:n});r!==void 0&&i.push(r)}return i}function yS(e,t){let n=new Map,r=[],i=(e,a,o)=>{let s=t.get(e.id);if(s===void 0)return;let c={x:s.x+a,y:s.y+o,width:s.width,height:s.height};n.set(e.id,c),r.push(...Gie([{rect:c,kind:e.state===`expanded`?`group`:`box`}])),e.children.forEach(e=>i(e,s.x+a,s.y+o))};return e.forEach(e=>i(e,0,0)),{abs:n,obstacles:r}}function Zoe(e,t,n){let r=e=>e.state===`expanded`?`group`:(e.node.type===void 0?void 0:n.resolve(e.node.type).shape)===`ellipse`?`ellipse`:`box`,i=[],a=(e,n)=>{let o=t.get(e.id);o!==void 0&&(e.external===void 0&&Ne(e.node)&&i.push({target:{node:e.id},name:e.node.name,threats:e.node.threats??[],comments:e.node.comments??[],links:e.node.links??[],badge:Wie(o,r(e)),element:o,parentId:n}),e.children.forEach(t=>a(t,e.id)))};return e.forEach(e=>a(e)),i}function Qoe(e,t,n,r){let i=[];for(let a of e){let e=Gn(a);if(e===void 0||!Ne(e))continue;let o=t.get(a.from),s=t.get(a.to);if(o===void 0||s===void 0)continue;let c=n.get(e.id),l=c?.at??{x:(o.x+o.width/2+s.x+s.width/2)/2,y:(o.y+o.height/2+s.y+s.height/2)/2},u=e.label!==void 0&&e.label!==``?` (${e.label})`:``;i.push({target:{relation:e.id},name:`${r.get(e.from)??e.from} → ${r.get(e.to)??e.to}${u}`,threats:e.threats??[],comments:e.comments??[],links:[],badge:l,element:null,away:c?.away})}return i}function bS(e,t,n){let{target:r,name:i,threats:a,comments:o,links:s,badge:c,element:l,parentId:u,away:d}=e,f=Me(r);if(!t.open.has(f))return;let{editing:p}=t,m=p&&(a.length>0||t.offersThreats),h={width:220,height:iae({name:i,threats:a,comments:o,links:s},m)},g=t.placements?.[f],_=g!==void 0&&(g.dx!==0||g.dy!==0)?{x:c.x+g.dx,y:c.y+g.dy}:Kie({badge:c,element:l,size:h,away:d},n.obstacles);n.obstacles.push({..._,...h});let v=(u===void 0?void 0:n.abs.get(u))??{x:0,y:0},y={target:r,name:i,threats:a,comments:o,links:s,anchor:{x:c.x-v.x,y:c.y-v.y},badge:c,editing:p,editingId:t.editingRow!==null&&t.editingRow.key===f?t.editingRow.id:void 0,onAddThreat:m?t.onAddThreat:void 0,onRetitleThreat:p?t.onRetitleThreat:void 0,onSetThreatStatus:p?t.onSetThreatStatus:void 0,onEditThreatText:p?t.onEditThreatText:void 0,onOpenLink:t.onOpenLink,onEndEdit:t.onEndEdit};return gae({id:gS+f,position:{x:_.x-v.x,y:_.y-v.y},data:y,parentId:u,draggable:p})}var $oe=`application/x-dg-library-entry`,xS=[`framework`,`language`,`tool`],SS=e=>[...e??[]].filter(e=>e.type.startsWith(`image/`)),ese=e=>document.elementFromPoint(e.clientX,e.clientY)?.closest(`.react-flow__node`)?.getAttribute(`data-id`)??void 0;function tse(e){let{editing:t,edit:n,reactFlow:r,wrapperRef:i}=e,a=n?.onImageFiles;return(0,_.useEffect)(()=>{if(!t||a===void 0)return;let e=e=>{let t=e.target?.tagName;if(t===`INPUT`||t===`TEXTAREA`||t===`SELECT`)return;let n=SS(e.clipboardData?.files);if(n.length===0)return;e.preventDefault();let o=i.current?.getBoundingClientRect(),s=o===void 0?void 0:r.screenToFlowPosition({x:o.left+o.width/2,y:o.top+o.height/2});a(n,s)};return window.addEventListener(`paste`,e),()=>window.removeEventListener(`paste`,e)},[t,a,r]),{onDragOver:e=>{if(!t)return;let r=n?.onDropLibraryEntry!==void 0&&e.dataTransfer.types.includes(`application/x-dg-library-entry`);(n?.onImageFiles!==void 0||r)&&e.preventDefault()},onDrop:e=>{if(!t)return;let i=n?.onDropLibraryEntry!==void 0&&typeof e.dataTransfer?.getData==`function`?e.dataTransfer.getData($oe):``;if(i!==void 0&&i!==``){e.preventDefault();let t=ese(e),a=t!==void 0&&_S(t)?void 0:t;n?.onDropLibraryEntry?.(i,r.screenToFlowPosition({x:e.clientX,y:e.clientY}),a);return}if(n?.onImageFiles===void 0)return;e.preventDefault();let a=SS(e.dataTransfer?.files);a.length!==0&&n.onImageFiles(a,r.screenToFlowPosition({x:e.clientX,y:e.clientY}))}}}function nse(e){let{editing:t,edit:n,derivedNodes:r,setLabelEdit:i,setNoteEdit:a,setRfNodes:o,selectOnAppearRef:s}=e,c=n?.editLabelRequest,l=(0,_.useRef)(void 0);(0,_.useEffect)(()=>{!t||c===void 0||c.nonce===l.current||(l.current=c.nonce,i({kind:`node`,id:c.id}),r.some(e=>e.id===c.id)?o(e=>Hx(e,c.id)):s.current=c.id)},[c?.nonce]);let u=n?.editThreatRequest,d=(0,_.useRef)(void 0);(0,_.useEffect)(()=>{!t||u===void 0||u.nonce===d.current||(d.current=u.nonce,a({key:Me(u.target),id:u.id}))},[u?.nonce])}function rse(e,t){let n=new Map(Object.entries(t.nodes)),r=new Map;for(let t of e.containment)r.set(t.child,[...r.get(t.child)??[],t.parent]);let i=(e,t)=>{for(let a of r.get(e)??[])t.has(a)||(t.add(a),n.has(a)||n.set(a,`inside`),i(a,t))};for(let e of Object.keys(t.nodes))i(e,new Set([e]));for(let n of e.relations)if(t.relations[n.id]!==void 0)for(let e of[n.from,n.to])i(e,new Set([e]));return n}function ise(e,t){let n=e.map(e=>t.relations[e.id]);if(n.every(e=>e===void 0))return;let r=n[0];return n.every(e=>e===r)?r:`changed`}function CS(e,t){return t===void 0?e:e===void 0?`dg-diff-${t}`:`${e} dg-diff-${t}`}function wS(e){let{props:t,editing:n,edit:r,preset:i,compiled:a}=e,{profile:o,kindRegistry:s}=e.notation,{labelMoves:c,moveViewLabel:l}=e.moves,{placedGeometry:u,routing:d,routes:f,laidAt:p,labelSpots:m,flowDirection:h}=e.layout,[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)(null),x=(0,_.useMemo)(()=>{let e=o.edge?.colorOf;if(e===void 0)return;let n=new Map;for(let r of a.edges){let i=e(r,t.model,t.plane);i!==void 0&&n.set(r.id,i)}return n},[o,a,t.model,t.plane]),S=(0,_.useCallback)(()=>b(null),[]),C=(0,_.useMemo)(()=>xv(a.edges),[a]),w=(0,_.useMemo)(()=>uv(a.edges),[a]),T=(0,_.useMemo)(()=>({kindRegistry:s,editing:n,onAddEdgeLabel:r?.onAddEdgeLabel,onEditEdgeLabel:r?.onEditEdgeLabel,onMoveEdgeLabel:r?.onMoveEdgeLabel,onSetEdgeSide:r?.onSetEdgeSide,onAddThreat:r?.onAddThreat,fixedSideRelation:g,pendingAdd:y,onPendingAddConsumed:S,stylePreset:i.rough===void 0?void 0:i,edgeLook:i.edges,notation:t.notation,routing:d,routes:f,laidAt:p,labelSpots:m,labelMoves:c,onViewMoveEdgeLabel:!n&&t.onViewLabelMovesChange!==void 0?l:void 0,edgeColors:x,flowDirection:h,selfLoopIndex:C,parallelBow:w}),[s,n,r?.onAddEdgeLabel,r?.onEditEdgeLabel,r?.onMoveEdgeLabel,r?.onSetEdgeSide,r?.onAddThreat,g,y,S,i,t.notation,d,f,p,m,c,t.onViewLabelMovesChange,l,x,h,C,w]),{diffMarks:E}=t,ee=(0,_.useMemo)(()=>u===null?[]:a.edges.map(e=>{let t=hoe(e,T),r=Gn(e),i=CS(void 0,E===void 0?void 0:ise(e.constituents,E));return Vy({id:e.id,source:e.from,target:e.to,data:t,reconnectable:n&&r!==void 0,className:i})}),[a,u,T,n,E]),[te,ne]=(0,_.useState)(()=>new Set);return{rfEdges:(0,_.useMemo)(()=>te.size===0?ee:ee.map(e=>te.has(e.id)?{...e,selected:!0}:e),[ee,te]),onEdgesChange:e=>{let t=e.filter(e=>e.type===`select`);t.length!==0&&ne(e=>{let n=new Set(e);for(let e of t)e.selected?n.add(e.id):n.delete(e.id);return n.size===e.size&&[...n].every(t=>e.has(t))?e:n})},setFixedSideRelation:v,setAddLabelAt:b}}function TS(e,t,n,r){let i=r.fixed.has(e.id)&&r.profile.node?.draggableWhenFixed?.(e.node)!==!0;return{draggable:!i&&void 0,className:i&&r.editing?`nopan`:void 0,...ES(e,n,r),...DS(e,t,r)}}function ES(e,t,n){return t===void 0||n.profile.node?.dropTarget!==void 0&&n.profile.node?.canDrop?.(e.node)===!0?{}:n.profile.layout===void 0?{expandParent:!0}:n.editing?{extent:`parent`}:{}}function DS(e,t,n){return e.state===`expanded`?{style:{width:t.width,height:t.height},zIndex:-1}:e.node.type===`git-stage`?{style:{width:t.width,height:t.height},zIndex:-2}:(e.node.image!==void 0||e.node.shape!==void 0)&&e.state===`leaf`||e.state===`leaf`&&e.node.type!==void 0&&ase(e.node.type,n)?{style:{width:t.width,height:t.height}}:n.profile.layout===void 0&&!(n.profile.node?.typelessAsText===!0&&e.node.type===void 0)?{style:{minWidth:t.width}}:{}}function ase(e,t){return jr.has(t.typeRegistry.resolve(e).shape)||de(e)||Mr.has(e)||t.profile.node?.isLane?.(e)===!0}function ose(e){let{props:t,editing:n,edit:r,compiled:i,labelEdit:a,preset:o,setLabelEdit:s}=e,{profile:c,typeRegistry:l,nodeColors:u,nodeChips:d}=e.notation,{arrangedGeometry:f,fixed:p,regionSeparators:m}=e.layout,h=(0,_.useCallback)(()=>s(null),[s]),g=(0,_.useMemo)(()=>({metaKeys:e.metaKeys,hiddenCounts:e.hiddenCounts,typeRegistry:l,icons:e.icons,typeColors:t.model.typeColors,onOpenLink:t.onOpenLink,onToggleExpand:t.onToggleExpand,onEnterNode:e.enterNode,editing:n,labelEditingId:a?.kind===`node`?a.id:void 0,endLabelEdit:h,onRenameNode:r?.onRenameNode,onSetNodeRich:r?.onSetNodeRich,assetBase:t.assetBase,libraryBase:t.libraryBase,onResize:r?.onResize,onSetTableColumns:r?.onSetTableColumns,quickAdd:r?.quickAdd,onSetRole:r?.onSetRole,onAddThreat:r?.onAddThreat,stylePreset:o.rough===void 0?void 0:o,notation:t.notation,nodeColors:u,hues:e.hues,nodeChips:d,resizable:c.node?.resizable,regionSeparators:m}),[e.metaKeys,e.hiddenCounts,l,e.icons,t.model.typeColors,t.onOpenLink,t.onToggleExpand,e.enterNode,n,a,h,r?.onRenameNode,r?.onSetNodeRich,t.assetBase,t.libraryBase,r?.onResize,r?.onSetTableColumns,r?.quickAdd,r?.onSetRole,r?.onAddThreat,o,t.notation,u,e.hues,d,c,m]),v=(0,_.useMemo)(()=>{if(f===null)return[];let e=[],t={editing:n,profile:c,typeRegistry:l,fixed:p},r=(n,i)=>{let a=f.get(n.id);if(a===void 0)return;let o=Bb(n,g);e.push(By({id:n.id,position:{x:a.x,y:a.y},data:o,parentId:i,...TS(n,a,i,t)})),n.children.forEach(e=>r(e,n.id))};return i.roots.forEach(e=>r(e)),e},[i,f,g,n,l,c,p]),{diffMarks:y,model:b}=t,x=(0,_.useMemo)(()=>y===void 0?null:rse(b,y),[y,b]),{noteNodes:S}=e,C=(0,_.useMemo)(()=>{let e=x===null?v:v.map(e=>{let t=x.get(e.id);if(t===void 0||t===`inside`&&e.data.state===`expanded`)return e;let n=CS(e.className,t);return n===void 0?e:{...e,className:n}});return S.length===0?e:[...e,...S]},[v,S,x]),w=(0,_.useRef)(C);w.current=C;let[T,E]=(0,_.useState)([]),ee=(0,_.useRef)([]);return ee.current=T,{derivedNodes:v,allNodes:C,allNodesRef:w,rfNodes:T,setRfNodes:E,rfNodesRef:ee}}function OS(e){let t=e.filter(e=>e!==void 0);if(t.length===0)return;let n=Math.min(...t.map(e=>e.x)),r=Math.min(...t.map(e=>e.y));return{x:n,y:r,width:Math.max(...t.map(e=>e.x+e.width))-n,height:Math.max(...t.map(e=>e.y+e.height))-r}}var sse=`.react-flow__edge, .react-flow__edgelabel-renderer > *, .dg-loop-badge, .dg-image-caption, .dg-order-band-header, .dg-time-axis-frame`;function kS(e,t){if(e==null)return;let n=[];for(let r of e.querySelectorAll(sse)){let e=r.getBoundingClientRect();if(e.width===0&&e.height===0)continue;let i=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});n.push({x:i.x,y:i.y,width:a.x-i.x,height:a.y-i.y})}return OS(n)}function AS(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let n=document.implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}var jS=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function MS(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function NS(e,t){let n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace(`px`,``)):0}function PS(e){let t=NS(e,`border-left-width`),n=NS(e,`border-right-width`);return e.clientWidth+t+n}function FS(e){let t=NS(e,`border-top-width`),n=NS(e,`border-bottom-width`);return e.clientHeight+t+n}function IS(e,t={}){return{width:t.width||PS(e),height:t.height||FS(e)}}function LS(){let e,t;try{t=process}catch{}let n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var RS=16384;function zS(e){(e.width>RS||e.height>RS)&&(e.width>RS&&e.height>RS?e.width>e.height?(e.height*=RS/e.width,e.width=RS):(e.width*=RS/e.height,e.height=RS):e.width>RS?(e.height*=RS/e.width,e.width=RS):(e.width*=RS/e.height,e.height=RS))}function BS(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:`image/png`,t.quality?t.quality:1)}):new Promise(n=>{let r=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(`,`)[1]),i=r.length,a=new Uint8Array(i);for(let e=0;e<i;e+=1)a[e]=r.charCodeAt(e);n(new Blob([a],{type:t.type?t.type:`image/png`}))})}function VS(e){return new Promise((t,n)=>{let r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin=`anonymous`,r.decoding=`async`,r.src=e})}async function HS(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function US(e,t,n){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`),a=document.createElementNS(r,`foreignObject`);return i.setAttribute(`width`,`${t}`),i.setAttribute(`height`,`${n}`),i.setAttribute(`viewBox`,`0 0 ${t} ${n}`),a.setAttribute(`width`,`100%`),a.setAttribute(`height`,`100%`),a.setAttribute(`x`,`0`),a.setAttribute(`y`,`0`),a.setAttribute(`externalResourcesRequired`,`true`),i.appendChild(a),a.appendChild(e),HS(i)}var WS=(e,t)=>{if(e instanceof t)return!0;let n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||WS(n,t)};function GS(e){let t=e.getPropertyValue(`content`);return`${e.cssText} content: '${t.replace(/'|"/g,``)}';`}function KS(e){return MS(e).map(t=>`${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t)?` !important`:``};`).join(` `)}function cse(e,t,n){let r=`.${e}:${t}`,i=n.cssText?GS(n):KS(n);return document.createTextNode(`${r}{${i}}`)}function qS(e,t,n){let r=window.getComputedStyle(e,n),i=r.getPropertyValue(`content`);if(i===``||i===`none`)return;let a=jS();try{t.className=`${t.className} ${a}`}catch{return}let o=document.createElement(`style`);o.appendChild(cse(a,n,r)),t.appendChild(o)}function JS(e,t){qS(e,t,`:before`),qS(e,t,`:after`)}var lse=`application/font-woff`,use=`image/jpeg`,YS={woff:lse,woff2:lse,ttf:`application/font-truetype`,eot:`application/vnd.ms-fontobject`,png:`image/png`,jpg:use,jpeg:use,gif:`image/gif`,tiff:`image/tiff`,svg:`image/svg+xml`,webp:`image/webp`};function XS(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:``}function ZS(e){return YS[XS(e).toLowerCase()]||``}function QS(e){return e.split(/,/)[1]}function $S(e){return e.search(/^(data:)/)!==-1}function eC(e,t){return`data:${t};base64,${e}`}async function tC(e,t,n){let r=await fetch(e,t);if(r.status===404)throw Error(`Resource "${r.url}" not found`);let i=await r.blob();return new Promise((e,t)=>{let a=new FileReader;a.onerror=t,a.onloadend=()=>{try{e(n({res:r,result:a.result}))}catch(e){t(e)}},a.readAsDataURL(i)})}var nC={};function rC(e,t,n){let r=e.replace(/\?.*/,``);return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,``)),t?`[${t}]${r}`:r}async function iC(e,t,n){let r=rC(e,t,n.includeQueryParams);if(nC[r]!=null)return nC[r];n.cacheBust&&(e+=(/\?/.test(e)?`&`:`?`)+new Date().getTime());let i;try{i=eC(await tC(e,n.fetchRequestInit,({res:e,result:n})=>(t||=e.headers.get(`Content-Type`)||``,QS(n))),t)}catch(t){i=n.imagePlaceholder||``;let r=`Failed to fetch resource: ${e}`;t&&(r=typeof t==`string`?t:t.message),r&&console.warn(r)}return nC[r]=i,i}async function aC(e){let t=e.toDataURL();return t===`data:,`?e.cloneNode(!1):VS(t)}async function oC(e,t){if(e.currentSrc){let t=document.createElement(`canvas`),n=t.getContext(`2d`);return t.width=e.clientWidth,t.height=e.clientHeight,n?.drawImage(e,0,0,t.width,t.height),VS(t.toDataURL())}let n=e.poster;return VS(await iC(n,ZS(n),t))}async function sC(e){try{if(e?.contentDocument?.body)return await gC(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function cC(e,t){return WS(e,HTMLCanvasElement)?aC(e):WS(e,HTMLVideoElement)?oC(e,t):WS(e,HTMLIFrameElement)?sC(e):e.cloneNode(!1)}var lC=e=>e.tagName!=null&&e.tagName.toUpperCase()===`SLOT`;async function uC(e,t,n){let r=[];return r=lC(e)&&e.assignedNodes?MS(e.assignedNodes()):WS(e,HTMLIFrameElement)&&e.contentDocument?.body?MS(e.contentDocument.body.childNodes):MS((e.shadowRoot??e).childNodes),r.length===0||WS(e,HTMLVideoElement)||await r.reduce((e,r)=>e.then(()=>gC(r,n)).then(e=>{e&&t.appendChild(e)}),Promise.resolve()),t}function dC(e,t){let n=t.style;if(!n)return;let r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):MS(r).forEach(i=>{let a=r.getPropertyValue(i);i===`font-size`&&a.endsWith(`px`)&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),WS(e,HTMLIFrameElement)&&i===`display`&&a===`inline`&&(a=`block`),i===`d`&&t.getAttribute(`d`)&&(a=`path(${t.getAttribute(`d`)})`),n.setProperty(i,a,r.getPropertyPriority(i))})}function fC(e,t){WS(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),WS(e,HTMLInputElement)&&t.setAttribute(`value`,e.value)}function pC(e,t){if(WS(e,HTMLSelectElement)){let n=t,r=Array.from(n.children).find(t=>e.value===t.getAttribute(`value`));r&&r.setAttribute(`selected`,``)}}function mC(e,t){return WS(t,Element)&&(dC(e,t),JS(e,t),fC(e,t),pC(e,t)),t}async function hC(e,t){let n=e.querySelectorAll?e.querySelectorAll(`use`):[];if(n.length===0)return e;let r={};for(let i=0;i<n.length;i++){let a=n[i].getAttribute(`xlink:href`);if(a){let n=e.querySelector(a),i=document.querySelector(a);!n&&i&&!r[a]&&(r[a]=await gC(i,t,!0))}}let i=Object.values(r);if(i.length){let t=`http://www.w3.org/1999/xhtml`,n=document.createElementNS(t,`svg`);n.setAttribute(`xmlns`,t),n.style.position=`absolute`,n.style.width=`0`,n.style.height=`0`,n.style.overflow=`hidden`,n.style.display=`none`;let r=document.createElementNS(t,`defs`);n.appendChild(r);for(let e=0;e<i.length;e++)r.appendChild(i[e]);e.appendChild(n)}return e}async function gC(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(e=>cC(e,t)).then(n=>uC(e,n,t)).then(t=>mC(e,t)).then(e=>hC(e,t))}var _C=/url\((['"]?)([^'"]+?)\1\)/g,dse=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,fse=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function M(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}function pse(e){let t=[];return e.replace(_C,(e,n,r)=>(t.push(r),e)),t.filter(e=>!$S(e))}async function mse(e,t,n,r,i){try{let a=n?AS(t,n):t,o=ZS(t),s;return s=i?eC(await i(a),o):await iC(a,o,r),e.replace(M(t),`$1${s}$3`)}catch{}return e}function hse(e,{preferredFontFormat:t}){return t?e.replace(fse,e=>{for(;;){let[n,,r]=dse.exec(e)||[];if(!r)return``;if(r===t)return`src: ${n};`}}):e}function vC(e){return e.search(_C)!==-1}async function yC(e,t,n){if(!vC(e))return e;let r=hse(e,n);return pse(r).reduce((e,r)=>e.then(e=>mse(e,r,t,n)),Promise.resolve(r))}async function bC(e,t,n){let r=t.style?.getPropertyValue(e);if(r){let i=await yC(r,null,n);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function gse(e,t){await bC(`background`,e,t)||await bC(`background-image`,e,t),await bC(`mask`,e,t)||await bC(`mask-image`,e,t)}async function _se(e,t){let n=WS(e,HTMLImageElement);if(!(n&&!$S(e.src))&&!(WS(e,SVGImageElement)&&!$S(e.href.baseVal)))return;let r=n?e.src:e.href.baseVal,i=await iC(r,ZS(r),t);await new Promise((t,r)=>{e.onload=t,e.onerror=r;let a=e;a.decode&&=t,a.loading===`lazy`&&(a.loading=`eager`),n?(e.srcset=``,e.src=i):e.href.baseVal=i})}async function vse(e,t){let n=MS(e.childNodes).map(e=>xC(e,t));await Promise.all(n).then(()=>e)}async function xC(e,t){WS(e,Element)&&(await gse(e,t),await _se(e,t),await vse(e,t))}function yse(e,t){let{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);let r=t.style;return r!=null&&Object.keys(r).forEach(e=>{n[e]=r[e]}),e}var SC={};async function CC(e){let t=SC[e];return t??(t={url:e,cssText:await(await fetch(e)).text()},SC[e]=t,t)}async function wC(e,t){let n=e.cssText,r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(r,`$1`);return a.startsWith(`https://`)||(a=new URL(a,e.url).href),tC(a,t.fetchRequestInit,({result:e})=>(n=n.replace(i,`url(${e})`),[i,e]))});return Promise.all(i).then(()=>n)}function TC(e){if(e==null)return[];let t=[],n=e.replace(/(\/\*[\s\S]*?\*\/)/gi,``),r=RegExp(`((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})`,`gi`);for(;;){let e=r.exec(n);if(e===null)break;t.push(e[0])}n=n.replace(r,``);let i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a=RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=i.exec(n);if(e===null){if(e=a.exec(n),e===null)break;i.lastIndex=a.lastIndex}else a.lastIndex=i.lastIndex;t.push(e[0])}return t}async function bse(e,t){let n=[],r=[];return e.forEach(n=>{if(`cssRules`in n)try{MS(n.cssRules||[]).forEach((e,i)=>{if(e.type===CSSRule.IMPORT_RULE){let a=i+1,o=e.href,s=CC(o).then(e=>wC(e,t)).then(e=>TC(e).forEach(e=>{try{n.insertRule(e,e.startsWith(`@import`)?a+=1:n.cssRules.length)}catch(t){console.error(`Error inserting rule from remote css`,{rule:e,error:t})}})).catch(e=>{console.error(`Error loading remote css`,e.toString())});r.push(s)}})}catch(i){let a=e.find(e=>e.href==null)||document.styleSheets[0];n.href!=null&&r.push(CC(n.href).then(e=>wC(e,t)).then(e=>TC(e).forEach(e=>{a.insertRule(e,n.cssRules.length)})).catch(e=>{console.error(`Error loading remote stylesheet`,e)})),console.error(`Error inlining remote css file`,i)}}),Promise.all(r).then(()=>(e.forEach(e=>{if(`cssRules`in e)try{MS(e.cssRules||[]).forEach(e=>{n.push(e)})}catch(t){console.error(`Error while reading CSS rules from ${e.href}`,t)}}),n))}function xse(e){return e.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>vC(e.style.getPropertyValue(`src`)))}async function Sse(e,t){if(e.ownerDocument==null)throw Error(`Provided element is not within a Document`);return xse(await bse(MS(e.ownerDocument.styleSheets),t))}async function Cse(e,t){let n=await Sse(e,t);return(await Promise.all(n.map(e=>{let n=e.parentStyleSheet?e.parentStyleSheet.href:null;return yC(e.cssText,n,t)}))).join(`
|
|
23
|
+
`));function Rae(e){let t=Zy(e);return t.length===0?0:Math.ceil(9+t.length*Xy)}var Qy={TITLE_STRIP_W:28,LANE_STRIP_W:28,LANE_MIN_W:320,LANE_MIN_H:120,PAD:24};function $y(e,t){let n=new Map;return ke(e,we(e,t)).forEach((e,t)=>{let r=`${e.parent}\u0000${e.child}`;n.has(r)||n.set(r,t)}),(e,t)=>n.get(`${e}\u0000${t}`)??2**53-1}function zae(e,t,n){if(!t.nodes.some(e=>e.type===`activity-frame`))return e;let r=$y(t,n),i=!1,a=e=>{let t=e.children.map(a);if(e.node.type===`activity-frame`){let n=[...t].sort((t,n)=>r(e.id,t.id)-r(e.id,n.id));n.some((e,n)=>e!==t[n])&&(t=n)}return t.every((t,n)=>t===e.children[n])?e:(i=!0,{...e,children:t})},o=e.roots.map(a);return i?{...e,roots:o}:e}function eb(e,t,n,{plane:r,sizes:i}={}){if(!n.nodes.some(e=>e.type===`activity-frame`))return e;let a=new Map(n.nodes.map(e=>[e.id,e.type])),o=new Map(e),{TITLE_STRIP_W:s,LANE_MIN_W:c,LANE_MIN_H:l,PAD:u}=Qy,d=$y(n,r),f=e=>{let t=e.children.filter(e=>a.get(e.id)===`activity-lane`&&o.has(e.id)).sort((t,n)=>d(e.id,t.id)-d(e.id,n.id));if(t.length===0){let t=o.get(e.id);o.set(e.id,{...t,width:Math.max(t.width,s+c),height:Math.max(t.height,l)});return}let n=[],r=c;for(let e of t){let t=0,a=0;for(let n of e.children){let e=o.get(n.id);e!==void 0&&(t=Math.max(t,e.x+e.width),a=Math.max(a,e.y+e.height))}let s=i?.[e.id];n.push(Math.max(l,a+u,s?.h??0)),r=Math.max(r,t+u,s?.w??0)}let f=0;t.forEach((e,t)=>{let i=o.get(e.id);o.set(e.id,{...i,x:s,y:f,width:r,height:n[t]}),f+=n[t]});let p=o.get(e.id);o.set(e.id,{...p,width:s+r,height:f})},p=e=>{a.get(e.id)===`activity-frame`&&o.has(e.id)&&f(e),e.children.forEach(p)};return t.roots.forEach(p),o}function Bae(e,t,n){let r=[...e].sort((e,t)=>e.y-t.y),i=r.findIndex(e=>e.id===t);if(i===-1)return 0;let a=n+r[i].height/2;return r.filter(e=>e.id!==t&&e.y+e.height/2<a).length-i}var Vae={"elk.nodeLabels.placement":`OUTSIDE V_TOP H_CENTER`},Hae={"elk.nodeLabels.placement":`OUTSIDE H_RIGHT V_CENTER`};function Uae(e,t,n){let r=new Map;for(let t of e)t.from===t.to&&r.set(t.from,[...r.get(t.from)??[],t]);let i=t===`RIGHT`||t===`LEFT`,a=new Map;for(let[e,t]of r){let r=yv(t.length-1),o=t.map(n).filter(e=>e!==void 0),s=Math.max(0,...o.map(e=>e.width)),c=Math.max(0,...o.map(e=>e.height)),l=e=>r+(o.length>0?10+e:0);a.set(e,i?{width:Math.max(1,s),height:l(c/2),text:`self-loops`,layoutOptions:Vae}:{width:l(s),height:Math.max(2*bv(0),c),text:`self-loops`,layoutOptions:Hae})}return a}var Wae={width:200,height:88};function tb(e){return{width:e.width,height:e.height+(e.reserveBottom??0)}}var nb=`layered`,rb=new Set([`force`,`stress`,`mrtree`,`radial`]);function ib(e){return rb.has(e?.algorithm??`layered`)}function ab(e){let t=e?.algorithm??`layered`,n=e?.spacing,r=String(n===void 0?40:n),i=r,a={"elk.algorithm":t,"elk.direction":e?.direction??`DOWN`,"elk.spacing.nodeNode":r,"elk.spacing.edgeNode":`20`,"elk.spacing.edgeEdge":`12`,"elk.spacing.componentComponent":`48`,"elk.spacing.edgeLabel":`6`,"elk.separateConnectedComponents":`true`,...ib(e)?{}:{"elk.hierarchyHandling":`INCLUDE_CHILDREN`}};return t===`layered`&&(a[`elk.layered.spacing.nodeNodeBetweenLayers`]=i,a[`elk.layered.thoroughness`]=`10`,a[`elk.layered.crossingMinimization.strategy`]=`LAYER_SWEEP`,a[`elk.layered.nodePlacement.strategy`]=`BRANDES_KOEPF`,a[`elk.layered.nodePlacement.bk.fixedAlignment`]=`BALANCED`,e?.aspectRatio!==void 0&&(a[`elk.layered.wrapping.strategy`]=`MULTI_EDGE`,a[`elk.aspectRatio`]=String(e.aspectRatio))),t===`stress`&&(a[`elk.stress.desiredEdgeLength`]=`240`),(t===`layered`||e?.edgeRouting===`orthogonal`)&&(a[`elk.edgeRouting`]=`ORTHOGONAL`),a}function ob(e){let t=new Map,n=(e,r)=>{t.set(e.id,r),e.children.forEach(t=>n(t,e.id))};e.roots.forEach(e=>n(e,null));let r=e=>{let n=[],r=e;for(;r!=null;)n.push(r),r=t.get(r);return n.reverse()},i=new Map;for(let t of e.layoutEdges){let e=r(t.from),n=r(t.to);if(e.length===0||n.length===0)continue;let a=0;for(;a<e.length&&a<n.length&&e[a]===n[a];)a++;let o=a===0?null:e[a-1],s=e[a],c=n[a];if(s===void 0||c===void 0||s===c)continue;let l=i.get(o)??[];l.push({id:t.id,sources:[s],targets:[c]}),i.set(o,l)}return i}var sb={top:36,left:16,bottom:16,right:16},cb={top:Qy.PAD,left:Qy.LANE_STRIP_W+Qy.PAD,bottom:Qy.PAD,right:Qy.PAD},lb={top:0,left:Qy.TITLE_STRIP_W,bottom:0,right:0};function ub(e){if(e.node.type===`activity-lane`)return cb;if(e.node.type===`activity-frame`)return lb;if(e.node.type===`sm-zone`)return db(e.node)===void 0?Gae:fb;let t=e.node.type===`sm-state`?Rae(e.node):0;return t>0?{...sb,top:sb.top+t}:sb}var db=e=>e.description!==void 0&&e.description.trim()!==``?e.description.trim():void 0,Gae={...sb,top:36},fb={...sb,top:53},Kae=24;function pb(e){if(e.node.type!==`sm-zone`)return 0;let t=db(e.node),n=Qr(e.node.name,12)*1.08;return Math.ceil(Math.max(n,t===void 0?0:Qr(t,11)))+Kae}var mb=e=>`[top=${e.top}.0,left=${e.left}.0,bottom=${e.bottom}.0,right=${e.right}.0]`,hb=mb({top:0,left:0,bottom:0,right:0});function qae(e,t){let n=e?.spacing??40;return t?n:Math.round(n*1.2)}function Jae(e){return Object.fromEntries(Object.entries(e).filter(([e])=>e.includes(`.spacing.`)))}var gb=6,_b=12,Yae=18,Xae=14;function vb(e){return e.labels!==void 0&&e.labels.length>0?e.labels.reduce((e,t)=>t.text.length>e.length?t.text:e,``):e.label??``}var Zae={"elk.edgeLabels.inline":`true`};function yb(e){let t=vb(e).trim();if(t===``)return;let n=it(e.kind)?ct(t,24):[t],r=Math.min(Math.max(...n.map(e=>[...e].length)),24);return{width:Math.round(r*gb+_b),height:Yae+(n.length-1)*Xae}}var bb={"elk.nodeLabels.placement":`OUTSIDE V_BOTTOM H_CENTER`},xb=`note-link`,Sb=new Set([ce,Ue]);function Cb(e){let t=e=>Sb.has(e.node.type)||e.children.some(t);return e.roots.some(t)}var wb=(e,t)=>!t&&[`DOWN`,`UP`].includes(e?.direction??`DOWN`),Qae=(e,t)=>({"elk.nodeSize.constraints":`MINIMUM_SIZE`,"elk.nodeSize.minimum":t?`(0.0, ${e}.0)`:`(${e}.0, 0.0)`}),Tb=(e,t)=>{let n=pb(t);return{...e.sharedContainerOptions,"elk.padding":mb(ub(t)),...n>0?Qae(n,e.swapsMinimum):{}}};function Eb(e,t){e.emitted.add(t.id);let n=e.substitute?.prelaid.get(t.id);if(n!==void 0)return{id:t.id,width:n.width,height:n.height};let r=e.substitute?.packs.get(t.id);if(r!==void 0)return{id:t.id,children:[...t.children.filter(e=>!r.members.has(e.id)).map(t=>Eb(e,t)),{id:r.id,width:r.width,height:r.height}],layoutOptions:Tb(e,t)};if(t.state===`expanded`){let n=e.byOwner?.get(t.id),r=n!==void 0&&n.length>0;return r&&(e.attachedToContainer=!0),{id:t.id,children:t.children.map(t=>Eb(e,t)),layoutOptions:Tb(e,t),...r?{edges:n}:{}}}if(t.state===`collapsed`){let n=e.sizes?.get(t.id)??Wae,r=e.loopRooms.get(t.id);return{id:t.id,width:n.width,height:n.height,...r===void 0?{}:{labels:[r]}}}return $ae(e,t)}function $ae(e,t){let n=e.sizes?.get(t.id)?.caption,r=[...n===void 0?[]:[{...n,text:`caption`,layoutOptions:bb}],...e.loopRooms.has(t.id)?[e.loopRooms.get(t.id)]:[]];return{id:t.id,...tb(e.sizes?.get(t.id)??nr),...r.length>0?{labels:r}:{},...e.fromStart&&Sb.has(t.node.type)?{layoutOptions:{"elk.layered.layering.layerConstraint":`FIRST`}}:{}}}function eoe(e,t){let n=t?.get(e.id);return n===void 0?e:{...e,layoutOptions:{...e.layoutOptions,"elk.partitioning.partition":String(n)}}}var toe=`__order__`,noe={"elk.layered.priority.direction":`100`};function roe(e,t,n){return e.layoutEdges.filter(e=>e.from!==e.to&&(t.substitute===void 0||t.emitted.has(e.from)&&t.emitted.has(e.to))).map(e=>{let r=vb(e).trim(),i=yb(e),a=t.fromStart&&e.kind===xb;return a&&n.add(e.id),{id:e.id,sources:[a?e.to:e.from],targets:[a?e.from:e.to],...i===void 0?{}:{labels:[{...i,text:r,layoutOptions:Zae}]},...e.kind===`__order__`?{layoutOptions:noe}:{}}})}function Db(e,t){let n=new Map(e.layoutEdges.map(e=>[e.id,e]));return t.some(e=>{let t=n.get(e.id);return t===void 0||e.sources[0]!==t.from||e.targets[0]!==t.to})}function Ob(e,t,n){return{...ab(e),...t===void 0?{}:{"elk.padding":hb},...n===void 0?{}:{"elk.partitioning.activate":`true`}}}var ioe=(e,t)=>(t?.algorithm??`layered`)===`layered`&&Cb(e);function kb(e,t,n,r){let i=r?.substitute,a=r?.partitions!==void 0&&r.partitions.size>0?r.partitions:void 0,o=Ob(n,i,a),s=ioe(e,n),c=s?{"elk.layered.cycleBreaking.strategy":`DEPTH_FIRST`}:{};Object.assign(o,c);let l=ib(n)&&r?.flat!==!0,u={sizes:t,substitute:i,byOwner:l?ob(e):void 0,sharedContainerOptions:l?o:{...Jae(o),...c},fromStart:s,emitted:new Set,attachedToContainer:!1,loopRooms:Uae(e.edges,n?.direction??`DOWN`,yb),swapsMinimum:wb(n,l)},d=(i?.roots??e.roots).map(e=>eoe(Eb(u,e),a)),f=new Set,p=l?u.byOwner?.get(null)??[]:roe(e,u,f),m=u.attachedToContainer||l&&Db(e,p);return{graph:{id:me,layoutOptions:o,children:d,edges:p},lifted:m,reversed:f}}function Ab(e,t){if(e.node.color!==void 0)return e.node.color;let n=t.nodeColors?.get(e.id);if(n!==void 0)return n;let r=t.typeColors;if(r!==void 0)return(e.node.type===void 0?void 0:r[e.node.type])??r[`*`]}function jb(e,t){return t.map(t=>e.node.metadata?.[t]).filter(e=>e!=null).map(String)}function Mb(e){let t=e.node.comments?.length??0,n=e.node.links?.length??0;return t>0||n>0?{comments:t,links:n}:void 0}function Nb(e,t){let n=hn(e.node.threats),r=Ab(e,t),i={label:e.node.name,state:e.state,promoted:e.promoted,sharedMembers:e.sharedMembers,hiddenCount:t.hiddenCounts.get(e.id)??0,metaBadges:jb(e,t.metaKeys),typeRegistry:t.typeRegistry,icons:t.icons,typeId:e.node.type,icon:e.node.icon,color:r,hue:t.hues===void 0?void 0:vie(e.node.type,r,t.hues),textColor:e.node.textColor,technology:e.node.technology,rich:e.node.rich,textAlign:e.node.textAlign,fontScale:e.node.fontScale,onToggleExpand:t.onToggleExpand,onEnterNode:e.state===`leaf`?void 0:t.onEnterNode,external:e.external!==void 0,image:e.node.image,shape:e.node.shape,link:e.node.link,columns:e.columns??e.node.columns,quickAdd:t.editing?t.quickAdd:void 0,onSetRole:t.editing?t.onSetRole:void 0,onAddThreat:t.editing?t.onAddThreat:void 0,stylePreset:t.stylePreset,notation:t.notation,threats:n.total>0?n:void 0,annotations:Mb(e),chips:t.nodeChips?.get(e.id),...e.node.type===`sm-state`?{behaviors:Lae(e.node),composite:e.state!==`leaf`}:{},...e.node.type===`sm-zone`&&db(e.node)!==void 0?{zoneNote:db(e.node)}:{}},a=t.regionSeparators?.get(e.id);return a!==void 0&&(i.regionSeparator=a),t.labelEditingId===e.id&&Pb(i,e,t),(e.node.image!==void 0||e.node.shape!==void 0)&&(i.assetBase=t.assetBase,i.libraryBase=t.libraryBase),e.node.link!==void 0&&(i.onOpenLink=t.onOpenLink),t.editing&&aoe(i,e,t),i}function Pb(e,t,n){e.labelEditing=!0,e.onLabelCommit=e=>{n.endLabelEdit?.();let r=e?.trim()??``;r!==``&&r!==t.node.name&&n.onRenameNode?.(t.id,r)},e.onRichCommit=e=>{n.endLabelEdit?.(),e!==null&&he(e).trim()!==``&&n.onSetNodeRich?.(t.id,e)}}function aoe(e,t,n){t.node.type===`db-table`&&n.onSetTableColumns!==void 0&&(e.onColumnsChange=e=>{let r=t.node.columns??[];n.onSetTableColumns?.(t.id,Sn(r,t.columns??r,e))}),n.onResize!==void 0&&(t.node.image!==void 0&&(e.onResize=n.onResize),n.resizable?.(t.node)===`x`&&(e.resizeAxis=`x`,e.onResize=n.onResize))}function ooe(e,t){let n=e.labels??[],r=Gn(e),i=r===void 0?void 0:t?.[r.id];return i===void 0?n:n.map(e=>{let t=i[e.id];return t===void 0?e:{...e,t:t.t,side:t.side}})}function soe(e){return e.constituents.reduce((e,t)=>{let n=hn(t.threats);return{open:e.open+n.open,total:e.total+n.total}},{open:0,total:0})}function coe(e){let t=e.constituents.reduce((e,t)=>e+(t.comments?.length??0),0);return t>0?{comments:t,links:0}:void 0}function loe(e,t){let n=soe(e),r={kind:e.kind,constituentCount:e.constituents.length,kindRegistry:t.kindRegistry,label:e.label,labels:e.labels===void 0?void 0:ooe(e,t.labelMoves),tint:e.tint,relStyle:e.style,stylePreset:t.stylePreset,edgeLook:t.edgeLook,notation:t.notation,polarity:e.polarity,delay:e.delay,notationColor:t.edgeColors?.get(e.id),threats:n.total>0?n:void 0,annotations:coe(e)},i=Gn(e);i!==void 0&&(r.threatRelation=i.id),i?.fromColumn!==void 0&&(r.fromColumn=i.fromColumn),i?.toColumn!==void 0&&(r.toColumn=i.toColumn),i!==void 0&&(t.editing?uoe(r,e,i,t):Fb(r,i,t)),e.from===e.to&&(r.selfLoop={direction:t.flowDirection,index:t.selfLoopIndex.get(e.id)??0,labelWidth:yb(e)?.width??0});let a=t.parallelBow.get(e.id);return a!==void 0&&(r.parallelBow=a),t.routing!==void 0&&Ib(r,e,t,t.routing),r}function uoe(e,t,n,r){if(e.editableLabels=!0,e.onAddLabel=(e,t,i)=>r.onAddEdgeLabel?.(n.id,e,t,i),e.onEditLabel=(e,t)=>r.onEditEdgeLabel?.(n.id,e,t),e.onMoveLabel=(e,t,i)=>r.onMoveEdgeLabel?.(n.id,e,t,i),r.onAddThreat!==void 0){let t=r.onAddThreat;e.onAddThreat=()=>t({relation:n.id})}Bn(n,t.from,t.to)&&r.onSetEdgeSide!==void 0&&(e.onSetSide=(e,t)=>r.onSetEdgeSide?.(n.id,e,t),n.id===r.fixedSideRelation&&(e.fixedSideDotsShown=!0)),r.pendingAdd?.edgeId===t.id&&(e.pendingAdd={x:r.pendingAdd.x,y:r.pendingAdd.y},e.onPendingAddConsumed=r.onPendingAddConsumed)}function Fb(e,t,n){n.onViewMoveEdgeLabel!==void 0&&(e.movableLabels=!0,e.onMoveLabel=(e,r,i)=>n.onViewMoveEdgeLabel?.(t.id,e,r,i))}function Ib(e,t,n,r){let i=n.routes.get(t.id),a=n.laidAt.get(t.from),o=n.laidAt.get(t.to);if(i===void 0||i.length<2||a===void 0||o===void 0)return;e.route=i,e.routeCorner=n.edgeLook?.corner??r.corner,e.routeFrom=a,e.routeTo=o;let s=n.labelSpots.get(t.id);s!==void 0&&(e.labelSpot=s)}var Lb=new WeakMap,Rb=new WeakMap,doe=`metaKeys.hiddenCounts.typeRegistry.icons.typeColors.onOpenLink.onToggleExpand.onEnterNode.editing.labelEditingId.endLabelEdit.onRenameNode.onSetNodeRich.assetBase.libraryBase.onResize.onSetTableColumns.quickAdd.onSetRole.onAddThreat.stylePreset.notation.nodeColors.hues.nodeChips.resizable.regionSeparators`.split(`.`),foe=[`kindRegistry`,`editing`,`onAddEdgeLabel`,`onEditEdgeLabel`,`onMoveEdgeLabel`,`onSetEdgeSide`,`onAddThreat`,`fixedSideRelation`,`pendingAdd`,`onPendingAddConsumed`,`stylePreset`,`edgeLook`,`notation`,`routing`,`routes`,`laidAt`,`labelSpots`,`labelMoves`,`onViewMoveEdgeLabel`,`edgeColors`,`flowDirection`,`selfLoopIndex`,`parallelBow`],poe=e=>(t,n)=>e.every(e=>t[e]===n[e]),zb=poe(doe),moe=poe(foe);function Bb(e,t){let n=Lb.get(e);if(n!==void 0&&zb(n.ctx,t))return n.data;let r=Nb(e,t);return Lb.set(e,{ctx:t,data:r}),r}function hoe(e,t){let n=Rb.get(e);if(n!==void 0&&moe(n.ctx,t))return n.data;let r=loe(e,t);return Rb.set(e,{ctx:t,data:r}),r}var Vb=[`layers`,`kinds`,`marks`],Hb=new Set([`bar`,`start-dot`,`end-bullseye`]);function Ub(e,t){let n=new Map(t.map((e,t)=>[e,t]));return[...e].sort((e,t)=>{let r=n.get(e),i=n.get(t);return r!==void 0&&i!==void 0?r-i:r===void 0?i===void 0?e.localeCompare(t):1:-1})}function Wb(e){let t=e.model,n=ut(t,e.plane?.id),r=e.plane?.id??t.planes[0]?.id,i=e=>Ee(e,r);if(e.root!==void 0&&n.childrenOf.has(e.root)){let{model:r}=Kn(t,n,e.root);return{nodes:r.nodes,relations:r.relations.filter(i)}}let a=new Set(n.childrenOf.keys());return{nodes:t.nodes.filter(e=>a.has(e.id)),relations:t.relations.filter(e=>i(e)&&a.has(e.from)&&a.has(e.to))}}function Gb(e){let{nodes:t,relations:n}=Wb(e),r=new Set;for(let e of t){e.layer!==void 0&&r.add(e.layer);for(let t of e.columns??[])t.layer!==void 0&&r.add(t.layer)}for(let t of n){let n=Pn(e.model,t);n!==void 0&&r.add(n)}return r}function Kb(e){let t=Gb(e),n=new Set(e.activeLayers??e.plane?.layers??[]),r=[];for(let i of e.model.layers){if(!t.has(i.id))continue;let a=n.has(i.id);!a&&!e.canToggleLayers||r.push({id:`layers:${i.id}`,section:`layers`,label:i.name,swatch:{draw:`chip`,color:i.tint??`var(--dg-edge)`},layer:i.id,active:a})}return r}function goe(e){let t=new Map,n=[];for(let r of e.compiled.edges)t.has(r.kind)?t.get(r.kind)!==r.tint&&t.set(r.kind,void 0):(n.push(r.kind),t.set(r.kind,r.tint));return Ub(n,Object.keys(Er)).map(n=>{let r=t.get(n),i=e.kindRegistry.resolve(n);return{id:`kinds:${n}`,section:`kinds`,label:i.legendLabel??n,swatch:{draw:`line`,style:i,color:r},vocabulary:i.legendLabel!==void 0||void 0}})}function qb(e){let t=new Map,n={nodeColors:e.nodeColors,typeColors:e.model.typeColors},r=e=>{for(let i of e){let e=i.node.type;if(e!==void 0){let r=Ab(i,n);t.has(e)?t.get(e)!==r&&t.set(e,void 0):t.set(e,r)}r(i.children)}};return r(e.compiled.roots),Ub([...t.keys()],Object.keys(Tr)).map(n=>{let r=e.typeRegistry.resolve(n),i=Hb.has(r.shape)?void 0:e.hues===void 0?t.get(n):vie(n,t.get(n),e.hues),a=r.label;return{id:`types:${n}`,section:`types`,label:r.legendLabel??(a===void 0||a===``?n:a),swatch:{draw:`shape`,style:r,color:i,icon:r.icon},vocabulary:r.legendLabel!==void 0||void 0}})}function _oe(e){let t=new Set,n=e=>{e.total!==0&&t.add(e.open>0?`threat-open`:`threat-handled`)},r=e=>{for(let i of e){n(hn(i.node.threats));for(let e of i.columns??i.node.columns??[])e.pk===!0?t.add(`pk`):e.fk===!0&&t.add(`fk`);r(i.children)}};r(e.compiled.roots);for(let t of e.compiled.edges)n(t.constituents.reduce((e,t)=>{let n=hn(t.threats);return{open:e.open+n.open,total:e.total+n.total}},{open:0,total:0}));let i={"threat-open":`Open threats`,"threat-handled":`All threats handled`,pk:`Primary key`,fk:`Foreign key column`};return Object.keys(i).filter(e=>t.has(e)).map(e=>({id:`marks:${e}`,section:`marks`,label:i[e],swatch:{draw:`mark`,mark:e},vocabulary:!0}))}function voe(e){let t=new Set,n=e=>{for(let r of e){let{type:e,stateKind:i,color:a}=r.node;e===`sm-state`&&i!==void 0&&a===void 0&&t.add(i),n(r.children)}};n(e.compiled.roots);let r=e.typeRegistry.resolve(Be);return E.filter(e=>t.has(e)).map(e=>({id:`marks:state-${e}`,section:`marks`,label:ki[e],swatch:{draw:`shape`,style:r,color:Oi[e]},vocabulary:!0}))}function yoe(e,t){if(e.kind!==void 0)return{draw:`line`,style:t.kindRegistry.resolve(e.kind),color:e.color};if(e.type!==void 0){let n=t.typeRegistry.resolve(e.type),r=e.icon??n.icon;return{draw:`shape`,style:n,color:e.color,icon:r}}if(e.color!==void 0)return{draw:`chip`,color:e.color}}function boe(e){return e.drawings===void 0?[]:[{id:`layers:$drawings`,section:`layers`,label:`Drawings`,swatch:{draw:`line`,style:{width:2.5},color:`var(--dg-ink)`},drawings:!0,active:e.drawings.active}]}function xoe(e){let t=e.config.show??Vb,n=t.includes(`types`)?qb(e):e.config.show===void 0?qb(e).filter(e=>e.vocabulary===!0):[],r=[...t.includes(`layers`)?[...Kb(e),...boe(e)]:[],...t.includes(`kinds`)?goe(e):[],...n,...t.includes(`marks`)?[...voe(e),..._oe(e)]:[]],i=[];return(e.config.items??[]).forEach((t,n)=>{let a=t.kind===void 0?t.type===void 0?void 0:`types:${t.type}`:`kinds:${t.kind}`,o=a===void 0?void 0:r.find(e=>e.id===a);if(o!==void 0){o.label=t.label,t.color!==void 0&&(o.swatch?.draw===`line`||o.swatch?.draw===`shape`)&&(o.swatch={...o.swatch,color:t.color}),t.icon!==void 0&&o.swatch!==void 0&&o.swatch.draw===`shape`&&(o.swatch={...o.swatch,icon:t.icon});return}let s=yoe(t,e);i.push({id:`items:${n}`,section:`items`,label:t.label,swatch:s})}),[...r,...i]}var Soe={};function Jb(e){let[t,n]=(0,_.useState)(e.model.legend!==void 0),[r,i]=(0,_.useState)(null),a=e.model.legend;(0,_.useEffect)(()=>{n(a!==void 0)},[e.model.id,a]);let o=(0,_.useMemo)(()=>Ce(e.model.planes,e.plane),[e.model.planes,e.plane]),s=(0,_.useMemo)(()=>{let t=xoe({model:e.model,compiled:e.compiled,plane:o,root:e.drillRoot,activeLayers:e.activeLayers,nodeColors:e.nodeColors,hues:e.hues,typeRegistry:e.typeRegistry,kindRegistry:e.kindRegistry,config:a??Soe,canToggleLayers:e.canToggleLayers,drawings:e.strokes.length>0?{active:e.drawingsVisible}:void 0});return a!==void 0||t.some(e=>e.vocabulary===!0)?t:[]},[a,e.model,e.compiled,o,e.drillRoot,e.activeLayers,e.typeRegistry,e.kindRegistry,e.canToggleLayers,e.strokes,e.drawingsVisible,e.nodeColors,e.hues]),c=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let e=a?.position??`bottom-right`;c.current=!t||r===null||s.length===0?null:{side:e.startsWith(`top`)?`top`:`bottom`,px:r.height+16}},[t,r,s,a]),{legendConfig:a,showLegend:t,setShowLegend:n,setLegendSize:i,legendRowList:s,legendReserveRef:c}}function Yb(e){let t;for(let n of e){if(n===void 0)return;if(t===void 0)t=n;else if(t!==n)return}return t}function Coe(e){let t=new Map;for(let n of e){let e=`${n.from}\0${n.to}`,r=t.get(e);if(r===void 0){t.set(e,{from:n.from,to:n.to,polarity:n.polarity,edgeIds:[n.id]});continue}r.edgeIds.push(n.id),r.polarity=Yb([r.polarity,n.polarity])}return t}function Xb(e){let t=0;for(let n of e){if(n.polarity===void 0)return`unknown`;n.polarity===`-`&&t++}return t%2==0?`R`:`B`}function woe(e,t){return{key:e.join(`→`),nodes:[...e],edgeIds:t.flatMap(e=>e.edgeIds),kind:Xb(t)}}var Zb=(e,t)=>e<t?-1:+(e>t);function Qb(e,t){let n=t?.maxLength??20,r=t?.maxLoops??50,i=t?.budget??2e5,a=[...Coe(e).values()],o=new Set;for(let e of a)o.add(e.from),o.add(e.to);let s=[...o].sort(Zb),c=new Map(s.map((e,t)=>[e,t])),l=s.length,u=Array.from({length:l},()=>[]),d=[];for(let e of a){if(e.from===e.to){d.push(e);continue}let t=c.get(e.from),n=c.get(e.to);t===void 0||n===void 0||u[t]?.push({to:n,arc:e})}for(let e of u)e.sort((e,t)=>e.to-t.to);d.sort((e,t)=>Zb(e.from,t.from));let f=[],p=0,m=!1;for(let e of d)f.push(woe([e.from],[e]));let h=[],g=[],_=new Set;function v(e,t){if(m)return;let r=u[t];if(r!==void 0)for(let{to:t,arc:a}of r){if(p>=i){m=!0;return}if(p++,t===e){h.length>=2&&f.push(woe(h,[...g,a]));continue}if(t>e&&!_.has(t)&&h.length<n){let n=s[t];if(n===void 0)continue;if(_.add(t),h.push(n),g.push(a),v(e,t),g.pop(),h.pop(),_.delete(t),m)return}}}for(let e=0;e<l&&!m;e++){let t=s[e];t!==void 0&&(h.length=0,g.length=0,_.clear(),h.push(t),_.add(e),v(e,e))}return f.sort((e,t)=>e.nodes.length-t.nodes.length||Zb(e.key,t.key)),{loops:f.slice(0,r),truncated:m||f.length>r}}var Toe=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),Eoe=6;function Doe(e,t,n){let r=[{x:e,y:t}],i=Math.max(24,n);for(let n=1;n<=Eoe;n++){let a=n*i,o=Math.max(4,Math.floor(2*Math.PI*a/i));for(let n=0;n<o;n++){let i=-Math.PI/2+2*Math.PI*n/o;r.push({x:e+Math.cos(i)*a,y:t+Math.sin(i)*a})}}return r}function $b(e,t,n){let r=Math.max(n.x,Math.min(e.x,n.x+n.width)),i=Math.max(n.y,Math.min(e.y,n.y+n.height)),a=e.x-r,o=e.y-i;return a*a+o*o<t*t}var ex=1e-6;function Ooe(e){if(e.length<3)return`none`;let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=e[(n+1)%e.length];r===void 0||i===void 0||(t+=r.x*i.y-i.x*r.y)}return t/=2,Math.abs(t)<ex?`none`:t>0?`cw`:`ccw`}function koe(e,t,n){let r=n?.labelRadius??15,i=n?.minLabelGap??36,a=n?.nodeMargin??8,o=n?.obstacles??[...t.values()],s=r+a,c=i*i,l=[...e.filter(e=>e.nodes.every(e=>t.has(e)))].sort((e,t)=>e.nodes.length-t.nodes.length||Zb(e.key,t.key)),u=[],d=[];for(let e of l){let n=e.nodes.map(e=>t.get(e)).filter(e=>e!==void 0).map(Toe);if(n.length===0)continue;let r=n.reduce((e,t)=>e+t.x,0)/n.length,a=n.reduce((e,t)=>e+t.y,0)/n.length,l=Ooe(n),f={x:r,y:a};for(let e of Doe(r,a,i))if(!o.some(t=>$b(e,s,t))&&!d.some(t=>{let n=t.x-e.x,r=t.y-e.y;return n*n+r*r<c})){f=e;break}d.push(f),u.push({key:e.key,kind:e.kind,x:f.x,y:f.y,direction:l})}return u}function tx(e){let t=new Map(e.map(e=>[e.id,e])),n=new Set;function r(e){let i=t.get(e);if(i===void 0)return{x:0,y:0};if(i.parentId===void 0||n.has(e))return i.position;n.add(e);let a=r(i.parentId);return n.delete(e),{x:i.position.x+a.x,y:i.position.y+a.y}}let i=new Map;for(let t of e){let e=t.measured?.width,n=t.measured?.height;if(e===void 0||n===void 0)continue;let a=r(t.id);i.set(t.id,{x:a.x,y:a.y,width:e,height:n})}return i}function nx(e){let t=e.profile.canvasOverlay===`loop-labels`,n=(0,_.useMemo)(()=>t?e.compiled.edges.map(e=>{let t=Yb(e.constituents.map(e=>e.polarity));return{id:e.id,from:e.from,to:e.to,polarity:t}}):null,[e.compiled,t]),{onCldEdges:r}=e;(0,_.useEffect)(()=>{r?.(n??[])},[n,r]);let[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!0),[u,d]=(0,_.useState)(null),f=e.externalHighlight,{profile:p,model:m,plane:h}=e,g=(0,_.useMemo)(()=>{if(!c||o===null)return null;let t=new Set([o]),n=new Set;for(let r of e.compiled.edges)r.from===o?(t.add(r.to),n.add(r.id)):r.to===o&&(t.add(r.from),n.add(r.id));for(let e of p.related?.(m,h,o)??[])t.add(e);return{nodes:t,edges:n}},[c,o,e.compiled.edges,p,m,h]),v=(0,_.useMemo)(()=>{let e=f==null?u===null?null:{nodes:u.nodes,edges:u.edges}:{nodes:new Set(f.nodes),edges:new Set(f.edges)},t=e??g;return{nodes:t?.nodes??k,edges:t?.edges??k,active:t!==null,variant:e===null?`focus`:`loop`,activeKey:u?.key??null,focusId:o,toggle:(e,t,n)=>d(r=>r?.key===e?null:{key:e,nodes:new Set(t),edges:new Set(n)}),clear:()=>d(null)}},[u,f,g,o]);return(0,_.useEffect)(()=>{d(null),s(null)},[e.compiled]),{cld:t,loopEdges:n,showLoops:i,setShowLoops:a,selectedNode:o,setSelectedNode:s,focusConnected:c,setFocusConnected:l,loopHighlight:v}}var Aoe=8,rx=14,ix=`stroke='black' stroke-width='1.4' fill='none' stroke-linecap='round'`,joe={plus:`<rect x='1.5' y='6.25' width='5' height='1.5'/><rect x='3.25' y='4.5' width='1.5' height='5'/>`,dash:`<rect x='1.5' y='6.25' width='5' height='1.5'/>`,equals:`<rect x='1.5' y='4.8' width='5' height='1.3'/><rect x='1.5' y='7.9' width='5' height='1.3'/>`,pipe:`<rect x='3.25' y='1' width='1.5' height='12'/>`,colon:`<circle cx='4' cy='4.5' r='1'/><circle cx='4' cy='9.5' r='1'/>`,dot:`<circle cx='4' cy='7' r='1'/>`,baseDot:`<circle cx='4' cy='10' r='1.05'/>`,tick:`<rect x='3.35' y='2.5' width='1.3' height='4'/>`,slash:`<path d='M1.8 12 L6.2 2' ${ix}/>`,backslash:`<path d='M1.8 2 L6.2 12' ${ix}/>`,openParen:`<path d='M5.6 1.5 Q1.6 7 5.6 12.5' ${ix}/>`,closeParen:`<path d='M2.4 1.5 Q6.4 7 2.4 12.5' ${ix}/>`},Moe=[[0,0],[1,0],[2,0],[2,1],[2,2],[1,2],[0,2],[0,1]];function ax(e){let t=e.map((e,t)=>{let[n,r]=Moe[t];return`<g transform='translate(${n*Aoe} ${r*rx})'>${joe[e]}</g>`});return`url("data:image/svg+xml,${`<svg xmlns='http://www.w3.org/2000/svg' width='${3*Aoe}' height='${3*rx}'>${t.join(``)}</svg>`.replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/#/g,`%23`)}")`}function Noe(){return{"--dg-ascii-box":ax([`plus`,`dash`,`plus`,`pipe`,`plus`,`dash`,`plus`,`pipe`]),"--dg-ascii-table":ax([`plus`,`equals`,`plus`,`pipe`,`plus`,`equals`,`plus`,`pipe`]),"--dg-ascii-hex":ax([`slash`,`dash`,`backslash`,`pipe`,`slash`,`dash`,`backslash`,`pipe`]),"--dg-ascii-pill":ax([`baseDot`,`dash`,`baseDot`,`closeParen`,`tick`,`dash`,`tick`,`openParen`]),"--dg-ascii-group":ax([`dot`,`dot`,`dot`,`colon`,`dot`,`dot`,`dot`,`colon`])}}var ox={id:`clean`,label:`Clean`},sx={id:`sketch`,label:`Sketch`,rough:{roughness:1.15,bowing:1,strokeWidth:1.5,fillStyle:`solid`},fontFamily:`'Kalam', system-ui, sans-serif`,colorMix:{fill:14,stroke:100}},cx={id:`hand-drawn`,label:`Hand-drawn`,rough:{roughness:.9,bowing:.8,strokeWidth:1.2,fillStyle:`hachure`,fillWeight:.8,hachureGap:5,hatchOpacity:.45},cornerRadius:14,fontFamily:`'Caveat', 'Kalam', cursive`,colorMix:{fill:22,stroke:85}},lx={id:`blueprint`,label:`Blueprint`,fontFamily:`ui-monospace, 'Cascadia Mono', 'Source Code Pro', monospace`,cssVars:{"--dg-canvas-bg":`#0d2740`,"--dg-surface":`#0d2740`,"--dg-node-fill":`#103052`,"--dg-node-stroke":`#9ec8e8`,"--dg-group-fill":`#0f2c4a`,"--dg-group-stroke":`#5f8ab0`,"--dg-text":`#e4f1fb`,"--dg-text-muted":`#8fb3cf`,"--dg-border":`#2a4a6b`,"--dg-edge":`#9ec8e8`,"--dg-edge-label-bg":`#103052`}},ux={id:`pencil`,label:`Pencil`,rough:{roughness:.3,bowing:.1,strokeWidth:1.4,fillStyle:`hachure`,fillWeight:.55,hachureGap:5,hatchOpacity:.5},cornerRadius:16,fontFamily:`'Caveat', 'Kalam', cursive`,colorMix:{fill:22,stroke:85}},dx={id:`marker`,label:`Marker`,rough:{roughness:1.6,bowing:1.2,strokeWidth:2.5,fillStyle:`zigzag`,fillWeight:1.8,hachureGap:7,hatchOpacity:.25},cornerRadius:8,fontFamily:`'Kalam', system-ui, sans-serif`,colorMix:{fill:28,stroke:100}},fx=`'diagc Inter', 'Inter', system-ui, sans-serif`,px=`'diagc JetBrains Mono', 'JetBrains Mono', ui-monospace, monospace`,mx=[`#3b82f6`,`#f59e0b`,`#10b981`,`#8b5cf6`,`#f43f5e`,`#06b6d4`,`#84cc16`,`#d946ef`],hx=e=>`color-mix(in srgb, var(--dg-text) ${e}%, var(--dg-bg))`,Poe={id:`soft`,label:`Soft`,fontFamily:fx,cssVars:{"--dg-edge":hx(38)}},gx=C(x),_x=[ox,sx,cx,ux,lx,dx,Poe,{id:`pastel`,label:`Pastel`,fontFamily:fx,palette:mx,cssVars:{"--dg-edge":hx(38)}},{id:`cards`,label:`Cards`,fontFamily:fx,palette:mx,cssVars:{"--dg-edge":hx(40)}},{id:`layered`,label:`Layered`,fontFamily:fx,grid:`none`,cssVars:{"--dg-canvas-bg":`color-mix(in srgb, #3b82f6 3%, var(--dg-bg))`,"--dg-edge":`color-mix(in srgb, #64748b 75%, var(--dg-text))`}},{id:`neon`,label:`Neon`,fontFamily:`'diagc Chakra Petch', 'Chakra Petch', system-ui, sans-serif`,palette:[`#00e5ff`,`#ff2bd6`,`#f2ff3d`,`#5cff7a`,`#ff9d2b`,`#b18cff`,`#ff4d6d`],grid:`lines`,cssVars:{...gx,"--dg-canvas-bg":`#07080f`,"--dg-bg":`#07080f`,"--dg-surface":`#0b0d17`,"--dg-node-fill":`#0b0d17`,"--dg-node-stroke":`#00e5ff`,"--dg-group-fill":`rgba(255, 43, 214, 0.035)`,"--dg-group-stroke":`#ff2bd6`,"--dg-text":`#e8f9ff`,"--dg-text-muted":`#86a4bb`,"--dg-border":`#1f2a3d`,"--dg-edge":`#22d3ee`,"--dg-edge-label-bg":`#07080f`,"--dg-accent":`#00e5ff`,"--dg-badge-bg":`#ff2bd6`,"--dg-badge-text":`#07080f`,"--dg-ink":`#e8f9ff`,"--dg-table-header-bg":`#111a2e`,"--dg-table-header-text":`#e8f9ff`,"--dg-table-border":`#22d3ee`,"--dg-table-row-text":`#c6e6f2`,"--dg-table-type-text":`#86a4bb`,"--dg-table-pk":`#f2ff3d`,"--dg-table-fk":`#ff79e6`}},{id:`terminal`,label:`Terminal`,fontFamily:px,palette:[`#39ff88`,`#5ef2ff`,`#ffb000`,`#ff79c6`,`#bd93f9`,`#ff5555`,`#f1fa8c`],grid:`none`,cssVars:{...gx,"--dg-canvas-bg":`#050805`,"--dg-bg":`#050805`,"--dg-surface":`#0a110b`,"--dg-node-fill":`#0a110b`,"--dg-node-stroke":`#39ff88`,"--dg-group-fill":`rgba(255, 176, 0, 0.03)`,"--dg-group-stroke":`#ffb000`,"--dg-text":`#d4ffe2`,"--dg-text-muted":`#6fbf8a`,"--dg-border":`#1d3a24`,"--dg-edge":`#2fd16f`,"--dg-edge-label-bg":`#050805`,"--dg-accent":`#39ff88`,"--dg-badge-bg":`#39ff88`,"--dg-badge-text":`#050805`,"--dg-ink":`#d4ffe2`,"--dg-table-header-bg":`#0f2414`,"--dg-table-header-text":`#d4ffe2`,"--dg-table-border":`#2fd16f`,"--dg-table-row-text":`#b9f5cb`,"--dg-table-type-text":`#6fbf8a`,"--dg-table-pk":`#ffb000`,"--dg-table-fk":`#5ef2ff`}},{id:`ascii`,label:`ASCII`,fontFamily:px,palette:mx,grid:`none`,edges:{corner:0,dash:{solid:`5 3`,dashed:`5 11`},openArrow:!0},cssVars:{"--dg-canvas-bg":`var(--dg-bg)`,"--dg-edge":hx(62),...Noe()}},{id:`dos`,label:`DOS`,fontFamily:px,palette:[`#aaaaaa`,`#00aaaa`,`#00aa00`,`#55ffff`,`#ffff55`,`#55ff55`,`#ff55ff`,`#ff5555`],grid:`none`,edges:{corner:0},cssVars:{...gx,"--dg-canvas-bg":`#0000aa`,"--dg-bg":`#0000aa`,"--dg-surface":`#0000aa`,"--dg-node-fill":`#aaaaaa`,"--dg-node-stroke":`#ffffff`,"--dg-group-fill":`transparent`,"--dg-group-stroke":`#ffffff`,"--dg-text":`#ffffff`,"--dg-text-muted":`#55ffff`,"--dg-border":`#5555ff`,"--dg-edge":`#ffffff`,"--dg-edge-label-bg":`#0000aa`,"--dg-accent":`#ffff55`,"--dg-badge-bg":`#ffff55`,"--dg-badge-text":`#000000`,"--dg-ink":`#ffffff`,"--dg-table-header-bg":`#00aaaa`,"--dg-table-header-text":`#000000`,"--dg-table-border":`#ffffff`,"--dg-table-row-text":`#000000`,"--dg-table-type-text":`#0000aa`,"--dg-table-pk":`#000000`,"--dg-table-fk":`#0000aa`}}],vx=e=>_x.find(t=>t.id===e)??ox,yx=e=>_x.some(t=>t.id===e);function bx(e){return[`dg-canvas`,e.chromeless&&`dg-no-chrome`,e.editing&&`dg-mode-edit`,!e.editing&&e.altHeld&&`dg-alt-move`,e.dragging&&`dg-dragging`,e.preset.id!==`clean`&&`dg-style-${e.preset.id}`,e.preset.rough!==void 0&&`dg-style-rough`,e.preset.fontFamily!==void 0&&`dg-style-font`,e.notationClass,e.penActive&&`dg-tool-pen`,e.eraserActive&&`dg-tool-eraser`,e.laserOn&&`dg-tool-laser`].filter(e=>typeof e==`string`).join(` `)}function xx(e){return{width:`100%`,height:`100%`,"--dg-style-font":e.fontFamily,...e.cssVars??{}}}function Sx(e,t){return t===void 0?e.grid===`none`?null:e.grid===`lines`?{variant:Ah.Lines,gap:32}:{}:{gap:t,className:`dg-grid-on`}}var Cx=([,e])=>()=>e(e=>!e);function wx(e){let{dim:t,laser:n,drawings:r,legend:i,loops:a}=e;return[{key:`dim`,on:t[0],offered:!0,flip:Cx(t),className:`dg-focus-toggle${t[0]?``:` dg-focus-toggle-off`}`,title:t[0]?`Stop dimming unconnected on select`:`Dim unconnected on select`,label:t[0]?`Stop dimming unconnected on select`:`Dim unconnected on select`,glyph:`◎`},{key:`laser`,on:n[0],offered:!0,flip:Cx(n),className:`dg-laser-toggle${n[0]?` dg-laser-toggle-on`:``}`,title:n[0]?`Laser pointer off`:`Laser pointer`,label:`Laser pointer`,glyph:`◉`},{key:`drawings`,on:r[0],offered:e.drawingsOffered,flip:Cx(r),className:`dg-drawings-toggle${r[0]?``:` dg-drawings-toggle-off`}`,title:r[0]?`Hide drawings`:`Show drawings`,label:r[0]?`Hide drawings`:`Show drawings`,glyph:`✎`},{key:`legend`,on:i[0],offered:e.legendOffered,flip:Cx(i),className:`dg-legend-toggle-btn${i[0]?``:` dg-legend-toggle-btn-off`}`,title:i[0]?`Hide legend`:`Show legend`,label:i[0]?`Hide legend`:`Show legend`,glyph:`▤`},{key:`loops`,on:a[0],offered:e.loopsOffered,flip:()=>{a[0]&&e.clearLoopHighlight(),a[1](e=>!e)},className:`dg-loop-toggle${a[0]?``:` dg-loop-toggle-off`}`,title:a[0]?`Hide loop badges`:`Show loop badges`,label:a[0]?`Hide loop badges`:`Show loop badges`,glyph:`↻`}]}var Tx=(e,t)=>e.find(e=>e.key===t);function Foe(e){let t=t=>{let n=e.keyHints?.[t]??(t===`laser`&&e.builtinKeys!==!1?`L`:void 0);return n!==void 0&&n!==``?` (${n})`:``};return(0,D.jsxs)(sne,{children:[e.toggles.filter(e=>e.offered).map(e=>(0,D.jsx)(jh,{className:e.className,title:`${e.title}${t(e.key)}`,"aria-label":e.label,"aria-pressed":e.on,onClick:e.flip,children:e.glyph},e.key)),e.onToggleTheme!==void 0&&(0,D.jsx)(jh,{className:`dg-theme-toggle`,title:e.colorMode===`dark`?`Light theme`:`Dark theme`,"aria-label":e.colorMode===`dark`?`Switch to light theme`:`Switch to dark theme`,onClick:e.onToggleTheme,children:e.colorMode===`dark`?`☀`:`☾`})]})}var Ex=48,Dx=Ex/2,Ox=15,Ioe=`M ${Dx} ${Dx-Ox} A ${Ox} ${Ox} 0 1 1 ${Dx-Ox} ${Dx}`;function Loe({placement:e,rough:t,active:n,dimmed:r,onSelect:i}){let a=(0,_.useMemo)(()=>t===void 0?null:cv({x:Dx,y:Dx},Ox*2,{style:t,seed:rv(e.key)}),[e.key,t]),o=e.kind===`unknown`?`?`:e.kind,s=e.kind!==`unknown`&&e.direction!==`none`,c=`dg-loop-arrow-${e.key.replace(/[^a-zA-Z0-9_-]/g,`_`)}`;return(0,D.jsx)(`div`,{className:`dg-loop-badge${n?` active`:``}${r?` dimmed`:``}`,"data-kind":e.kind,role:`button`,"aria-pressed":n,title:`Highlight this loop`,onClick:e=>{e.stopPropagation(),i?.()},style:{position:`absolute`,transform:`translate(${e.x-Dx}px, ${e.y-Dx}px)`,pointerEvents:`auto`},children:(0,D.jsxs)(`svg`,{width:Ex,height:Ex,viewBox:`0 0 ${Ex} ${Ex}`,"aria-hidden":`true`,children:[s&&(0,D.jsx)(`defs`,{children:(0,D.jsx)(`marker`,{id:c,viewBox:`0 0 10 10`,refX:`5`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,D.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:`var(--dg-text-muted)`})})}),a===null?(0,D.jsx)(`circle`,{className:`dg-loop-badge-circle`,cx:Dx,cy:Dx,r:Ox}):(0,D.jsxs)(D.Fragment,{children:[a.fill===``?(0,D.jsx)(`circle`,{className:`dg-loop-badge-fill`,cx:Dx,cy:Dx,r:Ox}):(0,D.jsx)(`path`,{className:`dg-loop-badge-fill`,d:a.fill}),(0,D.jsx)(`path`,{className:`dg-loop-badge-circle`,d:a.stroke})]}),s&&(0,D.jsx)(`path`,{className:`dg-loop-badge-arc`,d:Ioe,markerEnd:`url(#${c})`,style:e.direction===`ccw`?{transform:`scale(-1,1)`,transformOrigin:`${Dx}px ${Dx}px`}:void 0}),(0,D.jsx)(`text`,{x:Dx,y:Dx,textAnchor:`middle`,dominantBaseline:`central`,children:o})]})})}function Roe({edges:e,rough:t,nodeFilter:n}){let{loops:r}=(0,_.useMemo)(()=>Qb(e),[e]),i=(0,_.useMemo)(()=>n==null?r:r.filter(e=>e.nodes.includes(n)),[r,n]),a=(0,_.useMemo)(()=>new Map(i.map(e=>[e.key,e])),[i]),o=(0,_.useContext)(Xh),s=Oh(),c=(0,_.useMemo)(()=>tx(s),[s]),l=(0,_.useMemo)(()=>s.filter(e=>e.data.state!==`expanded`).map(e=>c.get(e.id)).filter(e=>e!==void 0),[s,c]);return(0,D.jsx)(Dh,{children:(0,D.jsx)(`div`,{className:`dg-loop-layer`,children:(0,_.useMemo)(()=>koe(i,c,{obstacles:l,labelRadius:Dx,minLabelGap:56}),[i,c,l]).map(e=>{let n=a.get(e.key);return(0,D.jsx)(Loe,{placement:e,rough:t,active:o.activeKey===e.key,dimmed:o.active&&o.activeKey!==e.key,onSelect:n===void 0?void 0:()=>o.toggle(e.key,n.nodes,n.edgeIds)},e.key)})})})}var zoe=4;function Boe({model:e,plane:t}){let n=Oh(),r=(0,_.useMemo)(()=>tx(n),[n]);return(0,D.jsx)(Dh,{children:(0,D.jsx)(`svg`,{className:`dg-git-lanes`,"aria-hidden":`true`,children:(0,_.useMemo)(()=>{let n=oi(e,t),i=ci(e,t),{MARGIN:a,LABEL_W:o}=ri,s=[];for(let t of n.lanes){let c=Ct(n,t.id),l=r.get(t.id);if(c===void 0||l===void 0||xt(e,c.id))continue;let u=r.get(c.id);if(u===void 0)continue;let d=u.x+u.width+zoe,f=l.x+l.width-a-o;f<=d||s.push({id:t.id,x1:d,x2:f,y:u.y+u.height/2,color:i.get(t.id)})}return s},[e,t,r]).map(e=>(0,D.jsx)(`line`,{className:`dg-git-tail`,x1:e.x1,y1:e.y,x2:e.x2,y2:e.y,stroke:e.color??`var(--dg-edge)`},e.id))})})}var Voe=8,Hoe=[`th`,`st`,`nd`,`rd`];function Uoe(e){let t=e%100;return`${e}${t>=11&&t<=13?`th`:Hoe[e%10]??`th`}`}var Woe=(e,t)=>e===0?t>1?`Decisions`:`Decision`:`${Uoe(e)} order`;function Goe(e,t,n){let r=n===`DOWN`||n===`UP`,i=new Map,a=1/0,o=-1/0;for(let[n,s]of t){let t=e.get(n);if(t===void 0)continue;let c=r?t.y:t.x,l=r?t.y+t.height:t.x+t.width,u=i.get(s);i.set(s,u===void 0?{lo:c,hi:l}:{lo:Math.min(u.lo,c),hi:Math.max(u.hi,l)}),a=Math.min(a,r?t.x:t.y),o=Math.max(o,r?t.x+t.width:t.y+t.height)}let s=a-20-(r?96:28),c=o+20-s;return[...i.entries()].sort(([e],[t])=>e-t).map(([e,{lo:t,hi:n}])=>{let i=t-20,a=n-t+40,o=r?{x:s,y:i,width:c,height:a}:{x:i,y:s,width:a,height:c};return{order:e,...o,header:{x:o.x+Voe,y:o.y+Voe}}})}function Koe({model:e,direction:t}){let n=Oh(),r=(0,_.useMemo)(()=>an(e).orders,[e]),i=(0,_.useMemo)(()=>e.nodes.filter(e=>e.type===`so-decision`&&r.get(e.id)===0).length,[e,r]),a=(0,_.useMemo)(()=>Goe(tx(n),r,t),[n,r,t]);return a.length===0?null:(0,D.jsx)(Dh,{children:(0,D.jsx)(`svg`,{className:`dg-order-bands`,"aria-hidden":`true`,children:a.map((e,t)=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`rect`,{className:`dg-order-band${t%2==1?` dg-order-band-alt`:``}`,x:e.x,y:e.y,width:e.width,height:e.height,rx:6}),(0,D.jsx)(`text`,{className:`dg-order-band-header`,x:e.header.x,y:e.header.y,dominantBaseline:`hanging`,children:Woe(e.order,i)})]},e.order))})})}var qoe=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Joe=3,kx=e=>((e+4)%7+7)%7,Ax=e=>Number(Gt(e).slice(0,4)),jx=e=>Number(Gt(e).slice(5,7))-1,Mx=e=>Date.parse(`${e}T00:00:00Z`)/864e5;function Yoe(e){let t=e+(3-(kx(e)+6)%7),n=Ax(t),r=Mx(`${String(n)}-01-04`),i=r-(kx(r)+6)%7;return Math.floor((t-i)/7)+1}var Nx=e=>{let t=Ax(e),n=jx(e);return Mx(n===11?`${String(t+1)}-01-01`:`${String(t)}-${String(n+2).padStart(2,`0`)}-01`)};function Px(e,t){let n=e.start-7,r=e.end+8,i=e=>fr(e,t),a=[];for(let e=n;e<r;e=Nx(e)){let t=Math.min(Nx(e),r);a.push({x:i(e),width:i(t)-i(e),label:`${qoe[jx(e)]} ${String(Ax(e))}`})}let o=[];for(let e=n;e<r;){let t=e+((8-kx(e))%7||7),n=Math.min(t,r),a=n-e;o.push({x:i(e),width:a*lr.DAY,label:a>=Joe?`W${String(Yoe(e)).padStart(2,`0`)}`:``}),e=n}return{x0:i(n),x1:i(r),months:a,weeks:o}}function Fx(e=new Date){let t=e=>String(e).padStart(2,`0`);return`${String(e.getFullYear())}-${t(e.getMonth()+1)}-${t(e.getDate())}`}var Ix=lr.HEADER_H/2;function Lx({model:e,plane:t,today:n}){let r=Oh(),i=(0,_.useMemo)(()=>tx(r),[r]),a=dr(e,t),o=(0,_.useMemo)(()=>a.range!==void 0&&a.origin!==void 0?Px(a.range,a.origin):void 0,[a]);if(o===void 0||a.origin===void 0||a.range===void 0)return null;let{DAY:s,HEADER_H:c,PAD:l}=lr,u=a.origin,d=0;for(let e of i.values())d=Math.max(d,e.y+e.height);d+=l;let f=new Map(e.nodes.map(e=>[e.id,e])),p=a.events.filter(e=>!a.parent.has(e)&&zt(f.get(e))),m=n==null?void 0:Wt(n),h=m!==void 0&&m>=a.range.start-7&&m<a.range.end+8?fr(m,u)+s/2:void 0;return(0,D.jsx)(Dh,{children:(0,D.jsxs)(`svg`,{className:`dg-time-axis`,"aria-hidden":`true`,children:[(0,D.jsx)(`rect`,{className:`dg-time-axis-frame`,x:o.x0,y:-c,width:o.x1-o.x0,height:c}),o.months.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`line`,{className:`dg-time-axis-tick`,x1:e.x,y1:-c,x2:e.x,y2:0}),(0,D.jsx)(`text`,{className:`dg-time-axis-month`,x:e.x+6,y:-c+Ix/2,dominantBaseline:`middle`,children:e.label})]},e.x)),o.weeks.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`line`,{className:`dg-time-axis-tick`,x1:e.x,y1:-Ix,x2:e.x,y2:0}),(0,D.jsx)(`line`,{className:`dg-time-axis-grid`,x1:e.x,y1:0,x2:e.x,y2:d}),e.label!==``&&(0,D.jsx)(`text`,{className:`dg-time-axis-week`,x:e.x+4,y:-Ix/2,dominantBaseline:`middle`,children:e.label})]},e.x)),p.map(e=>{let t=qt(f.get(e));if(t===void 0)return null;let n=fr(t,u)+s/2;return(0,D.jsx)(`line`,{className:`dg-time-axis-event`,x1:n,y1:0,x2:n,y2:d},e)}),h!==void 0&&(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`line`,{className:`dg-time-axis-today`,x1:h,y1:-Ix,x2:h,y2:d}),(0,D.jsx)(`text`,{className:`dg-time-axis-today-label`,x:h+4,y:-Ix/2,dominantBaseline:`middle`,children:`today`})]})]})})}function Rx(e){return e.placed?(0,D.jsxs)(D.Fragment,{children:[e.loopEdges!==null&&(0,D.jsx)(Roe,{edges:e.loopEdges,rough:e.rough,nodeFilter:e.loopNodeFilter}),e.overlay===`git-lanes`&&(0,D.jsx)(Boe,{model:e.model,plane:e.plane}),e.overlay===`order-bands`&&(0,D.jsx)(Koe,{model:e.model,direction:e.flowDirection}),e.overlay===`time-axis`&&(0,D.jsx)(Lx,{model:e.model,plane:e.plane,today:e.today})]}):null}var zx=()=>typeof document.elementsFromPoint==`function`?document.elementsFromPoint.bind(document):void 0;function Bx(e,t=zx()){if(t===void 0)return null;let{target:n}=e;if(!(n instanceof Element)||n.closest(`.react-flow__edge`)===null)return null;for(let n of t(e.clientX,e.clientY)){if(!(n instanceof HTMLElement)||n.closest(`.react-flow__node`)===null)continue;let e=n.closest(`button, a`);if(e instanceof HTMLElement)return e}return null}function Vx(e){let t=Bx(e);return t===null?!1:(e.stopPropagation(),e.preventDefault(),t.click(),!0)}var Hx=(e,t)=>e.map(e=>e.selected===!0==(e.id===t)?e:{...e,selected:e.id===t}),Ux=e=>e.map(e=>e.selected===!0?{...e,selected:!1}:e),Wx=(e,t)=>e.map(e=>{let n=e.data.dropTarget===!0,r=e.id===t;return n===r?e:{...e,data:{...e.data,dropTarget:r}}}),Gx=500,Kx=40;function qx(){let e=(0,_.useRef)(null),t=(0,_.useRef)(null),n=(e,t)=>e!==null&&Date.now()-e.at<Gx&&Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY)<Kx,r=(e,t,n)=>{e.current={id:t,clientX:n.clientX,clientY:n.clientY,at:Date.now()}};return{recordNodeClick:(t,n)=>r(e,t,n),clearNodeClick:()=>{e.current=null},consumeNodeDrill:(t,r,i)=>{let a=e.current;return a!==null&&a.id===t&&i>=2&&n(a,r)?(e.current=null,!0):!1},takePaneNodeDrill:(t,r)=>{let i=e.current;return i!==null&&r>=2&&n(i,t)?(e.current=null,i.id):null},recordEdgeClick:(e,n)=>r(t,e,n),clearEdgeClick:()=>{t.current=null},consumeEdgeAdd:(e,r)=>{let i=t.current;return i!==null&&i.id===e&&n(i,r)?(t.current=null,!0):!1},takePaneEdgeAdd:e=>{let r=t.current;return r!==null&&n(r,e)?(t.current=null,r.id):null},clearAll:()=>{e.current=null,t.current=null}}}function Jx(e){let{props:t,editing:n,edit:r,reactFlow:i,compiled:a,enterNode:o,setLabelEdit:s}=e,{selectOnAppearRef:c,setFixedSideRelation:l,setAddLabelAt:u,setSelectedNode:d,loopHighlight:f}=e,p=(0,_.useRef)(null),m=qx(),h=(e,t)=>{let n=i.screenToFlowPosition({x:t.clientX,y:t.clientY});u({edgeId:e,x:n.x,y:n.y})},g=(0,_.useRef)(t.onMultiSelect);g.current=t.onMultiSelect;let v=(0,_.useRef)([]),y=(0,_.useCallback)(({nodes:e})=>{let t=e.map(e=>e.id),n=v.current;t.length===n.length&&t.every((e,t)=>e===n[t])||(v.current=t,c.current=null,g.current?.(t))},[]);return{onNodeClick:(r,i)=>{if(l(null),m.clearEdgeClick(),i.type===`note`){m.clearNodeClick(),Yx(e,i);return}let s=a.externals?.get(i.id);if(s!==void 0){m.clearNodeClick(),o(s);return}if(!n&&(r.ctrlKey||r.metaKey)&&t.onCompareSelect!==void 0){m.clearNodeClick(),t.onCompareSelect(i.id);return}d(i.id),t.onSelect?.({kind:`node`,id:i.id}),n||r.shiftKey?m.clearNodeClick():m.consumeNodeDrill(i.id,r,r.detail)?o(i.id):m.recordNodeClick(i.id,r)},onNodeDoubleClick:(e,t)=>{n&&t.type!==`note`&&s({kind:`node`,id:t.id})},onReconnectStart:(e,t,n)=>{p.current=n},onReconnect:(t,n)=>Xx(e,p.current,t,n),onReconnectEnd:()=>{p.current=null},onConnect:e=>{e.source!==null&&e.target!==null&&r?.onConnect?.(e.source,e.target,e.sourceHandle,e.targetHandle)},onEdgeClick:(e,r)=>{let i=a.edges.find(e=>e.id===r.id),o=i===void 0?void 0:Gn(i)?.id;l(n&&o!==void 0?o:null),d(null),m.clearNodeClick(),t.onSelect?.({kind:`edge`,id:r.id,constituentIds:i?.constituents.map(e=>e.id)}),n&&o!==void 0?m.consumeEdgeAdd(r.id,e)?h(r.id,e):m.recordEdgeClick(r.id,e):m.clearEdgeClick()},onPaneClick:r=>{if(n){let e=m.takePaneEdgeAdd(r);if(e!==null){h(e,r);return}}let i=n?null:m.takePaneNodeDrill(r,r.detail);if(i!==null){o(i);return}r.detail===2?Zx(e,r):(l(null),m.clearAll(),d(null),t.onSelect?.(null),f.clear())},deleteKeyCode:n&&r?.onDeleteSelection!==void 0?[`Backspace`,`Delete`]:null,onDelete:t=>Qx(e,t),onSelectionChange:y}}function Yx(e,t){let{props:n,editing:r,compiled:i,setRfNodes:a,setFixedSideRelation:o,setSelectedNode:s}=e,c=t.data.target;if(je(c)){s(c.node),a(e=>Hx(e,c.node)),n.onSelect?.({kind:`node`,id:c.node});return}let l=i.edges.find(e=>Gn(e)?.id===c.relation);l!==void 0&&(r&&o(c.relation),s(null),a(Ux),n.onSelect?.({kind:`edge`,id:l.id,constituentIds:[c.relation]}))}function Xx(e,t,n,r){let{editing:i,edit:a,compiled:o}=e;if(!i||r.source===null||r.target===null)return;let s=o.edges.find(e=>e.id===n.id),c=s===void 0?void 0:Gn(s);if(c===void 0)return;let l=Mre(t,{source:r.source,target:r.target,sourceHandle:r.sourceHandle,targetHandle:r.targetHandle},c);a?.onReconnect?.(c.id,r.source,r.target,l)}function Zx(e,t){let{editing:n,edit:r,reactFlow:i,setLabelEdit:a}=e;if(n&&r?.onCreateAt!==void 0){let e=r.onCreateAt(i.screenToFlowPosition({x:t.clientX,y:t.clientY}));typeof e==`string`&&a({kind:`node`,id:e})}else i.fitView({padding:.1,duration:500})}function Qx(e,{nodes:t,edges:n}){let r=t.map(e=>e.id),i=n.filter(e=>e.selected===!0).flatMap(t=>e.compiled.edges.find(e=>e.id===t.id)?.constituents.map(e=>e.id)??[]);(r.length>0||i.length>0)&&e.edit?.onDeleteSelection?.({nodeIds:r,relationIds:i})}var $x=e=>()=>e.offered?(e.flip(),!0):!1;function eS(e){let{reactFlow:t,toggles:n}=e,{canArrange:r,selectedIds:i,alignSelection:a,distributeSelection:o}=e.arrange,s={toggleLaser:$x(Tx(n,`laser`)),toggleDim:$x(Tx(n,`dim`)),toggleLegend:$x(Tx(n,`legend`)),toggleDrawings:$x(Tx(n,`drawings`)),toggleLoops:$x(Tx(n,`loops`)),zoomIn:()=>(t.zoomIn(),!0),zoomOut:()=>(t.zoomOut(),!0),fitView:()=>{let n=e.layoutApiRef?.current;return n==null?t.fitView():n.fitView(),!0},align:e=>!r||i.length<2?!1:(a(e),!0),distribute:e=>!r||i.length<3?!1:(o(e),!0)};return(0,_.useEffect)(()=>{let t=e.canvasCommandsRef;if(t!==void 0)return t.current=s,()=>{t.current=null}}),s}var tS=new Map,nS=.5;function rS(e,t,n,r=()=>!1){let i,a,o=t=>(i??e).get(t),s=(t,n)=>{i??=new Map(e),i.set(t,n)},c=e=>{if(e.children.forEach(c),e.state!==`expanded`||r(e))return;let t=o(e.id);if(t===void 0)return;let i=e.children.map(e=>o(e.id)).filter(e=>e!==void 0);if(i.length===0)return;let l=n(e),u=Math.min(...i.map(e=>e.x))-l.left,d=Math.min(...i.map(e=>e.y))-l.top,f=u<-.5?u:0,p=d<-.5?d:0;if(f!==0||p!==0){for(let t of e.children){let e=o(t.id);e!==void 0&&s(t.id,{...e,x:e.x-f,y:e.y-p})}(a??=new Map).set(e.id,{dx:f,dy:p})}let m=(e,t)=>t>e+nS?t:e,h=m(t.width-f,Math.max(...i.map(e=>e.x+e.width))-f+l.right),g=m(t.height-p,Math.max(...i.map(e=>e.y+e.height))-p+l.bottom);(f!==0||p!==0||h!==t.width||g!==t.height)&&s(e.id,{...t,x:t.x+f,y:t.y+p,width:h,height:g})};return t.forEach(c),{geometry:i??e,shifts:a??tS}}function iS(e,t,n,r){return{x:e.x+(t.x-n.x)-(r?.dx??0),y:e.y+(t.y-n.y)-(r?.dy??0)}}var aS={x:0,y:0};function oS(e,t,{bases:n,shifts:r},i=()=>!1){let a=new Map(t.map(e=>[e.id,e])),o=e=>{let t=e===void 0?void 0:a.get(e);if(t===void 0)return aS;let n=o(t.parentId);return{x:n.x+t.position.x,y:n.y+t.position.y}},s={};for(let[t,c]of Object.entries(e)){let e=a.get(t)?.parentId,l=o(e),u=iS(c,l,(e===void 0?void 0:n.get(e))??l,r.get(t));s[t]=e!==void 0&&i(e)?{x:Math.max(0,u.x),y:Math.max(0,u.y)}:u}return s}function sS(e){let{editing:t,edit:n,rfNodesRef:r,containerBasesRef:i,containerShiftsRef:a,arrangedRef:o,setViewPositions:s}=e;return(0,_.useCallback)(e=>{if(Object.keys(e).length===0)return;let c=e=>r.current.find(t=>t.id===e)?.data?.typeId,l=oS(e,r.current,{bases:i.current,shifts:a.current},e=>fe(c(e))),u=o.current,d=Object.fromEntries(Object.entries(l).map(([e,t])=>{let n=u?.get(e);return[e,n===void 0?{dx:0,dy:0}:{dx:t.x-n.x,dy:t.y-n.y}]}));if(t)if(n?.onNodesMoved!==void 0)n.onNodesMoved(l,d);else for(let[e,t]of Object.entries(l))n?.onNodeMoved?.(e,t);else s(e=>({...e,...l}))},[t,n])}function cS(e,t,n){return t.node?.alwaysExpanded?.(e)===!0||e.type!==void 0&&n.resolve(e.type).alwaysExpanded===!0}function lS(e){let t=(0,_.useMemo)(()=>ua(e.notation),[e.notation]),n=(0,_.useMemo)(()=>e.typeRegistry??Or(t.typeStyles),[e.typeRegistry,t]);return{profile:t,typeRegistry:n,kindRegistry:(0,_.useMemo)(()=>e.kindRegistry??kr(t.kindStyles),[e.kindRegistry,t]),isAlwaysExpanded:(0,_.useCallback)(r=>{let i=e.model.nodes.find(e=>e.id===r);return i!==void 0&&cS(i,t,n)},[e.model.nodes,t,n]),nodeColors:(0,_.useMemo)(()=>t.node?.colorOf?.(e.model,e.plane),[t,e.model,e.plane]),nodeChips:(0,_.useMemo)(()=>t.node?.chips?.(e.model,e.plane),[t,e.model,e.plane])}}function uS(e){let{props:t,profile:n,typeRegistry:r,focus:i,drillRoot:a,visibleRef:o}=e,s=(0,_.useMemo)(()=>{let e=t.model.nodes.filter(e=>cS(e,n,r));if(e.length===0)return t.pins;let i={...t.pins??{}};for(let t of e)i[t.id]=`expanded`;return i},[n,t.pins,t.model.nodes,r]),c=(0,_.useMemo)(()=>{let e=ree(t.model,{focus:a===void 0?i:void 0,pins:s,activeLayers:t.activeLayers,plane:t.plane,root:a}),r=n.edge?.hidden;return r===void 0||!e.edges.some(e=>r(e.kind))?e:{...e,edges:e.edges.filter(e=>!r(e.kind))}},[t.model,t.plane,i,a,s,t.activeLayers,n]),l=(0,_.useRef)(c);return l.current=c,(0,_.useEffect)(()=>{let e=[],t=n=>{e.push(n.id),n.children.forEach(t)};c.roots.forEach(t),o.current=e},[c]),{compiled:c,compiledRef:l}}function dS(e,t,n=[]){if(!e.has(t))return[];let r=new Set(n),i=[t],a=new Set([t]),o=t;for(;;){let t=e.get(o)??[],n=t.find(e=>r.has(e))??t[0];if(n===void 0||a.has(n))break;i.unshift(n),a.add(n),o=n}return i}function fS(e,t){let n=e.indexOf(t);return n<0?[]:e.slice(0,n+1)}function pS(e,t,n){let r=ut(e,t),i=new Set;for(let e of n){let t=[...r.parentsOf.get(e)??[]];for(;t.length>0;){let e=t.pop();e===void 0||i.has(e)||(i.add(e),t.push(...r.parentsOf.get(e)??[]))}}return[...i]}function mS(e,t){let n=new Set(t.nodes.map(e=>e.id)),r=e.findIndex(e=>!n.has(e));return r<0?e:e.slice(0,r)}function hS(e,t){let n=t.next;return e.seen.modelId===n.modelId?e.seen.plane===n.plane?e.seen.model===n.model?e.seen.enteredPathProp===n.enteredPathProp?{seen:n,transition:`none`}:{seen:n,transition:`entered-path`}:{seen:n,transition:`model-edit`}:{seen:n,transition:`plane-switch`}:{seen:n,transition:`model-switch`}}function Xoe(e){let[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(()=>e.enteredPathProp===void 0?[]:mS(e.enteredPathProp,e.model)),a=(0,_.useRef)([]);a.current=r;let{onEnteredPathChange:o}=e;(0,_.useEffect)(()=>{o?.(r)},[r,o]);let s=(0,_.useRef)(null),c=()=>({modelId:e.model.id,model:e.model,plane:e.plane,enteredPathProp:e.enteredPathProp}),[l,u]=(0,_.useReducer)(hS,void 0,()=>({seen:c(),transition:`none`})),d=r;if(l.seen.modelId===e.model.id?l.seen.plane===e.plane?l.seen.model!==e.model&&(u({type:`sync`,next:c()}),i(t=>mS(t,e.model)),d=mS(r,e.model)):(u({type:`sync`,next:c()}),n(pS(e.model,e.plane,e.visibleRef.current)),i([]),d=[],e.onPlaneSwitch()):(u({type:`sync`,next:c()}),e.visibleRef.current=[],n([]),i([]),d=[],s.current=`jump`),l.seen.enteredPathProp!==e.enteredPathProp&&(u({type:`sync`,next:c()}),e.enteredPathProp!==void 0)){let t=mS(e.enteredPathProp,e.model);(t.length!==d.length||t.some((e,t)=>e!==d[t]))&&(s.current??=`glide`,i(t),n([]))}let f=(0,_.useMemo)(()=>ut(e.model,e.plane),[e.model,e.plane]),p=r.length>0?r[r.length-1]:void 0,{isAlwaysExpanded:m}=e;return{enteredPath:r,drillRoot:p,focus:t,enterNode:(0,_.useCallback)(e=>{if(m(e)||(f.childrenOf.get(e)?.length??0)===0)return;let t=dS(f.parentsOf,e,a.current);t.length!==0&&(s.current=`glide`,i(t),n([]))},[f,m]),exitTo:e=>{let t=e===null?[]:fS(r,e);s.current=`glide`,i(t),n([])},pendingRootFitRef:s}}var gS=`note:`,_S=e=>e.startsWith(gS);function vS(e){let{abs:t,obstacles:n}=yS(e.compiled.roots,e.geometry);for(let t of e.compiled.edges){let r=Gn(t),i=r===void 0?void 0:e.badgeSpots.get(r.id);i!==void 0&&n.push(...ky(i.line))}let r=[...Zoe(e.compiled.roots,t,e.typeRegistry),...Qoe(e.compiled.edges,t,e.badgeSpots,e.nameOf)],i=[];for(let a of r){let r=bS(a,e,{abs:t,obstacles:n});r!==void 0&&i.push(r)}return i}function yS(e,t){let n=new Map,r=[],i=(e,a,o)=>{let s=t.get(e.id);if(s===void 0)return;let c={x:s.x+a,y:s.y+o,width:s.width,height:s.height};n.set(e.id,c),r.push(...Gie([{rect:c,kind:e.state===`expanded`?`group`:`box`}])),e.children.forEach(e=>i(e,s.x+a,s.y+o))};return e.forEach(e=>i(e,0,0)),{abs:n,obstacles:r}}function Zoe(e,t,n){let r=e=>e.state===`expanded`?`group`:(e.node.type===void 0?void 0:n.resolve(e.node.type).shape)===`ellipse`?`ellipse`:`box`,i=[],a=(e,n)=>{let o=t.get(e.id);o!==void 0&&(e.external===void 0&&Ne(e.node)&&i.push({target:{node:e.id},name:e.node.name,threats:e.node.threats??[],comments:e.node.comments??[],links:e.node.links??[],badge:Wie(o,r(e)),element:o,parentId:n}),e.children.forEach(t=>a(t,e.id)))};return e.forEach(e=>a(e)),i}function Qoe(e,t,n,r){let i=[];for(let a of e){let e=Gn(a);if(e===void 0||!Ne(e))continue;let o=t.get(a.from),s=t.get(a.to);if(o===void 0||s===void 0)continue;let c=n.get(e.id),l=c?.at??{x:(o.x+o.width/2+s.x+s.width/2)/2,y:(o.y+o.height/2+s.y+s.height/2)/2},u=e.label!==void 0&&e.label!==``?` (${e.label})`:``;i.push({target:{relation:e.id},name:`${r.get(e.from)??e.from} → ${r.get(e.to)??e.to}${u}`,threats:e.threats??[],comments:e.comments??[],links:[],badge:l,element:null,away:c?.away})}return i}function bS(e,t,n){let{target:r,name:i,threats:a,comments:o,links:s,badge:c,element:l,parentId:u,away:d}=e,f=Me(r);if(!t.open.has(f))return;let{editing:p}=t,m=p&&(a.length>0||t.offersThreats),h={width:220,height:iae({name:i,threats:a,comments:o,links:s},m)},g=t.placements?.[f],_=g!==void 0&&(g.dx!==0||g.dy!==0)?{x:c.x+g.dx,y:c.y+g.dy}:Kie({badge:c,element:l,size:h,away:d},n.obstacles);n.obstacles.push({..._,...h});let v=(u===void 0?void 0:n.abs.get(u))??{x:0,y:0},y={target:r,name:i,threats:a,comments:o,links:s,anchor:{x:c.x-v.x,y:c.y-v.y},badge:c,editing:p,editingId:t.editingRow!==null&&t.editingRow.key===f?t.editingRow.id:void 0,onAddThreat:m?t.onAddThreat:void 0,onRetitleThreat:p?t.onRetitleThreat:void 0,onSetThreatStatus:p?t.onSetThreatStatus:void 0,onEditThreatText:p?t.onEditThreatText:void 0,onOpenLink:t.onOpenLink,onEndEdit:t.onEndEdit};return gae({id:gS+f,position:{x:_.x-v.x,y:_.y-v.y},data:y,parentId:u,draggable:p})}var $oe=`application/x-dg-library-entry`,xS=[`framework`,`language`,`tool`],SS=e=>[...e??[]].filter(e=>e.type.startsWith(`image/`)),ese=e=>document.elementFromPoint(e.clientX,e.clientY)?.closest(`.react-flow__node`)?.getAttribute(`data-id`)??void 0;function tse(e){let{editing:t,edit:n,reactFlow:r,wrapperRef:i}=e,a=n?.onImageFiles;return(0,_.useEffect)(()=>{if(!t||a===void 0)return;let e=e=>{let t=e.target?.tagName;if(t===`INPUT`||t===`TEXTAREA`||t===`SELECT`)return;let n=SS(e.clipboardData?.files);if(n.length===0)return;e.preventDefault();let o=i.current?.getBoundingClientRect(),s=o===void 0?void 0:r.screenToFlowPosition({x:o.left+o.width/2,y:o.top+o.height/2});a(n,s)};return window.addEventListener(`paste`,e),()=>window.removeEventListener(`paste`,e)},[t,a,r]),{onDragOver:e=>{if(!t)return;let r=n?.onDropLibraryEntry!==void 0&&e.dataTransfer.types.includes(`application/x-dg-library-entry`);(n?.onImageFiles!==void 0||r)&&e.preventDefault()},onDrop:e=>{if(!t)return;let i=n?.onDropLibraryEntry!==void 0&&typeof e.dataTransfer?.getData==`function`?e.dataTransfer.getData($oe):``;if(i!==void 0&&i!==``){e.preventDefault();let t=ese(e),a=t!==void 0&&_S(t)?void 0:t;n?.onDropLibraryEntry?.(i,r.screenToFlowPosition({x:e.clientX,y:e.clientY}),a);return}if(n?.onImageFiles===void 0)return;e.preventDefault();let a=SS(e.dataTransfer?.files);a.length!==0&&n.onImageFiles(a,r.screenToFlowPosition({x:e.clientX,y:e.clientY}))}}}function nse(e){let{editing:t,edit:n,derivedNodes:r,setLabelEdit:i,setNoteEdit:a,setRfNodes:o,selectOnAppearRef:s}=e,c=n?.editLabelRequest,l=(0,_.useRef)(void 0);(0,_.useEffect)(()=>{!t||c===void 0||c.nonce===l.current||(l.current=c.nonce,i({kind:`node`,id:c.id}),r.some(e=>e.id===c.id)?o(e=>Hx(e,c.id)):s.current=c.id)},[c?.nonce]);let u=n?.editThreatRequest,d=(0,_.useRef)(void 0);(0,_.useEffect)(()=>{!t||u===void 0||u.nonce===d.current||(d.current=u.nonce,a({key:Me(u.target),id:u.id}))},[u?.nonce])}function rse(e,t){let n=new Map(Object.entries(t.nodes)),r=new Map;for(let t of e.containment)r.set(t.child,[...r.get(t.child)??[],t.parent]);let i=(e,t)=>{for(let a of r.get(e)??[])t.has(a)||(t.add(a),n.has(a)||n.set(a,`inside`),i(a,t))};for(let e of Object.keys(t.nodes))i(e,new Set([e]));for(let n of e.relations)if(t.relations[n.id]!==void 0)for(let e of[n.from,n.to])i(e,new Set([e]));return n}function ise(e,t){let n=e.map(e=>t.relations[e.id]);if(n.every(e=>e===void 0))return;let r=n[0];return n.every(e=>e===r)?r:`changed`}function CS(e,t){return t===void 0?e:e===void 0?`dg-diff-${t}`:`${e} dg-diff-${t}`}function wS(e){let{props:t,editing:n,edit:r,preset:i,compiled:a}=e,{profile:o,kindRegistry:s}=e.notation,{labelMoves:c,moveViewLabel:l}=e.moves,{placedGeometry:u,routing:d,routes:f,laidAt:p,labelSpots:m,flowDirection:h}=e.layout,[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)(null),x=(0,_.useMemo)(()=>{let e=o.edge?.colorOf;if(e===void 0)return;let n=new Map;for(let r of a.edges){let i=e(r,t.model,t.plane);i!==void 0&&n.set(r.id,i)}return n},[o,a,t.model,t.plane]),S=(0,_.useCallback)(()=>b(null),[]),C=(0,_.useMemo)(()=>xv(a.edges),[a]),w=(0,_.useMemo)(()=>uv(a.edges),[a]),T=(0,_.useMemo)(()=>({kindRegistry:s,editing:n,onAddEdgeLabel:r?.onAddEdgeLabel,onEditEdgeLabel:r?.onEditEdgeLabel,onMoveEdgeLabel:r?.onMoveEdgeLabel,onSetEdgeSide:r?.onSetEdgeSide,onAddThreat:r?.onAddThreat,fixedSideRelation:g,pendingAdd:y,onPendingAddConsumed:S,stylePreset:i.rough===void 0?void 0:i,edgeLook:i.edges,notation:t.notation,routing:d,routes:f,laidAt:p,labelSpots:m,labelMoves:c,onViewMoveEdgeLabel:!n&&t.onViewLabelMovesChange!==void 0?l:void 0,edgeColors:x,flowDirection:h,selfLoopIndex:C,parallelBow:w}),[s,n,r?.onAddEdgeLabel,r?.onEditEdgeLabel,r?.onMoveEdgeLabel,r?.onSetEdgeSide,r?.onAddThreat,g,y,S,i,t.notation,d,f,p,m,c,t.onViewLabelMovesChange,l,x,h,C,w]),{diffMarks:E}=t,ee=(0,_.useMemo)(()=>u===null?[]:a.edges.map(e=>{let t=hoe(e,T),r=Gn(e),i=E===void 0?void 0:ise(e.constituents,E);return Vy({id:e.id,source:e.from,target:e.to,data:i===void 0?t:{...t,diff:i},reconnectable:n&&r!==void 0,className:CS(void 0,i)})}),[a,u,T,n,E]),[te,ne]=(0,_.useState)(()=>new Set);return{rfEdges:(0,_.useMemo)(()=>te.size===0?ee:ee.map(e=>te.has(e.id)?{...e,selected:!0}:e),[ee,te]),onEdgesChange:e=>{let t=e.filter(e=>e.type===`select`);t.length!==0&&ne(e=>{let n=new Set(e);for(let e of t)e.selected?n.add(e.id):n.delete(e.id);return n.size===e.size&&[...n].every(t=>e.has(t))?e:n})},setFixedSideRelation:v,setAddLabelAt:b}}function TS(e,t,n,r){let i=r.fixed.has(e.id)&&r.profile.node?.draggableWhenFixed?.(e.node)!==!0;return{draggable:!i&&void 0,className:i&&r.editing?`nopan`:void 0,...ES(e,n,r),...DS(e,t,r)}}function ES(e,t,n){return t===void 0||n.profile.node?.dropTarget!==void 0&&n.profile.node?.canDrop?.(e.node)===!0?{}:n.profile.layout===void 0?{expandParent:!0}:n.editing?{extent:`parent`}:{}}function DS(e,t,n){return e.state===`expanded`?{style:{width:t.width,height:t.height},zIndex:-1}:e.node.type===`git-stage`?{style:{width:t.width,height:t.height},zIndex:-2}:(e.node.image!==void 0||e.node.shape!==void 0)&&e.state===`leaf`||e.state===`leaf`&&e.node.type!==void 0&&ase(e.node.type,n)?{style:{width:t.width,height:t.height}}:n.profile.layout===void 0&&!(n.profile.node?.typelessAsText===!0&&e.node.type===void 0)?{style:{minWidth:t.width}}:{}}function ase(e,t){return jr.has(t.typeRegistry.resolve(e).shape)||de(e)||Mr.has(e)||t.profile.node?.isLane?.(e)===!0}function ose(e){let{props:t,editing:n,edit:r,compiled:i,labelEdit:a,preset:o,setLabelEdit:s}=e,{profile:c,typeRegistry:l,nodeColors:u,nodeChips:d}=e.notation,{arrangedGeometry:f,fixed:p,regionSeparators:m}=e.layout,h=(0,_.useCallback)(()=>s(null),[s]),g=(0,_.useMemo)(()=>({metaKeys:e.metaKeys,hiddenCounts:e.hiddenCounts,typeRegistry:l,icons:e.icons,typeColors:t.model.typeColors,onOpenLink:t.onOpenLink,onToggleExpand:t.onToggleExpand,onEnterNode:e.enterNode,editing:n,labelEditingId:a?.kind===`node`?a.id:void 0,endLabelEdit:h,onRenameNode:r?.onRenameNode,onSetNodeRich:r?.onSetNodeRich,assetBase:t.assetBase,libraryBase:t.libraryBase,onResize:r?.onResize,onSetTableColumns:r?.onSetTableColumns,quickAdd:r?.quickAdd,onSetRole:r?.onSetRole,onAddThreat:r?.onAddThreat,stylePreset:o.rough===void 0?void 0:o,notation:t.notation,nodeColors:u,hues:e.hues,nodeChips:d,resizable:c.node?.resizable,regionSeparators:m}),[e.metaKeys,e.hiddenCounts,l,e.icons,t.model.typeColors,t.onOpenLink,t.onToggleExpand,e.enterNode,n,a,h,r?.onRenameNode,r?.onSetNodeRich,t.assetBase,t.libraryBase,r?.onResize,r?.onSetTableColumns,r?.quickAdd,r?.onSetRole,r?.onAddThreat,o,t.notation,u,e.hues,d,c,m]),v=(0,_.useMemo)(()=>{if(f===null)return[];let e=[],t={editing:n,profile:c,typeRegistry:l,fixed:p},r=(n,i)=>{let a=f.get(n.id);if(a===void 0)return;let o=Bb(n,g);e.push(By({id:n.id,position:{x:a.x,y:a.y},data:o,parentId:i,...TS(n,a,i,t)})),n.children.forEach(e=>r(e,n.id))};return i.roots.forEach(e=>r(e)),e},[i,f,g,n,l,c,p]),{diffMarks:y,model:b}=t,x=(0,_.useMemo)(()=>y===void 0?null:rse(b,y),[y,b]),{noteNodes:S}=e,C=(0,_.useMemo)(()=>{let e=x===null?v:v.map(e=>{let t=x.get(e.id);if(t===void 0||t===`inside`&&e.data.state===`expanded`)return e;let n=CS(e.className,t);return n===void 0?e:{...e,className:n}});return S.length===0?e:[...e,...S]},[v,S,x]),w=(0,_.useRef)(C);w.current=C;let[T,E]=(0,_.useState)([]),ee=(0,_.useRef)([]);return ee.current=T,{derivedNodes:v,allNodes:C,allNodesRef:w,rfNodes:T,setRfNodes:E,rfNodesRef:ee}}function OS(e){let t=e.filter(e=>e!==void 0);if(t.length===0)return;let n=Math.min(...t.map(e=>e.x)),r=Math.min(...t.map(e=>e.y));return{x:n,y:r,width:Math.max(...t.map(e=>e.x+e.width))-n,height:Math.max(...t.map(e=>e.y+e.height))-r}}var sse=`.react-flow__edge, .react-flow__edgelabel-renderer > *, .dg-loop-badge, .dg-image-caption, .dg-order-band-header, .dg-time-axis-frame`;function kS(e,t){if(e==null)return;let n=[];for(let r of e.querySelectorAll(sse)){let e=r.getBoundingClientRect();if(e.width===0&&e.height===0)continue;let i=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});n.push({x:i.x,y:i.y,width:a.x-i.x,height:a.y-i.y})}return OS(n)}function AS(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let n=document.implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}var jS=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function MS(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function NS(e,t){let n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace(`px`,``)):0}function PS(e){let t=NS(e,`border-left-width`),n=NS(e,`border-right-width`);return e.clientWidth+t+n}function FS(e){let t=NS(e,`border-top-width`),n=NS(e,`border-bottom-width`);return e.clientHeight+t+n}function IS(e,t={}){return{width:t.width||PS(e),height:t.height||FS(e)}}function LS(){let e,t;try{t=process}catch{}let n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var RS=16384;function zS(e){(e.width>RS||e.height>RS)&&(e.width>RS&&e.height>RS?e.width>e.height?(e.height*=RS/e.width,e.width=RS):(e.width*=RS/e.height,e.height=RS):e.width>RS?(e.height*=RS/e.width,e.width=RS):(e.width*=RS/e.height,e.height=RS))}function BS(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:`image/png`,t.quality?t.quality:1)}):new Promise(n=>{let r=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(`,`)[1]),i=r.length,a=new Uint8Array(i);for(let e=0;e<i;e+=1)a[e]=r.charCodeAt(e);n(new Blob([a],{type:t.type?t.type:`image/png`}))})}function VS(e){return new Promise((t,n)=>{let r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin=`anonymous`,r.decoding=`async`,r.src=e})}async function HS(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function US(e,t,n){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`),a=document.createElementNS(r,`foreignObject`);return i.setAttribute(`width`,`${t}`),i.setAttribute(`height`,`${n}`),i.setAttribute(`viewBox`,`0 0 ${t} ${n}`),a.setAttribute(`width`,`100%`),a.setAttribute(`height`,`100%`),a.setAttribute(`x`,`0`),a.setAttribute(`y`,`0`),a.setAttribute(`externalResourcesRequired`,`true`),i.appendChild(a),a.appendChild(e),HS(i)}var WS=(e,t)=>{if(e instanceof t)return!0;let n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||WS(n,t)};function GS(e){let t=e.getPropertyValue(`content`);return`${e.cssText} content: '${t.replace(/'|"/g,``)}';`}function KS(e){return MS(e).map(t=>`${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t)?` !important`:``};`).join(` `)}function cse(e,t,n){let r=`.${e}:${t}`,i=n.cssText?GS(n):KS(n);return document.createTextNode(`${r}{${i}}`)}function qS(e,t,n){let r=window.getComputedStyle(e,n),i=r.getPropertyValue(`content`);if(i===``||i===`none`)return;let a=jS();try{t.className=`${t.className} ${a}`}catch{return}let o=document.createElement(`style`);o.appendChild(cse(a,n,r)),t.appendChild(o)}function JS(e,t){qS(e,t,`:before`),qS(e,t,`:after`)}var lse=`application/font-woff`,use=`image/jpeg`,YS={woff:lse,woff2:lse,ttf:`application/font-truetype`,eot:`application/vnd.ms-fontobject`,png:`image/png`,jpg:use,jpeg:use,gif:`image/gif`,tiff:`image/tiff`,svg:`image/svg+xml`,webp:`image/webp`};function XS(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:``}function ZS(e){return YS[XS(e).toLowerCase()]||``}function QS(e){return e.split(/,/)[1]}function $S(e){return e.search(/^(data:)/)!==-1}function eC(e,t){return`data:${t};base64,${e}`}async function tC(e,t,n){let r=await fetch(e,t);if(r.status===404)throw Error(`Resource "${r.url}" not found`);let i=await r.blob();return new Promise((e,t)=>{let a=new FileReader;a.onerror=t,a.onloadend=()=>{try{e(n({res:r,result:a.result}))}catch(e){t(e)}},a.readAsDataURL(i)})}var nC={};function rC(e,t,n){let r=e.replace(/\?.*/,``);return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,``)),t?`[${t}]${r}`:r}async function iC(e,t,n){let r=rC(e,t,n.includeQueryParams);if(nC[r]!=null)return nC[r];n.cacheBust&&(e+=(/\?/.test(e)?`&`:`?`)+new Date().getTime());let i;try{i=eC(await tC(e,n.fetchRequestInit,({res:e,result:n})=>(t||=e.headers.get(`Content-Type`)||``,QS(n))),t)}catch(t){i=n.imagePlaceholder||``;let r=`Failed to fetch resource: ${e}`;t&&(r=typeof t==`string`?t:t.message),r&&console.warn(r)}return nC[r]=i,i}async function aC(e){let t=e.toDataURL();return t===`data:,`?e.cloneNode(!1):VS(t)}async function oC(e,t){if(e.currentSrc){let t=document.createElement(`canvas`),n=t.getContext(`2d`);return t.width=e.clientWidth,t.height=e.clientHeight,n?.drawImage(e,0,0,t.width,t.height),VS(t.toDataURL())}let n=e.poster;return VS(await iC(n,ZS(n),t))}async function sC(e){try{if(e?.contentDocument?.body)return await gC(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function cC(e,t){return WS(e,HTMLCanvasElement)?aC(e):WS(e,HTMLVideoElement)?oC(e,t):WS(e,HTMLIFrameElement)?sC(e):e.cloneNode(!1)}var lC=e=>e.tagName!=null&&e.tagName.toUpperCase()===`SLOT`;async function uC(e,t,n){let r=[];return r=lC(e)&&e.assignedNodes?MS(e.assignedNodes()):WS(e,HTMLIFrameElement)&&e.contentDocument?.body?MS(e.contentDocument.body.childNodes):MS((e.shadowRoot??e).childNodes),r.length===0||WS(e,HTMLVideoElement)||await r.reduce((e,r)=>e.then(()=>gC(r,n)).then(e=>{e&&t.appendChild(e)}),Promise.resolve()),t}function dC(e,t){let n=t.style;if(!n)return;let r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):MS(r).forEach(i=>{let a=r.getPropertyValue(i);i===`font-size`&&a.endsWith(`px`)&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),WS(e,HTMLIFrameElement)&&i===`display`&&a===`inline`&&(a=`block`),i===`d`&&t.getAttribute(`d`)&&(a=`path(${t.getAttribute(`d`)})`),n.setProperty(i,a,r.getPropertyPriority(i))})}function fC(e,t){WS(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),WS(e,HTMLInputElement)&&t.setAttribute(`value`,e.value)}function pC(e,t){if(WS(e,HTMLSelectElement)){let n=t,r=Array.from(n.children).find(t=>e.value===t.getAttribute(`value`));r&&r.setAttribute(`selected`,``)}}function mC(e,t){return WS(t,Element)&&(dC(e,t),JS(e,t),fC(e,t),pC(e,t)),t}async function hC(e,t){let n=e.querySelectorAll?e.querySelectorAll(`use`):[];if(n.length===0)return e;let r={};for(let i=0;i<n.length;i++){let a=n[i].getAttribute(`xlink:href`);if(a){let n=e.querySelector(a),i=document.querySelector(a);!n&&i&&!r[a]&&(r[a]=await gC(i,t,!0))}}let i=Object.values(r);if(i.length){let t=`http://www.w3.org/1999/xhtml`,n=document.createElementNS(t,`svg`);n.setAttribute(`xmlns`,t),n.style.position=`absolute`,n.style.width=`0`,n.style.height=`0`,n.style.overflow=`hidden`,n.style.display=`none`;let r=document.createElementNS(t,`defs`);n.appendChild(r);for(let e=0;e<i.length;e++)r.appendChild(i[e]);e.appendChild(n)}return e}async function gC(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(e=>cC(e,t)).then(n=>uC(e,n,t)).then(t=>mC(e,t)).then(e=>hC(e,t))}var _C=/url\((['"]?)([^'"]+?)\1\)/g,dse=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,fse=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function M(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}function pse(e){let t=[];return e.replace(_C,(e,n,r)=>(t.push(r),e)),t.filter(e=>!$S(e))}async function mse(e,t,n,r,i){try{let a=n?AS(t,n):t,o=ZS(t),s;return s=i?eC(await i(a),o):await iC(a,o,r),e.replace(M(t),`$1${s}$3`)}catch{}return e}function hse(e,{preferredFontFormat:t}){return t?e.replace(fse,e=>{for(;;){let[n,,r]=dse.exec(e)||[];if(!r)return``;if(r===t)return`src: ${n};`}}):e}function vC(e){return e.search(_C)!==-1}async function yC(e,t,n){if(!vC(e))return e;let r=hse(e,n);return pse(r).reduce((e,r)=>e.then(e=>mse(e,r,t,n)),Promise.resolve(r))}async function bC(e,t,n){let r=t.style?.getPropertyValue(e);if(r){let i=await yC(r,null,n);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function gse(e,t){await bC(`background`,e,t)||await bC(`background-image`,e,t),await bC(`mask`,e,t)||await bC(`mask-image`,e,t)}async function _se(e,t){let n=WS(e,HTMLImageElement);if(!(n&&!$S(e.src))&&!(WS(e,SVGImageElement)&&!$S(e.href.baseVal)))return;let r=n?e.src:e.href.baseVal,i=await iC(r,ZS(r),t);await new Promise((t,r)=>{e.onload=t,e.onerror=r;let a=e;a.decode&&=t,a.loading===`lazy`&&(a.loading=`eager`),n?(e.srcset=``,e.src=i):e.href.baseVal=i})}async function vse(e,t){let n=MS(e.childNodes).map(e=>xC(e,t));await Promise.all(n).then(()=>e)}async function xC(e,t){WS(e,Element)&&(await gse(e,t),await _se(e,t),await vse(e,t))}function yse(e,t){let{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);let r=t.style;return r!=null&&Object.keys(r).forEach(e=>{n[e]=r[e]}),e}var SC={};async function CC(e){let t=SC[e];return t??(t={url:e,cssText:await(await fetch(e)).text()},SC[e]=t,t)}async function wC(e,t){let n=e.cssText,r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(r,`$1`);return a.startsWith(`https://`)||(a=new URL(a,e.url).href),tC(a,t.fetchRequestInit,({result:e})=>(n=n.replace(i,`url(${e})`),[i,e]))});return Promise.all(i).then(()=>n)}function TC(e){if(e==null)return[];let t=[],n=e.replace(/(\/\*[\s\S]*?\*\/)/gi,``),r=RegExp(`((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})`,`gi`);for(;;){let e=r.exec(n);if(e===null)break;t.push(e[0])}n=n.replace(r,``);let i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a=RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=i.exec(n);if(e===null){if(e=a.exec(n),e===null)break;i.lastIndex=a.lastIndex}else a.lastIndex=i.lastIndex;t.push(e[0])}return t}async function bse(e,t){let n=[],r=[];return e.forEach(n=>{if(`cssRules`in n)try{MS(n.cssRules||[]).forEach((e,i)=>{if(e.type===CSSRule.IMPORT_RULE){let a=i+1,o=e.href,s=CC(o).then(e=>wC(e,t)).then(e=>TC(e).forEach(e=>{try{n.insertRule(e,e.startsWith(`@import`)?a+=1:n.cssRules.length)}catch(t){console.error(`Error inserting rule from remote css`,{rule:e,error:t})}})).catch(e=>{console.error(`Error loading remote css`,e.toString())});r.push(s)}})}catch(i){let a=e.find(e=>e.href==null)||document.styleSheets[0];n.href!=null&&r.push(CC(n.href).then(e=>wC(e,t)).then(e=>TC(e).forEach(e=>{a.insertRule(e,n.cssRules.length)})).catch(e=>{console.error(`Error loading remote stylesheet`,e)})),console.error(`Error inlining remote css file`,i)}}),Promise.all(r).then(()=>(e.forEach(e=>{if(`cssRules`in e)try{MS(e.cssRules||[]).forEach(e=>{n.push(e)})}catch(t){console.error(`Error while reading CSS rules from ${e.href}`,t)}}),n))}function xse(e){return e.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>vC(e.style.getPropertyValue(`src`)))}async function Sse(e,t){if(e.ownerDocument==null)throw Error(`Provided element is not within a Document`);return xse(await bse(MS(e.ownerDocument.styleSheets),t))}async function Cse(e,t){let n=await Sse(e,t);return(await Promise.all(n.map(e=>{let n=e.parentStyleSheet?e.parentStyleSheet.href:null;return yC(e.cssText,n,t)}))).join(`
|
|
24
24
|
`)}async function EC(e,t){let n=t.fontEmbedCSS==null?t.skipFonts?null:await Cse(e,t):t.fontEmbedCSS;if(n){let t=document.createElement(`style`),r=document.createTextNode(n);t.appendChild(r),e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}}async function wse(e,t={}){let{width:n,height:r}=IS(e,t),i=await gC(e,t,!0);return await EC(i,t),await xC(i,t),yse(i,t),await US(i,n,r)}async function Tse(e,t={}){let{width:n,height:r}=IS(e,t),i=await VS(await wse(e,t)),a=document.createElement(`canvas`),o=a.getContext(`2d`),s=t.pixelRatio||LS(),c=t.canvasWidth||n,l=t.canvasHeight||r;return a.width=c*s,a.height=l*s,t.skipAutoScale||zS(a),a.style.width=`${c}`,a.style.height=`${l}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(i,0,0,a.width,a.height),a}async function Ese(e,t={}){return await BS(await Tse(e,t))}var Dse=12e3;function DC(e,t={}){let n=t.padding??32,r=Math.ceil(e.width+2*n),i=Math.ceil(e.height+2*n),a=t.pixelRatio??2,o=Math.min(a,Dse/Math.max(r,i,1));return{width:r,height:i,viewport:{x:n-e.x,y:n-e.y,zoom:1},pixelRatio:o}}var Ose=[`react-flow__panel`,`react-flow__handle`,`react-flow__resize-control`,`react-flow__minimap`,`react-flow__background`,`dg-no-export`];function OC(e){return e instanceof Element?!Ose.some(t=>e.classList.contains(t)):!0}async function kC(e,t){let n=getComputedStyle(e),r=n.getPropertyValue(`--xy-background-color`).trim()||n.backgroundColor;return Ese(e,{width:t.width,height:t.height,pixelRatio:t.pixelRatio,...r===``?{}:{backgroundColor:r},style:{width:`${t.width}px`,height:`${t.height}px`},filter:OC})}var AC=.02,kse=1,Ase=.35,jse=300;function jC(e){let{layoutApiRef:t,reactFlow:n,rfNodesRef:r,compiledRef:i,geometryRef:a,wrapperRef:o,strokesRef:s,legendReserveRef:c}=e;(0,_.useEffect)(()=>{let e=t;if(e!==void 0)return e.current={snapshotPositions:()=>Object.fromEntries(r.current.filter(e=>!(i.current.externals?.has(e.id)??!1)&&!_S(e.id)).map(e=>[e.id,{x:e.position.x,y:e.position.y}])),autoPositions:()=>a.current===null?{}:Object.fromEntries([...a.current].map(([e,t])=>[e,{x:t.x,y:t.y}])),viewportCenter:()=>{let e=o.current?.getBoundingClientRect();return e===void 0?void 0:n.screenToFlowPosition({x:e.left+e.width/2,y:e.top+e.height/2})},nodeBounds:e=>{let t=n.getInternalNode(e);if(t!==void 0)return{...t.internals.positionAbsolute,width:t.measured.width??0,height:t.measured.height??0}},contentBounds:()=>{let e=n.getNodes();return OS([e.length===0?void 0:n.getNodesBounds(e),vae(s.current),kS(o.current,e=>n.screenToFlowPosition(e,{snapToGrid:!1}))])},fitView:(t=.06)=>{let r=typeof t==`number`?t:Object.fromEntries(Object.entries(t).map(([e,t])=>[e,`${t}px`])),i=e.current?.contentBounds(),a=o.current?.getBoundingClientRect();if(i!==void 0&&a!==void 0&&a.width>0&&a.height>0){n.setViewport(zd(i,a.width,a.height,AC,4,r));return}n.fitView({padding:r})},focusNodes:t=>{let r=t.map(t=>e.current?.nodeBounds(t)),i=o.current?.getBoundingClientRect();if(r.length===0||r.includes(void 0)||i===void 0||i.width<=0)return!1;let a=OS(r);if(a===void 0)return!1;let s=zd(a,i.width,i.height,AC,kse,Ase);return n.setViewport(s,{duration:jse}),!0},legendReserve:()=>c.current,exportPng:async t=>{let r=o.current?.querySelector(`.react-flow`),i=e.current?.contentBounds();if(r==null||i===void 0)return null;let a=DC(i,t),s=n.getViewport();await n.setViewport(a.viewport),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)));try{return await kC(r,a)}finally{n.setViewport(s)}}},()=>{e.current=null}},[t,n])}function Mse(e,t,n){let r=(0,_.useRef)(t);r.current=t;let i=(0,_.useMemo)(()=>{let r=new Map;if(t===null)return r;let i=(e,a,o)=>{let s=t.get(e.id);if(s===void 0)return;let c=a+s.x,l=o+s.y;if(e.children.length===0)return;let u=n.get(e.id);r.set(e.id,{x:c-(u?.dx??0),y:l-(u?.dy??0)}),e.children.forEach(e=>i(e,c,l))};return e.roots.forEach(e=>i(e,0,0)),r},[e,t,n]),a=(0,_.useRef)(i);a.current=i;let o=(0,_.useRef)(n);return o.current=n,{arrangedRef:r,containerBasesRef:a,containerShiftsRef:o}}function Nse(e,t){let n=[],r={};for(let i of e){let e=t.get(i.id)??i.position;if(i.type!==`note`){r[i.id]=e;continue}let a=i.data;a.target===void 0||a.anchor===void 0||n.push({target:a.target,offset:{dx:Math.round(e.x-a.anchor.x),dy:Math.round(e.y-a.anchor.y)}})}return{notes:n,boxes:r}}function MC(e,t,n){let r=[],i={};for(let a of e){if(!t(a))continue;r.push(a);let e=n(a);e!==void 0&&(i[a]=e)}return{skip:r,resets:i}}function NC(e,t,n){let r=e=>e.data.typeId,i=e.find(e=>e.id===t),a=i?.parentId;if(!(i===void 0||a===void 0||r(i)!==`activity-lane`))return{frameId:a,offset:Bae(e.filter(e=>e.parentId===a&&r(e)===`activity-lane`).flatMap(e=>{let t=n?.get(e.id);return t===void 0?[]:[{id:e.id,y:t.y,height:t.height}]}),t,i.position.y)}}var PC=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),FC=(e,t)=>t.size===0?e:Object.fromEntries(Object.entries(e).filter(([e])=>!t.has(e))),N=e=>e.type===`dimensions`&&e.setAttributes===!0&&e.resizing===void 0;function IC(e,t){return t||!e.some(N)?e:e.filter(e=>!N(e)&&e.type!==`position`)}var LC={dx:0,dy:0,lines:[]};function Pse(e,t,n){let r=(e,t)=>t===`x`?[e.x,e.x+e.w/2,e.x+e.w]:[e.y,e.y+e.h/2,e.y+e.h],i=i=>{let a=r(e,i),o;for(let s of t)if(s.id!==e.id)for(let e of r(s,i))for(let t of a){let r=e-t;Math.abs(r)<=n&&(o===void 0||Math.abs(r)<Math.abs(o.d))&&(o={d:r,at:e,other:s})}return o},a=i(`x`),o=i(`y`);if(a===void 0&&o===void 0)return LC;let s=a?.d??0,c=o?.d??0,l=[];return a!==void 0&&l.push({axis:`x`,at:a.at,from:Math.min(e.y+c,a.other.y),to:Math.max(e.y+c+e.h,a.other.y+a.other.h)}),o!==void 0&&l.push({axis:`y`,at:o.at,from:Math.min(e.x+s,o.other.x),to:Math.max(e.x+s+e.w,o.other.x+o.other.w)}),{dx:s,dy:c,lines:l}}var RC=e=>{if(e===void 0)return;let t=e.measured?.width??(typeof e.style?.width==`number`?e.style.width:void 0),n=e.measured?.height??(typeof e.style?.height==`number`?e.style.height:void 0);return t!==void 0&&n!==void 0?{width:t,height:n}:void 0};function zC(e,t,n){let r={changes:e,lines:[]},i=e.filter(e=>e.type===`position`&&e.dragging===!0&&e.position!==void 0);if(i.length!==1)return r;let a=i[0],o=t.nodes.find(e=>e.id===a.id),s=RC(o);if(o===void 0||s===void 0||a.position===void 0)return r;let c=o.parentId===void 0?{x:0,y:0}:t.absoluteOf(o.parentId);if(c===void 0)return r;let l={id:o.id,x:c.x+a.position.x,y:c.y+a.position.y,w:s.width,h:s.height},u=[];for(let e of t.nodes){if(e.id===o.id||e.parentId!==o.parentId)continue;let n=RC(e),r=t.absoluteOf(e.id);n===void 0||r===void 0||u.push({id:e.id,x:r.x,y:r.y,w:n.width,h:n.height})}let d=Pse(l,u,n);return d.lines.length===0?r:(a.position.x+=d.dx,a.position.y+=d.dy,a.positionAbsolute!==void 0&&(a.positionAbsolute.x+=d.dx,a.positionAbsolute.y+=d.dy),{changes:e,lines:d.lines})}function Fse(e,t,n,r){let i=e=>e.type===`position`&&e.position!==void 0,a=r.current;if(a!==null){let t=e.find(e=>i(e)&&e.dragging!==!0&&e.id===a.id);if(t?.position!==void 0)return r.current=null,t.position.x===a.x&&t.position.y===a.y&&(t.position={x:a.x+a.dx,y:a.y+a.dy}),{changes:e,lines:[]}}let o=e.filter(e=>i(e)&&e.dragging===!0),s=o.length===1?{id:o[0].id,...o[0].position}:void 0,c=zC(e,t,n),l=o.length===1?o[0].position:void 0;return r.current=s!==void 0&&l!==void 0&&c.lines.length>0?{...s,dx:l.x-s.x,dy:l.y-s.y}:null,c}function Ise(e,t,n){let r;for(let i of t)n.has(i.id)||e.x<i.x||e.x>i.x+i.w||e.y<i.y||e.y>i.y+i.h||(r===void 0||i.w*i.h<r.w*r.h)&&(r=i);return r?.id}function Lse(e,t,n){let r=new Set([t]),i=e.find(e=>e.id===t)?.parentId;i!==void 0&&r.add(i);let a=new Map;for(let t of e)t.parentId!==void 0&&a.set(t.parentId,[...a.get(t.parentId)??[],t.id]);let o=[...a.get(t)??[]];for(let e=0;e<o.length;e++){let t=o[e];r.has(t)||(r.add(t),o.push(...a.get(t)??[]))}for(let e of n)r.add(e);return r}var BC=e=>`clientX`in e?{x:e.clientX,y:e.clientY}:{x:e.touches[0]?.clientX??0,y:e.touches[0]?.clientY??0};function VC(e,t,n){let{model:r,profile:i,reactFlow:a}=e,o=i.node?.dropTarget;if(o===void 0)return;let s=r.nodes.find(e=>e.id===t);if(s===void 0||i.node?.canDrop?.(s)!==!0)return;let c=Lse(e.rfNodesRef.current,t,i.related?.(r,e.plane,t)??[]),l=[];for(let e of r.nodes){if(!o(e))continue;let t=a.getInternalNode(e.id),n=t?.internals.positionAbsolute,r=t?.measured?.width,i=t?.measured?.height;n===void 0||r===void 0||i===void 0||l.push({id:e.id,x:n.x,y:n.y,w:r,h:i})}return Ise(n,l,c)}function HC(e){let{editing:t,edit:n,model:r,profile:i,reactFlow:a,rfNodesRef:o,setRfNodes:s,commitMoves:c}=e,[l,u]=(0,_.useState)([]),d=(0,_.useRef)(null),[f,p]=(0,_.useState)(!1),m=(0,_.useRef)(!1),h=(0,_.useRef)(void 0),g=t&&n?.onDropInto!==void 0&&i.node?.dropTarget!==void 0,v=(t,n,r)=>{let i=r.length===1?VC(e,n.id,a.screenToFlowPosition(BC(t))):void 0;i!==h.current&&(h.current=i,s(e=>Wx(e,i)))},y=e=>{let t=Object.entries(e).map(([e,t])=>({type:`position`,id:e,position:t}));o.current=lm(t,o.current),s(e=>lm(t,e))},b=(t,r)=>{if(n?.onDropInto===void 0||i.node?.dropTarget===void 0)return!1;let o=VC(e,t,a.screenToFlowPosition(BC(r))),s=o===void 0?void 0:a.getInternalNode(t)?.internals.positionAbsolute,c=o===void 0?void 0:a.getInternalNode(o)?.internals.positionAbsolute;return o===void 0||s===void 0||c===void 0?!1:(n.onDropInto(t,o,PC(s,c)),!0)},x=t=>e.allNodesRef.current.find(e=>e.id===t)?.position,S=e=>{let t=i.node?.snapsBack;return t===void 0?{skip:[],resets:{}}:MC(e,e=>{let n=r.nodes.find(t=>t.id===e);return n!==void 0&&t(n)},x)},C=(t,r)=>{if(n?.onMoveLane===void 0)return!1;let i=NC(o.current,t,e.arrangedRef.current);if(i===void 0)return!1;let a=x(t);return a!==void 0&&(r[t]=a),i.offset!==0&&n.onMoveLane(i.frameId,t,i.offset),!0},w=(e,t,r)=>{m.current=!1,p(!1),h.current!==void 0&&(h.current=void 0,o.current=Wx(o.current,void 0),s(e=>Wx(e,void 0)));let{notes:i,boxes:a}=Nse(r,new Map(o.current.map(e=>[e.id,e.position])));for(let e of i)n?.onNoteMoved?.(e.target,e.offset);let l=new Set,u=Object.keys(a);u.length===1&&b(u[0],e)&&l.add(u[0]);let{skip:d,resets:f}=S(u);for(let e of d)l.add(e);u.length===1&&C(u[0],f)&&l.add(u[0]),Object.keys(f).length>0&&y(f),c(FC(a,l))};return{guides:l,dragging:f,handlers:{onNodesChange:e=>{let t=Fse(e,{nodes:o.current,absoluteOf:e=>a.getInternalNode(e)?.internals.positionAbsolute},8/a.getZoom(),d);u(e=>e.length===0&&t.lines.length===0?e:t.lines);let n=IC(t.changes,m.current).filter(e=>e.type!==`remove`);o.current=lm(n,o.current),s(e=>lm(n,e))},onNodeDragStart:()=>{e.flushNudge(),m.current=!0,p(!0)},...g?{onNodeDrag:v}:{},onNodeDragStop:w}}}function UC(e){let{allNodes:t,derivedNodes:n,setRfNodes:r,selectOnAppearRef:i,pendingRef:a}=e;(0,_.useLayoutEffect)(()=>{let e=i.current,o=e!==null&&n.some(t=>t.id===e)?e:null;o!==null&&(i.current=null),r(e=>{let n=o===null?new Set(e.filter(e=>e.selected===!0).map(e=>e.id)):new Set([o]),r=a.current;return n.size===0&&Object.keys(r).length===0?t:t.map(e=>{let t=r[e.id],i=n.has(e.id);return!i&&t===void 0?e:{...e,...i?{selected:!0}:{},...t===void 0?{}:{position:t}}})})},[t])}function WC(e){let{session:t,editing:n,edit:r,compiled:i,arrangedGeometry:a,profile:o,nameOf:s,typeRegistry:c}=e,{noteEdit:l,setNoteEdit:u,noteOverrides:d,setNoteOverrides:f}=t,[p,m]=(0,_.useState)(()=>new Map),h=(0,_.useCallback)((e,t,n,r)=>{m(i=>{let a=i.get(e);return a!==void 0&&a.at.x===t.x&&a.at.y===t.y&&a.away.x===n.x&&a.away.y===n.y&&a.line.length===r.length&&a.line.every((e,t)=>e.x===r[t].x&&e.y===r[t].y)?i:new Map(i).set(e,{at:t,away:n,line:r})})},[]),g=Ae(e.model,e.plane),v=e.notes===!1,y=e.layout?.notes?.[g],b=(0,_.useMemo)(()=>{let e=new Set;for(let[t,n]of Object.entries(y??{}))n.open===!0&&e.add(t);for(let[t,n]of d)n?e.add(t):e.delete(t);return e},[y,d]),x=r?.onToggleNote,S=(0,_.useMemo)(()=>v?null:{isOpen:e=>b.has(e),toggle:e=>{let t=Me(e),r=!b.has(t);n&&x!==void 0?x(e,r):f(e=>new Map(e).set(t,r))},placeBadge:h},[v,b,n,x,h]),C=e.onOpenLink;return{noteState:S,noteNodes:(0,_.useMemo)(()=>v||b.size===0||a===null?[]:vS({compiled:i,geometry:a,open:b,placements:y,badgeSpots:p,editing:n,offersThreats:o.offersThreats===!0,editingRow:l,onAddThreat:r?.onAddThreat,onRetitleThreat:r?.onRetitleThreat,onSetThreatStatus:r?.onSetThreatStatus,onEditThreatText:r?.onEditThreatText,onOpenLink:C,onEndEdit:()=>u(null),nameOf:s,typeRegistry:c}),[v,b,a,i,y,p,n,r?.onAddThreat,r?.onRetitleThreat,r?.onSetThreatStatus,r?.onEditThreatText,C,o,l,s,c])}}function GC(e,t){let[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(()=>new Map);return(0,_.useEffect)(()=>{e&&a(new Map)},[e]),(0,_.useEffect)(()=>{a(new Map)},[t]),{noteEdit:n,setNoteEdit:r,noteOverrides:i,setNoteOverrides:a}}var KC=new Set([`left`,`centerX`,`right`]),Rse=(e,t)=>{switch(t){case`left`:return e.x;case`centerX`:return e.x+e.w/2;case`right`:return e.x+e.w;case`top`:return e.y;case`middle`:return e.y+e.h/2;case`bottom`:return e.y+e.h}};function zse(e,t){if(e.length<2)return{};let n=e.map(e=>Rse(e,t)),r=t===`left`||t===`top`?Math.min(...n):t===`right`||t===`bottom`?Math.max(...n):n.reduce((e,t)=>e+t,0)/n.length,i={};return e.forEach((e,a)=>{let o=r-n[a];o!==0&&(i[e.id]=KC.has(t)?{dx:o,dy:0}:{dx:0,dy:o})}),i}function qC(e,t){if(e.length<3)return{};let n=e=>t===`x`?e.x:e.y,r=e=>t===`x`?e.w:e.h,i=[...e].sort((e,t)=>n(e)-n(t)),a=i[0],o=i[i.length-1],s=(n(o)+r(o)-n(a)-i.reduce((e,t)=>e+r(t),0))/(i.length-1),c={},l=n(a)+r(a)+s;for(let e of i.slice(1,-1)){let i=l-n(e);i!==0&&(c[e.id]=t===`x`?{dx:i,dy:0}:{dx:0,dy:i}),l+=r(e)+s}return c}function JC(e,t){let n=new Set(e);return e.filter(e=>{for(let r=t(e);r!==void 0;r=t(r))if(n.has(r))return!1;return!0})}var YC={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},XC=e=>{let t=e?.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e?.isContentEditable===!0};function ZC(e){let t=(0,_.useRef)({}),n=(0,_.useRef)(null),r=(0,_.useRef)(e);r.current=e;let i=(0,_.useCallback)(()=>{n.current!==null&&(clearTimeout(n.current),n.current=null);let e=t.current;Object.keys(e).length!==0&&(t.current={},r.current.commit(e))},[]),a=(0,_.useCallback)(e=>{let{enabled:a,step:o,nodesRef:s,applyMoves:c}=r.current,l=YC[e.key];if(!a||l===void 0)return;let u=e.target;if(XC(u)||(u?.closest(`.react-flow__node, .react-flow__nodesselection-rect`)??null)===null)return;let d=s.current.filter(e=>e.selected===!0&&e.draggable!==!1);if(d.length===0)return;if(e.metaKey||e.ctrlKey||e.altKey){e.stopPropagation();return}e.preventDefault(),e.stopPropagation();let f=o*(e.shiftKey?4:1),p={};for(let e of d){let n=t.current[e.id]??e.position;p[e.id]={x:n.x+l.x*f,y:n.y+l.y*f}}t.current={...t.current,...p},c(p),n.current!==null&&clearTimeout(n.current),n.current=setTimeout(i,300)},[i]),o=(0,_.useCallback)(e=>{(e.target?.closest(`.react-flow__node`)??null)!==null&&i()},[i]);return(0,_.useEffect)(()=>i,[i]),{onKeyDownCapture:a,onBlurCapture:o,flush:i,pendingRef:t}}function QC(e){let{chromeless:t,gestureCaptured:n,reactFlow:r,rfNodes:i,rfNodesRef:a,setRfNodes:o,commitMoves:s}=e,c=ZC({enabled:!t&&!n,step:e.snapGrid??5,nodesRef:a,applyMoves:e=>o(t=>lm(Object.entries(e).map(([e,t])=>({type:`position`,id:e,position:t})),t)),commit:s}),l=(0,_.useMemo)(()=>i.filter(e=>e.selected===!0&&e.draggable!==!1).map(e=>e.id),[i]),u=!t&&!n&&(e.editing||e.savesViewPositions),d=e=>{c.flush();let t=new Map(a.current.map(e=>[e.id,e])),n=JC(l,e=>t.get(e)?.parentId),i=[];for(let e of n){let n=t.get(e),a=r.getInternalNode(e)?.internals.positionAbsolute,o=n?.measured?.width,s=n?.measured?.height;n===void 0||a===void 0||o===void 0||s===void 0||i.push({id:e,x:a.x,y:a.y,w:o,h:s})}let u={};for(let[n,r]of Object.entries(e(i))){let e=t.get(n);u[n]={x:e.position.x+r.dx,y:e.position.y+r.dy}}Object.keys(u).length!==0&&(o(e=>lm(Object.entries(u).map(([e,t])=>({type:`position`,id:e,position:t})),e)),s(u))};return{nudge:c,selectedIds:l,canArrange:u,arrangeSelection:d,alignSelection:e=>d(t=>zse(t,e)),distributeSelection:e=>d(t=>qC(t,e))}}function Bse(e,t,n,r){let{zoom:i}=t,a=e.x*i+t.x,o=e.y*i+t.y,s=a+e.width*i,c=o+e.height*i,l=n.width-r,u=n.height-r;if(a>=r&&o>=r&&s<=l&&c<=u)return null;if(e.width*i+2*r<=n.width&&e.height*i+2*r<=n.height){let e=a<r?r-a:s>l?l-s:0,n=o<r?r-o:c>u?u-c:0;return{x:t.x+e,y:t.y+n,zoom:i}}let d=Math.max(AC,Math.min((n.width-2*r)/e.width,(n.height-2*r)/e.height,i));return{x:(n.width-e.width*d)/2-e.x*d,y:(n.height-e.height*d)/2-e.y*d,zoom:d}}function Vse(e){let{pendingRevealRef:t,pendingRootFitRef:n,compiled:r,reactFlow:i,wrapperRef:a}=e,{arrangedGeometry:o,settledFor:s}=e.layout;(0,_.useEffect)(()=>{let e=t.current;if(e===null||o===null||s!==r||(t.current=null,n.current!==null))return;let c=Hse(r,o,e),l=a.current?.getBoundingClientRect();if(c===void 0||l===void 0||l.width===0||l.height===0)return;let u=Bse(c,i.getViewport(),l,24);u!==null&&i.setViewport(u,{duration:300})},[r,o,s,i])}function Hse(e,t,n){let r,i=(e,a,o)=>{let s=t.get(e.id);if(s===void 0)return;let c=a+s.x,l=o+s.y;if(e.id===n){e.state===`expanded`&&(r={x:c,y:l,width:s.width,height:s.height});return}e.state===`expanded`&&e.children.forEach(e=>i(e,c,l))};return e.roots.forEach(e=>i(e,0,0)),r}function $C(e){let{pendingRootFitRef:t,compiled:n,reactFlow:r}=e,{arrangedGeometry:i,settledFor:a}=e.layout;(0,_.useEffect)(()=>{let e=t.current;e===null||i===null||a!==n||(t.current=null,r.fitView(e===`glide`?{padding:.15,duration:500}:void 0))},[n,i,a,r])}var Use=c(o(((e,t)=>{(function(n){if(typeof e==`object`&&t!==void 0)t.exports=n();else if(typeof define==`function`&&define.amd)define([],n);else{var r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this;r.ELK=n()}})(function(){return(function(){function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof require==`function`&&require;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var l=Error(`Cannot find module '`+o+`'`);throw l.code=`MODULE_NOT_FOUND`,l}var u=n[o]={exports:{}};t[o][0].call(u.exports,function(e){var n=t[o][1][e];return i(n||e)},u,u.exports,e,t,n,r)}return n[o].exports}for(var a=typeof require==`function`&&require,o=0;o<r.length;o++)i(r[o]);return i}return e})()({1:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;function r(e){"@babel/helpers - typeof";return r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function o(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=c(e,`string`);return r(t)==`symbol`?t:t+``}function c(e,t){if(r(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||`default`);if(r(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}n.default=function(){function e(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=n.defaultLayoutOptions,a=r===void 0?{}:r,o=n.algorithms,s=o===void 0?[`layered`,`stress`,`mrtree`,`radial`,`force`,`disco`,`sporeOverlap`,`sporeCompaction`,`rectpacking`]:o,c=n.workerFactory,u=n.workerUrl;if(i(this,e),this.defaultLayoutOptions=a,this.initialized=!1,u===void 0&&c===void 0)throw Error(`Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.`);var d=c;u!==void 0&&c===void 0&&(d=function(e){return new Worker(e)});var f=d(u);if(typeof f.postMessage!=`function`)throw TypeError(`Created worker does not provide the required 'postMessage' function.`);this.worker=new l(f),this.worker.postMessage({cmd:`register`,algorithms:s}).then(function(e){return t.initialized=!0}).catch(console.err)}return o(e,[{key:`layout`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.layoutOptions,r=n===void 0?this.defaultLayoutOptions:n,i=t.logging,a=i!==void 0&&i,o=t.measureExecutionTime,s=o!==void 0&&o;return e?this.worker.postMessage({cmd:`layout`,graph:e,layoutOptions:r,options:{logging:a,measureExecutionTime:s}}):Promise.reject(Error(`Missing mandatory parameter 'graph'.`))}},{key:`knownLayoutAlgorithms`,value:function(){return this.worker.postMessage({cmd:`algorithms`})}},{key:`knownLayoutOptions`,value:function(){return this.worker.postMessage({cmd:`options`})}},{key:`knownLayoutCategories`,value:function(){return this.worker.postMessage({cmd:`categories`})}},{key:`terminateWorker`,value:function(){this.worker&&this.worker.terminate()}}])}();var l=function(){function e(t){var n=this;if(i(this,e),t===void 0)throw Error(`Missing mandatory parameter 'worker'.`);this.resolvers={},this.worker=t,this.worker.onmessage=function(e){setTimeout(function(){n.receive(n,e)},0)}}return o(e,[{key:`postMessage`,value:function(e){var t=this.id||0;this.id=t+1,e.id=t;var n=this;return new Promise(function(r,i){n.resolvers[t]=function(e,t){e?(n.convertGwtStyleError(e),i(e)):r(t)},n.worker.postMessage(e)})}},{key:`receive`,value:function(e,t){var n=t.data,r=e.resolvers[n.id];r&&(delete e.resolvers[n.id],n.error?r(n.error):r(null,n.data))}},{key:`terminate`,value:function(){this.worker&&this.worker.terminate()}},{key:`convertGwtStyleError`,value:function(e){if(e){var t=e.__java$exception;t&&(t.cause&&t.cause.backingJsObject&&(e.cause=t.cause.backingJsObject,this.convertGwtStyleError(e.cause)),delete e.__java$exception)}}}])}()},{}],2:[function(e,t,n){(function(e){(function(){"use strict";var r;typeof window<`u`?r=window:e===void 0?typeof self<`u`&&(r=self):r=e;var i;function a(){}function o(){}function s(){}function c(){}function l(){}function u(){}function d(){}function f(){}function p(){}function m(){}function h(){}function g(){}function _(){}function v(){}function y(){}function b(){}function x(){}function S(){}function C(){}function w(){}function T(){}function E(){}function ee(){}function te(){}function ne(){}function re(){}function ie(){}function ae(){}function oe(){}function se(){}function ce(){}function le(){}function ue(){}function de(){}function fe(){}function pe(){}function me(){}function he(){}function ge(){}function _e(){}function ve(){}function ye(){}function be(){}function xe(){}function Se(){}function Ce(){}function we(){}function Te(){}function Ee(){}function De(){}function Oe(){}function ke(){}function Ae(){}function je(){}function Me(){}function Ne(){}function Pe(){}function Fe(){}function Ie(){}function Le(){}function Re(){}function ze(){}function Be(){}function Ve(){}function He(){}function Ue(){}function We(){}function Ge(){}function Ke(){}function qe(){}function Je(){}function Ye(){}function Xe(){}function Ze(){}function Qe(){}function $e(){}function et(){}function tt(){}function nt(){}function rt(){}function it(){}function at(){}function ot(){}function st(){}function ct(){}function lt(){}function ut(){}function dt(){}function ft(){}function pt(){}function mt(){}function ht(){}function gt(){}function _t(){}function vt(){}function yt(){}function bt(){}function xt(){}function St(){}function Ct(){}function wt(){}function Tt(){}function Et(){}function Dt(){}function Ot(){}function kt(){}function At(){}function jt(){}function Mt(){}function Nt(){}function Pt(){}function Ft(){}function It(){}function Lt(){}function Rt(){}function zt(){}function Bt(){}function Vt(){}function Ht(){}function Ut(){}function Wt(){}function Gt(){}function Kt(){}function qt(){}function Jt(){}function Yt(){}function Xt(){}function Zt(){}function Qt(){}function $t(){}function en(){}function tn(){}function nn(){}function rn(){}function an(){}function on(){}function sn(){}function cn(){}function ln(){}function eee(){}function un(){}function dn(){}function fn(){}function pn(){}function mn(){}function hn(){}function gn(){}function _n(){}function vn(){}function yn(){}function bn(){}function xn(){}function Sn(){}function Cn(){}function wn(){}function Tn(){}function En(){}function Dn(){}function On(){}function kn(){}function An(){}function jn(){}function Mn(){}function Nn(){}function tee(){}function Pn(){}function Fn(){}function In(){}function Ln(){}function Rn(){}function zn(){}function Bn(){}function Vn(){}function Hn(){}function Un(){}function Wn(){}function Gn(){}function nee(){}function Kn(){}function qn(){}function Jn(){}function Yn(){}function Xn(){}function Zn(){}function Qn(){}function $n(){}function ree(){}function er(){}function tr(){}function nr(){}function rr(){}function ir(){}function ar(){}function or(){}function sr(){}function cr(){}function lr(){}function iee(){}function ur(){}function dr(){}function fr(){}function pr(){}function mr(){}function hr(){}function gr(){}function _r(){}function vr(){}function yr(){}function br(){}function xr(){}function Sr(){}function Cr(){}function wr(){}function Tr(){}function Er(){}function Dr(){}function Or(){}function kr(){}function Ar(){}function jr(){}function Mr(){}function Nr(){}function Pr(){}function Fr(){}function aee(){}function Ir(){}function Lr(){}function Rr(){}function zr(){}function Br(){}function Vr(){}function Hr(){}function Ur(){}function Wr(){}function Gr(){}function Kr(){}function qr(){}function Jr(){}function Yr(){}function Xr(){}function Zr(){}function Qr(){}function $r(){}function ei(){}function ti(){}function ni(){}function ri(){}function ii(){}function ai(){}function oi(){}function si(){}function ci(){}function li(){}function ui(){}function di(){}function fi(){}function pi(){}function mi(){}function hi(){}function gi(){}function _i(){}function vi(){}function yi(){}function bi(){}function xi(){}function Si(){}function Ci(){}function wi(){}function Ti(){}function Ei(){}function Di(){}function Oi(){}function ki(){}function Ai(){}function ji(){}function Mi(){}function Ni(){}function Pi(){}function Fi(){}function Ii(){}function Li(){}function Ri(){}function zi(){}function Bi(){}function Vi(){}function Hi(){}function Ui(){}function Wi(){}function Gi(){}function Ki(){}function qi(){}function Ji(){}function Yi(){}function Xi(){}function Zi(){}function Qi(){}function $i(){}function ea(){}function ta(){}function na(){}function ra(){}function ia(){}function aa(){}function oa(){}function sa(){}function ca(){}function la(){}function ua(){}function da(){}function D(){}function fa(){}function pa(){}function ma(){}function ha(){}function ga(){}function _a(){}function va(){}function ya(){}function ba(){}function xa(){}function Sa(){}function Ca(){}function wa(){}function Ta(){}function Ea(){}function Da(){}function Oa(){}function ka(){}function Aa(){}function ja(){}function Ma(){}function Na(){}function Pa(){}function Fa(){}function Ia(){}function La(){}function Ra(){}function za(){}function Ba(){}function Va(){}function Ha(){}function Ua(){}function Wa(){}function Ga(){}function Ka(){}function qa(){}function Ja(){}function Ya(){}function Xa(){}function Za(){}function Qa(){}function $a(){}function eo(){}function to(){}function no(){}function ro(){}function io(){}function ao(){}function oo(){}function so(){}function co(){}function lo(){}function uo(){}function fo(){}function po(){}function mo(){}function ho(){}function go(){}function _o(){}function vo(){}function yo(){}function bo(){}function xo(){}function So(){}function Co(){}function wo(){}function To(){}function Eo(){}function Do(){}function Oo(){}function ko(){}function Ao(){}function jo(){}function Mo(){}function No(){}function Po(){}function oee(){}function Fo(){}function Io(){}function Lo(){}function Ro(){}function zo(){}function Bo(){}function Vo(){}function Ho(){}function Uo(){}function Wo(){}function Go(){}function Ko(){}function qo(){}function Jo(){}function Yo(){}function Xo(){}function Zo(){}function Qo(){}function $o(){}function es(){}function ts(){}function see(){}function ns(){}function rs(){}function is(){}function as(){}function os(){}function ss(){}function cs(){}function ls(){}function us(){}function ds(){}function fs(){}function ps(){}function ms(){}function hs(){}function gs(){}function _s(){}function vs(){}function ys(){}function bs(){}function xs(){}function Ss(){}function Cs(){}function ws(){}function Ts(){}function Es(){}function Ds(){}function Os(){}function ks(){}function As(){}function js(){}function Ms(){}function Ns(){}function Ps(){}function Fs(){}function Is(){}function Ls(){}function Rs(){}function zs(){}function Bs(){}function Vs(){}function Hs(){}function Us(){}function Ws(){}function Gs(){}function Ks(){}function qs(){}function Js(){}function Ys(){}function Xs(){}function Zs(){}function Qs(){}function $s(){}function ec(){}function tc(){}function nc(){}function rc(){}function ic(){}function ac(){}function oc(){}function sc(){}function cc(){}function lc(){}function uc(){}function dc(){}function fc(){}function pc(){}function mc(){}function hc(){}function gc(){}function _c(){}function vc(){}function yc(){}function bc(){}function xc(){}function Sc(){}function Cc(){}function wc(){}function Tc(){}function Ec(){}function Dc(){}function Oc(){}function kc(){}function Ac(){}function jc(){}function Mc(){}function Nc(){}function Pc(){}function Fc(){}function Ic(){}function Lc(){}function Rc(){}function cee(){}function zc(){}function Bc(){}function Vc(){}function Hc(){}function Uc(){}function Wc(){}function Gc(){}function Kc(){}function qc(){}function Jc(){}function Yc(){}function Xc(){}function Zc(){}function Qc(){}function $c(){}function el(){}function tl(){}function nl(){}function rl(){}function il(){}function al(){}function ol(){}function sl(){}function cl(){}function ll(){}function ul(){}function dl(){}function fl(){}function pl(){}function ml(){}function hl(){}function gl(){}function _l(){}function vl(){}function yl(){}function bl(){}function xl(){}function Sl(){}function Cl(){}function wl(){}function Tl(){}function El(){}function Dl(){}function Ol(){}function kl(){}function Al(){}function jl(){}function Ml(){}function Nl(){}function Pl(){}function Fl(){}function Il(){}function Ll(){}function Rl(){}function zl(){}function Bl(){}function Vl(){}function Hl(){}function Ul(){}function Wl(){}function Gl(){}function Kl(){}function ql(){}function Jl(){}function Yl(){}function Xl(){}function Zl(){}function Ql(){}function $l(){}function eu(){}function tu(){}function nu(){}function ru(){}function iu(){}function au(){}function ou(){}function su(){}function cu(){}function lu(){}function uu(){}function du(){}function fu(){}function pu(){}function mu(){}function hu(){}function gu(){}function _u(){}function vu(){}function yu(){}function bu(){}function xu(){}function Su(){}function Cu(){}function wu(){}function Tu(){}function Eu(){}function Du(){}function Ou(){}function ku(){}function Au(){}function ju(){}function lee(){}function Mu(){}function Nu(){}function Pu(){}function Fu(){}function Iu(){}function Lu(){}function Ru(){}function zu(){}function Bu(){}function Vu(){}function Hu(){}function Uu(){}function Wu(){}function Gu(){}function Ku(){}function qu(){}function Ju(){}function Yu(){}function Xu(){}function Zu(){}function Qu(){}function $u(){}function ed(){}function td(){}function nd(){}function rd(){}function id(){}function ad(){}function od(){}function sd(){}function cd(){}function ld(){}function uee(){}function ud(){}function dd(){}function fd(){}function pd(){}function md(){}function hd(){}function gd(){}function _d(){}function vd(){}function yd(){}function bd(){}function xd(){}function Sd(){}function Cd(){}function wd(){}function Td(){}function Ed(){}function Dd(){}function Od(){}function kd(){}function Ad(){g_()}function jd(){wXe()}function Md(){NW()}function Nd(){UGe()}function Pd(){hV()}function Fd(){Tb()}function Id(){ioe()}function Ld(){RF()}function Rd(){Mke()}function zd(){Ob()}function Bd(){ID()}function Vd(){gL()}function Hd(){lH()}function Ud(){jb()}function Wd(){Sat()}function Gd(){swe()}function Kd(){LAe()}function qd(){bPe()}function Jd(){iwe()}function Yd(){rwe()}function Xd(){awe()}function Zd(){XG()}function Qd(){TPe()}function $d(){GEe()}function ef(){SPe()}function tf(){CPe()}function nf(){wPe()}function rf(){EPe()}function af(){fwe()}function of(){FP()}function sf(){$Fe()}function cf(){k8e()}function lf(){vH()}function uf(){lwe()}function df(){XGe()}function ff(){uwe()}function pf(){p5e()}function mf(){y1e()}function hf(){BW()}function gf(){nW()}function dee(){n7e()}function fee(){fBe()}function _f(){IP()}function vf(){aH()}function yf(){aW()}function bf(){BB()}function xf(){DN()}function Sf(){$G()}function Cf(){oH()}function wf(){OL()}function Tf(){rHe()}function Ef(){$W()}function Df(){$F()}function Of(){Ppe()}function kf(){d7e()}function Af(e){Wk(e)}function jf(e){this.a=e}function Mf(e){this.a=e}function Nf(e){this.a=e}function Pf(e){this.a=e}function Ff(e){this.a=e}function If(e){this.a=e}function Lf(e){this.a=e}function Rf(e){this.a=e}function zf(e){this.a=e}function Bf(e){this.a=e}function Vf(e){this.a=e}function Hf(e){this.a=e}function Uf(e){this.a=e}function Wf(e){this.c=e}function Gf(e){this.a=e}function Kf(e){this.a=e}function qf(e){this.a=e}function Jf(e){this.a=e}function Yf(e){this.a=e}function Xf(e){this.a=e}function Zf(e){this.a=e}function Qf(e){this.a=e}function $f(e){this.a=e}function ep(e){this.a=e}function tp(e){this.a=e}function pee(e){this.a=e}function np(e){this.a=e}function rp(e){this.a=e}function ip(e){this.a=e}function ap(e){this.a=e}function op(e){this.a=e}function sp(e){this.a=e}function cp(e){this.a=e}function mee(e){this.a=e}function lp(e){this.a=e}function up(e){this.a=e}function dp(e){this.a=e}function fp(e){this.a=e}function pp(e){this.a=e}function mp(e){this.a=e}function hp(e){this.a=e}function gp(e){this.a=e}function _p(e){this.a=e}function vp(e){this.b=e}function yp(){this.a=[]}function bp(e,t){e.a=t}function xp(e,t){e.a=t}function Sp(e,t){e.b=t}function Cp(e,t){e.c=t}function wp(e,t){e.c=t}function Tp(e,t){e.d=t}function Ep(e,t){e.d=t}function Dp(e,t){e.k=t}function Op(e,t){e.j=t}function kp(e,t){e.c=t}function Ap(e,t){e.c=t}function jp(e,t){e.a=t}function Mp(e,t){e.a=t}function hee(e,t){e.f=t}function Np(e,t){e.a=t}function Pp(e,t){e.b=t}function Fp(e,t){e.d=t}function Ip(e,t){e.i=t}function Lp(e,t){e.o=t}function Rp(e,t){e.r=t}function gee(e,t){e.a=t}function zp(e,t){e.b=t}function Bp(e,t){e.e=t}function _ee(e,t){e.e=t}function Vp(e,t){e.f=t}function Hp(e,t){e.f=t}function Up(e,t){e.g=t}function Wp(e,t){e.f=t}function Gp(e,t){e.a=t}function Kp(e,t){e.b=t}function qp(e,t){e.n=t}function vee(e,t){e.a=t}function yee(e,t){e.a=t}function bee(e,t){e.a=t}function xee(e,t){e.c=t}function See(e,t){e.c=t}function Cee(e,t){e.c=t}function wee(e,t){e.d=t}function Tee(e,t){e.d=t}function Eee(e,t){e.e=t}function Jp(e,t){e.e=t}function Dee(e,t){e.g=t}function Oee(e,t){e.f=t}function kee(e,t){e.j=t}function Yp(e,t){e.a=t}function Aee(e,t){e.a=t}function jee(e,t){e.b=t}function Mee(e){e.b=e.a}function Nee(e){e.c=e.d.d}function Xp(e){this.a=e}function Zp(e){this.a=e}function Qp(e){this.a=e}function $p(e){this.a=e}function Pee(e){this.a=e}function Fee(e){this.a=e}function em(e){this.a=e}function tm(e){this.a=e}function nm(e){this.a=e}function rm(e){this.a=e}function im(e){this.a=e}function am(e){this.a=e}function om(e){this.a=e}function sm(e){this.b=e}function cm(e){this.b=e}function lm(e){this.b=e}function um(e){this.d=e}function dm(e){this.a=e}function fm(e){this.a=e}function pm(e){this.a=e}function mm(e){this.a=e}function Iee(e){this.a=e}function Lee(e){this.a=e}function hm(e){this.a=e}function gm(e){this.a=e}function _m(e){this.c=e}function O(e){this.c=e}function vm(e){this.c=e}function ym(e){this.a=e}function bm(e){this.a=e}function xm(e){this.a=e}function Sm(e){this.a=e}function Cm(e){this.a=e}function wm(e){this.a=e}function Tm(e){this.a=e}function Em(e){this.a=e}function Ree(e){this.a=e}function zee(e){this.a=e}function Dm(e){this.a=e}function Bee(e){this.a=e}function Vee(e){this.a=e}function Hee(e){this.a=e}function Uee(e){this.a=e}function Om(e){this.a=e}function Wee(e){this.a=e}function Gee(e){this.a=e}function km(e){this.a=e}function Am(e){this.a=e}function Kee(e){this.a=e}function jm(e){this.a=e}function Mm(e){this.a=e}function qee(e){this.a=e}function Nm(e){this.a=e}function Pm(e){this.a=e}function Fm(e){this.a=e}function Jee(e){this.a=e}function Yee(e){this.a=e}function Im(e){this.a=e}function Lm(e){this.a=e}function Rm(e){this.a=e}function zm(e){this.a=e}function Bm(e){this.a=e}function Xee(e){this.a=e}function Vm(e){this.a=e}function Hm(e){this.a=e}function Um(e){this.a=e}function Wm(e){this.a=e}function Zee(e){this.a=e}function Qee(e){this.a=e}function $ee(e){this.a=e}function Gm(e){this.a=e}function ete(e){this.a=e}function Km(e){this.a=e}function tte(e){this.a=e}function nte(e){this.a=e}function rte(e){this.a=e}function qm(e){this.a=e}function ite(e){this.a=e}function ate(e){this.a=e}function ote(e){this.a=e}function ste(e){this.a=e}function cte(e){this.a=e}function Jm(e){this.a=e}function lte(e){this.a=e}function ute(e){this.a=e}function dte(e){this.a=e}function Ym(e){this.e=e}function Xm(e){this.a=e}function fte(e){this.a=e}function pte(e){this.a=e}function Zm(e){this.a=e}function mte(e){this.a=e}function Qm(e){this.a=e}function hte(e){this.a=e}function $m(e){this.a=e}function eh(e){this.a=e}function th(e){this.a=e}function nh(e){this.a=e}function gte(e){this.a=e}function rh(e){this.a=e}function ih(e){this.a=e}function ah(e){this.a=e}function oh(e){this.a=e}function sh(e){this.a=e}function _te(e){this.a=e}function ch(e){this.a=e}function lh(e){this.a=e}function vte(e){this.a=e}function uh(e){this.a=e}function dh(e){this.a=e}function yte(e){this.a=e}function fh(e){this.a=e}function ph(e){this.a=e}function mh(e){this.a=e}function bte(e){this.a=e}function xte(e){this.a=e}function hh(e){this.a=e}function gh(e){this.a=e}function Ste(e){this.a=e}function Cte(e){this.a=e}function wte(e){this.c=e}function Tte(e){this.b=e}function _h(e){this.a=e}function Ete(e){this.a=e}function vh(e){this.a=e}function Dte(e){this.a=e}function Ote(e){this.a=e}function kte(e){this.a=e}function Ate(e){this.a=e}function yh(e){this.a=e}function jte(e){this.a=e}function Mte(e){this.a=e}function Nte(e){this.a=e}function Pte(e){this.a=e}function bh(e){this.a=e}function Fte(e){this.a=e}function xh(e){this.a=e}function Ite(e){this.a=e}function Sh(e){this.a=e}function Lte(e){this.a=e}function Rte(e){this.a=e}function Ch(e){this.a=e}function zte(e){this.a=e}function wh(e){this.a=e}function Bte(e){this.a=e}function Vte(e){this.a=e}function Hte(e){this.a=e}function Ute(e){this.a=e}function Wte(e){this.a=e}function Th(e){this.a=e}function Eh(e){this.a=e}function Dh(e){this.a=e}function Gte(e){this.a=e}function Oh(e){this.a=e}function Kte(e){this.a=e}function kh(e){this.a=e}function qte(e){this.a=e}function Jte(e){this.a=e}function Yte(e){this.a=e}function Ah(e){this.a=e}function Xte(e){this.a=e}function Zte(e){this.a=e}function Qte(e){this.a=e}function $te(e){this.a=e}function ene(e){this.a=e}function tne(e){this.a=e}function nne(e){this.a=e}function rne(e){this.a=e}function ine(e){this.a=e}function jh(e){this.a=e}function ane(e){this.a=e}function one(e){this.a=e}function sne(e){this.a=e}function cne(e){this.a=e}function lne(e){this.a=e}function une(e){this.a=e}function Mh(e){this.a=e}function Nh(e){this.a=e}function dne(e){this.a=e}function fne(e){this.a=e}function pne(e){this.a=e}function mne(e){this.a=e}function hne(e){this.a=e}function gne(e){this.a=e}function _ne(e){this.a=e}function vne(e){this.a=e}function yne(e){this.a=e}function bne(e){this.a=e}function xne(e){this.a=e}function Sne(e){this.a=e}function Cne(e){this.a=e}function wne(e){this.a=e}function Ph(e){this.a=e}function Tne(e){this.a=e}function Ene(e){this.a=e}function Dne(e){this.a=e}function One(e){this.a=e}function kne(e){this.a=e}function Fh(e){this.a=e}function Ane(e){this.a=e}function jne(e){this.a=e}function Mne(e){this.a=e}function Nne(e){this.a=e}function Ih(e){this.a=e}function Pne(e){this.a=e}function Lh(e){this.a=e}function Rh(e){this.b=e}function Fne(e){this.f=e}function Ine(e){this.a=e}function Lne(e){this.a=e}function Rne(e){this.a=e}function zne(e){this.a=e}function Bne(e){this.a=e}function Vne(e){this.a=e}function Hne(e){this.a=e}function Une(e){this.a=e}function Wne(e){this.a=e}function zh(e){this.a=e}function Gne(e){this.a=e}function Kne(e){this.a=e}function Bh(e){this.a=e}function Vh(e){this.a=e}function qne(e){this.b=e}function Jne(e){this.c=e}function Hh(e){this.e=e}function Yne(e){this.d=e}function Uh(e){this.a=e}function Xne(e){this.a=e}function Zne(e){this.a=e}function Qne(e){this.a=e}function Wh(e){this.e=e}function Gh(){this.a=0}function Kh(){Gw(this)}function qh(){ck(this)}function Jh(){ybe(this)}function $ne(){}function Yh(){this.c=qBt}function ere(e,t){e.b+=t}function tre(e,t){t.Wb(e)}function nre(e){return e.a}function rre(e){return e.a}function ire(e){return e.a}function are(e){return e.a}function ore(e){return e.a}function k(e){return e.e}function sre(){return null}function Xh(){return null}function Zh(e){throw k(e)}function Qh(e){this.a=Sk(e)}function cre(){this.a=this}function $h(){Ble.call(this)}function lre(e){e.b.Mf(e.e)}function ure(e){e.b=new _v}function eg(e,t){e.b=t-e.b}function tg(e,t){e.a=t-e.a}function dre(e,t){t.gd(e.a)}function fre(e,t){zH(t,e)}function ng(e,t){e.push(t)}function pre(e,t){e.sort(t)}function mre(e,t,n){e.Wd(n,t)}function rg(e,t){e.e=t,t.b=e}function hre(e){LA(),Zgt.je(e)}function gre(){_y(),Cit()}function ig(){$h.call(this)}function ag(){$h.call(this)}function og(){Ble.call(this)}function _re(){$h.call(this)}function sg(){$h.call(this)}function cg(){$h.call(this)}function lg(){$h.call(this)}function ug(){$h.call(this)}function dg(){$h.call(this)}function fg(){$h.call(this)}function pg(){$h.call(this)}function vre(){$h.call(this)}function mg(){this.Bb|=256}function hg(){this.b=new Jse}function gg(){gg=E,new qh}function _g(e,t){e.length=t}function vg(e,t){zT(e.a,t)}function yre(e,t){UXe(e.c,t)}function bre(e,t){ok(e.b,t)}function xre(e,t){FB(e.a,t)}function Sre(e,t){OR(e.a,t)}function yg(e,t){pI(e.e,t)}function bg(e){nU(e.c,e.b)}function Cre(e,t){e.kc().Nb(t)}function xg(e){this.a=IBe(e)}function Sg(){this.a=new qh}function Cg(){this.a=new qh}function wg(){this.a=new Kh}function Tg(){this.a=new Kh}function Eg(){this.a=new Kh}function Dg(){this.a=new Re}function Og(){this.a=new Eke}function kg(){this.a=new Kae}function Ag(){this.a=new LCe}function jg(){this.a=new Zde}function Mg(){this.a=new it}function wre(){this.a=new TTe}function Ng(){this.a=new Kh}function Pg(){this.a=new Kh}function Fg(){this.a=new Kh}function Ig(){this.a=new Kh}function Lg(){this.d=new Kh}function Rg(){this.a=new Sg}function zg(){this.a=new qh}function Tre(){this.b=new qh}function Ere(){this.b=new Kh}function Bg(){this.e=new Kh}function Dre(){this.a=new Hd}function Ore(){this.d=new Kh}function kre(){Kh.call(this)}function Are(){ig.call(this)}function Vg(){wg.call(this)}function jre(){Fg.call(this)}function Hg(){$ne.call(this)}function Ug(){Hg.call(this)}function Wg(){_D.call(this)}function Gg(){$ne.call(this)}function Kg(){Gg.call(this)}function qg(){TSe.call(this)}function Jg(){TSe.call(this)}function Yg(){u_.call(this)}function Xg(){u_.call(this)}function Mre(){u_.call(this)}function Zg(){f_.call(this)}function Qg(){Xc.call(this)}function $g(){Xc.call(this)}function e_(){ab.call(this)}function Nre(){Ure.call(this)}function t_(){Ure.call(this)}function n_(){qh.call(this)}function Pre(){qh.call(this)}function Fre(){qh.call(this)}function r_(){iPe.call(this)}function Ire(){Sg.call(this)}function Lre(){mg.call(this)}function i_(){ZT.call(this)}function a_(){qh.call(this)}function o_(){ZT.call(this)}function s_(){qh.call(this)}function Rre(){qh.call(this)}function c_(){pl.call(this)}function zre(){c_.call(this)}function l_(){pl.call(this)}function Bre(){Dd.call(this)}function u_(){this.a=new Sg}function d_(){this.a=new qh}function f_(){this.a=new qh}function p_(){this.a=new ab}function Vre(){this.a=new Kh}function Hre(){this.j=new Kh}function Ure(){this.a=new ll}function m_(){this.a=new As}function Wre(){this.a=new iae}function h_(){h_=E,Fgt=new y_}function g_(){g_=E,jgt=new o}function __(){__=E,Pgt=new v_}function v_(){$f.call(this,``)}function y_(){$f.call(this,``)}function b_(e){lNe.call(this,e)}function x_(e){lNe.call(this,e)}function S_(e){If.call(this,e)}function C_(e){Hy.call(this,e)}function Gre(e){Hy.call(this,e)}function w_(e){C_.call(this,e)}function Kre(e){C_.call(this,e)}function qre(e){C_.call(this,e)}function T_(e){pM.call(this,e)}function E_(e){pM.call(this,e)}function Jre(e){rle.call(this,e)}function D_(e){jae.call(this,e)}function O_(e){qy.call(this,e)}function k_(e){qy.call(this,e)}function A_(e){qy.call(this,e)}function j_(e){mve.call(this,e)}function M_(e){j_.call(this,e)}function N_(){_p.call(this,{})}function P_(e){rE(),this.a=e}function F_(e){e.b=null,e.c=0}function I_(e,t){e.e=t,r3e(e,t)}function L_(e,t){e.a=t,GZe(e)}function R_(e,t,n){e.a[t.g]=n}function z_(e,t,n){sqe(n,e,t)}function B_(e,t){yfe(t.i,e.n)}function V_(e,t){lRe(e).Ad(t)}function Yre(e,t){return e*e/t}function H_(e,t){return e.g-t.g}function Xre(e,t){e.a.ec().Kc(t)}function U_(e){return new gp(e)}function Zre(e){return new Ak(e)}function W_(e){j_.call(this,e)}function G_(e){j_.call(this,e)}function K_(e){j_.call(this,e)}function q_(e){mve.call(this,e)}function J_(e){QFe(),this.a=e}function Y_(e){fve(),this.f=e}function X_(e){fve(),this.f=e}function Z_(e){Npe(),this.a=e}function Q_(e){j_.call(this,e)}function $_(e){j_.call(this,e)}function ev(e){j_.call(this,e)}function Qre(e){j_.call(this,e)}function tv(e){j_.call(this,e)}function nv(e){return Wk(e),e}function A(e){return Wk(e),e}function rv(e){return Wk(e),e}function iv(e){return Wk(e),e}function $re(e){return Wk(e),e}function av(e){return e.b==e.c}function ov(e){return!!e&&e.b}function eie(e){return!!e&&e.k}function tie(e){return!!e&&e.j}function sv(e){Wk(e),this.a=e}function cv(e){return pL(e),e}function lv(e){Xve(e,e.length)}function uv(e){j_.call(this,e)}function dv(e){j_.call(this,e)}function fv(e){j_.call(this,e)}function pv(e){j_.call(this,e)}function mv(e){j_.call(this,e)}function hv(e){j_.call(this,e)}function gv(e){lue.call(this,e,0)}function _v(){CTe.call(this,12,3)}function vv(){this.a=QE(Sk(mK))}function nie(){throw k(new fg)}function yv(){throw k(new fg)}function bv(){throw k(new fg)}function rie(){throw k(new fg)}function iie(){throw k(new fg)}function aie(){throw k(new fg)}function oie(){oie=E,Kgt=new a}function xv(){xv=E,Xgt=new v}function Sv(){Sv=E,hQ=new x}function Cv(){Cv=E,Rgt=new nle}function wv(){wv=E,t_t=new C}function Tv(){Tv=E,LA()}function Ev(){$p.call(this,``)}function Dv(){$p.call(this,``)}function Ov(){$p.call(this,``)}function kv(){$p.call(this,``)}function Av(e){G_.call(this,e)}function jv(e){G_.call(this,e)}function Mv(e){$_.call(this,e)}function Nv(e){cm.call(this,e)}function sie(e){Nv.call(this,e)}function Pv(e){mE.call(this,e)}function Fv(e,t,n){e.c.Cf(t,n)}function cie(e,t,n){t.Ad(e.a[n])}function Iv(e,t,n){t.Ne(e.a[n])}function Lv(e,t){return e.a-t.a}function lie(e,t){return e.a-t.a}function Rv(e,t){return e.a-t.a}function zv(e,t){return jN(e,t)}function j(e,t){return ZCe(e,t)}function uie(e,t){return t in e.a}function Bv(e){return e.a?e.b:0}function die(e){return e.a?e.b:0}function fie(e,t){return e.f=t,e}function pie(e,t){return e.b=t,e}function mie(e,t){return e.c=t,e}function hie(e,t){return e.g=t,e}function Vv(e,t){return e.a=t,e}function Hv(e,t){return e.f=t,e}function Uv(e,t){return e.k=t,e}function Wv(e,t){return e.a=t,e}function gie(e,t){return e.e=t,e}function Gv(e,t){return e.e=t,e}function _ie(e,t){return e.f=t,e}function vie(e,t){e.b=new Dw(t)}function yie(e,t){e._d(t),t.$d(e)}function bie(e,t){RD(),t.n.a+=e}function xie(e,t){lH(),sj(t,e)}function Kv(e,t){return e.b-t.b}function Sie(e,t){return e.g-t.g}function Cie(e,t){return e.s-t.s}function wie(e,t){return e?0:t-1}function Tie(e,t){return e?0:t-1}function Eie(e,t){return e?t-1:0}function Die(e,t){return t.pg(e)}function qv(e,t){return e.b=t,e}function Jv(e,t){return e.a=t,e}function Yv(e,t){return e.c=t,e}function Xv(e,t){return e.d=t,e}function Zv(e,t){return e.e=t,e}function Qv(e,t){return e.f=t,e}function $v(e,t){return e.a=t,e}function ey(e,t){return e.b=t,e}function ty(e,t){return e.c=t,e}function ny(e,t){return e.c=t,e}function ry(e,t){return e.b=t,e}function iy(e,t){return e.d=t,e}function ay(e,t){return e.e=t,e}function Oie(e,t){return e.f=t,e}function oy(e,t){return e.g=t,e}function sy(e,t){return e.a=t,e}function cy(e,t){return e.i=t,e}function ly(e,t){return e.j=t,e}function kie(e,t){return e.j=t,e}function Aie(e,t){return e.k=t,e}function uy(){this.a=0,this.b=0}function jie(){this.b=0,this.a=0}function Mie(e){Exe.call(this,e)}function dy(e){Exe.call(this,e)}function fy(e){tpe.call(this,e)}function py(e){EP.call(this,e)}function Nie(e){Dxe.call(this,e)}function Pie(e){Dxe.call(this,e)}function my(){mT.call(this,``)}function Fie(){Fie=E,H_t=Qqe()}function hy(){hy=E,Bzt=VKe()}function gy(){gy=E,l7=BJe()}function _y(){_y=E,T7=cF()}function vy(){vy=E,NBt=HKe()}function Iie(){Iie=E,bVt=UKe()}function yy(){yy=E,x9=HZe()}function by(e){return e.e&&e.e()}function xy(e,t){return e.c._b(t)}function Lie(e,t){return Eze(e.b,t)}function Rie(e,t){return xoe(e.a,t)}function zie(e,t){e.b=0,eF(e,t)}function Bie(e,t){e.c=t,e.b=!0}function Sy(e,t){return e.a+=t,e}function Cy(e,t){return e.a+=t,e}function wy(e,t){return e.a+=t,e}function Ty(e,t){return e.a+=t,e}function Ey(e){return XE(e),e.o}function Vie(e){Srt(),Hit(this,e)}function Hie(){throw k(new fg)}function Dy(){throw k(new fg)}function Uie(){throw k(new fg)}function Oy(){throw k(new fg)}function Wie(){throw k(new fg)}function Gie(){throw k(new fg)}function ky(e){this.a=new fb(e)}function Ay(e){this.a=new Lve(e)}function jy(e,t){for(;e.Pe(t););}function Kie(e,t){for(;e.zd(t););}function qie(e,t,n){G_e(e.a,t,n)}function Jie(e,t,n){e.splice(t,n)}function Yie(e,t){return vet(t,e)}function Xie(e,t){return e.d[t.p]}function My(e){return e.b!=e.d.c}function Zie(e){return e.l|e.m<<22}function Ny(e){return e?e.d:null}function Qie(e){return e?e.g:null}function $ie(e){return e?e.i:null}function eae(e,t){return t3e(e,t)}function Py(e){return zk(e),e.a}function tae(e){e.c?X3e(e):Z3e(e)}function nae(){this.b=new RU(gjt)}function rae(){this.b=new RU(yFt)}function iae(){this.b=new RU(yFt)}function Fy(){this.a=new RU(GMt)}function aae(){this.a=new RU($Nt)}function Iy(e){this.a=0,this.b=e}function Ly(){throw k(new fg)}function oae(){throw k(new fg)}function sae(){throw k(new fg)}function Ry(){throw k(new fg)}function cae(){throw k(new fg)}function lae(){throw k(new fg)}function uae(){throw k(new fg)}function dae(){throw k(new fg)}function fae(){throw k(new fg)}function pae(){throw k(new fg)}function mae(){throw k(new pg)}function hae(){throw k(new pg)}function zy(e){this.a=new Rae(e)}function By(e){this.b=I(Sk(e),92)}function gae(e,t){this.b=e,this.c=t}function Vy(e,t){this.e=e,this.d=t}function Hy(e){eE(e.dc()),this.c=e}function _ae(e,t){this.a=e,this.b=t}function vae(e,t){this.a=e,this.b=t}function yae(e,t){this.a=e,this.b=t}function bae(e,t){this.a=e,this.b=t}function xae(e,t){this.a=e,this.b=t}function Sae(e,t){this.a=e,this.b=t}function Cae(e,t){this.a=e,this.b=t}function wae(e,t){this.b=e,this.a=t}function Uy(e,t){this.g=e,this.i=t}function Tae(e,t){this.b=e,this.a=t}function Wy(e,t){QT.call(this,e,t)}function Gy(e,t){Wy.call(this,e,t)}function Eae(e,t){this.a=e,this.b=t}function Dae(e,t){this.a=e,this.b=t}function Oae(e,t){this.b=e,this.a=t}function kae(e,t){this.b=e,this.a=t}function Ky(e,t){this.f=e,this.g=t}function qy(e){this.b=I(Sk(e),50)}function Jy(e,t){this.a=e,this.b=t}function Yy(e,t){this.a=e,this.f=t}function Aae(e){this.a=I(Sk(e),16)}function jae(e){this.a=I(Sk(e),16)}function Mae(e,t){this.b=e,this.c=t}function Nae(e){this.a=I(Sk(e),92)}function Pae(e,t){this.a=e,this.b=t}function Fae(e,t){this.a=e,this.b=t}function Iae(e,t){return tk(e.b,t)}function Lae(e,t){return e>t&&t<GK}function Xy(e){return j9[e]!=-1}function Zy(e){return!e||mbe(e)}function Rae(e){FPe(this,e,OXe())}function Qy(e,t){aU(B(e.a),t)}function $y(e,t){aU(B(e.a),t)}function zae(e,t){return e.b.Hc(t)}function eb(e,t){return e.b.Gc(t)}function Bae(e,t){return e.b.Oc(t)}function Vae(e,t){return e.c.uc(t)}function Hae(e,t){return e.b.Gc(t)}function Uae(e,t){return uR(e.c,t)}function Wae(e){return Eye(),e?e_t:$gt}function tb(e){return e.f.c+e.i.c}function nb(e,t){return e.a._b(t)}function rb(e,t){this.a=e,this.b=t}function ib(e){this.c=e,yMe(this)}function ab(){gT(this),bA(this)}function ob(){ob=E,J_t=new Yse}function sb(){sb=E,zQ=new re}function cb(){cb=E,b_t=new ee}function lb(){lb=E,Y_t=new Xse}function ub(){ub=E,cvt=new _e}function db(){pQ!=0&&(pQ=0),mQ=-1}function Gae(){wgt??=[]}function fb(e){rRe.call(this,e,0)}function Kae(){Lve.call(this,null)}function pb(){fN.call(this,null)}function mb(){mb=E,WQ=new De}function hb(e,t){zk(e),e.a.Nb(t)}function qae(e,t){return e.a.Vc(t)}function Jae(e,t){return e.a.Wc(t)}function gb(e,t){return e.a.Yc(t)}function _b(e,t){return e.a.Zc(t)}function Yae(e,t){return e.Fc(t),e}function Xae(e,t){return e.a.f=t,e}function vb(e,t){return e.a.d=t,e}function Zae(e,t){return e.a.g=t,e}function yb(e,t){return e.a.j=t,e}function bb(e,t){return e.a.a=t,e}function xb(e,t){return e.a.d=t,e}function Sb(e,t){return e.a.e=t,e}function Cb(e,t){return e.a.g=t,e}function wb(e,t){return e.a.f=t,e}function Qae(e){return e.b=!1,e}function Tb(){Tb=E,axt=new uy}function Eb(){Eb=E,wbt=new ft}function $ae(){$ae=E,Tbt=new gt}function eoe(){eoe=E,kbt=new nve}function toe(){toe=E,xvt=new Me}function noe(){noe=E,zbt=new bt}function roe(){roe=E,Gbt=new jt}function Db(){Db=E,qbt=new Mt}function Ob(){Ob=E,oxt=new cn}function ioe(){ioe=E,Xxt=new Un}function kb(){kb=E,$Ot=new Kc}function Ab(){Ab=E,uSt=new Ei}function jb(){jb=E,E1=new Zi}function Mb(){Mb=E,xFt=new ooe}function Nb(){Nb=E,wFt=new Fue}function Pb(){Pb=E,l6=new xbe}function aoe(){xPe(),this.c=new _v}function ooe(){Ky.call(this,gct,0)}function soe(e,t,n,r){tWe(e,r,t,n)}function coe(e,t,n,r){q2e(r,e,t,n)}function loe(e,t,n,r){vrt(r,e,t,n)}function uoe(e,t,n){cj(e.d,t.f,n)}function Fb(e,t){tB(e.c.b,t.c,t)}function Ib(e,t){tB(e.c.c,t.b,t)}function Lb(e,t){return e.a=t.g,e}function Rb(){Rb=E,Rzt=new Yc}function doe(){doe=E,Zzt=new fl}function foe(){foe=E,ABt=new Pre}function poe(){poe=E,jBt=new Fre}function zb(){zb=E,V7=new a_}function moe(){moe=E,MBt=new Rre}function Bb(){Bb=E,D7=new qh}function hoe(){hoe=E,aVt=new Kh}function Vb(){Vb=E,JBt=new AT}function Hb(){Hb=E,u9=new tle}function Ub(){Ub=E,fVt=new Du}function Wb(){Wb=E,mVt=new Ou}function Gb(){Gb=E,G9=new kd}function Kb(){this.q=new r.Date}function goe(e){this.a=I(Sk(e),229)}function qb(e){return I(e,45).jd()}function _oe(e){return(e.c+e.a)/2}function voe(e){return e.e.a+e.f.a}function yoe(e){return e.e.b+e.f.b}function boe(e){return e.b?e.b:e.a}function xoe(e,t){return e.a.a.cc(t)}function Soe(e,t){return rKe(e.a,t)}function Jb(e,t){return JL(e,t)>0}function Yb(e,t){return JL(e,t)<0}function Coe(e,t){return t.split(e)}function Xb(e){return e.b<e.d.gc()}function woe(e,t){return L_e(e.a,t)}function Zb(e,t){ECe.call(this,e,t)}function Qb(e){axe(),SXe.call(this,e)}function Toe(e){axe(),Qb.call(this,e)}function Eoe(e){n_e(),rle.call(this,e)}function Doe(e,t){F_e(e,e.length,t)}function $b(e,t){yye(e,e.length,t)}function ex(e,t){return e.a.get(t)}function Ooe(e,t){return tk(e.e,t)}function koe(e){return Wk(e),!1}function tx(){return Fie(),new H_t}function nx(e){return VE(e.a),e.b}function Aoe(e,t){this.b=e,this.a=t}function rx(e,t){this.d=e,this.e=t}function ix(e,t){this.a=e,this.b=t}function joe(e,t){this.a=e,this.b=t}function Moe(e,t){this.a=e,this.b=t}function ax(e,t){this.a=e,this.b=t}function Noe(e,t){this.b=e,this.a=t}function ox(e,t){this.a=e,this.b=t}function sx(e,t){Ky.call(this,e,t)}function cx(e,t){Ky.call(this,e,t)}function lx(e,t){Ky.call(this,e,t)}function ux(e,t){Ky.call(this,e,t)}function dx(e,t){Ky.call(this,e,t)}function fx(e,t){Ky.call(this,e,t)}function px(e){yj.call(this,e,21)}function mx(e,t){this.b=e,this.a=t}function hx(e,t){this.b=e,this.a=t}function Poe(e,t){this.b=e,this.a=t}function gx(e,t){Ky.call(this,e,t)}function _x(e,t){Ky.call(this,e,t)}function vx(e,t){Ky.call(this,e,t)}function yx(e,t){this.b=e,this.a=t}function bx(e,t){this.c=e,this.d=t}function xx(e,t){Ky.call(this,e,t)}function Sx(e,t){Ky.call(this,e,t)}function Cx(e,t){this.e=e,this.d=t}function wx(e,t){Ky.call(this,e,t)}function Tx(e,t){this.a=e,this.b=t}function Foe(e,t){Ky.call(this,e,t)}function Ex(e,t){Ky.call(this,e,t)}function Dx(e,t){Ky.call(this,e,t)}function Ox(e,t,n){e.splice(t,0,n)}function Ioe(e,t,n){e.Mb(n)&&t.Ad(n)}function Loe(e,t,n){t.Ne(e.a.We(n))}function Roe(e,t,n){t.Bd(e.a.Xe(n))}function zoe(e,t,n){t.Ad(e.a.Kb(n))}function Boe(e,t){return CE(e.c,t)}function Voe(e,t){return CE(e.e,t)}function Hoe(e,t){this.a=e,this.b=t}function Uoe(e,t){this.a=e,this.b=t}function Woe(e,t){this.a=e,this.b=t}function Goe(e,t){this.a=e,this.b=t}function Koe(e,t){this.a=e,this.b=t}function qoe(e,t){this.a=e,this.b=t}function Joe(e,t){this.a=e,this.b=t}function kx(e,t){this.a=e,this.b=t}function Ax(e,t){this.b=e,this.a=t}function jx(e,t){this.b=e,this.a=t}function Mx(e,t){this.b=e,this.a=t}function Yoe(e,t){this.b=t,this.c=e}function Nx(e,t){Ky.call(this,e,t)}function Px(e,t){Ky.call(this,e,t)}function Fx(e,t){Ky.call(this,e,t)}function Ix(e,t){Ky.call(this,e,t)}function Lx(e,t){Ky.call(this,e,t)}function Rx(e,t){Ky.call(this,e,t)}function zx(e,t){Ky.call(this,e,t)}function Bx(e,t){Ky.call(this,e,t)}function Vx(e,t){Ky.call(this,e,t)}function Hx(e,t){Ky.call(this,e,t)}function Ux(e,t){Ky.call(this,e,t)}function Wx(e,t){Ky.call(this,e,t)}function Gx(e,t){Ky.call(this,e,t)}function Kx(e,t){Ky.call(this,e,t)}function qx(e,t){Ky.call(this,e,t)}function Jx(e,t){Ky.call(this,e,t)}function Yx(e,t){Ky.call(this,e,t)}function Xx(e,t){Ky.call(this,e,t)}function Zx(e,t){Ky.call(this,e,t)}function Qx(e,t){Ky.call(this,e,t)}function $x(e,t){Ky.call(this,e,t)}function eS(e,t){Ky.call(this,e,t)}function tS(e,t){Ky.call(this,e,t)}function nS(e,t){Ky.call(this,e,t)}function rS(e,t){Ky.call(this,e,t)}function iS(e,t){Ky.call(this,e,t)}function aS(e,t){Ky.call(this,e,t)}function oS(e,t){Ky.call(this,e,t)}function sS(e,t){Ky.call(this,e,t)}function cS(e,t){Ky.call(this,e,t)}function lS(e,t){Ky.call(this,e,t)}function uS(e,t){Ky.call(this,e,t)}function dS(e,t){Ky.call(this,e,t)}function fS(e,t){Ky.call(this,e,t)}function pS(e,t){Ky.call(this,e,t)}function mS(e,t){this.b=e,this.a=t}function hS(e,t){Ky.call(this,e,t)}function Xoe(e,t){this.a=e,this.b=t}function gS(e,t){this.a=e,this.b=t}function _S(e,t){this.a=e,this.b=t}function vS(e,t){Ky.call(this,e,t)}function yS(e,t){Ky.call(this,e,t)}function Zoe(e,t){this.a=e,this.b=t}function Qoe(e,t){return JD(),t!=e}function bS(e){return a1e(e,e.c),e}function $oe(e){r.clearTimeout(e)}function xS(e,t){Ky.call(this,e,t)}function SS(e,t){Ky.call(this,e,t)}function ese(e,t){this.a=e,this.b=t}function tse(e,t){this.a=e,this.b=t}function nse(e,t){this.b=e,this.d=t}function rse(e,t){this.a=e,this.b=t}function ise(e,t){this.b=e,this.a=t}function CS(e,t){Ky.call(this,e,t)}function wS(e,t){Ky.call(this,e,t)}function TS(e,t){Ky.call(this,e,t)}function ES(e,t){Ky.call(this,e,t)}function DS(e,t){Ky.call(this,e,t)}function ase(e,t){this.b=e,this.a=t}function ose(e,t){this.b=e,this.a=t}function OS(e,t){this.b=e,this.a=t}function sse(e,t){this.b=e,this.a=t}function kS(e,t){Ky.call(this,e,t)}function AS(e,t){Ky.call(this,e,t)}function jS(e,t){Ky.call(this,e,t)}function MS(e,t){Ky.call(this,e,t)}function NS(e,t){Ky.call(this,e,t)}function PS(e,t){Ky.call(this,e,t)}function FS(e,t){Ky.call(this,e,t)}function IS(e,t){Ky.call(this,e,t)}function LS(e,t){Ky.call(this,e,t)}function RS(e,t){Ky.call(this,e,t)}function zS(e,t){Ky.call(this,e,t)}function BS(e,t){Ky.call(this,e,t)}function VS(e,t){Ky.call(this,e,t)}function HS(e,t){Ky.call(this,e,t)}function US(e,t){Ky.call(this,e,t)}function WS(e,t){Ky.call(this,e,t)}function GS(e,t){Ky.call(this,e,t)}function KS(e,t){this.a=e,this.b=t}function cse(e,t){this.a=e,this.b=t}function qS(e,t){this.a=e,this.b=t}function JS(e,t){return CE(e.g,t)}function lse(e,t){return CE(t.b,e)}function use(e,t){return-e.b.$e(t)}function YS(e,t){Ky.call(this,e,t)}function XS(e,t){Ky.call(this,e,t)}function ZS(e,t){Ky.call(this,e,t)}function QS(e,t){Ky.call(this,e,t)}function $S(e,t){Ky.call(this,e,t)}function eC(e,t){Ky.call(this,e,t)}function tC(e,t){Ky.call(this,e,t)}function nC(e,t){Ky.call(this,e,t)}function rC(e,t){Ky.call(this,e,t)}function iC(e,t){Ky.call(this,e,t)}function aC(e,t){Ky.call(this,e,t)}function oC(e,t){Ky.call(this,e,t)}function sC(e,t){Ky.call(this,e,t)}function cC(e,t){Ky.call(this,e,t)}function lC(e,t){Ky.call(this,e,t)}function uC(e,t){Ky.call(this,e,t)}function dC(e,t){Ky.call(this,e,t)}function fC(e,t){Ky.call(this,e,t)}function pC(e,t){Ky.call(this,e,t)}function mC(e,t){Ky.call(this,e,t)}function hC(e,t){Ky.call(this,e,t)}function gC(e,t){Ky.call(this,e,t)}function _C(e,t){this.a=e,this.b=t}function dse(e,t){this.a=e,this.b=t}function fse(e,t){this.a=e,this.b=t}function M(e,t){this.a=e,this.b=t}function pse(e,t){this.a=e,this.b=t}function mse(e,t){this.a=e,this.b=t}function hse(e,t){this.a=e,this.b=t}function vC(e,t){this.a=e,this.b=t}function yC(e,t){Ky.call(this,e,t)}function bC(e,t){this.a=e,this.b=t}function gse(e,t){this.a=e,this.b=t}function _se(e,t){this.a=e,this.b=t}function vse(e,t){this.a=e,this.b=t}function xC(e,t){this.a=e,this.b=t}function yse(e,t){this.a=e,this.b=t}function SC(e,t){this.b=e,this.a=t}function CC(e,t){this.b=e,this.a=t}function wC(e,t){this.b=e,this.a=t}function TC(e,t){this.b=e,this.a=t}function bse(e,t){this.a=e,this.b=t}function xse(e,t){this.a=e,this.b=t}function Sse(e,t){this.a=e,this.b=t}function Cse(e,t){this.a=e,this.b=t}function EC(e,t){Ky.call(this,e,t)}function wse(e,t){this.f=e,this.c=t}function Tse(){dwe(),this.b=new Sg}function Ese(){UU(),this.a=new Sg}function Dse(){LD(),this.a=new efe}function DC(e,t){this.a=e,this.b=t}function Ose(e,t){this.a=e,this.b=t}function OC(e,t){this.i=e,this.g=t}function kC(e,t){this.d=e,this.e=t}function AC(e,t){this.a=e,this.b=t}function kse(e,t){this.a=e,this.b=t}function Ase(e,t){this.d=e,this.b=t}function jse(e,t){this.e=e,this.a=t}function jC(e,t){e.i=null,TF(e,t)}function Mse(e,t){e&&Yk(C7,e,t)}function Nse(e,t){return yz(e.a,t)}function MC(e){return bz(e.c,e.b)}function NC(e){return typeof e===sK}function PC(e){return typeof e===Aat}function FC(e){return typeof e===cK}function N(e){return e??null}function IC(e){return $D(e==null),e}function LC(e){return e?e.kd():null}function Pse(e){return iz(e),e.d.gc()}function RC(e,t){return e.Pd().Xb(t)}function zC(e,t){return FFe(e.Jc(),t)}function Fse(e,t){vMe(new XT(e),t)}function Ise(e,t,n){Tqe(t,kH(e,n))}function Lse(e,t,n){Tqe(t,kH(e,n))}function BC(e,t){Jje(e.a,I(t,12))}function VC(e,t){this.a=e,this.b=t}function HC(e,t){this.b=e,this.c=t}function UC(e,t){return JL(e,t)==0}function WC(e,t){return JL(e,t)>=0}function GC(e,t){return JL(e,t)!=0}function KC(e,t){return e.a+=``+t,e}function Rse(e){return``+(Wk(e),e)}function zse(e,t){e.q.setTime(Bj(t))}function qC(e,t){return e.a+=``+t,e}function JC(e,t){return e.a+=``+t,e}function YC(e,t){return e.a+=``+t,e}function XC(e,t){return e.a+=``+t,e}function ZC(e,t){return e.a+=``+t,e}function QC(e){return bj(e,0),null}function Bse(e){ck(this),rI(this,e)}function Vse(e,t){Fve.call(this,e,t)}function Hse(e,t){Fve.call(this,e,t)}function $C(e,t){Fve.call(this,e,t)}function Use(){cwe(),ESe.call(this)}function ew(){cwe(),ESe.call(this)}function Wse(){owe(),ave.call(this)}function Gse(){Gse=E,jjt=VL(ZFe())}function Kse(){Kse=E,ayt=VL(nB())}function qse(){qse=E,Yxt=VL(D4e())}function Jse(){this.b=new fb(_I(12))}function Yse(){this.b=0,this.a=!1}function Xse(){this.b=0,this.a=!1}function tw(e,t){xM(e,t,e.a,e.a.a)}function nw(e,t){xM(e,t,e.c.b,e.c)}function rw(e,t){Bb(),Yk(D7,e,t)}function iw(e,t){hD.call(this,e,t)}function aw(e,t){wD.call(this,e,t)}function ow(e,t){OC.call(this,e,t)}function sw(e,t){EE.call(this,e,t)}function cw(e,t){DI.call(this,e,t)}function lw(e){this.a=e,Ad.call(this)}function Zse(e){this.a=e,Ad.call(this)}function uw(e){return e.a=0,e.b=0,e}function Qse(e,t){return e.a=t.g+1,e}function $se(e,t){return e.j[t.p]==2}function dw(e,t){return MA(e.a,0,t)}function ece(e,t){return yR(e.a,t.a)}function fw(e,t){return lT(e.a,t.a)}function tce(e,t){return fye(e.a,t.a)}function nce(e,t){return N(e)===N(t)}function pw(e,t){return e.indexOf(t)}function rce(e){return Sk(e),new lw(e)}function mw(e){return dT(e.l,e.m,e.h)}function hw(e){return GA((Wk(e),e))}function ice(e){return GA((Wk(e),e))}function gw(e,t){return lT(e.g,t.g)}function _w(e){return typeof e===Aat}function vw(e){return e==w$||e==T$}function ace(e){return e==w$||e==D$}function yw(e){return e<10?`0`+e:``+e}function bw(e){return HN(e.b.b,e,0)}function xw(e,t){AN(e,0,e.length,t)}function Sw(e,t){return zT(e.a,t),t}function Cw(e,t){return RD(),t.a+=e}function ww(e,t){return RD(),t.a+=e}function oce(e,t){return RD(),t.c+=e}function Tw(e,t){return zT(e.c,t),e}function Ew(e,t){return fI(e.a,t),e}function sce(e){this.a=tx(),this.b=e}function cce(e){this.a=tx(),this.b=e}function Dw(e){this.a=e.a,this.b=e.b}function Ow(){hm.call(this,new _M)}function lce(){hO.call(this,0,0,0,0)}function kw(){fA.call(this,0,0,0,0)}function Aw(e){return fI(new Hk,e)}function uce(e){return Ybe(I(e,125))}function jw(e){return e.sh()&&e.th()}function Mw(e){return e!=i5&&e!=a5}function Nw(e){return e==y8||e==b8}function Pw(e){return e==S8||e==v8}function dce(e){return e==T4||e==w4}function fce(e,t){return yR(t.f,e.f)}function pce(e,t){return lT(e.g,t.g)}function mce(e,t){return new DI(t,e)}function hce(e,t){return new DI(t,e)}function Fw(e,t,n){UP(e,t),WP(e,n)}function Iw(e,t,n){qP(e,t),HP(e,n)}function Lw(e,t,n){JP(e,t),YP(e,n)}function Rw(e,t,n){GP(e,t),KP(e,n)}function zw(e,t,n){XP(e,t),ZP(e,n)}function Bw(e,t){LL(e,t),tF(e,e.D)}function Vw(e){wse.call(this,e,!0)}function gce(e,t,n){sde.call(this,e,t,n)}function _ce(){sx.call(this,`Head`,1)}function Hw(){sx.call(this,`Tail`,3)}function Uw(e){mW(),zFe.call(this,e)}function Ww(e){hO.call(this,e,e,e,e)}function Gw(e){e.c=H(sQ,hK,1,0,5,1)}function vce(e){AP(e.Qf(),new jm(e))}function Kw(e){return e==null?0:zF(e)}function yce(e,t){return DP(t,$A(e))}function bce(e,t){return DP(t,$A(e))}function xce(e,t){return e[e.length]=t}function Sce(e,t){return e[e.length]=t}function Cce(e,t){return yF(Vye(e.f),t)}function wce(e,t){return yF(Vye(e.n),t)}function Tce(e,t){return yF(Vye(e.p),t)}function qw(e){return Vhe(e.b.Jc(),e.a)}function Ece(e){return e==null?0:zF(e)}function Jw(e,t){hD.call(this,e.b,t)}function Dce(e,t){gN(lM(e.a),bwe(t))}function Oce(e,t){gN(JN(e.a),xwe(t))}function kce(e,t,n){Lw(n,n.i+e,n.j+t)}function Yw(e,t,n){Ek(e.c[t.g],t.g,n)}function Ace(e,t,n){I(e.c,72).Ei(t,n)}function Xw(e,t,n){return Ek(e,t,n),n}function jce(e,t){VQ||(e.b=t)}function Zw(){Zw=E,gg(),Qgt=new qh}function Qw(){Qw=E,qAt=new oz(kRt)}function $w(){$w=E,r.Math.log(2)}function eT(){eT=E,f9=(doe(),Zzt)}function tT(){tT=E,new nT,new Kh}function nT(){new qh,new qh,new qh}function Mce(){throw k(new uv(xgt))}function Nce(){throw k(new uv(bgt))}function Pce(){throw k(new uv(bgt))}function Fce(){throw k(new uv(xgt))}function rT(e){tK(),Wh.call(this,e)}function Ice(e){this.a=e,Whe.call(this,e)}function iT(e){this.a=e,By.call(this,e)}function aT(e){this.a=e,By.call(this,e)}function oT(e,t){I_e(e.c,e.c.length,t)}function sT(e){return e.a<e.c.c.length}function cT(e){return e.a<e.c.a.length}function Lce(e,t){return e.a?e.b:t.Ue()}function lT(e,t){return e<t?-1:+(e>t)}function uT(e,t){return JL(e,t)>0?e:t}function dT(e,t,n){return{l:e,m:t,h:n}}function fT(e,t){e.a!=null&&BC(t,e.a)}function Rce(e){ij(e,null),oj(e,null)}function zce(e,t,n){return Yk(e.g,n,t)}function Bce(e,t){Sk(t),nA(e).Ic(new h)}function Vce(){wV(),this.a=new RU(Sbt)}function pT(e){this.b=e,this.a=new Kh}function Hce(e){this.b=new nt,this.a=e}function mT(e){Xde.call(this),this.a=e}function Uce(e){DSe.call(this),this.b=e}function Wce(){sx.call(this,`Range`,2)}function hT(e){e.j=H(y_t,kK,325,0,0,1)}function gT(e){e.a=new de,e.c=new de}function Gce(e){e.a=new qh,e.e=new qh}function _T(e){mwe(e,null),hwe(e,null)}function Kce(e,t,n){return _nt(e,t,n),n}function qce(e,t){return fj(),t.n.b+=e}function vT(e,t,n){return lHe(t,n,e.c)}function Jce(e,t,n){return Yk(e.k,n,t)}function Yce(e,t){return Yk(e.a,t.a,t)}function Xce(e,t){return xnt(e.a,t,null)}function yT(e,t){return F(Dk(e.i,t))}function bT(e,t){return F(Dk(e.j,t))}function xT(e,t){return ctt(e.c,e.b,t)}function ST(e){return new M(e.c,e.d)}function CT(e){return new M(e.c,e.d)}function wT(e){return new M(e.a,e.b)}function P(e,t){return e!=null&&SB(e,t)}function TT(e,t){return rLe(e.Jc(),t)!=-1}function ET(e){return e.Ob()?e.Pb():null}function DT(e,t){return new kle(e.Jc(),t)}function Zce(e,t){e.q.setHours(t),qW(e,t)}function Qce(e,t,n){e.c._c(t,I(n,136))}function $ce(e,t,n){e.c.Si(t,I(n,136))}function ele(e,t){bG(e),e.Fc(I(t,16))}function OT(e,t){return e.a.Ac(t)!=null}function kT(e){return Lz(e,0,e.length)}function AT(){EE.call(this,null,null)}function tle(){DE.call(this,null,null)}function nle(){Ky.call(this,`INSTANCE`,0)}function rle(e){this.a=(_A(),new Nv(e))}function ile(e){this.b=(_A(),new _m(e))}function jT(e){this.a=e,qh.call(this)}function MT(){this.a=H(sQ,hK,1,8,5,1)}function ale(e,t,n,r){Ek(e.a[t.g],n.g,r)}function NT(e,t,n){return e.a[t.g][n.g]}function PT(e,t){return e.a[t.c.p][t.p]}function ole(e,t){return e.c[t.c.p][t.p]}function sle(e,t){return e.e[t.c.p][t.p]}function cle(e,t){return e.j[t.p]=u2e(t)}function FT(e,t){return Ske(e.f,t.Og())}function lle(e,t){return A(F(t.a))<=e}function ule(e,t){return A(F(t.a))>=e}function IT(e,t){return e.a.Ac(t)!=null}function dle(e,t){return e.a<epe(t)?-1:1}function LT(e,t){return e.a*t.a+e.b*t.b}function fle(e,t){return Ske(e.b,t.Og())}function ple(e,t,n){return n?t!=0:t!=e-1}function mle(e,t,n){e.a=t^1502,e.b=n^Not}function hle(e,t,n){return e.a=t,e.b=n,e}function RT(e,t){return e.a*=t,e.b*=t,e}function zT(e,t){return ng(e.c,t),!0}function BT(e,t,n){return Ek(e.g,t,n),n}function VT(e,t){e.c&&(Ege(t),fCe(t))}function HT(e,t,n){UT.call(this,e,t,n)}function UT(e,t,n){YD.call(this,e,t,n)}function WT(e,t,n){XD.call(this,e,t,n)}function gle(e,t,n){XD.call(this,e,t,n)}function _le(e,t,n){WT.call(this,e,t,n)}function GT(e,t,n){UT.call(this,e,t,n)}function vle(e,t,n){HT.call(this,e,t,n)}function KT(e,t,n){YD.call(this,e,t,n)}function qT(e,t,n){YD.call(this,e,t,n)}function JT(e,t,n){KT.call(this,e,t,n)}function YT(e){this.c=e,this.a=this.c.a}function XT(e){this.i=e,this.f=this.i.j}function ZT(){this.Bb|=256,this.Bb|=512}function QT(e,t){this.a=e,By.call(this,t)}function $T(e,t){return PBe(e,new Ov,t).a}function eE(e){if(!e)throw k(new lg)}function tE(e){if(!e)throw k(new ug)}function nE(){nE=E,nE(),$_t=new me}function yle(){yle=E,Ub(),pVt=new kf}function rE(){rE=E,q_t=new P_(null)}function ble(e){PA(e,amt),DU(e,Lrt(e))}function xle(e){e.a=I(xI(e.b.a,4),129)}function Sle(e){e.a=I(xI(e.b.a,4),129)}function iE(e){e.b.Qb(),--e.d.f.d,kO(e.d)}function aE(e){this.a=e,Wf.call(this,e.d)}function Cle(e,t){this.a=e,gv.call(this,t)}function wle(e,t){this.a=e,gv.call(this,t)}function Tle(e,t){this.a=e,gv.call(this,t)}function oE(e,t){this.a=t,gv.call(this,e)}function Ele(e,t){this.a=t,pM.call(this,e)}function Dle(e,t){this.a=e,pM.call(this,t)}function Ole(e,t){this.a=t,qy.call(this,e)}function kle(e,t){this.a=t,qy.call(this,e)}function sE(e,t){return Sk(t),new Ole(e,t)}function Ale(e,t){return new DZe(e.a,e.b,t)}function cE(e,t){return e.lastIndexOf(t)}function lE(e,t,n){return e.indexOf(t,n)}function uE(e){return e==null?gK:tz(e)}function jle(e){return e==null?null:e.name}function Mle(e){return e.l+e.m*pq+e.h*mq}function Nle(e){return My(e.a)?Swe(e):null}function Ple(e){$f.call(this,I(Sk(e),35))}function Fle(e){$f.call(this,I(Sk(e),35))}function dE(e){$p.call(this,(Wk(e),e))}function fE(e){$p.call(this,(Wk(e),e))}function pE(e){hm.call(this,new PAe(e))}function mE(e){cm.call(this,e),this.a=e}function Ile(e){lm.call(this,e),this.a=e}function Lle(e){Nv.call(this,e),this.a=e}function Rle(e){kg.call(this),qF(this,e)}function zle(e){this.a=e,sm.call(this,e)}function Ble(){hT(this),xA(this),this.he()}function hE(){hE=E,vQ=!1,yQ=!0}function gE(e,t,n){return dI(e,t,t,n),e}function Vle(e,t){return zT(t.b,e.a),e.a}function Hle(e,t){return zT(t.a,e.a),e.a}function _E(e,t){return zT(t.a,e.a),e.a}function vE(e){return VE(e.a!=null),e.a}function yE(e){return e.a==null?null:e.a}function bE(e){return e.$H||=++vvt}function xE(e){return sT(e.a)||sT(e.b)}function Ule(e,t){return yR(e.c.d,t.c.d)}function Wle(e,t){return yR(e.c.c,t.c.c)}function Gle(e,t){return yR(e.n.a,t.n.a)}function SE(e,t){return I(BM(e.b,t),16)}function Kle(e,t){return e.n.b=(Wk(t),t)}function qle(e,t){return e.n.b=(Wk(t),t)}function CE(e,t){return!!t&&e.b[t.g]==t}function Jle(e,t){return yR(e.e.b,t.e.b)}function Yle(e,t){return yR(e.e.a,t.e.a)}function Xle(e,t,n){return fDe(e,t,n,e.b)}function Zle(e,t,n){return fDe(e,t,n,e.c)}function Qle(e){return RD(),!!e&&!e.dc()}function wE(e,t){return++e.b,zT(e.a,t)}function $le(e,t){return++e.b,VN(e.a,t)}function eue(e,t){JHe.call(this,e,t,null)}function TE(e,t){fve(),this.f=t,this.d=e}function EE(e,t){Vb(),this.a=e,this.b=t}function DE(e,t){Hb(),this.b=e,this.c=t}function tue(){Ab(),this.b=new th(this)}function OE(e){this.d=e,XT.call(this,e)}function kE(e){this.c=e,XT.call(this,e)}function AE(e){this.c=e,OE.call(this,e)}function nue(e,t,n,r){hve.call(this,e,t,n,r)}function rue(e,t,n){I(WN(e,t),22).Ec(n)}function iue(e,t,n){OR(e.a,n),FB(e.a,t)}function aue(e,t){return cve(e.c).Kd().Xb(t)}function jE(e,t){return new Bfe(e,e.gc(),t)}function oue(e){return++W9,new sM(3,e)}function ME(e){return vF(e,KK),new mN(e)}function sue(e){return Cv(),oF((FCe(),Bgt),e)}function cue(e){return LA(),parseInt(e)||-1}function NE(e,t,n){return lE(e,$V(t),n)}function PE(e,t,n){e.dd(t).Rb(n)}function FE(e){var t=e.a;e.a=e.b,e.b=t}function lue(e,t){bke(t,e),this.c=e,this.b=t}function uue(e,t){return dI(e,t,t+1,``),e}function IE(e){return VE(e.b!=0),e.a.a.c}function LE(e){return VE(e.b!=0),e.c.b.c}function RE(){RE=E,r$=new hD(_st,0)}function due(e){return e.b=I(Lxe(e.a),45)}function fue(e){return e.f==null?``+e.g:e.f}function zE(e){return e.f==null?``+e.g:e.f}function pue(e){e.d=new yue(e),e.e=new qh}function mue(e){if(!e)throw k(new sg)}function hue(e){if(!e)throw k(new lg)}function BE(e){if(!e)throw k(new ug)}function gue(e){if(!e)throw k(new ag)}function VE(e){if(!e)throw k(new pg)}function _ue(e){lb(),this.b=e,this.a=!0}function HE(e){ob(),this.b=e,this.a=!0}function vue(e){qG(),ure(this),this.Df(e)}function yue(e){Ghe.call(this,e,null,null)}function bue(e){this.c=e,this.a=1,this.b=1}function xue(e){return IP(),e.e.b+e.f.b/2}function Sue(e){return IP(),e.e.a+e.f.a/2}function Cue(e,t,n){return IP(),n.e.a-e*t}function wue(e,t,n){return IP(),n.e.b-e*t}function Tue(e,t,n){return kb(),n.Lg(e,t)}function Eue(e,t){return lH(),XH(e,t.e,t)}function Due(e,t,n){return zT(t,gVe(e,n))}function UE(e,t){return I(sP(e.a,t),35)}function WE(e,t){return!!e.q&&tk(e.q,t)}function Oue(e,t){return e>0?t*t/e:t*t*100}function kue(e,t){return e>0?t/(e*e):t*100}function Aue(e,t){return e.a=t.a,e.b=t.b,e}function GE(e){return e.a=-e.a,e.b=-e.b,e}function jue(e,t,n){return e.a-=t,e.b-=n,e}function KE(e,t,n){return e.a+=t,e.b+=n,e}function Mue(e,t,n){DN(),e.nf(t)&&n.Ad(e)}function Nue(e){this.c=e,JP(e,0),YP(e,0)}function Pue(e){ab.call(this),pF(this,e)}function Fue(){Ky.call(this,`GROW_TREE`,0)}function qE(e,t,n){bN.call(this,e,t,n,2)}function Iue(e,t){Vb(),EE.call(this,e,t)}function Lue(e,t){Hb(),DE.call(this,e,t)}function Rue(e,t){Hb(),DE.call(this,e,t)}function zue(e,t){Hb(),Lue.call(this,e,t)}function Bue(e,t){return e.c.Ec(I(t,136))}function Vue(e,t){return I(Dk(e.e,t),26)}function Hue(e,t){return I(Dk(e.e,t),26)}function Uue(e,t,n){_R(JN(e.a),t,xwe(n))}function Wue(e,t,n){_R(lM(e.a),t,bwe(n))}function JE(e,t){eT(),bO.call(this,e,t)}function Gue(e,t){eT(),bO.call(this,e,t)}function Kue(e,t){eT(),bO.call(this,e,t)}function que(e,t){eT(),JE.call(this,e,t)}function Jue(e,t){eT(),JE.call(this,e,t)}function Yue(e,t){eT(),Jue.call(this,e,t)}function Xue(e,t){eT(),Gue.call(this,e,t)}function Zue(e,t,n){return pG(GN(e,t),n)}function Que(e,t,n){return t.xl(e.e,e.c,n)}function $ue(e,t,n){return t.yl(e.e,e.c,n)}function YE(e,t){return tR(e.e,I(t,52))}function ede(e,t){return(Wk(e),e)+epe(t)}function tde(e){return e==null?null:tz(e)}function nde(e){return e==null?null:tz(e)}function rde(e){return e==null?null:wrt(e)}function ide(e){return e==null?null:PXe(e)}function XE(e){e.o??_0e(e)}function ZE(e){return $D(e==null||NC(e)),e}function F(e){return $D(e==null||PC(e)),e}function QE(e){return $D(e==null||FC(e)),e}function $E(e){P(e,161)&&I(e,161).mi()}function ade(){iPe.call(this),this.Bb|=Cq}function ode(e,t){this.d=e,Nee(this),this.b=t}function eD(e,t){this.c=e,Vy.call(this,e,t)}function tD(e,t){this.a=e,eD.call(this,e,t)}function sde(e,t,n){aN.call(this,e,t,n,null)}function cde(e,t,n){aN.call(this,e,t,n,null)}function lde(e,t){fN.call(this,e),this.a=t}function ude(e,t){fN.call(this,e),this.a=t}function dde(e,t){return UB(e,t),new Lbe(e,t)}function fde(e,t,n){return e.Le(t,n)<=0?n:t}function pde(e,t,n){return e.Le(t,n)<=0?t:n}function mde(e){return Wk(e),e?1231:1237}function hde(e,t){t.a?p1e(e,t):IT(e.a,t.b)}function gde(e,t){VQ||zT(e.a,t)}function _de(e,t){return Tb(),gI(t.d.i,e)}function vde(e,t){return RF(),new m8e(t,e)}function yde(e,t){return I(sP(e.b,t),144)}function bde(e,t){return I(sP(e.c,t),233)}function nD(e){return I(dO(e.a,e.b),295)}function xde(e){return new M(e.c,e.d+e.a)}function Sde(e){return fj(),dce(I(e,203))}function Cde(e,t){return I(Dk(e.b,t),278)}function rD(e,t){return PA(t,pst),e.f=t,e}function wde(e,t,n){return n=AW(e,t,3,n),n}function Tde(e,t,n){return n=AW(e,t,6,n),n}function Ede(e,t,n){return n=AW(e,t,9,n),n}function iD(e,t,n){++e.j,e.rj(),lN(e,t,n)}function Dde(e,t,n){++e.j,e.oj(t,e.Xi(t,n))}function Ode(e,t,n){e.dd(t).Rb(n)}function kde(e,t){this.c=e,EP.call(this,t)}function Ade(e,t){this.a=e,qne.call(this,t)}function aD(e,t){this.a=e,qne.call(this,t)}function jde(e){this.q=new r.Date(Bj(e))}function Mde(){this.a=new BA,this.b=new BA}function oD(){oD=E,E7=new Nre,new t_}function sD(){sD=E,M3=new Rh(`root`)}function cD(){cD=E,oyt=YR((jz(),z5))}function lD(e){e.b?lD(e.b):e.f.c.yc(e.e,e.d)}function uD(e){this.a=(_A(),new im(Sk(e)))}function Nde(e){this.a=(vF(e,KK),new mN(e))}function Pde(e){this.a=(vF(e,KK),new mN(e))}function Fde(e){return e==null?null:e.message}function dD(e){return String.fromCharCode(e)}function Ide(e){return TO(VO(e,32))^TO(e)}function Lde(e,t){return(t&uK)%e.d.length}function Rde(e,t,n){return P9e(e.c,e.b,t,n)}function zde(e,t,n){return e.apply(t,n)}function Bde(e,t,n){return ak(e,I(t,24),n)}function Vde(e,t,n){return e.a+=Lz(t,0,n),e}function Hde(e,t){var n=e.e;return e.e=t,n}function Ude(e,t){var n=t;return!!e.De(n)}function Wde(e,t){e[Mot].call(e,t)}function Gde(e,t){e[Mot].call(e,t)}function fD(e,t){e.a._c(e.b,t),++e.b,e.c=-1}function Kde(e){ck(e.e),e.d.b=e.d,e.d.a=e.d}function qde(e,t,n){mb(),bp(e,t.Te(e.a,n))}function pD(e,t){return hE(),e==t?0:e?1:-1}function mD(e,t){return zv(Array(t),e)}function hD(e,t){Rh.call(this,e),this.a=t}function Jde(e,t){Jne.call(this,e),this.a=t}function gD(e,t){Jne.call(this,e),this.a=t}function Yde(){_D.call(this),this.a=new uy}function Xde(){this.n=new uy,this.o=new uy}function Zde(){this.b=new uy,this.c=new Kh}function Qde(){this.a=new Kh,this.b=new Kh}function $de(){this.a=new it,this.b=new hg}function efe(){this.b=new _M,this.a=new _M}function tfe(){this.b=new Sg,this.a=new Sg}function nfe(){this.a=new Kh,this.d=new Kh}function rfe(){this.b=new qh,this.a=new qh}function ife(){this.b=new nae,this.a=new bo}function afe(){this.a=new Ud,this.b=new ea}function _D(){this.n=new Gg,this.i=new kw}function vD(e){return!e.a&&(e.a=new w),e.a}function yD(e,t){return e.a+=t.a,e.b+=t.b,e}function bD(e,t){return e.a-=t.a,e.b-=t.b,e}function ofe(e){return _g(e.j.c,0),e.a=-1,e}function sfe(e,t,n){return n=AW(e,t,11,n),n}function cfe(e,t,n){n!=null&&CF(t,JB(e,n))}function lfe(e,t,n){n!=null&&wF(t,JB(e,n))}function xD(e,t,n,r){L.call(this,e,t,n,r)}function ufe(e,t,n,r){hO.call(this,e,t,n,r)}function dfe(e,t,n,r){L.call(this,e,t,n,r)}function ffe(e,t,n,r){dfe.call(this,e,t,n,r)}function pfe(e,t,n,r){ZO.call(this,e,t,n,r)}function SD(e,t,n,r){ZO.call(this,e,t,n,r)}function mfe(e,t,n,r){SD.call(this,e,t,n,r)}function hfe(e,t,n,r){ZO.call(this,e,t,n,r)}function CD(e,t,n,r){hfe.call(this,e,t,n,r)}function gfe(e,t,n,r){SD.call(this,e,t,n,r)}function _fe(e,t,n,r){gfe.call(this,e,t,n,r)}function vfe(e,t,n,r){Uve.call(this,e,t,n,r)}function wD(e,t){G_.call(this,dZ+e+nZ+t)}function yfe(e,t){Nw(e.f)?s0e(e,t):eYe(e,t)}function bfe(e,t){return e.hk().ti().oi(e,t)}function xfe(e,t){return e.hk().ti().qi(e,t)}function Sfe(e,t){return e.n.a=(Wk(t),t)+10}function Cfe(e,t){return e.n.a=(Wk(t),t)+10}function wfe(e,t){return e.e=I(e.d.Kb(t),162)}function Tfe(e,t){return t==e||EV(wU(t),e)}function Efe(e,t,n){return e.lastIndexOf(t,n)}function TD(e,t){return Wk(e),N(e)===N(t)}function Dfe(e,t){return Wk(e),N(e)===N(t)}function Ofe(e,t){return Yk(e.a,t,``)==null}function kfe(e,t){return e.b.zd(new joe(e,t))}function Afe(e,t){return e.b.zd(new Moe(e,t))}function jfe(e,t){return e.b.zd(new ax(e,t))}function Mfe(e,t){return G(t,(XG(),g2),e)}function Nfe(e,t,n){return yR(e[t.a],e[n.a])}function Pfe(e,t){return lT(e.a.d.p,t.a.d.p)}function Ffe(e,t){return lT(t.a.d.p,e.a.d.p)}function Ife(e,t){return Tb(),!gI(t.d.i,e)}function Lfe(e,t){VQ||t&&(e.d=t)}function Rfe(e,t){Xhe.call(this,e,e.length,t)}function zfe(e){this.c=e,$C.call(this,PK,0)}function Bfe(e,t,n){this.a=e,lue.call(this,t,n)}function Vfe(e,t){this.c=e,uye.call(this,e,t)}function Hfe(e,t,n){this.c=t,this.b=n,this.a=e}function ED(e){JD(),this.d=e,this.a=new MT}function Ufe(e){return e<100?null:new py(e)}function Wfe(e){return e.c?HN(e.c.a,e,0):-1}function Gfe(e,t){return yR(e.c.e.a,t.c.e.a)}function Kfe(e,t){return yR(e.b.e.a,t.b.e.a)}function qfe(e,t){return yR(e.c-e.s,t.c-t.s)}function Jfe(e,t,n){return I(e.c,72).Uk(t,n)}function DD(e,t,n){return I(e.c,72).Vk(t,n)}function Yfe(e,t,n){return Que(e,I(t,344),n)}function Xfe(e,t,n){return $ue(e,I(t,344),n)}function Zfe(e,t,n){return gJe(e,I(t,344),n)}function Qfe(e,t,n){return vYe(e,I(t,344),n)}function $fe(e,t){return P(t,16)&&f6e(e.c,t)}function OD(e,t){return t==null?null:qL(e.b,t)}function kD(e){return e==e5||e==n5||e==t5}function epe(e){return PC(e)?(Wk(e),e):e.se()}function AD(e){return!isNaN(e)&&!isFinite(e)}function tpe(e){gT(this),bA(this),qF(this,e)}function jD(e){Gw(this),Qhe(this.c,0,e.Nc())}function MD(e,t,n){this.a=e,this.b=t,this.c=n}function npe(e,t,n){this.a=e,this.b=t,this.c=n}function rpe(e,t,n){this.d=e,this.b=n,this.a=t}function ipe(e){this.a=e,cb(),vI(Date.now())}function ND(e){if(!e)throw k(new ev(Nat))}function ape(e,t){if(!e)throw k(new $_(t))}function ope(e,t){if(e!=t)throw k(new sg)}function spe(){spe=E,G_t=new fe,K_t=new pe}function cpe(e){var t=new Ue;return t.e=e,t}function lpe(e,t){return t.ni(e.a)}function upe(e,t,n){return mb(),e.a.Wd(t,n),t}function dpe(e){Vk(e.a),OAe(e.c,e.b),e.b=null}function fpe(e){return nK(),oF((Kse(),ayt),e)}function ppe(e){return uP(),oF((qke(),Fvt),e)}function mpe(e){return MN(),oF((Kke(),Mvt),e)}function hpe(e){return NN(),oF((bje(),avt),e)}function gpe(e){return ML(),oF((Yke(),gvt),e)}function _pe(e){return NP(),oF((Jke(),kvt),e)}function vpe(e){return PI(),oF((Cje(),uyt),e)}function ype(e){return gP(),oF((EOe(),Eyt),e)}function bpe(e){return YN(),oF((Xke(),vbt),e)}function xpe(e){return iH(),oF((kMe(),Cbt),e)}function Spe(e){return ZI(),oF((wje(),Nbt),e)}function Cpe(e){return qz(),oF((Sje(),Wbt),e)}function wpe(e){return vU(),oF((YFe(),Xbt),e)}function Tpe(e){hO.call(this,e.d,e.c,e.a,e.b)}function Epe(e){hO.call(this,e.d,e.c,e.a,e.b)}function Dpe(e,t,n){this.b=e,this.c=t,this.a=n}function PD(e,t,n){this.b=e,this.a=t,this.c=n}function Ope(e,t,n){this.a=e,this.b=t,this.c=n}function kpe(e,t,n){this.a=e,this.b=t,this.c=n}function Ape(e,t,n){this.a=e,this.b=t,this.c=n}function jpe(e,t,n){this.b=e,this.a=t,this.c=n}function FD(e,t,n){this.e=t,this.b=e,this.d=n}function Mpe(e){var t=new Lg;return t.b=e,t}function ID(){ID=E,H$=new On,U$=new kn}function LD(){LD=E,rSt=new tr,nSt=new rr}function RD(){RD=E,dSt=new li,fSt=new ui}function Npe(){Npe=E,pBt=H(sQ,hK,1,0,5,1)}function Ppe(){Ppe=E,HBt=H(sQ,hK,1,0,5,1)}function Fpe(){Fpe=E,UBt=H(sQ,hK,1,0,5,1)}function Ipe(e){return FF(),oF((DOe(),lxt),e)}function Lpe(e){return eK(),oF((qse(),Yxt),e)}function Rpe(e){return XI(),oF((xje(),tSt),e)}function zpe(e){return NI(),oF((Oje(),gSt),e)}function Bpe(e){return BV(),oF((jMe(),vSt),e)}function Vpe(e){return oN(),oF((dOe(),zSt),e)}function Hpe(e){return OH(),oF((ANe(),FSt),e)}function Upe(e){return cz(),oF((Tje(),USt),e)}function Wpe(e){return uF(),oF((dAe(),qSt),e)}function Gpe(e){return yU(),oF((OIe(),rCt),e)}function Kpe(e){return _P(),oF((fOe(),oCt),e)}function qpe(e){return $I(),oF((fAe(),lCt),e)}function Jpe(e){return LF(),oF((eAe(),wSt),e)}function Ype(e){return AV(),oF((MNe(),ECt),e)}function Xpe(e){return pH(),oF((jNe(),gCt),e)}function Zpe(e){return PN(),oF((uOe(),yCt),e)}function Qpe(e){return uH(),oF((NNe(),NCt),e)}function $pe(e){return XU(),oF((lLe(),FCt),e)}function eme(e){return jI(),oF((Zke(),zCt),e)}function tme(e){return QI(),oF((Qke(),HCt),e)}function nme(e){return dP(),oF(($ke(),WCt),e)}function rme(e){return nM(),oF((pOe(),JCt),e)}function ime(e){return rW(),oF((XFe(),PSt),e)}function ame(e){return sz(),oF((FMe(),_wt),e)}function ome(e){return CM(),oF((mOe(),xwt),e)}function sme(e){return PU(),oF((kIe(),ukt),e)}function cme(e){return ZL(),oF((aAe(),mkt),e)}function lme(e){return wB(),oF((Eje(),_kt),e)}function ume(e){return gB(),oF((AMe(),Skt),e)}function dme(e){return gW(),oF((cLe(),Okt),e)}function fme(e){return Rz(),oF((Dje(),Nkt),e)}function pme(e){return XN(),oF((hOe(),Lkt),e)}function mme(e){return dF(),oF((rAe(),zkt),e)}function hme(e){return AI(),oF((nAe(),Wkt),e)}function gme(e){return jL(),oF((tAe(),Jkt),e)}function _me(e){return FL(),oF((iAe(),Qkt),e)}function vme(e){return lF(),oF((oAe(),rAt),e)}function yme(e){return II(),oF((sAe(),oAt),e)}function bme(e){return XL(),oF((kje(),DAt),e)}function xme(e){return rM(),oF((gOe(),PAt),e)}function Sme(e){return HA(),oF((_Oe(),UAt),e)}function Cme(e){return ej(),oF((vOe(),GAt),e)}function wme(e){return $M(),oF((yOe(),cjt),e)}function Tme(e){return VA(),oF((bOe(),hjt),e)}function Eme(e){return dV(),oF((Mje(),_jt),e)}function Dme(e){return yW(),oF((Gse(),jjt),e)}function Ome(e){return _L(),oF((cAe(),Fjt),e)}function kme(e){return PL(),oF((jje(),IMt),e)}function Ame(e){return kj(),oF((xOe(),BMt),e)}function jme(e){return IF(),oF((SOe(),KMt),e)}function Mme(e){return UV(),oF((MMe(),$Mt),e)}function Nme(e){return AL(),oF((lAe(),sNt),e)}function Pme(e){return ON(),oF((COe(),rNt),e)}function Fme(e){return qB(),oF((Aje(),KNt),e)}function Ime(e){return MI(),oF((mAe(),ZNt),e)}function Lme(e){return Az(),oF((pAe(),ePt),e)}function Rme(e){return eH(),oF((Nje(),oPt),e)}function zme(e){return XR(),oF((uAe(),hPt),e)}function Bme(e){return kM(),oF((wOe(),aFt),e)}function Vme(e){return FN(),oF((gAe(),uFt),e)}function Hme(e){return CR(),oF((hAe(),hFt),e)}function Ume(e){return Nb(),oF((qEe(),EFt),e)}function Wme(e){return SR(),oF((_Ae(),bFt),e)}function Gme(e){return Mb(),oF((KEe(),CFt),e)}function Kme(e){return eN(),oF((TOe(),kFt),e)}function qme(e){return gH(),oF((PMe(),IFt),e)}function Jme(e){return kU(),oF((NMe(),vFt),e)}function Yme(e){return Pb(),oF((JEe(),_It),e)}function Xme(e){return LI(),oF((OOe(),bIt),e)}function Zme(e){return aB(),oF((IMe(),MIt),e)}function Qme(e){return wH(),oF((qFe(),FIt),e)}function $me(e){return TB(),oF((PNe(),BIt),e)}function ehe(e){return LV(),oF((LNe(),nLt),e)}function the(e){return bR(),oF((LMe(),xRt),e)}function nhe(e){return QL(),oF((Pje(),TRt),e)}function rhe(e){return PP(),oF((vAe(),DRt),e)}function ihe(e){return wR(),oF((Fje(),ARt),e)}function ahe(e){return tH(),oF((RNe(),RRt),e)}function ohe(e){return kL(),oF((yAe(),KRt),e)}function she(e){return fV(),oF((Ije(),YRt),e)}function che(e){return lU(),oF((EIe(),XRt),e)}function lhe(e){return oB(),oF((zMe(),$Rt),e)}function uhe(e){return HV(),oF((FNe(),tzt),e)}function dhe(e){return VH(),oF((INe(),nzt),e)}function fhe(e){return RG(),oF((RMe(),rzt),e)}function phe(e){return VP(),oF((bAe(),fzt),e)}function mhe(e){return jz(),oF((Rje(),pzt),e)}function hhe(e){return TW(),oF((DIe(),gzt),e)}function ghe(e){return xR(),oF((xAe(),yzt),e)}function _he(e){return SM(),oF((Lje(),wzt),e)}function vhe(e){return lz(),oF((zje(),Azt),e)}function yhe(e){return NL(),oF((Bje(),Lzt),e)}function bhe(e,t){return(Wk(e),e)+(Wk(t),t)}function xhe(e,t){this.c=e,this.a=t,this.b=t-e}function She(e,t,n){this.a=e,this.c=t,this.b=n}function Che(e,t,n){this.a=e,this.c=t,this.b=n}function whe(e,t,n){this.a=e,this.b=t,this.c=n}function The(e,t,n){this.a=e,this.b=t,this.c=n}function Ehe(e,t,n){this.a=e,this.b=t,this.c=n}function Dhe(e,t,n){this.a=e,this.b=t,this.c=n}function Ohe(e,t,n){this.a=e,this.b=t,this.c=n}function khe(e,t,n){this.a=e,this.b=t,this.c=n}function zD(e,t,n){this.e=e,this.a=t,this.c=n}function Ahe(e,t,n){eT(),sCe.call(this,e,t,n)}function jhe(e,t,n){eT(),obe.call(this,e,t,n)}function Mhe(e,t,n){eT(),obe.call(this,e,t,n)}function Nhe(e,t,n){eT(),obe.call(this,e,t,n)}function Phe(e,t,n){eT(),jhe.call(this,e,t,n)}function Fhe(e,t,n){eT(),jhe.call(this,e,t,n)}function Ihe(e,t,n){eT(),Fhe.call(this,e,t,n)}function Lhe(e,t,n){eT(),Mhe.call(this,e,t,n)}function Rhe(e,t,n){eT(),Nhe.call(this,e,t,n)}function zhe(e){return sU(),oF((JFe(),oBt),e)}function BD(e,t){return Sk(e),Sk(t),new vae(e,t)}function VD(e,t){return Sk(e),Sk(t),new Oge(e,t)}function Bhe(e,t){return Sk(e),Sk(t),new kge(e,t)}function Vhe(e,t){return Sk(e),Sk(t),new kae(e,t)}function Hhe(e,t){Pae.call(this,e,BR(new sv(t)))}function Uhe(e,t){this.c=e,this.b=t,this.a=!1}function Whe(e){this.d=e,Nee(this),this.b=lve(e.d)}function Ghe(e,t,n){this.c=e,rx.call(this,t,n)}function Khe(e){return!e.c&&(e.c=new Pl),e.c}function qhe(e){return!e.e&&(e.e=new Kh),e.e}function HD(e){var t=new Kh;return oP(t,e),t}function Jhe(e){var t=new Sg;return oP(t,e),t}function Yhe(e){var t=new kg;return BF(t,e),t}function UD(e){var t=new ab;return BF(t,e),t}function I(e,t){return $D(e==null||SB(e,t)),e}function Xhe(e,t,n){Ive.call(this,t,n),this.a=e}function Zhe(e,t,n){this.b=e,Vse.call(this,t,n)}function Qhe(e,t,n){I$e(n,0,e,t,n.length,!1)}function WD(e,t){if(!e)throw k(new $_(t))}function GD(e,t){if(!e)throw k(new ev(t))}function $he(e,t){if(!e)throw k(new K_(t))}function ege(e,t){t&&(e.b=t,e.a=(zk(t),t.a))}function KD(e,t,n,r,i){e.b=t,e.c=n,e.d=r,e.a=i}function tge(e,t,n,r,i){e.d=t,e.c=n,e.a=r,e.b=i}function nge(e){var t,n=e.d;t=e.a,e.d=t,e.a=n}function rge(e){var t=e.b;e.b=e.c,e.c=t}function ige(e){return VE(e.b!=0),OP(e,e.c.b)}function age(e){return VE(e.b!=0),OP(e,e.a.a)}function oge(e,t){return IP(),yR(e.e.a,t.e.a)}function sge(e,t){return IP(),yR(e.e.b,t.e.b)}function cge(e,t){return jb(),lT(e.d.p,t.d.p)}function lge(e,t){return lT(Rge(e.d),Rge(t.d))}function qD(e,t){return t&&Ik(e,t.d)?t:null}function uge(e,t){return t==(RG(),N5)?e.c:e.d}function JD(){JD=E,AAt=(RG(),N5),q4=p5}function dge(){this.b=A(F(lB((NW(),Gyt))))}function fge(){this.a=`;,;`,this.b=``,this.c=``}function pge(e,t,n){bx.call(this,e,t),this.b=n}function YD(e,t,n){kC.call(this,e,t),this.c=n}function mge(e){Fpe(),pl.call(this),this._h(e)}function hge(e,t,n){this.a=e,ow.call(this,t,n)}function gge(e,t,n){this.a=e,ow.call(this,t,n)}function XD(e,t,n){kC.call(this,e,t),this.c=n}function _ge(){QM(),lbe.call(this,(zb(),V7))}function vge(e){return tK(),++W9,new yO(0,e)}function yge(){yge=E,hVt=(_A(),new im(Iht))}function bge(e){return new M(e.c+e.b,e.d+e.a)}function xge(e){return e!=null&&!az(e,O7,k7)}function Sge(e,t){return(eBe(e)<<4|eBe(t))&aq}function Cge(e,t){var n=e.c;return APe(e,t),n}function wge(e,t){return t<0?e.g=-1:e.g=t,e}function ZD(e,t){return _Ne(e),e.a*=t,e.b*=t,e}function Tge(e,t,n,r,i){e.c=t,e.d=n,e.b=r,e.a=i}function QD(e,t){return xM(e,t,e.c.b,e.c),!0}function Ege(e){e.a.b=e.b,e.b.a=e.a,e.a=e.b=null}function Dge(e){this.b=e,this.a=IO(this.b.a).Md()}function Oge(e,t){this.b=e,this.a=t,Ad.call(this)}function kge(e,t){this.a=e,this.b=t,Ad.call(this)}function Age(e,t){Ive.call(this,t,1040),this.a=e}function jge(e){lue.call(this,e.length,0),this.a=e}function $D(e){if(!e)throw k(new Q_(null))}function eO(e){return jN(e.slice(),e)}function tO(e){var t=e.n;return e.a.b+t.d+t.a}function Mge(e){var t=e.n;return e.e.b+t.d+t.a}function Nge(e){var t=e.n;return e.e.a+t.b+t.c}function Pge(e){return e.a?e.a:wxe(e)}function nO(e,t){return SV(e,new bx(t.a,t.b))}function Fge(e){return!jM(e)&&e.c.i.c==e.d.i.c}function Ige(e,t){return e.c<t.c?-1:e.c==t.c?0:1}function Lge(e){return e.b.c.length-e.e.c.length}function Rge(e){return e.e.c.length-e.g.c.length}function zge(e){return e.e.c.length+e.g.c.length}function rO(e){return e==0||isNaN(e)?e:e<0?-1:1}function Bge(e){return FP(),H(d3,QY,40,e,0,1)}function Vge(e,t,n){return Yk(e.b,I(n.b,17),t)}function Hge(e,t,n){return Yk(e.b,I(n.b,17),t)}function Uge(e,t,n){return IP(),n.e.b+n.f.b+e*t}function Wge(e,t,n){return IP(),n.e.a+n.f.a+e*t}function Gge(e){return fj(),(RG(),v5).Gc(e.j)}function Kge(e,t){return zT(e,new M(t.a,t.b))}function iO(e,t,n){yP(e,t,new Ak(n))}function qge(e,t,n){var r=e[t];return e[t]=n,r}function aO(e,t){var n;return++e.j,n=e.Aj(t),n}function oO(e,t,n){return e.a=-1,rue(e,t.g,n),e}function Jge(e,t,n,r){wHe.call(this,e,t,n,r,0,0)}function sO(e,t){HC.call(this,e,t),this.a=this}function Yge(e){Fpe(),mge.call(this,e),this.a=-1}function Xge(){hC.call(this,`COUNT_CHILDREN`,0)}function Zge(){KD(this,!1,!1,!1,!1)}function Qge(){Qge=E,d_t=H(TQ,kK,15,256,0,1)}function cO(){cO=E,new uWe((h_(),Fgt),(__(),Pgt))}function $ge(e){e.a.jd(),I(e.a.kd(),18).gc(),yv()}function e_e(e){return e.e.Pd().gc()*e.c.Pd().gc()}function t_e(e,t,n){return new Hfe(wbe(e).Ze(),n,t)}function lO(){lO=E,Hgt=new gTe((_A(),_A(),IQ))}function n_e(){n_e=E,Wgt=new Eoe((_A(),_A(),RQ))}function r_e(){r_e=E,c_t=H(xQ,kK,221,256,0,1)}function i_e(){i_e=E,u_t=H(SQ,kK,180,128,0,1)}function a_e(){a_e=E,p_t=H(EQ,kK,190,256,0,1)}function o_e(){o_e=E,v_t=H(DQ,kK,191,256,0,1)}function s_e(e,t){jPe(e,t==null?null:(Wk(t),t))}function c_e(e,t){PPe(e,t==null?null:(Wk(t),t))}function l_e(e,t){PPe(e,t==null?null:(Wk(t),t))}function uO(e,t){var n=Mye(e,t);return n.i=2,n}function u_e(e,t){return e.a+=Lz(t,0,t.length),e}function dO(e,t){return bj(t,e.c.length),e.c[t]}function d_e(e,t){return bj(t,e.a.length),e.a[t]}function f_e(e,t){var n;for(n=0;n<t;++n)e[n]=-1}function p_e(e,t){return Wk(e),iI(e,(Wk(t),t))}function m_e(e,t){return Wk(t),iI(t,(Wk(e),e))}function h_e(e){return e.q?e.q:(_A(),_A(),LQ)}function fO(e){for(Sk(e);e.Ob();)e.Pb(),e.Qb()}function g_e(e){if(e.c.e!=e.a)throw k(new sg)}function __e(e){if(e.e.c!=e.b)throw k(new sg)}function v_e(e){this.c=e,this.a=new ib(this.c.a)}function y_e(e){this.a=e,this.c=new qh,yLe(this)}function b_e(e){this.c=e,this.b=this.c.d.vc().Jc()}function pO(e){this.a=new fb(e.gc()),qF(this,e)}function x_e(e){hm.call(this,new _M),qF(this,e)}function mO(e,t){mb(),fN.call(this,e),this.a=t}function hO(e,t,n,r){tge(this,e,t,n,r)}function gO(e,t,n,r,i,a){return Fqe(e,t,n,r,i,0,a)}function S_e(e,t,n){return lT(t.d[e.g],n.d[e.g])}function C_e(e,t,n){return lT(e.d[t.p],e.d[n.p])}function w_e(e,t,n){return lT(e.d[t.p],e.d[n.p])}function T_e(e,t,n){return lT(e.d[t.p],e.d[n.p])}function E_e(e,t,n){return lT(e.d[t.p],e.d[n.p])}function _O(e,t,n){return r.Math.min(n/e,1/t)}function D_e(e,t){return e?0:r.Math.max(0,t-1)}function O_e(e){return e.c-I(dO(e.a,e.b),295).b}function k_e(e,t){return e==null?t==null:TD(e,t)}function A_e(e,t){return e==null?t==null:Gz(e,t)}function vO(e,t){return tK(),++W9,new dye(e,t)}function yO(e,t){tK(),Wh.call(this,e),this.a=t}function bO(e,t){eT(),Hh.call(this,t),this.a=e}function xO(e){EP.call(this,e.gc()),xk(this,e)}function SO(e,t,n){this.a=e,UT.call(this,t,n,2)}function j_e(e){this.b=new ab,this.a=e,this.c=-1}function CO(e){return e.c?e.c.f:e.e.b}function wO(e){return e.c?e.c.g:e.e.a}function TO(e){return _w(e)?e|0:Zie(e)}function M_e(e){var t=Vqe(e);return t?M_e(t):e}function N_e(e,t){return e.a??A6e(e),e.a[t]}function P_e(e,t){return!e&&(e=[]),e[e.length]=t,e}function EO(e,t){var n=YR(e);return ALe(n,t),n}function F_e(e,t,n){var r;for(r=0;r<t;++r)e[r]=n}function DO(e,t,n){uj(t,e.c.length),Ox(e.c,t,n)}function I_e(e,t,n){ORe(0,t,e.length),AN(e,0,t,n)}function L_e(e,t){return P(t,24)&&CE(e,I(t,24))}function R_e(e,t){return P(t,24)&&uNe(e,I(t,24))}function OO(e,t){return BRe(e,t,ROe(e,e.b.Ae(t)))}function z_e(e,t){return e.a.get(t)!==void 0}function B_e(e){return Array.isArray(e)&&e.Rm===T}function V_e(e){return SU(e,26)*jq+SU(e,27)*Mq}function H_e(e,t){U_e(e,bD(new M(t.a,t.b),e.c))}function U_e(e,t){yD(e.c,t),e.b.c+=t.a,e.b.d+=t.b}function kO(e){e.b?kO(e.b):e.d.dc()&&e.f.c.Ac(e.e)}function AO(e,t,n){var r;e&&(r=e.i,r.c=t,r.b=n)}function jO(e,t,n){var r;e&&(r=e.i,r.d=t,r.a=n)}function W_e(e,t,n){return-lT(e.f[t.p],e.f[n.p])}function G_e(e,t,n){return ok(e,new ox(t.a,n.a))}function K_e(e,t,n){t0e(n,e,1),zT(t,new Goe(n,e))}function q_e(e,t,n){xV(n,e,1),zT(t,new jx(n,e))}function J_e(e,t,n){return n=AW(e,I(t,52),7,n),n}function Y_e(e,t,n){return n=AW(e,I(t,52),3,n),n}function MO(e,t,n){return e.a=-1,rue(e,t.g+1,n),e}function X_e(e,t,n){this.a=e,HT.call(this,t,n,22)}function Z_e(e,t,n){this.a=e,HT.call(this,t,n,14)}function Q_e(e,t,n,r){eT(),eEe.call(this,e,t,n,r)}function $_e(e,t,n,r){eT(),eEe.call(this,e,t,n,r)}function eve(e,t){(t.Bb&IX)!=0&&!e.a.o&&(e.a.o=t)}function tve(e,t){this.b=new ab,this.a=e,this.c=t}function nve(){this.b=new yt,this.c=new CSe(this)}function rve(){this.d=new Ve,this.e=new SSe(this)}function ive(){fj(),this.k=new qh,this.d=new Sg}function ave(){owe(),this.g=new ab,this.f=new ab}function NO(e){Gb(),this.a=0,this.b=e-1,this.c=1}function ove(e){return tK(),++W9,new cCe(10,e,0)}function sve(e){return e.f||=e.Cc()}function PO(e){return e.i||=e.bc()}function FO(e){if(e.e.j!=e.d)throw k(new sg)}function IO(e){return e.c?e.c:e.c=e.Qd()}function cve(e){return e.d?e.d:e.d=e.Rd()}function LO(e,t){return VHe(GN(e,t))?t.wi():null}function lve(e){return P(e,16)?I(e,16).cd():e.Jc()}function uve(e){return e.Oc(H(sQ,hK,1,e.gc(),5,1))}function dve(){dve=E,Lgt=new jge(H(sQ,hK,1,0,5,1))}function fve(){fve=E,zzt=new Jw(($G(),n8),0)}function pve(){hC.call(this,`LOOKAHEAD_LAYOUT`,1)}function mve(e){hT(this),this.g=e,xA(this),this.he()}function hve(e,t,n,r){this.a=e,aN.call(this,e,t,n,r)}function RO(e){this.a=(dve(),Lgt),this.d=I(Sk(e),50)}function zO(e,t){return hI(hXe(_w(e)?TI(e):e,t))}function BO(e,t){return hI(P1e(_w(e)?TI(e):e,t))}function VO(e,t){return hI(XXe(_w(e)?TI(e):e,t))}function gve(e,t){return pD((Wk(e),e),(Wk(t),t))}function _ve(e,t){return yR((Wk(e),e),(Wk(t),t))}function vve(e,t){return Sk(t),e.a.Hd(t)&&!e.b.Hd(t)}function yve(e,t){return dT(e.l&t.l,e.m&t.m,e.h&t.h)}function bve(e,t){return dT(e.l|t.l,e.m|t.m,e.h|t.h)}function xve(e,t){return dT(e.l^t.l,e.m^t.m,e.h^t.h)}function Sve(e){return e!=null&&Jve(e)&&e.Rm!==T}function Cve(e){return!Array.isArray(e)&&e.Rm===T}function HO(e,t){return lR(e,(Wk(t),new wm(t)))}function UO(e,t){return lR(e,(Wk(t),new Tm(t)))}function wve(e){return eI(),I(e,12).e.c.length!=0}function Tve(e){return eI(),I(e,12).g.c.length!=0}function Eve(e,t){return RF(),yR(t.a.o.a,e.a.o.a)}function WO(e){return _w(e)?``+e:s6e(e)}function GO(e,t){if(e<0||e>=t)throw k(new Are)}function Dve(e,t,n){e.a.Mb(n)&&(e.b=!0,t.Ad(n))}function Ove(e){e.d||(e.d=e.b.Jc(),e.c=e.b.gc())}function kve(e){return e.e?Nke(e.e):null}function Ave(e,t,n){return bat(e,I(t,12),I(n,12))}function jve(e,t,n){t.of(n,A(F(Dk(e.b,n)))*e.a)}function Mve(e,t,n){return ZU(),oI(e,t)&&oI(e,n)}function Nve(e,t){t.Tg(`General 'Rotator`,1),art(e)}function KO(e,t,n,r){var i=e.i;i.i=t,i.a=n,i.b=r}function Pve(e){for(var t=e;t.f;)t=t.f;return t}function Fve(e,t){this.e=e,this.d=t&64?t|AK:t}function Ive(e,t){this.c=0,this.d=e,this.b=t|64|AK}function qO(e){this.b=new mN(11),this.a=(vA(),e)}function Lve(e){this.b=null,this.a=(vA(),e||F_t)}function Rve(e){this.a=iWe(e.a),this.b=new jD(e.b)}function zve(e){this.b=e,OE.call(this,e),xle(this)}function Bve(e){this.b=e,AE.call(this,e),Sle(this)}function JO(e,t,n){this.a=e,xD.call(this,t,n,5,6)}function YO(e,t,n,r,i){xN.call(this,e,t,n,r,i,-1)}function XO(e,t,n,r,i){SN.call(this,e,t,n,r,i,-1)}function L(e,t,n,r){UT.call(this,e,t,n),this.b=r}function ZO(e,t,n,r){YD.call(this,e,t,n),this.b=r}function Vve(e){wse.call(this,e,!1),this.a=!1}function Hve(){hC.call(this,`LAYOUT_NEXT_LEVEL`,3)}function Uve(e,t,n,r){this.b=e,UT.call(this,t,n,r)}function Wve(e,t){this.b=e,Wf.call(this,e.b),this.a=t}function QO(e,t){var n=e.a.gc();return bke(t,n),n-t}function Gve(e,t){return t.Sh()?tR(e.b,I(t,52)):t}function Kve(e,t){return TD(e.substr(0,t.length),t)}function $O(e){return new RO(new oE(e.a.length,e.a))}function ek(e){return new M(e.c+e.b/2,e.d+e.a/2)}function qve(e){return dT(~e.l&uq,~e.m&uq,~e.h&dq)}function Jve(e){return typeof e===oK||typeof e===lK}function tk(e,t){return FC(t)?_Se(e,t):!!OO(e.f,t)}function nk(e,t){return tK(),++W9,new dbe(e,t,0)}function Yve(e,t){return tK(),++W9,new dbe(6,e,t)}function rk(e,t){for(Wk(t);e.Ob();)t.Ad(e.Pb())}function ik(e,t,n){mW(),this.e=e,this.d=t,this.a=n}function R(e,t,n,r){ORe(t,n,e.length),Zve(e,t,n,r)}function ak(e,t,n){return OF(e.a,t),qge(e.b,t.g,n)}function ok(e,t){return e.a.yc(t,e)==null}function Xve(e,t){var n;for(n=0;n<t;++n)e[n]=!1}function Zve(e,t,n,r){var i;for(i=t;i<n;++i)e[i]=r}function Qve(e,t,n){this.c=e,this.a=t,_A(),this.b=n}function $ve(e,t,n){GO(n,e.a.c.length),wM(e.a,n,t)}function sk(e,t){return e.a.yc(t,(hE(),vQ))==null}function eye(e,t){return e>0?r.Math.log(e/t):-100}function tye(e){return new mO(null,pye(e,e.length))}function ck(e){e.f=new sce(e),e.i=new cce(e),++e.g}function nye(e){if(!e)throw k(new pg);return e.d}function rye(e,t){if(e==null)throw k(new tv(t))}function iye(e,t){return t?qF(e,t):!1}function lk(e){return VH(),!e.Gc(c5)&&!e.Gc(u5)}function uk(e){BE(e.b!=-1),GM(e.c,e.a=e.b),e.b=-1}function dk(e,t,n){return DRe(e,t.g,n),OF(e.c,t),e}function aye(e,t,n){urt(e.a,e.b,e.d,e.c,I(t,170),n)}function fk(e,t){ele(e,P(t,163)?t:I(t,2001).Pl())}function oye(e){return PG(e,(bR(),y8)),e.d=!0,e}function sye(e){return!e.j&&kee(e,B8e(e.g,e.b)),e.j}function pk(e){var t=oL(e);return VE(t!=null),t}function cye(e){var t=cBe(e);return VE(t!=null),t}function lye(e,t,n){var r=mP(e,t);return uM(e,t,n),r}function uye(e,t){this.d=e,XT.call(this,e),this.e=t}function dye(e,t){Wh.call(this,1),this.a=e,this.b=t}function fye(e,t){return JL(e,t)<0?-1:+(JL(e,t)>0)}function pye(e,t){return cNe(t,e.length),new Age(e,t)}function mk(e){return e.e==0?e:new ik(-e.e,e.d,e.a)}function mye(e){return e==yq?ZZ:e==bq?`-INF`:``+e}function hye(e){return e==yq?ZZ:e==bq?`-INF`:``+e}function gye(e,t){return yR(e.c.c+e.c.b,t.c.c+t.c.b)}function hk(e,t){xM(e.d,t,e.b.b,e.b),++e.a,e.c=null}function _ye(e,t){return e.c?_ye(e.c,t):zT(e.b,t),e}function gk(e,t){hb(sA(e.Mc(),new Mi),new vte(t))}function _k(e,t,n,r,i){qV(e,I(BM(t.k,n),16),n,r,i)}function vye(e,t,n,r,i){for(;t<n;)r[i++]=Jk(e,t++)}function yye(e,t,n){var r;for(r=0;r<t;++r)Ek(e,r,n)}function vk(e){e.s=NaN,e.c=NaN,f1e(e,e.e),f1e(e,e.j)}function bye(e){e.a=null,e.e=null,ck(e.b),e.d=0,++e.c}function xye(e){return r.Math.abs(e.d.e-e.e.e)-e.a}function Sye(e,t){return yR(e.e.a+e.f.a,t.e.a+t.f.a)}function Cye(e,t){return yR(e.e.b+e.f.b,t.e.b+t.f.b)}function wye(e,t,n){return I(e.c.fd(t,I(n,136)),45)}function Tye(){return Cv(),W(j(zgt,1),Z,538,0,[Rgt])}function Eye(){Eye=E,$gt=new hp(!1),e_t=new hp(!0)}function yk(){yk=E,K7=h$e(),(rK(),J7)&&FKe()}function bk(e){return(e.i??HW(e),e.i).length}function Dye(e,t){kk(e,new Ak(t.f==null?``+t.g:t.f))}function Oye(e,t){kk(e,new Ak(t.f==null?``+t.g:t.f))}function xk(e,t){return e.Qi()&&(t=WCe(e,t)),e.Di(t)}function kye(e,t){return t=e.Wk(null,t),rYe(e,null,t)}function Aye(e,t,n){return tK(),++W9,new wTe(e,t,n)}function jye(e,t){++e.j,WV(e,e.i,t),g$e(e,I(t,344))}function z(e,t,n){var r=Mye(e,t);return QNe(n,r),r}function Mye(e,t){var n=new TLe;return n.j=e,n.d=t,n}function Sk(e){if(e==null)throw k(new dg);return e}function Nye(e){DSe.call(this),this.a=e,zT(e.a,this)}function Pye(){_M.call(this),this.a=!0,this.b=!0}function Ck(e){this.d=(Wk(e),e),this.a=0,this.c=PK}function Fye(e,t){this.d=mBe(e),this.c=t,this.a=.5*t}function Iye(e,t){return I(IO(e.a).Kd().Xb(t),45).jd()}function wk(e){var t;return t=e.g,t||(e.g=new If(e))}function Tk(e){var t;return t=e.k,t||(e.k=new Lf(e))}function Lye(e){var t;return t=e.k,t||(e.k=new Lf(e))}function Rye(e){var t;return t=e.i,t||(e.i=new Bf(e))}function zye(e){return e.j||=new lp(e)}function Bye(e){return e.f||=new aE(e)}function Vye(e){return e.d||=new tp(e)}function Hye(e){return P(e,607)?e:new TCe(e)}function Uye(e,t){return Vj(t,e.c.b.c.gc()),new _ae(e,t)}function Wye(e,t){return xj(t,e.length+1),e.substr(t)}function Ek(e,t,n){return gue(n==null||Y5e(e,n)),e[t]=n}function Gye(e,t){var n=e.a.gc();return Vj(t,n),n-1-t}function Kye(e,t){console[e].call(console,t)}function Dk(e,t){return FC(t)?WA(e,t):LC(OO(e.f,t))}function qye(e){e?IJe(e,(cb(),b_t),``):FSe((cb(),e))}function Jye(e){gg(),this.b=new Kh,this.a=e,Rtt(this,e)}function Yye(e){this.b=new Kh,this.a=new Kh,this.c=e}function Ok(e){this.c=new uy,this.a=new Kh,this.b=e}function Xye(e){this.d=e,this.c=e.a.d.a,this.b=e.a.e.g}function Zye(e){this.b=e,this.a=I(Pk(this.b.a.e),227)}function Qye(e){for(;e.a.b!=0;)Int(e,I(pCe(e.a),9))}function $ye(e,t){for(Wk(t);e.c<e.d;)e.Qe(t,e.c++)}function ebe(e,t){return RF(),I(Zk(e,t.d),16).Ec(t)}function tbe(e,t){return I(q(t,(XG(),J2)),15).a<e}function nbe(e,t,n,r){return n==0||(n-r)/n<e.e||t>=e.g}function rbe(e,t,n){return Y6e(e,MF(e,t,n))}function kk(e,t){var n=e.a.length;mP(e,n),uM(e,n,t)}function ibe(e,t){var n;++e.j,n=e.Cj(),e.pj(e.Xi(n,t))}function abe(e,t,n){I(t.b,68),AP(t.a,new The(e,n,t))}function obe(e,t,n){Hh.call(this,t),this.a=e,this.b=n}function sbe(e,t,n){this.a=e,Jne.call(this,t),this.b=n}function cbe(e,t,n){this.a=e,IEe.call(this,8,t,null,n)}function lbe(e){this.a=(Wk(TZ),TZ),this.b=e,new a_}function ube(e){this.c=e,this.a=new ab,this.b=new ab}function dbe(e,t,n){Wh.call(this,e),this.a=t,this.b=n}function Ak(e){if(e==null)throw k(new dg);this.a=e}function fbe(e){return!e.a&&(e.a=new UT(Q5,e,4)),e.a}function jk(e){return!e.d&&(e.d=new UT(z7,e,1)),e.d}function Mk(e,t){return e.a+=String.fromCharCode(t),e}function Nk(e,t){return e.a+=String.fromCharCode(t),e}function Pk(e){if(e==null)throw k(new dg);return e}function pbe(e){return z9?_Se(z9,e):!1}function mbe(e){return e?e.dc():!e.Jc().Ob()}function hbe(e){return Pk(e),P(e,472)?I(e,472):tz(e)}function gbe(e){return P(e,103)&&(I(e,19).Bb&IX)!=0}function Fk(e){return r.Math.sqrt(e.a*e.a+e.b*e.b)}function Ik(e,t){return cV(e.c,e.f,t,e.b,e.a,e.e,e.d)}function Lk(e,t){return GO(t,e.a.c.length),dO(e.a,t)}function Rk(e,t){return N(e)===N(t)||e!=null&&uR(e,t)}function _be(e,t){U_e(I(t.b,68),e),AP(t.a,new Pm(e))}function zk(e){e.c?zk(e.c):(FR(e),e.d=!0)}function Bk(e){e.c?e.c.Ye():(e.d=!0,a4e(e))}function vbe(e){lxe(e.a),e.b=H(sQ,hK,1,e.b.length,5,1)}function Vk(e){BE(e.c!=-1),e.d.ed(e.c),e.b=e.c,e.c=-1}function ybe(e){e.b=!1,e.c=!1,e.d=!1,e.a=!1}function bbe(e){this.c=e,this.b=this.c.a,this.a=this.c.e}function Hk(){Hre.call(this),_g(this.j.c,0),this.a=-1}function xbe(){Ky.call(this,`DELAUNAY_TRIANGULATION`,0)}function Sbe(e,t){var n=e.Fh(t);n>=0?e.hi(n):IQe(e,t)}function Cbe(e){return e.c.i.c==e.d.i.c}function Uk(e){return!e.a&&e.c?e.c.b:e.a}function wbe(e){return 0>=e?new pb:LPe(e-1)}function Wk(e){if(e==null)throw k(new dg);return e}function Tbe(e){if(e.p!=6)throw k(new ug);return e.f}function Ebe(e){if(e.p!=6)throw k(new ug);return e.k}function Dbe(e){if(e.p!=3)throw k(new ug);return e.e}function Obe(e){if(e.p!=4)throw k(new ug);return e.e}function kbe(e){if(e.p!=4)throw k(new ug);return e.j}function Abe(e){if(e.p!=3)throw k(new ug);return e.j}function jbe(e){return!e.b&&(e.b=new Bh(new s_)),e.b}function Gk(e){return e.c==-2&&Cee(e,wYe(e.g,e.b)),e.c}function Kk(e,t){var n=Mye(``,e);return n.n=t,n.i=1,n}function qk(e,t,n,r){Uy.call(this,e,n),this.a=t,this.f=r}function Mbe(e,t,n,r){Uy.call(this,e,t),this.d=n,this.a=r}function Nbe(e,t){this.b=e,uye.call(this,e,t),xle(this)}function Pbe(e,t){this.b=e,Vfe.call(this,e,t),Sle(this)}function Fbe(){PYe.call(this,NZ,(vy(),NBt)),set(this)}function Ibe(){PYe.call(this,KZ,(Iie(),bVt)),ptt(this)}function Lbe(e,t){ile.call(this,RPe(Sk(e),Sk(t))),this.a=t}function Rbe(e,t){e.c<0||e.b.b<e.c?nw(e.b,t):e.a.vf(t)}function zbe(e,t){gN((!e.a&&(e.a=new aD(e,e)),e.a),t)}function Jk(e,t){return xj(t,e.length),e.charCodeAt(t)}function Bbe(e,t){return lT(t.j.c.length,e.j.c.length)}function Yk(e,t,n){return FC(t)?cj(e,t,n):PH(e.f,t,n)}function Vbe(e){return _A(),e?e.Me():(vA(),vA(),L_t)}function Hbe(e){return vF(e,JK),xP(VR(VR(5,e),e/10|0))}function Ube(e,t,n){return eL(),n.Kg(e,I(t.jd(),147))}function Wbe(e,t){return cO(),new uWe(new Fle(e),new Ple(t))}function Xk(e,t){return N(e)===N(t)||e!=null&&uR(e,t)}function Zk(e,t){return L_e(e.a,t)?e.b[I(t,24).g]:null}function Gbe(e){return String.fromCharCode.apply(null,e)}function Kbe(e){return!e.d&&(e.d=new cm(e.c.Bc())),e.d}function Qk(e){return!e.a&&(e.a=new sie(e.c.vc())),e.a}function qbe(e){return!e.b&&(e.b=new Nv(e.c.ec())),e.b}function $k(e){return e.j.c.length=0,lxe(e.c),ofe(e.a),e}function Jbe(e,t){var n=new Ok(e);return ng(t.c,n),n}function Ybe(e){return!e.n&&(e.n=new L(f7,e,1,7)),e.n}function Xbe(e){return!e.b&&(e.b=new CD(r7,e,4,7)),e.b}function Zbe(e){return!e.c&&(e.c=new CD(r7,e,5,8)),e.c}function Qbe(e){return!e.c&&(e.c=new L(m7,e,9,9)),e.c}function eA(e,t,n,r){return KFe(e,t,n,!1),hR(e,r),e}function tA(e,t){for(;t-->0;)e=e<<1|e<0;return e}function $be(e,t){e.u.Gc((VH(),c5))&&r$e(e,t),Hke(e,t)}function exe(e,t){NBe(e,A(rF(t,`x`)),A(rF(t,`y`)))}function txe(e,t){NBe(e,A(rF(t,`x`)),A(rF(t,`y`)))}function nxe(){return Pb(),W(j(gIt,1),Z,528,0,[l6])}function rxe(){return Nb(),W(j(TFt,1),Z,547,0,[wFt])}function ixe(){return Mb(),W(j(SFt,1),Z,477,0,[xFt])}function axe(){axe=E,Ugt=new Toe(W(j(dQ,1),RK,45,0,[]))}function oxe(e){return e!=null&&eb(A7,e.toLowerCase())}function sxe(e,t){return new lSe(I(Sk(e),51),I(Sk(t),51))}function cxe(e,t,n){var r=I(e.d.Kb(n),162);r&&r.Nb(t)}function lxe(e){var t;for(t=e.Jc();t.Ob();)t.Pb(),t.Qb()}function nA(e){var t=e.b;return!t&&(e.b=t=new Rf(e)),t}function rA(e){return e.e==qZ&&Jp(e,$He(e.g,e.b)),e.e}function iA(e){return e.f==qZ&&Oee(e,yKe(e.g,e.b)),e.f}function aA(e){this.d=e,this.a=this.d.b,this.b=this.d.c}function uxe(e,t){this.b=e,this.c=t,this.a=new ib(this.b)}function dxe(e,t,n){this.a=Yat,this.d=e,this.b=t,this.c=n}function fxe(e,t){this.d=(Wk(e),e),this.a=16449,this.c=t}function pxe(e,t){return yR(e.d.c+e.d.b/2,t.d.c+t.d.b/2)}function mxe(e,t){return yR(e.g.c+e.g.b/2,t.g.c+t.g.b/2)}function hxe(e,t){return noe(),yR((Wk(e),e),(Wk(t),t))}function oA(e,t){return FR(e),new mO(e,new _je(t,e.a))}function sA(e,t){return FR(e),new mO(e,new jke(t,e.a))}function cA(e,t){return FR(e),new lde(e,new kke(t,e.a))}function lA(e,t){return FR(e),new ude(e,new Ake(t,e.a))}function gxe(e,t,n){$9e(e.a,n),HIe(n),R1e(e.b,n),ket(t,n)}function uA(e,t,n,r){this.a=e,this.c=t,this.b=n,this.d=r}function _xe(e,t,n,r){this.c=e,this.b=t,this.a=n,this.d=r}function vxe(e,t,n,r){this.c=e,this.b=t,this.d=n,this.a=r}function dA(e,t,n,r){this.a=e,this.e=t,this.d=n,this.c=r}function yxe(e,t,n,r){this.a=e,this.d=t,this.c=n,this.b=r}function fA(e,t,n,r){this.c=e,this.d=t,this.b=n,this.a=r}function pA(e,t,n,r){Ky.call(this,e,t),this.a=n,this.b=r}function bxe(e,t,n,r){qLe.call(this,e,n,r,!1),this.f=t}function xxe(e,t,n){var r=Urt(e);return t.qi(n,r)}function mA(e){var t,n=(t=new Yh,t);return LP(n,e),n}function Sxe(e){var t,n=(t=new Yh,t);return qYe(n,e),n}function Cxe(e){return!e.b&&(e.b=new L(i7,e,12,3)),e.b}function wxe(e){return UPe(e)||null}function Txe(e){RD();var t=I(e.g,9);t.n.a=e.d.c+t.d.b}function Exe(e){this.a=new Kh,this.e=H(q9,kK,54,e,0,2)}function Dxe(e){this.f=e,this.c=this.f.e,e.f>0&&rqe(this)}function Oxe(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function kxe(e,t,n,r){this.a=e,this.b=t,this.d=n,this.c=r}function Axe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function jxe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function hA(e,t,n,r){this.e=e,this.a=t,this.c=n,this.d=r}function Mxe(e,t,n,r){eT(),wke.call(this,t,n,r),this.a=e}function Nxe(e,t,n,r){eT(),wke.call(this,t,n,r),this.a=e}function Pxe(e,t){this.a=e,ode.call(this,e,I(e.d,16).dd(t))}function Fxe(e,t){return yR(wO(e)*CO(e),wO(t)*CO(t))}function Ixe(e,t){return yR(wO(e)*CO(e),wO(t)*CO(t))}function gA(e){var t;return t=e.f,t||(e.f=new Vy(e,e.c))}function _A(){_A=E,IQ=new ne,LQ=new ie,RQ=new ae}function vA(){vA=E,F_t=new se,I_t=new se,L_t=new ce}function yA(e){if(iz(e.d),e.d.d!=e.c)throw k(new sg)}function Lxe(e){return VE(e.b<e.d.gc()),e.d.Xb(e.c=e.b++)}function bA(e){e.a.a=e.c,e.c.b=e.a,e.a.b=e.c.a=null,e.b=0}function Rxe(e,t){return e.b=t.b,e.c=t.c,e.d=t.d,e.a=t.a,e}function zxe(e,t,n){return zT(e.a,(UB(t,n),new Uy(t,n))),e}function Bxe(e){return $D(e==null||Jve(e)&&e.Rm!==T),e}function xA(e){return e.n&&(e.e!==Kat&&e.he(),e.j=null),e}function Vxe(e){return e.length>0?VM(e):new Kh}function Hxe(e,t){return I(q(e,(X(),w0)),16).Ec(t),t}function Uxe(e,t){return XH(e,I(q(t,(XG(),J2)),15),t)}function Wxe(e){return JH(e)&&nv(ZE(Y(e,(XG(),A2))))}function Gxe(e,t,n){return Ab(),XBe(I(Dk(e.e,t),517),n)}function Kxe(e,t,n){e.i=0,e.e=0,t!=n&&ULe(e,t,n)}function qxe(e,t,n){e.i=0,e.e=0,t!=n&&WLe(e,t,n)}function Jxe(e,t,n,r){this.b=e,this.c=r,$C.call(this,t,n)}function Yxe(e,t){this.g=e,this.d=W(j(M$,1),KJ,9,0,[t])}function Xxe(e,t){e.d&&!e.d.a&&(ere(e.d,t),Xxe(e.d,t))}function Zxe(e,t){e.e&&!e.e.a&&(ere(e.e,t),Zxe(e.e,t))}function Qxe(e,t){return aR(e.j,t.s,t.c)+aR(t.e,e.s,e.c)}function $xe(e){return I(e.jd(),147).Og()+`:`+tz(e.kd())}function eSe(e,t){return-yR(wO(e)*CO(e),wO(t)*CO(t))}function tSe(e,t){return EL(e),EL(t),H_(I(e,24),I(t,24))}function SA(e,t,n){yP(e,t,new gp(epe(n)))}function nSe(e,t){new ab,this.a=new e_,this.b=e,this.c=t}function rSe(e){this.b=new Kh,UI(this.b,this.b),this.a=e}function iSe(e){this.b=new wa,this.a=e,r.Math.random()}function aSe(){dH(this,new Ef),this.wb=(yk(),K7),vy()}function oSe(){j_.call(this,`There is no more element.`)}function sSe(e,t,n,r){kC.call(this,t,n),this.b=e,this.a=r}function cSe(e,t,n,r,i,a){SN.call(this,e,t,n,r,i,a?-2:-1)}function CA(e){return!e.a&&(e.a=new L(p7,e,10,11)),e.a}function wA(e){return!e.q&&(e.q=new L(B7,e,11,10)),e.q}function B(e){return!e.s&&(e.s=new L(N7,e,21,17)),e.s}function TA(e,t){if(e==null)throw k(new tv(t));return e}function lSe(e,t){w_.call(this,new Lve(e)),this.a=e,this.b=t}function uSe(e){this.b=e,this.c=e,e.e=null,e.c=null,this.a=1}function dSe(e){Tv(),r.setTimeout(function(){throw e},0)}function fSe(e){return Sk(e),LWe(new RO(sE(e.a.Jc(),new f)))}function EA(e){return _A(),P(e,59)?new Pv(e):new mE(e)}function pSe(e){return P(e,18)?new pO(I(e,18)):Jhe(e.Jc())}function mSe(e){return new Cle(e,e.e.Pd().gc()*e.c.Pd().gc())}function hSe(e){return new wle(e,e.e.Pd().gc()*e.c.Pd().gc())}function gSe(e){return e&&e.hashCode?e.hashCode():bE(e)}function _Se(e,t){return t==null?!!OO(e.f,null):z_e(e.i,t)}function vSe(e,t){var n=OT(e.a,t);return n&&(t.d=null),n}function ySe(e,t,n){return e.f?e.f.cf(t,n):!1}function DA(e,t,n,r){Ek(e.c[t.g],n.g,r),Ek(e.c[n.g],t.g,r)}function bSe(e,t,n,r){Ek(e.c[t.g],t.g,n),Ek(e.b[t.g],t.g,r)}function xSe(e){e.Tg(`No crossing minimization`,1),e.Ug()}function SSe(e){this.c=e,this.b=new Ay(I(Sk(new Be),51))}function CSe(e){this.c=e,this.b=new Ay(I(Sk(new vt),51))}function wSe(e){this.b=e,this.a=new Ay(I(Sk(new tt),51))}function TSe(){this.b=new Sg,this.d=new ab,this.e=new Vg}function ESe(){this.d=new ab,this.b=new qh,this.c=new Kh}function DSe(){this.c=new uy,this.d=new uy,this.e=new uy}function OA(){this.a=new e_,this.b=(vF(3,KK),new mN(3))}function kA(e){this.c=e.c,this.d=e.d,this.b=e.b,this.a=e.a}function OSe(e,t,n,r,i,a){this.a=e,hF.call(this,t,n,r,i,a)}function kSe(e,t,n,r,i,a){this.a=e,hF.call(this,t,n,r,i,a)}function AA(e,t){this.e=e,this.a=sQ,this.b=X6e(t),this.c=t}function ASe(e,t){return P(t,147)&&TD(e.b,I(t,147).Og())}function jSe(e,t){return e.a?t.Dh().Jc():I(t.Dh(),72).Gi()}function MSe(e,t,n){return A(F(n.a))<=e&&A(F(n.b))>=t}function NSe(e,t,n){return n>=0&&TD(e.substr(n,t.length),t)}function jA(e,t,n,r,i,a,o){return new gM(e.e,t,n,r,i,a,o)}function MA(e,t,n){return dN(t,n,e.length),e.substr(t,n-t)}function NA(e,t){var n=Ey(e.Pm);return t==null?n:n+`: `+t}function PSe(e,t){var n=e.b.Oc(t);return XDe(n,e.b.gc()),n}function PA(e,t){if(e==null)throw k(new tv(t));return e}function FA(e){return e.u||=(MM(e),new Ade(e,e)),e.u}function IA(e){return I(xI(e,16),29)||e.fi()}function FSe(e){!e||NA(e,e.ge())}function ISe(){ISe=E,Svt=new Ne,wvt=new rve,Cvt=new ze}function LA(){LA=E;var e,t=!hHe();e=new b,Zgt=t?new y:e}function LSe(){return oN(),W(j(RSt,1),Z,422,0,[ISt,LSt])}function RSe(){return _P(),W(j(aCt,1),Z,419,0,[R1,iCt])}function zSe(){return PN(),W(j(vCt,1),Z,476,0,[_Ct,H1])}function BSe(){return nM(),W(j(qCt,1),Z,420,0,[GCt,KCt])}function VSe(){return CM(),W(j(bwt,1),Z,423,0,[ywt,vwt])}function HSe(){return XN(),W(j(Ikt,1),Z,421,0,[Pkt,Fkt])}function USe(){return rM(),W(j(NAt,1),Z,519,0,[Y4,J4])}function WSe(){return HA(),W(j(HAt,1),Z,510,0,[$4,Q4])}function GSe(){return ej(),W(j(WAt,1),Z,509,0,[e3,t3])}function KSe(){return $M(),W(j(sjt,1),Z,516,0,[i3,r3])}function qSe(){return VA(),W(j(mjt,1),Z,454,0,[a3,o3])}function JSe(){return kj(),W(j(zMt,1),Z,425,0,[RMt,LMt])}function YSe(){return IF(),W(j(GMt,1),Z,487,0,[N3,P3])}function XSe(){return ON(),W(j(nNt,1),Z,426,0,[eNt,tNt])}function ZSe(){return kM(),W(j(iFt,1),Z,478,0,[nFt,rFt])}function QSe(){return eN(),W(j(OFt,1),Z,428,0,[DFt,s6])}function $Se(){return gP(),W(j(Tyt,1),Z,424,0,[wyt,l$])}function eCe(){return FF(),W(j(cxt,1),Z,503,0,[V$,sxt])}function tCe(){return LI(),W(j(yIt,1),Z,427,0,[u6,vIt])}function RA(e,t,n,r){return n>=0?e.Rh(t,n,r):e.zh(null,n,r)}function zA(e){return e.b.b==0?e.a.uf():age(e.b)}function nCe(e){if(e.p!=5)throw k(new ug);return TO(e.f)}function rCe(e){if(e.p!=5)throw k(new ug);return TO(e.k)}function iCe(e){return N(e.a)===N(($F(),GBt))&&stt(e),e.a}function aCe(e,t){gee(this,new M(e.a,e.b)),zp(this,UD(t))}function oCe(e,t){_D.call(this),vNe(this),this.a=e,this.c=t}function sCe(e,t,n){eT(),Hh.call(this,t),this.a=e,this.b=n}function cCe(e,t,n){tK(),Wh.call(this,e),this.b=t,this.a=n}function BA(){Kre.call(this,new fb(_I(12))),eE(!0),this.a=2}function lCe(){hC.call(this,`FIXED_INTEGER_RATIO_BOXES`,2)}function VA(){VA=E,a3=new SS(Kq,0),o3=new SS(qq,1)}function HA(){HA=E,$4=new vS(qq,0),Q4=new vS(Kq,1)}function uCe(e,t){e.c=t,e.c>0&&e.b>0&&(e.g=_O(e.c,e.b,e.a))}function dCe(e,t){e.b=t,e.c>0&&e.b>0&&(e.g=_O(e.c,e.b,e.a))}function fCe(e){var t=e.c.d.b;e.b=t,e.a=e.c.d,t.a=e.c.d.b=e}function UA(e){var t;uPe(e.a),vce(e.a),t=new Mm(e.a),uz(t)}function WA(e,t){return t==null?LC(OO(e.f,null)):ex(e.i,t)}function pCe(e){return e.b==0?null:(VE(e.b!=0),OP(e,e.a.a))}function GA(e){return Math.max(Math.min(e,uK),-2147483648)|0}function mCe(e,t,n,r,i){return new yH(e,(NN(),rvt),t,n,r,i)}function KA(e,t){return $De(t),$Ne(e,H(q9,cq,30,t,15,1),t)}function hCe(e,t){return IP(),I(q(t,(BW(),A3)),15).a==e}function gCe(e,t){C6e(e,!0),AP(e.e.Pf(),new Dpe(e,!0,t))}function qA(e,t){return TA(e,`set1`),TA(t,`set2`),new Fae(e,t)}function _Ce(e,t){return Jgt[e.charCodeAt(0)]??e}function vCe(e,t){return yD(GE(ONe(e.f,t)),e.f.d)}function yCe(e,t){var n=t,r=new he;return bnt(e,n,r),r.d}function bCe(e,t,n,r){var i=new Yde;t.a[n.g]=i,ak(e.b,r,i)}function xCe(e,t,n){var r=e.Fh(t);r>=0?e.$h(r,n):g2e(e,t,n)}function JA(e,t,n){dj(),e&&Yk(uBt,e,t),e&&Yk(C7,e,n)}function SCe(e,t,n){this.i=new Kh,this.b=e,this.g=t,this.a=n}function YA(e,t,n){this.c=new Kh,this.e=e,this.f=t,this.b=n}function CCe(e,t,n){this.a=new Kh,this.e=e,this.f=t,this.c=n}function wCe(e){_D.call(this),vNe(this),this.a=e,this.c=!0}function TCe(e){this.a=I(Sk(e),277),this.b=(_A(),new Lle(e))}function ECe(e,t){hT(this),this.f=t,this.g=e,xA(this),this.he()}function XA(e,t){var n=e.q.getHours();e.q.setDate(t),qW(e,n)}function DCe(e,t){var n;for(Sk(t),n=e.a;n;n=n.c)t.Wd(n.g,n.i)}function OCe(e){var t=new ky(_I(e.length));return ALe(t,e),t}function kCe(e){function t(){}return t.prototype=e||{},new t}function ACe(e,t){return RIe(e,t)?(aPe(e),!0):!1}function ZA(e,t){if(t==null)throw k(new dg);return THe(e,t)}function jCe(e){if(e.ye())return null;var t=e.n;return oQ[t]}function QA(e){return e.Db>>16==3?I(e.Cb,26):null}function $A(e){return e.Db>>16==9?I(e.Cb,26):null}function MCe(e){return e.Db>>16==6?I(e.Cb,85):null}function NCe(e,t){var n=e.Fh(t);return n>=0?e.Th(n):KH(e,t)}function PCe(e,t,n){e.b=new jF(PLe(e,t,n).c.length)}function ej(){ej=E,e3=new yS(vst,0),t3=new yS(`UP`,1)}function FCe(){FCe=E,Bgt=VL((Cv(),W(j(zgt,1),Z,538,0,[Rgt])))}function ICe(e){this.a=e,this.b=H(OAt,kK,2008,e.e.length,0,2)}function LCe(){this.a=new Ow,this.e=new Sg,this.g=0,this.i=0}function RCe(e){return!e.a&&(e.a=new L(p7,e,10,11)),e.a.i>0}function zCe(e,t){return r.Math.abs(e)<r.Math.abs(t)?e:t}function BCe(e,t){return LD(),hE(),I(t.a,15).a<e}function VCe(e,t){return LD(),hE(),I(t.b,15).a<e}function HCe(e,t){return e.b+=t.b,e.c+=t.c,e.d+=t.d,e.a+=t.a,e}function UCe(e){var t=e.d;return t=e._i(e.f),gN(e,t),t.Ob()}function WCe(e,t){var n=new x_e(t);return TYe(n,e),new jD(n)}function GCe(e){if(e.p!=0)throw k(new ug);return GC(e.f,0)}function KCe(e){if(e.p!=0)throw k(new ug);return GC(e.k,0)}function qCe(e){return e.Db>>16==7?I(e.Cb,241):null}function tj(e){return e.Db>>16==6?I(e.Cb,241):null}function JCe(e){return e.Db>>16==7?I(e.Cb,174):null}function YCe(e){return e.Db>>16==3?I(e.Cb,158):null}function nj(e){return e.Db>>16==11?I(e.Cb,26):null}function rj(e){return e.Db>>16==17?I(e.Cb,29):null}function XCe(e){var t;return FR(e),t=new Sg,oA(e,new Hee(t))}function ZCe(e,t){var n=e.a=e.a||[];return n[t]||(n[t]=e.te(t))}function QCe(e,t){var n=e.q.getHours();e.q.setMonth(t),qW(e,n)}function ij(e,t){e.c&&VN(e.c.g,e),e.c=t,e.c&&zT(e.c.g,e)}function aj(e,t){e.c&&VN(e.c.a,e),e.c=t,e.c&&zT(e.c.a,e)}function oj(e,t){e.d&&VN(e.d.e,e),e.d=t,e.d&&zT(e.d.e,e)}function sj(e,t){e.i&&VN(e.i.j,e),e.i=t,e.i&&zT(e.i.j,e)}function cj(e,t,n){return t==null?PH(e.f,null,n):IR(e.i,t,n)}function lj(e,t,n,r,i,a){return new QN(e.e,t,e.Jj(),n,r,i,a)}function $Ce(e){return DL(),hE(),I(e.a,82).d.e!=0}function ewe(e,t){this.a=e,this.c=wT(this.a),this.b=new kA(t)}function twe(e,t,n){this.a=t,this.c=e,this.b=(Sk(n),new jD(n))}function nwe(e,t,n){this.a=t,this.c=e,this.b=(Sk(n),new jD(n))}function uj(e,t){if(e<0||e>t)throw k(new G_(Kot+e+qot+t))}function dj(){dj=E,uBt=new qh,C7=new qh,Mse(B_t,new ol)}function rwe(){rwe=E,sAt=MO(new Hk,(iH(),S$),(eK(),s1))}function iwe(){iwe=E,cAt=MO(new Hk,(iH(),S$),(eK(),s1))}function awe(){awe=E,lAt=MO(new Hk,(iH(),S$),(eK(),s1))}function owe(){owe=E,uAt=MO(new Hk,(iH(),S$),(eK(),s1))}function swe(){swe=E,fAt=MO(new Hk,(iH(),S$),(eK(),s1))}function cwe(){cwe=E,pAt=MO(new Hk,(iH(),S$),(eK(),s1))}function lwe(){lwe=E,FAt=oO(new Hk,(iH(),S$),(eK(),q$))}function fj(){fj=E,RAt=oO(new Hk,(iH(),S$),(eK(),q$))}function uwe(){uwe=E,VAt=oO(new Hk,(iH(),S$),(eK(),q$))}function dwe(){dwe=E,KAt=oO(new Hk,(iH(),S$),(eK(),q$))}function fwe(){fwe=E,VMt=MO(new Hk,(dV(),l3),(yW(),bjt))}function pj(e,t,n,r){this.c=e,this.d=r,mwe(this,t),hwe(this,n)}function mj(e){this.c=new ab,this.b=e.b,this.d=e.c,this.a=e.a}function pwe(e){this.a=r.Math.cos(e),this.b=r.Math.sin(e)}function mwe(e,t){e.a&&VN(e.a.k,e),e.a=t,e.a&&zT(e.a.k,e)}function hwe(e,t){e.b&&VN(e.b.f,e),e.b=t,e.b&&zT(e.b.f,e)}function gwe(e,t){abe(e,e.b,e.c),I(e.b.b,68),t&&I(t.b,68).b}function _we(e,t){LBe(e,t),P(e.Cb,88)&&LH(MM(I(e.Cb,88)),2)}function vwe(e,t){P(e.Cb,88)&&LH(MM(I(e.Cb,88)),4),VF(e,t)}function hj(e,t){P(e.Cb,184)&&(I(e.Cb,184).tb=null),VF(e,t)}function ywe(e,t){var n=I(qL(gA(e.a),t),18);return n?n.gc():0}function bwe(e){var t,n=(vy(),t=new Yh,t);return LP(n,e),n}function xwe(e){var t,n=(vy(),t=new Yh,t);return LP(n,e),n}function Swe(e){for(var t;;)if(t=e.Pb(),!e.Ob())return t}function gj(e){return mW(),JL(e,0)>=0?wz(e):mk(wz(zN(e)))}function Cwe(e,t){mle(e,TO(Ej(BO(t,24),Pq)),TO(Ej(t,Pq)))}function wwe(e,t){return yR(I(e.c,65).c.e.b,I(t.c,65).c.e.b)}function Twe(e,t){return yR(I(e.c,65).c.e.a,I(t.c,65).c.e.a)}function _j(e,t){return Wb(),aP(t)?new sO(t,e):new HC(t,e)}function Ewe(e,t,n){return new yH(e,(NN(),nvt),null,!1,t,n)}function Dwe(e,t,n){return new yH(e,(NN(),ivt),t,n,null,!1)}function Owe(e,t,n){var r;qze(t,n,e.c.length),r=n-t,Jie(e.c,t,r)}function vj(e,t,n){qze(t,n,e.gc()),this.c=e,this.a=t,this.b=n-t}function yj(e,t){this.b=(Wk(e),e),this.a=(t&xq)==0?t|64|AK:t}function bj(e,t){if(e<0||e>=t)throw k(new G_(Kot+e+qot+t))}function xj(e,t){if(e<0||e>=t)throw k(new Av(Kot+e+qot+t))}function kwe(e,t){t.c!=null&&kk(e,new Ak(t.c))}function Awe(e,t,n){var r=new Dw(n.d);yD(r,e),NBe(t,r.a,r.b)}function jwe(e){var t;return FR(e),t=(vA(),vA(),I_t),CP(e,t)}function Sj(e){return uL(W(j(T6,1),kK,8,0,[e.i.n,e.n,e.a]))}function Mwe(){return YN(),W(j(_bt,1),Z,384,0,[hbt,mbt,gbt])}function Nwe(){return ML(),W(j(UQ,1),Z,130,0,[mvt,HQ,hvt])}function Pwe(){return NP(),W(j(YQ,1),Z,237,0,[KQ,qQ,JQ])}function Fwe(){return MN(),W(j(jvt,1),Z,461,0,[QQ,ZQ,$Q])}function Iwe(){return uP(),W(j(Pvt,1),Z,462,0,[n$,t$,e$])}function Lwe(){return ZL(),W(j(pkt,1),Z,352,0,[dkt,fkt,C4])}function Rwe(){return jI(),W(j(RCt,1),Z,302,0,[ICt,LCt,t0])}function zwe(){return QI(),W(j(VCt,1),Z,329,0,[r0,BCt,n0])}function Bwe(){return dP(),W(j(UCt,1),Z,316,0,[a0,o0,i0])}function Vwe(){return LF(),W(j(CSt,1),Z,368,0,[T1,w1,C1])}function Hwe(){return jL(),W(j(qkt,1),Z,348,0,[Kkt,Gkt,z4])}function Uwe(){return AI(),W(j(Ukt,1),Z,381,0,[Bkt,Vkt,Hkt])}function Wwe(){return dF(),W(j(Rkt,1),Z,452,0,[R4,I4,L4])}function Gwe(){return FL(),W(j(Zkt,1),Z,349,0,[Ykt,Xkt,B4])}function Kwe(){return lF(),W(j(nAt,1),Z,351,0,[tAt,$kt,eAt])}function qwe(){return II(),W(j(aAt,1),Z,382,0,[iAt,H4,V4])}function Jwe(){return _L(),W(j(Pjt,1),Z,385,0,[Njt,Mjt,f3])}function Ywe(){return AL(),W(j(oNt,1),Z,386,0,[F3,iNt,aNt])}function Xwe(){return XR(),W(j(mPt,1),Z,387,0,[fPt,pPt,dPt])}function Zwe(){return uF(),W(j(KSt,1),Z,350,0,[WSt,I1,GSt])}function Qwe(){return $I(),W(j(cCt,1),Z,449,0,[sCt,z1,B1])}function $we(){return Az(),W(j($Nt,1),Z,436,0,[z3,B3,QNt])}function eTe(){return MI(),W(j(XNt,1),Z,304,0,[JNt,YNt,qNt])}function tTe(){return CR(),W(j(mFt,1),Z,430,0,[dFt,pFt,fFt])}function nTe(){return FN(),W(j(lFt,1),Z,429,0,[oFt,cFt,sFt])}function rTe(){return SR(),W(j(yFt,1),Z,435,0,[i6,a6,o6])}function iTe(){return PP(),W(j(ERt,1),Z,279,0,[E8,D8,O8])}function aTe(){return kL(),W(j(GRt,1),Z,347,0,[P8,N8,F8])}function oTe(){return VP(),W(j(dzt,1),Z,300,0,[F5,lzt,uzt])}function sTe(){return xR(),W(j(vzt,1),Z,281,0,[_zt,Y5,X5])}function Cj(e){return Ab(),P(e.g,9)?I(e.g,9):null}function cTe(e){return e.a==(QM(),h9)&&bee(e,m6e(e.g,e.b)),e.a}function wj(e){return e.d==(QM(),h9)&&Tee(e,W7e(e.g,e.b)),e.d}function lTe(e,t){var n=(Wk(e),e).g;return hue(!!n),Wk(t),n(t)}function uTe(e,t,n){var r=new eo;r.b=t,r.a=n,++t.b,zT(e.d,r)}function dTe(e,t,n){var r=eG(e,t,!1);return r.b<=t&&r.a<=n}function fTe(e,t){var n,r=QO(e,t);return n=e.a.dd(r),new Mae(e,n)}function pTe(e){return e.Db>>16==6?I(oU(e),241):null}function mTe(e){if(e.p!=2)throw k(new ug);return TO(e.f)&aq}function hTe(e){if(e.p!=2)throw k(new ug);return TO(e.k)&aq}function Tj(e){return Sk(e),P(e,18)?new jD(I(e,18)):HD(e.Jc())}function gTe(e){lO(),this.a=(_A(),P(e,59)?new Pv(e):new mE(e))}function Ej(e,t){return hI(yve(_w(e)?TI(e):e,_w(t)?TI(t):t))}function Dj(e,t){return hI(bve(_w(e)?TI(e):e,_w(t)?TI(t):t))}function _Te(e,t){return hI(xve(_w(e)?TI(e):e,_w(t)?TI(t):t))}function vTe(e,t){return R_e(e.a,t)?qge(e.b,I(t,24).g,null):null}function yTe(e){return VR(zO(vI(SU(e,32)),32),vI(SU(e,32)))}function bTe(e){var t=I(eO(e.b),10);return new MD(e.a,t,e.c)}function xTe(e,t){rit(e,t,A(F(e.a.mf(($G(),u8)))))}function STe(e,t){ik.call(this,1,2,W(j(q9,1),cq,30,15,[e,t]))}function CTe(e,t){Gre.call(this,new fb(_I(e))),vF(t,zat),this.a=t}function wTe(e,t,n){Wh.call(this,25),this.b=e,this.a=t,this.c=n}function Oj(e){tK(),Wh.call(this,e),this.c=!1,this.a=!1}function TTe(){this.c=new Vce,this.a=new Dke,this.b=new Tre,roe()}function kj(){kj=E,RMt=new DS(`DFS`,0),LMt=new DS(`BFS`,1)}function ETe(e){return e.b==null||e.b.length==0?`n_`+e.a:`n_`+e.b}function Aj(e){return I(Qz(e,H(M$,KJ,9,e.c.length,0,1)),199)}function DTe(e,t){return e&&e.equals?e.equals(t):N(e)===N(t)}function OTe(e,t){return fP(),e.c==t.c?yR(t.d,e.d):yR(e.c,t.c)}function kTe(e,t){return fP(),e.c==t.c?yR(e.d,t.d):yR(e.c,t.c)}function ATe(e,t){return fP(),e.c==t.c?yR(e.d,t.d):yR(t.c,e.c)}function jTe(e,t){return fP(),e.c==t.c?yR(t.d,e.d):yR(t.c,e.c)}function MTe(e,t){e.b|=t.b,e.c|=t.c,e.d|=t.d,e.a|=t.a}function NTe(e,t,n){var r=e.d[t.p];e.d[t.p]=e.d[n.p],e.d[n.p]=r}function PTe(e,t,n){var r;e.n&&t&&n&&(r=new Vc,zT(e.e,r))}function FTe(e,t){var n=I(Dk(e.g,t),60);AP(t.d,new Joe(e,n))}function ITe(e,t){var n=fGe(e),r=fGe(t);return n<r?-1:+(n>r)}function LTe(e,t){var n=qN(t);return I(Dk(e.c,n),15).a}function RTe(e,t){for(var n=e+``;n.length<t;)n=`0`+n;return n}function jj(e){return e.c==null||e.c.length==0?`n_`+e.g:`n_`+e.c}function zTe(e){return!!e.u&&lM(e.u.a).i!=0&&!(e.n&&RB(e.n))}function BTe(e,t){return t==0?!!e.o&&e.o.f!=0:cB(e,t)}function V(e){return VE(e.a<e.c.c.length),e.b=e.a++,e.c.c[e.b]}function VTe(e,t){if(ok(e.a,t),t.d)throw k(new j_(Xot));t.d=e}function HTe(e,t){this.a=new Kh,this.d=new Kh,this.f=e,this.c=t}function UTe(){eL(),this.b=new qh,this.a=new qh,this.c=new Kh}function WTe(e,t,n){this.d=e,this.j=t,this.e=n,this.o=-1,this.p=3}function GTe(e,t,n){this.d=e,this.k=t,this.f=n,this.o=-1,this.p=5}function KTe(e,t,n,r,i,a){rke.call(this,e,t,n,r,i),a&&(this.o=-2)}function qTe(e,t,n,r,i,a){UNe.call(this,e,t,n,r,i),a&&(this.o=-2)}function JTe(e,t,n,r,i,a){WNe.call(this,e,t,n,r,i),a&&(this.o=-2)}function YTe(e,t,n,r,i,a){ake.call(this,e,t,n,r,i),a&&(this.o=-2)}function XTe(e,t,n,r,i,a){qNe.call(this,e,t,n,r,i),a&&(this.o=-2)}function ZTe(e,t,n,r,i,a){ike.call(this,e,t,n,r,i),a&&(this.o=-2)}function QTe(e,t,n,r,i,a){GNe.call(this,e,t,n,r,i),a&&(this.o=-2)}function $Te(e,t,n,r,i,a){KNe.call(this,e,t,n,r,i),a&&(this.o=-2)}function eEe(e,t,n,r){Hh.call(this,n),this.b=e,this.c=t,this.d=r}function tEe(e,t){this.f=e,this.a=(QM(),m9),this.c=m9,this.b=t}function nEe(e,t){this.g=e,this.d=(QM(),h9),this.a=h9,this.b=t}function rEe(e,t){!e.c&&(e.c=new lI(e,0)),uG(e.c,(TG(),T9),t)}function iEe(e,t){return C0e(e,t,P(t,103)&&(I(t,19).Bb&Cq)!=0)}function aEe(e,t){return fye(vI(e.q.getTime()),vI(t.q.getTime()))}function oEe(e){return t_e(e.e.Pd().gc()*e.c.Pd().gc(),16,new Hf(e))}function sEe(e){return!!e.a&&JN(e.a.a).i!=0&&!(e.b&&zB(e.b))}function cEe(e){return e.a?e.e.length==0?e.a.a:e.a.a+(``+e.e):e.c}function Mj(e){for(;e.d>0&&e.a[--e.d]==0;);e.a[e.d++]==0&&(e.e=0)}function lEe(e){return VE(e.b.b!=e.d.a),e.c=e.b=e.b.b,--e.a,e.c.c}function uEe(e,t){var n=1-t;return e.a[n]=AF(e.a[n],n),AF(e,t)}function dEe(e,t){var n,r=Ej(e,Eq);return n=zO(t,32),Dj(n,r)}function fEe(e,t,n){var r=I(e.Zb().xc(t),18);return!!r&&r.Gc(n)}function pEe(e,t,n){var r=I(e.Zb().xc(t),18);return!!r&&r.Kc(n)}function mEe(e,t,n){BGe(new twe((Sk(e),new jD(e)),t,n))}function Nj(e,t,n){VGe(new nwe((Sk(e),new jD(e)),t,n))}function hEe(e,t,n){e.a=t,e.c=n,e.b.a.$b(),bA(e.d),_g(e.e.a.c,0)}function Pj(e,t,n,r,i,a){return KFe(e,t,n,a),Jze(e,r),Yze(e,i),e}function gEe(e,t,n,r){return e.a+=``+MA(t==null?gK:tz(t),n,r),e}function Fj(e,t){this.a=e,um.call(this,e),uj(t,e.gc()),this.b=t}function _Ee(e,t){var n;e.e=new m_,n=JU(t),oT(n,e.c),q3e(e,n,0)}function Ij(e,t,n,r){var i=new fc;i.a=t,i.b=n,i.c=r,QD(e.a,i)}function Lj(e,t,n,r){var i=new fc;i.a=t,i.b=n,i.c=r,QD(e.b,i)}function vEe(e,t){return new Dhe(t,jue(wT(t.e),e,e),(hE(),!0))}function yEe(e,t){return FP(),I(q(t,(BW(),O3)),15).a>=e.gc()}function bEe(e){return fj(),!jM(e)&&!(!jM(e)&&e.c.i.c==e.d.i.c)}function Rj(e){return I(Qz(e,H(j$,GJ,17,e.c.length,0,1)),324)}function zj(e){return new mN((vF(e,JK),xP(VR(VR(5,e),e/10|0))))}function xEe(e){return t_e(e.e.Pd().gc()*e.c.Pd().gc(),273,new Vf(e))}function SEe(e){aVe((!e.a&&(e.a=new L(p7,e,10,11)),e.a),new Fs)}function CEe(){var e,t=(n=(e=new Yh,e),n),n;return zT(aVt,t),t}function Bj(e){var t;return _w(e)?(t=e,t==-0?0:t):dMe(e)}function wEe(e,t){return P(t,45)?KB(e.a,I(t,45)):!1}function TEe(e,t){return P(t,45)?KB(e.a,I(t,45)):!1}function EEe(e,t){return P(t,45)?KB(e.a,I(t,45)):!1}function DEe(e,t){return e.a<=e.b?(t.Bd(e.a++),!0):!1}function Vj(e,t){if(e<0||e>=t)throw k(new G_(_Qe(e,t)));return e}function OEe(e,t,n){if(e<0||t<e||t>n)throw k(new G_(oZe(e,t,n)))}function kEe(e,t,n){e.d&&VN(e.d.e,e),e.d=t,e.d&&DO(e.d.e,n,e)}function Hj(e,t){Tit(t,e),rge(e.d),rge(I(q(e,(XG(),R2)),213))}function Uj(e,t){Eit(t,e),nge(e.d),nge(I(q(e,(XG(),R2)),213))}function AEe(e){var t;return zk(e),t=new le,jy(e.a,new Dm(t)),t}function Wj(e){var t;return zk(e),t=new ue,jy(e.a,new Bee(t)),t}function jEe(e){return nA(e).dc()?!1:(Bce(e,new g),!0)}function MEe(e){if(!(`stack`in e))try{throw e}catch{}return e}function NEe(e,t,n){var r=iUe();try{return zde(e,t,n)}finally{ske(r)}}function Gj(e,t){var n=ZA(e,t),r=null;return n&&(r=n.ne()),r}function Kj(e,t){var n=mP(e,t),r=null;return n&&(r=n.qe()),r}function qj(e,t){var n=ZA(e,t),r=null;return n&&(r=n.qe()),r}function Jj(e,t){var n=ZA(e,t),r=null;return n&&(r=mZe(n)),r}function PEe(e,t,n){var r=zz(n);return hW(e.n,r,t),hW(e.o,t,n),t}function FEe(e,t,n){this.d=new Ste(this),this.e=e,this.i=t,this.f=n}function IEe(e,t,n,r){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1}function LEe(e,t,n,r){return P(n,59)?new nue(e,t,n,r):new hve(e,t,n,r)}function REe(e){return I(Qz(e,H(ixt,Yst,12,e.c.length,0,1)),2007)}function zEe(e){this.a=H(sQ,hK,1,SLe(r.Math.max(8,e))<<1,5,1)}function BEe(e){JF.call(this,e,(NN(),tvt),null,!1,null,!1)}function VEe(e){var t=e.Dh();this.a=P(t,72)?I(t,72).Gi():t.Jc()}function HEe(e){return new yj(SNe(I(e.a.kd(),18).gc(),e.a.jd()),16)}function Yj(e){return P(e,18)?I(e,18).dc():!e.Jc().Ob()}function UEe(e){if(e.e.g!=e.b)throw k(new sg);return!!e.c&&e.d>0}function Xj(e){return VE(e.b!=e.d.c),e.c=e.b,e.b=e.b.a,++e.a,e.c.c}function WEe(e,t){Wk(t),Ek(e.a,e.c,t),e.c=e.c+1&e.a.length-1,DGe(e)}function Zj(e,t){Wk(t),e.b=e.b-1&e.a.length-1,Ek(e.a,e.b,t),DGe(e)}function GEe(){GEe=E,bAt=Wbe(K(1),K(4)),yAt=Wbe(K(1),K(2))}function KEe(){KEe=E,CFt=VL((Mb(),W(j(SFt,1),Z,477,0,[xFt])))}function qEe(){qEe=E,EFt=VL((Nb(),W(j(TFt,1),Z,547,0,[wFt])))}function JEe(){JEe=E,_It=VL((Pb(),W(j(gIt,1),Z,528,0,[l6])))}function YEe(){return ZI(),W(j(Mbt,1),Z,408,0,[w$,D$,T$,E$])}function XEe(){return PI(),W(j(lyt,1),Z,409,0,[a$,i$,syt,cyt])}function ZEe(){return NN(),W(j(BQ,1),Z,310,0,[tvt,nvt,rvt,ivt])}function QEe(){return XI(),W(j(eSt,1),Z,367,0,[$xt,p1,m1,f1])}function $Ee(){return qz(),W(j(Ubt,1),Z,383,0,[k$,Vbt,Bbt,Hbt])}function eDe(){return NI(),W(j(hSt,1),Z,413,0,[h1,g1,_1,mSt])}function tDe(e){var t;return e.j==(RG(),j5)&&(t=u1e(e),CE(t,p5))}function nDe(){return cz(),W(j(HSt,1),Z,301,0,[F1,BSt,P1,VSt])}function rDe(){return wB(),W(j(gkt,1),Z,203,0,[E4,hkt,T4,w4])}function iDe(){return Rz(),W(j(Mkt,1),Z,269,0,[F4,kkt,Akt,jkt])}function aDe(e,t){return I(vE(HO(I(BM(e.k,t),16).Mc(),E1)),113)}function oDe(e,t){return I(vE(UO(I(BM(e.k,t),16).Mc(),E1)),113)}function sDe(e,t){var n=t.a;ij(n,t.c.d),oj(n,t.d.d),aI(n.a,e.n)}function cDe(e,t){var n=I(sP(e.b,t),66);return!n&&(n=new ab),n}function Qj(e){return Ab(),P(e.g,156)?I(e.g,156):null}function lDe(e){e.a=null,e.e=null,_g(e.b.c,0),_g(e.f.c,0),e.c=null}function uDe(e,t,n,r){this.e=null,this.c=e,this.d=t,this.a=n,this.b=r}function dDe(e,t,n,r,i){this.i=e,this.a=t,this.e=n,this.j=r,this.f=i}function fDe(e,t,n,r){var i=r[t.g][n.g];return A(F(q(e.a,i)))}function pDe(e,t){var n;for(n=e.j.c.length;n<t;n++)zT(e.j,e.Mg())}function mDe(e,t){return LT(new M(t.e.a+t.f.a/2,t.e.b+t.f.b/2),e)}function hDe(){return PL(),W(j(FMt,1),Z,353,0,[PMt,j3,NMt,MMt])}function gDe(){return qB(),W(j(GNt,1),Z,354,0,[WNt,HNt,UNt,VNt])}function _De(){return XL(),W(j(EAt,1),Z,404,0,[U4,G4,K4,W4])}function vDe(){return eH(),W(j(aPt,1),Z,401,0,[iPt,tPt,rPt,nPt])}function yDe(){return dV(),W(j(gjt,1),Z,398,0,[s3,c3,l3,u3])}function bDe(){return QL(),W(j(wRt,1),Z,278,0,[T8,w8,SRt,CRt])}function xDe(){return SM(),W(j(Z5,1),Z,288,0,[bzt,Czt,xzt,Szt])}function SDe(){return jz(),W(j(B5,1),Z,380,0,[R5,z5,L5,I5])}function CDe(){return wR(),W(j(kRt,1),Z,222,0,[ORt,A8,k8,j8])}function wDe(){return fV(),W(j(JRt,1),Z,292,0,[z8,I8,L8,R8])}function TDe(){return lz(),W(j(kzt,1),Z,327,0,[Ozt,Tzt,Dzt,Ezt])}function EDe(){return NL(),W(j(Izt,1),Z,407,0,[Nzt,Pzt,Mzt,Fzt])}function DDe(e){return dj(),tk(uBt,e)?I(Dk(uBt,e),342).Pg():null}function $j(e,t,n){return t<0?KH(e,n):I(n,69).uk().zk(e,e.ei(),t)}function ODe(e,t,n){var r=zz(n);return hW(e.f,r,t),Yk(e.g,t,n),t}function kDe(e,t,n){var r=zz(n);return hW(e.p,r,t),Yk(e.q,t,n),t}function ADe(e){var t=(hy(),n=new Zc,n),n;return e&&DU(t,e),t}function jDe(e){var t=e.$i(e.i);return e.i>0&&RW(e.g,0,t,0,e.i),t}function eM(e){for(var t=0;e.Ob();)e.Pb(),t=VR(t,1);return xP(t)}function MDe(e,t){var n=new kv;return e.Ed(n),n.a+=`..`,t.Fd(n),n.a}function NDe(e,t){Bb();var n=I(Dk(D7,e),58);return!n||n.dk(t)}function PDe(e,t,n){if(n){var r=n.me();e.a[t]=r(n)}else delete e.a[t]}function tM(e,t){return t.e==0||e.e==0?MQ:(QU(),NU(e,t))}function FDe(e){if(e.p!=1)throw k(new ug);return TO(e.f)<<24>>24}function IDe(e){if(e.p!=1)throw k(new ug);return TO(e.k)<<24>>24}function LDe(e){if(e.p!=7)throw k(new ug);return TO(e.k)<<16>>16}function RDe(e){if(e.p!=7)throw k(new ug);return TO(e.f)<<16>>16}function nM(){nM=E,GCt=new Zx(Gq,0),KCt=new Zx(`TOP_LEFT`,1)}function rM(){rM=E,Y4=new hS(`UPPER`,0),J4=new hS(`LOWER`,1)}function zDe(e,t,n){var r=I(Dk(e.g,n),60);zT(e.a.c,new vC(t,r))}function BDe(e,t,n,r,i){zT(t,rQe(i,Y0e(i,n,r))),eXe(e,i,t)}function VDe(e,t,n){e.i=0,e.e=0,t!=n&&(WLe(e,t,n),ULe(e,t,n))}function HDe(e,t,n){return _ve(F(LC(OO(e.f,t))),F(LC(OO(e.f,n))))}function UDe(e,t){return I(t==null?LC(OO(e.f,null)):ex(e.i,t),290)}function WDe(e,t){return N(t)===N(e)?`(this Map)`:t==null?gK:tz(t)}function GDe(e,t){return e==(vU(),R$)&&t==R$?4:e==R$||t==R$?8:32}function iM(e,t,n){return WW(e,t,n,P(t,103)&&(I(t,19).Bb&Cq)!=0)}function KDe(e,t,n){return YW(e,t,n,P(t,103)&&(I(t,19).Bb&Cq)!=0)}function qDe(e,t,n){return I0e(e,t,n,P(t,103)&&(I(t,19).Bb&Cq)!=0)}function aM(e,t){Wb();var n=I(e,69).tk();return TXe(n,t),n.vl(t)}function oM(e,t){mW(),ik.call(this,e,1,W(j(q9,1),cq,30,15,[t]))}function sM(e,t){tK(),Wh.call(this,e),this.a=t,this.c=-1,this.b=-1}function JDe(e,t){DSe.call(this),this.a=e,this.b=t,zT(this.a.b,this)}function cM(e){return VE(e.a<e.c.a.length),e.b=e.a,yMe(e),e.c.b[e.b]}function lM(e){return e.n||(MM(e),e.n=new X_e(e,z7,e),FA(e)),e.n}function YDe(e,t){for(var n=t;n;)KE(e,n.i,n.j),n=nj(n);return e}function XDe(e,t){var n;for(n=0;n<t;++n)Ek(e,n,new pm(I(e[n],45)))}function ZDe(e,t){var n=e.q.getHours();e.q.setFullYear(t+sq),qW(e,n)}function QDe(e,t){gL();var n=e.j.g-t.j.g;return n==0?0:n}function uM(e,t,n){n=n?n.me()(n):void 0,e.a[t]=n}function $De(e){if(e<0)throw k(new Qre(`Negative array size: `+e))}function eOe(e){P(e,206)&&!nv(ZE(e.mf(($G(),$6))))&&R7e(I(e,26))}function dM(e){return e.c&&e.d?ETe(e.c)+`->`+ETe(e.d):`e_`+bE(e)}function tOe(e,t){var n;return n=t==null?LC(OO(e.f,t)):WA(e,t),IC(n)}function nOe(e,t){var n;return n=t==null?LC(OO(e.f,t)):WA(e,t),IC(n)}function rOe(e,t){return cb(),gN(B(e.a),t)}function iOe(e,t){return cb(),gN(B(e.a),t)}function fM(e,t,n){this.e=e,this.a=sQ,this.b=X6e(t),this.c=t,this.d=n}function pM(e){this.e=e,this.c=this.e.a,this.b=this.e.g,this.d=this.e.i}function aOe(e){this.c=e,this.a=I(yV(e),159),this.b=this.a.hk().ti()}function mM(e,t,n,r){WTe.call(this,1,n,r),this.c=e,this.b=t}function hM(e,t,n,r){GTe.call(this,1,n,r),this.c=e,this.b=t}function gM(e,t,n,r,i,a,o){hF.call(this,t,r,i,a,o),this.c=e,this.a=n}function _M(){qh.call(this),pue(this),this.d.b=this.d,this.d.a=this.d}function oOe(e){this.d=e,this.b=this.d.a.entries(),this.a=this.b.next()}function vM(e){JJe(),mle(this,TO(Ej(BO(e,24),Pq)),TO(Ej(e,Pq)))}function yM(e,t){var n;return t.b.Kb(Uje(e,t.c.Ve(),(n=new Om(t),n)))}function sOe(e,t){var n;return $De(t),n=e.slice(0,t),n.length=t,jN(n,e)}function bM(e){var t;return e?new x_e(e):(t=new Ow,BF(t,e),t)}function cOe(e,t){var n;for(n=e.d-1;n>=0&&e.a[n]===t[n];n--);return n<0}function lOe(e,t){var n,r=!1;do n=vLe(e,t),r|=n;while(n);return r}function xM(e,t,n,r){var i=new de;i.c=t,i.b=n,i.a=r,r.b=n.a=i,++e.b}function SM(){SM=E,bzt=new Xge,Czt=new pve,xzt=new lCe,Szt=new Hve}function CM(){CM=E,ywt=new $x(BJ,0),vwt=new $x(`ALTERNATING`,1)}function uOe(){uOe=E,yCt=VL((PN(),W(j(vCt,1),Z,476,0,[_Ct,H1])))}function dOe(){dOe=E,zSt=VL((oN(),W(j(RSt,1),Z,422,0,[ISt,LSt])))}function fOe(){fOe=E,oCt=VL((_P(),W(j(aCt,1),Z,419,0,[R1,iCt])))}function pOe(){pOe=E,JCt=VL((nM(),W(j(qCt,1),Z,420,0,[GCt,KCt])))}function mOe(){mOe=E,xwt=VL((CM(),W(j(bwt,1),Z,423,0,[ywt,vwt])))}function hOe(){hOe=E,Lkt=VL((XN(),W(j(Ikt,1),Z,421,0,[Pkt,Fkt])))}function gOe(){gOe=E,PAt=VL((rM(),W(j(NAt,1),Z,519,0,[Y4,J4])))}function _Oe(){_Oe=E,UAt=VL((HA(),W(j(HAt,1),Z,510,0,[$4,Q4])))}function vOe(){vOe=E,GAt=VL((ej(),W(j(WAt,1),Z,509,0,[e3,t3])))}function yOe(){yOe=E,cjt=VL(($M(),W(j(sjt,1),Z,516,0,[i3,r3])))}function bOe(){bOe=E,hjt=VL((VA(),W(j(mjt,1),Z,454,0,[a3,o3])))}function xOe(){xOe=E,BMt=VL((kj(),W(j(zMt,1),Z,425,0,[RMt,LMt])))}function SOe(){SOe=E,KMt=VL((IF(),W(j(GMt,1),Z,487,0,[N3,P3])))}function COe(){COe=E,rNt=VL((ON(),W(j(nNt,1),Z,426,0,[eNt,tNt])))}function wOe(){wOe=E,aFt=VL((kM(),W(j(iFt,1),Z,478,0,[nFt,rFt])))}function TOe(){TOe=E,kFt=VL((eN(),W(j(OFt,1),Z,428,0,[DFt,s6])))}function EOe(){EOe=E,Eyt=VL((gP(),W(j(Tyt,1),Z,424,0,[wyt,l$])))}function DOe(){DOe=E,lxt=VL((FF(),W(j(cxt,1),Z,503,0,[V$,sxt])))}function OOe(){OOe=E,bIt=VL((LI(),W(j(yIt,1),Z,427,0,[u6,vIt])))}function kOe(){return bR(),W(j(C8,1),Z,86,0,[x8,b8,y8,v8,S8])}function AOe(){return RG(),W(j(P5,1),VJ,64,0,[M5,m5,p5,j5,N5])}function jOe(e,t,n){return I(t==null?PH(e.f,null,n):IR(e.i,t,n),290)}function MOe(e){return(e.k==(vU(),R$)||e.k==P$)&&WE(e,(X(),m0))}function NOe(e){e.b!=e.c&&(e.a=H(sQ,hK,1,8,5,1),e.b=0,e.c=0)}function POe(e,t){var n=t.jd();return new Uy(n,e.e.pc(n,I(t.kd(),18)))}function FOe(e,t){for(var n=t;n;)KE(e,-n.i,-n.j),n=nj(n);return e}function IOe(e,t){for(var n=t,r=0;n>0;)r+=e.a[n],n-=n&-n;return r}function wM(e,t,n){var r=(bj(t,e.c.length),e.c[t]);return e.c[t]=n,r}function TM(e,t){var n,r;for(Wk(t),r=e.Jc();r.Ob();)n=r.Pb(),t.Ad(n)}function LOe(e,t){var n=t.jd(),r=e.De(n);return!!r&&Xk(r.e,t.kd())}function ROe(e,t){return e.a.get(t)??H(sQ,hK,1,0,5,1)}function EM(e){e.i=0,$b(e.b,null),$b(e.c,null),e.a=null,e.e=null,++e.g}function zOe(e,t,n){e.a.c.length=0,ftt(e,t,n),e.a.c.length==0||h5e(e,t)}function BOe(e,t){this.c=0,this.b=t,Hse.call(this,e,17493),this.a=this.c}function VOe(e){lat(),ure(this),this.a=new ab,aRe(this,e),QD(this.a,e)}function HOe(){Gw(this),this.b=new M(yq,yq),this.a=new M(bq,bq)}function DM(e){OM(),!VQ&&(this.c=e,this.e=!0,this.a=new Kh)}function OM(){OM=E,VQ=!0,uvt=!1,dvt=!1,pvt=!1,fvt=!1}function kM(){kM=E,nFt=new RS(hct,0),rFt=new RS(`TARGET_WIDTH`,1)}function AM(e,t){return(FR(e),Py(new mO(e,new _je(t,e.a)))).zd(WQ)}function UOe(){return iH(),W(j(Sbt,1),Z,363,0,[v$,y$,b$,x$,S$])}function WOe(){return UV(),W(j(QMt,1),Z,364,0,[XMt,qMt,ZMt,JMt,YMt])}function GOe(){return kU(),W(j(_Ft,1),Z,369,0,[e6,$3,n6,t6,r6])}function KOe(){return gH(),W(j(FFt,1),Z,330,0,[AFt,jFt,PFt,MFt,NFt])}function qOe(){return BV(),W(j(_St,1),Z,371,0,[y1,x1,S1,b1,v1])}function JOe(){return gB(),W(j(xkt,1),Z,303,0,[bkt,vkt,ykt,D4,O4])}function YOe(){return sz(),W(j(gwt,1),Z,165,0,[t2,Z0,Q0,$0,e2])}function XOe(){return aB(),W(j(g6,1),Z,160,0,[m6,p6,d6,h6,f6])}function ZOe(){return oB(),W(j($8,1),Z,257,0,[Z8,Q8,ZRt,X8,QRt])}function QOe(e){return Tv(),function(){return NEe(e,this,arguments)}}function jM(e){return!e.c||!e.d?!1:!!e.c.i&&e.c.i==e.d.i}function $Oe(e,t){return P(t,144)?TD(e.c,I(t,144).c):!1}function MM(e){return e.t||(e.t=new Hne(e),_R(new Z_(e),0,e.t)),e.t}function eke(e){var t;return e.c||(t=e.r,P(t,88)&&(e.c=I(t,29))),e.c}function NM(e,t){return I(sP(e.d,t),21)||I(sP(e.e,t),21)}function tke(e){this.b=e,XT.call(this,e),this.a=I(xI(this.b.a,4),129)}function nke(e){this.b=e,kE.call(this,e),this.a=I(xI(this.b.a,4),129)}function PM(e,t,n,r,i){Tke.call(this,t,r,i),this.c=e,this.b=n}function rke(e,t,n,r,i){Tke.call(this,t,r,i),this.c=e,this.a=n}function ike(e,t,n,r,i){GTe.call(this,t,r,i),this.c=e,this.a=n}function ake(e,t,n,r,i){WTe.call(this,t,r,i),this.c=e,this.a=n}function oke(e){Zb.call(this,e==null?gK:tz(e),P(e,80)?I(e,80):null)}function ske(e){e&&xMe((xv(),Xgt)),--pQ,e&&mQ!=-1&&($oe(mQ),mQ=-1)}function cke(e,t){var n=I(ize(e.c,t),18),r;n&&(r=n.gc(),n.$b(),e.d-=r)}function FM(e){return dT(e&uq,e>>22&uq,e<0?dq:0)}function lke(e){var t=e.c.i,n=e.d.i;return t.k==(vU(),P$)&&n.k==P$}function uke(e){var t=e.length;return TD(Sq.substr(Sq.length-t,t),e)}function IM(e){if(cU(e))return e.c=e.a,e.a.Pb();throw k(new pg)}function LM(e,t){return t==0||e.e==0?e:t>0?oHe(e,t):i3e(e,-t)}function dke(e,t){return t==0||e.e==0?e:t>0?i3e(e,t):oHe(e,-t)}function fke(e){return e.e=3,e.d=e.Yb(),e.e==2?!1:(e.e=0,!0)}function RM(e){var t=new OA;return EI(t,e),G(t,(XG(),j2),null),t}function zM(e,t,n){var r;return r=e.Fh(t),r>=0?e.Ih(r,n,!0):QH(e,t,n)}function pke(e,t,n){return yR(LT(rB(e),wT(t.b)),LT(rB(e),wT(n.b)))}function mke(e,t,n){return yR(LT(rB(e),wT(t.e)),LT(rB(e),wT(n.e)))}function hke(e,t){return r.Math.min(hN(t.a,e.d.d.c),hN(t.b,e.d.d.c))}function gke(e,t,n){var r=new jT(e.a);rI(r,e.a.a),PH(r.f,t,n),e.a.a=r}function _ke(e,t,n,r){var i;for(i=0;i<XQ;i++)AO(e.a[i][t.g],n,r[t.g])}function vke(e,t,n,r){var i;for(i=0;i<Avt;i++)jO(e.a[t.g][i],n,r[t.g])}function BM(e,t){var n=I(e.c.xc(t),18);return!n&&(n=e.ic(t)),e.pc(t,n)}function yke(e){var t=(Sk(e),e?new jD(e):HD(e.Jc()));return MH(t),BR(t)}function VM(e){var t,n;return Sk(e),t=Hbe(e.length),n=new mN(t),ALe(n,e),n}function HM(e){var t,n;++e.j,t=e.g,n=e.i,e.g=null,e.i=0,e.Mi(n,t),e.Li()}function UM(e,t){e.Zi(e.i+1),BT(e,e.i,e.Xi(e.i,t)),e.Ki(e.i++,t),e.Li()}function WM(e,t){return FC(t)?t==null?h1e(e.f,null):vIe(e.i,t):h1e(e.f,t)}function GM(e,t){var n=(bj(t,e.c.length),e.c[t]);return Jie(e.c,t,1),n}function KM(e,t,n,r){var i=H(q9,cq,30,t,15,1);return KJe(i,e,t,n,r),i}function qM(e,t){return e.a?ZC(e.a,e.b):e.a=new fE(e.d),YC(e.a,t),e}function bke(e,t){if(e<0||e>t)throw k(new G_(QZe(e,t,`index`)));return e}function xke(e){var t=e.e+e.f;return isNaN(t)&&AD(e.d)?e.d:t}function Ske(e,t){var n=(Wk(e),e),r=(Wk(t),t);return n==r?0:n<r?-1:1}function Cke(e,t){var n=e.q.getHours()+(t/60|0);e.q.setMinutes(t),qW(e,n)}function wke(e,t,n){Hh.call(this,n),this.b=e,this.c=t,this.d=(kz(),rVt)}function Tke(e,t,n){this.d=e,this.k=+!!t,this.f=+!!n,this.o=-1,this.p=0}function JM(e){this.c=e,this.a=new O(this.c.a),this.b=new O(this.c.b)}function YM(){this.e=new Kh,this.c=new Kh,this.d=new Kh,this.b=new Kh}function Eke(){this.g=new Eg,this.b=new Eg,this.a=new Kh,this.k=new Kh}function Dke(){this.a=new Fg,this.b=new jre,this.d=new kt,this.e=new Ot}function Oke(e,t,n){this.a=e,this.c=t,this.d=n,zT(t.e,this),zT(n.b,this)}function kke(e,t){Vse.call(this,t.xd(),t.wd()&-6),Wk(e),this.a=e,this.b=t}function Ake(e,t){Hse.call(this,t.xd(),t.wd()&-6),Wk(e),this.a=e,this.b=t}function jke(e,t){$C.call(this,t.xd(),t.wd()&-6),Wk(e),this.a=e,this.b=t}function XM(e,t,n){this.a=e,this.b=t,this.c=n,zT(e.t,this),zT(t.i,this)}function ZM(){this.b=new ab,this.a=new ab,this.b=new ab,this.a=new ab}function QM(){QM=E;var e,t;m9=(vy(),t=new mg,t),h9=(e=new r_,e)}function $M(){$M=E,i3=new xS(`REGULAR`,0),r3=new xS(`CRITICAL`,1)}function eN(){eN=E,DFt=new US(`FIXED`,0),s6=new US(`CENTER_NODE`,1)}function Mke(){Mke=E,Qxt=new hD(`separateLayerConnections`,(XI(),$xt))}function tN(){tN=E,w6=new Rh(`org.eclipse.elk.labels.labelManager`)}function Nke(e){if(e.a){if(e.e)return Nke(e.e)}else return e;return null}function Pke(e,t){return e.p<t.p?1:e.p>t.p?-1:0}function Fke(e,t){return tk(e.a,t)?(WM(e.a,t),!0):!1}function Ike(e){var t=e.jd();return BD(I(e.kd(),18).Lc(),new Ff(t))}function nN(e){var t=e.b;return t.b==0?null:I(yB(t,0),65).b}function Lke(e,t){var n=Itt(e,t);return e.b=new jF(n.c.length),Het(e,n)}function Rke(e){var t;return FR(e),t=new Zhe(e,e.a.e,e.a.d|4),new lde(e,t)}function zke(e){var t;for(zk(e),t=0;e.a.zd(new Oe);)t=VR(t,1);return t}function Bke(e){var t;return e.a||(t=e.r,P(t,159)&&(e.a=I(t,159))),e.a}function Vke(e,t,n){var r;return++e.e,--e.f,r=I(e.d[t].ed(n),136),r.kd()}function rN(e,t,n){return Vj(t,e.e.Pd().gc()),Vj(n,e.c.Pd().gc()),e.a[t][n]}function iN(e,t){return Wk(t),e.c<e.d?(e.Qe(t,e.c++),!0):!1}function Hke(e,t){var n;e.C&&(n=I(Zk(e.b,t),127).n,n.d=e.C.d,n.a=e.C.a)}function Uke(e){var t,n,r,i=e.d;t=e.a,n=e.b,r=e.c,e.d=n,e.a=r,e.b=i,e.c=t}function Wke(e,t,n){var r=0,i;for(i=0;i<t.length;i++)r+=e.sg(t[i],r,n)}function aN(e,t,n,r){this.f=e,this.e=t,this.d=n,this.b=r,this.c=r?r.d:null}function Gke(e,t){t.Tg(`Label management`,1),IC(q(e,(tN(),w6))),t.Ug()}function Kke(){Kke=E,Mvt=VL((MN(),W(j(jvt,1),Z,461,0,[QQ,ZQ,$Q])))}function qke(){qke=E,Fvt=VL((uP(),W(j(Pvt,1),Z,462,0,[n$,t$,e$])))}function Jke(){Jke=E,kvt=VL((NP(),W(j(YQ,1),Z,237,0,[KQ,qQ,JQ])))}function Yke(){Yke=E,gvt=VL((ML(),W(j(UQ,1),Z,130,0,[mvt,HQ,hvt])))}function Xke(){Xke=E,vbt=VL((YN(),W(j(_bt,1),Z,384,0,[hbt,mbt,gbt])))}function Zke(){Zke=E,zCt=VL((jI(),W(j(RCt,1),Z,302,0,[ICt,LCt,t0])))}function Qke(){Qke=E,HCt=VL((QI(),W(j(VCt,1),Z,329,0,[r0,BCt,n0])))}function $ke(){$ke=E,WCt=VL((dP(),W(j(UCt,1),Z,316,0,[a0,o0,i0])))}function eAe(){eAe=E,wSt=VL((LF(),W(j(CSt,1),Z,368,0,[T1,w1,C1])))}function tAe(){tAe=E,Jkt=VL((jL(),W(j(qkt,1),Z,348,0,[Kkt,Gkt,z4])))}function nAe(){nAe=E,Wkt=VL((AI(),W(j(Ukt,1),Z,381,0,[Bkt,Vkt,Hkt])))}function rAe(){rAe=E,zkt=VL((dF(),W(j(Rkt,1),Z,452,0,[R4,I4,L4])))}function iAe(){iAe=E,Qkt=VL((FL(),W(j(Zkt,1),Z,349,0,[Ykt,Xkt,B4])))}function aAe(){aAe=E,mkt=VL((ZL(),W(j(pkt,1),Z,352,0,[dkt,fkt,C4])))}function oAe(){oAe=E,rAt=VL((lF(),W(j(nAt,1),Z,351,0,[tAt,$kt,eAt])))}function sAe(){sAe=E,oAt=VL((II(),W(j(aAt,1),Z,382,0,[iAt,H4,V4])))}function cAe(){cAe=E,Fjt=VL((_L(),W(j(Pjt,1),Z,385,0,[Njt,Mjt,f3])))}function lAe(){lAe=E,sNt=VL((AL(),W(j(oNt,1),Z,386,0,[F3,iNt,aNt])))}function uAe(){uAe=E,hPt=VL((XR(),W(j(mPt,1),Z,387,0,[fPt,pPt,dPt])))}function dAe(){dAe=E,qSt=VL((uF(),W(j(KSt,1),Z,350,0,[WSt,I1,GSt])))}function fAe(){fAe=E,lCt=VL(($I(),W(j(cCt,1),Z,449,0,[sCt,z1,B1])))}function pAe(){pAe=E,ePt=VL((Az(),W(j($Nt,1),Z,436,0,[z3,B3,QNt])))}function mAe(){mAe=E,ZNt=VL((MI(),W(j(XNt,1),Z,304,0,[JNt,YNt,qNt])))}function hAe(){hAe=E,hFt=VL((CR(),W(j(mFt,1),Z,430,0,[dFt,pFt,fFt])))}function gAe(){gAe=E,uFt=VL((FN(),W(j(lFt,1),Z,429,0,[oFt,cFt,sFt])))}function _Ae(){_Ae=E,bFt=VL((SR(),W(j(yFt,1),Z,435,0,[i6,a6,o6])))}function vAe(){vAe=E,DRt=VL((PP(),W(j(ERt,1),Z,279,0,[E8,D8,O8])))}function yAe(){yAe=E,KRt=VL((kL(),W(j(GRt,1),Z,347,0,[P8,N8,F8])))}function bAe(){bAe=E,fzt=VL((VP(),W(j(dzt,1),Z,300,0,[F5,lzt,uzt])))}function xAe(){xAe=E,yzt=VL((xR(),W(j(vzt,1),Z,281,0,[_zt,Y5,X5])))}function oN(){oN=E,ISt=new Fx(`QUADRATIC`,0),LSt=new Fx(`SCANLINE`,1)}function sN(e){return!e.g&&(e.g=new cl),!e.g.c&&(e.g.c=new Vne(e)),e.g.c}function SAe(e){return!e.g&&(e.g=new cl),!e.g.a&&(e.g.a=new Bne(e)),e.g.a}function CAe(e){return!e.g&&(e.g=new cl),!e.g.b&&(e.g.b=new Rne(e)),e.g.b}function wAe(e){return!e.g&&(e.g=new cl),!e.g.d&&(e.g.d=new zne(e)),e.g.d}function TAe(e,t,n,r){return n&&(r=n.Oh(t,hz(n.Ah(),e.c.sk()),null,r)),r}function EAe(e,t,n,r){return n&&(r=n.Qh(t,hz(n.Ah(),e.c.sk()),null,r)),r}function cN(e,t,n,r){var i=H(q9,cq,30,t+1,15,1);return D7e(i,e,t,n,r),i}function H(e,t,n,r,i,a){var o=uGe(i,r);return i!=10&&W(j(e,a),t,n,i,o),o}function DAe(e,t,n){var r,i=new DI(t,e);for(r=0;r<n;++r)CB(i);return i}function lN(e,t,n){var r,i;if(n!=null)for(r=0;r<t;++r)i=n[r],e.Oi(r,i)}function OAe(e,t){var n=new he;return n.c=!0,n.d=t.kd(),bnt(e,t.jd(),n)}function kAe(e,t){var n=e.q.getHours()+(t/3600|0);e.q.setSeconds(t),qW(e,n)}function AAe(e,t){var n=t,r=EA(HD(new BN(e,n)));return fO(new BN(e,n)),r}function uN(e,t){return!e.o&&(e.o=new bN((GG(),d7),g7,e,0)),yz(e.o,t)}function jAe(e,t,n){I(e.b,68),I(e.b,68),I(e.b,68),AP(e.a,new Ope(n,t,e))}function MAe(e,t,n,r){h7e(e,t,n,YW(e,t,r,P(t,103)&&(I(t,19).Bb&Cq)!=0))}function dN(e,t,n){if(e<0||t>n||t<e)throw k(new Av(Lq+e+Got+t+Fot+n))}function NAe(e,t,n){this.d=new Vg,this.c=new qh,this.a=e,this.e=t,this.c=n}function fN(e){e?(this.c=e,this.b=null):(this.c=null,this.b=new Kh)}function pN(e,t){rx.call(this,e,t),this.a=H(evt,RK,438,2,0,1),this.b=!0}function PAe(e){rRe.call(this,e,0),pue(this),this.d.b=this.d,this.d.a=this.d}function FAe(e){this.e=e,this.b=this.e.a.entries(),this.a=H(sQ,hK,1,0,5,1)}function mN(e){Gw(this),WD(e>=0,`Initial capacity must not be negative`)}function hN(e,t){var n=e.a-t.a,i=e.b-t.b;return r.Math.sqrt(n*n+i*i)}function IAe(e,t,n){var r=e.b[n.c.p][n.p];r.b+=t.b,r.c+=t.c,r.a+=t.a,++r.a}function LAe(){LAe=E,dAt=MO(oO(new Hk,(iH(),v$),(eK(),Pxt)),S$,s1)}function RAe(){return OH(),W(j(N1,1),Z,231,0,[k1,j1,O1,A1,M1,D1])}function zAe(){return pH(),W(j(hCt,1),Z,284,0,[dCt,uCt,pCt,fCt,mCt,V1])}function BAe(){return AV(),W(j(TCt,1),Z,282,0,[U1,SCt,wCt,xCt,CCt,bCt])}function VAe(){return uH(),W(j(MCt,1),Z,283,0,[W1,OCt,jCt,ACt,kCt,DCt])}function HAe(){return TB(),W(j(zIt,1),Z,256,0,[RIt,O6,k6,A6,E6,D6])}function UAe(){return HV(),W(j(ezt,1),Z,102,0,[a5,i5,r5,e5,n5,t5])}function WAe(){return VH(),W(j(f5,1),Z,280,0,[u5,c5,l5,s5,o5,d5])}function GAe(){return LV(),W(j(tLt,1),Z,299,0,[eLt,P6,N6,$It,j6,M6])}function KAe(){return tH(),W(j(LRt,1),Z,328,0,[FRt,NRt,IRt,jRt,PRt,MRt])}function qAe(e){var t;return!e.a&&e.b!=-1&&(t=e.c.Ah(),e.a=bP(t,e.b)),e.a}function gN(e,t){return e.Qi()&&e.Gc(t)?!1:(e.Fi(t),!0)}function _N(e,t){return PA(t,`Horizontal alignment cannot be null`),e.b=t,e}function JAe(e,t,n){tK();var r=VG(e,t);return n&&r&&pbe(e)&&(r=null),r}function vN(e,t,n){var r,i;for(i=e.Jc();i.Ob();)r=I(i.Pb(),36),dW(r,t,n)}function YAe(e,t){var n,r;for(r=t.Jc();r.Ob();)n=I(r.Pb(),36),L8e(e,n,0,0)}function XAe(e){var t,n;for(n=sB(e.a,0);n.b!=n.d.c;)t=I(Xj(n),65),XQe(t)}function ZAe(e,t){return Ooe(e.e,t)||tB(e.e,t,new CUe(t)),I(sP(e.e,t),113)}function yN(e,t,n,r){return Wk(e),Wk(t),Wk(n),Wk(r),new Qve(e,t,new Ce)}function bN(e,t,n,r){this.$j(),this.a=t,this.b=e,this.c=new Uve(this,t,n,r)}function xN(e,t,n,r,i,a){IEe.call(this,t,r,i,a),this.c=e,this.b=n}function SN(e,t,n,r,i,a){IEe.call(this,t,r,i,a),this.c=e,this.a=n}function CN(e,t){var n,r,i=e.r;return r=e.d,n=eG(e,t,!0),n.b!=i||n.a!=r}function wN(e,t,n){var r,i=(r=hU(e.b,t),r);return i?pG(GN(e,i),n):null}function QAe(e,t,n){var r=ZA(e,n),i=null,a;r&&(i=mZe(r)),a=i,hUe(t,n,a)}function $Ae(e,t,n){var r=ZA(e,n),i=null,a;r&&(i=mZe(r)),a=i,hUe(t,n,a)}function eje(e,t,n){var i;e.d[t.g]=n,i=e.g.c,i[t.g]=r.Math.max(i[t.g],n+1)}function TN(e,t){var n;return n=e.Fh(t),n>=0?e.Ih(n,!0,!0):QH(e,t,!0)}function tje(e,t){var n=Dk(e.k,t);return r4e(e,t),_W(e,t),y0e(e,t,n),null}function nje(e){var t;if(!e.a)throw k(new oSe);return t=e.a,e.a=nj(e.a),t}function rje(e){if(e.b<=0)throw k(new pg);return--e.b,e.a-=e.c.c,K(e.a)}function ije(e,t,n){var r=PLe(e,t,n);return e.b=new jF(r.c.length),j3e(e,r)}function EN(e){var t;return Sk(e),P(e,204)?(t=I(e,204),t):new np(e)}function aje(e){for(;!e.a;)if(!jfe(e.c,new Vee(e)))return!1;return!0}function oje(e,t){e.a.Le(t.d,e.b)>0&&(zT(e.c,new pge(t.c,t.d,e.d)),e.b=t.d)}function sje(e,t){if(e.g==null||t>=e.i)throw k(new aw(t,e.i));return e.g[t]}function cje(e){var t;if(e.ll())for(t=e.i-1;t>=0;--t)U(e,t);return jDe(e)}function lje(e){DN(),I(e.mf(($G(),i8)),182).Ec((VH(),l5)),e.of(JLt,null)}function DN(){DN=E,EIt=new sc,OIt=new cc,DIt=uLe(($G(),JLt),EIt,Q6,OIt)}function ON(){ON=E,eNt=new jS(`LEAF_NUMBER`,0),tNt=new jS(`NODE_SIZE`,1)}function uje(){uje=E,$W(),LVt=yq,IVt=bq,zVt=new Zp(yq),RVt=new Zp(bq)}function dje(e){return P(e,180)?``+I(e,180).a:e==null?null:tz(e)}function fje(e){return P(e,180)?``+I(e,180).a:e==null?null:tz(e)}function kN(e,t,n,r,i){return t<0?QH(e,n,r):I(n,69).uk().wk(e,e.ei(),t,r,i)}function AN(e,t,n,r){var i;r=(vA(),r||F_t),i=e.slice(t,n),$Ze(i,e,t,n,-t,r)}function pje(e,t){var n,r=t/e.c.Pd().gc()|0;return n=t%e.c.Pd().gc(),rN(e,r,n)}function mje(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[0];)n=t;return n}function hje(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[1];)n=t;return n}function gje(e,t,n){if(yL(e,n),n!=null&&!e.dk(n))throw k(new ag);return n}function jN(e,t){return hP(t)!=10&&W(EL(t),t.Qm,t.__elementTypeId$,hP(t),e),e}function _je(e,t){$C.call(this,t.xd(),t.wd()&-16449),Wk(e),this.a=e,this.c=t}function vje(e,t,n,r,i){Gce(this),this.b=e,this.d=t,this.f=n,this.g=r,this.c=i}function yje(e,t){if(t.a)throw k(new j_(Xot));ok(e.a,t),t.a=e,!e.j&&(e.j=t)}function MN(){MN=E,QQ=new ux(Kq,0),ZQ=new ux(Gq,1),$Q=new ux(qq,2)}function NN(){NN=E,tvt=new sx(`All`,0),nvt=new _ce,rvt=new Wce,ivt=new Hw}function bje(){bje=E,avt=VL((NN(),W(j(BQ,1),Z,310,0,[tvt,nvt,rvt,ivt])))}function xje(){xje=E,tSt=VL((XI(),W(j(eSt,1),Z,367,0,[$xt,p1,m1,f1])))}function Sje(){Sje=E,Wbt=VL((qz(),W(j(Ubt,1),Z,383,0,[k$,Vbt,Bbt,Hbt])))}function Cje(){Cje=E,uyt=VL((PI(),W(j(lyt,1),Z,409,0,[a$,i$,syt,cyt])))}function wje(){wje=E,Nbt=VL((ZI(),W(j(Mbt,1),Z,408,0,[w$,D$,T$,E$])))}function Tje(){Tje=E,USt=VL((cz(),W(j(HSt,1),Z,301,0,[F1,BSt,P1,VSt])))}function Eje(){Eje=E,_kt=VL((wB(),W(j(gkt,1),Z,203,0,[E4,hkt,T4,w4])))}function Dje(){Dje=E,Nkt=VL((Rz(),W(j(Mkt,1),Z,269,0,[F4,kkt,Akt,jkt])))}function Oje(){Oje=E,gSt=VL((NI(),W(j(hSt,1),Z,413,0,[h1,g1,_1,mSt])))}function kje(){kje=E,DAt=VL((XL(),W(j(EAt,1),Z,404,0,[U4,G4,K4,W4])))}function Aje(){Aje=E,KNt=VL((qB(),W(j(GNt,1),Z,354,0,[WNt,HNt,UNt,VNt])))}function jje(){jje=E,IMt=VL((PL(),W(j(FMt,1),Z,353,0,[PMt,j3,NMt,MMt])))}function Mje(){Mje=E,_jt=VL((dV(),W(j(gjt,1),Z,398,0,[s3,c3,l3,u3])))}function Nje(){Nje=E,oPt=VL((eH(),W(j(aPt,1),Z,401,0,[iPt,tPt,rPt,nPt])))}function Pje(){Pje=E,TRt=VL((QL(),W(j(wRt,1),Z,278,0,[T8,w8,SRt,CRt])))}function Fje(){Fje=E,ARt=VL((wR(),W(j(kRt,1),Z,222,0,[ORt,A8,k8,j8])))}function Ije(){Ije=E,YRt=VL((fV(),W(j(JRt,1),Z,292,0,[z8,I8,L8,R8])))}function Lje(){Lje=E,wzt=VL((SM(),W(j(Z5,1),Z,288,0,[bzt,Czt,xzt,Szt])))}function Rje(){Rje=E,pzt=VL((jz(),W(j(B5,1),Z,380,0,[R5,z5,L5,I5])))}function zje(){zje=E,Azt=VL((lz(),W(j(kzt,1),Z,327,0,[Ozt,Tzt,Dzt,Ezt])))}function Bje(){Bje=E,Lzt=VL((NL(),W(j(Izt,1),Z,407,0,[Nzt,Pzt,Mzt,Fzt])))}function PN(){PN=E,_Ct=new Wx(BJ,0),H1=new Wx(`IMPROVE_STRAIGHTNESS`,1)}function FN(){FN=E,oFt=new zS(ydt,0),cFt=new zS(Vut,1),sFt=new zS(BJ,2)}function IN(e){e.a=H(q9,cq,30,e.b+1,15,1),e.c=H(q9,cq,30,e.b,15,1),e.d=0}function LN(e){var t;for(t=e.p+1;t<e.c.a.c.length;++t)--I(dO(e.c.a,t),9).p}function RN(e){var t=e.hj();t!=null&&e.d!=-1&&I(t,94).uh(e),e.i&&e.i.mj()}function zN(e){var t;return _w(e)&&(t=0-e,!isNaN(t))?t:hI(aL(e))}function Vje(e){var t;if(!NF(e))throw k(new pg);return e.e=1,t=e.d,e.d=null,t}function BN(e,t){var n;this.f=e,this.b=t,n=I(Dk(e.b,t),262),this.c=n?n.b:null}function VN(e,t){var n=HN(e,t,0);return n==-1?!1:(GM(e,n),!0)}function Hje(e,t){var n=I(WM(e.e,t),393);return n?(Ege(n),n.e):null}function HN(e,t,n){for(;n<e.c.length;++n)if(Xk(t,e.c[n]))return n;return-1}function Uje(e,t,n){var r;return zk(e),r=new Ee,r.a=t,e.a.Nb(new Noe(r,n)),r.a}function Wje(e){var t;return zk(e),t=H(Z9,Tq,30,0,15,1),jy(e.a,new zee(t)),t}function Gje(e,t){return yR(A(F(q(e,(X(),I0)))),A(F(q(t,I0))))}function Kje(e,t){return new Dhe(t,KE(wT(t.e),t.f.a+e,t.f.b+e),(hE(),!1))}function qje(e,t){return JD(),zT(e,new vC(t,K(t.e.c.length+t.g.c.length)))}function Jje(e,t){return JD(),zT(e,new vC(t,K(t.e.c.length+t.g.c.length)))}function UN(e,t){return Xk(t,dO(e.f,0))||Xk(t,dO(e.f,1))||Xk(t,dO(e.f,2))}function WN(e,t){if(t<0)throw k(new G_(Tft+t));return pDe(e,t+1),dO(e.j,t)}function Yje(e,t,n,r,i){return Wk(e),Wk(t),Wk(n),Wk(r),Wk(i),new Qve(e,t,r)}function Xje(e,t){Ab();var n=Qj(e),r=Qj(t);return!!n&&!!r&&!HUe(n.k,r.k)}function GN(e,t){var n=I(t,680),r=n.ui();return!r&&n.xi(r=new jse(e,t)),r}function KN(e,t){var n=I(t,682),r=n.Yk();return!r&&n.al(r=new nEe(e,t)),r}function qN(e){return I(q(I(dO(e.j,0),12),(X(),N0)),12)}function JN(e){return e.b||(e.b=new Z_e(e,z7,e),!e.a&&(e.a=new aD(e,e))),e.b}function YN(){YN=E,hbt=new _x(`XY`,0),mbt=new _x(`X`,1),gbt=new _x(`Y`,2)}function XN(){XN=E,Pkt=new sS(`INPUT_ORDER`,0),Fkt=new sS(`PORT_DEGREE`,1)}function Zje(){RD(),this.b=new qh,this.f=new qh,this.g=new qh,this.e=new qh}function ZN(e){hT(this),this.g=e?NA(e,e.ge()):null,this.f=e,xA(this),this.he()}function QN(e,t,n,r,i,a,o){hF.call(this,t,r,i,a,o),this.c=e,this.b=n}function Qje(e,t,n,r){if(!e)throw k(new $_(cW(t,W(j(sQ,1),hK,1,5,[n,r]))))}function $N(e,t,n){var r=10,i;for(i=0;i<n-1;i++)t<r&&(e.a+=`0`),r*=10;e.a+=t}function $je(e,t){fyt=new rt,dyt=t,o$=e,I(o$.b,68),jAe(o$,fyt,null),Fet(o$)}function eP(e){var t,n=e.length;return t=H(K9,rq,30,n,15,1),vye(e,0,n,t,0),t}function tP(e){r_e();var t=e+128,n=c_t[t];return!n&&(n=c_t[t]=new Pee(e)),n}function eMe(e){return ope(e.d.a.e.g,e.b),VE(e.c!=e.d.a.d),e.a=e.c,e.c=e.c.a,e.a}function tMe(e){BE(!!e.c),ope(e.f.g,e.d),e.c.Qb(),e.c=null,e.b=zIe(e),e.d=e.f.g}function nMe(e){var t;return e.Lh()||(t=bk(e.Ah())-e.gi(),e.Xh().Kk(t)),e.wh()}function rMe(e){var t=BP(xI(e,32));return t??=(Uz(e),BP(xI(e,32))),t}function nP(e,t){var n=hz(e.d,t);return n>=0?xB(e,n,!0,!0):QH(e,t,!0)}function iMe(e,t){kD(I(I(e.f,26).mf(($G(),r8)),102))&&aVe(Qbe(I(e.f,26)),t)}function aMe(e,t){JP(e,t==null||AD((Wk(t),t))||isNaN((Wk(t),t))?0:(Wk(t),t))}function oMe(e,t){qP(e,t==null||AD((Wk(t),t))||isNaN((Wk(t),t))?0:(Wk(t),t))}function sMe(e,t){HP(e,t==null||AD((Wk(t),t))||isNaN((Wk(t),t))?0:(Wk(t),t))}function cMe(e,t){YP(e,t==null||AD((Wk(t),t))||isNaN((Wk(t),t))?0:(Wk(t),t))}function lMe(e){(this.q?this.q:(_A(),_A(),LQ)).zc(e.q?e.q:(_A(),_A(),LQ))}function rP(e,t,n){var r=e.g[t];return BT(e,t,e.Xi(t,n)),e.Pi(t,n,r),e.Li(),r}function iP(e,t){var n=e.bd(t);return n>=0?(e.ed(n),!0):!1}function aP(e){var t;return e.d!=e.r&&(t=yV(e),e.e=!!t&&t.jk()==fht,e.d=t),e.e}function oP(e,t){var n;for(Sk(e),Sk(t),n=!1;t.Ob();)n|=e.Ec(t.Pb());return n}function sP(e,t){var n=I(Dk(e.e,t),393);return n?(VT(e,n),n.e):null}function cP(e){var t=e.b.c.length==0?null:dO(e.b,0);return t!=null&&kF(e,0),t}function lP(e,t){var n,r;return FR(e),r=new jke(t,e.a),n=new zfe(r),new mO(e,n)}function uP(){uP=E,n$=new dx(`TOP`,0),t$=new dx(Gq,1),e$=new dx(mst,2)}function dP(){dP=E,a0=new Xx(BJ,0),o0=new Xx(`TOP`,1),i0=new Xx(mst,2)}function fP(){fP=E,Ibt=new xt,Lbt=new St,Pbt=new Ct,Fbt=new wt,Rbt=new Tt}function pP(){pP=E,r_t=dT(uq,uq,524287),i_t=dT(0,0,fq),a_t=FM(1),FM(2),o_t=FM(0)}function mP(e,t){var n=e.a[t],r=(tL(),n_t)[typeof n];return r?r(n):aze(typeof n)}function uMe(e){var t=e/60|0,n=e%60;return n==0?``+t:``+t+`:`+(``+n)}function dMe(e){return IKe(e,(pP(),o_t))<0?-Mle(aL(e)):e.l+e.m*pq+e.h*mq}function fMe(e){switch(e.g){case 0:return uK;case 1:return QK;default:return 0}}function hP(e){return e.__elementTypeCategory$==null?10:e.__elementTypeCategory$}function pMe(e,t){return P(t,103)&&(I(t,19).Bb&Cq)!=0?new cw(t,e):new DI(t,e)}function mMe(e,t){return P(t,103)&&(I(t,19).Bb&Cq)!=0?new cw(t,e):new DI(t,e)}function hMe(e,t,n){return LT(new M(n.e.a+n.f.a/2,n.e.b+n.f.b/2),e)==(Wk(t),t)}function gMe(e,t){var n,r,i=t.c.i;n=I(Dk(e.f,i),60),r=n.d.c-n.e.c,yFe(t.a,r,0)}function _Me(e,t){var n;for(++e.d,++e.c[t],n=t+1;n<e.a.length;)++e.a[n],n+=n&-n}function vMe(e,t){for(var n=0;e.e!=e.i.gc();)aye(t,uB(e),K(n)),n!=uK&&++n}function yMe(e){var t;for(++e.a,t=e.c.a.length;e.a<t;++e.a)if(e.c.b[e.a])return}function bMe(e){var t,n;if(e.a){n=null;do t=e.a,e.a=null,n=sZe(t,n);while(e.a);e.a=n}}function xMe(e){var t,n;if(e.b){n=null;do t=e.b,e.b=null,n=sZe(t,n);while(e.b);e.b=n}}function SMe(e){if(!e.c)throw k(new pg);return e.e=e.a=e.c,e.c=e.c.c,++e.d,e.a.f}function CMe(e){if(!e.e)throw k(new pg);return e.c=e.a=e.e,e.e=e.e.e,--e.d,e.a.f}function wMe(e,t){var n=nz(e.e.c,t.e.c);return n==0?yR(e.e.d,t.e.d):n}function TMe(e,t){var n,r=t.c;for(n=r+1;n<=t.f;n++)e.a[n]>e.a[r]&&(r=n);return r}function EMe(e){var t=I(q(e,(X(),c0)),318);return t?t.a==e:!1}function DMe(e){var t=I(q(e,(X(),c0)),318);return t?t.i==e:!1}function OMe(e,t){return t==(spe(),spe(),K_t)?e.toLocaleLowerCase():e.toLowerCase()}function kMe(){kMe=E,Cbt=VL((iH(),W(j(Sbt,1),Z,363,0,[v$,y$,b$,x$,S$])))}function AMe(){AMe=E,Skt=VL((gB(),W(j(xkt,1),Z,303,0,[bkt,vkt,ykt,D4,O4])))}function jMe(){jMe=E,vSt=VL((BV(),W(j(_St,1),Z,371,0,[y1,x1,S1,b1,v1])))}function MMe(){MMe=E,$Mt=VL((UV(),W(j(QMt,1),Z,364,0,[XMt,qMt,ZMt,JMt,YMt])))}function NMe(){NMe=E,vFt=VL((kU(),W(j(_Ft,1),Z,369,0,[e6,$3,n6,t6,r6])))}function PMe(){PMe=E,IFt=VL((gH(),W(j(FFt,1),Z,330,0,[AFt,jFt,PFt,MFt,NFt])))}function FMe(){FMe=E,_wt=VL((sz(),W(j(gwt,1),Z,165,0,[t2,Z0,Q0,$0,e2])))}function IMe(){IMe=E,MIt=VL((aB(),W(j(g6,1),Z,160,0,[m6,p6,d6,h6,f6])))}function LMe(){LMe=E,xRt=VL((bR(),W(j(C8,1),Z,86,0,[x8,b8,y8,v8,S8])))}function RMe(){RMe=E,rzt=VL((RG(),W(j(P5,1),VJ,64,0,[M5,m5,p5,j5,N5])))}function zMe(){zMe=E,$Rt=VL((oB(),W(j($8,1),Z,257,0,[Z8,Q8,ZRt,X8,QRt])))}function gP(){gP=E,wyt=new gx(`EADES`,0),l$=new gx(`FRUCHTERMAN_REINGOLD`,1)}function _P(){_P=E,R1=new Vx(`READING_DIRECTION`,0),iCt=new Vx(`ROTATION`,1)}function BMe(e){this.g=e,this.f=new Kh,this.a=r.Math.min(this.g.c.c,this.g.d.c)}function VMe(e){this.b=new Kh,this.a=new Kh,this.c=new Kh,this.d=new Kh,this.e=e}function HMe(e,t,n,r){tK(),Wh.call(this,26),this.c=e,this.a=t,this.d=n,this.b=r}function UMe(e,t,n){_D.call(this),vNe(this),this.a=e,this.c=n,this.b=t.d,this.f=t.e}function WMe(e,t,n){var r,i;for(i=new O(n);i.a<i.c.c.length;)r=V(i),SJe(e,t,r)}function GMe(e,t,n){return GA(rO(e.a.e[I(t.a,9).p]-e.a.e[I(n.a,9).p]))}function vP(e,t){var n=I(Dk(e.a,t),150);return n||(n=new ot,Yk(e.a,t,n)),n}function yP(e,t,n){var r;if(t==null)throw k(new dg);return r=ZA(e,t),PDe(e,t,n),r}function bP(e,t){var n=(e.i??HW(e),e.i);return t>=0&&t<n.length?n[t]:null}function KMe(e,t){return Wk(t),Ove(e),e.d.Ob()?(t.Ad(e.d.Pb()),!0):!1}function xP(e){return JL(e,uK)>0?uK:JL(e,QK)<0?QK:TO(e)}function qMe(e,t){return FP(),-lT(I(q(e,(BW(),O3)),15).a,I(q(t,O3),15).a)}function JMe(){return vU(),W(j(Ybt,1),Z,249,0,[R$,I$,P$,z$,F$,N$,B$,L$])}function YMe(){return sU(),W(j(S7,1),Z,244,0,[aBt,b7,x7,y7,iBt,v7,_7,rBt])}function XMe(){return wH(),W(j(PIt,1),Z,285,0,[NIt,_6,x6,C6,v6,y6,b6,S6])}function ZMe(){return rW(),W(j(NSt,1),Z,275,0,[ESt,kSt,TSt,MSt,OSt,DSt,jSt,ASt])}function QMe(e,t){return!!XF(e,t,TO(HR(HK,tA(TO(HR(t==null?0:zF(t),UK)),15))))}function $Me(e,t){var n=t>0?t-1:t;return Aie(kie(BNe(wge(new p_,n),e.n),e.j),e.k)}function SP(e){var t,n=(t=new i_,t);gN((!e.q&&(e.q=new L(B7,e,11,10)),e.q),n)}function eNe(e,t){var n=I(qL(e.d,t),18),r;return n?(r=t,e.e.pc(r,n)):null}function CP(e,t){var n;return FR(e),n=new Jxe(e,e.a.xd(),e.a.wd()|4,t),new mO(e,n)}function wP(e){var t;BE(!!e.c),t=e.c.a,OP(e.d,e.c),e.b==e.c?e.b=t:--e.a,e.c=null}function tNe(e){return e.a>=-.01&&e.a<=Xq&&(e.a=0),e.b>=-.01&&e.b<=Xq&&(e.b=0),e}function nNe(e){var t=A(F(q(e,(XG(),E2))));return t<0&&(t=0,G(e,E2,t)),t}function rNe(e,t){kD(I(q(I(e.e,9),(XG(),Z2)),102))&&(_A(),oT(I(e.e,9).j,t))}function TP(e,t){var n,r;for(r=e.Jc();r.Ob();)n=I(r.Pb(),70),G(n,(X(),T0),t)}function iNe(e,t,n){var i=r.Math.max(0,e.b/2-.5);xV(n,i,1),zT(t,new Uoe(n,i))}function aNe(e,t,n,r){var i;e.j=-1,X$e(e,hZe(e,t,n),(Wb(),i=I(t,69).tk(),i.vl(r)))}function oNe(e,t,n,r,i,a){var o=RM(r);ij(o,i),oj(o,a),XH(e.a,r,new PD(o,t,n.f))}function sNe(e,t){vB(e,(oW(),uPt),t.f),vB(e,cPt,t.e),vB(e,lPt,t.d),vB(e,sPt,t.c)}function cNe(e,t){if(0>e||e>t)throw k(new jv(`fromIndex: 0, toIndex: `+e+Fot+t))}function EP(e){if(e<0)throw k(new $_(`Illegal Capacity: `+e));this.g=this.$i(e)}function lNe(e){this.d=e,this.c=e.c.vc().Jc(),this.b=null,this.a=null,this.e=(Cv(),Rgt)}function DP(e,t){for(var n=e;nj(n);)if(n=nj(n),n==t)return!0;return!1}function uNe(e,t){return t&&e.b[t.g]==t?(Ek(e.b,t.g,null),--e.c,!0):!1}function OP(e,t){var n=t.c;return t.a.b=t.b,t.b.a=t.a,t.a=t.b=null,t.c=null,--e.b,n}function dNe(e,t){var n=FU(e.Ah(),t);if(!n)throw k(new $_(PX+t+Dpt));return n}function kP(e){ZU();var t,n=ndt;for(t=0;t<e.length;t++)e[t]>n&&(n=e[t]);return n}function fNe(e){var t;for(t=0;t<e.c.length;t++)(bj(t,e.c.length),I(e.c[t],12)).p=t}function pNe(e){for(var t=e.a.d.j,n=e.c.d.j;t!=n;)OF(e.b,t),t=ER(t);OF(e.b,t)}function mNe(e,t){var n,r=t.a.jd(),i;for(n=I(t.a.kd(),18).gc(),i=0;i<n;i++)e.Ad(r)}function AP(e,t){var n,r,i,a;for(Wk(t),r=e.c,i=0,a=r.length;i<a;++i)n=r[i],t.Ad(n)}function jP(e,t){var n,r,i,a;for(r=e.d,i=0,a=r.length;i<a;++i)n=r[i],PT(e.g,n).a=t}function hNe(e,t,n){var r,i=t[n],a;for(r=0;r<i.length;r++)a=i[r],e.e[a.c.p][a.p]=r}function gNe(e,t,n){var r=t,i;do i=A(e.p[r.p])+n,e.p[r.p]=i,r=e.a[r.p];while(r!=t)}function _Ne(e){var t=r.Math.sqrt(e.a*e.a+e.b*e.b);return t>0&&(e.a/=t,e.b/=t),e}function MP(e){this.b=(Sk(e),new jD(e)),this.a=new Kh,this.d=new Kh,this.e=new uy}function vNe(e){e.b=(MN(),ZQ),e.f=(uP(),t$),e.d=(vF(2,KK),new mN(2)),e.e=new uy}function NP(){NP=E,KQ=new lx(`BEGIN`,0),qQ=new lx(Gq,1),JQ=new lx(`END`,2)}function PP(){PP=E,E8=new tC(Gq,0),D8=new tC(`HEAD`,1),O8=new tC(`TAIL`,2)}function FP(){FP=E,HMt=Hz(Hz(Hz(Lb(new Hk,(dV(),c3)),(yW(),kjt)),Sjt),Ejt)}function IP(){IP=E,WMt=Hz(Hz(Hz(Lb(new Hk,(dV(),u3)),(yW(),wjt)),yjt),Cjt)}function yNe(){yNe=E,XQ=(NP(),W(j(YQ,1),Z,237,0,[KQ,qQ,JQ])).length,Avt=XQ}function bNe(e,t){for(;t[0]<e.length&&pw(` \r
|
|
25
25
|
`,$V(Jk(e,t[0])))>=0;)++t[0]}function LP(e,t){var n,r=e.a;n=Zze(e,t,null),r!=t&&!e.e&&(n=AG(e,t,n)),n&&n.mj()}function RP(e){var t;return e.w?e.w:(t=pTe(e),t&&!t.Sh()&&(e.w=t),t)}function xNe(e){var t;return e==null?null:(t=I(e,195),mYe(t,t.length))}function U(e,t){if(e.g==null||t>=e.i)throw k(new aw(t,e.i));return e.Ui(t,e.g[t])}function SNe(e,t){_A();var n,r=new Kh;for(n=0;n<e;++n)ng(r.c,t);return new Pv(r)}function CNe(e){return FR(e),GD(!0,`n may not be negative`),new mO(e,new mPe(e.a))}function wNe(e){return(e.i&2?`interface `:e.i&1?``:`class `)+(XE(e),e.o)}function TNe(e,t){return $w(),sF(ZK),r.Math.abs(e-t)<=ZK||e==t||isNaN(e)&&isNaN(t)}function ENe(e,t){return $w(),sF(ZK),r.Math.abs(e-t)<=ZK||e==t||isNaN(e)&&isNaN(t)}function DNe(e,t){return lH(),lT(e.b.c.length-e.e.c.length,t.b.c.length-t.e.c.length)}function zP(e,t){return $ie(YF(e,t,TO(HR(HK,tA(TO(HR(t==null?0:zF(t),UK)),15)))))}function ONe(e,t){return bD(wT(I(Dk(e.g,t),8)),ST(I(Dk(e.f,t),460).b))}function kNe(e,t,n){var r=function(){return e.apply(r,arguments)};return t.apply(r,n),r}function BP(e){var t;return $D(e==null||Array.isArray(e)&&(t=hP(e),!(t>=14&&t<=16))),e}function ANe(){ANe=E,FSt=VL((OH(),W(j(N1,1),Z,231,0,[k1,j1,O1,A1,M1,D1])))}function jNe(){jNe=E,gCt=VL((pH(),W(j(hCt,1),Z,284,0,[dCt,uCt,pCt,fCt,mCt,V1])))}function MNe(){MNe=E,ECt=VL((AV(),W(j(TCt,1),Z,282,0,[U1,SCt,wCt,xCt,CCt,bCt])))}function NNe(){NNe=E,NCt=VL((uH(),W(j(MCt,1),Z,283,0,[W1,OCt,jCt,ACt,kCt,DCt])))}function PNe(){PNe=E,BIt=VL((TB(),W(j(zIt,1),Z,256,0,[RIt,O6,k6,A6,E6,D6])))}function FNe(){FNe=E,tzt=VL((HV(),W(j(ezt,1),Z,102,0,[a5,i5,r5,e5,n5,t5])))}function INe(){INe=E,nzt=VL((VH(),W(j(f5,1),Z,280,0,[u5,c5,l5,s5,o5,d5])))}function LNe(){LNe=E,nLt=VL((LV(),W(j(tLt,1),Z,299,0,[eLt,P6,N6,$It,j6,M6])))}function RNe(){RNe=E,RRt=VL((tH(),W(j(LRt,1),Z,328,0,[FRt,NRt,IRt,jRt,PRt,MRt])))}function zNe(){return lU(),W(j(Y8,1),Z,96,0,[V8,B8,U8,J8,q8,K8,W8,G8,H8])}function VP(){VP=E,F5=new uC(dpt,0),lzt=new uC(`PARENT`,1),uzt=new uC(`ROOT`,2)}function BNe(e,t){return e.n=t,e.n?(e.f=new Kh,e.e=new Kh):(e.f=null,e.e=null),e}function HP(e,t){var n=e.f;e.f=t,e.Db&4&&!(e.Db&1)&&pI(e,new mM(e,3,n,e.f))}function UP(e,t){var n=e.a;e.a=t,e.Db&4&&!(e.Db&1)&&pI(e,new mM(e,0,n,e.a))}function WP(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&pI(e,new mM(e,1,n,e.b))}function GP(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&pI(e,new mM(e,3,n,e.b))}function KP(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&pI(e,new mM(e,4,n,e.c))}function qP(e,t){var n=e.g;e.g=t,e.Db&4&&!(e.Db&1)&&pI(e,new mM(e,4,n,e.g))}function JP(e,t){var n=e.i;e.i=t,e.Db&4&&!(e.Db&1)&&pI(e,new mM(e,5,n,e.i))}function YP(e,t){var n=e.j;e.j=t,e.Db&4&&!(e.Db&1)&&pI(e,new mM(e,6,n,e.j))}function XP(e,t){var n=e.j;e.j=t,e.Db&4&&!(e.Db&1)&&pI(e,new mM(e,1,n,e.j))}function ZP(e,t){var n=e.k;e.k=t,e.Db&4&&!(e.Db&1)&&pI(e,new mM(e,2,n,e.k))}function QP(e,t){var n=e.d;e.d=t,e.Db&4&&!(e.Db&1)&&pI(e,new hM(e,2,n,e.d))}function $P(e,t){var n=e.s;e.s=t,e.Db&4&&!(e.Db&1)&&pI(e,new hM(e,4,n,e.s))}function eF(e,t){var n=e.t;e.t=t,e.Db&4&&!(e.Db&1)&&pI(e,new hM(e,5,n,e.t))}function tF(e,t){var n=e.F;e.F=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,5,n,t))}function nF(e,t){var n=I(Dk((Bb(),D7),e),58);return n?n.ek(t):H(sQ,hK,1,t,5,1)}function rF(e,t){var n=t in e.a,r;return n&&(r=ZA(e,t).pe(),r)?r.a:null}function VNe(e,t){var n=(r=(hy(),i=new tl,i),t&&d4e(r,t),r),r,i;return MPe(n,e),n}function HNe(e,t,n){var r=zz(n);return Yk(e.c,r,t),Yk(e.d,t,n),Yk(e.e,t,QA(t)),t}function iF(e,t,n,r,i,a){var o=Mye(e,t);return QNe(n,o),o.i=i?8:0,o.f=r,o.e=i,o.g=a,o}function UNe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=1,this.c=e,this.a=n}function WNe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=2,this.c=e,this.a=n}function GNe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=6,this.c=e,this.a=n}function KNe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=7,this.c=e,this.a=n}function qNe(e,t,n,r,i){this.d=t,this.j=r,this.e=i,this.o=-1,this.p=4,this.c=e,this.a=n}function JNe(e,t){var n,r,i,a;for(r=t,i=0,a=r.length;i<a;++i)n=r[i],yje(e.a,n);return e}function aF(e){var t,n,r,i;for(n=e,r=0,i=n.length;r<i;++r)t=n[r],Sk(t);return new Zse(e)}function YNe(e){var t=bD(wT(e.d.d),e.c.d);return CV(t,e.c.e.a,e.c.e.b),yD(t,e.c.d)}function XNe(e){var t=bD(wT(e.c.d),e.d.d);return CV(t,e.d.e.a,e.d.e.b),yD(t,e.d.d)}function ZNe(e){var t=/function(?:\s+([\w$]+))?\s*\(/.exec(e);return t&&t[1]||tq}function QNe(e,t){if(e){t.n=e;var n=jCe(t);if(!n){oQ[e]=[t];return}n.Pm=t}}function $Ne(e,t,n){var i,a=e.length;return i=r.Math.min(n,a),I$e(e,0,t,0,i,!0),t}function ePe(e,t,n){if(yL(e,n),!e.il()&&n!=null&&!e.dk(n))throw k(new ag);return n}function oF(e,t){var n;return Wk(t),n=e[`:`+t],WD(!!n,`Enum constant undefined: `+t),n}function tPe(e,t){var n=e.c,r=t.e[e.p];return r>0?I(dO(n.a,r-1),9):null}function sF(e){if(!(e>=0))throw k(new $_(`tolerance (`+e+`) must be >= 0`));return e}function cF(){return AIt||(AIt=new J6e,CL(AIt,W(j(c$,1),hK,148,0,[new Sf]))),AIt}function lF(){lF=E,tAt=new dS(`NO`,0),$kt=new dS(hct,1),eAt=new dS(`LOOK_BACK`,2)}function uF(){uF=E,WSt=new zx(`ARD`,0),I1=new zx(`MSD`,1),GSt=new zx(`MANUAL`,2)}function dF(){dF=E,R4=new cS(Yq,0),I4=new cS(`INPUT`,1),L4=new cS(`OUTPUT`,2)}function fF(e,t){var n=e.gc();if(t<0||t>n)throw k(new wD(t,n));return new Vfe(e,t)}function pF(e,t){var n,r,i,a;for(r=t,i=0,a=r.length;i<a;++i)n=r[i],xM(e,n,e.c.b,e.c)}function nPe(e,t){var n;return P(t,45)?e.c.Kc(t):(n=yz(e,t),Vz(e,t),n)}function mF(e,t,n){return GL(e,t),VF(e,n),$P(e,0),eF(e,1),mR(e,!0),pR(e,!0),e}function hF(e,t,n,r,i){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1,i||(this.o=-2-r-1)}function rPe(e,t,n,r){this.$j(),this.a=t,this.b=e,this.c=null,this.c=new vfe(this,t,n,r)}function iPe(){ZT.call(this),this.n=-1,this.g=null,this.i=null,this.j=null,this.Bb|=fZ}function aPe(e){BE(e.c>=0),NHe(e.d,e.c)<0&&(e.a=e.a-1&e.d.a.length-1,e.b=e.d.c),e.c=-1}function gF(e,t){e.b=r.Math.max(e.b,t.d),e.e+=t.r+(e.a.c.length==0?0:e.c),zT(e.a,t)}function oPe(e,t){t.Tg(`Hierarchical port constraint processing`,1),LUe(e),$it(e),t.Ug()}function _F(e){var t,n;for(n=e.c.Bc().Jc();n.Ob();)t=I(n.Pb(),18),t.$b();e.c.$b(),e.d=0}function sPe(e,t){var n,r;for(n=0,r=e.gc();n<r;++n)if(Xk(t,e.Xb(n)))return n;return-1}function cPe(e){var t,n,r,i;for(n=e.a,r=0,i=n.length;r<i;++r)t=n[r],yye(t,t.length,null)}function lPe(){Gae();for(var e=wgt,t=0;t<arguments.length;t++)e.push(arguments[t])}function uPe(e){var t,n;for(n=new O(bGe(e));n.a<n.c.c.length;)t=I(V(n),685),t.Zf()}function dPe(e){var t,n;if(e==0)return 32;for(n=0,t=1;(t&e)==0;t<<=1)++n;return n}function vF(e,t){if(e<0)throw k(new $_(t+` cannot be negative but was: `+e));return e}function fPe(e){Eb(),this.g=new qh,this.f=new qh,this.b=new qh,this.c=new BA,this.i=e}function pPe(){this.f=new uy,this.d=new Kg,this.c=new uy,this.a=new Kh,this.b=new Kh}function mPe(e){$C.call(this,e.yd(64)?uT(0,UR(e.xd(),1)):PK,e.wd()),this.b=1,this.a=e}function hPe(e,t){var n,r,i=t.c.i;n=I(Dk(e.f,i),60),r=n.d.c-n.e.c,AP(t.b,new ch(r))}function yF(e,t){return Qie(XF(e.a,t,TO(HR(HK,tA(TO(HR(t==null?0:zF(t),UK)),15)))))}function gPe(){return TW(),W(j(hzt,1),Z,266,0,[U5,W5,H5,G5,K5,J5,q5,mzt,V5])}function _Pe(){return yU(),W(j(nCt,1),Z,267,0,[ZSt,YSt,$St,eCt,QSt,tCt,L1,XSt,JSt])}function vPe(){return PU(),W(j(lkt,1),Z,268,0,[skt,akt,okt,nkt,ikt,ckt,S4,tkt,rkt])}function yPe(){yPe=E,f_t=W(j(q9,1),cq,30,15,[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15])}function bPe(){bPe=E,mAt=oO(oO(oO(new Hk,(iH(),v$),(eK(),W$)),y$,t1),b$,e1)}function xPe(){xPe=E,hAt=oO(oO(oO(new Hk,(iH(),v$),(eK(),W$)),y$,t1),b$,e1)}function SPe(){SPe=E,gAt=oO(oO(oO(new Hk,(iH(),v$),(eK(),W$)),y$,t1),b$,e1)}function CPe(){CPe=E,_At=oO(oO(oO(new Hk,(iH(),v$),(eK(),W$)),y$,t1),b$,e1)}function wPe(){wPe=E,vAt=oO(oO(oO(new Hk,(iH(),v$),(eK(),W$)),y$,t1),b$,e1)}function TPe(){TPe=E,xAt=oO(oO(oO(new Hk,(iH(),v$),(eK(),W$)),y$,t1),b$,e1)}function EPe(){EPe=E,wAt=MO(oO(oO(new Hk,(iH(),b$),(eK(),r1)),x$,Y$),S$,n1)}function DPe(e,t){return FP(),I(q(t,(BW(),O3)),15).a<e.gc()&&I(q(t,O3),15).a>=0}function OPe(e,t){e.r>0&&e.c<e.r&&(e.c+=t,e.i&&e.i.d>0&&e.g!=0&&OPe(e.i,t/e.r*e.i.d))}function kPe(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,1,n,e.c))}function bF(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,4,n,e.c))}function APe(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,1,n,e.c))}function jPe(e,t){var n=e.d;e.d=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,1,n,e.d))}function xF(e,t){var n=e.k;e.k=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,2,n,e.k))}function SF(e,t){var n=e.D;e.D=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,2,n,e.D))}function CF(e,t){var n=e.f;e.f=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,8,n,e.f))}function wF(e,t){var n=e.i;e.i=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,7,n,e.i))}function MPe(e,t){var n=e.a;e.a=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,8,n,e.a))}function NPe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,0,n,e.b))}function PPe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,0,n,e.b))}function FPe(e,t,n){var r;e.b=t,e.a=n,r=(e.a&512)==512?new Bre:new Dd,e.c=w3e(r,e.b,e.a)}function IPe(e,t){return GU(e.e,t)?(Wb(),aP(t)?new sO(t,e):new HC(t,e)):new VC(t,e)}function LPe(e){var t,n;return 0>e?new pb:(t=e+1,n=new BOe(t,e),new ude(null,n))}function RPe(e,t){_A();var n=new fb(1);return FC(e)?cj(n,e,t):PH(n.f,e,t),new _m(n)}function zPe(e,t){var n=new rt;I(t.b,68),I(t.b,68),I(t.b,68),AP(t.a,new Ehe(e,n,t))}function BPe(e,t){var n=e.d;e.d=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,11,n,e.d))}function VPe(e,t){var n,r;for(r=t.vc().Jc();r.Ob();)n=I(r.Pb(),45),TV(e,n.jd(),n.kd())}function TF(e,t){var n=e.j;e.j=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,13,n,e.j))}function HPe(e,t){var n;return P(t,8)?(n=I(t,8),e.a==n.a&&e.b==n.b):!1}function UPe(e){var t=q(e,(X(),N0));return P(t,174)?DVe(I(t,174)):null}function WPe(e){var t;return e=r.Math.max(e,2),t=SLe(e),e>t?(t<<=1,t>0?t:GK):t}function GPe(e){var t;return e.b==null?(Hb(),Hb(),u9):(t=e.sl()?e.rl():e.ql(),t)}function EF(e){var t;return ope(e.f.g,e.d),VE(e.b),e.c=e.a,t=I(e.a.Pb(),45),e.b=zIe(e),t}function DF(e,t){var n=e.a,r=0;for(var i in n)n.hasOwnProperty(i)&&(t[r++]=i);return t}function OF(e,t){var n;return Wk(t),n=t.g,e.b[n]?!1:(Ek(e.b,n,t),++e.c,!0)}function KPe(e,t){var n=t==null?-1:HN(e.b,t,0);return n<0?!1:(kF(e,n),!0)}function kF(e,t){var n=GM(e.b,e.b.c.length-1);t<e.b.c.length&&(wM(e.b,t,n),SQe(e,t))}function qPe(e,t){(OM(),VQ?null:t.c).length==0&&gde(t,new ve),cj(e.a,VQ?null:t.c,t)}function JPe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,21,n,e.b))}function AF(e,t){var n=1-t,r=e.a[n];return e.a[n]=r.a[t],r.a[t]=e,e.b=!0,r.b=!1,r}function YPe(e,t){var n=I(q(e,(XG(),t4)),8),r=I(q(t,t4),8);return yR(n.b,r.b)}function XPe(e){rve.call(this),this.b=A(F(q(e,(XG(),o4)))),this.a=I(q(e,T2),222)}function ZPe(e,t,n){FEe.call(this,e,t,n),this.a=new qh,this.b=new qh,this.d=new Ote(this)}function QPe(e){this.e=e,this.d=new ky(_I(PO(this.e).gc())),this.c=this.e.a,this.b=this.e.c}function jF(e){this.b=e,this.a=H(q9,cq,30,e+1,15,1),this.c=H(q9,cq,30,e,15,1),this.d=0}function MF(e,t,n){var r=new Kh;return Z4e(e,t,r,n,!0,!0),e.b=new jF(r.c.length),r}function $Pe(e,t){var n,r=new Kh;n=t;do ng(r.c,n),n=I(Dk(e.k,n),17);while(n);return r}function eFe(e,t){var n=I(Dk(e.c,t),456);return n||(n=new Ore,n.c=t,Yk(e.c,n.c,n)),n}function NF(e){switch(tE(e.e!=3),e.e){case 2:return!1;case 0:return!0}return fke(e)}function PF(){PF=E,h$=new Rh(Nst),g$=new Rh(Pst),m$=new Rh(Fst),p$=new Rh(Ist)}function FF(){FF=E,V$=new Foe(`TO_INTERNAL_LTR`,0),sxt=new Foe(`TO_INPUT_DIRECTION`,1)}function IF(){IF=E,N3=new kS(`P1_NODE_PLACEMENT`,0),P3=new kS(`P2_EDGE_ROUTING`,1)}function LF(){LF=E,T1=new Rx(`START`,0),w1=new Rx(`MIDDLE`,1),C1=new Rx(`END`,2)}function RF(){RF=E,Zxt=new hD(`edgelabelcenterednessanalysis.includelabel`,(hE(),vQ))}function tFe(e,t){hb(oA(new mO(null,new yj(new tm(e.b),1)),new _C(e,t)),new fse(e,t))}function nFe(e,t){t.Tg(act,1),hb(lP(new mO(null,new yj(e.b,16)),new qt),new Jt),t.Ug()}function zF(e){return FC(e)?vL(e):PC(e)?hw(e):NC(e)?mde(e):Cve(e)?e.Hb():B_e(e)?bE(e):gSe(e)}function BF(e,t){var n;return P(t,18)?(n=I(t,18),e.Fc(n)):oP(e,I(Sk(t),20).Jc())}function VF(e,t){var n=e.zb;e.zb=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,1,n,e.zb))}function HF(e,t){var n=(r=new r_,r),r;n.n=t,gN((!e.s&&(e.s=new L(N7,e,21,17)),e.s),n)}function UF(e,t){var n,r=(n=new ade,n);r.n=t,gN((!e.s&&(e.s=new L(N7,e,21,17)),e.s),r)}function rFe(e){var t,n;for(n=new XT(e);n.e!=n.i.gc();)t=I(uB(n),26),JP(t,0),YP(t,0)}function iFe(e){var t,n;for(n=e.c.a.ec().Jc();n.Ob();)t=I(n.Pb(),218),Mp(t,new Rve(t.f))}function aFe(e){var t,n;for(n=e.c.a.ec().Jc();n.Ob();)t=I(n.Pb(),218),hee(t,new XYe(t.e))}function WF(e,t){var n=e.xb;e.xb=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,3,n,e.xb))}function GF(e,t){var n=e.yb;e.yb=t,e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,1,2,n,e.yb))}function KF(e,t){var n=e.Nc(),r;for(AN(n,0,n.length,t),r=0;r<n.length;r++)e.fd(r,n[r])}function oFe(e,t,n){var r,i,a=e.a.length-1;for(i=e.b,r=0;r<n;i=i+1&a,++r)Ek(t,r,e.a[i])}function qF(e,t){var n,r,i;for(Wk(t),n=!1,i=t.Jc();i.Ob();)r=i.Pb(),n|=e.Ec(r);return n}function sFe(e){var t=0,n,r;for(r=e.Jc();r.Ob();)n=r.Pb(),t+=n==null?0:zF(n),t=~~t;return t}function cFe(e){var t;return e==0?`UTC`:(e<0?(e=-e,t=`UTC+`):t=`UTC-`,t+uMe(e))}function lFe(e){return e.a<54?e.f<0?-1:+(e.f>0):(!e.c&&(e.c=gj(vI(e.f))),e.c).e}function uFe(e,t){t?e.B??(e.B=e.D,e.D=null):e.B!=null&&(e.D=e.B,e.B=null)}function dFe(e,t){typeof window===oK&&typeof window.$gwt===oK&&(window.$gwt[e]=t)}function fFe(e,t,n){var r=0,i,a;for(i=0;i<n;i++)a=t[i],e[i]=a<<1|r,r=a>>>31;r!=0&&(e[n]=r)}function JF(e,t,n,r,i,a){var o;this.c=e,o=new Kh,YWe(e,o,t,e.b,n,r,i,a),this.a=new Fj(o,0)}function pFe(){this.c=new Iy(0),this.b=new Iy(edt),this.d=new Iy(Qut),this.a=new Iy($ut)}function mFe(e,t){return A(F(vE(lR(sA(new mO(null,new yj(e.c.b,16)),new mh(e)),t))))}function hFe(e,t){return A(F(vE(lR(sA(new mO(null,new yj(e.c.b,16)),new ph(e)),t))))}function gFe(e,t){var n=I(Y(e,(vH(),I3)),15),r=I(Y(t,I3),15);return lT(n.a,r.a)}function _Fe(e,t){var n;t.Tg(`General Compactor`,1),n=yVe(I(Y(e,(vH(),ENt)),386)),n.Bg(e)}function vFe(e,t,n){n.Tg(`DFS Treeifying phase`,1),sHe(e,t),A4e(e,t),e.a=null,e.b=null,n.Ug()}function yFe(e,t,n){var r,i;for(i=sB(e,0);i.b!=i.d.c;)r=I(Xj(i),8),r.a+=t,r.b+=n;return e}function YF(e,t,n){var r;for(r=e.b[n&e.f];r;r=r.b)if(n==r.a&&Rk(t,r.g))return r;return null}function XF(e,t,n){var r;for(r=e.c[n&e.f];r;r=r.d)if(n==r.f&&Rk(t,r.i))return r;return null}function bFe(e,t,n,r){var i=new N_;SA(i,`x`,RV(e,t,r.a)),SA(i,`y`,zV(e,t,r.b)),kk(n,i)}function xFe(e,t,n,r){var i=new N_;SA(i,`x`,RV(e,t,r.a)),SA(i,`y`,zV(e,t,r.b)),kk(n,i)}function ZF(e,t,n,r,i,a,o,s,c,l,u,d,f){return ZZe(e,t,n,r,i,a,o,s,c,l,u,d,f),JR(e,!1),e}function QF(e,t,n,r,i,a,o){Ky.call(this,e,t),this.d=n,this.e=r,this.c=i,this.b=a,this.a=VM(o)}function SFe(e,t){return $w(),sF(Xq),r.Math.abs(0-t)<=Xq||t==0?0:e/t}function CFe(e,t){return ZI(),e==w$&&t==D$||e==D$&&t==w$||e==E$&&t==T$||e==T$&&t==E$}function wFe(e,t){return ZI(),e==w$&&t==T$||e==w$&&t==E$||e==D$&&t==E$||e==D$&&t==T$}function TFe(){return XU(),W(j(PCt,1),Z,261,0,[K1,J1,Y1,X1,Z1,Q1,e0,G1,q1,$1])}function EFe(){return gW(),W(j(Dkt,1),Z,243,0,[N4,j4,M4,wkt,Tkt,Ckt,Ekt,P4,k4,A4])}function $F(){$F=E,l9=new Ire,GBt=W(j(N7,1),SZ,179,0,[]),WBt=W(j(B7,1),mht,62,0,[])}function eI(){eI=E,txt=new It,$bt=new Ft,ext=new Lt,Qbt=new Rt,nxt=new zt,rxt=new Bt}function DFe(e,t){t.Tg(act,1),uz(Qae(new Mm((Db(),new dA(e,!1,!1,new Nt))))),t.Ug()}function tI(e){var t=AEe(e);return UC(t.a,0)?(ob(),ob(),J_t):(ob(),new HE(t.b))}function nI(e){var t=AEe(e);return UC(t.a,0)?(ob(),ob(),J_t):(ob(),new HE(t.c))}function OFe(e){var t=Wj(e);return UC(t.a,0)?(lb(),lb(),Y_t):(lb(),new _ue(t.b))}function kFe(e){return e.b.c.i.k==(vU(),P$)?I(q(e.b.c.i,(X(),N0)),12):e.b.c}function AFe(e){return e.b.d.i.k==(vU(),P$)?I(q(e.b.d.i,(X(),N0)),12):e.b.d}function jFe(e){switch(e.g){case 2:return RG(),N5;case 4:return RG(),p5;default:return e}}function MFe(e){switch(e.g){case 1:return RG(),j5;case 3:return RG(),m5;default:return e}}function NFe(e,t){var n=uYe(e);return c$e(new M(n.c,n.d),new M(n.b,n.a),e.Kf(),t,e.$f())}function rI(e,t){var n,r;for(Wk(t),r=t.vc().Jc();r.Ob();)n=I(r.Pb(),45),e.yc(n.jd(),n.kd())}function PFe(e,t,n){var r;for(r=n.Jc();r.Ob();)if(!iM(e,t,r.Pb()))return!1;return!0}function FFe(e,t){var n;for(Sk(t);e.Ob();)if(n=e.Pb(),!TIe(I(n,9)))return!1;return!0}function IFe(e,t,n,r,i){var a;return n&&(a=hz(t.Ah(),e.c),i=n.Oh(t,-1-(a==-1?r:a),null,i)),i}function LFe(e,t,n,r,i){var a;return n&&(a=hz(t.Ah(),e.c),i=n.Qh(t,-1-(a==-1?r:a),null,i)),i}function RFe(e){var t;if(e.b==-2){if(e.e==0)t=-1;else for(t=0;e.a[t]==0;t++);e.b=t}return e.b}function zFe(e){if(Wk(e),e.length==0)throw k(new Mv(`Zero length BigInteger`));K8e(this,e)}function BFe(e){this.i=e.gc(),this.i>0&&(this.g=this.$i(this.i+(this.i/8|0)+1),e.Oc(this.g))}function VFe(e,t,n){this.g=e,this.d=t,this.e=n,this.a=new Kh,OQe(this),_A(),oT(this.a,null)}function HFe(e,t){t.q=e,e.d=r.Math.max(e.d,t.r),e.b+=t.d+(e.a.c.length==0?0:e.c),zT(e.a,t)}function UFe(e,t){return t<e.b.gc()?I(e.b.Xb(t),9):t==e.b.gc()?e.a:I(dO(e.e,t-e.b.gc()-1),9)}function iI(e,t){return hE(),FC(e)?Ske(e,QE(t)):PC(e)?_ve(e,F(t)):NC(e)?gve(e,ZE(t)):e.Dd(t)}function WFe(e){var t,n,r;return e.j==(RG(),m5)&&(t=u1e(e),n=CE(t,p5),r=CE(t,N5),r||r&&n)}function GFe(e){var t,n,r=0;for(n=new O(e.b);n.a<n.c.c.length;)t=I(V(n),25),t.p=r,++r}function aI(e,t){var n,r;for(r=sB(e,0);r.b!=r.d.c;)n=I(Xj(r),8),n.a+=t.a,n.b+=t.b;return e}function oI(e,t){var n,r,i=e.c,a;return n=e.c+e.b,a=e.d,r=e.d+e.a,t.a>i&&t.a<n&&t.b>a&&t.b<r}function sI(e,t){var n;P(t,92)?(I(e.c,78).Ek(),n=I(t,92),VPe(e,n)):I(e.c,78).Wb(t)}function cI(e,t){var n,r;for(Wk(t),r=e.vc().Jc();r.Ob();)n=I(r.Pb(),45),t.Wd(n.jd(),n.kd())}function lI(e,t){XD.call(this,YBt,e,t),this.b=this,this.a=HU(e.Ah(),bP(this.e.Ah(),this.c))}function uI(e){this.f=e,this.e=new oOe(this.f.i),this.a=this.e,this.b=zIe(this),this.d=this.f.g}function dI(e,t,n,r){var i=e.a.length;n>i?n=i:xj(t,n+1),e.a=MA(e.a,0,t)+(``+r)+Wye(e.a,n)}function KFe(e,t,n,r){P(e.Cb,184)&&(I(e.Cb,184).tb=null),VF(e,n),t&&p$e(e,t),r&&e.el(!0)}function qFe(){qFe=E,FIt=VL((wH(),W(j(PIt,1),Z,285,0,[NIt,_6,x6,C6,v6,y6,b6,S6])))}function JFe(){JFe=E,oBt=VL((sU(),W(j(S7,1),Z,244,0,[aBt,b7,x7,y7,iBt,v7,_7,rBt])))}function YFe(){YFe=E,Xbt=VL((vU(),W(j(Ybt,1),Z,249,0,[R$,I$,P$,z$,F$,N$,B$,L$])))}function XFe(){XFe=E,PSt=VL((rW(),W(j(NSt,1),Z,275,0,[ESt,kSt,TSt,MSt,OSt,DSt,jSt,ASt])))}function ZFe(){return yW(),W(j(Ajt,1),Z,264,0,[kjt,Sjt,Ejt,Djt,Tjt,xjt,Ojt,yjt,wjt,Cjt,bjt])}function QFe(){QFe=E,TAt=Hz(Qse(oO(oO(new Hk,(iH(),b$),(eK(),r1)),x$,Y$),S$),n1)}function $Fe(){$Fe=E,kAt=Hz(Qse(oO(oO(new Hk,(iH(),b$),(eK(),r1)),x$,Y$),S$),n1)}function eIe(){var e;return lvt||(lvt=new Cg,e=new DM(``),jce(e,(ub(),cvt)),qPe(lvt,e)),lvt}function tIe(e){return cD(),e.A.Gc((jz(),I5))&&!e.B.Gc((TW(),W5))?WVe(e):null}function nIe(e,t){var n=l8e(cF(),e);return n?(vB(t,($G(),c8),n),!0):!1}function fI(e,t){var n;for(n=0;n<t.j.c.length;n++)I(WN(e,n),22).Fc(I(WN(t,n),18));return e}function rIe(e,t){var n,r;for(r=new O(t.b);r.a<r.c.c.length;)n=I(V(r),25),e.a[n.p]=JYe(n)}function pI(e,t){var n=e.qh(),r,i;if(n!=null&&e.th())for(r=0,i=n.length;r<i;++r)n[r].bj(t)}function iIe(e,t,n){return e==(XL(),K4)?new za:SU(t,1)==0?new Mie(n.length):new dy(n.length)}function aIe(e,t,n){return yR(LT(rB(e),new M(t.e.a,t.e.b)),LT(rB(e),new M(n.e.a,n.e.b)))}function mI(e,t,n){var r,i=I(OD(e.d,t),15);return r=I(OD(e.b,n),15),!i||!r?null:rN(e,i.a,r.a)}function hI(e){var t=e.h;return t==0?e.l+e.m*pq:t==dq?e.l+e.m*pq-mq:e}function oIe(e){var t;if(e.a==e.b.a)throw k(new pg);return t=e.a,e.c=t,e.a=I(Pk(e.a.e),227),t}function sIe(e){var t;e.d==null?(++e.e,e.f=0,_ze(null)):(++e.e,t=e.d,e.d=null,e.f=0,_ze(t))}function cIe(e,t){var n,r;for(r=new O(t);r.a<r.c.c.length;)n=I(V(r),70),zT(e.d,n),YYe(e,n)}function gI(e,t){for(var n=e,r=Uk(n).e;r;){if(n=r,n==t)return!0;r=Uk(n).e}return!1}function lIe(e,t,n){var r=e.a.f[t.p],i=e.a.f[n.p];return r<i?-1:r==i?0:1}function _I(e){return e<3?(vF(e,Wat),e+1):e<GK?GA(r.Math.ceil(e/.75)):uK}function vI(e){return gq<e&&e<mq?e<0?r.Math.ceil(e):r.Math.floor(e):hI(i4e(e))}function uIe(e,t){e.a=VR(e.a,1),e.c=r.Math.min(e.c,t),e.b=r.Math.max(e.b,t),e.d=VR(e.d,t)}function dIe(e,t){var n;t.Tg(`Edge and layer constraint edge reversal`,1),n=P6e(e),Qnt(n),t.Ug()}function fIe(e,t){var n,r;for(r=new XT(e);r.e!=r.i.gc();)n=I(uB(r),26),Lw(n,n.i+t.b,n.j+t.d)}function pIe(e,t){e.c&&(w8e(e,t,!0),hb(new mO(null,new yj(t,16)),new Cte(e))),w8e(e,t,!1)}function yI(e,t){var n=(r=new Df,r),r;return n.G=t,!e.rb&&(e.rb=new JO(e,F7,e)),gN(e.rb,n),n}function bI(e,t){var n=(r=new mg,r),r;return n.G=t,!e.rb&&(e.rb=new JO(e,F7,e)),gN(e.rb,n),n}function xI(e,t){var n;return(e.Db&t)==0?null:(n=XB(e,t),n==-1?e.Eb:BP(e.Eb)[n])}function SI(e){var t;if(e.g>1||e.Ob())return++e.a,e.g=0,t=e.i,e.Ob(),t;throw k(new pg)}function mIe(e){Qw();var t;return woe(qAt,e)||(t=new no,t.a=e,Bde(qAt,e,t)),I(Zk(qAt,e),636)}function hIe(e){switch(e.a.g){case 1:return new Ese;case 3:return new wGe;default:return new pf}}function gIe(e,t){switch(t){case 1:return!!e.n&&e.n.i!=0;case 2:return e.k!=null}return BTe(e,t)}function CI(e){var t;return e<128?(i_e(),t=u_t[e],!t&&(t=u_t[e]=new Fee(e)),t):new Fee(e)}function _Ie(e){var t=1,n,r;for(r=e.Jc();r.Ob();)n=r.Pb(),t=31*t+(n==null?0:zF(n)),t=~~t;return t}function wI(e){var t,n,r=0;for(n=new ib(e.a);n.a<n.c.a.length;)t=cM(n),e.b.Gc(t)&&++r;return r}function TI(e){var t,n,r,i=e;return r=0,i<0&&(i+=mq,r=dq),n=GA(i/pq),t=GA(i-n*pq),dT(t,n,r)}function vIe(e,t){var n=e.a.get(t);return n===void 0?++e.d:(Gde(e.a,t),--e.c,++e.b.g),n}function EI(e,t){var n;return t?(n=t.lf(),n.dc()||(e.q?rI(e.q,n):e.q=new Bse(n)),e):e}function yIe(e,t){var n=t.p-e.p,r,i;return n==0?(r=e.f.a*e.f.b,i=t.f.a*t.f.b,yR(r,i)):n}function bIe(e,t){var n;try{t.be()}catch(t){if(t=GI(t),P(t,80))n=t,ng(e.c,n);else throw k(t)}}function xIe(e){return e.b.c.length!=0&&I(dO(e.b,0),70).a?I(dO(e.b,0),70).a:wxe(e)}function SIe(){this.a=I(lB((NW(),u$)),15).a,this.c=A(F(lB(f$))),this.b=A(F(lB(Vyt)))}function DI(e,t){this.b=e,this.e=t,this.d=t.j,this.f=(Wb(),I(e,69).vk()),this.k=HU(t.e.Ah(),e)}function OI(e,t,n){this.b=(Wk(e),e),this.d=(Wk(t),t),this.e=(Wk(n),n),this.c=this.d+(``+this.e)}function CIe(e,t,n,r,i){qLe.call(this,e,n,r,i),this.f=H(M$,KJ,9,t.a.c.length,0,1),Qz(t.a,this.f)}function kI(e,t,n,r,i){Ek(e.c[t.g],n.g,r),Ek(e.c[n.g],t.g,r),Ek(e.b[t.g],n.g,i),Ek(e.b[n.g],t.g,i)}function wIe(e,t){var n=e.j,r=t.j;return n==r?e.p==t.p?0:n==(RG(),m5)?e.p-t.p:t.p-e.p:n.g-r.g}function TIe(e){var t=I(q(e,(X(),v0)),64);return e.k==(vU(),P$)&&(t==(RG(),N5)||t==p5)}function EIe(){EIe=E,XRt=VL((lU(),W(j(Y8,1),Z,96,0,[V8,B8,U8,J8,q8,K8,W8,G8,H8])))}function DIe(){DIe=E,gzt=VL((TW(),W(j(hzt,1),Z,266,0,[U5,W5,H5,G5,K5,J5,q5,mzt,V5])))}function OIe(){OIe=E,rCt=VL((yU(),W(j(nCt,1),Z,267,0,[ZSt,YSt,$St,eCt,QSt,tCt,L1,XSt,JSt])))}function kIe(){kIe=E,ukt=VL((PU(),W(j(lkt,1),Z,268,0,[skt,akt,okt,nkt,ikt,ckt,S4,tkt,rkt])))}function AI(){AI=E,Bkt=new aS(`EQUALLY`,0),Vkt=new aS(`NORTH`,1),Hkt=new aS(`NORTH_SOUTH`,2)}function jI(){jI=E,ICt=new Jx(`ONE_SIDED`,0),LCt=new Jx(`TWO_SIDED`,1),t0=new Jx(`OFF`,2)}function MI(){MI=E,JNt=new PS(BJ,0),YNt=new PS(`POLAR_COORDINATE`,1),qNt=new PS(`ID`,2)}function NI(){NI=E,h1=new Nx(Gq,0),g1=new Nx(Kq,1),_1=new Nx(qq,2),mSt=new Nx(`TOP`,3)}function PI(){PI=E,a$=new fx(`UP`,0),i$=new fx(vst,1),syt=new fx(Kq,2),cyt=new fx(qq,3)}function FI(){FI=E,s$=new hD(`debugSVG`,(hE(),!1)),pyt=new hD(`overlapsExisted`,!0)}function II(){II=E,iAt=new fS(`OFF`,0),H4=new fS(`SINGLE_EDGE`,1),V4=new fS(`MULTI_EDGE`,2)}function LI(){LI=E,u6=new GS(`MINIMUM_SPANNING_TREE`,0),vIt=new GS(`MAXIMUM_SPANNING_TREE`,1)}function AIe(e){e.r=new Sg,e.w=new Sg,e.t=new Kh,e.i=new Kh,e.d=new Sg,e.a=new kw,e.c=new qh}function RI(e){this.n=new Kh,this.e=new ab,this.j=new ab,this.k=new Kh,this.f=new Kh,this.p=e}function jIe(e){switch(e.g){case 0:return new Ks;case 1:return new qs;default:return null}}function MIe(){return OM(),VQ?new DM(null):n1e(eIe(),`com.google.common.base.Strings`)}function NIe(e){var t;if(e){if(t=e,t.dc())throw k(new pg);return t.Xb(t.gc()-1)}return Swe(e.Jc())}function zI(e){var t;return(!e.a||!(e.Bb&1)&&e.a.Sh())&&(t=yV(e),P(t,159)&&(e.a=I(t,159))),e.a}function PIe(e,t,n){var r,i,a=null;return i=Gj(t,Vpt),r=new bC(e,n),a=(uqe(r.a,r.b,i),i),a}function BI(e,t){var n,r=(n=new Fl,n);return VF(r,t),gN((!e.A&&(e.A=new GT(W7,e,7)),e.A),r),r}function VI(e,t,n,r){return n==1?(!e.n&&(e.n=new L(f7,e,1,7)),bB(e.n,t,r)):sXe(e,t,n,r)}function FIe(e,t,n,r){I(n.b,68),I(n.b,68),I(r.b,68),I(r.b,68),I(r.b,68),AP(r.a,new The(e,t,r))}function IIe(e,t){e.d==(bR(),y8)||e.d==S8?I(t.a,60).c.Ec(I(t.b,60)):I(t.b,60).c.Ec(I(t.a,60))}function HI(e,t,n){var r,i,a,o=Uk(e);r=o.d,i=o.c,a=e.n,t&&(a.a=a.a-r.b-i.a),n&&(a.b=a.b-r.d-i.b)}function LIe(e,t,n){var r,i=I(q(e,(XG(),j2)),79);i&&(r=new e_,IL(r,0,i),aI(r,n),qF(t,r))}function UI(e,t){var n=t.Nc();return n.length==0?!1:(Qhe(e.c,e.c.length,n),!0)}function WI(e,t){var n,r;for(Wk(t),r=t.Jc();r.Ob();)if(n=r.Pb(),!e.Gc(n))return!1;return!0}function RIe(e,t){if(t==null)return!1;for(;e.a!=e.b;)if(uR(t,eR(e)))return!0;return!1}function zIe(e){return e.a.Ob()?!0:e.a==e.e?(e.a=new FAe(e.f.f),e.a.Ob()):!1}function GI(e){var t;return P(e,80)?e:(t=e&&e.__java$exception,t||(t=new MRe(e),hre(t)),t)}function KI(e){if(P(e,193))return I(e,125);if(e)return null;throw k(new tv(imt))}function BIe(e){switch(I(q(e,(XG(),M2)),165).g){case 2:case 4:return!0;default:return!1}}function VIe(e,t){var n=e.c,r=t.e[e.p];return r<n.a.c.length-1?I(dO(n.a,r+1),9):null}function HIe(e){var t,n;for(E9e(e),n=new O(e.d);n.a<n.c.c.length;)t=I(V(n),107),t.i&&WXe(t)}function UIe(e,t){var n,r;for(r=new O(e.b);r.a<r.c.c.length;)n=I(V(r),70),G(n,(X(),T0),t)}function WIe(e,t,n){var r,i;for(i=new O(e.b);i.a<i.c.c.length;)r=I(V(i),26),Lw(r,r.i+t,r.j+n)}function qI(e){var t=new ab,n,r;for(r=sB(e.d,0);r.b!=r.d.c;)n=I(Xj(r),65),QD(t,n.c);return t}function GIe(e){var t=1,n,r,i;for(n=0,i=e.gc();n<i;++n)r=e.Ti(n),t=31*t+(r==null?0:zF(r));return t}function KIe(e){var t,n=(t=new Fl,t);return VF(n,`T`),gN((!e.d&&(e.d=new GT(W7,e,11)),e.d),n),n}function qIe(e,t){var n=ME(t.a.gc());return hb(CP(new mO(null,new yj(t,1)),e.i),new qS(e,n)),n}function JIe(e,t,n,r){var i;return Vj(t,e.e.Pd().gc()),Vj(n,e.c.Pd().gc()),i=e.a[t][n],Ek(e.a[t],n,r),i}function W(e,t,n,r,i){return i.Pm=e,i.Qm=t,i.Rm=T,i.__elementTypeId$=n,i.__elementTypeCategory$=r,i}function YIe(e,t){var n=e.l+t.l,r=e.m+t.m+(n>>22),i=e.h+t.h+(r>>22);return dT(n&uq,r&uq,i&dq)}function XIe(e,t){var n=e.l-t.l,r=e.m-t.m+(n>>22),i=e.h-t.h+(r>>22);return dT(n&uq,r&uq,i&dq)}function ZIe(e){var t;GW(e,!0),t=iq,WE(e,(XG(),n4))&&(t+=I(q(e,n4),15).a),G(e,n4,K(t))}function JI(e){var t,n,r,i=new Kh;for(r=e.Jc();r.Ob();)n=I(r.Pb(),26),t=JU(n),UI(i,t);return i}function QIe(e,t,n){var r;ck(e.a),AP(n.i,new ine(e)),r=new pT(I(Dk(e.a,t.b),68)),UHe(e,r,t),n.f=r}function $Ie(e,t){return!e||!t||e==t?!1:SHe(e.d.c,t.d.c+t.d.b)&&SHe(t.d.c,e.d.c+e.d.b)}function eLe(e,t,n,i,a){return ZU(),r.Math.min(fnt(e,t,n,i,a),fnt(n,i,e,t,GE(new M(a.a,a.b))))}function tLe(e,t){if(!e)throw k(new $_(cW(`value already present: %s`,W(j(sQ,1),hK,1,5,[t]))))}function nLe(e){var t,n=(hy(),t=new $c,t);return e&&gN((!e.a&&(e.a=new L(a7,e,6,6)),e.a),n),n}function YI(e,t){var n,r=0;if(e<64&&e<=t)for(t=t<64?t:63,n=e;n<=t;n++)r=Dj(r,zO(1,n));return r}function rLe(e,t){var n,r;for(TA(t,`predicate`),r=0;e.Ob();r++)if(n=e.Pb(),t.Lb(n))return r;return-1}function iLe(e,t){switch(t){case 0:!e.o&&(e.o=new bN((GG(),d7),g7,e,0)),e.o.c.$b();return}SH(e,t)}function aLe(e){switch(e.g){case 1:return L8;case 2:return I8;case 3:return R8;default:return z8}}function oLe(e){_A();var t,n,r=0;for(n=e.Jc();n.Ob();)t=n.Pb(),r+=t==null?0:zF(t),r|=0;return r}function sLe(e){var t=new S;return t.a=e,t.b=CLe(e),t.c=H(OQ,kK,2,2,6,1),t.c[0]=cFe(e),t.c[1]=cFe(e),t}function XI(){XI=E,$xt=new Dx(BJ,0),p1=new Dx(dct,1),m1=new Dx(fct,2),f1=new Dx(`BOTH`,3)}function ZI(){ZI=E,w$=new xx(`Q1`,0),D$=new xx(`Q4`,1),T$=new xx(`Q2`,2),E$=new xx(`Q3`,3)}function QI(){QI=E,r0=new Yx(`ONLY_WITHIN_GROUP`,0),BCt=new Yx(Wst,1),n0=new Yx(`ENFORCED`,2)}function $I(){$I=E,sCt=new Hx(BJ,0),z1=new Hx(`INCOMING_ONLY`,1),B1=new Hx(`OUTGOING_ONLY`,2)}function eL(){eL=E,new Rh(`org.eclipse.elk.addLayoutConfig`),CIt=new tc,SIt=new nc,wIt=new ec}function tL(){tL=E,n_t={boolean:Wae,number:U_,string:Zre,object:cQe,function:cQe,undefined:Xh}}function cLe(){cLe=E,Okt=VL((gW(),W(j(Dkt,1),Z,243,0,[N4,j4,M4,wkt,Tkt,Ckt,Ekt,P4,k4,A4])))}function lLe(){lLe=E,FCt=VL((XU(),W(j(PCt,1),Z,261,0,[K1,J1,Y1,X1,Z1,Q1,e0,G1,q1,$1])))}function uLe(e,t,n,r){return new Toe(W(j(dQ,1),RK,45,0,[(UB(e,t),new Uy(e,t)),(UB(n,r),new Uy(n,r))]))}function dLe(e,t){return y7e(I(I(Dk(e.g,t.a),49).a,68),I(I(Dk(e.g,t.b),49).a,68))}function fLe(e,t,n){var r=e.gc();if(t>r)throw k(new wD(t,r));return e.Qi()&&(n=WCe(e,n)),e.Ci(t,n)}function pLe(e){var t,n=e.n,r=e.o;return t=e.d,new fA(n.a-t.b,n.b-t.d,r.a+(t.b+t.c),r.b+(t.d+t.a))}function mLe(e,t){return!e||!t||e==t?!1:nz(e.b.c,t.b.c+t.b.b)<0&&nz(t.b.c,e.b.c+e.b.b)<0}function nL(e,t,n){return e>=128?!1:GC(e<64?Ej(zO(1,e),n):Ej(zO(1,e-64),t),0)}function rL(e,t,n){switch(n.g){case 2:e.b=t;break;case 1:e.c=t;break;case 4:e.d=t;break;case 3:e.a=t}}function hLe(e,t){for(;e.g==null&&!e.c?UCe(e):e.g==null||e.i!=0&&I(e.g[e.i-1],50).Ob();)t.Bi(_U(e))}function iL(e,t,n){return n==null?(!e.q&&(e.q=new qh),WM(e.q,t)):(!e.q&&(e.q=new qh),Yk(e.q,t,n)),e}function G(e,t,n){return n==null?(!e.q&&(e.q=new qh),WM(e.q,t)):(!e.q&&(e.q=new qh),Yk(e.q,t,n)),e}function gLe(e){var t,n=new YM;return EI(n,e),G(n,(PF(),h$),e),t=new qh,n9e(e,n,t),Hnt(e,n,t),n}function _Le(e){ZU();var t,n=H(T6,kK,8,2,0,1),r=0;for(t=0;t<2;t++)r+=.5,n[t]=UWe(r,e);return n}function vLe(e,t){var n=!1,r=e.a[t].length,i,a;for(a=0;a<r-1;a++)i=a+1,n|=fHe(e,t,a,i);return n}function yLe(e){var t,n,r,i;for(n=e.a,r=0,i=n.length;r<i;++r)t=n[r],MLe(e,t,(RG(),j5)),MLe(e,t,m5)}function aL(e){var t=~e.l+1&uq,n=~e.m+ +(t==0)&uq;return dT(t,n,~e.h+ +(t==0&&n==0)&dq)}function bLe(e){var t=e.t-e.k[e.o.p]*e.d+e.j[e.o.p]>e.f,n=e.u+e.e[e.o.p]*e.d>e.f*e.s*e.d;return t||n}function xLe(e){var t;return(!e.c||!(e.Bb&1)&&e.c.Db&64)&&(t=yV(e),P(t,88)&&(e.c=I(t,29))),e.c}function SLe(e){var t;if(e<0)return QK;if(e==0)return 0;for(t=GK;(t&e)==0;t>>=1);return t}function CLe(e){var t;return e==0?`Etc/GMT`:(e<0?(e=-e,t=`Etc/GMT-`):t=`Etc/GMT+`,t+uMe(e))}function wLe(e){var t,n=ZH(e.h);return n==32?(t=ZH(e.m),t==32?ZH(e.l)+32:t+20-10):n-12}function oL(e){var t=e.a[e.b];return t==null?null:(Ek(e.a,e.b,null),e.b=e.b+1&e.a.length-1,t)}function TLe(){++kgt,this.o=null,this.k=null,this.j=null,this.d=null,this.b=null,this.n=null,this.a=null}function ELe(e,t){this.c=e,this.d=t,this.b=this.d/this.c.c.Pd().gc()|0,this.a=this.d%this.c.c.Pd().gc()}function DLe(e,t){this.b=e,ow.call(this,(I(U(B((yk(),K7).o),10),19),t.i),t.g),this.a=($F(),GBt)}function OLe(e,t,n){this.q=new r.Date,this.q.setFullYear(e+sq,t,n),this.q.setHours(0,0,0,0),qW(this,0)}function kLe(e,t,n){var r=new pN(t,n),i=new he;return e.b=v3e(e,e.b,r,i),i.b||++e.c,e.b.b=!1,i.d}function ALe(e,t){_A();var n,r,i,a,o=!1;for(r=t,i=0,a=r.length;i<a;++i)n=r[i],o|=e.Ec(n);return o}function jLe(e,t,n,r,i){var a,o=e.length;if(a=n.length,t<0||r<0||i<0||t+i>o||r+i>a)throw k(new ig)}function MLe(e,t,n){var r,i,a,o=dR(t,n);for(a=0,i=o.Jc();i.Ob();)r=I(i.Pb(),12),Yk(e.c,r,K(a++))}function sL(e){var t,n;for(n=new O(e.a.b);n.a<n.c.c.length;)t=I(V(n),82),t.g.c=-t.g.c-t.g.b;MU(e)}function cL(e){var t,n;for(n=new O(e.a.b);n.a<n.c.c.length;)t=I(V(n),60),t.d.c=-t.d.c-t.d.b;s4e(e)}function NLe(e){var t=I(e.e&&e.e(),10),n;return new MD(t,(n=t.slice(),I(jN(n,t),10)),t.length)}function lL(e){var t=~e.l+1&uq,n=~e.m+ +(t==0)&uq,r=~e.h+ +(t==0&&n==0)&dq;e.l=t,e.m=n,e.h=r}function uL(e){var t=new uy,n,r,i,a;for(r=e,i=0,a=r.length;i<a;++i)n=r[i],t.a+=n.a,t.b+=n.b;return t}function dL(e,t,n){var r,i,a=null;return i=Gj(t,`labels`),r=new bse(e,n),a=($1e(r.a,r.b,i),i),a}function PLe(e,t,n){var r=new Kh;return Z4e(e,t,r,(RG(),p5),!0,!1),Z4e(e,n,r,N5,!1,!1),r}function FLe(e,t,n,r){var i=x0e(e,t,n,r);return!i&&(i=oBe(e,n,r),i&&!wG(e,t,i))?null:i}function ILe(e,t,n,r){var i=S0e(e,t,n,r);return!i&&(i=vR(e,n,r),i&&!wG(e,t,i))?null:i}function LLe(e,t){var n;for(n=0;n<e.a.a.length;n++)if(!I(d_e(e.a,n),178).Lb(t))return!1;return!0}function RLe(e,t,n){if(Sk(t),n.Ob())for(KC(t,hbe(n.Pb()));n.Ob();)KC(t,e.a),KC(t,hbe(n.Pb()));return t}function zLe(e){_A();var t,n,r=1;for(n=e.Jc();n.Ob();)t=n.Pb(),r=31*r+(t==null?0:zF(t)),r|=0;return r}function BLe(e,t,n,r,i){var a=P1e(e,t);return n&&lL(a),i&&(e=ZWe(e,t),_Q=r?aL(e):dT(e.l,e.m,e.h)),a}function fL(e){var t;return zk(e),t=new Ee,e.a.zd(t)?(rE(),new P_(Wk(t.a))):(rE(),rE(),q_t)}function pL(e){var t,n;for(n=new O(e.a.b);n.a<n.c.c.length;)t=I(V(n),82),t.f.$b();L_(e.b,e),v4e(e)}function VLe(e,t){switch(t.g){case 0:P(e.b,632)||(e.b=new SIe);break;case 1:P(e.b,633)||(e.b=new dge)}}function HLe(e,t){switch(t){case 7:return!!e.e&&e.e.i!=0;case 8:return!!e.d&&e.d.i!=0}return vVe(e,t)}function ULe(e,t,n){e.g=DH(e,t,(RG(),p5),e.b),e.d=DH(e,n,p5,e.b),!(e.g.c==0||e.d.c==0)&&$Ye(e)}function WLe(e,t,n){e.g=DH(e,t,(RG(),N5),e.j),e.d=DH(e,n,N5,e.j),!(e.g.c==0||e.d.c==0)&&$Ye(e)}function GLe(e,t){return LT(rB(I(q(t,(BW(),D3)),86)),new M(e.c.e.a-e.b.e.a,e.c.e.b-e.b.e.b))<=0}function KLe(e,t,n){return!Py(oA(new mO(null,new yj(e.c,16)),new Em(new dse(t,n)))).zd((mb(),WQ))}function mL(e,t,n){this.g=e,this.e=new uy,this.f=new uy,this.d=new ab,this.b=new ab,this.a=t,this.c=n}function hL(e,t,n,r){this.b=new Kh,this.n=new Kh,this.i=r,this.j=n,this.s=e,this.t=t,this.r=0,this.d=0}function qLe(e,t,n,r){this.b=new qh,this.g=new qh,this.d=(ZL(),C4),this.c=e,this.e=t,this.d=n,this.a=r}function JLe(e,t,n){switch(t){case 0:!e.o&&(e.o=new bN((GG(),d7),g7,e,0)),sI(e.o,n);return}IH(e,t,n)}function YLe(e){switch(e.g){case 0:return new $s;default:throw k(new $_(pX+(e.f==null?``+e.g:e.f)))}}function XLe(e){switch(e.g){case 0:return new Zs;default:throw k(new $_(pX+(e.f==null?``+e.g:e.f)))}}function gL(){gL=E,cSt=new gr,lSt=new _r,sSt=new mr,oSt=new vr,aSt=new hr,iSt=(Wk(aSt),new oe)}function _L(){_L=E,Njt=new TS(BJ,0),Mjt=new TS(`MIDDLE_TO_MIDDLE`,1),f3=new TS(`AVOID_OVERLAP`,2)}function ZLe(e){var t=new e_,n,r;for(r=sB(e,0);r.b!=r.d.c;)n=I(Xj(r),8),PE(t,0,new Dw(n));return t}function vL(e){var t=0,n;for(n=0;n<e.length;n++)t=(t<<5)-t+(xj(n,e.length),e.charCodeAt(n))|0;return t}function QLe(e){var t=I(q(e,(X(),F0)),9),n;t&&(n=t.c,VN(n.a,t),n.a.c.length==0&&VN(Uk(t).b,n))}function $Le(e){return VQ?H(svt,Vot,567,0,0,1):I(Qz(e.a,H(svt,Vot,567,e.a.c.length,0,1)),841)}function eRe(e){var t;return e.b<=0?!1:(t=pw(`MLydhHmsSDkK`,$V(Jk(e.c,0))),t>1||t>=0&&e.b<3)}function tRe(){tK();var e;return WVt||(e=oue(VG(`M`,!0)),e=vO(VG(`M`,!1),e),WVt=e,WVt)}function nRe(e){switch(e.g){case 1:return Qut;default:case 2:return 0;case 3:return $ut;case 4:return edt}}function yL(e,t){if(!e.Ji()&&t==null)throw k(new $_(`The 'no null' constraint is violated`));return t}function rRe(e,t){WD(e>=0,`Negative initial capacity`),WD(t>=0,`Non-positive load factor`),ck(this)}function iRe(e,t){for(var n,r,i=e.b;i;){if(n=e.a.Le(t,i.d),n==0)return i;r=n<0?0:1,i=i.a[r]}return null}function bL(e,t){var n;return t===e?!0:P(t,229)?(n=I(t,229),uR(e.Zb(),n.Zb())):!1}function aRe(e,t){return e4e(e,t)?(XH(e.b,I(q(t,(X(),g0)),22),t),QD(e.a,t),!0):!1}function oRe(e,t){return WE(e,(X(),M0))&&WE(t,M0)?I(q(t,M0),15).a-I(q(e,M0),15).a:0}function sRe(e,t){return WE(e,(X(),M0))&&WE(t,M0)?I(q(e,M0),15).a-I(q(t,M0),15).a:0}function cRe(e,t){var n=I(Y(e,(nW(),Y3)),15).a,r=I(Y(t,Y3),15).a;return n==r||n<r?-1:+(n>r)}function lRe(e){return zT(e.c,(eL(),CIt)),ENe(e.a,A(F(lB((Tz(),x4)))))?new qc:new lne(e)}function uRe(e){for(;!e.d||!e.d.Ob();)if(e.b&&!av(e.b))e.d=I(pk(e.b),50);else return null;return e.d}function dRe(e,t,n){return e.d[t.p][n.p]||(rWe(e,t,n),e.d[t.p][n.p]=!0,e.d[n.p][t.p]=!0),e.a[t.p][n.p]}function xL(e,t,n){var r,i=(r=new i_,r);return mF(i,t,n),gN((!e.q&&(e.q=new L(B7,e,11,10)),e.q),i),i}function SL(e){var t,n,r,i=Coe($zt,e);for(n=i.length,r=H(OQ,kK,2,n,6,1),t=0;t<n;++t)r[t]=i[t];return r}function CL(e,t){var n,r,i,a,o;for(r=t,i=0,a=r.length;i<a;++i)n=r[i],o=new ube(e),n.tf(o),S9e(o);ck(e.f)}function fRe(e,t){var n;t*2+1>=e.b.c.length||(fRe(e,2*t+1),n=2*t+2,n<e.b.c.length&&fRe(e,n),SQe(e,t))}function pRe(e,t){var n,r;for(r=sB(e,0);r.b!=r.d.c;)n=I(Xj(r),218),n.e.length>0&&(t.Ad(n),n.i&&wUe(n))}function mRe(e,t,n){var r;for(r=n-1;r>=0&&e[r]===t[r];r--);return r<0?0:Yb(Ej(e[r],Eq),Ej(t[r],Eq))?-1:1}function hRe(e,t){var n;return!e||e==t||!WE(t,(X(),C0))?!1:(n=I(q(t,(X(),C0)),9),n!=e)}function wL(e){switch(e.i){case 2:return!0;case 1:return!1;case-1:++e.c;default:return e.Yl()}}function gRe(e){switch(e.i){case-2:return!0;case-1:return!1;case 1:--e.c;default:return e.Zl()}}function _Re(e,t){var n,r;for(r=e.Zb().Bc().Jc();r.Ob();)if(n=I(r.Pb(),18),n.Gc(t))return!0;return!1}function vRe(e,t,n){var r,i,a,o;for(Wk(n),o=!1,a=e.dd(t),i=n.Jc();i.Ob();)r=i.Pb(),a.Rb(r),o=!0;return o}function yRe(e,t,n){var r,i;this.g=e,this.c=t,this.a=this,this.d=this,i=WPe(n),r=H(Vgt,WK,227,i,0,1),this.b=r}function TL(e,t){var n,r=I(xI(e.a,4),129);return n=H(dBt,qmt,415,t,0,1),r!=null&&RW(r,0,n,0,r.length),n}function bRe(e,t){var n=new iW((e.f&256)!=0,e.i,e.a,e.d,(e.f&16)!=0,e.j,e.g,t);return e.e??(n.c=e),n}function xRe(e,t){var n;return e===t?!0:P(t,92)?(n=I(t,92),HXe(IO(e),n.vc())):!1}function SRe(e,t,n){var r,i;for(i=n.Jc();i.Ob();)if(r=I(i.Pb(),45),e.ze(t,r.kd()))return!0;return!1}function EL(e){return FC(e)?OQ:PC(e)?CQ:NC(e)?bQ:Cve(e)||B_e(e)?e.Pm:e.Pm||Array.isArray(e)&&j(qgt,1)||qgt}function DL(){DL=E,Dbt=OCe(W(j(C8,1),Z,86,0,[(bR(),y8),b8])),Obt=OCe(W(j(C8,1),Z,86,0,[S8,v8]))}function OL(){OL=E,WRt=new Ww(15),URt=new Jw(($G(),t8),WRt),M8=o8,zRt=aLt,BRt=Y6,HRt=Z6,VRt=X6}function kL(){kL=E,P8=new iC(dpt,0),N8=new iC(`INCLUDE_CHILDREN`,1),F8=new iC(`SEPARATE_CHILDREN`,2)}function AL(){AL=E,F3=new MS(BJ,0),iNt=new MS(`RADIAL_COMPACTION`,1),aNt=new MS(`WEDGE_COMPACTION`,2)}function jL(){jL=E,Kkt=new lS(`STACKED`,0),Gkt=new lS(`REVERSE_STACKED`,1),z4=new lS(`SEQUENCED`,2)}function ML(){ML=E,mvt=new cx(`CONCURRENT`,0),HQ=new cx(`IDENTITY_FINISH`,1),hvt=new cx(`UNORDERED`,2)}function NL(){NL=E,Nzt=new yC(`ELK`,0),Pzt=new yC(`JSON`,1),Mzt=new yC(`DOT`,2),Fzt=new yC(`SVG`,3)}function PL(){PL=E,PMt=new ES(Wst,0),j3=new ES(adt,1),NMt=new ES(`FAN`,2),MMt=new ES(`CONSTRAINT`,3)}function FL(){FL=E,Ykt=new uS(`CONSERVATIVE`,0),Xkt=new uS(`CONSERVATIVE_SOFT`,1),B4=new uS(`SLOPPY`,2)}function IL(e,t,n){var r=new ab,i,a;for(a=sB(n,0);a.b!=a.d.c;)i=I(Xj(a),8),QD(r,new Dw(i));vRe(e,t,r)}function CRe(e){var t=0,n,r=H(T6,kK,8,e.b,0,1);for(n=sB(e,0);n.b!=n.d.c;)r[t++]=I(Xj(n),8);return r}function wRe(e,t){var n=I(e.d.Ac(t),18),r;return n?(r=e.e.hc(),r.Fc(n),e.e.d-=n.gc(),n.$b(),r):null}function TRe(e,t){var n,r=e.c[t];if(r!=0)for(e.c[t]=0,e.d-=r,n=t+1;n<e.a.length;)e.a[n]-=r,n+=n&-n}function ERe(e){var t=e.a.c.length;if(t>0)return GO(t-1,e.a.c.length),GM(e.a,t-1);throw k(new cg)}function DRe(e,t,n){if(t<0)throw k(new G_(Tft+t));t<e.j.c.length?wM(e.j,t,n):(pDe(e,t),zT(e.j,n))}function ORe(e,t,n){if(e>t)throw k(new $_(Lq+e+Wot+t));if(e<0||t>n)throw k(new jv(Lq+e+Got+t+Fot+n))}function kRe(e){if(!e.a||!(e.a.i&8))throw k(new ev(`Enumeration class expected for layout option `+e.f))}function ARe(e){ECe.call(this,`The given string does not match the expected format for individual spacings.`,e)}function jRe(){qre.call(this,new PAe(_I(16))),vF(2,zat),this.b=2,this.a=new Mbe(null,null,0,null),rg(this.a,this.a)}function MRe(e){oie(),hT(this),xA(this),this.e=e,r3e(this,e),this.g=e==null?gK:tz(e),this.a=``,this.b=e,this.a=``}function LL(e,t){e.D==null&&e.B!=null&&(e.D=e.B,e.B=null),SF(e,t==null?null:(Wk(t),t)),e.C&&e.fl(null)}function NRe(e,t){var n=e.a.length-1,r;for(e.c=e.c-1&n;t!=e.c;)r=t+1&n,Ek(e.a,t,e.a[r]),t=r;Ek(e.a,e.c,null)}function PRe(e,t){for(var n=e.a.length-1,r;t!=e.b;)r=t-1&n,Ek(e.a,t,e.a[r]),t=r;Ek(e.a,e.b,null),e.b=e.b+1&n}function FRe(e,t,n){var r,i;return uj(t,e.c.length),r=n.Nc(),i=r.length,i==0?!1:(Qhe(e.c,t,r),!0)}function IRe(e){var t=(!e.a&&(e.a=new L(R7,e,9,5)),e.a);return t.i==0?null:boe(I(U(t,0),684))}function LRe(e,t){var n=VR(e,t);return Yb(_Te(e,t),0)|WC(_Te(e,n),0)?n:VR(PK,_Te(VO(n,63),1))}function RRe(e,t){var n=lB((Tz(),x4))!=null&&t.Rg()!=null?A(F(t.Rg()))/A(F(lB(x4))):1;Yk(e.b,t,n)}function RL(e){var t;++e.j,e.i==0?e.g=null:e.i<e.g.length&&(t=e.g,e.g=e.$i(e.i),RW(t,0,e.g,0,e.i))}function zL(e){return(e.c!=e.b.b||e.i!=e.g.b)&&(_g(e.a.c,0),UI(e.a,e.b),UI(e.a,e.g),e.c=e.b.b,e.i=e.g.b),e.a}function zRe(e){var t,n;if(e==null)return null;for(t=0,n=e.length;t<n;t++)if(!xge(e[t]))return e[t];return null}function BRe(e,t,n){var r,i,a,o;for(i=n,a=0,o=i.length;a<o;++a)if(r=i[a],e.b.ze(t,r.jd()))return r;return null}function BL(e){var t,n,r,i,a=1;for(n=e,r=0,i=n.length;r<i;++r)t=n[r],a=31*a+(t==null?0:zF(t)),a|=0;return a}function VL(e){var t={},n,r,i,a;for(r=e,i=0,a=r.length;i<a;++i)n=r[i],t[`:`+(n.f==null?``+n.g:n.f)]=n;return t}function VRe(e){var t;for(Sk(e),ape(!0,`numberToAdvance must be nonnegative`),t=0;t<0&&cU(e);t++)IM(e);return t}function HRe(e){var t,n,r=0;for(n=new RO(sE(e.a.Jc(),new f));cU(n);)t=I(IM(n),17),t.c.i==t.d.i||++r;return r}function URe(e,t){var n=e,r,i=0;do{if(n==t)return i;if(r=n.e,!r)throw k(new lg);n=Uk(r),++i}while(!0)}function WRe(e,t){var n,r,i=t-e.f;for(r=new O(e.d);r.a<r.c.c.length;)n=I(V(r),320),cHe(n,n.e,n.f+i);e.f=t}function HL(e,t){return!e||t&&!e.j||P(e,127)&&I(e,127).a.b==0?0:e.ff()}function UL(e,t){return!e||t&&!e.k||P(e,127)&&I(e,127).a.a==0?0:e.gf()}function WL(e){switch(e.c){case 0:return n_e(),Wgt;case 1:return new Qh(NQe(new ib(e)));default:return new Jre(e)}}function GRe(e){switch(e.gc()){case 0:return n_e(),Wgt;case 1:return new Qh(e.Jc().Pb());default:return new Eoe(e)}}function KRe(e,t){var n;for(n=0;n<t.length;n++)if(e==(xj(n,t.length),t.charCodeAt(n)))return!0;return!1}function qRe(e,t){return t<e.length&&(xj(t,e.length),e.charCodeAt(t)!=63)&&(xj(t,e.length),e.charCodeAt(t)!=35)}function JRe(e,t,n,r){var i,a;e.a=t,a=+!r,e.f=(i=new ZXe(e.c,e.a,n,a),new S6e(n,e.a,i,e.e,e.b,e.c==(XL(),G4)))}function GL(e,t){var n,r=e.Wk(t,null),i=null;t&&(i=(vy(),n=new Yh,n),LP(i,e.r)),r=ZV(e,i,r),r&&r.mj()}function YRe(e,t){var n,r=SU(e.d,1)!=0;for(n=!0;n;)n=!1,n=t.c.kg(t.e,r),n|=IU(e,t,r,!1),r=!r;aFe(e)}function XRe(e,t){var n,i,a,o,s,c,l=t.i,u=t.j;return i=e.f,a=i.i,o=i.j,s=l-a,c=u-o,n=r.Math.sqrt(s*s+c*c),n}function ZRe(e,t){var n,r=!1,i;return n=t.q.d,t.d<e.b&&(i=n4e(t.q,e.b),t.q.d>i&&(Yqe(t.q,i),r=n!=t.q.d)),r}function QRe(e,t){var n;for(n=0;n<t.length;n++)if(e==(xj(n,t.length),t.charCodeAt(n)))return!0;return!1}function $Re(e){var t,n;for(n=new O(e.r);n.a<n.c.c.length;)if(t=I(V(n),9),e.n[t.p]<=0)return t;return null}function eze(e){var t=new BMe(e);return Nj(e.a,Rbt,new sv(W(j(C$,1),hK,377,0,[t]))),t.d&&zT(t.f,t.d),t.f}function tze(e,t){var n,r=Jz(e);return r||(!eBt&&(eBt=new Cl),n=(hG(),b0e(t)),r=new Yne(n),gN(r.Cl(),e)),r}function nze(e){var t,n;if(e==null)return!1;for(t=0,n=e.length;t<n;t++)if(!xge(e[t]))return!1;return!0}function rze(e){var t;if(!(e.c.c<0?e.a>=e.c.b:e.a<=e.c.b))throw k(new pg);return t=e.a,e.a+=e.c.c,++e.b,K(t)}function KL(e,t){var n=I(e.c.Ac(t),18),r;return n?(r=e.hc(),r.Fc(n),e.d-=n.gc(),n.$b(),e.mc(r)):e.jc()}function ize(e,t){Sk(e);try{return e.Ac(t)}catch(e){if(e=GI(e),P(e,211)||P(e,172))return null;throw k(e)}}function qL(e,t){Sk(e);try{return e.xc(t)}catch(e){if(e=GI(e),P(e,211)||P(e,172))return null;throw k(e)}}function JL(e,t){var n;return _w(e)&&_w(t)&&(n=e-t,!isNaN(n))?n:IKe(_w(e)?TI(e):e,_w(t)?TI(t):t)}function YL(e,t,n){return r.Math.abs(t-e)<qY||r.Math.abs(n-e)<qY?!0:t-e>qY?e-n>qY:n-e>qY}function aze(e){throw tL(),k(new M_(`Unexpected typeof result '`+e+`'; please report this bug to the GWT team`))}function oze(){this.a=new Js,this.f=new Zte(this),this.b=new Qte(this),this.i=new $te(this),this.e=new ene(this)}function XL(){XL=E,U4=new pS(`BARYCENTER`,0),G4=new pS(oct,1),K4=new pS(sct,2),W4=new pS(`MEDIAN`,3)}function ZL(){ZL=E,dkt=new nS(`DUMMY_NODE_OVER`,0),fkt=new nS(`DUMMY_NODE_UNDER`,1),C4=new nS(`EQUAL`,2)}function QL(){QL=E,T8=new eC(dpt,0),w8=new eC(`CONTAINER`,1),SRt=new eC(`PARENT`,2),CRt=new eC(`ROOT`,3)}function sze(e,t,n){var r=new B$e(e,t);XH(e.r,t.$f(),r),n&&!lk(e.u)&&(r.c=new wCe(e.d),AP(t.Pf(),new qee(r)))}function $L(e){var t=new mT(e.a);return EI(t,e),G(t,(X(),N0),e),t.o.a=e.g,t.o.b=e.f,t.n.a=e.i,t.n.b=e.j,t}function eR(e){var t;return VE(e.a!=e.b),t=e.d.a[e.a],mue(e.b==e.d.c&&t!=null),e.c=e.a,e.a=e.a+1&e.d.a.length-1,t}function cze(e){var t;if(e.c!=0)return e.c;for(t=0;t<e.a.length;t++)e.c=e.c*33+(e.a[t]&-1);return e.c*=e.e,e.c}function lze(e){var t,n,r,i=new Sg;for(r=new O(e);r.a<r.c.c.length;)n=I(V(r),26),t=z3e(n),qF(i,t);return i}function uze(e,t,n){var r,i;for(i=t.a.a.ec().Jc();i.Ob();)if(r=I(i.Pb(),60),ySe(e,r,n))return!0;return!1}function dze(e,t,n,r){var i,a;for(a=e.Jc();a.Ob();)i=I(a.Pb(),70),i.n.a=t.a+(r.a-i.o.a)/2,i.n.b=t.b,t.b+=i.o.b+n}function fze(e,t,n){var r,i=e.a;return e.a=t,e.Db&4&&!(e.Db&1)&&(r=new YO(e,1,1,i,t),n?n.lj(r):n=r),n}function tR(e,t){var n,r,i,a=(i=e?Jz(e):null,aQe((r=t,i&&i.El(),r)));return a==t&&(n=Jz(e),n&&n.El()),a}function pze(e,t,n){var r,i=e.b;return e.b=t,e.Db&4&&!(e.Db&1)&&(r=new YO(e,1,3,i,t),n?n.lj(r):n=r),n}function mze(e,t,n){var r,i=e.f;return e.f=t,e.Db&4&&!(e.Db&1)&&(r=new YO(e,1,0,i,t),n?n.lj(r):n=r),n}function hze(e,t){var n,r,i=1;for(n=e,r=t>=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,--r);return t<0?1/i:i}function gze(e,t){var n,r,i=1;for(n=e,r=t>=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,--r);return t<0?1/i:i}function _ze(e){var t,n,r,i;if(e!=null){for(n=0;n<e.length;++n)if(t=e[n],t)for(I(t.g,374),i=t.i,r=0;r<i;++r);}}function vze(e){var t=Aw(wAt);return I(q(e,(X(),b0)),22).Gc((XU(),Z1))&&oO(t,(iH(),b$),(eK(),o1)),t}function nR(e){return(RG(),T5).Gc(e.j)?A(F(q(e,(X(),W0)))):uL(W(j(T6,1),kK,8,0,[e.i.n,e.n,e.a])).b}function yze(e,t){var n=new LB(e);return Dp(n,(vU(),I$)),G(n,(X(),N0),t),G(n,(XG(),Z2),(HV(),t5)),n}function bze(e,t,n){var r,i;for(i=e.Jc();i.Ob();){if(r=I(i.Pb(),9),r==t)return-1;if(r==n)return 1}return 0}function xze(e,t,n){var r=n/e.gc(),i=0,a,o;for(o=e.Jc();o.Ob();)a=I(o.Pb(),186),WRe(a,a.f+r*i),nqe(a,t,r),++i}function Sze(e){var t,n,r;for(r=new O(e.b);r.a<r.c.c.length;)n=I(V(r),218),t=n.c.ig()?n.f:n.a,t&&xet(t,n.j)}function Cze(e){var t,n,i=0;for(n=new O(e.a);n.a<n.c.c.length;)t=I(V(n),173),i=r.Math.max(i,t.g);return i}function wze(e){switch(e.g){case 0:return new Us;case 1:return new Gs;case 2:return new Ws;default:return null}}function Tze(e,t){switch(t){case 1:!e.n&&(e.n=new L(f7,e,1,7)),bG(e.n);return;case 2:xF(e,null);return}iLe(e,t)}function Eze(e,t){Sk(e);try{return e._b(t)}catch(e){if(e=GI(e),P(e,211)||P(e,172))return!1;throw k(e)}}function Dze(e,t){Sk(e);try{return e.Gc(t)}catch(e){if(e=GI(e),P(e,211)||P(e,172))return!1;throw k(e)}}function Oze(e,t){Sk(e);try{return e.Kc(t)}catch(e){if(e=GI(e),P(e,211)||P(e,172))return!1;throw k(e)}}function kze(e,t){var n;e.a.c.length>0&&(n=I(dO(e.a,e.a.c.length-1),565),aRe(n,t))||zT(e.a,new VOe(t))}function Aze(e,t){var n;e.c.length!=0&&(n=I(Qz(e,H(M$,KJ,9,e.c.length,0,1)),199),xw(n,new wn),b$e(n,t))}function jze(e,t){var n;e.c.length!=0&&(n=I(Qz(e,H(M$,KJ,9,e.c.length,0,1)),199),xw(n,new Tn),b$e(n,t))}function Mze(e,t,n,r,i){t==0||r==0||(t==1?i[r]=dWe(i,n,r,e[0]):r==1?i[t]=dWe(i,e,t,n[0]):l1e(e,n,i,t,r))}function K(e){var t,n;return e>-129&&e<128?(Qge(),t=e+128,n=d_t[t],!n&&(n=d_t[t]=new Qp(e)),n):new Qp(e)}function rR(e){var t,n;return e>-129&&e<128?(o_e(),t=e+128,n=v_t[t],!n&&(n=v_t[t]=new nm(e)),n):new nm(e)}function Nze(e){var t=new Ov;return t.a+=`VerticalSegment `,XC(t,e.e),t.a+=` `,ZC(t,$T(new vv,new O(e.k))),t.a}function Pze(e){RD();var t=e.d.c-e.e.c,n=I(e.g,156);AP(n.b,new gte(t)),AP(n.c,new rh(t)),TM(n.i,new ih(t))}function Fze(e,t){var n;e.c=t,e.a=TVe(t),e.a<54&&(e.f=(n=t.d>1?dEe(t.a[0],t.a[1]):dEe(t.a[0],0),Bj(t.e>0?n:zN(n))))}function iR(e,t){var n=0,r,i;for(i=LR(e,t).Jc();i.Ob();)r=I(i.Pb(),12),n+=q(r,(X(),F0))==null?0:1;return n}function aR(e,t,n){var r=0,i,a;for(a=sB(e,0);a.b!=a.d.c&&(i=A(F(Xj(a))),!(i>n));)i>=t&&++r;return r}function Ize(e,t,n){var r,i=e.sb;return e.sb=t,e.Db&4&&!(e.Db&1)&&(r=new YO(e,1,4,i,t),n?n.lj(r):n=r),n}function Lze(e){var t=I(sP(e.c.c,``),233);return t||(t=new mj(ty(ey(new dc,``),`Other`)),tB(e.c.c,``,t)),t}function oR(e){var t;return e.Db&64?pU(e):(t=new dE(pU(e)),t.a+=` (name: `,JC(t,e.zb),t.a+=`)`,t.a)}function Rze(e,t,n){var r,i=e.r;return e.r=t,e.Db&4&&!(e.Db&1)&&(r=new YO(e,1,8,i,e.r),n?n.lj(r):n=r),n}function zze(e,t,n){var r=new QN(e.e,4,13,(i=t.c,i||(rK(),e9)),null,DB(e,t),!1),i;return n?n.lj(r):n=r,n}function Bze(e,t,n){var r=new QN(e.e,3,13,null,(i=t.c,i||(rK(),e9)),DB(e,t),!1),i;return n?n.lj(r):n=r,n}function sR(e,t){var n=I(t,681),r=n.cl();return!r&&n.dl(r=P(t,88)?new Ase(e,I(t,29)):new tEe(e,I(t,159))),r}function cR(e,t,n){var r;e.Zi(e.i+1),r=e.Xi(t,n),t!=e.i&&RW(e.g,t,e.g,t+1,e.i-t),Ek(e.g,t,r),++e.i,e.Ki(t,n),e.Li()}function Vze(e,t,n,r,i,a,o,s){for(var c=n;a<o;)c>=r||t<n&&s.Le(e[t],e[c])<=0?Ek(i,a++,e[t++]):Ek(i,a++,e[c++])}function Hze(e,t){var n,r,i,a;if(t.cj(e.a),a=I(xI(e.a,8),2e3),a!=null)for(n=a,r=0,i=n.length;r<i;++r)null.Sm()}function Uze(e,t){var n;return t.a&&(n=t.a.a.length,e.a?ZC(e.a,e.b):e.a=new fE(e.d),gEe(e.a,t.a,t.d.length,n)),e}function lR(e,t){var n=new Ee;return e.a.zd(n)?(rE(),new P_(Wk(Uje(e,n.a,t)))):(zk(e),rE(),rE(),q_t)}function Wze(e){var t;return JL(e,0)<0&&(e=hI(qve(_w(e)?TI(e):e))),t=TO(VO(e,32)),64-(t==0?ZH(TO(e))+32:ZH(t))}function uR(e,t){return FC(e)?TD(e,t):PC(e)?Dfe(e,t):NC(e)?(Wk(e),N(e)===N(t)):Cve(e)?e.Fb(t):B_e(e)?nce(e,t):DTe(e,t)}function Gze(e){return e?e.i&1?e==J9?bQ:e==q9?TQ:e==Q9?wQ:e==Z9?CQ:e==Y9?EQ:e==$9?DQ:e==X9?xQ:SQ:e:null}function dR(e,t){switch(t.g){case 2:case 1:return LR(e,t);case 3:case 4:return pz(LR(e,t))}return _A(),_A(),IQ}function Kze(e,t,n,r){switch(t){case 1:return!e.n&&(e.n=new L(f7,e,1,7)),e.n;case 2:return e.k}return NGe(e,t,n,r)}function fR(e,t,n){if(t<0)IQe(e,n);else{if(!n.pk())throw k(new $_(PX+n.ve()+FX));I(n,69).uk().Ck(e,e.ei(),t)}}function qze(e,t,n){if(e<0||t>n)throw k(new G_(Lq+e+Got+t+`, size: `+n));if(e>t)throw k(new $_(Lq+e+Wot+t))}function pR(e,t){var n=(e.Bb&256)!=0;t?e.Bb|=256:e.Bb&=-257,e.Db&4&&!(e.Db&1)&&pI(e,new PM(e,1,2,n,t))}function mR(e,t){var n=(e.Bb&512)!=0;t?e.Bb|=512:e.Bb&=-513,e.Db&4&&!(e.Db&1)&&pI(e,new PM(e,1,3,n,t))}function Jze(e,t){var n=(e.Bb&256)!=0;t?e.Bb|=256:e.Bb&=-257,e.Db&4&&!(e.Db&1)&&pI(e,new PM(e,1,8,n,t))}function Yze(e,t){var n=(e.Bb&512)!=0;t?e.Bb|=512:e.Bb&=-513,e.Db&4&&!(e.Db&1)&&pI(e,new PM(e,1,9,n,t))}function Xze(e){var t;return e.Db&64?pU(e):(t=new dE(pU(e)),t.a+=` (source: `,JC(t,e.d),t.a+=`)`,t.a)}function hR(e,t){var n=(e.Bb&256)!=0;t?e.Bb|=256:e.Bb&=-257,e.Db&4&&!(e.Db&1)&&pI(e,new PM(e,1,8,n,t))}function Zze(e,t,n){var r,i=e.a;return e.a=t,e.Db&4&&!(e.Db&1)&&(r=new YO(e,1,5,i,e.a),n?hJe(n,r):n=r),n}function gR(e,t){var n;return e.b==-1&&e.a&&(n=e.a.nk(),e.b=n?e.c.Eh(e.a.Jj(),n):hz(e.c.Ah(),e.a)),e.c.vh(e.b,t)}function Qze(e,t){var n,r;for(r=new XT(e);r.e!=r.i.gc();)if(n=I(uB(r),29),N(t)===N(n))return!0;return!1}function $ze(e){nK();var t,n,r,i;for(n=nB(),r=0,i=n.length;r<i;++r)if(t=n[r],HN(t.a,e,0)!=-1)return t;return ryt}function eBe(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e>=48&&e<=57?e-48:0}function tBe(e){return e-=e>>1&1431655765,e=(e>>2&858993459)+(e&858993459),e=(e>>4)+e&252645135,e+=e>>8,e+=e>>16,e&63}function nBe(e){var t=e.k,n;return t==(vU(),P$)?(n=I(q(e,(X(),v0)),64),n==(RG(),m5)||n==j5):!1}function rBe(e){var t=AEe(e);return UC(t.a,0)?(ob(),ob(),J_t):(ob(),new HE(Jb(t.a,0)?xke(t)/Bj(t.a):0))}function iBe(e,t){var n=FU(e,t);if(P(n,335))return I(n,38);throw k(new $_(PX+t+`' is not a valid attribute`))}function _R(e,t,n){var r=e.gc();if(t>r)throw k(new wD(t,r));if(e.Qi()&&e.Gc(n))throw k(new $_(tZ));e.Ei(t,n)}function aBe(e,t){var n,r;for(r=new XT(e);r.e!=r.i.gc();)if(n=I(uB(r),143),N(t)===N(n))return!0;return!1}function oBe(e,t,n){var r,i,a=(i=hU(e.b,t),i);return a&&(r=I(pG(GN(e,a),``),29),r)?x0e(e,r,t,n):null}function vR(e,t,n){var r,i,a=(i=hU(e.b,t),i);return a&&(r=I(pG(GN(e,a),``),29),r)?S0e(e,r,t,n):null}function sBe(e){var t,n,r=0;for(n=e.length,t=0;t<n;t++)e[t]==32||e[t]==13||e[t]==10||e[t]==9||(e[r++]=e[t]);return r}function cBe(e){var t=e.a[e.c-1&e.a.length-1];return t==null?null:(e.c=e.c-1&e.a.length-1,Ek(e.a,e.c,null),t)}function lBe(e){var t,n;for(n=e.p.a.ec().Jc();n.Ob();)if(t=I(n.Pb(),217),t.f&&e.b[t.c]<-1e-10)return t;return null}function uBe(e,t){switch(e.b.g){case 0:case 1:return t;case 2:case 3:return new fA(t.d,0,t.a,t.b);default:return null}}function yR(e,t){return e<t?-1:e>t?1:e==t?e==0?yR(1/e,1/t):0:isNaN(e)?+!isNaN(t):-1}function dBe(e,t){t.Tg(`Sort end labels`,1),hb(oA(lP(new mO(null,new yj(e.b,16)),new ln),new eee),new un),t.Ug()}function bR(){bR=E,x8=new $S(Yq,0),b8=new $S(qq,1),y8=new $S(Kq,2),v8=new $S(vst,3),S8=new $S(`UP`,4)}function xR(){xR=E,_zt=new mC(`PARALLEL_NODE`,0),Y5=new mC(`HIERARCHICAL_NODE`,1),X5=new mC(`ROOT_NODE`,2)}function SR(){SR=E,i6=new HS(`P1_STRUCTURE`,0),a6=new HS(`P2_PROCESSING_ORDER`,1),o6=new HS(`P3_EXECUTION`,2)}function CR(){CR=E,dFt=new BS(`EQUAL_BETWEEN_STRUCTURES`,0),pFt=new BS(`TO_ASPECT_RATIO`,1),fFt=new BS(BJ,2)}function wR(){wR=E,ORt=new nC(Yq,0),A8=new nC(`POLYLINE`,1),k8=new nC(`ORTHOGONAL`,2),j8=new nC(`SPLINES`,3)}function fBe(){fBe=E,UMt=Hz(Hz(Lb(Hz(Hz(Lb(oO(new Hk,(dV(),c3),(yW(),kjt)),l3),Tjt),Djt),u3),xjt),Ojt)}function pBe(e){switch(I(q(e,(X(),S0)),316).g){case 1:G(e,S0,(dP(),i0));break;case 2:G(e,S0,(dP(),o0))}}function mBe(e){switch(e){case 0:return new Mre;case 1:return new Yg;case 2:return new Xg;default:throw k(new lg)}}function hBe(e){switch(e.g){case 2:return b8;case 1:return y8;case 4:return v8;case 3:return S8;default:return x8}}function gBe(e){switch(e.g){case 1:return N5;case 2:return m5;case 3:return p5;case 4:return j5;default:return M5}}function TR(e){switch(e.g){case 1:return j5;case 2:return N5;case 3:return m5;case 4:return p5;default:return M5}}function ER(e){switch(e.g){case 1:return p5;case 2:return j5;case 3:return N5;case 4:return m5;default:return M5}}function DR(e,t,n){var r,i;return e.Nj()?(i=e.Oj(),r=YH(e,t,n),e.Hj(e.Gj(7,K(n),r,t,i)),r):YH(e,t,n)}function OR(e,t){var n,r,i;e.d==null?(++e.e,--e.f):(i=t.jd(),n=t.yi(),r=(n&uK)%e.d.length,Vke(e,r,N0e(e,r,n,i)))}function kR(e,t){var n=(e.Bb&mZ)!=0;t?e.Bb|=mZ:e.Bb&=-8193,e.Db&4&&!(e.Db&1)&&pI(e,new PM(e,1,15,n,t))}function AR(e,t){var n=(e.Bb&fZ)!=0;t?e.Bb|=fZ:e.Bb&=-1025,e.Db&4&&!(e.Db&1)&&pI(e,new PM(e,1,10,n,t))}function jR(e,t){var n=(e.Bb&xq)!=0;t?e.Bb|=xq:e.Bb&=-4097,e.Db&4&&!(e.Db&1)&&pI(e,new PM(e,1,12,n,t))}function MR(e,t){var n=(e.Bb&RX)!=0;t?e.Bb|=RX:e.Bb&=-2049,e.Db&4&&!(e.Db&1)&&pI(e,new PM(e,1,11,n,t))}function _Be(e,t){var n=yR(e.b.c,t.b.c);return n!=0||(n=yR(e.a.a,t.a.a),n!=0)?n:yR(e.a.b,t.a.b)}function vBe(e){var t,n=Nk(new Ov,91);for(t=!0;e.Ob();)t||(n.a+=mK),t=!1,XC(n,e.Pb());return(n.a+=`]`,n).a}function yBe(e){var t=new Kh,n,r;for(r=new O(e.b);r.a<r.c.c.length;)n=I(V(r),592),UI(t,I(n.Af(),18));return t}function NR(e,t){var n,r;for(r=new O(t);r.a<r.c.c.length;)n=I(V(r),49),VN(e.b.b,n.b),vSe(I(n.a,194),I(n.b,82))}function bBe(e){var t,n;for(n=w0e(RP(e)).Jc();n.Ob();)if(t=QE(n.Pb()),jW(e,t))return tOe((foe(),ABt),t);return null}function xBe(e,t,n){var r,i;for(i=e.a.ec().Jc();i.Ob();)if(r=I(i.Pb(),9),WI(n,I(dO(t,r.p),18)))return r;return null}function SBe(e,t,n){var r,i=P(t,103)&&(I(t,19).Bb&Cq)!=0?new cw(t,e):new DI(t,e);for(r=0;r<n;++r)CB(i);return i}function CBe(e,t){var n,r,i,a,o=HU(e.e.Ah(),t);for(a=0,n=I(e.g,122),i=0;i<e.i;++i)r=n[i],o.$l(r.Jk())&&++a;return a}function PR(e){var t,n=I(q(e,(XG(),b2)),86);return n==(bR(),x8)?(t=A(F(q(e,r2))),t>=1?b8:v8):n}function wBe(e){switch(I(q(e,(XG(),T2)),222).g){case 1:return new Xi;case 3:return new ta;default:return new Yi}}function FR(e){if(e.c)FR(e.c);else if(e.d)throw k(new ev(`Stream already terminated, can't be modified or used`))}function TBe(e){var t;if(!e.a)throw k(new ev(`Cannot offset an unassigned cut.`));t=e.c-e.b,e.b+=t,Xxe(e,t),Zxe(e,t)}function EBe(e,t,n){var r,i;if(e.c)OYe(e.c,t,n);else for(i=new O(e.b);i.a<i.c.c.length;)r=I(V(i),167),EBe(r,t,n)}function DBe(e,t){var n,r,i;for(Wk(t),n=!1,r=new O(e);r.a<r.c.c.length;)i=V(r),t.Gc(i)&&(uk(r),n=!0);return n}function IR(e,t,n){var r=e.a.get(t);return e.a.set(t,n===void 0?null:n),r===void 0?(++e.c,++e.b.g):++e.d,r}function OBe(e,t,n){var r=I(t.mf(e.a),35),i=I(n.mf(e.a),35);return r!=null&&i!=null?iI(r,i):r==null?i==null?0:1:-1}function LR(e,t){var n;return e.i||FQe(e),n=I(Zk(e.g,t),49),n?new vj(e.j,I(n.a,15).a,I(n.b,15).a):(_A(),_A(),IQ)}function RR(e,t){this.e=t,this.a=Wze(e),this.a<54?this.f=Bj(e):this.c=(mW(),JL(e,0)>=0?wz(e):mk(wz(zN(e))))}function kBe(e,t,n,r,i,a){this.e=new Kh,this.f=(dF(),R4),zT(this.e,e),this.d=t,this.a=n,this.b=r,this.f=i,this.c=a}function ABe(e,t,n,r,i){Gce(this),this.b=e,this.d=H(M$,KJ,9,t.a.c.length,0,1),this.f=n,Qz(t.a,this.d),this.g=r,this.c=i}function jBe(e,t,n){var r=n;!r&&(r=wge(new p_,0)),r.Tg(Ust,2),oWe(e.b,t,r.dh(1)),ttt(e,t,r.dh(1)),Xrt(t,r.dh(1)),r.Ug()}function MBe(e,t,n){var r=0;return t&&(Pw(e.a)?r+=t.f.a/2:r+=t.f.b/2),n&&(Pw(e.a)?r+=n.f.a/2:r+=n.f.b/2),r}function NBe(e,t,n){var r=(hy(),i=new Qc,i),i;return UP(r,t),WP(r,n),e&&gN((!e.a&&(e.a=new UT(e7,e,5)),e.a),r),r}function zR(e){var t;return e.Db&64?pU(e):(t=new dE(pU(e)),t.a+=` (identifier: `,JC(t,e.k),t.a+=`)`,t.a)}function BR(e){var t;switch(e.gc()){case 0:return lO(),Hgt;case 1:return new uD(Sk(e.Xb(0)));default:return t=e,new gTe(t)}}function VR(e,t){var n;return _w(e)&&_w(t)&&(n=e+t,gq<n&&n<mq)?n:hI(YIe(_w(e)?TI(e):e,_w(t)?TI(t):t))}function HR(e,t){var n;return _w(e)&&_w(t)&&(n=e*t,gq<n&&n<mq)?n:hI(Ret(_w(e)?TI(e):e,_w(t)?TI(t):t))}function UR(e,t){var n;return _w(e)&&_w(t)&&(n=e-t,gq<n&&n<mq)?n:hI(XIe(_w(e)?TI(e):e,_w(t)?TI(t):t))}function PBe(e,t,n){var r;try{RLe(e,t,n)}catch(e){throw e=GI(e),P(e,596)?(r=e,k(new oke(r))):k(e)}return t}function FBe(e){var t=H(K9,rq,30,2,15,1);return e-=Cq,t[0]=(e>>10)+wq&aq,t[1]=(e&1023)+56320&aq,Lz(t,0,t.length)}function WR(e){var t=new Kh,n,r;for(r=new O(e.j);r.a<r.c.c.length;)n=I(V(r),12),zT(t,n.e);return Sk(t),new lw(t)}function GR(e){var t=new Kh,n,r;for(r=new O(e.j);r.a<r.c.c.length;)n=I(V(r),12),zT(t,n.b);return Sk(t),new lw(t)}function KR(e){var t=new Kh,n,r;for(r=new O(e.j);r.a<r.c.c.length;)n=I(V(r),12),zT(t,n.g);return Sk(t),new lw(t)}function IBe(e){var t=fH(e);return t>34028234663852886e22?yq:t<-34028234663852886e22?bq:t}function qR(e,t){var n=(e.Bb&AK)!=0;t?e.Bb|=AK:e.Bb&=-16385,e.Db&4&&!(e.Db&1)&&pI(e,new PM(e,1,16,n,t))}function JR(e,t){var n=(e.Bb&IX)!=0;t?e.Bb|=IX:e.Bb&=-32769,e.Db&4&&!(e.Db&1)&&pI(e,new PM(e,1,18,n,t))}function LBe(e,t){var n=(e.Bb&IX)!=0;t?e.Bb|=IX:e.Bb&=-32769,e.Db&4&&!(e.Db&1)&&pI(e,new PM(e,1,18,n,t))}function RBe(e,t){var n=(e.Bb&Cq)!=0;t?e.Bb|=Cq:e.Bb&=-65537,e.Db&4&&!(e.Db&1)&&pI(e,new PM(e,1,20,n,t))}function zBe(e,t){e.n.c.length==0&&zT(e.n,new YA(e.s,e.t,e.i)),zT(e.b,t),HWe(I(dO(e.n,e.n.c.length-1),208),t),B7e(e,t)}function BBe(e,t,n){var r;n.Tg(`Straight Line Edge Routing`,1),n.bh(t,_dt),r=I(Y(t,(sD(),M3)),26),z9e(e,r),n.bh(t,iX)}function VBe(e){var t,n;for(n=I1e(RP(rj(e))).Jc();n.Ob();)if(t=QE(n.Pb()),jW(e,t))return nOe((poe(),jBt),t);return null}function HBe(e){var t=new Pde(e.Pd().gc()),n,r,i=0;for(r=EN(e.Pd().Jc());r.Ob();)n=r.Pb(),zxe(t,n,K(i++));return FXe(t.a)}function YR(e){var t,n=(t=I(by((r=e.Pm,i=r.f,i==fQ?r:i)),10),new MD(t,I(mD(t,t.length),10),0)),r,i;return OF(n,e),n}function UBe(e){var t,n,r;for(n=0,r=e.length;n<r;n++)if(e[n]==null)throw k(new tv(`at index `+n));return t=e,new sv(t)}function XR(){XR=E,fPt=new LS(`ASPECT_RATIO_DRIVEN`,0),pPt=new LS(`MAX_SCALE_DRIVEN`,1),dPt=new LS(`AREA_DRIVEN`,2)}function ZR(){JJe();var e,t,n=Q_t+++Date.now();e=GA(r.Math.floor(n*Nq))&Pq,t=GA(n-e*Pot),this.a=e^1502,this.b=t^Not}function WBe(e){return DL(),hE(),!!(ZBe(I(e.a,82).j,I(e.b,86))||I(e.a,82).d.e!=0&&ZBe(I(e.a,82).j,I(e.b,86)))}function QR(e,t){var n,r,i=0;for(r=I(t.Kb(e),20).Jc();r.Ob();)n=I(r.Pb(),17),nv(ZE(q(n,(X(),z0))))||++i;return i}function GBe(e,t){var n,i=A(F(Mz(Cj(t),(XG(),o4))));n=r.Math.max(0,i/2-.5),xV(t,n,1),zT(e,new Ax(t,n))}function KBe(e,t){for(var n=sB(e,0),r;n.b!=n.d.c;){if(r=rv(F(Xj(n))),r==t)return;if(r>t){lEe(n);break}}hk(n,t)}function $R(e,t){var n=t.f,r,i,a,o;if(tB(e.c.d,n,t),t.g!=null)for(i=t.g,a=0,o=i.length;a<o;++a)r=i[a],tB(e.c.e,r,t)}function qBe(e,t,n,r){var i,a,o;for(i=t+1;i<n;++i)for(a=i;a>t&&r.Le(e[a-1],e[a])>0;--a)o=e[a],Ek(e,a,e[a-1]),Ek(e,a-1,o)}function ez(e,t,n,r){if(t<0)g2e(e,n,r);else{if(!n.pk())throw k(new $_(PX+n.ve()+FX));I(n,69).uk().Ak(e,e.ei(),t,r)}}function JBe(e,t){var n=FU(e.Ah(),t);if(P(n,103))return I(n,19);throw k(new $_(PX+t+`' is not a valid reference`))}function tz(e){var t;return Array.isArray(e)&&e.Rm===T?Ey(EL(e))+`@`+(t=zF(e)>>>0,t.toString(16)):e.toString()}function YBe(e,t){return e.h==fq&&e.m==0&&e.l==0?(t&&(_Q=dT(0,0,0)),mw((pP(),a_t))):(t&&(_Q=dT(e.l,e.m,e.h)),dT(0,0,0))}function XBe(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function ZBe(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function QBe(e,t,n,r){switch(t){case 3:return e.f;case 4:return e.g;case 5:return e.i;case 6:return e.j}return Kze(e,t,n,r)}function $Be(e,t,n){switch(t.g){case 1:e.b-=n.b/2;break;case 3:e.b+=n.b/2;break;case 4:e.a-=n.a/2;break;case 2:e.a+=n.a/2}}function eVe(e,t){return TD(t.b&&t.c?jj(t.b)+`->`+jj(t.c):`e_`+zF(t),e.b&&e.c?jj(e.b)+`->`+jj(e.c):`e_`+zF(e))}function tVe(e,t){return TD(t.b&&t.c?jj(t.b)+`->`+jj(t.c):`e_`+zF(t),e.b&&e.c?jj(e.b)+`->`+jj(e.c):`e_`+zF(e))}function nz(e,t){return $w(),sF(ZK),r.Math.abs(e-t)<=ZK||e==t||isNaN(e)&&isNaN(t)?0:e<t?-1:e>t?1:pD(isNaN(e),isNaN(t))}function rz(e,t){if(t==e.d)return e.e;if(t==e.e)return e.d;throw k(new $_(`Node `+t+` not part of edge `+e))}function nVe(e){return e.e==null?e:(!e.c&&(e.c=new iW((e.f&256)!=0,e.i,e.a,e.d,(e.f&16)!=0,e.j,e.g,null)),e.c)}function rVe(e){return e.k==(vU(),R$)&&AM(new mO(null,new Ck(new RO(sE(KR(e).a.Jc(),new f)))),new Di)}function iz(e){var t;if(e.b){if(iz(e.b),e.b.d!=e.c)throw k(new sg)}else e.d.dc()&&(t=I(e.f.c.xc(e.e),18),t&&(e.d=t))}function iVe(e){cD();var t=e.o.b,n,r,i;for(r=I(I(BM(e.r,(RG(),j5)),22),83).Jc();r.Ob();)n=I(r.Pb(),115),i=n.e,i.b+=t}function aVe(e,t){oD();var n,r=cje(e),i=t,a;for(AN(r,0,r.length,i),n=0;n<r.length;n++)a=vKe(e,r[n],n),n!=a&&DR(e,n,a)}function oVe(e,t){var n,r=$6e(e,t),i=r[r.length-1]/2;for(n=0;n<r.length;n++)if(r[n]>=i)return t.c+n;return t.c+t.b.gc()}function az(e,t,n){var r,i;for(r=0,i=e.length;r<i;r++)if(nL((xj(r,e.length),e.charCodeAt(r)),t,n))return!0;return!1}function sVe(e){var t;return e==null?!0:(t=e.length,t>0&&(xj(t-1,e.length),e.charCodeAt(t-1)==58)&&!az(e,O7,k7))}function oz(e){var t;this.a=(t=I(e.e&&e.e(),10),new MD(t,I(mD(t,t.length),10),0)),this.b=H(sQ,hK,1,this.a.a.length,5,1)}function cVe(e){Tz(),this.c=VM(W(j(TIt,1),hK,830,0,[$Ot])),this.b=new qh,this.a=e,Yk(this.b,x4,1),AP(ekt,new cne(this))}function sz(){sz=E,t2=new Qx(BJ,0),Z0=new Qx(`FIRST`,1),Q0=new Qx(dct,2),$0=new Qx(`LAST`,3),e2=new Qx(fct,4)}function cz(){cz=E,F1=new Lx(`LAYER_SWEEP`,0),BSt=new Lx(`MEDIAN_LAYER_SWEEP`,1),P1=new Lx(mct,2),VSt=new Lx(BJ,3)}function lz(){lz=E,Ozt=new gC(Vut,0),Tzt=new gC(`GROUP_DEC`,1),Dzt=new gC(`GROUP_MIXED`,2),Ezt=new gC(`GROUP_INC`,3)}function lVe(e){var t,n,r,i,a=nYe(e);return n=Zy(e.c),r=!n,r&&(i=new yp,yP(a,`knownLayouters`,i),t=new Ih(i),TM(e.c,t)),a}function uVe(e,t,n,r,i){for(var a,o=i,s;t.b!=t.c;)a=I(pk(t),9),s=I(LR(a,r).Xb(0),12),e.d[s.p]=o++,ng(n.c,s);return o}function dVe(e,t){var n,r=0,i,a,o,s;for(n=0,a=t,o=0,s=a.length;o<s;++o)i=a[o],i>0&&(r+=i,++n);return n>1&&(r+=e.d*(n-1)),r}function fVe(e){var t,n,r=new Ev;for(r.a+=`[`,t=0,n=e.gc();t<n;)JC(r,uE(e.Ti(t))),++t<n&&(r.a+=mK);return r.a+=`]`,r.a}function uz(e){var t,n,r=A(F(e.a.mf(($G(),u8))));for(n=new O(e.a.Qf());n.a<n.c.c.length;)t=I(V(n),685),rit(e,t,r)}function pVe(e){var t,n,r,i;for(t=(e.j??=(LA(),i=Zgt.ke(e),xqe(i)),e.j),n=0,r=t.length;n<r;++n);}function dz(e,t){var n,r;for(r=new O(t);r.a<r.c.c.length;)n=I(V(r),49),zT(e.b.b,I(n.b,82)),VTe(I(n.a,194),I(n.b,82))}function mVe(e,t,n){var r,i=e.a.b;for(r=i.c.length;r<n;r++)DO(i,0,new Ok(e.a));aj(t,I(dO(i,i.c.length-n),25)),e.b[t.p]=n}function hVe(e,t,n,r,i){fj(),BU(Sb(xb(bb(Cb(new Dg,0),i.d.e-e),t),i.d)),BU(Sb(xb(bb(Cb(new Dg,0),n-i.a.e),i.a),r))}function gVe(e,t){var n;return e.d?tk(e.b,t)?I(Dk(e.b,t),43):(n=t.bg(),Yk(e.b,t,n),n):t.bg()}function _Ve(e,t){var n;return N(e)===N(t)?!0:P(t,91)?(n=I(t,91),e.e==n.e&&e.d==n.d&&cOe(e,n.a)):!1}function fz(e){switch(RG(),e.g){case 4:return m5;case 1:return p5;case 3:return j5;case 2:return N5;default:return M5}}function vVe(e,t){switch(t){case 3:return e.f!=0;case 4:return e.g!=0;case 5:return e.i!=0;case 6:return e.j!=0}return gIe(e,t)}function yVe(e){switch(e.g){case 1:return new ys;case 2:return new Mde;default:throw k(new $_(Cdt+(e.f==null?``+e.g:e.f)))}}function bVe(e){switch(e.g){case 0:return new Ds;case 1:return new Os;default:throw k(new $_(Cdt+(e.f==null?``+e.g:e.f)))}}function xVe(e){switch(e.g){case 0:return new Es;case 1:return new ks;default:throw k(new $_(cct+(e.f==null?``+e.g:e.f)))}}function SVe(e){switch(e.g){case 0:return new f_;case 1:return new Zg;default:throw k(new $_(pX+(e.f==null?``+e.g:e.f)))}}function pz(e){var t,n;return P(e,312)?(n=yke(I(e,312)),t=n,t):P(e,432)?I(e,432).a:P(e,59)?new D_(e):new jae(e)}function CVe(e){var t=e.e;function n(e){return!e||e.length==0?``:` `+e.join(`
|
|
26
26
|
`)}return t&&(t.stack||n(e[nq]))}function wVe(e){var t,n;if(e.b)return e.b;for(n=VQ?null:e.d;n;){if(t=VQ?null:n.b,t)return t;n=VQ?null:n.d}return ub(),cvt}function TVe(e){var t,n,r;return e.e==0?0:(t=e.d<<5,n=e.a[e.d-1],e.e<0&&(r=RFe(e),r==e.d-1&&(--n,n|=0)),t-=ZH(n),t)}function EVe(e){var t,n,r;return e<jQ.length?jQ[e]:(n=e>>5,t=e&31,r=H(q9,cq,30,n+1,15,1),r[n]=1<<t,new ik(1,n+1,r))}function DVe(e){var t,n=e.ih(),r;return n?(t=e.Bh(),P(t,174)&&(r=DVe(I(t,174)),r!=null)?r+`.`+n:n):null}function mz(e,t,n){var r,i;for(i=e.Jc();i.Ob();)if(r=i.Pb(),N(t)===N(r)||t!=null&&uR(t,r))return n&&i.Qb(),!0;return!1}function OVe(e,t){var n,r,i=new mN(t.gc()),a;for(r=t.Jc();r.Ob();)n=r.Pb(),a=EW(e,I(n,57)),a&&ng(i.c,a);return i}function kVe(e){var t=new yp,n,r,i;for(i=new lm(e.b.Jc());i.b.Ob();)r=I(i.b.Pb(),690),n=qXe(r),lye(t,t.a.length,n);return t.a}function AVe(e,t,n){var r,i;if(++e.j,n.dc())return!1;for(i=n.Jc();i.Ob();)r=i.Pb(),e.oj(t,e.Xi(t,r)),++t;return!0}function jVe(e,t){var n,r;if(t){for(n=0;n<e.i;++n)if(r=I(e.g[n],373),r.kj(t))return!1;return gN(e,t)}else return!1}function hz(e,t){var n=(e.i??HW(e),e.i),r=t.Jj(),i;if(r!=-1){for(i=n.length;r<i;++r)if(n[r]==t)return r}return-1}function MVe(e){var t,n=I(e.g,679),r,i,a;for(r=e.i-1;r>=0;--r)for(t=n[r],i=0;i<r;++i)if(a=n[i],m7e(e,t,a)){uV(e,r);break}}function NVe(e,t){var n,r,i,a;t&&(i=rF(t,`x`),n=new Dne(e),XP(n.a,(Wk(i),i)),a=rF(t,`y`),r=new One(e),ZP(r.a,(Wk(a),a)))}function PVe(e,t){var n,r,i,a;t&&(i=rF(t,`x`),n=new Fh(e),GP(n.a,(Wk(i),i)),a=rF(t,`y`),r=new Ane(e),KP(r.a,(Wk(a),a)))}function FVe(e,t){var n=I(yM(e,yN(new xe,new be,new we,W(j(UQ,1),Z,130,0,[(ML(),HQ)]))),16);return n.Oc(Bge(n.gc()))}function IVe(e){var t;return!e.c&&(e.c=new Xe),oT(e.d,new Qe),W3e(e),t=N3e(e),hb(new mO(null,new yj(e.d,16)),new Nm(e)),t}function LVe(e,t){t.Tg(`End label post-processing`,1),hb(oA(lP(new mO(null,new yj(e.b,16)),new en),new tn),new nn),t.Ug()}function gz(e,t){switch(t.g){case 1:return VD(e.j,(eI(),$bt));case 2:return VD(e.j,(eI(),txt));default:return _A(),_A(),IQ}}function RVe(e,t){switch(t){case 3:HP(e,0);return;case 4:qP(e,0);return;case 5:JP(e,0);return;case 6:YP(e,0);return}Tze(e,t)}function zVe(e,t){var n,r=new Cm(e.a.$c(t,!0));if(r.a.gc()<=1)throw k(new dg);return n=r.a.ec().Jc(),n.Pb(),I(n.Pb(),40)}function BVe(e,t,n){var r=A(e.p[t.i.p])+A(e.d[t.i.p])+t.n.b+t.a.b;return A(e.p[n.i.p])+A(e.d[n.i.p])+n.n.b+n.a.b-r}function VVe(e,t){var n;return e.i>0&&(t.length<e.i&&(n=nF(EL(t).c,e.i),t=n),RW(e.g,0,t,0,e.i)),t.length>e.i&&Ek(t,e.i,null),t}function _z(e){var t;return e.Db&64?oR(e):(t=new dE(oR(e)),t.a+=` (instanceClassName: `,JC(t,e.D),t.a+=`)`,t.a)}function vz(e){var t,n,r,i=0;for(n=0,r=e.length;n<r;n++)t=(xj(n,e.length),e.charCodeAt(n)),t<64&&(i=Dj(i,zO(1,t)));return i}function yz(e,t){var n,r,i;return e.f>0?(e.Zj(),r=t==null?0:zF(t),i=(r&uK)%e.d.length,n=N0e(e,i,r,t),n!=-1):!1}function bz(e,t){var n,r,i,a=HU(e.e.Ah(),t);for(n=I(e.g,122),i=0;i<e.i;++i)if(r=n[i],a.$l(r.Jk()))return!1;return!0}function HVe(e,t,n,r){var i,a=n-t;if(a<3)for(;a<3;)e*=10,++a;else{for(i=1;a>3;)i*=10,--a;e=(e+(i>>1))/i|0}return r.i=e,!0}function UVe(e,t,n){var r=Ej(n,Eq),i;for(i=0;JL(r,0)!=0&&i<t;i++)r=VR(r,Ej(e[i],Eq)),e[i]=TO(r),r=BO(r,32);return TO(r)}function xz(e,t){Zw();var n=vD((Sv(),Sv(),hQ)),r=null;return t==n&&(r=I(WA(Qgt,e),616)),r||(r=new Jye(e),t==n&&cj(Qgt,e,r)),r}function WVe(e){cD();var t=new Dw(I(e.e.mf(($G(),Z6)),8));return e.B.Gc((TW(),U5))&&(t.a<=0&&(t.a=20),t.b<=0&&(t.b=20)),t}function GVe(e){DN(),I(e.mf(($G(),Q6)),182).Gc((TW(),q5))&&(I(e.mf(i8),182).Ec((VH(),d5)),I(e.mf(Q6),182).Kc(q5))}function KVe(e){var t=e.d==(OH(),O1),n=fJe(e);t&&!n||!t&&n?G(e.a,(XG(),n2),(TB(),k6)):G(e.a,(XG(),n2),(TB(),O6))}function qVe(e){var t,n,r=KZe(e),i;for(oT(r,oxt),i=e.d,i.c.length=0,n=new O(r);n.a<n.c.c.length;)t=I(V(n),455),UI(i,t.b)}function Sz(e,t,n){var r,i,a;return e.Nj()?(r=e.i,a=e.Oj(),cR(e,r,t),i=e.Gj(3,null,t,r,a),n?n.lj(i):n=i):cR(e,e.i,t),n}function JVe(e,t,n){var r=new QN(e.e,4,10,(i=t.c,P(i,88)?I(i,29):(rK(),t9)),null,DB(e,t),!1),i;return n?n.lj(r):n=r,n}function YVe(e,t,n){var r=new QN(e.e,3,10,null,(i=t.c,P(i,88)?I(i,29):(rK(),t9)),DB(e,t),!1),i;return n?n.lj(r):n=r,n}function Cz(e,t){var n,r,i;return e.f>0&&(e.Zj(),r=t==null?0:zF(t),i=(r&uK)%e.d.length,n=C$e(e,i,r,t),n)?n.kd():null}function XVe(e,t){var n,r,i;return P(t,45)?(n=I(t,45),r=n.jd(),i=qL(e.Pc(),r),Rk(i,n.kd())&&(i!=null||e.Pc()._b(r))):!1}function wz(e){mW();var t,n=TO(e);return t=TO(VO(e,32)),t==0?n>10||n<0?new oM(1,n):A_t[n]:new STe(n,t)}function ZVe(e){return wB(),(e.q?e.q:(_A(),_A(),LQ))._b((XG(),V2))?I(q(e,V2),203):I(q(Uk(e),H2),203)}function Tz(){Tz=E,kb(),x4=(XG(),h4),ekt=VM(W(j(jIt,1),zut,147,0,[a4,o4,c4,l4,f4,FOt,p4,m4,IOt,v4,s4,u4,g4]))}function QVe(e,t,n){yNe(),Wg.call(this),this.a=gO(Ovt,[kK,fst],[593,216],0,[XQ,Avt],2),this.c=new kw,this.g=e,this.f=t,this.d=n}function $Ve(e){this.e=H(q9,cq,30,e.length,15,1),this.c=H(J9,Uq,30,e.length,16,1),this.b=H(J9,Uq,30,e.length,16,1),this.f=0}function eHe(e){var t,n;for(e.j=H(Z9,Tq,30,e.p.c.length,15,1),n=new O(e.p);n.a<n.c.c.length;)t=I(V(n),9),e.j[t.p]=t.o.b/e.i}function tHe(e,t){var n,i;e.a=VR(e.a,1),e.c=r.Math.min(e.c,t),e.b=r.Math.max(e.b,t),e.d+=t,n=t-e.f,i=e.e+n,e.f=i-e.e-n,e.e=i}function Ez(e,t){var n,r=t.length;for(n=0;n<r;n+=2)qU(e,(xj(n,t.length),t.charCodeAt(n)),(xj(n+1,t.length),t.charCodeAt(n+1)))}function Dz(e,t){var n;Ynt(t),n=I(q(e,(XG(),w2)),284),n&&G(e,w2,RGe(n)),FE(e.c),FE(e.f),Uke(e.d),Uke(I(q(e,R2),213))}function Oz(e,t){var n;return _w(e)&&_w(t)&&(n=e%t,gq<n&&n<mq)?n:hI((att(_w(e)?TI(e):e,_w(t)?TI(t):t,!0),_Q))}function nHe(e,t){e.Vj();try{e.d._c(e.e++,t),e.f=e.d.j,e.g=-1}catch(e){throw e=GI(e),P(e,99)?k(new sg):k(e)}}function kz(){kz=E,rVt=new Tl,XBt=new El,ZBt=new Dl,QBt=new Ol,$Bt=new kl,eVt=new Al,tVt=new jl,nVt=new Ml,iVt=new Nl}function rHe(){rHe=E,ozt=new Ww(15),azt=new Jw(($G(),t8),ozt),czt=new Jw(d8,15),szt=new Jw(QLt,K(0)),izt=new Jw(I6,uJ)}function Az(){Az=E,z3=new FS(`P1_WIDTH_APPROXIMATION`,0),B3=new FS(`P2_PACKING`,1),QNt=new FS(`P3_WHITESPACE_ELIMINATION`,2)}function jz(){jz=E,R5=new fC(`PORTS`,0),z5=new fC(`PORT_LABELS`,1),L5=new fC(`NODE_LABELS`,2),I5=new fC(`MINIMUM_SIZE`,3)}function iHe(e,t){t.Tg(`Min Size Postprocessing`,1),vB(e,(oW(),q3),r.Math.max(A(F(Y(e,q3))),A(F(Y(e,G3))))),t.Ug()}function aHe(e){if(e.b==null){for(;e.a.Ob();)if(e.b=e.a.Pb(),!I(e.b,52).Gh())return!0;return e.b=null,!1}else return!0}function Mz(e,t){var n,r=null;return WE(e,(XG(),d4))&&(n=I(q(e,d4),105),n.nf(t)&&(r=n.mf(t))),r??=q(Uk(e),t),r}function oHe(e,t){var n=t>>5,r,i,a;return t&=31,i=e.d+n+(t==0?0:1),r=H(q9,cq,30,i,15,1),oYe(r,e.a,n,t),a=new ik(e.e,i,r),Mj(a),a}function sHe(e,t){var n,r,i,a=t.b.b;for(e.a=new ab,e.b=H(q9,cq,30,a,15,1),n=0,i=sB(t.b,0);i.b!=i.d.c;)r=I(Xj(i),40),r.g=n++}function cHe(e,t,n){var r,i,a=t-e.e,o=n-e.f;for(i=new O(e.a);i.a<i.c.c.length;)r=I(V(i),173),kB(r,r.s+a,r.t+o);e.e=t,e.f=n}function lHe(e,t,n){var i,a,o,s=e.k,c=t.k;return i=n[s.g][c.g],a=F(Mz(e,i)),o=F(Mz(t,i)),r.Math.max((Wk(a),a),(Wk(o),o))}function uHe(e,t,n){var r=I(WA(L9,t),121),i=I(WA(R9,t),121);n?(cj(L9,e,r),cj(R9,e,i)):(cj(R9,e,r),cj(L9,e,i))}function Nz(e,t,n){for(var r,i=null,a=e.b;a;){if(r=e.a.Le(t,a.d),n&&r==0)return a;r>=0?a=a.a[1]:(i=a,a=a.a[0])}return i}function Pz(e,t,n){for(var r,i=null,a=e.b;a;){if(r=e.a.Le(t,a.d),n&&r==0)return a;r<=0?a=a.a[0]:(i=a,a=a.a[1])}return i}function dHe(e,t,n){var r,i=I(Dk(e.b,n),171),a,o;for(r=0,o=new O(t.j);o.a<o.c.c.length;)a=I(V(o),113),i[a.d.p]&&++r;return r}function fHe(e,t,n,r){var i=!1,a,o;return ent(e.f,n,r)&&(sUe(e.f,e.a[t][n],e.a[t][r]),a=e.a[t],o=a[r],a[r]=a[n],a[n]=o,i=!0),i}function pHe(e,t){var n,r,i;for(r=new RO(sE(KR(e).a.Jc(),new f));cU(r);)if(n=I(IM(r),17),i=n.d.i,i.c==t)return!1;return!0}function mHe(e){var t=e.a;do t=I(IM(new RO(sE(KR(t).a.Jc(),new f))),17).d.i,t.k==(vU(),I$)&&zT(e.e,t);while(t.k==(vU(),I$))}function hHe(){return Error.stackTraceLimit>0?(r.Error.stackTraceLimit=Error.stackTraceLimit=64,!0):`stack`in Error()}function Fz(e){var t;e.c!=0&&(t=I(dO(e.a,e.b),295),t.b==1?(++e.b,e.b<e.a.c.length&&Mee(I(dO(e.a,e.b),295))):--t.b,--e.c)}function Iz(e,t){for(var n=0;!t[n]||t[n]==``;)n++;for(var r=t[n++];n<t.length;n++)!t[n]||t[n]==``||(r+=e+t[n]);return r}function gHe(e){var t=I(xI(e.a,4),129),n;return t==null?pBt:(n=H(dBt,qmt,415,t.length,0,1),RW(t,0,n,0,t.length),n)}function _He(e){var t,n,r,i,a;if(e==null)return null;for(a=new Kh,n=SL(e),r=0,i=n.length;r<i;++r)t=n[r],zT(a,cG(t,!0));return a}function vHe(e){var t,n,r,i,a;if(e==null)return null;for(a=new Kh,n=SL(e),r=0,i=n.length;r<i;++r)t=n[r],zT(a,cG(t,!0));return a}function yHe(e){var t,n,r,i,a;if(e==null)return null;for(a=new Kh,n=SL(e),r=0,i=n.length;r<i;++r)t=n[r],zT(a,cG(t,!0));return a}function Lz(e,t,n){var i,a,o=t+n,s;for(dN(t,o,e.length),s=``,a=t;a<o;)i=r.Math.min(a+1e4,o),s+=Gbe(e.slice(a,i)),a=i;return s}function bHe(e,t){return $w(),$w(),sF(ZK),(r.Math.abs(e-t)<=ZK||e==t||isNaN(e)&&isNaN(t)?0:e<t?-1:e>t?1:pD(isNaN(e),isNaN(t)))>0}function xHe(e,t){return $w(),$w(),sF(ZK),(r.Math.abs(e-t)<=ZK||e==t||isNaN(e)&&isNaN(t)?0:e<t?-1:e>t?1:pD(isNaN(e),isNaN(t)))<0}function SHe(e,t){return $w(),$w(),sF(ZK),(r.Math.abs(e-t)<=ZK||e==t||isNaN(e)&&isNaN(t)?0:e<t?-1:e>t?1:pD(isNaN(e),isNaN(t)))<=0}function CHe(e){switch(e.g){case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:return!0;default:return!1}}function Rz(){Rz=E,F4=new oS(BJ,0),kkt=new oS(`NODES_AND_EDGES`,1),Akt=new oS(`PREFER_EDGES`,2),jkt=new oS(`PREFER_NODES`,3)}function wHe(e,t,n,r,i,a){this.a=e,this.c=t,this.b=n,this.f=r,this.d=i,this.e=a,this.c>0&&this.b>0&&(this.g=_O(this.c,this.b,this.a))}function THe(e,t){var n=e.a,r;t=String(t),n.hasOwnProperty(t)&&(r=n[t]);var i=(tL(),n_t)[typeof r];return i?i(r):aze(typeof r)}function zz(e){var t,n,r=null;if(t=JX in e.a,n=!t,n)throw k(new pv(`Every element must have an id.`));return r=HH(ZA(e,JX)),r}function Bz(e){var t,n=aZe(e);for(t=null;e.c==2;)YG(e),t||(t=(tK(),tK(),++W9,new rT(2)),yG(t,n),n=t),n.Hm(aZe(e));return n}function Vz(e,t){var n,r,i;return e.Zj(),r=t==null?0:zF(t),i=(r&uK)%e.d.length,n=C$e(e,i,r,t),n?(nPe(e,n),n.kd()):null}function EHe(e,t){return e.e>t.e?1:e.e<t.e?-1:e.d>t.d?e.e:e.d<t.d?-t.e:e.e*mRe(e.a,t.a,e.d)}function DHe(e){return e>=48&&e<48+r.Math.min(10,10)?e-48:e>=97&&e<97?e-97+10:e>=65&&e<65?e-65+10:-1}function OHe(e,t){if(t.c==e)return t.d;if(t.d==e)return t.c;throw k(new $_(`Input edge is not connected to the input port.`))}function Hz(e,t){if(e.a<0)throw k(new ev(`Did not call before(...) or after(...) before calling add(...).`));return rue(e,e.a,t),e}function kHe(e,t){var n,r,i;if(e.c)HP(e.c,t);else for(n=t-CO(e),i=new O(e.a);i.a<i.c.c.length;)r=I(V(i),167),kHe(r,CO(r)+n)}function AHe(e,t){var n,r,i;if(e.c)qP(e.c,t);else for(n=t-wO(e),i=new O(e.d);i.a<i.c.c.length;)r=I(V(i),167),AHe(r,wO(r)+n)}function jHe(e){return dj(),P(e,166)?I(Dk(C7,B_t),296).Qg(e):tk(C7,EL(e))?I(Dk(C7,EL(e)),296).Qg(e):null}function Uz(e){var t,n;return e.Db&32||(n=(t=I(xI(e,16),29),bk(t||e.fi())-bk(e.fi())),n!=0&&Wz(e,32,H(sQ,hK,1,n,5,1))),e}function Wz(e,t,n){var r;(e.Db&t)==0?n!=null&&Y4e(e,t,n):n==null?s1e(e,t):(r=XB(e,t),r==-1?e.Eb=n:Ek(BP(e.Eb),r,n))}function MHe(e,t,n,r){var i,a;t.c.length!=0&&(i=y2e(n,r),a=RQe(t),hb(CP(new mO(null,new yj(a,1)),new uo),new yxe(e,n,i,r)))}function NHe(e,t){var n,r=e.a.length-1,i,a;return n=t-e.b&r,a=e.c-t&r,i=e.c-e.b&r,mue(n<i),n>=a?(NRe(e,t),-1):(PRe(e,t),1)}function PHe(e,t){for(var n=(xj(t,e.length),e.charCodeAt(t)),r=t+1;r<e.length&&(xj(r,e.length),e.charCodeAt(r)==n);)++r;return r-t}function FHe(e){var t,n=e.Nc();switch(n.length){case 0:return lO(),Hgt;case 1:return t=n[0],new uD(Sk(t));default:return new gTe(UBe(n))}}function IHe(e){switch(typeof e){case cK:return vL(e);case Aat:return hw(e);case sK:return mde(e);default:return e==null?0:bE(e)}}function LHe(e){if(Gz(xX,e))return hE(),yQ;if(Gz(Oft,e))return hE(),vQ;throw k(new $_(`Expecting true or false`))}function RHe(e,t){return e.e<t.e?-1:e.e>t.e?1:e.f<t.f?-1:e.f>t.f?1:zF(e)-zF(t)}function zHe(e,t){var n;return N(t)===N(e)?!0:!P(t,22)||(n=I(t,22),n.gc()!=e.gc())?!1:e.Hc(n)}function Gz(e,t){return Wk(e),t==null?!1:TD(e,t)?!0:e.length==t.length&&TD(e.toLowerCase(),t.toLowerCase())}function Kz(e){var t,n;return JL(e,-129)>0&&JL(e,128)<0?(a_e(),t=TO(e)+128,n=p_t[t],!n&&(n=p_t[t]=new Xp(e)),n):new Xp(e)}function BHe(e){var t,n;for(n=new O(e.a.b);n.a<n.c.c.length;)if(t=I(V(n),70),nv(ZE(q(t,(XG(),S2)))))return!0;return!1}function VHe(e){var t;return e.b||Bie(e,(t=lpe(e.e,e.a),!t||!TD(Oft,Cz((!t.b&&(t.b=new qE((rK(),o9),d9,t)),t.b),`qualified`)))),e.c}function qz(){qz=E,k$=new Sx(BJ,0),Vbt=new Sx(`INSIDE_PORT_SIDE_GROUPS`,1),Bbt=new Sx(`GROUP_MODEL_ORDER`,2),Hbt=new Sx(Wst,3)}function Jz(e){var t,n,r=e.Gh();if(!r)for(t=0,n=e.Mh();n;n=n.Mh()){if(++t>wot)return n.Nh();if(r=n.Gh(),r||n==e)break}return r}function HHe(e,t,n){var r=I(U(JN(e.a),t),87),i,a=(i=r.c,i||(rK(),e9));return(a.Sh()?tR(e.b,I(a,52)):a)==n?PW(r):LP(r,n),a}function UHe(e,t,n){var r,i,a;for(a=new O(n.a);a.a<a.c.c.length;)i=I(V(a),225),r=new pT(I(Dk(e.a,i.b),68)),zT(t.a,r),UHe(e,r,i)}function WHe(e,t,n){var r=t.c.p,i,a=t.p;e.b[r][a]=new Yxe(e,t),n&&(e.a[r][a]=new wte(t),i=I(q(t,(X(),C0)),9),i&&XH(e.d,i,t))}function GHe(e,t){(!t&&console.groupCollapsed!=null?console.groupCollapsed:console.group==null?console.log:console.group).call(console,e)}function KHe(e,t,n,r){I(n.b,68),I(n.b,68),I(r.b,68),I(r.b,68).c.b,jAe(r,t,e)}function qHe(e,t,n){t.b=r.Math.max(t.b,-n.a),t.c=r.Math.max(t.c,n.a-e.a),t.d=r.Math.max(t.d,-n.b),t.a=r.Math.max(t.a,n.b-e.b)}function JHe(e,t,n){this.c=e,this.f=new Kh,this.e=new uy,this.j=new Zge,this.n=new Zge,this.b=t,this.g=new fA(t.c,t.d,t.b,t.a),this.a=n}function Yz(e){var t,n,r,i;for(this.a=new Ow,this.d=new Sg,this.e=0,n=e,r=0,i=n.length;r<i;++r)t=n[r],!this.f&&(this.f=t),VTe(this,t)}function YHe(e){mW(),e.length==0?(this.e=0,this.d=1,this.a=W(j(q9,1),cq,30,15,[0])):(this.e=1,this.d=e.length,this.a=e,Mj(this))}function Xz(e,t,n){Wg.call(this),this.a=H(Ovt,fst,216,(NP(),W(j(YQ,1),Z,237,0,[KQ,qQ,JQ])).length,0,1),this.b=e,this.d=t,this.c=n}function XHe(e){var t,n,r,i,a,o=I(q(e,(X(),N0)),12);for(G(o,W0,e.i.n.b),t=Rj(e.e),r=t,i=0,a=r.length;i<a;++i)n=r[i],oj(n,o)}function ZHe(e){var t,n=I(q(e,(X(),N0)),12),r,i,a,o;for(G(n,W0,e.i.n.b),t=Rj(e.g),i=t,a=0,o=i.length;a<o;++a)r=i[a],ij(r,n)}function QHe(e,t){dwe();var n,r;for(r=new RO(sE(GR(e).a.Jc(),new f));cU(r);)if(n=I(IM(r),17),n.d.i==t||n.c.i==t)return n;return null}function $He(e,t){var n=t.ni(e.a),r;return n&&(r=QE(Cz((!n.b&&(n.b=new qE((rK(),o9),d9,n)),n.b),$X)),r!=null)?r:t.ve()}function eUe(e,t){var n=t.ni(e.a),r;return n&&(r=QE(Cz((!n.b&&(n.b=new qE((rK(),o9),d9,n)),n.b),$X)),r!=null)?r:t.ve()}function tUe(e,t){var n=lT(e.a.c.p,t.a.c.p),r;return n==0?(r=lT(e.a.d.i.p,t.a.d.i.p),r==0?lT(t.a.d.p,e.a.d.p):r):n}function nUe(e,t,n){var r,i,a=t.j,o=n.j;return a==o?(r=e.f[t.p],i=e.f[n.p],r==0&&i==0?0:r==0?-1:i==0?1:yR(r,i)):a.g-o.g}function rUe(e,t){var n,r,i,a;for(r=0,i=t.gc();r<i;++r)n=t.Rl(r),P(n,103)&&(I(n,19).Bb&IX)!=0&&(a=t.Sl(r),a!=null&&EW(e,I(a,57)))}function iUe(){var e;return pQ!=0&&(e=Date.now(),e-Ygt>2e3&&(Ygt=e,mQ=r.setTimeout(db,10))),pQ++==0?(bMe((xv(),Xgt)),!0):!1}function aUe(e,t,n){var r;(uvt?(wVe(e),!0):dvt||pvt?(ub(),!0):fvt&&(ub(),!1))&&(r=new ipe(t),r.b=n,uXe(e,r))}function Zz(e,t){var n=!e.A.Gc((jz(),z5))||e.q==(HV(),t5);e.u.Gc((VH(),c5))?n?Brt(e,t):hrt(e,t):e.u.Gc(u5)&&(n?Knt(e,t):cit(e,t))}function oUe(e){var t;N(Y(e,($G(),U6)))===N((kL(),P8))&&(nj(e)?(t=I(Y(nj(e),U6),347),vB(e,U6,t)):vB(e,U6,F8))}function sUe(e,t,n){var r,i;rH(e.e,t,n,(RG(),N5)),rH(e.i,t,n,p5),e.a&&(i=I(q(t,(X(),N0)),12),r=I(q(n,N0),12),NTe(e.g,i,r))}function cUe(e,t,n){return new fA(r.Math.min(e.a,t.a)-n/2,r.Math.min(e.b,t.b)-n/2,r.Math.abs(e.a-t.a)+n,r.Math.abs(e.b-t.b)+n)}function lUe(e){var t;this.d=new Kh,this.j=new uy,this.g=new uy,t=e.g.b,this.f=I(q(Uk(t),(XG(),b2)),86),this.e=A(F(pB(t,f4)))}function uUe(e){this.d=new Kh,this.e=new _M,this.c=H(q9,cq,30,(RG(),W(j(P5,1),VJ,64,0,[M5,m5,p5,j5,N5])).length,15,1),this.b=e}function dUe(e,t,n){var r=n[e.g][t];switch(e.g){case 1:case 3:return new M(0,r);case 2:case 4:return new M(r,0);default:return null}}function fUe(e,t){var n=zP(e.o,t);if(n==null)throw k(new pv(`Node did not exist in input.`));return r4e(e,t),_W(e,t),y0e(e,t,n),null}function pUe(e,t){var n,r=e.a.length;for(t.length<r&&(t=zv(Array(r),t)),n=0;n<r;++n)Ek(t,n,e.a[n]);return t.length>r&&Ek(t,r,null),t}function Qz(e,t){var n,r=e.c.length;for(t.length<r&&(t=zv(Array(r),t)),n=0;n<r;++n)Ek(t,n,e.c[n]);return t.length>r&&Ek(t,r,null),t}function $z(e,t,n,r){var i=e.length;if(t>=i)return i;for(t=t>0?t:0;t<i&&!nL((xj(t,e.length),e.charCodeAt(t)),n,r);t++);return t}function mUe(e,t,n){var r,i=I(zA(t.f),214);try{i.kf(e,n),Rbe(t.f,i)}catch(e){throw e=GI(e),P(e,101)?(r=e,k(r)):k(e)}}function hUe(e,t,n){var r=null,i,a,o,s=Ltt(cF(),t),c;return a=null,s&&(i=null,c=Stt(s,n),o=null,c!=null&&(o=e.of(s,c)),i=o,a=i),r=a,r}function gUe(e,t,n,r){var i=new QN(e.e,1,13,(o=t.c,o||(rK(),e9)),(a=n.c,a||(rK(),e9)),DB(e,t),!1),a,o;return r?r.lj(i):r=i,r}function _Ue(e){var t;if(e==null)return null;if(t=P0e(cG(e,!0)),t==null)throw k(new hv(`Invalid hexBinary value: '`+e+`'`));return t}function eB(e,t,n){var r;t.a.length>0&&(zT(e.b,new Uhe(t.a,n)),r=t.a.length,0<r?t.a=MA(t.a,0,0):0>r&&(t.a+=kT(H(K9,rq,30,-r,15,1))))}function vUe(e,t,n){var r,i,a;if(!n[t.d])for(n[t.d]=!0,i=new O(zL(t));i.a<i.c.c.length;)r=I(V(i),217),a=rz(r,t),vUe(e,a,n)}function yUe(e,t){var n=0,i,a,o;for(a=new O(t.a);a.a<a.c.c.length;)i=I(V(a),9),o=i.o.a+i.d.c+i.d.b+e.j,n=r.Math.max(n,o);return n}function tB(e,t,n){var r,i=I(Dk(e.e,t),393),a;return i?(a=Hde(i,n),VT(e,i),a):(r=new Ghe(e,t,n),Yk(e.e,t,r),fCe(r),null)}function bUe(e,t){var n=Dk(e.q,t);if(n==null)throw k(new pv(`Port did not exist in input.`));return r4e(e,t),_W(e,t),y0e(e,t,n),null}function nB(){return nK(),W(j(iyt,1),Z,168,0,[tyt,eyt,nyt,Kvt,Gvt,qvt,Xvt,Yvt,Jvt,$vt,Qvt,Zvt,Uvt,Hvt,Wvt,Bvt,zvt,Vvt,Lvt,Ivt,Rvt,ryt])}function rB(e){switch(e.g){case 4:return new M(0,-1);case 1:return new M(1,0);case 2:return new M(-1,0);default:return new M(0,1)}}function iB(e){switch(e.g){case 1:return bR(),S8;case 4:return bR(),y8;case 2:return bR(),b8;case 3:return bR(),v8}return bR(),x8}function xUe(e){switch(e.fj(null)){case 10:return 0;case 15:return 1;case 14:return 2;case 11:return 3;case 21:return 4}return-1}function aB(){aB=E,m6=new YS(`PARENTS`,0),p6=new YS(`NODES`,1),d6=new YS(`EDGES`,2),h6=new YS(`PORTS`,3),f6=new YS(`LABELS`,4)}function oB(){oB=E,Z8=new sC(`DISTRIBUTED`,0),Q8=new sC(`JUSTIFIED`,1),ZRt=new sC(`BEGIN`,2),X8=new sC(Gq,3),QRt=new sC(`END`,4)}function SUe(e,t,n){var r=n.q.getFullYear()-sq+sq;switch(r<0&&(r=-r),t){case 1:e.a+=r;break;case 2:$N(e,r%100,2);break;default:$N(e,r,t)}}function sB(e,t){var n,r;if(uj(t,e.b),t>=e.b>>1)for(r=e.c,n=e.b;n>t;--n)r=r.b;else for(r=e.a.a,n=0;n<t;++n)r=r.a;return new rpe(e,t,r)}function CUe(e){this.b=new Kh,this.e=new Kh,this.d=e,this.a=!Py(oA(new mO(null,new Ck(new JM(e.b))),new Em(new Oi))).zd((mb(),WQ))}function wUe(e){var t;e.g&&(e.c.ig()?e.f:e.a)&&(t=e.c.ig()?e.f:e.a,c3e(t.a,e.o,!0),c3e(t.a,e.o,!1),G(e.o,(XG(),Z2),(HV(),e5)))}function TUe(e,t){var n,r,i=t.d.i;r=i.k,!(r==(vU(),R$)||r==N$)&&(n=new RO(sE(KR(i).a.Jc(),new f)),cU(n)&&Yk(e.k,t,I(IM(n),17)))}function EUe(e,t){return IP(),yR((e.a.b==0?new M(e.c.e.a,e.c.e.b):I(IE(e.a),8)).b,(t.a.b==0?new M(t.c.e.a,t.c.e.b):I(IE(t.a),8)).b)}function DUe(e,t){return IP(),yR((e.a.b==0?new M(e.c.e.a,e.c.e.b):I(IE(e.a),8)).a,(t.a.b==0?new M(t.c.e.a,t.c.e.b):I(IE(t.a),8)).a)}function OUe(e,t){return IP(),yR((e.a.b==0?new M(e.b.e.a,e.b.e.b):I(LE(e.a),8)).a,(t.a.b==0?new M(t.b.e.a,t.b.e.b):I(LE(t.a),8)).a)}function kUe(e,t){return IP(),yR((e.a.b==0?new M(e.b.e.a,e.b.e.b):I(LE(e.a),8)).b,(t.a.b==0?new M(t.b.e.a,t.b.e.b):I(LE(t.a),8)).b)}function cB(e,t){var n,r=bP(e.Ah(),t),i;return n=t-e.gi(),n<0?(i=e.Fh(r),i>=0?e.Th(i):KH(e,r)):n<0?KH(e,r):I(r,69).uk().zk(e,e.ei(),n)}function AUe(e){var t,n,r=(!e.o&&(e.o=new bN((GG(),d7),g7,e,0)),e.o);for(n=r.c.Jc();n.e!=n.i.gc();)t=I(n.Wj(),45),t.kd();return sN(r)}function lB(e){var t;if(P(e.a,4)){if(t=jHe(e.a),t==null)throw k(new ev(kft+e.b+`'. `+Eft+(XE(w7),w7.k)+Dft));return t}else return e.a}function jUe(e){var t;if(e==null)return null;if(t=$rt(cG(e,!0)),t==null)throw k(new hv(`Invalid base64Binary value: '`+e+`'`));return t}function uB(e){var t;try{return t=e.i.Xb(e.e),e.Vj(),e.g=e.e++,t}catch(t){throw t=GI(t),P(t,99)?(e.Vj(),k(new pg)):k(t)}}function dB(e){var t;try{return t=e.c.Ti(e.e),e.Vj(),e.g=e.e++,t}catch(t){throw t=GI(t),P(t,99)?(e.Vj(),k(new pg)):k(t)}}function fB(e){var t,n,r,i=0;for(n=0,r=e.length;n<r;n++)t=(xj(n,e.length),e.charCodeAt(n)),t>=64&&t<128&&(i=Dj(i,zO(1,t-64)));return i}function pB(e,t){var n,r=null;return WE(e,($G(),l8))&&(n=I(q(e,l8),105),n.nf(t)&&(r=n.mf(t))),r==null&&Uk(e)&&(r=q(Uk(e),t)),r}function MUe(e,t){var n=I(q(e,(XG(),j2)),79);return TT(t,Gbt)?n?bA(n):(n=new e_,G(e,j2,n)):n&&G(e,j2,null),n}function NUe(e,t){var n,r,i=new mN(t.gc());for(r=t.Jc();r.Ob();)n=I(r.Pb(),294),n.c==n.f?xH(e,n,n.c):tZe(e,n)||ng(i.c,n);return i}function PUe(e,t){var n=e.o,r,i;for(i=I(I(BM(e.r,t),22),83).Jc();i.Ob();)r=I(i.Pb(),115),r.e.a=OGe(r,n.a),r.e.b=n.b*A(F(r.b.mf(r$)))}function FUe(e,t){var n,r,i=e.k,a;return n=A(F(q(e,(X(),I0)))),a=t.k,r=A(F(q(t,I0))),a==(vU(),P$)?i==P$?n==r?0:n<r?-1:1:1:-1}function IUe(e,t){var n=I(I(Dk(e.g,t.a),49).a,68),r=I(I(Dk(e.g,t.b),49).a,68);return hN(t.a,t.b)-hN(t.a,ST(n.b))-hN(t.b,ST(r.b))}function mB(e,t){var n,r;if(++e.j,t!=null&&(n=(r=e.a.Cb,P(r,100)?I(r,100).qh():null),T$e(t,n))){Wz(e.a,4,n);return}Wz(e.a,4,I(t,129))}function hB(e){switch(noe(),this.c=new Kh,this.d=e,e.g){case 0:case 2:this.a=Vbe(zbt),this.b=yq;break;case 3:case 1:this.a=zbt,this.b=bq}}function LUe(e){var t;kD(I(q(e,(XG(),Z2)),102))&&(t=e.b,k$e((bj(0,t.c.length),I(t.c[0],25))),k$e(I(dO(t,t.c.length-1),25)))}function RUe(e,t){t.Tg(`Self-Loop post-processing`,1),hb(oA(oA(lP(new mO(null,new yj(e.b,16)),new Dr),new Or),new kr),new Ar),t.Ug()}function zUe(e,t,n){var r,i;if(e.c)JP(e.c,e.c.i+t),YP(e.c,e.c.j+n);else for(i=new O(e.b);i.a<i.c.c.length;)r=I(V(i),167),zUe(r,t,n)}function BUe(e){var t,n,r=e.c.a;for(e.p=(Sk(r),new jD(r)),n=new O(r);n.a<n.c.c.length;)t=I(V(n),9),t.p=YZe(t).a;_A(),oT(e.p,new Aa)}function VUe(e,t){var n,r;if(e.j.length!=t.j.length)return!1;for(n=0,r=e.j.length;n<r;n++)if(!TD(e.j[n],t.j[n]))return!1;return!0}function HUe(e,t){_A();var n=e,r,i,a=t;for(P(e,22)&&!P(t,22)&&(n=t,a=e),i=n.Jc();i.Ob();)if(r=i.Pb(),a.Gc(r))return!1;return!0}function UUe(e,t,n,r){return t.a<r.a||t.a==r.a&&(t.b<r.b||t.b==r.b&&e.b>n.b)}function WUe(e){var t=new Ov;return t.a+=`n`,e.k!=(vU(),R$)&&ZC(ZC((t.a+=`(`,t),zE(e.k).toLowerCase()),`)`),ZC((t.a+=`_`,t),iV(e)),t.a}function gB(){gB=E,bkt=new iS(Vut,0),vkt=new iS(mct,1),ykt=new iS(`LINEAR_SEGMENTS`,2),D4=new iS(`BRANDES_KOEPF`,3),O4=new iS(But,4)}function _B(e,t,n,r){var i;return n>=0?e.Ph(t,n,r):(e.Mh()&&(r=(i=e.Ch(),i>=0?e.xh(r):e.Mh().Qh(e,-1-i,null,r))),e.zh(t,n,r))}function GUe(e,t){switch(t){case 7:!e.e&&(e.e=new CD(i7,e,7,4)),bG(e.e);return;case 8:!e.d&&(e.d=new CD(i7,e,8,5)),bG(e.d);return}RVe(e,t)}function vB(e,t,n){return n==null?(!e.o&&(e.o=new bN((GG(),d7),g7,e,0)),Vz(e.o,t)):(!e.o&&(e.o=new bN((GG(),d7),g7,e,0)),TV(e.o,t,n)),e}function yB(e,t){var n=e.dd(t);try{return n.Pb()}catch(e){throw e=GI(e),P(e,112)?k(new G_(`Can't get element `+t)):k(e)}}function KUe(e,t){var n=I(Zk(e.b,t),127).n;switch(t.g){case 1:e.t>=0&&(n.d=e.t);break;case 3:e.t>=0&&(n.a=e.t)}e.C&&(n.b=e.C.b,n.c=e.C.c)}function qUe(e){var t=e.a;do t=I(IM(new RO(sE(WR(t).a.Jc(),new f))),17).c.i,t.k==(vU(),I$)&&e.b.Ec(t);while(t.k==(vU(),I$));e.b=pz(e.b)}function JUe(e,t){var n,i,a=e;for(i=new RO(sE(WR(t).a.Jc(),new f));cU(i);)n=I(IM(i),17),n.c.i.c&&(a=r.Math.max(a,n.c.i.c.p));return a}function YUe(e,t){var n,r,i=0;for(r=I(I(BM(e.r,t),22),83).Jc();r.Ob();)n=I(r.Pb(),115),i+=n.d.d+n.b.Kf().b+n.d.a,r.Ob()&&(i+=e.w);return i}function XUe(e,t){var n,r,i=0;for(r=I(I(BM(e.r,t),22),83).Jc();r.Ob();)n=I(r.Pb(),115),i+=n.d.b+n.b.Kf().a+n.d.c,r.Ob()&&(i+=e.w);return i}function ZUe(e){var t,n,r=0,i=JU(e);if(i.c.length==0)return 1;for(n=new O(i);n.a<n.c.c.length;)t=I(V(n),26),r+=ZUe(t);return r}function QUe(e){var t,n;for(this.b=new Kh,this.c=e,this.a=!1,n=new O(e.a);n.a<n.c.c.length;)t=I(V(n),9),this.a|=t.k==(vU(),R$)}function $Ue(e,t,n){var r=e.bd(t),i,a,o;return r!=-1&&(e.Nj()?(a=e.Oj(),o=aO(e,r),i=e.Gj(4,o,null,r,a),n?n.lj(i):n=i):aO(e,r)),n}function bB(e,t,n){var r=e.bd(t),i,a,o;return r!=-1&&(e.Nj()?(a=e.Oj(),o=uV(e,r),i=e.Gj(4,o,null,r,a),n?n.lj(i):n=i):uV(e,r)),n}function eWe(e,t,n,r){var i,a,o;n.Uh(t)&&(Wb(),aP(t)?(i=I(n.Jh(t),163),rUe(e,i)):(a=(o=t,o?I(r,52).di(o):null),a&&tre(n.Jh(t),a)))}function xB(e,t,n,r){var i,a=bP(e.Ah(),t),o;return i=t-e.gi(),i<0?(o=e.Fh(a),o>=0?e.Ih(o,n,!0):QH(e,a,n)):I(a,69).uk().wk(e,e.ei(),i,n,r)}function tWe(e,t,n,r){var i=$ze(t.nf(($G(),J6))?I(t.mf(J6),22):e.j);i!=(nK(),ryt)&&(n&&!CHe(i)||UXe(F0e(e,i,r),t))}function SB(e,t){return FC(e)?!!Ogt[t]:e.Qm?!!e.Qm[t]:PC(e)?!!Dgt[t]:NC(e)?!!Egt[t]:!1}function nWe(e){switch(e.g){case 1:return PI(),a$;case 3:return PI(),i$;case 2:return PI(),cyt;case 4:return PI(),syt;default:return null}}function rWe(e,t,n){if(e.e)switch(e.b){case 1:Kxe(e.c,t,n);break;case 0:qxe(e.c,t,n)}else VDe(e.c,t,n);e.a[t.p][n.p]=e.c.i,e.a[n.p][t.p]=e.c.e}function iWe(e){var t,n;if(e==null)return null;for(n=H(M$,kK,199,e.length,0,2),t=0;t<n.length;t++)n[t]=I(sOe(e[t],e[t].length),199);return n}function aWe(e){var t=I(q(e,(BW(),yMt)),104);G(e,(LG(),m3),new M(0,0)),t5e(new ZM,e,t.b-A(F(q(e,Hjt))),t.d-A(F(q(e,Wjt))))}function CB(e){var t;if(wL(e))return FO(e),e.sl()&&(t=GH(e.e,e.b,e.c,e.a,e.j),e.j=t),e.g=e.a,++e.a,++e.c,e.i=0,e.j;throw k(new pg)}function oWe(e,t,n){n.Tg(`Compound graph preprocessor`,1),e.a=new BA,qnt(e,t,null),bet(e,t),B2e(e),G(t,(X(),QCt),e.a),e.a=null,ck(e.b),n.Ug()}function sWe(e,t,n){var r,i,a;for(i=new RO(sE((t?WR(e):KR(e)).a.Jc(),new f));cU(i);)r=I(IM(i),17),a=t?r.c.i:r.d.i,a.k==(vU(),F$)&&aj(a,n)}function cWe(e,t,n){var r=t.i.j.c.length,i,a;return WE(t,(X(),M0))&&WE(n,M0)?(i=zU(t,n,e.b,r),a=zU(n,t,e.b,r),i<a?-1:+(i>a)):0}function wB(){wB=E,E4=new rS(BJ,0),hkt=new rS(`PORT_POSITION`,1),T4=new rS(`NODE_SIZE_WHERE_SPACE_PERMITS`,2),w4=new rS(`NODE_SIZE`,3)}function lWe(e,t){var n,r,i;for(t.Tg(`Untreeify`,1),n=I(q(e,(LG(),Kjt)),16),i=n.Jc();i.Ob();)r=I(i.Pb(),65),QD(r.b.d,r),QD(r.c.b,r);t.Ug()}function TB(){TB=E,RIt=new ZS(`AUTOMATIC`,0),O6=new ZS(Kq,1),k6=new ZS(qq,2),A6=new ZS(`TOP`,3),E6=new ZS(mst,4),D6=new ZS(Gq,5)}function EB(e,t,n){var r,i=e.gc();if(t>=i)throw k(new wD(t,i));if(e.Qi()&&(r=e.bd(n),r>=0&&r!=t))throw k(new $_(tZ));return e.Vi(t,n)}function DB(e,t){var n,r,i=eKe(e,t);if(i>=0)return i;if(e.ml()){for(r=0;r<e.i;++r)if(n=e.nl(I(e.g[r],57)),N(n)===N(t))return r}return-1}function uWe(e,t){if(this.a=I(Sk(e),254),this.b=I(Sk(t),254),e.Cd(t)>0||e==(__(),Pgt)||t==(h_(),Fgt))throw k(new $_(`Invalid range: `+MDe(e,t)))}function dWe(e,t,n,r){QU();var i=0,a;for(a=0;a<n;a++)i=VR(HR(Ej(t[a],Eq),Ej(r,Eq)),Ej(TO(i),Eq)),e[a]=TO(i),i=VO(i,32);return TO(i)}function fWe(e,t,n){var i,a=0;for(i=0;i<Avt;i++)a=r.Math.max(a,HL(e.a[t.g][i],n));return t==(NP(),qQ)&&e.b&&(a=r.Math.max(a,e.b.b)),a}function OB(e,t){var n,r;if(hue(t>0),(t&-t)==t)return GA(t*SU(e,31)*4656612873077393e-25);do n=SU(e,31),r=n%t;while(n-r+(t-1)<0);return GA(r)}function pWe(e,t){var n=_E(new Og,e),r,i;for(i=new O(t);i.a<i.c.c.length;)r=I(V(i),124),BU(Sb(xb(Cb(bb(new Dg,0),0),n),r));return n}function kB(e,t,n){var r,i;for(WIe(e,t-e.s,n-e.t),i=new O(e.n);i.a<i.c.c.length;)r=I(V(i),208),_ee(r,r.e+t-e.s),Vp(r,r.f+n-e.t);e.s=t,e.t=n}function mWe(e,t,n){switch(n.g){case 1:e.a=t.a/2,e.b=0;break;case 2:e.a=t.a,e.b=t.b/2;break;case 3:e.a=t.a/2,e.b=t.b;break;case 4:e.a=0,e.b=t.b/2}}function AB(e,t,n,r){var i,a;for(i=t;i<e.c.length;i++)if(a=(bj(i,e.c.length),I(e.c[i],12)),n.Mb(a))ng(r.c,a);else return i;return e.c.length}function hWe(e){var t,n,r;for(r=I(BM(e.a,(BV(),x1)),16).Jc();r.Ob();)n=I(r.Pb(),107),t=JGe(n),_k(e,n,t[0],(LF(),C1),0),_k(e,n,t[1],T1,1)}function gWe(e){var t,n,r;for(r=I(BM(e.a,(BV(),S1)),16).Jc();r.Ob();)n=I(r.Pb(),107),t=JGe(n),_k(e,n,t[0],(LF(),C1),0),_k(e,n,t[1],T1,1)}function jB(e){switch(e.g){case 0:return null;case 1:return new pFe;case 2:return new m_;default:throw k(new $_(Cdt+(e.f==null?``+e.g:e.f)))}}function _We(e){var t=A(F(Y(e,($G(),p8))))*r.Math.sqrt((!e.a&&(e.a=new L(p7,e,10,11)),e.a).i);return new M(t,t/A(F(Y(e,f8))))}function MB(e){var t;return e.f&&e.f.Sh()&&(t=I(e.f,52),e.f=I(tR(e,t),84),e.f!=t&&e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,9,8,t,e.f))),e.f}function NB(e){var t;return e.i&&e.i.Sh()&&(t=I(e.i,52),e.i=I(tR(e,t),84),e.i!=t&&e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,9,7,t,e.i))),e.i}function PB(e){var t;return e.b&&e.b.Db&64&&(t=e.b,e.b=I(tR(e,t),19),e.b!=t&&e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,9,21,t,e.b))),e.b}function FB(e,t){var n,r,i;e.d==null?(++e.e,++e.f):(r=t.yi(),Q2e(e,e.f+1),i=(r&uK)%e.d.length,n=e.d[i],!n&&(n=e.d[i]=e.bk()),n.Ec(t),++e.f)}function vWe(e,t,n){var r;return t.rk()?!1:t.Gk()==-2?t.ok()==e.e.Ah()&&n==null:(r=t.gk(),r==null?n==null:uR(r,n))}function IB(){var e;vF(16,Wat),e=WPe(16),this.b=H(Igt,WK,309,e,0,1),this.c=H(Igt,WK,309,e,0,1),this.a=null,this.e=null,this.i=0,this.f=e-1,this.g=0}function LB(e){Xde.call(this),this.k=(vU(),R$),this.j=(vF(6,KK),new mN(6)),this.b=(vF(2,KK),new mN(2)),this.d=new Ug,this.f=new Kg,this.a=e}function yWe(e){var t,n=0,r,i,a;for(i=new O(e.a);i.a<i.c.c.length;)r=I(V(i),124),r.d=n++;return t=AYe(e),a=null,t.c.length>1&&(a=pWe(e,t)),a}function bWe(e){var t=0,n,r;for(r=new O(e.c.a);r.a<r.c.c.length;)n=I(V(r),9),t+=eM(new RO(sE(KR(n).a.Jc(),new f)));return t/e.c.a.c.length}function RB(e){var t,n;for(n=new XT(e);n.e!=n.i.gc();)if(t=I(uB(n),87),t.e||(!t.d&&(t.d=new UT(z7,t,1)),t.d).i!=0)return!0;return!1}function zB(e){var t,n;for(n=new XT(e);n.e!=n.i.gc();)if(t=I(uB(n),87),t.e||(!t.d&&(t.d=new UT(z7,t,1)),t.d).i!=0)return!0;return!1}function xWe(e,t,n,r){var i=I(BM(r?e.a:e.b,t),22),a,o;for(o=i.Jc();o.Ob();)if(a=I(o.Pb(),26),$U(e,n,a))return!0;return!1}function SWe(e,t){for(var n,r;e.Ob();)if(!t.Ob()||(n=e.Pb(),r=t.Pb(),!(N(n)===N(r)||n!=null&&uR(n,r))))return!1;return!t.Ob()}function CWe(e){var t,n;e.c.length<=1||(t=B3e(e,(RG(),j5)),fZe(e,I(t.a,15).a,I(t.b,15).a),n=B3e(e,N5),fZe(e,I(n.a,15).a,I(n.b,15).a))}function wWe(e,t,n){var r,i=e.a.b;for(r=i.c.length;r<n;r++)DO(i,i.c.length,new Ok(e.a));aj(t,(bj(n-1,i.c.length),I(i.c[n-1],25))),e.b[t.p]=n}function TWe(e,t){var n,r,i;for(e.b[t.g]=1,r=sB(t.d,0);r.b!=r.d.c;)n=I(Xj(r),65),i=n.c,e.b[i.g]==1?QD(e.a,n):e.b[i.g]==2?e.b[i.g]=1:TWe(e,i)}function BB(){BB=E,hIt=(aW(),lIt),pIt=new Ww(8),new Jw(($G(),t8),pIt),new Jw(d8,8),mIt=sIt,dIt=ZFt,fIt=QFt,uIt=new Jw(B6,(hE(),!1))}function EWe(e,t,n){var r;n.Tg(`Shrinking tree compaction`,1),nv(ZE(q(t,(FI(),s$))))?(zPe(e,t.f),$je(t.f,(r=t.c,r))):$je(t.f,t.c),n.Ug()}function DWe(e,t,n,r){switch(t){case 7:return!e.e&&(e.e=new CD(i7,e,7,4)),e.e;case 8:return!e.d&&(e.d=new CD(i7,e,8,5)),e.d}return QBe(e,t,n,r)}function VB(e){var t;return e.a&&e.a.Sh()&&(t=I(e.a,52),e.a=I(tR(e,t),143),e.a!=t&&e.Db&4&&!(e.Db&1)&&pI(e,new YO(e,9,5,t,e.a))),e.a}function HB(e){return e<48||e>102?-1:e<=57?e-48:e<65?-1:e<=70?e-65+10:e<97?-1:e-97+10}function UB(e,t){if(e==null)throw k(new tv(`null key in entry: null=`+t));if(t==null)throw k(new tv(`null value in entry: `+e+`=null`))}function OWe(e,t){var n=W(j(Z9,1),Tq,30,15,[HL(e.a[0],t),HL(e.a[1],t),HL(e.a[2],t)]);return e.d&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function kWe(e,t){var n=W(j(Z9,1),Tq,30,15,[UL(e.a[0],t),UL(e.a[1],t),UL(e.a[2],t)]);return e.d&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function AWe(e,t,n){kD(I(q(t,(XG(),Z2)),102))||(zOe(e,t,_H(t,n)),zOe(e,t,_H(t,(RG(),j5))),zOe(e,t,_H(t,m5)),_A(),oT(t.j,new gh(e)))}function jWe(e){var t,n;for(e.c||dtt(e),n=new e_,t=new O(e.a),V(t);t.a<t.c.c.length;)QD(n,I(V(t),410).a);return VE(n.b!=0),OP(n,n.c.b),n}function MWe(e,t,n){var r,i,a,o,s=e.r+t;for(e.r+=t,e.d+=n,r=n/e.n.c.length,i=0,o=new O(e.n);o.a<o.c.c.length;)a=I(V(o),208),h0e(a,s,r,i),++i}function NWe(e){var t,n,r;for(e.b.a.$b(),e.a=H(GQ,hK,60,e.c.c.a.b.c.length,0,1),t=0,r=new O(e.c.c.a.b);r.a<r.c.c.length;)n=I(V(r),60),n.f=t++}function PWe(e){var t,n,r;for(e.b.a.$b(),e.a=H(Ebt,hK,82,e.c.a.a.b.c.length,0,1),t=0,r=new O(e.c.a.a.b);r.a<r.c.c.length;)n=I(V(r),82),n.i=t++}function FWe(e){var t,n,r,i,a;for(r=new O(e.b);r.a<r.c.c.length;)for(n=I(V(r),25),t=0,a=new O(n.a);a.a<a.c.c.length;)i=I(V(a),9),i.p=t++}function IWe(e,t,n){var r,i,a,o=0;for(r=n/e.a.c.length,a=new O(e.a);a.a<a.c.c.length;)i=I(V(a),173),kB(i,i.s,i.t+o*r),MWe(i,e.d-i.r+t,r),++o}function LWe(e){var t=VRe(e);if(!cU(e))throw k(new G_(`position (0) must be less than the number of elements that remained (`+t+`)`));return IM(e)}function RWe(e,t){var n;return e.a||=(n=H(Z9,Tq,30,0,15,1),jy(e.b.a,new Ree(n)),pre(n,kNe(te.prototype.Ke,te,[])),new Rfe(n,e.d)),iN(e.a,t)}function zWe(e){switch(e.g){case 1:return RG(),N5;case 4:return RG(),m5;case 3:return RG(),p5;case 2:return RG(),j5;default:return RG(),M5}}function BWe(e,t,n){t.k==(vU(),R$)&&n.k==I$&&(e.d=iR(t,(RG(),j5)),e.b=iR(t,m5)),n.k==R$&&t.k==I$&&(e.d=iR(n,(RG(),m5)),e.b=iR(n,j5))}function WB(e,t){var n,r;for(r=LR(e,t).Jc();r.Ob();)if(n=I(r.Pb(),12),q(n,(X(),F0))!=null||xE(new JM(n.b)))return!0;return!1}function VWe(e,t,n){n.Tg(`Linear segments node placement`,1),e.b=I(q(t,(X(),H0)),317),eat(e,t),K9e(e,t),Eet(e,t),yit(e),e.a=null,e.b=null,n.Ug()}function HWe(e,t){return JP(t,e.e+e.d+(e.c.c.length==0?0:e.b)),YP(t,e.f),e.a=r.Math.max(e.a,t.f),e.d+=t.g+(e.c.c.length==0?0:e.b),zT(e.c,t),!0}function UWe(e,t){var n,r,i=t.length-1,a,o=0,s=0;for(r=0;r<=i;r++)a=t[r],n=bXe(i,r)*hze(1-e,i-r)*hze(e,r),o+=a.a*n,s+=a.b*n;return new M(o,s)}function WWe(e,t){var n=t.gc(),r,i,a,o;for(e.Zi(e.i+n),a=t.Jc(),o=e.i,e.i+=n,r=o;r<e.i;++r)i=a.Pb(),BT(e,r,e.Xi(r,i)),e.Ki(r,i),e.Li();return n!=0}function GWe(e,t,n){var r,i,a;return e.Nj()?(r=e.Cj(),a=e.Oj(),++e.j,e.oj(r,e.Xi(r,t)),i=e.Gj(3,null,t,r,a),n?n.lj(i):n=i):Dde(e,e.Cj(),t),n}function KWe(e,t,n){var r=I(U(lM(e.a),t),87),i,a=(i=r.c,P(i,88)?I(i,29):(rK(),t9));return(a.Db&64?tR(e.b,a):a)==n?PW(r):LP(r,n),a}function qWe(e){var t;return e==null?null:new Uw((t=cG(e,!0),t.length>0&&(xj(0,t.length),t.charCodeAt(0)==43)?(xj(1,t.length+1),t.substr(1)):t))}function JWe(e){var t;return e==null?null:new Uw((t=cG(e,!0),t.length>0&&(xj(0,t.length),t.charCodeAt(0)==43)?(xj(1,t.length+1),t.substr(1)):t))}function YWe(e,t,n,r,i,a,o,s){var c,l;r&&(c=r.a[0],c&&YWe(e,t,n,c,i,a,o,s),cV(e,n,r.d,i,a,o,s)&&t.Ec(r),l=r.a[1],l&&YWe(e,t,n,l,i,a,o,s))}function GB(e,t){var n,r,i,a=e.gc();for(t.length<a&&(t=zv(Array(a),t)),i=t,r=e.Jc(),n=0;n<a;++n)Ek(i,n,r.Pb());return t.length>a&&Ek(t,a,null),t}function XWe(e,t){var n,r=e.gc();if(t==null){for(n=0;n<r;n++)if(e.Xb(n)==null)return n}else for(n=0;n<r;n++)if(uR(t,e.Xb(n)))return n;return-1}function KB(e,t){var n=t.jd(),r,i=t.kd();return r=e.xc(n),!(!(N(i)===N(r)||i!=null&&uR(i,r))||r==null&&!e._b(n))}function ZWe(e,t){var n,r,i;return t<=22?(n=e.l&(1<<t)-1,r=i=0):t<=44?(n=e.l,r=e.m&(1<<t-22)-1,i=0):(n=e.l,r=e.m,i=e.h&(1<<t-44)-1),dT(n,r,i)}function QWe(e,t){switch(t.g){case 1:return e.f.n.d+e.t;case 3:return e.f.n.a+e.t;case 2:return e.f.n.c+e.s;case 4:return e.f.n.b+e.s;default:return 0}}function $We(e,t){var n,r=t.c;switch(n=t.a,e.b.g){case 0:n.d=e.e-r.a-r.d;break;case 1:n.d+=e.e;break;case 2:n.c=e.e-r.a-r.d;break;case 3:n.c=e.e+r.d}}function qB(){qB=E,WNt=new NS(BJ,0),HNt=new NS(_ct,1),UNt=new NS(`EDGE_LENGTH_BY_POSITION`,2),VNt=new NS(`CROSSING_MINIMIZATION_BY_POSITION`,3)}function JB(e,t){var n=I(zP(e.n,t),26),r;if(n)return n;if(r=I(zP(e.p,t),125),r)return r;throw k(new pv(`Referenced shape does not exist: `+t))}function eGe(e,t){if(e.g==-1)throw k(new ug);e.Vj();try{e.d.fd(e.g,t),e.f=e.d.j}catch(e){throw e=GI(e),P(e,99)?k(new sg):k(e)}}function tGe(e,t){var n,r;if(P(t,254)){r=I(t,254);try{return n=e.Cd(r),n==0}catch(e){if(e=GI(e),P(e,211))return!1;throw k(e)}}return!1}function nGe(e,t){if(e.c==t)return e.d;if(e.d==t)return e.c;throw k(new $_(`Node 'one' must be either source or target of edge 'edge'.`))}function rGe(e,t){if(e.c.i==t)return e.d.i;if(e.d.i==t)return e.c.i;throw k(new $_(`Node `+t+` is neither source nor target of edge `+e))}function iGe(e,t,n){n.Tg(`Self-Loop ordering`,1),hb(sA(oA(oA(lP(new mO(null,new yj(t.b,16)),new xr),new Sr),new Cr),new wr),new pte(e)),n.Ug()}function YB(e,t,n,r,i,a){var o=XKe(t,n,a),s=n==(RG(),m5)||n==N5?-1:1,c,l=e[n.g],u;for(u=0;u<l.length;u++)c=l[u],c>0&&(c+=i),l[u]=o,o+=s*(c+r)}function aGe(e){var t;for(t=0;t<e.a.c.length;t++)if(WE(I(dO(e.a,t),9),(XG(),cOt))&&nv(ZE(q(I(dO(e.a,t),9),cOt))))return!0;return!1}function oGe(e){var t,n,r=e.f;for(e.n=H(Z9,Tq,30,r,15,1),e.d=H(Z9,Tq,30,r,15,1),t=0;t<r;t++)n=I(dO(e.c.b,t),25),e.n[t]=yUe(e,n),e.d[t]=A2e(e,n)}function sGe(e,t,n,r){var i;this.c=e,this.d=t,i=new ab,xM(i,n,i.c.b,i.c),this.a=i,this.b=I(q(r,(BW(),D3)),86),this.e=A(F(q(r,wMt))),mat(this)}function XB(e,t){var n,r,i=0;for(r=2;r<t;r<<=1)(e.Db&r)!=0&&++i;if(i==0){for(n=t<<=1;n<=128;n<<=1)if((e.Db&n)!=0)return 0;return-1}else return i}function cGe(e,t){var n,r,i,a,o=HU(e.e.Ah(),t);for(a=null,n=I(e.g,122),i=0;i<e.i;++i)r=n[i],o.$l(r.Jk())&&(!a&&(a=new il),gN(a,r));a&&hit(e,a)}function lGe(e){var t,n,r;if(!e)return null;if(e.dc())return``;for(r=new Ev,n=e.Jc();n.Ob();)t=n.Pb(),JC(r,QE(t)),r.a+=` `;return dw(r,r.a.length-1)}function uGe(e,t){var n=Array(t),r;switch(e){case 14:case 15:r=0;break;case 16:r=!1;break;default:return n}for(var i=0;i<t;++i)n[i]=r;return n}function ZB(e){var t,n,r;for(n=new O(e.a.b);n.a<n.c.c.length;)t=I(V(n),60),t.c.$b();r=Nw(e.d)?e.a.c:e.a.d,AP(r,new Kee(e)),e.c.bf(e),p3e(e)}function dGe(e){var t,n,r,i;for(n=new O(e.e.c);n.a<n.c.c.length;){for(t=I(V(n),291),i=new O(t.b);i.a<i.c.c.length;)r=I(V(i),445),T9e(r);H$e(t)}}function fGe(e){var t,n,i=uK;for(n=new O(e.a);n.a<n.c.c.length;)t=I(V(n),9),WE(t,(X(),M0))&&(i=r.Math.min(i,I(q(t,M0),15).a));return i}function QB(e){var t,n,i=0,a,o=0;for(a=0,n=new O(e.a);n.a<n.c.c.length;)t=I(V(n),173),o=r.Math.max(o,t.r),i+=t.d+(a>0?e.c:0),++a;e.b=i,e.d=o}function pGe(e,t){var n=W(j(Z9,1),Tq,30,15,[fWe(e,(NP(),KQ),t),fWe(e,qQ,t),fWe(e,JQ,t)]);return e.f&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function mGe(e){var t;WE(e,(XG(),z2))&&(t=I(q(e,z2),22),t.Gc((lU(),V8))?(t.Kc(V8),t.Ec(U8)):t.Gc(U8)&&(t.Kc(U8),t.Ec(V8)))}function hGe(e){var t;WE(e,(XG(),z2))&&(t=I(q(e,z2),22),t.Gc((lU(),J8))?(t.Kc(J8),t.Ec(K8)):t.Gc(K8)&&(t.Kc(K8),t.Ec(J8)))}function $B(e,t,n,r){var i,a,o,s;return e.a??yXe(e,t),o=t.b.j.c.length,a=n.d.p,s=r.d.p,i=s-1,i<0&&(i=o-1),a<=i?e.a[i]-e.a[a]:e.a[o-1]-e.a[a]+e.a[i]}function gGe(e){var t;for(t=0;t<e.a.c.length;t++)if(WE(I(dO(e.a,t),9),(XG(),lOt))&&!nv(ZE(q(I(dO(e.a,t),9),lOt))))return!1;return!0}function _Ge(e,t,n){var r,i,a=e.c,o,s=n?t:e;for(r=n?e:t,i=s.p+1;i<r.p;++i)if(o=I(dO(a.a,i),9),!(o.k==(vU(),N$)||kKe(o)))return!1;return!0}function vGe(e){var t,n;if(!e.b)for(e.b=zj(I(e.f,26).jh().i),n=new XT(I(e.f,26).jh());n.e!=n.i.gc();)t=I(uB(n),157),zT(e.b,new Y_(t));return e.b}function yGe(e){var t,n;if(!e.e)for(e.e=zj(Qbe(I(e.f,26)).i),n=new XT(Qbe(I(e.f,26)));n.e!=n.i.gc();)t=I(uB(n),125),zT(e.e,new Fne(t));return e.e}function bGe(e){var t,n;if(!e.a)for(e.a=zj(CA(I(e.f,26)).i),n=new XT(CA(I(e.f,26)));n.e!=n.i.gc();)t=I(uB(n),26),zT(e.a,new TE(e,t));return e.a}function eV(e){var t;if(!e.C&&(e.D!=null||e.B!=null))if(t=Lnt(e),t)e.fl(t);else try{e.fl(null)}catch(e){if(e=GI(e),!P(e,63))throw k(e)}return e.C}function xGe(e){switch(e.q.g){case 5:pqe(e,(RG(),m5)),pqe(e,j5);break;case 4:Ttt(e,(RG(),m5)),Ttt(e,j5);break;default:kZe(e,(RG(),m5)),kZe(e,j5)}}function SGe(e){switch(e.q.g){case 5:mqe(e,(RG(),p5)),mqe(e,N5);break;case 4:Ett(e,(RG(),p5)),Ett(e,N5);break;default:AZe(e,(RG(),p5)),AZe(e,N5)}}function tV(e,t){var n,i,a=new uy;for(i=e.Jc();i.Ob();)n=I(i.Pb(),36),dW(n,a.a,0),a.a+=n.f.a+t,a.b=r.Math.max(a.b,n.f.b);return a.b>0&&(a.b+=t),a}function nV(e,t){var n,i,a=new uy;for(i=e.Jc();i.Ob();)n=I(i.Pb(),36),dW(n,0,a.b),a.b+=n.f.b+t,a.a=r.Math.max(a.a,n.f.a);return a.a>0&&(a.a+=t),a}function CGe(e,t){var n,r;if(t.length==0)return 0;for(n=rbe(e.a,t[0],(RG(),N5)),n+=rbe(e.a,t[t.length-1],p5),r=0;r<t.length;r++)n+=ZYe(e,r,t);return n}function wGe(){WU(),this.c=new Kh,this.i=new Kh,this.e=new Ow,this.f=new Ow,this.g=new Ow,this.j=new Kh,this.a=new Kh,this.b=new qh,this.k=new qh}function rV(e,t){var n,r;return e.Db>>16==6?e.Cb.Qh(e,5,c7,t):(r=PB(I(bP((n=I(xI(e,16),29),n||e.fi()),e.Db>>16),19)),e.Cb.Qh(e,r.n,r.f,t))}function TGe(e){LA();var t=e.e;if(t&&t.stack){var n=t.stack,r=t+`
|