diff --git a/forge/sterling/build/main.bundle.js b/forge/sterling/build/main.bundle.js index 67db8840..0fc9b9b0 100644 --- a/forge/sterling/build/main.bundle.js +++ b/forge/sterling/build/main.bundle.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,n,r={52780:(e,t,n)=>{var r=n(85893),o=(n(54848),n(49203),n(31906),n(67294)),s=n(73935),i=n(39704),a=n(57247),l=n(105),c=n(68527),d=n(78654),h=n(35173);const p=()=>{const e=(0,l.mq)("DragBar");return(0,r.jsx)(c.xu,{__css:e})},u=()=>{const e=(0,l.mq)("DragHandle");return(0,r.jsx)(c.xu,Object.assign({className:"drag-handle",__css:e},{children:(0,r.jsx)(p,{})}))},m=e=>{const{children:t,rightPaneCollapsed:n,rightPaneInitialWidth:s,rightPaneMinWidth:i,rightPaneMaxWidth:a}=e,p=(0,o.useRef)(null),m=(0,l.mq)("Dashboard"),[g,x]=(0,o.useState)(0),[b,y]=(0,o.useState)(!1),[w,v]=(0,o.useState)(s),j=(0,o.useMemo)((()=>n?0:w),[n,w]),A=(0,o.useMemo)((()=>n?-w:0),[n,w]),M=(0,o.useMemo)((()=>f(void 0,0,j,b)),[0,j,!1,b]),k=(0,o.useMemo)((()=>f(w,void 0,A,b)),[w,A,b]),C=(0,o.useMemo)((()=>f(void 0,void 0,A+w,b)),[A,w,b]),O=(0,o.useCallback)(((e,t)=>{const n=t.target.getBoundingClientRect(),r=t.clientX-n.left;"right"===e&&(x(r),y(!0))}),[y]),S=(0,o.useCallback)((0,d.Z)((e=>{var t;if(b){const n=p.current;if(n){null===(t=window.getSelection())||void 0===t||t.empty();const r=n.getBoundingClientRect().width-e.clientX+g-5;v((0,h.Z)(r,i,a))}}}),16),[g,b,i,a]),I=(0,o.useCallback)((()=>{y(!1)}),[y]);(0,o.useEffect)((()=>(document.addEventListener("mousemove",S),document.addEventListener("mouseup",I),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",I)})),[S,I]);const N=o.Children.toArray(t).filter((e=>e));return 2===N.length?(0,r.jsxs)(c.xu,Object.assign({ref:p,__css:m},{children:[(0,r.jsx)("div",Object.assign({style:M},{children:N[0]})),(0,r.jsx)("div",Object.assign({style:k},{children:N[1]})),(0,r.jsx)("div",Object.assign({style:C,onMouseDown:e=>O("right",e)},{children:(0,r.jsx)(u,{})}))]})):null},g={baseStyle:{position:"fixed",top:"35px",right:"30px",bottom:"20px",left:"0"}};function f(e,t,n,r){const o={position:"absolute",top:"0",bottom:"0",transition:r?void 0:"all 200ms cubic-bezier(0.85, 0, 0.15, 1)"};return void 0!==e&&(o.width=`${e}px`),void 0!==t&&(o.left=`${t}px`),void 0!==n&&(o.right=`${n}px`),o}const x=(0,l.Gp)(((e,t)=>{const n=(0,l.mq)("Pane");return(0,r.jsx)(c.xu,Object.assign({__css:n,ref:t},e))})),b=e=>{const t=(0,l.mq)("LogList",e);return(0,r.jsx)(c.rj,Object.assign({__css:t},e))};const y=e=>{const{variant:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const t=(0,l.mq)("Logo");return(0,r.jsx)(c.M5,Object.assign({__css:t},e,{children:"Sterling"}))},v=e=>{const t=(0,l.mq)("NavBar");return(0,r.jsx)(c.kC,Object.assign({__css:t},e))},j={baseStyle:{h:"35px",position:"fixed",top:0,left:0,right:0,display:"flex",alignItems:"stretch",p:2,bg:"gray.600"}};var A=n(68921);const M=e=>{const t=(0,l.mq)("NavButton");return(0,r.jsx)(A.zx,Object.assign({__css:t},e))},k=e=>{const t=(0,l.mq)("PaneBody");return(0,r.jsx)(c.xu,Object.assign({__css:t},e))},C=e=>{const t=(0,l.mq)("PaneHeader");return(0,r.jsx)(c.xu,Object.assign({__css:t},e))},O=e=>{const t=(0,l.mq)("PaneTitle");return(0,r.jsx)(c.M5,Object.assign({__css:t},e))},S=e=>{const t=(0,l.mq)("SideBar");return(0,r.jsx)(c.kC,Object.assign({__css:Object.assign(Object.assign({},t),{overflowY:"auto"})},e))},I={baseStyle:{w:"30px",position:"fixed",top:"35px",right:0,bottom:"20px",display:"flex",flexDir:"column",alignItems:"stretch",fontSize:"xs",borderLeft:"1px",borderColor:"gray.300",bg:"gray.100"}};const N=e=>{const{text:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const t=(0,l.mq)("StatusBar");return(0,r.jsx)(c.kC,Object.assign({__css:t},e))},D={baseStyle:{h:"20px",position:"fixed",right:0,bottom:0,left:0,display:"flex",alignItems:"center",px:2,fontSize:"xs",borderTop:"1px",borderColor:"gray.300",bg:"gray.100"}},_=(0,a.B1C)({fonts:{body:"InterVariable",mono:"Fira Code VF, Fira Code, monospace"},styles:{global:{"html, body, #root":{w:"full",h:"full",overflow:"hidden",userSelect:"none",cursor:"default"}}},components:{Dashboard:g,DragBar:{baseStyle:{w:"1px",h:"full",transition:"all ease 0.25s",backgroundColor:"gray.300",".drag-handle:hover &":{backgroundColor:"gray.500"}}},DragHandle:{baseStyle:{w:"10px",h:"full",mx:"-5px",px:"5px",cursor:"col-resize",boxSizing:"border-box",backgroundColor:"transparent"}},Logo:{baseStyle:{p:1,fontWeight:"bold",fontSize:"sm",letterSpacing:"wide",color:"gray.50",lineHeight:"0"}},LogList:{baseStyle:{display:"grid",backgroundColor:"gray.50",gridTemplateColumns:"fit-content(300px) 1fr",gridColumnGap:"0.35rem",gridAutoRows:"min-content",userSelect:"text"}},LogText:{baseStyle:{fontFamily:"mono",fontSize:"xs"},variants:{message:{color:"gray.900"},warning:{color:"yellow.400",fontWeight:"semibold"},error:{color:"red.500",fontWeight:"semibold"},timestamp:{display:"flex",alignItems:"center",color:"gray.500"}},defaultProps:{variant:"message"}},NavBar:j,NavButton:{baseStyle:{display:"flex",alignItems:"center",borderRadius:"sm",px:4,lineHeight:1.2,fontSize:"xs",fontWeight:"semibold",color:"gray.200",transitionProperty:"common",transitionDuration:"normal",_hover:{bg:"gray.100",color:"initial",_disabled:{bg:"initial"}},_active:{bg:"gray.200",color:"initial"},_disabled:{opacity:.4,cursor:"not-allowed"}}},Pane:{baseStyle:{position:"absolute",top:0,right:0,bottom:0,left:0}},PaneBody:{baseStyle:{position:"absolute",top:"35px",right:0,bottom:0,left:0}},PaneHeader:{baseStyle:{position:"absolute",top:0,left:0,right:0,height:"35px",bg:"gray.100",display:"flex",alignItems:"center"}},PaneTitle:{baseStyle:{fontSize:"xs",fontWeight:"semibold",color:"gray.800"}},SideBar:I,SideBarButton:{baseStyle:{display:"flex",cursor:"pointer",alignItems:"center",justifyContent:"center",py:3,fontSize:"xs",fontWeight:"normal",transitionProperty:"common",transitionDuration:"normal",writingMode:"vertical-lr",textOrientation:"sideways",iconSpacing:"0.35rem",span:{marginRight:".12rem"},_hover:{bg:"gray.200",_disabled:{bg:"initial"}},_active:{bg:"gray.300"}}},StatusBar:D,View:{baseStyle:{w:"full",h:"full"}}}});var T=n(59876),E=n(11384);const L=e=>{const{text:t,variant:n,time:o}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(y,Object.assign({variant:"timestamp",justifySelf:"end"},{children:[o?(0,E.Z)(o,"HH:mm:ss"):"--:--:--",(0,r.jsx)(T.XC,{})]})),(0,r.jsx)(y,Object.assign({variant:n},{children:t}))]})};var P=n(64657);function R(e,t){return e.nodes[t]}function B(e,t){return t?t.map((t=>R(e,t))):(0,P.Z)(e.nodes)}function Z(e,t){return e.edges[t]}function V(e,t){return t?t.map((t=>Z(e,t))):(0,P.Z)(e.edges)}function $(e,t){return`arrow-${e}-[${t}]`}const F=(0,o.memo)((e=>{const{size:t,color:n}=e,o=$(t,n),s=t/2;return(0,r.jsx)("marker",Object.assign({id:o,viewBox:`0 0 ${t} ${t}`,refX:0,refY:s,markerWidth:t,markerHeight:t,markerUnits:"userSpaceOnUse",orient:"auto",fill:n},{children:(0,r.jsx)("path",{d:`M 0 0 L ${t} ${s} L 0 ${t} z`})}))})),G=e=>{const{arrowHeads:t}=e;return(0,r.jsx)("defs",{children:t.map(((e,t)=>(0,r.jsx)(F,Object.assign({},e),t)))})},W=e=>(0,r.jsx)("text",Object.assign({x:e.x,y:e.y,style:e.style},e.props,{children:e.text})),U=e=>{const{label:t,position:n}=e;return t.length!==n.length?null:(0,r.jsx)(r.Fragment,{children:t.map(((e,t)=>{const{x:o,y:s}=n[t];return(0,r.jsx)(W,Object.assign({x:o,y:s},e),t)}))})};var q=n(50236),Y=n(18990),X=n(27470),J=n(75908),H=n(74681),Q=n(85925),K=n(69786),ee=n(67185),te=n(14643);const ne=e=>{const{path:t,curve:n,style:s,onRender:i}=e,a=(0,o.useRef)(null),l=(0,o.useRef)(null),c=(0,o.useMemo)((()=>function(e){const t=(0,q.Z)().x((e=>e.x)).y((e=>e.y));switch(null==e?void 0:e.type){case"bspline":t.curve(Y.ZP);break;case"bundle":t.curve(X.Z.beta(.85));break;case"cardinal":t.curve(J.ZP.tension(0));break;case"catmullrom":t.curve(H.Z.alpha(.5));break;case"line":default:t.curve(Q.Z);break;case"monotonex":t.curve(K.Z);break;case"monotoney":t.curve(K.s);break;case"natural":t.curve(ee.Z);break;case"step":t.curve(te.ZP);break;case"stepafter":t.curve(te.cD);break;case"stepbefore":t.curve(te.RN)}return t}(n)),[n]),d=(0,o.useMemo)((()=>c(t)||""),[c,t]),h=`url(#${$(10,s.stroke)})`;return(0,o.useLayoutEffect)((()=>{const e=a.current,n=l.current;if(e&&n){const r=e.getTotalLength(),o=e.getPointAtLength(r-10);n.setAttribute("d",c([...t.slice(0,-1),o])||"")}i&&a.current&&i(a.current)}),[i,t]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("path",{ref:l,style:s,markerEnd:h}),(0,r.jsx)("path",{ref:a,d,stroke:"transparent",strokeWidth:11,fill:"none"})]})},re=e=>{const{id:t,path:n,curve:s,style:i,labels:a}=e,[l,c]=(0,o.useState)([]),d=(0,o.useCallback)((e=>{a&&c(a.map((t=>function(e,t){const n=t.getTotalLength();if(void 0===e.position)return t.getPointAtLength(n/2);if("number"==typeof e.position){const r=(0,h.Z)(e.position,0,1);return t.getPointAtLength(r*n)}const r=(0,h.Z)(e.position.distance,0,n);return"source"===e.position.from?t.getPointAtLength(r):t.getPointAtLength(n-r)}(t,e))))}),[c,a]);return(0,r.jsxs)("g",Object.assign({id:`${t}`},{children:[(0,r.jsx)(ne,{path:n,curve:s,style:i,onRender:d}),a&&(0,r.jsx)(U,{label:a,position:l})]}))},oe=(0,o.memo)((e=>{const{edges:t}=e;return(0,r.jsx)("g",Object.assign({className:"edges"},{children:t.map((e=>(0,r.jsx)(re,Object.assign({},e),e.id)))}))}));function se(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ie(e){return Math.atan2(-e.y,-e.x)+Math.PI}function ae(e,t){return{x:e.x-t.x,y:e.y-t.y}}function le(e,t,n){return{x:e.x+n*Math.cos(t),y:e.y+n*Math.sin(t)}}var ce=n(5419);const de=(0,o.createContext)({nodeOffset:()=>({x:0,y:0}),onClickNode:()=>{},onMouseDown:()=>{},onMouseDownNode:()=>{},onMouseMove:()=>{},onMouseUp:()=>{},onMouseUpNode:()=>{},onWheel:()=>{},spreadMatrix:(0,ce.yR)(),zoomMatrix:(0,ce.yR)()});var he=n(60953);const pe={x:0,y:0};function ue(e,t,n){const r=t.getScreenCTM();if(r){const o=r.inverse(),s=(0,ce.SO)(n),i=t.createSVGPoint();i.x=e.clientX,i.y=e.clientY;const a=(0,ce.hC)(s,i.matrixTransform(o));return i.x=e.clientX+e.movementX,i.y=e.clientY+e.movementY,ae((0,ce.hC)(s,i.matrixTransform(o)),a)}return{x:0,y:0}}const me=()=>!1;function ge(e){return(0,o.useCallback)(((t,n)=>{let r,o=n.callbacks;switch(n.type){case"clicknode":return r=(0,he.Z)(null==o?void 0:o.onClickNode,me),r(n.nodeId,n.event)?t:function(e,t){return e}(t);case"mousedown":return r=(0,he.Z)(null==o?void 0:o.onMouseDown,me),r(n.event)?t:function(e,t){return Object.assign(Object.assign({},e),{isPanning:!0})}(t);case"mousedownnode":return r=(0,he.Z)(null==o?void 0:o.onMouseDownNode,me),r(n.nodeId,n.event)?t:function(e,t){const{event:n,nodeId:r}=t;return n.preventDefault(),n.stopPropagation(),e.selection.push(r),e.isDragging=!0,e}(t,n);case"mousemove":return r=(0,he.Z)(null==o?void 0:o.onMouseMove,me),r(n.event)?t:function(e,t,n){if(n){if(e.isDragging)return function(e,t,n){const r=e.selection,o=Object.assign({},e.offsets),s=ue(t.event,n,e.zoomMatrix);return r.forEach((e=>{const t=o[e]||pe;o[e]=se(t,s)})),Object.assign(Object.assign({},e),{offsets:o})}(e,t,n);if(e.isPanning)return function(e,t,n){const r=ue(t.event,n,e.zoomMatrix),o=(0,ce.vs)([e.zoomMatrix,(0,ce.Iu)(r.x,r.y)]);return Object.assign(Object.assign({},e),{zoomMatrix:o})}(e,t,n)}return e}(t,n,e);case"mouseup":return r=(0,he.Z)(null==o?void 0:o.onMouseUp,me),r(n.event)?t:function(e,t){return Object.assign(Object.assign({},e),{isDragging:!1,isPanning:!1,offsets:{},selection:[]})}(t);case"mouseupnode":return r=(0,he.Z)(null==o?void 0:o.onMouseUpNode,me),r(n.nodeId,n.event)?t:(r=(0,he.Z)(null==o?void 0:o.onSelectionMoved,me),r(t.offsets)?t:function(e,t){const{event:n}=t;return n.preventDefault(),n.stopPropagation(),e.isDragging=!1,e.isPanning=!1,e.offsets={},e.selection=[],e}(t,n));case"wheel":if(r=(0,he.Z)(null==o?void 0:o.onWheel,me),r(n.event))return t;const s=t.spreadMatrix,i=t.zoomMatrix,a=function(e,t,n){const r=t.event,o=function(e){const t=e.shiftKey?e.deltaX:e.deltaY;return 0===t?0:t<0?1.055:.9478672985781991}(r);return n&&0!==o&&!r.ctrlKey?r.shiftKey?function(e,t,n,r){const o=r.getScreenCTM();if(o){const s=r.createSVGPoint();s.x=t.clientX,s.y=t.clientY;const i=s.matrixTransform(o.inverse()),{x:a,y:l}=(0,ce.hC)((0,ce.vs)((0,ce.SO)(e.spreadMatrix),(0,ce.SO)(e.zoomMatrix)),i),c=(0,ce.vs)(e.spreadMatrix,(0,ce.bA)(n,n,a,l));return Object.assign(Object.assign({},e),{spreadMatrix:c})}return e}(e,r,o,n):function(e,t,n,r){const o=r.getScreenCTM();if(o){const s=r.createSVGPoint();s.x=t.clientX,s.y=t.clientY;const i=s.matrixTransform(o.inverse()),{x:a,y:l}=(0,ce.hC)((0,ce.SO)(e.zoomMatrix),i),c=(0,ce.vs)(e.zoomMatrix,(0,ce.bA)(n,n,a,l));return Object.assign(Object.assign({},e),{zoomMatrix:c})}return e}(e,r,o,n):e}(t,n,e);return r=(0,he.Z)(null==o?void 0:o.onSpreadChanged,me),s!==a.spreadMatrix&&r(a.spreadMatrix)?t:(r=(0,he.Z)(null==o?void 0:o.onZoomChanged,me),i!==a.zoomMatrix&&r(a.zoomMatrix)?t:a)}return t}),[e])}const fe=e=>{const{svg:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{i(function(e,t){return Object.assign(Object.assign({},e),{callbacks:t})}(e,n))}),[i,n]);return{nodeOffset:(0,o.useCallback)((e=>s.offsets[e]||{x:0,y:0}),[s.offsets]),onClickNode:(0,o.useCallback)(((e,t)=>a(function(e,t){return{type:"clicknode",nodeId:e,event:t}}(e,t))),[a]),onMouseDown:(0,o.useCallback)((e=>a(function(e){return{type:"mousedown",event:e}}(e))),[a]),onMouseDownNode:(0,o.useCallback)(((e,t)=>a(function(e,t){return{type:"mousedownnode",nodeId:e,event:t}}(e,t))),[a]),onMouseMove:(0,o.useCallback)((e=>a(function(e){return{type:"mousemove",event:e}}(e))),[a]),onMouseUp:(0,o.useCallback)((e=>a(function(e){return{type:"mouseup",event:e}}(e))),[a]),onMouseUpNode:(0,o.useCallback)(((e,t)=>a(function(e,t){return{type:"mouseupnode",event:t,nodeId:e}}(e,t))),[a]),onWheel:(0,o.useCallback)((e=>a(function(e){return{type:"wheel",event:e}}(e))),[a]),spreadMatrix:s.spreadMatrix,zoomMatrix:s.zoomMatrix}};const xe=()=>(0,o.useContext)(de),be=e=>{const{children:t,beforeUnmount:n}=e,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o()=>{n&&n(i)}),[n]),(0,r.jsx)(de.Provider,Object.assign({value:i},{children:t}))};const ye=e=>{const{label:t}=e;return(0,r.jsx)(r.Fragment,{children:t.map(((e,t)=>{const{offset:n}=e,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const{shape:t,style:n}=e;return(0,r.jsx)("circle",{r:t.radius,style:n})})),ve=(0,o.memo)((e=>{const{shape:t,style:n}=e;return(0,r.jsx)("rect",{x:-t.width/2,y:-t.height/2,width:t.width,height:t.height,style:n})})),je=(0,o.memo)((e=>{const{shape:t,style:n}=e;switch(t.shape){case"circle":return(0,r.jsx)(we,{shape:t,style:n});case"rectangle":return(0,r.jsx)(ve,{shape:t,style:n})}return null})),Ae=(0,o.memo)((e=>{const{id:t,position:n,shape:s,style:i,labels:a}=e,{onClickNode:l,onMouseDownNode:c,onMouseUpNode:d,spreadMatrix:h,nodeOffset:p}=xe(),u=p(t),m=(0,o.useMemo)((()=>{const e=se((0,ce.hC)(h,n),u);return`translate(${e.x} ${e.y})`}),[n,u,h]);return(0,r.jsxs)("g",Object.assign({id:t,transform:m,onClick:e=>l(t,e),onMouseDown:e=>c(t,e),onMouseUp:e=>d(t,e)},{children:[(0,r.jsx)(je,{shape:s,style:i}),a&&(0,r.jsx)(ye,{label:a})]}))})),Me=(0,o.memo)((e=>{const{nodes:t}=e;return(0,r.jsx)("g",Object.assign({className:"nodes"},{children:t.map((e=>(0,r.jsx)(Ae,Object.assign({},e),e.id)))}))}));function ke(e,t){return{a:e,b:t}}function Ce(e,t){const n=e.a,r=e.b,o=t.a,s=t.b,i=((s.x-o.x)*(n.y-o.y)-(s.y-o.y)*(n.x-o.x))/((s.y-o.y)*(r.x-n.x)-(s.x-o.x)*(r.y-n.y));return{x:n.x+i*(r.x-n.x),y:n.y+i*(r.y-n.y)}}function Oe(e,t,n,r){switch(t.shape){case"circle":return function(e,t,n,r){return le(e,ie(n),t+r/2)}(e,t.radius,n,r);case"rectangle":return function(e,t,n,r,o){const s=t+o,i=n+o,a=s/2,l=i/2,c=le(e,ie(r),Math.max(s,i)),d=ke(e,c),h=((p=d).a.y-p.b.y)/(p.a.x-p.b.x);var p;const u=h*a,m=l/h,g={x:e.x+a,y:e.y+l},f={x:e.x-a,y:e.y+l},x={x:e.x+a,y:e.y-l},b={x:e.x-a,y:e.y-l};if(-l<=u&&u<=l){if(e.xc.x)return Ce(ke(f,b),d)}if(-a<=m&&m<=a){if(e.yc.y)return Ce(ke(b,x),d)}return e}(e,t.width,t.height,n,r)}return e}function Se(e){return void 0!==e}const Ie=(0,o.memo)((e=>{const{id:t,graph:n,edgeCurves:s,edgeStyles:i,edgeLabels:a,nodeShapes:l,nodeStyles:c,nodeLabels:d}=e,h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);oB(n).map((e=>{const t={x:e.x,y:e.y},n=l[e.id],r=c[e.id],o=d?d[e.id]:void 0;return{id:e.id,position:t,shape:n,style:r,labels:o}}))),[n,l,c,d]),g=(0,o.useMemo)((()=>V(n).map((e=>{const t=R(n,e.source),r=R(n,e.target);if(!t||!r)return;const o=l[t.id],c=l[r.id],d=function(e,t,n,r,o,s,i,a){const l=e.waypoints||[],c=(0,ce.hC)(a,se(t,r)),d=(0,ce.hC)(a,se(o,i)),h=l.map((e=>(0,ce.hC)(a,e))),p=Oe(c,n,ae((0,he.Z)(h[0],d),c),0),u=Oe(d,s,ae((0,he.Z)(h[h.length-1],c),d),0);return[p,...h,u]}(e,t,o,p(t.id),r,c,p(r.id),u),h=s[e.id],m=i[e.id],g=a?a[e.id]:void 0;return{id:e.id,path:d,curve:h,style:m,labels:g}})).filter(Se)),[n,u,s,i,a,p]),f=function(e){const t=new Set,n=[];return e.forEach((e=>{const r=e.stroke,o=$(10,r);t.has(o)||(t.add(o),n.push({size:10,color:r}))})),n}(Object.values(i));return m.length<1&&m.push({id:"0",position:{x:0,y:0},shape:{shape:"rectangle",width:550,height:50},style:{fill:"transparent",stroke:"black"},labels:[{text:"There are no atoms to display (or the current theme has hidden them)",style:{fontSize:12,textAnchor:"middle",fontFamily:"monospace",userSelect:"none"}}]}),(0,r.jsxs)("g",Object.assign({id:t},h,{children:[(0,r.jsx)(G,{arrowHeads:f}),(0,r.jsx)(Me,{nodes:m}),(0,r.jsx)(oe,{edges:g})]}))})),Ne=(e,t)=>{const[n,r]=(0,o.useState)();return(0,o.useLayoutEffect)((()=>{const n=e.current;if(n){r(n.getBoundingClientRect());const e=new ResizeObserver((e=>{e.forEach((e=>{e.target===n&&(t?t(e.contentRect):r(e.contentRect))}))}));return e.observe(n),()=>{e.unobserve(n)}}}),[e.current]),n};var ze=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const{children:n}=e,o=ze(e,["children"]),{onMouseDown:s,onMouseMove:i,onMouseUp:a,onWheel:l,zoomMatrix:c}=xe();return(0,r.jsx)("svg",Object.assign({ref:t,preserveAspectRatio:"xMidYMid slice",onMouseDown:s,onMouseMove:i,onMouseUp:a,onWheel:l},o,{children:(0,r.jsx)("g",Object.assign({transform:(0,ce.BB)(c)},{children:n}))}))})),_e=e=>{const{callbacks:t}=e,n=ze(e,["callbacks"]),s=(0,o.useRef)(null);return(0,r.jsx)(be,Object.assign({svg:s.current},t,{children:(0,r.jsx)(De,Object.assign({ref:s},n))}))};const Te=e=>{const{callbacks:t,children:n}=e,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);onull==a?void 0:a.width),[a]),c=(0,o.useMemo)((()=>null==a?void 0:a.height),[a]),d=(0,o.useMemo)((()=>l&&c?`${-l/2} ${-c/2} ${l} ${c}`:void 0),[l,c]);return(0,r.jsx)("div",Object.assign({ref:i},s,{children:(0,r.jsx)(_e,Object.assign({callbacks:t,viewBox:d},{children:n}))}))},Ee=(0,l.Gp)(((e,t)=>(0,r.jsx)(A.zx,Object.assign({colorScheme:"green",size:"xs",ref:t},e))));var Le=n(98765);const Pe=(0,Le.PH)("sterling/buttonClicked"),Re=(0,Le.PH)("sterling/dataRequested"),Be=(0,Le.PH)("sterling/evalRequested"),Ze=(0,Le.PH)("sterling/metaRequested"),Ve=(0,Le.PH)("sterling/dataReceived"),$e=(0,Le.PH)("sterling/evalReceived"),Fe=(0,Le.PH)("sterling/metaReceived"),Ge=(0,Le.PH)("sterling/connect"),We=(0,Le.PH)("sterling/disconnect"),Ue=(0,Le.PH)("sterling/connected"),qe=(0,Le.PH)("sterling/connectionError"),Ye=(0,Le.PH)("sterling/disconnected"),Xe=(0,Le.PH)("sterling/error");function Je(e){return void 0!==e}function He(e,t){const n={};for(const r of e)n[t(r)]=r;return n}function Qe(e){return e.types[e.types.length-1]}function Ke(e){return e.atoms}function et(e){return void 0!==e.meta&&!0===e.meta.builtin}function tt(e,t,n){return"string"==typeof t&&(t=pt(e,t)),"string"!=typeof n&&(n=n.id),t.types.includes(n)}function nt(e,t){const n=t.getAttribute("label");if(!n)throw new Error("No label attribute in atom element");return{_:"atom",id:n,type:e}}function rt(e,t){return Array.from(t).map((t=>nt(e,t)))}function ot(e,t){if("string"==typeof t&&(t=lt(e,t)),!e.types[t.type])throw new Error(`The atom's type is not part of the instance: ${t.type}`);return e.types[t.type]}function st(e,t){return Array.from(t).map((t=>function(e,t){return{_:"tuple",types:e,atoms:Array.from(t.querySelectorAll("atom")).map(((t,n)=>nt(e[n],t).id))}}(e,t)))}function it(e){return e.tuples}function at(e,t){return Array.from(t).map((t=>function(e,t){const n=t.getAttribute("label");if(!n)throw new Error("No label found for field element");const r=function(e,t){const n=t.querySelectorAll("type");return Array.from(n).map((t=>{const n=t.getAttribute("ID");if(!n)throw new Error("Type element must have an ID attribute");const r=e[n];if(!r)throw new Error(`Type element with ID ${n} not found`);return r}))}(e,t);if(0===r.length)throw new Error("No types found for field element");return{_:"relation",id:`${r[0]}<:${n}`,name:n,types:r,tuples:st(r,t.querySelectorAll("tuple"))}}(e,t)))}function lt(e,t){const n=ct(e).find((e=>e.id===t));if(!n)throw new Error(`Could not find atom with id ${t}`);return n}function ct(e){return ut(e).map(Ke).reduce(((e,t)=>e.concat(t)),[])}function dt(e){return Object.values(e.relations)}function ht(e){return Object.values(e.skolems)}function pt(e,t){const n=e.types[t];if(!n)throw new Error(`Could not find type with id ${t}`);return n}function ut(e){return Object.values(e.types)}function mt(e){const t=e.getAttribute("bitwidth");if(!t)throw new Error("No bitwidth found in instance");const n=function(e){const t={},n=e.querySelectorAll("sig");for(const e of n){const n=e.getAttribute("ID"),r=e.getAttribute("label");if(!n)throw new Error("No ID found for sig element");if(!r)throw new Error("No label found for sig element");t[n]=r}return t}(e),r=function(e,t){const n={},r=t.querySelectorAll("sig");for(const e of r)if(!yt(e)){const t=e.getAttribute("ID"),r=e.getAttribute("parentID"),o=e.getAttribute("label");if(!t)throw new Error("No ID found for sig element");if(!o)throw new Error("No label found for sig element");r&&(n[t]=r)}const o=(t,r)=>n[t]?o(n[t],[...r,e[t]]):r,s={};for(const t in e)s[e[t]]=o(t,[]);return s}(n,e),o=function(e,t){return Array.from(t).filter((e=>!yt(e))).map((t=>function(e,t){const n=t.getAttribute("label");if(!n)throw new Error("No label attribute in sig element");const r=e[n];if(!r)throw console.log(e),new Error(`No type hierarchy for ${n}`);const o=function(e){const t={};return"yes"===e.getAttribute("abstract")&&(t.abstract=!0),"yes"===e.getAttribute("builtin")&&(t.builtin=!0),"yes"===e.getAttribute("enum")&&(t.enum=!0),"yes"===e.getAttribute("meta")&&(t.meta=!0),"yes"===e.getAttribute("one")&&(t.one=!0),"yes"===e.getAttribute("private")&&(t.private=!0),0===Object.keys(t).length?void 0:t}(t),s={_:"type",id:n,types:r,atoms:rt(n,t.querySelectorAll("atom")),meta:void 0};return Je(o)&&(s.meta=o),s}(e,t)))}(r,e.querySelectorAll("sig")),s=at(n,e.querySelectorAll("field")),i=at(n,e.querySelectorAll("skolem"));return function(e,t){const n=t.find((e=>"Int"===e.id));if(!n)throw new Error("Could not find Int type");n.atoms=function(e){const t=[],n=Math.pow(2,e);for(let e=-n/2;ee.id)),relations:He(s,(e=>e.id)),skolems:He(i,(e=>e.id))}}function gt(e){var t;const n=(new DOMParser).parseFromString(e,"application/xml"),r=Array.from(n.querySelectorAll("instance"));if(!r.length)throw new Error(`No Alloy instance in XML: ${e}`);const o=n.querySelector("visualizer"),s=null===o?void 0:xt(o,"script"),i=null===o?void 0:xt(o,"theme");return{instances:r.map(mt),bitwidth:ft(r[0],"bitwidth"),command:xt(r[0],"command"),loopBack:null!==(t=ft(r[0],"backloop"))&&void 0!==t?t:ft(r[0],"loop"),maxSeq:ft(r[0],"maxseq"),maxTrace:ft(r[0],"maxtrace"),minTrace:ft(r[0],"mintrace"),traceLength:ft(r[0],"tracelength"),visualizerConfig:{script:bt(s),theme:bt(i)}}}function ft(e,t){const n=e.getAttribute(t);return n?+n:void 0}function xt(e,t){const n=e.getAttribute(t);return n?`${n}`:void 0}function bt(e){return null==e?void 0:e.replaceAll(""",'"').replaceAll('\\"','"').replaceAll(">",">").replaceAll("<","<")}function yt(e){return e.querySelectorAll("type").length>0}function wt(e){return"alloy"===e.format}function vt(e){return Object.assign(Object.assign({},e),{parsed:gt(e.data)})}function jt(e,t){const n=function(e){return JSON.parse(e)}(e);!function(e){return"data"===e.type&&void 0!==e.payload}(n)?function(e){return"eval"===e.type&&void 0!==e.payload}(n)?t.dispatch($e(n.payload)):function(e){return"meta"===e.type&&void 0!==e.payload}(n)&&t.dispatch(Fe(n.payload)):t.dispatch(Ve(function(e,t){const{enter:n,update:r,exit:o}=e,s=function(e,t){const n=[];return e&&e.forEach((e=>{!function(e){const t=e.format;return"alloy"===t||"raw"===t}(e)?t.dispatch(Xe(`Unsupported data format in datum ${e.id}: ${e.format}`)):(e.id=`${e.id}`,n.push(e))})),n}(n,t);return{enter:s.map((e=>{switch(e.format){case"alloy":return vt(e);case"raw":return function(e){return Object.assign(Object.assign({},e),{parsed:e.data})}(e);default:throw new Error("Unsupported format fell through unexpectedly.")}})),update:r,exit:o}}(n.payload,t)))}function At(e){e.dispatch(Xe("Not connected to a provider."))}function Mt(e,t){e.send(JSON.stringify(t))}const kt=()=>(0,i.I0)(),Ct=i.v9;var Ot=n(18172);function St(e,t){return t in e.edges}function It(e,t){return t in e.nodes}var Nt=n(29428);function zt(e,t){return t=t||[],function(e,t){return(0,Ot.Uy)(e,(e=>{t.forEach((t=>function(e,t){const{id:n,source:r,target:o}=t;if(n&&(s=e,i=[r,o],(0,Nt.Z)(i,(e=>It(s,e))))&&!St(e,n))e.edges[n]=t,function(e,t,n,r){e.predecessors.hasOwnProperty(n)||(e.predecessors[n]={}),e.predecessors[n].hasOwnProperty(t)||(e.predecessors[n][t]=[]),e.predecessors[n][t].push(r)}(e,r,o,n),function(e,t,n,r){e.successors.hasOwnProperty(t)||(e.successors[t]={}),e.successors[t].hasOwnProperty(n)||(e.successors[t][n]=[]),e.successors[t][n].push(r)}(e,r,o,n),function(e,t,n){e.inedges[t].push(n)}(e,o,n),function(e,t,n){e.outedges[t].push(n)}(e,r,n);else{if(!n)throw new Error("Cannot add an edge without an edge ID");if(!It(e,r))throw new Error(`Cannot add edge ${n}, the source node ${r} is not in the graph`);if(!It(e,o))throw new Error(`Cannot add edge ${n}, the target node ${o} is not in the graph`);if(St(e,n))throw new Error(`Cannot add edge, an edge with ID ${n} already exists in the graph`)}var s,i}(e,(0,Ot.cA)(t))))}))}(function(e,t){return(0,Ot.Uy)(e,(e=>{t.forEach((t=>function(e,t){const{id:n}=t;if(n&&!It(e,n))e.nodes[n]=t,e.predecessors[n]={},e.successors[n]={},e.inedges[n]=[],e.outedges[n]=[];else{if(!n)throw new Error("Cannot add a node without a node ID");if(It(e,n))throw new Error(`Cannot add node, a node with ID ${n} already exists in the graph`)}}(e,(0,Ot.cA)(t))))}))}({nodes:{},edges:{},predecessors:{},successors:{},inedges:{},outedges:{}},e=e||[]),t)}function Dt(e,t){const n=e.edges;return!!n&&n.some((e=>{var n;return!0===e.asAttribute&&(null===(n=e.targets)||void 0===n?void 0:n.some((e=>"*"===e||e.relation===t)))}))}function _t(e,t,n){if(n<2)return[0,0];if(!e)return[0,n-1];const r=e.edges;if(!r)return[0,n-1];const o=r.find((e=>{var n;return(e.sourceIndex||e.targetIndex)&&(null===(n=e.targets)||void 0===n?void 0:n.some((e=>"*"===e||e.relation===t)))}));return o?[o.sourceIndex?o.sourceIndex:0,o.targetIndex?o.targetIndex:n-1]:[0,n-1]}var Tt=n(11022),Et=n(935);function Lt(e){return e.id}function Pt(e,t){return`${e.id}:${t.atoms.join("->")}`}function Rt(e,t){var n,r;const o=(null===(n=null==t?void 0:t.hidden)||void 0===n?void 0:n.disconnected)||!1,s=o||(null===(r=null==t?void 0:t.hidden)||void 0===r?void 0:r.builtinDisconnected)||!1,{nodeIds:i,edgeIds:a}=function(e,t,n,r){const o=new Set,s=new Set;return dt(e).forEach((t=>{it(t).forEach((n=>{const i=n.atoms.map((t=>lt(e,t))),[a,l]=function(e,t,n){if(n){const[r,o]=_t(n,e.id,t.length);return[r?t[r]:(0,Tt.Z)(t),o?t[o]:(0,Et.Z)(t)]}return[(0,Tt.Z)(t),(0,Et.Z)(t)]}(t,i,r);a&&l&&(o.add(Lt(a)),o.add(Lt(l)),s.add(Pt(t,n)))}))})),ct(e).forEach((r=>{const s=Lt(r);o.has(s)||t||function(e,t){return"string"==typeof t&&(t=lt(e,t)),ot(e,t).types.map((t=>pt(e,t))).some(et)}(e,r)&&n||o.add(s)})),{nodeIds:o,edgeIds:s}}(e,o,s,t),l=[];ct(e).forEach((e=>{const t=Lt(e);i.has(t)&&l.push({id:t,atom:e})}));const c=[];return dt(e).forEach((n=>{t&&Dt(t,n.id)||it(n).forEach((r=>{const o=Pt(n,r),s=r.atoms,[i,l]=_t(t,n.id,s.length),d=i?s[i]:(0,Tt.Z)(s),h=l?s[l]:(0,Et.Z)(s);d&&h&&a.has(o)&&c.push({id:o,source:Lt(lt(e,d)),target:Lt(lt(e,h)),relation:n,tuple:r})}))})),zt(l,c)}var Bt=n(79432),Zt=n(27961);function Vt(e,t){const n={"*":(r=[t],(0,Zt.Z)(r.map((e=>e.edges?e.edges.filter((e=>e.targets&&e.targets.some((e=>"*"===e)))):[]))))};var r;return dt(e).forEach((e=>{n[e.id]=function(e,t){return(0,Zt.Z)(t.map((t=>t.edges?t.edges.filter((t=>t.targets&&t.targets.some((t=>"*"!==t&&t.relation===e)))):[])))}(e.id,[t])})),n}function $t(e,t){const n={"*":(r=[t],(0,Zt.Z)(r.map((e=>e.nodes?e.nodes.filter((e=>e.targets&&e.targets.some((e=>"*"===e)))):[]))))};var r;return ut(e).forEach((e=>{n[e.id]=function(e,t){return(0,Zt.Z)(t.map((t=>t.nodes?t.nodes.filter((t=>t.targets&&t.targets.some((t=>"*"!==t&&t.type===e)))):[])))}(e.id,[t])})),n}function Ft(e,t,n,r){const o={},s={},i={},a={},l={},c={},d=$t(t,r),h=Vt(t,r),p={};dt(t).forEach((e=>{Dt(r,e.id)&&it(e).forEach((t=>{const n=t.atoms;if(n.length>1){const t=n[0];p[t]||(p[t]=[]),p[t].push(`${e.name}: ${n.slice(1).join(", ")}`)}}))})),ht(t).forEach((e=>{it(e).forEach((t=>{const n=t.atoms[0];p[n]||(p[n]=[]),p[n].push(`${e.name}`)}))})),B(n).forEach((e=>{i[e.id]=[{text:e.atom.id,props:{},style:{}}],p[e.id]&&i[e.id].push(...p[e.id].map((e=>({text:e,props:{},style:{}})))),s[e.id]={}}));const u=e=>{if(e.tuple.atoms.length>2){const[t,n]=_t(r,e.relation.id,e.tuple.atoms.length),o=e.tuple.atoms.slice();return o.splice(t,1),o.splice(n-1,1),e.relation.name+`[${o.join(", ")}]`}return e.relation.name};return V(n).forEach((e=>{c[e.id]=[{text:u(e),props:{},style:{}}],l[e.id]={}})),B(n).forEach((e=>{const{id:n,atom:r}=e;["*","univ",...ot(t,r).types.slice().reverse()].forEach((e=>{var t;null===(t=d[e])||void 0===t||t.forEach((e=>{var t;e.shape&&(o[n]=e.shape),(0,Bt.Z)(s[n],null===(t=e.styles)||void 0===t?void 0:t.node),i[n].forEach((t=>{var n,r;(0,Bt.Z)(t.props,null===(n=e.props)||void 0===n?void 0:n.label),(0,Bt.Z)(t.style,null===(r=e.styles)||void 0===r?void 0:r.label)})),Gt(i[n])}))}))})),V(n).forEach((e=>{const{id:t,relation:n,tuple:r}=e;["*",n.id].forEach((e=>{var n;null===(n=h[e])||void 0===n||n.forEach((e=>{var n;e.curve&&(a[t]=e.curve),(0,Bt.Z)(l[t],null===(n=e.styles)||void 0===n?void 0:n.edge),c[t].forEach((t=>{var n,r;(0,Bt.Z)(t.props,null===(n=e.props)||void 0===n?void 0:n.label),(0,Bt.Z)(t.style,null===(r=e.styles)||void 0===r?void 0:r.label)})),Gt(c[t])}))}))})),{id:e,graph:n,nodeShapes:o,nodeStyles:s,nodeLabels:i,edgeCurves:a,edgeLabels:c,edgeStyles:l}}function Gt(e){const t=e.length-1;e.forEach(((e,n)=>{e.props||(e.props={}),e.props.dy=n-t/2+.33+"em"}))}var Wt=n(70681),Ut=n.n(Wt),qt=n(5840),Yt=n(13209),Xt=n(44186),Jt=n(49360);function Ht(e,t){return zt(B(e).map((e=>{const n=t.nodePositions[e.id];return Object.assign(Object.assign({},e),{x:(null==n?void 0:n.x)||0,y:(null==n?void 0:n.y)||0})})),V(e).map((e=>Object.assign(Object.assign({},e),{waypoints:t.edgeWaypoints[e.id]||[]}))))}const Qt=e=>void 0!==e.loopBack;var Kt=n(1185);function en(e,t){const n={};return t.forEach((t=>{const r=Qe(ot(e,t));if(n[r])throw new Error(`Cannot project ${t} and ${n[r]}. Both are of type ${r}`);n[r]=t})),{types:tn(e,n),relations:nn(e,n),skolems:e.skolems}}function tn(e,t){const n={},r=Object.keys(t);for(const t in e.types){const o=e.types[t],s=r.some((t=>tt(e,o,t)));n[t]={_:"type",id:o.id,types:o.types,atoms:s?[]:o.atoms,meta:o.meta}}return n}function nn(e,t){const n={},r=Object.keys(t),o=Object.values(t);for(const t in e.relations){const s=e.relations[t],i=s.types.some((t=>r.some((n=>tt(e,t,n))))),a=i?rn(e,s.types,r):[];n[t]={_:"relation",id:s.id,name:s.name,types:i?sn(s.types,a):s.types,tuples:i?on(s.tuples,a,o):s.tuples},i||(n[t]=s)}return n}function rn(e,t,n){const r=[];return t.forEach(((t,o)=>{n.some((n=>tt(e,t,n)))&&r.push(o)})),r}function on(e,t,n){return e.filter((e=>e.atoms.some((e=>n.includes(e))))).map((e=>({_:"tuple",types:sn(e.types,t),atoms:sn(e.atoms,t)}))).filter((e=>e.atoms.length>1))}function sn(e,t){const n=[];for(let r=0;rt.map((t=>un(e,t))).filter((e=>!(0,Jt.Z)(e))))),selectDatumById:un},gn=function(e,t){return(e.orderByDatumId[t.id]||[]).map((t=>e.expressionsById[t]))},fn=function(e){return e.nextExpressionId};function xn(e){return e.length?e.slice().sort(((e,t)=>e.time===t.time?e.type.localeCompare(t.type):!0===e.time?-1:1)).map((e=>!0===e.time?`[${e.type}]`:`(${e.type})`)).join("|"):"|"}function bn(e,t){const n=yn(e,t);return n&&n.projections||[]}function yn(e,t){var n;return e.themeByGeneratorName[null!==(n=t.generatorName)&&void 0!==n?n:""]}const wn={selectGraphLayout:function(e,t){const n=bn(e,t),r=e.layoutsByDatumId[t.id],o=xn(n);return r.layoutById[o]},selectHiddenRelations:function(e,t){return e.hiddenByDatumId[t.id]},selectProjections:bn,selectSpreadMatrix:function(e,t){var n;return null===(n=e.matricesByDatumId[t.id])||void 0===n?void 0:n.spreadMatrix},selectTheme:yn,selectTimeIndex:function(e,t){return e.timeByDatumId[t.id]||0},selectZoomMatrix:function(e,t){var n;return null===(n=e.matricesByDatumId[t.id])||void 0===n?void 0:n.zoomMatrix}},vn=function(e){return e.items},jn=function(e){return e.connected},An=function(e){return e.providerName},Mn=function(e){return e.providerGenerators};function kn(e,t){let n=null!=t?t:e;if(n instanceof Function)return n;{let e=n;return()=>e}}function Cn(e){return{top_left:{x:Math.min(...e.map((e=>e.top_left.x))),y:Math.min(...e.map((e=>e.top_left.y)))},bottom_right:{x:Math.max(...e.map((e=>e.bottom_right.x))),y:Math.max(...e.map((e=>e.bottom_right.y)))}}}function On(e){return null==e||0==e.length?{x:0,y:0}:e.reduce(((t,n)=>({x:t.x+n.x/e.length,y:t.y+n.y/e.length})),{x:0,y:0})}function Sn(e,t){return e.map((e=>()=>({x:e().x-t().x,y:e().y-t().y})))}function In(e){let t=1/0,n=1/0,r=-1/0,o=-1/0;return e.forEach((e=>{t=Math.min(t,e.x),r=Math.max(r,e.x),n=Math.min(n,e.y),o=Math.max(o,e.y)})),{top_left:{x:t,y:n},bottom_right:{x:r,y:o}}}function Nn(e,t){const n=[];for(let o=1;o<=t;o++){const s=e(2*Math.PI/t*o);if(!("x"in(r=s))||!("y"in r))throw"returned bounding box response not of type coords. Issue in edge.ts or utility.ts";n.push(s)}var r;return n}function zn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Dn(e){let t=Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2));return{x:e.x/t,y:e.y/t}}function _n(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function Tn(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function En(e,t){const n=function(e,t){return e.x*t.x+e.y*t.y}(e,t)/(Tn(e)*Tn(t));return Tn(e)*Tn(t)==0?1/0:Math.acos(n)}function Ln(e,t,n,r){const o=e*n+t*r,s=Math.sqrt((e*e+t*t)*(n*n+r*r));let i=Math.acos(o/s);return e*r-t*n<0&&(i=-i),i}var Pn=n(7667);const Rn="rgb(0, 0, 0)";class Bn{constructor(e){this.center=kn({x:0,y:0},e),this.origin_offset=kn({x:0,y:0},e),this.bounding_box_lam=e=>this.center(),this.hasBoundingBox=!1,this.children=[],this.dependents=[],this.masks=[]}boundingBox(){return 0==this.children.length?{top_left:this.center(),bottom_right:this.center()}:Cn(this.children.map((e=>e.boundingBox())))}getChildren(){return this.children}setCenter(e){this.center=kn(this.center(),e)}hasLam(){return this.hasBoundingBox}getLam(){return this.hasBoundingBox?this.bounding_box_lam:(e=this.boundingBox(),t=>{const n=t%(2*Math.PI),r=e.top_left,o=e.bottom_right,s=Math.abs(r.y-o.y),i=Math.abs(r.x-o.x),a=Math.atan(s/i);if(2*Math.PI-a<=n||n<=a){const e=o.x;let t;return t=n>Math.PI?o.y-s/2+Math.tan(2*Math.PI-n)*i/2:o.y-s+Math.tan(n)*i/2,{x:e,y:t}}if(aMath.PI/2?r.x+s/(2*Math.tan(n-Math.PI/4)):r.x+i/2+s/(2*Math.tan(n)),{x:e,y:r.y}}if(Math.PI-a{r.append("rect").attr("x",e.top_left.x).attr("y",e.top_left.y).attr("width",Math.abs(e.top_left.x-e.bottom_right.x)).attr("height",Math.abs(e.top_left.y-e.bottom_right.y))})),n}render(e,t){let n;n=t?this.masks.concat(t):this.masks,this.children.forEach((t=>{t.render(e,n)}))}sterlingExpectCenter(e,t,n){if(this.center().x!==t)throw new Error(`${e}: center().x was not expected value (${t}); was ${this.center().x}`);if(this.center().y!==n)throw new Error(`${e}: center().y was not expected value (${n}); was ${this.center().y}`)}}class Zn extends Bn{constructor(e){super(e.coords),this.text=kn("",e.text),this.fontSize=kn(15,e.fontSize),this.color=kn("rgb(0, 0, 0)",e.color),this.events=kn([],e.events),this.fontWeight=kn(400,e.fontWeight)}boundingBox(){return{top_left:{x:this.center().x-this.fontSize()/2,y:this.center().y-this.fontSize()/2},bottom_right:{x:this.center().x+this.fontSize()/2,y:this.center().y+this.fontSize()/2}}}setText(e){this.text=kn(this.text(),e)}setFontSize(e){this.fontSize=kn(this.fontSize(),e)}setTextColor(e){this.color=kn(this.color(),e)}setFontWeight(e){this.fontWeight=kn(this.fontWeight(),e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e);const o=Pn.Ys(e).append("text").attr("x",this.center().x).attr("y",this.center().y).attr("text-anchor","middle").attr("alignment-baseline","central").attr("font-size",this.fontSize).attr("font-weight",this.fontWeight).attr("mask",n.length>0?`url(#${r})`:"").attr("fill",this.color).text(this.text);this.events()&&this.events().forEach((e=>o.on(e.event,e.callback))),super.render(e)}}class Vn extends Bn{constructor(e){super(e.center),this.color=kn("rgb(0, 0, 0)",e.color),this.borderWidth=kn(2,e.borderWidth),this.borderColor=kn("rgb(255, 255, 255)",e.borderColor),this.label=new Zn({text:e.label,coords:()=>this.center(),color:e.labelColor,fontSize:e.labelSize}),this.children.push(this.label),this.opacity=kn(1,e.opacity)}setColor(e){this.color=kn(this.color(),e)}setBorderWidth(e){this.borderWidth=kn(this.borderWidth(),e)}setBorderColor(e){this.borderColor=kn(this.borderColor(),e)}setLabelText(e){this.label.setText(e)}setLabelColor(e){this.label.setTextColor(e)}setLabelSize(e){this.label.setFontSize(e)}}class $n extends Vn{constructor(e){var t;super(e),this.height=kn(0,e.height),this.width=kn(0,e.width),this.labelLocation=null!==(t=e.labelLocation)&&void 0!==t?t:"center";const n={x:0,y:0};if(e.center&&e.coords)throw"you cannot include both coords and a center as the two define the same thing";this.center=(()=>{if(e.center)return kn(n,e.center);{const t=kn(n,e.coords);return()=>{const e=t();return{x:e.x+this.width()/2,y:e.y+this.height()/2}}}})(),this.setLabelLocation()}boundingBox(){return{top_left:{x:this.center().x-this.width()/2,y:this.center().y-this.height()/2},bottom_right:{x:this.center().x+this.width()/2,y:this.center().y+this.height()/2}}}setLabelLocation(){switch(this.labelLocation){case"topLeft":this.label.setCenter((()=>({x:this.center().x-this.width()/2+2.5*this.label.text().length,y:this.center().y-this.height()/2-1*this.label.fontSize()})));break;case"topRight":this.label.setCenter((()=>({x:this.center().x+this.width()/2-2.5*this.label.text().length,y:this.center().y-this.height()/2-1*this.label.fontSize()})));break;case"bottomRight":this.label.setCenter((()=>({x:this.center().x+this.width()/2-2.5*this.label.text().length,y:this.center().y+this.height()/2+1*this.label.fontSize()})));break;case"bottomLeft":this.label.setCenter((()=>({x:this.center().x-this.width()/2+2.5*this.label.text().length,y:this.center().y+this.height()/2+1*this.label.fontSize()})))}}setWidth(e){this.width=kn(this.width(),e)}setHeight(e){this.height=kn(this.height(),e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),Pn.Ys(e).append("rect").attr("x",this.center().x-this.width()/2).attr("y",this.center().y-this.height()/2).attr("width",this.width()).attr("height",this.height()).attr("stroke-width",this.borderWidth()).attr("stroke",this.borderColor()).attr("fill",this.color()).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}class Fn extends Vn{constructor(e){super(e),this.radius=kn(0,e.radius),this.bounding_box_lam=e=>{const t=this.radius(),n=this.center();return{x:t*Math.cos(e)+n.x,y:t*Math.sin(e)+n.y}},this.hasBoundingBox=!0}boundingBox(){return{top_left:{x:this.center().x-this.radius(),y:this.center().y-this.radius()},bottom_right:{x:this.center().x+this.radius(),y:this.center().y+this.radius()}}}setRadius(e){this.radius=kn(0,e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),Pn.Ys(e).append("circle").attr("cx",this.center().x).attr("cy",this.center().y).attr("r",this.radius).attr("stroke-width",this.borderWidth).attr("stroke",this.borderColor).attr("fill",this.color).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}var Gn=n(28721);class Wn extends Bn{constructor(e){var t;let n;n=null!=e.points?e.points.map((e=>kn({x:0,y:0},e))):[],super((()=>On(n.map((e=>e()))))),this.pointsRelative=Sn(n,this.center),this.color=kn(Rn,e.color),this.width=kn(2,e.width),this.opacity=kn(1,e.opacity),this.arrow=null!==(t=e.arrow)&&void 0!==t&&t,this.style=kn("full",e.style),this.curve=kn({curveType:"none"},e.curve)}boundingBox(){return In(this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y}))))}setColor(e){this.color=kn(this.color(),e)}setWidth(e){this.width=kn(this.width(),e)}setOpacity(e){this.opacity=kn(this.opacity(),e)}render(e,t){let n,r="";if(n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),2==this.pointsRelative.length)for(;this.pointsRelative[0]().x==this.pointsRelative[1]().x||this.pointsRelative[0]().y==this.pointsRelative[1]().y;){if(this.pointsRelative[0]().x==this.pointsRelative[1]().x){const e=this.pointsRelative[0];this.pointsRelative[0]=()=>({x:e().x+1e-4,y:e().y})}if(this.pointsRelative[0]().y==this.pointsRelative[1]().y){const e=this.pointsRelative[0];this.pointsRelative[0]=()=>({x:e().x,y:e().y+1e-4})}}let o=this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y})));const s=this.buildPathString(o);let i="0";if("dashed"==this.style()?i=5*this.width():"dotted"==this.style()&&(i=this.width()),this.arrow){const t=(0,Gn.Z)();Pn.Ys(e).append("svg:defs").append("svg:marker").attr("id",t).attr("refX",11).attr("refY",6).attr("markerWidth",10*this.width()).attr("markerHeight",10*this.width()).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 0 0 12 6 0 12 3 6").style("fill",this.color),Pn.Ys(e).append("path").attr("d",s).attr("stroke-width",this.width).attr("stroke",this.color).attr("opacity",this.opacity()).attr("marker-end",`url(#${t})`).attr("mask",n.length>0?`url(#${r})`:"").style("stroke-dasharray",i).attr("fill","transparent"),super.render(e,n)}else Pn.Ys(e).append("path").attr("d",s).attr("stroke-width",this.width).attr("stroke",this.color).attr("opacity",this.opacity()).attr("fill","transparent").attr("mask",n.length>0?`url(#${r})`:"").style("stroke-dasharray",i),super.render(e,n)}buildPathString(e){const t=this.curve();switch(t.curveType){case"none":const n=Pn.ETc();return n.moveTo(e[0].x,e[0].y),e.forEach((e=>{n.lineTo(e.x,e.y)})),n.toString();case"arc":return`M ${e[0].x} ${e[0].y} \n A ${t.xradius} ${t.yradius} 0 0 \n ${void 0!==t.sweep?t.sweep:1} ${e[1].x} ${e[1].y}`;case"cubic":throw console.log("Error: cubic curves currently unsupported by Line"),new Error("cubic curves currently unsupported by Line");case"quadratic":throw console.log("Error: quadratic curves currently unsupported by Line"),new Error("quadratic curves currently unsupported by Line");default:throw console.log(`Error: unrecognized curveType in prop ${JSON.stringify(t)} (check you have not misspelled the field name)`),new Error(`unknown curveType field in Line prop ${JSON.stringify(t)} (check you have not misspelled the field name)`)}}}class Un extends Bn{constructor(e){var t,n;super(e.coords);let r=kn({x:0,y:0},e.coords);this.center=()=>({x:r().x+this.width/2,y:r().y+this.height/2}),this.coords=()=>{const e=this.center();return{x:e.x-this.width/2,y:e.y-this.height/2}},this.height=e.height,this.width=e.width,this.root=e.root;let o=this.root.visualObject.center;this.root.visualObject.setCenter((()=>{const e=this.coords(),t=o();return{x:e.x+this.width/2+t.x,y:e.y+t.y}})),this.lines=[],this.subTrees=[],this.setUpSubtrees(),this.setLineColor(null!==(t=e.edgeColor)&&void 0!==t?t:"black"),this.setLineWidth(null!==(n=e.edgeWidth)&&void 0!==n?n:2)}setUpSubtrees(){let e=this.height/(qn(this.root)-1),t=this.root.children.map((e=>Yn(e))).reduce(((e,t)=>e+t),0);this.subTrees=[];let n=0;this.subTrees=this.root.children.map((r=>{let o=Yn(r),s=n;return n+=o,new Un({root:r,height:e*(qn(r)-1),width:this.width*Yn(r)/t,coords:()=>{const n=this.coords();return{x:n.x+s/t*this.width,y:n.y+e}}})})),this.subTrees.forEach((e=>{this.lines.push(new Wn({points:[()=>{const e=this.root.visualObject.center();return{x:e.x,y:e.y}},()=>{const t=e.root.visualObject.center();return{x:t.x,y:t.y}}],color:Rn,width:2}))})),this.lines.forEach((e=>{this.children.push(e)})),this.subTrees.forEach((e=>{this.children.push(e)})),this.children.push(this.root.visualObject)}setLineColor(e){this.lines.forEach((t=>t.setColor(e))),this.subTrees.forEach((t=>t.setLineColor(e)))}setLineWidth(e){this.lines.forEach((t=>t.setWidth(e))),this.subTrees.forEach((t=>t.setLineWidth(e)))}}function qn(e){let t=0,n=[e];for(;0!=n.length;){t+=1;let e=[];n.forEach((t=>{t.children.forEach((t=>{e.push(t)}))})),n=e}return t}function Yn(e){let t=1,n=[e];for(;0!=n.length;){let e=[];n.forEach((t=>{t.children.forEach((t=>{e.push(t)}))})),n=e,t=Math.max(t,e.length)}return t}class Xn{static error(e,t,n){return n&&console.trace(),Error(`[${e}] ${t}`)}static missingAttribute(e,t){return Error(`[${e}] Missing attribute: ${t}`)}static missingElement(e,t){return Error(`[${e}] Missing element: <${t}>`)}}class Jn{constructor(e){this._tuples=e||[]}empty(){return 0===this._tuples.length}equals(e){return this.toString()===e.toString()}in(e){const t=new Set(e.tuples().map((e=>e.toString())));return this.tuples().every((e=>t.has(e.toString())))}join(e){if(Array.isArray(e))throw Xn.error("AlloySet",`[${e}] is an array, not an AlloySet, so unable to apply join.`);if(!(e instanceof Jn))throw Xn.error("AlloySet",`${e} is something other than an AlloySet, so unable to apply join.`);if(!this.tuples().length||!e.tuples().length)return new Jn;const t=function(e,t){const n=new Map;return t.forEach((e=>{const t=e.atoms()[0];n.has(t.id())||n.set(t.id(),[]),n.get(t.id()).push(e)})),n}(0,e.tuples()),n=[],r=this._tuples[0].atoms().length-1;return this.tuples().forEach((e=>{const o=e.atoms()[r],s=t.get(o.id());s&&s.forEach((t=>{const r=e.atoms().slice(0,-1).concat(...t.atoms().slice(1));n.push(new Hn(r))}))})),new Jn(function(e){const t=new Set;return e.filter((e=>{const n=e.atoms().map((e=>e.id())).join();return!t.has(n)&&(t.add(n),!0)}))}(n))}toString(){return this._tuples.map((e=>e.toString())).join("\n")}tuples(){return this._tuples.slice()}}class Hn extends Jn{constructor(e){super(),this._tuples=[this],this._atoms=e}atoms(){return this._atoms.slice()}toString(){return this._atoms.map((e=>e.id())).join(", ")}static tuplesFromXML(e,t){return Array.from(e).map((e=>{if(1===t.length)return Hn.buildTuple(t[0],e);const n=t.reduce(((t,n)=>{if(t)return t;try{return Hn.buildTuple(n,e)}catch(e){return}}),void 0);if(n)return n;throw Xn.error("AlloyField",`No match for tuple element ${e} in declared types ${t}`)}))}static buildTuple(e,t){const n=Array.from(t.querySelectorAll("atom")).map(((t,n)=>{const r=e[n],o=t.getAttribute("label");if(!o)throw Xn.missingAttribute("AlloyField","label");const s=r.atom(o);if(!s)throw Xn.error("AlloyField",`No atom: ${o} in type: ${r}`);return s}));return new Hn(n)}}class Qn extends Jn{constructor(e,t){super();const n=t?t.applyProxy(this,function(e){return e.replace("/","$").replace("-","$")}(e)):this;return this._id=e,this._tuples=[new Hn([n])],n}clone(e){return new Qn(this.id(),e)}id(){return this._id}static fromElement(e,t){const n=e.getAttribute("label");if(!n)throw Xn.missingAttribute("AlloyAtom","label");return new Qn(n,t)}}const Kn=[{name:"VisualObject",value:Bn},{name:"Shape",value:Vn},{name:"Grid",value:class extends Bn{constructor(e){super(e.grid_location),this.config=e;let t=kn({x:0,y:0},this.config.grid_location);this.center=()=>{const e=t();return{x:e.x+this.config.grid_dimensions.x_size*this.config.cell_size.x_size/2,y:e.y+this.config.grid_dimensions.y_size*this.config.cell_size.y_size/2}},this.coords=()=>{const e=this.center();return{x:e.x-this.config.grid_dimensions.x_size*this.config.cell_size.x_size/2,y:e.y-this.config.grid_dimensions.y_size*this.config.cell_size.y_size/2}},this.cells=new Array(this.config.grid_dimensions.y_size).fill([]);for(var n=0;nthis.config.cell_size.y_size)throw`Proposed object to add is taller than grid cells. Add "true" as the last parameter to\n grid.add() to hide this error.\n Grid cells are ${this.config.cell_size.y_size}\n units tall, while the object you want to add is ${n} units tall`;if(t>this.config.cell_size.x_size)throw`Proposed object to add is wider than grid cells. Add "true" as the last parameter to\n grid.add() to hide this error.\n Grid cells are ${this.config.cell_size.x_size}\n units tall, while the object you want to add is ${t} units tall`}add(e,t,n){if(!(t instanceof Bn))throw new Error("Grid can only add VisualObjects as children.");this.check_coords(e),n||this.check_bounding_box(t.boundingBox()),this.children.push(t),t.center=this.center_helper(e,t.origin_offset),this.cells[e.y][e.x]=t}center_helper(e,t){return()=>{let n=t();const r=this.coords();return{x:r.x+this.config.cell_size.x_size*(e.x+.5)+n.x,y:r.y+this.config.cell_size.y_size*(e.y+.5)+n.y}}}fill_grid_lines(){for(let e=0;e<=this.config.grid_dimensions.y_size;e++){const t=new Wn({points:[()=>{const t=this.coords();return{x:t.x,y:t.y+e*this.config.cell_size.y_size}},()=>{const t=this.coords();return{x:t.x+this.config.grid_dimensions.x_size*this.config.cell_size.x_size,y:t.y+e*this.config.cell_size.y_size}}]});this.gridlines.push(t),this.children.push(t)}for(let e=0;e<=this.config.grid_dimensions.x_size;e++){const t=new Wn({points:[()=>{const t=this.coords();return{x:t.x+e*this.config.cell_size.x_size,y:t.y}},()=>{const t=this.coords();return{x:t.x+e*this.config.cell_size.x_size,y:t.y+this.config.grid_dimensions.y_size*this.config.cell_size.y_size}}]});this.gridlines.push(t),this.children.push(t)}}hide_grid_lines(){this.gridlines.forEach((e=>{e.setOpacity(0)}))}fill(e,t){this.check_coords(e);const n=new $n({height:this.config.cell_size.x_size,width:this.config.cell_size.y_size});n.setColor(t),this.add(e,n)}check_coords(e){if(!Number.isInteger(e.x)||!Number.isInteger(e.y))throw`non-integer indices given for grid coords. Inputted coords: ${e.x},${e.y}`;if(e.x<0||e.y<0)throw"negative indices given for grid coords";if(e.x>this.config.grid_dimensions.x_size-1||e.y>this.config.grid_dimensions.y_size-1)throw`coordinates out of bounds. Grid is of x_size ${this.config.grid_dimensions.x_size} and y_size ${this.config.grid_dimensions.y_size}\n\n Note: passing in 2 refers to index 2 which is the third element of the grid`}childAt(e,t){if(void 0!==this.cells[e]&&void 0!==this.cells[e][t])return this.cells[e][t]}}},{name:"Rectangle",value:$n},{name:"Circle",value:Fn},{name:"Stage",value:class{constructor(){this.Children=[],this.masks=[]}add(e){if(!(e instanceof Bn))throw new Error("Stage can only add VisualObjects as children.");this.Children.push(e)}addAll(e){e.forEach((e=>{this.Children.push(e)}))}remove(e){this.Children=this.Children.filter((t=>t!==e))}addMask(e){this.masks.push(e)}childrenToTreeRecurse(e){const t=e.constructor.name,n={visualObject:new Zn({text:t}),children:[]};return 0==e.getChildren().length||e.children.forEach((e=>{n.children.push(this.childrenToTreeRecurse(e))})),n}render(e,t){if(Pn.Ys(e).selectAll("*").remove(),this.Children.forEach((t=>t.render(e,this.masks))),t){const e=t.getElementById("svg-container");e.getElementsByTagName("svg")[0].style.height="200%",e.getElementsByTagName("svg")[0].style.width="200%"}}}},{name:"TextBox",value:Zn},{name:"Line",value:Wn},{name:"Polygon",value:class extends Vn{constructor(e){let t=e.points.map((e=>kn({x:0,y:0},e)));e.center=()=>On(t.map((e=>e()))),super(e),this.pointsRelative=Sn(t,this.center)}boundingBox(){return In(this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y}))))}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks;let o=this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y}))),s=Pn.ETc();s.moveTo(o[0].x,o[0].y),o.forEach((e=>{s.lineTo(e.x,e.y)})),s.closePath(),r=this.addMaskRender(n,e),Pn.Ys(e).append("path").attr("d",s.toString()).attr("stroke-width",this.borderWidth).attr("stroke",this.borderColor).attr("fill",this.color).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}},{name:"Tree",value:Un},{name:"Edge",value:class extends Bn{constructor(e){var t,n,r,o;super(),this.obj1=e.obj1,this.obj2=e.obj2,this.textProps=null!==(t=e.textProps)&&void 0!==t?t:{},this.lineProps=null!==(n=e.lineProps)&&void 0!==n?n:{points:[]},this.textLocation=null!==(r=e.textLocation)&&void 0!==r?r:"none",this.obj1CoordsStore={x:0,y:0},this.obj2CoordsStore={x:0,y:0},this.fast_imprecise=null!==(o=e.fast_imprecise)&&void 0!==o&&o,this.obj1Coords=()=>({x:0,y:0}),this.obj2Coords=()=>({x:0,y:0}),this.compute_points(30),this.makeLine(),this.makeText()}compute_points(e){const t=_n(this.obj1.center(),this.obj2.center());this.obj2Coords=()=>this.opt_points(t,this.obj2,e,"obj1"),this.obj1Coords=()=>this.opt_points(t,this.obj1,e,"obj2")}opt_points(e,t,n,r){if(this.fast_imprecise){let e;if("obj1"==r)e=this.obj1CoordsStore;else{if("obj2"!=r)throw"bad arg for coordsstore";e=this.obj1CoordsStore}if(e.xt.boundingBox().top_left.x&&e.y>t.boundingBox().bottom_right.y&&e.y{zn(t,e)function(e,t){if(e.x==t.x)return 90;{let n=(e.y-t.y)/(e.x-t.x);return Math.atan(n)}}(this.obj1Coords(),this.obj2Coords()),n=()=>Math.sqrt(Math.pow(e.fontSize(),2)+Math.pow(.14*e.text().length*e.fontSize(),2)),r=()=>{const e=this.arcMidpoint();return void 0!==e?e:_n(this.obj1Coords(),this.obj2Coords())};switch(this.textLocation){case"above":e.setCenter((()=>({x:r().x+Math.cos(t()-Math.PI/2)*n(),y:r().y+Math.sin(t()-Math.PI/2)*n()})));break;case"below":e.setCenter((()=>({x:r().x+Math.cos(t()+Math.PI/2)*n(),y:r().y+Math.sin(t()+Math.PI/2)*n()})));break;case"left":e.setCenter((()=>t()<=0?{x:r().x+Math.cos(t()-Math.PI/2)*n(),y:r().y+Math.sin(t()-Math.PI/2)*n()}:{x:r().x+Math.cos(t()+Math.PI/2)*n(),y:r().y+Math.sin(t()+Math.PI/2)*n()}));break;case"right":e.setCenter((()=>t()<=0?{x:r().x+Math.cos(t()+Math.PI/2)*n(),y:r().y+Math.sin(t()+Math.PI/2)*n()}:{x:r().x+Math.cos(t()-Math.PI/2)*n(),y:r().y+Math.sin(t()-Math.PI/2)*n()}));break;case"clockwise":e.setCenter((()=>{let e=Dn({x:this.obj2Coords().x-this.obj1Coords().x,y:this.obj2Coords().y-this.obj1Coords().y});return{x:r().x-e.y*n(),y:r().y+e.x*n()}}));break;case"counterclockwise":e.setCenter((()=>{let e=Dn({x:this.obj2Coords().x-this.obj1Coords().x,y:this.obj2Coords().y-this.obj1Coords().y});return{x:r().x+e.y*n(),y:r().y-e.x*n()}}));break;default:console.log(`default text position: midpoint of line or arc: at ${JSON.stringify(r())}`),e.setCenter((()=>({x:r().x,y:r().y})))}this.children.push(e)}arcMidpoint(){if(!this.lineProps)return;const e=this.lineProps.curve instanceof Function?this.lineProps.curve():this.lineProps.curve;if(e){if("arc"===e.curveType){const t=function({x1:e,y1:t,rx:n,ry:r,phi:o,fA:s,fS:i,x2:a,y2:l}){let c,d,h,p,u;const m=2*Math.PI;if(0==n||0==r)throw Error("rx and ry can not be 0");n<0&&(n=-n),r<0&&(r=-r);const g=Math.sin(o),f=Math.cos(o),x=(e-a)/2,b=(t-l)/2,y=(e+a)/2,w=(t+l)/2,v=f*x+g*b,j=f*b-g*x,A=v*v/(n*n)+j*j/(r*r);A>1&&(n*=Math.sqrt(A),r*=Math.sqrt(A));var M=n*r,k=n*j,C=r*v,O=k*k+C*C;if(!O)throw Error("start point can not be same as end point");var S=Math.sqrt(Math.abs((M*M-O)/O));s==i&&(S=-S);var I=S*k/r,N=-S*C/n;c=f*I-g*N+y,d=g*I+f*N+w;var z=(v-I)/n,D=(v+I)/n,_=(j-N)/r,T=(j+N)/r;for(h=Ln(1,0,z,_),p=Ln(z,_,-D,-T);p>m;)p-=m;for(;p<0;)p+=m;for(0==i&&(p-=m),u=h+p;u>m;)u-=m;for(;u<0;)u+=m;return{cx:c,cy:d,startAngle:h,deltaAngle:p,endAngle:u,clockwise:1==i,rx:n,ry:r}}({x1:this.obj1Coords().x,y1:this.obj1Coords().y,rx:e.xradius,ry:e.yradius,phi:0,fA:!1,fS:1===e.sweep,x2:this.obj2Coords().x,y2:this.obj2Coords().y}),n=0===e.sweep;return{x:t.cx,y:n?t.cy+t.ry:t.cy-t.ry}}throw console.log(`unsupported curve type: ${e.curveType}`),new Error(`unsupported curve type: ${e.curveType}`)}}}},{name:"Hull",value:class extends Bn{constructor(e){var t,n;super(),this.fuzz=null!==(t=e.fuzz)&&void 0!==t?t:0,this.smooth=null!==(n=e.smooth)&&void 0!==n&&n,this.pts=function(e){let t=[],n=new Set;t.push(function(e){return e.sort(((e,t)=>e.x>t.x?1:t.x>e.x?-1:0))[0]}(e));let r=0;for(;0==r||t[r].x!=t[0].x||t[r].y!=t[0].y;){let o;0==r?o={x:0,y:1}:(o={x:t[r].x-t[r-1].x,y:t[r].y-t[r-1].y},n.add({x:t[r].x,y:t[r].y}));let s={x:0,y:0},i=2*Math.PI;e.forEach((e=>{if(!n.has({x:e.x,y:e.y})){let n={x:e.x-t[r].x,y:e.y-t[r].y},a=En(o,n);(a{t.push({x:e.center().x,y:e.center().y})})):this.smooth?e.forEach((e=>{Nn(new Fn({radius:this.fuzz,center:e.center()}).getLam(),100).forEach((e=>t.push(e)))})):e.forEach((e=>{const n=new $n({height:this.fuzz,width:this.fuzz});n.setCenter(e.center()),Nn(n.getLam(),100).forEach((e=>t.push(e)))})),t}render(e,t){let n;n=t?this.masks.concat(t):this.masks,new Wn({points:this.pts}).render(e,n)}}},{name:"ConjoinedObject",value:class extends Bn{constructor(e){super({x:0,y:0}),this.children=[],e&&e.forEach((e=>{this.add(e)}))}addOrdered(e,t){if(!(e instanceof Bn))throw new Error("ConjoinedObject can only add VisualObjects as children.");if(t>this.children.length)throw`Index larger than current number of objects stored plus 1. Add an index between 0 and ${this.children.length}`;this.children.splice(t,0,e)}add(e){this.addOrdered(e,0)}setCenter(e){this.children.forEach((t=>{t.setCenter(e)}))}}},{name:"boxUnion",value:Cn},{name:"Ellipse",value:class extends Vn{constructor(e){super(e),this.height=kn(0,e.height),this.width=kn(0,e.width);let t=kn({x:0,y:0},e.coords);this.center=()=>{const e=t();return{x:e.x+this.width()/2,y:e.y+this.height()/2}}}boundingBox(){return{top_left:{x:this.center().x-this.width()/2,y:this.center().y-this.height()/2},bottom_right:{x:this.center().x+this.width()/2,y:this.center().y+this.height()/2}}}setWidth(e){this.width=kn(this.width(),e)}setHeight(e){this.height=kn(this.height(),e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),Pn.Ys(e).append("ellipse").attr("cx",this.center().x-this.width()/2).attr("cy",this.center().y-this.height()/2).attr("rx",this.width()).attr("ry",this.height()).attr("stroke-width",this.borderWidth()).attr("stroke",this.borderColor()).attr("fill",this.color()).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}},{name:"ImageBox",value:class extends Bn{constructor(e){super(e.coords),this.url=kn("",e.url),this.width=kn(100,e.width),this.height=kn(100,e.height)}boundingBox(){return{top_left:{x:this.center().x-this.width()/2,y:this.center().y-this.height()/2},bottom_right:{x:this.center().x+this.width()/2,y:this.center().y+this.height()/2}}}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),Pn.Ys(e).append("svg:image").attr("x",this.center().x-this.width()/2).attr("y",this.center().y-this.height()/2).attr("width",this.width()).attr("height",this.height()).attr("mask",n.length>0?`url(#${r})`:"").attr("xlink:href",`${this.url()}`),super.render(e)}}},{name:"AlloySet",value:Jn},{name:"AlloyAtom",value:Qn}];var er=n(25001);class tr extends Jn{constructor(e,t,n){return super(),this._id=e,this._atoms=t,this._subsignatures=[],this._tuples=t.map((e=>new Hn([e]))),n?n.applyProxy(this,function(e){return e.replace(/^this\//,"").replace("/","$").replace("-","$")}(e)):this}atom(e){return this.atoms(!0).find((t=>t.id()===e))||null}atoms(e=!1){return e?this.atoms().concat(this.subSignatures().map((e=>e.atoms(!0))).reduce(((e,t)=>e.concat(t)),[])):this._atoms.slice()}tuples(){return this.atoms(!0).map((e=>new Hn([e])))}clone(e){const t=new tr(this.id(),this.atoms().map((t=>t.clone(e))),e);return t._subsignatures=this.subSignatures().map((t=>t.clone(e))),t}id(){return this._id}subSignatures(e=!1){return e?this.subSignatures().concat(this.subSignatures().map((e=>e.subSignatures(!0))).reduce(((e,t)=>e.concat(t)),[])):this._subsignatures.slice()}static fromElement(e,t){const n=e.getAttribute("label");if(!n)throw Xn.missingAttribute("AlloySignature","label");const r=Array.from(e.querySelectorAll("atom")).map((e=>Qn.fromElement(e,t)));return new tr(n,r,t)}static intSignature(e,t){if(e<0)throw Xn.error("AlloySignature","Invalid bitwidth");const n=[];for(let r=Math.pow(2,e),o=-r/2;o{const n=e.getAttribute("ID"),o=e.getAttribute("label");if(!n)throw Xn.missingAttribute("AlloySignature","ID");const a=tr.getParent(e);if(!a&&"univ"!==o)throw Xn.error("AlloySignature",`unable to resolve parent sig for non-univ sig ${o}`);const l="Int"===o||"seq/Int"===o?r:tr.fromElement(e,t);return i.set(n,l),a&&"seq/Int"!==o&&(s.has(a)||s.set(a,[]),s.get(a).push(n)),l})),i.forEach(((e,t)=>{const n=s.get(t)||[];e._subsignatures=n.map((e=>i.get(e))).filter(er.$K)})),i}static getParent(e){const t=e.getAttribute("parentID"),n=e.getAttribute("label");if(!t&&"univ"!==n){const t=e.getElementsByTagName("type");if(1!==t.length)throw Xn.error("AlloySignature",`subset sig ${n} had no type or multiple types; this is unsupported`);if(t[0].getAttribute("ID"))return t[0].getAttribute("ID");throw Xn.missingAttribute("AlloySignature","type.ID")}return t}static typesFromXML(e,t){const n=e.querySelectorAll("types");if(!n)throw Xn.missingElement("AlloyField","types");return Array.from(n).map((e=>tr.typesFromXMLSingle(e,t)))}static typesFromXMLSingle(e,t){return Array.from(e.querySelectorAll("type")).map((e=>{const n=e.getAttribute("ID");if(!n)throw Xn.missingAttribute("AlloyField","ID");const r=t.get(n);if(!r)throw Xn.error("Alloy Field",`No signature with ID: ${n}`);return r}))}}var nr=n(44908),rr=n.n(nr);class or extends Jn{constructor(e,t){super(t),this._types=e}project(e){const t=rr()(this.types().map((t=>t.map((t=>e.get(t))))).flat());t.some(er.$K)&&(this._tuples=this.tuples().filter((e=>e.atoms().every(((e,n)=>void 0===t[n]||t[n]===e)))).map((e=>new Hn(e.atoms().filter(((e,n)=>void 0===t[n]))))))}types(){return this._types.slice()}join(e){if(e instanceof or){const t=this.types().map((e=>e.at(-1))),n=e.types().map((e=>e.at(0)));if(!t.some((e=>n.includes(e))))throw Xn.error("Join",`Joining ${this} and ${e} will always be empty.`)}return super.join(e)}}class sr extends or{constructor(e,t,n,r,o){return super(t,n),this._id=e,r?r.applyProxy(this,o?function(e){return e.replace(/-/g,"$").replace("/","$")}(o):e):this}clone(e,t){this.types().forEach((e=>{if(!this.types().every(er.$K))throw Xn.error("AlloyField","Missing type, cannot clone field")}));const n=this.tuples().map((e=>new Hn(e.atoms().map(((e,t)=>e.clone())))));if(t){const e=Reflect.get(this,"__var__");if(!e)throw Xn.error("AlloyField","Cannot use proxy to clone non-proxied field");return new sr(this.id(),this.types(),n,t,e.toString())}return new sr(this.id(),this.types(),n)}id(){return this._id}static fieldsFromXML(e,t,n){const r=Array.from(e.querySelectorAll("field")),o=new Map;return r.forEach((e=>{const t=e.getAttribute("label");if(!t)throw Xn.missingAttribute("AlloyField","label");o.set(t,(o.get(t)||0)+1)})),r.map((e=>{const r=e.getAttribute("label"),s=e.getAttribute("parentID"),i=tr.typesFromXML(e,t);if(!r)throw Xn.missingAttribute("AlloyField","label");if(!s)throw Xn.missingAttribute("AlloyField","parentID");const a=o.get(r)||0,l=t.get(s);if(!l)throw Xn.error("AlloyField","Field parent type does not exist");const c=a>1?(d=r,h=l,`${Reflect.get(h,"__var__")}$${d}`):r;var d,h;const p=Hn.tuplesFromXML(e.querySelectorAll("tuple"),i);return new sr(r,i,p,n,c)}))}}class ir{constructor(){this._sets=new Map}applyProxy(e,t){const n=this._sets,r=t||`${n.size}`,o=this._finalize.bind(this);if(n.has(r))throw Xn.error("AlloyProxy",`Cannot apply proxy, ID already exists: ${r}. (This may be caused by a clash between sig and atom names.)`);const s=new Proxy(e,{get(e,r){if("symbol"==typeof r||r in e)return Reflect.get(e,r);if("number"!=typeof r&&isNaN(+r)){let s;const i=r.match(/\[(.*)]/);if(i){const r=n.get(i[1]);if(!r)throw Xn.error("Box Join",`Tried to join ${t} with ${i[1]} but no set ${i[1]} defined.`,!0);s=r.join(e)}else{const o=n.get(r);if(!o)throw Xn.error("Dot Join",`Tried to join ${t} with ${r} but no set ${r} defined.`,!0);s=e.join(o)}return o(s)}{const t=n.get(`${r}`);if(!t)throw Xn.error("Join",`Integer atom does not exist: ${r}`);return o(t.join(e))}}});return Reflect.set(s,Symbol.toPrimitive,(()=>`[${r}]`)),Reflect.set(s,"__var__",r),this._sets.set(r,s),s}_finalize(e){if(1===e.tuples().length&&1===e.tuples()[0].atoms().length){const t=e.tuples()[0].atoms()[0];return this._sets.get(t.id())||this.applyProxy(t,t.id())}return this.applyProxy(e)}}class ar extends or{constructor(e,t,n,r){return super(t,n),this._id=e,r?r.applyProxy(this,function(e){return e.replace(/^\$this\//,"$").replace("/","$").replace(/'/g,"$")}(e)):this}clone(e,t){const n=this.tuples().map((e=>new Hn(e.atoms().map(((e,t)=>e.clone())))));return new ar(this.id(),this.types(),n,t)}id(){return this._id}static skolemsFromXML(e,t,n){return Array.from(e.querySelectorAll("skolem")).map((e=>{const r=e.getAttribute("label"),o=tr.typesFromXML(e,t),s=Hn.tuplesFromXML(e.querySelectorAll("tuple"),o);if(!r)throw Xn.missingAttribute("AlloySkolem","label");return new ar(r,o,s,n)}))}}class lr{constructor(e,t){this._proxy=new ir,this._atoms=[],this._fields=[],this._signatures=[],this._skolems=[],this._projections=new Map,this._bitwidth=0,this._command="",this._filename="",this._sources=new Map,e&&this._buildFromXML(e,t)}atom(e){return this._atoms.find((t=>t.id()===e))||null}atoms(){return this._atoms.slice()}bitwidth(){return this._bitwidth}clone(){const e=new ir,t=this.univ();if(!t)throw Xn.error("AlloyInstance","Cannot clone an instance without univ signature");const n=t.clone(e),r=[n,...n.subSignatures(!0)],o=n.atoms(!0),s=this.fields().map((t=>t.clone(r,e))),i=this.skolems().map((t=>t.clone(r,e))),a=new lr;return a._proxy=e,a._fields=s,a._signatures=r,a._atoms=o,a._skolems=i,a._bitwidth=this.bitwidth(),a._command=this.command(),a._filename=this.filename(),a}command(){return this._command}field(e){return this._fields.find((t=>t.id()===e))||null}fields(){return this._fields}filename(){return this._filename}project(e){const t=this.clone(),n=e.map((e=>t.atom(e.id())));if(!n.every(er.$K))throw Xn.error("AlloyInstance","Error cloning instance");const r=t.univ();if(!r)throw Xn.error("AlloyInstance","No univ signature");const o=r.subSignatures(),s=new Map;return n.forEach((e=>{o.forEach((t=>{if(t.atoms(!0).includes(e)){if(s.has(t))throw Xn.error("AlloyInstance","Cannot project over multiple atoms from the same signature");s.set(t,e)}}))})),this._projections=s,t.fields().forEach((e=>e.project(s))),t.skolems().forEach((e=>e.project(s))),t}projections(){return new Map(this._projections)}signature(e){return this.signatures().find((t=>t.id()===e))||null}signatures(){return this._signatures.slice()}skolem(e){return this.skolems().find((t=>t.id()===e))||null}skolems(){return this._skolems.slice()}sources(){return new Map(this._sources)}univ(){return this._signatures.find((e=>"univ"===e.id()))||null}_buildFromXML(e,t){const n=(new DOMParser).parseFromString(e,"application/xml"),r=n.querySelectorAll("instance"),o=void 0!==t?r[t]:r[0];if(!o)throw Xn.missingElement("AlloyInstance","instance");const s=o.getAttribute("bitwidth"),i=o.getAttribute("command"),a=o.getAttribute("filename"),l=o.getAttribute("maxseq");if(!s)throw Xn.missingAttribute("AlloyInstance","bitwidth");if(!i)throw Xn.missingAttribute("AlloyInstance","command");if(!a)throw Xn.missingAttribute("AlloyInstance","filename");if(!l)throw Xn.missingAttribute("AlloyInstance","maxseq");if(+s<1)throw Xn.error("AlloyInstance",`Invalid bitwidth ${s}`);this._bitwidth=+s,this._command=i,this._filename=a,this._atoms=[],this._fields=[],this._signatures=[],this._skolems=[];const c=tr.signaturesFromXML(o,this._proxy);this._signatures=Array.from(c.values()),this._fields=sr.fieldsFromXML(o,c,this._proxy),this._skolems=ar.skolemsFromXML(o,c,this._proxy),this._atoms=this._signatures.map((e=>e.atoms())).reduce(((e,t)=>e.concat(t)),[]),this._sources=new Map,Array.from(n.querySelectorAll("source")).forEach((e=>{const t=e.getAttribute("filename"),n=e.getAttribute("content");if(!t)throw Xn.missingAttribute("AlloyInstance","filename");if(!n)throw Xn.missingAttribute("AlloyInstance","content");this._sources.set(t,n)}))}}const cr="https://alloy-js.github.io/alloy-ts/classes/alloyinstance.alloyinstance-1.html",dr=function(e){return e.stage},hr=function(e){return e.stageDimensions},pr=function(e){return e.text},ur=function(e,t,n){if(wt(e)){const r=e.data,o=e.parsed.instances.map(((e,t)=>new lr(r,t))),s=o[n],i=s.atoms(),a=[];t.forEach((e=>{const t=e.atom;if(t){const e=i.find((e=>e.id()===t));e&&a.push(e)}}));const l=s.project(a),c=l.signatures().map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloySignature",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloysignature.alloysignature-1.html"}))),d=l.atoms().filter((e=>isNaN(+e.id()))).map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloyAtom",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloyatom.alloyatom-1.html"}))),h=l.fields().map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloyField",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloyfield.alloyfield-1.html"}))),p=l.skolems().map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloySkolem",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloyskolem.alloyskolem-1.html"}))),u=Kn.map((e=>({name:e.name,variable:e.value,type:"D3Helper",typeUrl:"https://csci1710.github.io/forge-documentation/sterling/d3fx.html"}))),m=[{name:"instance",variable:s,type:"AlloyInstance",typeUrl:cr},...c,...d,...h,...p,...u];return Qt(e.parsed)&&m.unshift({name:"currentInstance",type:"number",variable:n},{name:"loopBack",type:"number",variable:e.parsed.loopBack},{name:"instances",variable:o,type:"AlloyInstance[]",typeUrl:cr}),m}return function(e){return"raw"===e.format}(e)?[{name:"data",variable:e.data,type:"string"}]:[]};function mr(e){return e.mainView}function gr(e){return e.graphViewDrawer}function fr(e){return e.tableViewDrawer}function xr(e){return e.scriptViewDrawer}const br={selectAvailableViews:function(e){return e.availableViews},selectMainView:mr,selectGraphDrawer:gr,selectGraphDrawerThemeRelationExpanded:function(e,t,n){return!0===(0,hn.Z)(e,["graphDrawerThemeById",t.id,"expandedRelations",n])},selectGraphDrawerThemeTypeExpanded:function(e,t,n){return!0===(0,hn.Z)(e,["graphDrawerThemeById",t.id,"expandedTypes",n])},selectTableDrawer:fr,selectScriptDrawer:xr,selectDrawerIsCollapsed:(0,an.P1)([mr,gr,fr,xr],((e,t,n,r)=>{switch(e){case"GraphView":return null===t;case"TableView":return null===n;case"ScriptView":return null===r;default:return!0}})),selectDrawerView:(0,an.P1)([mr,gr,fr,xr],((e,t,n,r)=>{switch(e){case"GraphView":return t;case"TableView":return n;case"ScriptView":return r;default:return null}})),selectSelectedGenerator:function(e){return e.selectedGenerator}};function yr(e){return mn.selectActiveDatum(e.data)}function wr(e){return br.selectSelectedGenerator(e.ui)}function vr(e,t){const n=Tr(0,t),r=Er(e,t).map((e=>e.type)),o=(0,ln.Z)((0,cn.Z)(n),r);return(0,dn.Z)(n,o)}function jr(e){return br.selectAvailableViews(e.ui)}function Ar(e){return mn.selectData(e.data)}function Mr(e,t){return wt(t)&&Qt(t.parsed)}function kr(e){return br.selectDrawerIsCollapsed(e.ui)}function Cr(e){return br.selectDrawerView(e.ui)}function Or(e){return br.selectGraphDrawer(e.ui)}function Sr(e){const t=yr(e);return void 0!==t&&!0===t.evaluator}function Ir(e,t){return gn(e.evaluator,t)}function Nr(e){return jn(e.provider)}function zr(e){return vn(e.log)}function Dr(e){return br.selectMainView(e.ui)}function _r(e){return fn(e.evaluator)}function Tr(e,t){const n={};if(t&&wt(t)){const e=t.parsed.instances[0];(function(e){return(0,Kt.Z)(ut(e).map(Qe)).filter((e=>!(0,Jt.Z)(e)))})(e).forEach((t=>{const r=pt(e,t);n[t]=function(e,t){return ct(e).filter((n=>function(e,t,n){return"string"==typeof t&&(t=lt(e,t)),"string"!=typeof n&&(n=n.id),ot(e,t).types.includes(n)}(e,n,t)))}(e,r).map((e=>e.id))}))}return n}function Er(e,t){return wn.selectProjections(e.graphs,t)}function Lr(e){return An(e.provider)}function Pr(e){return Mn(e.provider)}function Rr(e){return br.selectScriptDrawer(e.ui)}function Br(e){return dr(e.script)}function Zr(e){return hr(e.script)}function Vr(e){return pr(e.script)}function $r(e){return br.selectTableDrawer(e.ui)}function Fr(e,t){return wn.selectTheme(e.graphs,t)}function Gr(e,t){return wn.selectTimeIndex(e.graphs,t)}const Wr=(0,an.P1)([(e,t)=>t,(e,t)=>t?function(e,t){return wn.selectGraphLayout(e.graphs,t)}(e,t):void 0,(e,t)=>t?Fr(e,t):void 0,(e,t)=>t?Gr(e,t):void 0,(e,t)=>t?function(e,t){return wn.selectHiddenRelations(e.graphs,t)}(e,t):void 0],((e,t,n,r,o)=>{if(e&&t&&n&&void 0!==r&&wt(e)&&o){const s=e.parsed.instances[r],i=n.projections||[],a=i.filter((e=>!0===e.time)),l=en(s,i.map((e=>e.atom)).filter(Je)),c=Rt(l,n);if(a.length)return a.map((e=>{let r=c;o[e.type]&&o[e.type].forEach((e=>{const t=V(r).filter((t=>t.relation.name===e)).map((e=>e.id));r=function(e,t){return(0,Ot.Uy)(e,(e=>{t.forEach((t=>{const n=Z(e,t);n&&function(e,t){const{id:n,source:r,target:o}=t;delete e.edges[n],function(e,t,n,r){const o=e.predecessors[n][t];if(o){const s=o.indexOf(r);-1!==s&&o.splice(s,1),0===o.length&&delete e.predecessors[n][t]}}(e,r,o,n),function(e,t,n,r){const o=e.successors[t][n];if(o){const s=o.indexOf(r);-1!==s&&o.splice(s,1),0===o.length&&delete e.successors[t][n]}}(e,r,o,n),function(e,t,n){const r=e.inedges[t].indexOf(n);-1!==r&&e.inedges[t].splice(r,1)}(e,o,n),function(e,t,n){const r=e.outedges[t].indexOf(n);-1!==r&&e.outedges[t].splice(r,1)}(e,r,n)}(e,n)}))}))}(c,t)}));const s=Ht(r,t);return Ft("",l,s,n)}));const d=Ht(c,t);return[Ft("",l,d,n)]}return console.log(`datum: ${void 0!==e}`),console.log(`layout: ${void 0!==t}`),console.log(`theme: ${void 0!==n}`),console.log(`time: ${r}`),[]})),Ur=(0,an.P1)([(e,t)=>t,(e,t)=>Er(e,t),(e,t)=>Gr(e,t)],((e,t,n)=>ur(e,t,n))),qr=(0,an.P1)([(e,t)=>t,(e,t)=>Gr(e,t)],((e,t)=>{if(wt(e)){const n=e.parsed.instances[t],r=function(e){const t=ht(e),n=dt(e);return t.concat(n)}(n).map((e=>({title:e.name,type:"relation",headers:e.types,data:it(e).map((e=>e.atoms))})));return[...r,...ut(n).map((e=>({title:e.id,type:"type",data:Ke(e).map((e=>[e.id]))})))]}return[]}));var Yr=n(10894),Xr=n(66653);const Jr=e=>{const{expression:t}=e;return(0,r.jsxs)("div",Object.assign({className:"relative p-2 font-mono text-xs"},{children:[(0,r.jsxs)("div",Object.assign({className:"relative flex ml-6"},{children:[(0,r.jsx)("span",Object.assign({className:"absolute inset-y-0 -left-5"},{children:(0,r.jsx)(Yr.JO,{as:Xr.tOB})})),(0,r.jsx)("div",Object.assign({className:"font-semibold select-text"},{children:t.expression}))]})),(0,r.jsx)("div",Object.assign({className:"ml-6 text-gray-600 select-text"},{children:t.result}))]}))},Hr=e=>{const{datum:t}=e,n=Ct((e=>Ir(e,t)));return(0,r.jsx)("div",Object.assign({className:"absolute inset-x-0 top-[35px] bottom-0 flex flex-col overflow-y-auto"},{children:n.map((e=>(0,r.jsx)(Jr,{expression:e},e.id)))}))},Qr=e=>{const{datum:t}=e,[n,s]=(0,o.useState)(""),[i,a]=(0,o.useState)(null),l=Ct(Sr),c=Ct(_r),d=Ct((e=>Ir(e,t))),h=kt(),p=(0,o.useCallback)((e=>{a(null),s(e.target.value)}),[]),u=(0,o.useCallback)((e=>{var t;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(t=e.code,Kr.includes(t))))switch(e.code){case"ArrowUp":null===i?d.length>0&&a(0):i{e.preventDefault(),n.length>0&&(h(Be({id:`${c}`,datumId:t.id,expression:n})),s(""),a(null))}),[t,c,n]),g=l?"gray.500":"gray.300",f=l?"Enter an expression...":"Evaluator disabled";return(0,r.jsx)("div",Object.assign({className:"absolute inset-x-0 top-0 h-[35px]"},{children:(0,r.jsxs)("form",Object.assign({className:"relative block font-mono",onSubmit:m},{children:[(0,r.jsx)("span",Object.assign({className:"sr-only"},{children:"Search"})),(0,r.jsx)("span",Object.assign({className:"absolute inset-y-0 left-0 flex items-center pl-2"},{children:(0,r.jsx)(Yr.JO,{color:g,as:Xr.tOB})})),(0,r.jsx)("input",{className:"h-[35px] text-xs placeholder:italic placeholder:text-gray-400 placeholder:text-xs block bg-white w-full border-b border-gray-100 focus:border-gray-200 py-2 pl-9 pr-3 focus:outline-none",placeholder:f,type:"text",disabled:!l,value:null===i?n:d[i].expression,onChange:p,onKeyDown:u})]}))}))},Kr=["Unidentified","Escape","Enter","ControlLeft","ControlRight","ShiftLeft","ShiftRight","AltLeft","AltRight","CapsLock","OSLeft","OSRight","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","ScrollLock","ArrowLeft","ArrowRight"],eo=()=>{const e=Ct(yr);return e?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0"},{children:[(0,r.jsx)(Qr,{datum:e}),(0,r.jsx)(Hr,{datum:e})]})):null},to=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:Xr.RJr}),(0,r.jsx)(O,{children:"Evaluator"})]})),no=()=>{const e=Ct(zr);return(0,r.jsx)(b,Object.assign({h:"full",px:2,py:1,overflowY:"auto"},{children:e.map(((e,t)=>(0,r.jsx)(L,{text:e.text,time:new Date(e.time),variant:e.type},t)))}))},ro=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{className:"mt-0.5",as:Xr.t75}),(0,r.jsx)(O,{children:"Log"})]}));var oo=n(89583),so=n(47016),io=n(51649),ao=n(41947),lo=n(18124);const co={nodeWidth:100,nodeHeight:60,nodeSep:100,rankSep:100},ho={hidden:{builtinDisconnected:!0},nodes:[{shape:{shape:"rectangle",width:100,height:60},styles:{node:{stroke:"#333",strokeWidth:1,fill:"#ffffff"},label:{fontFamily:"monospace",fontSize:"14px",textAnchor:"middle",userSelect:"none",fill:"#333"}},props:{label:{dy:"0.33em"}},targets:["*"]}],edges:[{asAttribute:!1,sourceIndex:0,curve:{type:"bspline"},styles:{edge:{stroke:"#333",strokeWidth:1,fill:"none"},label:{fontFamily:"monospace",fontSize:"12px",textAnchor:"middle",userSelect:"none"}},targets:["*"]}]};function po(e,t){var n;return null===(n=e.edges)||void 0===n?void 0:n.find((e=>{const n=e.targets,r=n?n[0]:void 0;return void 0!==n&&1===n.length&&void 0!==r&&"*"!==r&&r.relation===t}))}function uo(e,t){var n;return null===(n=e.nodes)||void 0===n?void 0:n.find((e=>{const n=e.targets,r=n?n[0]:void 0;return void 0!==n&&1===n.length&&void 0!==r&&"*"!==r&&r.type===t}))}function mo(e,t){var n;if(wt(t)){const r=e.themeByGeneratorName[null!==(n=t.generatorName)&&void 0!==n?n:""],o=r&&r.projections||[];if(o){const e=t.parsed.instances[0];o.forEach((t=>{if(!t.atom){const n=t.type,r=Ke(pt(e,n));r.length&&(t.atom=r[0].id)}}))}const s=xn(o),i=t.parsed.instances,a=o.map((e=>e.atom)).filter(Je),l=i.map((e=>en(e,a))).map((e=>Rt(e,r)));e.layoutsByDatumId[t.id].layoutById[s]=function(e,t){const n=new Set,r={};e.forEach((e=>{B(e).forEach((e=>{n.add(e.id)})),V(e).forEach((e=>{r[e.id]=e}))}));const o=new(Ut().graphlib.Graph)({multigraph:!0});o.setGraph({nodesep:t.nodeSep,ranksep:t.rankSep,rankdir:"TB"}),n.forEach((e=>{o.setNode(e,{label:e,width:t.nodeWidth,height:t.nodeHeight})})),(0,qt.Z)(r,((e,t)=>{o.setEdge(e.source,e.target,{id:t})})),Ut().layout(o);const s=function(e,t){const n=e.nodes().map((t=>e.node(t).x)),r=e.nodes().map((t=>e.node(t).y)),o=(0,Yt.Z)(n),s=(0,Yt.Z)(r),i=(0,Xt.Z)(n),a=(0,Xt.Z)(r);return{x:(0,Jt.Z)(o)||(0,Jt.Z)(i)?0:(i-o)/2+t.nodeWidth/2,y:(0,Jt.Z)(s)||(0,Jt.Z)(a)?0:(a-s)/2+t.nodeHeight/2}}(o,t),i={},a={};return o.nodes().forEach((e=>{const{x:t,y:n}=o.node(e);i[e]={x:t-s.x,y:n-s.y}})),o.edges().forEach((e=>{const{id:t,points:n}=o.edge(e);a[t]=n.slice(1,-1).map((e=>({x:e.x-s.x,y:e.y-s.y})))})),{nodePositions:i,edgeWaypoints:a}}(l,co)}}const go={asAttributeSet:function(e,t){var n;const{datum:r,relation:o,asAttribute:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=po(i,o);if(e)s?(0,pn.Z)(e,["asAttribute"],!0):(0,ao.Z)(e,["asAttribute"]);else if(s){const e={targets:[{relation:o}],asAttribute:!0};i.edges||(i.edges=[]),i.edges.push((0,Ot.cA)(e))}}},curveRemoved:function(e,t){var n;const{datum:r,relation:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(s){const e=po(s,o);e&&(0,ao.Z)(e,["curve"])}},curveSet:function(e,t){var n;const{datum:r,relation:o,curve:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=po(i,o);if(e)(0,pn.Z)(e,["curve"],s);else{const e={targets:[{relation:o}],curve:s};i.edges||(i.edges=[]),i.edges.push((0,Ot.cA)(e))}}},edgeLabelStyleRemoved:function(e,t){var n;const{datum:r,relation:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=po(i,o);e&&(0,ao.Z)(e,["styles","label",s])}},edgeLabelStyleSet:function(e,t){var n;const{datum:r,relation:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=po(a,o);if(e)(0,pn.Z)(e,["styles","label",s],i);else{const e={targets:[{relation:o}],styles:{label:{[s]:i}}};a.edges||(a.edges=[]),a.edges.push((0,Ot.cA)(e))}}},edgeStyleRemoved:function(e,t){var n;const{datum:r,relation:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=po(i,o);e&&(0,ao.Z)(e,["styles","edge",s])}},edgeStyleSet:function(e,t){var n;const{datum:r,relation:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=po(a,o);if(e)(0,pn.Z)(e,["styles","edge",s],i);else{const e={targets:[{relation:o}],styles:{edge:{[s]:i}}};a.edges||(a.edges=[]),a.edges.push((0,Ot.cA)(e))}}},edgeIndexSet:function(e,t){var n;const{datum:r,relation:o,which:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const t=po(a,o);if(t)(0,pn.Z)(t,[s],i);else{const e={targets:[{relation:o}]};e[s]=i,a.edges||(a.edges=[]),a.edges.push((0,Ot.cA)(e))}mo(e,r)}},edgeIndexRemoved:function(e,t){var n;const{datum:r,relation:o,which:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=po(i,o);e&&(0,ao.Z)(e,[s])}},graphSpread:function(e,t){const{datum:n,matrix:r}=t.payload,o=e.matricesByDatumId[n.id];o&&(o.spreadMatrix=r)},graphZoomed:function(e,t){const{datum:n,matrix:r}=t.payload,o=e.matricesByDatumId[n.id];o&&(o.zoomMatrix=r)},hiddenRelationAdded:function(e,t){const{datum:n,type:r,relation:o}=t.payload;e.hiddenByDatumId[n.id][r]||(e.hiddenByDatumId[n.id][r]=[]),e.hiddenByDatumId[n.id][r].push(o)},nodeLabelPropRemoved:function(e,t){var n;const{datum:r,type:o,prop:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=uo(i,o);e&&(0,ao.Z)(e,["props","label",s])}},nodeLabelPropSet:function(e,t){var n;const{datum:r,type:o,prop:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=uo(a,o);if(e)(0,pn.Z)(e,["props","label",s],i);else{const e={targets:[{type:o}],props:{label:{[s]:i}}};a.nodes||(a.nodes=[]),a.nodes.push((0,Ot.cA)(e))}}},nodeLabelStyleRemoved:function(e,t){var n;const{datum:r,type:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=uo(i,o);e&&(0,ao.Z)(e,["styles","label",s])}},nodeLabelStyleSet:function(e,t){var n;const{datum:r,type:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=uo(a,o);if(e)(0,pn.Z)(e,["styles","label",s],i);else{const e={targets:[{type:o}],styles:{label:{[s]:i}}};a.nodes||(a.nodes=[]),a.nodes.push((0,Ot.cA)(e))}}},nodesOffset:function(e,t){var n;const{datum:r,offsets:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""],i=xn(s&&s.projections||[]),a=e.layoutsByDatumId[r.id].layoutById[i];(0,qt.Z)(o,((e,t)=>{const n=a.nodePositions[t];a.nodePositions[t]=se(n,e)}))},projectionAdded:function(e,t){var n;const{datum:r,type:o,atom:s,time:i,timeOrdering:a}=t.payload,l={type:o,atom:s,time:i,timeOrdering:a},c=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];c.projections?c.projections.push((0,Ot.cA)(l)):c.projections=[(0,Ot.cA)(l)],mo(e,r)},projectionOrderingSet:function(e,t){var n;const{datum:r,type:o,relation:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""],a=(i&&i.projections||[]).find((e=>e.type===o));a&&(s?a.timeOrdering=s:delete a.timeOrdering)},projectionRemoved:function(e,t){var n;const{datum:r,type:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];s.projections&&(0,lo.Z)(s.projections,(e=>e.type===o)),mo(e,r)},projectionSet:function(e,t){var n;const{datum:r,type:o,atom:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""],a=(i&&i.projections||[]).find((e=>e.type===o));a&&(a.atom=s),mo(e,r)},saveThemeRequested:function(e,t){var n;const{datum:r}=t.payload,o=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(o){const e=(0,Ot.Vk)(o),t=(0,Ot.Uy)(e,(e=>{var t;null===(t=e.projections)||void 0===t||t.forEach((e=>{(0,ao.Z)(e,"atom")}))})),n=JSON.stringify(t,null,2),r=document.createElement("a"),s=new Blob([n],{type:"application/json"});r.href=URL.createObjectURL(s),r.download="theme.json",r.click()}},shapeRemoved:function(e,t){var n;const{datum:r,type:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(s){const e=uo(s,o);e&&(0,ao.Z)(e,["shape"])}},shapeSet:function(e,t){var n;const{datum:r,type:o,shape:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=uo(i,o);if(e)(0,pn.Z)(e,["shape"],s);else{const e={targets:[{type:o}],shape:s};i.nodes||(i.nodes=[]),i.nodes.push((0,Ot.cA)(e))}}},shapeStyleRemoved:function(e,t){var n;const{datum:r,type:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=uo(i,o);e&&(0,ao.Z)(e,["styles","node",s])}},shapeStyleSet:function(e,t){var n;const{datum:r,type:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=uo(a,o);if(e)(0,pn.Z)(e,["styles","node",s],i);else{const e={targets:[{type:o}],styles:{node:{[s]:i}}};a.nodes||(a.nodes=[]),a.nodes.push((0,Ot.cA)(e))}}},themeFileLoaded:function(e,t){var n;const{datum:r,data:o}=t.payload;e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""]=JSON.parse(o),mo(e,r)},timeIndexSet:function(e,t){const{datum:n,index:r}=t.payload;e.timeByDatumId[n.id]=r}},fo=function(e,t){const{enter:n}=t.payload;n&&n.filter(wt).forEach((t=>{var n;const r=t.id;e.matricesByDatumId[t.id]={datumId:r,spreadMatrix:(0,ce.yR)(),zoomMatrix:(0,ce.yR)()};const o=null!==(n=t.generatorName)&&void 0!==n?n:"";o in e.themeByGeneratorName||(e.themeByGeneratorName[o]=(0,Ot.cA)(ho)),e.layoutsByDatumId[r]={datumId:r,layoutById:{}},mo(e,t),e.timeByDatumId[r]=0,e.hiddenByDatumId[r]={}}))},xo=(0,Le.oM)({name:"graphs",initialState:{layoutsByDatumId:{},matricesByDatumId:{},themeByGeneratorName:{},timeByDatumId:{},hiddenByDatumId:{}},reducers:go,extraReducers:e=>e.addCase(Ve,fo)}),{asAttributeSet:bo,edgeLabelStyleRemoved:yo,edgeLabelStyleSet:wo,edgeStyleRemoved:vo,edgeStyleSet:jo,edgeIndexSet:Ao,edgeIndexRemoved:Mo,curveRemoved:ko,curveSet:Co,graphSpread:Oo,graphZoomed:So,hiddenRelationAdded:Io,nodeLabelStyleRemoved:No,nodeLabelStyleSet:zo,nodeLabelPropRemoved:Do,nodeLabelPropSet:_o,nodesOffset:To,projectionAdded:Eo,projectionOrderingSet:Lo,projectionRemoved:Po,projectionSet:Ro,shapeRemoved:Bo,saveThemeRequested:Zo,shapeSet:Vo,shapeStyleRemoved:$o,shapeStyleSet:Fo,themeFileLoaded:Go,timeIndexSet:Wo}=xo.actions,Uo=xo.reducer,qo=e=>{const{datum:t}=e,n=kt(),s=Ct((e=>vr(e,t))),i=(0,cn.Z)(s),a=(0,o.useCallback)((e=>{const r=s[e][0];n(Eo({datum:t,type:e,atom:r,time:!0}))}),[t,s]);return 0===i.length?null:(0,r.jsx)(c.M5,Object.assign({my:2},{children:(0,r.jsxs)(so.v2,{children:[(0,r.jsx)(so.j2,Object.assign({as:A.zx,colorScheme:"green",size:"xs",leftIcon:(0,r.jsx)(io.f8n,{})},{children:"Add Time Projection"})),(0,r.jsx)(so.qy,{children:i.map((e=>(0,r.jsx)(so.sN,Object.assign({onClick:()=>a(e)},{children:e}),e)))})]})}))};var Yo=n(11391),Xo=n(5434);const Jo=e=>{const{type:t,atom:n,atoms:o,onChange:s,onNext:i,onPrevious:a,onRemove:l,onToggle:c}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",Object.assign({className:"text-sm px-2 flex items-center align-middle"},{children:t})),(0,r.jsx)("div",Object.assign({className:"flex items-center"},{children:(0,r.jsx)(Yo.Ph,Object.assign({className:"flex items-center",size:"xs",value:n,onChange:s},{children:o.map((e=>(0,r.jsx)("option",Object.assign({value:e},{children:e}),e)))}))})),(0,r.jsxs)("div",Object.assign({className:"px-2 flex items-center justify-end"},{children:[(0,r.jsxs)(A.hE,Object.assign({size:"xs",isAttached:!0},{children:[(0,r.jsx)(A.hU,{"aria-label":"Previous",icon:(0,r.jsx)(Xo.G1X,{}),onClick:a}),(0,r.jsx)(A.hU,{"aria-label":"Remove",icon:(0,r.jsx)(Xo.FU5,{}),onClick:l}),(0,r.jsx)(A.hU,{"aria-label":"Next",icon:(0,r.jsx)(Xo.FNi,{}),onClick:i})]})),(0,r.jsx)(Xo.G1X,{className:"-rotate-90 ml-2 cursor-pointer hover:text-black",onClick:c})]}))]})},Ho=e=>{const{type:t,atom:n,atoms:o,relation:s,relations:i,onChange:a,onNext:l,onPrevious:c,onRelation:d,onRemove:h,onToggle:p,onHiddenRelation:u}=e;return(0,r.jsxs)("div",Object.assign({className:"m-2 p-2 col-span-3 flex flex-col border shadow"},{children:[(0,r.jsxs)("div",Object.assign({className:"flex justify-between pb-3"},{children:[(0,r.jsx)("div",Object.assign({className:"text-sm font-bold"},{children:t})),(0,r.jsx)(Xo.G1X,{className:"rotate-90 cursor-pointer hover:text-black",onClick:p})]})),(0,r.jsxs)("div",Object.assign({className:"px-2 grid grid-cols-[minmax(max-content,auto)_minmax(max-content,auto)]"},{children:[(0,r.jsx)(Yo.Ph,Object.assign({size:"xs",value:n,onChange:a},{children:o.map((e=>(0,r.jsx)("option",Object.assign({value:e},{children:e}),e)))})),(0,r.jsx)("div",Object.assign({className:"mt-0.5 flex items-center justify-end"},{children:(0,r.jsxs)(A.hE,Object.assign({className:"px-2",size:"xs",isAttached:!0},{children:[(0,r.jsx)(A.zx,Object.assign({"aria-label":"Previous",leftIcon:(0,r.jsx)(Xo.G1X,{}),onClick:c},{children:"Previous"})),(0,r.jsx)(A.zx,Object.assign({"aria-label":"Next",rightIcon:(0,r.jsx)(Xo.FNi,{}),onClick:l},{children:"Next"}))]}))}))]})),(0,r.jsx)("div",Object.assign({className:"px-2 pt-2"},{children:s?(0,r.jsxs)("div",Object.assign({className:"px-2 text-sm flex justify-between items-center"},{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",Object.assign({className:"font-semibold"},{children:s}))," defines total order"]}),(0,r.jsx)(Xo.FU5,{onClick:()=>d(void 0)})]})):(0,r.jsxs)(so.v2,Object.assign({matchWidth:!0},{children:[(0,r.jsx)(so.j2,Object.assign({as:A.zx,width:"full",size:"xs",py:4},{children:"Select Ordering Relation"})),(0,r.jsx)(so.qy,{children:i.map((e=>(0,r.jsx)(so.sN,Object.assign({onClick:()=>d(e)},{children:e}),e)))})]}))})),(0,r.jsx)("div",Object.assign({className:"p-2"},{children:(0,r.jsxs)(so.v2,Object.assign({matchWidth:!0},{children:[(0,r.jsx)(so.j2,Object.assign({as:A.zx,width:"full",size:"xs",py:4},{children:"Hide a Relation"})),(0,r.jsx)(so.qy,{children:i.map((e=>(0,r.jsx)(so.sN,Object.assign({onClick:()=>u(e)},{children:e}),e)))})]}))})),(0,r.jsx)("div",Object.assign({className:"p-2"},{children:(0,r.jsx)(A.zx,Object.assign({"aria-label":"Remove",width:"full",size:"xs",py:4,colorScheme:"red",leftIcon:(0,r.jsx)(Xo.FU5,{}),onClick:h},{children:"Remove Projection"}))}))]}))},Qo=e=>{const{datum:t,projection:n,atoms:s,relations:i}=e,{type:a,atom:l,timeOrdering:c}=n,[d,h]=(0,o.useState)(!1),p=kt(),u=(0,o.useCallback)((e=>{const n=e.target.value;p(Ro({datum:t,type:a,atom:n}))}),[t,a]),m=(0,o.useCallback)((()=>{if(l){const e=s.indexOf(l);e>0&&p(Ro({datum:t,type:a,atom:s[e-1]}))}}),[t,a,s,l]),g=(0,o.useCallback)((()=>{p(Po({datum:t,type:a}))}),[t,a]),f=(0,o.useCallback)((()=>{if(l){const e=s.indexOf(l);-1!==e&&e{p(Lo({datum:t,type:a,relation:e}))}),[t,a]),b=(0,o.useCallback)((e=>{p(Io({datum:t,type:a,relation:e}))}),[t,a]),y=(0,o.useCallback)((()=>{h((e=>!e))}),[h]);return d?(0,r.jsx)(Ho,{type:a,atom:l,atoms:s,relation:c,relations:i,onChange:u,onNext:f,onPrevious:m,onRemove:g,onRelation:x,onToggle:y,onHiddenRelation:b}):(0,r.jsx)(Jo,{type:a,atom:l,atoms:s,relation:c,relations:i,onChange:u,onNext:f,onPrevious:m,onRemove:g,onRelation:x,onToggle:y,onHiddenRelation:b})},Ko=({datum:e})=>{const t=Ct((t=>Tr(0,e))),n=Ct((t=>Er(t,e))).filter((e=>!0===e.time)),o=Ct((t=>function(e,t){return wt(t)?dt(t.parsed.instances[0]).map((e=>e.name)):[]}(0,e)));return 0===n.length?null:(0,r.jsx)("div",Object.assign({className:"p-2 grid grid-cols-[minmax(min-content,max-content)_minmax(max-content,auto)_minmax(min-content,max-content)] gap-y-2"},{children:n.map((n=>{const s=n.type,i=t[s];return(0,r.jsx)(Qo,{datum:e,projection:n,atoms:i,relations:o},s)}))}))},es=({datum:e})=>Ct((t=>Mr(0,e)))?null:(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)(Ko,{datum:e}),(0,r.jsx)(qo,{datum:e})]}));var ts=n(47516);const ns=e=>{const{collapsed:t,current:n,length:o,onChange:s,label:i,loopBack:a,onToggleCollapse:l}=e;return(0,r.jsx)("div",Object.assign({className:"flex"},{children:(0,r.jsxs)(A.hE,Object.assign({width:"full",isAttached:!0,size:"sm"},{children:[(0,r.jsx)(A.hU,{"aria-label":"First State",icon:(0,r.jsx)(ts.pB9,{}),borderRadius:0,disabled:0===n,onClick:()=>s(0)}),(0,r.jsx)(A.hU,{"aria-label":"Previous State",borderRadius:0,icon:(0,r.jsx)(ts.u_m,{}),disabled:0===n,onClick:()=>s(n-1)}),(0,r.jsx)(c.M5,Object.assign({width:"full",px:2,fontSize:"xs",bg:"gray.100"},{children:i(n)})),void 0!==a&&n===o-1?(0,r.jsx)(A.hU,{"aria-label":"Loop Back",borderRadius:0,icon:(0,r.jsx)(ts.V3h,{}),onClick:()=>s(a)}):(0,r.jsx)(A.hU,{"aria-label":"First State",borderRadius:0,icon:(0,r.jsx)(ts.OEZ,{}),disabled:n===o-1,onClick:()=>s(n+1)}),(0,r.jsx)(A.hU,{"aria-label":"Previous State",icon:(0,r.jsx)(ts.xeH,{}),disabled:n===o-1,onClick:()=>s(o-1)}),(0,r.jsx)(A.hU,{"aria-label":"Toggle Minimap",size:"sm",borderRadius:0,borderLeftWidth:1,borderLeftColor:"gray.300",icon:t?(0,r.jsx)(ts.OrA,{}):(0,r.jsx)(ts.jRD,{}),onClick:()=>l()})]}))}))};function rs(e){const t={};return V(e).forEach((e=>{t[e.id]={type:"line"}})),t}function os(e){const t={};return V(e).forEach((e=>{t[`${e.id}`]={stroke:"#4A5568",strokeWidth:1,fill:"none"}})),t}function ss(e,t){const n={};return B(e).forEach((e=>{const r=e.id===`${t}`;n[`${e.id}`]=[{text:e.id,style:{fill:r?"white":"#4A5568",fontFamily:"monospace",fontSize:"10px",fontWeight:r?"bold":"normal",textAnchor:"middle",userSelect:"none",cursor:"pointer"},props:{dy:"0.4em"}}]})),n}function is(e){const t={};return B(e).forEach((e=>{t[`${e.id}`]={shape:"circle",radius:15}})),t}function as(e,t){const n={};return B(e).forEach((e=>{const r=e.id===`${t}`;n[e.id]={stroke:r?"#3B82F6":"#4A5568",strokeWidth:1,fill:r?"#3B82F6":"white",cursor:"pointer"}})),n}const ls=e=>{const t=function(e){return 50*(e.length-1)+45}(e),n=function(e){return void 0!==e.loopBack?75:45}(e),s=function(e){const{length:t,loopBack:n}=e,r=[],o=[],s=-50*(t-1)/2,i=void 0!==n?7.5:0;for(let e=0;e${e+1}`,source:`${e}`,target:`${e+1}`}):void 0!==n&&o.push({id:`${e}->${n}`,source:`${e}`,target:`${n}`,waypoints:[{x:s+50*e,y:i-30},{x:s+50*n,y:i-30}]});return zt(r,o)}(e),i=`${-t/2} ${-n/2} ${t} ${n}`,a=(0,o.useRef)(null);return(0,r.jsx)("div",Object.assign({className:"grid place-items-center overflow-y-auto"},{children:(0,r.jsx)(be,Object.assign({svg:a.current,onMouseDown:()=>console.log("down"),onClickNode:t=>{e.onChange&&e.onChange(+t)}},{children:(0,r.jsx)("svg",Object.assign({ref:a,style:{minWidth:t},width:t,height:n,viewBox:i},{children:(0,r.jsx)(Ie,{id:"minimap",graph:s,nodeShapes:is(s),nodeStyles:as(s,e.current),nodeLabels:ss(s,e.current),edgeCurves:rs(s),edgeStyles:os(s)})}))}))}))},cs=e=>{const{collapsed:t}=e;return(0,r.jsxs)("div",Object.assign({className:"border rounded mx-2"},{children:[(0,r.jsx)(ns,Object.assign({},e)),!t&&(0,r.jsx)(ls,Object.assign({},e))]}))},ds=({datum:e})=>{const t=kt(),[n,s]=(0,o.useState)(!1),i=Ct((t=>Gr(t,e))),a=Ct((t=>function(e,t){return wt(t)&&Qt(t.parsed)?t.parsed.instances.length:1}(0,e))),l=Ct((t=>function(e,t){if(t&&wt(t)&&Qt(t.parsed))return t.parsed.loopBack}(0,e))),c=(0,o.useCallback)((n=>{t(Wo({datum:e,index:n}))}),[e]);return(0,r.jsx)("div",Object.assign({className:"mx-1 my-2"},{children:(0,r.jsx)(cs,{collapsed:n,current:i,length:a,loopBack:l,label:e=>`State ${e+1}/${a}`,onChange:c,onToggleCollapse:()=>s((e=>!e))})}))},hs=({datum:e})=>Ct((t=>Mr(0,e)))?(0,r.jsx)("div",Object.assign({className:"flex flex-col justify-middle"},{children:(0,r.jsx)(ds,{datum:e})})):null,ps=()=>{const e=Ct(yr);return e?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:[(0,r.jsx)(es,{datum:e}),(0,r.jsx)(hs,{datum:e})]})):null},us=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:oo.rHK}),(0,r.jsx)(O,{children:"Time"})]}));var ms=n(47398);const gs={activeDatumSet:function(e,t){e.active=t.payload},dumpClicked:function(e){console.log((0,Ot.Vk)(e))}};var fs=n(3231),xs=n(54354),bs=n(20924);const ys=function(e,t){const{enter:n,update:r,exit:o}=t.payload;if(n){(0,fs.Z)(n,(t=>{const n=t.id;e.datumById[n]||(e.datumById[n]=t,e.datumIds.push(n))}));const t=(0,Et.Z)(n);t&&(e.active=t.id)}r&&(0,qt.Z)(r,(t=>{const n=t.id;e.datumById[n]&&(0,xs.Z)(e.datumById[n],t)})),o&&(0,qt.Z)(o,(t=>{if(e.datumById[t]){delete e.datumById[t];const n=(0,bs.Z)(e.datumIds,t);n>-1&&e.datumIds.splice(n,1),e.active===t&&(e.active=e.datumIds.length?e.datumIds[0]:null)}}))},ws=(0,Le.oM)({name:"data",initialState:{active:null,datumById:{},datumIds:[]},reducers:gs,extraReducers:e=>e.addCase(Ve,ys)}),{activeDatumSet:vs,dumpClicked:js}=ws.actions,As=ws.reducer;var Ms=n(2585),ks=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const{className:t,onClick:n}=e,o=ks(e,["className","onClick"]);return(0,r.jsx)("div",Object.assign({className:`contents ${n?"group":""} ${t||""}`,onClick:n},o))},Os=e=>{const{className:t}=e,n=ks(e,["className"]);return(0,r.jsx)("div",Object.assign({className:`\n flex items-center prose prose-sm truncate px-1 py-0.5 first:pl-2 last:pr-2 group-hover:bg-blue-600 group-active:bg-blue-700 group-hover:text-white select-none cursor-default group-hover:cursor-pointer ${t||""}`},n))},Ss=e=>{var t;const{datum:n,active:o,onClickItem:s}=e,i=Ct((e=>function(e,t){return Mr(0,t)}(0,n))),a=Ct((e=>function(e,t){return(Er(e,t)||[]).some((e=>!0===e.time))}(e,n))),l=o?"text-white bg-blue-600":"";return(0,r.jsxs)(Cs,Object.assign({onClick:e=>s(e,n)},{children:[(0,r.jsxs)(Os,Object.assign({className:l},{children:["Instance ",n.id," (from: '",null!==(t=n.generatorName)&&void 0!==t?t:"UNNAMED","')"]})),(0,r.jsx)(Os,Object.assign({className:l},{children:n.evaluator&&(0,r.jsx)(Yr.JO,{as:Xr.RJr})})),(0,r.jsxs)(Os,Object.assign({className:l},{children:[i&&(0,r.jsx)(Yr.JO,{as:oo.rHK}),a&&(0,r.jsx)(Yr.JO,{as:Ms.sYI})]}))]}))},Is=e=>{const{data:t,active:n}=e,s=kt(),i=(0,o.useCallback)(((e,t)=>{s(vs(t.id))}),[]);return(0,r.jsx)("div",Object.assign({className:"w-full grid grid-cols-[minmax(max-content,auto)_repeat(2,min-content)]"},{children:t.map((e=>{const{id:t}=e;return(0,r.jsx)(Ss,{datum:e,active:e===n,onClickItem:i},t)}))}))},Ns={mainViewChanged:function(e,t){e.mainView=t.payload},commonDrawerViewChanged:function(e,t){const n=t.payload;switch(e.mainView){case"GraphView":e.graphViewDrawer=n===e.graphViewDrawer?null:n;break;case"TableView":e.tableViewDrawer=n===e.tableViewDrawer?null:n;break;case"ScriptView":e.scriptViewDrawer=n===e.scriptViewDrawer?null:n}},graphDrawerViewChanged:function(e,t){const n=t.payload;e.graphViewDrawer=n===e.graphViewDrawer?null:n},graphDrawerThemeRelationToggled:function(e,t){const{datumId:n,relation:r}=t.payload,o=["graphDrawerThemeById",n,"expandedRelations",r],s=(0,hn.Z)(e,o);(0,pn.Z)(e,o,!s)},graphDrawerThemeTypeToggled:function(e,t){const{datumId:n,type:r}=t.payload,o=["graphDrawerThemeById",n,"expandedTypes",r],s=(0,hn.Z)(e,o);(0,pn.Z)(e,o,!s)},tableDrawerViewChanged:function(e,t){const n=t.payload;e.tableViewDrawer=n===e.tableViewDrawer?null:n},scriptDrawerViewChanged:function(e,t){const n=t.payload;e.scriptViewDrawer=n===e.scriptViewDrawer?null:n},selectedGeneratorChanged:function(e,t){const n=t.payload;e.selectedGenerator=n.generatorName}},zs=function(e,t){const n=t.payload;n.views&&(e.availableViews=n.views.map((e=>{switch(e){case"graph":return"GraphView";case"table":return"TableView";case"script":return"ScriptView"}})),e.mainView=e.availableViews[0],n.generators&&n.generators.length>0&&(e.selectedGenerator=n.generators[0]))},Ds={availableViews:["GraphView","TableView","ScriptView"],mainView:"ScriptView",graphViewDrawer:"explorer",tableViewDrawer:null,scriptViewDrawer:"variables",graphDrawerThemeById:{},selectedGenerator:void 0};const _s=(0,Le.oM)({name:"ui",initialState:Ds,reducers:Ns,extraReducers:e=>{e.addCase(Fe,zs)}}),{mainViewChanged:Ts,commonDrawerViewChanged:Es,graphDrawerViewChanged:Ls,graphDrawerThemeRelationToggled:Ps,graphDrawerThemeTypeToggled:Rs,tableDrawerViewChanged:Bs,scriptDrawerViewChanged:Zs,selectedGeneratorChanged:Vs}=_s.actions,$s=_s.reducer,Fs=()=>{const e=Ct(yr),t=Ct(Ar),n=Ct(Pr),s=kt(),i=Ct(wr);if(!e&&(!n||n.length<1))return null;const a=!t.some((e=>e.generatorName==i)),l=(0,o.useCallback)((()=>{void 0!==i&&a&&(console.log(`Running new generator: ${i}`),s(Pe({id:void 0,onClick:"next",context:{generatorName:i}})))}),[i,t]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(c.xu,Object.assign({p:1,shadow:"md",borderWidth:"1px"},{children:[(0,r.jsx)(c.X6,Object.assign({fontSize:"l",align:"center"},{children:"Select an Available Command"})),(0,r.jsxs)(c.kC,{children:[(0,r.jsx)(Yo.Ph,Object.assign({isDisabled:!n||n.length<1,value:i,onChange:e=>{const n=e.target.value,r=t.filter((e=>e.generatorName==n)).reverse()[0];console.log(`Selecting generator: ${n}. Latest id: ${null==r?void 0:r.id}`),s(Vs({generatorName:n})),s(vs(r?r.id:""))}},{children:null==n?void 0:n.map(((e,t)=>(0,r.jsx)("option",{children:e},t)))})),(0,r.jsx)(A.zx,Object.assign({size:"sm",margin:"1",onClick:l,isDisabled:!n||n.length<1||i&&(null==e?void 0:e.generatorName)===i||!a},{children:(0,r.jsx)(ms.u,Object.assign({hasArrow:!0,label:"Re-run Forge to refresh this command.",isDisabled:a},{children:"Run"}))}))]})]})),(0,r.jsx)(c.xu,Object.assign({p:1,shadow:"md",borderWidth:"1px"},{children:(0,r.jsxs)(c.X6,Object.assign({fontSize:"l",align:"center"},{children:["Instance History for ",(0,r.jsx)("i",{children:i})]}))})),(0,r.jsx)("hr",{}),(0,r.jsx)("div",Object.assign({"aria-label":"explorer pane instance selector",className:"absolute flex flex-col overflow-y-auto"},{children:(0,r.jsx)(Is,{data:t.filter((e=>e.generatorName==i)),active:e})}))]})},Gs=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:oo.rHK}),(0,r.jsx)(O,{children:"Explorer"})]}));var Ws=n(79352);const Us=e=>{const{datum:t}=e,n=kt(),s=Ct((e=>vr(e,t))),i=(0,cn.Z)(s),a=(0,o.useCallback)((e=>{const r=s[e][0];n(Eo({datum:t,type:e,atom:r}))}),[t,s]);return(0,r.jsx)(c.M5,Object.assign({my:2},{children:(0,r.jsxs)(so.v2,{children:[(0,r.jsx)(so.j2,Object.assign({as:A.zx,colorScheme:"green",size:"xs",leftIcon:(0,r.jsx)(io.f8n,{})},{children:"Add Projection"})),(0,r.jsx)(so.qy,{children:i.map((e=>(0,r.jsx)(so.sN,Object.assign({onClick:()=>a(e)},{children:e}),e)))})]})}))},qs=e=>{const{datum:t,projection:n,atoms:s}=e,{type:i,atom:a}=n,l=kt(),c=(0,o.useCallback)((e=>{const n=e.target.value;l(Ro({datum:t,type:i,atom:n}))}),[t,i]),d=(0,o.useCallback)((()=>{if(a){const e=s.indexOf(a);e>0&&l(Ro({datum:t,type:i,atom:s[e-1]}))}}),[t,i,s,a]),h=(0,o.useCallback)((()=>{l(Po({datum:t,type:i}))}),[t,i]),p=(0,o.useCallback)((()=>{if(a){const e=s.indexOf(a);-1!==e&&e(0,r.jsx)("option",Object.assign({value:e},{children:e}),e)))}))})),(0,r.jsx)("div",Object.assign({className:"px-2 flex items-center justify-end"},{children:(0,r.jsxs)(A.hE,Object.assign({size:"xs",isAttached:!0},{children:[(0,r.jsx)(A.hU,{"aria-label":"Previous",icon:(0,r.jsx)(Xo.G1X,{}),onClick:d}),(0,r.jsx)(A.hU,{"aria-label":"Remove",icon:(0,r.jsx)(Xo.FU5,{}),onClick:h}),(0,r.jsx)(A.hU,{"aria-label":"Next",icon:(0,r.jsx)(Xo.FNi,{}),onClick:p})]}))}))]})},Ys=({datum:e})=>{const t=Ct((t=>Tr(0,e))),n=Ct((t=>Er(t,e))).filter((e=>!0!==e.time));return 0===n.length?null:(0,r.jsx)("div",Object.assign({className:"p-2 grid grid-cols-[minmax(min-content,max-content)_minmax(max-content,auto)_minmax(min-content,max-content)] gap-y-2"},{children:n.map((n=>{const o=n.type,s=t[o];return(0,r.jsx)(qs,{datum:e,projection:n,atoms:s},o)}))}))},Xs=e=>{const{datum:t}=e;return(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)("div",Object.assign({className:"prose prose-md font-bold mx-2 my-2 border-b"},{children:"Projections"})),(0,r.jsx)(Ys,{datum:t}),(0,r.jsx)(Us,{datum:t})]}))};var Js=n(68133);const Hs=e=>{const{label:t,value:n,onChange:o}=e;return(0,r.jsxs)("div",Object.assign({className:"px-3 py-1 first:mt-2 last:mb-2 flex justify-end items-center hover:bg-slate-100"},{children:[(0,r.jsx)("div",Object.assign({className:"grow text-sm"},{children:t})),(0,r.jsx)(Js.XZ,{isChecked:n,onChange:e=>{o(e.target.checked)}})]}))},Qs=({onClick:e})=>(0,r.jsx)(Yr.JO,{className:"mx-2 cursor-pointer active:text-slate-500",onClick:e,as:Xo.FU5}),Ks=()=>(0,r.jsx)("div",Object.assign({className:"mx-2 px-2 text-xs text-slate-400 rounded-full bg-slate-200"},{children:"Inherited"})),ei=e=>{const{label:t,value:n,inherited:o,onChange:s,onRemove:i}=e;return(0,r.jsxs)("div",Object.assign({className:"px-3 py-1 first:mt-2 last:mb-2 flex items-center hover:bg-slate-100"},{children:[(0,r.jsx)("div",Object.assign({className:"grow text-sm"},{children:t})),o&&(0,r.jsx)(Ks,{}),!o&&(0,r.jsx)(Qs,{onClick:i}),(0,r.jsx)("input",{className:"cursor-pointer",type:"color",value:n,onChange:e=>{s(e.target.value)}})]}))},ti=e=>{const{label:t,value:n,inherited:o,onChange:s,onRemove:i}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",Object.assign({className:"px-3 py-1 first:mt-2 last:mb-2 flex items-center hover:bg-slate-100"},{children:[(0,r.jsx)("div",Object.assign({className:"grow text-sm"},{children:t})),o&&(0,r.jsx)(Ks,{}),!o&&(0,r.jsx)(Qs,{onClick:i}),(0,r.jsxs)(Yo.Ph,Object.assign({maxWidth:28,size:"xs",value:n.type,onChange:e=>{const t=e.target.value;s({type:t})}},{children:[(0,r.jsx)("option",Object.assign({value:"bspline"},{children:"B-Spline"})),(0,r.jsx)("option",Object.assign({value:"bundle"},{children:"Bundle"})),(0,r.jsx)("option",Object.assign({value:"cardinal"},{children:"Cardinal"})),(0,r.jsx)("option",Object.assign({value:"catmullrom"},{children:"Catmull-Rom"})),(0,r.jsx)("option",Object.assign({value:"line"},{children:"Line"})),(0,r.jsx)("option",Object.assign({value:"monotonex"},{children:"Monotone X"})),(0,r.jsx)("option",Object.assign({value:"monotoney"},{children:"Monotone Y"})),(0,r.jsx)("option",Object.assign({value:"natural"},{children:"Natural"})),(0,r.jsx)("option",Object.assign({value:"step"},{children:"Step"})),(0,r.jsx)("option",Object.assign({value:"stepafter"},{children:"Step After"})),(0,r.jsx)("option",Object.assign({value:"stepbefore"},{children:"Step Before"}))]}))]}))})};var ni=n(72773);const ri=e=>{const{label:t,value:n,inherited:o,onChange:s,onRemove:i}=e;return(0,r.jsxs)("div",Object.assign({className:"px-3 py-1 first:mt-2 last:mb-2 flex items-center hover:bg-slate-100"},{children:[(0,r.jsx)("div",Object.assign({className:"grow text-sm"},{children:t})),o&&(0,r.jsx)(Ks,{}),!o&&(0,r.jsx)(Qs,{onClick:i}),(0,r.jsxs)(ni.Y2,Object.assign({size:"sm",className:"w-20 text-xs",min:0,max:100,value:n,onChange:e=>{s(+e)}},{children:[(0,r.jsx)(ni.zu,{}),(0,r.jsxs)(ni.Fi,{children:[(0,r.jsx)(ni.WQ,{}),(0,r.jsx)(ni.Y_,{})]})]}))]}))},oi=e=>{const{label:t,value:n,inherited:o,onChange:s,onRemove:i}=e;return(0,r.jsxs)("div",Object.assign({className:"px-3 py-1 first:mt-2 last:mb-2 flex items-center hover:bg-slate-100"},{children:[(0,r.jsx)("div",Object.assign({className:"grow text-sm"},{children:t})),o&&(0,r.jsx)(Ks,{}),!o&&(0,r.jsx)(Qs,{onClick:i}),(0,r.jsx)("input",{className:"w-16 text-xs h-6",type:"text",value:n,onChange:e=>{s(e.target.value)}})]}))},si=e=>{const{datum:t,id:n}=e,o=kt(),s=Ct((e=>function(e,t,n){if(wt(t)){const r=Vt(t.parsed.instances[0],Fr(e,t)),o={};return["*",n].forEach((e=>{r[e].forEach((t=>{const r=(0,hn.Z)(t,["asAttribute"]),s=(0,hn.Z)(t,["sourceIndex"]),i=(0,hn.Z)(t,["targetIndex"]),a=(0,hn.Z)(t,["curve"]),l=(0,hn.Z)(t,["styles","edge","stroke"]),c=(0,hn.Z)(t,["styles","edge","strokeWidth"]),d=(0,hn.Z)(t,["styles","label","fontSize"]),h=(0,hn.Z)(t,["styles","label","fill"]);(0,pn.Z)(o,["asAttribute"],!0===r),(0,pn.Z)(o,["sourceIndex"],s),(0,pn.Z)(o,["targetIndex"],i),a&&((0,pn.Z)(o,["curve","value"],a),(0,pn.Z)(o,["curve","inherited"],e!==n)),l&&((0,pn.Z)(o,["stroke","value"],l),(0,pn.Z)(o,["stroke","inherited"],e!==n)),c&&((0,pn.Z)(o,["strokeWidth","value"],c),(0,pn.Z)(o,["strokeWidth","inherited"],e!==n)),d&&((0,pn.Z)(o,["fontSize","value"],d),(0,pn.Z)(o,["fontSize","inherited"],e!==n)),h&&((0,pn.Z)(o,["textColor","value"],h),(0,pn.Z)(o,["textColor","inherited"],e!==n))}))})),o}return{}}(e,t,n))),{asAttribute:i,curve:a,stroke:l,strokeWidth:c,fontSize:d,textColor:h,sourceIndex:p,targetIndex:u}=s,m=(e,r)=>{o(Ao({datum:t,relation:n,which:e,value:r}))},g=e=>{o(Mo({datum:t,relation:n,which:e}))},f=(e,r)=>{o(wo({datum:t,relation:n,style:e,value:r}))},x=e=>{o(yo({datum:t,relation:n,style:e}))},b=(e,r)=>{o(jo({datum:t,relation:n,style:e,value:r}))},y=e=>{o(vo({datum:t,relation:n,style:e}))};return(0,r.jsxs)("div",Object.assign({className:"flex flex-col"},{children:[a&&(0,r.jsx)(ti,{label:"Curve",value:a.value,inherited:a.inherited,onChange:e=>{o(Co({datum:t,relation:n,curve:e}))},onRemove:()=>{o(ko({datum:t,relation:n}))}}),void 0!==i&&(0,r.jsx)(Hs,{label:"Display as attribute",value:i,onChange:e=>{o(bo({datum:t,relation:n,asAttribute:e}))}}),(0,r.jsx)(ri,{label:"Source Index",value:p||0,inherited:!1,onChange:e=>m("sourceIndex",e||0),onRemove:()=>g("sourceIndex")}),(0,r.jsx)(ri,{label:"Target Index",value:u||"",inherited:!1,onChange:e=>m("targetIndex",e||1),onRemove:()=>g("targetIndex")}),l&&(0,r.jsx)(ei,{label:"Stroke",value:l.value,inherited:l.inherited,onChange:e=>b("stroke",e),onRemove:()=>y("stroke")}),c&&(0,r.jsx)(ri,{label:"Stroke Width",value:c.value,inherited:c.inherited,onChange:e=>b("strokeWidth",e),onRemove:()=>y("strokeWidth")}),d&&(0,r.jsx)(oi,{label:"Font Size",value:d.value,inherited:d.inherited,onChange:e=>f("fontSize",e),onRemove:()=>x("fontSize")}),h&&(0,r.jsx)(ei,{label:"Text Color",value:h.value,inherited:h.inherited,onChange:e=>f("fill",e),onRemove:()=>x("fill")})]}))};function ii(e){return"datum"===e.type}const ai=({depth:e})=>(0,r.jsx)("div",Object.assign({className:"flex"},{children:[...Array(e)].map(((e,t)=>(0,r.jsx)("div",{className:"pl-4 border-r"},t)))})),li=({hidden:e})=>e?(0,r.jsx)("div",{className:"self-center w-2 border-b mr-1 border-transparent"}):(0,r.jsx)("div",{className:"self-center w-2 border-b mr-1"}),ci=e=>{var t;const{datum:n,node:o,panel:s,isOpen:i,onToggle:a}=e,l=ii(o)&&i(o),c=o.level,d=o.text,h=s;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",Object.assign({className:"flex items-stretch border-l cursor-pointer hover:bg-blue-500 hover:text-white",onClick:()=>{ii(o)&&a(o)}},{children:[(0,r.jsx)(ai,{depth:c}),(0,r.jsx)(li,{hidden:0===c}),(0,r.jsx)("div",{children:d})]})),l&&(0,r.jsx)("div",Object.assign({className:"bg-slate-100 border-t border-b shadow-inner"},{children:(0,r.jsx)(h,{datum:n,id:o.id})})),null===(t=o.children)||void 0===t?void 0:t.map(((e,t)=>(0,r.jsx)(ci,{datum:n,node:e,panel:s,isOpen:i,onToggle:a},t)))]})},di=e=>{const{datum:t,tree:n,panel:o,isOpen:s,onToggle:i}=e;return(0,r.jsx)("div",Object.assign({className:"prose prose-sm"},{children:(0,r.jsx)(ci,{datum:t,node:n,panel:o,isOpen:s,onToggle:i})}))},hi=e=>{const{label:t,value:n,inherited:o,onChange:s,onRemove:i}=e,a="circle"===n.shape,l="rectangle"===n.shape,c=a?2*n.radius:Math.min(n.width,n.height)/2,d=(e,t)=>{if(void 0!==t)switch(n.shape){case"rectangle":s({shape:"rectangle",width:"width"===e?t:n.width,height:"height"===e?t:n.height});break;case"circle":s({shape:"circle",radius:t})}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",Object.assign({className:"px-3 py-1 first:mt-2 last:mb-2 flex items-center hover:bg-slate-100"},{children:[(0,r.jsx)("div",Object.assign({className:"grow text-sm"},{children:t})),o&&(0,r.jsx)(Ks,{}),!o&&(0,r.jsx)(Qs,{onClick:i}),(0,r.jsxs)(Yo.Ph,Object.assign({maxWidth:28,size:"xs",value:n.shape,onChange:e=>{switch(e.target.value){case"rectangle":s({shape:"rectangle",width:5/3*c,height:c});break;case"circle":s({shape:"circle",radius:c})}}},{children:[(0,r.jsx)("option",Object.assign({value:"circle"},{children:"Circle"})),(0,r.jsx)("option",Object.assign({value:"rectangle"},{children:"Rectangle"}))]}))]})),a&&(0,r.jsx)(ri,{label:"Radius",value:n.radius,inherited:o,onChange:e=>d("radius",e),onRemove:i}),l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ri,{label:"Width",value:n.width,inherited:o,onChange:e=>d("width",e),onRemove:i}),(0,r.jsx)(ri,{label:"Height",value:n.height,inherited:o,onChange:e=>d("height",e),onRemove:i})]})]})},pi=e=>{const{datum:t,id:n}=e,o=kt(),s=Ct((e=>function(e,t,n){if(wt(t)){const r=t.parsed.instances[0],o=$t(r,Fr(e,t)),s={};return["*","univ",...pt(r,n).types.slice().reverse()].forEach((e=>{o[e].forEach((t=>{const r=(0,hn.Z)(t,["shape"]),o=(0,hn.Z)(t,["styles","node","fill"]),i=(0,hn.Z)(t,["styles","node","stroke"]),a=(0,hn.Z)(t,["styles","node","strokeWidth"]),l=(0,hn.Z)(t,["styles","label","fontSize"]),c=(0,hn.Z)(t,["styles","label","fill"]);r&&((0,pn.Z)(s,["shape","value"],r),(0,pn.Z)(s,["shape","inherited"],e!==n)),o&&((0,pn.Z)(s,["fill","value"],o),(0,pn.Z)(s,["fill","inherited"],e!==n)),i&&((0,pn.Z)(s,["stroke","value"],i),(0,pn.Z)(s,["stroke","inherited"],e!==n)),a&&((0,pn.Z)(s,["strokeWidth","value"],a),(0,pn.Z)(s,["strokeWidth","inherited"],e!==n)),l&&((0,pn.Z)(s,["fontSize","value"],l),(0,pn.Z)(s,["fontSize","inherited"],e!==n)),c&&((0,pn.Z)(s,["textColor","value"],c),(0,pn.Z)(s,["textColor","inherited"],e!==n))}))})),s}return{}}(e,t,n))),{shape:i,stroke:a,strokeWidth:l,fill:c,fontSize:d,textColor:h}=s,p=(e,r)=>{o(zo({datum:t,type:n,style:e,value:r}))},u=e=>{o(No({datum:t,type:n,style:e}))},m=(e,r)=>{o(Fo({datum:t,type:n,style:e,value:r}))},g=e=>{o($o({datum:t,type:n,style:e}))};return(0,r.jsxs)("div",Object.assign({className:"flex flex-col"},{children:[i&&(0,r.jsx)(hi,{label:"Shape",value:i.value,inherited:i.inherited,onChange:e=>{o(Vo({datum:t,type:n,shape:e}))},onRemove:()=>{o(Bo({datum:t,type:n}))}}),c&&(0,r.jsx)(ei,{label:"Fill",value:c.value,inherited:c.inherited,onChange:e=>m("fill",e),onRemove:()=>g("fill")}),a&&(0,r.jsx)(ei,{label:"Stroke",value:a.value,inherited:a.inherited,onChange:e=>m("stroke",e),onRemove:()=>g("stroke")}),l&&(0,r.jsx)(ri,{label:"Stroke Width",value:l.value,inherited:l.inherited,onChange:e=>m("strokeWidth",e),onRemove:()=>g("strokeWidth")}),d&&(0,r.jsx)(oi,{label:"Font Size",value:d.value,inherited:d.inherited,onChange:e=>p("fontSize",e),onRemove:()=>u("fontSize")}),h&&(0,r.jsx)(ei,{label:"Text Color",value:h.value,inherited:h.inherited,onChange:e=>p("fill",e),onRemove:()=>u("fill")})]}))},ui=({datum:e})=>{const t=wt(e),n=t?function(e){const t=e.instances[0],n={},r=ut(t);return r.forEach((e=>{n[e.id]={type:"datum",id:e.id,text:e.id,level:e.types.length+1,children:[]}})),r.forEach((e=>{var t,r;const o=e.types;if(o.length>1){const r=o[1];null===(t=n[r].children)||void 0===t||t.push(n[e.id])}else"univ"!==e.id&&(null===(r=n.univ.children)||void 0===r||r.push(n[e.id]))})),{type:"header",text:"Types",level:0,children:[n.univ]}}(e.parsed):null,o=t?function(e){return{type:"header",text:"Relations",level:0,children:dt(e.instances[0]).map((e=>({type:"datum",id:e.id,text:e.name,level:1})))}}(e.parsed):null,s=kt();return(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)("div",Object.assign({className:"prose prose-md font-bold mx-2 my-2 border-b"},{children:"Styles"})),n&&(0,r.jsx)(di,{datum:e,tree:n,panel:pi,isOpen:t=>Ct((n=>function(e,t,n){return br.selectGraphDrawerThemeTypeExpanded(e.ui,t,n)}(n,e,t.id))),onToggle:t=>{s(Rs({type:t.id,datumId:e.id}))}}),o&&(0,r.jsx)(di,{datum:e,tree:o,panel:si,isOpen:t=>Ct((n=>function(e,t,n){return br.selectGraphDrawerThemeRelationExpanded(e.ui,t,n)}(n,e,t.id))),onToggle:t=>{s(Ps({relation:t.id,datumId:e.id}))}})]}))},mi=e=>{const{datum:t}=e,n=kt();return(0,r.jsxs)("form",Object.assign({className:"flex items-center space-x-2 px-2 py-1 bg-slate-100 border-b"},{children:[(0,r.jsx)("label",Object.assign({className:"block text-xs font-semibold border-0 rounded-md bg-slate-100 text-slate-900 px-4 py-1 shrink-0 transition hover:bg-slate-300 cursor-pointer",onClick:()=>{n(Zo({datum:t}))}},{children:"Save As..."})),(0,r.jsxs)("label",Object.assign({className:"block grow"},{children:[(0,r.jsx)("span",Object.assign({className:"sr-only"},{children:"Choose a theme file."})),(0,r.jsx)("input",{type:"file",className:"block w-full text-xs text-slate-500 file:mr-2 file:bg-slate-100 hover:file:bg-slate-300 file:transition file:text-slate-900 file:py-1 file:px-4 file:rounded-md file:border-0 file:text-xs file:font-semibold file:cursor-pointer",onChange:e=>{const r=e.target.files;r&&r[0].text().then((e=>{n(Go({datum:t,data:e}))}))}})]}))]}))},gi=()=>{const e=Ct(yr);return e?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:[(0,r.jsx)(mi,{datum:e}),(0,r.jsx)(Xs,{datum:e}),(0,r.jsx)(ui,{datum:e})]})):null},fi=()=>(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:Ws.wY1}),(0,r.jsx)(O,{children:"Theme"})]}));var xi=n(79762),bi=n(4612),yi=n(33441);const wi=()=>{const e=Ct(yr),[t,n]=(0,o.useState)("");return e?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto p-4"},{children:[(0,r.jsxs)(xi.NI,Object.assign({mt:4},{children:[(0,r.jsx)(xi.lX,{children:"Upload layout specification file"}),(0,r.jsx)(bi.II,{type:"file",accept:".cnd",onChange:e=>{var t;const r=null===(t=e.target.files)||void 0===t?void 0:t[0];if(r){const e=new FileReader;e.onload=e=>{var t;const r=null===(t=e.target)||void 0===t?void 0:t.result;n(r)},e.readAsText(r)}}})]})),(0,r.jsxs)(xi.NI,{children:[(0,r.jsx)(xi.lX,{children:"Layout Specification"}),(0,r.jsx)(yi.g,{minH:"20rem",value:t,onChange:e=>n(e.target.value)})]}),(0,r.jsx)(A.zx,Object.assign({onClick:n=>{n.preventDefault();const r=document.createElement("form");r.method="POST",r.action="http://localhost:3000",r.target="_blank";const o=document.createElement("input");o.type="hidden",o.name="cope",o.value=t,r.appendChild(o);const s=document.createElement("input");s.type="hidden",s.name="alloydatum",s.value=e.data,r.appendChild(s),document.body.appendChild(r),r.submit(),document.body.removeChild(r)},mt:4},{children:"Load layout"}))]})):null},vi=()=>(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:Ws.vWf}),(0,r.jsx)(O,{children:"Layout"})]})),ji=()=>{const e=Ct(Or);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Fs,{}),"state"===e&&(0,r.jsx)(ps,{}),"theme"===e&&(0,r.jsx)(gi,{}),"evaluator"===e&&(0,r.jsx)(eo,{}),"log"===e&&(0,r.jsx)(no,{}),"layout"===e&&(0,r.jsx)(wi,{})]})},Ai=()=>{const e=Ct(Or);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Gs,{}),"state"===e&&(0,r.jsx)(us,{}),"theme"===e&&(0,r.jsx)(fi,{}),"evaluator"===e&&(0,r.jsx)(to,{}),"log"===e&&(0,r.jsx)(ro,{}),"layout"===e&&(0,r.jsx)(vi,{})]})};var Mi=n(14578);const ki=e=>(0,r.jsx)("div",Object.assign({className:"contents group"},{children:e.children})),Ci=e=>(0,r.jsx)("div",Object.assign({className:"px-4 py-0.5 prose text-xs group-hover:bg-slate-100"},{children:e.children})),Oi=e=>(0,r.jsx)("div",Object.assign({className:"px-4 py-0.5 text-xs font-mono group-hover:bg-slate-100"},{children:e.children})),Si=e=>{const{variable:t}=e;return(0,r.jsxs)(ki,{children:[(0,r.jsx)(Oi,{children:t.name}),(0,r.jsx)(Ci,{children:void 0!==t.typeUrl?(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:t.typeUrl},{children:t.type})):t.type})]})},Ii=e=>{const{datum:t}=e,n=Ct((e=>Ur(e,t)));return(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)("div",Object.assign({className:"prose prose-md font-bold mx-2 my-2 border-b"},{children:"Datum Variables"})),(0,r.jsxs)("div",Object.assign({className:"grid grid-cols-2"},{children:[(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Variable"})),(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Type"})),n.map(((e,t)=>(0,r.jsx)(Si,{variable:e},t)))]}))]}))},Ni=()=>{const e=Ct(Br),t=Ct(Zr);return(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)("div",Object.assign({className:"prose prose-md font-bold mx-2 my-2 border-b"},{children:"Stage Variables"})),(0,r.jsxs)("div",Object.assign({className:"grid grid-cols-2"},{children:[(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Variable"})),(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Value"})),(0,r.jsxs)(ki,{children:[(0,r.jsx)(Oi,{children:e}),(0,r.jsxs)(Ci,{children:["svg"===e&&(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:"https://developer.mozilla.org/en-US/docs/Web/SVG"},{children:""})),"div"===e&&(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div"},{children:"
"})),"canvas"===e&&(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:"https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API"},{children:""}))]})]}),(0,r.jsxs)(ki,{children:[(0,r.jsx)(Oi,{children:"width"}),(0,r.jsx)(Oi,{children:t.width})]}),(0,r.jsxs)(ki,{children:[(0,r.jsx)(Oi,{children:"height"}),(0,r.jsx)(Oi,{children:t.height})]})]}))]}))},zi=e=>{const{datum:t}=e;return(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:[(0,r.jsx)(Ni,{}),(0,r.jsx)(Ii,{datum:t})]}))},Di=()=>(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:Mi.VuO}),(0,r.jsx)(O,{children:"Variables"})]})),_i=()=>{const e=Ct(yr),t=Ct(Rr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===t&&(0,r.jsx)(Fs,{}),"evaluator"===t&&(0,r.jsx)(eo,{}),"log"===t&&(0,r.jsx)(no,{}),"variables"===t&&e&&(0,r.jsx)(zi,{datum:e})]})},Ti=()=>{const e=Ct(Rr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Gs,{}),"evaluator"===e&&(0,r.jsx)(to,{}),"log"===e&&(0,r.jsx)(ro,{}),"variables"===e&&(0,r.jsx)(Di,{})]})},Ei=()=>{const e=Ct(yr);return e?(0,r.jsx)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:(0,r.jsx)(hs,{datum:e})})):null},Li=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:oo.rHK}),(0,r.jsx)(O,{children:"Time"})]})),Pi=()=>{console.log("table drawer explorer!");const e=Ct($r);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Fs,{}),"state"===e&&(0,r.jsx)(Ei,{}),"evaluator"===e&&(0,r.jsx)(eo,{}),"log"===e&&(0,r.jsx)(no,{})]})},Ri=()=>{const e=Ct($r);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Gs,{}),"state"===e&&(0,r.jsx)(Li,{}),"evaluator"===e&&(0,r.jsx)(to,{}),"log"===e&&(0,r.jsx)(ro,{})]})},Bi=()=>{const e=Ct(Dr);return(0,r.jsxs)(x,{children:[(0,r.jsxs)(C,Object.assign({className:"border-b"},{children:["GraphView"===e&&(0,r.jsx)(Ai,{}),"TableView"===e&&(0,r.jsx)(Ri,{}),"ScriptView"===e&&(0,r.jsx)(Ti,{})]})),(0,r.jsxs)(k,{children:["GraphView"===e&&(0,r.jsx)(ji,{}),"TableView"===e&&(0,r.jsx)(Pi,{}),"ScriptView"===e&&(0,r.jsx)(_i,{})]})]})};var Zi=n(53854);const Vi=()=>{const e=kt(),t=Ct(jr),n=Ct(Dr);return(0,r.jsxs)(r.Fragment,{children:[t.includes("GraphView")&&(0,r.jsx)(M,Object.assign({isActive:"GraphView"===n,mr:1,leftIcon:(0,r.jsx)(ts.DvO,{}),onClick:()=>e(Ts("GraphView"))},{children:"Graph"})),t.includes("TableView")&&(0,r.jsx)(M,Object.assign({isActive:"TableView"===n,mr:1,leftIcon:(0,r.jsx)(oo.WHV,{}),onClick:()=>e(Ts("TableView"))},{children:"Table"})),t.includes("ScriptView")&&(0,r.jsx)(M,Object.assign({isActive:"ScriptView"===n,mr:1,leftIcon:(0,r.jsx)(Zi.aJo,{}),onClick:()=>e(Ts("ScriptView"))},{children:"Script"}))]})},$i=()=>(0,r.jsxs)(v,Object.assign({className:"shadow"},{children:[(0,r.jsx)(w,{}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)(c.LZ,{}),(0,r.jsx)(Vi,{})]}));var Fi=n(60155);const Gi=()=>{const e=kt(),t=Ct(Dr),n=Ct(Or);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(N,{text:"Time",rightIcon:(0,r.jsx)(oo.rHK,{}),isActive:"GraphView"===t&&"state"===n,onClick:()=>e(Ls("state"))}),(0,r.jsx)(N,{text:"Theme",rightIcon:(0,r.jsx)(Ws.wY1,{}),isActive:"GraphView"===t&&"theme"===n,onClick:()=>e(Ls("theme"))}),(0,r.jsx)(N,{text:"Layout",rightIcon:(0,r.jsx)(Xo.df2,{}),isActive:"GraphView"===t&&"layout"===n,onClick:()=>e(Ls("layout"))}),(0,r.jsx)(N,{text:"Settings",rightIcon:(0,r.jsx)(Fi.Fuo,{}),isActive:"GraphView"===t&&"settings"===n,onClick:()=>e(Ls("settings"))})]})},Wi=()=>{const e=kt(),t=Ct(Dr),n=Ct(Rr);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(N,{text:"Variables",rightIcon:(0,r.jsx)(Mi.VuO,{}),isActive:"ScriptView"===t&&"variables"===n,onClick:()=>e(Zs("variables"))}),(0,r.jsx)(N,{text:"Settings",rightIcon:(0,r.jsx)(Fi.Fuo,{}),isActive:"ScriptView"===t&&"settings"===n,onClick:()=>e(Zs("settings"))})]})},Ui=()=>{const e=kt(),t=Ct(Dr),n=Ct($r);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(N,{text:"Time",rightIcon:(0,r.jsx)(oo.rHK,{}),isActive:"TableView"===t&&"state"===n,onClick:()=>e(Bs("state"))}),(0,r.jsx)(N,{text:"Settings",rightIcon:(0,r.jsx)(Fi.Fuo,{}),isActive:"TableView"===t&&"settings"===n,onClick:()=>e(Bs("settings"))})]})},qi=()=>{const e=kt(),t=Ct(Dr),n=Ct(Cr);return(0,r.jsxs)(S,{children:["GraphView"===t&&(0,r.jsx)(Gi,{}),"TableView"===t&&(0,r.jsx)(Ui,{}),"ScriptView"===t&&(0,r.jsx)(Wi,{}),(0,r.jsx)(c.LZ,{}),(0,r.jsx)(N,{text:"Explorer",rightIcon:(0,r.jsx)(oo.rHK,{}),isActive:"explorer"===n,onClick:()=>e(Es("explorer"))}),(0,r.jsx)(N,{text:"Evaluator",rightIcon:(0,r.jsx)(Xr.RJr,{}),isActive:"evaluator"===n,onClick:()=>e(Es("evaluator"))}),(0,r.jsx)(N,{text:"Log",rightIcon:(0,r.jsx)(Xr.t75,{}),isActive:"log"===n,onClick:()=>e(Es("log"))})]})},Yi=e=>{const{datum:t,graphProps:n}=e,{id:s,graph:i,nodeShapes:a,nodeStyles:l,nodeLabels:c,edgeCurves:h,edgeLabels:p,edgeStyles:u}=(Ct((e=>function(e,t){return wn.selectSpreadMatrix(e.graphs,t)}(e,t))),Ct((e=>function(e,t){return wn.selectZoomMatrix(e.graphs,t)}(e,t))),n),m=kt(),g=((0,o.useCallback)((0,d.Z)((e=>(m(Oo({datum:t,matrix:e})),!0)),16,{trailing:!1}),[t]),(0,o.useCallback)((0,d.Z)((e=>(m(So({datum:t,matrix:e})),!0)),16,{trailing:!1}),[t]),(0,o.useCallback)((e=>{m(To({datum:t,offsets:e}))}),[t]));return(0,r.jsx)(Te,Object.assign({className:"absolute inset-0",callbacks:{onSelectionMoved:g}},{children:(0,r.jsx)(Ie,{id:s,graph:i,nodeShapes:a,nodeLabels:c,nodeStyles:l,edgeCurves:h,edgeLabels:p,edgeStyles:u})}))},Xi=e=>{const t=kt(),{datumId:n,button:s,generatorId:i}=e,{text:a,onClick:l,mouseover:c}=s,d=(0,o.useCallback)((()=>{t(Pe({id:n,onClick:l,context:{generatorName:i,id:n}}))}),[n,s]);return(0,r.jsx)(ms.u,Object.assign({hasArrow:!0,label:c,isDisabled:void 0===c},{children:(0,r.jsx)(Ee,Object.assign({onClick:d},{children:a}))}))},Ji=e=>{const{datum:t}=e,{id:n,parsed:o,buttons:s,generatorName:i}=t,a=o.command;return(0,r.jsxs)("div",Object.assign({className:"w-full flex item-center space-x-2 px-2"},{children:[(0,r.jsxs)(O,Object.assign({className:"text-gray-400"},{children:["ID: ",n]})),(0,r.jsx)(O,{children:a}),(0,r.jsx)("div",{className:"grow"}),s&&s.map(((e,t)=>(0,r.jsx)(Xi,{datumId:n,generatorId:i,button:e},t)))]}))},Hi=()=>{const e=Ct(yr),t=Ct((t=>Wr(t,e)));return(0,r.jsx)(x,Object.assign({className:"grid grid-flow-col divide-x divide-dashed"},{children:e&&t.map(((t,n)=>(0,r.jsx)("div",Object.assign({className:"relative"},{children:(0,r.jsxs)(x,{children:[(0,r.jsx)(C,Object.assign({className:"border-b"},{children:(0,r.jsx)(Ji,{datum:e})})),(0,r.jsx)(k,{children:(0,r.jsx)(Yi,{datum:e,graphProps:t})})]})}),n)))}))};var Qi=n(4953);const Ki=(0,Le.oM)({name:"script",initialState:{stage:"svg",stageDimensions:{width:0,height:0},text:"",scriptTextByDatumId:{}},reducers:{scriptStageDimensionsSet(e,t){e.stageDimensions=t.payload},scriptStageSet(e,t){e.stage=t.payload},scriptTextSet(e,t){e.text=t.payload},scriptTextByDatumSet(e,t){const{id:n,text:r}=t.payload;e.scriptTextByDatumId[n]=r}},extraReducers:e=>e.addCase(vs,((e,t)=>{e.text=e.scriptTextByDatumId[t.payload]})).addCase(Ve,((e,t)=>{const{enter:n,update:r,exit:o}=t.payload;if(n){(0,fs.Z)(n,(t=>{"visualizerConfig"in t.parsed&&"script"in t.parsed.visualizerConfig&&(e.scriptTextByDatumId[t.id]=t.parsed.visualizerConfig.script)}));const t=(0,Et.Z)(n);t&&(e.text=e.scriptTextByDatumId[t.id])}o&&(0,qt.Z)(o,(t=>{e.scriptTextByDatumId[t]=""}))}))}),{scriptStageSet:ea,scriptStageDimensionsSet:ta,scriptTextSet:na,scriptTextByDatumSet:ra}=Ki.actions,oa=Ki.reducer;var sa=n(76815);function ia(e){return(0,sa.pF)(e)}var aa=n(81493);const la="\nclass AlloyError {\n static error(source: string, message: string): Error;\n\n static missingAttribute(source: string, attribute: string): Error;\n\n static missingElement(source: string, element: string): Error;\n}\n\nclass AlloySignature extends AlloySet {\n private readonly _id;\n private readonly _atoms;\n private _subsignatures;\n\n /**\n * Create a new Alloy signature.\n *\n * @param id The signature's unique ID\n * @param atoms The atoms defined by the signature\n * @param proxy If provided, a proxied signature will be created.\n */\n constructor(id: string, atoms: AlloyAtom[], proxy?: AlloyProxy);\n\n /**\n * Get an atom by ID\n * @param id The atom ID\n * @returns An atom or null if there is no atom with the specified ID\n */\n atom(id: string): AlloyAtom | null;\n\n /**\n * Get an array of all atoms in this signature.\n * @param recursive If false, return only atoms defined by this signature,\n * if true, include atoms defined by all subsignatures as well.\n */\n atoms(recursive?: boolean): AlloyAtom[];\n\n /**\n * Create a clone of this signature.\n * @param proxy If provided, a proxied clone will be returned.\n */\n clone(proxy?: AlloyProxy): AlloySignature;\n\n /**\n * Get the signature ID.\n */\n id(): string;\n\n /**\n * Get an array of all signatures that extend this signature.\n * @param recursive If false, return only signatures that are immediate\n * children of this signature. If true, return all signatures that are\n * descendants of this signature.\n */\n subSignatures(recursive?: boolean): AlloySignature[];\n\n /**\n * Create a signature from an XML element and populate the signature with\n * atoms. Any signatures that extend the one defined in the element are not\n * created.\n *\n * @param element The XML `````` element\n * @param proxy If provided, a proxied signature with proxied atoms will be\n * returned.\n */\n static fromElement(element: Element, proxy?: AlloyProxy): AlloySignature;\n\n /**\n * Create the Int signature.\n *\n * @param bitwidth The integer bitwidth, which must be greater than or equal to zero.\n * @param proxy If provided, a proxied Int signature with proxied atoms will\n * be returned.\n */\n static intSignature(bitwidth: number, proxy?: AlloyProxy): AlloySignature;\n\n /**\n * TODO: Check and document this.\n * @param intsig\n * @param proxy\n */\n static seqIntSignature(\n intsig: AlloySignature,\n proxy?: AlloyProxy\n ): AlloySignature;\n\n /**\n * Build all signatures from an XML `````` element. All signatures are\n * populated with atoms.\n *\n * @param instance The XML `````` element\n * @param proxy If provided, all signatures and atoms will be proxied.\n * @returns A map of string IDs, as defined by the \"ID\" attribute for each\n * signature, to [[AlloySignature]] objects.\n */\n static signaturesFromXML(\n instance: Element,\n proxy?: AlloyProxy\n ): Map;\n\n /**\n * Get an array of signature types associated with an XML element. Typically\n * this is used when parsing a field or skolem, as each `````` and ``````\n * element will have a `````` child. This method parses the types defined\n * in this element and returns the corresponding signatures.\n *\n * @param element The XML element that has a child\n * @param sigIDs A map of signature IDs to signatures\n */\n static typesFromXML(\n element: Element,\n sigIDs: Map\n ): AlloySignature[];\n}\n\nclass AlloySet {\n protected _tuples: AlloyTuple[];\n\n /**\n * Create a new Alloy set.\n *\n * @param tuples The tuples contained in the set\n */\n constructor(tuples?: AlloyTuple[]);\n\n /**\n * Returns true if the set is empty, false if it is not.\n */\n empty(): boolean;\n\n /**\n * Returns true if this set is equivalent to the provided set, false otherwise.\n * @param that The set to compare to\n */\n equals(that: AlloySet): boolean;\n\n /**\n * Returns true if this set is a subset of the provided set, false otherwise.\n * @param that The set to compare to\n */\n in(that: AlloySet): boolean;\n\n /**\n * Perform a join operation with another set. This operation is equivalent\n * to the dot join operator in Alloy, in which this set is on the left side\n * of the dot and that set is on the right side.\n *\n * @param that The other set\n */\n join(that: AlloySet): AlloySet;\n\n /**\n * Create a printable string representation of this set.\n */\n toString(): string;\n\n /**\n * Get an array of all tuples in this set.\n */\n tuples(): AlloyTuple[];\n}\n\nclass AlloyTuple extends AlloySet {\n private _atoms;\n\n /**\n * Create a new Alloy tuple.\n *\n * @param atoms The atoms, in order, that comprise the tuple.\n */\n constructor(atoms: AlloyAtom[]);\n\n /**\n * Get an ordered list of the atoms in this tuple.\n */\n atoms(): AlloyAtom[];\n\n /**\n * Create a printable string representation of this tuple.\n */\n toString(): string;\n\n /**\n * Create an array of tuples from a node list of `````` XML elements.\n *\n * @param elements A node list of `````` elements, typically created\n * using the ```querySelectorAll()``` method on a `````` or\n * `````` element.\n * @param types An ordered array of signatures that define the type of each\n * atom in each tuple, typically created using [[AlloySignature.typesFromXML]].\n */\n static tuplesFromXML(\n elements: NodeListOf,\n types: AlloySignature[]\n ): AlloyTuple[];\n}\n\nclass AlloyProxy {\n private readonly _sets;\n\n constructor();\n\n applyProxy(set: T, id?: string): T;\n\n private _finalize;\n}\n\n/**\n * In Alloy, an atom is a primitive entity that is indivisible, immutable, and\n * uninterpreted.\n */\nclass AlloyAtom extends AlloySet {\n private readonly _id;\n\n constructor(id: string, proxy?: AlloyProxy);\n\n clone(proxy?: AlloyProxy): AlloyAtom;\n\n id(): string;\n\n static fromElement(element: Element, proxy?: AlloyProxy): AlloyAtom;\n}\n\nclass AlloyTypedSet extends AlloySet {\n private readonly _types;\n\n constructor(types: AlloySignature[], tuples: AlloyTuple[]);\n\n project(atoms: Map): void;\n\n types(): AlloySignature[];\n}\n\nexport class AlloyField extends AlloyTypedSet {\n private readonly _id;\n\n /**\n * Create a new Alloy field.\n * @param id The field's unique ID\n * @param types An array of signatures defining the types of each column of the field\n * @param tuples The tuples defined by the field\n * @param proxy If provided, a proxied signature will be created.\n * @param varName If provided, the variable name to assign to this field when proxied.\n */\n constructor(\n id: string,\n types: AlloySignature[],\n tuples: AlloyTuple[],\n proxy?: AlloyProxy,\n varName?: string\n );\n\n /**\n * Create a clone of this field\n *\n * @param signatures An array of signatures. When creating the clone of this\n * field, the types associated with each column are not cloned. Instead,\n * provide an array of signatures and this method will find the corresponding\n * types by signature ID in the array and use them to define types of the\n * cloned field.\n * @param proxy If provided, a proxied clone will be returned.\n */\n clone(signatures: AlloySignature[], proxy?: AlloyProxy): AlloyField;\n\n /**\n * Get the field ID.\n */\n id(): string;\n\n /**\n * Build all fields from an XML `````` element. All fields are\n * fully populated with tuples.\n *\n * @param instance The XML `````` element\n * @param sigIDs A map of signature string IDs to signature objects\n * @param proxy If provided, all fields will be proxied.\n */\n static fieldsFromXML(\n instance: Element,\n sigIDs: Map,\n proxy?: AlloyProxy\n ): AlloyField[];\n}\n\nclass AlloySkolem extends AlloyTypedSet {\n private readonly _id;\n\n constructor(\n id: string,\n types: AlloySignature[],\n tuples: AlloyTuple[],\n proxy?: AlloyProxy\n );\n\n clone(signatures: AlloySignature[], proxy?: AlloyProxy): AlloySkolem;\n\n id(): string;\n\n static skolemsFromXML(\n instance: Element,\n sigIDs: Map,\n proxy?: AlloyProxy\n ): AlloySkolem[];\n}\n\n/**\n * In Alloy, when you run a predicate or check an assertion, the analyzer\n * searches for an _instance_ of an _analysis constraint_: an assignment of\n * values to the variables of the constraint for which the constraint evaluates\n * to true [[Jackson 2012](http://softwareabstractions.org/)].\n */\nclass AlloyInstance {\n private _proxy;\n private _atoms;\n private _fields;\n private _signatures;\n private _skolems;\n private _projections;\n private _bitwidth;\n private _command;\n private _filename;\n private _sources;\n\n /**\n * Create a new Alloy instance. If no text is provided, an empty instance\n * is created.\n * @param text A string containing the XML output from an Alloy instance\n * @param index\n */\n constructor(text?: string, index?: number);\n\n /**\n * Get an atom by ID.\n * @param id The atom ID\n * @returns An atom or null if there is no atom with the specified ID\n */\n atom(id: string): AlloyAtom | null;\n\n /**\n * Get an array of all atoms in the instance.\n */\n atoms(): AlloyAtom[];\n\n /**\n * Get the bitwidth of the instance.\n */\n bitwidth(): number;\n\n /**\n * Generate a deep clone of the instance.\n * @throws Error if the instance does not have a univ signature.\n */\n clone(): AlloyInstance;\n\n /**\n * Get the command used to generate the instance.\n */\n command(): string;\n\n /**\n * Get a field by ID.\n * @param id The field ID\n * @returns A field or null if there is no field with the specified ID\n */\n field(id: string): AlloyField | null;\n\n /**\n * Get an array of all fields in the instance.\n */\n fields(): AlloyField[];\n\n /**\n * Get the full path of the model used to generate the instance.\n */\n filename(): string;\n\n /**\n * Project the instance over the specified atoms. There may be a maximum of\n * one atom per signature that is a direct descendant of the univ signature.\n * @param atoms The list of atoms over which to project the instance.\n * @returns A clone of the instance with the projection applied.\n * @throws Error if there is more than one atom provided for any signature\n * that is a direct descendant of the univ signature.\n */\n project(atoms: AlloyAtom[]): AlloyInstance;\n\n /**\n * Get the currently projected atoms.\n * @returns A Map object with key-value pairs mapping signatures to projected atoms\n */\n projections(): Map;\n\n /**\n * Get a signature by ID\n * @param id The signature ID\n * @returns A signature or null if there is no signature with the specified ID\n */\n signature(id: string): AlloySignature | null;\n\n /**\n * Get an array of all signatures in the instance.\n */\n signatures(): AlloySignature[];\n\n /**\n * Get a skolem by ID\n * @param id The skolem ID\n * @returns A skolem or null if there is no skolem with the specified ID\n */\n skolem(id: string): AlloySkolem | null;\n\n /**\n * Get an array of all skolems in the instance.\n */\n skolems(): AlloySkolem[];\n\n /**\n * Get all source files that define the model from which this instance was created.\n * @returns A Map object with key-value pairs mapping full path names to file contents\n */\n sources(): Map;\n\n /**\n * Get the univ signature.\n * @returns The univ signature if it exists, null if it does not\n */\n univ(): AlloySignature | null;\n\n private _buildFromXML;\n}",ca=e=>{const{initialText:t,variables:n,editorRef:s,stageRef:i,beforeUnmount:a,onExecute:l}=e,[c,d]=(0,o.useState)(),h=(0,o.useCallback)((e=>{s(e),d(e)}),[]);return(0,o.useEffect)((()=>{if(c){c.addCommand(aa.Fd.KeyMod.WinCtrl|aa.Fd.KeyCode.Enter,(()=>{l()}));const e="ts:filename/alloy.d.js",t=aa.Fd.Uri.parse(e);null!==aa.Fd.editor.getModel(t)||(aa.Fd.languages.typescript.javascriptDefaults.setExtraLibs([{content:la,filePath:"alloy.js"}]),aa.Fd.editor.createModel(la,"typescript",t))}}),[c,l,i]),(0,o.useEffect)((()=>{const e=function(e){return e.map((e=>`declare const ${e.name}: ${e.type};`)).join("\n")}(n);aa.Fd.languages.typescript.javascriptDefaults.setExtraLibs([{content:"\n/**\n * To anyone adding to this library in the future: please take the following steps when adding\n * new VisualObjects.\n *\n * 1. If the object is to be accessible within sterling, add it to library within ScriptViewImports.\n * 2. Add the name of the file, minus .d.ts, to the list within d3lib-def-compiler/src/D3LibDefCompiler.java.\n * 3. Run the typescript compiler (\"tsc\" in terminal) from within the d3-packages folder.\n * 4. Run the main method within D3LibDefCompiler.\n *\n * If these steps are not followed, the file's definitions will either not be accessible within\n * sterling, or will not show up in monaco.\n */\ndeclare type BoundingBoxGenerator = (r: number) => Coords;\ndeclare class VisualObject {\n center: () => Coords;\n children: VisualObject[];\n dependents: VisualObject[];\n bounding_box_lam: BoundingBoxGenerator;\n hasBoundingBox: boolean;\n /**\n * Top level class, which all other visual objects will extend.\n * @param coords position of the object on screen.\n */\n constructor(coords?: Coords | (() => Coords));\n boundingBox(): BoundingBox;\n getChildren(): VisualObject[];\n /**\n * Shifts object to have new given center\n * @param center new center of the object\n */\n setCenter(center: Coords | (() => Coords)): void;\n hasLam(): Boolean;\n getLam(): BoundingBoxGenerator;\n /**\n * Renders the object to the screen.\n * @param svg HTML Svg object to which the object should be rendered.\n */\n render(svg: any): void;\n}\n//# sourceMappingURL=VisualObject.d.ts.map\ninterface ShapeProps {\n center?: Coords | (() => Coords);\n color?: string | (() => string);\n borderWidth?: number | (() => number);\n borderColor?: string | (() => string);\n label?: string | (() => string);\n labelColor?: string | (() => string);\n labelSize?: number | (() => number);\n opacity?: number | (() => number);\n}\n/**\n * Generic class for a large suite of \"shape\"-like objects.\n * Generally includes anything with an inside and an outside.\n * All shapes come with builtin label.\n */\ndeclare class Shape extends VisualObject {\n color: () => string;\n borderWidth: () => number;\n borderColor: () => string;\n opacity: () => number;\n label: TextBox;\n /**\n * Constructs a generic shape object. This is a top-level class,\n * which should not be used except as super class for other specific\n * shapes.\n * @param coords coordinates of the shape\n * @param color color of shape's interior\n * @param borderWidth width of Shape's border\n * @param borderColor color of border\n * @param label text to display atop the shape\n * @param labelColor color of text\n * @param labelSize size of text\n * @param style\n */\n constructor(props: ShapeProps);\n setColor(color: string | (() => string)): void;\n setBorderWidth(borderWidth: number | (() => number)): void;\n setBorderColor(borderColor: string | (() => string)): void;\n setLabelText(text: string | (() => string)): void;\n setLabelColor(labelColor: string | (() => string)): void;\n setLabelSize(labelSize: number | (() => number)): void;\n}\n//# sourceMappingURL=Shape.d.ts.map\ndeclare class Pane {\n Children: VisualObject[];\n constructor();\n add(addNode: VisualObject): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Pane.d.ts.map\ninterface gridProps {\n grid_location: Coords | (() => Coords);\n cell_size: {\n x_size: number;\n y_size: number;\n };\n grid_dimensions: {\n x_size: number;\n y_size: number;\n };\n}\ndeclare class Grid extends VisualObject {\n /**\n *\n * As one of the most common expressions of a graph is a matrix, we offer functionality\n * for building a grid of cells, where you can add visual objects to each square in the grid,\n * and they are automatically formatted into the grid (where the center of the object is aligned\n * to the center of the grid)\n *\n * Note: grid size is fixed! You can't change the size of a grid once it's created\n *\n */\n private coords;\n config: gridProps;\n cells: Array>;\n gridlines: Array;\n constructor(props: gridProps);\n private check_bounding_box;\n add(coords: Coords, add_object: VisualObject, ignore_warning?: boolean): void;\n private center_helper;\n private fill_grid_lines;\n hide_grid_lines(): void;\n fill(coords: Coords, color: string): void;\n private check_coords;\n}\n{};\n//# sourceMappingURL=Grid.d.ts.map\ninterface RectangleProps extends ShapeProps {\n height: number | (() => number);\n width: number | (() => number);\n coords?: Coords | (() => Coords);\n}\ndeclare class Rectangle extends Shape {\n height: () => number;\n width: () => number;\n /**\n * Creates a logical rectangle object\n * @param height height (y direction)\n * @param width width (x direction)\n * @param coords coordinates of the top-left point\n * @param color color for interior\n * @param borderWidth width of border\n * @param borderColor color of border\n * @param label text for label\n * @param labelColor color for label text\n * @param labelSize size of label text\n */\n constructor(props: RectangleProps);\n boundingBox(): BoundingBox;\n setWidth(width: number | (() => number)): void;\n setHeight(height: number | (() => number)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Rectangle.d.ts.map\ninterface CircleProps extends ShapeProps {\n radius: number | (() => number);\n}\ndeclare class Circle extends Shape {\n radius: () => number;\n bounding_box_lam: BoundingBoxGenerator;\n /**\n * Creates a circle object at the given location\n * @param radius radius of circle\n * @param coords coordinates of circle's center\n * @param color color of interior\n * @param borderWidth width border\n * @param borderColor color for border\n * @param label text for label\n * @param labelColor color of label\n * @param labelSize size of label\n */\n constructor(props: CircleProps);\n boundingBox(): BoundingBox;\n setRadius(radius: number | (() => number)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Circle.d.ts.map\ndeclare class Stage {\n Children: VisualObject[];\n constructor();\n add(addObject: VisualObject): void;\n children_to_tree_recurse(root: VisualObject): VisTree;\n render(svg: any, document?: any): void;\n}\n//# sourceMappingURL=Stage.d.ts.map\ninterface TextBoxProps {\n text?: string | (() => string);\n coords?: Coords | (() => Coords);\n color?: string | (() => string);\n fontSize?: number | (() => number);\n}\ndeclare class TextBox extends VisualObject {\n text: () => string;\n fontSize: () => number;\n color: () => string;\n /**\n * Displays given text.\n * @param text text to display\n * @param coords location for center of text\n * @param color text color\n * @param fontSize size of the text\n */\n constructor(props: TextBoxProps);\n boundingBox(): BoundingBox;\n setText(text: string | (() => string)): void;\n setFontSize(fontSize: number | (() => number)): void;\n setTextColor(color: string | (() => string)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=TextBox.d.ts.map\ninterface LineProps {\n points?: Coords[] | (() => Coords)[];\n arrow?: boolean;\n color?: string | (() => string);\n width?: number | (() => number);\n opacity?: number | (() => number);\n style?: string | (() => string);\n}\ndeclare class Line extends VisualObject {\n pointsRelative: (() => Coords)[];\n color: () => string;\n width: () => number;\n opacity: () => number;\n arrow: boolean;\n style: () => string;\n /**\n * Creates a line on the given poitns.\n * @param points list of points for the line to pass through\n * @param color color of line\n * @param width width of line\n * @param opacity of the line\n */\n constructor(props: LineProps);\n boundingBox(): BoundingBox;\n setColor(color: string | (() => string)): void;\n setWidth(width: number | (() => number)): void;\n setOpacity(opacity: number | (() => number)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Line.d.ts.map\n/**\n * This class is not currently being used!!\n */\ndeclare class ConjoinedObject extends VisualObject {\n /**\n * Note: this code is untested!\n */\n children: VisualObject[];\n constructor(Children?: VisualObject[]);\n addOrdered(obj: VisualObject, index: number): void;\n add(obj: VisualObject): void;\n setCenter(coords: Coords): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=ConjoinedObject.d.ts.map\ninterface PolygonProps extends ShapeProps {\n points: Coords[] | (() => Coords)[];\n}\n/**\n * Class Representing Polygonal objects. Takes the form of any\n * series of points, and will form a polygon with said points as the boundary.\n */\ndeclare class Polygon extends Shape {\n pointsRelative: (() => Coords)[];\n /**\n * Constructs a polygon object\n * @param points list of points forming outside\n * @param color color of interior\n * @param borderWidth width of the border\n * @param borderColor color of the border\n * @param label text to label with\n * @param labelColor color of label text\n * @param labelSize size of the label\n */\n constructor(props: PolygonProps);\n boundingBox(): BoundingBox;\n render(svg: any): void;\n}\n//# sourceMappingURL=Polygon.d.ts.map\ninterface Node {\n name: string;\n neighbors: string[];\n}\ndeclare class Graph extends VisualObject {\n nodes: Node[];\n node_radius: number;\n fixed_nodes: number;\n graph_dimensions: number;\n node_to_location: any;\n constructor(coords?: Coords, graph_dimensions?: number, fixed_nodes?: number, node_radius?: number);\n setCenter(center: Coords): void;\n center(): {\n x: any;\n y: any;\n };\n add(Nodes: Node[]): void;\n private set_fixed_nodes;\n private set_malleable_nodes;\n check_add_set(Nodes: Node[]): void;\n render(svg: any): void;\n render_lines(svg: any, connections: string[][]): void;\n render_nodes(svg: any): void;\n}\n//# sourceMappingURL=Graph.d.ts.map\n/**\n * This is going to be a generic utility file. Primarily for factoring\n * out algorithms with a higher level of computational complexity.\n */\ndeclare function toFunc(defaultValue: T, t?: T | (() => T)): (() => T);\ninterface Coords {\n x: number;\n y: number;\n}\n/**\n * Generic props for representing a box around an object.\n */\ninterface BoundingBox {\n top_left: Coords;\n bottom_right: Coords;\n}\ndeclare function boxUnion(boxes: BoundingBox[]): {\n top_left: {\n x: number;\n y: number;\n };\n bottom_right: {\n x: number;\n y: number;\n };\n};\ninterface ExperimentalBoundingBox {\n lambda: (radians: number) => Coords;\n}\n/**\n * Simple method averaging the coordinate points in a series.\n * @param points\n * @returns\n */\ndeclare function averagePath(points: Coords[]): Coords;\n/**\n * Shifts a function list of points according to a shift variable\n * @param pointList\n * @param shift\n * @returns\n */\ndeclare function shiftList(pointList: (() => Coords)[], shift: () => Coords): (() => Coords)[];\n/**\n * Utility function returning bounding box for a list of points\n * @param pointList list of points as coords\n * @returns bounding box\n */\ndeclare function boundsOfList(pointList: Coords[]): BoundingBox;\n//# sourceMappingURL=Utility.d.ts.map\n/**\n * Interface for node in a tree with a visualObject\n */\ninterface VisTree {\n visualObject: VisualObject;\n children: VisTree[];\n}\ninterface TreeProps {\n root: VisTree;\n height: number;\n width: number;\n coords?: Coords | (() => Coords);\n edgeColor?: string;\n edgeWidth?: number;\n}\ndeclare class Tree extends VisualObject {\n root: VisTree;\n height: number;\n width: number;\n private lines;\n private subTrees;\n private coords;\n /**\n * Builds a tree object, pulling all children nodes into proper locations and\n * adding lines where necessary.\n * @param root root of the tree of visual objects\n * @param height height of box to bound the tree\n * @param width width of box to bound the tree\n * @param coords top left point of the tree\n */\n constructor(props: TreeProps);\n private setUpSubtrees;\n setLineColor(color: string): void;\n setLineWidth(width: number): void;\n}\n//# sourceMappingURL=Tree.d.ts.map\n",filePath:"helpers.ts"},{content:la+"\n"+e,filePath:"alloy.js"},{content:e,filePath:"variables.ts"}])}),[c,n]),(0,r.jsx)(aa.ZP,{"data-testid":"script-view-monaco-editor",language:"javascript",options:{automaticLayout:!0,scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:12},value:t},editorDidMount:h,editorWillUnmount:e=>{const t=e.getValue();a(t)}})},da=e=>{const t=kt(),{datumId:n,button:s,generatorId:i}=e,{text:a,onClick:l,mouseover:c}=s,d=(0,o.useCallback)((()=>{t(Pe({id:n,onClick:l,context:{generatorName:i,id:n}}))}),[n,s]);return(0,r.jsx)(ms.u,Object.assign({hasArrow:!0,label:c,isDisabled:void 0===c},{children:(0,r.jsx)(Ee,Object.assign({onClick:d},{children:a}))}))},ha=e=>{const{onExecute:t}=e,n=Ct(Br),s=kt(),i=(0,o.useCallback)((e=>{s(ea(e))}),[]);return(0,r.jsxs)("div",Object.assign({className:"flex"},{children:[(0,r.jsx)(ms.u,Object.assign({hasArrow:!0,label:""},{children:(0,r.jsx)(A.zx,Object.assign({colorScheme:"blue",size:"xs",onClick:t},{children:"Run"}))})),(0,r.jsxs)(A.hE,Object.assign({className:"pl-2",isAttached:!0,colorScheme:"blue",size:"xs"},{children:[(0,r.jsx)(A.zx,Object.assign({isActive:"div"===n,onClick:()=>i("div")},{children:"
"})),(0,r.jsx)(A.zx,Object.assign({isActive:"canvas"===n,onClick:()=>i("canvas")},{children:""})),(0,r.jsx)(A.zx,Object.assign({isActive:"svg"===n,onClick:()=>i("svg")},{children:""}))]}))]}))},pa=e=>{const{datum:t,onExecute:n}=e,{id:o,parsed:s,buttons:i}=t,a=s.command;return(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center space-x-2 px-2"},{children:[(0,r.jsxs)(O,Object.assign({className:"text-gray-400"},{children:["ID: ",o]})),(0,r.jsx)(O,{children:a}),(0,r.jsx)("div",{className:"grow"}),(0,r.jsx)(ha,{onExecute:n}),i&&i.map(((e,n)=>(0,r.jsx)(da,{datumId:o,generatorId:t.generatorName,button:e},n)))]}))},ua=e=>{const{datum:t}=e,n=kt(),s=(0,Qi.pm)(),i=Ct(Br),a=Ct(Zr),l=Ct(Vr),c=Ct((e=>Ur(e,t))),[d,h]=(0,o.useState)(),[p,u]=(0,o.useState)(null),m=(0,o.useRef)(null);Ne(m,(e=>{n(ta({width:e.width,height:e.height}))}));const g=(0,o.useCallback)((e=>{h(e)}),[]),f=(0,o.useCallback)((e=>{e&&u(e)}),[]),b=(0,o.useCallback)((e=>{e&&u(e)}),[]),y=(0,o.useCallback)((e=>{e&&u(e)}),[]),w=(0,o.useCallback)((e=>{n(na(e)),n(ra({id:t.id,text:e}))}),[t]),v=(0,o.useCallback)((()=>{const e=null==d?void 0:d.getValue();if(e&&p&&a){n(na(e)),n(ra({id:t.id,text:e}));const[r,o]=function(e){const t=e.split("\n"),n=[];let r=0;for(let e=0;e{try{new Function(i,"width","height",...Kn.map((e=>e.name)),...c.map((e=>e.name)),...r.map((e=>function(e){return e.replaceAll("-","_")}(e))),o)(p,a.width,a.height,...Kn.map((e=>e.value)),...c.map((e=>e.variable)),...e)}catch(e){s({variant:"top-accent",position:"bottom-right",title:e instanceof Error?e.name:"Error",description:ma(e),status:"error",duration:1e4,isClosable:!0})}}))}}),[d,i,p,a,c]);return(0,r.jsxs)(x,{children:[(0,r.jsx)(C,Object.assign({className:"border-b"},{children:(0,r.jsx)(pa,{datum:t,onExecute:v})})),(0,r.jsx)(k,{children:(0,r.jsxs)("div",Object.assign({className:"grid grid-cols-2 divide-x h-full"},{children:[(0,r.jsxs)(x,Object.assign({ref:m,className:"relative"},{children:["div"===i&&(0,r.jsx)("div",{ref:y,className:"w-full h-full"}),"canvas"===i&&(0,r.jsx)("canvas",{ref:b,className:"w-full h-full"}),"svg"===i&&(0,r.jsx)("div",Object.assign({"aria-label":"SVG Visualization",id:"svg-container",style:{height:"100%",width:"100%",overflow:"scroll"}},{children:(0,r.jsx)("svg",{ref:f,style:{width:"100%",height:"100%",backgroundColor:"snow"}})}))]})),(0,r.jsx)(x,Object.assign({className:"relative","aria-label":"Visualization Script","data-testid":"script-editor-pane"},{children:(0,r.jsx)(ca,{initialText:l,variables:c,editorRef:g,stageRef:p,beforeUnmount:w,onExecute:v})}))]}))})]})};function ma(e){if(!(e instanceof Error))return`${e}`;if(console.log(`Error stack: ${e.stack}`),null!=e.stack){const t=e.stack.match(new RegExp(".*(Function|):[0-9]+:[0-9]+.*","g"));if(t){const n=t[0].split(new RegExp(".*Function:|:"))[1].split(":");console.log(`rowCol: ${JSON.stringify(n)}`);const r=+n[0]-2;return n[1],`${e.message} Around line ${r} (computed via parsing error stack)`}}return`${e.message} (error location was not provided by the browser)`}const ga=()=>{const e=Ct(yr);return e?(0,r.jsx)(ua,{datum:e,"data-testid":"script-view-datum"}):null},fa=e=>{const{data:t}=e,n={gridTemplateColumns:`repeat(${t.data.length>0?t.data[0].length:0}, minmax(0, 1fr))`,borderCollapse:"collapse",textAlign:"left"};return(0,r.jsxs)("table",Object.assign({className:"prose shadow m-2 boarder prose text-xs font-mono",summary:t.title,role:"table",style:n},{children:[(0,r.jsx)("caption",Object.assign({className:"prose prose-sm font-semibold px-2 py-1 border shadow",style:{textAlign:"left"}},{children:t.title})),(0,r.jsx)("thead",Object.assign({className:"bg-slate-100"},{children:(0,r.jsx)("tr",{children:t.headers&&t.headers.map(((e,t)=>(0,r.jsx)("th",Object.assign({className:"font-semibold px-2 py-0.5",scope:"col","aria-labelledby":e},{children:e}),`header-${t}`)))})})),(0,r.jsx)("tbody",{children:t.data.map(((e,t)=>(0,r.jsx)("tr",{children:e.map(((e,n)=>(0,r.jsx)("td",Object.assign({className:"px-2 py-0.5 bg-white boarder",headers:`header-${n}`},{children:e}),`${t}${n}`)))},`row-${t}`)))})]}))},xa=e=>{const{datum:t}=e,n=Ct((e=>qr(e,t)));return(0,r.jsx)(r.Fragment,{children:n.map(((e,t)=>(0,r.jsx)(fa,{data:e},t)))})},ba=e=>{const{datum:t}=e,{id:n,parsed:o,buttons:s}=t,i=o.command;return(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center space-x-2 px-2"},{children:[(0,r.jsxs)(O,Object.assign({className:"text-gray-400"},{children:["ID: ",n]})),(0,r.jsx)(O,{children:i}),(0,r.jsx)("div",{className:"grow"}),s&&s.map(((e,o)=>(0,r.jsx)(da,{datumId:n,generatorId:t.generatorName,button:e},o)))]}))},ya=()=>{const e=Ct(yr);return e?(0,r.jsxs)(x,{children:[(0,r.jsx)(C,{children:(0,r.jsx)(ba,{datum:e})}),(0,r.jsx)(k,{children:(0,r.jsx)("div",Object.assign({className:"w-full h-full flex content-start items-start flex-wrap overflow-y-auto"},{children:(0,r.jsx)(xa,{datum:e})}))})]}):null},wa=()=>{const e=Ct(Dr);return(0,r.jsxs)(x,{children:["GraphView"===e&&(0,r.jsx)(Hi,{}),"TableView"===e&&(0,r.jsx)(ya,{}),"ScriptView"===e&&(0,r.jsx)(ga,{})]})};var va=n(97375);const ja=e=>{const{isConnected:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const t=Ct(Nr),n=Ct(Lr),o=t?`Connected to ${n}`:"Not connected to a provider",s=t?"Connected":"Disconnected";return(0,r.jsx)(ms.u,Object.assign({hasArrow:!0,label:o},{children:(0,r.jsxs)(c.M5,Object.assign({},e,{children:[(0,r.jsx)(ja,{isConnected:t}),(0,r.jsx)(c.xv,Object.assign({mx:1,userSelect:"none"},{children:s}))]}))}))};var Ma=n(68016);const ka=function(e,t){const{id:n,result:r}=t.payload;e.expressionsById[n].result=r},Ca=function(e,t){const{id:n,datumId:r,expression:o}=t.payload,s=e.orderByDatumId[r]||[];e.nextExpressionId+=1,e.expressionsById[n]={id:n,datumId:r,expression:o,result:""},e.orderByDatumId[r]=[n,...s]},Oa=(0,Le.oM)({name:"evaluator",initialState:{nextExpressionId:0,expressionsById:{},orderByDatumId:{}},reducers:{},extraReducers:e=>e.addCase($e,ka).addCase(Be,Ca)}),{}=Oa.actions,Sa=Oa.reducer;function Ia(e){return{type:"message",time:(new Date).toJSON(),text:e}}function Na(e){return{type:"error",time:(new Date).toJSON(),text:e}}const za=function(e,t){e.items.push(Ia(`Datum selected - Datum ID: ${t.payload}`))},Da=function(e,t){const{id:n,onClick:r}=t.payload;e.items.push(Ia(`Click button - Datum ID: ${n} - Button: ${r}`))},_a=function(e,t){const{enter:n,update:r,exit:o}=t.payload,s=(null==n?void 0:n.length)||0,i=(null==r?void 0:r.length)||0,a=(null==o?void 0:o.length)||0;e.items.push(Ia(`Receive data: ${s} enter, ${i} update, ${a} exit.`))},Ta=function(e){e.items.push(Ia("Request data."))},Ea=function(e,t){const{name:n}=t.payload;e.items.push(Ia(`Receive metadata from ${n}.`))},La=function(e){e.items.push(Ia("Connection established."))},Pa=function(e,t){e.items.push(Na(t.payload))},Ra=function(e){e.items.push(Ia("Connection lost."))},Ba=function(e,t){e.items.push(Na(t.payload))},Za=(0,Le.oM)({name:"log",initialState:{items:[],filters:["message","warning","error"],sort:"ascending"},reducers:{filtersChanged:function(e,t){e.filters=t.payload},logCleared:function(e){e.items=[]},sortOrderChanged:function(e,t){e.sort=t.payload}},extraReducers:e=>e.addCase(vs,za).addCase(Pe,Da).addCase(Ve,_a).addCase(Re,Ta).addCase(Fe,Ea).addCase(Ue,La).addCase(qe,Pa).addCase(Ye,Ra).addCase(Xe,Ba)}),{logCleared:Va,sortOrderChanged:$a,filtersChanged:Fa}=Za.actions,Ga=Za.reducer,Wa=function(e,t){const{name:n,generators:r}=t.payload;e.providerName=n||"unknown provider",e.providerGenerators=null==r?void 0:r.slice()},Ua=function(e){e.connected=!0},qa=function(e){e.connected=!1},Ya=(0,Le.oM)({name:"provider",initialState:{connected:!1,providerName:"unknown provider",providerGenerators:void 0},reducers:{},extraReducers:e=>e.addCase(Fe,Wa).addCase(Ue,Ua).addCase(Ye,qa)}),{}=Ya.actions,Xa=Ya.reducer,Ja=(0,Le.xC)({reducer:{data:As,evaluator:Sa,graphs:Uo,log:Ga,provider:Xa,script:oa,ui:$s},middleware:e=>e().prepend(function(){let e=null,t=0;const n=()=>{window.clearInterval(t),t=0},r=()=>{e&&e.close()},o=()=>{e&&e.send("ping")},s=(i,a)=>{const l=i.dispatch;let c=!1;e&&r(),a=a||`ws://localhost:${window.location.search.slice(1)}`,e=new WebSocket(a),e.onopen=()=>{c=!0,window.setTimeout((()=>o()),3e3),l(Ue()),n()},e.onclose=()=>{c&&(c=!1,l(Ye())),e&&e.readyState===WebSocket.CLOSED&&(n(),t=window.setInterval((()=>s(i,a)),1e3))},e.onmessage=e=>{"pong"===e.data?window.setTimeout((()=>o()),3e3):jt(e.data,i)}};return t=>n=>o=>(Ge.match(o)?s(t,o.payload):We.match(o)?r():Pe.match(o)?function(e,t,n){if(!e)return At(t);Mt(e,function(e,t){return{type:"click",version:1,payload:t}}(0,n))}(e,t,o.payload):Re.match(o)?function(e,t){if(!e)return At(t);Mt(e,{type:"data",version:1})}(e,t):Be.match(o)?function(e,t,n){if(!e)return At(t);Mt(e,function(e,t){return{type:"eval",version:1,payload:t}}(0,n))}(e,t,o.payload):Ze.match(o)&&function(e,t){if(!e)return At(t);Mt(e,{type:"meta",version:1})}(e,t),n(o))}(),(e=>t=>n=>{if(!Ue.match(n))return t(n);t(n),e.dispatch(Ze()),e.dispatch(Re())}))});function Ha({isOpen:e,onClose:t}){const n=(0,o.useRef)(null);let[s,i]=(0,o.useState)("");const a=(0,Qi.pm)(),l=(0,o.useRef)(null);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(Ma.u_,Object.assign({isOpen:e,onClose:t},{children:[(0,r.jsx)(Ma.ZA,{}),(0,r.jsxs)(Ma.hz,Object.assign({maxW:"70rem"},{children:[(0,r.jsx)(Ma.xB,{children:(0,r.jsx)(c.M5,{children:"Input Alloy-style XML datum (paste directly or load from file)"})}),(0,r.jsx)(Ma.ol,{}),(0,r.jsxs)(Ma.fe,Object.assign({pb:6},{children:[(0,r.jsx)(A.zx,Object.assign({onClick:()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.click()}},{children:"Click to add XML from file"})),' ...or simply paste in an XML datum below. Then click the "Add Datum" button.',(0,r.jsx)(c.LZ,{h:"1rem"}),(0,r.jsx)(c.iz,{orientation:"horizontal",mx:5}),(0,r.jsx)(c.LZ,{h:"1rem"}),(0,r.jsxs)(xi.NI,{children:[(0,r.jsx)(xi.lX,{children:"XML datum string to add"}),(0,r.jsx)(yi.g,{minH:"20rem",ref:n,placeholder:'\n\n \n \n \n\n\n',value:s,onChange:e=>i(e.target.value)})]})]})),(0,r.jsxs)(Ma.mz,{children:[(0,r.jsx)(A.zx,Object.assign({onClick:()=>{var e;const r=null===(e=n.current)||void 0===e?void 0:e.value;if(void 0===r)return void t();const o=Ja.getState().data.datumIds;console.log(o);const s=o.reduce(((e,t)=>isNaN(parseInt(t))?e:Math.max(e,parseInt(t)+1)),0);try{Ja.dispatch(Ve({enter:[vt({id:s.toString(),format:"alloy",data:r,buttons:[],evaluator:!1})],update:[],exit:[]}))}catch(e){a({variant:"top-accent",position:"bottom-right",title:e instanceof Error?e.name:"Error adding instance",description:e instanceof Error?e.message:"No further information is available.",status:"error",duration:1e4,isClosable:!0})}t()}},{children:"Add Datum"})),(0,r.jsx)(bi.II,{type:"file",ref:l,style:{display:"none"},onChange:e=>{var t;const n=new FileReader;n.onload=e=>{return t=this,n=void 0,o=function*(){var t;(null===(t=e.target)||void 0===t?void 0:t.result)&&(e.target.result instanceof ArrayBuffer?i(e.target.result.toString()):i(e.target.result))},new((r=void 0)||(r=Promise))((function(e,s){function i(e){try{l(o.next(e))}catch(e){s(e)}}function a(e){try{l(o.throw(e))}catch(e){s(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,a)}l((o=o.apply(t,n||[])).next())}));var t,n,r,o},(null===(t=e.target)||void 0===t?void 0:t.files)&&e.target.files.length>0&&n.readAsText(e.target.files[0])}})]})]}))]}))})}const Qa=()=>{const e=kt(),{isOpen:t,onOpen:n,onClose:o}=(0,va.qY)();return(0,r.jsxs)(z,Object.assign({"data-testid":"app-status-bar"},{children:[(0,r.jsx)(c.LZ,{}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)("div",Object.assign({className:"cursor-pointer hover:text-gray-500",onClick:n},{children:"Manual Datum"})),(0,r.jsx)(Ha,{isOpen:t,onClose:o}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)("div",Object.assign({className:"cursor-pointer hover:text-gray-500",onClick:()=>{e(js())}},{children:"Console Dump"})),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)(Aa,{})]}))},Ka={layout:{drawerWidth:350,drawerMinWidth:100,drawerMaxWidth:600,explorerWidth:250,explorerMinWidth:60,explorerMaxWidth:250}};var el=n(93379),tl=n.n(el),nl=n(7795),rl=n.n(nl),ol=n(90569),sl=n.n(ol),il=n(3565),al=n.n(il),ll=n(19216),cl=n.n(ll),dl=n(44589),hl=n.n(dl),pl=n(50992),ul={};ul.styleTagTransform=hl(),ul.setAttributes=al(),ul.insert=sl().bind(null,"head"),ul.domAPI=rl(),ul.insertStyleElement=cl(),tl()(pl.Z,ul),pl.Z&&pl.Z.locals&&pl.Z.locals,s.render((0,r.jsx)(o.StrictMode,{children:(0,r.jsx)(a.xjn,Object.assign({theme:_},{children:(0,r.jsx)(i.zt,Object.assign({store:Ja},{children:(0,r.jsx)((e=>{const{url:t}=e,{layout:n}=Ka,s=kt(),i=Ct(kr);return(0,o.useEffect)((()=>(s(Ge(t)),()=>{s(We())})),[t,s]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(m,Object.assign({rightPaneCollapsed:i,rightPaneInitialWidth:n.drawerWidth,rightPaneMinWidth:n.drawerMinWidth,rightPaneMaxWidth:n.drawerMaxWidth},{children:[(0,r.jsx)(wa,{}),(0,r.jsx)(Bi,{})]})),(0,r.jsx)(qi,{}),(0,r.jsx)($i,{}),(0,r.jsx)(Qa,{})]})}),{url:void 0})}))}))}),document.getElementById("root"))},50992:(e,t,n)=>{n.d(t,{Z:()=>b});var r=n(8081),o=n.n(r),s=n(23645),i=n.n(s),a=n(61667),l=n.n(a),c=new URL(n(70909),n.b),d=new URL(n(133),n.b),h=new URL(n(23601),n.b),p=new URL(n(1686),n.b),u=i()(o()),m=l()(c),g=l()(d),f=l()(h),x=l()(p);u.push([e.id,"/*\n! tailwindcss v3.0.13 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n*/\n\nhtml {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n -o-tab-size: 4;\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 4 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font family by default.\n2. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\n[type='button'],\n[type='reset'],\n[type='submit'] {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/*\nEnsure the default browser behavior of the `hidden` attribute.\n*/\n\n[hidden] {\n display: none;\n}\n\n[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n background-color: #fff;\n border-color: #6b7280;\n border-width: 1px;\n border-radius: 0px;\n padding-top: 0.5rem;\n padding-right: 0.75rem;\n padding-bottom: 0.5rem;\n padding-left: 0.75rem;\n font-size: 1rem;\n line-height: 1.5rem;\n --tw-shadow: 0 0 #0000;\n}\n\n[type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: #2563eb;\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n border-color: #2563eb;\n}\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n color: #6b7280;\n opacity: 1;\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n color: #6b7280;\n opacity: 1;\n}\n\ninput::placeholder,textarea::placeholder {\n color: #6b7280;\n opacity: 1;\n}\n\n::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n}\n\n::-webkit-date-and-time-value {\n min-height: 1.5em;\n}\n\nselect {\n background-image: url("+m+");\n background-position: right 0.5rem center;\n background-repeat: no-repeat;\n background-size: 1.5em 1.5em;\n padding-right: 2.5rem;\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n}\n\n[multiple] {\n background-image: initial;\n background-position: initial;\n background-repeat: unset;\n background-size: initial;\n padding-right: 0.75rem;\n -webkit-print-color-adjust: unset;\n color-adjust: unset;\n}\n\n[type='checkbox'],[type='radio'] {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: 0;\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n display: inline-block;\n vertical-align: middle;\n background-origin: border-box;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n flex-shrink: 0;\n height: 1rem;\n width: 1rem;\n color: #2563eb;\n background-color: #fff;\n border-color: #6b7280;\n border-width: 1px;\n --tw-shadow: 0 0 #0000;\n}\n\n[type='checkbox'] {\n border-radius: 0px;\n}\n\n[type='radio'] {\n border-radius: 100%;\n}\n\n[type='checkbox']:focus,[type='radio']:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);\n --tw-ring-offset-width: 2px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: #2563eb;\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n}\n\n[type='checkbox']:checked,[type='radio']:checked {\n border-color: transparent;\n background-color: currentColor;\n background-size: 100% 100%;\n background-position: center;\n background-repeat: no-repeat;\n}\n\n[type='checkbox']:checked {\n background-image: url("+g+");\n}\n\n[type='radio']:checked {\n background-image: url("+f+");\n}\n\n[type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus {\n border-color: transparent;\n background-color: currentColor;\n}\n\n[type='checkbox']:indeterminate {\n background-image: url("+x+');\n border-color: transparent;\n background-color: currentColor;\n background-size: 100% 100%;\n background-position: center;\n background-repeat: no-repeat;\n}\n\n[type=\'checkbox\']:indeterminate:hover,[type=\'checkbox\']:indeterminate:focus {\n border-color: transparent;\n background-color: currentColor;\n}\n\n[type=\'file\'] {\n background: unset;\n border-color: inherit;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-size: unset;\n line-height: inherit;\n}\n\n[type=\'file\']:focus {\n outline: 1px auto -webkit-focus-ring-color;\n}\n\n*, ::before, ::after {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n.prose {\n color: var(--tw-prose-body);\n max-width: 65ch;\n}\n.prose :where([class~="lead"]):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-lead);\n font-size: 1.25em;\n line-height: 1.6;\n margin-top: 1.2em;\n margin-bottom: 1.2em;\n}\n.prose :where(a):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-links);\n text-decoration: underline;\n font-weight: 500;\n}\n.prose :where(strong):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-bold);\n font-weight: 600;\n}\n.prose :where(ol):not(:where([class~="not-prose"] *)) {\n list-style-type: decimal;\n padding-left: 1.625em;\n}\n.prose :where(ol[type="A"]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-alpha;\n}\n.prose :where(ol[type="a"]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-alpha;\n}\n.prose :where(ol[type="A" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-alpha;\n}\n.prose :where(ol[type="a" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-alpha;\n}\n.prose :where(ol[type="I"]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-roman;\n}\n.prose :where(ol[type="i"]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-roman;\n}\n.prose :where(ol[type="I" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-roman;\n}\n.prose :where(ol[type="i" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-roman;\n}\n.prose :where(ol[type="1"]):not(:where([class~="not-prose"] *)) {\n list-style-type: decimal;\n}\n.prose :where(ul):not(:where([class~="not-prose"] *)) {\n list-style-type: disc;\n padding-left: 1.625em;\n}\n.prose :where(ol > li):not(:where([class~="not-prose"] *))::marker {\n font-weight: 400;\n color: var(--tw-prose-counters);\n}\n.prose :where(ul > li):not(:where([class~="not-prose"] *))::marker {\n color: var(--tw-prose-bullets);\n}\n.prose :where(hr):not(:where([class~="not-prose"] *)) {\n border-color: var(--tw-prose-hr);\n border-top-width: 1px;\n margin-top: 3em;\n margin-bottom: 3em;\n}\n.prose :where(blockquote):not(:where([class~="not-prose"] *)) {\n font-weight: 500;\n font-style: italic;\n color: var(--tw-prose-quotes);\n border-left-width: 0.25rem;\n border-left-color: var(--tw-prose-quote-borders);\n quotes: "\\201C""\\201D""\\2018""\\2019";\n margin-top: 1.6em;\n margin-bottom: 1.6em;\n padding-left: 1em;\n}\n.prose :where(blockquote p:first-of-type):not(:where([class~="not-prose"] *))::before {\n content: open-quote;\n}\n.prose :where(blockquote p:last-of-type):not(:where([class~="not-prose"] *))::after {\n content: close-quote;\n}\n.prose :where(h1):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 800;\n font-size: 2.25em;\n margin-top: 0;\n margin-bottom: 0.8888889em;\n line-height: 1.1111111;\n}\n.prose :where(h1 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 900;\n}\n.prose :where(h2):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 700;\n font-size: 1.5em;\n margin-top: 2em;\n margin-bottom: 1em;\n line-height: 1.3333333;\n}\n.prose :where(h2 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 800;\n}\n.prose :where(h3):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n font-size: 1.25em;\n margin-top: 1.6em;\n margin-bottom: 0.6em;\n line-height: 1.6;\n}\n.prose :where(h3 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 700;\n}\n.prose :where(h4):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n margin-top: 1.5em;\n margin-bottom: 0.5em;\n line-height: 1.5;\n}\n.prose :where(h4 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 700;\n}\n.prose :where(figure > *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.prose :where(figcaption):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-captions);\n font-size: 0.875em;\n line-height: 1.4285714;\n margin-top: 0.8571429em;\n}\n.prose :where(code):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-code);\n font-weight: 600;\n font-size: 0.875em;\n}\n.prose :where(code):not(:where([class~="not-prose"] *))::before {\n content: "`";\n}\n.prose :where(code):not(:where([class~="not-prose"] *))::after {\n content: "`";\n}\n.prose :where(a code):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-links);\n}\n.prose :where(pre):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-pre-code);\n background-color: var(--tw-prose-pre-bg);\n overflow-x: auto;\n font-weight: 400;\n font-size: 0.875em;\n line-height: 1.7142857;\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n border-radius: 0.375rem;\n padding-top: 0.8571429em;\n padding-right: 1.1428571em;\n padding-bottom: 0.8571429em;\n padding-left: 1.1428571em;\n}\n.prose :where(pre code):not(:where([class~="not-prose"] *)) {\n background-color: transparent;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-weight: inherit;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n}\n.prose :where(pre code):not(:where([class~="not-prose"] *))::before {\n content: none;\n}\n.prose :where(pre code):not(:where([class~="not-prose"] *))::after {\n content: none;\n}\n.prose :where(table):not(:where([class~="not-prose"] *)) {\n width: 100%;\n table-layout: auto;\n text-align: left;\n margin-top: 2em;\n margin-bottom: 2em;\n font-size: 0.875em;\n line-height: 1.7142857;\n}\n.prose :where(thead):not(:where([class~="not-prose"] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-th-borders);\n}\n.prose :where(thead th):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n vertical-align: bottom;\n padding-right: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-left: 0.5714286em;\n}\n.prose :where(tbody tr):not(:where([class~="not-prose"] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-td-borders);\n}\n.prose :where(tbody tr:last-child):not(:where([class~="not-prose"] *)) {\n border-bottom-width: 0;\n}\n.prose :where(tbody td):not(:where([class~="not-prose"] *)) {\n vertical-align: baseline;\n padding-top: 0.5714286em;\n padding-right: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-left: 0.5714286em;\n}\n.prose {\n --tw-prose-body: #374151;\n --tw-prose-headings: #111827;\n --tw-prose-lead: #4b5563;\n --tw-prose-links: #111827;\n --tw-prose-bold: #111827;\n --tw-prose-counters: #6b7280;\n --tw-prose-bullets: #d1d5db;\n --tw-prose-hr: #e5e7eb;\n --tw-prose-quotes: #111827;\n --tw-prose-quote-borders: #e5e7eb;\n --tw-prose-captions: #6b7280;\n --tw-prose-code: #111827;\n --tw-prose-pre-code: #e5e7eb;\n --tw-prose-pre-bg: #1f2937;\n --tw-prose-th-borders: #d1d5db;\n --tw-prose-td-borders: #e5e7eb;\n --tw-prose-invert-body: #d1d5db;\n --tw-prose-invert-headings: #fff;\n --tw-prose-invert-lead: #9ca3af;\n --tw-prose-invert-links: #fff;\n --tw-prose-invert-bold: #fff;\n --tw-prose-invert-counters: #9ca3af;\n --tw-prose-invert-bullets: #4b5563;\n --tw-prose-invert-hr: #374151;\n --tw-prose-invert-quotes: #f3f4f6;\n --tw-prose-invert-quote-borders: #374151;\n --tw-prose-invert-captions: #9ca3af;\n --tw-prose-invert-code: #fff;\n --tw-prose-invert-pre-code: #d1d5db;\n --tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);\n --tw-prose-invert-th-borders: #4b5563;\n --tw-prose-invert-td-borders: #374151;\n font-size: 1rem;\n line-height: 1.75;\n}\n.prose :where(p):not(:where([class~="not-prose"] *)) {\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n}\n.prose :where(img):not(:where([class~="not-prose"] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.prose :where(video):not(:where([class~="not-prose"] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.prose :where(figure):not(:where([class~="not-prose"] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.prose :where(h2 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.875em;\n}\n.prose :where(h3 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.9em;\n}\n.prose :where(li):not(:where([class~="not-prose"] *)) {\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n}\n.prose :where(ol > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.375em;\n}\n.prose :where(ul > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.375em;\n}\n.prose > :where(ul > li p):not(:where([class~="not-prose"] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.prose > :where(ul > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.25em;\n}\n.prose > :where(ul > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.25em;\n}\n.prose > :where(ol > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.25em;\n}\n.prose > :where(ol > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.25em;\n}\n.prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.prose :where(hr + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(h2 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(h3 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(h4 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(thead th:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose :where(thead th:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose :where(tbody td:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose :where(tbody td:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose > :where(:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose > :where(:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 0;\n}\n.prose-sm {\n font-size: 0.875rem;\n line-height: 1.7142857;\n}\n.prose-sm :where(p):not(:where([class~="not-prose"] *)) {\n margin-top: 1.1428571em;\n margin-bottom: 1.1428571em;\n}\n.prose-sm :where([class~="lead"]):not(:where([class~="not-prose"] *)) {\n font-size: 1.2857143em;\n line-height: 1.5555556;\n margin-top: 0.8888889em;\n margin-bottom: 0.8888889em;\n}\n.prose-sm :where(blockquote):not(:where([class~="not-prose"] *)) {\n margin-top: 1.3333333em;\n margin-bottom: 1.3333333em;\n padding-left: 1.1111111em;\n}\n.prose-sm :where(h1):not(:where([class~="not-prose"] *)) {\n font-size: 2.1428571em;\n margin-top: 0;\n margin-bottom: 0.8em;\n line-height: 1.2;\n}\n.prose-sm :where(h2):not(:where([class~="not-prose"] *)) {\n font-size: 1.4285714em;\n margin-top: 1.6em;\n margin-bottom: 0.8em;\n line-height: 1.4;\n}\n.prose-sm :where(h3):not(:where([class~="not-prose"] *)) {\n font-size: 1.2857143em;\n margin-top: 1.5555556em;\n margin-bottom: 0.4444444em;\n line-height: 1.5555556;\n}\n.prose-sm :where(h4):not(:where([class~="not-prose"] *)) {\n margin-top: 1.4285714em;\n margin-bottom: 0.5714286em;\n line-height: 1.4285714;\n}\n.prose-sm :where(img):not(:where([class~="not-prose"] *)) {\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n}\n.prose-sm :where(video):not(:where([class~="not-prose"] *)) {\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n}\n.prose-sm :where(figure):not(:where([class~="not-prose"] *)) {\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n}\n.prose-sm :where(figure > *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.prose-sm :where(figcaption):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n line-height: 1.3333333;\n margin-top: 0.6666667em;\n}\n.prose-sm :where(code):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n}\n.prose-sm :where(h2 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.9em;\n}\n.prose-sm :where(h3 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.8888889em;\n}\n.prose-sm :where(pre):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n line-height: 1.6666667;\n margin-top: 1.6666667em;\n margin-bottom: 1.6666667em;\n border-radius: 0.25rem;\n padding-top: 0.6666667em;\n padding-right: 1em;\n padding-bottom: 0.6666667em;\n padding-left: 1em;\n}\n.prose-sm :where(ol):not(:where([class~="not-prose"] *)) {\n padding-left: 1.5714286em;\n}\n.prose-sm :where(ul):not(:where([class~="not-prose"] *)) {\n padding-left: 1.5714286em;\n}\n.prose-sm :where(li):not(:where([class~="not-prose"] *)) {\n margin-top: 0.2857143em;\n margin-bottom: 0.2857143em;\n}\n.prose-sm :where(ol > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.4285714em;\n}\n.prose-sm :where(ul > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.4285714em;\n}\n.prose-sm > :where(ul > li p):not(:where([class~="not-prose"] *)) {\n margin-top: 0.5714286em;\n margin-bottom: 0.5714286em;\n}\n.prose-sm > :where(ul > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.1428571em;\n}\n.prose-sm > :where(ul > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.1428571em;\n}\n.prose-sm > :where(ol > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.1428571em;\n}\n.prose-sm > :where(ol > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.1428571em;\n}\n.prose-sm :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"] *)) {\n margin-top: 0.5714286em;\n margin-bottom: 0.5714286em;\n}\n.prose-sm :where(hr):not(:where([class~="not-prose"] *)) {\n margin-top: 2.8571429em;\n margin-bottom: 2.8571429em;\n}\n.prose-sm :where(hr + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(h2 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(h3 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(h4 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(table):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n line-height: 1.5;\n}\n.prose-sm :where(thead th):not(:where([class~="not-prose"] *)) {\n padding-right: 1em;\n padding-bottom: 0.6666667em;\n padding-left: 1em;\n}\n.prose-sm :where(thead th:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose-sm :where(thead th:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose-sm :where(tbody td):not(:where([class~="not-prose"] *)) {\n padding-top: 0.6666667em;\n padding-right: 1em;\n padding-bottom: 0.6666667em;\n padding-left: 1em;\n}\n.prose-sm :where(tbody td:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose-sm :where(tbody td:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose-sm > :where(:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm > :where(:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 0;\n}\n.sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0, 0, 0, 0) !important;\n white-space: nowrap !important;\n border-width: 0 !important;\n}\n.fixed {\n position: fixed !important;\n}\n.absolute {\n position: absolute !important;\n}\n.relative {\n position: relative !important;\n}\n.inset-0 {\n top: 0px !important;\n right: 0px !important;\n bottom: 0px !important;\n left: 0px !important;\n}\n.inset-y-0 {\n top: 0px !important;\n bottom: 0px !important;\n}\n.inset-x-0 {\n left: 0px !important;\n right: 0px !important;\n}\n.top-0 {\n top: 0px !important;\n}\n.right-0 {\n right: 0px !important;\n}\n.left-0 {\n left: 0px !important;\n}\n.-left-5 {\n left: -1.25rem !important;\n}\n.top-\\[35px\\] {\n top: 35px !important;\n}\n.bottom-0 {\n bottom: 0px !important;\n}\n.col-span-3 {\n grid-column: span 3 / span 3 !important;\n}\n.m-2 {\n margin: 0.5rem !important;\n}\n.mx-2 {\n margin-left: 0.5rem !important;\n margin-right: 0.5rem !important;\n}\n.my-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n.mx-1 {\n margin-left: 0.25rem !important;\n margin-right: 0.25rem !important;\n}\n.mt-0\\.5 {\n margin-top: 0.125rem !important;\n}\n.mt-0 {\n margin-top: 0px !important;\n}\n.ml-6 {\n margin-left: 1.5rem !important;\n}\n.ml-2 {\n margin-left: 0.5rem !important;\n}\n.mt-3 {\n margin-top: 0.75rem !important;\n}\n.-mt-0\\.5 {\n margin-top: -0.125rem !important;\n}\n.-mt-0 {\n margin-top: -0px !important;\n}\n.mr-1 {\n margin-right: 0.25rem !important;\n}\n.block {\n display: block !important;\n}\n.flex {\n display: flex !important;\n}\n.table {\n display: table !important;\n}\n.grid {\n display: grid !important;\n}\n.contents {\n display: contents !important;\n}\n.hidden {\n display: none !important;\n}\n.h-\\[30px\\] {\n height: 30px !important;\n}\n.h-full {\n height: 100% !important;\n}\n.h-\\[35px\\] {\n height: 35px !important;\n}\n.h-6 {\n height: 1.5rem !important;\n}\n.w-full {\n width: 100% !important;\n}\n.w-20 {\n width: 5rem !important;\n}\n.w-16 {\n width: 4rem !important;\n}\n.w-2 {\n width: 0.5rem !important;\n}\n.shrink-0 {\n flex-shrink: 0 !important;\n}\n.grow {\n flex-grow: 1 !important;\n}\n.-rotate-90 {\n --tw-rotate: -90deg !important;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;\n}\n.rotate-90 {\n --tw-rotate: 90deg !important;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;\n}\n.cursor-pointer {\n cursor: pointer !important;\n}\n.cursor-default {\n cursor: default !important;\n}\n.select-none {\n -webkit-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n}\n.select-text {\n -webkit-user-select: text !important;\n -moz-user-select: text !important;\n -ms-user-select: text !important;\n user-select: text !important;\n}\n.grid-flow-col {\n grid-auto-flow: column !important;\n}\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n}\n.grid-cols-\\[minmax\\(max-content\\2c auto\\)_repeat\\(2\\2c min-content\\)\\] {\n grid-template-columns: minmax(-webkit-max-content,auto) repeat(2,-webkit-min-content) !important;\n grid-template-columns: minmax(max-content,auto) repeat(2,min-content) !important;\n}\n.grid-cols-\\[minmax\\(min-content\\2c max-content\\)_minmax\\(max-content\\2c auto\\)_minmax\\(min-content\\2c max-content\\)\\] {\n grid-template-columns: minmax(-webkit-min-content,-webkit-max-content) minmax(-webkit-max-content,auto) minmax(-webkit-min-content,-webkit-max-content) !important;\n grid-template-columns: minmax(min-content,max-content) minmax(max-content,auto) minmax(min-content,max-content) !important;\n}\n.grid-cols-\\[minmax\\(max-content\\2c auto\\)_minmax\\(max-content\\2c auto\\)\\] {\n grid-template-columns: minmax(-webkit-max-content,auto) minmax(-webkit-max-content,auto) !important;\n grid-template-columns: minmax(max-content,auto) minmax(max-content,auto) !important;\n}\n.flex-col {\n flex-direction: column !important;\n}\n.flex-wrap {\n flex-wrap: wrap !important;\n}\n.place-content-center {\n place-content: center !important;\n}\n.place-items-center {\n place-items: center !important;\n}\n.content-start {\n align-content: flex-start !important;\n}\n.items-start {\n align-items: flex-start !important;\n}\n.items-center {\n align-items: center !important;\n}\n.items-stretch {\n align-items: stretch !important;\n}\n.justify-end {\n justify-content: flex-end !important;\n}\n.justify-between {\n justify-content: space-between !important;\n}\n.gap-y-2 {\n row-gap: 0.5rem !important;\n}\n.space-x-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-x-reverse: 0 !important;\n margin-right: calc(0.5rem * var(--tw-space-x-reverse)) !important;\n margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse))) !important;\n}\n.divide-x > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-x-reverse: 0 !important;\n border-right-width: calc(1px * var(--tw-divide-x-reverse)) !important;\n border-left-width: calc(1px * calc(1 - var(--tw-divide-x-reverse))) !important;\n}\n.divide-dashed > :not([hidden]) ~ :not([hidden]) {\n border-style: dashed !important;\n}\n.self-center {\n align-self: center !important;\n}\n.overflow-y-auto {\n overflow-y: auto !important;\n}\n.truncate {\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n}\n.whitespace-nowrap {\n white-space: nowrap !important;\n}\n.rounded {\n border-radius: 0.25rem !important;\n}\n.rounded-md {\n border-radius: 0.375rem !important;\n}\n.rounded-full {\n border-radius: 9999px !important;\n}\n.border {\n border-width: 1px !important;\n}\n.border-0 {\n border-width: 0px !important;\n}\n.border-b {\n border-bottom-width: 1px !important;\n}\n.border-r {\n border-right-width: 1px !important;\n}\n.border-l {\n border-left-width: 1px !important;\n}\n.border-t {\n border-top-width: 1px !important;\n}\n.border-gray-100 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(243 244 246 / var(--tw-border-opacity)) !important;\n}\n.border-transparent {\n border-color: transparent !important;\n}\n.bg-slate-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.bg-white {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity)) !important;\n}\n.bg-blue-600 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity)) !important;\n}\n.bg-slate-50 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity)) !important;\n}\n.bg-slate-200 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(226 232 240 / var(--tw-bg-opacity)) !important;\n}\n.p-2 {\n padding: 0.5rem !important;\n}\n.p-4 {\n padding: 1rem !important;\n}\n.p-1 {\n padding: 0.25rem !important;\n}\n.p-3 {\n padding: 0.75rem !important;\n}\n.px-2 {\n padding-left: 0.5rem !important;\n padding-right: 0.5rem !important;\n}\n.py-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n.py-0\\.5 {\n padding-top: 0.125rem !important;\n padding-bottom: 0.125rem !important;\n}\n.py-0 {\n padding-top: 0px !important;\n padding-bottom: 0px !important;\n}\n.py-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n.px-4 {\n padding-left: 1rem !important;\n padding-right: 1rem !important;\n}\n.px-1 {\n padding-left: 0.25rem !important;\n padding-right: 0.25rem !important;\n}\n.px-3 {\n padding-left: 0.75rem !important;\n padding-right: 0.75rem !important;\n}\n.pl-2 {\n padding-left: 0.5rem !important;\n}\n.pl-9 {\n padding-left: 2.25rem !important;\n}\n.pr-3 {\n padding-right: 0.75rem !important;\n}\n.pb-3 {\n padding-bottom: 0.75rem !important;\n}\n.pt-2 {\n padding-top: 0.5rem !important;\n}\n.pl-4 {\n padding-left: 1rem !important;\n}\n.align-middle {\n vertical-align: middle !important;\n}\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;\n}\n.text-xs {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.text-sm {\n font-size: 0.875rem !important;\n line-height: 1.25rem !important;\n}\n.font-semibold {\n font-weight: 600 !important;\n}\n.font-bold {\n font-weight: 700 !important;\n}\n.text-gray-400 {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.text-gray-600 {\n --tw-text-opacity: 1 !important;\n color: rgb(75 85 99 / var(--tw-text-opacity)) !important;\n}\n.text-slate-900 {\n --tw-text-opacity: 1 !important;\n color: rgb(15 23 42 / var(--tw-text-opacity)) !important;\n}\n.text-slate-500 {\n --tw-text-opacity: 1 !important;\n color: rgb(100 116 139 / var(--tw-text-opacity)) !important;\n}\n.text-white {\n --tw-text-opacity: 1 !important;\n color: rgb(255 255 255 / var(--tw-text-opacity)) !important;\n}\n.text-slate-400 {\n --tw-text-opacity: 1 !important;\n color: rgb(148 163 184 / var(--tw-text-opacity)) !important;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important;\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;\n}\n.shadow-inner {\n --tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05) !important;\n --tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color) !important;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;\n}\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;\n}\n.transition {\n transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;\n transition-duration: 150ms !important;\n}\n.file\\:mr-2::-webkit-file-upload-button {\n margin-right: 0.5rem !important;\n}\n.file\\:mr-2::file-selector-button {\n margin-right: 0.5rem !important;\n}\n.file\\:cursor-pointer::-webkit-file-upload-button {\n cursor: pointer !important;\n}\n.file\\:cursor-pointer::file-selector-button {\n cursor: pointer !important;\n}\n.file\\:rounded-md::-webkit-file-upload-button {\n border-radius: 0.375rem !important;\n}\n.file\\:rounded-md::file-selector-button {\n border-radius: 0.375rem !important;\n}\n.file\\:border-0::-webkit-file-upload-button {\n border-width: 0px !important;\n}\n.file\\:border-0::file-selector-button {\n border-width: 0px !important;\n}\n.file\\:bg-slate-100::-webkit-file-upload-button {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.file\\:bg-slate-100::file-selector-button {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.file\\:py-1::-webkit-file-upload-button {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n.file\\:py-1::file-selector-button {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n.file\\:px-4::-webkit-file-upload-button {\n padding-left: 1rem !important;\n padding-right: 1rem !important;\n}\n.file\\:px-4::file-selector-button {\n padding-left: 1rem !important;\n padding-right: 1rem !important;\n}\n.file\\:text-xs::-webkit-file-upload-button {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.file\\:text-xs::file-selector-button {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.file\\:font-semibold::-webkit-file-upload-button {\n font-weight: 600 !important;\n}\n.file\\:font-semibold::file-selector-button {\n font-weight: 600 !important;\n}\n.file\\:text-slate-900::-webkit-file-upload-button {\n --tw-text-opacity: 1 !important;\n color: rgb(15 23 42 / var(--tw-text-opacity)) !important;\n}\n.file\\:text-slate-900::file-selector-button {\n --tw-text-opacity: 1 !important;\n color: rgb(15 23 42 / var(--tw-text-opacity)) !important;\n}\n.file\\:transition::-webkit-file-upload-button {\n -webkit-transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;\n transition-duration: 150ms !important;\n}\n.file\\:transition::file-selector-button {\n transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;\n transition-duration: 150ms !important;\n}\n.placeholder\\:text-xs::-moz-placeholder {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.placeholder\\:text-xs:-ms-input-placeholder {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.placeholder\\:text-xs::placeholder {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.placeholder\\:italic::-moz-placeholder {\n font-style: italic !important;\n}\n.placeholder\\:italic:-ms-input-placeholder {\n font-style: italic !important;\n}\n.placeholder\\:italic::placeholder {\n font-style: italic !important;\n}\n.placeholder\\:text-gray-400::-moz-placeholder {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.placeholder\\:text-gray-400:-ms-input-placeholder {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.placeholder\\:text-gray-400::placeholder {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.first\\:mt-2:first-child {\n margin-top: 0.5rem !important;\n}\n.first\\:pl-2:first-child {\n padding-left: 0.5rem !important;\n}\n.last\\:mb-2:last-child {\n margin-bottom: 0.5rem !important;\n}\n.last\\:pr-2:last-child {\n padding-right: 0.5rem !important;\n}\n.hover\\:bg-slate-300:hover {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(203 213 225 / var(--tw-bg-opacity)) !important;\n}\n.hover\\:bg-slate-100:hover {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.hover\\:bg-blue-500:hover {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity)) !important;\n}\n.hover\\:text-gray-500:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(107 114 128 / var(--tw-text-opacity)) !important;\n}\n.hover\\:text-slate-400:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(148 163 184 / var(--tw-text-opacity)) !important;\n}\n.hover\\:text-black:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(0 0 0 / var(--tw-text-opacity)) !important;\n}\n.hover\\:text-white:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(255 255 255 / var(--tw-text-opacity)) !important;\n}\n.hover\\:file\\:bg-slate-300::-webkit-file-upload-button:hover {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(203 213 225 / var(--tw-bg-opacity)) !important;\n}\n.hover\\:file\\:bg-slate-300::file-selector-button:hover {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(203 213 225 / var(--tw-bg-opacity)) !important;\n}\n.focus\\:border-gray-200:focus {\n --tw-border-opacity: 1 !important;\n border-color: rgb(229 231 235 / var(--tw-border-opacity)) !important;\n}\n.focus\\:outline-none:focus {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n}\n.active\\:text-slate-800:active {\n --tw-text-opacity: 1 !important;\n color: rgb(30 41 59 / var(--tw-text-opacity)) !important;\n}\n.active\\:text-slate-500:active {\n --tw-text-opacity: 1 !important;\n color: rgb(100 116 139 / var(--tw-text-opacity)) !important;\n}\n.group:hover .group-hover\\:cursor-pointer {\n cursor: pointer !important;\n}\n.group:hover .group-hover\\:bg-slate-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.group:hover .group-hover\\:bg-blue-600 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity)) !important;\n}\n.group:hover .group-hover\\:text-white {\n --tw-text-opacity: 1 !important;\n color: rgb(255 255 255 / var(--tw-text-opacity)) !important;\n}\n.group:active .group-active\\:bg-blue-700 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(29 78 216 / var(--tw-bg-opacity)) !important;\n}',""]);const b=u},94748:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII="},4768:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAL0lEQVQoz2NgCD3x//9/BhBYBWdhgFVAiVW4JBFKGIa4AqD0//9D3pt4I4tAdAMAHTQ/j5Zom30AAAAASUVORK5CYII="},35555:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAz0lEQVRIx2NgYGBY/R8I/vx5eelX3n82IJ9FxGf6tksvf/8FiTMQAcAGQMDvSwu09abffY8QYSAScNk45G198eX//yev73/4///701eh//kZSARckrNBRvz//+8+6ZohwCzjGNjdgQxkAg7B9WADeBjIBqtJCbhRA0YNoIkBSNmaPEMoNmA0FkYNoFKhapJ6FGyAH3nauaSmPfwI0v/3OukVi0CIZ+F25KrtYcx/CTIy0e+rC7R1Z4KMICVTQQ14feVXIbR695u14+Ir4gwAAD49E54wc1kWAAAAAElFTkSuQmCC"},23601:e=>{e.exports="data:image/svg+xml,%3csvg viewBox=%270 0 16 16%27 fill=%27white%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3ccircle cx=%278%27 cy=%278%27 r=%273%27/%3e%3c/svg%3e"},133:e=>{e.exports="data:image/svg+xml,%3csvg viewBox=%270 0 16 16%27 fill=%27white%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3cpath d=%27M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z%27/%3e%3c/svg%3e"},1686:e=>{e.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 16 16%27%3e%3cpath stroke=%27white%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%272%27 d=%27M4 8h8%27/%3e%3c/svg%3e"},70909:e=>{e.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 20 20%27%3e%3cpath stroke=%27%236b7280%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%271.5%27 d=%27M6 8l4 4 4-4%27/%3e%3c/svg%3e"},6161:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjNDI0MjQyIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},51096:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjQzVDNUM1Ii8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="}},o={};function s(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={id:e,loaded:!1,exports:{}};return r[e](n,n.exports,s),n.loaded=!0,n.exports}s.m=r,s.amdO={},e=[],s.O=(t,n,r,o)=>{if(!n){var i=1/0;for(d=0;d=o)&&Object.keys(s.O).every((e=>s.O[e](n[l])))?n.splice(l--,1):(a=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},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.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>e+".bundle.js",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),t={},n="sterling-ts:",s.l=(e,r,o,i)=>{if(t[e])t[e].push(r);else{var a,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),d=0;d{a.onerror=a.onload=null,clearTimeout(u);var o=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(r))),n)return n(r)},u=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.p="./",(()=>{s.b=document.baseURI||self.location.href;var e={179:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var i=s.p+s.u(t),a=new Error;s.l(i,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,r[1](a)}}),"chunk-"+t,t)}},s.O.j=t=>0===e[t];var t=(t,n)=>{var r,o,[i,a,l]=n,c=0;if(i.some((t=>0!==e[t]))){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);if(l)var d=l(s)}for(t&&t(n);cs(52780)));i=s.O(i)})(); \ No newline at end of file +(()=>{"use strict";var e,t,n,r={5827:(e,t,n)=>{var r=n(85893),o=(n(54848),n(49203),n(31906),n(67294)),s=n(73935),i=n(39704),a=n(57247),l=n(105),c=n(68527),d=n(78654),h=n(35173);const p=()=>{const e=(0,l.mq)("DragBar");return(0,r.jsx)(c.xu,{__css:e})},u=()=>{const e=(0,l.mq)("DragHandle");return(0,r.jsx)(c.xu,Object.assign({className:"drag-handle",__css:e},{children:(0,r.jsx)(p,{})}))},m=e=>{const{children:t,rightPaneCollapsed:n,rightPaneInitialWidth:s,rightPaneMinWidth:i,rightPaneMaxWidth:a}=e,p=(0,o.useRef)(null),m=(0,l.mq)("Dashboard"),[g,x]=(0,o.useState)(0),[b,y]=(0,o.useState)(!1),[w,v]=(0,o.useState)(s),j=(0,o.useMemo)((()=>n?0:w),[n,w]),A=(0,o.useMemo)((()=>n?-w:0),[n,w]),M=(0,o.useMemo)((()=>f(void 0,0,j,b)),[0,j,!1,b]),k=(0,o.useMemo)((()=>f(w,void 0,A,b)),[w,A,b]),C=(0,o.useMemo)((()=>f(void 0,void 0,A+w,b)),[A,w,b]),O=(0,o.useCallback)(((e,t)=>{const n=t.target.getBoundingClientRect(),r=t.clientX-n.left;"right"===e&&(x(r),y(!0))}),[y]),S=(0,o.useCallback)((0,d.Z)((e=>{var t;if(b){const n=p.current;if(n){null===(t=window.getSelection())||void 0===t||t.empty();const r=n.getBoundingClientRect().width-e.clientX+g-5;v((0,h.Z)(r,i,a))}}}),16),[g,b,i,a]),I=(0,o.useCallback)((()=>{y(!1)}),[y]);(0,o.useEffect)((()=>(document.addEventListener("mousemove",S),document.addEventListener("mouseup",I),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",I)})),[S,I]);const N=o.Children.toArray(t).filter((e=>e));return 2===N.length?(0,r.jsxs)(c.xu,Object.assign({ref:p,__css:m},{children:[(0,r.jsx)("div",Object.assign({style:M},{children:N[0]})),(0,r.jsx)("div",Object.assign({style:k},{children:N[1]})),(0,r.jsx)("div",Object.assign({style:C,onMouseDown:e=>O("right",e)},{children:(0,r.jsx)(u,{})}))]})):null},g={baseStyle:{position:"fixed",top:"35px",right:"30px",bottom:"20px",left:"0"}};function f(e,t,n,r){const o={position:"absolute",top:"0",bottom:"0",transition:r?void 0:"all 200ms cubic-bezier(0.85, 0, 0.15, 1)"};return void 0!==e&&(o.width=`${e}px`),void 0!==t&&(o.left=`${t}px`),void 0!==n&&(o.right=`${n}px`),o}const x=(0,l.Gp)(((e,t)=>{const n=(0,l.mq)("Pane");return(0,r.jsx)(c.xu,Object.assign({__css:n,ref:t},e))})),b=e=>{const t=(0,l.mq)("LogList",e);return(0,r.jsx)(c.rj,Object.assign({__css:t},e))};const y=e=>{const{variant:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const t=(0,l.mq)("Logo");return(0,r.jsx)(c.M5,Object.assign({__css:t},e,{children:"Sterling"}))},v=e=>{const t=(0,l.mq)("NavBar");return(0,r.jsx)(c.kC,Object.assign({__css:t},e))},j={baseStyle:{h:"35px",position:"fixed",top:0,left:0,right:0,display:"flex",alignItems:"stretch",p:2,bg:"gray.600"}};var A=n(68921);const M=e=>{const t=(0,l.mq)("NavButton");return(0,r.jsx)(A.zx,Object.assign({__css:t},e))},k=e=>{const t=(0,l.mq)("PaneBody");return(0,r.jsx)(c.xu,Object.assign({__css:t},e))},C=e=>{const t=(0,l.mq)("PaneHeader");return(0,r.jsx)(c.xu,Object.assign({__css:t},e))},O=e=>{const t=(0,l.mq)("PaneTitle");return(0,r.jsx)(c.M5,Object.assign({__css:t},e))},S=e=>{const t=(0,l.mq)("SideBar");return(0,r.jsx)(c.kC,Object.assign({__css:Object.assign(Object.assign({},t),{overflowY:"auto"})},e))},I={baseStyle:{w:"30px",position:"fixed",top:"35px",right:0,bottom:"20px",display:"flex",flexDir:"column",alignItems:"stretch",fontSize:"xs",borderLeft:"1px",borderColor:"gray.300",bg:"gray.100"}};const N=e=>{const{text:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const t=(0,l.mq)("StatusBar");return(0,r.jsx)(c.kC,Object.assign({__css:t},e))},D={baseStyle:{h:"20px",position:"fixed",right:0,bottom:0,left:0,display:"flex",alignItems:"center",px:2,fontSize:"xs",borderTop:"1px",borderColor:"gray.300",bg:"gray.100"}},_=(0,a.B1C)({fonts:{body:"InterVariable",mono:"Fira Code VF, Fira Code, monospace"},styles:{global:{"html, body, #root":{w:"full",h:"full",overflow:"hidden",userSelect:"none",cursor:"default"}}},components:{Dashboard:g,DragBar:{baseStyle:{w:"1px",h:"full",transition:"all ease 0.25s",backgroundColor:"gray.300",".drag-handle:hover &":{backgroundColor:"gray.500"}}},DragHandle:{baseStyle:{w:"10px",h:"full",mx:"-5px",px:"5px",cursor:"col-resize",boxSizing:"border-box",backgroundColor:"transparent"}},Logo:{baseStyle:{p:1,fontWeight:"bold",fontSize:"sm",letterSpacing:"wide",color:"gray.50",lineHeight:"0"}},LogList:{baseStyle:{display:"grid",backgroundColor:"gray.50",gridTemplateColumns:"fit-content(300px) 1fr",gridColumnGap:"0.35rem",gridAutoRows:"min-content",userSelect:"text"}},LogText:{baseStyle:{fontFamily:"mono",fontSize:"xs"},variants:{message:{color:"gray.900"},warning:{color:"yellow.400",fontWeight:"semibold"},error:{color:"red.500",fontWeight:"semibold"},timestamp:{display:"flex",alignItems:"center",color:"gray.500"}},defaultProps:{variant:"message"}},NavBar:j,NavButton:{baseStyle:{display:"flex",alignItems:"center",borderRadius:"sm",px:4,lineHeight:1.2,fontSize:"xs",fontWeight:"semibold",color:"gray.200",transitionProperty:"common",transitionDuration:"normal",_hover:{bg:"gray.100",color:"initial",_disabled:{bg:"initial"}},_active:{bg:"gray.200",color:"initial"},_disabled:{opacity:.4,cursor:"not-allowed"}}},Pane:{baseStyle:{position:"absolute",top:0,right:0,bottom:0,left:0}},PaneBody:{baseStyle:{position:"absolute",top:"35px",right:0,bottom:0,left:0}},PaneHeader:{baseStyle:{position:"absolute",top:0,left:0,right:0,height:"35px",bg:"gray.100",display:"flex",alignItems:"center"}},PaneTitle:{baseStyle:{fontSize:"xs",fontWeight:"semibold",color:"gray.800"}},SideBar:I,SideBarButton:{baseStyle:{display:"flex",cursor:"pointer",alignItems:"center",justifyContent:"center",py:3,fontSize:"xs",fontWeight:"normal",transitionProperty:"common",transitionDuration:"normal",writingMode:"vertical-lr",textOrientation:"sideways",iconSpacing:"0.35rem",span:{marginRight:".12rem"},_hover:{bg:"gray.200",_disabled:{bg:"initial"}},_active:{bg:"gray.300"}}},StatusBar:D,View:{baseStyle:{w:"full",h:"full"}}}});var T=n(59876),E=n(11384);const L=e=>{const{text:t,variant:n,time:o}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(y,Object.assign({variant:"timestamp",justifySelf:"end"},{children:[o?(0,E.Z)(o,"HH:mm:ss"):"--:--:--",(0,r.jsx)(T.XC,{})]})),(0,r.jsx)(y,Object.assign({variant:n},{children:t}))]})};var P=n(64657);function R(e,t){return e.nodes[t]}function B(e,t){return t?t.map((t=>R(e,t))):(0,P.Z)(e.nodes)}function Z(e,t){return e.edges[t]}function V(e,t){return t?t.map((t=>Z(e,t))):(0,P.Z)(e.edges)}function $(e,t){return`arrow-${e}-[${t}]`}const F=(0,o.memo)((e=>{const{size:t,color:n}=e,o=$(t,n),s=t/2;return(0,r.jsx)("marker",Object.assign({id:o,viewBox:`0 0 ${t} ${t}`,refX:0,refY:s,markerWidth:t,markerHeight:t,markerUnits:"userSpaceOnUse",orient:"auto",fill:n},{children:(0,r.jsx)("path",{d:`M 0 0 L ${t} ${s} L 0 ${t} z`})}))})),G=e=>{const{arrowHeads:t}=e;return(0,r.jsx)("defs",{children:t.map(((e,t)=>(0,r.jsx)(F,Object.assign({},e),t)))})},W=e=>(0,r.jsx)("text",Object.assign({x:e.x,y:e.y,style:e.style},e.props,{children:e.text})),U=e=>{const{label:t,position:n}=e;return t.length!==n.length?null:(0,r.jsx)(r.Fragment,{children:t.map(((e,t)=>{const{x:o,y:s}=n[t];return(0,r.jsx)(W,Object.assign({x:o,y:s},e),t)}))})};var q=n(50236),Y=n(18990),X=n(27470),J=n(75908),H=n(74681),Q=n(85925),K=n(69786),ee=n(67185),te=n(14643);const ne=e=>{const{path:t,curve:n,style:s,onRender:i}=e,a=(0,o.useRef)(null),l=(0,o.useRef)(null),c=(0,o.useMemo)((()=>function(e){const t=(0,q.Z)().x((e=>e.x)).y((e=>e.y));switch(null==e?void 0:e.type){case"bspline":t.curve(Y.ZP);break;case"bundle":t.curve(X.Z.beta(.85));break;case"cardinal":t.curve(J.ZP.tension(0));break;case"catmullrom":t.curve(H.Z.alpha(.5));break;case"line":default:t.curve(Q.Z);break;case"monotonex":t.curve(K.Z);break;case"monotoney":t.curve(K.s);break;case"natural":t.curve(ee.Z);break;case"step":t.curve(te.ZP);break;case"stepafter":t.curve(te.cD);break;case"stepbefore":t.curve(te.RN)}return t}(n)),[n]),d=(0,o.useMemo)((()=>c(t)||""),[c,t]),h=`url(#${$(10,s.stroke)})`;return(0,o.useLayoutEffect)((()=>{const e=a.current,n=l.current;if(e&&n){const r=e.getTotalLength(),o=e.getPointAtLength(r-10);n.setAttribute("d",c([...t.slice(0,-1),o])||"")}i&&a.current&&i(a.current)}),[i,t]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("path",{ref:l,style:s,markerEnd:h}),(0,r.jsx)("path",{ref:a,d,stroke:"transparent",strokeWidth:11,fill:"none"})]})},re=e=>{const{id:t,path:n,curve:s,style:i,labels:a}=e,[l,c]=(0,o.useState)([]),d=(0,o.useCallback)((e=>{a&&c(a.map((t=>function(e,t){const n=t.getTotalLength();if(void 0===e.position)return t.getPointAtLength(n/2);if("number"==typeof e.position){const r=(0,h.Z)(e.position,0,1);return t.getPointAtLength(r*n)}const r=(0,h.Z)(e.position.distance,0,n);return"source"===e.position.from?t.getPointAtLength(r):t.getPointAtLength(n-r)}(t,e))))}),[c,a]);return(0,r.jsxs)("g",Object.assign({id:`${t}`},{children:[(0,r.jsx)(ne,{path:n,curve:s,style:i,onRender:d}),a&&(0,r.jsx)(U,{label:a,position:l})]}))},oe=(0,o.memo)((e=>{const{edges:t}=e;return(0,r.jsx)("g",Object.assign({className:"edges"},{children:t.map((e=>(0,r.jsx)(re,Object.assign({},e),e.id)))}))}));function se(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ie(e){return Math.atan2(-e.y,-e.x)+Math.PI}function ae(e,t){return{x:e.x-t.x,y:e.y-t.y}}function le(e,t,n){return{x:e.x+n*Math.cos(t),y:e.y+n*Math.sin(t)}}var ce=n(5419);const de=(0,o.createContext)({nodeOffset:()=>({x:0,y:0}),onClickNode:()=>{},onMouseDown:()=>{},onMouseDownNode:()=>{},onMouseMove:()=>{},onMouseUp:()=>{},onMouseUpNode:()=>{},onWheel:()=>{},spreadMatrix:(0,ce.yR)(),zoomMatrix:(0,ce.yR)()});var he=n(60953);const pe={x:0,y:0};function ue(e,t,n){const r=t.getScreenCTM();if(r){const o=r.inverse(),s=(0,ce.SO)(n),i=t.createSVGPoint();i.x=e.clientX,i.y=e.clientY;const a=(0,ce.hC)(s,i.matrixTransform(o));return i.x=e.clientX+e.movementX,i.y=e.clientY+e.movementY,ae((0,ce.hC)(s,i.matrixTransform(o)),a)}return{x:0,y:0}}const me=()=>!1;function ge(e){return(0,o.useCallback)(((t,n)=>{let r,o=n.callbacks;switch(n.type){case"clicknode":return r=(0,he.Z)(null==o?void 0:o.onClickNode,me),r(n.nodeId,n.event)?t:function(e,t){return e}(t);case"mousedown":return r=(0,he.Z)(null==o?void 0:o.onMouseDown,me),r(n.event)?t:function(e,t){return Object.assign(Object.assign({},e),{isPanning:!0})}(t);case"mousedownnode":return r=(0,he.Z)(null==o?void 0:o.onMouseDownNode,me),r(n.nodeId,n.event)?t:function(e,t){const{event:n,nodeId:r}=t;return n.preventDefault(),n.stopPropagation(),e.selection.push(r),e.isDragging=!0,e}(t,n);case"mousemove":return r=(0,he.Z)(null==o?void 0:o.onMouseMove,me),r(n.event)?t:function(e,t,n){if(n){if(e.isDragging)return function(e,t,n){const r=e.selection,o=Object.assign({},e.offsets),s=ue(t.event,n,e.zoomMatrix);return r.forEach((e=>{const t=o[e]||pe;o[e]=se(t,s)})),Object.assign(Object.assign({},e),{offsets:o})}(e,t,n);if(e.isPanning)return function(e,t,n){const r=ue(t.event,n,e.zoomMatrix),o=(0,ce.vs)([e.zoomMatrix,(0,ce.Iu)(r.x,r.y)]);return Object.assign(Object.assign({},e),{zoomMatrix:o})}(e,t,n)}return e}(t,n,e);case"mouseup":return r=(0,he.Z)(null==o?void 0:o.onMouseUp,me),r(n.event)?t:function(e,t){return Object.assign(Object.assign({},e),{isDragging:!1,isPanning:!1,offsets:{},selection:[]})}(t);case"mouseupnode":return r=(0,he.Z)(null==o?void 0:o.onMouseUpNode,me),r(n.nodeId,n.event)?t:(r=(0,he.Z)(null==o?void 0:o.onSelectionMoved,me),r(t.offsets)?t:function(e,t){const{event:n}=t;return n.preventDefault(),n.stopPropagation(),e.isDragging=!1,e.isPanning=!1,e.offsets={},e.selection=[],e}(t,n));case"wheel":if(r=(0,he.Z)(null==o?void 0:o.onWheel,me),r(n.event))return t;const s=t.spreadMatrix,i=t.zoomMatrix,a=function(e,t,n){const r=t.event,o=function(e){const t=e.shiftKey?e.deltaX:e.deltaY;return 0===t?0:t<0?1.055:.9478672985781991}(r);return n&&0!==o&&!r.ctrlKey?r.shiftKey?function(e,t,n,r){const o=r.getScreenCTM();if(o){const s=r.createSVGPoint();s.x=t.clientX,s.y=t.clientY;const i=s.matrixTransform(o.inverse()),{x:a,y:l}=(0,ce.hC)((0,ce.vs)((0,ce.SO)(e.spreadMatrix),(0,ce.SO)(e.zoomMatrix)),i),c=(0,ce.vs)(e.spreadMatrix,(0,ce.bA)(n,n,a,l));return Object.assign(Object.assign({},e),{spreadMatrix:c})}return e}(e,r,o,n):function(e,t,n,r){const o=r.getScreenCTM();if(o){const s=r.createSVGPoint();s.x=t.clientX,s.y=t.clientY;const i=s.matrixTransform(o.inverse()),{x:a,y:l}=(0,ce.hC)((0,ce.SO)(e.zoomMatrix),i),c=(0,ce.vs)(e.zoomMatrix,(0,ce.bA)(n,n,a,l));return Object.assign(Object.assign({},e),{zoomMatrix:c})}return e}(e,r,o,n):e}(t,n,e);return r=(0,he.Z)(null==o?void 0:o.onSpreadChanged,me),s!==a.spreadMatrix&&r(a.spreadMatrix)?t:(r=(0,he.Z)(null==o?void 0:o.onZoomChanged,me),i!==a.zoomMatrix&&r(a.zoomMatrix)?t:a)}return t}),[e])}const fe=e=>{const{svg:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{i(function(e,t){return Object.assign(Object.assign({},e),{callbacks:t})}(e,n))}),[i,n]);return{nodeOffset:(0,o.useCallback)((e=>s.offsets[e]||{x:0,y:0}),[s.offsets]),onClickNode:(0,o.useCallback)(((e,t)=>a(function(e,t){return{type:"clicknode",nodeId:e,event:t}}(e,t))),[a]),onMouseDown:(0,o.useCallback)((e=>a(function(e){return{type:"mousedown",event:e}}(e))),[a]),onMouseDownNode:(0,o.useCallback)(((e,t)=>a(function(e,t){return{type:"mousedownnode",nodeId:e,event:t}}(e,t))),[a]),onMouseMove:(0,o.useCallback)((e=>a(function(e){return{type:"mousemove",event:e}}(e))),[a]),onMouseUp:(0,o.useCallback)((e=>a(function(e){return{type:"mouseup",event:e}}(e))),[a]),onMouseUpNode:(0,o.useCallback)(((e,t)=>a(function(e,t){return{type:"mouseupnode",event:t,nodeId:e}}(e,t))),[a]),onWheel:(0,o.useCallback)((e=>a(function(e){return{type:"wheel",event:e}}(e))),[a]),spreadMatrix:s.spreadMatrix,zoomMatrix:s.zoomMatrix}};const xe=()=>(0,o.useContext)(de),be=e=>{const{children:t,beforeUnmount:n}=e,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o()=>{n&&n(i)}),[n]),(0,r.jsx)(de.Provider,Object.assign({value:i},{children:t}))};const ye=e=>{const{label:t}=e;return(0,r.jsx)(r.Fragment,{children:t.map(((e,t)=>{console.log(`handling node: ${JSON.stringify(e)}`);const{offset:n}=e,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const{shape:t,style:n}=e;return(0,r.jsx)("circle",{r:t.radius,style:n})})),ve=(0,o.memo)((e=>{const{shape:t,style:n}=e;return(0,r.jsx)("rect",{x:-t.width/2,y:-t.height/2,width:t.width,height:t.height,style:n})})),je=(0,o.memo)((e=>{const{shape:t,style:n}=e;switch(t.shape){case"circle":return(0,r.jsx)(we,{shape:t,style:n});case"rectangle":return(0,r.jsx)(ve,{shape:t,style:n})}return null})),Ae=(0,o.memo)((e=>{const{id:t,position:n,shape:s,style:i,labels:a,superscripts:l}=e,{onClickNode:c,onMouseDownNode:d,onMouseUpNode:h,spreadMatrix:p,nodeOffset:u}=xe(),m=u(t),g=(0,o.useMemo)((()=>{const e=se((0,ce.hC)(p,n),m);return`translate(${e.x} ${e.y})`}),[n,m,p]);return(0,r.jsxs)("g",Object.assign({id:t,transform:g,onClick:e=>c(t,e),onMouseDown:e=>d(t,e),onMouseUp:e=>h(t,e)},{children:[(0,r.jsx)(je,{shape:s,style:i}),a&&(0,r.jsx)(ye,{label:a}),l&&(0,r.jsx)(ye,{label:l})]}))})),Me=(0,o.memo)((e=>{const{nodes:t}=e;return(0,r.jsx)("g",Object.assign({className:"nodes"},{children:t.map((e=>(0,r.jsx)(Ae,Object.assign({},e),e.id)))}))}));function ke(e,t){return{a:e,b:t}}function Ce(e,t){const n=e.a,r=e.b,o=t.a,s=t.b,i=((s.x-o.x)*(n.y-o.y)-(s.y-o.y)*(n.x-o.x))/((s.y-o.y)*(r.x-n.x)-(s.x-o.x)*(r.y-n.y));return{x:n.x+i*(r.x-n.x),y:n.y+i*(r.y-n.y)}}function Oe(e,t,n,r){switch(t.shape){case"circle":return function(e,t,n,r){return le(e,ie(n),t+r/2)}(e,t.radius,n,r);case"rectangle":return function(e,t,n,r,o){const s=t+o,i=n+o,a=s/2,l=i/2,c=le(e,ie(r),Math.max(s,i)),d=ke(e,c),h=((p=d).a.y-p.b.y)/(p.a.x-p.b.x);var p;const u=h*a,m=l/h,g={x:e.x+a,y:e.y+l},f={x:e.x-a,y:e.y+l},x={x:e.x+a,y:e.y-l},b={x:e.x-a,y:e.y-l};if(-l<=u&&u<=l){if(e.xc.x)return Ce(ke(f,b),d)}if(-a<=m&&m<=a){if(e.yc.y)return Ce(ke(b,x),d)}return e}(e,t.width,t.height,n,r)}return e}function Se(e){return void 0!==e}const Ie=(0,o.memo)((e=>{const{id:t,graph:n,edgeCurves:s,edgeStyles:i,edgeLabels:a,nodeShapes:l,nodeStyles:c,nodeLabels:d,nodeSuperscripts:h}=e,p=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);oB(n).map((e=>{const t={x:e.x,y:e.y},n=l[e.id],r=c[e.id],o=d?d[e.id]:void 0,s=h?h[e.id]:void 0;return{id:e.id,position:t,shape:n,style:r,labels:o,superscripts:s}}))),[n,l,c,d]),f=(0,o.useMemo)((()=>V(n).map((e=>{const t=R(n,e.source),r=R(n,e.target);if(!t||!r)return;const o=l[t.id],c=l[r.id],d=function(e,t,n,r,o,s,i,a){const l=e.waypoints||[],c=(0,ce.hC)(a,se(t,r)),d=(0,ce.hC)(a,se(o,i)),h=l.map((e=>(0,ce.hC)(a,e))),p=Oe(c,n,ae((0,he.Z)(h[0],d),c),0),u=Oe(d,s,ae((0,he.Z)(h[h.length-1],c),d),0);return[p,...h,u]}(e,t,o,u(t.id),r,c,u(r.id),m),h=s[e.id],p=i[e.id],g=a?a[e.id]:void 0;return{id:e.id,path:d,curve:h,style:p,labels:g}})).filter(Se)),[n,m,s,i,a,u]),x=function(e){const t=new Set,n=[];return e.forEach((e=>{const r=e.stroke,o=$(10,r);t.has(o)||(t.add(o),n.push({size:10,color:r}))})),n}(Object.values(i));return g.length<1&&g.push({id:"0",position:{x:0,y:0},shape:{shape:"rectangle",width:550,height:50},style:{fill:"transparent",stroke:"black"},labels:[{text:"There are no atoms to display (or the current theme has hidden them)",style:{fontSize:12,textAnchor:"middle",fontFamily:"monospace",userSelect:"none"}}]}),(0,r.jsxs)("g",Object.assign({id:t},p,{children:[(0,r.jsx)(G,{arrowHeads:x}),(0,r.jsx)(Me,{nodes:g}),(0,r.jsx)(oe,{edges:f})]}))})),Ne=(e,t)=>{const[n,r]=(0,o.useState)();return(0,o.useLayoutEffect)((()=>{const n=e.current;if(n){r(n.getBoundingClientRect());const e=new ResizeObserver((e=>{e.forEach((e=>{e.target===n&&(t?t(e.contentRect):r(e.contentRect))}))}));return e.observe(n),()=>{e.unobserve(n)}}}),[e.current]),n};var ze=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const{children:n}=e,o=ze(e,["children"]),{onMouseDown:s,onMouseMove:i,onMouseUp:a,onWheel:l,zoomMatrix:c}=xe();return(0,r.jsx)("svg",Object.assign({ref:t,preserveAspectRatio:"xMidYMid slice",onMouseDown:s,onMouseMove:i,onMouseUp:a,onWheel:l},o,{children:(0,r.jsx)("g",Object.assign({transform:(0,ce.BB)(c)},{children:n}))}))})),_e=e=>{const{callbacks:t}=e,n=ze(e,["callbacks"]),s=(0,o.useRef)(null);return(0,r.jsx)(be,Object.assign({svg:s.current},t,{children:(0,r.jsx)(De,Object.assign({ref:s},n))}))};const Te=e=>{const{callbacks:t,children:n}=e,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);onull==a?void 0:a.width),[a]),c=(0,o.useMemo)((()=>null==a?void 0:a.height),[a]),d=(0,o.useMemo)((()=>l&&c?`${-l/2} ${-c/2} ${l} ${c}`:void 0),[l,c]);return(0,r.jsx)("div",Object.assign({ref:i},s,{children:(0,r.jsx)(_e,Object.assign({callbacks:t,viewBox:d},{children:n}))}))},Ee=(0,l.Gp)(((e,t)=>(0,r.jsx)(A.zx,Object.assign({colorScheme:"green",size:"xs",ref:t},e))));var Le=n(98765);const Pe=(0,Le.PH)("sterling/buttonClicked"),Re=(0,Le.PH)("sterling/dataRequested"),Be=(0,Le.PH)("sterling/evalRequested"),Ze=(0,Le.PH)("sterling/metaRequested"),Ve=(0,Le.PH)("sterling/dataReceived"),$e=(0,Le.PH)("sterling/evalReceived"),Fe=(0,Le.PH)("sterling/metaReceived"),Ge=(0,Le.PH)("sterling/connect"),We=(0,Le.PH)("sterling/disconnect"),Ue=(0,Le.PH)("sterling/connected"),qe=(0,Le.PH)("sterling/connectionError"),Ye=(0,Le.PH)("sterling/disconnected"),Xe=(0,Le.PH)("sterling/error");function Je(e){return void 0!==e}function He(e,t){const n={};for(const r of e)n[t(r)]=r;return n}function Qe(e){return e.types[e.types.length-1]}function Ke(e){return e.atoms}function et(e){return void 0!==e.meta&&!0===e.meta.builtin}function tt(e,t,n){return"string"==typeof t&&(t=pt(e,t)),"string"!=typeof n&&(n=n.id),t.types.includes(n)}function nt(e,t){const n=t.getAttribute("label");if(!n)throw new Error("No label attribute in atom element");return{_:"atom",id:n,type:e}}function rt(e,t){return Array.from(t).map((t=>nt(e,t)))}function ot(e,t){if("string"==typeof t&&(t=lt(e,t)),!e.types[t.type])throw new Error(`The atom's type is not part of the instance: ${t.type}`);return e.types[t.type]}function st(e,t){return Array.from(t).map((t=>function(e,t){return{_:"tuple",types:e,atoms:Array.from(t.querySelectorAll("atom")).map(((t,n)=>nt(e[n],t).id))}}(e,t)))}function it(e){return e.tuples}function at(e,t){return Array.from(t).map((t=>function(e,t){const n=t.getAttribute("label");if(!n)throw new Error("No label found for field element");const r=function(e,t){const n=t.querySelectorAll("type");return Array.from(n).map((t=>{const n=t.getAttribute("ID");if(!n)throw new Error("Type element must have an ID attribute");const r=e[n];if(!r)throw new Error(`Type element with ID ${n} not found`);return r}))}(e,t);if(0===r.length)throw new Error("No types found for field element");return{_:"relation",id:`${r[0]}<:${n}`,name:n,types:r,tuples:st(r,t.querySelectorAll("tuple"))}}(e,t)))}function lt(e,t){const n=ct(e).find((e=>e.id===t));if(!n)throw new Error(`Could not find atom with id ${t}`);return n}function ct(e){return ut(e).map(Ke).reduce(((e,t)=>e.concat(t)),[])}function dt(e){return Object.values(e.relations)}function ht(e){return Object.values(e.skolems)}function pt(e,t){const n=e.types[t];if(!n)throw new Error(`Could not find type with id ${t}`);return n}function ut(e){return Object.values(e.types)}function mt(e){const t=e.getAttribute("bitwidth");if(!t)throw new Error("No bitwidth found in instance");const n=function(e){const t={},n=e.querySelectorAll("sig");for(const e of n){const n=e.getAttribute("ID"),r=e.getAttribute("label");if(!n)throw new Error("No ID found for sig element");if(!r)throw new Error("No label found for sig element");t[n]=r}return t}(e),r=function(e,t){const n={},r=t.querySelectorAll("sig");for(const e of r)if(!yt(e)){const t=e.getAttribute("ID"),r=e.getAttribute("parentID"),o=e.getAttribute("label");if(!t)throw new Error("No ID found for sig element");if(!o)throw new Error("No label found for sig element");r&&(n[t]=r)}const o=(t,r)=>n[t]?o(n[t],[...r,e[t]]):r,s={};for(const t in e)s[e[t]]=o(t,[]);return s}(n,e),o=function(e,t){return Array.from(t).filter((e=>!yt(e))).map((t=>function(e,t){const n=t.getAttribute("label");if(!n)throw new Error("No label attribute in sig element");const r=e[n];if(!r)throw console.log(e),new Error(`No type hierarchy for ${n}`);const o=function(e){const t={};return"yes"===e.getAttribute("abstract")&&(t.abstract=!0),"yes"===e.getAttribute("builtin")&&(t.builtin=!0),"yes"===e.getAttribute("enum")&&(t.enum=!0),"yes"===e.getAttribute("meta")&&(t.meta=!0),"yes"===e.getAttribute("one")&&(t.one=!0),"yes"===e.getAttribute("private")&&(t.private=!0),0===Object.keys(t).length?void 0:t}(t),s={_:"type",id:n,types:r,atoms:rt(n,t.querySelectorAll("atom")),meta:void 0};return Je(o)&&(s.meta=o),s}(e,t)))}(r,e.querySelectorAll("sig")),s=at(n,e.querySelectorAll("field")),i=at(n,e.querySelectorAll("skolem"));return function(e,t){const n=t.find((e=>"Int"===e.id));if(!n)throw new Error("Could not find Int type");n.atoms=function(e){const t=[],n=Math.pow(2,e);for(let e=-n/2;ee.id)),relations:He(s,(e=>e.id)),skolems:He(i,(e=>e.id))}}function gt(e){var t;const n=(new DOMParser).parseFromString(e,"application/xml"),r=Array.from(n.querySelectorAll("instance"));if(!r.length)throw new Error(`No Alloy instance in XML: ${e}`);const o=n.querySelector("visualizer"),s=null===o?void 0:xt(o,"script"),i=null===o?void 0:xt(o,"theme");return{instances:r.map(mt),bitwidth:ft(r[0],"bitwidth"),command:xt(r[0],"command"),loopBack:null!==(t=ft(r[0],"backloop"))&&void 0!==t?t:ft(r[0],"loop"),maxSeq:ft(r[0],"maxseq"),maxTrace:ft(r[0],"maxtrace"),minTrace:ft(r[0],"mintrace"),traceLength:ft(r[0],"tracelength"),visualizerConfig:{script:bt(s),theme:bt(i)}}}function ft(e,t){const n=e.getAttribute(t);return n?+n:void 0}function xt(e,t){const n=e.getAttribute(t);return n?`${n}`:void 0}function bt(e){return null==e?void 0:e.replaceAll(""",'"').replaceAll('\\"','"').replaceAll(">",">").replaceAll("<","<")}function yt(e){return e.querySelectorAll("type").length>0}function wt(e){return"alloy"===e.format}function vt(e){return Object.assign(Object.assign({},e),{parsed:gt(e.data)})}function jt(e,t){const n=function(e){return JSON.parse(e)}(e);!function(e){return"data"===e.type&&void 0!==e.payload}(n)?function(e){return"eval"===e.type&&void 0!==e.payload}(n)?t.dispatch($e(n.payload)):function(e){return"meta"===e.type&&void 0!==e.payload}(n)&&t.dispatch(Fe(n.payload)):t.dispatch(Ve(function(e,t){const{enter:n,update:r,exit:o}=e,s=function(e,t){const n=[];return e&&e.forEach((e=>{!function(e){const t=e.format;return"alloy"===t||"raw"===t}(e)?t.dispatch(Xe(`Unsupported data format in datum ${e.id}: ${e.format}`)):(e.id=`${e.id}`,n.push(e))})),n}(n,t);return{enter:s.map((e=>{switch(e.format){case"alloy":return vt(e);case"raw":return function(e){return Object.assign(Object.assign({},e),{parsed:e.data})}(e);default:throw new Error("Unsupported format fell through unexpectedly.")}})),update:r,exit:o}}(n.payload,t)))}function At(e){e.dispatch(Xe("Not connected to a provider."))}function Mt(e,t){e.send(JSON.stringify(t))}const kt=()=>(0,i.I0)(),Ct=i.v9;var Ot=n(18172);function St(e,t){return t in e.edges}function It(e,t){return t in e.nodes}var Nt=n(29428);function zt(e,t){return t=t||[],function(e,t){return(0,Ot.Uy)(e,(e=>{t.forEach((t=>function(e,t){const{id:n,source:r,target:o}=t;if(n&&(s=e,i=[r,o],(0,Nt.Z)(i,(e=>It(s,e))))&&!St(e,n))e.edges[n]=t,function(e,t,n,r){e.predecessors.hasOwnProperty(n)||(e.predecessors[n]={}),e.predecessors[n].hasOwnProperty(t)||(e.predecessors[n][t]=[]),e.predecessors[n][t].push(r)}(e,r,o,n),function(e,t,n,r){e.successors.hasOwnProperty(t)||(e.successors[t]={}),e.successors[t].hasOwnProperty(n)||(e.successors[t][n]=[]),e.successors[t][n].push(r)}(e,r,o,n),function(e,t,n){e.inedges[t].push(n)}(e,o,n),function(e,t,n){e.outedges[t].push(n)}(e,r,n);else{if(!n)throw new Error("Cannot add an edge without an edge ID");if(!It(e,r))throw new Error(`Cannot add edge ${n}, the source node ${r} is not in the graph`);if(!It(e,o))throw new Error(`Cannot add edge ${n}, the target node ${o} is not in the graph`);if(St(e,n))throw new Error(`Cannot add edge, an edge with ID ${n} already exists in the graph`)}var s,i}(e,(0,Ot.cA)(t))))}))}(function(e,t){return(0,Ot.Uy)(e,(e=>{t.forEach((t=>function(e,t){const{id:n}=t;if(n&&!It(e,n))e.nodes[n]=t,e.predecessors[n]={},e.successors[n]={},e.inedges[n]=[],e.outedges[n]=[];else{if(!n)throw new Error("Cannot add a node without a node ID");if(It(e,n))throw new Error(`Cannot add node, a node with ID ${n} already exists in the graph`)}}(e,(0,Ot.cA)(t))))}))}({nodes:{},edges:{},predecessors:{},successors:{},inedges:{},outedges:{}},e=e||[]),t)}function Dt(e,t){const n=e.edges;return!!n&&n.some((e=>{var n;return!0===e.asAttribute&&(null===(n=e.targets)||void 0===n?void 0:n.some((e=>"*"===e||e.relation===t)))}))}function _t(e,t,n){if(n<2)return[0,0];if(!e)return[0,n-1];const r=e.edges;if(!r)return[0,n-1];const o=r.find((e=>{var n;return(e.sourceIndex||e.targetIndex)&&(null===(n=e.targets)||void 0===n?void 0:n.some((e=>"*"===e||e.relation===t)))}));return o?[o.sourceIndex?o.sourceIndex:0,o.targetIndex?o.targetIndex:n-1]:[0,n-1]}var Tt=n(11022),Et=n(935);function Lt(e){return e.id}function Pt(e,t){return`${e.id}:${t.atoms.join("->")}`}function Rt(e,t){var n,r;const o=(null===(n=null==t?void 0:t.hidden)||void 0===n?void 0:n.disconnected)||!1,s=o||(null===(r=null==t?void 0:t.hidden)||void 0===r?void 0:r.builtinDisconnected)||!1,{nodeIds:i,edgeIds:a}=function(e,t,n,r){const o=new Set,s=new Set;return dt(e).forEach((t=>{it(t).forEach((n=>{const i=n.atoms.map((t=>lt(e,t))),[a,l]=function(e,t,n){if(n){const[r,o]=_t(n,e.id,t.length);return[r?t[r]:(0,Tt.Z)(t),o?t[o]:(0,Et.Z)(t)]}return[(0,Tt.Z)(t),(0,Et.Z)(t)]}(t,i,r);a&&l&&(o.add(Lt(a)),o.add(Lt(l)),s.add(Pt(t,n)))}))})),ct(e).forEach((r=>{const s=Lt(r);o.has(s)||t||function(e,t){return"string"==typeof t&&(t=lt(e,t)),ot(e,t).types.map((t=>pt(e,t))).some(et)}(e,r)&&n||o.add(s)})),{nodeIds:o,edgeIds:s}}(e,o,s,t),l=[];ct(e).forEach((e=>{const t=Lt(e);i.has(t)&&l.push({id:t,atom:e})}));const c=[];return dt(e).forEach((n=>{t&&Dt(t,n.id)||it(n).forEach((r=>{const o=Pt(n,r),s=r.atoms,[i,l]=_t(t,n.id,s.length),d=i?s[i]:(0,Tt.Z)(s),h=l?s[l]:(0,Et.Z)(s);d&&h&&a.has(o)&&c.push({id:o,source:Lt(lt(e,d)),target:Lt(lt(e,h)),relation:n,tuple:r})}))})),zt(l,c)}var Bt=n(79432),Zt=n(27961);function Vt(e,t){const n={"*":(r=[t],(0,Zt.Z)(r.map((e=>e.edges?e.edges.filter((e=>e.targets&&e.targets.some((e=>"*"===e)))):[]))))};var r;return dt(e).forEach((e=>{n[e.id]=function(e,t){return(0,Zt.Z)(t.map((t=>t.edges?t.edges.filter((t=>t.targets&&t.targets.some((t=>"*"!==t&&t.relation===e)))):[])))}(e.id,[t])})),n}function $t(e,t){const n={"*":(r=[t],(0,Zt.Z)(r.map((e=>e.nodes?e.nodes.filter((e=>e.targets&&e.targets.some((e=>"*"===e)))):[]))))};var r;return ut(e).forEach((e=>{n[e.id]=function(e,t){return(0,Zt.Z)(t.map((t=>t.nodes?t.nodes.filter((t=>t.targets&&t.targets.some((t=>"*"!==t&&t.type===e)))):[])))}(e.id,[t])})),n}function Ft(e,t,n,r){const o={},s={},i={},a={},l={},c={},d={},h=$t(t,r),p=Vt(t,r),u={};dt(t).forEach((e=>{Dt(r,e.id)&&it(e).forEach((t=>{const n=t.atoms;if(n.length>1){const t=n[0];u[t]||(u[t]=[]),u[t].push(`${e.name}: ${n.slice(1).join(", ")}`)}}))})),ht(t).forEach((e=>{it(e).forEach((t=>{const n=t.atoms[0];u[n]||(u[n]=[]),u[n].push(`${e.name}`)}))})),B(n).forEach((e=>{i[e.id]=[{text:e.atom.id,props:{},style:{}}];const n=pt(t,e.atom.type);a[e.id]=[{text:n.types[0],props:{dy:"-1em"},style:{textAnchor:"middle",fontSize:"14px",fontStyle:"italic"}}],u[e.id]&&i[e.id].push(...u[e.id].map((e=>({text:e,props:{},style:{}})))),s[e.id]={}}));const m=e=>{if(e.tuple.atoms.length>2){const[t,n]=_t(r,e.relation.id,e.tuple.atoms.length),o=e.tuple.atoms.slice();return o.splice(t,1),o.splice(n-1,1),e.relation.name+`[${o.join(", ")}]`}return e.relation.name};return V(n).forEach((e=>{d[e.id]=[{text:m(e),props:{},style:{}}],c[e.id]={}})),B(n).forEach((e=>{const{id:n,atom:r}=e;["*","univ",...ot(t,r).types.slice().reverse()].forEach((e=>{var t;null===(t=h[e])||void 0===t||t.forEach((e=>{var t;e.shape&&(o[n]=e.shape),(0,Bt.Z)(s[n],null===(t=e.styles)||void 0===t?void 0:t.node),i[n].forEach((t=>{var n,r;(0,Bt.Z)(t.props,null===(n=e.props)||void 0===n?void 0:n.label),(0,Bt.Z)(t.style,null===(r=e.styles)||void 0===r?void 0:r.label)})),Gt(i[n])}))}))})),V(n).forEach((e=>{const{id:t,relation:n,tuple:r}=e;["*",n.id].forEach((e=>{var n;null===(n=p[e])||void 0===n||n.forEach((e=>{var n;e.curve&&(l[t]=e.curve),(0,Bt.Z)(c[t],null===(n=e.styles)||void 0===n?void 0:n.edge),d[t].forEach((t=>{var n,r;(0,Bt.Z)(t.props,null===(n=e.props)||void 0===n?void 0:n.label),(0,Bt.Z)(t.style,null===(r=e.styles)||void 0===r?void 0:r.label)})),Gt(d[t])}))}))})),{id:e,graph:n,nodeShapes:o,nodeStyles:s,nodeLabels:i,nodeSuperscripts:a,edgeCurves:l,edgeLabels:d,edgeStyles:c}}function Gt(e){const t=e.length-1;e.forEach(((e,n)=>{e.props||(e.props={}),e.props.dy=n-t/2+.33+"em"}))}var Wt=n(70681),Ut=n.n(Wt),qt=n(5840),Yt=n(13209),Xt=n(44186),Jt=n(49360);function Ht(e,t){return zt(B(e).map((e=>{const n=t.nodePositions[e.id];return Object.assign(Object.assign({},e),{x:(null==n?void 0:n.x)||0,y:(null==n?void 0:n.y)||0})})),V(e).map((e=>Object.assign(Object.assign({},e),{waypoints:t.edgeWaypoints[e.id]||[]}))))}const Qt=e=>void 0!==e.loopBack;var Kt=n(1185);function en(e,t){const n={};return t.forEach((t=>{const r=Qe(ot(e,t));if(n[r])throw new Error(`Cannot project ${t} and ${n[r]}. Both are of type ${r}`);n[r]=t})),{types:tn(e,n),relations:nn(e,n),skolems:e.skolems}}function tn(e,t){const n={},r=Object.keys(t);for(const t in e.types){const o=e.types[t],s=r.some((t=>tt(e,o,t)));n[t]={_:"type",id:o.id,types:o.types,atoms:s?[]:o.atoms,meta:o.meta}}return n}function nn(e,t){const n={},r=Object.keys(t),o=Object.values(t);for(const t in e.relations){const s=e.relations[t],i=s.types.some((t=>r.some((n=>tt(e,t,n))))),a=i?rn(e,s.types,r):[];n[t]={_:"relation",id:s.id,name:s.name,types:i?sn(s.types,a):s.types,tuples:i?on(s.tuples,a,o):s.tuples},i||(n[t]=s)}return n}function rn(e,t,n){const r=[];return t.forEach(((t,o)=>{n.some((n=>tt(e,t,n)))&&r.push(o)})),r}function on(e,t,n){return e.filter((e=>e.atoms.some((e=>n.includes(e))))).map((e=>({_:"tuple",types:sn(e.types,t),atoms:sn(e.atoms,t)}))).filter((e=>e.atoms.length>1))}function sn(e,t){const n=[];for(let r=0;rt.map((t=>un(e,t))).filter((e=>!(0,Jt.Z)(e))))),selectDatumById:un},gn=function(e,t){return(e.orderByDatumId[t.id]||[]).map((t=>e.expressionsById[t]))},fn=function(e){return e.nextExpressionId};function xn(e){return e.length?e.slice().sort(((e,t)=>e.time===t.time?e.type.localeCompare(t.type):!0===e.time?-1:1)).map((e=>!0===e.time?`[${e.type}]`:`(${e.type})`)).join("|"):"|"}function bn(e,t){const n=yn(e,t);return n&&n.projections||[]}function yn(e,t){var n;return e.themeByGeneratorName[null!==(n=t.generatorName)&&void 0!==n?n:""]}const wn={selectGraphLayout:function(e,t){const n=bn(e,t),r=e.layoutsByDatumId[t.id],o=xn(n);return r.layoutById[o]},selectHiddenRelations:function(e,t){return e.hiddenByDatumId[t.id]},selectProjections:bn,selectSpreadMatrix:function(e,t){var n;return null===(n=e.matricesByDatumId[t.id])||void 0===n?void 0:n.spreadMatrix},selectTheme:yn,selectTimeIndex:function(e,t){return e.timeByDatumId[t.id]||0},selectZoomMatrix:function(e,t){var n;return null===(n=e.matricesByDatumId[t.id])||void 0===n?void 0:n.zoomMatrix}},vn=function(e){return e.items},jn=function(e){return e.connected},An=function(e){return e.providerName},Mn=function(e){return e.providerGenerators};function kn(e,t){let n=null!=t?t:e;if(n instanceof Function)return n;{let e=n;return()=>e}}function Cn(e){return{top_left:{x:Math.min(...e.map((e=>e.top_left.x))),y:Math.min(...e.map((e=>e.top_left.y)))},bottom_right:{x:Math.max(...e.map((e=>e.bottom_right.x))),y:Math.max(...e.map((e=>e.bottom_right.y)))}}}function On(e){return null==e||0==e.length?{x:0,y:0}:e.reduce(((t,n)=>({x:t.x+n.x/e.length,y:t.y+n.y/e.length})),{x:0,y:0})}function Sn(e,t){return e.map((e=>()=>({x:e().x-t().x,y:e().y-t().y})))}function In(e){let t=1/0,n=1/0,r=-1/0,o=-1/0;return e.forEach((e=>{t=Math.min(t,e.x),r=Math.max(r,e.x),n=Math.min(n,e.y),o=Math.max(o,e.y)})),{top_left:{x:t,y:n},bottom_right:{x:r,y:o}}}function Nn(e,t){const n=[];for(let o=1;o<=t;o++){const s=e(2*Math.PI/t*o);if(!("x"in(r=s))||!("y"in r))throw"returned bounding box response not of type coords. Issue in edge.ts or utility.ts";n.push(s)}var r;return n}function zn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Dn(e){let t=Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2));return{x:e.x/t,y:e.y/t}}function _n(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function Tn(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function En(e,t){const n=function(e,t){return e.x*t.x+e.y*t.y}(e,t)/(Tn(e)*Tn(t));return Tn(e)*Tn(t)==0?1/0:Math.acos(n)}function Ln(e,t,n,r){const o=e*n+t*r,s=Math.sqrt((e*e+t*t)*(n*n+r*r));let i=Math.acos(o/s);return e*r-t*n<0&&(i=-i),i}var Pn=n(7667);const Rn="rgb(0, 0, 0)";class Bn{constructor(e){this.center=kn({x:0,y:0},e),this.origin_offset=kn({x:0,y:0},e),this.bounding_box_lam=e=>this.center(),this.hasBoundingBox=!1,this.children=[],this.dependents=[],this.masks=[]}boundingBox(){return 0==this.children.length?{top_left:this.center(),bottom_right:this.center()}:Cn(this.children.map((e=>e.boundingBox())))}getChildren(){return this.children}setCenter(e){this.center=kn(this.center(),e)}hasLam(){return this.hasBoundingBox}getLam(){return this.hasBoundingBox?this.bounding_box_lam:(e=this.boundingBox(),t=>{const n=t%(2*Math.PI),r=e.top_left,o=e.bottom_right,s=Math.abs(r.y-o.y),i=Math.abs(r.x-o.x),a=Math.atan(s/i);if(2*Math.PI-a<=n||n<=a){const e=o.x;let t;return t=n>Math.PI?o.y-s/2+Math.tan(2*Math.PI-n)*i/2:o.y-s+Math.tan(n)*i/2,{x:e,y:t}}if(aMath.PI/2?r.x+s/(2*Math.tan(n-Math.PI/4)):r.x+i/2+s/(2*Math.tan(n)),{x:e,y:r.y}}if(Math.PI-a{r.append("rect").attr("x",e.top_left.x).attr("y",e.top_left.y).attr("width",Math.abs(e.top_left.x-e.bottom_right.x)).attr("height",Math.abs(e.top_left.y-e.bottom_right.y))})),n}render(e,t){let n;n=t?this.masks.concat(t):this.masks,this.children.forEach((t=>{t.render(e,n)}))}sterlingExpectCenter(e,t,n){if(this.center().x!==t)throw new Error(`${e}: center().x was not expected value (${t}); was ${this.center().x}`);if(this.center().y!==n)throw new Error(`${e}: center().y was not expected value (${n}); was ${this.center().y}`)}}class Zn extends Bn{constructor(e){super(e.coords),this.text=kn("",e.text),this.fontSize=kn(15,e.fontSize),this.color=kn("rgb(0, 0, 0)",e.color),this.events=kn([],e.events),this.fontWeight=kn(400,e.fontWeight)}boundingBox(){return{top_left:{x:this.center().x-this.fontSize()/2,y:this.center().y-this.fontSize()/2},bottom_right:{x:this.center().x+this.fontSize()/2,y:this.center().y+this.fontSize()/2}}}setText(e){this.text=kn(this.text(),e)}setFontSize(e){this.fontSize=kn(this.fontSize(),e)}setTextColor(e){this.color=kn(this.color(),e)}setFontWeight(e){this.fontWeight=kn(this.fontWeight(),e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e);const o=Pn.Ys(e).append("text").attr("x",this.center().x).attr("y",this.center().y).attr("text-anchor","middle").attr("alignment-baseline","central").attr("font-size",this.fontSize).attr("font-weight",this.fontWeight).attr("mask",n.length>0?`url(#${r})`:"").attr("fill",this.color).text(this.text);this.events()&&this.events().forEach((e=>o.on(e.event,e.callback))),super.render(e)}}class Vn extends Bn{constructor(e){super(e.center),this.color=kn("rgb(0, 0, 0)",e.color),this.borderWidth=kn(2,e.borderWidth),this.borderColor=kn("rgb(255, 255, 255)",e.borderColor),this.label=new Zn({text:e.label,coords:()=>this.center(),color:e.labelColor,fontSize:e.labelSize}),this.children.push(this.label),this.opacity=kn(1,e.opacity)}setColor(e){this.color=kn(this.color(),e)}setBorderWidth(e){this.borderWidth=kn(this.borderWidth(),e)}setBorderColor(e){this.borderColor=kn(this.borderColor(),e)}setLabelText(e){this.label.setText(e)}setLabelColor(e){this.label.setTextColor(e)}setLabelSize(e){this.label.setFontSize(e)}}class $n extends Vn{constructor(e){var t;super(e),this.height=kn(0,e.height),this.width=kn(0,e.width),this.labelLocation=null!==(t=e.labelLocation)&&void 0!==t?t:"center";const n={x:0,y:0};if(e.center&&e.coords)throw"you cannot include both coords and a center as the two define the same thing";this.center=(()=>{if(e.center)return kn(n,e.center);{const t=kn(n,e.coords);return()=>{const e=t();return{x:e.x+this.width()/2,y:e.y+this.height()/2}}}})(),this.setLabelLocation()}boundingBox(){return{top_left:{x:this.center().x-this.width()/2,y:this.center().y-this.height()/2},bottom_right:{x:this.center().x+this.width()/2,y:this.center().y+this.height()/2}}}setLabelLocation(){switch(this.labelLocation){case"topLeft":this.label.setCenter((()=>({x:this.center().x-this.width()/2+2.5*this.label.text().length,y:this.center().y-this.height()/2-1*this.label.fontSize()})));break;case"topRight":this.label.setCenter((()=>({x:this.center().x+this.width()/2-2.5*this.label.text().length,y:this.center().y-this.height()/2-1*this.label.fontSize()})));break;case"bottomRight":this.label.setCenter((()=>({x:this.center().x+this.width()/2-2.5*this.label.text().length,y:this.center().y+this.height()/2+1*this.label.fontSize()})));break;case"bottomLeft":this.label.setCenter((()=>({x:this.center().x-this.width()/2+2.5*this.label.text().length,y:this.center().y+this.height()/2+1*this.label.fontSize()})))}}setWidth(e){this.width=kn(this.width(),e)}setHeight(e){this.height=kn(this.height(),e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),Pn.Ys(e).append("rect").attr("x",this.center().x-this.width()/2).attr("y",this.center().y-this.height()/2).attr("width",this.width()).attr("height",this.height()).attr("stroke-width",this.borderWidth()).attr("stroke",this.borderColor()).attr("fill",this.color()).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}class Fn extends Vn{constructor(e){super(e),this.radius=kn(0,e.radius),this.bounding_box_lam=e=>{const t=this.radius(),n=this.center();return{x:t*Math.cos(e)+n.x,y:t*Math.sin(e)+n.y}},this.hasBoundingBox=!0}boundingBox(){return{top_left:{x:this.center().x-this.radius(),y:this.center().y-this.radius()},bottom_right:{x:this.center().x+this.radius(),y:this.center().y+this.radius()}}}setRadius(e){this.radius=kn(0,e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),Pn.Ys(e).append("circle").attr("cx",this.center().x).attr("cy",this.center().y).attr("r",this.radius).attr("stroke-width",this.borderWidth).attr("stroke",this.borderColor).attr("fill",this.color).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}var Gn=n(28721);class Wn extends Bn{constructor(e){var t;let n;n=null!=e.points?e.points.map((e=>kn({x:0,y:0},e))):[],super((()=>On(n.map((e=>e()))))),this.pointsRelative=Sn(n,this.center),this.color=kn(Rn,e.color),this.width=kn(2,e.width),this.opacity=kn(1,e.opacity),this.arrow=null!==(t=e.arrow)&&void 0!==t&&t,this.style=kn("full",e.style),this.curve=kn({curveType:"none"},e.curve)}boundingBox(){return In(this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y}))))}setColor(e){this.color=kn(this.color(),e)}setWidth(e){this.width=kn(this.width(),e)}setOpacity(e){this.opacity=kn(this.opacity(),e)}render(e,t){let n,r="";if(n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),2==this.pointsRelative.length)for(;this.pointsRelative[0]().x==this.pointsRelative[1]().x||this.pointsRelative[0]().y==this.pointsRelative[1]().y;){if(this.pointsRelative[0]().x==this.pointsRelative[1]().x){const e=this.pointsRelative[0];this.pointsRelative[0]=()=>({x:e().x+1e-4,y:e().y})}if(this.pointsRelative[0]().y==this.pointsRelative[1]().y){const e=this.pointsRelative[0];this.pointsRelative[0]=()=>({x:e().x,y:e().y+1e-4})}}let o=this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y})));const s=this.buildPathString(o);let i="0";if("dashed"==this.style()?i=5*this.width():"dotted"==this.style()&&(i=this.width()),this.arrow){const t=(0,Gn.Z)();Pn.Ys(e).append("svg:defs").append("svg:marker").attr("id",t).attr("refX",11).attr("refY",6).attr("markerWidth",10*this.width()).attr("markerHeight",10*this.width()).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 0 0 12 6 0 12 3 6").style("fill",this.color),Pn.Ys(e).append("path").attr("d",s).attr("stroke-width",this.width).attr("stroke",this.color).attr("opacity",this.opacity()).attr("marker-end",`url(#${t})`).attr("mask",n.length>0?`url(#${r})`:"").style("stroke-dasharray",i).attr("fill","transparent"),super.render(e,n)}else Pn.Ys(e).append("path").attr("d",s).attr("stroke-width",this.width).attr("stroke",this.color).attr("opacity",this.opacity()).attr("fill","transparent").attr("mask",n.length>0?`url(#${r})`:"").style("stroke-dasharray",i),super.render(e,n)}buildPathString(e){const t=this.curve();switch(t.curveType){case"none":const n=Pn.ETc();return n.moveTo(e[0].x,e[0].y),e.forEach((e=>{n.lineTo(e.x,e.y)})),n.toString();case"arc":return`M ${e[0].x} ${e[0].y} \n A ${t.xradius} ${t.yradius} 0 0 \n ${void 0!==t.sweep?t.sweep:1} ${e[1].x} ${e[1].y}`;case"cubic":throw console.log("Error: cubic curves currently unsupported by Line"),new Error("cubic curves currently unsupported by Line");case"quadratic":throw console.log("Error: quadratic curves currently unsupported by Line"),new Error("quadratic curves currently unsupported by Line");default:throw console.log(`Error: unrecognized curveType in prop ${JSON.stringify(t)} (check you have not misspelled the field name)`),new Error(`unknown curveType field in Line prop ${JSON.stringify(t)} (check you have not misspelled the field name)`)}}}class Un extends Bn{constructor(e){var t,n;super(e.coords);let r=kn({x:0,y:0},e.coords);this.center=()=>({x:r().x+this.width/2,y:r().y+this.height/2}),this.coords=()=>{const e=this.center();return{x:e.x-this.width/2,y:e.y-this.height/2}},this.height=e.height,this.width=e.width,this.root=e.root;let o=this.root.visualObject.center;this.root.visualObject.setCenter((()=>{const e=this.coords(),t=o();return{x:e.x+this.width/2+t.x,y:e.y+t.y}})),this.lines=[],this.subTrees=[],this.setUpSubtrees(),this.setLineColor(null!==(t=e.edgeColor)&&void 0!==t?t:"black"),this.setLineWidth(null!==(n=e.edgeWidth)&&void 0!==n?n:2)}setUpSubtrees(){let e=this.height/(qn(this.root)-1),t=this.root.children.map((e=>Yn(e))).reduce(((e,t)=>e+t),0);this.subTrees=[];let n=0;this.subTrees=this.root.children.map((r=>{let o=Yn(r),s=n;return n+=o,new Un({root:r,height:e*(qn(r)-1),width:this.width*Yn(r)/t,coords:()=>{const n=this.coords();return{x:n.x+s/t*this.width,y:n.y+e}}})})),this.subTrees.forEach((e=>{this.lines.push(new Wn({points:[()=>{const e=this.root.visualObject.center();return{x:e.x,y:e.y}},()=>{const t=e.root.visualObject.center();return{x:t.x,y:t.y}}],color:Rn,width:2}))})),this.lines.forEach((e=>{this.children.push(e)})),this.subTrees.forEach((e=>{this.children.push(e)})),this.children.push(this.root.visualObject)}setLineColor(e){this.lines.forEach((t=>t.setColor(e))),this.subTrees.forEach((t=>t.setLineColor(e)))}setLineWidth(e){this.lines.forEach((t=>t.setWidth(e))),this.subTrees.forEach((t=>t.setLineWidth(e)))}}function qn(e){let t=0,n=[e];for(;0!=n.length;){t+=1;let e=[];n.forEach((t=>{t.children.forEach((t=>{e.push(t)}))})),n=e}return t}function Yn(e){let t=1,n=[e];for(;0!=n.length;){let e=[];n.forEach((t=>{t.children.forEach((t=>{e.push(t)}))})),n=e,t=Math.max(t,e.length)}return t}class Xn{static error(e,t,n){return n&&console.trace(),Error(`[${e}] ${t}`)}static missingAttribute(e,t){return Error(`[${e}] Missing attribute: ${t}`)}static missingElement(e,t){return Error(`[${e}] Missing element: <${t}>`)}}class Jn{constructor(e){this._tuples=e||[]}empty(){return 0===this._tuples.length}equals(e){return this.toString()===e.toString()}in(e){const t=new Set(e.tuples().map((e=>e.toString())));return this.tuples().every((e=>t.has(e.toString())))}join(e){if(Array.isArray(e))throw Xn.error("AlloySet",`[${e}] is an array, not an AlloySet, so unable to apply join.`);if(!(e instanceof Jn))throw Xn.error("AlloySet",`${e} is something other than an AlloySet, so unable to apply join.`);if(!this.tuples().length||!e.tuples().length)return new Jn;const t=function(e,t){const n=new Map;return t.forEach((e=>{const t=e.atoms()[0];n.has(t.id())||n.set(t.id(),[]),n.get(t.id()).push(e)})),n}(0,e.tuples()),n=[],r=this._tuples[0].atoms().length-1;return this.tuples().forEach((e=>{const o=e.atoms()[r],s=t.get(o.id());s&&s.forEach((t=>{const r=e.atoms().slice(0,-1).concat(...t.atoms().slice(1));n.push(new Hn(r))}))})),new Jn(function(e){const t=new Set;return e.filter((e=>{const n=e.atoms().map((e=>e.id())).join();return!t.has(n)&&(t.add(n),!0)}))}(n))}toString(){return this._tuples.map((e=>e.toString())).join("\n")}tuples(){return this._tuples.slice()}}class Hn extends Jn{constructor(e){super(),this._tuples=[this],this._atoms=e}atoms(){return this._atoms.slice()}toString(){return this._atoms.map((e=>e.id())).join(", ")}static tuplesFromXML(e,t){return Array.from(e).map((e=>{if(1===t.length)return Hn.buildTuple(t[0],e);const n=t.reduce(((t,n)=>{if(t)return t;try{return Hn.buildTuple(n,e)}catch(e){return}}),void 0);if(n)return n;throw Xn.error("AlloyField",`No match for tuple element ${e} in declared types ${t}`)}))}static buildTuple(e,t){const n=Array.from(t.querySelectorAll("atom")).map(((t,n)=>{const r=e[n],o=t.getAttribute("label");if(!o)throw Xn.missingAttribute("AlloyField","label");const s=r.atom(o);if(!s)throw Xn.error("AlloyField",`No atom: ${o} in type: ${r}`);return s}));return new Hn(n)}}class Qn extends Jn{constructor(e,t){super();const n=t?t.applyProxy(this,function(e){return e.replace("/","$").replace("-","$")}(e)):this;return this._id=e,this._tuples=[new Hn([n])],n}clone(e){return new Qn(this.id(),e)}id(){return this._id}static fromElement(e,t){const n=e.getAttribute("label");if(!n)throw Xn.missingAttribute("AlloyAtom","label");return new Qn(n,t)}}const Kn=[{name:"VisualObject",value:Bn},{name:"Shape",value:Vn},{name:"Grid",value:class extends Bn{constructor(e){super(e.grid_location),this.config=e;let t=kn({x:0,y:0},this.config.grid_location);this.center=()=>{const e=t();return{x:e.x+this.config.grid_dimensions.x_size*this.config.cell_size.x_size/2,y:e.y+this.config.grid_dimensions.y_size*this.config.cell_size.y_size/2}},this.coords=()=>{const e=this.center();return{x:e.x-this.config.grid_dimensions.x_size*this.config.cell_size.x_size/2,y:e.y-this.config.grid_dimensions.y_size*this.config.cell_size.y_size/2}},this.cells=new Array(this.config.grid_dimensions.y_size).fill([]);for(var n=0;nthis.config.cell_size.y_size)throw`Proposed object to add is taller than grid cells. Add "true" as the last parameter to\n grid.add() to hide this error.\n Grid cells are ${this.config.cell_size.y_size}\n units tall, while the object you want to add is ${n} units tall`;if(t>this.config.cell_size.x_size)throw`Proposed object to add is wider than grid cells. Add "true" as the last parameter to\n grid.add() to hide this error.\n Grid cells are ${this.config.cell_size.x_size}\n units tall, while the object you want to add is ${t} units tall`}add(e,t,n){if(!(t instanceof Bn))throw new Error("Grid can only add VisualObjects as children.");this.check_coords(e),n||this.check_bounding_box(t.boundingBox()),this.children.push(t),t.center=this.center_helper(e,t.origin_offset),this.cells[e.y][e.x]=t}center_helper(e,t){return()=>{let n=t();const r=this.coords();return{x:r.x+this.config.cell_size.x_size*(e.x+.5)+n.x,y:r.y+this.config.cell_size.y_size*(e.y+.5)+n.y}}}fill_grid_lines(){for(let e=0;e<=this.config.grid_dimensions.y_size;e++){const t=new Wn({points:[()=>{const t=this.coords();return{x:t.x,y:t.y+e*this.config.cell_size.y_size}},()=>{const t=this.coords();return{x:t.x+this.config.grid_dimensions.x_size*this.config.cell_size.x_size,y:t.y+e*this.config.cell_size.y_size}}]});this.gridlines.push(t),this.children.push(t)}for(let e=0;e<=this.config.grid_dimensions.x_size;e++){const t=new Wn({points:[()=>{const t=this.coords();return{x:t.x+e*this.config.cell_size.x_size,y:t.y}},()=>{const t=this.coords();return{x:t.x+e*this.config.cell_size.x_size,y:t.y+this.config.grid_dimensions.y_size*this.config.cell_size.y_size}}]});this.gridlines.push(t),this.children.push(t)}}hide_grid_lines(){this.gridlines.forEach((e=>{e.setOpacity(0)}))}fill(e,t){this.check_coords(e);const n=new $n({height:this.config.cell_size.x_size,width:this.config.cell_size.y_size});n.setColor(t),this.add(e,n)}check_coords(e){if(!Number.isInteger(e.x)||!Number.isInteger(e.y))throw`non-integer indices given for grid coords. Inputted coords: ${e.x},${e.y}`;if(e.x<0||e.y<0)throw"negative indices given for grid coords";if(e.x>this.config.grid_dimensions.x_size-1||e.y>this.config.grid_dimensions.y_size-1)throw`coordinates out of bounds. Grid is of x_size ${this.config.grid_dimensions.x_size} and y_size ${this.config.grid_dimensions.y_size}\n\n Note: passing in 2 refers to index 2 which is the third element of the grid`}childAt(e,t){if(void 0!==this.cells[e]&&void 0!==this.cells[e][t])return this.cells[e][t]}}},{name:"Rectangle",value:$n},{name:"Circle",value:Fn},{name:"Stage",value:class{constructor(){this.Children=[],this.masks=[]}add(e){if(!(e instanceof Bn))throw new Error("Stage can only add VisualObjects as children.");this.Children.push(e)}addAll(e){e.forEach((e=>{this.Children.push(e)}))}remove(e){this.Children=this.Children.filter((t=>t!==e))}addMask(e){this.masks.push(e)}childrenToTreeRecurse(e){const t=e.constructor.name,n={visualObject:new Zn({text:t}),children:[]};return 0==e.getChildren().length||e.children.forEach((e=>{n.children.push(this.childrenToTreeRecurse(e))})),n}render(e,t){if(Pn.Ys(e).selectAll("*").remove(),this.Children.forEach((t=>t.render(e,this.masks))),t){const e=t.getElementById("svg-container");e.getElementsByTagName("svg")[0].style.height="200%",e.getElementsByTagName("svg")[0].style.width="200%"}}}},{name:"TextBox",value:Zn},{name:"Line",value:Wn},{name:"Polygon",value:class extends Vn{constructor(e){let t=e.points.map((e=>kn({x:0,y:0},e)));e.center=()=>On(t.map((e=>e()))),super(e),this.pointsRelative=Sn(t,this.center)}boundingBox(){return In(this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y}))))}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks;let o=this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y}))),s=Pn.ETc();s.moveTo(o[0].x,o[0].y),o.forEach((e=>{s.lineTo(e.x,e.y)})),s.closePath(),r=this.addMaskRender(n,e),Pn.Ys(e).append("path").attr("d",s.toString()).attr("stroke-width",this.borderWidth).attr("stroke",this.borderColor).attr("fill",this.color).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}},{name:"Tree",value:Un},{name:"Edge",value:class extends Bn{constructor(e){var t,n,r,o;super(),this.obj1=e.obj1,this.obj2=e.obj2,this.textProps=null!==(t=e.textProps)&&void 0!==t?t:{},this.lineProps=null!==(n=e.lineProps)&&void 0!==n?n:{points:[]},this.textLocation=null!==(r=e.textLocation)&&void 0!==r?r:"none",this.obj1CoordsStore={x:0,y:0},this.obj2CoordsStore={x:0,y:0},this.fast_imprecise=null!==(o=e.fast_imprecise)&&void 0!==o&&o,this.obj1Coords=()=>({x:0,y:0}),this.obj2Coords=()=>({x:0,y:0}),this.compute_points(30),this.makeLine(),this.makeText()}compute_points(e){const t=_n(this.obj1.center(),this.obj2.center());this.obj2Coords=()=>this.opt_points(t,this.obj2,e,"obj1"),this.obj1Coords=()=>this.opt_points(t,this.obj1,e,"obj2")}opt_points(e,t,n,r){if(this.fast_imprecise){let e;if("obj1"==r)e=this.obj1CoordsStore;else{if("obj2"!=r)throw"bad arg for coordsstore";e=this.obj1CoordsStore}if(e.xt.boundingBox().top_left.x&&e.y>t.boundingBox().bottom_right.y&&e.y{zn(t,e)function(e,t){if(e.x==t.x)return 90;{let n=(e.y-t.y)/(e.x-t.x);return Math.atan(n)}}(this.obj1Coords(),this.obj2Coords()),n=()=>Math.sqrt(Math.pow(e.fontSize(),2)+Math.pow(.14*e.text().length*e.fontSize(),2)),r=()=>{const e=this.arcMidpoint();return void 0!==e?e:_n(this.obj1Coords(),this.obj2Coords())};switch(this.textLocation){case"above":e.setCenter((()=>({x:r().x+Math.cos(t()-Math.PI/2)*n(),y:r().y+Math.sin(t()-Math.PI/2)*n()})));break;case"below":e.setCenter((()=>({x:r().x+Math.cos(t()+Math.PI/2)*n(),y:r().y+Math.sin(t()+Math.PI/2)*n()})));break;case"left":e.setCenter((()=>t()<=0?{x:r().x+Math.cos(t()-Math.PI/2)*n(),y:r().y+Math.sin(t()-Math.PI/2)*n()}:{x:r().x+Math.cos(t()+Math.PI/2)*n(),y:r().y+Math.sin(t()+Math.PI/2)*n()}));break;case"right":e.setCenter((()=>t()<=0?{x:r().x+Math.cos(t()+Math.PI/2)*n(),y:r().y+Math.sin(t()+Math.PI/2)*n()}:{x:r().x+Math.cos(t()-Math.PI/2)*n(),y:r().y+Math.sin(t()-Math.PI/2)*n()}));break;case"clockwise":e.setCenter((()=>{let e=Dn({x:this.obj2Coords().x-this.obj1Coords().x,y:this.obj2Coords().y-this.obj1Coords().y});return{x:r().x-e.y*n(),y:r().y+e.x*n()}}));break;case"counterclockwise":e.setCenter((()=>{let e=Dn({x:this.obj2Coords().x-this.obj1Coords().x,y:this.obj2Coords().y-this.obj1Coords().y});return{x:r().x+e.y*n(),y:r().y-e.x*n()}}));break;default:console.log(`default text position: midpoint of line or arc: at ${JSON.stringify(r())}`),e.setCenter((()=>({x:r().x,y:r().y})))}this.children.push(e)}arcMidpoint(){if(!this.lineProps)return;const e=this.lineProps.curve instanceof Function?this.lineProps.curve():this.lineProps.curve;if(e){if("arc"===e.curveType){const t=function({x1:e,y1:t,rx:n,ry:r,phi:o,fA:s,fS:i,x2:a,y2:l}){let c,d,h,p,u;const m=2*Math.PI;if(0==n||0==r)throw Error("rx and ry can not be 0");n<0&&(n=-n),r<0&&(r=-r);const g=Math.sin(o),f=Math.cos(o),x=(e-a)/2,b=(t-l)/2,y=(e+a)/2,w=(t+l)/2,v=f*x+g*b,j=f*b-g*x,A=v*v/(n*n)+j*j/(r*r);A>1&&(n*=Math.sqrt(A),r*=Math.sqrt(A));var M=n*r,k=n*j,C=r*v,O=k*k+C*C;if(!O)throw Error("start point can not be same as end point");var S=Math.sqrt(Math.abs((M*M-O)/O));s==i&&(S=-S);var I=S*k/r,N=-S*C/n;c=f*I-g*N+y,d=g*I+f*N+w;var z=(v-I)/n,D=(v+I)/n,_=(j-N)/r,T=(j+N)/r;for(h=Ln(1,0,z,_),p=Ln(z,_,-D,-T);p>m;)p-=m;for(;p<0;)p+=m;for(0==i&&(p-=m),u=h+p;u>m;)u-=m;for(;u<0;)u+=m;return{cx:c,cy:d,startAngle:h,deltaAngle:p,endAngle:u,clockwise:1==i,rx:n,ry:r}}({x1:this.obj1Coords().x,y1:this.obj1Coords().y,rx:e.xradius,ry:e.yradius,phi:0,fA:!1,fS:1===e.sweep,x2:this.obj2Coords().x,y2:this.obj2Coords().y}),n=0===e.sweep;return{x:t.cx,y:n?t.cy+t.ry:t.cy-t.ry}}throw console.log(`unsupported curve type: ${e.curveType}`),new Error(`unsupported curve type: ${e.curveType}`)}}}},{name:"Hull",value:class extends Bn{constructor(e){var t,n;super(),this.fuzz=null!==(t=e.fuzz)&&void 0!==t?t:0,this.smooth=null!==(n=e.smooth)&&void 0!==n&&n,this.pts=function(e){let t=[],n=new Set;t.push(function(e){return e.sort(((e,t)=>e.x>t.x?1:t.x>e.x?-1:0))[0]}(e));let r=0;for(;0==r||t[r].x!=t[0].x||t[r].y!=t[0].y;){let o;0==r?o={x:0,y:1}:(o={x:t[r].x-t[r-1].x,y:t[r].y-t[r-1].y},n.add({x:t[r].x,y:t[r].y}));let s={x:0,y:0},i=2*Math.PI;e.forEach((e=>{if(!n.has({x:e.x,y:e.y})){let n={x:e.x-t[r].x,y:e.y-t[r].y},a=En(o,n);(a{t.push({x:e.center().x,y:e.center().y})})):this.smooth?e.forEach((e=>{Nn(new Fn({radius:this.fuzz,center:e.center()}).getLam(),100).forEach((e=>t.push(e)))})):e.forEach((e=>{const n=new $n({height:this.fuzz,width:this.fuzz});n.setCenter(e.center()),Nn(n.getLam(),100).forEach((e=>t.push(e)))})),t}render(e,t){let n;n=t?this.masks.concat(t):this.masks,new Wn({points:this.pts}).render(e,n)}}},{name:"ConjoinedObject",value:class extends Bn{constructor(e){super({x:0,y:0}),this.children=[],e&&e.forEach((e=>{this.add(e)}))}addOrdered(e,t){if(!(e instanceof Bn))throw new Error("ConjoinedObject can only add VisualObjects as children.");if(t>this.children.length)throw`Index larger than current number of objects stored plus 1. Add an index between 0 and ${this.children.length}`;this.children.splice(t,0,e)}add(e){this.addOrdered(e,0)}setCenter(e){this.children.forEach((t=>{t.setCenter(e)}))}}},{name:"boxUnion",value:Cn},{name:"Ellipse",value:class extends Vn{constructor(e){super(e),this.height=kn(0,e.height),this.width=kn(0,e.width);let t=kn({x:0,y:0},e.coords);this.center=()=>{const e=t();return{x:e.x+this.width()/2,y:e.y+this.height()/2}}}boundingBox(){return{top_left:{x:this.center().x-this.width()/2,y:this.center().y-this.height()/2},bottom_right:{x:this.center().x+this.width()/2,y:this.center().y+this.height()/2}}}setWidth(e){this.width=kn(this.width(),e)}setHeight(e){this.height=kn(this.height(),e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),Pn.Ys(e).append("ellipse").attr("cx",this.center().x-this.width()/2).attr("cy",this.center().y-this.height()/2).attr("rx",this.width()).attr("ry",this.height()).attr("stroke-width",this.borderWidth()).attr("stroke",this.borderColor()).attr("fill",this.color()).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}},{name:"ImageBox",value:class extends Bn{constructor(e){super(e.coords),this.url=kn("",e.url),this.width=kn(100,e.width),this.height=kn(100,e.height)}boundingBox(){return{top_left:{x:this.center().x-this.width()/2,y:this.center().y-this.height()/2},bottom_right:{x:this.center().x+this.width()/2,y:this.center().y+this.height()/2}}}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),Pn.Ys(e).append("svg:image").attr("x",this.center().x-this.width()/2).attr("y",this.center().y-this.height()/2).attr("width",this.width()).attr("height",this.height()).attr("mask",n.length>0?`url(#${r})`:"").attr("xlink:href",`${this.url()}`),super.render(e)}}},{name:"AlloySet",value:Jn},{name:"AlloyAtom",value:Qn}];var er=n(25001);class tr extends Jn{constructor(e,t,n){return super(),this._id=e,this._atoms=t,this._subsignatures=[],this._tuples=t.map((e=>new Hn([e]))),n?n.applyProxy(this,function(e){return e.replace(/^this\//,"").replace("/","$").replace("-","$")}(e)):this}atom(e){return this.atoms(!0).find((t=>t.id()===e))||null}atoms(e=!1){return e?this.atoms().concat(this.subSignatures().map((e=>e.atoms(!0))).reduce(((e,t)=>e.concat(t)),[])):this._atoms.slice()}tuples(){return this.atoms(!0).map((e=>new Hn([e])))}clone(e){const t=new tr(this.id(),this.atoms().map((t=>t.clone(e))),e);return t._subsignatures=this.subSignatures().map((t=>t.clone(e))),t}id(){return this._id}subSignatures(e=!1){return e?this.subSignatures().concat(this.subSignatures().map((e=>e.subSignatures(!0))).reduce(((e,t)=>e.concat(t)),[])):this._subsignatures.slice()}static fromElement(e,t){const n=e.getAttribute("label");if(!n)throw Xn.missingAttribute("AlloySignature","label");const r=Array.from(e.querySelectorAll("atom")).map((e=>Qn.fromElement(e,t)));return new tr(n,r,t)}static intSignature(e,t){if(e<0)throw Xn.error("AlloySignature","Invalid bitwidth");const n=[];for(let r=Math.pow(2,e),o=-r/2;o{const n=e.getAttribute("ID"),o=e.getAttribute("label");if(!n)throw Xn.missingAttribute("AlloySignature","ID");const a=tr.getParent(e);if(!a&&"univ"!==o)throw Xn.error("AlloySignature",`unable to resolve parent sig for non-univ sig ${o}`);const l="Int"===o||"seq/Int"===o?r:tr.fromElement(e,t);return i.set(n,l),a&&"seq/Int"!==o&&(s.has(a)||s.set(a,[]),s.get(a).push(n)),l})),i.forEach(((e,t)=>{const n=s.get(t)||[];e._subsignatures=n.map((e=>i.get(e))).filter(er.$K)})),i}static getParent(e){const t=e.getAttribute("parentID"),n=e.getAttribute("label");if(!t&&"univ"!==n){const t=e.getElementsByTagName("type");if(1!==t.length)throw Xn.error("AlloySignature",`subset sig ${n} had no type or multiple types; this is unsupported`);if(t[0].getAttribute("ID"))return t[0].getAttribute("ID");throw Xn.missingAttribute("AlloySignature","type.ID")}return t}static typesFromXML(e,t){const n=e.querySelectorAll("types");if(!n)throw Xn.missingElement("AlloyField","types");return Array.from(n).map((e=>tr.typesFromXMLSingle(e,t)))}static typesFromXMLSingle(e,t){return Array.from(e.querySelectorAll("type")).map((e=>{const n=e.getAttribute("ID");if(!n)throw Xn.missingAttribute("AlloyField","ID");const r=t.get(n);if(!r)throw Xn.error("Alloy Field",`No signature with ID: ${n}`);return r}))}}var nr=n(44908),rr=n.n(nr);class or extends Jn{constructor(e,t){super(t),this._types=e}project(e){const t=rr()(this.types().map((t=>t.map((t=>e.get(t))))).flat());t.some(er.$K)&&(this._tuples=this.tuples().filter((e=>e.atoms().every(((e,n)=>void 0===t[n]||t[n]===e)))).map((e=>new Hn(e.atoms().filter(((e,n)=>void 0===t[n]))))))}types(){return this._types.slice()}join(e){if(e instanceof or){const t=this.types().map((e=>e.at(-1))),n=e.types().map((e=>e.at(0)));if(!t.some((e=>n.includes(e))))throw Xn.error("Join",`Joining ${this} and ${e} will always be empty.`)}return super.join(e)}}class sr extends or{constructor(e,t,n,r,o){return super(t,n),this._id=e,r?r.applyProxy(this,o?function(e){return e.replace(/-/g,"$").replace("/","$")}(o):e):this}clone(e,t){this.types().forEach((e=>{if(!this.types().every(er.$K))throw Xn.error("AlloyField","Missing type, cannot clone field")}));const n=this.tuples().map((e=>new Hn(e.atoms().map(((e,t)=>e.clone())))));if(t){const e=Reflect.get(this,"__var__");if(!e)throw Xn.error("AlloyField","Cannot use proxy to clone non-proxied field");return new sr(this.id(),this.types(),n,t,e.toString())}return new sr(this.id(),this.types(),n)}id(){return this._id}static fieldsFromXML(e,t,n){const r=Array.from(e.querySelectorAll("field")),o=new Map;return r.forEach((e=>{const t=e.getAttribute("label");if(!t)throw Xn.missingAttribute("AlloyField","label");o.set(t,(o.get(t)||0)+1)})),r.map((e=>{const r=e.getAttribute("label"),s=e.getAttribute("parentID"),i=tr.typesFromXML(e,t);if(!r)throw Xn.missingAttribute("AlloyField","label");if(!s)throw Xn.missingAttribute("AlloyField","parentID");const a=o.get(r)||0,l=t.get(s);if(!l)throw Xn.error("AlloyField","Field parent type does not exist");const c=a>1?(d=r,h=l,`${Reflect.get(h,"__var__")}$${d}`):r;var d,h;const p=Hn.tuplesFromXML(e.querySelectorAll("tuple"),i);return new sr(r,i,p,n,c)}))}}class ir{constructor(){this._sets=new Map}applyProxy(e,t){const n=this._sets,r=t||`${n.size}`,o=this._finalize.bind(this);if(n.has(r))throw Xn.error("AlloyProxy",`Cannot apply proxy, ID already exists: ${r}. (This may be caused by a clash between sig and atom names.)`);const s=new Proxy(e,{get(e,r){if("symbol"==typeof r||r in e)return Reflect.get(e,r);if("number"!=typeof r&&isNaN(+r)){let s;const i=r.match(/\[(.*)]/);if(i){const r=n.get(i[1]);if(!r)throw Xn.error("Box Join",`Tried to join ${t} with ${i[1]} but no set ${i[1]} defined.`,!0);s=r.join(e)}else{const o=n.get(r);if(!o)throw Xn.error("Dot Join",`Tried to join ${t} with ${r} but no set ${r} defined.`,!0);s=e.join(o)}return o(s)}{const t=n.get(`${r}`);if(!t)throw Xn.error("Join",`Integer atom does not exist: ${r}`);return o(t.join(e))}}});return Reflect.set(s,Symbol.toPrimitive,(()=>`[${r}]`)),Reflect.set(s,"__var__",r),this._sets.set(r,s),s}_finalize(e){if(1===e.tuples().length&&1===e.tuples()[0].atoms().length){const t=e.tuples()[0].atoms()[0];return this._sets.get(t.id())||this.applyProxy(t,t.id())}return this.applyProxy(e)}}class ar extends or{constructor(e,t,n,r){return super(t,n),this._id=e,r?r.applyProxy(this,function(e){return e.replace(/^\$this\//,"$").replace("/","$").replace(/'/g,"$")}(e)):this}clone(e,t){const n=this.tuples().map((e=>new Hn(e.atoms().map(((e,t)=>e.clone())))));return new ar(this.id(),this.types(),n,t)}id(){return this._id}static skolemsFromXML(e,t,n){return Array.from(e.querySelectorAll("skolem")).map((e=>{const r=e.getAttribute("label"),o=tr.typesFromXML(e,t),s=Hn.tuplesFromXML(e.querySelectorAll("tuple"),o);if(!r)throw Xn.missingAttribute("AlloySkolem","label");return new ar(r,o,s,n)}))}}class lr{constructor(e,t){this._proxy=new ir,this._atoms=[],this._fields=[],this._signatures=[],this._skolems=[],this._projections=new Map,this._bitwidth=0,this._command="",this._filename="",this._sources=new Map,e&&this._buildFromXML(e,t)}atom(e){return this._atoms.find((t=>t.id()===e))||null}atoms(){return this._atoms.slice()}bitwidth(){return this._bitwidth}clone(){const e=new ir,t=this.univ();if(!t)throw Xn.error("AlloyInstance","Cannot clone an instance without univ signature");const n=t.clone(e),r=[n,...n.subSignatures(!0)],o=n.atoms(!0),s=this.fields().map((t=>t.clone(r,e))),i=this.skolems().map((t=>t.clone(r,e))),a=new lr;return a._proxy=e,a._fields=s,a._signatures=r,a._atoms=o,a._skolems=i,a._bitwidth=this.bitwidth(),a._command=this.command(),a._filename=this.filename(),a}command(){return this._command}field(e){return this._fields.find((t=>t.id()===e))||null}fields(){return this._fields}filename(){return this._filename}project(e){const t=this.clone(),n=e.map((e=>t.atom(e.id())));if(!n.every(er.$K))throw Xn.error("AlloyInstance","Error cloning instance");const r=t.univ();if(!r)throw Xn.error("AlloyInstance","No univ signature");const o=r.subSignatures(),s=new Map;return n.forEach((e=>{o.forEach((t=>{if(t.atoms(!0).includes(e)){if(s.has(t))throw Xn.error("AlloyInstance","Cannot project over multiple atoms from the same signature");s.set(t,e)}}))})),this._projections=s,t.fields().forEach((e=>e.project(s))),t.skolems().forEach((e=>e.project(s))),t}projections(){return new Map(this._projections)}signature(e){return this.signatures().find((t=>t.id()===e))||null}signatures(){return this._signatures.slice()}skolem(e){return this.skolems().find((t=>t.id()===e))||null}skolems(){return this._skolems.slice()}sources(){return new Map(this._sources)}univ(){return this._signatures.find((e=>"univ"===e.id()))||null}_buildFromXML(e,t){const n=(new DOMParser).parseFromString(e,"application/xml"),r=n.querySelectorAll("instance"),o=void 0!==t?r[t]:r[0];if(!o)throw Xn.missingElement("AlloyInstance","instance");const s=o.getAttribute("bitwidth"),i=o.getAttribute("command"),a=o.getAttribute("filename"),l=o.getAttribute("maxseq");if(!s)throw Xn.missingAttribute("AlloyInstance","bitwidth");if(!i)throw Xn.missingAttribute("AlloyInstance","command");if(!a)throw Xn.missingAttribute("AlloyInstance","filename");if(!l)throw Xn.missingAttribute("AlloyInstance","maxseq");if(+s<1)throw Xn.error("AlloyInstance",`Invalid bitwidth ${s}`);this._bitwidth=+s,this._command=i,this._filename=a,this._atoms=[],this._fields=[],this._signatures=[],this._skolems=[];const c=tr.signaturesFromXML(o,this._proxy);this._signatures=Array.from(c.values()),this._fields=sr.fieldsFromXML(o,c,this._proxy),this._skolems=ar.skolemsFromXML(o,c,this._proxy),this._atoms=this._signatures.map((e=>e.atoms())).reduce(((e,t)=>e.concat(t)),[]),this._sources=new Map,Array.from(n.querySelectorAll("source")).forEach((e=>{const t=e.getAttribute("filename"),n=e.getAttribute("content");if(!t)throw Xn.missingAttribute("AlloyInstance","filename");if(!n)throw Xn.missingAttribute("AlloyInstance","content");this._sources.set(t,n)}))}}const cr="https://alloy-js.github.io/alloy-ts/classes/alloyinstance.alloyinstance-1.html",dr=function(e){return e.stage},hr=function(e){return e.stageDimensions},pr=function(e){return e.text},ur=function(e,t,n){if(wt(e)){const r=e.data,o=e.parsed.instances.map(((e,t)=>new lr(r,t))),s=o[n],i=s.atoms(),a=[];t.forEach((e=>{const t=e.atom;if(t){const e=i.find((e=>e.id()===t));e&&a.push(e)}}));const l=s.project(a),c=l.signatures().map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloySignature",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloysignature.alloysignature-1.html"}))),d=l.atoms().filter((e=>isNaN(+e.id()))).map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloyAtom",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloyatom.alloyatom-1.html"}))),h=l.fields().map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloyField",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloyfield.alloyfield-1.html"}))),p=l.skolems().map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloySkolem",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloyskolem.alloyskolem-1.html"}))),u=Kn.map((e=>({name:e.name,variable:e.value,type:"D3Helper",typeUrl:"https://csci1710.github.io/forge-documentation/sterling/d3fx.html"}))),m=[{name:"instance",variable:s,type:"AlloyInstance",typeUrl:cr},...c,...d,...h,...p,...u];return Qt(e.parsed)&&m.unshift({name:"currentInstance",type:"number",variable:n},{name:"loopBack",type:"number",variable:e.parsed.loopBack},{name:"instances",variable:o,type:"AlloyInstance[]",typeUrl:cr}),m}return function(e){return"raw"===e.format}(e)?[{name:"data",variable:e.data,type:"string"}]:[]};function mr(e){return e.mainView}function gr(e){return e.graphViewDrawer}function fr(e){return e.tableViewDrawer}function xr(e){return e.scriptViewDrawer}const br={selectAvailableViews:function(e){return e.availableViews},selectMainView:mr,selectGraphDrawer:gr,selectGraphDrawerThemeRelationExpanded:function(e,t,n){return!0===(0,hn.Z)(e,["graphDrawerThemeById",t.id,"expandedRelations",n])},selectGraphDrawerThemeTypeExpanded:function(e,t,n){return!0===(0,hn.Z)(e,["graphDrawerThemeById",t.id,"expandedTypes",n])},selectTableDrawer:fr,selectScriptDrawer:xr,selectDrawerIsCollapsed:(0,an.P1)([mr,gr,fr,xr],((e,t,n,r)=>{switch(e){case"GraphView":return null===t;case"TableView":return null===n;case"ScriptView":return null===r;default:return!0}})),selectDrawerView:(0,an.P1)([mr,gr,fr,xr],((e,t,n,r)=>{switch(e){case"GraphView":return t;case"TableView":return n;case"ScriptView":return r;default:return null}})),selectSelectedGenerator:function(e){return e.selectedGenerator}};function yr(e){return mn.selectActiveDatum(e.data)}function wr(e){return br.selectSelectedGenerator(e.ui)}function vr(e,t){const n=Tr(0,t),r=Er(e,t).map((e=>e.type)),o=(0,ln.Z)((0,cn.Z)(n),r);return(0,dn.Z)(n,o)}function jr(e){return br.selectAvailableViews(e.ui)}function Ar(e){return mn.selectData(e.data)}function Mr(e,t){return wt(t)&&Qt(t.parsed)}function kr(e){return br.selectDrawerIsCollapsed(e.ui)}function Cr(e){return br.selectDrawerView(e.ui)}function Or(e){return br.selectGraphDrawer(e.ui)}function Sr(e){const t=yr(e);return void 0!==t&&!0===t.evaluator}function Ir(e,t){return gn(e.evaluator,t)}function Nr(e){return jn(e.provider)}function zr(e){return vn(e.log)}function Dr(e){return br.selectMainView(e.ui)}function _r(e){return fn(e.evaluator)}function Tr(e,t){const n={};if(t&&wt(t)){const e=t.parsed.instances[0];(function(e){return(0,Kt.Z)(ut(e).map(Qe)).filter((e=>!(0,Jt.Z)(e)))})(e).forEach((t=>{const r=pt(e,t);n[t]=function(e,t){return ct(e).filter((n=>function(e,t,n){return"string"==typeof t&&(t=lt(e,t)),"string"!=typeof n&&(n=n.id),ot(e,t).types.includes(n)}(e,n,t)))}(e,r).map((e=>e.id))}))}return n}function Er(e,t){return wn.selectProjections(e.graphs,t)}function Lr(e){return An(e.provider)}function Pr(e){return Mn(e.provider)}function Rr(e){return br.selectScriptDrawer(e.ui)}function Br(e){return dr(e.script)}function Zr(e){return hr(e.script)}function Vr(e){return pr(e.script)}function $r(e){return br.selectTableDrawer(e.ui)}function Fr(e,t){return wn.selectTheme(e.graphs,t)}function Gr(e,t){return wn.selectTimeIndex(e.graphs,t)}const Wr=(0,an.P1)([(e,t)=>t,(e,t)=>t?function(e,t){return wn.selectGraphLayout(e.graphs,t)}(e,t):void 0,(e,t)=>t?Fr(e,t):void 0,(e,t)=>t?Gr(e,t):void 0,(e,t)=>t?function(e,t){return wn.selectHiddenRelations(e.graphs,t)}(e,t):void 0],((e,t,n,r,o)=>{if(e&&t&&n&&void 0!==r&&wt(e)&&o){const s=e.parsed.instances[r],i=n.projections||[],a=i.filter((e=>!0===e.time)),l=en(s,i.map((e=>e.atom)).filter(Je)),c=Rt(l,n);if(a.length)return a.map((e=>{let r=c;o[e.type]&&o[e.type].forEach((e=>{const t=V(r).filter((t=>t.relation.name===e)).map((e=>e.id));r=function(e,t){return(0,Ot.Uy)(e,(e=>{t.forEach((t=>{const n=Z(e,t);n&&function(e,t){const{id:n,source:r,target:o}=t;delete e.edges[n],function(e,t,n,r){const o=e.predecessors[n][t];if(o){const s=o.indexOf(r);-1!==s&&o.splice(s,1),0===o.length&&delete e.predecessors[n][t]}}(e,r,o,n),function(e,t,n,r){const o=e.successors[t][n];if(o){const s=o.indexOf(r);-1!==s&&o.splice(s,1),0===o.length&&delete e.successors[t][n]}}(e,r,o,n),function(e,t,n){const r=e.inedges[t].indexOf(n);-1!==r&&e.inedges[t].splice(r,1)}(e,o,n),function(e,t,n){const r=e.outedges[t].indexOf(n);-1!==r&&e.outedges[t].splice(r,1)}(e,r,n)}(e,n)}))}))}(c,t)}));const s=Ht(r,t);return Ft("",l,s,n)}));const d=Ht(c,t);return[Ft("",l,d,n)]}return console.log(`datum: ${void 0!==e}`),console.log(`layout: ${void 0!==t}`),console.log(`theme: ${void 0!==n}`),console.log(`time: ${r}`),[]})),Ur=(0,an.P1)([(e,t)=>t,(e,t)=>Er(e,t),(e,t)=>Gr(e,t)],((e,t,n)=>ur(e,t,n))),qr=(0,an.P1)([(e,t)=>t,(e,t)=>Gr(e,t)],((e,t)=>{if(wt(e)){const n=e.parsed.instances[t],r=function(e){const t=ht(e),n=dt(e);return t.concat(n)}(n).map((e=>({title:e.name,type:"relation",headers:e.types,data:it(e).map((e=>e.atoms))})));return[...r,...ut(n).map((e=>({title:e.id,type:"type",data:Ke(e).map((e=>[e.id]))})))]}return[]}));var Yr=n(10894),Xr=n(66653);const Jr=e=>{const{expression:t}=e;return(0,r.jsxs)("div",Object.assign({className:"relative p-2 font-mono text-xs"},{children:[(0,r.jsxs)("div",Object.assign({className:"relative flex ml-6"},{children:[(0,r.jsx)("span",Object.assign({className:"absolute inset-y-0 -left-5"},{children:(0,r.jsx)(Yr.JO,{as:Xr.tOB})})),(0,r.jsx)("div",Object.assign({className:"font-semibold select-text"},{children:t.expression}))]})),(0,r.jsx)("div",Object.assign({className:"ml-6 text-gray-600 select-text"},{children:t.result}))]}))},Hr=e=>{const{datum:t}=e,n=Ct((e=>Ir(e,t)));return(0,r.jsx)("div",Object.assign({className:"absolute inset-x-0 top-[35px] bottom-0 flex flex-col overflow-y-auto"},{children:n.map((e=>(0,r.jsx)(Jr,{expression:e},e.id)))}))},Qr=e=>{const{datum:t}=e,[n,s]=(0,o.useState)(""),[i,a]=(0,o.useState)(null),l=Ct(Sr),c=Ct(_r),d=Ct((e=>Ir(e,t))),h=kt(),p=(0,o.useCallback)((e=>{a(null),s(e.target.value)}),[]),u=(0,o.useCallback)((e=>{var t;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(t=e.code,Kr.includes(t))))switch(e.code){case"ArrowUp":null===i?d.length>0&&a(0):i{e.preventDefault(),n.length>0&&(h(Be({id:`${c}`,datumId:t.id,expression:n})),s(""),a(null))}),[t,c,n]),g=l?"gray.500":"gray.300",f=l?"Enter an expression...":"Evaluator disabled";return(0,r.jsx)("div",Object.assign({className:"absolute inset-x-0 top-0 h-[35px]"},{children:(0,r.jsxs)("form",Object.assign({className:"relative block font-mono",onSubmit:m},{children:[(0,r.jsx)("span",Object.assign({className:"sr-only"},{children:"Search"})),(0,r.jsx)("span",Object.assign({className:"absolute inset-y-0 left-0 flex items-center pl-2"},{children:(0,r.jsx)(Yr.JO,{color:g,as:Xr.tOB})})),(0,r.jsx)("input",{className:"h-[35px] text-xs placeholder:italic placeholder:text-gray-400 placeholder:text-xs block bg-white w-full border-b border-gray-100 focus:border-gray-200 py-2 pl-9 pr-3 focus:outline-none",placeholder:f,type:"text",disabled:!l,value:null===i?n:d[i].expression,onChange:p,onKeyDown:u})]}))}))},Kr=["Unidentified","Escape","Enter","ControlLeft","ControlRight","ShiftLeft","ShiftRight","AltLeft","AltRight","CapsLock","OSLeft","OSRight","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","ScrollLock","ArrowLeft","ArrowRight"],eo=()=>{const e=Ct(yr);return e?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0"},{children:[(0,r.jsx)(Qr,{datum:e}),(0,r.jsx)(Hr,{datum:e})]})):null},to=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:Xr.RJr}),(0,r.jsx)(O,{children:"Evaluator"})]})),no=()=>{const e=Ct(zr);return(0,r.jsx)(b,Object.assign({h:"full",px:2,py:1,overflowY:"auto"},{children:e.map(((e,t)=>(0,r.jsx)(L,{text:e.text,time:new Date(e.time),variant:e.type},t)))}))},ro=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{className:"mt-0.5",as:Xr.t75}),(0,r.jsx)(O,{children:"Log"})]}));var oo=n(89583),so=n(47016),io=n(51649),ao=n(41947),lo=n(18124);const co={nodeWidth:100,nodeHeight:60,nodeSep:100,rankSep:100},ho={hidden:{builtinDisconnected:!0},nodes:[{shape:{shape:"rectangle",width:100,height:60},styles:{node:{stroke:"#333",strokeWidth:1,fill:"#ffffff"},label:{fontFamily:"monospace",fontSize:"14px",textAnchor:"middle",userSelect:"none",fill:"#333"}},props:{label:{dy:"0.33em"}},targets:["*"]}],edges:[{asAttribute:!1,sourceIndex:0,curve:{type:"bspline"},styles:{edge:{stroke:"#333",strokeWidth:1,fill:"none"},label:{fontFamily:"monospace",fontSize:"12px",textAnchor:"middle",userSelect:"none"}},targets:["*"]}]};function po(e,t){var n;return null===(n=e.edges)||void 0===n?void 0:n.find((e=>{const n=e.targets,r=n?n[0]:void 0;return void 0!==n&&1===n.length&&void 0!==r&&"*"!==r&&r.relation===t}))}function uo(e,t){var n;return null===(n=e.nodes)||void 0===n?void 0:n.find((e=>{const n=e.targets,r=n?n[0]:void 0;return void 0!==n&&1===n.length&&void 0!==r&&"*"!==r&&r.type===t}))}function mo(e,t){var n;if(wt(t)){const r=e.themeByGeneratorName[null!==(n=t.generatorName)&&void 0!==n?n:""],o=r&&r.projections||[];if(o){const e=t.parsed.instances[0];o.forEach((t=>{if(!t.atom){const n=t.type,r=Ke(pt(e,n));r.length&&(t.atom=r[0].id)}}))}const s=xn(o),i=t.parsed.instances,a=o.map((e=>e.atom)).filter(Je),l=i.map((e=>en(e,a))).map((e=>Rt(e,r)));e.layoutsByDatumId[t.id].layoutById[s]=function(e,t){const n=new Set,r={};e.forEach((e=>{B(e).forEach((e=>{n.add(e.id)})),V(e).forEach((e=>{r[e.id]=e}))}));const o=new(Ut().graphlib.Graph)({multigraph:!0});o.setGraph({nodesep:t.nodeSep,ranksep:t.rankSep,rankdir:"TB"}),n.forEach((e=>{o.setNode(e,{label:e,width:t.nodeWidth,height:t.nodeHeight})})),(0,qt.Z)(r,((e,t)=>{o.setEdge(e.source,e.target,{id:t})})),Ut().layout(o);const s=function(e,t){const n=e.nodes().map((t=>e.node(t).x)),r=e.nodes().map((t=>e.node(t).y)),o=(0,Yt.Z)(n),s=(0,Yt.Z)(r),i=(0,Xt.Z)(n),a=(0,Xt.Z)(r);return{x:(0,Jt.Z)(o)||(0,Jt.Z)(i)?0:(i-o)/2+t.nodeWidth/2,y:(0,Jt.Z)(s)||(0,Jt.Z)(a)?0:(a-s)/2+t.nodeHeight/2}}(o,t),i={},a={};return o.nodes().forEach((e=>{const{x:t,y:n}=o.node(e);i[e]={x:t-s.x,y:n-s.y}})),o.edges().forEach((e=>{const{id:t,points:n}=o.edge(e);a[t]=n.slice(1,-1).map((e=>({x:e.x-s.x,y:e.y-s.y})))})),{nodePositions:i,edgeWaypoints:a}}(l,co)}}const go={asAttributeSet:function(e,t){var n;const{datum:r,relation:o,asAttribute:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=po(i,o);if(e)s?(0,pn.Z)(e,["asAttribute"],!0):(0,ao.Z)(e,["asAttribute"]);else if(s){const e={targets:[{relation:o}],asAttribute:!0};i.edges||(i.edges=[]),i.edges.push((0,Ot.cA)(e))}}},curveRemoved:function(e,t){var n;const{datum:r,relation:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(s){const e=po(s,o);e&&(0,ao.Z)(e,["curve"])}},curveSet:function(e,t){var n;const{datum:r,relation:o,curve:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=po(i,o);if(e)(0,pn.Z)(e,["curve"],s);else{const e={targets:[{relation:o}],curve:s};i.edges||(i.edges=[]),i.edges.push((0,Ot.cA)(e))}}},edgeLabelStyleRemoved:function(e,t){var n;const{datum:r,relation:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=po(i,o);e&&(0,ao.Z)(e,["styles","label",s])}},edgeLabelStyleSet:function(e,t){var n;const{datum:r,relation:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=po(a,o);if(e)(0,pn.Z)(e,["styles","label",s],i);else{const e={targets:[{relation:o}],styles:{label:{[s]:i}}};a.edges||(a.edges=[]),a.edges.push((0,Ot.cA)(e))}}},edgeStyleRemoved:function(e,t){var n;const{datum:r,relation:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=po(i,o);e&&(0,ao.Z)(e,["styles","edge",s])}},edgeStyleSet:function(e,t){var n;const{datum:r,relation:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=po(a,o);if(e)(0,pn.Z)(e,["styles","edge",s],i);else{const e={targets:[{relation:o}],styles:{edge:{[s]:i}}};a.edges||(a.edges=[]),a.edges.push((0,Ot.cA)(e))}}},edgeIndexSet:function(e,t){var n;const{datum:r,relation:o,which:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const t=po(a,o);if(t)(0,pn.Z)(t,[s],i);else{const e={targets:[{relation:o}]};e[s]=i,a.edges||(a.edges=[]),a.edges.push((0,Ot.cA)(e))}mo(e,r)}},edgeIndexRemoved:function(e,t){var n;const{datum:r,relation:o,which:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=po(i,o);e&&(0,ao.Z)(e,[s])}},graphSpread:function(e,t){const{datum:n,matrix:r}=t.payload,o=e.matricesByDatumId[n.id];o&&(o.spreadMatrix=r)},graphZoomed:function(e,t){const{datum:n,matrix:r}=t.payload,o=e.matricesByDatumId[n.id];o&&(o.zoomMatrix=r)},hiddenRelationAdded:function(e,t){const{datum:n,type:r,relation:o}=t.payload;e.hiddenByDatumId[n.id][r]||(e.hiddenByDatumId[n.id][r]=[]),e.hiddenByDatumId[n.id][r].push(o)},nodeLabelPropRemoved:function(e,t){var n;const{datum:r,type:o,prop:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=uo(i,o);e&&(0,ao.Z)(e,["props","label",s])}},nodeLabelPropSet:function(e,t){var n;const{datum:r,type:o,prop:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=uo(a,o);if(e)(0,pn.Z)(e,["props","label",s],i);else{const e={targets:[{type:o}],props:{label:{[s]:i}}};a.nodes||(a.nodes=[]),a.nodes.push((0,Ot.cA)(e))}}},nodeLabelStyleRemoved:function(e,t){var n;const{datum:r,type:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=uo(i,o);e&&(0,ao.Z)(e,["styles","label",s])}},nodeLabelStyleSet:function(e,t){var n;const{datum:r,type:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=uo(a,o);if(e)(0,pn.Z)(e,["styles","label",s],i);else{const e={targets:[{type:o}],styles:{label:{[s]:i}}};a.nodes||(a.nodes=[]),a.nodes.push((0,Ot.cA)(e))}}},nodesOffset:function(e,t){var n;const{datum:r,offsets:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""],i=xn(s&&s.projections||[]),a=e.layoutsByDatumId[r.id].layoutById[i];(0,qt.Z)(o,((e,t)=>{const n=a.nodePositions[t];a.nodePositions[t]=se(n,e)}))},projectionAdded:function(e,t){var n;const{datum:r,type:o,atom:s,time:i,timeOrdering:a}=t.payload,l={type:o,atom:s,time:i,timeOrdering:a},c=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];c.projections?c.projections.push((0,Ot.cA)(l)):c.projections=[(0,Ot.cA)(l)],mo(e,r)},projectionOrderingSet:function(e,t){var n;const{datum:r,type:o,relation:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""],a=(i&&i.projections||[]).find((e=>e.type===o));a&&(s?a.timeOrdering=s:delete a.timeOrdering)},projectionRemoved:function(e,t){var n;const{datum:r,type:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];s.projections&&(0,lo.Z)(s.projections,(e=>e.type===o)),mo(e,r)},projectionSet:function(e,t){var n;const{datum:r,type:o,atom:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""],a=(i&&i.projections||[]).find((e=>e.type===o));a&&(a.atom=s),mo(e,r)},saveThemeRequested:function(e,t){var n;const{datum:r}=t.payload,o=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(o){const e=(0,Ot.Vk)(o),t=(0,Ot.Uy)(e,(e=>{var t;null===(t=e.projections)||void 0===t||t.forEach((e=>{(0,ao.Z)(e,"atom")}))})),n=JSON.stringify(t,null,2),r=document.createElement("a"),s=new Blob([n],{type:"application/json"});r.href=URL.createObjectURL(s),r.download="theme.json",r.click()}},shapeRemoved:function(e,t){var n;const{datum:r,type:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(s){const e=uo(s,o);e&&(0,ao.Z)(e,["shape"])}},shapeSet:function(e,t){var n;const{datum:r,type:o,shape:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=uo(i,o);if(e)(0,pn.Z)(e,["shape"],s);else{const e={targets:[{type:o}],shape:s};i.nodes||(i.nodes=[]),i.nodes.push((0,Ot.cA)(e))}}},shapeStyleRemoved:function(e,t){var n;const{datum:r,type:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=uo(i,o);e&&(0,ao.Z)(e,["styles","node",s])}},shapeStyleSet:function(e,t){var n;const{datum:r,type:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=uo(a,o);if(e)(0,pn.Z)(e,["styles","node",s],i);else{const e={targets:[{type:o}],styles:{node:{[s]:i}}};a.nodes||(a.nodes=[]),a.nodes.push((0,Ot.cA)(e))}}},themeFileLoaded:function(e,t){var n;const{datum:r,data:o}=t.payload;e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""]=JSON.parse(o),mo(e,r)},timeIndexSet:function(e,t){const{datum:n,index:r}=t.payload;e.timeByDatumId[n.id]=r}},fo=function(e,t){const{enter:n}=t.payload;n&&n.filter(wt).forEach((t=>{var n;const r=t.id;e.matricesByDatumId[t.id]={datumId:r,spreadMatrix:(0,ce.yR)(),zoomMatrix:(0,ce.yR)()};const o=null!==(n=t.generatorName)&&void 0!==n?n:"";o in e.themeByGeneratorName||(e.themeByGeneratorName[o]=(0,Ot.cA)(ho)),e.layoutsByDatumId[r]={datumId:r,layoutById:{}},mo(e,t),e.timeByDatumId[r]=0,e.hiddenByDatumId[r]={}}))},xo=(0,Le.oM)({name:"graphs",initialState:{layoutsByDatumId:{},matricesByDatumId:{},themeByGeneratorName:{},timeByDatumId:{},hiddenByDatumId:{}},reducers:go,extraReducers:e=>e.addCase(Ve,fo)}),{asAttributeSet:bo,edgeLabelStyleRemoved:yo,edgeLabelStyleSet:wo,edgeStyleRemoved:vo,edgeStyleSet:jo,edgeIndexSet:Ao,edgeIndexRemoved:Mo,curveRemoved:ko,curveSet:Co,graphSpread:Oo,graphZoomed:So,hiddenRelationAdded:Io,nodeLabelStyleRemoved:No,nodeLabelStyleSet:zo,nodeLabelPropRemoved:Do,nodeLabelPropSet:_o,nodesOffset:To,projectionAdded:Eo,projectionOrderingSet:Lo,projectionRemoved:Po,projectionSet:Ro,shapeRemoved:Bo,saveThemeRequested:Zo,shapeSet:Vo,shapeStyleRemoved:$o,shapeStyleSet:Fo,themeFileLoaded:Go,timeIndexSet:Wo}=xo.actions,Uo=xo.reducer,qo=e=>{const{datum:t}=e,n=kt(),s=Ct((e=>vr(e,t))),i=(0,cn.Z)(s),a=(0,o.useCallback)((e=>{const r=s[e][0];n(Eo({datum:t,type:e,atom:r,time:!0}))}),[t,s]);return 0===i.length?null:(0,r.jsx)(c.M5,Object.assign({my:2},{children:(0,r.jsxs)(so.v2,{children:[(0,r.jsx)(so.j2,Object.assign({as:A.zx,colorScheme:"green",size:"xs",leftIcon:(0,r.jsx)(io.f8n,{})},{children:"Add Time Projection"})),(0,r.jsx)(so.qy,{children:i.map((e=>(0,r.jsx)(so.sN,Object.assign({onClick:()=>a(e)},{children:e}),e)))})]})}))};var Yo=n(11391),Xo=n(5434);const Jo=e=>{const{type:t,atom:n,atoms:o,onChange:s,onNext:i,onPrevious:a,onRemove:l,onToggle:c}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",Object.assign({className:"text-sm px-2 flex items-center align-middle"},{children:t})),(0,r.jsx)("div",Object.assign({className:"flex items-center"},{children:(0,r.jsx)(Yo.Ph,Object.assign({className:"flex items-center",size:"xs",value:n,onChange:s},{children:o.map((e=>(0,r.jsx)("option",Object.assign({value:e},{children:e}),e)))}))})),(0,r.jsxs)("div",Object.assign({className:"px-2 flex items-center justify-end"},{children:[(0,r.jsxs)(A.hE,Object.assign({size:"xs",isAttached:!0},{children:[(0,r.jsx)(A.hU,{"aria-label":"Previous",icon:(0,r.jsx)(Xo.G1X,{}),onClick:a}),(0,r.jsx)(A.hU,{"aria-label":"Remove",icon:(0,r.jsx)(Xo.FU5,{}),onClick:l}),(0,r.jsx)(A.hU,{"aria-label":"Next",icon:(0,r.jsx)(Xo.FNi,{}),onClick:i})]})),(0,r.jsx)(Xo.G1X,{className:"-rotate-90 ml-2 cursor-pointer hover:text-black",onClick:c})]}))]})},Ho=e=>{const{type:t,atom:n,atoms:o,relation:s,relations:i,onChange:a,onNext:l,onPrevious:c,onRelation:d,onRemove:h,onToggle:p,onHiddenRelation:u}=e;return(0,r.jsxs)("div",Object.assign({className:"m-2 p-2 col-span-3 flex flex-col border shadow"},{children:[(0,r.jsxs)("div",Object.assign({className:"flex justify-between pb-3"},{children:[(0,r.jsx)("div",Object.assign({className:"text-sm font-bold"},{children:t})),(0,r.jsx)(Xo.G1X,{className:"rotate-90 cursor-pointer hover:text-black",onClick:p})]})),(0,r.jsxs)("div",Object.assign({className:"px-2 grid grid-cols-[minmax(max-content,auto)_minmax(max-content,auto)]"},{children:[(0,r.jsx)(Yo.Ph,Object.assign({size:"xs",value:n,onChange:a},{children:o.map((e=>(0,r.jsx)("option",Object.assign({value:e},{children:e}),e)))})),(0,r.jsx)("div",Object.assign({className:"mt-0.5 flex items-center justify-end"},{children:(0,r.jsxs)(A.hE,Object.assign({className:"px-2",size:"xs",isAttached:!0},{children:[(0,r.jsx)(A.zx,Object.assign({"aria-label":"Previous",leftIcon:(0,r.jsx)(Xo.G1X,{}),onClick:c},{children:"Previous"})),(0,r.jsx)(A.zx,Object.assign({"aria-label":"Next",rightIcon:(0,r.jsx)(Xo.FNi,{}),onClick:l},{children:"Next"}))]}))}))]})),(0,r.jsx)("div",Object.assign({className:"px-2 pt-2"},{children:s?(0,r.jsxs)("div",Object.assign({className:"px-2 text-sm flex justify-between items-center"},{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",Object.assign({className:"font-semibold"},{children:s}))," defines total order"]}),(0,r.jsx)(Xo.FU5,{onClick:()=>d(void 0)})]})):(0,r.jsxs)(so.v2,Object.assign({matchWidth:!0},{children:[(0,r.jsx)(so.j2,Object.assign({as:A.zx,width:"full",size:"xs",py:4},{children:"Select Ordering Relation"})),(0,r.jsx)(so.qy,{children:i.map((e=>(0,r.jsx)(so.sN,Object.assign({onClick:()=>d(e)},{children:e}),e)))})]}))})),(0,r.jsx)("div",Object.assign({className:"p-2"},{children:(0,r.jsxs)(so.v2,Object.assign({matchWidth:!0},{children:[(0,r.jsx)(so.j2,Object.assign({as:A.zx,width:"full",size:"xs",py:4},{children:"Hide a Relation"})),(0,r.jsx)(so.qy,{children:i.map((e=>(0,r.jsx)(so.sN,Object.assign({onClick:()=>u(e)},{children:e}),e)))})]}))})),(0,r.jsx)("div",Object.assign({className:"p-2"},{children:(0,r.jsx)(A.zx,Object.assign({"aria-label":"Remove",width:"full",size:"xs",py:4,colorScheme:"red",leftIcon:(0,r.jsx)(Xo.FU5,{}),onClick:h},{children:"Remove Projection"}))}))]}))},Qo=e=>{const{datum:t,projection:n,atoms:s,relations:i}=e,{type:a,atom:l,timeOrdering:c}=n,[d,h]=(0,o.useState)(!1),p=kt(),u=(0,o.useCallback)((e=>{const n=e.target.value;p(Ro({datum:t,type:a,atom:n}))}),[t,a]),m=(0,o.useCallback)((()=>{if(l){const e=s.indexOf(l);e>0&&p(Ro({datum:t,type:a,atom:s[e-1]}))}}),[t,a,s,l]),g=(0,o.useCallback)((()=>{p(Po({datum:t,type:a}))}),[t,a]),f=(0,o.useCallback)((()=>{if(l){const e=s.indexOf(l);-1!==e&&e{p(Lo({datum:t,type:a,relation:e}))}),[t,a]),b=(0,o.useCallback)((e=>{p(Io({datum:t,type:a,relation:e}))}),[t,a]),y=(0,o.useCallback)((()=>{h((e=>!e))}),[h]);return d?(0,r.jsx)(Ho,{type:a,atom:l,atoms:s,relation:c,relations:i,onChange:u,onNext:f,onPrevious:m,onRemove:g,onRelation:x,onToggle:y,onHiddenRelation:b}):(0,r.jsx)(Jo,{type:a,atom:l,atoms:s,relation:c,relations:i,onChange:u,onNext:f,onPrevious:m,onRemove:g,onRelation:x,onToggle:y,onHiddenRelation:b})},Ko=({datum:e})=>{const t=Ct((t=>Tr(0,e))),n=Ct((t=>Er(t,e))).filter((e=>!0===e.time)),o=Ct((t=>function(e,t){return wt(t)?dt(t.parsed.instances[0]).map((e=>e.name)):[]}(0,e)));return 0===n.length?null:(0,r.jsx)("div",Object.assign({className:"p-2 grid grid-cols-[minmax(min-content,max-content)_minmax(max-content,auto)_minmax(min-content,max-content)] gap-y-2"},{children:n.map((n=>{const s=n.type,i=t[s];return(0,r.jsx)(Qo,{datum:e,projection:n,atoms:i,relations:o},s)}))}))},es=({datum:e})=>Ct((t=>Mr(0,e)))?null:(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)(Ko,{datum:e}),(0,r.jsx)(qo,{datum:e})]}));var ts=n(47516);const ns=e=>{const{collapsed:t,current:n,length:o,onChange:s,label:i,loopBack:a,onToggleCollapse:l}=e;return(0,r.jsx)("div",Object.assign({className:"flex"},{children:(0,r.jsxs)(A.hE,Object.assign({width:"full",isAttached:!0,size:"sm"},{children:[(0,r.jsx)(A.hU,{"aria-label":"First State",icon:(0,r.jsx)(ts.pB9,{}),borderRadius:0,disabled:0===n,onClick:()=>s(0)}),(0,r.jsx)(A.hU,{"aria-label":"Previous State",borderRadius:0,icon:(0,r.jsx)(ts.u_m,{}),disabled:0===n,onClick:()=>s(n-1)}),(0,r.jsx)(c.M5,Object.assign({width:"full",px:2,fontSize:"xs",bg:"gray.100"},{children:i(n)})),void 0!==a&&n===o-1?(0,r.jsx)(A.hU,{"aria-label":"Loop Back",borderRadius:0,icon:(0,r.jsx)(ts.V3h,{}),onClick:()=>s(a)}):(0,r.jsx)(A.hU,{"aria-label":"First State",borderRadius:0,icon:(0,r.jsx)(ts.OEZ,{}),disabled:n===o-1,onClick:()=>s(n+1)}),(0,r.jsx)(A.hU,{"aria-label":"Previous State",icon:(0,r.jsx)(ts.xeH,{}),disabled:n===o-1,onClick:()=>s(o-1)}),(0,r.jsx)(A.hU,{"aria-label":"Toggle Minimap",size:"sm",borderRadius:0,borderLeftWidth:1,borderLeftColor:"gray.300",icon:t?(0,r.jsx)(ts.OrA,{}):(0,r.jsx)(ts.jRD,{}),onClick:()=>l()})]}))}))};function rs(e){const t={};return V(e).forEach((e=>{t[e.id]={type:"line"}})),t}function os(e){const t={};return V(e).forEach((e=>{t[`${e.id}`]={stroke:"#4A5568",strokeWidth:1,fill:"none"}})),t}function ss(e,t){const n={};return B(e).forEach((e=>{const r=e.id===`${t}`;n[`${e.id}`]=[{text:e.id,style:{fill:r?"white":"#4A5568",fontFamily:"monospace",fontSize:"10px",fontWeight:r?"bold":"normal",textAnchor:"middle",userSelect:"none",cursor:"pointer"},props:{dy:"0.4em"}}]})),n}function is(e){const t={};return B(e).forEach((e=>{t[`${e.id}`]={shape:"circle",radius:15}})),t}function as(e,t){const n={};return B(e).forEach((e=>{const r=e.id===`${t}`;n[e.id]={stroke:r?"#3B82F6":"#4A5568",strokeWidth:1,fill:r?"#3B82F6":"white",cursor:"pointer"}})),n}const ls=e=>{const t=function(e){return 50*(e.length-1)+45}(e),n=function(e){return void 0!==e.loopBack?75:45}(e),s=function(e){const{length:t,loopBack:n}=e,r=[],o=[],s=-50*(t-1)/2,i=void 0!==n?7.5:0;for(let e=0;e${e+1}`,source:`${e}`,target:`${e+1}`}):void 0!==n&&o.push({id:`${e}->${n}`,source:`${e}`,target:`${n}`,waypoints:[{x:s+50*e,y:i-30},{x:s+50*n,y:i-30}]});return zt(r,o)}(e),i=`${-t/2} ${-n/2} ${t} ${n}`,a=(0,o.useRef)(null);return(0,r.jsx)("div",Object.assign({className:"grid place-items-center overflow-y-auto"},{children:(0,r.jsx)(be,Object.assign({svg:a.current,onMouseDown:()=>console.log("down"),onClickNode:t=>{e.onChange&&e.onChange(+t)}},{children:(0,r.jsx)("svg",Object.assign({ref:a,style:{minWidth:t},width:t,height:n,viewBox:i},{children:(0,r.jsx)(Ie,{id:"minimap",graph:s,nodeShapes:is(s),nodeStyles:as(s,e.current),nodeLabels:ss(s,e.current),edgeCurves:rs(s),edgeStyles:os(s)})}))}))}))},cs=e=>{const{collapsed:t}=e;return(0,r.jsxs)("div",Object.assign({className:"border rounded mx-2"},{children:[(0,r.jsx)(ns,Object.assign({},e)),!t&&(0,r.jsx)(ls,Object.assign({},e))]}))},ds=({datum:e})=>{const t=kt(),[n,s]=(0,o.useState)(!1),i=Ct((t=>Gr(t,e))),a=Ct((t=>function(e,t){return wt(t)&&Qt(t.parsed)?t.parsed.instances.length:1}(0,e))),l=Ct((t=>function(e,t){if(t&&wt(t)&&Qt(t.parsed))return t.parsed.loopBack}(0,e))),c=(0,o.useCallback)((n=>{t(Wo({datum:e,index:n}))}),[e]);return(0,r.jsx)("div",Object.assign({className:"mx-1 my-2"},{children:(0,r.jsx)(cs,{collapsed:n,current:i,length:a,loopBack:l,label:e=>`State ${e+1}/${a}`,onChange:c,onToggleCollapse:()=>s((e=>!e))})}))},hs=({datum:e})=>Ct((t=>Mr(0,e)))?(0,r.jsx)("div",Object.assign({className:"flex flex-col justify-middle"},{children:(0,r.jsx)(ds,{datum:e})})):null,ps=()=>{const e=Ct(yr);return e?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:[(0,r.jsx)(es,{datum:e}),(0,r.jsx)(hs,{datum:e})]})):null},us=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:oo.rHK}),(0,r.jsx)(O,{children:"Time"})]}));var ms=n(47398);const gs={activeDatumSet:function(e,t){e.active=t.payload},dumpClicked:function(e){console.log((0,Ot.Vk)(e))}};var fs=n(3231),xs=n(54354),bs=n(20924);const ys=function(e,t){const{enter:n,update:r,exit:o}=t.payload;if(n){(0,fs.Z)(n,(t=>{const n=t.id;e.datumById[n]||(e.datumById[n]=t,e.datumIds.push(n))}));const t=(0,Et.Z)(n);t&&(e.active=t.id)}r&&(0,qt.Z)(r,(t=>{const n=t.id;e.datumById[n]&&(0,xs.Z)(e.datumById[n],t)})),o&&(0,qt.Z)(o,(t=>{if(e.datumById[t]){delete e.datumById[t];const n=(0,bs.Z)(e.datumIds,t);n>-1&&e.datumIds.splice(n,1),e.active===t&&(e.active=e.datumIds.length?e.datumIds[0]:null)}}))},ws=(0,Le.oM)({name:"data",initialState:{active:null,datumById:{},datumIds:[]},reducers:gs,extraReducers:e=>e.addCase(Ve,ys)}),{activeDatumSet:vs,dumpClicked:js}=ws.actions,As=ws.reducer;var Ms=n(2585),ks=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const{className:t,onClick:n}=e,o=ks(e,["className","onClick"]);return(0,r.jsx)("div",Object.assign({className:`contents ${n?"group":""} ${t||""}`,onClick:n},o))},Os=e=>{const{className:t}=e,n=ks(e,["className"]);return(0,r.jsx)("div",Object.assign({className:`\n flex items-center prose prose-sm truncate px-1 py-0.5 first:pl-2 last:pr-2 group-hover:bg-blue-600 group-active:bg-blue-700 group-hover:text-white select-none cursor-default group-hover:cursor-pointer ${t||""}`},n))},Ss=e=>{var t;const{datum:n,active:o,onClickItem:s}=e,i=Ct((e=>function(e,t){return Mr(0,t)}(0,n))),a=Ct((e=>function(e,t){return(Er(e,t)||[]).some((e=>!0===e.time))}(e,n))),l=o?"text-white bg-blue-600":"";return(0,r.jsxs)(Cs,Object.assign({onClick:e=>s(e,n)},{children:[(0,r.jsxs)(Os,Object.assign({className:l},{children:["Instance ",n.id," (from: '",null!==(t=n.generatorName)&&void 0!==t?t:"UNNAMED","')"]})),(0,r.jsx)(Os,Object.assign({className:l},{children:n.evaluator&&(0,r.jsx)(Yr.JO,{as:Xr.RJr})})),(0,r.jsxs)(Os,Object.assign({className:l},{children:[i&&(0,r.jsx)(Yr.JO,{as:oo.rHK}),a&&(0,r.jsx)(Yr.JO,{as:Ms.sYI})]}))]}))},Is=e=>{const{data:t,active:n}=e,s=kt(),i=(0,o.useCallback)(((e,t)=>{s(vs(t.id))}),[]);return(0,r.jsx)("div",Object.assign({className:"w-full grid grid-cols-[minmax(max-content,auto)_repeat(2,min-content)]"},{children:t.map((e=>{const{id:t}=e;return(0,r.jsx)(Ss,{datum:e,active:e===n,onClickItem:i},t)}))}))},Ns={mainViewChanged:function(e,t){e.mainView=t.payload},commonDrawerViewChanged:function(e,t){const n=t.payload;switch(e.mainView){case"GraphView":e.graphViewDrawer=n===e.graphViewDrawer?null:n;break;case"TableView":e.tableViewDrawer=n===e.tableViewDrawer?null:n;break;case"ScriptView":e.scriptViewDrawer=n===e.scriptViewDrawer?null:n}},graphDrawerViewChanged:function(e,t){const n=t.payload;e.graphViewDrawer=n===e.graphViewDrawer?null:n},graphDrawerThemeRelationToggled:function(e,t){const{datumId:n,relation:r}=t.payload,o=["graphDrawerThemeById",n,"expandedRelations",r],s=(0,hn.Z)(e,o);(0,pn.Z)(e,o,!s)},graphDrawerThemeTypeToggled:function(e,t){const{datumId:n,type:r}=t.payload,o=["graphDrawerThemeById",n,"expandedTypes",r],s=(0,hn.Z)(e,o);(0,pn.Z)(e,o,!s)},tableDrawerViewChanged:function(e,t){const n=t.payload;e.tableViewDrawer=n===e.tableViewDrawer?null:n},scriptDrawerViewChanged:function(e,t){const n=t.payload;e.scriptViewDrawer=n===e.scriptViewDrawer?null:n},selectedGeneratorChanged:function(e,t){const n=t.payload;e.selectedGenerator=n.generatorName}},zs=function(e,t){const n=t.payload;n.views&&(e.availableViews=n.views.map((e=>{switch(e){case"graph":return"GraphView";case"table":return"TableView";case"script":return"ScriptView"}})),e.mainView=e.availableViews[0],n.generators&&n.generators.length>0&&(e.selectedGenerator=n.generators[0]))},Ds={availableViews:["GraphView","TableView","ScriptView"],mainView:"ScriptView",graphViewDrawer:"explorer",tableViewDrawer:null,scriptViewDrawer:"variables",graphDrawerThemeById:{},selectedGenerator:void 0};const _s=(0,Le.oM)({name:"ui",initialState:Ds,reducers:Ns,extraReducers:e=>{e.addCase(Fe,zs)}}),{mainViewChanged:Ts,commonDrawerViewChanged:Es,graphDrawerViewChanged:Ls,graphDrawerThemeRelationToggled:Ps,graphDrawerThemeTypeToggled:Rs,tableDrawerViewChanged:Bs,scriptDrawerViewChanged:Zs,selectedGeneratorChanged:Vs}=_s.actions,$s=_s.reducer,Fs=()=>{const e=Ct(yr),t=Ct(Ar),n=Ct(Pr),s=kt(),i=Ct(wr);if(!e&&(!n||n.length<1))return null;const a=!t.some((e=>e.generatorName==i)),l=(0,o.useCallback)((()=>{void 0!==i&&a&&(console.log(`Running new generator: ${i}`),s(Pe({id:void 0,onClick:"next",context:{generatorName:i}})))}),[i,t]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(c.xu,Object.assign({p:1,shadow:"md",borderWidth:"1px"},{children:[(0,r.jsx)(c.X6,Object.assign({fontSize:"l",align:"center"},{children:"Select an Available Command"})),(0,r.jsxs)(c.kC,{children:[(0,r.jsx)(Yo.Ph,Object.assign({isDisabled:!n||n.length<1,value:i,onChange:e=>{const n=e.target.value,r=t.filter((e=>e.generatorName==n)).reverse()[0];console.log(`Selecting generator: ${n}. Latest id: ${null==r?void 0:r.id}`),s(Vs({generatorName:n})),s(vs(r?r.id:""))}},{children:null==n?void 0:n.map(((e,t)=>(0,r.jsx)("option",{children:e},t)))})),(0,r.jsx)(A.zx,Object.assign({size:"sm",margin:"1",onClick:l,isDisabled:!n||n.length<1||i&&(null==e?void 0:e.generatorName)===i||!a},{children:(0,r.jsx)(ms.u,Object.assign({hasArrow:!0,label:"Re-run Forge to refresh this command.",isDisabled:a},{children:"Run"}))}))]})]})),(0,r.jsx)(c.xu,Object.assign({p:1,shadow:"md",borderWidth:"1px"},{children:(0,r.jsxs)(c.X6,Object.assign({fontSize:"l",align:"center"},{children:["Instance History for ",(0,r.jsx)("i",{children:i})]}))})),(0,r.jsx)("hr",{}),(0,r.jsx)("div",Object.assign({"aria-label":"explorer pane instance selector",className:"absolute flex flex-col overflow-y-auto"},{children:(0,r.jsx)(Is,{data:t.filter((e=>e.generatorName==i)),active:e})}))]})},Gs=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:oo.rHK}),(0,r.jsx)(O,{children:"Explorer"})]}));var Ws=n(79352);const Us=e=>{const{datum:t}=e,n=kt(),s=Ct((e=>vr(e,t))),i=(0,cn.Z)(s),a=(0,o.useCallback)((e=>{const r=s[e][0];n(Eo({datum:t,type:e,atom:r}))}),[t,s]);return(0,r.jsx)(c.M5,Object.assign({my:2},{children:(0,r.jsxs)(so.v2,{children:[(0,r.jsx)(so.j2,Object.assign({as:A.zx,colorScheme:"green",size:"xs",leftIcon:(0,r.jsx)(io.f8n,{})},{children:"Add Projection"})),(0,r.jsx)(so.qy,{children:i.map((e=>(0,r.jsx)(so.sN,Object.assign({onClick:()=>a(e)},{children:e}),e)))})]})}))},qs=e=>{const{datum:t,projection:n,atoms:s}=e,{type:i,atom:a}=n,l=kt(),c=(0,o.useCallback)((e=>{const n=e.target.value;l(Ro({datum:t,type:i,atom:n}))}),[t,i]),d=(0,o.useCallback)((()=>{if(a){const e=s.indexOf(a);e>0&&l(Ro({datum:t,type:i,atom:s[e-1]}))}}),[t,i,s,a]),h=(0,o.useCallback)((()=>{l(Po({datum:t,type:i}))}),[t,i]),p=(0,o.useCallback)((()=>{if(a){const e=s.indexOf(a);-1!==e&&e(0,r.jsx)("option",Object.assign({value:e},{children:e}),e)))}))})),(0,r.jsx)("div",Object.assign({className:"px-2 flex items-center justify-end"},{children:(0,r.jsxs)(A.hE,Object.assign({size:"xs",isAttached:!0},{children:[(0,r.jsx)(A.hU,{"aria-label":"Previous",icon:(0,r.jsx)(Xo.G1X,{}),onClick:d}),(0,r.jsx)(A.hU,{"aria-label":"Remove",icon:(0,r.jsx)(Xo.FU5,{}),onClick:h}),(0,r.jsx)(A.hU,{"aria-label":"Next",icon:(0,r.jsx)(Xo.FNi,{}),onClick:p})]}))}))]})},Ys=({datum:e})=>{const t=Ct((t=>Tr(0,e))),n=Ct((t=>Er(t,e))).filter((e=>!0!==e.time));return 0===n.length?null:(0,r.jsx)("div",Object.assign({className:"p-2 grid grid-cols-[minmax(min-content,max-content)_minmax(max-content,auto)_minmax(min-content,max-content)] gap-y-2"},{children:n.map((n=>{const o=n.type,s=t[o];return(0,r.jsx)(qs,{datum:e,projection:n,atoms:s},o)}))}))},Xs=e=>{const{datum:t}=e;return(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)("div",Object.assign({className:"prose prose-md font-bold mx-2 my-2 border-b"},{children:"Projections"})),(0,r.jsx)(Ys,{datum:t}),(0,r.jsx)(Us,{datum:t})]}))};var Js=n(68133);const Hs=e=>{const{label:t,value:n,onChange:o}=e;return(0,r.jsxs)("div",Object.assign({className:"px-3 py-1 first:mt-2 last:mb-2 flex justify-end items-center hover:bg-slate-100"},{children:[(0,r.jsx)("div",Object.assign({className:"grow text-sm"},{children:t})),(0,r.jsx)(Js.XZ,{isChecked:n,onChange:e=>{o(e.target.checked)}})]}))},Qs=({onClick:e})=>(0,r.jsx)(Yr.JO,{className:"mx-2 cursor-pointer active:text-slate-500",onClick:e,as:Xo.FU5}),Ks=()=>(0,r.jsx)("div",Object.assign({className:"mx-2 px-2 text-xs text-slate-400 rounded-full bg-slate-200"},{children:"Inherited"})),ei=e=>{const{label:t,value:n,inherited:o,onChange:s,onRemove:i}=e;return(0,r.jsxs)("div",Object.assign({className:"px-3 py-1 first:mt-2 last:mb-2 flex items-center hover:bg-slate-100"},{children:[(0,r.jsx)("div",Object.assign({className:"grow text-sm"},{children:t})),o&&(0,r.jsx)(Ks,{}),!o&&(0,r.jsx)(Qs,{onClick:i}),(0,r.jsx)("input",{className:"cursor-pointer",type:"color",value:n,onChange:e=>{s(e.target.value)}})]}))},ti=e=>{const{label:t,value:n,inherited:o,onChange:s,onRemove:i}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",Object.assign({className:"px-3 py-1 first:mt-2 last:mb-2 flex items-center hover:bg-slate-100"},{children:[(0,r.jsx)("div",Object.assign({className:"grow text-sm"},{children:t})),o&&(0,r.jsx)(Ks,{}),!o&&(0,r.jsx)(Qs,{onClick:i}),(0,r.jsxs)(Yo.Ph,Object.assign({maxWidth:28,size:"xs",value:n.type,onChange:e=>{const t=e.target.value;s({type:t})}},{children:[(0,r.jsx)("option",Object.assign({value:"bspline"},{children:"B-Spline"})),(0,r.jsx)("option",Object.assign({value:"bundle"},{children:"Bundle"})),(0,r.jsx)("option",Object.assign({value:"cardinal"},{children:"Cardinal"})),(0,r.jsx)("option",Object.assign({value:"catmullrom"},{children:"Catmull-Rom"})),(0,r.jsx)("option",Object.assign({value:"line"},{children:"Line"})),(0,r.jsx)("option",Object.assign({value:"monotonex"},{children:"Monotone X"})),(0,r.jsx)("option",Object.assign({value:"monotoney"},{children:"Monotone Y"})),(0,r.jsx)("option",Object.assign({value:"natural"},{children:"Natural"})),(0,r.jsx)("option",Object.assign({value:"step"},{children:"Step"})),(0,r.jsx)("option",Object.assign({value:"stepafter"},{children:"Step After"})),(0,r.jsx)("option",Object.assign({value:"stepbefore"},{children:"Step Before"}))]}))]}))})};var ni=n(72773);const ri=e=>{const{label:t,value:n,inherited:o,onChange:s,onRemove:i}=e;return(0,r.jsxs)("div",Object.assign({className:"px-3 py-1 first:mt-2 last:mb-2 flex items-center hover:bg-slate-100"},{children:[(0,r.jsx)("div",Object.assign({className:"grow text-sm"},{children:t})),o&&(0,r.jsx)(Ks,{}),!o&&(0,r.jsx)(Qs,{onClick:i}),(0,r.jsxs)(ni.Y2,Object.assign({size:"sm",className:"w-20 text-xs",min:0,max:100,value:n,onChange:e=>{s(+e)}},{children:[(0,r.jsx)(ni.zu,{}),(0,r.jsxs)(ni.Fi,{children:[(0,r.jsx)(ni.WQ,{}),(0,r.jsx)(ni.Y_,{})]})]}))]}))},oi=e=>{const{label:t,value:n,inherited:o,onChange:s,onRemove:i}=e;return(0,r.jsxs)("div",Object.assign({className:"px-3 py-1 first:mt-2 last:mb-2 flex items-center hover:bg-slate-100"},{children:[(0,r.jsx)("div",Object.assign({className:"grow text-sm"},{children:t})),o&&(0,r.jsx)(Ks,{}),!o&&(0,r.jsx)(Qs,{onClick:i}),(0,r.jsx)("input",{className:"w-16 text-xs h-6",type:"text",value:n,onChange:e=>{s(e.target.value)}})]}))},si=e=>{const{datum:t,id:n}=e,o=kt(),s=Ct((e=>function(e,t,n){if(wt(t)){const r=Vt(t.parsed.instances[0],Fr(e,t)),o={};return["*",n].forEach((e=>{r[e].forEach((t=>{const r=(0,hn.Z)(t,["asAttribute"]),s=(0,hn.Z)(t,["sourceIndex"]),i=(0,hn.Z)(t,["targetIndex"]),a=(0,hn.Z)(t,["curve"]),l=(0,hn.Z)(t,["styles","edge","stroke"]),c=(0,hn.Z)(t,["styles","edge","strokeWidth"]),d=(0,hn.Z)(t,["styles","label","fontSize"]),h=(0,hn.Z)(t,["styles","label","fill"]);(0,pn.Z)(o,["asAttribute"],!0===r),(0,pn.Z)(o,["sourceIndex"],s),(0,pn.Z)(o,["targetIndex"],i),a&&((0,pn.Z)(o,["curve","value"],a),(0,pn.Z)(o,["curve","inherited"],e!==n)),l&&((0,pn.Z)(o,["stroke","value"],l),(0,pn.Z)(o,["stroke","inherited"],e!==n)),c&&((0,pn.Z)(o,["strokeWidth","value"],c),(0,pn.Z)(o,["strokeWidth","inherited"],e!==n)),d&&((0,pn.Z)(o,["fontSize","value"],d),(0,pn.Z)(o,["fontSize","inherited"],e!==n)),h&&((0,pn.Z)(o,["textColor","value"],h),(0,pn.Z)(o,["textColor","inherited"],e!==n))}))})),o}return{}}(e,t,n))),{asAttribute:i,curve:a,stroke:l,strokeWidth:c,fontSize:d,textColor:h,sourceIndex:p,targetIndex:u}=s,m=(e,r)=>{o(Ao({datum:t,relation:n,which:e,value:r}))},g=e=>{o(Mo({datum:t,relation:n,which:e}))},f=(e,r)=>{o(wo({datum:t,relation:n,style:e,value:r}))},x=e=>{o(yo({datum:t,relation:n,style:e}))},b=(e,r)=>{o(jo({datum:t,relation:n,style:e,value:r}))},y=e=>{o(vo({datum:t,relation:n,style:e}))};return(0,r.jsxs)("div",Object.assign({className:"flex flex-col"},{children:[a&&(0,r.jsx)(ti,{label:"Curve",value:a.value,inherited:a.inherited,onChange:e=>{o(Co({datum:t,relation:n,curve:e}))},onRemove:()=>{o(ko({datum:t,relation:n}))}}),void 0!==i&&(0,r.jsx)(Hs,{label:"Display as attribute",value:i,onChange:e=>{o(bo({datum:t,relation:n,asAttribute:e}))}}),(0,r.jsx)(ri,{label:"Source Index",value:p||0,inherited:!1,onChange:e=>m("sourceIndex",e||0),onRemove:()=>g("sourceIndex")}),(0,r.jsx)(ri,{label:"Target Index",value:u||"",inherited:!1,onChange:e=>m("targetIndex",e||1),onRemove:()=>g("targetIndex")}),l&&(0,r.jsx)(ei,{label:"Stroke",value:l.value,inherited:l.inherited,onChange:e=>b("stroke",e),onRemove:()=>y("stroke")}),c&&(0,r.jsx)(ri,{label:"Stroke Width",value:c.value,inherited:c.inherited,onChange:e=>b("strokeWidth",e),onRemove:()=>y("strokeWidth")}),d&&(0,r.jsx)(oi,{label:"Font Size",value:d.value,inherited:d.inherited,onChange:e=>f("fontSize",e),onRemove:()=>x("fontSize")}),h&&(0,r.jsx)(ei,{label:"Text Color",value:h.value,inherited:h.inherited,onChange:e=>f("fill",e),onRemove:()=>x("fill")})]}))};function ii(e){return"datum"===e.type}const ai=({depth:e})=>(0,r.jsx)("div",Object.assign({className:"flex"},{children:[...Array(e)].map(((e,t)=>(0,r.jsx)("div",{className:"pl-4 border-r"},t)))})),li=({hidden:e})=>e?(0,r.jsx)("div",{className:"self-center w-2 border-b mr-1 border-transparent"}):(0,r.jsx)("div",{className:"self-center w-2 border-b mr-1"}),ci=e=>{var t;const{datum:n,node:o,panel:s,isOpen:i,onToggle:a}=e,l=ii(o)&&i(o),c=o.level,d=o.text,h=s;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",Object.assign({className:"flex items-stretch border-l cursor-pointer hover:bg-blue-500 hover:text-white",onClick:()=>{ii(o)&&a(o)}},{children:[(0,r.jsx)(ai,{depth:c}),(0,r.jsx)(li,{hidden:0===c}),(0,r.jsx)("div",{children:d})]})),l&&(0,r.jsx)("div",Object.assign({className:"bg-slate-100 border-t border-b shadow-inner"},{children:(0,r.jsx)(h,{datum:n,id:o.id})})),null===(t=o.children)||void 0===t?void 0:t.map(((e,t)=>(0,r.jsx)(ci,{datum:n,node:e,panel:s,isOpen:i,onToggle:a},t)))]})},di=e=>{const{datum:t,tree:n,panel:o,isOpen:s,onToggle:i}=e;return(0,r.jsx)("div",Object.assign({className:"prose prose-sm"},{children:(0,r.jsx)(ci,{datum:t,node:n,panel:o,isOpen:s,onToggle:i})}))},hi=e=>{const{label:t,value:n,inherited:o,onChange:s,onRemove:i}=e,a="circle"===n.shape,l="rectangle"===n.shape,c=a?2*n.radius:Math.min(n.width,n.height)/2,d=(e,t)=>{if(void 0!==t)switch(n.shape){case"rectangle":s({shape:"rectangle",width:"width"===e?t:n.width,height:"height"===e?t:n.height});break;case"circle":s({shape:"circle",radius:t})}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",Object.assign({className:"px-3 py-1 first:mt-2 last:mb-2 flex items-center hover:bg-slate-100"},{children:[(0,r.jsx)("div",Object.assign({className:"grow text-sm"},{children:t})),o&&(0,r.jsx)(Ks,{}),!o&&(0,r.jsx)(Qs,{onClick:i}),(0,r.jsxs)(Yo.Ph,Object.assign({maxWidth:28,size:"xs",value:n.shape,onChange:e=>{switch(e.target.value){case"rectangle":s({shape:"rectangle",width:5/3*c,height:c});break;case"circle":s({shape:"circle",radius:c})}}},{children:[(0,r.jsx)("option",Object.assign({value:"circle"},{children:"Circle"})),(0,r.jsx)("option",Object.assign({value:"rectangle"},{children:"Rectangle"}))]}))]})),a&&(0,r.jsx)(ri,{label:"Radius",value:n.radius,inherited:o,onChange:e=>d("radius",e),onRemove:i}),l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ri,{label:"Width",value:n.width,inherited:o,onChange:e=>d("width",e),onRemove:i}),(0,r.jsx)(ri,{label:"Height",value:n.height,inherited:o,onChange:e=>d("height",e),onRemove:i})]})]})},pi=e=>{const{datum:t,id:n}=e,o=kt(),s=Ct((e=>function(e,t,n){if(wt(t)){const r=t.parsed.instances[0],o=$t(r,Fr(e,t)),s={};return["*","univ",...pt(r,n).types.slice().reverse()].forEach((e=>{o[e].forEach((t=>{const r=(0,hn.Z)(t,["shape"]),o=(0,hn.Z)(t,["styles","node","fill"]),i=(0,hn.Z)(t,["styles","node","stroke"]),a=(0,hn.Z)(t,["styles","node","strokeWidth"]),l=(0,hn.Z)(t,["styles","label","fontSize"]),c=(0,hn.Z)(t,["styles","label","fill"]);r&&((0,pn.Z)(s,["shape","value"],r),(0,pn.Z)(s,["shape","inherited"],e!==n)),o&&((0,pn.Z)(s,["fill","value"],o),(0,pn.Z)(s,["fill","inherited"],e!==n)),i&&((0,pn.Z)(s,["stroke","value"],i),(0,pn.Z)(s,["stroke","inherited"],e!==n)),a&&((0,pn.Z)(s,["strokeWidth","value"],a),(0,pn.Z)(s,["strokeWidth","inherited"],e!==n)),l&&((0,pn.Z)(s,["fontSize","value"],l),(0,pn.Z)(s,["fontSize","inherited"],e!==n)),c&&((0,pn.Z)(s,["textColor","value"],c),(0,pn.Z)(s,["textColor","inherited"],e!==n))}))})),s}return{}}(e,t,n))),{shape:i,stroke:a,strokeWidth:l,fill:c,fontSize:d,textColor:h}=s,p=(e,r)=>{o(zo({datum:t,type:n,style:e,value:r}))},u=e=>{o(No({datum:t,type:n,style:e}))},m=(e,r)=>{o(Fo({datum:t,type:n,style:e,value:r}))},g=e=>{o($o({datum:t,type:n,style:e}))};return(0,r.jsxs)("div",Object.assign({className:"flex flex-col"},{children:[i&&(0,r.jsx)(hi,{label:"Shape",value:i.value,inherited:i.inherited,onChange:e=>{o(Vo({datum:t,type:n,shape:e}))},onRemove:()=>{o(Bo({datum:t,type:n}))}}),c&&(0,r.jsx)(ei,{label:"Fill",value:c.value,inherited:c.inherited,onChange:e=>m("fill",e),onRemove:()=>g("fill")}),a&&(0,r.jsx)(ei,{label:"Stroke",value:a.value,inherited:a.inherited,onChange:e=>m("stroke",e),onRemove:()=>g("stroke")}),l&&(0,r.jsx)(ri,{label:"Stroke Width",value:l.value,inherited:l.inherited,onChange:e=>m("strokeWidth",e),onRemove:()=>g("strokeWidth")}),d&&(0,r.jsx)(oi,{label:"Font Size",value:d.value,inherited:d.inherited,onChange:e=>p("fontSize",e),onRemove:()=>u("fontSize")}),h&&(0,r.jsx)(ei,{label:"Text Color",value:h.value,inherited:h.inherited,onChange:e=>p("fill",e),onRemove:()=>u("fill")})]}))},ui=({datum:e})=>{const t=wt(e),n=t?function(e){const t=e.instances[0],n={},r=ut(t);return r.forEach((e=>{n[e.id]={type:"datum",id:e.id,text:e.id,level:e.types.length+1,children:[]}})),r.forEach((e=>{var t,r;const o=e.types;if(o.length>1){const r=o[1];null===(t=n[r].children)||void 0===t||t.push(n[e.id])}else"univ"!==e.id&&(null===(r=n.univ.children)||void 0===r||r.push(n[e.id]))})),{type:"header",text:"Types",level:0,children:[n.univ]}}(e.parsed):null,o=t?function(e){return{type:"header",text:"Relations",level:0,children:dt(e.instances[0]).map((e=>({type:"datum",id:e.id,text:e.name,level:1})))}}(e.parsed):null,s=kt();return(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)("div",Object.assign({className:"prose prose-md font-bold mx-2 my-2 border-b"},{children:"Styles"})),n&&(0,r.jsx)(di,{datum:e,tree:n,panel:pi,isOpen:t=>Ct((n=>function(e,t,n){return br.selectGraphDrawerThemeTypeExpanded(e.ui,t,n)}(n,e,t.id))),onToggle:t=>{s(Rs({type:t.id,datumId:e.id}))}}),o&&(0,r.jsx)(di,{datum:e,tree:o,panel:si,isOpen:t=>Ct((n=>function(e,t,n){return br.selectGraphDrawerThemeRelationExpanded(e.ui,t,n)}(n,e,t.id))),onToggle:t=>{s(Ps({relation:t.id,datumId:e.id}))}})]}))},mi=e=>{const{datum:t}=e,n=kt();return(0,r.jsxs)("form",Object.assign({className:"flex items-center space-x-2 px-2 py-1 bg-slate-100 border-b"},{children:[(0,r.jsx)("label",Object.assign({className:"block text-xs font-semibold border-0 rounded-md bg-slate-100 text-slate-900 px-4 py-1 shrink-0 transition hover:bg-slate-300 cursor-pointer",onClick:()=>{n(Zo({datum:t}))}},{children:"Save As..."})),(0,r.jsxs)("label",Object.assign({className:"block grow"},{children:[(0,r.jsx)("span",Object.assign({className:"sr-only"},{children:"Choose a theme file."})),(0,r.jsx)("input",{type:"file",className:"block w-full text-xs text-slate-500 file:mr-2 file:bg-slate-100 hover:file:bg-slate-300 file:transition file:text-slate-900 file:py-1 file:px-4 file:rounded-md file:border-0 file:text-xs file:font-semibold file:cursor-pointer",onChange:e=>{const r=e.target.files;r&&r[0].text().then((e=>{n(Go({datum:t,data:e}))}))}})]}))]}))},gi=()=>{const e=Ct(yr);return e?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:[(0,r.jsx)(mi,{datum:e}),(0,r.jsx)(Xs,{datum:e}),(0,r.jsx)(ui,{datum:e})]})):null},fi=()=>(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:Ws.wY1}),(0,r.jsx)(O,{children:"Theme"})]}));var xi=n(79762),bi=n(4612),yi=n(33441);const wi=()=>{const e=Ct(yr),[t,n]=(0,o.useState)("");return e?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto p-4"},{children:[(0,r.jsxs)(xi.NI,Object.assign({mt:4},{children:[(0,r.jsx)(xi.lX,{children:"Upload layout specification file"}),(0,r.jsx)(bi.II,{type:"file",accept:".cnd",onChange:e=>{var t;const r=null===(t=e.target.files)||void 0===t?void 0:t[0];if(r){const e=new FileReader;e.onload=e=>{var t;const r=null===(t=e.target)||void 0===t?void 0:t.result;n(r)},e.readAsText(r)}}})]})),(0,r.jsxs)(xi.NI,{children:[(0,r.jsx)(xi.lX,{children:"Layout Specification"}),(0,r.jsx)(yi.g,{minH:"20rem",value:t,onChange:e=>n(e.target.value)})]}),(0,r.jsx)(A.zx,Object.assign({onClick:n=>{n.preventDefault();const r=document.createElement("form");r.method="POST",r.action="http://localhost:3000",r.target="_blank";const o=document.createElement("input");o.type="hidden",o.name="cope",o.value=t,r.appendChild(o);const s=document.createElement("input");s.type="hidden",s.name="alloydatum",s.value=e.data,r.appendChild(s),document.body.appendChild(r),r.submit(),document.body.removeChild(r)},mt:4},{children:"Load layout"}))]})):null},vi=()=>(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:Ws.vWf}),(0,r.jsx)(O,{children:"Layout"})]})),ji=()=>{const e=Ct(Or);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Fs,{}),"state"===e&&(0,r.jsx)(ps,{}),"theme"===e&&(0,r.jsx)(gi,{}),"evaluator"===e&&(0,r.jsx)(eo,{}),"log"===e&&(0,r.jsx)(no,{}),"layout"===e&&(0,r.jsx)(wi,{})]})},Ai=()=>{const e=Ct(Or);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Gs,{}),"state"===e&&(0,r.jsx)(us,{}),"theme"===e&&(0,r.jsx)(fi,{}),"evaluator"===e&&(0,r.jsx)(to,{}),"log"===e&&(0,r.jsx)(ro,{}),"layout"===e&&(0,r.jsx)(vi,{})]})};var Mi=n(14578);const ki=e=>(0,r.jsx)("div",Object.assign({className:"contents group"},{children:e.children})),Ci=e=>(0,r.jsx)("div",Object.assign({className:"px-4 py-0.5 prose text-xs group-hover:bg-slate-100"},{children:e.children})),Oi=e=>(0,r.jsx)("div",Object.assign({className:"px-4 py-0.5 text-xs font-mono group-hover:bg-slate-100"},{children:e.children})),Si=e=>{const{variable:t}=e;return(0,r.jsxs)(ki,{children:[(0,r.jsx)(Oi,{children:t.name}),(0,r.jsx)(Ci,{children:void 0!==t.typeUrl?(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:t.typeUrl},{children:t.type})):t.type})]})},Ii=e=>{const{datum:t}=e,n=Ct((e=>Ur(e,t)));return(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)("div",Object.assign({className:"prose prose-md font-bold mx-2 my-2 border-b"},{children:"Datum Variables"})),(0,r.jsxs)("div",Object.assign({className:"grid grid-cols-2"},{children:[(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Variable"})),(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Type"})),n.map(((e,t)=>(0,r.jsx)(Si,{variable:e},t)))]}))]}))},Ni=()=>{const e=Ct(Br),t=Ct(Zr);return(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)("div",Object.assign({className:"prose prose-md font-bold mx-2 my-2 border-b"},{children:"Stage Variables"})),(0,r.jsxs)("div",Object.assign({className:"grid grid-cols-2"},{children:[(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Variable"})),(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Value"})),(0,r.jsxs)(ki,{children:[(0,r.jsx)(Oi,{children:e}),(0,r.jsxs)(Ci,{children:["svg"===e&&(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:"https://developer.mozilla.org/en-US/docs/Web/SVG"},{children:""})),"div"===e&&(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div"},{children:"
"})),"canvas"===e&&(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:"https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API"},{children:""}))]})]}),(0,r.jsxs)(ki,{children:[(0,r.jsx)(Oi,{children:"width"}),(0,r.jsx)(Oi,{children:t.width})]}),(0,r.jsxs)(ki,{children:[(0,r.jsx)(Oi,{children:"height"}),(0,r.jsx)(Oi,{children:t.height})]})]}))]}))},zi=e=>{const{datum:t}=e;return(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:[(0,r.jsx)(Ni,{}),(0,r.jsx)(Ii,{datum:t})]}))},Di=()=>(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:Mi.VuO}),(0,r.jsx)(O,{children:"Variables"})]})),_i=()=>{const e=Ct(yr),t=Ct(Rr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===t&&(0,r.jsx)(Fs,{}),"evaluator"===t&&(0,r.jsx)(eo,{}),"log"===t&&(0,r.jsx)(no,{}),"variables"===t&&e&&(0,r.jsx)(zi,{datum:e})]})},Ti=()=>{const e=Ct(Rr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Gs,{}),"evaluator"===e&&(0,r.jsx)(to,{}),"log"===e&&(0,r.jsx)(ro,{}),"variables"===e&&(0,r.jsx)(Di,{})]})},Ei=()=>{const e=Ct(yr);return e?(0,r.jsx)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:(0,r.jsx)(hs,{datum:e})})):null},Li=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Yr.JO,{as:oo.rHK}),(0,r.jsx)(O,{children:"Time"})]})),Pi=()=>{console.log("table drawer explorer!");const e=Ct($r);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Fs,{}),"state"===e&&(0,r.jsx)(Ei,{}),"evaluator"===e&&(0,r.jsx)(eo,{}),"log"===e&&(0,r.jsx)(no,{})]})},Ri=()=>{const e=Ct($r);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Gs,{}),"state"===e&&(0,r.jsx)(Li,{}),"evaluator"===e&&(0,r.jsx)(to,{}),"log"===e&&(0,r.jsx)(ro,{})]})},Bi=()=>{const e=Ct(Dr);return(0,r.jsxs)(x,{children:[(0,r.jsxs)(C,Object.assign({className:"border-b"},{children:["GraphView"===e&&(0,r.jsx)(Ai,{}),"TableView"===e&&(0,r.jsx)(Ri,{}),"ScriptView"===e&&(0,r.jsx)(Ti,{})]})),(0,r.jsxs)(k,{children:["GraphView"===e&&(0,r.jsx)(ji,{}),"TableView"===e&&(0,r.jsx)(Pi,{}),"ScriptView"===e&&(0,r.jsx)(_i,{})]})]})};var Zi=n(53854);const Vi=()=>{const e=kt(),t=Ct(jr),n=Ct(Dr);return(0,r.jsxs)(r.Fragment,{children:[t.includes("GraphView")&&(0,r.jsx)(M,Object.assign({isActive:"GraphView"===n,mr:1,leftIcon:(0,r.jsx)(ts.DvO,{}),onClick:()=>e(Ts("GraphView"))},{children:"Graph"})),t.includes("TableView")&&(0,r.jsx)(M,Object.assign({isActive:"TableView"===n,mr:1,leftIcon:(0,r.jsx)(oo.WHV,{}),onClick:()=>e(Ts("TableView"))},{children:"Table"})),t.includes("ScriptView")&&(0,r.jsx)(M,Object.assign({isActive:"ScriptView"===n,mr:1,leftIcon:(0,r.jsx)(Zi.aJo,{}),onClick:()=>e(Ts("ScriptView"))},{children:"Script"}))]})},$i=()=>(0,r.jsxs)(v,Object.assign({className:"shadow"},{children:[(0,r.jsx)(w,{}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)(c.LZ,{}),(0,r.jsx)(Vi,{})]}));var Fi=n(60155);const Gi=()=>{const e=kt(),t=Ct(Dr),n=Ct(Or);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(N,{text:"Time",rightIcon:(0,r.jsx)(oo.rHK,{}),isActive:"GraphView"===t&&"state"===n,onClick:()=>e(Ls("state"))}),(0,r.jsx)(N,{text:"Theme",rightIcon:(0,r.jsx)(Ws.wY1,{}),isActive:"GraphView"===t&&"theme"===n,onClick:()=>e(Ls("theme"))}),(0,r.jsx)(N,{text:"Layout",rightIcon:(0,r.jsx)(Xo.df2,{}),isActive:"GraphView"===t&&"layout"===n,onClick:()=>e(Ls("layout"))}),(0,r.jsx)(N,{text:"Settings",rightIcon:(0,r.jsx)(Fi.Fuo,{}),isActive:"GraphView"===t&&"settings"===n,onClick:()=>e(Ls("settings"))})]})},Wi=()=>{const e=kt(),t=Ct(Dr),n=Ct(Rr);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(N,{text:"Variables",rightIcon:(0,r.jsx)(Mi.VuO,{}),isActive:"ScriptView"===t&&"variables"===n,onClick:()=>e(Zs("variables"))}),(0,r.jsx)(N,{text:"Settings",rightIcon:(0,r.jsx)(Fi.Fuo,{}),isActive:"ScriptView"===t&&"settings"===n,onClick:()=>e(Zs("settings"))})]})},Ui=()=>{const e=kt(),t=Ct(Dr),n=Ct($r);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(N,{text:"Time",rightIcon:(0,r.jsx)(oo.rHK,{}),isActive:"TableView"===t&&"state"===n,onClick:()=>e(Bs("state"))}),(0,r.jsx)(N,{text:"Settings",rightIcon:(0,r.jsx)(Fi.Fuo,{}),isActive:"TableView"===t&&"settings"===n,onClick:()=>e(Bs("settings"))})]})},qi=()=>{const e=kt(),t=Ct(Dr),n=Ct(Cr);return(0,r.jsxs)(S,{children:["GraphView"===t&&(0,r.jsx)(Gi,{}),"TableView"===t&&(0,r.jsx)(Ui,{}),"ScriptView"===t&&(0,r.jsx)(Wi,{}),(0,r.jsx)(c.LZ,{}),(0,r.jsx)(N,{text:"Explorer",rightIcon:(0,r.jsx)(oo.rHK,{}),isActive:"explorer"===n,onClick:()=>e(Es("explorer"))}),(0,r.jsx)(N,{text:"Evaluator",rightIcon:(0,r.jsx)(Xr.RJr,{}),isActive:"evaluator"===n,onClick:()=>e(Es("evaluator"))}),(0,r.jsx)(N,{text:"Log",rightIcon:(0,r.jsx)(Xr.t75,{}),isActive:"log"===n,onClick:()=>e(Es("log"))})]})},Yi=e=>{const{datum:t,graphProps:n}=e,{id:s,graph:i,nodeShapes:a,nodeStyles:l,nodeLabels:c,nodeSuperscripts:h,edgeCurves:p,edgeLabels:u,edgeStyles:m}=(Ct((e=>function(e,t){return wn.selectSpreadMatrix(e.graphs,t)}(e,t))),Ct((e=>function(e,t){return wn.selectZoomMatrix(e.graphs,t)}(e,t))),n),g=kt(),f=((0,o.useCallback)((0,d.Z)((e=>(g(Oo({datum:t,matrix:e})),!0)),16,{trailing:!1}),[t]),(0,o.useCallback)((0,d.Z)((e=>(g(So({datum:t,matrix:e})),!0)),16,{trailing:!1}),[t]),(0,o.useCallback)((e=>{g(To({datum:t,offsets:e}))}),[t]));return(0,r.jsx)(Te,Object.assign({className:"absolute inset-0",callbacks:{onSelectionMoved:f}},{children:(0,r.jsx)(Ie,{id:s,graph:i,nodeShapes:a,nodeLabels:c,nodeSuperscripts:h,nodeStyles:l,edgeCurves:p,edgeLabels:u,edgeStyles:m})}))},Xi=e=>{const t=kt(),{datumId:n,button:s,generatorId:i}=e,{text:a,onClick:l,mouseover:c}=s,d=(0,o.useCallback)((()=>{t(Pe({id:n,onClick:l,context:{generatorName:i,id:n}}))}),[n,s]);return(0,r.jsx)(ms.u,Object.assign({hasArrow:!0,label:c,isDisabled:void 0===c},{children:(0,r.jsx)(Ee,Object.assign({onClick:d},{children:a}))}))},Ji=e=>{const{datum:t}=e,{id:n,parsed:o,buttons:s,generatorName:i}=t,a=o.command;return(0,r.jsxs)("div",Object.assign({className:"w-full flex item-center space-x-2 px-2"},{children:[(0,r.jsxs)(O,Object.assign({className:"text-gray-400"},{children:["ID: ",n]})),(0,r.jsx)(O,{children:a}),(0,r.jsx)("div",{className:"grow"}),s&&s.map(((e,t)=>(0,r.jsx)(Xi,{datumId:n,generatorId:i,button:e},t)))]}))},Hi=()=>{const e=Ct(yr),t=Ct((t=>Wr(t,e)));return(0,r.jsx)(x,Object.assign({className:"grid grid-flow-col divide-x divide-dashed"},{children:e&&t.map(((t,n)=>(0,r.jsx)("div",Object.assign({className:"relative"},{children:(0,r.jsxs)(x,{children:[(0,r.jsx)(C,Object.assign({className:"border-b"},{children:(0,r.jsx)(Ji,{datum:e})})),(0,r.jsx)(k,{children:(0,r.jsx)(Yi,{datum:e,graphProps:t})})]})}),n)))}))};var Qi=n(4953);const Ki=(0,Le.oM)({name:"script",initialState:{stage:"svg",stageDimensions:{width:0,height:0},text:"",scriptTextByDatumId:{}},reducers:{scriptStageDimensionsSet(e,t){e.stageDimensions=t.payload},scriptStageSet(e,t){e.stage=t.payload},scriptTextSet(e,t){e.text=t.payload},scriptTextByDatumSet(e,t){const{id:n,text:r}=t.payload;e.scriptTextByDatumId[n]=r}},extraReducers:e=>e.addCase(vs,((e,t)=>{e.text=e.scriptTextByDatumId[t.payload]})).addCase(Ve,((e,t)=>{const{enter:n,update:r,exit:o}=t.payload;if(n){(0,fs.Z)(n,(t=>{"visualizerConfig"in t.parsed&&"script"in t.parsed.visualizerConfig&&(e.scriptTextByDatumId[t.id]=t.parsed.visualizerConfig.script)}));const t=(0,Et.Z)(n);t&&(e.text=e.scriptTextByDatumId[t.id])}o&&(0,qt.Z)(o,(t=>{e.scriptTextByDatumId[t]=""}))}))}),{scriptStageSet:ea,scriptStageDimensionsSet:ta,scriptTextSet:na,scriptTextByDatumSet:ra}=Ki.actions,oa=Ki.reducer;var sa=n(76815);function ia(e){return(0,sa.pF)(e)}var aa=n(81493);const la="\nclass AlloyError {\n static error(source: string, message: string): Error;\n\n static missingAttribute(source: string, attribute: string): Error;\n\n static missingElement(source: string, element: string): Error;\n}\n\nclass AlloySignature extends AlloySet {\n private readonly _id;\n private readonly _atoms;\n private _subsignatures;\n\n /**\n * Create a new Alloy signature.\n *\n * @param id The signature's unique ID\n * @param atoms The atoms defined by the signature\n * @param proxy If provided, a proxied signature will be created.\n */\n constructor(id: string, atoms: AlloyAtom[], proxy?: AlloyProxy);\n\n /**\n * Get an atom by ID\n * @param id The atom ID\n * @returns An atom or null if there is no atom with the specified ID\n */\n atom(id: string): AlloyAtom | null;\n\n /**\n * Get an array of all atoms in this signature.\n * @param recursive If false, return only atoms defined by this signature,\n * if true, include atoms defined by all subsignatures as well.\n */\n atoms(recursive?: boolean): AlloyAtom[];\n\n /**\n * Create a clone of this signature.\n * @param proxy If provided, a proxied clone will be returned.\n */\n clone(proxy?: AlloyProxy): AlloySignature;\n\n /**\n * Get the signature ID.\n */\n id(): string;\n\n /**\n * Get an array of all signatures that extend this signature.\n * @param recursive If false, return only signatures that are immediate\n * children of this signature. If true, return all signatures that are\n * descendants of this signature.\n */\n subSignatures(recursive?: boolean): AlloySignature[];\n\n /**\n * Create a signature from an XML element and populate the signature with\n * atoms. Any signatures that extend the one defined in the element are not\n * created.\n *\n * @param element The XML `````` element\n * @param proxy If provided, a proxied signature with proxied atoms will be\n * returned.\n */\n static fromElement(element: Element, proxy?: AlloyProxy): AlloySignature;\n\n /**\n * Create the Int signature.\n *\n * @param bitwidth The integer bitwidth, which must be greater than or equal to zero.\n * @param proxy If provided, a proxied Int signature with proxied atoms will\n * be returned.\n */\n static intSignature(bitwidth: number, proxy?: AlloyProxy): AlloySignature;\n\n /**\n * TODO: Check and document this.\n * @param intsig\n * @param proxy\n */\n static seqIntSignature(\n intsig: AlloySignature,\n proxy?: AlloyProxy\n ): AlloySignature;\n\n /**\n * Build all signatures from an XML `````` element. All signatures are\n * populated with atoms.\n *\n * @param instance The XML `````` element\n * @param proxy If provided, all signatures and atoms will be proxied.\n * @returns A map of string IDs, as defined by the \"ID\" attribute for each\n * signature, to [[AlloySignature]] objects.\n */\n static signaturesFromXML(\n instance: Element,\n proxy?: AlloyProxy\n ): Map;\n\n /**\n * Get an array of signature types associated with an XML element. Typically\n * this is used when parsing a field or skolem, as each `````` and ``````\n * element will have a `````` child. This method parses the types defined\n * in this element and returns the corresponding signatures.\n *\n * @param element The XML element that has a child\n * @param sigIDs A map of signature IDs to signatures\n */\n static typesFromXML(\n element: Element,\n sigIDs: Map\n ): AlloySignature[];\n}\n\nclass AlloySet {\n protected _tuples: AlloyTuple[];\n\n /**\n * Create a new Alloy set.\n *\n * @param tuples The tuples contained in the set\n */\n constructor(tuples?: AlloyTuple[]);\n\n /**\n * Returns true if the set is empty, false if it is not.\n */\n empty(): boolean;\n\n /**\n * Returns true if this set is equivalent to the provided set, false otherwise.\n * @param that The set to compare to\n */\n equals(that: AlloySet): boolean;\n\n /**\n * Returns true if this set is a subset of the provided set, false otherwise.\n * @param that The set to compare to\n */\n in(that: AlloySet): boolean;\n\n /**\n * Perform a join operation with another set. This operation is equivalent\n * to the dot join operator in Alloy, in which this set is on the left side\n * of the dot and that set is on the right side.\n *\n * @param that The other set\n */\n join(that: AlloySet): AlloySet;\n\n /**\n * Create a printable string representation of this set.\n */\n toString(): string;\n\n /**\n * Get an array of all tuples in this set.\n */\n tuples(): AlloyTuple[];\n}\n\nclass AlloyTuple extends AlloySet {\n private _atoms;\n\n /**\n * Create a new Alloy tuple.\n *\n * @param atoms The atoms, in order, that comprise the tuple.\n */\n constructor(atoms: AlloyAtom[]);\n\n /**\n * Get an ordered list of the atoms in this tuple.\n */\n atoms(): AlloyAtom[];\n\n /**\n * Create a printable string representation of this tuple.\n */\n toString(): string;\n\n /**\n * Create an array of tuples from a node list of `````` XML elements.\n *\n * @param elements A node list of `````` elements, typically created\n * using the ```querySelectorAll()``` method on a `````` or\n * `````` element.\n * @param types An ordered array of signatures that define the type of each\n * atom in each tuple, typically created using [[AlloySignature.typesFromXML]].\n */\n static tuplesFromXML(\n elements: NodeListOf,\n types: AlloySignature[]\n ): AlloyTuple[];\n}\n\nclass AlloyProxy {\n private readonly _sets;\n\n constructor();\n\n applyProxy(set: T, id?: string): T;\n\n private _finalize;\n}\n\n/**\n * In Alloy, an atom is a primitive entity that is indivisible, immutable, and\n * uninterpreted.\n */\nclass AlloyAtom extends AlloySet {\n private readonly _id;\n\n constructor(id: string, proxy?: AlloyProxy);\n\n clone(proxy?: AlloyProxy): AlloyAtom;\n\n id(): string;\n\n static fromElement(element: Element, proxy?: AlloyProxy): AlloyAtom;\n}\n\nclass AlloyTypedSet extends AlloySet {\n private readonly _types;\n\n constructor(types: AlloySignature[], tuples: AlloyTuple[]);\n\n project(atoms: Map): void;\n\n types(): AlloySignature[];\n}\n\nexport class AlloyField extends AlloyTypedSet {\n private readonly _id;\n\n /**\n * Create a new Alloy field.\n * @param id The field's unique ID\n * @param types An array of signatures defining the types of each column of the field\n * @param tuples The tuples defined by the field\n * @param proxy If provided, a proxied signature will be created.\n * @param varName If provided, the variable name to assign to this field when proxied.\n */\n constructor(\n id: string,\n types: AlloySignature[],\n tuples: AlloyTuple[],\n proxy?: AlloyProxy,\n varName?: string\n );\n\n /**\n * Create a clone of this field\n *\n * @param signatures An array of signatures. When creating the clone of this\n * field, the types associated with each column are not cloned. Instead,\n * provide an array of signatures and this method will find the corresponding\n * types by signature ID in the array and use them to define types of the\n * cloned field.\n * @param proxy If provided, a proxied clone will be returned.\n */\n clone(signatures: AlloySignature[], proxy?: AlloyProxy): AlloyField;\n\n /**\n * Get the field ID.\n */\n id(): string;\n\n /**\n * Build all fields from an XML `````` element. All fields are\n * fully populated with tuples.\n *\n * @param instance The XML `````` element\n * @param sigIDs A map of signature string IDs to signature objects\n * @param proxy If provided, all fields will be proxied.\n */\n static fieldsFromXML(\n instance: Element,\n sigIDs: Map,\n proxy?: AlloyProxy\n ): AlloyField[];\n}\n\nclass AlloySkolem extends AlloyTypedSet {\n private readonly _id;\n\n constructor(\n id: string,\n types: AlloySignature[],\n tuples: AlloyTuple[],\n proxy?: AlloyProxy\n );\n\n clone(signatures: AlloySignature[], proxy?: AlloyProxy): AlloySkolem;\n\n id(): string;\n\n static skolemsFromXML(\n instance: Element,\n sigIDs: Map,\n proxy?: AlloyProxy\n ): AlloySkolem[];\n}\n\n/**\n * In Alloy, when you run a predicate or check an assertion, the analyzer\n * searches for an _instance_ of an _analysis constraint_: an assignment of\n * values to the variables of the constraint for which the constraint evaluates\n * to true [[Jackson 2012](http://softwareabstractions.org/)].\n */\nclass AlloyInstance {\n private _proxy;\n private _atoms;\n private _fields;\n private _signatures;\n private _skolems;\n private _projections;\n private _bitwidth;\n private _command;\n private _filename;\n private _sources;\n\n /**\n * Create a new Alloy instance. If no text is provided, an empty instance\n * is created.\n * @param text A string containing the XML output from an Alloy instance\n * @param index\n */\n constructor(text?: string, index?: number);\n\n /**\n * Get an atom by ID.\n * @param id The atom ID\n * @returns An atom or null if there is no atom with the specified ID\n */\n atom(id: string): AlloyAtom | null;\n\n /**\n * Get an array of all atoms in the instance.\n */\n atoms(): AlloyAtom[];\n\n /**\n * Get the bitwidth of the instance.\n */\n bitwidth(): number;\n\n /**\n * Generate a deep clone of the instance.\n * @throws Error if the instance does not have a univ signature.\n */\n clone(): AlloyInstance;\n\n /**\n * Get the command used to generate the instance.\n */\n command(): string;\n\n /**\n * Get a field by ID.\n * @param id The field ID\n * @returns A field or null if there is no field with the specified ID\n */\n field(id: string): AlloyField | null;\n\n /**\n * Get an array of all fields in the instance.\n */\n fields(): AlloyField[];\n\n /**\n * Get the full path of the model used to generate the instance.\n */\n filename(): string;\n\n /**\n * Project the instance over the specified atoms. There may be a maximum of\n * one atom per signature that is a direct descendant of the univ signature.\n * @param atoms The list of atoms over which to project the instance.\n * @returns A clone of the instance with the projection applied.\n * @throws Error if there is more than one atom provided for any signature\n * that is a direct descendant of the univ signature.\n */\n project(atoms: AlloyAtom[]): AlloyInstance;\n\n /**\n * Get the currently projected atoms.\n * @returns A Map object with key-value pairs mapping signatures to projected atoms\n */\n projections(): Map;\n\n /**\n * Get a signature by ID\n * @param id The signature ID\n * @returns A signature or null if there is no signature with the specified ID\n */\n signature(id: string): AlloySignature | null;\n\n /**\n * Get an array of all signatures in the instance.\n */\n signatures(): AlloySignature[];\n\n /**\n * Get a skolem by ID\n * @param id The skolem ID\n * @returns A skolem or null if there is no skolem with the specified ID\n */\n skolem(id: string): AlloySkolem | null;\n\n /**\n * Get an array of all skolems in the instance.\n */\n skolems(): AlloySkolem[];\n\n /**\n * Get all source files that define the model from which this instance was created.\n * @returns A Map object with key-value pairs mapping full path names to file contents\n */\n sources(): Map;\n\n /**\n * Get the univ signature.\n * @returns The univ signature if it exists, null if it does not\n */\n univ(): AlloySignature | null;\n\n private _buildFromXML;\n}",ca=e=>{const{initialText:t,variables:n,editorRef:s,stageRef:i,beforeUnmount:a,onExecute:l}=e,[c,d]=(0,o.useState)(),h=(0,o.useCallback)((e=>{s(e),d(e)}),[]);return(0,o.useEffect)((()=>{if(c){c.addCommand(aa.Fd.KeyMod.WinCtrl|aa.Fd.KeyCode.Enter,(()=>{l()}));const e="ts:filename/alloy.d.js",t=aa.Fd.Uri.parse(e);null!==aa.Fd.editor.getModel(t)||(aa.Fd.languages.typescript.javascriptDefaults.setExtraLibs([{content:la,filePath:"alloy.js"}]),aa.Fd.editor.createModel(la,"typescript",t))}}),[c,l,i]),(0,o.useEffect)((()=>{const e=function(e){return e.map((e=>`declare const ${e.name}: ${e.type};`)).join("\n")}(n);aa.Fd.languages.typescript.javascriptDefaults.setExtraLibs([{content:"\n/**\n * To anyone adding to this library in the future: please take the following steps when adding\n * new VisualObjects.\n *\n * 1. If the object is to be accessible within sterling, add it to library within ScriptViewImports.\n * 2. Add the name of the file, minus .d.ts, to the list within d3lib-def-compiler/src/D3LibDefCompiler.java.\n * 3. Run the typescript compiler (\"tsc\" in terminal) from within the d3-packages folder.\n * 4. Run the main method within D3LibDefCompiler.\n *\n * If these steps are not followed, the file's definitions will either not be accessible within\n * sterling, or will not show up in monaco.\n */\ndeclare type BoundingBoxGenerator = (r: number) => Coords;\ndeclare class VisualObject {\n center: () => Coords;\n children: VisualObject[];\n dependents: VisualObject[];\n bounding_box_lam: BoundingBoxGenerator;\n hasBoundingBox: boolean;\n /**\n * Top level class, which all other visual objects will extend.\n * @param coords position of the object on screen.\n */\n constructor(coords?: Coords | (() => Coords));\n boundingBox(): BoundingBox;\n getChildren(): VisualObject[];\n /**\n * Shifts object to have new given center\n * @param center new center of the object\n */\n setCenter(center: Coords | (() => Coords)): void;\n hasLam(): Boolean;\n getLam(): BoundingBoxGenerator;\n /**\n * Renders the object to the screen.\n * @param svg HTML Svg object to which the object should be rendered.\n */\n render(svg: any): void;\n}\n//# sourceMappingURL=VisualObject.d.ts.map\ninterface ShapeProps {\n center?: Coords | (() => Coords);\n color?: string | (() => string);\n borderWidth?: number | (() => number);\n borderColor?: string | (() => string);\n label?: string | (() => string);\n labelColor?: string | (() => string);\n labelSize?: number | (() => number);\n opacity?: number | (() => number);\n}\n/**\n * Generic class for a large suite of \"shape\"-like objects.\n * Generally includes anything with an inside and an outside.\n * All shapes come with builtin label.\n */\ndeclare class Shape extends VisualObject {\n color: () => string;\n borderWidth: () => number;\n borderColor: () => string;\n opacity: () => number;\n label: TextBox;\n /**\n * Constructs a generic shape object. This is a top-level class,\n * which should not be used except as super class for other specific\n * shapes.\n * @param coords coordinates of the shape\n * @param color color of shape's interior\n * @param borderWidth width of Shape's border\n * @param borderColor color of border\n * @param label text to display atop the shape\n * @param labelColor color of text\n * @param labelSize size of text\n * @param style\n */\n constructor(props: ShapeProps);\n setColor(color: string | (() => string)): void;\n setBorderWidth(borderWidth: number | (() => number)): void;\n setBorderColor(borderColor: string | (() => string)): void;\n setLabelText(text: string | (() => string)): void;\n setLabelColor(labelColor: string | (() => string)): void;\n setLabelSize(labelSize: number | (() => number)): void;\n}\n//# sourceMappingURL=Shape.d.ts.map\ndeclare class Pane {\n Children: VisualObject[];\n constructor();\n add(addNode: VisualObject): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Pane.d.ts.map\ninterface gridProps {\n grid_location: Coords | (() => Coords);\n cell_size: {\n x_size: number;\n y_size: number;\n };\n grid_dimensions: {\n x_size: number;\n y_size: number;\n };\n}\ndeclare class Grid extends VisualObject {\n /**\n *\n * As one of the most common expressions of a graph is a matrix, we offer functionality\n * for building a grid of cells, where you can add visual objects to each square in the grid,\n * and they are automatically formatted into the grid (where the center of the object is aligned\n * to the center of the grid)\n *\n * Note: grid size is fixed! You can't change the size of a grid once it's created\n *\n */\n private coords;\n config: gridProps;\n cells: Array>;\n gridlines: Array;\n constructor(props: gridProps);\n private check_bounding_box;\n add(coords: Coords, add_object: VisualObject, ignore_warning?: boolean): void;\n private center_helper;\n private fill_grid_lines;\n hide_grid_lines(): void;\n fill(coords: Coords, color: string): void;\n private check_coords;\n}\n{};\n//# sourceMappingURL=Grid.d.ts.map\ninterface RectangleProps extends ShapeProps {\n height: number | (() => number);\n width: number | (() => number);\n coords?: Coords | (() => Coords);\n}\ndeclare class Rectangle extends Shape {\n height: () => number;\n width: () => number;\n /**\n * Creates a logical rectangle object\n * @param height height (y direction)\n * @param width width (x direction)\n * @param coords coordinates of the top-left point\n * @param color color for interior\n * @param borderWidth width of border\n * @param borderColor color of border\n * @param label text for label\n * @param labelColor color for label text\n * @param labelSize size of label text\n */\n constructor(props: RectangleProps);\n boundingBox(): BoundingBox;\n setWidth(width: number | (() => number)): void;\n setHeight(height: number | (() => number)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Rectangle.d.ts.map\ninterface CircleProps extends ShapeProps {\n radius: number | (() => number);\n}\ndeclare class Circle extends Shape {\n radius: () => number;\n bounding_box_lam: BoundingBoxGenerator;\n /**\n * Creates a circle object at the given location\n * @param radius radius of circle\n * @param coords coordinates of circle's center\n * @param color color of interior\n * @param borderWidth width border\n * @param borderColor color for border\n * @param label text for label\n * @param labelColor color of label\n * @param labelSize size of label\n */\n constructor(props: CircleProps);\n boundingBox(): BoundingBox;\n setRadius(radius: number | (() => number)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Circle.d.ts.map\ndeclare class Stage {\n Children: VisualObject[];\n constructor();\n add(addObject: VisualObject): void;\n children_to_tree_recurse(root: VisualObject): VisTree;\n render(svg: any, document?: any): void;\n}\n//# sourceMappingURL=Stage.d.ts.map\ninterface TextBoxProps {\n text?: string | (() => string);\n coords?: Coords | (() => Coords);\n color?: string | (() => string);\n fontSize?: number | (() => number);\n}\ndeclare class TextBox extends VisualObject {\n text: () => string;\n fontSize: () => number;\n color: () => string;\n /**\n * Displays given text.\n * @param text text to display\n * @param coords location for center of text\n * @param color text color\n * @param fontSize size of the text\n */\n constructor(props: TextBoxProps);\n boundingBox(): BoundingBox;\n setText(text: string | (() => string)): void;\n setFontSize(fontSize: number | (() => number)): void;\n setTextColor(color: string | (() => string)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=TextBox.d.ts.map\ninterface LineProps {\n points?: Coords[] | (() => Coords)[];\n arrow?: boolean;\n color?: string | (() => string);\n width?: number | (() => number);\n opacity?: number | (() => number);\n style?: string | (() => string);\n}\ndeclare class Line extends VisualObject {\n pointsRelative: (() => Coords)[];\n color: () => string;\n width: () => number;\n opacity: () => number;\n arrow: boolean;\n style: () => string;\n /**\n * Creates a line on the given poitns.\n * @param points list of points for the line to pass through\n * @param color color of line\n * @param width width of line\n * @param opacity of the line\n */\n constructor(props: LineProps);\n boundingBox(): BoundingBox;\n setColor(color: string | (() => string)): void;\n setWidth(width: number | (() => number)): void;\n setOpacity(opacity: number | (() => number)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Line.d.ts.map\n/**\n * This class is not currently being used!!\n */\ndeclare class ConjoinedObject extends VisualObject {\n /**\n * Note: this code is untested!\n */\n children: VisualObject[];\n constructor(Children?: VisualObject[]);\n addOrdered(obj: VisualObject, index: number): void;\n add(obj: VisualObject): void;\n setCenter(coords: Coords): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=ConjoinedObject.d.ts.map\ninterface PolygonProps extends ShapeProps {\n points: Coords[] | (() => Coords)[];\n}\n/**\n * Class Representing Polygonal objects. Takes the form of any\n * series of points, and will form a polygon with said points as the boundary.\n */\ndeclare class Polygon extends Shape {\n pointsRelative: (() => Coords)[];\n /**\n * Constructs a polygon object\n * @param points list of points forming outside\n * @param color color of interior\n * @param borderWidth width of the border\n * @param borderColor color of the border\n * @param label text to label with\n * @param labelColor color of label text\n * @param labelSize size of the label\n */\n constructor(props: PolygonProps);\n boundingBox(): BoundingBox;\n render(svg: any): void;\n}\n//# sourceMappingURL=Polygon.d.ts.map\ninterface Node {\n name: string;\n neighbors: string[];\n}\ndeclare class Graph extends VisualObject {\n nodes: Node[];\n node_radius: number;\n fixed_nodes: number;\n graph_dimensions: number;\n node_to_location: any;\n constructor(coords?: Coords, graph_dimensions?: number, fixed_nodes?: number, node_radius?: number);\n setCenter(center: Coords): void;\n center(): {\n x: any;\n y: any;\n };\n add(Nodes: Node[]): void;\n private set_fixed_nodes;\n private set_malleable_nodes;\n check_add_set(Nodes: Node[]): void;\n render(svg: any): void;\n render_lines(svg: any, connections: string[][]): void;\n render_nodes(svg: any): void;\n}\n//# sourceMappingURL=Graph.d.ts.map\n/**\n * This is going to be a generic utility file. Primarily for factoring\n * out algorithms with a higher level of computational complexity.\n */\ndeclare function toFunc(defaultValue: T, t?: T | (() => T)): (() => T);\ninterface Coords {\n x: number;\n y: number;\n}\n/**\n * Generic props for representing a box around an object.\n */\ninterface BoundingBox {\n top_left: Coords;\n bottom_right: Coords;\n}\ndeclare function boxUnion(boxes: BoundingBox[]): {\n top_left: {\n x: number;\n y: number;\n };\n bottom_right: {\n x: number;\n y: number;\n };\n};\ninterface ExperimentalBoundingBox {\n lambda: (radians: number) => Coords;\n}\n/**\n * Simple method averaging the coordinate points in a series.\n * @param points\n * @returns\n */\ndeclare function averagePath(points: Coords[]): Coords;\n/**\n * Shifts a function list of points according to a shift variable\n * @param pointList\n * @param shift\n * @returns\n */\ndeclare function shiftList(pointList: (() => Coords)[], shift: () => Coords): (() => Coords)[];\n/**\n * Utility function returning bounding box for a list of points\n * @param pointList list of points as coords\n * @returns bounding box\n */\ndeclare function boundsOfList(pointList: Coords[]): BoundingBox;\n//# sourceMappingURL=Utility.d.ts.map\n/**\n * Interface for node in a tree with a visualObject\n */\ninterface VisTree {\n visualObject: VisualObject;\n children: VisTree[];\n}\ninterface TreeProps {\n root: VisTree;\n height: number;\n width: number;\n coords?: Coords | (() => Coords);\n edgeColor?: string;\n edgeWidth?: number;\n}\ndeclare class Tree extends VisualObject {\n root: VisTree;\n height: number;\n width: number;\n private lines;\n private subTrees;\n private coords;\n /**\n * Builds a tree object, pulling all children nodes into proper locations and\n * adding lines where necessary.\n * @param root root of the tree of visual objects\n * @param height height of box to bound the tree\n * @param width width of box to bound the tree\n * @param coords top left point of the tree\n */\n constructor(props: TreeProps);\n private setUpSubtrees;\n setLineColor(color: string): void;\n setLineWidth(width: number): void;\n}\n//# sourceMappingURL=Tree.d.ts.map\n",filePath:"helpers.ts"},{content:la+"\n"+e,filePath:"alloy.js"},{content:e,filePath:"variables.ts"}])}),[c,n]),(0,r.jsx)(aa.ZP,{"data-testid":"script-view-monaco-editor",language:"javascript",options:{automaticLayout:!0,scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:12},value:t},editorDidMount:h,editorWillUnmount:e=>{const t=e.getValue();a(t)}})},da=e=>{const t=kt(),{datumId:n,button:s,generatorId:i}=e,{text:a,onClick:l,mouseover:c}=s,d=(0,o.useCallback)((()=>{t(Pe({id:n,onClick:l,context:{generatorName:i,id:n}}))}),[n,s]);return(0,r.jsx)(ms.u,Object.assign({hasArrow:!0,label:c,isDisabled:void 0===c},{children:(0,r.jsx)(Ee,Object.assign({onClick:d},{children:a}))}))},ha=e=>{const{onExecute:t}=e,n=Ct(Br),s=kt(),i=(0,o.useCallback)((e=>{s(ea(e))}),[]);return(0,r.jsxs)("div",Object.assign({className:"flex"},{children:[(0,r.jsx)(ms.u,Object.assign({hasArrow:!0,label:""},{children:(0,r.jsx)(A.zx,Object.assign({colorScheme:"blue",size:"xs",onClick:t},{children:"Run"}))})),(0,r.jsxs)(A.hE,Object.assign({className:"pl-2",isAttached:!0,colorScheme:"blue",size:"xs"},{children:[(0,r.jsx)(A.zx,Object.assign({isActive:"div"===n,onClick:()=>i("div")},{children:"
"})),(0,r.jsx)(A.zx,Object.assign({isActive:"canvas"===n,onClick:()=>i("canvas")},{children:""})),(0,r.jsx)(A.zx,Object.assign({isActive:"svg"===n,onClick:()=>i("svg")},{children:""}))]}))]}))},pa=e=>{const{datum:t,onExecute:n}=e,{id:o,parsed:s,buttons:i}=t,a=s.command;return(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center space-x-2 px-2"},{children:[(0,r.jsxs)(O,Object.assign({className:"text-gray-400"},{children:["ID: ",o]})),(0,r.jsx)(O,{children:a}),(0,r.jsx)("div",{className:"grow"}),(0,r.jsx)(ha,{onExecute:n}),i&&i.map(((e,n)=>(0,r.jsx)(da,{datumId:o,generatorId:t.generatorName,button:e},n)))]}))},ua=e=>{const{datum:t}=e,n=kt(),s=(0,Qi.pm)(),i=Ct(Br),a=Ct(Zr),l=Ct(Vr),c=Ct((e=>Ur(e,t))),[d,h]=(0,o.useState)(),[p,u]=(0,o.useState)(null),m=(0,o.useRef)(null);Ne(m,(e=>{n(ta({width:e.width,height:e.height}))}));const g=(0,o.useCallback)((e=>{h(e)}),[]),f=(0,o.useCallback)((e=>{e&&u(e)}),[]),b=(0,o.useCallback)((e=>{e&&u(e)}),[]),y=(0,o.useCallback)((e=>{e&&u(e)}),[]),w=(0,o.useCallback)((e=>{n(na(e)),n(ra({id:t.id,text:e}))}),[t]),v=(0,o.useCallback)((()=>{const e=null==d?void 0:d.getValue();if(e&&p&&a){n(na(e)),n(ra({id:t.id,text:e}));const[r,o]=function(e){const t=e.split("\n"),n=[];let r=0;for(let e=0;e{try{new Function(i,"width","height",...Kn.map((e=>e.name)),...c.map((e=>e.name)),...r.map((e=>function(e){return e.replaceAll("-","_")}(e))),o)(p,a.width,a.height,...Kn.map((e=>e.value)),...c.map((e=>e.variable)),...e)}catch(e){s({variant:"top-accent",position:"bottom-right",title:e instanceof Error?e.name:"Error",description:ma(e),status:"error",duration:1e4,isClosable:!0})}}))}}),[d,i,p,a,c]);return(0,r.jsxs)(x,{children:[(0,r.jsx)(C,Object.assign({className:"border-b"},{children:(0,r.jsx)(pa,{datum:t,onExecute:v})})),(0,r.jsx)(k,{children:(0,r.jsxs)("div",Object.assign({className:"grid grid-cols-2 divide-x h-full"},{children:[(0,r.jsxs)(x,Object.assign({ref:m,className:"relative"},{children:["div"===i&&(0,r.jsx)("div",{ref:y,className:"w-full h-full"}),"canvas"===i&&(0,r.jsx)("canvas",{ref:b,className:"w-full h-full"}),"svg"===i&&(0,r.jsx)("div",Object.assign({"aria-label":"SVG Visualization",id:"svg-container",style:{height:"100%",width:"100%",overflow:"scroll"}},{children:(0,r.jsx)("svg",{ref:f,style:{width:"100%",height:"100%",backgroundColor:"snow"}})}))]})),(0,r.jsx)(x,Object.assign({className:"relative","aria-label":"Visualization Script","data-testid":"script-editor-pane"},{children:(0,r.jsx)(ca,{initialText:l,variables:c,editorRef:g,stageRef:p,beforeUnmount:w,onExecute:v})}))]}))})]})};function ma(e){if(!(e instanceof Error))return`${e}`;if(console.log(`Error stack: ${e.stack}`),null!=e.stack){const t=e.stack.match(new RegExp(".*(Function|):[0-9]+:[0-9]+.*","g"));if(t){const n=t[0].split(new RegExp(".*Function:|:"))[1].split(":");console.log(`rowCol: ${JSON.stringify(n)}`);const r=+n[0]-2;return n[1],`${e.message} Around line ${r} (computed via parsing error stack)`}}return`${e.message} (error location was not provided by the browser)`}const ga=()=>{const e=Ct(yr);return e?(0,r.jsx)(ua,{datum:e,"data-testid":"script-view-datum"}):null},fa=e=>{const{data:t}=e,n={gridTemplateColumns:`repeat(${t.data.length>0?t.data[0].length:0}, minmax(0, 1fr))`,borderCollapse:"collapse",textAlign:"left"};return(0,r.jsxs)("table",Object.assign({className:"prose shadow m-2 boarder prose text-xs font-mono",summary:t.title,role:"table",style:n},{children:[(0,r.jsx)("caption",Object.assign({className:"prose prose-sm font-semibold px-2 py-1 border shadow",style:{textAlign:"left"}},{children:t.title})),(0,r.jsx)("thead",Object.assign({className:"bg-slate-100"},{children:(0,r.jsx)("tr",{children:t.headers&&t.headers.map(((e,t)=>(0,r.jsx)("th",Object.assign({className:"font-semibold px-2 py-0.5",scope:"col","aria-labelledby":e},{children:e}),`header-${t}`)))})})),(0,r.jsx)("tbody",{children:t.data.map(((e,t)=>(0,r.jsx)("tr",{children:e.map(((e,n)=>(0,r.jsx)("td",Object.assign({className:"px-2 py-0.5 bg-white boarder",headers:`header-${n}`},{children:e}),`${t}${n}`)))},`row-${t}`)))})]}))},xa=e=>{const{datum:t}=e,n=Ct((e=>qr(e,t)));return(0,r.jsx)(r.Fragment,{children:n.map(((e,t)=>(0,r.jsx)(fa,{data:e},t)))})},ba=e=>{const{datum:t}=e,{id:n,parsed:o,buttons:s}=t,i=o.command;return(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center space-x-2 px-2"},{children:[(0,r.jsxs)(O,Object.assign({className:"text-gray-400"},{children:["ID: ",n]})),(0,r.jsx)(O,{children:i}),(0,r.jsx)("div",{className:"grow"}),s&&s.map(((e,o)=>(0,r.jsx)(da,{datumId:n,generatorId:t.generatorName,button:e},o)))]}))},ya=()=>{const e=Ct(yr);return e?(0,r.jsxs)(x,{children:[(0,r.jsx)(C,{children:(0,r.jsx)(ba,{datum:e})}),(0,r.jsx)(k,{children:(0,r.jsx)("div",Object.assign({className:"w-full h-full flex content-start items-start flex-wrap overflow-y-auto"},{children:(0,r.jsx)(xa,{datum:e})}))})]}):null},wa=()=>{const e=Ct(Dr);return(0,r.jsxs)(x,{children:["GraphView"===e&&(0,r.jsx)(Hi,{}),"TableView"===e&&(0,r.jsx)(ya,{}),"ScriptView"===e&&(0,r.jsx)(ga,{})]})};var va=n(97375);const ja=e=>{const{isConnected:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const t=Ct(Nr),n=Ct(Lr),o=t?`Connected to ${n}`:"Not connected to a provider",s=t?"Connected":"Disconnected";return(0,r.jsx)(ms.u,Object.assign({hasArrow:!0,label:o},{children:(0,r.jsxs)(c.M5,Object.assign({},e,{children:[(0,r.jsx)(ja,{isConnected:t}),(0,r.jsx)(c.xv,Object.assign({mx:1,userSelect:"none"},{children:s}))]}))}))};var Ma=n(68016);const ka=function(e,t){const{id:n,result:r}=t.payload;e.expressionsById[n].result=r},Ca=function(e,t){const{id:n,datumId:r,expression:o}=t.payload,s=e.orderByDatumId[r]||[];e.nextExpressionId+=1,e.expressionsById[n]={id:n,datumId:r,expression:o,result:""},e.orderByDatumId[r]=[n,...s]},Oa=(0,Le.oM)({name:"evaluator",initialState:{nextExpressionId:0,expressionsById:{},orderByDatumId:{}},reducers:{},extraReducers:e=>e.addCase($e,ka).addCase(Be,Ca)}),{}=Oa.actions,Sa=Oa.reducer;function Ia(e){return{type:"message",time:(new Date).toJSON(),text:e}}function Na(e){return{type:"error",time:(new Date).toJSON(),text:e}}const za=function(e,t){e.items.push(Ia(`Datum selected - Datum ID: ${t.payload}`))},Da=function(e,t){const{id:n,onClick:r}=t.payload;e.items.push(Ia(`Click button - Datum ID: ${n} - Button: ${r}`))},_a=function(e,t){const{enter:n,update:r,exit:o}=t.payload,s=(null==n?void 0:n.length)||0,i=(null==r?void 0:r.length)||0,a=(null==o?void 0:o.length)||0;e.items.push(Ia(`Receive data: ${s} enter, ${i} update, ${a} exit.`))},Ta=function(e){e.items.push(Ia("Request data."))},Ea=function(e,t){const{name:n}=t.payload;e.items.push(Ia(`Receive metadata from ${n}.`))},La=function(e){e.items.push(Ia("Connection established."))},Pa=function(e,t){e.items.push(Na(t.payload))},Ra=function(e){e.items.push(Ia("Connection lost."))},Ba=function(e,t){e.items.push(Na(t.payload))},Za=(0,Le.oM)({name:"log",initialState:{items:[],filters:["message","warning","error"],sort:"ascending"},reducers:{filtersChanged:function(e,t){e.filters=t.payload},logCleared:function(e){e.items=[]},sortOrderChanged:function(e,t){e.sort=t.payload}},extraReducers:e=>e.addCase(vs,za).addCase(Pe,Da).addCase(Ve,_a).addCase(Re,Ta).addCase(Fe,Ea).addCase(Ue,La).addCase(qe,Pa).addCase(Ye,Ra).addCase(Xe,Ba)}),{logCleared:Va,sortOrderChanged:$a,filtersChanged:Fa}=Za.actions,Ga=Za.reducer,Wa=function(e,t){const{name:n,generators:r}=t.payload;e.providerName=n||"unknown provider",e.providerGenerators=null==r?void 0:r.slice()},Ua=function(e){e.connected=!0},qa=function(e){e.connected=!1},Ya=(0,Le.oM)({name:"provider",initialState:{connected:!1,providerName:"unknown provider",providerGenerators:void 0},reducers:{},extraReducers:e=>e.addCase(Fe,Wa).addCase(Ue,Ua).addCase(Ye,qa)}),{}=Ya.actions,Xa=Ya.reducer,Ja=(0,Le.xC)({reducer:{data:As,evaluator:Sa,graphs:Uo,log:Ga,provider:Xa,script:oa,ui:$s},middleware:e=>e().prepend(function(){let e=null,t=0;const n=()=>{window.clearInterval(t),t=0},r=()=>{e&&e.close()},o=()=>{e&&e.send("ping")},s=(i,a)=>{const l=i.dispatch;let c=!1;e&&r(),a=a||`ws://localhost:${window.location.search.slice(1)}`,e=new WebSocket(a),e.onopen=()=>{c=!0,window.setTimeout((()=>o()),3e3),l(Ue()),n()},e.onclose=()=>{c&&(c=!1,l(Ye())),e&&e.readyState===WebSocket.CLOSED&&(n(),t=window.setInterval((()=>s(i,a)),1e3))},e.onmessage=e=>{"pong"===e.data?window.setTimeout((()=>o()),3e3):jt(e.data,i)}};return t=>n=>o=>(Ge.match(o)?s(t,o.payload):We.match(o)?r():Pe.match(o)?function(e,t,n){if(!e)return At(t);Mt(e,function(e,t){return{type:"click",version:1,payload:t}}(0,n))}(e,t,o.payload):Re.match(o)?function(e,t){if(!e)return At(t);Mt(e,{type:"data",version:1})}(e,t):Be.match(o)?function(e,t,n){if(!e)return At(t);Mt(e,function(e,t){return{type:"eval",version:1,payload:t}}(0,n))}(e,t,o.payload):Ze.match(o)&&function(e,t){if(!e)return At(t);Mt(e,{type:"meta",version:1})}(e,t),n(o))}(),(e=>t=>n=>{if(!Ue.match(n))return t(n);t(n),e.dispatch(Ze()),e.dispatch(Re())}))});function Ha({isOpen:e,onClose:t}){const n=(0,o.useRef)(null);let[s,i]=(0,o.useState)("");const a=(0,Qi.pm)(),l=(0,o.useRef)(null);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(Ma.u_,Object.assign({isOpen:e,onClose:t},{children:[(0,r.jsx)(Ma.ZA,{}),(0,r.jsxs)(Ma.hz,Object.assign({maxW:"70rem"},{children:[(0,r.jsx)(Ma.xB,{children:(0,r.jsx)(c.M5,{children:"Input Alloy-style XML datum (paste directly or load from file)"})}),(0,r.jsx)(Ma.ol,{}),(0,r.jsxs)(Ma.fe,Object.assign({pb:6},{children:[(0,r.jsx)(A.zx,Object.assign({onClick:()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.click()}},{children:"Click to add XML from file"})),' ...or simply paste in an XML datum below. Then click the "Add Datum" button.',(0,r.jsx)(c.LZ,{h:"1rem"}),(0,r.jsx)(c.iz,{orientation:"horizontal",mx:5}),(0,r.jsx)(c.LZ,{h:"1rem"}),(0,r.jsxs)(xi.NI,{children:[(0,r.jsx)(xi.lX,{children:"XML datum string to add"}),(0,r.jsx)(yi.g,{minH:"20rem",ref:n,placeholder:'\n\n \n \n \n\n\n',value:s,onChange:e=>i(e.target.value)})]})]})),(0,r.jsxs)(Ma.mz,{children:[(0,r.jsx)(A.zx,Object.assign({onClick:()=>{var e;const r=null===(e=n.current)||void 0===e?void 0:e.value;if(void 0===r)return void t();const o=Ja.getState().data.datumIds;console.log(o);const s=o.reduce(((e,t)=>isNaN(parseInt(t))?e:Math.max(e,parseInt(t)+1)),0);try{Ja.dispatch(Ve({enter:[vt({id:s.toString(),format:"alloy",data:r,buttons:[],evaluator:!1})],update:[],exit:[]}))}catch(e){a({variant:"top-accent",position:"bottom-right",title:e instanceof Error?e.name:"Error adding instance",description:e instanceof Error?e.message:"No further information is available.",status:"error",duration:1e4,isClosable:!0})}t()}},{children:"Add Datum"})),(0,r.jsx)(bi.II,{type:"file",ref:l,style:{display:"none"},onChange:e=>{var t;const n=new FileReader;n.onload=e=>{return t=this,n=void 0,o=function*(){var t;(null===(t=e.target)||void 0===t?void 0:t.result)&&(e.target.result instanceof ArrayBuffer?i(e.target.result.toString()):i(e.target.result))},new((r=void 0)||(r=Promise))((function(e,s){function i(e){try{l(o.next(e))}catch(e){s(e)}}function a(e){try{l(o.throw(e))}catch(e){s(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,a)}l((o=o.apply(t,n||[])).next())}));var t,n,r,o},(null===(t=e.target)||void 0===t?void 0:t.files)&&e.target.files.length>0&&n.readAsText(e.target.files[0])}})]})]}))]}))})}function Qa({isOpen:e,onClose:t}){const n=Ct(Dr);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(Ma.u_,Object.assign({isOpen:e,onClose:t},{children:[(0,r.jsx)(Ma.ZA,{}),(0,r.jsxs)(Ma.hz,Object.assign({maxW:"70rem"},{children:[(0,r.jsx)(Ma.xB,{children:(0,r.jsx)(c.M5,{children:"Using Sterling"})}),(0,r.jsx)(Ma.ol,{}),(0,r.jsxs)(Ma.fe,Object.assign({pb:6},{children:[(0,r.jsxs)(c.xu,Object.assign({as:"ul",listStyleType:"circle"},{children:[(0,r.jsxs)("li",{children:["Use the ",(0,r.jsx)("strong",{children:"evaluator"})," tab to query the value of expressions and constraints."]}),(0,r.jsxs)("li",{children:["The ",(0,r.jsx)("strong",{children:"explorer"})," tab lets you pick a run to visualize. Click on any prior instance to reload it in the visualizer."]})]})),(0,r.jsx)(c.iz,{orientation:"horizontal",colorScheme:"blackAlpha"}),"ScriptView"===n&&(0,r.jsx)(el,{}),"GraphView"===n&&(0,r.jsx)(Ka,{}),"TableView"===n&&(0,r.jsx)(tl,{})]}))]}))]}))})}function Ka(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.M5,{children:(0,r.jsx)("strong",{children:"Graph View"})}),(0,r.jsxs)(c.xu,Object.assign({as:"ul",listStyleType:"circle"},{children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"Zoom"})," with the mouse wheel or with ",(0,r.jsx)("em",{children:"two fingers"})," on the trackpad."]}),(0,r.jsxs)("li",{children:["Use the ",(0,r.jsx)("strong",{children:"theme"})," tab on the sidebar to adjust styling options such as node coloring by sig, source and destination for edges, etc. You can also save the theme-definition file or load one you've already created."]}),(0,r.jsxs)("li",{children:["The ",(0,r.jsx)("strong",{children:"time"})," tab will let you adjust the layout according to time index, if that is appropriate for your model. In a Temporal model, you'll see a minimap and have the option to move back and forth in time. In a model that isn't explicitly temporal, you can still declare a sig as the time index and use it to navigate."]}),(0,r.jsxs)("li",{children:["The ",(0,r.jsx)("strong",{children:"layout"})," tab opens the CnD interface, which is an alternative graph-based visualization that gives more control over your instance diagram."]})]}))]})}function el(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.M5,{children:(0,r.jsx)("strong",{children:"Script View"})}),(0,r.jsx)(c.xu,{as:"ul",listStyleType:"circle"})]})}function tl(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.M5,{children:(0,r.jsx)("strong",{children:"Table View"})}),(0,r.jsx)(c.xu,{as:"ul",listStyleType:"circle"})]})}const nl=()=>{const e=kt(),t=(0,va.qY)(),n=(0,va.qY)();return(0,r.jsxs)(z,Object.assign({"data-testid":"app-status-bar"},{children:[(0,r.jsxs)("div",Object.assign({className:"cursor-pointer hover:text-gray-500",onClick:n.onOpen},{children:[(0,r.jsx)(c.LZ,{width:"50px"}),(0,r.jsx)(c.M5,{children:(0,r.jsx)("strong",{children:"Help"})})]})),(0,r.jsx)(Qa,{isOpen:n.isOpen,onClose:n.onClose}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)(c.LZ,{}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)("div",Object.assign({className:"cursor-pointer hover:text-gray-500",onClick:t.onOpen},{children:"Manual Datum"})),(0,r.jsx)(Ha,{isOpen:t.isOpen,onClose:t.onClose}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)("div",Object.assign({className:"cursor-pointer hover:text-gray-500",onClick:()=>{e(js())}},{children:"Console Dump"})),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)(Aa,{})]}))},rl={layout:{drawerWidth:350,drawerMinWidth:100,drawerMaxWidth:600,explorerWidth:250,explorerMinWidth:60,explorerMaxWidth:250}};var ol=n(93379),sl=n.n(ol),il=n(7795),al=n.n(il),ll=n(90569),cl=n.n(ll),dl=n(3565),hl=n.n(dl),pl=n(19216),ul=n.n(pl),ml=n(44589),gl=n.n(ml),fl=n(50992),xl={};xl.styleTagTransform=gl(),xl.setAttributes=hl(),xl.insert=cl().bind(null,"head"),xl.domAPI=al(),xl.insertStyleElement=ul(),sl()(fl.Z,xl),fl.Z&&fl.Z.locals&&fl.Z.locals,s.render((0,r.jsx)(o.StrictMode,{children:(0,r.jsx)(a.xjn,Object.assign({theme:_},{children:(0,r.jsx)(i.zt,Object.assign({store:Ja},{children:(0,r.jsx)((e=>{const{url:t}=e,{layout:n}=rl,s=kt(),i=Ct(kr);return(0,o.useEffect)((()=>(s(Ge(t)),()=>{s(We())})),[t,s]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(m,Object.assign({rightPaneCollapsed:i,rightPaneInitialWidth:n.drawerWidth,rightPaneMinWidth:n.drawerMinWidth,rightPaneMaxWidth:n.drawerMaxWidth},{children:[(0,r.jsx)(wa,{}),(0,r.jsx)(Bi,{})]})),(0,r.jsx)(qi,{}),(0,r.jsx)($i,{}),(0,r.jsx)(nl,{})]})}),{url:void 0})}))}))}),document.getElementById("root"))},50992:(e,t,n)=>{n.d(t,{Z:()=>b});var r=n(8081),o=n.n(r),s=n(23645),i=n.n(s),a=n(61667),l=n.n(a),c=new URL(n(70909),n.b),d=new URL(n(133),n.b),h=new URL(n(23601),n.b),p=new URL(n(1686),n.b),u=i()(o()),m=l()(c),g=l()(d),f=l()(h),x=l()(p);u.push([e.id,"/*\n! tailwindcss v3.0.13 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n*/\n\nhtml {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n -o-tab-size: 4;\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 4 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font family by default.\n2. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\n[type='button'],\n[type='reset'],\n[type='submit'] {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/*\nEnsure the default browser behavior of the `hidden` attribute.\n*/\n\n[hidden] {\n display: none;\n}\n\n[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n background-color: #fff;\n border-color: #6b7280;\n border-width: 1px;\n border-radius: 0px;\n padding-top: 0.5rem;\n padding-right: 0.75rem;\n padding-bottom: 0.5rem;\n padding-left: 0.75rem;\n font-size: 1rem;\n line-height: 1.5rem;\n --tw-shadow: 0 0 #0000;\n}\n\n[type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: #2563eb;\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n border-color: #2563eb;\n}\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n color: #6b7280;\n opacity: 1;\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n color: #6b7280;\n opacity: 1;\n}\n\ninput::placeholder,textarea::placeholder {\n color: #6b7280;\n opacity: 1;\n}\n\n::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n}\n\n::-webkit-date-and-time-value {\n min-height: 1.5em;\n}\n\nselect {\n background-image: url("+m+");\n background-position: right 0.5rem center;\n background-repeat: no-repeat;\n background-size: 1.5em 1.5em;\n padding-right: 2.5rem;\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n}\n\n[multiple] {\n background-image: initial;\n background-position: initial;\n background-repeat: unset;\n background-size: initial;\n padding-right: 0.75rem;\n -webkit-print-color-adjust: unset;\n color-adjust: unset;\n}\n\n[type='checkbox'],[type='radio'] {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: 0;\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n display: inline-block;\n vertical-align: middle;\n background-origin: border-box;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n flex-shrink: 0;\n height: 1rem;\n width: 1rem;\n color: #2563eb;\n background-color: #fff;\n border-color: #6b7280;\n border-width: 1px;\n --tw-shadow: 0 0 #0000;\n}\n\n[type='checkbox'] {\n border-radius: 0px;\n}\n\n[type='radio'] {\n border-radius: 100%;\n}\n\n[type='checkbox']:focus,[type='radio']:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);\n --tw-ring-offset-width: 2px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: #2563eb;\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n}\n\n[type='checkbox']:checked,[type='radio']:checked {\n border-color: transparent;\n background-color: currentColor;\n background-size: 100% 100%;\n background-position: center;\n background-repeat: no-repeat;\n}\n\n[type='checkbox']:checked {\n background-image: url("+g+");\n}\n\n[type='radio']:checked {\n background-image: url("+f+");\n}\n\n[type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus {\n border-color: transparent;\n background-color: currentColor;\n}\n\n[type='checkbox']:indeterminate {\n background-image: url("+x+');\n border-color: transparent;\n background-color: currentColor;\n background-size: 100% 100%;\n background-position: center;\n background-repeat: no-repeat;\n}\n\n[type=\'checkbox\']:indeterminate:hover,[type=\'checkbox\']:indeterminate:focus {\n border-color: transparent;\n background-color: currentColor;\n}\n\n[type=\'file\'] {\n background: unset;\n border-color: inherit;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-size: unset;\n line-height: inherit;\n}\n\n[type=\'file\']:focus {\n outline: 1px auto -webkit-focus-ring-color;\n}\n\n*, ::before, ::after {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n.prose {\n color: var(--tw-prose-body);\n max-width: 65ch;\n}\n.prose :where([class~="lead"]):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-lead);\n font-size: 1.25em;\n line-height: 1.6;\n margin-top: 1.2em;\n margin-bottom: 1.2em;\n}\n.prose :where(a):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-links);\n text-decoration: underline;\n font-weight: 500;\n}\n.prose :where(strong):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-bold);\n font-weight: 600;\n}\n.prose :where(ol):not(:where([class~="not-prose"] *)) {\n list-style-type: decimal;\n padding-left: 1.625em;\n}\n.prose :where(ol[type="A"]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-alpha;\n}\n.prose :where(ol[type="a"]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-alpha;\n}\n.prose :where(ol[type="A" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-alpha;\n}\n.prose :where(ol[type="a" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-alpha;\n}\n.prose :where(ol[type="I"]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-roman;\n}\n.prose :where(ol[type="i"]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-roman;\n}\n.prose :where(ol[type="I" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-roman;\n}\n.prose :where(ol[type="i" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-roman;\n}\n.prose :where(ol[type="1"]):not(:where([class~="not-prose"] *)) {\n list-style-type: decimal;\n}\n.prose :where(ul):not(:where([class~="not-prose"] *)) {\n list-style-type: disc;\n padding-left: 1.625em;\n}\n.prose :where(ol > li):not(:where([class~="not-prose"] *))::marker {\n font-weight: 400;\n color: var(--tw-prose-counters);\n}\n.prose :where(ul > li):not(:where([class~="not-prose"] *))::marker {\n color: var(--tw-prose-bullets);\n}\n.prose :where(hr):not(:where([class~="not-prose"] *)) {\n border-color: var(--tw-prose-hr);\n border-top-width: 1px;\n margin-top: 3em;\n margin-bottom: 3em;\n}\n.prose :where(blockquote):not(:where([class~="not-prose"] *)) {\n font-weight: 500;\n font-style: italic;\n color: var(--tw-prose-quotes);\n border-left-width: 0.25rem;\n border-left-color: var(--tw-prose-quote-borders);\n quotes: "\\201C""\\201D""\\2018""\\2019";\n margin-top: 1.6em;\n margin-bottom: 1.6em;\n padding-left: 1em;\n}\n.prose :where(blockquote p:first-of-type):not(:where([class~="not-prose"] *))::before {\n content: open-quote;\n}\n.prose :where(blockquote p:last-of-type):not(:where([class~="not-prose"] *))::after {\n content: close-quote;\n}\n.prose :where(h1):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 800;\n font-size: 2.25em;\n margin-top: 0;\n margin-bottom: 0.8888889em;\n line-height: 1.1111111;\n}\n.prose :where(h1 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 900;\n}\n.prose :where(h2):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 700;\n font-size: 1.5em;\n margin-top: 2em;\n margin-bottom: 1em;\n line-height: 1.3333333;\n}\n.prose :where(h2 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 800;\n}\n.prose :where(h3):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n font-size: 1.25em;\n margin-top: 1.6em;\n margin-bottom: 0.6em;\n line-height: 1.6;\n}\n.prose :where(h3 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 700;\n}\n.prose :where(h4):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n margin-top: 1.5em;\n margin-bottom: 0.5em;\n line-height: 1.5;\n}\n.prose :where(h4 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 700;\n}\n.prose :where(figure > *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.prose :where(figcaption):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-captions);\n font-size: 0.875em;\n line-height: 1.4285714;\n margin-top: 0.8571429em;\n}\n.prose :where(code):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-code);\n font-weight: 600;\n font-size: 0.875em;\n}\n.prose :where(code):not(:where([class~="not-prose"] *))::before {\n content: "`";\n}\n.prose :where(code):not(:where([class~="not-prose"] *))::after {\n content: "`";\n}\n.prose :where(a code):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-links);\n}\n.prose :where(pre):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-pre-code);\n background-color: var(--tw-prose-pre-bg);\n overflow-x: auto;\n font-weight: 400;\n font-size: 0.875em;\n line-height: 1.7142857;\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n border-radius: 0.375rem;\n padding-top: 0.8571429em;\n padding-right: 1.1428571em;\n padding-bottom: 0.8571429em;\n padding-left: 1.1428571em;\n}\n.prose :where(pre code):not(:where([class~="not-prose"] *)) {\n background-color: transparent;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-weight: inherit;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n}\n.prose :where(pre code):not(:where([class~="not-prose"] *))::before {\n content: none;\n}\n.prose :where(pre code):not(:where([class~="not-prose"] *))::after {\n content: none;\n}\n.prose :where(table):not(:where([class~="not-prose"] *)) {\n width: 100%;\n table-layout: auto;\n text-align: left;\n margin-top: 2em;\n margin-bottom: 2em;\n font-size: 0.875em;\n line-height: 1.7142857;\n}\n.prose :where(thead):not(:where([class~="not-prose"] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-th-borders);\n}\n.prose :where(thead th):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n vertical-align: bottom;\n padding-right: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-left: 0.5714286em;\n}\n.prose :where(tbody tr):not(:where([class~="not-prose"] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-td-borders);\n}\n.prose :where(tbody tr:last-child):not(:where([class~="not-prose"] *)) {\n border-bottom-width: 0;\n}\n.prose :where(tbody td):not(:where([class~="not-prose"] *)) {\n vertical-align: baseline;\n padding-top: 0.5714286em;\n padding-right: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-left: 0.5714286em;\n}\n.prose {\n --tw-prose-body: #374151;\n --tw-prose-headings: #111827;\n --tw-prose-lead: #4b5563;\n --tw-prose-links: #111827;\n --tw-prose-bold: #111827;\n --tw-prose-counters: #6b7280;\n --tw-prose-bullets: #d1d5db;\n --tw-prose-hr: #e5e7eb;\n --tw-prose-quotes: #111827;\n --tw-prose-quote-borders: #e5e7eb;\n --tw-prose-captions: #6b7280;\n --tw-prose-code: #111827;\n --tw-prose-pre-code: #e5e7eb;\n --tw-prose-pre-bg: #1f2937;\n --tw-prose-th-borders: #d1d5db;\n --tw-prose-td-borders: #e5e7eb;\n --tw-prose-invert-body: #d1d5db;\n --tw-prose-invert-headings: #fff;\n --tw-prose-invert-lead: #9ca3af;\n --tw-prose-invert-links: #fff;\n --tw-prose-invert-bold: #fff;\n --tw-prose-invert-counters: #9ca3af;\n --tw-prose-invert-bullets: #4b5563;\n --tw-prose-invert-hr: #374151;\n --tw-prose-invert-quotes: #f3f4f6;\n --tw-prose-invert-quote-borders: #374151;\n --tw-prose-invert-captions: #9ca3af;\n --tw-prose-invert-code: #fff;\n --tw-prose-invert-pre-code: #d1d5db;\n --tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);\n --tw-prose-invert-th-borders: #4b5563;\n --tw-prose-invert-td-borders: #374151;\n font-size: 1rem;\n line-height: 1.75;\n}\n.prose :where(p):not(:where([class~="not-prose"] *)) {\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n}\n.prose :where(img):not(:where([class~="not-prose"] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.prose :where(video):not(:where([class~="not-prose"] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.prose :where(figure):not(:where([class~="not-prose"] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.prose :where(h2 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.875em;\n}\n.prose :where(h3 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.9em;\n}\n.prose :where(li):not(:where([class~="not-prose"] *)) {\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n}\n.prose :where(ol > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.375em;\n}\n.prose :where(ul > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.375em;\n}\n.prose > :where(ul > li p):not(:where([class~="not-prose"] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.prose > :where(ul > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.25em;\n}\n.prose > :where(ul > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.25em;\n}\n.prose > :where(ol > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.25em;\n}\n.prose > :where(ol > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.25em;\n}\n.prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.prose :where(hr + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(h2 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(h3 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(h4 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(thead th:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose :where(thead th:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose :where(tbody td:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose :where(tbody td:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose > :where(:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose > :where(:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 0;\n}\n.prose-sm {\n font-size: 0.875rem;\n line-height: 1.7142857;\n}\n.prose-sm :where(p):not(:where([class~="not-prose"] *)) {\n margin-top: 1.1428571em;\n margin-bottom: 1.1428571em;\n}\n.prose-sm :where([class~="lead"]):not(:where([class~="not-prose"] *)) {\n font-size: 1.2857143em;\n line-height: 1.5555556;\n margin-top: 0.8888889em;\n margin-bottom: 0.8888889em;\n}\n.prose-sm :where(blockquote):not(:where([class~="not-prose"] *)) {\n margin-top: 1.3333333em;\n margin-bottom: 1.3333333em;\n padding-left: 1.1111111em;\n}\n.prose-sm :where(h1):not(:where([class~="not-prose"] *)) {\n font-size: 2.1428571em;\n margin-top: 0;\n margin-bottom: 0.8em;\n line-height: 1.2;\n}\n.prose-sm :where(h2):not(:where([class~="not-prose"] *)) {\n font-size: 1.4285714em;\n margin-top: 1.6em;\n margin-bottom: 0.8em;\n line-height: 1.4;\n}\n.prose-sm :where(h3):not(:where([class~="not-prose"] *)) {\n font-size: 1.2857143em;\n margin-top: 1.5555556em;\n margin-bottom: 0.4444444em;\n line-height: 1.5555556;\n}\n.prose-sm :where(h4):not(:where([class~="not-prose"] *)) {\n margin-top: 1.4285714em;\n margin-bottom: 0.5714286em;\n line-height: 1.4285714;\n}\n.prose-sm :where(img):not(:where([class~="not-prose"] *)) {\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n}\n.prose-sm :where(video):not(:where([class~="not-prose"] *)) {\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n}\n.prose-sm :where(figure):not(:where([class~="not-prose"] *)) {\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n}\n.prose-sm :where(figure > *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.prose-sm :where(figcaption):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n line-height: 1.3333333;\n margin-top: 0.6666667em;\n}\n.prose-sm :where(code):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n}\n.prose-sm :where(h2 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.9em;\n}\n.prose-sm :where(h3 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.8888889em;\n}\n.prose-sm :where(pre):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n line-height: 1.6666667;\n margin-top: 1.6666667em;\n margin-bottom: 1.6666667em;\n border-radius: 0.25rem;\n padding-top: 0.6666667em;\n padding-right: 1em;\n padding-bottom: 0.6666667em;\n padding-left: 1em;\n}\n.prose-sm :where(ol):not(:where([class~="not-prose"] *)) {\n padding-left: 1.5714286em;\n}\n.prose-sm :where(ul):not(:where([class~="not-prose"] *)) {\n padding-left: 1.5714286em;\n}\n.prose-sm :where(li):not(:where([class~="not-prose"] *)) {\n margin-top: 0.2857143em;\n margin-bottom: 0.2857143em;\n}\n.prose-sm :where(ol > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.4285714em;\n}\n.prose-sm :where(ul > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.4285714em;\n}\n.prose-sm > :where(ul > li p):not(:where([class~="not-prose"] *)) {\n margin-top: 0.5714286em;\n margin-bottom: 0.5714286em;\n}\n.prose-sm > :where(ul > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.1428571em;\n}\n.prose-sm > :where(ul > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.1428571em;\n}\n.prose-sm > :where(ol > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.1428571em;\n}\n.prose-sm > :where(ol > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.1428571em;\n}\n.prose-sm :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"] *)) {\n margin-top: 0.5714286em;\n margin-bottom: 0.5714286em;\n}\n.prose-sm :where(hr):not(:where([class~="not-prose"] *)) {\n margin-top: 2.8571429em;\n margin-bottom: 2.8571429em;\n}\n.prose-sm :where(hr + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(h2 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(h3 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(h4 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(table):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n line-height: 1.5;\n}\n.prose-sm :where(thead th):not(:where([class~="not-prose"] *)) {\n padding-right: 1em;\n padding-bottom: 0.6666667em;\n padding-left: 1em;\n}\n.prose-sm :where(thead th:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose-sm :where(thead th:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose-sm :where(tbody td):not(:where([class~="not-prose"] *)) {\n padding-top: 0.6666667em;\n padding-right: 1em;\n padding-bottom: 0.6666667em;\n padding-left: 1em;\n}\n.prose-sm :where(tbody td:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose-sm :where(tbody td:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose-sm > :where(:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm > :where(:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 0;\n}\n.sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0, 0, 0, 0) !important;\n white-space: nowrap !important;\n border-width: 0 !important;\n}\n.fixed {\n position: fixed !important;\n}\n.absolute {\n position: absolute !important;\n}\n.relative {\n position: relative !important;\n}\n.inset-0 {\n top: 0px !important;\n right: 0px !important;\n bottom: 0px !important;\n left: 0px !important;\n}\n.inset-y-0 {\n top: 0px !important;\n bottom: 0px !important;\n}\n.inset-x-0 {\n left: 0px !important;\n right: 0px !important;\n}\n.top-0 {\n top: 0px !important;\n}\n.right-0 {\n right: 0px !important;\n}\n.left-0 {\n left: 0px !important;\n}\n.-left-5 {\n left: -1.25rem !important;\n}\n.top-\\[35px\\] {\n top: 35px !important;\n}\n.bottom-0 {\n bottom: 0px !important;\n}\n.col-span-3 {\n grid-column: span 3 / span 3 !important;\n}\n.m-2 {\n margin: 0.5rem !important;\n}\n.mx-2 {\n margin-left: 0.5rem !important;\n margin-right: 0.5rem !important;\n}\n.my-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n.mx-1 {\n margin-left: 0.25rem !important;\n margin-right: 0.25rem !important;\n}\n.mt-0\\.5 {\n margin-top: 0.125rem !important;\n}\n.mt-0 {\n margin-top: 0px !important;\n}\n.ml-6 {\n margin-left: 1.5rem !important;\n}\n.ml-2 {\n margin-left: 0.5rem !important;\n}\n.mt-3 {\n margin-top: 0.75rem !important;\n}\n.-mt-0\\.5 {\n margin-top: -0.125rem !important;\n}\n.-mt-0 {\n margin-top: -0px !important;\n}\n.mr-1 {\n margin-right: 0.25rem !important;\n}\n.block {\n display: block !important;\n}\n.flex {\n display: flex !important;\n}\n.table {\n display: table !important;\n}\n.grid {\n display: grid !important;\n}\n.contents {\n display: contents !important;\n}\n.hidden {\n display: none !important;\n}\n.h-\\[30px\\] {\n height: 30px !important;\n}\n.h-full {\n height: 100% !important;\n}\n.h-\\[35px\\] {\n height: 35px !important;\n}\n.h-6 {\n height: 1.5rem !important;\n}\n.w-full {\n width: 100% !important;\n}\n.w-20 {\n width: 5rem !important;\n}\n.w-16 {\n width: 4rem !important;\n}\n.w-2 {\n width: 0.5rem !important;\n}\n.shrink-0 {\n flex-shrink: 0 !important;\n}\n.grow {\n flex-grow: 1 !important;\n}\n.-rotate-90 {\n --tw-rotate: -90deg !important;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;\n}\n.rotate-90 {\n --tw-rotate: 90deg !important;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;\n}\n.cursor-pointer {\n cursor: pointer !important;\n}\n.cursor-default {\n cursor: default !important;\n}\n.select-none {\n -webkit-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n}\n.select-text {\n -webkit-user-select: text !important;\n -moz-user-select: text !important;\n -ms-user-select: text !important;\n user-select: text !important;\n}\n.grid-flow-col {\n grid-auto-flow: column !important;\n}\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n}\n.grid-cols-\\[minmax\\(max-content\\2c auto\\)_repeat\\(2\\2c min-content\\)\\] {\n grid-template-columns: minmax(-webkit-max-content,auto) repeat(2,-webkit-min-content) !important;\n grid-template-columns: minmax(max-content,auto) repeat(2,min-content) !important;\n}\n.grid-cols-\\[minmax\\(min-content\\2c max-content\\)_minmax\\(max-content\\2c auto\\)_minmax\\(min-content\\2c max-content\\)\\] {\n grid-template-columns: minmax(-webkit-min-content,-webkit-max-content) minmax(-webkit-max-content,auto) minmax(-webkit-min-content,-webkit-max-content) !important;\n grid-template-columns: minmax(min-content,max-content) minmax(max-content,auto) minmax(min-content,max-content) !important;\n}\n.grid-cols-\\[minmax\\(max-content\\2c auto\\)_minmax\\(max-content\\2c auto\\)\\] {\n grid-template-columns: minmax(-webkit-max-content,auto) minmax(-webkit-max-content,auto) !important;\n grid-template-columns: minmax(max-content,auto) minmax(max-content,auto) !important;\n}\n.flex-col {\n flex-direction: column !important;\n}\n.flex-wrap {\n flex-wrap: wrap !important;\n}\n.place-content-center {\n place-content: center !important;\n}\n.place-items-center {\n place-items: center !important;\n}\n.content-start {\n align-content: flex-start !important;\n}\n.items-start {\n align-items: flex-start !important;\n}\n.items-center {\n align-items: center !important;\n}\n.items-stretch {\n align-items: stretch !important;\n}\n.justify-end {\n justify-content: flex-end !important;\n}\n.justify-between {\n justify-content: space-between !important;\n}\n.gap-y-2 {\n row-gap: 0.5rem !important;\n}\n.space-x-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-x-reverse: 0 !important;\n margin-right: calc(0.5rem * var(--tw-space-x-reverse)) !important;\n margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse))) !important;\n}\n.divide-x > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-x-reverse: 0 !important;\n border-right-width: calc(1px * var(--tw-divide-x-reverse)) !important;\n border-left-width: calc(1px * calc(1 - var(--tw-divide-x-reverse))) !important;\n}\n.divide-dashed > :not([hidden]) ~ :not([hidden]) {\n border-style: dashed !important;\n}\n.self-center {\n align-self: center !important;\n}\n.overflow-y-auto {\n overflow-y: auto !important;\n}\n.truncate {\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n}\n.whitespace-nowrap {\n white-space: nowrap !important;\n}\n.rounded {\n border-radius: 0.25rem !important;\n}\n.rounded-md {\n border-radius: 0.375rem !important;\n}\n.rounded-full {\n border-radius: 9999px !important;\n}\n.border {\n border-width: 1px !important;\n}\n.border-0 {\n border-width: 0px !important;\n}\n.border-b {\n border-bottom-width: 1px !important;\n}\n.border-r {\n border-right-width: 1px !important;\n}\n.border-l {\n border-left-width: 1px !important;\n}\n.border-t {\n border-top-width: 1px !important;\n}\n.border-gray-100 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(243 244 246 / var(--tw-border-opacity)) !important;\n}\n.border-transparent {\n border-color: transparent !important;\n}\n.bg-slate-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.bg-white {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity)) !important;\n}\n.bg-blue-600 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity)) !important;\n}\n.bg-slate-50 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity)) !important;\n}\n.bg-slate-200 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(226 232 240 / var(--tw-bg-opacity)) !important;\n}\n.p-2 {\n padding: 0.5rem !important;\n}\n.p-4 {\n padding: 1rem !important;\n}\n.p-1 {\n padding: 0.25rem !important;\n}\n.p-3 {\n padding: 0.75rem !important;\n}\n.px-2 {\n padding-left: 0.5rem !important;\n padding-right: 0.5rem !important;\n}\n.py-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n.py-0\\.5 {\n padding-top: 0.125rem !important;\n padding-bottom: 0.125rem !important;\n}\n.py-0 {\n padding-top: 0px !important;\n padding-bottom: 0px !important;\n}\n.py-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n.px-4 {\n padding-left: 1rem !important;\n padding-right: 1rem !important;\n}\n.px-1 {\n padding-left: 0.25rem !important;\n padding-right: 0.25rem !important;\n}\n.px-3 {\n padding-left: 0.75rem !important;\n padding-right: 0.75rem !important;\n}\n.pl-2 {\n padding-left: 0.5rem !important;\n}\n.pl-9 {\n padding-left: 2.25rem !important;\n}\n.pr-3 {\n padding-right: 0.75rem !important;\n}\n.pb-3 {\n padding-bottom: 0.75rem !important;\n}\n.pt-2 {\n padding-top: 0.5rem !important;\n}\n.pl-4 {\n padding-left: 1rem !important;\n}\n.align-middle {\n vertical-align: middle !important;\n}\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;\n}\n.text-xs {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.text-sm {\n font-size: 0.875rem !important;\n line-height: 1.25rem !important;\n}\n.font-semibold {\n font-weight: 600 !important;\n}\n.font-bold {\n font-weight: 700 !important;\n}\n.text-gray-400 {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.text-gray-600 {\n --tw-text-opacity: 1 !important;\n color: rgb(75 85 99 / var(--tw-text-opacity)) !important;\n}\n.text-slate-900 {\n --tw-text-opacity: 1 !important;\n color: rgb(15 23 42 / var(--tw-text-opacity)) !important;\n}\n.text-slate-500 {\n --tw-text-opacity: 1 !important;\n color: rgb(100 116 139 / var(--tw-text-opacity)) !important;\n}\n.text-white {\n --tw-text-opacity: 1 !important;\n color: rgb(255 255 255 / var(--tw-text-opacity)) !important;\n}\n.text-slate-400 {\n --tw-text-opacity: 1 !important;\n color: rgb(148 163 184 / var(--tw-text-opacity)) !important;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important;\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;\n}\n.shadow-inner {\n --tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05) !important;\n --tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color) !important;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;\n}\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;\n}\n.transition {\n transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;\n transition-duration: 150ms !important;\n}\n.file\\:mr-2::-webkit-file-upload-button {\n margin-right: 0.5rem !important;\n}\n.file\\:mr-2::file-selector-button {\n margin-right: 0.5rem !important;\n}\n.file\\:cursor-pointer::-webkit-file-upload-button {\n cursor: pointer !important;\n}\n.file\\:cursor-pointer::file-selector-button {\n cursor: pointer !important;\n}\n.file\\:rounded-md::-webkit-file-upload-button {\n border-radius: 0.375rem !important;\n}\n.file\\:rounded-md::file-selector-button {\n border-radius: 0.375rem !important;\n}\n.file\\:border-0::-webkit-file-upload-button {\n border-width: 0px !important;\n}\n.file\\:border-0::file-selector-button {\n border-width: 0px !important;\n}\n.file\\:bg-slate-100::-webkit-file-upload-button {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.file\\:bg-slate-100::file-selector-button {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.file\\:py-1::-webkit-file-upload-button {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n.file\\:py-1::file-selector-button {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n.file\\:px-4::-webkit-file-upload-button {\n padding-left: 1rem !important;\n padding-right: 1rem !important;\n}\n.file\\:px-4::file-selector-button {\n padding-left: 1rem !important;\n padding-right: 1rem !important;\n}\n.file\\:text-xs::-webkit-file-upload-button {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.file\\:text-xs::file-selector-button {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.file\\:font-semibold::-webkit-file-upload-button {\n font-weight: 600 !important;\n}\n.file\\:font-semibold::file-selector-button {\n font-weight: 600 !important;\n}\n.file\\:text-slate-900::-webkit-file-upload-button {\n --tw-text-opacity: 1 !important;\n color: rgb(15 23 42 / var(--tw-text-opacity)) !important;\n}\n.file\\:text-slate-900::file-selector-button {\n --tw-text-opacity: 1 !important;\n color: rgb(15 23 42 / var(--tw-text-opacity)) !important;\n}\n.file\\:transition::-webkit-file-upload-button {\n -webkit-transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;\n transition-duration: 150ms !important;\n}\n.file\\:transition::file-selector-button {\n transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter !important;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;\n transition-duration: 150ms !important;\n}\n.placeholder\\:text-xs::-moz-placeholder {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.placeholder\\:text-xs:-ms-input-placeholder {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.placeholder\\:text-xs::placeholder {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.placeholder\\:italic::-moz-placeholder {\n font-style: italic !important;\n}\n.placeholder\\:italic:-ms-input-placeholder {\n font-style: italic !important;\n}\n.placeholder\\:italic::placeholder {\n font-style: italic !important;\n}\n.placeholder\\:text-gray-400::-moz-placeholder {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.placeholder\\:text-gray-400:-ms-input-placeholder {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.placeholder\\:text-gray-400::placeholder {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.first\\:mt-2:first-child {\n margin-top: 0.5rem !important;\n}\n.first\\:pl-2:first-child {\n padding-left: 0.5rem !important;\n}\n.last\\:mb-2:last-child {\n margin-bottom: 0.5rem !important;\n}\n.last\\:pr-2:last-child {\n padding-right: 0.5rem !important;\n}\n.hover\\:bg-slate-300:hover {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(203 213 225 / var(--tw-bg-opacity)) !important;\n}\n.hover\\:bg-slate-100:hover {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.hover\\:bg-blue-500:hover {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity)) !important;\n}\n.hover\\:text-gray-500:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(107 114 128 / var(--tw-text-opacity)) !important;\n}\n.hover\\:text-slate-400:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(148 163 184 / var(--tw-text-opacity)) !important;\n}\n.hover\\:text-black:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(0 0 0 / var(--tw-text-opacity)) !important;\n}\n.hover\\:text-white:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(255 255 255 / var(--tw-text-opacity)) !important;\n}\n.hover\\:file\\:bg-slate-300::-webkit-file-upload-button:hover {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(203 213 225 / var(--tw-bg-opacity)) !important;\n}\n.hover\\:file\\:bg-slate-300::file-selector-button:hover {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(203 213 225 / var(--tw-bg-opacity)) !important;\n}\n.focus\\:border-gray-200:focus {\n --tw-border-opacity: 1 !important;\n border-color: rgb(229 231 235 / var(--tw-border-opacity)) !important;\n}\n.focus\\:outline-none:focus {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n}\n.active\\:text-slate-800:active {\n --tw-text-opacity: 1 !important;\n color: rgb(30 41 59 / var(--tw-text-opacity)) !important;\n}\n.active\\:text-slate-500:active {\n --tw-text-opacity: 1 !important;\n color: rgb(100 116 139 / var(--tw-text-opacity)) !important;\n}\n.group:hover .group-hover\\:cursor-pointer {\n cursor: pointer !important;\n}\n.group:hover .group-hover\\:bg-slate-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.group:hover .group-hover\\:bg-blue-600 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity)) !important;\n}\n.group:hover .group-hover\\:text-white {\n --tw-text-opacity: 1 !important;\n color: rgb(255 255 255 / var(--tw-text-opacity)) !important;\n}\n.group:active .group-active\\:bg-blue-700 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(29 78 216 / var(--tw-bg-opacity)) !important;\n}',""]);const b=u},94748:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII="},4768:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAL0lEQVQoz2NgCD3x//9/BhBYBWdhgFVAiVW4JBFKGIa4AqD0//9D3pt4I4tAdAMAHTQ/j5Zom30AAAAASUVORK5CYII="},35555:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAz0lEQVRIx2NgYGBY/R8I/vx5eelX3n82IJ9FxGf6tksvf/8FiTMQAcAGQMDvSwu09abffY8QYSAScNk45G198eX//yev73/4///701eh//kZSARckrNBRvz//+8+6ZohwCzjGNjdgQxkAg7B9WADeBjIBqtJCbhRA0YNoIkBSNmaPEMoNmA0FkYNoFKhapJ6FGyAH3nauaSmPfwI0v/3OukVi0CIZ+F25KrtYcx/CTIy0e+rC7R1Z4KMICVTQQ14feVXIbR695u14+Ir4gwAAD49E54wc1kWAAAAAElFTkSuQmCC"},23601:e=>{e.exports="data:image/svg+xml,%3csvg viewBox=%270 0 16 16%27 fill=%27white%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3ccircle cx=%278%27 cy=%278%27 r=%273%27/%3e%3c/svg%3e"},133:e=>{e.exports="data:image/svg+xml,%3csvg viewBox=%270 0 16 16%27 fill=%27white%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3cpath d=%27M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z%27/%3e%3c/svg%3e"},1686:e=>{e.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 16 16%27%3e%3cpath stroke=%27white%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%272%27 d=%27M4 8h8%27/%3e%3c/svg%3e"},70909:e=>{e.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 20 20%27%3e%3cpath stroke=%27%236b7280%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%271.5%27 d=%27M6 8l4 4 4-4%27/%3e%3c/svg%3e"},6161:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjNDI0MjQyIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},51096:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjQzVDNUM1Ii8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="}},o={};function s(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={id:e,loaded:!1,exports:{}};return r[e](n,n.exports,s),n.loaded=!0,n.exports}s.m=r,s.amdO={},e=[],s.O=(t,n,r,o)=>{if(!n){var i=1/0;for(d=0;d=o)&&Object.keys(s.O).every((e=>s.O[e](n[l])))?n.splice(l--,1):(a=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},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.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>e+".bundle.js",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),t={},n="sterling-ts:",s.l=(e,r,o,i)=>{if(t[e])t[e].push(r);else{var a,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),d=0;d{a.onerror=a.onload=null,clearTimeout(u);var o=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(r))),n)return n(r)},u=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.p="./",(()=>{s.b=document.baseURI||self.location.href;var e={179:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var i=s.p+s.u(t),a=new Error;s.l(i,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,r[1](a)}}),"chunk-"+t,t)}},s.O.j=t=>0===e[t];var t=(t,n)=>{var r,o,[i,a,l]=n,c=0;if(i.some((t=>0!==e[t]))){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);if(l)var d=l(s)}for(t&&t(n);cs(5827)));i=s.O(i)})(); \ No newline at end of file