@keadex/mina-react 2.10.3 → 3.0.0

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/index.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var e,t,n,r,a,o,i={15:e=>{e.exports=require("react")},39:(e,t,n)=>{n.d(t,{$n:()=>A,tz:()=>p,rI:()=>d,UW:()=>y,K0:()=>k,pd:()=>Y,vL:()=>E,sx:()=>U,l6:()=>$,YD:()=>G,CL:()=>z,T_:()=>w,hS:()=>W});var r=n(452);n.n(r)().addPluralRule(/Person/,"Persons");var a=n(15),o=n.n(a),i=n(177),l=n(53),s=n(732);const _="hide.te.dropdown",c="show.te.dropdown",u=o().memo((e=>{var t;const n=(0,a.useRef)(null),[r,o]=(0,a.useState)(!1);function u(e){let t;return t=e.isSepator?(0,s.jsx)("li",{className:"relative",children:(0,s.jsx)("span",{className:"bg-third my-1 block h-px w-full"})},e.id):(0,s.jsxs)("li",{className:"relative",children:[(0,s.jsxs)("button",{disabled:void 0!==e.disabled&&e.disabled,id:e.id,className:"\n hover:bg-link\n flex\n w-full\n items-center\n whitespace-nowrap\n px-4\n py-1\n text-left\n text-sm\n hover:text-white\n ","data-te-dropdown-item-ref":!0,onClick:t=>{e.onClick&&e.onClick(t)},children:[e.subMenuItems&&e.subMenuItems.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"mr-16 basis-11/12 pr-1",children:e.label}),(0,s.jsx)("span",{className:"basis-1/12 text-right",children:(0,s.jsx)(l.FontAwesomeIcon,{icon:i.faAngleRight})})]}),(!e.subMenuItems||0===e.subMenuItems.length)&&e.label]}),d(e.isHeaderMenuItem,e.id,e.subMenuItems)]},e.id),t}function d(e,t,n){const r=[];if(n&&n.length>0){for(const e of n)r.push(u(e));return(0,s.jsx)("ul",{className:`\n bg-secondary\n text-accent-primary\n absolute\n z-50\n m-0\n w-auto\n min-w-max\n list-none\n rounded-md\n border-none\n bg-clip-padding\n py-2\n shadow-[0_1px_2px_rgba(0,0,0,0.6)]\n [&[data-te-dropdown-show]]:block\n ${e?" dropdown-menu float-left hidden origin-top-left":" right-px top-0"}\n `,id:`menu-${t}`,"aria-labelledby":t,"data-te-dropdown-menu-ref":!0,children:r})}return(0,s.jsx)("div",{"data-te-dropdown-menu-ref":!0})}const g=t=>{e.increaseOpenedMenu&&e.setLastOpenedMenu&&e.decreaseOpenedMenu&&(t.type===c?(o(!0),e.increaseOpenedMenu(),e.setLastOpenedMenu(e.id)):(o(!1),e.decreaseOpenedMenu()))};return(0,a.useEffect)((()=>{const t=n.current;return null==t||t.addEventListener(_,g),null==t||t.addEventListener(c,g),(e.alwaysOpen&&!r||e.lastOpenedMenu!==e.id&&r)&&(null==t||t.dispatchEvent(new MouseEvent("click"))),()=>{null==t||t.removeEventListener(_,g),null==t||t.removeEventListener(c,g)}})),(0,s.jsxs)("div",{className:`relative ${null!=(t=e.className)?t:""}`,"data-te-dropdown-ref":!0,children:[(0,s.jsx)("button",{className:`\n ${r?"":" bg-dark-primary text-accent-primary"} \n hover:bg-primary\n flex\n items-center\n whitespace-nowrap\n rounded-md\n px-2\n py-0.5\n text-sm hover:text-white\n hover:shadow-[0_1px_2px_rgba(0,0,0,0.6)]\n focus:outline-none\n focus:ring-0\n ${r?" bg-primary show text-white":""}\n ${e.hidden?" h-0 opacity-0":""}\n ${e.buttonClassName?` ${e.buttonClassName}`:""}\n `,type:"button",id:e.id,"aria-expanded":"false",ref:n,"data-te-dropdown-toggle-ref":!0,"data-te-dropdown-animation":"off",onMouseEnter:t=>{e.atLeastOneOpenedMenu&&e.atLeastOneOpenedMenu()&&!r&&t.target.dispatchEvent(new MouseEvent("click"))},children:e.label}),d(e.isHeaderMenuItem,e.id,e.subMenuItems)]},e.id)})),d=o().memo((e=>{var t;const[n,r]=(0,a.useState)(0),[o,i]=(0,a.useState)("");function l(){r((e=>e+1))}function _(){r((e=>e-1))}function c(){return n>0}return(0,s.jsx)("div",{className:`dropdown-menu group flex ${c()?"open":""} ${null!=(t=e.className)?t:""}`,children:function(){const t=[];if(e.menuItemsProps&&e.menuItemsProps.length>0)for(const n of e.menuItemsProps)t.push((0,a.createElement)(u,Object.assign({},n,{key:n.id,increaseOpenedMenu:l,decreaseOpenedMenu:_,atLeastOneOpenedMenu:c,lastOpenedMenu:o,setLastOpenedMenu:i})));return t}()})})),g=d,p=()=>{const{anchorPoint:e,show:t,contextMenuItems:n}=(()=>{const[e,t]=(0,a.useState)({x:0,y:0}),[n,r]=(0,a.useState)(!1),[o,i]=(0,a.useState)([]),l=(0,a.useCallback)((e=>{if(e.preventDefault(),(n=e)instanceof CustomEvent&&n instanceof CustomEvent&&Object.keys(n.detail).includes("menuItems")){const n=e.detail.pageX,a=e.detail.pageY;i(e.detail.menuItems),t({x:n,y:a}),r(!0)}var n}),[r,t]),s=(0,a.useCallback)((()=>n?r(!1):null),[n]);return(0,a.useEffect)((()=>(document.addEventListener("click",s),document.addEventListener("contextmenu",l),()=>{document.removeEventListener("click",s),document.removeEventListener("contextmenu",l)}))),{anchorPoint:e,show:n,contextMenuItems:o}})(),r=(0,a.useRef)(),[o,i]=(0,a.useState)((0,s.jsx)(s.Fragment,{}));return r.current!==t&&(r.current=t),(0,a.useEffect)((()=>{void 0!==r.current&&(r.current?i((0,s.jsx)("div",{hidden:!t,className:"context-menu absolute",style:{top:e.y,left:e.x},children:(0,s.jsx)(g,{menuItemsProps:n})})):i((0,s.jsx)(s.Fragment,{})))}),[r.current]),o},b=require("js-cookie");var f=n.n(b);const m=require("react-ga4");var h=n.n(m);function w(e){const{initTE:t,initGA:n}=e,[r,o]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{(async()=>{t&&await t(),n&&function(e,t){var n;let r=f().get("CookieConsent");r=null==(n=r)?void 0:n.replace(/{/gi,'{"').replace(/:/gi,'":').replace(/,/gi,',"').replace(/'/gi,'"'),!e&&r&&JSON.parse(r).statistics&&({NODE_ENV:"production"}.NEXT_PUBLIC_GA_MEASUREMENT_ID&&h().initialize([{trackingId:{NODE_ENV:"production"}.NEXT_PUBLIC_GA_MEASUREMENT_ID,gtagOptions:{anonymize_ip:!0,send_page_view:!1}}]),t(!0)),e&&(console.debug(`Logging pageview for ${window.location.pathname}`),h().send({hitType:"pageview",page:window.location.pathname}))}(r,o)})()}),[r,n,t]),{isGAInitialized:r}}const y={CONTEXT_MENU:"contextmenu"};var v=n(489);const O="idle",S="panning";class E extends v.fabric.Canvas{constructor(e,t){super(e,t),this.gridEnabled=void 0,this.gridBgColor=void 0,T(this),R(this)}initialize(e,t){return this.gridEnabled=null==t?void 0:t.gridEnabled,T(this),R(this),!0===(null==t?void 0:t.readOnly)&&this.setReadOnly(),!0===(null==t?void 0:t.gridEnabled)&&this.enableGrid(),!0===(null==t?void 0:t.enableSnapToGrid)&&function(e,t){const n=null!=t?t:5;e.on("object:moving",(e=>{var t,r,a;null==(t=e.target)||t.set({left:Math.round((null!=(r=e.target.left)?r:0)/n)*n,top:Math.round((null!=(a=e.target.top)?a:0)/n)*n})}))}(this,t.gridSize),super.initialize(e,t)}isReadOnly(){return v.fabric.Object.prototype.lockMovementX&&v.fabric.Object.prototype.lockMovementY&&v.fabric.Object.prototype.lockRotation&&v.fabric.Object.prototype.lockScalingFlip&&v.fabric.Object.prototype.lockScalingX&&v.fabric.Object.prototype.lockScalingY&&v.fabric.Object.prototype.lockSkewingX&&v.fabric.Object.prototype.lockSkewingY}setReadOnly(){v.fabric.Object.prototype.lockMovementX=!0,v.fabric.Object.prototype.lockMovementY=!0,v.fabric.Object.prototype.lockRotation=!0,v.fabric.Object.prototype.lockScalingFlip=!0,v.fabric.Object.prototype.lockScalingX=!0,v.fabric.Object.prototype.lockScalingY=!0,v.fabric.Object.prototype.lockSkewingX=!0,v.fabric.Object.prototype.lockSkewingY=!0}setReadAndWrite(){v.fabric.Object.prototype.lockMovementX=!1,v.fabric.Object.prototype.lockMovementY=!1,v.fabric.Object.prototype.lockRotation=!1,v.fabric.Object.prototype.lockScalingFlip=!1,v.fabric.Object.prototype.lockScalingX=!1,v.fabric.Object.prototype.lockScalingY=!1,v.fabric.Object.prototype.lockSkewingX=!1,v.fabric.Object.prototype.lockSkewingY=!1}zoomIn(){this.setZoom(1.1*this.getZoom())}zoomOut(){this.setZoom(this.getZoom()/1.1)}resetZoom(){this.setZoom(1)}panLeft(){this.relativePan(new v.fabric.Point(5,0))}panRight(){this.relativePan(new v.fabric.Point(-5,0))}panUp(){this.relativePan(new v.fabric.Point(0,5))}panDown(){this.relativePan(new v.fabric.Point(0,-5))}resetPan(){this.absolutePan(new v.fabric.Point(0,0))}isGridEnabled(){var e;return null!=(e=this.gridEnabled)&&e}enableGrid(){if(!this.gridEnabled){this.gridEnabled=!0,this.gridBgColor=this.backgroundColor;const e=`\n<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160"><rect width="160" height="160" fill="${this.gridBgColor}" /><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><rect x="0.38" y="0.38" width="160" height="160" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.75px"/><line x1="0.38" y1="140.38" x2="160.38" y2="140.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="0.38" y1="120.38" x2="160.38" y2="120.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="0.38" y1="100.38" x2="160.38" y2="100.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="0.38" y1="80.38" x2="160.38" y2="80.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.5px"/><line x1="0.38" y1="60.38" x2="160.38" y2="60.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="0.38" y1="40.38" x2="160.38" y2="40.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="0.38" y1="20.38" x2="160.38" y2="20.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="140.38" y1="0.38" x2="140.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="120.38" y1="0.38" x2="120.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="100.38" y1="0.38" x2="100.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="80.38" y1="0.38" x2="80.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.5px"/><line x1="60.38" y1="0.38" x2="60.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="40.38" y1="0.38" x2="40.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="20.38" y1="0.38" x2="20.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/></g></g></svg>\n`,t=new Blob([e],{type:"image/svg+xml"}),n=URL.createObjectURL(t);v.fabric.Image.fromURL(n,(e=>{var t,n;e.scaleToWidth(null!=(t=this.width)?t:0),e.scaleToHeight(null!=(n=this.height)?n:0);const r=new v.fabric.Pattern({source:e.getElement(),repeat:"repeat"});this.setBackgroundColor(r,this.renderAll.bind(this))}))}}disableGrid(){this.gridEnabled&&(this.gridEnabled=!1,this.gridBgColor&&(this.setBackgroundColor(this.gridBgColor,this.renderAll.bind(this)),this.gridBgColor=void 0))}}function x(e){return 3===e.button}function T(e){e.on("mouse:wheel",(function(t){const n=t.e.deltaY;let r=e.getZoom();r*=.999**n,r>20&&(r=20),r<.01&&(r=.01),e.zoomToPoint({x:t.e.offsetX,y:t.e.offsetY},r),t.e.preventDefault(),t.e.stopPropagation()}))}function R(e){let t,n,r=O;e.discardActiveObject(),e.on("mouse:up",(function(t){x(t)&&(r=O,e.defaultCursor="default")})),e.on("mouse:down",(a=>{x(a)&&(e.defaultCursor="move",r=S,t=a.e.clientX,n=a.e.clientY)})),e.on("mouse:move",(a=>{if(r===S&&a&&a.e){let r=0,o=0;t&&(r=a.e.clientX-t),n&&(o=a.e.clientY-n),t=a.e.clientX,n=a.e.clientY;const i=new v.fabric.Point(r,o);e.relativePan(i),e.fire("moved")}}))}var C=n(416),I=n(454);const D=["icon","classNameIcon","classNameContent"],k=o().memo((e=>{const{icon:t,classNameIcon:n,classNameContent:r}=e,a=(0,C.A)(e,D),o=(0,I.Cp)(e);return(0,s.jsxs)("button",Object.assign({},a,o,{className:`${e.className} text-accent-secondary hover:text-accent-primary [&.active]:text-accent-primary disabled:hover:text-accent-secondary disabled:opacity-50`,children:[(0,s.jsx)(l.FontAwesomeIcon,{icon:null!=t?t:i.faXmark,className:null!=n?n:""}),(0,s.jsx)("div",{className:r,children:e.children})]}))}));require("@tanstack/react-table"),n(61);const L=o().memo((e=>{const{className:t}=e;return(0,s.jsx)("div",{className:`inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite] ${t}`,role:"status",children:(0,s.jsx)("span",{className:"!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]",children:"Loading..."})})})),N=["children","isLoading","disabled"],A=o().memo((e=>{const t=(0,I.Cp)(e),{children:n,isLoading:r,disabled:a}=e,o=(0,C.A)(e,N);return(0,s.jsxs)("button",Object.assign({},o,t,{disabled:a||r,type:"button","data-te-toggle":"button",className:`button--primary inline-block min-w-[75px] rounded px-5 py-2 text-xs font-medium uppercase leading-tight shadow-md transition duration-75 ease-in-out hover:shadow-lg focus:shadow-lg focus:outline-none focus:ring-0 active:shadow-lg ${e.className}`,children:[r&&(0,s.jsx)(L,{className:"icon !h-4 !w-4"}),!r&&n]}))})),j="modalRoot";var F=n(221);const M=["key"],P="hidden.te.modal";function z(e){const t=[];return"boolean"!=typeof e&&e&&e.forEach(((e,n,r)=>{const a=(0,I.Cp)(e),{key:o}=e,i=(0,C.A)(e,M);t.push((0,s.jsx)(A,Object.assign({},i,a,{className:`${0!==n&&r.length>1?"ml-3":""} ${e.className}`}),o))})),t}const B=(0,a.forwardRef)(((e,t)=>{var n;const{id:r,onHiddenModal:o}=e,_=null!=(n=e.size)?n:"md",c=(0,a.useRef)();return(0,a.useEffect)((()=>{function e(){o&&o()}const t=document.getElementById(r);return!c.current&&t&&(c.current=new F.Modal(t)),t&&t.addEventListener(P,e),()=>{t&&t.removeEventListener(P,e)}}),[r,o]),(0,a.useImperativeHandle)(t,(()=>({showModal:()=>{c.current.show()},hideModal:()=>{c.current.hide(),c.current=void 0}}))),(0,s.jsx)("div",{"data-te-modal-init":!0,className:"fixed left-0 top-8 bottom-0 z-[1055] hidden h-auto w-full overflow-y-auto overflow-x-hidden outline-none",id:r,tabIndex:-1,"aria-labelledby":`${r}Label`,children:(0,s.jsx)("div",{"data-te-modal-dialog-ref":!0,className:"pointer-events-none relative flex min-h-[calc(100%-1rem)] w-auto translate-y-[-50px] items-center justify-center opacity-0 transition-all duration-300 ease-in-out min-[576px]:mx-5 min-[576px]:my-7 min-[576px]:min-h-[calc(100%-3.5rem)]",children:(0,s.jsxs)("div",{className:`pointer-events-auto relative flex ${(()=>{switch(_){case"sm":return"w-[25rem]";case"md":return"w-[40rem]";case"lg":return"w-[70rem]";case"full":return"w-full"}})()} ${"full"===e.size?"mx-5":""} bg-primary flex-col rounded-md border-none bg-clip-padding text-current shadow-lg outline-none`,children:[(0,s.jsxs)("div",{className:"border-secondary flex flex-shrink-0 items-center justify-between rounded-t-md border-b-2 border-opacity-50 p-4",children:[(0,s.jsx)("h5",{className:"text-accent-primary text-xl font-medium leading-normal pointer-events-none",id:`${r}Label`,children:e.title}),(0,s.jsx)("button",{type:"button",className:"box-content rounded-none border-none hover:no-underline hover:opacity-75 focus:opacity-100 focus:shadow-none focus:outline-none","data-te-modal-dismiss":!0,"aria-label":"Close",children:(0,s.jsx)(l.FontAwesomeIcon,{icon:i.faXmark})})]}),"boolean"!=typeof e.buttons&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"modal__body",children:e.body}),(0,s.jsx)("div",{className:"modal__footer",children:z(e.buttons)})]}),"boolean"==typeof e.buttons&&e.body]})})})})),H=require("react-dom");function W(){const[e,t]=(0,a.useState)(),[n,r]=(0,a.useState)(!0),o=(0,a.useRef)(null);return(0,a.useEffect)((()=>{o.current&&(n?o.current.showModal():o.current.hideModal())}),[e,n]),{modal:e,showModal:function(e){const n=document.getElementById(j);n&&(t((0,H.createPortal)((0,s.jsx)(B,Object.assign({},e,{ref:o,onHiddenModal:()=>{t(void 0)}})),n)),r(!0))},hideModal:function(){r(!1)}}}const X=["label","info","allowedChars","classNameRoot","key"],Y=o().memo((e=>{const[t,n]=(0,a.useState)(e.value),{info:r,classNameRoot:o,key:i}=e,l=(0,C.A)(e,X),_=(0,I.Cp)(e);return(0,a.useEffect)((()=>{n(e.value)}),[e.value]),(0,s.jsxs)("div",{className:`relative mb-3 ${null!=o?o:""}`,children:[(0,s.jsx)("input",Object.assign({maxLength:200},l,_,{onChange:function(r){!e.allowedChars||""===r.currentTarget.value||e.allowedChars.test(r.currentTarget.value)?(n(r.currentTarget.value),e.onChange&&e.onChange(r)):t&&(r.currentTarget.value=t.toString())},"data-te-input-state-active":!0,className:`peer transition-all duration-200 ease-linear placeholder:opacity-0 motion-reduce:transition-none ${e.className}`,placeholder:e.label}),i),(0,s.jsx)("label",{htmlFor:e.id,className:(null!=t&&""!==t?"input__label -translate-y-[1.1rem] scale-[0.9]":"")+" peer-focus:text-link peer-focus:input__label pointer-events-none absolute left-3 top-0 mb-0 max-w-[90%] origin-[0_0] truncate pt-[0.37rem] leading-[1.6] drop-shadow-[0_35px_35px_rgba(0,0,0,0.25)] transition-all duration-200 ease-out peer-focus:-translate-y-[1.1rem] peer-focus:scale-[0.9] motion-reduce:transition-none",children:e.label}),r&&(0,s.jsx)("div",{className:"text-sm px-3 mt-1",children:r})]})})),Z=["label","className","key"],$=o().memo((e=>{const{label:t,className:n,key:r}=e,o=(0,C.A)(e,Z),i=(0,I.Cp)(e);return(0,a.useEffect)((()=>{const t=document.querySelector(`#${e.id}`);F.Select.getInstance(t)||new F.Select(document.querySelector(`#${e.id}`),{},{dropdown:"select__dropdown",formCheckInput:"bg-red-400 checked:after:border-red-500",selectInput:"peer select__input",selectOption:"select__option data-[te-select-option-selected]:data-[te-input-state-active]:link",selectLabelSizeDefault:"select__label-size-default",selectLabel:"select__label",selectArrow:"select__arrow top-[0.65rem]"})})),(0,s.jsxs)("div",{className:`relative mb-3 ${n}`,children:[(0,s.jsx)("select",Object.assign({"data-te-select-init":!0},o,i,{children:function(){const t=[];return e.options.forEach((e=>{var n;t.push((0,s.jsx)("option",{value:e.value,children:e.label},null==(n=e.value)?void 0:n.toString()))})),t}()}),r),(0,s.jsx)("label",{"data-te-select-label-ref":!0,children:t})]})})),G=(require("react-html-parser"),o().memo((({tags:e,className:t})=>(0,s.jsx)("ul",{className:`tags ${null!=t?t:""}`,children:e.map(((e,t)=>(0,s.jsx)("li",{children:e},t)))})))),U=(require("@yaireo/tagify"),e=>{var t;const{className:n,options:r}=e;return(0,s.jsx)("div",{className:`flex justify-center ${null!=n?n:""}`,id:null!=(t=e.id)?t:"",children:r.map(((t,n)=>(0,s.jsxs)("div",{className:"mb-[0.125rem] me-4 inline-block min-h-[1.5rem] ps-[1.5rem]",children:[(0,s.jsx)("input",{className:"relative float-left -ms-[1.5rem] me-1 mt-0.5 h-5 w-5 appearance-none rounded-full border-2 border-solid border-secondary-500 before:pointer-events-none before:absolute before:h-4 before:w-4 before:scale-0 before:rounded-full before:bg-transparent before:opacity-0 before:shadow-checkbox before:shadow-transparent before:content-[''] after:absolute after:z-[1] after:block after:h-4 after:w-4 after:rounded-full after:content-[''] checked:border-accent-secondary checked:before:opacity-[0.16] checked:after:absolute checked:after:left-1/2 checked:after:top-1/2 checked:after:h-[0.625rem] checked:after:w-[0.625rem] checked:after:rounded-full checked:after:border-accent-secondary checked:after:bg-accent-primary checked:after:content-[''] checked:after:[transform:translate(-50%,-50%)] hover:before:opacity-[0.04] hover:before:shadow-black/60 focus:shadow-none focus:outline-none focus:ring-0 focus:before:scale-100 focus:before:opacity-[0.12] focus:before:shadow-black/60 focus:before:transition-[box-shadow_0.2s,transform_0.2s] checked:focus:border-accent-secondary checked:focus:before:scale-100 checked:focus:before:shadow-checkbox checked:focus:before:transition-[box-shadow_0.2s,transform_0.2s] rtl:float-right "+(e.disabled?"":"hover:cursor-pointer"),type:"radio",name:`inlineRadioOptions-${e.id}`,id:`option-${e.id}-${n}`,value:JSON.stringify(t.value),onChange:()=>{e.onChange(t.value)},checked:JSON.stringify(t.value)===JSON.stringify(e.value),disabled:e.disabled}),(0,s.jsx)("label",{className:"mt-px inline-block ps-[0.15rem] "+(e.disabled?"":"hover:cursor-pointer"),htmlFor:e.disabled?void 0:`option-${e.id}-${n}`,children:t.label})]},`radioOption${n}`)))})});require("react-color"),n(735),n(691),n(423),require("react-router-dom")},53:e=>{e.exports=require("@fortawesome/react-fontawesome")},61:e=>{e.exports=require("react-i18next")},177:e=>{e.exports=require("@fortawesome/free-solid-svg-icons")},196:(e,t,n)=>{var r=n(457);e.exports=n.v(t,e.id,"1b07b76204f7689b9a0c",{"./mina_react_bg.js":{__wbg_log_c222819a41e063d3:r.pR9,__wbg_info_3daf2e093e091b66:r.ZrD,__wbg_warn_4ca3906c248c47c4:r.jwJ,__wbg_debug_3cb59063b29f58c1:r.F$t,__wbg_error_524f506f44df1645:r.pWA,__wbindgen_string_new:r.ycJ,__wbindgen_string_get:r.qNE,__wbindgen_bigint_get_as_i64:r.DMD,__wbindgen_memory:r.Py0,__wbindgen_throw:r.Qnr,__wbindgen_debug_string:r.rl,__wbg_new_5e0be73521bc8c17:r.aIY,__wbg_new_78feb108b6472713:r.M2,__wbindgen_number_new:r.QRK,__wbg_new_405e22f390576ce2:r.va5,__wbg_newnoargs_105ed471475aaf50:r.VrZ,__wbg_new_a12002a7f91c75be:r.vVD,__wbg_stringify_f7ed6987935b4a24:r.Y6F,__wbindgen_is_function:r.PRY,__wbindgen_is_string:r.GuA,__wbindgen_is_object:r.qvD,__wbg_next_25feadfc0913fea9:r.yqB,__wbg_buffer_609cc3eee51ed158:r.FHK,__wbg_byteLength_e674b853d9c77e1d:r.x6W,__wbg_byteOffset_fd862df290ef848d:r.cyg,__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a:r.hI8,__wbg_length_a446193dc22c12f8:r.eIr,__wbg_set_65595bdd868b3009:r.HBq,__wbg_newwithlength_a381634e90c276d4:r.HtP,__wbg_buffer_09165b52af8c5237:r._Ue,__wbg_subarray_aa9065fa9dc5df96:r.TOc,__wbg_done_769e5ede4b31c67b:r.Xb8,__wbg_value_cd1ffa7b1ab794f1:r.LMq,__wbg_next_c3ab0d59847b3b5c:r.tER,__wbg_instanceof_Error_4d54113b22d20306:r.fcg,__wbg_instanceof_Uint8Array_17156bcf118086a9:r.SJf,__wbg_instanceof_ArrayBuffer_e14585432e3737fc:r.gGA,__wbg_set_8fc6bf8a5b1071d1:r.iAh,__wbg_get_b9b93047fe3cf45b:r.RKz,__wbg_set_37837023f3d740e8:r.p8e,__wbg_length_e2d2a49132c1b256:r.Ry,__wbg_push_737cfc8c1432c2c6:r.tZf,__wbg_isArray_a1eab7e0d067391b:r.uod,__wbg_new_c68d7209be747379:r.wd3,__wbg_message_97a2af9b89d693a3:r.oGe,__wbg_isSafeInteger_343e2beeeece1bb0:r.Yb6,__wbg_entries_3265d4158b33e5dc:r.gHg,__wbg_iterator_9a24c88df860dc65:r.eW0,__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0:r.w6e,__wbindgen_is_undefined:r.vUM,__wbg_call_672a4d21634d4a24:r.wHY,__wbg_static_accessor_SELF_37c5d418e4bf5819:r.fb$,__wbg_static_accessor_GLOBAL_88a902d13a557d07:r.ii7,__wbg_static_accessor_WINDOW_5de37043a91a9c40:r.x0C,__wbg_new_23a2665fac83c611:r.c6u,__wbg_then_44b73946d2fb3e7d:r.GQG,__wbg_then_48b406749878a531:r.xV_,__wbg_resolve_4851785c9c5f573d:r.wJz,__wbg_call_7cccdd69e0791ae2:r.w9h,__wbg_next_6574e1a8a62d1055:r.Dn4,__wbindgen_number_get:r.sWe,__wbg_get_67b2ba62fc30de12:r.dzD,__wbg_instanceof_FileSystemFileHandle_d3d037cf85ee546c:r.KA3,__wbg_createWritable_b4ed240dc879905e:r.kPb,__wbg_getFile_2607bc0123c724e0:r.ycy,__wbg_setkeepexistingdata_ee7c8cb466e9477f:r.aKt,__wbg_component_unwrap:r.dT0,__wbindgen_jsval_loose_eq:r.U8c,__wbindgen_boolean_get:r.NhE,__wbindgen_as_number:r.qmw,__wbindgen_error_new:r.RjG,__wbg_getwithrefkey_2d7fdfea9645a25b:r.A2U,__wbg_set_2873a5cee2324875:r.v1k,__wbg_String_1b2069caba3b9783:r.JF5,__wbindgen_bigint_from_u64:r.Qg3,__wbg_point_new:r.nA9,__wbg_diagramelementspec_new:r.Dr_,__wbg_shape_new:r._cl,__wbg_person_new:r.c1W,__wbg_softwaresystem_new:r.dM0,__wbg_boundary_new:r.HCo,__wbg_container_new:r.e57,__wbg_component_new:r.WJm,__wbg_deploymentnode_new:r.ezj,__wbg_relationship_new:r.NpJ,__wbg_minaerror_new:r.EkI,__wbg_new_8a6f238a6ece86ea:r.$Pc,__wbg_stack_0ed75d68575b0f3c:r.x$X,__wbg_error_7534b8e9a36f1ab4:r.WYM,__wbg_queueMicrotask_97d92b4fcc8a61c5:r._mt,__wbg_queueMicrotask_d3219def82552485:r.k2R,__wbindgen_cb_drop:r.LCp,__wbg_person_unwrap:r.Xv$,__wbg_container_unwrap:r.xB8,__wbg_new_e25e5aab09ff45db:r.RG9,__wbg_abort_775ef1d17fc65868:r.gMQ,__wbg_signal_aaf9ad74119f20a4:r.CF8,__wbg_seek_3f0f8d7591f648d7:r.Zk3,__wbg_write_397d977609afc729:r.Vob,__wbg_instanceof_Window_def73ea0955fc569:r.vF0,__wbg_get_79e1d7592116244e:r.X_o,__wbg_set_d9a72c1550e3f2b5:r.pdH,__wbg_enqueue_bb16ba72f537dc9e:r.QHd,__wbg_close_304cc1fef3466669:r.oaw,__wbg_close_24caca68e93b9c03:r.jeC,__wbg_setcreate_139bad94b2874fb5:r.kF0,__wbg_setrecursive_536113a081d6177a:r.ugc,__wbg_postMessage_83a8d58d3fcb6c13:r.A2$,__wbg_instanceof_File_a4e2256bf71955a9:r.gjJ,__wbg_lastModified_7a9e61b3961224b8:r.gvw,__wbg_has_a5ea9117f258a0ec:r.HSm,__wbg_fetch_4465c2b10f21a927:r.o0R,__wbg_fetch_509096533071c657:r.gRe,__wbg_newwithstrandinit_06c535e0a867c635:r.heb,__wbg_byobRequest_77d9adf63337edfb:r.JpR,__wbg_close_5ce03e29be453811:r.sQY,__wbg_append_299d5d48292c0495:r.cVx,__wbg_append_b44785ebeb668479:r.d_N,__wbg_append_b2d1fc16de2a0e81:r.WqA,__wbg_new_9fd39a253424609a:r.z09,__wbg_respond_1f279fa9f8edcb1c:r.dSQ,__wbg_view_fd8a56e8983f448d:r.NgT,__wbg_instanceof_FileSystemDirectoryHandle_0906fc139d75557b:r.Cjr,__wbg_removeEntry_9f6bc325e3383e59:r.m_N,__wbg_removeEntry_a424e90dff229b19:r.lkn,__wbg_getFileHandle_5fb877d1ecc74d52:r.Wkh,__wbg_getDirectoryHandle_c48a138373d79b3d:r.kTu,__wbg_entries_19efe296f7d36df9:r.RCF,__wbg_setcreate_4ca762e23d9f78da:r.N9Q,__wbg_settype_39ed370d3edd403c:r.a4S,__wbg_name_e4a115def9e2bbaa:r.Yeo,__wbg_arrayBuffer_f18c144cd0125f07:r.RGi,__wbg_newwithu8arraysequenceandoptions_068570c487f69127:r.qe7,__wbg_size_3808d41635a9c259:r.$CF,__wbg_text_1f39a8afe3c70a99:r.CFe,__wbg_crypto_ed58b8e10a292839:r.ilI,__wbg_process_5c1d670bc53614b8:r.Evb,__wbg_versions_c71aa1626a93e0a1:r.ooJ,__wbg_node_02999533c4ea02e3:r.OtZ,__wbg_require_79b1e9274cde3c87:r.Ltb,__wbg_msCrypto_0a36e2ec3a343d26:r.HOd,__wbg_randomFillSync_ab2cfe79ebbf2740:r.NNx,__wbg_getRandomValues_bcb4912f16000dc4:r.FGp,__wbg_relationship_unwrap:r.KM7,__wbg_instanceof_Response_f2cc20d9f7dfd644:r.Hzn,__wbg_arrayBuffer_d1b44c4390db422f:r._iy,__wbg_url_ae10c34ca209681d:r.Tp3,__wbg_status_f6360336ca686bf0:r.kK3,__wbg_headers_9cb51cfd2ac780a4:r.Moj,__wbg_setmethod_3c5280fe5d890842:r._hX,__wbg_setsignal_75b21ef3a81de905:r.l0x,__wbg_setcredentials_c3a22f1cd105a2c6:r.uw1,__wbg_setheaders_834c0bdb6a8949ad:r.rk2,__wbg_setbody_5923b78a95eedf29:r.Nhd,__wbg_setmode_5dc300b865044b65:r.BFX,__wbg_new_018dcc2d6c8c2f6a:r.RR8,__wbg_append_8c7dd8d641a5f01b:r.Tbm,__wbg_localStorage_1406c99c39728187:r.x8V,__wbg_softwaresystem_unwrap:r.qre,__wbg_shape_unwrap:r.D7n,__wbg_deploymentnode_unwrap:r._Zx,__wbg_point_unwrap:r._QJ,__wbg_boundary_unwrap:r.Wq,__wbg_diagramelementspec_unwrap:r.W3f,__wbindgen_jsval_eq:r.BGI,__wbindgen_in:r.zEy,__wbindgen_is_bigint:r.YkQ,__wbindgen_closure_wrapper1249:r.nJO,__wbindgen_init_externref_table:r.bLn}})},221:e=>{e.exports=require("tw-elements")},334:(e,t,n)=>{n.a(e,(async(e,r)=>{try{n.r(t),n.d(t,{MinaReact:()=>d,default:()=>g});var a=n(764),o=n(39),i=n(454),l=n(15),s=n(507),_=n(519),c=n(732),u=e([s,_]);[s,_]=u.then?(await u)():u,(0,i.aC)();const d=e=>{var t;const{projectRootUrl:r,diagramUrl:i,ghToken:u}=e;(0,o.T_)({initTE:async function(){const{initTE:e,Dropdown:t}=await Promise.resolve().then(n.t.bind(n,221,23));await e({Dropdown:t})}});const d=(0,l.useRef)(null),[g,p]=(0,l.useState)(),[b,f]=(0,l.useState)(),[m,h]=(0,l.useState)(),w={onOpenDiagramClick:e=>{let t;try{t=(0,_.qjW)(r,e)}catch(e){console.error(e),y("Invalid URL: the provided URL is an invalid Mina project or diagram.")}t&&v(t)},onOpenExternalLinkClick:e=>{window.open(e,"_blank")}};function y(e){p(null),h(e)}async function v(e){var t,n,a,o;let i;null==(t=d.current)||t.resetCanvas();try{i=await(0,s.wS)(r,e,u)}catch(e){const t=e;if(!(t.message&&t.message.replace(/ /g,"").length>0))throw new Error;y(t.message)}if(null!=(n=i)&&n.projectSettingsJson&&null!=(a=i)&&a.plantuml&&null!=(o=i)&&o.spec)try{f(JSON.parse(i.projectSettingsJson));const t=await(0,_.Oxg)(r,e,i.plantuml,i.spec);p(t)}catch(e){y("Invalid diagram or project settings.")}}(0,l.useEffect)((()=>{y(null),v(i)}),[i,r,u]);return(0,c.jsxs)("div",{className:"h-full w-full border-t flex items-center",children:[(0,c.jsx)(o.rI,{menuItemsProps:[{id:"dropdown-init",label:"",isHeaderMenuItem:!0,subMenuItems:[{id:"dropdown-init-1",label:""}]}],className:"hidden"}),(0,c.jsx)(o.tz,{}),null===m&&g&&(0,c.jsx)(a.D,{diagramListener:w,diagram:g,ref:d,diagramsThemeSettings:null==b||null==(t=b.themes_settings)?void 0:t.diagrams_theme_settings,target:"web",readOnly:!0}),m&&(0,c.jsx)("div",{className:"w-full text-center text-black",children:m})]})},g=d;r()}catch(e){r(e)}}))},416:(e,t,n)=>{function r(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}n.d(t,{A:()=>r})},423:e=>{e.exports=require("change-case")},452:e=>{e.exports=require("pluralize")},454:(e,t,n)=>{n.d(t,{mg:()=>_,Cp:()=>r,qI:()=>g,aC:()=>b,l:()=>u,$r:()=>s,cr:()=>p,wF:()=>d,x4:()=>c});const r=(e={})=>Object.keys(e).reduce(((t,n)=>(n.startsWith("data-")&&(t[n]=e[n]),t)),{}),a=require("fast-deep-equal/es6/react");var o=n.n(a);const i=require("lodash.clonedeep");var l=n.n(i);const s=(e,t)=>o()(e,t),_=e=>l()(e);function c(e){return e?e.replace(/\\n/g,"\n").replace(/\\t/g," ").replace(/\\r/g,"\n"):void 0}function u(e){return e.sort(((e,t)=>t.length-e.length))[0]}function d(e,t=96){return Number.parseFloat((e/t).toFixed(2))}function g(e,t=96){return Number.parseFloat((e*t).toFixed(2))}function p(e,t=96){return Number.parseFloat((e*(t/72)).toFixed(2))}function b(){console.log=()=>{},console.debug=()=>{}}require("jszip")},457:(e,t,n)=>{let r;function a(e){r=e}n.d(t,{$CF:()=>xn,$Pc:()=>Rt,A2$:()=>Zt,A2U:()=>Qe,BFX:()=>hn,BGI:()=>ir,CF8:()=>En,CFe:()=>Fn,Cjr:()=>at,D7n:()=>Sn,DMD:()=>Gn,Dn4:()=>Pt,Dr_:()=>je,EkI:()=>wt,Evb:()=>$t,F$t:()=>Le,FGp:()=>Ue,FHK:()=>me,GQG:()=>Mn,GuA:()=>ar,HBq:()=>sn,HCo:()=>pe,HOd:()=>yt,HSm:()=>Ke,HtP:()=>At,Hzn:()=>lt,JD7:()=>R,JF5:()=>ie,JpR:()=>he,KA3:()=>ot,KM7:()=>Qt,LCp:()=>qn,LMq:()=>Bn,Llp:()=>x,Ltb:()=>tn,M2:()=>Tt,Moj:()=>et,N9Q:()=>gn,NNx:()=>Vt,NgT:()=>Wn,NhE:()=>Un,Nhd:()=>un,NpJ:()=>Jt,OtZ:()=>Bt,Oxg:()=>S,PRY:()=>nr,Py0:()=>sr,QHd:()=>Pe,QRK:()=>cr,Qg3:()=>$n,Qnr:()=>gr,RCF:()=>ze,RG9:()=>kt,RGi:()=>ge,RKz:()=>Je,RR8:()=>Ot,RjG:()=>Qn,Ry:()=>bt,SJf:()=>st,TOc:()=>jn,Tbm:()=>_e,Tp3:()=>zn,U8c:()=>lr,Vob:()=>Yn,VrZ:()=>Lt,W3f:()=>Fe,WJm:()=>Te,WYM:()=>We,Wkh:()=>$e,Wq:()=>be,WqA:()=>ce,X_o:()=>Ve,Xb8:()=>Me,Xv$:()=>Wt,Y6F:()=>An,Yb6:()=>ut,Yeo:()=>vt,YkQ:()=>tr,Zk3:()=>an,ZrD:()=>tt,_Cc:()=>C,_QJ:()=>Yt,_Ue:()=>fe,_Zx:()=>Ae,_cl:()=>On,_hX:()=>mn,_iy:()=>de,_mt:()=>Ut,a4S:()=>vn,aIY:()=>xt,aKt:()=>fn,bLn:()=>er,c1W:()=>Ht,c6u:()=>St,cVx:()=>se,cyg:()=>ye,dM0:()=>Tn,dSQ:()=>rn,dT0:()=>Re,d_N:()=>ue,dzD:()=>qe,e57:()=>Ce,eIr:()=>pt,eW0:()=>dt,ezj:()=>Ne,fb$:()=>kn,fcg:()=>rt,gGA:()=>nt,gHg:()=>Be,gMQ:()=>le,gRe:()=>Ye,gjJ:()=>it,gvw:()=>gt,hI8:()=>Nt,heb:()=>jt,iAh:()=>_n,ii7:()=>In,ilI:()=>ke,jeC:()=>Se,jwJ:()=>Xn,k2R:()=>qt,kF0:()=>dn,kK3:()=>Nn,kPb:()=>De,kTu:()=>Ze,l0x:()=>yn,lIU:()=>a,lkn:()=>en,m_N:()=>Kt,nA9:()=>Xt,nJO:()=>Vn,o0R:()=>Xe,oGe:()=>ht,oaw:()=>Ee,ooJ:()=>Hn,p8e:()=>ln,pR9:()=>mt,pWA:()=>He,pdH:()=>cn,qNE:()=>ur,qe7:()=>Ft,qjW:()=>T,qmw:()=>Zn,qre:()=>Rn,qvD:()=>rr,rk2:()=>bn,rl:()=>Jn,sQY:()=>xe,sWe:()=>_r,tER:()=>zt,tZf:()=>Gt,ugc:()=>wn,uod:()=>ct,uw1:()=>pn,v1k:()=>on,vF0:()=>_t,vUM:()=>or,vVD:()=>It,va5:()=>Et,w6e:()=>Dn,w9h:()=>Oe,wHY:()=>ve,wJz:()=>nn,wd3:()=>Dt,x$X:()=>Cn,x0C:()=>Ln,x6W:()=>we,x8V:()=>ft,xB8:()=>Ie,xV_:()=>Pn,ycJ:()=>dr,ycy:()=>Ge,yqB:()=>Mt,z09:()=>Ct,zEy:()=>Kn}),e=n.hmd(e);let o=0,i=null;function l(){return null!==i&&0!==i.byteLength||(i=new Uint8Array(r.memory.buffer)),i}let s=new("undefined"==typeof TextEncoder?(0,e.require)("util").TextEncoder:TextEncoder)("utf-8");const _="function"==typeof s.encodeInto?function(e,t){return s.encodeInto(e,t)}:function(e,t){const n=s.encode(e);return t.set(n),{read:e.length,written:n.length}};function c(e,t,n){if(void 0===n){const n=s.encode(e),r=t(n.length,1)>>>0;return l().subarray(r,r+n.length).set(n),o=n.length,r}let r=e.length,a=t(r,1)>>>0;const i=l();let c=0;for(;c<r;c++){const t=e.charCodeAt(c);if(t>127)break;i[a+c]=t}if(c!==r){0!==c&&(e=e.slice(c)),a=n(a,r,r=c+3*e.length,1)>>>0;const t=l().subarray(a+c,a+r);c+=_(e,t).written,a=n(a,r,c,1)>>>0}return o=c,a}let u=null;function d(){return(null===u||!0===u.buffer.detached||void 0===u.buffer.detached&&u.buffer!==r.memory.buffer)&&(u=new DataView(r.memory.buffer)),u}let g=new("undefined"==typeof TextDecoder?(0,e.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});function p(e,t){return e>>>=0,g.decode(l().subarray(e,e+t))}function b(e){const t=r.__externref_table_alloc();return r.__wbindgen_export_4.set(t,e),t}function f(e,t){try{return e.apply(this,t)}catch(e){const t=b(e);r.__wbindgen_exn_store(t)}}function m(e){return null==e}g.decode();const h="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>{r.__wbindgen_export_6.get(e.dtor)(e.a,e.b)}));function w(e){const t=typeof e;if("number"==t||"boolean"==t||null==e)return`${e}`;if("string"==t)return`"${e}"`;if("symbol"==t){const t=e.description;return null==t?"Symbol":`Symbol(${t})`}if("function"==t){const t=e.name;return"string"==typeof t&&t.length>0?`Function(${t})`:"Function"}if(Array.isArray(e)){const t=e.length;let n="[";t>0&&(n+=w(e[0]));for(let r=1;r<t;r++)n+=", "+w(e[r]);return n+="]",n}const n=/\[object ([^\]]+)\]/.exec(toString.call(e));let r;if(!(n&&n.length>1))return toString.call(e);if(r=n[1],"Object"==r)try{return"Object("+JSON.stringify(e)+")"}catch(e){return"Object"}return e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:r}function y(e,t){e>>>=0;const n=d(),a=[];for(let o=e;o<e+4*t;o+=4)a.push(r.__wbindgen_export_4.get(n.getUint32(o,!0)));return r.__externref_drop_slice(e,t),a}function v(e,t){const n=t(4*e.length,4)>>>0;for(let t=0;t<e.length;t++){const r=b(e[t]);d().setUint32(n+4*t,r,!0)}return o=e.length,n}function O(e,t){if(!(e instanceof t))throw new Error(`expected instance of ${t.name}`)}function S(e,t,n,a){return r.open_remote_diagram(e,t,n,a)}function E(e){const t=r.__wbindgen_export_4.get(e);return r.__externref_table_dealloc(e),t}function x(e,t){let n,a;try{const s=c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),_=o,u=c(t,r.__wbindgen_malloc,r.__wbindgen_realloc),d=o,g=r.diagram_plantuml_url_from_diagram_url(s,_,u,d);var i=g[0],l=g[1];if(g[3])throw i=0,l=0,E(g[2]);return n=i,a=l,p(i,l)}finally{r.__wbindgen_free(n,a,1)}}function T(e,t){let n,a;try{const s=c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),_=o,u=c(t,r.__wbindgen_malloc,r.__wbindgen_realloc),d=o,g=r.diagram_url_from_link_string(s,_,u,d);var i=g[0],l=g[1];if(g[3])throw i=0,l=0,E(g[2]);return n=i,a=l,p(i,l)}finally{r.__wbindgen_free(n,a,1)}}function R(e,t){let n,a;try{const s=c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),_=o,u=c(t,r.__wbindgen_malloc,r.__wbindgen_realloc),d=o,g=r.diagram_spec_url_from_diagram_url(s,_,u,d);var i=g[0],l=g[1];if(g[3])throw i=0,l=0,E(g[2]);return n=i,a=l,p(i,l)}finally{r.__wbindgen_free(n,a,1)}}function C(e){let t,n;try{const a=c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),i=o,l=r.project_settings_url(a,i);return t=l[0],n=l[1],p(l[0],l[1])}finally{r.__wbindgen_free(t,n,1)}}function I(e,t,n){r.closure138_externref_shim(e,t,n)}const D=["omit","same-origin","include"],k=["same-origin","no-cors","cors","navigate"];"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_aisettings_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_addelementtag_free(e>>>0,1)));const L="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_baseelement_free(e>>>0,1)));class N{static __wrap(e){e>>>=0;const t=Object.create(N.prototype);return t.__wbg_ptr=e,L.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,L.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_baseelement_free(e,0)}get alias(){const e=r.__wbg_get_baseelement_alias(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set alias(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_baseelement_alias(this.__wbg_ptr,t,n)}get label(){const e=r.__wbg_get_baseelement_label(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set label(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_baseelement_label(this.__wbg_ptr,t,n)}get description(){const e=r.__wbg_get_baseelement_description(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set description(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_baseelement_description(this.__wbg_ptr,t,n)}get sprite(){const e=r.__wbg_get_baseelement_sprite(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set sprite(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_baseelement_sprite(this.__wbg_ptr,t,n)}get tags(){const e=r.__wbg_get_baseelement_tags(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set tags(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_baseelement_tags(this.__wbg_ptr,t,n)}get link(){const e=r.__wbg_get_baseelement_link(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set link(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_baseelement_link(this.__wbg_ptr,t,n)}get uuid(){const e=r.__wbg_get_baseelement_uuid(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set uuid(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_baseelement_uuid(this.__wbg_ptr,t,n)}get notes(){const e=r.__wbg_get_baseelement_notes(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set notes(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_baseelement_notes(this.__wbg_ptr,t,n)}}const A="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_boundary_free(e>>>0,1)));class j{static __wrap(e){e>>>=0;const t=Object.create(j.prototype);return t.__wbg_ptr=e,A.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof j?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,A.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_boundary_free(e,0)}get base_data(){const e=r.__wbg_get_boundary_base_data(this.__wbg_ptr);return N.__wrap(e)}set base_data(e){O(e,N);var t=e.__destroy_into_raw();r.__wbg_set_boundary_base_data(this.__wbg_ptr,t)}get boundary_type(){return r.__wbg_get_boundary_boundary_type(this.__wbg_ptr)}set boundary_type(e){r.__wbg_set_boundary_boundary_type(this.__wbg_ptr,m(e)?0:b(e))}get boundary_custom_type(){const e=r.__wbg_get_boundary_boundary_custom_type(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set boundary_custom_type(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_addelementtag_legend_sprite(this.__wbg_ptr,t,n)}get sub_elements(){const e=r.__wbg_get_boundary_sub_elements(this.__wbg_ptr);var t=y(e[0],e[1]).slice();return r.__wbindgen_free(e[0],4*e[1],4),t}set sub_elements(e){const t=v(e,r.__wbindgen_malloc),n=o;r.__wbg_set_boundary_sub_elements(this.__wbg_ptr,t,n)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_c4elements_free(e>>>0,1)));const F="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_component_free(e>>>0,1)));class M{static __wrap(e){e>>>=0;const t=Object.create(M.prototype);return t.__wbg_ptr=e,F.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof M?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,F.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_component_free(e,0)}get base_data(){const e=r.__wbg_get_component_base_data(this.__wbg_ptr);return N.__wrap(e)}set base_data(e){O(e,N);var t=e.__destroy_into_raw();r.__wbg_set_component_base_data(this.__wbg_ptr,t)}get technology(){const e=r.__wbg_get_component_technology(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set technology(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_component_technology(this.__wbg_ptr,t,n)}get component_type(){return r.__wbg_get_component_component_type(this.__wbg_ptr)}set component_type(e){r.__wbg_set_component_component_type(this.__wbg_ptr,m(e)?0:b(e))}}const P="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_container_free(e>>>0,1)));class z{static __wrap(e){e>>>=0;const t=Object.create(z.prototype);return t.__wbg_ptr=e,P.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof z?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,P.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_container_free(e,0)}get base_data(){const e=r.__wbg_get_container_base_data(this.__wbg_ptr);return N.__wrap(e)}set base_data(e){O(e,N);var t=e.__destroy_into_raw();r.__wbg_set_container_base_data(this.__wbg_ptr,t)}get technology(){const e=r.__wbg_get_container_technology(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set technology(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_container_technology(this.__wbg_ptr,t,n)}get container_type(){return r.__wbg_get_container_container_type(this.__wbg_ptr)}set container_type(e){r.__wbg_set_container_container_type(this.__wbg_ptr,m(e)?0:b(e))}}const B="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_deploymentnode_free(e>>>0,1)));class H{static __wrap(e){e>>>=0;const t=Object.create(H.prototype);return t.__wbg_ptr=e,B.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof H?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,B.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_deploymentnode_free(e,0)}get base_data(){const e=r.__wbg_get_boundary_base_data(this.__wbg_ptr);return N.__wrap(e)}set base_data(e){O(e,N);var t=e.__destroy_into_raw();r.__wbg_set_boundary_base_data(this.__wbg_ptr,t)}get deploymeny_node_custom_type(){const e=r.__wbg_get_deploymentnode_deploymeny_node_custom_type(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set deploymeny_node_custom_type(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_addelementtag_legend_sprite(this.__wbg_ptr,t,n)}get deployment_node_type(){return r.__wbg_get_deploymentnode_deployment_node_type(this.__wbg_ptr)}set deployment_node_type(e){r.__wbg_set_deploymentnode_deployment_node_type(this.__wbg_ptr,m(e)?0:b(e))}get sub_elements(){const e=r.__wbg_get_deploymentnode_sub_elements(this.__wbg_ptr);var t=y(e[0],e[1]).slice();return r.__wbindgen_free(e[0],4*e[1],4),t}set sub_elements(e){const t=v(e,r.__wbindgen_malloc),n=o;r.__wbg_set_boundary_sub_elements(this.__wbg_ptr,t,n)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_diagram_free(e>>>0,1)));const W="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_diagramelementspec_free(e>>>0,1)));class X{static __wrap(e){e>>>=0;const t=Object.create(X.prototype);return t.__wbg_ptr=e,W.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof X?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,W.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_diagramelementspec_free(e,0)}get alias(){const e=r.__wbg_get_diagramelementspec_alias(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set alias(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_diagramelementspec_alias(this.__wbg_ptr,t,n)}get from(){const e=r.__wbg_get_diagramelementspec_from(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set from(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_diagramelementspec_from(this.__wbg_ptr,t,n)}get to(){const e=r.__wbg_get_diagramelementspec_to(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set to(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_diagramelementspec_to(this.__wbg_ptr,t,n)}get shapes(){const e=r.__wbg_get_diagramelementspec_shapes(this.__wbg_ptr);let t;return 0!==e[0]&&(t=y(e[0],e[1]).slice(),r.__wbindgen_free(e[0],4*e[1],4)),t}set shapes(e){var t=m(e)?0:v(e,r.__wbindgen_malloc),n=o;r.__wbg_set_diagramelementspec_shapes(this.__wbg_ptr,t,n)}get element_type(){return r.__wbg_get_diagramelementspec_element_type(this.__wbg_ptr)}set element_type(e){r.__wbg_set_diagramelementspec_element_type(this.__wbg_ptr,m(e)?0:b(e))}get position(){const e=r.__wbg_get_diagramelementspec_position(this.__wbg_ptr);return 0===e?void 0:J.__wrap(e)}set position(e){let t=0;m(e)||(O(e,J),t=e.__destroy_into_raw()),r.__wbg_set_diagramelementspec_position(this.__wbg_ptr,t)}get size(){const e=r.__wbg_get_diagramelementspec_size(this.__wbg_ptr);return 0===e?void 0:re.__wrap(e)}set size(e){let t=0;m(e)||(O(e,re),t=e.__destroy_into_raw()),r.__wbg_set_diagramelementspec_size(this.__wbg_ptr,t)}get inner_specs(){const e=r.__wbg_get_diagramelementspec_inner_specs(this.__wbg_ptr);let t;return 0!==e[0]&&(t=y(e[0],e[1]).slice(),r.__wbindgen_free(e[0],4*e[1],4)),t}set inner_specs(e){var t=m(e)?0:v(e,r.__wbindgen_malloc),n=o;r.__wbg_set_diagramelementspec_inner_specs(this.__wbg_ptr,t,n)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_diagramplantuml_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_diagramspec_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_diagramsthemesettings_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_elementdata_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_hookpayload_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_intounderlyingbytesource_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_intounderlyingsink_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_intounderlyingsource_free(e>>>0,1)));const Y="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_minaerror_free(e>>>0,1)));class Z{static __wrap(e){e>>>=0;const t=Object.create(Z.prototype);return t.__wbg_ptr=e,Y.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Y.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_minaerror_free(e,0)}get code(){return r.__wbg_get_minaerror_code(this.__wbg_ptr)}set code(e){r.__wbg_set_minaerror_code(this.__wbg_ptr,e)}get msg(){let e,t;try{const n=r.__wbg_get_minaerror_msg(this.__wbg_ptr);return e=n[0],t=n[1],p(n[0],n[1])}finally{r.__wbindgen_free(e,t,1)}}set msg(e){const t=c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_minaerror_msg(this.__wbg_ptr,t,n)}}const $="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_person_free(e>>>0,1)));class G{static __wrap(e){e>>>=0;const t=Object.create(G.prototype);return t.__wbg_ptr=e,$.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof G?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,$.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_person_free(e,0)}get base_data(){const e=r.__wbg_get_container_base_data(this.__wbg_ptr);return N.__wrap(e)}set base_data(e){O(e,N);var t=e.__destroy_into_raw();r.__wbg_set_container_base_data(this.__wbg_ptr,t)}get person_type(){return r.__wbg_get_person_person_type(this.__wbg_ptr)}set person_type(e){r.__wbg_set_person_person_type(this.__wbg_ptr,m(e)?0:b(e))}}const U="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_point_free(e>>>0,1)));class q{static __wrap(e){e>>>=0;const t=Object.create(q.prototype);return t.__wbg_ptr=e,U.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof q?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,U.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_point_free(e,0)}get x(){return r.__wbg_get_point_x(this.__wbg_ptr)}set x(e){r.__wbg_set_point_x(this.__wbg_ptr,e)}get y(){return r.__wbg_get_point_y(this.__wbg_ptr)}set y(e){r.__wbg_set_point_y(this.__wbg_ptr,e)}}const V="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_position_free(e>>>0,1)));class J{static __wrap(e){e>>>=0;const t=Object.create(J.prototype);return t.__wbg_ptr=e,V.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_position_free(e,0)}get left(){const e=r.__wbg_get_position_left(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}set left(e){r.__wbg_set_position_left(this.__wbg_ptr,!m(e),m(e)?0:e)}get top(){const e=r.__wbg_get_position_top(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}set top(e){r.__wbg_set_position_top(this.__wbg_ptr,!m(e),m(e)?0:e)}get z_index(){const e=r.__wbg_get_position_z_index(this.__wbg_ptr);return 4294967297===e?void 0:e}set z_index(e){r.__wbg_set_position_z_index(this.__wbg_ptr,m(e)?4294967297:0|e)}get angle(){const e=r.__wbg_get_position_angle(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}set angle(e){r.__wbg_set_position_angle(this.__wbg_ptr,!m(e),m(e)?0:e)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_project_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_projectlibrary_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_projectsettings_free(e>>>0,1)));const Q="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_relationship_free(e>>>0,1)));class K{static __wrap(e){e>>>=0;const t=Object.create(K.prototype);return t.__wbg_ptr=e,Q.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof K?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Q.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_relationship_free(e,0)}get base_data(){const e=r.__wbg_get_container_base_data(this.__wbg_ptr);return N.__wrap(e)}set base_data(e){O(e,N);var t=e.__destroy_into_raw();r.__wbg_set_container_base_data(this.__wbg_ptr,t)}get from(){const e=r.__wbg_get_relationship_from(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set from(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_container_technology(this.__wbg_ptr,t,n)}get to(){const e=r.__wbg_get_relationship_to(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set to(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_relationship_to(this.__wbg_ptr,t,n)}get technology(){const e=r.__wbg_get_relationship_technology(this.__wbg_ptr);let t;return 0!==e[0]&&(t=p(e[0],e[1]).slice(),r.__wbindgen_free(e[0],1*e[1],1)),t}set technology(e){var t=m(e)?0:c(e,r.__wbindgen_malloc,r.__wbindgen_realloc),n=o;r.__wbg_set_relationship_technology(this.__wbg_ptr,t,n)}get relationship_type(){return r.__wbg_get_relationship_relationship_type(this.__wbg_ptr)}set relationship_type(e){r.__wbg_set_relationship_relationship_type(this.__wbg_ptr,m(e)?0:b(e))}}const ee="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_shape_free(e>>>0,1)));class te{static __wrap(e){e>>>=0;const t=Object.create(te.prototype);return t.__wbg_ptr=e,ee.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof te?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ee.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_shape_free(e,0)}get shape_type(){return r.__wbg_get_shape_shape_type(this.__wbg_ptr)}set shape_type(e){r.__wbg_set_shape_shape_type(this.__wbg_ptr,m(e)?0:b(e))}get position(){const e=r.__wbg_get_shape_position(this.__wbg_ptr);return 0===e?void 0:J.__wrap(e)}set position(e){let t=0;m(e)||(O(e,J),t=e.__destroy_into_raw()),r.__wbg_set_shape_position(this.__wbg_ptr,t)}get size(){const e=r.__wbg_get_shape_size(this.__wbg_ptr);return 0===e?void 0:re.__wrap(e)}set size(e){let t=0;m(e)||(O(e,re),t=e.__destroy_into_raw()),r.__wbg_set_shape_size(this.__wbg_ptr,t)}}const ne="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_size_free(e>>>0,1)));class re{static __wrap(e){e>>>=0;const t=Object.create(re.prototype);return t.__wbg_ptr=e,ne.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ne.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_size_free(e,0)}get width(){const e=r.__wbg_get_size_width(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}set width(e){r.__wbg_set_size_width(this.__wbg_ptr,!m(e),m(e)?0:e)}get height(){const e=r.__wbg_get_size_height(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}set height(e){r.__wbg_set_size_height(this.__wbg_ptr,!m(e),m(e)?0:e)}get scale_x(){const e=r.__wbg_get_size_scale_x(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}set scale_x(e){r.__wbg_set_size_scale_x(this.__wbg_ptr,!m(e),m(e)?0:e)}get scale_y(){const e=r.__wbg_get_size_scale_y(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}set scale_y(e){r.__wbg_set_size_scale_y(this.__wbg_ptr,!m(e),m(e)?0:e)}}const ae="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_softwaresystem_free(e>>>0,1)));class oe{static __wrap(e){e>>>=0;const t=Object.create(oe.prototype);return t.__wbg_ptr=e,ae.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof oe?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ae.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_softwaresystem_free(e,0)}get base_data(){const e=r.__wbg_get_component_base_data(this.__wbg_ptr);return N.__wrap(e)}set base_data(e){O(e,N);var t=e.__destroy_into_raw();r.__wbg_set_component_base_data(this.__wbg_ptr,t)}get system_type(){return r.__wbg_get_softwaresystem_system_type(this.__wbg_ptr)}set system_type(e){r.__wbg_set_softwaresystem_system_type(this.__wbg_ptr,m(e)?0:b(e))}}function ie(e,t){const n=c(String(t),r.__wbindgen_malloc,r.__wbindgen_realloc),a=o;d().setInt32(e+4,a,!0),d().setInt32(e+0,n,!0)}function le(e){e.abort()}function se(){return f((function(e,t,n,r,a){e.append(p(t,n),p(r,a))}),arguments)}function _e(){return f((function(e,t,n,r,a){e.append(p(t,n),p(r,a))}),arguments)}function ce(){return f((function(e,t,n,r,a,o){e.append(p(t,n),r,p(a,o))}),arguments)}function ue(){return f((function(e,t,n,r){e.append(p(t,n),r)}),arguments)}function de(){return f((function(e){return e.arrayBuffer()}),arguments)}function ge(e){return e.arrayBuffer()}function pe(e){return j.__wrap(e)}function be(e){return j.__unwrap(e)}function fe(e){return e.buffer}function me(e){return e.buffer}function he(e){const t=e.byobRequest;return m(t)?0:b(t)}function we(e){return e.byteLength}function ye(e){return e.byteOffset}function ve(){return f((function(e,t){return e.call(t)}),arguments)}function Oe(){return f((function(e,t,n){return e.call(t,n)}),arguments)}function Se(e){return e.close()}function Ee(){return f((function(e){e.close()}),arguments)}function xe(){return f((function(e){e.close()}),arguments)}function Te(e){return M.__wrap(e)}function Re(e){return M.__unwrap(e)}function Ce(e){return z.__wrap(e)}function Ie(e){return z.__unwrap(e)}function De(e,t){return e.createWritable(t)}function ke(e){return e.crypto}function Le(e){console.debug(e)}function Ne(e){return H.__wrap(e)}function Ae(e){return H.__unwrap(e)}function je(e){return X.__wrap(e)}function Fe(e){return X.__unwrap(e)}function Me(e){return e.done}function Pe(){return f((function(e,t){e.enqueue(t)}),arguments)}function ze(e){return e.entries()}function Be(e){return Object.entries(e)}function He(e){console.error(e)}function We(e,t){let n,a;try{n=e,a=t,console.error(p(e,t))}finally{r.__wbindgen_free(n,a,1)}}function Xe(e){return fetch(e)}function Ye(e,t){return e.fetch(t)}function Ze(e,t,n,r){return e.getDirectoryHandle(p(t,n),r)}function $e(e,t,n,r){return e.getFileHandle(p(t,n),r)}function Ge(e){return e.getFile()}function Ue(){return f((function(e,t){e.getRandomValues(t)}),arguments)}function qe(){return f((function(e,t){return Reflect.get(e,t)}),arguments)}function Ve(){return f((function(e,t,n,a){const i=t[p(n,a)];var l=m(i)?0:c(i,r.__wbindgen_malloc,r.__wbindgen_realloc),s=o;d().setInt32(e+4,s,!0),d().setInt32(e+0,l,!0)}),arguments)}function Je(e,t){return e[t>>>0]}function Qe(e,t){return e[t]}function Ke(){return f((function(e,t){return Reflect.has(e,t)}),arguments)}function et(e){return e.headers}function tt(e){console.info(e)}function nt(e){let t;try{t=e instanceof ArrayBuffer}catch(e){t=!1}return t}function rt(e){let t;try{t=e instanceof Error}catch(e){t=!1}return t}function at(e){let t;try{t=e instanceof FileSystemDirectoryHandle}catch(e){t=!1}return t}function ot(e){let t;try{t=e instanceof FileSystemFileHandle}catch(e){t=!1}return t}function it(e){let t;try{t=e instanceof File}catch(e){t=!1}return t}function lt(e){let t;try{t=e instanceof Response}catch(e){t=!1}return t}function st(e){let t;try{t=e instanceof Uint8Array}catch(e){t=!1}return t}function _t(e){let t;try{t=e instanceof Window}catch(e){t=!1}return t}function ct(e){return Array.isArray(e)}function ut(e){return Number.isSafeInteger(e)}function dt(){return Symbol.iterator}function gt(e){return e.lastModified}function pt(e){return e.length}function bt(e){return e.length}function ft(){return f((function(e){const t=e.localStorage;return m(t)?0:b(t)}),arguments)}function mt(e){console.log(e)}function ht(e){return e.message}function wt(e){return Z.__wrap(e)}function yt(e){return e.msCrypto}function vt(e,t){const n=c(t.name,r.__wbindgen_malloc,r.__wbindgen_realloc),a=o;d().setInt32(e+4,a,!0),d().setInt32(e+0,n,!0)}function Ot(){return f((function(){return new Headers}),arguments)}function St(e,t){try{var n={a:e,b:t};const a=new Promise(((e,t)=>{const a=n.a;n.a=0;try{return function(e,t,n,a){r.closure72_externref_shim(e,t,n,a)}(a,n.b,e,t)}finally{n.a=a}}));return a}finally{n.a=n.b=0}}function Et(){return new Object}function xt(){return new Map}function Tt(){return new Array}function Rt(){return new Error}function Ct(){return f((function(){return new FormData}),arguments)}function It(e){return new Uint8Array(e)}function Dt(e,t){return new Error(p(e,t))}function kt(){return f((function(){return new AbortController}),arguments)}function Lt(e,t){return new Function(p(e,t))}function Nt(e,t,n){return new Uint8Array(e,t>>>0,n>>>0)}function At(e){return new Uint8Array(e>>>0)}function jt(){return f((function(e,t,n){return new Request(p(e,t),n)}),arguments)}function Ft(){return f((function(e,t){return new Blob(e,t)}),arguments)}function Mt(e){return e.next}function Pt(){return f((function(e){return e.next()}),arguments)}function zt(){return f((function(e){return e.next()}),arguments)}function Bt(e){return e.node}function Ht(e){return G.__wrap(e)}function Wt(e){return G.__unwrap(e)}function Xt(e){return q.__wrap(e)}function Yt(e){return q.__unwrap(e)}function Zt(){return f((function(e,t){e.postMessage(t)}),arguments)}function $t(e){return e.process}function Gt(e,t){return e.push(t)}function Ut(e){queueMicrotask(e)}function qt(e){return e.queueMicrotask}function Vt(){return f((function(e,t){e.randomFillSync(t)}),arguments)}function Jt(e){return K.__wrap(e)}function Qt(e){return K.__unwrap(e)}function Kt(e,t,n){return e.removeEntry(p(t,n))}function en(e,t,n,r){return e.removeEntry(p(t,n),r)}function tn(){return f((function(){return e.require}),arguments)}function nn(e){return Promise.resolve(e)}function rn(){return f((function(e,t){e.respond(t>>>0)}),arguments)}function an(){return f((function(e,t){return e.seek(t)}),arguments)}function on(e,t,n){e[t]=n}function ln(e,t,n){e[t>>>0]=n}function sn(e,t,n){e.set(t,n>>>0)}function _n(e,t,n){return e.set(t,n)}function cn(){return f((function(e,t,n,r,a){e[p(t,n)]=p(r,a)}),arguments)}function un(e,t){e.body=t}function dn(e,t){e.create=0!==t}function gn(e,t){e.create=0!==t}function pn(e,t){e.credentials=D[t]}function bn(e,t){e.headers=t}function fn(e,t){e.keepExistingData=0!==t}function mn(e,t,n){e.method=p(t,n)}function hn(e,t){e.mode=k[t]}function wn(e,t){e.recursive=0!==t}function yn(e,t){e.signal=t}function vn(e,t,n){e.type=p(t,n)}function On(e){return te.__wrap(e)}function Sn(e){return te.__unwrap(e)}function En(e){return e.signal}function xn(e){return e.size}function Tn(e){return oe.__wrap(e)}function Rn(e){return oe.__unwrap(e)}function Cn(e,t){const n=c(t.stack,r.__wbindgen_malloc,r.__wbindgen_realloc),a=o;d().setInt32(e+4,a,!0),d().setInt32(e+0,n,!0)}function In(){const e=void 0===n.g?null:n.g;return m(e)?0:b(e)}function Dn(){const e="undefined"==typeof globalThis?null:globalThis;return m(e)?0:b(e)}function kn(){const e="undefined"==typeof self?null:self;return m(e)?0:b(e)}function Ln(){const e="undefined"==typeof window?null:window;return m(e)?0:b(e)}function Nn(e){return e.status}function An(){return f((function(e){return JSON.stringify(e)}),arguments)}function jn(e,t,n){return e.subarray(t>>>0,n>>>0)}function Fn(e){return e.text()}function Mn(e,t){return e.then(t)}function Pn(e,t,n){return e.then(t,n)}function zn(e,t){const n=c(t.url,r.__wbindgen_malloc,r.__wbindgen_realloc),a=o;d().setInt32(e+4,a,!0),d().setInt32(e+0,n,!0)}function Bn(e){return e.value}function Hn(e){return e.versions}function Wn(e){const t=e.view;return m(t)?0:b(t)}function Xn(e){console.warn(e)}function Yn(){return f((function(e,t){return e.write(t)}),arguments)}function Zn(e){return+e}function $n(e){return BigInt.asUintN(64,e)}function Gn(e,t){const n="bigint"==typeof t?t:void 0;d().setBigInt64(e+8,m(n)?BigInt(0):n,!0),d().setInt32(e+0,!m(n),!0)}function Un(e){return"boolean"==typeof e?e?1:0:2}function qn(e){const t=e.original;return 1==t.cnt--&&(t.a=0,!0)}function Vn(e,t,n){const a=function(e,t,n,a){const o={a:e,b:t,cnt:1,dtor:139},i=(...e)=>{o.cnt++;const t=o.a;o.a=0;try{return a(t,o.b,...e)}finally{0==--o.cnt?(r.__wbindgen_export_6.get(o.dtor)(t,o.b),h.unregister(o)):o.a=t}};return i.original=o,h.register(i,o,o),i}(e,t,0,I);return a}function Jn(e,t){const n=c(w(t),r.__wbindgen_malloc,r.__wbindgen_realloc),a=o;d().setInt32(e+4,a,!0),d().setInt32(e+0,n,!0)}function Qn(e,t){return new Error(p(e,t))}function Kn(e,t){return e in t}function er(){const e=r.__wbindgen_export_4,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}function tr(e){return"bigint"==typeof e}function nr(e){return"function"==typeof e}function rr(e){return"object"==typeof e&&null!==e}function ar(e){return"string"==typeof e}function or(e){return void 0===e}function ir(e,t){return e===t}function lr(e,t){return e==t}function sr(){return r.memory}function _r(e,t){const n="number"==typeof t?t:void 0;d().setFloat64(e+8,m(n)?0:n,!0),d().setInt32(e+0,!m(n),!0)}function cr(e){return e}function ur(e,t){const n="string"==typeof t?t:void 0;var a=m(n)?0:c(n,r.__wbindgen_malloc,r.__wbindgen_realloc),i=o;d().setInt32(e+4,i,!0),d().setInt32(e+0,a,!0)}function dr(e,t){return p(e,t)}function gr(e,t){throw new Error(p(e,t))}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_themessettings_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_usersettings_free(e>>>0,1)))},489:e=>{e.exports=require("fabric")},507:(e,t,n)=>{n.a(e,(async(e,r)=>{try{n.d(t,{wS:()=>l});var a=n(519),o=e([a]);async function i(e,t){if(t){const n="https://keadex.dev/api/download-gh-raw-file",r={headers:{"Keadex-Gh-Url":e}};return t&&(r.headers["Keadex-Gh-Authorization"]=t),await fetch(n,r)}return await fetch(e)}async function l(e,t,n){let r,o,l;try{r=(0,a._Cc)(e),o=(0,a.Llp)(e,t),l=(0,a.JD7)(e,t)}catch(e){throw console.error(e),new Error("Invalid URL: the provided URL is an invalid Mina project or diagram.")}if(r&&o&&l){let e,t,a;try{const s=await i(r,n),_=await i(o,n),c=await i(l,n);if(s.ok&&_.ok&&c.ok)return e=await s.text(),t=await _.text(),a=await c.text(),{projectSettingsJson:e,plantuml:t,spec:a};throw new Error}catch(e){throw console.error(e),new Error("Diagram or project settings not found. Please verify the URLs provided, or, if linking to a private repository, ensure the GitHub token is configured.")}}}a=(o.then?(await o)():o)[0],r()}catch(s){r(s)}}))},519:(e,t,n)=>{n.a(e,(async(e,r)=>{try{n.d(t,{JD7:()=>o.JD7,Llp:()=>o.Llp,Oxg:()=>o.Oxg,_Cc:()=>o._Cc,qjW:()=>o.qjW});var a=n(196),o=n(457),i=e([a]);a=(i.then?(await i)():i)[0],(0,o.lIU)(a),a.__wbindgen_start(),r()}catch(e){r(e)}}))},691:e=>{e.exports=require("ts-key-enum")},732:e=>{e.exports=require("react/jsx-runtime")},735:e=>{e.exports=require("react-hotkeys-hook")},764:(e,t,n)=>{n.d(t,{D:()=>rn});var r=n(416);const a=["TopToBottom","LeftToRight"],o=["https://","http://"];let i=function(e){return e.Alias="Alias",e}({});const l="object:modified",s="mouseup",_="modified",c="selected",u="deselected",d="#FFFFFF",g="#000000",p=12,b=10,f=20,m=20,h=120,w=20,y=10,v={SIZES:{DEFAULT_TOP:f+w,DEFAULT_LEFT:m+h+50,BORDER_WIDTH:1},FONT:{FAMILY:"Roboto"}},O={COLORS:{BG_COLOR_SOFTWARE_SYSTEM_PERSON:"#1168BD",BG_COLOR_CONTAINER:"#438DD5",BG_COLOR_COMPONENT:"#85BBF0",BG_COLOR_SOFTWARE_SYSTEM_PERSON_EXT:"#686868",BG_COLOR_CONTAINER_EXT:"#999999",BG_COLOR_COMPONENT_EXT:"#CCCCCC",BG_COLOR_BOUNDARY:d,BG_COLOR_DEPLOYMENT_NODE:d,BORDER_COLOR_SOFTWARE_SYSTEM_PERSON:"#0F5BA6",BORDER_COLOR_CONTAINER:"#3E84C7",BORDER_COLOR_COMPONENT:"#7BADDE",BORDER_COLOR_SOFTWARE_SYSTEM_PERSON_EXT:"#525252",BORDER_COLOR_CONTAINER_EXT:"#8A8A8A",BORDER_COLOR_COMPONENT_EXT:"#BDBDBD",BORDER_COLOR_BOUNDARY:"#666666",BORDER_COLOR_DEPLOYMENT_NODE:"#666666",TEXT_COLOR_SOFTWARE_SYSTEM_PERSON:"#FFFFFF",TEXT_COLOR_CONTAINER:"#FFFFFF",TEXT_COLOR_COMPONENT:"#000000",TEXT_COLOR_SOFTWARE_SYSTEM_PERSON_EXT:"#FFFFFF",TEXT_COLOR_CONTAINER_EXT:"#FFFFFF",TEXT_COLOR_COMPONENT_EXT:"#000000",TEXT_COLOR_BOUNDARY:"#333333",TEXT_COLOR_DEPLOYMENT_NODE:"#333333"},SIZES:{WIDTH:220,MIN_HEIGHT:100,PADDING_BOTTOM:15,BORDER_RADIUS:10,TOP_LABEL:20,TOP_TAGS:5,TOP_TYPE_TECHNOLOGY:2,TOP_DESCRIPTION:25,PADDING_Y_DESCRIPTION:10},FONT:{SIZE:14,SIZE_TAG:12,SIZE_TYPE_TECHNOLOGY:12,SIZE_DESCRIPTION:10}},S={SIZES:{SCALE_Y_TAIL_HEAD:.3,HEAD_BOX_WIDTH:20,RADIUS_TAIL_HEAD:O.SIZES.MIN_HEIGHT/2-v.SIZES.BORDER_WIDTH/2,SCALED_RADIUS_TAIL_HEAD:1/0,WIDTH_TAIL:1/0,WIDTH_HEAD:1/0}};S.SIZES.SCALED_RADIUS_TAIL_HEAD=S.SIZES.RADIUS_TAIL_HEAD*S.SIZES.SCALE_Y_TAIL_HEAD,S.SIZES.WIDTH_TAIL=S.SIZES.SCALED_RADIUS_TAIL_HEAD,S.SIZES.WIDTH_HEAD=S.SIZES.HEAD_BOX_WIDTH+S.SIZES.SCALED_RADIUS_TAIL_HEAD;const E={SIZES:{SCALE_X_TOP_BOTTOM:.15,TOP_BOX_HEIGHT:14,RADIUS_TOP_BOTTOM:O.SIZES.WIDTH/2-v.SIZES.BORDER_WIDTH/2,SCALED_RADIUS_TOP_BOTTOM:1/0,WIDTH_TOP:1/0,WIDTH_BOTTOM:1/0}};E.SIZES.SCALED_RADIUS_TOP_BOTTOM=E.SIZES.RADIUS_TOP_BOTTOM*E.SIZES.SCALE_X_TOP_BOTTOM,E.SIZES.WIDTH_TOP=E.SIZES.TOP_BOX_HEIGHT+E.SIZES.SCALED_RADIUS_TOP_BOTTOM,E.SIZES.WIDTH_BOTTOM=E.SIZES.SCALED_RADIUS_TOP_BOTTOM;const x="rgba(0,0,0,0)",T="#828282",R="#404040",C="#ff8f26",I=10,D=10,k=3,L=3,N=9,A=1,j=2,F=90,M=40,P=45,z=10,B=10,H=150,W=80,X=10,Y={SIZES:{STROKE_DASH_ARRAY:[5,5]}},Z={'"dashed"':{name:'"dashed"',value:[8,5]}};var $=n(454),G=n(423),U=(n(452),n(39)),q=n(489);function V(e){try{return`Open Link ${new URL(e).host.replace("www.","")}`}catch(e){return"Open Link"}}function J(e){return`<${e.toString().toUpperCase()}>`}function Q(e,t=!0,n){var r,a,o,i;let l,s,_,c;return e.forEach((e=>{if(e.visible){const r=e.getBoundingRect(!1,!0),a=t?e.getBoundingRect(!0,!1):r;let o=a.left,i=a.top;if(n&&o&&i){const e=fabric.util.transformPoint(new fabric.Point(o,i),n);o=e.x,i=e.y}(void 0===l||o<l)&&(l=o),void 0!==o&&void 0!==r.width&&(void 0===s||o+r.width>s)&&(s=o+r.width),(void 0===c||void 0!==i&&i<c)&&(c=i),void 0!==i&&void 0!==r.height&&(void 0===_||r.height+i>_)&&(_=i+r.height)}})),{left:l,right:s,top:c,bottom:_,width:(null!=(r=s)?r:0)-(null!=(a=l)?a:0),height:(null!=(o=_)?o:0)-(null!=(i=c)?i:0)}}function K(e,t){let n=-1;return e&&(n=e.getObjects().indexOf(t)),-1!==n?n:void 0}function ee(e,t,n=Number.MAX_SAFE_INTEGER){let r=n;return t.forEach((t=>{const n=K(e,t);void 0!==n&&n<r&&(r=n)})),r!==Number.MAX_SAFE_INTEGER?r:void 0}function te(e,t=!0){let n=[];return e&&e.forEach((e=>{(e.visible||!e.visible&&t)&&n.push(e),e.children&&(n=n.concat(te(e.children,t)))})),n}function ne(e){let t=0,n=0;if(e){const r=e.viewportTransform;t=r?r[4]:0,n=r?r[5]:0}return{panX:t,panY:n}}function re(e){var t;const n=e.parent,r=function(e){let t=[];const n=new Set;if(e){let r=[];e.forEach((e=>{const t=e.getVirtualGroupRoot();t&&n.add(t)})),n.forEach((e=>{var t;r=r.concat(te(null!=(t=e.children)?t:[],!0))})),t=e.filter((e=>!r.includes(e)))}return{filteredObjects:t,virtualGroupsRoots:n}}(null==(t=e.canvas)?void 0:t.getActiveObjects());let a,o;if(r.filteredObjects.length>0||r.virtualGroupsRoots.size>1){let e=r.filteredObjects;r.virtualGroupsRoots.forEach((t=>{var n;return e=e.concat(te(null!=(n=t.children)?n:[],!1))})),a=e,o="multiple"}else{var i;a=te(null!=(i=null==n?void 0:n.children)?i:[],!1),o="single"}return{objects:a,type:o}}function ae(e,t){var n,r;return(null==e?void 0:e.length)===(null==t?void 0:t.length)&&(null!=(n=null==e?void 0:e.map((e=>{var t;return null!=(t=e.name)?t:"undefined"})))?n:[]).sort().join(",")===(null!=(r=null==t?void 0:t.map((e=>{var t;return null!=(t=e.name)?t:"undefined"})))?r:[]).sort().join(",")}q.fabric.ActiveSelection.prototype._controlsVisibility={tl:!0,tr:!0,br:!0,bl:!0,ml:!1,mt:!1,mr:!1,mb:!1,mtr:!1},q.fabric.Object.prototype.isVirtualGroupParent=function(){return void 0!==this.children&&this.children.length>0},q.fabric.Object.prototype.isVirtualGroupChild=function(){return void 0!==this.parent},q.fabric.Object.prototype.isVirtualGroupRoot=function(){return this.isVirtualGroupParent()&&void 0===this.parent},q.fabric.Object.prototype.isVirtualGroupLeaf=function(){return this.isVirtualGroupChild()&&!this.isVirtualGroupParent()},q.fabric.Object.prototype.isVirtualGroupBaseShape=function(){return this.isVirtualGroupChild()&&this.parent.children[0]===this},q.fabric.Object.prototype.getVirtualGroupRoot=function(){let e=this.parent;for(;e&&e.parent;)e=e.parent;return e};class oe extends q.fabric.Point{constructor(e,t,n){super(e,t),this.customType=void 0,this.data=void 0,this.customType=n}}class ie extends q.fabric.ActiveSelection{}const le=e=>"getUpdatedSpecs"in e;class se extends q.fabric.Group{constructor(e,t,n,r,a,o,i,l,_=!1){var c,u,d,g,p,b,f,m,h,w,y;super(a,Object.assign({data:{rawDiagramElementSpec:t,rawData:e,rawAutoLayout:r},name:null!=(c=n.alias)?c:"undefined",left:void 0!==(null==t||null==(u=t.position)?void 0:u.left)?null==t||null==(d=t.position)?void 0:d.left:null==(g=n.position)?void 0:g.left,top:void 0!==(null==t||null==(p=t.position)?void 0:p.top)?null==t||null==(b=t.position)?void 0:b.top:null==(f=n.position)?void 0:f.top,scaleX:void 0!==(null==t||null==(m=t.size)?void 0:m.scale_x)?null==t||null==(h=t.size)?void 0:h.scale_x:1,scaleY:void 0!==(null==t||null==(w=t.size)?void 0:w.scale_y)?null==t||null==(y=t.size)?void 0:y.scale_y:1},o)),this.parent=i,this.children=null!=l?l:[],this.setControlsVisibility({mb:!1,ml:!1,mr:!1,mt:!1,mtr:!1}),_||this.on(s,(e=>{var t;this.onComponentMouseUp(null==(t=e.target)?void 0:t.canvas,e,this)}))}getUpdatedSpecs(){var e,t;null==(e=this.canvas)||e.discardActiveObject();const n=null==(t=this.data)?void 0:t.rawDiagramElementSpec;if(n){var r,a,o,i,l,s,_,c,u,d,g,p,b,f,m,h;const e=(0,$.mg)(n);return e.position={left:null!=(r=this.left)?r:null==(a=n.position)?void 0:a.left,top:null!=(o=this.top)?o:null==(i=n.position)?void 0:i.top,z_index:null!=(l=K(this.canvas,this))?l:null==(s=n.position)?void 0:s.z_index,angle:null!=(_=this.angle)?_:null==(c=n.position)?void 0:c.angle},e.size={width:null!=(u=this.width)?u:null==(d=n.size)?void 0:d.width,height:null!=(g=this.height)?g:null==(p=n.size)?void 0:p.height,scale_x:null!=(b=this.scaleX)?b:null==(f=n.size)?void 0:f.scale_x,scale_y:null!=(m=this.scaleY)?m:null==(h=n.size)?void 0:h.scale_y},e}}onComponentMouseUp(e,t,n,r){if(e)switch(t.e.preventDefault(),t.button){case 3:{e.setActiveObject(n),e.renderAll();const a=e.contextTop,o=q.fabric.util.getPointer(t.e,a.canvas),i=new CustomEvent(U.UW.CONTEXT_MENU,{detail:{sourceEvent:t,pageX:o.x,pageY:o.y,menuItems:null!=r?r:_e(e,t,n)}});document.dispatchEvent(i);break}}}}const _e=(e,t,n,r=!0)=>{var a,s,_,c;const u=[],d=n instanceof ie?n.parent:n,g=null==d?void 0:d.data,p=null==g||null==(a=g.rawDiagramElementSpec)?void 0:a.element_type,b=null==g||null==(s=g.rawData)||null==(s=s.base_data)||null==(s=s.link)?void 0:s.split(";"),f=e.isReadOnly(),m=e.codingFeaturesEnabled,h=void 0!==p&&b&&b.length>0&&void 0!==(ve(w=p)||me(w)||fe(w)||be(w));var w;let y=0,v=null==d?void 0:d.parent;for(;v;){var O;y++,v=null==(O=v)?void 0:O.parent}return h&&b.forEach(((t,n)=>{const r=t.replace(/ /gi,"");r.length>0&&(function(e){return o.some((t=>e.startsWith(t)))}(r)?u.push({isHeaderMenuItem:!1,id:`openLink${n}`,label:V(r),onClick:()=>{e.diagramListener&&e.diagramListener.onOpenExternalLinkClick(function(e,t){let n=`${e}`;for(const e in i){var r;e===i.Alias.toString()&&n.includes(J(i.Alias))&&null!=t&&null!=(r=t.base_data)&&r.alias&&(n=n.replace(new RegExp(J(i.Alias),"gi"),t.base_data.alias))}return n}(r,null==g?void 0:g.rawData))}}):u.push({isHeaderMenuItem:!1,id:"openDiagram",label:"Open Diagram",onClick:()=>{e.diagramListener&&e.diagramListener.onOpenDiagramClick(r)}}))})),m&&null!=g&&g.rawData&&null!=(_=g.rawDiagramElementSpec)&&_.element_type&&u.push({isHeaderMenuItem:!1,id:"selectDiagramElementCode",label:"Select code",onClick:()=>{var t;null!=(t=e.diagramListener)&&t.onSelectElementCode&&e.diagramListener.onSelectElementCode(g.rawData,g.rawDiagramElementSpec.element_type,y)}}),!f&&(h||m&&null!=g&&g.rawData&&null!=(c=g.rawDiagramElementSpec)&&c.element_type)&&u.push({id:"separatorCommon",isSepator:!0}),f||u.push({isHeaderMenuItem:!1,id:"bringToFront",label:"Bring to Front",onClick:()=>{var e;n.bringToFront(),null==(e=n.canvas)||e.fire(l)}},{isHeaderMenuItem:!1,id:"bringForward",label:"Bring Forward",onClick:()=>{var e;n.bringForward(),null==(e=n.canvas)||e.fire(l)}},{isHeaderMenuItem:!1,id:"sentToBack",label:"Send to Back",onClick:()=>ce(n)},{isHeaderMenuItem:!1,id:"sendBackwards",label:"Send Backwards",onClick:()=>ue(n)}),r?[{isHeaderMenuItem:!0,id:"baseComponentContextMenu",label:"",hidden:!0,alwaysOpen:!0,subMenuItems:u}]:u},ce=e=>{var t;e.parent||(e.sendToBack(),null==(t=e.canvas)||t.fire(l))},ue=e=>{if(e instanceof ie){var t,n,r;const o=e.parent,i=ee(e.canvas,null!=(t=null==o?void 0:o.children)?t:[]),s=ee(e.canvas,null!=(n=null==o||null==(r=o.parent)?void 0:r.children)?n:[]);var a;void 0===s||void 0===i||i-1>s?(e.sendBackwards(),null==(a=e.canvas)||a.fire(l)):console.debug(`cannot send backwards ${i} ${s}`)}else{var o,i;const t=K(e.canvas,e),n=ee(e.canvas,null!=(o=null==(i=e.parent)?void 0:i.children)?o:[]);var s;void 0===n||void 0===t||t-1>n?(e.sendBackwards(),null==(s=e.canvas)||s.fire(l)):console.debug(`cannot send backwards ${t} ${n}`)}},de=(e,t,n,r,a)=>ge(e,t,n,r,a.elements_specs)||pe(e,t,n,r),ge=(e,t,n,r,a)=>{for(let o=0;o<a.length;o++){const i=a[o],l=i.alias===e,s=(0,$.$r)(i.element_type,r);if(l&&s)return i;if(i.inner_specs){const a=i.inner_specs,o=ge(e,t,n,r,a);if(o)return o}}},pe=(e,t,n,r)=>({alias:e,from:t,to:n,element_type:r}),be=e=>{if("Boundary"in e)return e.Boundary},fe=e=>{if("Component"in e)return e.Component},me=e=>{if("Container"in e)return e.Container},he=e=>{if("DeploymentNode"in e)return e.DeploymentNode},we=e=>{if("Person"in e)return e.Person},ye=e=>{if("Relationship"in e)return e.Relationship},ve=e=>{if("SoftwareSystem"in e)return e.SoftwareSystem},Oe=(e,t)=>{var n,r,a;return e&&null!=(n=t[e])&&n.position?{left:null==(r=t[e].position)?void 0:r.x,top:null==(a=t[e].position)?void 0:a.y}:{left:v.SIZES.DEFAULT_LEFT,top:v.SIZES.DEFAULT_TOP}};function Se(e){return btoa(e)}const Ee="_margin_hack";function xe(e,t,n){return 2===n.length?n.map(((n,r)=>{const a=0===r?(0,$.qI)(e.x):(0,$.qI)(e.y),o=0===r?n:t-n;return(0,$.cr)(o,Te)+a})):n}const Te=96,Re=(0,$.wF)(v.SIZES.DEFAULT_LEFT),Ce=(0,$.wF)(v.SIZES.DEFAULT_TOP),Ie=4.5;function De(e){const t={x:O.SIZES.WIDTH,y:O.SIZES.MIN_HEIGHT+2*P},n={x:O.SIZES.WIDTH,y:O.SIZES.MIN_HEIGHT},r={x:O.SIZES.WIDTH+S.SIZES.WIDTH_TAIL+S.SIZES.WIDTH_HEAD,y:O.SIZES.MIN_HEIGHT},a={x:O.SIZES.WIDTH,y:O.SIZES.MIN_HEIGHT+E.SIZES.WIDTH_TOP+E.SIZES.WIDTH_BOTTOM};if(we(e))return t;if(ve(e)){const t=ve(e);return"SystemDb"===t.system_type||"SystemDb_Ext"===t.system_type?a:"SystemQueue"===t.system_type||"SystemQueue_Ext"===t.system_type?r:n}if(me(e)){const t=me(e);return"ContainerDb"===t.container_type||"ContainerDb_Ext"===t.container_type?a:"ContainerQueue"===t.container_type||"ContainerQueue_Ext"===t.container_type?r:n}if(fe(e)){const t=fe(e);return"ComponentDb"===t.component_type||"ComponentDb_Ext"===t.component_type?a:"ComponentQueue"===t.component_type||"ComponentQueue_Ext"===t.component_type?r:n}return{x:100,y:100}}function ke(e,t,n,r,a){return`\n subgraph "${o=e,`${o}${Ee}`}" {\n cluster=true\n margin="${a}"\n fontsize="0pt"\n label=""\n subgraph "${e}" {\n cluster=true\n margin="${r}"\n label=" "\n labelloc="b"\n fontsize="17pt"\n "${e}" [peripheries=0, height=0, width=0, label=""] // invisible node that is used as a workaround to let the connection between nodes and subgraphs\n ${Le(t,n,r,a)}\n }\n }\n `;var o}function Le(e,t,n,r){let a="";for(const l of e){const e=De(l);let s;if(we(l))s=we(l).base_data.alias;else if(ve(l))s=ve(l).base_data.alias;else if(me(l))s=me(l).base_data.alias;else if(fe(l))s=fe(l).base_data.alias;else if(be(l)){const e=be(l);s=e.base_data.alias,s&&(t.add(s),a=a.concat(ke(s,e.sub_elements,t,n,r))),s=void 0}else if(he(l)){const e=he(l);s=e.base_data.alias,s&&(t.add(s),a=a.concat(ke(s,e.sub_elements,t,n,r))),s=void 0}else if(ye(l)){const e=ye(l);var o,i;e.from&&e.to&&(a=a.concat(`\n"${e.from}" -> "${e.to}" [name="${e.base_data.alias}", xlabel="${(0,$.l)([null!=(o=e.base_data.label)?o:"",null!=(i=e.technology)?i:""])}", ltail="${e.from}", lhead="${e.to}", fontsize="${I}", keadex_fromissubgraph=${t.has(e.from)}, keadex_toissubgraph=${t.has(e.to)}]`)),s=void 0}s&&(a=a.concat(`\n"${s}" [width=${(0,$.wF)(e.x,Te)}, height=${(0,$.wF)(e.y,Te)}, peripheries=2]`))}return a}const Ne=require("@hpcc-js/wasm-graphviz"),Ae=require("react-toastify");function je(e){if(e)return Z[e]}const Fe="legend",Me=(e,t,n,r,a,o)=>{var i,l,s;const _=[],c=n?1:0,u=new q.fabric.Rect({fill:t,stroke:n,strokeWidth:c,strokeDashArray:r,left:m,top:f+w*o,width:h-c,height:w-c});_.push(u);const d=new q.fabric.Text(e,{fill:a,fontFamily:v.FONT.FAMILY,fontSize:b,fontWeight:"normal",textAlign:"left",originX:"left",originY:"top",left:m+y});return d.top=(null!=(i=u.top)?i:0)+(null!=(l=u.height)?l:0)/2-(null!=(s=d.height)?s:0)/2,_.push(d),_},Pe=(e,t)=>{var n,r,a,o,i,l,s,_,c,u,d,b,h,w,y,S,E,x,T,R,C,I,D,k,L,N,A,j,F,M,P,z,B,H;let W=[];const X=new q.fabric.Text("LEGEND",{fill:g,fontFamily:v.FONT.FAMILY,fontSize:p,fontWeight:"bold",textAlign:"left",originX:"left",originY:"top",left:m,top:f});W.push(X),W=W.concat(Me("Person",null!=(n=null==t||null==(r=t.diagramsThemeSettings)?void 0:r.bg_color_person)?n:O.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON,void 0,void 0,null!=(a=null==t||null==(o=t.diagramsThemeSettings)?void 0:o.text_color_person)?a:O.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON,1)),W=W.concat(Me("Person External",null!=(i=null==t||null==(l=t.diagramsThemeSettings)?void 0:l.bg_color_person_ext)?i:O.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,void 0,void 0,null!=(s=null==t||null==(_=t.diagramsThemeSettings)?void 0:_.text_color_person_ext)?s:O.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,2)),W=W.concat(Me("System",null!=(c=null==t||null==(u=t.diagramsThemeSettings)?void 0:u.bg_color_software_system)?c:O.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON,void 0,void 0,null!=(d=null==t||null==(b=t.diagramsThemeSettings)?void 0:b.text_color_software_system)?d:O.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON,3)),W=W.concat(Me("System External",null!=(h=null==t||null==(w=t.diagramsThemeSettings)?void 0:w.bg_color_software_system_ext)?h:O.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,void 0,void 0,null!=(y=null==t||null==(S=t.diagramsThemeSettings)?void 0:S.text_color_software_system_ext)?y:O.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,4)),W=W.concat(Me("Container",null!=(E=null==t||null==(x=t.diagramsThemeSettings)?void 0:x.bg_color_container)?E:O.COLORS.BG_COLOR_CONTAINER,void 0,void 0,null!=(T=null==t||null==(R=t.diagramsThemeSettings)?void 0:R.text_color_container)?T:O.COLORS.TEXT_COLOR_CONTAINER,5)),W=W.concat(Me("Container External",null!=(C=null==t||null==(I=t.diagramsThemeSettings)?void 0:I.bg_color_container_ext)?C:O.COLORS.BG_COLOR_CONTAINER_EXT,void 0,void 0,null!=(D=null==t||null==(k=t.diagramsThemeSettings)?void 0:k.text_color_container_ext)?D:O.COLORS.TEXT_COLOR_CONTAINER_EXT,6)),W=W.concat(Me("Component",null!=(L=null==t||null==(N=t.diagramsThemeSettings)?void 0:N.bg_color_component)?L:O.COLORS.BG_COLOR_COMPONENT,void 0,void 0,null!=(A=null==t||null==(j=t.diagramsThemeSettings)?void 0:j.text_color_component)?A:O.COLORS.TEXT_COLOR_COMPONENT,7)),W=W.concat(Me("Component External",null!=(F=null==t||null==(M=t.diagramsThemeSettings)?void 0:M.bg_color_component_ext)?F:O.COLORS.BG_COLOR_COMPONENT_EXT,void 0,void 0,null!=(P=null==t||null==(z=t.diagramsThemeSettings)?void 0:z.text_color_component_ext)?P:O.COLORS.TEXT_COLOR_COMPONENT_EXT,8));let Y=8;var Z,$,G,U;null!=t&&null!=(B=t.diagramsThemeSettings)&&B.bg_color_boundary&&(Y++,W=W.concat(Me("Boundary",t.diagramsThemeSettings.bg_color_boundary,void 0,void 0,null!=(Z=null==t||null==($=t.diagramsThemeSettings)?void 0:$.text_color_boundary)?Z:O.COLORS.TEXT_COLOR_BOUNDARY,Y))),null!=t&&null!=(H=t.diagramsThemeSettings)&&H.bg_color_deployment_node&&(Y++,W=W.concat(Me("Deployment Node",t.diagramsThemeSettings.bg_color_deployment_node,void 0,void 0,null!=(G=null==t||null==(U=t.diagramsThemeSettings)?void 0:U.text_color_deployment_node)?G:O.COLORS.TEXT_COLOR_DEPLOYMENT_NODE,Y))),null!=t&&t.tags&&Object.entries(t.tags).forEach((([e,t],n)=>{var r,a,o,i,l;Y++,W=W.concat(Me(null!=(r=null!=(a=t.legend_text)?a:t.tag)?r:"<no tag>",t.bg_color,null!=(o=t.border_color)?o:t.bg_color?void 0:"black",null==(i=je(t.border_style))?void 0:i.value,null!=(l=t.font_color)?l:"black",Y))}));return new se(void 0,e,{alias:Fe,position:{left:m,top:f}},{},W)},ze="The diagram contains too many elements and relationships, which may cause the auto layout to break. Try adjusting auto layout settings like orientation, ranksep or subgraph margins.",Be="Graphviz not initialized. Cannot generate auto layout.",He="triangulation failed";var We=n(177);function Xe(e){return null==e?void 0:e.split("+")}function Ye(e,t){if(e&&t){const n=[];for(const r of e){const e=t[Se(r)];e&&n.push(e)}if(n.length>0)return Object.assign({},...n)}}let Ze=function(e){return e.Rectangle="RECTANGLE",e.Footer="FOOTER",e}({});class $e extends se{getUpdatedSpecs(){const e=super.getUpdatedSpecs();var t;if(e&&(null==(t=this.canvas)||t.discardActiveObject(),delete e.position,delete e.size,e.inner_specs=[],e.shapes=[],this.children))for(const t of this.children)if(le(t)){const n=t.getUpdatedSpecs();n&&e.inner_specs.push(n)}else if(t.name!==Ze.Footer){var n,r;e.shapes.push({position:{left:t.left,top:t.top,z_index:K(t.canvas,t)},size:{scale_x:null!=(n=t.scaleX)?n:1,scale_y:null!=(r=t.scaleY)?r:1},shape_type:t.name})}else e.shapes.push({position:{z_index:K(t.canvas,t)},shape_type:t.name});return e}}const Ge=e=>{var t,n,r,a,o,i,l,s,_,c,u;let d,g;const p=(null==(t=e.data)||null==(t=t.rawData)||null==(t=t.base_data)?void 0:t.alias)&&e.data.rawAutoLayout&&void 0!==e.data.rawAutoLayout[e.data.rawData.base_data.alias],b=[];null==(n=e.children)||n.forEach((e=>{e.name===Ze.Footer?g=e:e.name===Ze.Rectangle?d=e:b.push(e)}));const f=Q(te(b),!1),m=null!=(r=null==(a=d)?void 0:a.scaleX)?r:1,h=null!=(o=null==(i=d)?void 0:i.scaleY)?o:1,w=null!=(l=null==(s=d)||null==(s=s.canvas)?void 0:s.getZoom())?l:1,y=ne(e.canvas),v=X*m,O=X*h,S=X*m,E=X*h;var x;d&&void 0!==f.left&&void 0!==f.right&&void 0!==f.top&&void 0!==f.bottom&&void 0!==f.width&&void 0!==f.height&&void 0!==g?(f.left=(f.left-y.panX)/w,f.top=(f.top-y.panY)/w,f.right=(f.right-y.panX)/w,f.bottom=(f.bottom-y.panY)/w,f.width=f.right-f.left,f.height=f.bottom-f.top,p||(d.width=f.width/m+v/m*2,d.height=f.height/h+O/h*3+(null!=(x=g.height)?x:0),d.left=f.left-v,d.top=f.top-O)):d&&void 0!==g&&(d.width=H,d.height=W+g.getScaledHeight()),null==(_=e.canvas)||_.renderAll(),d&&g&&void 0!==d.left&&void 0!==d.top&&void 0!==d.height&&void 0!==g.height&&(g.top=d.top+d.getScaledHeight()-g.getScaledHeight()-E,g.left=d.left+S),null==(c=d)||c.setCoords(),null==(u=g)||u.setCoords()},Ue=e=>{e.on(c,(t=>{Ve(t,e)}))},qe=e=>{e.on(c,(t=>{Ve(t,e)}))},Ve=(e,t)=>{var n;if(e.e&&null!=(n=t.parent)&&n.children){var r;const e=re(t);if(!ae(null==(r=t.canvas)?void 0:r.getActiveObjects(),e.objects)){var a,o,i;null==(a=t.canvas)||a.discardActiveObject();const n=t.parent;let r;"multiple"===e.type?r=new q.fabric.ActiveSelection(e.objects,{canvas:t.canvas}):(r=new ie(e.objects,{canvas:t.canvas}),r.parent=n,r.on(s,(e=>{Qe(r.canvas,e,r,n)})),r.on(_,(e=>{var r;null==(r=t.canvas)||r.discardActiveObject(),n.fire(_)}))),null==(o=t.canvas)||o.setActiveObject(r),null==(i=t.canvas)||i.requestRenderAll()}}},Je=(e,t)=>{e&&t&&Ge(e)},Qe=(e,t,n,r)=>{n instanceof q.fabric.ActiveSelection&&e&&r.onComponentMouseUp(e,t,n,((e,t,n)=>n instanceof q.fabric.ActiveSelection?[{isHeaderMenuItem:!0,id:"baseElasticContainerContextMenu",label:"",hidden:!0,alwaysOpen:!0,subMenuItems:[..._e(e,t,n,!1)]}]:[])(e,t,n))},Ke=(e,t,n,r,a,o)=>{var i,l;const s=Ye(Xe(null==(i=e.base_data)?void 0:i.tags),null==o?void 0:o.tags),c={alias:null==(l=e.base_data)?void 0:l.alias},u=new $e(e,t,c,r,[],void 0,void 0,void 0,!0);u.visible=!1;const d=((e,t,n,r,a)=>{var o,i,l,s,_,c,u,d,g,p,b,f;const m=null==e||null==(o=e.shapes)?void 0:o.filter((e=>e.shape_type===Ze.Rectangle))[0],h=new q.fabric.Rect({fill:null!=(i=null==a?void 0:a.bg_color)?i:n.bgColor,stroke:null!=(l=null==a?void 0:a.border_color)?l:n.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH,strokeDashArray:n.strokeDashArray,left:null!=(s=null==m||null==(_=m.position)?void 0:_.left)?s:Oe(e.alias,t).left,top:null!=(c=null==m||null==(u=m.position)?void 0:u.top)?c:Oe(e.alias,t).top,name:Ze.Rectangle,rx:O.SIZES.BORDER_RADIUS,ry:O.SIZES.BORDER_RADIUS,scaleX:null!=(d=null==m||null==(g=m.size)?void 0:g.scale_x)?d:1,scaleY:null!=(p=null==m||null==(b=m.size)?void 0:b.scale_y)?p:1}),w=((e,t)=>{var n,r,a;if(e&&null!=(n=t[e])&&n.size)return{width:null==(r=t[e].size)?void 0:r.x,height:null==(a=t[e].size)?void 0:a.y}})(e.alias,t);return w&&(h.width=w.width,h.height=w.height),h.data={rawDiagramElementSpec:m},h.parent=r,Ue(h),null==(f=r.children)||f.push(h),h})(t,r,a,u,s);((e,t,n,r,a,o,i)=>{var l,s,_,c,u,d,g,p,b,f,m;const h=null==e||null==(l=e.shapes)?void 0:l.filter((e=>e.shape_type===Ze.Footer))[0],w=[],y={fontFamily:v.FONT.FAMILY,fill:null!=(s=null==i?void 0:i.font_color)?s:n.textColor};let O;var S;let E;var x,T;null!=(_=r.base_data)&&_.link&&(O=new q.fabric.Path(We.faLink.icon[4].toString(),{fill:null!=(S=null==i?void 0:i.font_color)?S:n.textColor,opacity:1,originX:"left",originY:"top",top:1,left:0}),O.scaleToWidth(10),w.push(O)),null!=(c=r.base_data)&&c.label&&(E=new q.fabric.Text(r.base_data.label,Object.assign({},y,{fontSize:z,fontWeight:"bold"})),E.top=0,E.left=null!=(x=O)&&x.getScaledWidth()?(null==(T=O)?void 0:T.getScaledWidth())+3:0,w.push(E));let R=null!=(u=null!=(d=r.boundary_type)?d:r.deployment_node_type)?u:"";R=null!=(g=null!=(p=r.boundary_custom_type)?p:r.deploymeny_node_custom_type)?g:R,R+=r.technology?`: ${r.technology}`:"",R=`[${R}]`;const C=new q.fabric.Text(R,Object.assign({},y,{fontSize:B,left:0,top:null!=(b=null==(f=E)?void 0:f.height)?b:0}));w.push(C);const I=new q.fabric.Group(w,{name:Ze.Footer,selectable:!1,evented:!1,left:a.left,top:a.top,scaleX:a.scaleX,scaleY:a.scaleY});I.data={rawDiagramElementSpec:h},I.parent=o,qe(I),null==(m=o.children)||m.push(I)})(t,0,a,e,d,u,s);let g=[];return e.sub_elements&&(g=Nt(void 0,e.sub_elements,n,r,Object.assign({},o,{skipAddToCanvas:!0,skipLegendRendering:!0})),g.forEach((e=>{var t;e.parent=u,null==(t=u.children)||t.push(e)}))),Ge(u),(e=>{var t;null==(t=e.children)||t.forEach((t=>{t.on(_,(t=>{Je(e,t)})),t.children&&t.children.forEach((t=>{t.on(_,(t=>{Je(e,t)}))}))}))})(u),u},et=(e,t,n,r,a)=>{if(t.base_data&&t.base_data.alias&&t.base_data.label&&t.boundary_type&&(n.auto_layout_enabled&&r[t.base_data.alias]||!n.auto_layout_enabled)){var o;const i=((e,t,n,r,a,o)=>{var i,l,s,_,c,u;const d={bgColor:null!=(i=null==o||null==(l=o.diagramsThemeSettings)?void 0:l.bg_color_boundary)?i:O.COLORS.BG_COLOR_BOUNDARY,borderColor:null!=(s=null==o||null==(_=o.diagramsThemeSettings)?void 0:_.border_color_boundary)?s:O.COLORS.BORDER_COLOR_BOUNDARY,textColor:null!=(c=null==o||null==(u=o.diagramsThemeSettings)?void 0:u.text_color_boundary)?c:O.COLORS.TEXT_COLOR_BOUNDARY,strokeDashArray:Y.SIZES.STROKE_DASH_ARRAY},g=Object.assign({},d,a);return Ke(e,t,n,r,g,o)})(t,de(t.base_data.alias,void 0,void 0,{Boundary:t.boundary_type},n),n,r,void 0,a);return a&&a.skipAddToCanvas||!i||null==e||e.add(i,...te(null!=(o=i.children)?o:[])),i}},tt=(e,t,n,r,a)=>{var o,i,l,s,_,c;const u=Ye(Xe(null==(o=e.base_data)?void 0:o.tags),null==a?void 0:a.tags),d=[],g=((e,t,n)=>{var r,a,o,i,l,s,_;const c=new q.fabric.Rect({fill:null!=(r=null==n?void 0:n.bg_color)?r:t.bgColor,stroke:null!=(a=null==n?void 0:n.border_color)?a:t.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH,left:v.SIZES.DEFAULT_LEFT,top:v.SIZES.DEFAULT_TOP,width:null!=(o=t.widthBox)?o:O.SIZES.WIDTH,height:O.SIZES.MIN_HEIGHT,name:null!=(i=null==(l=e.base_data)?void 0:l.alias)?i:"undefined",rx:null!=(s=t.borderRadius)?s:O.SIZES.BORDER_RADIUS,ry:null!=(_=t.borderRadius)?_:O.SIZES.BORDER_RADIUS});return c.on("scaling",(e=>{var t;null!=(t=e.target)&&t.width&&e.target.height&&e.target.scaleX&&e.target.scaleY&&e.target.set({width:e.target.width*e.target.scaleX,height:e.target.height*e.target.scaleY,scaleX:1,scaleY:1})})),c})(e,r,u);let p;d.push(g),null!=(i=e.base_data)&&i.tags&&(p=((e,t,n,r)=>{var a,o,i,l,s;return new q.fabric.Text(`«${null==(a=t.base_data)?void 0:a.tags}»`,{fill:null!=(o=null==r?void 0:r.font_color)?o:n.textColor,fontFamily:v.FONT.FAMILY,fontSize:O.FONT.SIZE_TAG,fontStyle:"italic",fontWeight:"normal",textAlign:"center",originX:"center",originY:"top",left:(null!=(i=e.left)?i:v.SIZES.DEFAULT_LEFT)+(null!=(l=e.width)?l:0)/2,top:(null!=(s=e.top)?s:v.SIZES.DEFAULT_TOP)+O.SIZES.TOP_TAGS})})(g,e,r,u),d.push(p));const b=((e,t,n,r,a)=>{var o,i,l,s,_,c;return new q.fabric.Text(null!=(o=(0,$.x4)(null==(i=n.base_data)?void 0:i.label))?o:"undefined",{fill:null!=(l=null==a?void 0:a.font_color)?l:r.textColor,fontFamily:v.FONT.FAMILY,fontSize:O.FONT.SIZE,fontWeight:"bold",textAlign:"center",originX:"center",originY:"top",left:(null!=(s=e.left)?s:v.SIZES.DEFAULT_LEFT)+(null!=(_=e.width)?_:0)/2,top:(null!=(c=null==t?void 0:t.top)?c:v.SIZES.DEFAULT_TOP)+O.SIZES.TOP_LABEL})})(g,p,e,r,u);d.push(b);const f=((e,t,n,r,a)=>{var o,i,l,s,_,c,u,d,g,p,b,f;const m=`[${null!=(o=null!=(i=null!=(l=null!=(s=null!=(_=null!=(c=null!=(u=n.boundary_custom_type)?u:n.boundary_type)?c:n.component_type)?_:n.container_type)?s:n.deployment_node_type)?l:n.deploymeny_node_custom_type)?i:n.person_type)?o:n.system_type}${n.technology?`: ${n.technology}`:""}]`;return new q.fabric.Text(m,{fill:null!=(d=null==a?void 0:a.font_color)?d:r.textColor,fontFamily:v.FONT.FAMILY,fontSize:O.FONT.SIZE_TYPE_TECHNOLOGY,fontWeight:"normal",textAlign:"center",originX:"center",originY:"top",left:(null!=(g=e.left)?g:v.SIZES.DEFAULT_LEFT)+(null!=(p=e.width)?p:0)/2,top:(null!=(b=null==t?void 0:t.top)?b:v.SIZES.DEFAULT_TOP)+O.SIZES.TOP_TYPE_TECHNOLOGY+(null!=(f=null==t?void 0:t.height)?f:0)})})(g,b,e,r,u);let m;d.push(f),null!=(l=e.base_data)&&l.description&&(m=((e,t,n,r,a)=>{var o,i,l,s,_,c,u;const d=null!=(o=r.widthDescription)?o:e.width;return new q.fabric.Textbox(null!=(i=(0,$.x4)(null==(l=n.base_data)?void 0:l.description))?i:"",{fill:null!=(s=null==a?void 0:a.font_color)?s:r.textColor,fontFamily:v.FONT.FAMILY,fontSize:O.FONT.SIZE_DESCRIPTION,fontWeight:400,opacity:.7,splitByGrapheme:!0,width:d?d-O.SIZES.PADDING_Y_DESCRIPTION:0,textAlign:"center",originX:"center",originY:"top",left:(null!=(_=e.left)?_:v.SIZES.DEFAULT_LEFT)+(null!=(c=e.width)?c:0)/2,top:(null!=(u=null==t?void 0:t.top)?u:0)+O.SIZES.TOP_DESCRIPTION})})(g,f,e,r,u),d.push(m)),null!=(s=e.base_data)&&s.link&&d.push(((e,t,n)=>{var r,a,o;const i=new q.fabric.Path(We.faLink.icon[4].toString(),{fill:null!=(r=null==n?void 0:n.font_color)?r:t.textColor,opacity:1,originX:"left",originY:"top",left:(null!=(a=e.left)?a:0)+5,top:(null!=(o=e.top)?o:0)+5});return i.scaleToWidth(10),i})(g,r,u)),((e,t)=>{var n,r,a;let o=(null!=(n=null==t?void 0:t.height)?n:0)+((null!=(r=null==t?void 0:t.top)?r:0)-(null!=(a=null==e?void 0:e.top)?a:0))+O.SIZES.PADDING_BOTTOM;o<O.SIZES.MIN_HEIGHT&&(o=O.SIZES.MIN_HEIGHT),e.height=o})(g,m);const h={alias:null==(_=e.base_data)?void 0:_.alias,position:Oe(null==(c=e.base_data)?void 0:c.alias,n)};return new se(e,t,h,n,d)},nt=(e,t,n,r,a)=>{var o,i,l,s;const _=Ye(Xe(null==(o=e.base_data)?void 0:o.tags),null==a?void 0:a.tags),c=[],u=((e,t,n)=>{const r=Object.assign({},t,{borderRadius:0});return tt(e,{},{},r,n)})(e,r,a);c.push(u);const d=(null!=(i=u.width)?i:0)/2-v.SIZES.BORDER_WIDTH/2;c.push(((e,t,n,r)=>{var a,o,i,l,s,_,c,u,d,g,p,b,f,m,h,w,y,O,S,x,T,R;const C=[],I=v.SIZES.BORDER_WIDTH,D=E.SIZES.TOP_BOX_HEIGHT,k=new q.fabric.Rect({fill:null!=(a=null==r?void 0:r.bg_color)?a:n.bgColor,strokeWidth:0,left:(null!=(o=e.left)?o:0)+v.SIZES.BORDER_WIDTH,top:(null!=(i=e.top)?i:0)-D+I,width:(null!=(l=e.width)?l:0)-2*v.SIZES.BORDER_WIDTH,height:D});return C.push(k),C.push(new q.fabric.Line([null!=(s=e.left)?s:0,null!=(_=e.top)?_:0,null!=(c=e.left)?c:0,null!=(u=k.top)?u:0],{strokeWidth:v.SIZES.BORDER_WIDTH,stroke:null!=(d=null==r?void 0:r.border_color)?d:n.borderColor,originX:"left",originY:"top"})),C.push(new q.fabric.Line([(null!=(g=e.left)?g:0)+(null!=(p=e.width)?p:0)-v.SIZES.BORDER_WIDTH,null!=(b=e.top)?b:0,(null!=(f=e.left)?f:0)+(null!=(m=e.width)?m:0)-v.SIZES.BORDER_WIDTH,null!=(h=k.top)?h:0],{strokeWidth:v.SIZES.BORDER_WIDTH,stroke:null!=(w=null==r?void 0:r.border_color)?w:n.borderColor,originX:"left",originY:"top"})),C.push(new q.fabric.Circle({fill:null!=(y=null==r?void 0:r.bg_color)?y:n.bgColor,stroke:null!=(O=null==r?void 0:r.border_color)?O:n.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH,radius:t,top:(null!=(S=k.top)?S:0)-(null!=(x=e.width)?x:0)*E.SIZES.SCALE_X_TOP_BOTTOM/2,left:(null!=(T=k.left)?T:0)+ +(null!=(R=e.width)?R:0)-I,angle:90,startAngle:0,endAngle:360,scaleX:E.SIZES.SCALE_X_TOP_BOTTOM})),new q.fabric.Group(C)})(u,d,r,_)),c.push(((e,t,n,r)=>{var a,o,i,l,s,_;return new q.fabric.Circle({fill:null!=(a=null==r?void 0:r.bg_color)?a:n.bgColor,stroke:null!=(o=null==r?void 0:r.border_color)?o:n.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH,radius:t,top:(null!=(i=e.top)?i:0)+(null!=(l=e.height)?l:0)-2*t*E.SIZES.SCALE_X_TOP_BOTTOM/2-v.SIZES.BORDER_WIDTH,left:(null!=(s=e.left)?s:0)+(null!=(_=e.width)?_:0),angle:90,startAngle:270,endAngle:90,scaleX:E.SIZES.SCALE_X_TOP_BOTTOM})})(u,d,r,_));const g={alias:null==(l=e.base_data)?void 0:l.alias,position:Oe(null==(s=e.base_data)?void 0:s.alias,n)};return new se(e,t,g,n,c)},rt=(e,t,n,r,a)=>{var o,i,l,s;const _=Ye(Xe(null==(o=e.base_data)?void 0:o.tags),null==a?void 0:a.tags),c=[],u=at(e,r,a);c.push(u);const d=(null!=(i=u.height)?i:0)/2-v.SIZES.BORDER_WIDTH/2;c.push(ot(u,d,r,_)),c.push(it(u,d,r,_));const g={alias:null==(l=e.base_data)?void 0:l.alias,position:Oe(null==(s=e.base_data)?void 0:s.alias,n)};return new se(e,t,g,n,c)},at=(e,t,n)=>{const r=Object.assign({},t,{borderRadius:0});return tt(e,{},{},r,n)},ot=(e,t,n,r)=>{var a,o,i;return new q.fabric.Circle({fill:null!=(a=null==r?void 0:r.bg_color)?a:n.bgColor,stroke:null!=(o=null==r?void 0:r.border_color)?o:n.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH,radius:t,top:e.top,left:(null!=(i=e.left)?i:0)+2*t*S.SIZES.SCALE_Y_TAIL_HEAD/2+2*v.SIZES.BORDER_WIDTH,angle:90,startAngle:0,endAngle:180,scaleY:S.SIZES.SCALE_Y_TAIL_HEAD})},it=(e,t,n,r)=>{var a,o,i,l,s,_,c,u,d,g,p,b,f,m,h,w,y,O,E,x,T,R,C,I;const D=[],k=v.SIZES.BORDER_WIDTH,L=new q.fabric.Rect({fill:null!=(a=null==r?void 0:r.bg_color)?a:n.bgColor,strokeWidth:0,left:(null!=(o=e.left)?o:0)+(null!=(i=e.width)?i:0)-k,top:(null!=(l=e.top)?l:0)+v.SIZES.BORDER_WIDTH,width:S.SIZES.HEAD_BOX_WIDTH,height:(null!=(s=e.height)?s:0)-2*v.SIZES.BORDER_WIDTH});return D.push(L),D.push(new q.fabric.Line([null!=(_=L.left)?_:0,null!=(c=e.top)?c:0,(null!=(u=L.left)?u:0)+(null!=(d=L.width)?d:0),null!=(g=e.top)?g:0],{strokeWidth:v.SIZES.BORDER_WIDTH,stroke:null!=(p=null==r?void 0:r.border_color)?p:n.borderColor,originX:"left",originY:"top"})),D.push(new q.fabric.Line([null!=(b=L.left)?b:0,(null!=(f=L.top)?f:0)+(null!=(m=L.height)?m:0),(null!=(h=L.left)?h:0)+(null!=(w=L.width)?w:0),(null!=(y=L.top)?y:0)+(null!=(O=L.height)?O:0)],{strokeWidth:v.SIZES.BORDER_WIDTH,stroke:null!=(E=null==r?void 0:r.border_color)?E:n.borderColor,originX:"left",originY:"top"})),D.push(new q.fabric.Circle({fill:null!=(x=null==r?void 0:r.bg_color)?x:n.bgColor,stroke:null!=(T=null==r?void 0:r.border_color)?T:n.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH,radius:t,top:e.top,left:(null!=(R=L.left)?R:0)+(null!=(C=L.width)?C:0)+(null!=(I=e.height)?I:0)*S.SIZES.SCALE_Y_TAIL_HEAD/2-k,angle:90,startAngle:0,endAngle:360,scaleY:S.SIZES.SCALE_Y_TAIL_HEAD})),new q.fabric.Group(D)},lt=rt,st=(e,t,n,r,a)=>{if(t.base_data&&t.base_data.alias&&t.component_type&&(n.auto_layout_enabled&&r[t.base_data.alias]||!n.auto_layout_enabled)){let o;switch(t.component_type){case"Component":case"ComponentDb":case"ComponentQueue":o=((e,t,n,r,a)=>{var o,i,l,s,_,c;const u={bgColor:null!=(o=null==a||null==(i=a.diagramsThemeSettings)?void 0:i.bg_color_component)?o:O.COLORS.BG_COLOR_COMPONENT,borderColor:null!=(l=null==a||null==(s=a.diagramsThemeSettings)?void 0:s.border_color_component)?l:O.COLORS.BORDER_COLOR_COMPONENT,textColor:null!=(_=null==a||null==(c=a.diagramsThemeSettings)?void 0:c.text_color_component)?_:O.COLORS.TEXT_COLOR_COMPONENT},d=Object.assign({},u,r);if(e.component_type)switch(e.component_type){case"Component":return tt(e,t,n,d,a);case"ComponentDb":return nt(e,t,n,d,a);case"ComponentQueue":return lt(e,t,n,d,a)}})(t,de(t.base_data.alias,void 0,void 0,{Component:t.component_type},n),r,void 0,a);break;case"Component_Ext":case"ComponentDb_Ext":case"ComponentQueue_Ext":o=((e,t,n,r,a)=>{var o,i,l,s,_,c;const u={bgColor:null!=(o=null==a||null==(i=a.diagramsThemeSettings)?void 0:i.bg_color_component_ext)?o:O.COLORS.BG_COLOR_COMPONENT_EXT,borderColor:null!=(l=null==a||null==(s=a.diagramsThemeSettings)?void 0:s.border_color_component_ext)?l:O.COLORS.BORDER_COLOR_COMPONENT_EXT,textColor:null!=(_=null==a||null==(c=a.diagramsThemeSettings)?void 0:c.text_color_component_ext)?_:O.COLORS.TEXT_COLOR_COMPONENT_EXT},d=Object.assign({},u,r);if(e.component_type)switch(e.component_type){case"Component_Ext":return tt(e,t,n,d,a);case"ComponentDb_Ext":return nt(e,t,n,d,a);case"ComponentQueue_Ext":return lt(e,t,n,d,a)}})(t,de(t.base_data.alias,void 0,void 0,{Component:t.component_type},n),r,void 0,a)}return a&&a.skipAddToCanvas||!o||null==e||e.add(o),o}},_t=(e,t,n,r,a)=>{if(t.base_data&&t.base_data.alias&&t.container_type&&(n.auto_layout_enabled&&r[t.base_data.alias]||!n.auto_layout_enabled)){let o;switch(t.container_type){case"Container":case"ContainerDb":case"ContainerQueue":o=((e,t,n,r,a)=>{var o,i,l,s,_,c;const u={bgColor:null!=(o=null==a||null==(i=a.diagramsThemeSettings)?void 0:i.bg_color_container)?o:O.COLORS.BG_COLOR_CONTAINER,borderColor:null!=(l=null==a||null==(s=a.diagramsThemeSettings)?void 0:s.border_color_container)?l:O.COLORS.BORDER_COLOR_CONTAINER,textColor:null!=(_=null==a||null==(c=a.diagramsThemeSettings)?void 0:c.text_color_container)?_:O.COLORS.TEXT_COLOR_CONTAINER},d=Object.assign({},u,r);if(e.container_type)switch(e.container_type){case"Container":return tt(e,t,n,d,a);case"ContainerDb":return nt(e,t,n,d,a);case"ContainerQueue":return rt(e,t,n,d,a)}})(t,de(t.base_data.alias,void 0,void 0,{Container:t.container_type},n),r,void 0,a);break;case"Container_Ext":case"ContainerDb_Ext":case"ContainerQueue_Ext":o=((e,t,n,r,a)=>{var o,i,l,s,_,c;const u={bgColor:null!=(o=null==a||null==(i=a.diagramsThemeSettings)?void 0:i.bg_color_container_ext)?o:O.COLORS.BG_COLOR_CONTAINER_EXT,borderColor:null!=(l=null==a||null==(s=a.diagramsThemeSettings)?void 0:s.border_color_container_ext)?l:O.COLORS.BORDER_COLOR_CONTAINER_EXT,textColor:null!=(_=null==a||null==(c=a.diagramsThemeSettings)?void 0:c.text_color_container_ext)?_:O.COLORS.TEXT_COLOR_CONTAINER_EXT},d=Object.assign({},u,r);if(e.container_type)switch(e.container_type){case"Container_Ext":return tt(e,t,n,d,a);case"ContainerDb_Ext":return nt(e,t,n,d,a);case"ContainerQueue_Ext":return lt(e,t,n,d,a)}})(t,de(t.base_data.alias,void 0,void 0,{Container:t.container_type},n),r,void 0,a)}return a&&a.skipAddToCanvas||!o||null==e||e.add(o),o}},ct=(e,t,n,r,a)=>{if(t.base_data&&t.base_data.alias&&t.base_data.label&&t.deployment_node_type&&(n.auto_layout_enabled&&r[t.base_data.alias]||!n.auto_layout_enabled)){var o;const i=((e,t,n,r,a,o)=>{var i,l,s,_,c,u;const d={bgColor:null!=(i=null==o||null==(l=o.diagramsThemeSettings)?void 0:l.bg_color_deployment_node)?i:O.COLORS.BG_COLOR_DEPLOYMENT_NODE,borderColor:null!=(s=null==o||null==(_=o.diagramsThemeSettings)?void 0:_.border_color_deployment_node)?s:O.COLORS.BORDER_COLOR_DEPLOYMENT_NODE,textColor:null!=(c=null==o||null==(u=o.diagramsThemeSettings)?void 0:u.text_color_deployment_node)?c:O.COLORS.TEXT_COLOR_DEPLOYMENT_NODE},g=Object.assign({},d,a);return Ke(e,t,n,r,g,o)})(t,de(t.base_data.alias,void 0,void 0,{DeploymentNode:t.deployment_node_type},n),n,r,void 0,a);return a&&a.skipAddToCanvas||!i||null==e||e.add(i,...te(null!=(o=i.children)?o:[])),i}},ut=(e,t,n,r,a)=>{var o,i;const l=[],s=((e,t,n)=>{const r=Object.assign({},t,{borderRadius:M});return tt(e,{},{},r,n)})(e,r,a);l.push(s);const _=((e,t)=>{var n,r,a,o,i;const l=new q.fabric.Circle({radius:P,top:t.top,left:t.left,fill:e.bgColor,stroke:e.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH});return l.left=(null!=(n=l.left)?n:0)+(null!=(r=t.getScaledWidth())?r:0)/2-(null!=(a=l.getScaledWidth())?a:0)/2,l.top=(null!=(o=l.top)?o:0)-(null!=(i=l.getScaledWidth())?i:0)+5,l})(r,s);l.push(_);const c={alias:null==(o=e.base_data)?void 0:o.alias,position:Oe(null==(i=e.base_data)?void 0:i.alias,n)};return new se(e,t,c,n,l)},dt=(e,t,n,r,a)=>{if(t.base_data&&t.base_data.alias&&t.person_type&&(n.auto_layout_enabled&&r[t.base_data.alias]||!n.auto_layout_enabled)){let o;switch(t.person_type){case"Person":o=((e,t,n,r,a)=>{var o,i,l,s,_,c;const u={bgColor:null!=(o=null==a||null==(i=a.diagramsThemeSettings)?void 0:i.bg_color_person)?o:O.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON,borderColor:null!=(l=null==a||null==(s=a.diagramsThemeSettings)?void 0:s.border_color_person)?l:O.COLORS.BORDER_COLOR_SOFTWARE_SYSTEM_PERSON,textColor:null!=(_=null==a||null==(c=a.diagramsThemeSettings)?void 0:c.text_color_person)?_:O.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON},d=Object.assign({},u,r);return ut(e,t,n,d,a)})(t,de(t.base_data.alias,void 0,void 0,{Person:t.person_type},n),r,void 0,a);break;case"Person_Ext":o=((e,t,n,r,a)=>{var o,i,l,s,_,c;const u={bgColor:null!=(o=null==a||null==(i=a.diagramsThemeSettings)?void 0:i.bg_color_person_ext)?o:O.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,borderColor:null!=(l=null==a||null==(s=a.diagramsThemeSettings)?void 0:s.border_color_person_ext)?l:O.COLORS.BORDER_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,textColor:null!=(_=null==a||null==(c=a.diagramsThemeSettings)?void 0:c.text_color_person_ext)?_:O.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON_EXT},d=Object.assign({},u,r);return ut(e,t,n,d,a)})(t,de(t.base_data.alias,void 0,void 0,{Person:t.person_type},n),r,void 0,a)}return a&&a.skipAddToCanvas||!o||null==e||e.add(o),o}};let gt=function(e){return e.Dot="DOT",e.Line="LINE",e.Text="TEXT",e.Triangle="TRIANGLE",e.Rectangle="RECTANGLE",e}({});class pt extends se{getUpdatedSpecs(){const e=super.getUpdatedSpecs();var t,n;return e&&(null==(t=this.canvas)||t.discardActiveObject(),delete e.position,delete e.size,e.shapes=[],null==(n=this.children)||n.forEach((t=>{const n=q.fabric.util.object.clone(t);if(n.name===gt.Line||n.name===gt.Rectangle)e.shapes.push({position:{z_index:K(n.canvas,n)},shape_type:n.name});else{var r,a;let t=0,o=0;const i=n.angle;if(n.name===gt.Text)t=n.getCenterPoint().x,o=n.getCenterPoint().y;else if(n.name===gt.Dot||n.name===gt.Triangle){n.name===gt.Triangle&&n.rotate(F);const e=wt(this.canvas,n.left,n.top,n.name===gt.Triangle,i,n.scaleX,n.scaleY,!0);t=e.left,o=e.top}const l={position:{left:t,top:o,z_index:K(n.canvas,n)},size:{scale_x:null!=(r=n.scaleX)?r:1,scale_y:null!=(a=n.scaleY)?a:1},shape_type:n.name};n.name===gt.Triangle&&(l.position.angle=i),e.shapes.push(l)}}))),e}}const bt=e=>{var t;e.children=null==(t=e.children)?void 0:t.sort(((e,t)=>e.name===gt.Rectangle||e.name===gt.Line&&t.name!==gt.Rectangle?-1:t.name===gt.Rectangle||e.name!==gt.Rectangle&&t.name===gt.Line?1:e.name===t.name?0:1))},ft=e=>{const t=e.parent;let n,r=1;const a=e.canvas;if(t&&a){const l=[],s=[];if(t.children){var o,i;t.children.forEach((e=>{if(e.name===gt.Triangle&&(n=e),e.name===gt.Dot||e.name===gt.Triangle){var t;s.push(e),r=null!=(t=e.scaleX)?t:1;const n=e.getPointByOrigin("center","center"),a=new oe(n.x,n.y,e.name);l.push(a)}}));const _=t.children.findIndex((e=>e.name===gt.Line));void 0!==_&&_>-1&&t.children.splice(_,1);const c=K(a,e),u=null==(o=e.data)?void 0:o.rawDiagramElementSpec,d=e.stroke,g=e.strokeDashArray,p=null==(i=e.data)?void 0:i.otherData.selectedRelColor;a.remove(e);const b=St(u,l,t,r,d,p,void 0,g);a.add(b),c&&b.moveTo(c),n&&ht(l,n)}}},mt=e=>{const t=e.findIndex((e=>e.customType===gt.Triangle)),n=e[t],r=e[t>0?t-1:t+1];return 180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI+90},ht=(e,t)=>{let n;e&&(n=mt(e),t.rotate(n))},wt=(e,t,n,r,a=F,o=1,i=1,l)=>{var s;const _=null!=(s=null==e?void 0:e.getZoom())?s:1,c=ne(e);let u=t,d=n;if(r){const e=N*o/2+A*o/2,t=N*i/2+A*i/2;l?(u-=e,d+=t):(u+=e,d-=t)}else{const e=L*o*2+A*o/2,t=L*i+A*i/2;l?(u+=e,d+=t):(u-=e,d-=t)}return l||(u=(u-c.panX)/_,d=(d-c.panY)/_),{left:u,top:d,angle:a}},yt=(e,t)=>{let n=[];if(null!=e&&e.shapes)null==e||e.shapes.forEach((e=>{var t,r;if((e.shape_type===gt.Dot||e.shape_type===gt.Triangle)&&void 0!==(null==(t=e.position)?void 0:t.left)&&void 0!==(null==(r=e.position)?void 0:r.top)){const t=new oe(e.position.left,e.position.top,e.shape_type);t.data={rawDiagramElementSpec:e},n.push(t)}}));else{var r,a;let o;null!=e&&e.alias&&null!=(r=t[e.alias])&&r.start&&null!=(a=t[e.alias])&&a.end?(o=[],o.push(new oe(t[e.alias].start.x,t[e.alias].start.y,gt.Dot)),t[e.alias].path&&t[e.alias].path.forEach((e=>{o.push(new oe(e.x,e.y,gt.Dot))})),o.push(new oe(t[e.alias].end.x,t[e.alias].end.y,gt.Triangle))):o=[new oe(v.SIZES.DEFAULT_LEFT,v.SIZES.DEFAULT_TOP,gt.Dot),new oe(100+v.SIZES.DEFAULT_LEFT,v.SIZES.DEFAULT_TOP,gt.Triangle)],n=n.concat(o)}return n},vt=(e,t,n,r,a,o)=>{const i=[],l=void 0!==(null==e?void 0:e.alias)&&void 0!==t[e.alias];for(let e=0;e<n.length;e++){var s,_,c,u;i.push(Ot(void 0,n[e],n[e].customType===gt.Triangle?null!=(s=null==(_=n[e].data)||null==(_=_.rawDiagramElementSpec)||null==(_=_.position)?void 0:_.angle)?s:mt(n):void 0,n[e].customType===gt.Triangle,r,!0,null==(c=n[e].data)||null==(c=c.rawDiagramElementSpec)||null==(c=c.size)?void 0:c.scale_x,null==(u=n[e].data)||null==(u=u.rawDiagramElementSpec)||null==(u=u.size)?void 0:u.scale_y,a,o,l))}return i},Ot=(e,t,n,r,a,o=!0,i=1,l=1,s,_,c)=>{var u;s=null!=(u=s)?u:T;const{left:d,top:g,angle:p}=wt(e,t.x,t.y,r,n,i,l,!1);if(r){var b,f;const e=new q.fabric.Triangle({left:d,top:g,width:N,height:N,fill:s,scaleX:i,scaleY:l,hasControls:!1,name:gt.Triangle,angle:F});return e.rotate(p),e.data={rawDiagramElementSpec:null==(b=t.data)?void 0:b.rawDiagramElementSpec,otherData:{selectedRelColor:null!=_?_:C}},e.parent=a,o&&(null==(f=a.children)||f.push(e)),Tt(e,s),e}{var m,h;const e=new q.fabric.Circle({left:d,top:g,radius:L,fill:s,opacity:.2,scaleX:i,scaleY:l,hasControls:!1,name:gt.Dot,visible:!c,selectable:!c,hasBorders:!c});return e.data={rawDiagramElementSpec:null==(m=t.data)?void 0:m.rawDiagramElementSpec,otherData:{selectedRelColor:null!=_?_:C}},e.parent=a,o&&(null==(h=a.children)||h.push(e)),Tt(e,s),e}},St=(e,t,n,r=1,a,o,i,l)=>{var s,_,c;const u=null==e||null==(s=e.shapes)?void 0:s.filter((e=>e.shape_type===gt.Line))[0];let d;return d=i&&null!=e&&e.alias&&null!=(_=i[e.alias])&&_.svg_path?new q.fabric.Path(i[e.alias].svg_path,{stroke:null!=a?a:T,strokeDashArray:l,fill:"",strokeWidth:A*r,scaleX:1,scaleY:1,name:gt.Line,perPixelTargetFind:!0,hasBorders:!1}):new q.fabric.Polyline(t,{stroke:null!=a?a:T,strokeDashArray:l,fill:"",strokeWidth:A*r,scaleX:1,scaleY:1,name:gt.Line,perPixelTargetFind:!0,hasBorders:!1}),d.data={rawDiagramElementSpec:u,otherData:{selectedRelColor:null!=o?o:C}},d.parent=n,xt(d,d.stroke,d.strokeWidth),null==(c=n.children)||c.push(d),d},Et=(e,t,n,r,a,o,i,l)=>{var s,_,c,u,d,g,p;let b,f=1,m=1;var h,w,y,O;null!=t&&t.shapes&&(b=t.shapes.filter((e=>e.shape_type===gt.Text))[0],b&&(f=null!=(h=null==(w=b.size)?void 0:w.scale_x)?h:1,m=null!=(y=null==(O=b.size)?void 0:O.scale_y)?y:1));const S=[],E={fontFamily:v.FONT.FAMILY,fill:null!=(s=null!=(_=null==l?void 0:l.font_color)?_:null==i||null==(c=i.diagramsThemeSettings)?void 0:c.text_color_relationship)?s:R};if(null!=(u=e.base_data)&&u.label){var T,C,L,N,A;const t=new q.fabric.Text((0,$.x4)(e.base_data.label),Object.assign({},E,{fontSize:I,fontWeight:"bold",textAlign:"center"}));t.top=e.technology?-(null!=(T=t.height)?T:0):-(null!=(C=t.height)?C:0)/2,t.left=(null!=(L=r.width)?L:0)/2-(null!=(N=t.width)?N:0)/2-(null!=(A=a[0].width)?A:0)/2,S.push(t)}if(e.technology){var j,F,M;const t=new q.fabric.Text(`[${e.technology}]`,Object.assign({},E,{fontSize:D,textAlign:"center"}));t.left=(null!=(j=r.width)?j:0)/2-(null!=(F=t.width)?F:0)/2-(null!=(M=a[0].width)?M:0)/2,S.push(t)}const P=new q.fabric.Group(S),z=P.getBoundingRect(),B=new q.fabric.Rect({top:z.top-k,left:z.left-k,width:z.width+2*k,height:z.height+2*k,fill:null!=(d=null==i||null==(g=i.diagramsThemeSettings)?void 0:g.bg_color_relationship)?d:x});let H,W;var X,Y,Z,G,U,V,J,Q;null!=t&&t.alias&&n[t.alias]&&n[t.alias].label_position?(H=n[t.alias].label_position.x-(null!=(X=B.width)?X:0)/2,W=n[t.alias].label_position.y-(null!=(Y=B.height)?Y:0)/2):(H=(null!=(Z=r.left)?Z:0)+(null!=(G=r.width)?G:0)/2-(null!=(U=B.width)?U:0)/2,W=(null!=(V=r.top)?V:0)+(null!=(J=r.height)?J:0)/2-(null!=(Q=B.height)?Q:0)/2);const K=new q.fabric.Group([B,P],{name:gt.Text,hasControls:!1,left:H,top:W,scaleX:f,scaleY:m});var ee,te;return K.data={rawDiagramElementSpec:b},K.parent=o,null==(p=o.children)||p.push(K),b&&void 0!==(null==(ee=b.position)?void 0:ee.left)&&void 0!==(null==(te=b.position)?void 0:te.top)&&K.setPositionByOrigin(new q.fabric.Point(b.position.left,b.position.top),"center","center"),K},xt=(e,t,n)=>{const r=e.parent;e.on(c,(t=>{var n,r,a;e.stroke=null==(n=e.data)||null==(n=n.otherData)?void 0:n.selectedRelColor,e.strokeWidth=(null!=(r=e.strokeWidth)?r:0)+j,e.dirty=!0,null==(a=e.canvas)||a.renderAll(),((e,t)=>{var n;if(e.e&&null!=(n=t.parent)&&n.children){var r;const e=re(t);if(!ae(null==(r=t.canvas)?void 0:r.getActiveObjects(),e.objects)){var a,o,i;null==(a=t.canvas)||a.discardActiveObject();const n=t.parent;let r;"multiple"===e.type?r=new q.fabric.ActiveSelection(e.objects,{canvas:t.canvas}):(r=new ie(e.objects,{canvas:t.canvas}),r.parent=t.parent,r.on(s,(e=>{It(r.canvas,e,r,n)})),r.on(_,(e=>{var r;null==(r=t.canvas)||r.discardActiveObject(),n.fire(_)}))),r.hasBorders=!1,null==(o=t.canvas)||o.setActiveObject(r),null==(i=t.canvas)||i.requestRenderAll()}}})(t,e)})),e.on(u,(r=>{var a;e.stroke=t,e.strokeWidth=n,e.dirty=!0,null==(a=e.canvas)||a.renderAll()})),e.on(s,(t=>{It(e.canvas,t,e,r)}))},Tt=(e,t)=>{const n=e.parent;e.on("moving",(e=>{Rt(e)})),e.on(s,(t=>{It(e.canvas,t,e,n)})),e.on(c,(t=>{var n,r;e.fill=null==(n=e.data)||null==(n=n.otherData)?void 0:n.selectedRelColor,e.dirty=!0,null==(r=e.canvas)||r.renderAll()})),e.on(u,(n=>{var r;e.fill=t,e.dirty=!0,null==(r=e.canvas)||r.renderAll()}))},Rt=e=>{var t;if(null!=(t=e.transform)&&t.target){const t=e.transform.target.parent;if(t){var n;const e=null==(n=t.children)?void 0:n.filter((e=>e.name===gt.Line))[0];e&&ft(e)}}},Ct=(e,t,n)=>{if(n instanceof q.fabric.ActiveSelection){const r=[];return e.isReadOnly()?e.codingFeaturesEnabled&&r.push(..._e(e,t,n,!1)):r.push({isHeaderMenuItem:!1,id:"addPoint",label:"Add point",onClick:()=>{((e,t)=>{const n=e.canvas;if(t.pointer&&n){const a=e.getObjects().filter((e=>e.name===gt.Line))[0],o=e.getObjects().filter((e=>e.name===gt.Dot))[0];n.discardActiveObject();const i=a.parent;if(i){var r;const e=new oe(t.pointer.x,t.pointer.y,gt.Dot),l=Ot(n,e,void 0,!1,i,!1,o.scaleX,o.scaleY,a.stroke,null==(r=o.data)?void 0:r.otherData.selectedRelColor,!1);((e,t)=>{const n=e.parent;if(n){var r;let a,o;const i=[];null==(r=n.children)||r.forEach((e=>{e.name===gt.Text?a=e:e.name===gt.Rectangle?o=e:e.name!==gt.Dot&&e.name!==gt.Triangle||i.push(e)})),i.push(t),i.sort(((e,t)=>e.getCenterPoint().x-t.getCenterPoint().x)),n.children=i,n.children.push(e),a&&n.children.push(a),o&&n.children.push(o)}})(a,l),n.add(l),ft(a)}}})(n,t)}},{id:"separatorRel",isSepator:!0},..._e(e,t,n,!1)),[{isHeaderMenuItem:!0,id:"relationshipContextMenu",label:"",hidden:!0,alwaysOpen:!0,subMenuItems:r}]}return n.name!==gt.Dot||e.isReadOnly()?[]:[{isHeaderMenuItem:!0,id:"dotContextMenu",label:"",hidden:!0,alwaysOpen:!0,subMenuItems:[{isHeaderMenuItem:!1,id:"removePoint",label:"Remove point",onClick:()=>{(e=>{const t=e.parent;if(t&&e.canvas){var n;const i=null==(n=t.children)?void 0:n.filter((e=>e.name===gt.Dot||e.name===gt.Triangle));if(void 0!==i&&i.length>2){var r,a;const n=null==(r=t.children)?void 0:r.filter((e=>e.name===gt.Line))[0],i=null==(a=t.children)?void 0:a.findIndex((t=>t.getCenterPoint().eq(e.getCenterPoint())));var o;void 0!==i&&i>-1&&(null==(o=t.children)||o.splice(i,1)),e.canvas.remove(e),ft(n)}}})(n)}}]}]},It=(e,t,n,r)=>{n.name!==gt.Line&&n.name!==gt.Rectangle&&e&&r.onComponentMouseUp(e,t,n,Ct(e,t,n))},Dt=(e,t,n,r,a)=>{if(t.base_data&&t.base_data.alias&&t.relationship_type&&(n.auto_layout_enabled&&r[t.base_data.alias]||!n.auto_layout_enabled)){var o;const i=((e,t,n,r)=>{var a,o,i,l,s,_,c,u,d,g,p,b;const f=Ye(Xe(null==(a=e.base_data)?void 0:a.tags),null==r?void 0:r.tags),m={alias:null==(o=e.base_data)?void 0:o.alias};let h=1;const w=null==(i=t.shapes)?void 0:i.filter((e=>e.shape_type===gt.Dot));w&&w.length>0&&(h=null!=(l=null==(s=w[0].size)?void 0:s.scale_x)?l:1);const y=new pt(e,t,m,n,[],{visible:!1,selectable:!1},void 0,void 0,!0),v=yt(t,n),O=vt(t,n,v,y,null!=(_=null==f?void 0:f.border_color)?_:null==r||null==(c=r.diagramsThemeSettings)?void 0:c.line_color_relationship,null==r||null==(u=r.diagramsThemeSettings)?void 0:u.selected_color_relationship),S=O.map((e=>new oe(e.getCenterPoint().x,e.getCenterPoint().y,e.name))),E=St(t,S,y,h,null!=(d=null==f?void 0:f.border_color)?d:null==r||null==(g=r.diagramsThemeSettings)?void 0:g.line_color_relationship,null==r||null==(p=r.diagramsThemeSettings)?void 0:p.selected_color_relationship,n,null==(b=je(null==f?void 0:f.border_style))?void 0:b.value);return Et(e,t,n,E,O,y,r,f),bt(y),y})(t,de(t.base_data.alias,t.from,t.to,{Relationship:t.relationship_type},n),r,a);return a&&a.skipAddToCanvas||!i||null==e||e.add(i,...null!=(o=i.children)?o:[]),i}},kt=(e,t,n,r,a)=>{if(t.base_data&&t.base_data.alias&&t.system_type&&(n.auto_layout_enabled&&r[t.base_data.alias]||!n.auto_layout_enabled)){let o;switch(t.system_type){case"System":case"SystemDb":case"SystemQueue":o=((e,t,n,r,a)=>{var o,i,l,s,_,c;const u={bgColor:null!=(o=null==a||null==(i=a.diagramsThemeSettings)?void 0:i.bg_color_software_system)?o:O.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON,borderColor:null!=(l=null==a||null==(s=a.diagramsThemeSettings)?void 0:s.border_color_software_system)?l:O.COLORS.BORDER_COLOR_SOFTWARE_SYSTEM_PERSON,textColor:null!=(_=null==a||null==(c=a.diagramsThemeSettings)?void 0:c.text_color_software_system)?_:O.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON},d=Object.assign({},u,r);if(e.system_type)switch(e.system_type){case"System":return tt(e,t,n,d,a);case"SystemDb":return nt(e,t,n,d,a);case"SystemQueue":return lt(e,t,n,d,a)}})(t,de(t.base_data.alias,void 0,void 0,{SoftwareSystem:t.system_type},n),r,void 0,a);break;case"System_Ext":case"SystemDb_Ext":case"SystemQueue_Ext":o=((e,t,n,r,a)=>{var o,i,l,s,_,c;const u={bgColor:null!=(o=null==a||null==(i=a.diagramsThemeSettings)?void 0:i.bg_color_software_system_ext)?o:O.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,borderColor:null!=(l=null==a||null==(s=a.diagramsThemeSettings)?void 0:s.border_color_software_system_ext)?l:O.COLORS.BORDER_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,textColor:null!=(_=null==a||null==(c=a.diagramsThemeSettings)?void 0:c.text_color_software_system_ext)?_:O.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON_EXT},d=Object.assign({},u,r);if(e.system_type)switch(e.system_type){case"System_Ext":return tt(e,t,n,d,a);case"SystemDb_Ext":return nt(e,t,n,d,a);case"SystemQueue_Ext":return lt(e,t,n,d,a)}})(t,de(t.base_data.alias,void 0,void 0,{SoftwareSystem:t.system_type},n),r,void 0,a)}return a&&a.skipAddToCanvas||!o||null==e||e.add(o),o}};class Lt{constructor(){this.graphviz=void 0}async initialize(){return this.graphviz=await Ne.Graphviz.load(),this}renderDiagram(e,t,n,r){if(e&&n){var a,o,i,l,s,_,c,u;if(e.diagramListener=t,e.autoLayoutEnabled=null==(a=n.diagram_spec)?void 0:a.auto_layout_enabled,e.autoLayoutOrientation=null==(o=n.diagram_spec)?void 0:o.auto_layout_orientation,e.backgroundColor=null!=(i=null==r?void 0:r.bg_color_diagram)?i:d,null!=(l=n.diagram_spec)&&l.auto_layout_enabled)if(this.graphviz){const e=function(e,t){var n,r;const a={},o=[];if(null!=(n=t.diagram_spec)&&n.auto_layout_enabled&&t.diagram_spec.auto_layout_orientation&&null!=(r=t.diagram_plantuml)&&r.elements){console.time("autoLayoutGeneration");const n=t.diagram_plantuml.elements,r=t.diagram_spec.auto_layout_orientation,s=t.diagram_spec.auto_layout_ranksep,_=t.diagram_spec.auto_layout_subgraph_inner_margin,c=t.diagram_spec.auto_layout_subgraph_outer_margin,u=t.diagram_spec.auto_layout_only_straight_arrows,d=(e=>{for(const t of e)if(be(t)||he(t))return!0;return!1})(n),g=function(e){let t=Re,n=Ce;return e&&(t-=.1,n-=.1),{x:Number.parseFloat(t.toFixed(2)),y:Number.parseFloat(n.toFixed(2))}}(d),p=function(e,t,n,r,a,o,i){const l=new Set;return`\n digraph G {\n pad = "${i.x},${i.y}"\n dpi = ${Te.toFixed(1)}\n penwidth="1"\n rankdir = ${"LeftToRight"===t?"LR":"TB"}\n nodesep=0\n ranksep=${n}\n compound=true\n bgcolor="red"\n ${o?"splines=ortho":""}\n node [shape="rect", fixedsize=true, penwidth="1"]\n ${Le(e,l,r,a)}\n }\n `}(n,r,s,_,c,u,g);try{var i,l;let t=e.dot(p,"json");const n=JSON.parse(t),r=function(e){const t=e.split(",");return Number.parseFloat(t[3])}(n.bb);null==(i=n.objects)||i.forEach((e=>{if(!function(e){return e.width&&0===Number.parseInt(e.width)&&e.height&&0===Number.parseInt(e.height)&&e.peripheries&&0===Number.parseInt(e.peripheries)&&""===e.label}(e)&&!function(e){return e.name.endsWith(Ee)}(e)&&e._draw_){const t=e._draw_.filter((e=>"p"===e.op||"P"===e.op))[0],n=xe(g,r,t.points[0]),o=xe(g,r,t.points[1]),i=xe(g,r,t.points[2]),l=o[0],s=o[1];let _;4===t.points.length&&(_={x:i[0]-o[0],y:n[1]-o[1]}),a[e.name]={position:{x:l,y:s},size:_}}})),null==(l=n.edges)||l.forEach((e=>{const t={path:[]};if(e._draw_?e._draw_.filter((e=>"b"===e.op))[0].points.forEach(((e,n)=>{var a;const o=xe(g,r,e),i=o[0],l=o[1];0===n?t.start={x:i,y:l}:null==(a=t.path)||a.push({x:i,y:l})})):o.push(He),e._hdraw_){const n=e._hdraw_.filter((e=>"P"===e.op))[0].points,a=xe(g,r,n[1]);t.end={x:a[0],y:a[1]}}if(e._ldraw_){var n;const a=null==(n=e._ldraw_)?void 0:n.filter((e=>"T"===e.op))[0].pt;if(a){const e=xe(g,r,a);t.label_position={x:e[0],y:e[1]}}}if(t.start&&t.end){const n=t.path&&t.path.length>2?t.path[1]:t.end,a=t.path&&t.path.length>2?t.path[t.path.length-2]:t.start;"false"===e.keadex_fromissubgraph&&n.x&&n.y&&(t.start.x<n.x?t.start.x-=Ie:t.start.x>n.x&&(t.start.x+=Ie),t.start.y<n.y?t.start.y-=Ie:t.start.y>n.y&&(t.start.y+=Ie)),"false"===e.keadex_toissubgraph&&a.x&&a.y&&(t.end.x<a.x?t.end.x-=Ie:t.end.x>a.x&&(t.end.x+=Ie),t.end.y<a.y?t.end.y-=Ie:t.end.y>a.y&&(t.end.y+=Ie)),t.svg_path=function(e,t,n,r,a){const o=e.split(" ").slice(1).map((e=>e.split(",").map(Number)));let i=`M ${n.x} ${n.y}`;for(let e=o.length-3;e>=0;e-=3){const[n,l]=xe(r,a,o[e+1]),[s,_]=xe(r,a,o[e]),[c,u]=xe(r,a,o[e-1]);let d=c,g=u;1===e&&(d=t.x,g=t.y),i+=` C ${n} ${l}, ${s} ${_}, ${d} ${g}`}return i}(e.pos,t.start,t.end,g,r)}a[e.name]=t}))}catch(e){console.error(e),o.push(He)}}return console.timeEnd("autoLayoutGeneration"),{positions:a,errors:o}}(this.graphviz,n);n.auto_layout=e.positions,n.auto_layout_errors=e.errors,e.errors.length>0&&(e.errors.indexOf(He)>=0?(console.warn(ze),Ae.toast.warn(ze)):(console.error(e.errors.join(", ")),Ae.toast.error(e.errors.join(", "))))}else console.error(Be),Ae.toast.error(Be);null!=(s=n.diagram_spec)&&s.grid_enabled?e.enableGrid():e.disableGrid();const g=Nt(e,null==(_=n.diagram_plantuml)?void 0:_.elements,n.diagram_spec,null!=(c=n.auto_layout)?c:{},{diagramsThemeSettings:r,tags:null==(u=n.diagram_plantuml)?void 0:u.tags});return At(g),g}}}const Nt=(e,t,n,r,a)=>{const o=[];if(n){if(!a||!a.skipLegendRendering){const t=Pe(de(Fe,void 0,void 0,void 0,n),a);t&&(o.push(t),null==e||e.add(t))}if(t)for(const i of t)if(be(i)){const t=et(e,be(i),n,r,a);t&&o.push(t)}else if(fe(i)){const t=st(e,fe(i),n,r,a);t&&o.push(t)}else if(me(i)){const t=_t(e,me(i),n,r,a);t&&o.push(t)}else if(he(i)){const t=ct(e,he(i),n,r,a);t&&o.push(t)}else if(we(i)){const t=dt(e,we(i),n,r,a);t&&o.push(t)}else if(ye(i)){const t=Dt(e,ye(i),n,r,a);t&&o.push(t)}else if(ve(i)){const t=kt(e,ve(i),n,r,a);t&&o.push(t)}}return o},At=(e,t)=>{e.forEach((e=>{let n=function(e){let t;var n,r;return t=e.isVirtualGroupParent()?null==(n=e.data)||null==(n=n.rawDiagramElementSpec)||null==(n=n.shapes)||null==(n=n.reduce(((e,t)=>{var n,r;return void 0===(null==(n=e.position)?void 0:n.z_index)?t:(void 0===(null==(r=t.position)?void 0:r.z_index)||(t.position.z_index,e.position.z_index),e)})).position)?void 0:n.z_index:null==(r=e.data)||null==(r=r.rawDiagramElementSpec)||null==(r=r.position)?void 0:r.z_index,t}(e);var r;n&&(t&&n<=t&&(n=t+1,t++),e.moveTo(n)),e.isVirtualGroupParent()&&At(e.children,null!=(r=n)?r:K(e.canvas,e.children[0]))}))};var jt=n(15),Ft=n.n(jt),Mt=n(61);const Pt=require("react-resize-detector");var zt=n(732);const Bt="text-5xl text-dark-primary hover:text-third",Ht="text-2xl text-dark-primary hover:text-third",Wt=Ft().memo((e=>{const{canvas:t,readOnly:n,diagramInfoPanelVisible:r,setDiagramInfoPanelVisible:a,diagramCodePanelVisible:o,setDiagramCodePanelVisible:i}=e;function l(){return n}return(0,zt.jsxs)("div",{className:"absolute bottom-0 left-0 z-[1] scale-[85%] opacity-20 transition hover:scale-[100%] hover:opacity-100 flex flex-row mx-2",children:[(0,zt.jsx)(U.K0,{className:`${Ht} ${l()?"absolute":"hidden"}`,icon:We.faCircleInfo,onClick:function(){l()&&(i(!1),a(!r))}}),(0,zt.jsx)(U.K0,{className:`${Ht} ${l()?"absolute bottom-1":"hidden"}`,icon:We.faCode,onClick:function(){l()&&(a(!1),i(!o))}}),(0,zt.jsx)("div",{className:"flex flex-col",children:(0,zt.jsx)(U.K0,{className:`${Bt} !my-auto`,icon:We.faCaretLeft,onClick:()=>null==t?void 0:t.panLeft()})}),(0,zt.jsxs)("div",{className:"flex flex-col",children:[(0,zt.jsx)(U.K0,{className:Bt,icon:We.faCaretUp,onClick:()=>null==t?void 0:t.panDown()}),(0,zt.jsxs)("div",{children:[(0,zt.jsx)(U.K0,{className:`${Ht} ml-1`,icon:We.faMagnifyingGlassPlus,onClick:()=>null==t?void 0:t.zoomIn()}),(0,zt.jsx)(U.K0,{className:`${Ht} mx-2 !text-xl`,icon:We.faRotateLeft,onClick:()=>{null==t||t.resetZoom(),null==t||t.resetPan()}}),(0,zt.jsx)(U.K0,{className:`${Ht} mr-1`,icon:We.faMagnifyingGlassMinus,onClick:()=>null==t?void 0:t.zoomOut()})]}),(0,zt.jsx)(U.K0,{className:Bt,icon:We.faCaretDown,onClick:()=>null==t?void 0:t.panUp()})]}),(0,zt.jsx)("div",{className:"flex flex-col",children:(0,zt.jsx)(U.K0,{className:`${Bt} !my-auto`,icon:We.faCaretRight,onClick:()=>null==t?void 0:t.panRight()})})]})})),Xt=require("@tauri-apps/api/core");JSON.parse(!0),JSON.parse(!0);const Yt=require("fontfaceobserver");var Zt=n.n(Yt),$t=n(53);const Gt=e=>{const{t}=(0,Mt.useTranslation)(),[n,r]=(0,jt.useState)(e.enabled),[o,i]=(0,jt.useState)(e.orientation),[l,s]=(0,jt.useState)(e.generateOnlyStraightArrows),[_,c]=(0,jt.useState)(e.ranksep),[u,d]=(0,jt.useState)(e.subgraphInnerMargin),[g,p]=(0,jt.useState)(e.subgraphOuterMargin);return(0,zt.jsxs)("div",{children:[(0,zt.jsxs)("div",{className:"modal__body",children:[(0,zt.jsxs)("div",{className:"flex flex-col",children:[(0,zt.jsxs)("div",{className:"flex flex-row",children:[(0,zt.jsxs)("span",{children:[t("common.status"),"*:"]}),(0,zt.jsx)(U.sx,{id:"autolayout-status",className:"ml-5",value:n,options:[{label:t("common.enabled"),value:!0},{label:t("common.disabled"),value:!1}],onChange:e=>{r(e)}})]}),(0,zt.jsxs)("span",{className:"text-sm text-orange-500 mt-2 "+(!e.enabled&&n?"block":"hidden"),children:[(0,zt.jsx)($t.FontAwesomeIcon,{icon:We.faWarning,className:"mr-1 text-yellow-500"}),t("diagram_editor.warning_enable_autolayout")]})]}),(0,zt.jsxs)("div",{className:"flex flex-row mt-5",children:[(0,zt.jsxs)("span",{children:[`${t("diagrams_settings.gen_only_straight_arrows")}*`,":"]}),(0,zt.jsx)(U.sx,{id:"autolayout-straight-arrows-status",className:"ml-5",value:l,options:[{label:t("common.yes"),value:!0},{label:t("common.no"),value:!1}],onChange:e=>{s(e)}})]}),(0,zt.jsx)(U.l6,{id:"autolayout-orientation-selector",label:`${t("common.orientation")}*`,className:"mt-8",value:o,options:a.map((e=>({label:e,value:e}))),onChange:e=>i(e.target.value)}),(0,zt.jsx)(U.pd,{id:"autolayout-ranksep",type:"number",label:"ranksep*",min:0,classNameRoot:"mt-6",info:`${t("diagrams_settings.ranksep_description")}`,value:_,onChange:e=>c(Number.parseFloat(e.target.value))}),(0,zt.jsx)(U.pd,{id:"autolayout-subgraph-inner-margin",type:"number",label:`${t("diagrams_settings.subgraph_inner_margin")}`,min:0,classNameRoot:"mt-6",value:u,onChange:e=>d(Number.parseFloat(e.target.value))}),(0,zt.jsx)(U.pd,{id:"autolayout-subgraph-outer-margin",type:"number",label:`${t("diagrams_settings.subgraph_outer_margin")}`,min:0,classNameRoot:"mt-6",value:g,onChange:e=>p(Number.parseFloat(e.target.value))})]}),(0,zt.jsx)("div",{className:"modal__footer",children:(0,U.CL)([{key:"button-cancel",children:(0,zt.jsx)("span",{children:t("common.cancel")}),"data-te-modal-dismiss":!0},{key:"button-save",children:(0,zt.jsx)("span",{children:t("common.save")}),onClick:function(){e.onAutoLayoutConfigured(n,o,l,_,u,g),e.hideModal()}}])})]})},Ut=Ft().memo((e=>{var t,n,r;const{tagsDirection:a,scrollable:o,diagram:i,handleDiagramHeaderClick:l}=e;return(null==i?void 0:i.diagram_type)&&(0,zt.jsxs)("div",{className:"w-full flex flex-col items-center py-1 pr-3 "+(l?"cursor-pointer":""),onClick:function(){l&&l()},children:[(0,zt.jsxs)("div",{className:"flex w-full my-auto "+("bottom"===a?"flex-col":""),children:[(0,zt.jsxs)("div",{className:"text-lg text-accent-primary grow truncate",children:[(s=i.diagram_type,(0,G.capitalCase)((0,G.noCase)(s)))," Diagram -"," ",i.diagram_name]}),(null==(t=i.diagram_spec)?void 0:t.tags)&&(0,zt.jsx)("div",{className:"bottom"===a?"mt-2 mb-5":"",children:(0,zt.jsx)(U.YD,{tags:i.diagram_spec.tags,className:"right"===a?"float-right top-1/2 -translate-y-1/2":""})})]}),(null==(n=i.diagram_spec)?void 0:n.description)&&(0,zt.jsx)("div",{className:"w-full text-sm whitespace-break-spaces "+(o?"":"line-clamp-3"),children:null==(r=i.diagram_spec)?void 0:r.description})]});var s})),qt=Ft().memo((e=>{const{setDiagramInfoPanelVisible:t,diagram:n,hidden:r}=e;return(0,zt.jsxs)("div",{className:r?"hidden":"absolute z-[1] bg-dark-primary bg-opacity-90 w-full p-2 max-h-96 overflow-auto",children:[(0,zt.jsx)(U.K0,{icon:We.faXmark,className:"absolute right-5 top-3",onClick:()=>t(!1)}),n&&(0,zt.jsx)(Ut,{diagram:n,tagsDirection:"bottom",scrollable:!0})]})}));var Vt=function(e){return e[e.PlantUML=0]="PlantUML",e[e.JSON=1]="JSON",e}(Vt||{});const Jt=Ft().memo((e=>{const{setDiagramCodePanelVisible:t,diagram:n,hidden:r}=e,[a,o]=(0,jt.useState)(Vt.PlantUML),[i,l]=(0,jt.useState)(null==n?void 0:n.raw_plantuml);return(0,jt.useEffect)((()=>{n&&l(a===Vt.PlantUML?n.raw_plantuml:JSON.stringify(n.diagram_spec,null,2))}),[n,a]),(0,zt.jsxs)("div",{className:r?"hidden":"absolute z-[1] bg-dark-primary bg-opacity-90 w-full h-full p-2 overflow-auto",children:[(0,zt.jsx)(U.K0,{icon:We.faXmark,className:"absolute right-5 top-3",onClick:()=>t(!1)}),n&&(0,zt.jsxs)("div",{className:"flex flex-col",children:[(0,zt.jsxs)("div",{children:[(0,zt.jsx)(U.$n,{className:"mr-3 w-32 normal-case "+(a===Vt.PlantUML?"!bg-green-700":""),onClick:()=>o(Vt.PlantUML),children:"PlantUML"}),(0,zt.jsx)(U.$n,{className:"w-32 normal-case "+(a===Vt.JSON?"!bg-green-700":""),onClick:()=>o(Vt.JSON),children:"JSON"})]}),(0,zt.jsxs)("div",{className:"mt-5 p-2 bg-primary rounded-md overflow-auto whitespace-pre-wrap text-sm font-mono",children:[(0,zt.jsx)(U.K0,{icon:We.faCopy,className:"absolute right-5 text-xl",onClick:()=>{i&&navigator.clipboard.writeText(i)}}),(0,zt.jsx)("div",{children:i})]})]})]})})),Qt=e=>{const{t}=(0,Mt.useTranslation)(),[n,r]=(0,jt.useState)(e.settings);return(0,zt.jsxs)("div",{children:[(0,zt.jsx)("div",{className:"modal__body",children:(0,zt.jsx)("div",{className:"flex flex-col",children:(0,zt.jsxs)("div",{className:"flex flex-row",children:[(0,zt.jsxs)("span",{children:[t("diagrams_settings.grid_enabled"),"*:"]}),(0,zt.jsx)(U.sx,{id:"autolayout-status",className:"ml-5",value:n.gridEnabled,options:[{label:t("common.enabled"),value:!0},{label:t("common.disabled"),value:!1}],onChange:e=>{r(Object.assign({},n,{gridEnabled:e}))}})]})})}),(0,zt.jsx)("div",{className:"modal__footer",children:(0,U.CL)([{key:"button-cancel",children:(0,zt.jsx)("span",{children:t("common.cancel")}),"data-te-modal-dismiss":!0},{key:"button-save",children:(0,zt.jsx)("span",{children:t("common.save")}),onClick:function(){e.onSettingsChanged(n),e.hideModal()}}])})]})};var Kt=n(735),en=n(691);const tn=["auto_layout"],nn=["auto_layout"],rn=(0,jt.forwardRef)(((e,t)=>{const{readOnly:n,diagram:a,diagramListener:o,diagramDesignViewToolbarCommands:i,saveDiagram:s,diagramsThemeSettings:_}=e,{t:c}=(0,Mt.useTranslation)(),u=(0,jt.useRef)(),d=(0,jt.useRef)(null),g=(0,jt.useRef)(null),{ref:p}=(0,Pt.useResizeDetector)(),b=(0,jt.useRef)(),f=(0,jt.useRef)(!1),m=(0,jt.useRef)(!1),h=(0,jt.useRef)(!1),[w,y]=(0,jt.useState)([]),[O,S]=(0,jt.useState)([]),[E,x]=(0,jt.useState)(!1),[T,R]=(0,jt.useState)(!1),[C,I]=(0,jt.useState)(),{modal:D,showModal:k,hideModal:L}=(0,U.hS)();let N=b.current,A=a;function j(){f.current=!0,n||function(){if(!h.current){const e=H();e&&y((t=>[...t,e]))}}()}function F(t){const n={fireRightClick:!0,fireMiddleClick:!0,stopContextMenu:!0,backgroundColor:"white",readOnly:e.readOnly,enableSnapToGrid:!0},r=new U.vL(d.current,n);r.on("object:added",j),r.on("object:removed",j),r.on(l,j),r.on("mouse:down",(()=>m.current=!0)),r.on("mouse:out",(()=>m.current=!1)),r.codingFeaturesEnabled="desktop"===e.target,f.current=!1,t&&(r.setZoom(t.zoom),r.relativePan(new q.fabric.Point(t.pan.panX,t.pan.panY))),u.current=r}function M(){u.current&&(u.current.dispose(),u.current=void 0)}function P(e){M(),F(e)}function z(){var e,t;return{zoom:null!=(e=null==(t=u.current)?void 0:t.getZoom())?e:1,pan:ne(u.current)}}async function B(){var e;if(null!=(e=b.current)&&e.diagram_name&&b.current.diagram_type&&u.current){const e="png";console.debug(`Exporting to ${e}`);const t=u.current.viewportTransform;u.current.viewportTransform=q.fabric.iMatrix.slice(0);let{width:n,height:r,left:a,top:o}=Q(u.current.getObjects());n&&r&&a&&o&&(n+=50,r+=50,a-=25,o-=25),await async function(e,t,n,r){return(0,Xt.invoke)("export_diagram_to_file",{diagramDataUrl:n,format:r,diagramName:e,diagramType:t})}(b.current.diagram_name,b.current.diagram_type,u.current.toDataURL({format:e,enableRetinaScaling:!0,width:n,height:r,left:a,top:o}),e).then((e=>Ae.toast.success(c("common.info.diagram_exported",{pathExportedDiagram:e})))).catch((e=>Ae.toast.success(e.msg))),u.current.viewportTransform=t}}function H(){if(b.current&&b.current.diagram_plantuml&&b.current.diagram_spec&&b.current.diagram_name&&b.current.diagram_type){var e,t;const n=void 0!==(null==(e=u.current)?void 0:e.autoLayoutEnabled)?u.current.autoLayoutEnabled:b.current.diagram_spec.auto_layout_enabled;let r=[];return n||(r=(e=>{const t=Array();return e&&e.getObjects().forEach((e=>{if(e instanceof se){const n=e.getUpdatedSpecs();n&&t.push(n)}})),t})(u.current)),Object.assign({},b.current.diagram_spec,{auto_layout_enabled:n,auto_layout_orientation:void 0!==(null==(t=u.current)?void 0:t.autoLayoutOrientation)?u.current.autoLayoutOrientation:b.current.diagram_spec.auto_layout_orientation,elements_specs:r})}}function W(){return f.current}function X(){var e;return!(null==(e=b.current)||!e.diagram_spec)&&b.current.diagram_spec.auto_layout_enabled}function Y(){var e;return null!=(e=b.current)&&e.diagram_spec?b.current.diagram_spec.auto_layout_orientation:"TopToBottom"}function Z(){var e;return!(null==(e=b.current)||!e.diagram_spec)&&b.current.diagram_spec.auto_layout_only_straight_arrows}function G(){var e;return null!=(e=b.current)&&e.diagram_spec?b.current.diagram_spec.auto_layout_ranksep:0}function V(){var e;return null!=(e=b.current)&&e.diagram_spec?b.current.diagram_spec.auto_layout_subgraph_inner_margin:0}function J(){var e;return null!=(e=b.current)&&e.diagram_spec?b.current.diagram_spec.auto_layout_subgraph_outer_margin:6.5}function K(e,t,r,a,o,i){u.current&&b.current&&!n&&k({id:"showAutoLayoutConfigurationModal",title:`${c("diagram_editor.configure_auto_layout")}`,body:(0,zt.jsx)(Gt,{enabled:e,orientation:t,generateOnlyStraightArrows:r,ranksep:a,subgraphInnerMargin:o,subgraphOuterMargin:i,hideModal:L,onAutoLayoutConfigured:(e,t,r,a,o,i)=>{u.current&&b.current&&!n&&(u.current.autoLayoutEnabled=e,u.current.autoLayoutOrientation=t,b.current.diagram_spec&&(b.current.diagram_spec.auto_layout_only_straight_arrows=r,b.current.diagram_spec.auto_layout_ranksep=a,b.current.diagram_spec.auto_layout_subgraph_inner_margin=o,b.current.diagram_spec.auto_layout_subgraph_outer_margin=i),f.current=!0,s&&s())}}),buttons:!1})}function ee(){var e;if(null!=(e=b.current)&&e.diagram_spec)return{gridEnabled:b.current.diagram_spec.grid_enabled}}function te(e){e&&u.current&&b.current&&!n&&k({id:"showDiagramDesignViewSettingsModal",title:`${c("common.settings")}`,body:(0,zt.jsx)(Qt,{settings:e,hideModal:L,onSettingsChanged:e=>{var t;u.current&&b.current&&!n&&(e.gridEnabled?u.current.enableGrid():u.current.disableGrid(),b.current.diagram_spec&&(b.current.diagram_spec.grid_enabled=null!=(t=e.gridEnabled)&&t),f.current=!0,s&&s())}}),buttons:!1})}function re(){var t,n;null!=(t=b.current)&&t.diagram_spec&&u.current&&!e.readOnly&&(null!=(n=b.current)&&n.diagram_spec.auto_layout_enabled?u.current.setReadOnly():u.current.setReadAndWrite())}function ae(e){var t;u.current&&(P(z()),re(),C?C.renderDiagram(u.current,o,Object.assign({},b.current,{diagram_spec:e}),_):console.error("DiagramRenderer not initialized"),null==(t=u.current)||t.renderAll(),f.current=!0,console.debug("Load history completed"))}function oe(){if(h.current=!0,le()){const e=w[w.length-1],t=w[w.length-2];b.current&&e&&t&&(console.debug("Undo design view"),y((e=>e.filter(((t,n)=>n!==e.length-1)))),S((t=>[...t,e])),ae(t))}h.current=!1}function ie(){if(console.debug("Redo design view"),h.current=!0,_e()){const e=O[O.length-1];e&&(S((e=>e.filter(((t,n)=>n!==e.length-1)))),y((t=>[...t,e])),ae(e))}h.current=!1}function le(){return!n&&w.length>1}function _e(){return!n&&O.length>0}return N&&(N=(0,r.A)(N,tn)),A&&(A=(0,r.A)(A,nn)),(0,$.$r)(N,A)||(b.current=a),(0,jt.useImperativeHandle)(t,(()=>({resetCanvas:P,getCanvasState:z,exportDiagram:B,getUpdatedDiagramSpec:H,isDiagramChanged:W,undo:oe,redo:ie,canUndo:le,canRedo:_e,isAutoLayoutEnabled:X,autoLayoutOrientation:Y,updateAutoLayoutOptions:K,isGenerateOnlyStraightArrowsEnabled:Z,ranksep:G,updateDiagramDesignViewSettings:te,diagramDesignViewSettings:ee,subgraphInnerMargin:V,subgraphOuterMargin:J}))),(0,jt.useLayoutEffect)((()=>{var e,t,n,r,a,o,i;console.debug("Diagram Design View changed layout"),d.current&&null!=(e=g.current)&&e.clientWidth&&null!=(t=g.current)&&t.clientHeight&&(console.debug("Canvas resize"),d.current.parentElement&&(d.current.parentElement.style.display="none"),null==(n=u.current)||n.setWidth(null==(r=g.current)?void 0:r.getBoundingClientRect().width),null==(a=u.current)||a.setHeight(null==(o=g.current)?void 0:o.getBoundingClientRect().height),d.current.parentElement&&(d.current.parentElement.style.display="flex"),null==(i=u.current)||i.renderAll())})),(0,jt.useEffect)((()=>(new(Zt())(v.FONT.FAMILY).load(null,36e4).then((function(){u.current&&(function(e){e.getObjects().forEach((e=>e.set("dirty",!0)))}(u.current),u.current.renderAll())})),d.current&&!u.current&&F(),()=>{M()})),[]),(0,jt.useEffect)((()=>{function e(e){n||"Z"!==e.key.toUpperCase()&&"Y"!==e.key.toUpperCase()||!e.ctrlKey&&!e.metaKey||!m.current||(e.preventDefault(),"Z"===e.key.toUpperCase()?oe():"Y"===e.key.toUpperCase()&&ie())}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[n,w,O]),(0,jt.useEffect)((()=>{var e,t;u.current&&b.current&&C&&(h.current=!0,console.debug("Rendering the diagram"),re(),C.renderDiagram(u.current,o,b.current,_),null==(e=u.current)||e.renderAll(),f.current=!1,h.current=!1,n||(h.current=!1,null!=(t=b.current)&&t.diagram_spec&&y([b.current.diagram_spec]),S([])))}),[b.current,C]),(0,jt.useEffect)((()=>{var e;!n&&i&&(console.debug("Update design toolbar"),null==(e=i.current)||e.forceUpdate())}),[n,w,O,i]),(0,jt.useEffect)((()=>{!async function(){const e=await(new Lt).initialize();I(e)}()}),[]),(0,Kt.useHotkeys)([en.Key.Escape],(e=>{var t;u.current&&(e.preventDefault(),null==(t=u.current)||t.discardActiveObject())})),(0,zt.jsxs)("div",{className:"relative h-full w-full",ref:p,children:[D,(0,zt.jsx)(Wt,{canvas:u.current,readOnly:n,diagramInfoPanelVisible:E,setDiagramInfoPanelVisible:x,diagramCodePanelVisible:T,setDiagramCodePanelVisible:R}),(0,zt.jsx)(qt,{diagram:a,hidden:!E,setDiagramInfoPanelVisible:x}),(0,zt.jsx)(Jt,{diagram:a,hidden:!T,setDiagramCodePanelVisible:R}),(0,zt.jsx)("div",{className:"h-full w-full flex-row flex-wrap",ref:g,children:(0,zt.jsx)("canvas",{ref:d})})]})}))}},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={id:e,loaded:!1,exports:{}};return i[e](n,n.exports,s),n.loaded=!0,n.exports}e="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",t="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",n="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",r=e=>{e&&e.d<1&&(e.d=1,e.forEach((e=>e.r--)),e.forEach((e=>e.r--?e.r++:e())))},s.a=(a,o,i)=>{var l;i&&((l=[]).d=-1);var s,_,c,u=new Set,d=a.exports,g=new Promise(((e,t)=>{c=t,_=e}));g[t]=d,g[e]=e=>(l&&e(l),u.forEach(e),g.catch((e=>{}))),a.exports=g,o((a=>{var o;s=(a=>a.map((a=>{if(null!==a&&"object"==typeof a){if(a[e])return a;if(a.then){var o=[];o.d=0,a.then((e=>{i[t]=e,r(o)}),(e=>{i[n]=e,r(o)}));var i={};return i[e]=e=>e(o),i}}var l={};return l[e]=e=>{},l[t]=a,l})))(a);var i=()=>s.map((e=>{if(e[n])throw e[n];return e[t]})),_=new Promise((t=>{(o=()=>t(i)).r=0;var n=e=>e!==l&&!u.has(e)&&(u.add(e),e&&!e.d&&(o.r++,e.push(o)));s.map((t=>t[e](n)))}));return o.r?_:i()}),(e=>(e?c(g[n]=e):_(d),r(l)))),l&&l.d<0&&(l.d=0)},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},o=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);s.r(n);var r={};a=a||[null,o({}),o([]),o(o)];for(var i=2&t&&e;"object"==typeof i&&!~a.indexOf(i);i=o(i))Object.getOwnPropertyNames(i).forEach((t=>r[t]=()=>e[t]));return r.default=()=>e,s.d(n,r),n},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.v=(e,t,n,r)=>{var a=fetch(s.p+""+n+".module.wasm"),o=()=>a.then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,r))).then((t=>Object.assign(e,t.instance.exports)));return a.then((t=>"function"==typeof WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(t,r).then((t=>Object.assign(e,t.instance.exports)),(e=>{if("application/wasm"!==t.headers.get("Content-Type"))return console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",e),o();throw e})):o()))},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})();var _={};s.r(_),s.d(_,{default:()=>g});var c=s(15),u=s(732);const d=()=>null,g=e=>{const[t,n]=(0,c.useState)((()=>d));return(0,c.useEffect)((()=>{Promise.resolve().then(s.bind(s,334)).then((e=>n((()=>e.default))))}),[]),(0,u.jsx)(t,Object.assign({},e))};module.exports=_})();
1
+ (()=>{"use strict";var e,t,n,_,r,o,i,a={15(e){e.exports=require("react")},53(e){e.exports=require("@fortawesome/react-fontawesome")},61(e){e.exports=require("react-i18next")},177(e){e.exports=require("@fortawesome/free-solid-svg-icons")},196(e,t,n){var _=n(457);e.exports=n.v(t,e.id,"328c7049cadfe70fef7d",{"./mina_react_bg.js":{__wbg_new_dca287b076112a51:_._hV,__wbg_new_3eb36ae241fe6f44:_.oF3,__wbg___wbindgen_string_get_72fb696202c56729:_.cKO,__wbg___wbindgen_number_get_8ff4255516ccad3e:_.bDv,__wbg___wbindgen_in_47fa6863be6f2f25:_.cpy,__wbg___wbindgen_throw_be289d5034ed271b:_.rm3,__wbg___wbindgen_rethrow_05525c567f154472:_.wEy,__wbg___wbindgen_jsval_eq_11888390b0186270:_.Z_9,__wbg_Number_04624de7d0e8332d:_.neO,__wbg_Error_8c4e43fe74559d73:_.fa$,__wbg___wbindgen_is_bigint_31b12575b56f32fc:_.tZJ,__wbg___wbindgen_is_object_5ae8e5880f2c1fbd:_.rXI,__wbg___wbindgen_is_string_cd444516edc5b180:_.XP1,__wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25:_.vGI,__wbg___wbindgen_is_function_0095a73b8b156f76:_.Bth,__wbg___wbindgen_is_undefined_9e4d92534c42d778:_.$hZ,__wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811:_.wIB,__wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2:_.a9o,__wbg___wbindgen_debug_string_0bc8482c6e3508ae:_.k0X,__wbg__wbg_cb_unref_d9b87ff7982e3b21:_.W7D,__wbg_stringify_8d1cc6ff383e8bae:_._2w,__wbg_new_361308b2356cecd0:_.LZ_,__wbg_new_no_args_1c7c842f08d00ebb:_.WMd,__wbg_new_dd2b680c8bf6ae29:_.V0o,__wbg_next_418f80d8f5303233:_.A0G,__wbg_byteLength_3417f266f4bf562a:_.a_p,__wbg_byteOffset_f88547ca47c86358:_.c0$,__wbg_length_32ed9a279acd054c:_.XmT,__wbg_prototypesetcall_bdcdcc5842e4d77d:_.esX,__wbg_new_from_slice_a3d2629dc1826784:_.PnO,__wbg_new_with_byte_offset_and_length_aa261d9c9da49eb1:_.YzY,__wbg_buffer_26d0910f3a5bc899:_.Nwu,__wbg_set_cc56eefd2dd91957:_.Zzl,__wbg_done_57b39ecd9addfe81:_.b6G,__wbg_value_0546255b415e96c1:_.NZe,__wbg_next_0a5e0f8af98146aa:_.MzV,__wbg_instanceof_Error_8573fe0b0b480f46:_.CeS,__wbg_instanceof_Uint8Array_9b9075935c74707c:_.l7b,__wbg_instanceof_ArrayBuffer_c367199e2fa2aa04:_.rgd,__wbg_set_1eb0999cf5d27fc8:_.c22,__wbg_get_9b94d73e6221f75c:_.Kk3,__wbg_set_f43e577aea94465b:_.ZEw,__wbg_length_35a7bace40f36eac:_.iNx,__wbg_push_8ffdcb2063340ba5:_.YyO,__wbg_isArray_d314bb98fcf08331:_.ng2,__wbg_new_72b49615380db768:_.Xci,__wbg_message_9ddc4b9a62a7c379:_.CJX,__wbg_isSafeInteger_bfbc7332a9768d2a:_.W_J,__wbg_entries_58c7934c745daac7:_.XZV,__wbg_iterator_6ff6560ca1568e55:_.T70,__wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f:_.Hgc,__wbg_call_389efe28435a9388:_.qe3,__wbg_static_accessor_SELF_a621d3dfbb60d0ce:_.n8y,__wbg_static_accessor_GLOBAL_12837167ad935116:_.St8,__wbg_static_accessor_WINDOW_f8727f0cf888e0bd:_.MLu,__wbg_new_b5d9e2fb389fef91:_.nc3,__wbg_then_b9e7b3b5f1a9e1b5:_.xRo,__wbg_then_0d9fe2c7b1857d32:_.IIh,__wbg_resolve_002c4b7d9d8f6b64:_.kwF,__wbg_call_4708e0c13bdc8e95:_.GSt,__wbg_next_3482f54c49e8af19:_.KMT,__wbg_get_b3ed3ad4be2bc8ac:_.HBd,__wbg_instanceof_Window_ed49b2db8df90359:_.Q8O,__wbg_localStorage_a22d31b9eacc4594:_.hvT,__wbg_fetch_afb6a4b6cacf876d:_.vZh,__wbg_new_64284bd487f9d239:_.rEs,__wbg_append_a992ccc37aa62dc4:_.Q01,__wbg_postMessage_2041f4e90af61318:_.B6M,__wbg_instanceof_File_21240124aa87092d:_.U0y,__wbg_lastModified_a5cfce993c651681:_.OVC,__wbg_get_7402eeed7493cb5a:_.XYU,__wbg_set_9d4519d2fdec4515:_.Ytm,__wbg_set_method_c3e20375f5ae7fac:_.p3I,__wbg_set_signal_f2d3f8599248896d:_.T9E,__wbg_set_credentials_c4a58d2e05ef24fb:_.Qdk,__wbg_set_headers_cfc5f4b2c1f20549:_.Jyf,__wbg_set_body_9a7e00afe3cfe244:_.TB7,__wbg_set_mode_b13642c312648202:_.gqh,__wbg_set_cache_315a3ed773a41543:_.vNk,__wbg_byobRequest_80e594e6da4e1af7:_.tNh,__wbg_close_06dfa0a815b9d71f:_.kfc,__wbg_append_f397817515023c29:_.uN9,__wbg_append_5050a4a2867113b7:_.SrV,__wbg_append_68324d5b44b13a25:_.$Dy,__wbg_new_738c2e238e869a5e:_.Z5i,__wbg_abort_d549b92d3c665de1:_.FMZ,__wbg_new_b949e7f56150a5d1:_.l8_,__wbg_abort_2f0584e03e8e3950:_.tRs,__wbg_signal_d1285ecab4ebc5ad:_.U4M,__wbg_respond_bf6ab10399ca8722:_.aax,__wbg_view_6c32e7184b8606ad:_.wej,__wbg_set_keep_existing_data_ac7fffea75f37b19:_.p2o,__wbg_set_create_1f902c5936adde7d:_.rDs,__wbg_seek_2f754ad448f4e0d7:_.U1n,__wbg_write_eef6ab13f06e9779:_.yf_,__wbg_set_type_148de20768639245:_.oV6,__wbg_instanceof_FileSystemFileHandle_fd8948f4bac4e78a:_.VRI,__wbg_createWritable_6c6623bddc203fe6:_._xs,__wbg_getFile_115354fc950edc88:_.dJ9,__wbg_close_83fb809aca3de7f9:_.K2U,__wbg_set_create_c95ddca018fac9ce:_.vw0,__wbg_name_e8cffaa6f870bdb5:_.S_F,__wbg_new_with_str_and_init_a61cbc6bdef21614:_.C85,__wbg_enqueue_2c63f2044f257c3e:_.Uyb,__wbg_close_a79afee31de55b36:_.XYr,__wbg_queueMicrotask_5bb536982f78a56f:_.mlW,__wbg_queueMicrotask_0aa0a927f78f5d98:_.lBq,__wbg_set_recursive_f5d3416098328110:_.VPg,__wbg_instanceof_FileSystemDirectoryHandle_56a167039d614548:_.KnO,__wbg_removeEntry_d1cc9710704217eb:_.dT3,__wbg_removeEntry_c4efffdd318b51a1:_.zSd,__wbg_getFileHandle_ff4ab917b45affb3:_.Iz5,__wbg_getDirectoryHandle_87ce8ca53cf4d8dc:_.tSL,__wbg_entries_04a4b982351a717f:_.kZ2,__wbg_shape_new:_._cl,__wbg_person_unwrap:_.Xv$,__wbg_String_8f0eb39a4a4c2f66:_.Oyk,__wbg_get_with_ref_key_1dc361bd10053bfe:_.GPN,__wbg_set_3f1d0b984ed272ed:_.NJs,__wbg_getRandomValues_9c5c1b115e142bb8:_.Ctk,__wbg_minaerror_new:_.EkI,__wbg_new_8a6f238a6ece86ea:_.$Pc,__wbg_stack_0ed75d68575b0f3c:_.x$X,__wbg_error_7534b8e9a36f1ab4:_.WYM,__wbg_log_6b5ca2e6124b2808:_.aW0,__wbg_info_148d043840582012:_.fib,__wbg_warn_f7ae1b2e66ccb930:_.Ua6,__wbg_debug_a4099fa12db6cd61:_.DaD,__wbg_error_9a7fe3f932034cde:_.JBS,__wbg_clearTimeout_42d9ccd50822fd3a:_.P6V,__wbg_instanceof_Response_ee1d54d79ae41977:_.RMx,__wbg_arrayBuffer_bb54076166006c39:_.EyN,__wbg_url_c484c26b1fbf5126:_.xkM,__wbg_status_89d7e803db911ee7:_.bWe,__wbg_headers_59a2938db9f80985:_.tCk,__wbg_setTimeout_4ec014681668a581:_.BJ2,__wbg_arrayBuffer_05ce1af23e9064e8:_.rWY,__wbg_new_with_u8_array_sequence_and_options_cc0f8f2c1ef62e68:_.f8A,__wbg_size_e05d31cc6049815f:_.v9h,__wbg_text_6c01d6a72e29d7a7:_.DQW,__wbg_has_d4e53238966c12b6:_.M4v,__wbg_fetch_6bbc32f991730587:_.qO7,__wbg_softwaresystem_new:_.dM0,__wbg_boundary_new:_.HCo,__wbg_person_new:_.c1W,__wbg_component_new:_.WJm,__wbg_deploymentnode_new:_.ezj,__wbg_relationship_new:_.NpJ,__wbg_container_new:_.e57,__wbg_boundary_unwrap:_.Wq,__wbg_shape_unwrap:_.D7n,__wbg_point_unwrap:_._QJ,__wbg_deploymentnode_unwrap:_._Zx,__wbg_diagramelementspec_unwrap:_.W3f,__wbg_relationship_unwrap:_.KM7,__wbg_container_unwrap:_.xB8,__wbg_component_unwrap:_.dT0,__wbg_softwaresystem_unwrap:_.qre,__wbg_diagramelementspec_new:_.Dr_,__wbg_point_new:_.nA9,__wbindgen_init_externref_table:_.bLn,__wbindgen_cast_0000000000000001:_.NRA,__wbindgen_cast_0000000000000002:_.U_B,__wbindgen_cast_0000000000000003:_.b$l,__wbindgen_cast_0000000000000004:_.Ww_,__wbindgen_cast_0000000000000005:_.PUW}})},221(e){e.exports=require("tw-elements")},334(e,t,n){n.a(e,(async(e,_)=>{try{n.d(t,{default:()=>g});var r=n(764),o=n(768),i=n(454),a=n(15),s=n(507),l=n(519),c=n(732),d=e([s,l]);[s,l]=d.then?(await d)():d,(0,i.aC)();const g=e=>{var t;const{projectRootUrl:_,diagramUrl:i,ghToken:d}=e;(0,o.T_)({initTE:async function(){const{initTE:e,Dropdown:t}=await Promise.resolve().then(n.t.bind(n,221,23));await e({Dropdown:t})}});const g=(0,a.useRef)(null),[u,b]=(0,a.useState)(),[p,w]=(0,a.useState)(),[m,f]=(0,a.useState)(),h={onOpenDiagramClick:e=>{let t;try{t=(0,l.qj)(_,e)}catch(e){console.error(e),y("Invalid URL: the provided URL is an invalid Mina project or diagram.")}t&&v(t)},onOpenExternalLinkClick:e=>{window.open(e,"_blank")}};function y(e){b(null),f(e)}async function v(e){var t,n,r,o;let i;null==(t=g.current)||t.resetCanvas();try{i=await(0,s.wS)(_,e,d)}catch(e){const t=e;if(!(t.message&&t.message.replace(/ /g,"").length>0))throw new Error;y(t.message)}if(null!=(n=i)&&n.projectSettingsJson&&null!=(r=i)&&r.plantuml&&null!=(o=i)&&o.spec)try{w(JSON.parse(i.projectSettingsJson));const t=await(0,l.Ox)(_,e,i.plantuml,i.spec);b(t)}catch(e){y("Invalid diagram or project settings.")}}(0,a.useEffect)((()=>{y(null),v(i)}),[i,_,d]);return(0,c.jsxs)("div",{className:"h-full w-full border-t flex items-center",children:[(0,c.jsx)(o.rI,{menuItemsProps:[{id:"dropdown-init",label:"",isHeaderMenuItem:!0,subMenuItems:[{id:"dropdown-init-1",label:""}]}],className:"hidden"}),(0,c.jsx)(o.tz,{}),null===m&&u&&(0,c.jsx)(r.D,{diagramListener:h,diagram:u,ref:g,diagramsThemeSettings:null==p||null==(t=p.themes_settings)?void 0:t.diagrams_theme_settings,target:"web",readOnly:!0}),m&&(0,c.jsx)("div",{className:"w-full text-center text-black",children:m})]})};_()}catch(e){_(e)}}))},423(e){e.exports=require("change-case")},452(e){e.exports=require("pluralize")},454(e,t,n){n.d(t,{mg:()=>l,Cp:()=>_,qI:()=>u,aC:()=>p,l:()=>d,$r:()=>s,cr:()=>b,wF:()=>g,x4:()=>c});const _=(e={})=>Object.keys(e).reduce(((t,n)=>(n.startsWith("data-")&&(t[n]=e[n]),t)),{}),r=require("fast-deep-equal/es6/react");var o=n.n(r);const i=require("lodash.clonedeep");var a=n.n(i);const s=(e,t)=>o()(e,t),l=e=>a()(e);function c(e){return e?e.replace(/\\n/g,"\n").replace(/\\t/g," ").replace(/\\r/g,"\n"):void 0}function d(e){return e.sort(((e,t)=>t.length-e.length))[0]}function g(e,t=96){return Number.parseFloat((e/t).toFixed(2))}function u(e,t=96){return Number.parseFloat((e*t).toFixed(2))}function b(e,t=96){return Number.parseFloat((e*(t/72)).toFixed(2))}function p(){console.log=()=>{},console.debug=()=>{}}require("jszip")},457(e,t,n){n.d(t,{$Dy:()=>ae,$Pc:()=>Ot,$hZ:()=>V,A0G:()=>At,B6M:()=>Bt,BJ2:()=>Kt,Bth:()=>G,C85:()=>Dt,CJX:()=>pt,CeS:()=>et,Ctk:()=>Ye,D7n:()=>fn,DQW:()=>kn,DaD:()=>Ie,Dr_:()=>Le,EkI:()=>wt,EyN:()=>de,FMZ:()=>oe,GPN:()=>qe,GSt:()=>he,HBd:()=>$e,HCo:()=>ge,Hgc:()=>En,IIh:()=>Dn,Iz5:()=>Ze,JBS:()=>ze,JD7:()=>A,Jyf:()=>cn,K2U:()=>Se,KM7:()=>Ut,KMT:()=>jt,Kk3:()=>Ge,KnO:()=>tt,LZ_:()=>ft,Llp:()=>j,M4v:()=>Ve,MLu:()=>Rn,MzV:()=>Nt,NJs:()=>en,NRA:()=>Pn,NZe:()=>jn,NpJ:()=>Yt,Nwu:()=>be,OVC:()=>ct,Oxg:()=>F,Oyk:()=>W,P6V:()=>ye,PUW:()=>Xn,PnO:()=>Ct,Q01:()=>se,Q8O:()=>it,Qdk:()=>sn,RMx:()=>rt,S_F:()=>mt,SrV:()=>ie,St8:()=>xn,T70:()=>lt,T9E:()=>pn,TB7:()=>nn,U0y:()=>_t,U1n:()=>Jt,U4M:()=>hn,U_B:()=>zn,Ua6:()=>Mn,Uyb:()=>Ae,V0o:()=>Rt,VPg:()=>bn,VRI:()=>nt,W3f:()=>Ne,W7D:()=>_e,WJm:()=>xe,WMd:()=>It,WYM:()=>Pe,W_J:()=>st,Wq:()=>ue,Ww_:()=>Wn,XP1:()=>q,XYU:()=>Ue,XYr:()=>Oe,XZV:()=>Fe,Xci:()=>vt,XmT:()=>dt,Xv$:()=>Ft,Ytm:()=>tn,YyO:()=>Xt,YzY:()=>kt,Z5i:()=>St,ZEw:()=>ln,Z_9:()=>J,Zzl:()=>rn,_2w:()=>In,_Cc:()=>P,_QJ:()=>zt,_Zx:()=>De,_cl:()=>mn,_hV:()=>Tt,_xs:()=>Ce,a9o:()=>X,aW0:()=>bt,a_p:()=>we,aax:()=>Vt,b$l:()=>Bn,b6G:()=>je,bDv:()=>Q,bLn:()=>Zn,bWe:()=>Cn,c0$:()=>me,c1W:()=>Mt,c22:()=>Qt,cKO:()=>te,cpy:()=>Y,dJ9:()=>He,dM0:()=>vn,dT0:()=>Ee,dT3:()=>$t,e57:()=>Te,esX:()=>Wt,ezj:()=>ke,f8A:()=>Lt,fa$:()=>z,fib:()=>Ke,gqh:()=>un,hvT:()=>ut,iNx:()=>gt,k0X:()=>H,kZ2:()=>Me,kfc:()=>ve,kwF:()=>qt,l7b:()=>ot,l8_:()=>Et,lBq:()=>Zt,lIU:()=>V_,mlW:()=>Ht,n8y:()=>Tn,nA9:()=>Pt,nc3:()=>xt,neO:()=>B,ng2:()=>at,oF3:()=>ht,oV6:()=>wn,p2o:()=>dn,p3I:()=>gn,qO7:()=>Be,qe3:()=>fe,qjW:()=>M,qre:()=>Sn,rDs:()=>on,rEs:()=>yt,rWY:()=>ce,rXI:()=>$,rgd:()=>Qe,rm3:()=>ne,tCk:()=>Je,tNh:()=>pe,tRs:()=>re,tSL:()=>Xe,tZJ:()=>U,uN9:()=>le,v9h:()=>yn,vGI:()=>Z,vNk:()=>_n,vZh:()=>We,vw0:()=>an,wEy:()=>ee,wIB:()=>K,wej:()=>An,x$X:()=>On,xB8:()=>Re,xRo:()=>Ln,xkM:()=>Nn,yf_:()=>Fn,zSd:()=>Gt});class _{static __wrap(e){e>>>=0;const t=Object.create(_.prototype);return t.__wbg_ptr=e,Vn.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Vn.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_aisettings_free(e,0)}get api_base_url(){const e=$_.__wbg_get_aisettings_api_base_url(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get api_key(){const e=$_.__wbg_get_aisettings_api_key(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get model(){const e=$_.__wbg_get_aisettings_model(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}set api_base_url(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_aisettings_api_base_url(this.__wbg_ptr,t,n)}set api_key(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_aisettings_api_key(this.__wbg_ptr,t,n)}set model(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_aisettings_model(this.__wbg_ptr,t,n)}}Symbol.dispose&&(_.prototype[Symbol.dispose]=_.prototype.free);class r{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Jn.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_addelementtag_free(e,0)}get bg_color(){const e=$_.__wbg_get_addelementtag_bg_color(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get border_color(){const e=$_.__wbg_get_addelementtag_border_color(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get border_style(){const e=$_.__wbg_get_addelementtag_border_style(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get border_thickness(){const e=$_.__wbg_get_addelementtag_border_thickness(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get font_color(){const e=$_.__wbg_get_addelementtag_font_color(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get legend_sprite(){const e=$_.__wbg_get_addelementtag_legend_sprite(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get legend_text(){const e=$_.__wbg_get_addelementtag_legend_text(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get shadowing(){const e=$_.__wbg_get_addelementtag_shadowing(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get shape(){const e=$_.__wbg_get_addelementtag_shape(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get sprite(){const e=$_.__wbg_get_addelementtag_sprite(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get tag(){const e=$_.__wbg_get_addelementtag_tag(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get techn(){const e=$_.__wbg_get_addelementtag_techn(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}set bg_color(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_addelementtag_bg_color(this.__wbg_ptr,t,n)}set border_color(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_addelementtag_border_color(this.__wbg_ptr,t,n)}set border_style(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_addelementtag_border_style(this.__wbg_ptr,t,n)}set border_thickness(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_addelementtag_border_thickness(this.__wbg_ptr,t,n)}set font_color(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_addelementtag_font_color(this.__wbg_ptr,t,n)}set legend_sprite(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_addelementtag_legend_sprite(this.__wbg_ptr,t,n)}set legend_text(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_addelementtag_legend_text(this.__wbg_ptr,t,n)}set shadowing(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_addelementtag_shadowing(this.__wbg_ptr,t,n)}set shape(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_addelementtag_shape(this.__wbg_ptr,t,n)}set sprite(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_addelementtag_sprite(this.__wbg_ptr,t,n)}set tag(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_addelementtag_tag(this.__wbg_ptr,t,n)}set techn(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_addelementtag_techn(this.__wbg_ptr,t,n)}}Symbol.dispose&&(r.prototype[Symbol.dispose]=r.prototype.free);class o{static __wrap(e){e>>>=0;const t=Object.create(o.prototype);return t.__wbg_ptr=e,Kn.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Kn.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_baseelement_free(e,0)}get alias(){const e=$_.__wbg_get_baseelement_alias(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get description(){const e=$_.__wbg_get_baseelement_description(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get label(){const e=$_.__wbg_get_baseelement_label(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get link(){const e=$_.__wbg_get_baseelement_link(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get notes(){const e=$_.__wbg_get_baseelement_notes(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get sprite(){const e=$_.__wbg_get_baseelement_sprite(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get tags(){const e=$_.__wbg_get_baseelement_tags(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get uuid(){const e=$_.__wbg_get_baseelement_uuid(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}set alias(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_baseelement_alias(this.__wbg_ptr,t,n)}set description(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_baseelement_description(this.__wbg_ptr,t,n)}set label(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_baseelement_label(this.__wbg_ptr,t,n)}set link(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_baseelement_link(this.__wbg_ptr,t,n)}set notes(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_baseelement_notes(this.__wbg_ptr,t,n)}set sprite(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_baseelement_sprite(this.__wbg_ptr,t,n)}set tags(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_baseelement_tags(this.__wbg_ptr,t,n)}set uuid(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_baseelement_uuid(this.__wbg_ptr,t,n)}}Symbol.dispose&&(o.prototype[Symbol.dispose]=o.prototype.free);class i{static __wrap(e){e>>>=0;const t=Object.create(i.prototype);return t.__wbg_ptr=e,Qn.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof i?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Qn.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_boundary_free(e,0)}get base_data(){const e=$_.__wbg_get_boundary_base_data(this.__wbg_ptr);return o.__wrap(e)}get boundary_custom_type(){const e=$_.__wbg_get_boundary_boundary_custom_type(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get boundary_type(){return $_.__wbg_get_boundary_boundary_type(this.__wbg_ptr)}get sub_elements(){const e=$_.__wbg_get_boundary_sub_elements(this.__wbg_ptr);var t=D_(e[0],e[1]).slice();return $_.__wbindgen_free(e[0],4*e[1],4),t}set base_data(e){C_(e,o);var t=e.__destroy_into_raw();$_.__wbg_set_boundary_base_data(this.__wbg_ptr,t)}set boundary_custom_type(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_boundary_boundary_custom_type(this.__wbg_ptr,t,n)}set boundary_type(e){$_.__wbg_set_boundary_boundary_type(this.__wbg_ptr,z_(e)?0:R_(e))}set sub_elements(e){const t=W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_boundary_sub_elements(this.__wbg_ptr,t,n)}}Symbol.dispose&&(i.prototype[Symbol.dispose]=i.prototype.free);class a{static __wrap(e){e>>>=0;const t=Object.create(a.prototype);return t.__wbg_ptr=e,e_.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_c4elements_free(e,0)}get boundaries(){const e=$_.__wbg_get_c4elements_boundaries(this.__wbg_ptr);var t=D_(e[0],e[1]).slice();return $_.__wbindgen_free(e[0],4*e[1],4),t}get components(){const e=$_.__wbg_get_c4elements_components(this.__wbg_ptr);var t=D_(e[0],e[1]).slice();return $_.__wbindgen_free(e[0],4*e[1],4),t}get containers(){const e=$_.__wbg_get_c4elements_containers(this.__wbg_ptr);var t=D_(e[0],e[1]).slice();return $_.__wbindgen_free(e[0],4*e[1],4),t}get deployment_nodes(){const e=$_.__wbg_get_c4elements_deployment_nodes(this.__wbg_ptr);var t=D_(e[0],e[1]).slice();return $_.__wbindgen_free(e[0],4*e[1],4),t}get persons(){const e=$_.__wbg_get_c4elements_persons(this.__wbg_ptr);var t=D_(e[0],e[1]).slice();return $_.__wbindgen_free(e[0],4*e[1],4),t}get relationships(){const e=$_.__wbg_get_c4elements_relationships(this.__wbg_ptr);var t=D_(e[0],e[1]).slice();return $_.__wbindgen_free(e[0],4*e[1],4),t}get software_systems(){const e=$_.__wbg_get_c4elements_software_systems(this.__wbg_ptr);var t=D_(e[0],e[1]).slice();return $_.__wbindgen_free(e[0],4*e[1],4),t}set boundaries(e){const t=W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_c4elements_boundaries(this.__wbg_ptr,t,n)}set components(e){const t=W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_c4elements_components(this.__wbg_ptr,t,n)}set containers(e){const t=W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_c4elements_containers(this.__wbg_ptr,t,n)}set deployment_nodes(e){const t=W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_c4elements_deployment_nodes(this.__wbg_ptr,t,n)}set persons(e){const t=W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_c4elements_persons(this.__wbg_ptr,t,n)}set relationships(e){const t=W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_c4elements_relationships(this.__wbg_ptr,t,n)}set software_systems(e){const t=W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_c4elements_software_systems(this.__wbg_ptr,t,n)}}Symbol.dispose&&(a.prototype[Symbol.dispose]=a.prototype.free);class s{static __wrap(e){e>>>=0;const t=Object.create(s.prototype);return t.__wbg_ptr=e,t_.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof s?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,t_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_component_free(e,0)}get base_data(){const e=$_.__wbg_get_component_base_data(this.__wbg_ptr);return o.__wrap(e)}get component_type(){return $_.__wbg_get_component_component_type(this.__wbg_ptr)}get technology(){const e=$_.__wbg_get_component_technology(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}set base_data(e){C_(e,o);var t=e.__destroy_into_raw();$_.__wbg_set_component_base_data(this.__wbg_ptr,t)}set component_type(e){$_.__wbg_set_component_component_type(this.__wbg_ptr,z_(e)?0:R_(e))}set technology(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_component_technology(this.__wbg_ptr,t,n)}}Symbol.dispose&&(s.prototype[Symbol.dispose]=s.prototype.free);class l{static __wrap(e){e>>>=0;const t=Object.create(l.prototype);return t.__wbg_ptr=e,n_.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof l?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,n_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_container_free(e,0)}get base_data(){const e=$_.__wbg_get_container_base_data(this.__wbg_ptr);return o.__wrap(e)}get container_type(){return $_.__wbg_get_container_container_type(this.__wbg_ptr)}get technology(){const e=$_.__wbg_get_container_technology(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}set base_data(e){C_(e,o);var t=e.__destroy_into_raw();$_.__wbg_set_container_base_data(this.__wbg_ptr,t)}set container_type(e){$_.__wbg_set_container_container_type(this.__wbg_ptr,z_(e)?0:R_(e))}set technology(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_container_technology(this.__wbg_ptr,t,n)}}Symbol.dispose&&(l.prototype[Symbol.dispose]=l.prototype.free);class c{static __wrap(e){e>>>=0;const t=Object.create(c.prototype);return t.__wbg_ptr=e,__.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof c?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,__.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_deploymentnode_free(e,0)}get base_data(){const e=$_.__wbg_get_deploymentnode_base_data(this.__wbg_ptr);return o.__wrap(e)}get deployment_node_type(){return $_.__wbg_get_deploymentnode_deployment_node_type(this.__wbg_ptr)}get deploymeny_node_custom_type(){const e=$_.__wbg_get_deploymentnode_deploymeny_node_custom_type(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get sub_elements(){const e=$_.__wbg_get_deploymentnode_sub_elements(this.__wbg_ptr);var t=D_(e[0],e[1]).slice();return $_.__wbindgen_free(e[0],4*e[1],4),t}set base_data(e){C_(e,o);var t=e.__destroy_into_raw();$_.__wbg_set_deploymentnode_base_data(this.__wbg_ptr,t)}set deployment_node_type(e){$_.__wbg_set_deploymentnode_deployment_node_type(this.__wbg_ptr,z_(e)?0:R_(e))}set deploymeny_node_custom_type(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_addelementtag_legend_sprite(this.__wbg_ptr,t,n)}set sub_elements(e){const t=W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_deploymentnode_sub_elements(this.__wbg_ptr,t,n)}}Symbol.dispose&&(c.prototype[Symbol.dispose]=c.prototype.free);class d{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,r_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_diagram_free(e,0)}get auto_layout(){return $_.diagram_auto_layout(this.__wbg_ptr)}set auto_layout(e){$_.diagram_set_auto_layout(this.__wbg_ptr,e)}get auto_layout_errors(){const e=$_.__wbg_get_diagram_auto_layout_errors(this.__wbg_ptr);let t;return 0!==e[0]&&(t=D_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],4*e[1],4)),t}get diagram_name(){const e=$_.__wbg_get_diagram_diagram_name(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get diagram_plantuml(){const e=$_.__wbg_get_diagram_diagram_plantuml(this.__wbg_ptr);return 0===e?void 0:u.__wrap(e)}get diagram_spec(){const e=$_.__wbg_get_diagram_diagram_spec(this.__wbg_ptr);return 0===e?void 0:b.__wrap(e)}get diagram_type(){return $_.__wbg_get_diagram_diagram_type(this.__wbg_ptr)}get last_modified(){const e=$_.__wbg_get_diagram_last_modified(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get raw_plantuml(){const e=$_.__wbg_get_diagram_raw_plantuml(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}set auto_layout_errors(e){var t=z_(e)?0:W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_diagram_auto_layout_errors(this.__wbg_ptr,t,n)}set diagram_name(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagram_diagram_name(this.__wbg_ptr,t,n)}set diagram_plantuml(e){let t=0;z_(e)||(C_(e,u),t=e.__destroy_into_raw()),$_.__wbg_set_diagram_diagram_plantuml(this.__wbg_ptr,t)}set diagram_spec(e){let t=0;z_(e)||(C_(e,b),t=e.__destroy_into_raw()),$_.__wbg_set_diagram_diagram_spec(this.__wbg_ptr,t)}set diagram_type(e){$_.__wbg_set_diagram_diagram_type(this.__wbg_ptr,z_(e)?0:R_(e))}set last_modified(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagram_last_modified(this.__wbg_ptr,t,n)}set raw_plantuml(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagram_raw_plantuml(this.__wbg_ptr,t,n)}}Symbol.dispose&&(d.prototype[Symbol.dispose]=d.prototype.free);class g{static __wrap(e){e>>>=0;const t=Object.create(g.prototype);return t.__wbg_ptr=e,o_.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof g?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,o_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_diagramelementspec_free(e,0)}get alias(){const e=$_.__wbg_get_diagramelementspec_alias(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get element_type(){return $_.__wbg_get_diagramelementspec_element_type(this.__wbg_ptr)}get from(){const e=$_.__wbg_get_diagramelementspec_from(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get inner_specs(){const e=$_.__wbg_get_diagramelementspec_inner_specs(this.__wbg_ptr);let t;return 0!==e[0]&&(t=D_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],4*e[1],4)),t}get position(){const e=$_.__wbg_get_diagramelementspec_position(this.__wbg_ptr);return 0===e?void 0:x.__wrap(e)}get shapes(){const e=$_.__wbg_get_diagramelementspec_shapes(this.__wbg_ptr);let t;return 0!==e[0]&&(t=D_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],4*e[1],4)),t}get size(){const e=$_.__wbg_get_diagramelementspec_size(this.__wbg_ptr);return 0===e?void 0:k.__wrap(e)}get to(){const e=$_.__wbg_get_diagramelementspec_to(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}set alias(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramelementspec_alias(this.__wbg_ptr,t,n)}set element_type(e){$_.__wbg_set_diagramelementspec_element_type(this.__wbg_ptr,z_(e)?0:R_(e))}set from(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramelementspec_from(this.__wbg_ptr,t,n)}set inner_specs(e){var t=z_(e)?0:W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_diagramelementspec_inner_specs(this.__wbg_ptr,t,n)}set position(e){let t=0;z_(e)||(C_(e,x),t=e.__destroy_into_raw()),$_.__wbg_set_diagramelementspec_position(this.__wbg_ptr,t)}set shapes(e){var t=z_(e)?0:W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_diagramelementspec_shapes(this.__wbg_ptr,t,n)}set size(e){let t=0;z_(e)||(C_(e,k),t=e.__destroy_into_raw()),$_.__wbg_set_diagramelementspec_size(this.__wbg_ptr,t)}set to(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramelementspec_to(this.__wbg_ptr,t,n)}}Symbol.dispose&&(g.prototype[Symbol.dispose]=g.prototype.free);class u{static __wrap(e){e>>>=0;const t=Object.create(u.prototype);return t.__wbg_ptr=e,i_.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,i_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_diagramplantuml_free(e,0)}set tags(e){$_.diagramplantuml_set_tags(this.__wbg_ptr,e)}get tags(){return $_.diagramplantuml_tags(this.__wbg_ptr)}get aliases(){const e=$_.__wbg_get_diagramplantuml_aliases(this.__wbg_ptr);var t=D_(e[0],e[1]).slice();return $_.__wbindgen_free(e[0],4*e[1],4),t}get diagram_id(){const e=$_.__wbg_get_diagramplantuml_diagram_id(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get elements(){const e=$_.__wbg_get_diagramplantuml_elements(this.__wbg_ptr);var t=D_(e[0],e[1]).slice();return $_.__wbindgen_free(e[0],4*e[1],4),t}set aliases(e){const t=W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_diagramplantuml_aliases(this.__wbg_ptr,t,n)}set diagram_id(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramplantuml_diagram_id(this.__wbg_ptr,t,n)}set elements(e){const t=W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_boundary_sub_elements(this.__wbg_ptr,t,n)}}Symbol.dispose&&(u.prototype[Symbol.dispose]=u.prototype.free);class b{static __wrap(e){e>>>=0;const t=Object.create(b.prototype);return t.__wbg_ptr=e,a_.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,a_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_diagramspec_free(e,0)}get auto_layout_enabled(){return 0!==$_.__wbg_get_diagramspec_auto_layout_enabled(this.__wbg_ptr)}get auto_layout_only_straight_arrows(){return 0!==$_.__wbg_get_diagramspec_auto_layout_only_straight_arrows(this.__wbg_ptr)}get auto_layout_orientation(){return $_.__wbg_get_diagramspec_auto_layout_orientation(this.__wbg_ptr)}get auto_layout_ranksep(){return $_.__wbg_get_diagramspec_auto_layout_ranksep(this.__wbg_ptr)}get auto_layout_subgraph_inner_margin(){return $_.__wbg_get_diagramspec_auto_layout_subgraph_inner_margin(this.__wbg_ptr)}get auto_layout_subgraph_outer_margin(){return $_.__wbg_get_diagramspec_auto_layout_subgraph_outer_margin(this.__wbg_ptr)}get description(){const e=$_.__wbg_get_diagramspec_description(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get elements_specs(){const e=$_.__wbg_get_diagramspec_elements_specs(this.__wbg_ptr);var t=D_(e[0],e[1]).slice();return $_.__wbindgen_free(e[0],4*e[1],4),t}get grid_enabled(){return 0!==$_.__wbg_get_diagramspec_grid_enabled(this.__wbg_ptr)}get shapes(){const e=$_.__wbg_get_diagramspec_shapes(this.__wbg_ptr);var t=D_(e[0],e[1]).slice();return $_.__wbindgen_free(e[0],4*e[1],4),t}get tags(){const e=$_.__wbg_get_diagramspec_tags(this.__wbg_ptr);let t;return 0!==e[0]&&(t=D_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],4*e[1],4)),t}get uuid(){let e,t;try{const n=$_.__wbg_get_diagramspec_uuid(this.__wbg_ptr);return e=n[0],t=n[1],A_(n[0],n[1])}finally{$_.__wbindgen_free(e,t,1)}}set auto_layout_enabled(e){$_.__wbg_set_diagramspec_auto_layout_enabled(this.__wbg_ptr,e)}set auto_layout_only_straight_arrows(e){$_.__wbg_set_diagramspec_auto_layout_only_straight_arrows(this.__wbg_ptr,e)}set auto_layout_orientation(e){$_.__wbg_set_diagramspec_auto_layout_orientation(this.__wbg_ptr,e)}set auto_layout_ranksep(e){$_.__wbg_set_diagramspec_auto_layout_ranksep(this.__wbg_ptr,e)}set auto_layout_subgraph_inner_margin(e){$_.__wbg_set_diagramspec_auto_layout_subgraph_inner_margin(this.__wbg_ptr,e)}set auto_layout_subgraph_outer_margin(e){$_.__wbg_set_diagramspec_auto_layout_subgraph_outer_margin(this.__wbg_ptr,e)}set description(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramspec_description(this.__wbg_ptr,t,n)}set elements_specs(e){const t=W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_diagramspec_elements_specs(this.__wbg_ptr,t,n)}set grid_enabled(e){$_.__wbg_set_diagramspec_grid_enabled(this.__wbg_ptr,e)}set shapes(e){const t=W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_diagramspec_shapes(this.__wbg_ptr,t,n)}set tags(e){var t=z_(e)?0:W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_diagramspec_tags(this.__wbg_ptr,t,n)}set uuid(e){const t=X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramspec_uuid(this.__wbg_ptr,t,n)}}Symbol.dispose&&(b.prototype[Symbol.dispose]=b.prototype.free);class p{static __wrap(e){e>>>=0;const t=Object.create(p.prototype);return t.__wbg_ptr=e,s_.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,s_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_diagramsthemesettings_free(e,0)}get bg_color_boundary(){const e=$_.__wbg_get_diagramsthemesettings_bg_color_boundary(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get bg_color_component_ext(){const e=$_.__wbg_get_diagramsthemesettings_bg_color_component_ext(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get bg_color_component(){const e=$_.__wbg_get_diagramsthemesettings_bg_color_component(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get bg_color_container_ext(){const e=$_.__wbg_get_diagramsthemesettings_bg_color_container_ext(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get bg_color_container(){const e=$_.__wbg_get_diagramsthemesettings_bg_color_container(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get bg_color_deployment_node(){const e=$_.__wbg_get_diagramsthemesettings_bg_color_deployment_node(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get bg_color_diagram(){const e=$_.__wbg_get_diagramsthemesettings_bg_color_diagram(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get bg_color_person_ext(){const e=$_.__wbg_get_diagramsthemesettings_bg_color_person_ext(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get bg_color_person(){const e=$_.__wbg_get_diagramsthemesettings_bg_color_person(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get bg_color_relationship(){const e=$_.__wbg_get_diagramsthemesettings_bg_color_relationship(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get bg_color_software_system_ext(){const e=$_.__wbg_get_diagramsthemesettings_bg_color_software_system_ext(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get bg_color_software_system(){const e=$_.__wbg_get_diagramsthemesettings_bg_color_software_system(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get border_color_boundary(){const e=$_.__wbg_get_diagramsthemesettings_border_color_boundary(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get border_color_component_ext(){const e=$_.__wbg_get_diagramsthemesettings_border_color_component_ext(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get border_color_component(){const e=$_.__wbg_get_diagramsthemesettings_border_color_component(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get border_color_container_ext(){const e=$_.__wbg_get_diagramsthemesettings_border_color_container_ext(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get border_color_container(){const e=$_.__wbg_get_diagramsthemesettings_border_color_container(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get border_color_deployment_node(){const e=$_.__wbg_get_diagramsthemesettings_border_color_deployment_node(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get border_color_person_ext(){const e=$_.__wbg_get_diagramsthemesettings_border_color_person_ext(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get border_color_person(){const e=$_.__wbg_get_diagramsthemesettings_border_color_person(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get border_color_software_system_ext(){const e=$_.__wbg_get_diagramsthemesettings_border_color_software_system_ext(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get border_color_software_system(){const e=$_.__wbg_get_diagramsthemesettings_border_color_software_system(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get line_color_relationship(){const e=$_.__wbg_get_diagramsthemesettings_line_color_relationship(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get selected_color_relationship(){const e=$_.__wbg_get_diagramsthemesettings_selected_color_relationship(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get text_color_boundary(){const e=$_.__wbg_get_diagramsthemesettings_text_color_boundary(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get text_color_component_ext(){const e=$_.__wbg_get_diagramsthemesettings_text_color_component_ext(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get text_color_component(){const e=$_.__wbg_get_diagramsthemesettings_text_color_component(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get text_color_container_ext(){const e=$_.__wbg_get_diagramsthemesettings_text_color_container_ext(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get text_color_container(){const e=$_.__wbg_get_diagramsthemesettings_text_color_container(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get text_color_deployment_node(){const e=$_.__wbg_get_diagramsthemesettings_text_color_deployment_node(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get text_color_legend_title(){const e=$_.__wbg_get_diagramsthemesettings_text_color_legend_title(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get text_color_person_ext(){const e=$_.__wbg_get_diagramsthemesettings_text_color_person_ext(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get text_color_person(){const e=$_.__wbg_get_diagramsthemesettings_text_color_person(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get text_color_relationship(){const e=$_.__wbg_get_diagramsthemesettings_text_color_relationship(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get text_color_software_system_ext(){const e=$_.__wbg_get_diagramsthemesettings_text_color_software_system_ext(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get text_color_software_system(){const e=$_.__wbg_get_diagramsthemesettings_text_color_software_system(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}set bg_color_boundary(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_bg_color_boundary(this.__wbg_ptr,t,n)}set bg_color_component_ext(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_bg_color_component_ext(this.__wbg_ptr,t,n)}set bg_color_component(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_bg_color_component(this.__wbg_ptr,t,n)}set bg_color_container_ext(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_bg_color_container_ext(this.__wbg_ptr,t,n)}set bg_color_container(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_bg_color_container(this.__wbg_ptr,t,n)}set bg_color_deployment_node(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_bg_color_deployment_node(this.__wbg_ptr,t,n)}set bg_color_diagram(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_bg_color_diagram(this.__wbg_ptr,t,n)}set bg_color_person_ext(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_bg_color_person_ext(this.__wbg_ptr,t,n)}set bg_color_person(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_bg_color_person(this.__wbg_ptr,t,n)}set bg_color_relationship(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_bg_color_relationship(this.__wbg_ptr,t,n)}set bg_color_software_system_ext(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_bg_color_software_system_ext(this.__wbg_ptr,t,n)}set bg_color_software_system(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_bg_color_software_system(this.__wbg_ptr,t,n)}set border_color_boundary(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_border_color_boundary(this.__wbg_ptr,t,n)}set border_color_component_ext(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_border_color_component_ext(this.__wbg_ptr,t,n)}set border_color_component(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_border_color_component(this.__wbg_ptr,t,n)}set border_color_container_ext(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_border_color_container_ext(this.__wbg_ptr,t,n)}set border_color_container(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_border_color_container(this.__wbg_ptr,t,n)}set border_color_deployment_node(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_border_color_deployment_node(this.__wbg_ptr,t,n)}set border_color_person_ext(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_border_color_person_ext(this.__wbg_ptr,t,n)}set border_color_person(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_border_color_person(this.__wbg_ptr,t,n)}set border_color_software_system_ext(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_border_color_software_system_ext(this.__wbg_ptr,t,n)}set border_color_software_system(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_border_color_software_system(this.__wbg_ptr,t,n)}set line_color_relationship(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_line_color_relationship(this.__wbg_ptr,t,n)}set selected_color_relationship(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_selected_color_relationship(this.__wbg_ptr,t,n)}set text_color_boundary(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_text_color_boundary(this.__wbg_ptr,t,n)}set text_color_component_ext(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_text_color_component_ext(this.__wbg_ptr,t,n)}set text_color_component(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_text_color_component(this.__wbg_ptr,t,n)}set text_color_container_ext(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_text_color_container_ext(this.__wbg_ptr,t,n)}set text_color_container(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_text_color_container(this.__wbg_ptr,t,n)}set text_color_deployment_node(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_text_color_deployment_node(this.__wbg_ptr,t,n)}set text_color_legend_title(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_text_color_legend_title(this.__wbg_ptr,t,n)}set text_color_person_ext(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_text_color_person_ext(this.__wbg_ptr,t,n)}set text_color_person(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_text_color_person(this.__wbg_ptr,t,n)}set text_color_relationship(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_text_color_relationship(this.__wbg_ptr,t,n)}set text_color_software_system_ext(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_text_color_software_system_ext(this.__wbg_ptr,t,n)}set text_color_software_system(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_text_color_software_system(this.__wbg_ptr,t,n)}}Symbol.dispose&&(p.prototype[Symbol.dispose]=p.prototype.free);class w{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,l_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_elementdata_free(e,0)}get end(){const e=$_.__wbg_get_elementdata_end(this.__wbg_ptr);return 0===e?void 0:O.__wrap(e)}get label_position(){const e=$_.__wbg_get_elementdata_label_position(this.__wbg_ptr);return 0===e?void 0:O.__wrap(e)}get path(){const e=$_.__wbg_get_elementdata_path(this.__wbg_ptr);let t;return 0!==e[0]&&(t=D_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],4*e[1],4)),t}get position(){const e=$_.__wbg_get_elementdata_position(this.__wbg_ptr);return 0===e?void 0:O.__wrap(e)}get size(){const e=$_.__wbg_get_elementdata_size(this.__wbg_ptr);return 0===e?void 0:O.__wrap(e)}get start(){const e=$_.__wbg_get_elementdata_start(this.__wbg_ptr);return 0===e?void 0:O.__wrap(e)}get svg_path(){const e=$_.__wbg_get_elementdata_svg_path(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}set end(e){let t=0;z_(e)||(C_(e,O),t=e.__destroy_into_raw()),$_.__wbg_set_elementdata_end(this.__wbg_ptr,t)}set label_position(e){let t=0;z_(e)||(C_(e,O),t=e.__destroy_into_raw()),$_.__wbg_set_elementdata_label_position(this.__wbg_ptr,t)}set path(e){var t=z_(e)?0:W_(e,$_.__wbindgen_malloc),n=q_;$_.__wbg_set_elementdata_path(this.__wbg_ptr,t,n)}set position(e){let t=0;z_(e)||(C_(e,O),t=e.__destroy_into_raw()),$_.__wbg_set_elementdata_position(this.__wbg_ptr,t)}set size(e){let t=0;z_(e)||(C_(e,O),t=e.__destroy_into_raw()),$_.__wbg_set_elementdata_size(this.__wbg_ptr,t)}set start(e){let t=0;z_(e)||(C_(e,O),t=e.__destroy_into_raw()),$_.__wbg_set_elementdata_start(this.__wbg_ptr,t)}set svg_path(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_elementdata_svg_path(this.__wbg_ptr,t,n)}}Symbol.dispose&&(w.prototype[Symbol.dispose]=w.prototype.free);class m{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,c_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_hookpayload_free(e,0)}get data(){return $_.__wbg_get_hookpayload_data(this.__wbg_ptr)}get hook_type(){return $_.__wbg_get_hookpayload_hook_type(this.__wbg_ptr)}set data(e){$_.__wbg_set_hookpayload_data(this.__wbg_ptr,z_(e)?0:R_(e))}set hook_type(e){$_.__wbg_set_hookpayload_hook_type(this.__wbg_ptr,e)}}Symbol.dispose&&(m.prototype[Symbol.dispose]=m.prototype.free);class f{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,d_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_intounderlyingbytesource_free(e,0)}get autoAllocateChunkSize(){return $_.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr)>>>0}cancel(){const e=this.__destroy_into_raw();$_.intounderlyingbytesource_cancel(e)}pull(e){return $_.intounderlyingbytesource_pull(this.__wbg_ptr,e)}start(e){$_.intounderlyingbytesource_start(this.__wbg_ptr,e)}get type(){const e=$_.intounderlyingbytesource_type(this.__wbg_ptr);return Un[e]}}Symbol.dispose&&(f.prototype[Symbol.dispose]=f.prototype.free);class h{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,g_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_intounderlyingsink_free(e,0)}abort(e){const t=this.__destroy_into_raw();return $_.intounderlyingsink_abort(t,e)}close(){const e=this.__destroy_into_raw();return $_.intounderlyingsink_close(e)}write(e){return $_.intounderlyingsink_write(this.__wbg_ptr,e)}}Symbol.dispose&&(h.prototype[Symbol.dispose]=h.prototype.free);class y{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,u_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_intounderlyingsource_free(e,0)}cancel(){const e=this.__destroy_into_raw();$_.intounderlyingsource_cancel(e)}pull(e){return $_.intounderlyingsource_pull(this.__wbg_ptr,e)}}Symbol.dispose&&(y.prototype[Symbol.dispose]=y.prototype.free);class v{static __wrap(e){e>>>=0;const t=Object.create(v.prototype);return t.__wbg_ptr=e,b_.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,b_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_minaerror_free(e,0)}get code(){return $_.__wbg_get_minaerror_code(this.__wbg_ptr)}get msg(){let e,t;try{const n=$_.__wbg_get_minaerror_msg(this.__wbg_ptr);return e=n[0],t=n[1],A_(n[0],n[1])}finally{$_.__wbindgen_free(e,t,1)}}set code(e){$_.__wbg_set_minaerror_code(this.__wbg_ptr,e)}set msg(e){const t=X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_minaerror_msg(this.__wbg_ptr,t,n)}}Symbol.dispose&&(v.prototype[Symbol.dispose]=v.prototype.free);class S{static __wrap(e){e>>>=0;const t=Object.create(S.prototype);return t.__wbg_ptr=e,p_.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof S?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,p_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_person_free(e,0)}get base_data(){const e=$_.__wbg_get_person_base_data(this.__wbg_ptr);return o.__wrap(e)}get person_type(){return $_.__wbg_get_person_person_type(this.__wbg_ptr)}set base_data(e){C_(e,o);var t=e.__destroy_into_raw();$_.__wbg_set_person_base_data(this.__wbg_ptr,t)}set person_type(e){$_.__wbg_set_person_person_type(this.__wbg_ptr,z_(e)?0:R_(e))}}Symbol.dispose&&(S.prototype[Symbol.dispose]=S.prototype.free);class O{static __wrap(e){e>>>=0;const t=Object.create(O.prototype);return t.__wbg_ptr=e,w_.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof O?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,w_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_point_free(e,0)}get x(){return $_.__wbg_get_point_x(this.__wbg_ptr)}get y(){return $_.__wbg_get_point_y(this.__wbg_ptr)}set x(e){$_.__wbg_set_point_x(this.__wbg_ptr,e)}set y(e){$_.__wbg_set_point_y(this.__wbg_ptr,e)}}Symbol.dispose&&(O.prototype[Symbol.dispose]=O.prototype.free);class x{static __wrap(e){e>>>=0;const t=Object.create(x.prototype);return t.__wbg_ptr=e,m_.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,m_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_position_free(e,0)}get angle(){const e=$_.__wbg_get_position_angle(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}get left(){const e=$_.__wbg_get_position_left(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}get top(){const e=$_.__wbg_get_position_top(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}get z_index(){const e=$_.__wbg_get_position_z_index(this.__wbg_ptr);return 4294967297===e?void 0:e}set angle(e){$_.__wbg_set_position_angle(this.__wbg_ptr,!z_(e),z_(e)?0:e)}set left(e){$_.__wbg_set_position_left(this.__wbg_ptr,!z_(e),z_(e)?0:e)}set top(e){$_.__wbg_set_position_top(this.__wbg_ptr,!z_(e),z_(e)?0:e)}set z_index(e){$_.__wbg_set_position_z_index(this.__wbg_ptr,z_(e)?4294967297:0|e)}}Symbol.dispose&&(x.prototype[Symbol.dispose]=x.prototype.free);class E{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,f_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_project_free(e,0)}get project_library(){const e=$_.__wbg_get_project_project_library(this.__wbg_ptr);return T.__wrap(e)}get project_settings(){const e=$_.__wbg_get_project_project_settings(this.__wbg_ptr);return R.__wrap(e)}set project_library(e){C_(e,T);var t=e.__destroy_into_raw();$_.__wbg_set_project_project_library(this.__wbg_ptr,t)}set project_settings(e){C_(e,R);var t=e.__destroy_into_raw();$_.__wbg_set_project_project_settings(this.__wbg_ptr,t)}}Symbol.dispose&&(E.prototype[Symbol.dispose]=E.prototype.free);class T{static __wrap(e){e>>>=0;const t=Object.create(T.prototype);return t.__wbg_ptr=e,h_.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,h_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_projectlibrary_free(e,0)}get elements(){const e=$_.__wbg_get_projectlibrary_elements(this.__wbg_ptr);return a.__wrap(e)}set elements(e){C_(e,a);var t=e.__destroy_into_raw();$_.__wbg_set_projectlibrary_elements(this.__wbg_ptr,t)}}Symbol.dispose&&(T.prototype[Symbol.dispose]=T.prototype.free);class R{static __wrap(e){e>>>=0;const t=Object.create(R.prototype);return t.__wbg_ptr=e,y_.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,y_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_projectsettings_free(e,0)}get ai_settings(){const e=$_.__wbg_get_projectsettings_ai_settings(this.__wbg_ptr);return 0===e?void 0:_.__wrap(e)}get autosave_enabled(){return 0!==$_.__wbg_get_projectsettings_autosave_enabled(this.__wbg_ptr)}get autosave_interval_seconds(){const e=$_.__wbg_get_projectsettings_autosave_interval_seconds(this.__wbg_ptr);return 16777215===e?void 0:e}get description(){let e,t;try{const n=$_.__wbg_get_projectsettings_description(this.__wbg_ptr);return e=n[0],t=n[1],A_(n[0],n[1])}finally{$_.__wbindgen_free(e,t,1)}}get name(){let e,t;try{const n=$_.__wbg_get_projectsettings_name(this.__wbg_ptr);return e=n[0],t=n[1],A_(n[0],n[1])}finally{$_.__wbindgen_free(e,t,1)}}get root(){let e,t;try{const n=$_.__wbg_get_projectsettings_root(this.__wbg_ptr);return e=n[0],t=n[1],A_(n[0],n[1])}finally{$_.__wbindgen_free(e,t,1)}}get themes_settings(){const e=$_.__wbg_get_projectsettings_themes_settings(this.__wbg_ptr);return 0===e?void 0:L.__wrap(e)}get version(){let e,t;try{const n=$_.__wbg_get_projectsettings_version(this.__wbg_ptr);return e=n[0],t=n[1],A_(n[0],n[1])}finally{$_.__wbindgen_free(e,t,1)}}set ai_settings(e){let t=0;z_(e)||(C_(e,_),t=e.__destroy_into_raw()),$_.__wbg_set_projectsettings_ai_settings(this.__wbg_ptr,t)}set autosave_enabled(e){$_.__wbg_set_projectsettings_autosave_enabled(this.__wbg_ptr,e)}set autosave_interval_seconds(e){$_.__wbg_set_projectsettings_autosave_interval_seconds(this.__wbg_ptr,z_(e)?16777215:e)}set description(e){const t=X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_projectsettings_description(this.__wbg_ptr,t,n)}set name(e){const t=X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_projectsettings_name(this.__wbg_ptr,t,n)}set root(e){const t=X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_minaerror_msg(this.__wbg_ptr,t,n)}set themes_settings(e){let t=0;z_(e)||(C_(e,L),t=e.__destroy_into_raw()),$_.__wbg_set_projectsettings_themes_settings(this.__wbg_ptr,t)}set version(e){const t=X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_projectsettings_version(this.__wbg_ptr,t,n)}}Symbol.dispose&&(R.prototype[Symbol.dispose]=R.prototype.free);class C{static __wrap(e){e>>>=0;const t=Object.create(C.prototype);return t.__wbg_ptr=e,v_.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof C?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,v_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_relationship_free(e,0)}get base_data(){const e=$_.__wbg_get_container_base_data(this.__wbg_ptr);return o.__wrap(e)}get from(){const e=$_.__wbg_get_relationship_from(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get relationship_type(){return $_.__wbg_get_relationship_relationship_type(this.__wbg_ptr)}get technology(){const e=$_.__wbg_get_relationship_technology(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}get to(){const e=$_.__wbg_get_relationship_to(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}set base_data(e){C_(e,o);var t=e.__destroy_into_raw();$_.__wbg_set_container_base_data(this.__wbg_ptr,t)}set from(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_container_technology(this.__wbg_ptr,t,n)}set relationship_type(e){$_.__wbg_set_relationship_relationship_type(this.__wbg_ptr,z_(e)?0:R_(e))}set technology(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_relationship_technology(this.__wbg_ptr,t,n)}set to(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_relationship_to(this.__wbg_ptr,t,n)}}Symbol.dispose&&(C.prototype[Symbol.dispose]=C.prototype.free);class I{static __wrap(e){e>>>=0;const t=Object.create(I.prototype);return t.__wbg_ptr=e,S_.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof I?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,S_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_shape_free(e,0)}get position(){const e=$_.__wbg_get_shape_position(this.__wbg_ptr);return 0===e?void 0:x.__wrap(e)}get shape_type(){return $_.__wbg_get_shape_shape_type(this.__wbg_ptr)}get size(){const e=$_.__wbg_get_shape_size(this.__wbg_ptr);return 0===e?void 0:k.__wrap(e)}set position(e){let t=0;z_(e)||(C_(e,x),t=e.__destroy_into_raw()),$_.__wbg_set_shape_position(this.__wbg_ptr,t)}set shape_type(e){$_.__wbg_set_shape_shape_type(this.__wbg_ptr,z_(e)?0:R_(e))}set size(e){let t=0;z_(e)||(C_(e,k),t=e.__destroy_into_raw()),$_.__wbg_set_shape_size(this.__wbg_ptr,t)}}Symbol.dispose&&(I.prototype[Symbol.dispose]=I.prototype.free);class k{static __wrap(e){e>>>=0;const t=Object.create(k.prototype);return t.__wbg_ptr=e,O_.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,O_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_size_free(e,0)}get height(){const e=$_.__wbg_get_size_height(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}get scale_x(){const e=$_.__wbg_get_size_scale_x(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}get scale_y(){const e=$_.__wbg_get_size_scale_y(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}get width(){const e=$_.__wbg_get_size_width(this.__wbg_ptr);return 0===e[0]?void 0:e[1]}set height(e){$_.__wbg_set_size_height(this.__wbg_ptr,!z_(e),z_(e)?0:e)}set scale_x(e){$_.__wbg_set_size_scale_x(this.__wbg_ptr,!z_(e),z_(e)?0:e)}set scale_y(e){$_.__wbg_set_size_scale_y(this.__wbg_ptr,!z_(e),z_(e)?0:e)}set width(e){$_.__wbg_set_size_width(this.__wbg_ptr,!z_(e),z_(e)?0:e)}}Symbol.dispose&&(k.prototype[Symbol.dispose]=k.prototype.free);class D{static __wrap(e){e>>>=0;const t=Object.create(D.prototype);return t.__wbg_ptr=e,x_.register(t,t.__wbg_ptr,t),t}static __unwrap(e){return e instanceof D?e.__destroy_into_raw():0}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,x_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_softwaresystem_free(e,0)}get base_data(){const e=$_.__wbg_get_softwaresystem_base_data(this.__wbg_ptr);return o.__wrap(e)}get system_type(){return $_.__wbg_get_softwaresystem_system_type(this.__wbg_ptr)}set base_data(e){C_(e,o);var t=e.__destroy_into_raw();$_.__wbg_set_softwaresystem_base_data(this.__wbg_ptr,t)}set system_type(e){$_.__wbg_set_softwaresystem_system_type(this.__wbg_ptr,z_(e)?0:R_(e))}}Symbol.dispose&&(D.prototype[Symbol.dispose]=D.prototype.free);class L{static __wrap(e){e>>>=0;const t=Object.create(L.prototype);return t.__wbg_ptr=e,E_.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,E_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_themessettings_free(e,0)}get diagrams_theme_settings(){const e=$_.__wbg_get_themessettings_diagrams_theme_settings(this.__wbg_ptr);return 0===e?void 0:p.__wrap(e)}set diagrams_theme_settings(e){let t=0;z_(e)||(C_(e,p),t=e.__destroy_into_raw()),$_.__wbg_set_themessettings_diagrams_theme_settings(this.__wbg_ptr,t)}}Symbol.dispose&&(L.prototype[Symbol.dispose]=L.prototype.free);class N{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,T_.unregister(this),e}free(){const e=this.__destroy_into_raw();$_.__wbg_usersettings_free(e,0)}get git_path(){const e=$_.__wbg_get_usersettings_git_path(this.__wbg_ptr);let t;return 0!==e[0]&&(t=A_(e[0],e[1]).slice(),$_.__wbindgen_free(e[0],1*e[1],1)),t}set git_path(e){var t=z_(e)?0:X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),n=q_;$_.__wbg_set_diagramsthemesettings_bg_color_diagram(this.__wbg_ptr,t,n)}}function j(e,t){let n,_;try{const i=X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),a=q_,s=X_(t,$_.__wbindgen_malloc,$_.__wbindgen_realloc),l=q_,c=$_.diagram_plantuml_url_from_diagram_url(i,a,s,l);var r=c[0],o=c[1];if(c[3])throw r=0,o=0,Z_(c[2]);return n=r,_=o,A_(r,o)}finally{$_.__wbindgen_free(n,_,1)}}function A(e,t){let n,_;try{const i=X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),a=q_,s=X_(t,$_.__wbindgen_malloc,$_.__wbindgen_realloc),l=q_,c=$_.diagram_spec_url_from_diagram_url(i,a,s,l);var r=c[0],o=c[1];if(c[3])throw r=0,o=0,Z_(c[2]);return n=r,_=o,A_(r,o)}finally{$_.__wbindgen_free(n,_,1)}}function M(e,t){let n,_;try{const i=X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),a=q_,s=X_(t,$_.__wbindgen_malloc,$_.__wbindgen_realloc),l=q_,c=$_.diagram_url_from_link_string(i,a,s,l);var r=c[0],o=c[1];if(c[3])throw r=0,o=0,Z_(c[2]);return n=r,_=o,A_(r,o)}finally{$_.__wbindgen_free(n,_,1)}}function F(e,t,n,_){return $_.open_remote_diagram(e,t,n,_)}function P(e){let t,n;try{const _=X_(e,$_.__wbindgen_malloc,$_.__wbindgen_realloc),r=q_,o=$_.project_settings_url(_,r);return t=o[0],n=o[1],A_(o[0],o[1])}finally{$_.__wbindgen_free(t,n,1)}}function z(e,t){return Error(A_(e,t))}function B(e){return Number(e)}function W(e,t){const n=X_(String(t),$_.__wbindgen_malloc,$_.__wbindgen_realloc),_=q_;j_().setInt32(e+4,_,!0),j_().setInt32(e+0,n,!0)}function X(e,t){const n="bigint"==typeof t?t:void 0;j_().setBigInt64(e+8,z_(n)?BigInt(0):n,!0),j_().setInt32(e+0,!z_(n),!0)}function Z(e){const t="boolean"==typeof e?e:void 0;return z_(t)?16777215:t?1:0}function H(e,t){const n=X_(k_(t),$_.__wbindgen_malloc,$_.__wbindgen_realloc),_=q_;j_().setInt32(e+4,_,!0),j_().setInt32(e+0,n,!0)}function Y(e,t){return e in t}function U(e){return"bigint"==typeof e}function G(e){return"function"==typeof e}function $(e){return"object"==typeof e&&null!==e}function q(e){return"string"==typeof e}function V(e){return void 0===e}function J(e,t){return e===t}function K(e,t){return e==t}function Q(e,t){const n="number"==typeof t?t:void 0;j_().setFloat64(e+8,z_(n)?0:n,!0),j_().setInt32(e+0,!z_(n),!0)}function ee(e){throw e}function te(e,t){const n="string"==typeof t?t:void 0;var _=z_(n)?0:X_(n,$_.__wbindgen_malloc,$_.__wbindgen_realloc),r=q_;j_().setInt32(e+4,r,!0),j_().setInt32(e+0,_,!0)}function ne(e,t){throw new Error(A_(e,t))}function _e(e){e._wbg_cb_unref()}function re(e){e.abort()}function oe(e,t){e.abort(t)}function ie(){return P_((function(e,t,n,_){e.append(A_(t,n),_)}),arguments)}function ae(){return P_((function(e,t,n,_,r,o){e.append(A_(t,n),_,A_(r,o))}),arguments)}function se(){return P_((function(e,t,n,_,r){e.append(A_(t,n),A_(_,r))}),arguments)}function le(){return P_((function(e,t,n,_,r){e.append(A_(t,n),A_(_,r))}),arguments)}function ce(e){return e.arrayBuffer()}function de(){return P_((function(e){return e.arrayBuffer()}),arguments)}function ge(e){return i.__wrap(e)}function ue(e){return i.__unwrap(e)}function be(e){return e.buffer}function pe(e){const t=e.byobRequest;return z_(t)?0:R_(t)}function we(e){return e.byteLength}function me(e){return e.byteOffset}function fe(){return P_((function(e,t){return e.call(t)}),arguments)}function he(){return P_((function(e,t,n){return e.call(t,n)}),arguments)}function ye(e){return clearTimeout(e)}function ve(){return P_((function(e){e.close()}),arguments)}function Se(e){return e.close()}function Oe(){return P_((function(e){e.close()}),arguments)}function xe(e){return s.__wrap(e)}function Ee(e){return s.__unwrap(e)}function Te(e){return l.__wrap(e)}function Re(e){return l.__unwrap(e)}function Ce(e,t){return e.createWritable(t)}function Ie(e){console.debug(e)}function ke(e){return c.__wrap(e)}function De(e){return c.__unwrap(e)}function Le(e){return g.__wrap(e)}function Ne(e){return g.__unwrap(e)}function je(e){return e.done}function Ae(){return P_((function(e,t){e.enqueue(t)}),arguments)}function Me(e){return e.entries()}function Fe(e){return Object.entries(e)}function Pe(e,t){let n,_;try{n=e,_=t,console.error(A_(e,t))}finally{$_.__wbindgen_free(n,_,1)}}function ze(e){console.error(e)}function Be(e){return fetch(e)}function We(e,t){return e.fetch(t)}function Xe(e,t,n,_){return e.getDirectoryHandle(A_(t,n),_)}function Ze(e,t,n,_){return e.getFileHandle(A_(t,n),_)}function He(e){return e.getFile()}function Ye(){return P_((function(e,t){globalThis.crypto.getRandomValues(L_(e,t))}),arguments)}function Ue(){return P_((function(e,t,n,_){const r=t[A_(n,_)];var o=z_(r)?0:X_(r,$_.__wbindgen_malloc,$_.__wbindgen_realloc),i=q_;j_().setInt32(e+4,i,!0),j_().setInt32(e+0,o,!0)}),arguments)}function Ge(e,t){return e[t>>>0]}function $e(){return P_((function(e,t){return Reflect.get(e,t)}),arguments)}function qe(e,t){return e[t]}function Ve(){return P_((function(e,t){return Reflect.has(e,t)}),arguments)}function Je(e){return e.headers}function Ke(e){console.info(e)}function Qe(e){let t;try{t=e instanceof ArrayBuffer}catch(e){t=!1}return t}function et(e){let t;try{t=e instanceof Error}catch(e){t=!1}return t}function tt(e){let t;try{t=e instanceof FileSystemDirectoryHandle}catch(e){t=!1}return t}function nt(e){let t;try{t=e instanceof FileSystemFileHandle}catch(e){t=!1}return t}function _t(e){let t;try{t=e instanceof File}catch(e){t=!1}return t}function rt(e){let t;try{t=e instanceof Response}catch(e){t=!1}return t}function ot(e){let t;try{t=e instanceof Uint8Array}catch(e){t=!1}return t}function it(e){let t;try{t=e instanceof Window}catch(e){t=!1}return t}function at(e){return Array.isArray(e)}function st(e){return Number.isSafeInteger(e)}function lt(){return Symbol.iterator}function ct(e){return e.lastModified}function dt(e){return e.length}function gt(e){return e.length}function ut(){return P_((function(e){const t=e.localStorage;return z_(t)?0:R_(t)}),arguments)}function bt(e){console.log(e)}function pt(e){return e.message}function wt(e){return v.__wrap(e)}function mt(e,t){const n=X_(t.name,$_.__wbindgen_malloc,$_.__wbindgen_realloc),_=q_;j_().setInt32(e+4,_,!0),j_().setInt32(e+0,n,!0)}function ft(){return new Object}function ht(){return new Array}function yt(){return P_((function(){return new Headers}),arguments)}function vt(e,t){return new Error(A_(e,t))}function St(){return P_((function(){return new FormData}),arguments)}function Ot(){return new Error}function xt(e,t){try{var n={a:e,b:t};const _=new Promise(((e,t)=>{const _=n.a;n.a=0;try{return function(e,t,n,_){$_.wasm_bindgen__convert__closures_____invoke__h33bd8c776c9d6607(e,t,n,_)}(_,n.b,e,t)}finally{n.a=_}}));return _}finally{n.a=n.b=0}}function Et(){return P_((function(){return new AbortController}),arguments)}function Tt(){return new Map}function Rt(e){return new Uint8Array(e)}function Ct(e,t){return new Uint8Array(L_(e,t))}function It(e,t){return new Function(A_(e,t))}function kt(e,t,n){return new Uint8Array(e,t>>>0,n>>>0)}function Dt(){return P_((function(e,t,n){return new Request(A_(e,t),n)}),arguments)}function Lt(){return P_((function(e,t){return new Blob(e,t)}),arguments)}function Nt(){return P_((function(e){return e.next()}),arguments)}function jt(){return P_((function(e){return e.next()}),arguments)}function At(e){return e.next}function Mt(e){return S.__wrap(e)}function Ft(e){return S.__unwrap(e)}function Pt(e){return O.__wrap(e)}function zt(e){return O.__unwrap(e)}function Bt(){return P_((function(e,t){e.postMessage(t)}),arguments)}function Wt(e,t,n){Uint8Array.prototype.set.call(L_(e,t),n)}function Xt(e,t){return e.push(t)}function Zt(e){return e.queueMicrotask}function Ht(e){queueMicrotask(e)}function Yt(e){return C.__wrap(e)}function Ut(e){return C.__unwrap(e)}function Gt(e,t,n,_){return e.removeEntry(A_(t,n),_)}function $t(e,t,n){return e.removeEntry(A_(t,n))}function qt(e){return Promise.resolve(e)}function Vt(){return P_((function(e,t){e.respond(t>>>0)}),arguments)}function Jt(){return P_((function(e,t){return e.seek(t)}),arguments)}function Kt(e,t){return setTimeout(e,t)}function Qt(e,t,n){return e.set(t,n)}function en(e,t,n){e[t]=n}function tn(){return P_((function(e,t,n,_,r){e[A_(t,n)]=A_(_,r)}),arguments)}function nn(e,t){e.body=t}function _n(e,t){e.cache=Gn[t]}function rn(e,t,n){e.set(L_(t,n))}function on(e,t){e.create=0!==t}function an(e,t){e.create=0!==t}function sn(e,t){e.credentials=$n[t]}function ln(e,t,n){e[t>>>0]=n}function cn(e,t){e.headers=t}function dn(e,t){e.keepExistingData=0!==t}function gn(e,t,n){e.method=A_(t,n)}function un(e,t){e.mode=qn[t]}function bn(e,t){e.recursive=0!==t}function pn(e,t){e.signal=t}function wn(e,t,n){e.type=A_(t,n)}function mn(e){return I.__wrap(e)}function fn(e){return I.__unwrap(e)}function hn(e){return e.signal}function yn(e){return e.size}function vn(e){return D.__wrap(e)}function Sn(e){return D.__unwrap(e)}function On(e,t){const n=X_(t.stack,$_.__wbindgen_malloc,$_.__wbindgen_realloc),_=q_;j_().setInt32(e+4,_,!0),j_().setInt32(e+0,n,!0)}function xn(){const e=void 0===n.g?null:n.g;return z_(e)?0:R_(e)}function En(){const e="undefined"==typeof globalThis?null:globalThis;return z_(e)?0:R_(e)}function Tn(){const e="undefined"==typeof self?null:self;return z_(e)?0:R_(e)}function Rn(){const e="undefined"==typeof window?null:window;return z_(e)?0:R_(e)}function Cn(e){return e.status}function In(){return P_((function(e){return JSON.stringify(e)}),arguments)}function kn(e){return e.text()}function Dn(e,t,n){return e.then(t,n)}function Ln(e,t){return e.then(t)}function Nn(e,t){const n=X_(t.url,$_.__wbindgen_malloc,$_.__wbindgen_realloc),_=q_;j_().setInt32(e+4,_,!0),j_().setInt32(e+0,n,!0)}function jn(e){return e.value}function An(e){const t=e.view;return z_(t)?0:R_(t)}function Mn(e){console.warn(e)}function Fn(){return P_((function(e,t){return e.write(t)}),arguments)}function Pn(e,t){return B_(e,t,$_.wasm_bindgen__closure__destroy__hbeedb0fccc75a309,Yn)}function zn(e,t){return B_(e,t,$_.wasm_bindgen__closure__destroy__ha2db632fab222612,Hn)}function Bn(e){return e}function Wn(e,t){return A_(e,t)}function Xn(e){return BigInt.asUintN(64,e)}function Zn(){const e=$_.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}function Hn(e,t){$_.wasm_bindgen__convert__closures_____invoke__h753dea23332c87b4(e,t)}function Yn(e,t,n){$_.wasm_bindgen__convert__closures_____invoke__h410084c9c93c07b1(e,t,n)}Symbol.dispose&&(N.prototype[Symbol.dispose]=N.prototype.free);const Un=["bytes"],Gn=["default","no-store","reload","no-cache","force-cache","only-if-cached"],$n=["omit","same-origin","include"],qn=["same-origin","no-cors","cors","navigate"],Vn="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_aisettings_free(e>>>0,1))),Jn="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_addelementtag_free(e>>>0,1))),Kn="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_baseelement_free(e>>>0,1))),Qn="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_boundary_free(e>>>0,1))),e_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_c4elements_free(e>>>0,1))),t_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_component_free(e>>>0,1))),n_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_container_free(e>>>0,1))),__="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_deploymentnode_free(e>>>0,1))),r_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_diagram_free(e>>>0,1))),o_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_diagramelementspec_free(e>>>0,1))),i_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_diagramplantuml_free(e>>>0,1))),a_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_diagramspec_free(e>>>0,1))),s_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_diagramsthemesettings_free(e>>>0,1))),l_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_elementdata_free(e>>>0,1))),c_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_hookpayload_free(e>>>0,1))),d_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_intounderlyingbytesource_free(e>>>0,1))),g_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_intounderlyingsink_free(e>>>0,1))),u_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_intounderlyingsource_free(e>>>0,1))),b_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_minaerror_free(e>>>0,1))),p_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_person_free(e>>>0,1))),w_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_point_free(e>>>0,1))),m_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_position_free(e>>>0,1))),f_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_project_free(e>>>0,1))),h_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_projectlibrary_free(e>>>0,1))),y_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_projectsettings_free(e>>>0,1))),v_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_relationship_free(e>>>0,1))),S_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_shape_free(e>>>0,1))),O_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_size_free(e>>>0,1))),x_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_softwaresystem_free(e>>>0,1))),E_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_themessettings_free(e>>>0,1))),T_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>$_.__wbg_usersettings_free(e>>>0,1)));function R_(e){const t=$_.__externref_table_alloc();return $_.__wbindgen_externrefs.set(t,e),t}function C_(e,t){if(!(e instanceof t))throw new Error(`expected instance of ${t.name}`)}const I_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>e.dtor(e.a,e.b)));function k_(e){const t=typeof e;if("number"==t||"boolean"==t||null==e)return`${e}`;if("string"==t)return`"${e}"`;if("symbol"==t){const t=e.description;return null==t?"Symbol":`Symbol(${t})`}if("function"==t){const t=e.name;return"string"==typeof t&&t.length>0?`Function(${t})`:"Function"}if(Array.isArray(e)){const t=e.length;let n="[";t>0&&(n+=k_(e[0]));for(let _=1;_<t;_++)n+=", "+k_(e[_]);return n+="]",n}const n=/\[object ([^\]]+)\]/.exec(toString.call(e));let _;if(!(n&&n.length>1))return toString.call(e);if(_=n[1],"Object"==_)try{return"Object("+JSON.stringify(e)+")"}catch(e){return"Object"}return e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:_}function D_(e,t){e>>>=0;const n=j_(),_=[];for(let r=e;r<e+4*t;r+=4)_.push($_.__wbindgen_externrefs.get(n.getUint32(r,!0)));return $_.__externref_drop_slice(e,t),_}function L_(e,t){return e>>>=0,F_().subarray(e/1,e/1+t)}let N_=null;function j_(){return(null===N_||!0===N_.buffer.detached||void 0===N_.buffer.detached&&N_.buffer!==$_.memory.buffer)&&(N_=new DataView($_.memory.buffer)),N_}function A_(e,t){return function(e,t){return U_+=t,U_>=Y_&&(H_=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),H_.decode(),U_=t),H_.decode(F_().subarray(e,e+t))}(e>>>=0,t)}let M_=null;function F_(){return null!==M_&&0!==M_.byteLength||(M_=new Uint8Array($_.memory.buffer)),M_}function P_(e,t){try{return e.apply(this,t)}catch(e){const t=R_(e);$_.__wbindgen_exn_store(t)}}function z_(e){return null==e}function B_(e,t,n,_){const r={a:e,b:t,cnt:1,dtor:n},o=(...e)=>{r.cnt++;const t=r.a;r.a=0;try{return _(t,r.b,...e)}finally{r.a=t,o._wbg_cb_unref()}};return o._wbg_cb_unref=()=>{0==--r.cnt&&(r.dtor(r.a,r.b),r.a=0,I_.unregister(r))},I_.register(o,r,r),o}function W_(e,t){const n=t(4*e.length,4)>>>0;for(let t=0;t<e.length;t++){const _=R_(e[t]);j_().setUint32(n+4*t,_,!0)}return q_=e.length,n}function X_(e,t,n){if(void 0===n){const n=G_.encode(e),_=t(n.length,1)>>>0;return F_().subarray(_,_+n.length).set(n),q_=n.length,_}let _=e.length,r=t(_,1)>>>0;const o=F_();let i=0;for(;i<_;i++){const t=e.charCodeAt(i);if(t>127)break;o[r+i]=t}if(i!==_){0!==i&&(e=e.slice(i)),r=n(r,_,_=i+3*e.length,1)>>>0;const t=F_().subarray(r+i,r+_);i+=G_.encodeInto(e,t).written,r=n(r,_,i,1)>>>0}return q_=i,r}function Z_(e){const t=$_.__wbindgen_externrefs.get(e);return $_.__externref_table_dealloc(e),t}let H_=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});H_.decode();const Y_=2146435072;let U_=0;const G_=new TextEncoder;"encodeInto"in G_||(G_.encodeInto=function(e,t){const n=G_.encode(e);return t.set(n),{read:e.length,written:n.length}});let $_,q_=0;function V_(e){$_=e}},489(e){e.exports=require("fabric")},507(e,t,n){n.a(e,(async(e,_)=>{try{n.d(t,{wS:()=>s});var r=n(519),o=e([r]),i=o.then?(await o)():o;async function a(e,t){if(t){const n="https://keadex.dev/api/download-gh-raw-file",_={headers:{"Keadex-Gh-Url":e}};return t&&(_.headers["Keadex-Gh-Authorization"]=t),await fetch(n,_)}return await fetch(e)}async function s(e,t,n){let _,o,i;try{_=(0,r._C)(e),o=(0,r.Ll)(e,t),i=(0,r.JD)(e,t)}catch(e){throw console.error(e),new Error("Invalid URL: the provided URL is an invalid Mina project or diagram.")}if(_&&o&&i){let e,t,r;try{const s=await a(_,n),l=await a(o,n),c=await a(i,n);if(s.ok&&l.ok&&c.ok)return e=await s.text(),t=await l.text(),r=await c.text(),{projectSettingsJson:e,plantuml:t,spec:r};throw new Error}catch(e){throw console.error(e),new Error("Diagram or project settings not found. Please verify the URLs provided, or, if linking to a private repository, ensure the GitHub token is configured.")}}}r=i[0],_()}catch(l){_(l)}}))},519(e,t,n){n.a(e,(async(e,_)=>{try{n.d(t,{JD:()=>o.JD7,Ll:()=>o.Llp,Ox:()=>o.Oxg,_C:()=>o._Cc,qj:()=>o.qjW});var r=n(196),o=n(457),i=e([r]);r=(i.then?(await i)():i)[0],(0,o.lIU)(r),r.__wbindgen_start(),_()}catch(e){_(e)}}))},644(e,t,n){function _(e,t){if(null==e)return{};var n={};for(var _ in e)if({}.hasOwnProperty.call(e,_)){if(-1!==t.indexOf(_))continue;n[_]=e[_]}return n}n.d(t,{A:()=>_})},691(e){e.exports=require("ts-key-enum")},693(e){e.exports=require("tailwind-merge")},732(e){e.exports=require("react/jsx-runtime")},735(e){e.exports=require("react-hotkeys-hook")},764(e,t,n){n.d(t,{D:()=>_n});var _=n(644);const r=["TopToBottom","LeftToRight"],o=["https://","http://"];let i=function(e){return e.Alias="Alias",e}({});const a="object:modified",s="mouseup",l="modified",c="selected",d="deselected",g="#FFFFFF",u="#000000",b=12,p=10,w=20,m=20,f=120,h=20,y=10,v={SIZES:{DEFAULT_TOP:w+h,DEFAULT_LEFT:m+f+50,BORDER_WIDTH:1},FONT:{FAMILY:"Roboto"}},S={COLORS:{BG_COLOR_SOFTWARE_SYSTEM_PERSON:"#1168BD",BG_COLOR_CONTAINER:"#438DD5",BG_COLOR_COMPONENT:"#85BBF0",BG_COLOR_SOFTWARE_SYSTEM_PERSON_EXT:"#686868",BG_COLOR_CONTAINER_EXT:"#999999",BG_COLOR_COMPONENT_EXT:"#CCCCCC",BG_COLOR_BOUNDARY:g,BG_COLOR_DEPLOYMENT_NODE:g,BORDER_COLOR_SOFTWARE_SYSTEM_PERSON:"#0F5BA6",BORDER_COLOR_CONTAINER:"#3E84C7",BORDER_COLOR_COMPONENT:"#7BADDE",BORDER_COLOR_SOFTWARE_SYSTEM_PERSON_EXT:"#525252",BORDER_COLOR_CONTAINER_EXT:"#8A8A8A",BORDER_COLOR_COMPONENT_EXT:"#BDBDBD",BORDER_COLOR_BOUNDARY:"#666666",BORDER_COLOR_DEPLOYMENT_NODE:"#666666",TEXT_COLOR_SOFTWARE_SYSTEM_PERSON:"#FFFFFF",TEXT_COLOR_CONTAINER:"#FFFFFF",TEXT_COLOR_COMPONENT:"#000000",TEXT_COLOR_SOFTWARE_SYSTEM_PERSON_EXT:"#FFFFFF",TEXT_COLOR_CONTAINER_EXT:"#FFFFFF",TEXT_COLOR_COMPONENT_EXT:"#000000",TEXT_COLOR_BOUNDARY:"#333333",TEXT_COLOR_DEPLOYMENT_NODE:"#333333"},SIZES:{WIDTH:220,MIN_HEIGHT:100,PADDING_BOTTOM:15,BORDER_RADIUS:10,TOP_LABEL:20,TOP_TAGS:5,TOP_TYPE_TECHNOLOGY:2,TOP_DESCRIPTION:25,PADDING_Y_DESCRIPTION:10},FONT:{SIZE:14,SIZE_TAG:12,SIZE_TYPE_TECHNOLOGY:12,SIZE_DESCRIPTION:10}},O={SIZES:{SCALE_Y_TAIL_HEAD:.3,HEAD_BOX_WIDTH:20,RADIUS_TAIL_HEAD:S.SIZES.MIN_HEIGHT/2-v.SIZES.BORDER_WIDTH/2,SCALED_RADIUS_TAIL_HEAD:1/0,WIDTH_TAIL:1/0,WIDTH_HEAD:1/0}};O.SIZES.SCALED_RADIUS_TAIL_HEAD=O.SIZES.RADIUS_TAIL_HEAD*O.SIZES.SCALE_Y_TAIL_HEAD,O.SIZES.WIDTH_TAIL=O.SIZES.SCALED_RADIUS_TAIL_HEAD,O.SIZES.WIDTH_HEAD=O.SIZES.HEAD_BOX_WIDTH+O.SIZES.SCALED_RADIUS_TAIL_HEAD;const x={SIZES:{SCALE_X_TOP_BOTTOM:.15,TOP_BOX_HEIGHT:14,RADIUS_TOP_BOTTOM:S.SIZES.WIDTH/2-v.SIZES.BORDER_WIDTH/2,SCALED_RADIUS_TOP_BOTTOM:1/0,WIDTH_TOP:1/0,WIDTH_BOTTOM:1/0}};x.SIZES.SCALED_RADIUS_TOP_BOTTOM=x.SIZES.RADIUS_TOP_BOTTOM*x.SIZES.SCALE_X_TOP_BOTTOM,x.SIZES.WIDTH_TOP=x.SIZES.TOP_BOX_HEIGHT+x.SIZES.SCALED_RADIUS_TOP_BOTTOM,x.SIZES.WIDTH_BOTTOM=x.SIZES.SCALED_RADIUS_TOP_BOTTOM;const E="rgba(0,0,0,0)",T="#828282",R="#404040",C="#ff8f26",I=10,k=10,D=3,L=3,N=9,j=1,A=2,M=90,F=40,P=45,z=10,B=10,W=150,X=80,Z=10,H={SIZES:{STROKE_DASH_ARRAY:[5,5]}},Y={'"dashed"':{name:'"dashed"',value:[8,5]}};var U=n(454),G=n(423),$=(n(452),n(768)),q=n(489);function V(e){try{return`Open Link ${new URL(e).host.replace("www.","")}`}catch(e){return"Open Link"}}function J(e){return`<${e.toString().toUpperCase()}>`}function K(e,t=!0,n){var _,r,o,i;let a,s,l,c;return e.forEach((e=>{if(e.visible){const _=e.getBoundingRect(!1,!0),r=t?e.getBoundingRect(!0,!1):_;let o=r.left,i=r.top;if(n&&o&&i){const e=fabric.util.transformPoint(new fabric.Point(o,i),n);o=e.x,i=e.y}(void 0===a||o<a)&&(a=o),void 0!==o&&void 0!==_.width&&(void 0===s||o+_.width>s)&&(s=o+_.width),(void 0===c||void 0!==i&&i<c)&&(c=i),void 0!==i&&void 0!==_.height&&(void 0===l||_.height+i>l)&&(l=i+_.height)}})),{left:a,right:s,top:c,bottom:l,width:(null!=(_=s)?_:0)-(null!=(r=a)?r:0),height:(null!=(o=l)?o:0)-(null!=(i=c)?i:0)}}function Q(e,t){let n=-1;return e&&(n=e.getObjects().indexOf(t)),-1!==n?n:void 0}function ee(e,t,n=Number.MAX_SAFE_INTEGER){let _=n;return t.forEach((t=>{const n=Q(e,t);void 0!==n&&n<_&&(_=n)})),_!==Number.MAX_SAFE_INTEGER?_:void 0}function te(e,t=!0){let n=[];return e&&e.forEach((e=>{(e.visible||!e.visible&&t)&&n.push(e),e.children&&(n=n.concat(te(e.children,t)))})),n}function ne(e){let t=0,n=0;if(e){const _=e.viewportTransform;t=_?_[4]:0,n=_?_[5]:0}return{panX:t,panY:n}}function _e(e){var t;const n=e.parent,_=function(e){let t=[];const n=new Set;if(e){let _=[];e.forEach((e=>{const t=e.getVirtualGroupRoot();t&&n.add(t)})),n.forEach((e=>{var t;_=_.concat(te(null!=(t=e.children)?t:[],!0))})),t=e.filter((e=>!_.includes(e)))}return{filteredObjects:t,virtualGroupsRoots:n}}(null==(t=e.canvas)?void 0:t.getActiveObjects());let r,o;if(_.filteredObjects.length>0||_.virtualGroupsRoots.size>1){let e=_.filteredObjects;_.virtualGroupsRoots.forEach((t=>{var n;return e=e.concat(te(null!=(n=t.children)?n:[],!1))})),r=e,o="multiple"}else{var i;r=te(null!=(i=null==n?void 0:n.children)?i:[],!1),o="single"}return{objects:r,type:o}}function re(e,t){var n,_;return(null==e?void 0:e.length)===(null==t?void 0:t.length)&&(null!=(n=null==e?void 0:e.map((e=>{var t;return null!=(t=e.name)?t:"undefined"})))?n:[]).sort().join(",")===(null!=(_=null==t?void 0:t.map((e=>{var t;return null!=(t=e.name)?t:"undefined"})))?_:[]).sort().join(",")}q.fabric.ActiveSelection.prototype._controlsVisibility={tl:!0,tr:!0,br:!0,bl:!0,ml:!1,mt:!1,mr:!1,mb:!1,mtr:!1},q.fabric.Object.prototype.isVirtualGroupParent=function(){return void 0!==this.children&&this.children.length>0},q.fabric.Object.prototype.isVirtualGroupChild=function(){return void 0!==this.parent},q.fabric.Object.prototype.isVirtualGroupRoot=function(){return this.isVirtualGroupParent()&&void 0===this.parent},q.fabric.Object.prototype.isVirtualGroupLeaf=function(){return this.isVirtualGroupChild()&&!this.isVirtualGroupParent()},q.fabric.Object.prototype.isVirtualGroupBaseShape=function(){return this.isVirtualGroupChild()&&this.parent.children[0]===this},q.fabric.Object.prototype.getVirtualGroupRoot=function(){let e=this.parent;for(;e&&e.parent;)e=e.parent;return e};class oe extends q.fabric.Point{constructor(e,t,n){super(e,t),this.customType=void 0,this.data=void 0,this.customType=n}}class ie extends q.fabric.ActiveSelection{}const ae=e=>"getUpdatedSpecs"in e;class se extends q.fabric.Group{constructor(e,t,n,_,r,o,i,a,l=!1){var c,d,g,u,b,p,w,m,f,h,y;super(r,Object.assign({data:{rawDiagramElementSpec:t,rawData:e,rawAutoLayout:_},name:null!=(c=n.alias)?c:"undefined",left:void 0!==(null==t||null==(d=t.position)?void 0:d.left)?null==t||null==(g=t.position)?void 0:g.left:null==(u=n.position)?void 0:u.left,top:void 0!==(null==t||null==(b=t.position)?void 0:b.top)?null==t||null==(p=t.position)?void 0:p.top:null==(w=n.position)?void 0:w.top,scaleX:void 0!==(null==t||null==(m=t.size)?void 0:m.scale_x)?null==t||null==(f=t.size)?void 0:f.scale_x:1,scaleY:void 0!==(null==t||null==(h=t.size)?void 0:h.scale_y)?null==t||null==(y=t.size)?void 0:y.scale_y:1},o)),this.parent=i,this.children=null!=a?a:[],this.setControlsVisibility({mb:!1,ml:!1,mr:!1,mt:!1,mtr:!1}),l||this.on(s,(e=>{var t;this.onComponentMouseUp(null==(t=e.target)?void 0:t.canvas,e,this)}))}getUpdatedSpecs(){var e,t;null==(e=this.canvas)||e.discardActiveObject();const n=null==(t=this.data)?void 0:t.rawDiagramElementSpec;if(n){var _,r,o,i,a,s,l,c,d,g,u,b,p,w,m,f;const e=(0,U.mg)(n);return e.position={left:null!=(_=this.left)?_:null==(r=n.position)?void 0:r.left,top:null!=(o=this.top)?o:null==(i=n.position)?void 0:i.top,z_index:null!=(a=Q(this.canvas,this))?a:null==(s=n.position)?void 0:s.z_index,angle:null!=(l=this.angle)?l:null==(c=n.position)?void 0:c.angle},e.size={width:null!=(d=this.width)?d:null==(g=n.size)?void 0:g.width,height:null!=(u=this.height)?u:null==(b=n.size)?void 0:b.height,scale_x:null!=(p=this.scaleX)?p:null==(w=n.size)?void 0:w.scale_x,scale_y:null!=(m=this.scaleY)?m:null==(f=n.size)?void 0:f.scale_y},e}}onComponentMouseUp(e,t,n,_){if(e)switch(t.e.preventDefault(),t.button){case 3:{e.setActiveObject(n),e.renderAll();const r=e.contextTop,o=q.fabric.util.getPointer(t.e,r.canvas),i=new CustomEvent($.UW.CONTEXT_MENU,{detail:{sourceEvent:t,pageX:o.x,pageY:o.y,menuItems:null!=_?_:le(e,t,n)}});document.dispatchEvent(i);break}}}}const le=(e,t,n,_=!0)=>{var r,s,l,c;const d=[],g=n instanceof ie?n.parent:n,u=null==g?void 0:g.data,b=null==u||null==(r=u.rawDiagramElementSpec)?void 0:r.element_type,p=null==u||null==(s=u.rawData)||null==(s=s.base_data)||null==(s=s.link)?void 0:s.split(";"),w=e.isReadOnly(),m=e.codingFeaturesEnabled,f=void 0!==b&&p&&p.length>0&&void 0!==(ve(h=b)||me(h)||we(h)||pe(h));var h;let y=0,v=null==g?void 0:g.parent;for(;v;){var S;y++,v=null==(S=v)?void 0:S.parent}return f&&p.forEach(((t,n)=>{const _=t.replace(/ /gi,"");_.length>0&&(function(e){return o.some((t=>e.startsWith(t)))}(_)?d.push({isHeaderMenuItem:!1,id:`openLink${n}`,label:V(_),onClick:()=>{e.diagramListener&&e.diagramListener.onOpenExternalLinkClick(function(e,t){let n=`${e}`;for(const e in i){var _;e===i.Alias.toString()&&n.includes(J(i.Alias))&&null!=t&&null!=(_=t.base_data)&&_.alias&&(n=n.replace(new RegExp(J(i.Alias),"gi"),t.base_data.alias))}return n}(_,null==u?void 0:u.rawData))}}):d.push({isHeaderMenuItem:!1,id:"openDiagram",label:"Open Diagram",onClick:()=>{e.diagramListener&&e.diagramListener.onOpenDiagramClick(_)}}))})),m&&null!=u&&u.rawData&&null!=(l=u.rawDiagramElementSpec)&&l.element_type&&d.push({isHeaderMenuItem:!1,id:"selectDiagramElementCode",label:"Select code",onClick:()=>{var t;null!=(t=e.diagramListener)&&t.onSelectElementCode&&e.diagramListener.onSelectElementCode(u.rawData,u.rawDiagramElementSpec.element_type,y)}}),!w&&(f||m&&null!=u&&u.rawData&&null!=(c=u.rawDiagramElementSpec)&&c.element_type)&&d.push({id:"separatorCommon",isSepator:!0}),w||d.push({isHeaderMenuItem:!1,id:"bringToFront",label:"Bring to Front",onClick:()=>{var e;n.bringToFront(),null==(e=n.canvas)||e.fire(a)}},{isHeaderMenuItem:!1,id:"bringForward",label:"Bring Forward",onClick:()=>{var e;n.bringForward(),null==(e=n.canvas)||e.fire(a)}},{isHeaderMenuItem:!1,id:"sentToBack",label:"Send to Back",onClick:()=>ce(n)},{isHeaderMenuItem:!1,id:"sendBackwards",label:"Send Backwards",onClick:()=>de(n)}),_?[{isHeaderMenuItem:!0,id:"baseComponentContextMenu",label:"",hidden:!0,alwaysOpen:!0,subMenuItems:d}]:d},ce=e=>{var t;e.parent||(e.sendToBack(),null==(t=e.canvas)||t.fire(a))},de=e=>{if(e instanceof ie){var t,n,_;const o=e.parent,i=ee(e.canvas,null!=(t=null==o?void 0:o.children)?t:[]),s=ee(e.canvas,null!=(n=null==o||null==(_=o.parent)?void 0:_.children)?n:[]);var r;void 0===s||void 0===i||i-1>s?(e.sendBackwards(),null==(r=e.canvas)||r.fire(a)):console.debug(`cannot send backwards ${i} ${s}`)}else{var o,i;const t=Q(e.canvas,e),n=ee(e.canvas,null!=(o=null==(i=e.parent)?void 0:i.children)?o:[]);var s;void 0===n||void 0===t||t-1>n?(e.sendBackwards(),null==(s=e.canvas)||s.fire(a)):console.debug(`cannot send backwards ${t} ${n}`)}},ge=(e,t,n,_,r)=>ue(e,t,n,_,r.elements_specs)||be(e,t,n,_),ue=(e,t,n,_,r)=>{for(let o=0;o<r.length;o++){const i=r[o],a=i.alias===e,s=(0,U.$r)(i.element_type,_);if(a&&s)return i;if(i.inner_specs){const r=i.inner_specs,o=ue(e,t,n,_,r);if(o)return o}}},be=(e,t,n,_)=>({alias:e,from:t,to:n,element_type:_}),pe=e=>{if("Boundary"in e)return e.Boundary},we=e=>{if("Component"in e)return e.Component},me=e=>{if("Container"in e)return e.Container},fe=e=>{if("DeploymentNode"in e)return e.DeploymentNode},he=e=>{if("Person"in e)return e.Person},ye=e=>{if("Relationship"in e)return e.Relationship},ve=e=>{if("SoftwareSystem"in e)return e.SoftwareSystem},Se=(e,t)=>{var n,_,r;return e&&null!=(n=t[e])&&n.position?{left:null==(_=t[e].position)?void 0:_.x,top:null==(r=t[e].position)?void 0:r.y}:{left:v.SIZES.DEFAULT_LEFT,top:v.SIZES.DEFAULT_TOP}};function Oe(e){return btoa(e)}const xe="_margin_hack";function Ee(e,t,n){return 2===n.length?n.map(((n,_)=>{const r=0===_?(0,U.qI)(e.x):(0,U.qI)(e.y),o=0===_?n:t-n;return(0,U.cr)(o,Te)+r})):n}const Te=96,Re=(0,U.wF)(v.SIZES.DEFAULT_LEFT),Ce=(0,U.wF)(v.SIZES.DEFAULT_TOP),Ie=4.5;function ke(e){const t={x:S.SIZES.WIDTH,y:S.SIZES.MIN_HEIGHT+2*P},n={x:S.SIZES.WIDTH,y:S.SIZES.MIN_HEIGHT},_={x:S.SIZES.WIDTH+O.SIZES.WIDTH_TAIL+O.SIZES.WIDTH_HEAD,y:S.SIZES.MIN_HEIGHT},r={x:S.SIZES.WIDTH,y:S.SIZES.MIN_HEIGHT+x.SIZES.WIDTH_TOP+x.SIZES.WIDTH_BOTTOM};if(he(e))return t;if(ve(e)){const t=ve(e);return"SystemDb"===t.system_type||"SystemDb_Ext"===t.system_type?r:"SystemQueue"===t.system_type||"SystemQueue_Ext"===t.system_type?_:n}if(me(e)){const t=me(e);return"ContainerDb"===t.container_type||"ContainerDb_Ext"===t.container_type?r:"ContainerQueue"===t.container_type||"ContainerQueue_Ext"===t.container_type?_:n}if(we(e)){const t=we(e);return"ComponentDb"===t.component_type||"ComponentDb_Ext"===t.component_type?r:"ComponentQueue"===t.component_type||"ComponentQueue_Ext"===t.component_type?_:n}return{x:100,y:100}}function De(e,t,n,_,r){return`\n subgraph "${o=e,`${o}${xe}`}" {\n cluster=true\n margin="${r}"\n fontsize="0pt"\n label=""\n subgraph "${e}" {\n cluster=true\n margin="${_}"\n label=" "\n labelloc="b"\n fontsize="17pt"\n "${e}" [peripheries=0, height=0, width=0, label=""] // invisible node that is used as a workaround to let the connection between nodes and subgraphs\n ${Le(t,n,_,r)}\n }\n }\n `;var o}function Le(e,t,n,_){let r="";for(const a of e){const e=ke(a);let s;if(he(a))s=he(a).base_data.alias;else if(ve(a))s=ve(a).base_data.alias;else if(me(a))s=me(a).base_data.alias;else if(we(a))s=we(a).base_data.alias;else if(pe(a)){const e=pe(a);s=e.base_data.alias,s&&(t.add(s),r=r.concat(De(s,e.sub_elements,t,n,_))),s=void 0}else if(fe(a)){const e=fe(a);s=e.base_data.alias,s&&(t.add(s),r=r.concat(De(s,e.sub_elements,t,n,_))),s=void 0}else if(ye(a)){const e=ye(a);var o,i;e.from&&e.to&&(r=r.concat(`\n"${e.from}" -> "${e.to}" [name="${e.base_data.alias}", xlabel="${(0,U.l)([null!=(o=e.base_data.label)?o:"",null!=(i=e.technology)?i:""])}", ltail="${e.from}", lhead="${e.to}", fontsize="${I}", keadex_fromissubgraph=${t.has(e.from)}, keadex_toissubgraph=${t.has(e.to)}]`)),s=void 0}s&&(r=r.concat(`\n"${s}" [width=${(0,U.wF)(e.x,Te)}, height=${(0,U.wF)(e.y,Te)}, peripheries=2]`))}return r}const Ne=require("@hpcc-js/wasm-graphviz"),je=require("react-toastify");function Ae(e){if(e)return Y[e]}const Me="legend",Fe=(e,t,n,_,r,o)=>{var i,a,s;const l=[],c=n?1:0,d=new q.fabric.Rect({fill:t,stroke:n,strokeWidth:c,strokeDashArray:_,left:m,top:w+h*o,width:f-c,height:h-c});l.push(d);const g=new q.fabric.Text(e,{fill:r,fontFamily:v.FONT.FAMILY,fontSize:p,fontWeight:"normal",textAlign:"left",originX:"left",originY:"top",left:m+y});return g.top=(null!=(i=d.top)?i:0)+(null!=(a=d.height)?a:0)/2-(null!=(s=g.height)?s:0)/2,l.push(g),l},Pe=(e,t)=>{var n,_,r,o,i,a,s,l,c,d,g,p,f,h,y,O,x,E,T,R,C,I,k,D,L,N,j,A,M,F,P,z,B,W;let X=[];const Z=new q.fabric.Text("LEGEND",{fill:u,fontFamily:v.FONT.FAMILY,fontSize:b,fontWeight:"bold",textAlign:"left",originX:"left",originY:"top",left:m,top:w});X.push(Z),X=X.concat(Fe("Person",null!=(n=null==t||null==(_=t.diagramsThemeSettings)?void 0:_.bg_color_person)?n:S.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON,void 0,void 0,null!=(r=null==t||null==(o=t.diagramsThemeSettings)?void 0:o.text_color_person)?r:S.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON,1)),X=X.concat(Fe("Person External",null!=(i=null==t||null==(a=t.diagramsThemeSettings)?void 0:a.bg_color_person_ext)?i:S.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,void 0,void 0,null!=(s=null==t||null==(l=t.diagramsThemeSettings)?void 0:l.text_color_person_ext)?s:S.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,2)),X=X.concat(Fe("System",null!=(c=null==t||null==(d=t.diagramsThemeSettings)?void 0:d.bg_color_software_system)?c:S.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON,void 0,void 0,null!=(g=null==t||null==(p=t.diagramsThemeSettings)?void 0:p.text_color_software_system)?g:S.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON,3)),X=X.concat(Fe("System External",null!=(f=null==t||null==(h=t.diagramsThemeSettings)?void 0:h.bg_color_software_system_ext)?f:S.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,void 0,void 0,null!=(y=null==t||null==(O=t.diagramsThemeSettings)?void 0:O.text_color_software_system_ext)?y:S.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,4)),X=X.concat(Fe("Container",null!=(x=null==t||null==(E=t.diagramsThemeSettings)?void 0:E.bg_color_container)?x:S.COLORS.BG_COLOR_CONTAINER,void 0,void 0,null!=(T=null==t||null==(R=t.diagramsThemeSettings)?void 0:R.text_color_container)?T:S.COLORS.TEXT_COLOR_CONTAINER,5)),X=X.concat(Fe("Container External",null!=(C=null==t||null==(I=t.diagramsThemeSettings)?void 0:I.bg_color_container_ext)?C:S.COLORS.BG_COLOR_CONTAINER_EXT,void 0,void 0,null!=(k=null==t||null==(D=t.diagramsThemeSettings)?void 0:D.text_color_container_ext)?k:S.COLORS.TEXT_COLOR_CONTAINER_EXT,6)),X=X.concat(Fe("Component",null!=(L=null==t||null==(N=t.diagramsThemeSettings)?void 0:N.bg_color_component)?L:S.COLORS.BG_COLOR_COMPONENT,void 0,void 0,null!=(j=null==t||null==(A=t.diagramsThemeSettings)?void 0:A.text_color_component)?j:S.COLORS.TEXT_COLOR_COMPONENT,7)),X=X.concat(Fe("Component External",null!=(M=null==t||null==(F=t.diagramsThemeSettings)?void 0:F.bg_color_component_ext)?M:S.COLORS.BG_COLOR_COMPONENT_EXT,void 0,void 0,null!=(P=null==t||null==(z=t.diagramsThemeSettings)?void 0:z.text_color_component_ext)?P:S.COLORS.TEXT_COLOR_COMPONENT_EXT,8));let H=8;var Y,U,G,$;null!=t&&null!=(B=t.diagramsThemeSettings)&&B.bg_color_boundary&&(H++,X=X.concat(Fe("Boundary",t.diagramsThemeSettings.bg_color_boundary,void 0,void 0,null!=(Y=null==t||null==(U=t.diagramsThemeSettings)?void 0:U.text_color_boundary)?Y:S.COLORS.TEXT_COLOR_BOUNDARY,H))),null!=t&&null!=(W=t.diagramsThemeSettings)&&W.bg_color_deployment_node&&(H++,X=X.concat(Fe("Deployment Node",t.diagramsThemeSettings.bg_color_deployment_node,void 0,void 0,null!=(G=null==t||null==($=t.diagramsThemeSettings)?void 0:$.text_color_deployment_node)?G:S.COLORS.TEXT_COLOR_DEPLOYMENT_NODE,H))),null!=t&&t.tags&&Object.entries(t.tags).forEach((([e,t],n)=>{var _,r,o,i,a;H++,X=X.concat(Fe(null!=(_=null!=(r=t.legend_text)?r:t.tag)?_:"<no tag>",t.bg_color,null!=(o=t.border_color)?o:t.bg_color?void 0:"black",null==(i=Ae(t.border_style))?void 0:i.value,null!=(a=t.font_color)?a:"black",H))}));return new se(void 0,e,{alias:Me,position:{left:m,top:w}},{},X)},ze="The diagram contains too many elements and relationships, which may cause the auto layout to break. Try adjusting auto layout settings like orientation, ranksep or subgraph margins.",Be="Graphviz not initialized. Cannot generate auto layout.",We="triangulation failed";var Xe=n(177);function Ze(e){return null==e?void 0:e.split("+")}function He(e,t){if(e&&t){const n=[];for(const _ of e){const e=t[Oe(_)];e&&n.push(e)}if(n.length>0)return Object.assign({},...n)}}let Ye=function(e){return e.Rectangle="RECTANGLE",e.Footer="FOOTER",e}({});class Ue extends se{getUpdatedSpecs(){const e=super.getUpdatedSpecs();var t;if(e&&(null==(t=this.canvas)||t.discardActiveObject(),delete e.position,delete e.size,e.inner_specs=[],e.shapes=[],this.children))for(const t of this.children)if(ae(t)){const n=t.getUpdatedSpecs();n&&e.inner_specs.push(n)}else if(t.name!==Ye.Footer){var n,_;e.shapes.push({position:{left:t.left,top:t.top,z_index:Q(t.canvas,t)},size:{scale_x:null!=(n=t.scaleX)?n:1,scale_y:null!=(_=t.scaleY)?_:1},shape_type:t.name})}else e.shapes.push({position:{z_index:Q(t.canvas,t)},shape_type:t.name});return e}}const Ge=e=>{var t,n,_,r,o,i,a,s,l,c,d;let g,u;const b=(null==(t=e.data)||null==(t=t.rawData)||null==(t=t.base_data)?void 0:t.alias)&&e.data.rawAutoLayout&&void 0!==e.data.rawAutoLayout[e.data.rawData.base_data.alias],p=[];null==(n=e.children)||n.forEach((e=>{e.name===Ye.Footer?u=e:e.name===Ye.Rectangle?g=e:p.push(e)}));const w=K(te(p),!1),m=null!=(_=null==(r=g)?void 0:r.scaleX)?_:1,f=null!=(o=null==(i=g)?void 0:i.scaleY)?o:1,h=null!=(a=null==(s=g)||null==(s=s.canvas)?void 0:s.getZoom())?a:1,y=ne(e.canvas),v=Z*m,S=Z*f,O=Z*m,x=Z*f;var E;g&&void 0!==w.left&&void 0!==w.right&&void 0!==w.top&&void 0!==w.bottom&&void 0!==w.width&&void 0!==w.height&&void 0!==u?(w.left=(w.left-y.panX)/h,w.top=(w.top-y.panY)/h,w.right=(w.right-y.panX)/h,w.bottom=(w.bottom-y.panY)/h,w.width=w.right-w.left,w.height=w.bottom-w.top,b||(g.width=w.width/m+v/m*2,g.height=w.height/f+S/f*3+(null!=(E=u.height)?E:0),g.left=w.left-v,g.top=w.top-S)):g&&void 0!==u&&(g.width=W,g.height=X+u.getScaledHeight()),null==(l=e.canvas)||l.renderAll(),g&&u&&void 0!==g.left&&void 0!==g.top&&void 0!==g.height&&void 0!==u.height&&(u.top=g.top+g.getScaledHeight()-u.getScaledHeight()-x,u.left=g.left+O),null==(c=g)||c.setCoords(),null==(d=u)||d.setCoords()},$e=e=>{e.on(c,(t=>{Ve(t,e)}))},qe=e=>{e.on(c,(t=>{Ve(t,e)}))},Ve=(e,t)=>{var n;if(e.e&&null!=(n=t.parent)&&n.children){var _;const e=_e(t);if(!re(null==(_=t.canvas)?void 0:_.getActiveObjects(),e.objects)){var r,o,i;null==(r=t.canvas)||r.discardActiveObject();const n=t.parent;let _;"multiple"===e.type?_=new q.fabric.ActiveSelection(e.objects,{canvas:t.canvas}):(_=new ie(e.objects,{canvas:t.canvas}),_.parent=n,_.on(s,(e=>{Ke(_.canvas,e,_,n)})),_.on(l,(e=>{var _;null==(_=t.canvas)||_.discardActiveObject(),n.fire(l)}))),null==(o=t.canvas)||o.setActiveObject(_),null==(i=t.canvas)||i.requestRenderAll()}}},Je=(e,t)=>{e&&t&&Ge(e)},Ke=(e,t,n,_)=>{n instanceof q.fabric.ActiveSelection&&e&&_.onComponentMouseUp(e,t,n,((e,t,n)=>n instanceof q.fabric.ActiveSelection?[{isHeaderMenuItem:!0,id:"baseElasticContainerContextMenu",label:"",hidden:!0,alwaysOpen:!0,subMenuItems:[...le(e,t,n,!1)]}]:[])(e,t,n))},Qe=(e,t,n,_,r,o)=>{var i,a;const s=He(Ze(null==(i=e.base_data)?void 0:i.tags),null==o?void 0:o.tags),c={alias:null==(a=e.base_data)?void 0:a.alias},d=new Ue(e,t,c,_,[],void 0,void 0,void 0,!0);d.visible=!1;const g=((e,t,n,_,r)=>{var o,i,a,s,l,c,d,g,u,b,p,w;const m=null==e||null==(o=e.shapes)?void 0:o.filter((e=>e.shape_type===Ye.Rectangle))[0],f=new q.fabric.Rect({fill:null!=(i=null==r?void 0:r.bg_color)?i:n.bgColor,stroke:null!=(a=null==r?void 0:r.border_color)?a:n.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH,strokeDashArray:n.strokeDashArray,left:null!=(s=null==m||null==(l=m.position)?void 0:l.left)?s:Se(e.alias,t).left,top:null!=(c=null==m||null==(d=m.position)?void 0:d.top)?c:Se(e.alias,t).top,name:Ye.Rectangle,rx:S.SIZES.BORDER_RADIUS,ry:S.SIZES.BORDER_RADIUS,scaleX:null!=(g=null==m||null==(u=m.size)?void 0:u.scale_x)?g:1,scaleY:null!=(b=null==m||null==(p=m.size)?void 0:p.scale_y)?b:1}),h=((e,t)=>{var n,_,r;if(e&&null!=(n=t[e])&&n.size)return{width:null==(_=t[e].size)?void 0:_.x,height:null==(r=t[e].size)?void 0:r.y}})(e.alias,t);return h&&(f.width=h.width,f.height=h.height),f.data={rawDiagramElementSpec:m},f.parent=_,$e(f),null==(w=_.children)||w.push(f),f})(t,_,r,d,s);((e,t,n,_,r,o,i)=>{var a,s,l,c,d,g,u,b,p,w,m;const f=null==e||null==(a=e.shapes)?void 0:a.filter((e=>e.shape_type===Ye.Footer))[0],h=[],y={fontFamily:v.FONT.FAMILY,fill:null!=(s=null==i?void 0:i.font_color)?s:n.textColor};let S;var O;let x;var E,T;null!=(l=_.base_data)&&l.link&&(S=new q.fabric.Path(Xe.faLink.icon[4].toString(),{fill:null!=(O=null==i?void 0:i.font_color)?O:n.textColor,opacity:1,originX:"left",originY:"top",top:1,left:0}),S.scaleToWidth(10),h.push(S)),null!=(c=_.base_data)&&c.label&&(x=new q.fabric.Text(_.base_data.label,Object.assign({},y,{fontSize:z,fontWeight:"bold"})),x.top=0,x.left=null!=(E=S)&&E.getScaledWidth()?(null==(T=S)?void 0:T.getScaledWidth())+3:0,h.push(x));let R=null!=(d=null!=(g=_.boundary_type)?g:_.deployment_node_type)?d:"";R=null!=(u=null!=(b=_.boundary_custom_type)?b:_.deploymeny_node_custom_type)?u:R,R+=_.technology?`: ${_.technology}`:"",R=`[${R}]`;const C=new q.fabric.Text(R,Object.assign({},y,{fontSize:B,left:0,top:null!=(p=null==(w=x)?void 0:w.height)?p:0}));h.push(C);const I=new q.fabric.Group(h,{name:Ye.Footer,selectable:!1,evented:!1,left:r.left,top:r.top,scaleX:r.scaleX,scaleY:r.scaleY});I.data={rawDiagramElementSpec:f},I.parent=o,qe(I),null==(m=o.children)||m.push(I)})(t,0,r,e,g,d,s);let u=[];return e.sub_elements&&(u=Nt(void 0,e.sub_elements,n,_,Object.assign({},o,{skipAddToCanvas:!0,skipLegendRendering:!0})),u.forEach((e=>{var t;e.parent=d,null==(t=d.children)||t.push(e)}))),Ge(d),(e=>{var t;null==(t=e.children)||t.forEach((t=>{t.on(l,(t=>{Je(e,t)})),t.children&&t.children.forEach((t=>{t.on(l,(t=>{Je(e,t)}))}))}))})(d),d},et=(e,t,n,_,r)=>{if(t.base_data&&t.base_data.alias&&t.base_data.label&&t.boundary_type&&(n.auto_layout_enabled&&_[t.base_data.alias]||!n.auto_layout_enabled)){var o;const i=((e,t,n,_,r,o)=>{var i,a,s,l,c,d;const g={bgColor:null!=(i=null==o||null==(a=o.diagramsThemeSettings)?void 0:a.bg_color_boundary)?i:S.COLORS.BG_COLOR_BOUNDARY,borderColor:null!=(s=null==o||null==(l=o.diagramsThemeSettings)?void 0:l.border_color_boundary)?s:S.COLORS.BORDER_COLOR_BOUNDARY,textColor:null!=(c=null==o||null==(d=o.diagramsThemeSettings)?void 0:d.text_color_boundary)?c:S.COLORS.TEXT_COLOR_BOUNDARY,strokeDashArray:H.SIZES.STROKE_DASH_ARRAY},u=Object.assign({},g,r);return Qe(e,t,n,_,u,o)})(t,ge(t.base_data.alias,void 0,void 0,{Boundary:t.boundary_type},n),n,_,void 0,r);return r&&r.skipAddToCanvas||!i||null==e||e.add(i,...te(null!=(o=i.children)?o:[])),i}},tt=(e,t,n,_,r)=>{var o,i,a,s,l,c;const d=He(Ze(null==(o=e.base_data)?void 0:o.tags),null==r?void 0:r.tags),g=[],u=((e,t,n)=>{var _,r,o,i,a,s,l;const c=new q.fabric.Rect({fill:null!=(_=null==n?void 0:n.bg_color)?_:t.bgColor,stroke:null!=(r=null==n?void 0:n.border_color)?r:t.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH,left:v.SIZES.DEFAULT_LEFT,top:v.SIZES.DEFAULT_TOP,width:null!=(o=t.widthBox)?o:S.SIZES.WIDTH,height:S.SIZES.MIN_HEIGHT,name:null!=(i=null==(a=e.base_data)?void 0:a.alias)?i:"undefined",rx:null!=(s=t.borderRadius)?s:S.SIZES.BORDER_RADIUS,ry:null!=(l=t.borderRadius)?l:S.SIZES.BORDER_RADIUS});return c.on("scaling",(e=>{var t;null!=(t=e.target)&&t.width&&e.target.height&&e.target.scaleX&&e.target.scaleY&&e.target.set({width:e.target.width*e.target.scaleX,height:e.target.height*e.target.scaleY,scaleX:1,scaleY:1})})),c})(e,_,d);let b;g.push(u),null!=(i=e.base_data)&&i.tags&&(b=((e,t,n,_)=>{var r,o,i,a,s;return new q.fabric.Text(`«${null==(r=t.base_data)?void 0:r.tags}»`,{fill:null!=(o=null==_?void 0:_.font_color)?o:n.textColor,fontFamily:v.FONT.FAMILY,fontSize:S.FONT.SIZE_TAG,fontStyle:"italic",fontWeight:"normal",textAlign:"center",originX:"center",originY:"top",left:(null!=(i=e.left)?i:v.SIZES.DEFAULT_LEFT)+(null!=(a=e.width)?a:0)/2,top:(null!=(s=e.top)?s:v.SIZES.DEFAULT_TOP)+S.SIZES.TOP_TAGS})})(u,e,_,d),g.push(b));const p=((e,t,n,_,r)=>{var o,i,a,s,l,c;return new q.fabric.Text(null!=(o=(0,U.x4)(null==(i=n.base_data)?void 0:i.label))?o:"undefined",{fill:null!=(a=null==r?void 0:r.font_color)?a:_.textColor,fontFamily:v.FONT.FAMILY,fontSize:S.FONT.SIZE,fontWeight:"bold",textAlign:"center",originX:"center",originY:"top",left:(null!=(s=e.left)?s:v.SIZES.DEFAULT_LEFT)+(null!=(l=e.width)?l:0)/2,top:(null!=(c=null==t?void 0:t.top)?c:v.SIZES.DEFAULT_TOP)+S.SIZES.TOP_LABEL})})(u,b,e,_,d);g.push(p);const w=((e,t,n,_,r)=>{var o,i,a,s,l,c,d,g,u,b,p,w;const m=`[${null!=(o=null!=(i=null!=(a=null!=(s=null!=(l=null!=(c=null!=(d=n.boundary_custom_type)?d:n.boundary_type)?c:n.component_type)?l:n.container_type)?s:n.deployment_node_type)?a:n.deploymeny_node_custom_type)?i:n.person_type)?o:n.system_type}${n.technology?`: ${n.technology}`:""}]`;return new q.fabric.Text(m,{fill:null!=(g=null==r?void 0:r.font_color)?g:_.textColor,fontFamily:v.FONT.FAMILY,fontSize:S.FONT.SIZE_TYPE_TECHNOLOGY,fontWeight:"normal",textAlign:"center",originX:"center",originY:"top",left:(null!=(u=e.left)?u:v.SIZES.DEFAULT_LEFT)+(null!=(b=e.width)?b:0)/2,top:(null!=(p=null==t?void 0:t.top)?p:v.SIZES.DEFAULT_TOP)+S.SIZES.TOP_TYPE_TECHNOLOGY+(null!=(w=null==t?void 0:t.height)?w:0)})})(u,p,e,_,d);let m;g.push(w),null!=(a=e.base_data)&&a.description&&(m=((e,t,n,_,r)=>{var o,i,a,s,l,c,d;const g=null!=(o=_.widthDescription)?o:e.width;return new q.fabric.Textbox(null!=(i=(0,U.x4)(null==(a=n.base_data)?void 0:a.description))?i:"",{fill:null!=(s=null==r?void 0:r.font_color)?s:_.textColor,fontFamily:v.FONT.FAMILY,fontSize:S.FONT.SIZE_DESCRIPTION,fontWeight:400,opacity:.7,splitByGrapheme:!0,width:g?g-S.SIZES.PADDING_Y_DESCRIPTION:0,textAlign:"center",originX:"center",originY:"top",left:(null!=(l=e.left)?l:v.SIZES.DEFAULT_LEFT)+(null!=(c=e.width)?c:0)/2,top:(null!=(d=null==t?void 0:t.top)?d:0)+S.SIZES.TOP_DESCRIPTION})})(u,w,e,_,d),g.push(m)),null!=(s=e.base_data)&&s.link&&g.push(((e,t,n)=>{var _,r,o;const i=new q.fabric.Path(Xe.faLink.icon[4].toString(),{fill:null!=(_=null==n?void 0:n.font_color)?_:t.textColor,opacity:1,originX:"left",originY:"top",left:(null!=(r=e.left)?r:0)+5,top:(null!=(o=e.top)?o:0)+5});return i.scaleToWidth(10),i})(u,_,d)),((e,t)=>{var n,_,r;let o=(null!=(n=null==t?void 0:t.height)?n:0)+((null!=(_=null==t?void 0:t.top)?_:0)-(null!=(r=null==e?void 0:e.top)?r:0))+S.SIZES.PADDING_BOTTOM;o<S.SIZES.MIN_HEIGHT&&(o=S.SIZES.MIN_HEIGHT),e.height=o})(u,m);const f={alias:null==(l=e.base_data)?void 0:l.alias,position:Se(null==(c=e.base_data)?void 0:c.alias,n)};return new se(e,t,f,n,g)},nt=(e,t,n,_,r)=>{var o,i,a,s;const l=He(Ze(null==(o=e.base_data)?void 0:o.tags),null==r?void 0:r.tags),c=[],d=((e,t,n)=>{const _=Object.assign({},t,{borderRadius:0});return tt(e,{},{},_,n)})(e,_,r);c.push(d);const g=(null!=(i=d.width)?i:0)/2-v.SIZES.BORDER_WIDTH/2;c.push(((e,t,n,_)=>{var r,o,i,a,s,l,c,d,g,u,b,p,w,m,f,h,y,S,O,E,T,R;const C=[],I=v.SIZES.BORDER_WIDTH,k=x.SIZES.TOP_BOX_HEIGHT,D=new q.fabric.Rect({fill:null!=(r=null==_?void 0:_.bg_color)?r:n.bgColor,strokeWidth:0,left:(null!=(o=e.left)?o:0)+v.SIZES.BORDER_WIDTH,top:(null!=(i=e.top)?i:0)-k+I,width:(null!=(a=e.width)?a:0)-2*v.SIZES.BORDER_WIDTH,height:k});return C.push(D),C.push(new q.fabric.Line([null!=(s=e.left)?s:0,null!=(l=e.top)?l:0,null!=(c=e.left)?c:0,null!=(d=D.top)?d:0],{strokeWidth:v.SIZES.BORDER_WIDTH,stroke:null!=(g=null==_?void 0:_.border_color)?g:n.borderColor,originX:"left",originY:"top"})),C.push(new q.fabric.Line([(null!=(u=e.left)?u:0)+(null!=(b=e.width)?b:0)-v.SIZES.BORDER_WIDTH,null!=(p=e.top)?p:0,(null!=(w=e.left)?w:0)+(null!=(m=e.width)?m:0)-v.SIZES.BORDER_WIDTH,null!=(f=D.top)?f:0],{strokeWidth:v.SIZES.BORDER_WIDTH,stroke:null!=(h=null==_?void 0:_.border_color)?h:n.borderColor,originX:"left",originY:"top"})),C.push(new q.fabric.Circle({fill:null!=(y=null==_?void 0:_.bg_color)?y:n.bgColor,stroke:null!=(S=null==_?void 0:_.border_color)?S:n.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH,radius:t,top:(null!=(O=D.top)?O:0)-(null!=(E=e.width)?E:0)*x.SIZES.SCALE_X_TOP_BOTTOM/2,left:(null!=(T=D.left)?T:0)+ +(null!=(R=e.width)?R:0)-I,angle:90,startAngle:0,endAngle:360,scaleX:x.SIZES.SCALE_X_TOP_BOTTOM})),new q.fabric.Group(C)})(d,g,_,l)),c.push(((e,t,n,_)=>{var r,o,i,a,s,l;return new q.fabric.Circle({fill:null!=(r=null==_?void 0:_.bg_color)?r:n.bgColor,stroke:null!=(o=null==_?void 0:_.border_color)?o:n.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH,radius:t,top:(null!=(i=e.top)?i:0)+(null!=(a=e.height)?a:0)-2*t*x.SIZES.SCALE_X_TOP_BOTTOM/2-v.SIZES.BORDER_WIDTH,left:(null!=(s=e.left)?s:0)+(null!=(l=e.width)?l:0),angle:90,startAngle:270,endAngle:90,scaleX:x.SIZES.SCALE_X_TOP_BOTTOM})})(d,g,_,l));const u={alias:null==(a=e.base_data)?void 0:a.alias,position:Se(null==(s=e.base_data)?void 0:s.alias,n)};return new se(e,t,u,n,c)},_t=(e,t,n,_,r)=>{var o,i,a,s;const l=He(Ze(null==(o=e.base_data)?void 0:o.tags),null==r?void 0:r.tags),c=[],d=rt(e,_,r);c.push(d);const g=(null!=(i=d.height)?i:0)/2-v.SIZES.BORDER_WIDTH/2;c.push(ot(d,g,_,l)),c.push(it(d,g,_,l));const u={alias:null==(a=e.base_data)?void 0:a.alias,position:Se(null==(s=e.base_data)?void 0:s.alias,n)};return new se(e,t,u,n,c)},rt=(e,t,n)=>{const _=Object.assign({},t,{borderRadius:0});return tt(e,{},{},_,n)},ot=(e,t,n,_)=>{var r,o,i;return new q.fabric.Circle({fill:null!=(r=null==_?void 0:_.bg_color)?r:n.bgColor,stroke:null!=(o=null==_?void 0:_.border_color)?o:n.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH,radius:t,top:e.top,left:(null!=(i=e.left)?i:0)+2*t*O.SIZES.SCALE_Y_TAIL_HEAD/2+2*v.SIZES.BORDER_WIDTH,angle:90,startAngle:0,endAngle:180,scaleY:O.SIZES.SCALE_Y_TAIL_HEAD})},it=(e,t,n,_)=>{var r,o,i,a,s,l,c,d,g,u,b,p,w,m,f,h,y,S,x,E,T,R,C,I;const k=[],D=v.SIZES.BORDER_WIDTH,L=new q.fabric.Rect({fill:null!=(r=null==_?void 0:_.bg_color)?r:n.bgColor,strokeWidth:0,left:(null!=(o=e.left)?o:0)+(null!=(i=e.width)?i:0)-D,top:(null!=(a=e.top)?a:0)+v.SIZES.BORDER_WIDTH,width:O.SIZES.HEAD_BOX_WIDTH,height:(null!=(s=e.height)?s:0)-2*v.SIZES.BORDER_WIDTH});return k.push(L),k.push(new q.fabric.Line([null!=(l=L.left)?l:0,null!=(c=e.top)?c:0,(null!=(d=L.left)?d:0)+(null!=(g=L.width)?g:0),null!=(u=e.top)?u:0],{strokeWidth:v.SIZES.BORDER_WIDTH,stroke:null!=(b=null==_?void 0:_.border_color)?b:n.borderColor,originX:"left",originY:"top"})),k.push(new q.fabric.Line([null!=(p=L.left)?p:0,(null!=(w=L.top)?w:0)+(null!=(m=L.height)?m:0),(null!=(f=L.left)?f:0)+(null!=(h=L.width)?h:0),(null!=(y=L.top)?y:0)+(null!=(S=L.height)?S:0)],{strokeWidth:v.SIZES.BORDER_WIDTH,stroke:null!=(x=null==_?void 0:_.border_color)?x:n.borderColor,originX:"left",originY:"top"})),k.push(new q.fabric.Circle({fill:null!=(E=null==_?void 0:_.bg_color)?E:n.bgColor,stroke:null!=(T=null==_?void 0:_.border_color)?T:n.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH,radius:t,top:e.top,left:(null!=(R=L.left)?R:0)+(null!=(C=L.width)?C:0)+(null!=(I=e.height)?I:0)*O.SIZES.SCALE_Y_TAIL_HEAD/2-D,angle:90,startAngle:0,endAngle:360,scaleY:O.SIZES.SCALE_Y_TAIL_HEAD})),new q.fabric.Group(k)},at=_t,st=(e,t,n,_,r)=>{if(t.base_data&&t.base_data.alias&&t.component_type&&(n.auto_layout_enabled&&_[t.base_data.alias]||!n.auto_layout_enabled)){let o;switch(t.component_type){case"Component":case"ComponentDb":case"ComponentQueue":o=((e,t,n,_,r)=>{var o,i,a,s,l,c;const d={bgColor:null!=(o=null==r||null==(i=r.diagramsThemeSettings)?void 0:i.bg_color_component)?o:S.COLORS.BG_COLOR_COMPONENT,borderColor:null!=(a=null==r||null==(s=r.diagramsThemeSettings)?void 0:s.border_color_component)?a:S.COLORS.BORDER_COLOR_COMPONENT,textColor:null!=(l=null==r||null==(c=r.diagramsThemeSettings)?void 0:c.text_color_component)?l:S.COLORS.TEXT_COLOR_COMPONENT},g=Object.assign({},d,_);if(e.component_type)switch(e.component_type){case"Component":return tt(e,t,n,g,r);case"ComponentDb":return nt(e,t,n,g,r);case"ComponentQueue":return at(e,t,n,g,r)}})(t,ge(t.base_data.alias,void 0,void 0,{Component:t.component_type},n),_,void 0,r);break;case"Component_Ext":case"ComponentDb_Ext":case"ComponentQueue_Ext":o=((e,t,n,_,r)=>{var o,i,a,s,l,c;const d={bgColor:null!=(o=null==r||null==(i=r.diagramsThemeSettings)?void 0:i.bg_color_component_ext)?o:S.COLORS.BG_COLOR_COMPONENT_EXT,borderColor:null!=(a=null==r||null==(s=r.diagramsThemeSettings)?void 0:s.border_color_component_ext)?a:S.COLORS.BORDER_COLOR_COMPONENT_EXT,textColor:null!=(l=null==r||null==(c=r.diagramsThemeSettings)?void 0:c.text_color_component_ext)?l:S.COLORS.TEXT_COLOR_COMPONENT_EXT},g=Object.assign({},d,_);if(e.component_type)switch(e.component_type){case"Component_Ext":return tt(e,t,n,g,r);case"ComponentDb_Ext":return nt(e,t,n,g,r);case"ComponentQueue_Ext":return at(e,t,n,g,r)}})(t,ge(t.base_data.alias,void 0,void 0,{Component:t.component_type},n),_,void 0,r)}return r&&r.skipAddToCanvas||!o||null==e||e.add(o),o}},lt=(e,t,n,_,r)=>{if(t.base_data&&t.base_data.alias&&t.container_type&&(n.auto_layout_enabled&&_[t.base_data.alias]||!n.auto_layout_enabled)){let o;switch(t.container_type){case"Container":case"ContainerDb":case"ContainerQueue":o=((e,t,n,_,r)=>{var o,i,a,s,l,c;const d={bgColor:null!=(o=null==r||null==(i=r.diagramsThemeSettings)?void 0:i.bg_color_container)?o:S.COLORS.BG_COLOR_CONTAINER,borderColor:null!=(a=null==r||null==(s=r.diagramsThemeSettings)?void 0:s.border_color_container)?a:S.COLORS.BORDER_COLOR_CONTAINER,textColor:null!=(l=null==r||null==(c=r.diagramsThemeSettings)?void 0:c.text_color_container)?l:S.COLORS.TEXT_COLOR_CONTAINER},g=Object.assign({},d,_);if(e.container_type)switch(e.container_type){case"Container":return tt(e,t,n,g,r);case"ContainerDb":return nt(e,t,n,g,r);case"ContainerQueue":return _t(e,t,n,g,r)}})(t,ge(t.base_data.alias,void 0,void 0,{Container:t.container_type},n),_,void 0,r);break;case"Container_Ext":case"ContainerDb_Ext":case"ContainerQueue_Ext":o=((e,t,n,_,r)=>{var o,i,a,s,l,c;const d={bgColor:null!=(o=null==r||null==(i=r.diagramsThemeSettings)?void 0:i.bg_color_container_ext)?o:S.COLORS.BG_COLOR_CONTAINER_EXT,borderColor:null!=(a=null==r||null==(s=r.diagramsThemeSettings)?void 0:s.border_color_container_ext)?a:S.COLORS.BORDER_COLOR_CONTAINER_EXT,textColor:null!=(l=null==r||null==(c=r.diagramsThemeSettings)?void 0:c.text_color_container_ext)?l:S.COLORS.TEXT_COLOR_CONTAINER_EXT},g=Object.assign({},d,_);if(e.container_type)switch(e.container_type){case"Container_Ext":return tt(e,t,n,g,r);case"ContainerDb_Ext":return nt(e,t,n,g,r);case"ContainerQueue_Ext":return at(e,t,n,g,r)}})(t,ge(t.base_data.alias,void 0,void 0,{Container:t.container_type},n),_,void 0,r)}return r&&r.skipAddToCanvas||!o||null==e||e.add(o),o}},ct=(e,t,n,_,r)=>{if(t.base_data&&t.base_data.alias&&t.base_data.label&&t.deployment_node_type&&(n.auto_layout_enabled&&_[t.base_data.alias]||!n.auto_layout_enabled)){var o;const i=((e,t,n,_,r,o)=>{var i,a,s,l,c,d;const g={bgColor:null!=(i=null==o||null==(a=o.diagramsThemeSettings)?void 0:a.bg_color_deployment_node)?i:S.COLORS.BG_COLOR_DEPLOYMENT_NODE,borderColor:null!=(s=null==o||null==(l=o.diagramsThemeSettings)?void 0:l.border_color_deployment_node)?s:S.COLORS.BORDER_COLOR_DEPLOYMENT_NODE,textColor:null!=(c=null==o||null==(d=o.diagramsThemeSettings)?void 0:d.text_color_deployment_node)?c:S.COLORS.TEXT_COLOR_DEPLOYMENT_NODE},u=Object.assign({},g,r);return Qe(e,t,n,_,u,o)})(t,ge(t.base_data.alias,void 0,void 0,{DeploymentNode:t.deployment_node_type},n),n,_,void 0,r);return r&&r.skipAddToCanvas||!i||null==e||e.add(i,...te(null!=(o=i.children)?o:[])),i}},dt=(e,t,n,_,r)=>{var o,i;const a=[],s=((e,t,n)=>{const _=Object.assign({},t,{borderRadius:F});return tt(e,{},{},_,n)})(e,_,r);a.push(s);const l=((e,t)=>{var n,_,r,o,i;const a=new q.fabric.Circle({radius:P,top:t.top,left:t.left,fill:e.bgColor,stroke:e.borderColor,strokeWidth:v.SIZES.BORDER_WIDTH});return a.left=(null!=(n=a.left)?n:0)+(null!=(_=t.getScaledWidth())?_:0)/2-(null!=(r=a.getScaledWidth())?r:0)/2,a.top=(null!=(o=a.top)?o:0)-(null!=(i=a.getScaledWidth())?i:0)+5,a})(_,s);a.push(l);const c={alias:null==(o=e.base_data)?void 0:o.alias,position:Se(null==(i=e.base_data)?void 0:i.alias,n)};return new se(e,t,c,n,a)},gt=(e,t,n,_,r)=>{if(t.base_data&&t.base_data.alias&&t.person_type&&(n.auto_layout_enabled&&_[t.base_data.alias]||!n.auto_layout_enabled)){let o;switch(t.person_type){case"Person":o=((e,t,n,_,r)=>{var o,i,a,s,l,c;const d={bgColor:null!=(o=null==r||null==(i=r.diagramsThemeSettings)?void 0:i.bg_color_person)?o:S.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON,borderColor:null!=(a=null==r||null==(s=r.diagramsThemeSettings)?void 0:s.border_color_person)?a:S.COLORS.BORDER_COLOR_SOFTWARE_SYSTEM_PERSON,textColor:null!=(l=null==r||null==(c=r.diagramsThemeSettings)?void 0:c.text_color_person)?l:S.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON},g=Object.assign({},d,_);return dt(e,t,n,g,r)})(t,ge(t.base_data.alias,void 0,void 0,{Person:t.person_type},n),_,void 0,r);break;case"Person_Ext":o=((e,t,n,_,r)=>{var o,i,a,s,l,c;const d={bgColor:null!=(o=null==r||null==(i=r.diagramsThemeSettings)?void 0:i.bg_color_person_ext)?o:S.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,borderColor:null!=(a=null==r||null==(s=r.diagramsThemeSettings)?void 0:s.border_color_person_ext)?a:S.COLORS.BORDER_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,textColor:null!=(l=null==r||null==(c=r.diagramsThemeSettings)?void 0:c.text_color_person_ext)?l:S.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON_EXT},g=Object.assign({},d,_);return dt(e,t,n,g,r)})(t,ge(t.base_data.alias,void 0,void 0,{Person:t.person_type},n),_,void 0,r)}return r&&r.skipAddToCanvas||!o||null==e||e.add(o),o}};let ut=function(e){return e.Dot="DOT",e.Line="LINE",e.Text="TEXT",e.Triangle="TRIANGLE",e.Rectangle="RECTANGLE",e}({});class bt extends se{getUpdatedSpecs(){const e=super.getUpdatedSpecs();var t,n;return e&&(null==(t=this.canvas)||t.discardActiveObject(),delete e.position,delete e.size,e.shapes=[],null==(n=this.children)||n.forEach((t=>{const n=q.fabric.util.object.clone(t);if(n.name===ut.Line||n.name===ut.Rectangle)e.shapes.push({position:{z_index:Q(n.canvas,n)},shape_type:n.name});else{var _,r;let t=0,o=0;const i=n.angle;if(n.name===ut.Text)t=n.getCenterPoint().x,o=n.getCenterPoint().y;else if(n.name===ut.Dot||n.name===ut.Triangle){n.name===ut.Triangle&&n.rotate(M);const e=ht(this.canvas,n.left,n.top,n.name===ut.Triangle,i,n.scaleX,n.scaleY,!0);t=e.left,o=e.top}const a={position:{left:t,top:o,z_index:Q(n.canvas,n)},size:{scale_x:null!=(_=n.scaleX)?_:1,scale_y:null!=(r=n.scaleY)?r:1},shape_type:n.name};n.name===ut.Triangle&&(a.position.angle=i),e.shapes.push(a)}}))),e}}const pt=e=>{var t;e.children=null==(t=e.children)?void 0:t.sort(((e,t)=>e.name===ut.Rectangle||e.name===ut.Line&&t.name!==ut.Rectangle?-1:t.name===ut.Rectangle||e.name!==ut.Rectangle&&t.name===ut.Line?1:e.name===t.name?0:1))},wt=e=>{const t=e.parent;let n,_=1;const r=e.canvas;if(t&&r){const a=[],s=[];if(t.children){var o,i;t.children.forEach((e=>{if(e.name===ut.Triangle&&(n=e),e.name===ut.Dot||e.name===ut.Triangle){var t;s.push(e),_=null!=(t=e.scaleX)?t:1;const n=e.getPointByOrigin("center","center"),r=new oe(n.x,n.y,e.name);a.push(r)}}));const l=t.children.findIndex((e=>e.name===ut.Line));void 0!==l&&l>-1&&t.children.splice(l,1);const c=Q(r,e),d=null==(o=e.data)?void 0:o.rawDiagramElementSpec,g=e.stroke,u=e.strokeDashArray,b=null==(i=e.data)?void 0:i.otherData.selectedRelColor;r.remove(e);const p=Ot(d,a,t,_,g,b,void 0,u);r.add(p),c&&p.moveTo(c),n&&ft(a,n)}}},mt=e=>{const t=e.findIndex((e=>e.customType===ut.Triangle)),n=e[t],_=e[t>0?t-1:t+1];return 180*Math.atan2(n.y-_.y,n.x-_.x)/Math.PI+90},ft=(e,t)=>{let n;e&&(n=mt(e),t.rotate(n))},ht=(e,t,n,_,r=M,o=1,i=1,a)=>{var s;const l=null!=(s=null==e?void 0:e.getZoom())?s:1,c=ne(e);let d=t,g=n;if(_){const e=N*o/2+j*o/2,t=N*i/2+j*i/2;a?(d-=e,g+=t):(d+=e,g-=t)}else{const e=L*o*2+j*o/2,t=L*i+j*i/2;a?(d+=e,g+=t):(d-=e,g-=t)}return a||(d=(d-c.panX)/l,g=(g-c.panY)/l),{left:d,top:g,angle:r}},yt=(e,t)=>{let n=[];if(null!=e&&e.shapes)null==e||e.shapes.forEach((e=>{var t,_;if((e.shape_type===ut.Dot||e.shape_type===ut.Triangle)&&void 0!==(null==(t=e.position)?void 0:t.left)&&void 0!==(null==(_=e.position)?void 0:_.top)){const t=new oe(e.position.left,e.position.top,e.shape_type);t.data={rawDiagramElementSpec:e},n.push(t)}}));else{var _,r;let o;null!=e&&e.alias&&null!=(_=t[e.alias])&&_.start&&null!=(r=t[e.alias])&&r.end?(o=[],o.push(new oe(t[e.alias].start.x,t[e.alias].start.y,ut.Dot)),t[e.alias].path&&t[e.alias].path.forEach((e=>{o.push(new oe(e.x,e.y,ut.Dot))})),o.push(new oe(t[e.alias].end.x,t[e.alias].end.y,ut.Triangle))):o=[new oe(v.SIZES.DEFAULT_LEFT,v.SIZES.DEFAULT_TOP,ut.Dot),new oe(100+v.SIZES.DEFAULT_LEFT,v.SIZES.DEFAULT_TOP,ut.Triangle)],n=n.concat(o)}return n},vt=(e,t,n,_,r,o)=>{const i=[],a=void 0!==(null==e?void 0:e.alias)&&void 0!==t[e.alias];for(let e=0;e<n.length;e++){var s,l,c,d;i.push(St(void 0,n[e],n[e].customType===ut.Triangle?null!=(s=null==(l=n[e].data)||null==(l=l.rawDiagramElementSpec)||null==(l=l.position)?void 0:l.angle)?s:mt(n):void 0,n[e].customType===ut.Triangle,_,!0,null==(c=n[e].data)||null==(c=c.rawDiagramElementSpec)||null==(c=c.size)?void 0:c.scale_x,null==(d=n[e].data)||null==(d=d.rawDiagramElementSpec)||null==(d=d.size)?void 0:d.scale_y,r,o,a))}return i},St=(e,t,n,_,r,o=!0,i=1,a=1,s,l,c)=>{var d;s=null!=(d=s)?d:T;const{left:g,top:u,angle:b}=ht(e,t.x,t.y,_,n,i,a,!1);if(_){var p,w;const e=new q.fabric.Triangle({left:g,top:u,width:N,height:N,fill:s,scaleX:i,scaleY:a,hasControls:!1,name:ut.Triangle,angle:M});return e.rotate(b),e.data={rawDiagramElementSpec:null==(p=t.data)?void 0:p.rawDiagramElementSpec,otherData:{selectedRelColor:null!=l?l:C}},e.parent=r,o&&(null==(w=r.children)||w.push(e)),Tt(e,s),e}{var m,f;const e=new q.fabric.Circle({left:g,top:u,radius:L,fill:s,opacity:.2,scaleX:i,scaleY:a,hasControls:!1,name:ut.Dot,visible:!c,selectable:!c,hasBorders:!c});return e.data={rawDiagramElementSpec:null==(m=t.data)?void 0:m.rawDiagramElementSpec,otherData:{selectedRelColor:null!=l?l:C}},e.parent=r,o&&(null==(f=r.children)||f.push(e)),Tt(e,s),e}},Ot=(e,t,n,_=1,r,o,i,a)=>{var s,l,c;const d=null==e||null==(s=e.shapes)?void 0:s.filter((e=>e.shape_type===ut.Line))[0];let g;return g=i&&null!=e&&e.alias&&null!=(l=i[e.alias])&&l.svg_path?new q.fabric.Path(i[e.alias].svg_path,{stroke:null!=r?r:T,strokeDashArray:a,fill:"",strokeWidth:j*_,scaleX:1,scaleY:1,name:ut.Line,perPixelTargetFind:!0,hasBorders:!1}):new q.fabric.Polyline(t,{stroke:null!=r?r:T,strokeDashArray:a,fill:"",strokeWidth:j*_,scaleX:1,scaleY:1,name:ut.Line,perPixelTargetFind:!0,hasBorders:!1}),g.data={rawDiagramElementSpec:d,otherData:{selectedRelColor:null!=o?o:C}},g.parent=n,Et(g,g.stroke,g.strokeWidth),null==(c=n.children)||c.push(g),g},xt=(e,t,n,_,r,o,i,a)=>{var s,l,c,d,g,u,b;let p,w=1,m=1;var f,h,y,S;null!=t&&t.shapes&&(p=t.shapes.filter((e=>e.shape_type===ut.Text))[0],p&&(w=null!=(f=null==(h=p.size)?void 0:h.scale_x)?f:1,m=null!=(y=null==(S=p.size)?void 0:S.scale_y)?y:1));const O=[],x={fontFamily:v.FONT.FAMILY,fill:null!=(s=null!=(l=null==a?void 0:a.font_color)?l:null==i||null==(c=i.diagramsThemeSettings)?void 0:c.text_color_relationship)?s:R};if(null!=(d=e.base_data)&&d.label){var T,C,L,N,j;const t=new q.fabric.Text((0,U.x4)(e.base_data.label),Object.assign({},x,{fontSize:I,fontWeight:"bold",textAlign:"center"}));t.top=e.technology?-(null!=(T=t.height)?T:0):-(null!=(C=t.height)?C:0)/2,t.left=(null!=(L=_.width)?L:0)/2-(null!=(N=t.width)?N:0)/2-(null!=(j=r[0].width)?j:0)/2,O.push(t)}if(e.technology){var A,M,F;const t=new q.fabric.Text(`[${e.technology}]`,Object.assign({},x,{fontSize:k,textAlign:"center"}));t.left=(null!=(A=_.width)?A:0)/2-(null!=(M=t.width)?M:0)/2-(null!=(F=r[0].width)?F:0)/2,O.push(t)}const P=new q.fabric.Group(O),z=P.getBoundingRect(),B=new q.fabric.Rect({top:z.top-D,left:z.left-D,width:z.width+2*D,height:z.height+2*D,fill:null!=(g=null==i||null==(u=i.diagramsThemeSettings)?void 0:u.bg_color_relationship)?g:E});let W,X;var Z,H,Y,G,$,V,J,K;null!=t&&t.alias&&n[t.alias]&&n[t.alias].label_position?(W=n[t.alias].label_position.x-(null!=(Z=B.width)?Z:0)/2,X=n[t.alias].label_position.y-(null!=(H=B.height)?H:0)/2):(W=(null!=(Y=_.left)?Y:0)+(null!=(G=_.width)?G:0)/2-(null!=($=B.width)?$:0)/2,X=(null!=(V=_.top)?V:0)+(null!=(J=_.height)?J:0)/2-(null!=(K=B.height)?K:0)/2);const Q=new q.fabric.Group([B,P],{name:ut.Text,hasControls:!1,left:W,top:X,scaleX:w,scaleY:m});var ee,te;return Q.data={rawDiagramElementSpec:p},Q.parent=o,null==(b=o.children)||b.push(Q),p&&void 0!==(null==(ee=p.position)?void 0:ee.left)&&void 0!==(null==(te=p.position)?void 0:te.top)&&Q.setPositionByOrigin(new q.fabric.Point(p.position.left,p.position.top),"center","center"),Q},Et=(e,t,n)=>{const _=e.parent;e.on(c,(t=>{var n,_,r;e.stroke=null==(n=e.data)||null==(n=n.otherData)?void 0:n.selectedRelColor,e.strokeWidth=(null!=(_=e.strokeWidth)?_:0)+A,e.dirty=!0,null==(r=e.canvas)||r.renderAll(),((e,t)=>{var n;if(e.e&&null!=(n=t.parent)&&n.children){var _;const e=_e(t);if(!re(null==(_=t.canvas)?void 0:_.getActiveObjects(),e.objects)){var r,o,i;null==(r=t.canvas)||r.discardActiveObject();const n=t.parent;let _;"multiple"===e.type?_=new q.fabric.ActiveSelection(e.objects,{canvas:t.canvas}):(_=new ie(e.objects,{canvas:t.canvas}),_.parent=t.parent,_.on(s,(e=>{It(_.canvas,e,_,n)})),_.on(l,(e=>{var _;null==(_=t.canvas)||_.discardActiveObject(),n.fire(l)}))),_.hasBorders=!1,null==(o=t.canvas)||o.setActiveObject(_),null==(i=t.canvas)||i.requestRenderAll()}}})(t,e)})),e.on(d,(_=>{var r;e.stroke=t,e.strokeWidth=n,e.dirty=!0,null==(r=e.canvas)||r.renderAll()})),e.on(s,(t=>{It(e.canvas,t,e,_)}))},Tt=(e,t)=>{const n=e.parent;e.on("moving",(e=>{Rt(e)})),e.on(s,(t=>{It(e.canvas,t,e,n)})),e.on(c,(t=>{var n,_;e.fill=null==(n=e.data)||null==(n=n.otherData)?void 0:n.selectedRelColor,e.dirty=!0,null==(_=e.canvas)||_.renderAll()})),e.on(d,(n=>{var _;e.fill=t,e.dirty=!0,null==(_=e.canvas)||_.renderAll()}))},Rt=e=>{var t;if(null!=(t=e.transform)&&t.target){const t=e.transform.target.parent;if(t){var n;const e=null==(n=t.children)?void 0:n.filter((e=>e.name===ut.Line))[0];e&&wt(e)}}},Ct=(e,t,n)=>{if(n instanceof q.fabric.ActiveSelection){const _=[];return e.isReadOnly()?e.codingFeaturesEnabled&&_.push(...le(e,t,n,!1)):_.push({isHeaderMenuItem:!1,id:"addPoint",label:"Add point",onClick:()=>{((e,t)=>{const n=e.canvas;if(t.pointer&&n){const r=e.getObjects().filter((e=>e.name===ut.Line))[0],o=e.getObjects().filter((e=>e.name===ut.Dot))[0];n.discardActiveObject();const i=r.parent;if(i){var _;const e=new oe(t.pointer.x,t.pointer.y,ut.Dot),a=St(n,e,void 0,!1,i,!1,o.scaleX,o.scaleY,r.stroke,null==(_=o.data)?void 0:_.otherData.selectedRelColor,!1);((e,t)=>{const n=e.parent;if(n){var _;let r,o;const i=[];null==(_=n.children)||_.forEach((e=>{e.name===ut.Text?r=e:e.name===ut.Rectangle?o=e:e.name!==ut.Dot&&e.name!==ut.Triangle||i.push(e)})),i.push(t),i.sort(((e,t)=>e.getCenterPoint().x-t.getCenterPoint().x)),n.children=i,n.children.push(e),r&&n.children.push(r),o&&n.children.push(o)}})(r,a),n.add(a),wt(r)}}})(n,t)}},{id:"separatorRel",isSepator:!0},...le(e,t,n,!1)),[{isHeaderMenuItem:!0,id:"relationshipContextMenu",label:"",hidden:!0,alwaysOpen:!0,subMenuItems:_}]}return n.name!==ut.Dot||e.isReadOnly()?[]:[{isHeaderMenuItem:!0,id:"dotContextMenu",label:"",hidden:!0,alwaysOpen:!0,subMenuItems:[{isHeaderMenuItem:!1,id:"removePoint",label:"Remove point",onClick:()=>{(e=>{const t=e.parent;if(t&&e.canvas){var n;const i=null==(n=t.children)?void 0:n.filter((e=>e.name===ut.Dot||e.name===ut.Triangle));if(void 0!==i&&i.length>2){var _,r;const n=null==(_=t.children)?void 0:_.filter((e=>e.name===ut.Line))[0],i=null==(r=t.children)?void 0:r.findIndex((t=>t.getCenterPoint().eq(e.getCenterPoint())));var o;void 0!==i&&i>-1&&(null==(o=t.children)||o.splice(i,1)),e.canvas.remove(e),wt(n)}}})(n)}}]}]},It=(e,t,n,_)=>{n.name!==ut.Line&&n.name!==ut.Rectangle&&e&&_.onComponentMouseUp(e,t,n,Ct(e,t,n))},kt=(e,t,n,_,r)=>{if(t.base_data&&t.base_data.alias&&t.relationship_type&&(n.auto_layout_enabled&&_[t.base_data.alias]||!n.auto_layout_enabled)){var o;const i=((e,t,n,_)=>{var r,o,i,a,s,l,c,d,g,u,b,p;const w=He(Ze(null==(r=e.base_data)?void 0:r.tags),null==_?void 0:_.tags),m={alias:null==(o=e.base_data)?void 0:o.alias};let f=1;const h=null==(i=t.shapes)?void 0:i.filter((e=>e.shape_type===ut.Dot));h&&h.length>0&&(f=null!=(a=null==(s=h[0].size)?void 0:s.scale_x)?a:1);const y=new bt(e,t,m,n,[],{visible:!1,selectable:!1},void 0,void 0,!0),v=yt(t,n),S=vt(t,n,v,y,null!=(l=null==w?void 0:w.border_color)?l:null==_||null==(c=_.diagramsThemeSettings)?void 0:c.line_color_relationship,null==_||null==(d=_.diagramsThemeSettings)?void 0:d.selected_color_relationship),O=S.map((e=>new oe(e.getCenterPoint().x,e.getCenterPoint().y,e.name))),x=Ot(t,O,y,f,null!=(g=null==w?void 0:w.border_color)?g:null==_||null==(u=_.diagramsThemeSettings)?void 0:u.line_color_relationship,null==_||null==(b=_.diagramsThemeSettings)?void 0:b.selected_color_relationship,n,null==(p=Ae(null==w?void 0:w.border_style))?void 0:p.value);return xt(e,t,n,x,S,y,_,w),pt(y),y})(t,ge(t.base_data.alias,t.from,t.to,{Relationship:t.relationship_type},n),_,r);return r&&r.skipAddToCanvas||!i||null==e||e.add(i,...null!=(o=i.children)?o:[]),i}},Dt=(e,t,n,_,r)=>{if(t.base_data&&t.base_data.alias&&t.system_type&&(n.auto_layout_enabled&&_[t.base_data.alias]||!n.auto_layout_enabled)){let o;switch(t.system_type){case"System":case"SystemDb":case"SystemQueue":o=((e,t,n,_,r)=>{var o,i,a,s,l,c;const d={bgColor:null!=(o=null==r||null==(i=r.diagramsThemeSettings)?void 0:i.bg_color_software_system)?o:S.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON,borderColor:null!=(a=null==r||null==(s=r.diagramsThemeSettings)?void 0:s.border_color_software_system)?a:S.COLORS.BORDER_COLOR_SOFTWARE_SYSTEM_PERSON,textColor:null!=(l=null==r||null==(c=r.diagramsThemeSettings)?void 0:c.text_color_software_system)?l:S.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON},g=Object.assign({},d,_);if(e.system_type)switch(e.system_type){case"System":return tt(e,t,n,g,r);case"SystemDb":return nt(e,t,n,g,r);case"SystemQueue":return at(e,t,n,g,r)}})(t,ge(t.base_data.alias,void 0,void 0,{SoftwareSystem:t.system_type},n),_,void 0,r);break;case"System_Ext":case"SystemDb_Ext":case"SystemQueue_Ext":o=((e,t,n,_,r)=>{var o,i,a,s,l,c;const d={bgColor:null!=(o=null==r||null==(i=r.diagramsThemeSettings)?void 0:i.bg_color_software_system_ext)?o:S.COLORS.BG_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,borderColor:null!=(a=null==r||null==(s=r.diagramsThemeSettings)?void 0:s.border_color_software_system_ext)?a:S.COLORS.BORDER_COLOR_SOFTWARE_SYSTEM_PERSON_EXT,textColor:null!=(l=null==r||null==(c=r.diagramsThemeSettings)?void 0:c.text_color_software_system_ext)?l:S.COLORS.TEXT_COLOR_SOFTWARE_SYSTEM_PERSON_EXT},g=Object.assign({},d,_);if(e.system_type)switch(e.system_type){case"System_Ext":return tt(e,t,n,g,r);case"SystemDb_Ext":return nt(e,t,n,g,r);case"SystemQueue_Ext":return at(e,t,n,g,r)}})(t,ge(t.base_data.alias,void 0,void 0,{SoftwareSystem:t.system_type},n),_,void 0,r)}return r&&r.skipAddToCanvas||!o||null==e||e.add(o),o}};class Lt{constructor(){this.graphviz=void 0}async initialize(){return this.graphviz=await Ne.Graphviz.load(),this}renderDiagram(e,t,n,_){if(e&&n){var r,o,i,a,s,l,c,d;if(e.diagramListener=t,e.autoLayoutEnabled=null==(r=n.diagram_spec)?void 0:r.auto_layout_enabled,e.autoLayoutOrientation=null==(o=n.diagram_spec)?void 0:o.auto_layout_orientation,e.backgroundColor=null!=(i=null==_?void 0:_.bg_color_diagram)?i:g,null!=(a=n.diagram_spec)&&a.auto_layout_enabled)if(this.graphviz){const e=function(e,t){var n,_;const r={},o=[];if(null!=(n=t.diagram_spec)&&n.auto_layout_enabled&&t.diagram_spec.auto_layout_orientation&&null!=(_=t.diagram_plantuml)&&_.elements){console.time("autoLayoutGeneration");const n=t.diagram_plantuml.elements,_=t.diagram_spec.auto_layout_orientation,s=t.diagram_spec.auto_layout_ranksep,l=t.diagram_spec.auto_layout_subgraph_inner_margin,c=t.diagram_spec.auto_layout_subgraph_outer_margin,d=t.diagram_spec.auto_layout_only_straight_arrows,g=(e=>{for(const t of e)if(pe(t)||fe(t))return!0;return!1})(n),u=function(e){let t=Re,n=Ce;return e&&(t-=.1,n-=.1),{x:Number.parseFloat(t.toFixed(2)),y:Number.parseFloat(n.toFixed(2))}}(g),b=function(e,t,n,_,r,o,i){const a=new Set;return`\n digraph G {\n pad = "${i.x},${i.y}"\n dpi = ${Te.toFixed(1)}\n penwidth="1"\n rankdir = ${"LeftToRight"===t?"LR":"TB"}\n nodesep=0\n ranksep=${n}\n compound=true\n bgcolor="red"\n ${o?"splines=ortho":""}\n node [shape="rect", fixedsize=true, penwidth="1"]\n ${Le(e,a,_,r)}\n }\n `}(n,_,s,l,c,d,u);try{var i,a;const t=e.dot(b,"json"),n=JSON.parse(t),_=function(e){const t=e.split(",");return Number.parseFloat(t[3])}(n.bb);null==(i=n.objects)||i.forEach((e=>{if(!function(e){return e.width&&0===Number.parseInt(e.width)&&e.height&&0===Number.parseInt(e.height)&&e.peripheries&&0===Number.parseInt(e.peripheries)&&""===e.label}(e)&&!function(e){return e.name.endsWith(xe)}(e)&&e._draw_){const t=e._draw_.filter((e=>"p"===e.op||"P"===e.op))[0],n=Ee(u,_,t.points[0]),o=Ee(u,_,t.points[1]),i=Ee(u,_,t.points[2]),a=o[0],s=o[1];let l;4===t.points.length&&(l={x:i[0]-o[0],y:n[1]-o[1]}),r[e.name]={position:{x:a,y:s},size:l}}})),null==(a=n.edges)||a.forEach((e=>{const t={path:[]};if(e._draw_?e._draw_.filter((e=>"b"===e.op))[0].points.forEach(((e,n)=>{var r;const o=Ee(u,_,e),i=o[0],a=o[1];0===n?t.start={x:i,y:a}:null==(r=t.path)||r.push({x:i,y:a})})):o.push(We),e._hdraw_){const n=e._hdraw_.filter((e=>"P"===e.op))[0].points,r=Ee(u,_,n[1]);t.end={x:r[0],y:r[1]}}if(e._ldraw_){var n;const r=null==(n=e._ldraw_)?void 0:n.filter((e=>"T"===e.op))[0].pt;if(r){const e=Ee(u,_,r);t.label_position={x:e[0],y:e[1]}}}if(t.start&&t.end){const n=t.path&&t.path.length>2?t.path[1]:t.end,r=t.path&&t.path.length>2?t.path[t.path.length-2]:t.start;"false"===e.keadex_fromissubgraph&&n.x&&n.y&&(t.start.x<n.x?t.start.x-=Ie:t.start.x>n.x&&(t.start.x+=Ie),t.start.y<n.y?t.start.y-=Ie:t.start.y>n.y&&(t.start.y+=Ie)),"false"===e.keadex_toissubgraph&&r.x&&r.y&&(t.end.x<r.x?t.end.x-=Ie:t.end.x>r.x&&(t.end.x+=Ie),t.end.y<r.y?t.end.y-=Ie:t.end.y>r.y&&(t.end.y+=Ie)),t.svg_path=function(e,t,n,_,r){const o=e.split(" ").slice(1).map((e=>e.split(",").map(Number)));let i=`M ${n.x} ${n.y}`;for(let e=o.length-3;e>=0;e-=3){const[n,a]=Ee(_,r,o[e+1]),[s,l]=Ee(_,r,o[e]),[c,d]=Ee(_,r,o[e-1]);let g=c,u=d;1===e&&(g=t.x,u=t.y),i+=` C ${n} ${a}, ${s} ${l}, ${g} ${u}`}return i}(e.pos,t.start,t.end,u,_)}r[e.name]=t}))}catch(e){console.error(e),o.push(We)}}return console.timeEnd("autoLayoutGeneration"),{positions:r,errors:o}}(this.graphviz,n);n.auto_layout=e.positions,n.auto_layout_errors=e.errors,e.errors.length>0&&(e.errors.indexOf(We)>=0?(console.warn(ze),je.toast.warn(ze)):(console.error(e.errors.join(", ")),je.toast.error(e.errors.join(", "))))}else console.error(Be),je.toast.error(Be);null!=(s=n.diagram_spec)&&s.grid_enabled?e.enableGrid():e.disableGrid();const u=Nt(e,null==(l=n.diagram_plantuml)?void 0:l.elements,n.diagram_spec,null!=(c=n.auto_layout)?c:{},{diagramsThemeSettings:_,tags:null==(d=n.diagram_plantuml)?void 0:d.tags});return jt(u),u}}}const Nt=(e,t,n,_,r)=>{const o=[];if(n){if(!r||!r.skipLegendRendering){const t=Pe(ge(Me,void 0,void 0,void 0,n),r);t&&(o.push(t),null==e||e.add(t))}if(t)for(const i of t)if(pe(i)){const t=et(e,pe(i),n,_,r);t&&o.push(t)}else if(we(i)){const t=st(e,we(i),n,_,r);t&&o.push(t)}else if(me(i)){const t=lt(e,me(i),n,_,r);t&&o.push(t)}else if(fe(i)){const t=ct(e,fe(i),n,_,r);t&&o.push(t)}else if(he(i)){const t=gt(e,he(i),n,_,r);t&&o.push(t)}else if(ye(i)){const t=kt(e,ye(i),n,_,r);t&&o.push(t)}else if(ve(i)){const t=Dt(e,ve(i),n,_,r);t&&o.push(t)}}return o},jt=(e,t)=>{e.forEach((e=>{let n=function(e){let t;var n,_;return t=e.isVirtualGroupParent()?null==(n=e.data)||null==(n=n.rawDiagramElementSpec)||null==(n=n.shapes)||null==(n=n.reduce(((e,t)=>{var n,_;return void 0===(null==(n=e.position)?void 0:n.z_index)?t:(void 0===(null==(_=t.position)?void 0:_.z_index)||(t.position.z_index,e.position.z_index),e)})).position)?void 0:n.z_index:null==(_=e.data)||null==(_=_.rawDiagramElementSpec)||null==(_=_.position)?void 0:_.z_index,t}(e);var _;n&&(t&&n<=t&&(n=t+1,t++),e.moveTo(n)),e.isVirtualGroupParent()&&jt(e.children,null!=(_=n)?_:Q(e.canvas,e.children[0]))}))},At=require("fontfaceobserver");var Mt=n.n(At),Ft=n(15),Pt=n(735),zt=n(61);const Bt=require("react-resize-detector");var Wt=n(691),Xt=n(693),Zt=n(732),Ht=function(e){return e[e.PlantUML=0]="PlantUML",e[e.JSON=1]="JSON",e}(Ht||{});const Yt=(0,Ft.memo)((e=>{const{setDiagramCodePanelVisible:t,diagram:n,hidden:_}=e,[r,o]=(0,Ft.useState)(Ht.PlantUML),[i,a]=(0,Ft.useState)(null==n?void 0:n.raw_plantuml);return(0,Ft.useEffect)((()=>{n&&a(r===Ht.PlantUML?n.raw_plantuml:JSON.stringify(n.diagram_spec,null,2))}),[n,r]),(0,Zt.jsxs)("div",{className:_?"hidden":"absolute z-1 bg-dark-primary/90 w-full h-full p-2 overflow-auto",children:[(0,Zt.jsx)($.K0,{icon:Xe.faXmark,className:"absolute right-5 top-3",onClick:()=>t(!1)}),n&&(0,Zt.jsxs)("div",{className:"flex flex-col",children:[(0,Zt.jsxs)("div",{children:[(0,Zt.jsx)($.$n,{className:(0,Xt.twMerge)("mr-3 w-32 normal-case",r===Ht.PlantUML?"bg-green-700!":""),onClick:()=>o(Ht.PlantUML),children:"PlantUML"}),(0,Zt.jsx)($.$n,{className:(0,Xt.twMerge)("w-32 normal-case",r===Ht.JSON?"bg-green-700!":""),onClick:()=>o(Ht.JSON),children:"JSON"})]}),(0,Zt.jsxs)("div",{className:"mt-5 p-2 bg-primary rounded-md overflow-auto whitespace-pre-wrap text-sm font-mono text-gray-300",children:[(0,Zt.jsx)($.K0,{icon:Xe.faCopy,className:"absolute right-5 text-xl",onClick:()=>{i&&navigator.clipboard.writeText(i)}}),(0,Zt.jsx)("div",{children:i})]})]})]})})),Ut="text-5xl text-dark-primary hover:text-third",Gt="text-2xl text-dark-primary hover:text-third",$t=(0,Ft.memo)((e=>{const{canvas:t,readOnly:n,diagramInfoPanelVisible:_,setDiagramInfoPanelVisible:r,diagramCodePanelVisible:o,setDiagramCodePanelVisible:i}=e;function a(){return n}return(0,Zt.jsxs)("div",{className:"absolute bottom-0 left-0 z-1 scale-[85%] opacity-20 transition hover:scale-[100%] hover:opacity-100 flex flex-row mx-2",children:[(0,Zt.jsx)($.K0,{className:(0,Xt.twMerge)(Gt,a()?"absolute":"hidden"),icon:Xe.faCircleInfo,onClick:function(){a()&&(i(!1),r(!_))}}),(0,Zt.jsx)($.K0,{className:(0,Xt.twMerge)(Gt,a()?"absolute bottom-1":"hidden"),icon:Xe.faCode,onClick:function(){a()&&(r(!1),i(!o))}}),(0,Zt.jsx)("div",{className:"flex flex-col",children:(0,Zt.jsx)($.K0,{className:(0,Xt.twMerge)(Ut,"my-auto!"),icon:Xe.faCaretLeft,onClick:()=>null==t?void 0:t.panLeft()})}),(0,Zt.jsxs)("div",{className:"flex flex-col",children:[(0,Zt.jsx)($.K0,{className:Ut,icon:Xe.faCaretUp,onClick:()=>null==t?void 0:t.panDown()}),(0,Zt.jsxs)("div",{children:[(0,Zt.jsx)($.K0,{className:(0,Xt.twMerge)(Gt,"ml-1"),icon:Xe.faMagnifyingGlassPlus,onClick:()=>null==t?void 0:t.zoomIn()}),(0,Zt.jsx)($.K0,{className:(0,Xt.twMerge)(Gt,"mx-2 text-xl!"),icon:Xe.faRotateLeft,onClick:()=>{null==t||t.resetZoom(),null==t||t.resetPan()}}),(0,Zt.jsx)($.K0,{className:(0,Xt.twMerge)(Gt,"mr-1"),icon:Xe.faMagnifyingGlassMinus,onClick:()=>null==t?void 0:t.zoomOut()})]}),(0,Zt.jsx)($.K0,{className:Ut,icon:Xe.faCaretDown,onClick:()=>null==t?void 0:t.panUp()})]}),(0,Zt.jsx)("div",{className:"flex flex-col",children:(0,Zt.jsx)($.K0,{className:(0,Xt.twMerge)(Ut,"my-auto!"),icon:Xe.faCaretRight,onClick:()=>null==t?void 0:t.panRight()})})]})})),qt=(0,Ft.memo)((e=>{var t,n,_;const{tagsDirection:r,scrollable:o,diagram:i,handleDiagramHeaderClick:a}=e;return(null==i?void 0:i.diagram_type)&&(0,Zt.jsxs)("div",{className:(0,Xt.twMerge)("w-full text-left flex flex-col items-center py-1 pr-3",a?"cursor-pointer":""),onClick:function(){a&&a()},children:[(0,Zt.jsxs)("div",{className:(0,Xt.twMerge)("flex w-full my-auto","bottom"===r?"flex-col":""),children:[(0,Zt.jsxs)("div",{className:"text-lg text-accent-primary grow truncate",children:[(s=i.diagram_type,(0,G.capitalCase)((0,G.noCase)(s)))," Diagram -"," ",i.diagram_name]}),(null==(t=i.diagram_spec)?void 0:t.tags)&&(0,Zt.jsx)("div",{className:"bottom"===r?"mt-2 mb-5":"",children:(0,Zt.jsx)($.YD,{tags:i.diagram_spec.tags,className:"right"===r?"float-right top-1/2 -translate-y-1/2":""})})]}),(null==(n=i.diagram_spec)?void 0:n.description)&&(0,Zt.jsx)("div",{className:(0,Xt.twMerge)("w-full text-sm text-accent-secondary whitespace-break-spaces",o?"":"line-clamp-3"),children:null==(_=i.diagram_spec)?void 0:_.description})]});var s})),Vt=(0,Ft.memo)((e=>{const{setDiagramInfoPanelVisible:t,diagram:n,hidden:_}=e;return(0,Zt.jsxs)("div",{className:_?"hidden":"absolute z-1 bg-dark-primary/90 w-full p-2 max-h-96 overflow-auto",children:[(0,Zt.jsx)($.K0,{icon:Xe.faXmark,className:"absolute right-5 top-3",onClick:()=>t(!1)}),n&&(0,Zt.jsx)(qt,{diagram:n,tagsDirection:"bottom",scrollable:!0})]})}));var Jt=n(53);const Kt=e=>{const{t}=(0,zt.useTranslation)(),[n,_]=(0,Ft.useState)(e.enabled),[o,i]=(0,Ft.useState)(e.orientation),[a,s]=(0,Ft.useState)(e.generateOnlyStraightArrows),[l,c]=(0,Ft.useState)(e.ranksep),[d,g]=(0,Ft.useState)(e.subgraphInnerMargin),[u,b]=(0,Ft.useState)(e.subgraphOuterMargin);return(0,Zt.jsxs)("div",{children:[(0,Zt.jsxs)("div",{className:"modal__body",children:[(0,Zt.jsxs)("div",{className:"flex flex-col",children:[(0,Zt.jsxs)("div",{className:"flex flex-row",children:[(0,Zt.jsxs)("span",{children:[t("common.status"),"*:"]}),(0,Zt.jsx)($.sx,{id:"autolayout-status",className:"ml-5",value:n,options:[{label:t("common.enabled"),value:!0},{label:t("common.disabled"),value:!1}],onChange:e=>{_(e)}})]}),(0,Zt.jsxs)("span",{className:(0,Xt.twMerge)("text-sm text-orange-500 mt-2",!e.enabled&&n?"block":"hidden"),children:[(0,Zt.jsx)(Jt.FontAwesomeIcon,{icon:Xe.faWarning,className:"mr-1 text-yellow-500"}),t("diagram_editor.warning_enable_autolayout")]})]}),(0,Zt.jsxs)("div",{className:"flex flex-row mt-5",children:[(0,Zt.jsxs)("span",{children:[`${t("diagrams_settings.gen_only_straight_arrows")}*`,":"]}),(0,Zt.jsx)($.sx,{id:"autolayout-straight-arrows-status",className:"ml-5",value:a,options:[{label:t("common.yes"),value:!0},{label:t("common.no"),value:!1}],onChange:e=>{s(e)}})]}),(0,Zt.jsx)($.l6,{id:"autolayout-orientation-selector",label:`${t("common.orientation")}*`,className:"mt-8",value:o,options:r.map((e=>({label:e,value:e}))),onChange:e=>i(e.target.value)}),(0,Zt.jsx)($.pd,{id:"autolayout-ranksep",type:"number",label:"ranksep*",min:0,classNameRoot:"mt-6",info:`${t("diagrams_settings.ranksep_description")}`,value:l,onChange:e=>c(Number.parseFloat(e.target.value))}),(0,Zt.jsx)($.pd,{id:"autolayout-subgraph-inner-margin",type:"number",label:`${t("diagrams_settings.subgraph_inner_margin")}`,min:0,classNameRoot:"mt-6",value:d,onChange:e=>g(Number.parseFloat(e.target.value))}),(0,Zt.jsx)($.pd,{id:"autolayout-subgraph-outer-margin",type:"number",label:`${t("diagrams_settings.subgraph_outer_margin")}`,min:0,classNameRoot:"mt-6",value:u,onChange:e=>b(Number.parseFloat(e.target.value))})]}),(0,Zt.jsx)("div",{className:"modal__footer",children:(0,$.CL)([{key:"button-cancel",children:(0,Zt.jsx)("span",{children:t("common.cancel")}),"data-te-modal-dismiss":!0},{key:"button-save",children:(0,Zt.jsx)("span",{children:t("common.save")}),onClick:function(){e.onAutoLayoutConfigured(n,o,a,l,d,u),e.hideModal()}}])})]})},Qt=e=>{const{t}=(0,zt.useTranslation)(),[n,_]=(0,Ft.useState)(e.settings);return(0,Zt.jsxs)("div",{children:[(0,Zt.jsx)("div",{className:"modal__body",children:(0,Zt.jsx)("div",{className:"flex flex-col",children:(0,Zt.jsxs)("div",{className:"flex flex-row",children:[(0,Zt.jsxs)("span",{children:[t("diagrams_settings.grid_enabled"),"*:"]}),(0,Zt.jsx)($.sx,{id:"autolayout-status",className:"ml-5",value:n.gridEnabled,options:[{label:t("common.enabled"),value:!0},{label:t("common.disabled"),value:!1}],onChange:e=>{_(Object.assign({},n,{gridEnabled:e}))}})]})})}),(0,Zt.jsx)("div",{className:"modal__footer",children:(0,$.CL)([{key:"button-cancel",children:(0,Zt.jsx)("span",{children:t("common.cancel")}),"data-te-modal-dismiss":!0},{key:"button-save",children:(0,Zt.jsx)("span",{children:t("common.save")}),onClick:function(){e.onSettingsChanged(n),e.hideModal()}}])})]})},en=require("@tauri-apps/api/core");JSON.parse(!0),JSON.parse(!0);const tn=["auto_layout"],nn=["auto_layout"],_n=(0,Ft.forwardRef)(((e,t)=>{const{readOnly:n,diagram:r,diagramListener:o,diagramDesignViewToolbarCommands:i,saveDiagram:s,diagramsThemeSettings:l}=e,{t:c}=(0,zt.useTranslation)(),d=(0,Ft.useRef)(void 0),g=(0,Ft.useRef)(null),u=(0,Ft.useRef)(null),{ref:b}=(0,Bt.useResizeDetector)(),p=(0,Ft.useRef)(void 0),w=(0,Ft.useRef)(!1),m=(0,Ft.useRef)(!1),f=(0,Ft.useRef)(!1),[h,y]=(0,Ft.useState)([]),[S,O]=(0,Ft.useState)([]),[x,E]=(0,Ft.useState)(!1),[T,R]=(0,Ft.useState)(!1),[C,I]=(0,Ft.useState)(),{modal:k,showModal:D,hideModal:L}=(0,$.hS)();let N=p.current,j=r;function A(){w.current=!0,n||function(){if(!f.current){const e=W();e&&y((t=>[...t,e]))}}()}function M(t){const n={fireRightClick:!0,fireMiddleClick:!0,stopContextMenu:!0,backgroundColor:"white",readOnly:e.readOnly,enableSnapToGrid:!0},_=new $.vL(g.current,n);_.on("object:added",A),_.on("object:removed",A),_.on(a,A),_.on("mouse:down",(()=>m.current=!0)),_.on("mouse:out",(()=>m.current=!1)),_.codingFeaturesEnabled="desktop"===e.target,w.current=!1,t&&(_.setZoom(t.zoom),_.relativePan(new q.fabric.Point(t.pan.panX,t.pan.panY))),d.current=_}function F(){d.current&&(d.current.dispose(),d.current=void 0)}function P(e){F(),M(e)}function z(){var e,t;return{zoom:null!=(e=null==(t=d.current)?void 0:t.getZoom())?e:1,pan:ne(d.current)}}async function B(){var e;if(null!=(e=p.current)&&e.diagram_name&&p.current.diagram_type&&d.current){const e="png";console.debug(`Exporting to ${e}`);const t=d.current.viewportTransform;d.current.viewportTransform=q.fabric.iMatrix.slice(0);let{width:n,height:_,left:r,top:o}=K(d.current.getObjects());n&&_&&r&&o&&(n+=50,_+=50,r-=25,o-=25),await async function(e,t,n,_){return(0,en.invoke)("export_diagram_to_file",{diagramDataUrl:n,format:_,diagramName:e,diagramType:t})}(p.current.diagram_name,p.current.diagram_type,d.current.toDataURL({format:e,enableRetinaScaling:!0,width:n,height:_,left:r,top:o}),e).then((e=>je.toast.success(c("common.info.diagram_exported",{pathExportedDiagram:e})))).catch((e=>je.toast.success(e.msg))),d.current.viewportTransform=t}}function W(){if(p.current&&p.current.diagram_plantuml&&p.current.diagram_spec&&p.current.diagram_name&&p.current.diagram_type){var e,t;const n=void 0!==(null==(e=d.current)?void 0:e.autoLayoutEnabled)?d.current.autoLayoutEnabled:p.current.diagram_spec.auto_layout_enabled;let _=[];return n||(_=(e=>{const t=Array();return e&&e.getObjects().forEach((e=>{if(e instanceof se){const n=e.getUpdatedSpecs();n&&t.push(n)}})),t})(d.current)),Object.assign({},p.current.diagram_spec,{auto_layout_enabled:n,auto_layout_orientation:void 0!==(null==(t=d.current)?void 0:t.autoLayoutOrientation)?d.current.autoLayoutOrientation:p.current.diagram_spec.auto_layout_orientation,elements_specs:_})}}function X(){return w.current}function Z(){var e;return!(null==(e=p.current)||!e.diagram_spec)&&p.current.diagram_spec.auto_layout_enabled}function H(){var e;return null!=(e=p.current)&&e.diagram_spec?p.current.diagram_spec.auto_layout_orientation:"TopToBottom"}function Y(){var e;return!(null==(e=p.current)||!e.diagram_spec)&&p.current.diagram_spec.auto_layout_only_straight_arrows}function G(){var e;return null!=(e=p.current)&&e.diagram_spec?p.current.diagram_spec.auto_layout_ranksep:0}function V(){var e;return null!=(e=p.current)&&e.diagram_spec?p.current.diagram_spec.auto_layout_subgraph_inner_margin:0}function J(){var e;return null!=(e=p.current)&&e.diagram_spec?p.current.diagram_spec.auto_layout_subgraph_outer_margin:6.5}function Q(e,t,_,r,o,i){d.current&&p.current&&!n&&D({id:"showAutoLayoutConfigurationModal",title:`${c("diagram_editor.configure_auto_layout")}`,body:(0,Zt.jsx)(Kt,{enabled:e,orientation:t,generateOnlyStraightArrows:_,ranksep:r,subgraphInnerMargin:o,subgraphOuterMargin:i,hideModal:L,onAutoLayoutConfigured:(e,t,_,r,o,i)=>{d.current&&p.current&&!n&&(d.current.autoLayoutEnabled=e,d.current.autoLayoutOrientation=t,p.current.diagram_spec&&(p.current.diagram_spec.auto_layout_only_straight_arrows=_,p.current.diagram_spec.auto_layout_ranksep=r,p.current.diagram_spec.auto_layout_subgraph_inner_margin=o,p.current.diagram_spec.auto_layout_subgraph_outer_margin=i),w.current=!0,s&&s())}}),buttons:!1})}function ee(){var e;if(null!=(e=p.current)&&e.diagram_spec)return{gridEnabled:p.current.diagram_spec.grid_enabled}}function te(e){e&&d.current&&p.current&&!n&&D({id:"showDiagramDesignViewSettingsModal",title:`${c("common.settings")}`,body:(0,Zt.jsx)(Qt,{settings:e,hideModal:L,onSettingsChanged:e=>{var t;d.current&&p.current&&!n&&(e.gridEnabled?d.current.enableGrid():d.current.disableGrid(),p.current.diagram_spec&&(p.current.diagram_spec.grid_enabled=null!=(t=e.gridEnabled)&&t),w.current=!0,s&&s())}}),buttons:!1})}function _e(){var t,n;null!=(t=p.current)&&t.diagram_spec&&d.current&&!e.readOnly&&(null!=(n=p.current)&&n.diagram_spec.auto_layout_enabled?d.current.setReadOnly():d.current.setReadAndWrite())}function re(e){var t;d.current&&(P(z()),_e(),C?C.renderDiagram(d.current,o,Object.assign({},p.current,{diagram_spec:e}),l):console.error("DiagramRenderer not initialized"),null==(t=d.current)||t.renderAll(),w.current=!0,console.debug("Load history completed"))}function oe(){if(f.current=!0,ae()){const e=h[h.length-1],t=h[h.length-2];p.current&&e&&t&&(console.debug("Undo design view"),y((e=>e.filter(((t,n)=>n!==e.length-1)))),O((t=>[...t,e])),re(t))}f.current=!1}function ie(){if(console.debug("Redo design view"),f.current=!0,le()){const e=S[S.length-1];e&&(O((e=>e.filter(((t,n)=>n!==e.length-1)))),y((t=>[...t,e])),re(e))}f.current=!1}function ae(){return!n&&h.length>1}function le(){return!n&&S.length>0}return N&&(N=(0,_.A)(N,tn)),j&&(j=(0,_.A)(j,nn)),(0,U.$r)(N,j)||(p.current=r),(0,Ft.useImperativeHandle)(t,(()=>({resetCanvas:P,getCanvasState:z,exportDiagram:B,getUpdatedDiagramSpec:W,isDiagramChanged:X,undo:oe,redo:ie,canUndo:ae,canRedo:le,isAutoLayoutEnabled:Z,autoLayoutOrientation:H,updateAutoLayoutOptions:Q,isGenerateOnlyStraightArrowsEnabled:Y,ranksep:G,updateDiagramDesignViewSettings:te,diagramDesignViewSettings:ee,subgraphInnerMargin:V,subgraphOuterMargin:J}))),(0,Ft.useLayoutEffect)((()=>{var e,t,n,_,r,o,i;console.debug("Diagram Design View changed layout"),g.current&&null!=(e=u.current)&&e.clientWidth&&null!=(t=u.current)&&t.clientHeight&&(console.debug("Canvas resize"),g.current.parentElement&&(g.current.parentElement.style.display="none"),null==(n=d.current)||n.setWidth(null==(_=u.current)?void 0:_.getBoundingClientRect().width),null==(r=d.current)||r.setHeight(null==(o=u.current)?void 0:o.getBoundingClientRect().height),g.current.parentElement&&(g.current.parentElement.style.display="flex"),null==(i=d.current)||i.renderAll())})),(0,Ft.useEffect)((()=>(new(Mt())(v.FONT.FAMILY).load(null,36e4).then((function(){d.current&&(function(e){e.getObjects().forEach((e=>e.set("dirty",!0)))}(d.current),d.current.renderAll())})),g.current&&!d.current&&M(),()=>{F()})),[]),(0,Ft.useEffect)((()=>{function e(e){n||"Z"!==e.key.toUpperCase()&&"Y"!==e.key.toUpperCase()||!e.ctrlKey&&!e.metaKey||!m.current||(e.preventDefault(),"Z"===e.key.toUpperCase()?oe():"Y"===e.key.toUpperCase()&&ie())}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[n,h,S]),(0,Ft.useEffect)((()=>{var e,t;d.current&&p.current&&C&&(f.current=!0,console.debug("Rendering the diagram"),_e(),C.renderDiagram(d.current,o,p.current,l),null==(e=d.current)||e.renderAll(),w.current=!1,f.current=!1,n||(f.current=!1,null!=(t=p.current)&&t.diagram_spec&&y([p.current.diagram_spec]),O([])))}),[p.current,C]),(0,Ft.useEffect)((()=>{var e;!n&&i&&(console.debug("Update design toolbar"),null==(e=i.current)||e.forceUpdate())}),[n,h,S,i]),(0,Ft.useEffect)((()=>{!async function(){const e=await(new Lt).initialize();I(e)}()}),[]),(0,Pt.useHotkeys)([Wt.Key.Escape],(e=>{var t;d.current&&(e.preventDefault(),null==(t=d.current)||t.discardActiveObject())})),(0,Zt.jsxs)("div",{className:"relative h-full w-full",ref:b,children:[k,(0,Zt.jsx)($t,{canvas:d.current,readOnly:n,diagramInfoPanelVisible:x,setDiagramInfoPanelVisible:E,diagramCodePanelVisible:T,setDiagramCodePanelVisible:R}),(0,Zt.jsx)(Vt,{diagram:r,hidden:!x,setDiagramInfoPanelVisible:E}),(0,Zt.jsx)(Yt,{diagram:r,hidden:!T,setDiagramCodePanelVisible:R}),(0,Zt.jsx)("div",{className:"h-full w-full flex-row flex-wrap",ref:u,children:(0,Zt.jsx)("canvas",{ref:g})})]})}))},768(e,t,n){n.d(t,{$n:()=>g,tz:()=>C,rI:()=>T,UW:()=>b,K0:()=>k,pd:()=>L,vL:()=>m,sx:()=>z,l6:()=>W,YD:()=>X,CL:()=>A,T_:()=>G,hS:()=>P});var _=n(452);n.n(_)().addPluralRule(/Person/,"Persons");var r=n(454),o=n(15);require("react-html-parser");var i=n(693),a=n(221),s=n(732),l=n(644);const c=(0,o.memo)((e=>{const{className:t}=e;return(0,s.jsx)("div",{className:(0,i.twMerge)("inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",t),role:"status",children:(0,s.jsx)("span",{className:"absolute! -m-px! h-px! w-px! overflow-hidden! whitespace-nowrap! border-0! p-0! [clip:rect(0,0,0,0)]!",children:"Loading..."})})})),d=["children","isLoading","disabled"],g=(0,o.memo)((e=>{const t=(0,r.Cp)(e),{children:n,isLoading:_,disabled:o}=e,a=(0,l.A)(e,d);return(0,s.jsxs)("button",Object.assign({},a,t,{disabled:o||_,type:"button","data-te-toggle":"button",className:(0,i.twMerge)("button--primary inline-block min-w-[75px] rounded-sm px-5 py-2 text-xs font-medium uppercase leading-tight shadow-md transition duration-75 ease-in-out hover:shadow-lg focus:shadow-lg focus:outline-hidden focus:ring-0 active:shadow-lg",e.className),children:[_&&(0,s.jsx)(c,{className:"icon !h-4 !w-4"}),!_&&n]}))}));var u=n(489);const b={CONTEXT_MENU:"contextmenu"},p="idle",w="panning";class m extends u.fabric.Canvas{constructor(e,t){super(e,t),this.gridEnabled=void 0,this.gridBgColor=void 0,h(this),y(this)}initialize(e,t){return this.gridEnabled=null==t?void 0:t.gridEnabled,h(this),y(this),!0===(null==t?void 0:t.readOnly)&&this.setReadOnly(),!0===(null==t?void 0:t.gridEnabled)&&this.enableGrid(),!0===(null==t?void 0:t.enableSnapToGrid)&&function(e,t){const n=null!=t?t:5;e.on("object:moving",(e=>{var t,_,r;null==(t=e.target)||t.set({left:Math.round((null!=(_=e.target.left)?_:0)/n)*n,top:Math.round((null!=(r=e.target.top)?r:0)/n)*n})}))}(this,t.gridSize),super.initialize(e,t)}isReadOnly(){return u.fabric.Object.prototype.lockMovementX&&u.fabric.Object.prototype.lockMovementY&&u.fabric.Object.prototype.lockRotation&&u.fabric.Object.prototype.lockScalingFlip&&u.fabric.Object.prototype.lockScalingX&&u.fabric.Object.prototype.lockScalingY&&u.fabric.Object.prototype.lockSkewingX&&u.fabric.Object.prototype.lockSkewingY}setReadOnly(){u.fabric.Object.prototype.lockMovementX=!0,u.fabric.Object.prototype.lockMovementY=!0,u.fabric.Object.prototype.lockRotation=!0,u.fabric.Object.prototype.lockScalingFlip=!0,u.fabric.Object.prototype.lockScalingX=!0,u.fabric.Object.prototype.lockScalingY=!0,u.fabric.Object.prototype.lockSkewingX=!0,u.fabric.Object.prototype.lockSkewingY=!0}setReadAndWrite(){u.fabric.Object.prototype.lockMovementX=!1,u.fabric.Object.prototype.lockMovementY=!1,u.fabric.Object.prototype.lockRotation=!1,u.fabric.Object.prototype.lockScalingFlip=!1,u.fabric.Object.prototype.lockScalingX=!1,u.fabric.Object.prototype.lockScalingY=!1,u.fabric.Object.prototype.lockSkewingX=!1,u.fabric.Object.prototype.lockSkewingY=!1}zoomIn(){this.setZoom(1.1*this.getZoom())}zoomOut(){this.setZoom(this.getZoom()/1.1)}resetZoom(){this.setZoom(1)}panLeft(){this.relativePan(new u.fabric.Point(5,0))}panRight(){this.relativePan(new u.fabric.Point(-5,0))}panUp(){this.relativePan(new u.fabric.Point(0,5))}panDown(){this.relativePan(new u.fabric.Point(0,-5))}resetPan(){this.absolutePan(new u.fabric.Point(0,0))}isGridEnabled(){var e;return null!=(e=this.gridEnabled)&&e}enableGrid(){if(!this.gridEnabled){this.gridEnabled=!0,this.gridBgColor=this.backgroundColor;const e=`\n<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160"><rect width="160" height="160" fill="${this.gridBgColor}" /><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><rect x="0.38" y="0.38" width="160" height="160" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.75px"/><line x1="0.38" y1="140.38" x2="160.38" y2="140.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="0.38" y1="120.38" x2="160.38" y2="120.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="0.38" y1="100.38" x2="160.38" y2="100.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="0.38" y1="80.38" x2="160.38" y2="80.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.5px"/><line x1="0.38" y1="60.38" x2="160.38" y2="60.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="0.38" y1="40.38" x2="160.38" y2="40.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="0.38" y1="20.38" x2="160.38" y2="20.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="140.38" y1="0.38" x2="140.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="120.38" y1="0.38" x2="120.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="100.38" y1="0.38" x2="100.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="80.38" y1="0.38" x2="80.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.5px"/><line x1="60.38" y1="0.38" x2="60.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="40.38" y1="0.38" x2="40.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/><line x1="20.38" y1="0.38" x2="20.38" y2="160.38" style="fill:none;stroke:#bcbec0;stroke-miterlimit:10;stroke-width:0.25px"/></g></g></svg>\n`,t=new Blob([e],{type:"image/svg+xml"}),n=URL.createObjectURL(t);u.fabric.Image.fromURL(n,(e=>{var t,n;e.scaleToWidth(null!=(t=this.width)?t:0),e.scaleToHeight(null!=(n=this.height)?n:0);const _=new u.fabric.Pattern({source:e.getElement(),repeat:"repeat"});this.setBackgroundColor(_,this.renderAll.bind(this))}))}}disableGrid(){this.gridEnabled&&(this.gridEnabled=!1,this.gridBgColor&&(this.setBackgroundColor(this.gridBgColor,this.renderAll.bind(this)),this.gridBgColor=void 0))}}function f(e){return 3===e.button}function h(e){e.on("mouse:wheel",(function(t){const n=t.e.deltaY;let _=e.getZoom();_*=.999**n,_>20&&(_=20),_<.01&&(_=.01),e.zoomToPoint({x:t.e.offsetX,y:t.e.offsetY},_),t.e.preventDefault(),t.e.stopPropagation()}))}function y(e){let t,n,_=p;e.discardActiveObject(),e.on("mouse:up",(function(t){f(t)&&(_=p,e.defaultCursor="default")})),e.on("mouse:down",(r=>{f(r)&&(e.defaultCursor="move",_=w,t=r.e.clientX,n=r.e.clientY)})),e.on("mouse:move",(r=>{if(_===w&&r&&r.e){let _=0,o=0;t&&(_=r.e.clientX-t),n&&(o=r.e.clientY-n),t=r.e.clientX,n=r.e.clientY;const i=new u.fabric.Point(_,o);e.relativePan(i),e.fire("moved")}}))}n(423),require("react-color"),n(735),n(691);var v=n(177),S=n(53);const O="hide.te.dropdown",x="show.te.dropdown",E=(0,o.memo)((e=>{var t;const n=(0,o.useRef)(null),[_,r]=(0,o.useState)(!1);function a(e){let t;return t=e.isSepator?(0,s.jsx)("li",{className:"relative",children:(0,s.jsx)("span",{className:"bg-third my-1 block h-px w-full"})},e.id):(0,s.jsxs)("li",{className:"relative",children:[(0,s.jsxs)("button",{disabled:void 0!==e.disabled&&e.disabled,id:e.id,className:"\n hover:bg-link\n flex\n w-full\n items-center\n whitespace-nowrap\n px-4\n py-1\n text-left\n text-sm\n hover:text-white\n ","data-te-dropdown-item-ref":!0,onClick:t=>{e.onClick&&e.onClick(t)},children:[e.subMenuItems&&e.subMenuItems.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"mr-16 basis-11/12 pr-1",children:e.label}),(0,s.jsx)("span",{className:"basis-1/12 text-right",children:(0,s.jsx)(S.FontAwesomeIcon,{icon:v.faAngleRight})})]}),(!e.subMenuItems||0===e.subMenuItems.length)&&e.label]}),l(e.isHeaderMenuItem,e.id,e.subMenuItems)]},e.id),t}function l(e,t,n){const _=[];if(n&&n.length>0){for(const e of n)_.push(a(e));return(0,s.jsx)("ul",{className:(0,i.twMerge)("\n bg-secondary\n text-accent-primary\n absolute\n z-50\n m-0\n w-auto\n min-w-max\n list-none\n rounded-md\n border-none\n bg-clip-padding\n py-2\n shadow-[0_1px_2px_rgba(0,0,0,0.6)]\n data-te-dropdown-show:block",e?" dropdown-menu float-left hidden origin-top-left":" right-px top-0"),id:`menu-${t}`,"aria-labelledby":t,"data-te-dropdown-menu-ref":!0,children:_})}return(0,s.jsx)("div",{"data-te-dropdown-menu-ref":!0})}const c=t=>{e.increaseOpenedMenu&&e.setLastOpenedMenu&&e.decreaseOpenedMenu&&(t.type===x?(r(!0),e.increaseOpenedMenu(),e.setLastOpenedMenu(e.id)):(r(!1),e.decreaseOpenedMenu()))};return(0,o.useEffect)((()=>{const t=n.current;return null==t||t.addEventListener(O,c),null==t||t.addEventListener(x,c),(e.alwaysOpen&&!_||e.lastOpenedMenu!==e.id&&_)&&(null==t||t.dispatchEvent(new MouseEvent("click"))),()=>{null==t||t.removeEventListener(O,c),null==t||t.removeEventListener(x,c)}})),(0,s.jsxs)("div",{className:(0,i.twMerge)("relative",null!=(t=e.className)?t:""),"data-te-dropdown-ref":!0,children:[(0,s.jsx)("button",{className:(0,i.twMerge)(_?"":" bg-dark-primary text-accent-primary","hover:bg-primary\n flex\n items-center\n whitespace-nowrap\n rounded-md\n px-2\n py-0.5\n text-sm hover:text-white\n hover:shadow-[0_1px_2px_rgba(0,0,0,0.6)]\n focus:outline-hidden\n focus:ring-0",_?" bg-primary show text-white":"",e.hidden?" h-0 opacity-0":"",e.buttonClassName?` ${e.buttonClassName}`:""),type:"button",id:e.id,"aria-expanded":"false",ref:n,"data-te-dropdown-toggle-ref":!0,"data-te-dropdown-animation":"off",onMouseEnter:t=>{e.atLeastOneOpenedMenu&&e.atLeastOneOpenedMenu()&&!_&&t.target.dispatchEvent(new MouseEvent("click"))},children:e.label}),l(e.isHeaderMenuItem,e.id,e.subMenuItems)]},e.id)})),T=(0,o.memo)((e=>{var t;const[n,_]=(0,o.useState)(0),[r,a]=(0,o.useState)("");function l(){_((e=>e+1))}function c(){_((e=>e-1))}function d(){return n>0}return(0,s.jsx)("div",{className:(0,i.twMerge)("dropdown-menu group flex",d()?"open":"",null!=(t=e.className)?t:""),children:function(){const t=[];if(e.menuItemsProps&&e.menuItemsProps.length>0)for(const n of e.menuItemsProps)t.push((0,o.createElement)(E,Object.assign({},n,{key:n.id,increaseOpenedMenu:l,decreaseOpenedMenu:c,atLeastOneOpenedMenu:d,lastOpenedMenu:r,setLastOpenedMenu:a})));return t}()})})),R=T,C=()=>{const{anchorPoint:e,show:t,contextMenuItems:n}=(()=>{const[e,t]=(0,o.useState)({x:0,y:0}),[n,_]=(0,o.useState)(!1),[r,i]=(0,o.useState)([]),a=(0,o.useCallback)((e=>{if(e.preventDefault(),(n=e)instanceof CustomEvent&&n instanceof CustomEvent&&Object.keys(n.detail).includes("menuItems")){const n=e.detail.pageX,r=e.detail.pageY;i(e.detail.menuItems),t({x:n,y:r}),_(!0)}var n}),[_,t]),s=(0,o.useCallback)((()=>n?_(!1):null),[n]);return(0,o.useEffect)((()=>(document.addEventListener("click",s),document.addEventListener("contextmenu",a),()=>{document.removeEventListener("click",s),document.removeEventListener("contextmenu",a)}))),{anchorPoint:e,show:n,contextMenuItems:r}})(),_=(0,o.useRef)(void 0),[r,i]=(0,o.useState)((0,s.jsx)(s.Fragment,{}));return _.current!==t&&(_.current=t),(0,o.useEffect)((()=>{void 0!==_.current&&(_.current?i((0,s.jsx)("div",{hidden:!t,className:"context-menu absolute",style:{top:e.y,left:e.x},children:(0,s.jsx)(R,{menuItemsProps:n})})):i((0,s.jsx)(s.Fragment,{})))}),[_.current]),r},I=["icon","classNameIcon","classNameContent"],k=(0,o.memo)((e=>{const{icon:t,classNameIcon:n,classNameContent:_}=e,o=(0,l.A)(e,I),a=(0,r.Cp)(e);return(0,s.jsxs)("button",Object.assign({},o,a,{className:(0,i.twMerge)("text-accent-secondary hover:text-accent-primary [&.active]:text-accent-primary disabled:hover:text-accent-secondary disabled:opacity-50",e.className),children:[(0,s.jsx)(S.FontAwesomeIcon,{icon:null!=t?t:v.faXmark,className:null!=n?n:""}),(0,s.jsx)("div",{className:_,children:e.children})]}))})),D=["label","info","allowedChars","classNameRoot","key"],L=(0,o.memo)((e=>{const[t,n]=(0,o.useState)(e.value),{info:_,classNameRoot:a,key:c}=e,d=(0,l.A)(e,D),g=(0,r.Cp)(e);return(0,o.useEffect)((()=>{n(e.value)}),[e.value]),(0,s.jsxs)("div",{className:(0,i.twMerge)("relative mb-3",null!=a?a:""),children:[(0,s.jsx)("input",Object.assign({maxLength:200},d,g,{onChange:function(_){!e.allowedChars||""===_.currentTarget.value||e.allowedChars.test(_.currentTarget.value)?(n(_.currentTarget.value),e.onChange&&e.onChange(_)):t&&(_.currentTarget.value=t.toString())},"data-te-input-state-active":!0,className:(0,i.twMerge)("peer transition-all duration-200 ease-linear placeholder:opacity-0 motion-reduce:transition-none",e.className),placeholder:e.label}),c),(0,s.jsx)("label",{htmlFor:e.id,className:(0,i.twMerge)(null!=t&&""!==t?"input__label -translate-y-[1.1rem] scale-[0.9]":"","peer-focus:text-link peer-focus:input__label pointer-events-none absolute left-3 top-0 mb-0 max-w-[90%] origin-top-left truncate pt-[0.37rem] leading-[1.6] drop-shadow-[0_35px_35px_rgba(0,0,0,0.25)] transition-all duration-200 ease-out peer-focus:-translate-y-[1.1rem] peer-focus:scale-[0.9] motion-reduce:transition-none"),children:e.label}),_&&(0,s.jsx)("div",{className:"text-sm px-3 mt-1",children:_})]})})),N=["key"],j="hidden.te.modal";function A(e){const t=[];return"boolean"!=typeof e&&e&&e.forEach(((e,n,_)=>{const o=(0,r.Cp)(e),{key:a}=e,c=(0,l.A)(e,N);t.push((0,s.jsx)(g,Object.assign({},c,o,{className:(0,i.twMerge)(0!==n&&_.length>1?"ml-3":"",e.className)}),a))})),t}const M=(0,o.forwardRef)(((e,t)=>{var n;const{id:_,onHiddenModal:r}=e,l=null!=(n=e.size)?n:"md",c=(0,o.useRef)(void 0);return(0,o.useEffect)((()=>{function e(){r&&r()}const t=document.getElementById(_);return!c.current&&t&&(c.current=new a.Modal(t)),t&&t.addEventListener(j,e),()=>{t&&t.removeEventListener(j,e)}}),[_,r]),(0,o.useImperativeHandle)(t,(()=>({showModal:()=>{c.current.show()},hideModal:()=>{c.current.hide(),c.current=void 0}}))),(0,s.jsx)("div",{"data-te-modal-init":!0,className:"fixed left-0 top-8 bottom-0 z-[1055] hidden h-auto w-full overflow-y-auto overflow-x-hidden outline-hidden",id:_,tabIndex:-1,"aria-labelledby":`${_}Label`,children:(0,s.jsx)("div",{"data-te-modal-dialog-ref":!0,className:"pointer-events-none relative flex min-h-[calc(100%-1rem)] w-auto items-center justify-center opacity-0 transition-all duration-300 ease-in-out min-[576px]:mx-5 min-[576px]:my-7 min-[576px]:min-h-[calc(100%-3.5rem)]",children:(0,s.jsxs)("div",{className:(0,i.twMerge)("pointer-events-auto relative flex",(()=>{switch(l){case"sm":return"w-[25rem]";case"md":return"w-[40rem]";case"lg":return"w-[70rem]";case"full":return"w-full"}})(),"full"===e.size?"mx-5":"","bg-primary flex-col rounded-md border-none bg-clip-padding text-current shadow-lg outline-hidden"),children:[(0,s.jsxs)("div",{className:"border-secondary/50 flex shrink-0 items-center justify-between rounded-t-md border-b-2 p-4",children:[(0,s.jsx)("h5",{className:"text-accent-primary text-xl font-medium leading-normal pointer-events-none",id:`${_}Label`,children:e.title}),(0,s.jsx)("button",{type:"button",className:"box-content rounded-none border-none hover:no-underline hover:opacity-75 focus:opacity-100 focus:shadow-none focus:outline-hidden","data-te-modal-dismiss":!0,"aria-label":"Close",children:(0,s.jsx)(S.FontAwesomeIcon,{icon:v.faXmark})})]}),"boolean"!=typeof e.buttons&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"modal__body",children:e.body}),(0,s.jsx)("div",{className:"modal__footer",children:A(e.buttons)})]}),"boolean"==typeof e.buttons&&e.body]})})})})),F=require("react-dom");function P(){const[e,t]=(0,o.useState)(),[n,_]=(0,o.useState)(!0),r=(0,o.useRef)(null);return(0,o.useEffect)((()=>{r.current&&(n?r.current.showModal():r.current.hideModal())}),[e,n]),{modal:e,showModal:function(e){const n=document.getElementById("modalRoot");n&&(t((0,F.createPortal)((0,s.jsx)(M,Object.assign({},e,{ref:r,onHiddenModal:()=>{t(void 0)}})),n)),_(!0))},hideModal:function(){_(!1)}}}require("react-player");const z=e=>{var t;const{className:n,options:_}=e;return(0,s.jsx)("div",{className:(0,i.twMerge)("flex justify-center",null!=n?n:""),id:null!=(t=e.id)?t:"",children:_.map(((t,n)=>(0,s.jsxs)("div",{className:"mb-0.5 me-4 inline-block min-h-6 ps-6",children:[(0,s.jsx)("input",{className:(0,i.twMerge)("relative float-left -ms-6 me-1 mt-0.5 h-5 w-5 appearance-none rounded-full border-2 border-solid border-third before:pointer-events-none before:absolute before:h-4 before:w-4 before:scale-0 before:rounded-full before:bg-transparent before:opacity-0 before:shadow-checkbox before:shadow-transparent before:content-[''] after:absolute after:z-1 after:block after:h-4 after:w-4 after:rounded-full after:content-[''] checked:border-accent-secondary checked:before:opacity-[0.16] checked:after:absolute checked:after:left-1/2 checked:after:top-1/2 checked:after:h-2.5 checked:after:w-2.5 checked:after:rounded-full checked:after:border-accent-secondary checked:after:bg-accent-primary checked:after:content-[''] checked:after:transform-[translate(-50%,-50%)] hover:before:opacity-[0.04] hover:before:shadow-black/60 focus:shadow-none focus:outline-hidden focus:ring-0 focus:before:scale-100 focus:before:opacity-[0.12] focus:before:shadow-black/60 focus:before:transition-[box-shadow_0.2s,transform_0.2s] checked:focus:border-accent-secondary checked:focus:before:scale-100 checked:focus:before:shadow-checkbox checked:focus:before:transition-[box-shadow_0.2s,transform_0.2s] rtl:float-right",e.disabled?"":"hover:cursor-pointer"),type:"radio",name:`inlineRadioOptions-${e.id}`,id:`option-${e.id}-${n}`,value:JSON.stringify(t.value),onChange:()=>{e.onChange(t.value)},checked:JSON.stringify(t.value)===JSON.stringify(e.value),disabled:e.disabled}),(0,s.jsx)("label",{className:(0,i.twMerge)("mt-px inline-block ps-[0.15rem]",e.disabled?"":"hover:cursor-pointer"),htmlFor:e.disabled?void 0:`option-${e.id}-${n}`,children:t.label})]},`radioOption${n}`)))})},B=["label","className","key"],W=(0,o.memo)((e=>{const{label:t,className:n,key:_}=e,c=(0,l.A)(e,B),d=(0,r.Cp)(e);return(0,o.useEffect)((()=>{const t=document.querySelector(`#${e.id}`);a.Select.getInstance(t)||new a.Select(document.querySelector(`#${e.id}`),{},{dropdown:"select__dropdown",formCheckInput:"bg-red-400 checked:after:border-red-500",selectInput:"peer select__input",selectOption:"select__option data-[te-select-option-selected]:data-[te-input-state-active]:link",selectLabelSizeDefault:"select__label-size-default",selectLabel:"select__label",selectArrow:"select__arrow top-[0.65rem]"})})),(0,s.jsxs)("div",{className:(0,i.twMerge)("relative mb-3",n),children:[(0,s.jsx)("select",Object.assign({"data-te-select-init":!0},c,d,{children:function(){const t=[];return e.options.forEach((e=>{var n;t.push((0,s.jsx)("option",{value:e.value,children:e.label},null==(n=e.value)?void 0:n.toString()))})),t}()}),_),(0,s.jsx)("label",{"data-te-select-label-ref":!0,children:t})]})}));require("@tanstack/react-table"),n(61);const X=(0,o.memo)((({tags:e,className:t})=>(0,s.jsx)("ul",{className:(0,i.twMerge)("tags",null!=t?t:""),children:e.map(((e,t)=>(0,s.jsx)("li",{children:e},t)))}))),Z=(require("@yaireo/tagify"),require("js-cookie"));var H=n.n(Z);const Y=require("react-ga4");var U=n.n(Y);function G(e){const{initTE:t,initGA:n}=e,[_,r]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{(async()=>{t&&await t(),n&&function(e,t){var n;let _=H().get("CookieConsent");_=null==(n=_)?void 0:n.replace(/{/gi,'{"').replace(/:/gi,'":').replace(/,/gi,',"').replace(/'/gi,'"'),!e&&_&&JSON.parse(_).statistics&&({NODE_ENV:"production"}.NEXT_PUBLIC_GA_MEASUREMENT_ID&&U().initialize([{trackingId:{NODE_ENV:"production"}.NEXT_PUBLIC_GA_MEASUREMENT_ID,gtagOptions:{anonymize_ip:!0,send_page_view:!1}}]),t(!0)),e&&(console.debug(`Logging pageview for ${window.location.pathname}`),U().send({hitType:"pageview",page:window.location.pathname}))}(_,r)})()}),[_,n,t]),{isGAInitialized:_}}require("react-router-dom")}},s={};function l(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={id:e,exports:{}};return a[e](n,n.exports,l),n.exports}e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",n=e?Symbol("webpack exports"):"__webpack_exports__",_=e?Symbol("webpack error"):"__webpack_error__",r=e=>{e&&e.d<1&&(e.d=1,e.forEach((e=>e.r--)),e.forEach((e=>e.r--?e.r++:e())))},l.a=(e,o,i)=>{var a;i&&((a=[]).d=-1);var s,l,c,d=new Set,g=e.exports,u=new Promise(((e,t)=>{c=t,l=e}));u[n]=g,u[t]=e=>(a&&e(a),d.forEach(e),u.catch((e=>{}))),e.exports=u,o((e=>{var o;s=(e=>e.map((e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){var o=[];o.d=0,e.then((e=>{i[n]=e,r(o)}),(e=>{i[_]=e,r(o)}));var i={};return i[t]=e=>e(o),i}}var a={};return a[t]=e=>{},a[n]=e,a})))(e);var i=()=>s.map((e=>{if(e[_])throw e[_];return e[n]})),l=new Promise((e=>{(o=()=>e(i)).r=0;var n=e=>e!==a&&!d.has(e)&&(d.add(e),e&&!e.d&&(o.r++,e.push(o)));s.map((e=>e[t](n)))}));return o.r?l:i()}),(e=>(e?c(u[_]=e):l(g),r(a)))),a&&a.d<0&&(a.d=0)},l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},i=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);l.r(n);var _={};o=o||[null,i({}),i([]),i(i)];for(var r=2&t&&e;("object"==typeof r||"function"==typeof r)&&!~o.indexOf(r);r=i(r))Object.getOwnPropertyNames(r).forEach((t=>_[t]=()=>e[t]));return _.default=()=>e,l.d(n,_),n},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.v=(e,t,n,_)=>{var r=fetch(l.p+""+n+".module.wasm"),o=()=>r.then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,_))).then((t=>Object.assign(e,t.instance.exports)));return r.then((t=>"function"==typeof WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(t,_).then((t=>Object.assign(e,t.instance.exports)),(e=>{if("application/wasm"!==t.headers.get("Content-Type"))return console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",e),o();throw e})):o()))},(()=>{var e;l.g.importScripts&&(e=l.g.location+"");var t=l.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var _=n.length-1;_>-1&&(!e||!/^http(s?):/.test(e));)e=n[_--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),l.p=e})();var c={};l.r(c),l.d(c,{default:()=>b});var d=l(15),g=l(732);const u=()=>null,b=e=>{const[t,n]=(0,d.useState)((()=>u));return(0,d.useEffect)((()=>{Promise.resolve().then(l.bind(l,334)).then((e=>n((()=>e.default))))}),[]),(0,g.jsx)(t,Object.assign({},e))};module.exports=c})();