@highstate/designer 0.17.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{6EZimURw.js → 9hmcqHPO.js} +1 -1
- package/.output/public/_nuxt/{CimE6O20.js → BLsOQd1H.js} +21 -21
- package/.output/public/_nuxt/{CtwNW5xN.js → C4zpeTvm.js} +1 -1
- package/.output/public/_nuxt/{DqRHBxBn.js → CEYFgC8B.js} +1 -1
- package/.output/public/_nuxt/{DFsBSlE_.js → DTAwr92a.js} +1 -1
- package/.output/public/_nuxt/{54_UD3a3.js → N3RVRbLb.js} +1 -1
- package/.output/public/_nuxt/SytC7lKg.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/033f259e-8ba9-4c82-8824-56febea80b7d.json +1 -0
- package/.output/public/_nuxt/{ih8zLb53.js → dwrHE3tM.js} +1 -1
- package/.output/public/_nuxt/{entry.BAsn-2au.css → entry.dxugZJXl.css} +1 -1
- package/.output/public/_nuxt/error-404.CttAF9VE.css +1 -0
- package/.output/public/_nuxt/error-500.DXXd6-x4.css +1 -0
- package/.output/public/_nuxt/{graph-resolver-Cs66Hj63.js → graph-resolver-eG1ZUsYn.js} +1 -1
- package/.output/server/index.mjs +582 -582
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/package.json +4 -4
- package/.output/public/_nuxt/XrMy4kkt.js +0 -1
- package/.output/public/_nuxt/builds/meta/5447597b-48ec-41ad-8928-729a28784f20.json +0 -1
- package/.output/public/_nuxt/error-404.h4BWQQPs.css +0 -1
- package/.output/public/_nuxt/error-500.B72O9eXJ.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as K,I as be,b2 as De,b3 as Te,_ as pe,g as he,aD as we,aW as re,n as Oe,aq as Pe,av as Fe,b4 as Me,aE as Ue}from"#entry";import{E as q,g as S,Z as D,_ as P,W as p,aE as ne,a1 as s,X as n,ay as oe,a2 as B,a3 as H,F as e,aS as Ne,aW as ie,K as U,aN as Ie,$ as O,ac as xe,aO as Q,av as _,a9 as R,af as ae,b8 as ce,aB as fe,r as V,w as ee,aw as me,bc as ke,bd as Se,be as se,az as Be,b as J,aR as Ae,aA as G,aC as ve,aD as ge,ai as te,a0 as ue,a$ as Le,aH as ze,aJ as de,bf as Ee,m as Re,N as qe,ab as je}from"./Dm4QKadl.js";import{H as He,I as We}from"./ih8zLb53.js";import{I as Ge}from"./BqeRdtD4.js";import{a as E,_ as Je}from"./ga9TZ2z5.js";import{C as Ke}from"./DhQfdAdO.js";import{P as Xe}from"./DHuTDtaT.js";const ye=q({__name:"EditorLoader",props:{text:{},value:{}},setup(t){const{instancesStore:l}=K(),x=S(()=>t.value===-1?t.text:`${t.text} ${t.value}/${l.totalInstanceCount}...`);return(h,I)=>t.text?(p(),D(ne,{key:0,variant:"tonal"},{default:s(()=>[n(oe,{class:"text-overline"},{default:s(()=>[B(H(e(x)),1)]),_:1}),n(Ne,{indeterminate:t.value===-1,"model-value":t.value,max:e(l).totalInstanceCount,height:4,color:"primary",class:"w-full"},null,8,["indeterminate","model-value","max"])]),_:1})):P("",!0)}}),Ot=q({__name:"EditorLoaderPopup",setup(t){const{instancesStore:l,stateStore:x}=K(),h=S(()=>l.initializationPhase==="resolving"||x.initializationPhase==="calculating");return(I,g)=>e(h)?(p(),D(ne,{key:0,variant:"tonal"},{default:s(()=>[e(l).initializationPhase==="resolving"?(p(),D(ye,{key:0,text:"Resolving instance inputs",value:e(l).resolvedInstanceCount},null,8,["value"])):P("",!0),e(x).initializationPhase==="calculating"?(p(),D(ye,{key:1,text:"Detecting instance changes",value:e(x).calculatedInputHashCount},null,8,["value"])):P("",!0)]),_:1})):P("",!0)}}),Pt=q({__name:"HubNodeWrapper",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},setup(t){const{stateStore:l}=K(),x=ie("contextMenu");return(h,I)=>(p(),D(He,{hub:t.data.hub,onContextmenu:I[0]||(I[0]=g=>e(x)?.showContextMenu(g))},{default:s(()=>[n(e($e),{ref_key:"contextMenu",ref:x,title:"Hub",subtitle:t.data.hub.id,"is-deletable":g=>e(l).isNodeDeletable(g)},null,8,["subtitle","is-deletable"])]),_:1},8,["hub"]))}}),Ye={key:0},Ze={class:"d-flex flex-column"},Qe={key:0,class:"text-caption text-medium-emphasis"},_e={key:1,class:"text-body-2 text-medium-emphasis pa-4"},et=q({__name:"OperationPlanTree",props:{phases:{}},setup(t){const{instancesStore:l,libraryStore:x}=K(),h=S(()=>{const f=[];for(const r of t.phases){const m={id:`phase-${r.type}`,title:`${r.type.charAt(0).toUpperCase()+r.type.slice(1)} Phase`,subtitle:`${r.instances.length} instance${r.instances.length===1?"":"s"}`,icon:w(r.type),iconColor:d(r.type),phaseType:r.type,children:[]},a=I(r.instances);m.children=a,f.push(m)}return f}),I=f=>{const r=new Map;for(const a of f)r.has(a.id)||r.set(a.id,{...a,children:[]});for(const a of f)a.parentId&&r.has(a.parentId)&&r.get(a.parentId).children.push(a);return f.filter(a=>!a.parentId||!r.has(a.parentId)).map(a=>g(a,r))},g=(f,r)=>{const m=l.instances.get(f.id),a=m?x.library.components[m.type]:null,y={id:f.id,title:a&&m?`${a.meta.title} "${m.name}"`:f.id,subtitle:f.message,icon:a?.meta.icon??"iconamoon:component",iconColor:a?.meta.iconColor,phaseType:"instance"},o=r.get(f.id);return o&&o.children.length>0&&(y.children=o.children.map(i=>g(i,r))),y},w=f=>{switch(f){case"preview":return"mdi-eye";case"destroy":return"mdi-delete";case"update":return"mdi-update";case"refresh":return"mdi-refresh";default:return"mdi-cog"}},d=f=>{switch(f){case"preview":return"secondary";case"destroy":return"error";case"update":return"primary";case"refresh":return"info";default:return"secondary"}};return(f,r)=>t.phases.length>0?(p(),U("div",Ye,[n(Ie,{items:e(h),"item-title":"title","item-value":"id",density:"compact","open-all":"","indent-lines":"","bg-color":"#2d2d2d"},{prepend:s(({item:m})=>[n(e(be),{icon:m.icon,color:m.iconColor,width:"20",class:"mr-2"},null,8,["icon","color"])]),title:s(({item:m})=>[O("div",Ze,[O("div",{class:xe(["text-body-2",m.phaseType==="instance"?"font-weight-regular":"font-weight-medium"])},H(m.title),3),m.subtitle?(p(),U("div",Qe,H(m.subtitle),1)):P("",!0)])]),_:1},8,["items"])])):(p(),U("div",_e," No changes planned for this operation. "))}}),tt={key:0},nt={class:"text-caption"},at=q({__name:"OperationOptions",props:Q({operation:{}},{options:{default:{}},optionsModifiers:{}}),emits:["update:options"],setup(t){const l=_(t,"options"),x=[{key:"forceUpdateDependencies",label:"Force update dependencies",description:"Force update all dependencies regardless of their current state. Bypasses hash-based change detection for dependency chains.",showForOperations:["update"]},{key:"ignoreDependencies",label:"Ignore dependencies",description:"Skip dependency inclusion entirely. Only the requested instances are operated on, even if their dependencies are outdated or failed.",warning:"Ignoring dependencies will skip undeployed or failed prerequisites. Expect the operation to fail unless every required instance is handled manually.",showForOperations:["update"]},{key:"forceUpdateChildren",label:"Force update children instances",description:"Force update all children of composite instances regardless of their state. Overrides selective child inclusion logic.",showForOperations:["update"]},{key:"destroyDependentInstances",label:"Destroy dependent instances",description:"Include dependent instances when destroying instances. Traverses the dependency graph in reverse to prevent orphaned instances.",defaultValue:!0,showForOperations:["destroy","recreate"]},{key:"invokeDestroyTriggers",label:"Invoke destroy triggers",description:"Execute destroy triggers when destroying instances. Controls trigger execution during the destruction phase.",defaultValue:!0},{key:"deleteUnreachableResources",label:"Delete unreachable resources",description:"Delete Pulumi resources that are no longer referenced in the state. Deletes orphaned resources within individual instances.",warning:"All resources that will not be reachable at the moment of the destroy operation will be removed from the state. Only use when you are sure that these resources do not actually exist!"},{key:"forceDeleteState",label:"Force delete state",description:"Force deletion of instance state even if the destroy operation fails. Bypasses normal destroy procedures as emergency fallback.",warning:"This will delete the stack state and all resources in it even if the destroy operation failed. Use only when the stack is unrecoverable and you want to start from scratch.",showForOperations:["destroy","recreate"]},{key:"allowPartialCompositeInstanceUpdate",label:"Allow partial update of composite instances",description:"Allow update of individual composite children without requiring all siblings. When enabled, only necessary children are included.",showForOperations:["update","recreate"]},{key:"allowPartialCompositeInstanceDestruction",label:"Allow partial destruction of composite instances",description:"Allow partial destruction of composite instances during cascade operations. When enabled, cascade destruction includes only directly dependent children.",showForOperations:["destroy","recreate"]},{key:"refresh",label:"Refresh state before operation",description:"Also refresh the state of instances during the operation. Synchronizes state with actual infrastructure."},{key:"debug",label:"Enable debug logging",description:"Enable debug logging for Pulumi engine and resource providers. Sets TF_LOG=DEBUG for Terraform providers.",warning:"Debug mode may expose sensitive information including credentials in the logs. Use only when absolutely necessary for troubleshooting."}],h=S(()=>x.filter(g=>g.showForOperations?g.showForOperations.includes(t.operation):!0)),I=(g,w)=>{const d=w??!1;g==="forceUpdateDependencies"&&d&&(l.value.ignoreDependencies=!1),g==="ignoreDependencies"&&d&&(l.value.forceUpdateDependencies=!1),l.value[g]=d};return(g,w)=>l.value?(p(),U("div",tt,[(p(!0),U(R,null,ae(e(h),d=>(p(),U(R,{key:d.key},[n(ce,{"model-value":l.value[d.key],"onUpdate:modelValue":f=>I(d.key,f),class:xe(d===e(h)[0]?"mt-2":""),label:d.label,density:"compact","hide-details":""},null,8,["model-value","onUpdate:modelValue","class","label"]),O("div",nt,H(d.description),1)],64))),128)),(p(!0),U(R,null,ae(e(h),d=>(p(),U(R,{key:`warning-${d.key}`},[d.warning&&l.value[d.key]?(p(),D(fe,{key:0,density:"compact",type:"warning",variant:"outlined",class:"mt-4"},{default:s(()=>[B(H(d.warning),1)]),_:2},1024)):P("",!0)],64))),128))])):P("",!0)}}),st={class:"metadata-section"},ot={class:"options-header"},it={class:"text-body-2 text-medium-emphasis mb-4"},lt={class:"options-scrollable"},rt={class:"plan-header"},dt={class:"plan-scrollable"},ct=q({__name:"InstanceOperationDialog",props:Q({instances:{},component:{},operation:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const l=_(t,"visible"),{operationsStore:x,projectStore:h}=K(),I=S(()=>t.instances.length>1),g=S(()=>t.instances[0]),w=V({forceUpdateDependencies:!1,ignoreDependencies:!1,forceUpdateChildren:!1,destroyDependentInstances:!1,invokeDestroyTriggers:!0,deleteUnreachableResources:!1,forceDeleteState:!1,allowPartialCompositeInstanceUpdate:!1,allowPartialCompositeInstanceDestruction:!1,refresh:!1}),d=V([]),f=V(!1),r=V(null),m=V(""),a=V("");ee([()=>t.operation,()=>t.instances],()=>{t.instances.length!==0&&(m.value=I.value?De(t.operation,t.instances):Te(t.operation,g.value),w.value={...w.value,destroyDependentInstances:t.operation==="destroy"})},{immediate:!0}),ee(()=>w.value,()=>{y()},{deep:!0}),ee(()=>l.value,v=>{v&&y()});const y=async()=>{if(l.value){f.value=!0,r.value=null;try{const v=await x.planOperation({projectId:h.projectId,type:t.operation,instanceIds:t.instances.map(u=>u.id),options:w.value});d.value=v}catch(v){console.error("Failed to load operation plan:",v),r.value=v instanceof Error?v.message:"Unknown error"}finally{f.value=!1}}},o=S(()=>{const v=new Set,u=new Set,F=new Set,X=new Set,Z=new Set;for(const b of d.value)for(const c of b.instances){if(Z.add(c.id),b.type==="update"){v.add(c.id);continue}if(b.type==="destroy"){u.add(c.id);continue}if(b.type==="refresh"){F.add(c.id);continue}b.type==="preview"&&X.add(c.id)}return{update:v.size,destroy:u.size,refresh:F.size,preview:X.size,unique:Z.size}}),i=v=>`${v} instance${v===1?"":"s"}`,C=S(()=>{switch(t.operation){case"update":return"Update";case"preview":return"Preview";case"refresh":return"Refresh";case"destroy":return"Destroy";case"recreate":return"Recreate";default:return"Unknown operation"}}),$=S(()=>{const v=o.value;switch(t.operation){case"update":{const{update:u}=v;return u===0?C.value:`Update ${i(u)}`}case"recreate":return v.unique===0?C.value:`Recreate ${i(v.unique)}`;case"destroy":return v.destroy===0?C.value:`Destroy ${i(v.destroy)}`;case"refresh":return v.refresh===0?C.value:`Refresh ${i(v.refresh)}`;case"preview":return v.preview===0?C.value:`Preview ${i(v.preview)}`;default:return v.unique===0?C.value:`${C.value} ${i(v.unique)}`}}),N=S(()=>{switch(t.operation){case"update":return"primary";case"preview":return"secondary";case"refresh":return"info";case"destroy":return"error";case"recreate":return"warning";default:return"primary"}}),L=V(!1),W=async()=>{L.value=!0;try{await x.launchOperation({projectId:h.projectId,type:t.operation,instanceIds:t.instances.map(v=>v.id),options:w.value,meta:{title:m.value,description:a.value}}),l.value=!1}finally{L.value=!1}},z=S(()=>I.value?`${C.value} ${t.instances.length} instances`:t.component?`${C.value} ${t.component.meta.title} "${g.value.name}"`:`${C.value} "${g.value.name}"`);return(v,u)=>(p(),D(me,{modelValue:l.value,"onUpdate:modelValue":u[4]||(u[4]=F=>l.value=F),"max-width":"1200px",class:"operation-dialog"},{default:s(()=>[n(ne,{title:e(z),color:t.component?.meta.color??"#2d2d2d",class:"operation-card"},{prepend:s(()=>[t.component&&!e(I)?(p(),D(e(Ke),{key:0,meta:t.component.meta},null,8,["meta"])):e(I)?(p(),D(ue,{key:1},{default:s(()=>[...u[5]||(u[5]=[B("mdi-format-list-bulleted",-1)])]),_:1})):(p(),D(ue,{key:2},{default:s(()=>[...u[6]||(u[6]=[B("mdi-cube-outline",-1)])]),_:1}))]),default:s(()=>[n(oe,{class:"operation-card-content"},{default:s(()=>[n(ke,{fluid:"",class:"pa-0 fill-height"},{default:s(()=>[n(Se,{"no-gutters":"",class:"fill-height"},{default:s(()=>[n(se,{cols:"12",md:"5",class:"pr-md-4 column-container"},{default:s(()=>[O("div",st,[u[7]||(u[7]=O("div",{class:"text-overline mb-2"},"Metadata",-1)),n(Be,{modelValue:e(m),"onUpdate:modelValue":u[0]||(u[0]=F=>J(m)?m.value=F:null),label:"Title",variant:"outlined",density:"compact",class:"mb-3",hint:"A descriptive title for this operation (optional)","persistent-hint":""},null,8,["modelValue"]),n(Ae,{modelValue:e(a),"onUpdate:modelValue":u[1]||(u[1]=F=>J(a)?a.value=F:null),label:"Description",variant:"outlined",density:"compact",rows:"2",hint:"Describe the purpose of this operation (optional)","persistent-hint":""},null,8,["modelValue"])]),n(G,{class:"my-4"}),O("div",ot,[u[10]||(u[10]=O("div",{class:"text-overline mb-2"},"Options",-1)),O("p",it,[u[8]||(u[8]=B(" Configure how the ",-1)),O("b",null,H(t.operation),1),u[9]||(u[9]=B(" operation should be executed. These options control the behavior and scope of the operation. ",-1))])]),O("div",lt,[n(at,{options:e(w),"onUpdate:options":u[2]||(u[2]=F=>J(w)?w.value=F:null),operation:t.operation},null,8,["options","operation"])])]),_:1}),n(G,{vertical:"",class:"d-none d-md-flex"}),n(se,{cols:"12",md:"7",class:"pl-md-4 column-container"},{default:s(()=>[O("div",rt,[u[11]||(u[11]=O("div",{class:"text-overline mb-2"},"Execution Plan",-1)),u[12]||(u[12]=O("p",{class:"text-body-2 text-medium-emphasis mb-4"}," Preview of instances that will be affected by this operation. The plan shows the execution phases and which instances will be processed. ",-1)),e(r)?(p(),D(fe,{key:0,type:"error",variant:"outlined",density:"compact",class:"mb-3"},{default:s(()=>[B(" Failed to load operation plan: "+H(e(r)),1)]),_:1})):P("",!0)]),O("div",dt,[n(et,{phases:e(d)},null,8,["phases"])])]),_:1})]),_:1})]),_:1})]),_:1}),n(ve,null,{default:s(()=>[n(ge),n(te,{onClick:u[3]||(u[3]=F=>l.value=!1)},{default:s(()=>[...u[13]||(u[13]=[B("Cancel",-1)])]),_:1}),n(te,{color:e(N),loading:e(L),disabled:e(f),onClick:W},{default:s(()=>[B(H(e($)),1)]),_:1},8,["color","loading","disabled"])]),_:1})]),_:1},8,["title","color"])]),_:1},8,["modelValue"]))}}),ut=pe(ct,[["__scopeId","data-v-8655a745"]]),pt={class:"tree-scrollable"},ft={class:"d-flex flex-column"},mt={class:"text-body-2 font-weight-regular"},vt={class:"text-caption text-medium-emphasis"},gt=q({__name:"ForgetInstanceStateDialog",props:Q({instances:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const l=_(t,"visible"),{stateStore:x,libraryStore:h}=K(),I=S(()=>t.instances.length>1),g=S(()=>t.instances[0]),w=V(!1),d=V(!1),f=V(!1),r=S(()=>t.instances.map(y=>{const o=h.library.components?.[y.type];return{id:y.id,title:o?`${o.meta.title} "${y.name}"`:`${y.type} "${y.name}"`,subtitle:y.id,icon:o?.meta.icon??"iconamoon:component",iconColor:o?.meta.iconColor}})),m=async()=>{w.value=!0;try{await x.forgetInstanceStates(t.instances.map(y=>y.id),d.value,f.value),l.value=!1}finally{w.value=!1}},a=S(()=>{if(t.instances.length===0)return"Forget state";if(!I.value){const y=g.value,o=h.library.components?.[y.type];return o?`Forget state of ${o.meta.title} "${y.name}"`:`Forget state of ${y.type} "${y.name}"`}return`Forget state of ${t.instances.length} instances`});return(y,o)=>(p(),D(me,{modelValue:l.value,"onUpdate:modelValue":o[3]||(o[3]=i=>l.value=i),"max-width":"1200px",class:"forget-dialog"},{default:s(()=>[n(ne,{title:e(a),color:"#2d2d2d",class:"forget-card"},{default:s(()=>[n(oe,{class:"forget-card-content"},{default:s(()=>[n(ke,{fluid:"",class:"pa-0 fill-height"},{default:s(()=>[n(Se,{"no-gutters":"",class:"fill-height"},{default:s(()=>[n(se,{cols:"12",md:"5",class:"pr-md-4 column-container"},{default:s(()=>[o[5]||(o[5]=O("div",{class:"text-overline mb-2"},"Options",-1)),n(ce,{modelValue:e(d),"onUpdate:modelValue":o[0]||(o[0]=i=>J(d)?d.value=i:null),label:"Delete all secrets associated with this instance",density:"compact","hide-details":""},null,8,["modelValue"]),n(ce,{modelValue:e(f),"onUpdate:modelValue":o[1]||(o[1]=i=>J(f)?f.value=i:null),label:"Clear all terminal data associated with this instance",density:"compact","hide-details":""},null,8,["modelValue"]),n(fe,{density:"compact",type:"warning",variant:"outlined",class:"mt-4 alert-auto"},{default:s(()=>[...o[4]||(o[4]=[O("div",null," No destroy operation will be performed, so all resources will be left in place and unreachable by HighState. ",-1),O("div",null," You should only use this operation when the instance is unreachable/unrecoverable and you want to start from scratch. ",-1)])]),_:1})]),_:1}),n(G,{vertical:"",class:"d-none d-md-flex"}),n(se,{cols:"12",md:"7",class:"pl-md-4 mt-4 mt-md-0 column-container"},{default:s(()=>[o[6]||(o[6]=O("div",{class:"text-overline mb-2"},"Instances",-1)),O("div",pt,[n(Ie,{items:e(r),"item-title":"title","item-value":"id",density:"compact","bg-color":"#2d2d2d",class:"forget-instance-tree"},{prepend:s(({item:i})=>[n(e(be),{icon:i.icon,color:i.iconColor,width:"20",class:"mr-2"},null,8,["icon","color"])]),title:s(({item:i})=>[O("div",ft,[O("div",mt,H(i.title),1),O("div",vt,H(i.subtitle),1)])]),_:1},8,["items"])])]),_:1})]),_:1})]),_:1})]),_:1}),n(ve,null,{default:s(()=>[n(ge),n(te,{onClick:o[2]||(o[2]=i=>l.value=!1)},{default:s(()=>[...o[7]||(o[7]=[B("Cancel",-1)])]),_:1}),n(te,{loading:e(w),onClick:m},{default:s(()=>[B(" Forget State"+H(e(I)?` (${t.instances.length})`:""),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}}),yt=pe(gt,[["__scopeId","data-v-7881a32c"]]),bt={class:"session-list-cointainer"},ht=q({__name:"TerminalListSubmenu",props:Q({stateId:{},terminalIds:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const{instancesStore:l,stateStore:x}=K(),{state:h,execute:I,isLoading:g}=x.getTerminalsState(S(()=>t.terminalIds)),{state:w,execute:d,isLoading:f}=l.getTerminalSessionsState(S(()=>t.stateId)),r=_(t,"visible");ee(r,i=>{i&&(d(),I())});const m=i=>i.finishedAt?`Finished at ${new Date(i.finishedAt).toLocaleString()}`:`Started at ${new Date(i.startedAt).toLocaleString()}`,a=i=>{const C=Ee();return i.finishedAt?"#9E9E9E":C.current.value.colors.success},y=V(null),o=async i=>{y.value=i;try{await l.openTerminal(i,!0)}finally{y.value=null}};return(i,C)=>(p(),D(e(E),{icon:"mdi-console",title:"Terminals"},{append:s(()=>[n(ue,{icon:"mdi-menu-right",size:"x-small"})]),default:s(()=>[n(Le,{modelValue:r.value,"onUpdate:modelValue":C[0]||(C[0]=$=>r.value=$),"open-on-focus":!1,"open-on-hover":"","close-on-content-click":!1,submenu:"",activator:"parent"},{default:s(()=>[n(ze,{density:"compact",variant:"text"},{default:s(()=>[n(de,{class:"text-overline"},{default:s(()=>[...C[1]||(C[1]=[B("Available Terminals",-1)])]),_:1}),(p(!0),U(R,null,ae(e(h),$=>(p(),D(e(E),{key:$.id,disabled:!!e(y),title:$.meta.title,subtitle:$.meta.description,"custom-icon":$.meta.icon,loading:e(y)===$.id,icon:"mdi-console",onClick:N=>o($.id)},null,8,["disabled","title","subtitle","custom-icon","loading","onClick"]))),128)),n(G,{class:"mt-2 mb-2"}),n(de,{class:"text-overline"},{default:s(()=>[...C[2]||(C[2]=[B("Sessions",-1)])]),_:1}),O("div",bt,[(p(!0),U(R,null,ae(e(w),$=>(p(),D(e(E),{key:$.id,title:$.meta.title,subtitle:m($),"custom-icon":$.meta.icon,icon:"mdi-console",color:a($),onClick:N=>e(l).openTerminalSession($)},null,8,["title","subtitle","custom-icon","color","onClick"]))),128))]),e(w).length===0?(p(),D(de,{key:0,class:"text-disabled"},{default:s(()=>[...C[3]||(C[3]=[B(" No sessions found ",-1)])]),_:1})):P("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1}))}}),wt=pe(ht,[["__scopeId","data-v-7c86584d"]]),It=q({__name:"InstanceContextMenu",props:{instance:{},component:{},state:{},stores:{},operation:{},locked:{type:Boolean},editable:{type:Boolean},ghost:{type:Boolean,default:!1}},setup(t,{expose:l}){const{projectStore:x,stateStore:h,operationsStore:I}=t.stores,g=he(),{selection:w}=we(),d=V(!1),f=V(!1),r=V("update"),m=V([]),a=V(!1),y=V([]),o=S(()=>w.selectedInstances.length>1&&w.selectedInstances.some(c=>c.id===t.instance.id)?w.selectedInstances:[t.instance]),i=S(()=>o.value.length>1),C=(b,c,k)=>{if(k==="preview"&&(i.value||b.kind!=="unit"))return!1;const j=Pe(c?.lastOperationState?.status);switch(k){case"update":return!j;case"refresh":return re(c)&&!j;case"preview":return!j;case"recreate":case"destroy":return re(c)&&!j;default:return!1}},$=b=>t.ghost&&b!=="destroy"?!1:o.value.some(c=>{const k=h.instanceStates.get(c.id);return C(c,k,b)}),N=b=>t.ghost&&b!=="destroy"?!1:o.value.every(c=>{const k=h.instanceStates.get(c.id);return C(c,k,b)}),L=S(()=>o.value.some(b=>{const c=h.instanceStates.get(b.id);return re(c)})),W=b=>{const c=o.value.length;return c===1?b==="update"?L.value?"Update":"Create":b.charAt(0).toUpperCase()+b.slice(1):b==="update"?`${L.value?"Update":"Create"} selected (${c})`:`${b.charAt(0).toUpperCase()+b.slice(1)} selected (${c})`},z=b=>{if(i.value)return"mdi-format-list-bulleted";switch(b){case"update":return L.value?"mdi-play":"mdi-rocket-launch";case"refresh":return"mdi-reload";case"preview":return"mdi-eye";case"recreate":return"mdi-restart";case"destroy":return"mdi-stop";default:return"mdi-play"}},v=b=>{r.value=b,m.value=o.value,f.value=!0,d.value=!1,w.clearSelection()},u=()=>{y.value=o.value,a.value=!0,d.value=!1,w.clearSelection()},F=ie("contextMenu"),X=async b=>{F.value&&await F.value.showContextMenu(b)},Z=async()=>{if(o.value.length!==1||t.instance.kind!=="unit"){d.value=!1;return}const b=await I.launchInstanceOperation("preview",t.instance);d.value=!1,t.state&&await g.openLogsPanel(x.projectId,b.id,t.state.id)};return l({showContextMenu:X}),(b,c)=>(p(),U(R,null,[n(e($e),{ref_key:"contextMenu",ref:F,visible:e(d),"onUpdate:visible":c[6]||(c[6]=k=>J(d)?d.value=k:null),title:"Instance",subtitle:t.instance.id,"is-deletable":k=>t.stores.stateStore.isNodeDeletable(k)},{default:s(()=>[$("update")?(p(),D(e(E),{key:0,title:W("update"),icon:z("update"),color:"primary",disabled:t.locked||!N("update"),onClick:c[0]||(c[0]=k=>v("update"))},null,8,["title","icon","disabled"])):P("",!0),$("refresh")?(p(),D(e(E),{key:1,title:W("refresh"),icon:z("refresh"),color:"primary",disabled:t.locked||!N("refresh"),onClick:c[1]||(c[1]=k=>v("refresh"))},null,8,["title","icon","disabled"])):P("",!0),$("preview")?(p(),D(e(E),{key:2,title:W("preview"),icon:z("preview"),color:"secondary",disabled:t.locked||!N("preview"),onClick:Z},null,8,["title","icon","disabled"])):P("",!0),t.state?.lastOperationState?(p(),U(R,{key:3},[n(G),n(e(E),{title:"Open Logs",icon:"mdi-text",color:"primary",onClick:c[2]||(c[2]=k=>e(h).openInstanceLogs(t.instance))})],64)):P("",!0),n(G),n(e(E),{title:"View in Settings",icon:"mdi-cog",color:"primary",onClick:c[3]||(c[3]=()=>{const k=e(h).getInstanceState(t.instance.id);k&&("navigateTo"in b?b.navigateTo:e(Oe))({name:"settings.instance-details",params:{projectId:e(x).projectId,stateId:k.id}}),d.value=!1})}),t.state?.terminalIds?.length?(p(),U(R,{key:4},[n(G),n(wt,{"state-id":t.state.id,"terminal-ids":t.state.terminalIds},null,8,["state-id","terminal-ids"])],64)):P("",!0),e(L)?(p(),U(R,{key:5},[n(G),$("recreate")?(p(),D(e(E),{key:0,title:W("recreate"),icon:z("recreate"),color:"warning",disabled:t.locked||!N("recreate"),onClick:c[4]||(c[4]=k=>v("recreate"))},null,8,["title","icon","disabled"])):P("",!0),$("destroy")?(p(),D(e(E),{key:1,title:W("destroy"),icon:z("destroy"),color:"error",disabled:t.locked||!N("destroy"),onClick:c[5]||(c[5]=k=>v("destroy"))},null,8,["title","icon","disabled"])):P("",!0),n(e(E),{title:e(i)?`Forget State selected (${e(o).length})`:"Forget State",icon:"mdi-delete-forever",color:"error",disabled:t.locked,onClick:u},null,8,["title","disabled"])],64)):P("",!0)]),_:1},8,["visible","subtitle","is-deletable"]),n(ut,{visible:e(f),"onUpdate:visible":c[7]||(c[7]=k=>J(f)?f.value=k:null),operation:e(r),instances:e(m),component:t.component},null,8,["visible","operation","instances","component"]),n(yt,{visible:e(a),"onUpdate:visible":c[8]||(c[8]=k=>J(a)?a.value=k:null),instances:e(y)},null,8,["visible","instances"])],64))}}),xt=q({__name:"PageDialog",props:Q({meta:{},content:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const l=_(t,"visible");return(x,h)=>(p(),D(me,{modelValue:l.value,"onUpdate:modelValue":h[1]||(h[1]=I=>l.value=I),"max-width":"80vh","max-height":"60vh"},{default:s(()=>[n(ne,{title:t.meta.title,color:"#2d2d2d"},{default:s(()=>[n(oe,{style:{"overflow-y":"scroll"}},{default:s(()=>[n(Xe,{content:t.content},null,8,["content"])]),_:1}),n(ve,null,{default:s(()=>[n(ge),n(te,{onClick:h[0]||(h[0]=I=>l.value=!1)},{default:s(()=>[...h[2]||(h[2]=[B("Close",-1)])]),_:1})]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}}),Ft=q({__name:"InstanceNodeWrapper",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},setup(t){const l=K(),x=he(),{projectStore:h,stateStore:I,instancesStore:g,libraryStore:w,operationsStore:d,validationStore:f}=l,r=S(()=>t.data.instance),m=S(()=>{const A=w.library.components[r.value.type];if(!A)throw new Error(`component "${r.value.type}" for instance "${r.value.id}" not found in library`);return A}),a=S(()=>I.instanceStates.get(r.value.id)),y=S(()=>a.value&&I.instanceLocks.get(a.value.id)),o=S(()=>d.getLastInstanceOperation(r.value.id)),i=S(()=>g.isGhostInstance(r.value.id)),C=S(()=>i.value&&a.value?.source==="resident"),$=V(!1),N=V(!1),L=V(),W=V([]),z=V(!1),v=V(!1),u=V({}),F=async()=>{$.value=!0;try{if(!a.value?.pageIds)return;const A=a.value.pageIds;if(!A.length)return;const T=await I.getPage(A[0]);if(!T)return;W.value=T.content,L.value=T.meta,N.value=!0}finally{$.value=!1}},X=V(!1),Z=async()=>{X.value=!0;try{if(!a.value?.terminalIds||a.value.terminalIds.length===0)return;await g.openTerminal(a.value.terminalIds[0])}finally{X.value=!1}},b=async()=>{v.value=!0;try{if(!a.value)return;const A=await l.stateStore.getInstanceSecrets(a.value.id);u.value={...A},z.value=!0}finally{v.value=!1}},c=ie("contextMenu"),k=Fe(),j=V(null),Ce=A=>i.value?!1:Me(k,w.library,A);return ee(()=>({ghost:i.value,resident:C.value,initialized:k.areNodesInitialized.value}),({ghost:A,resident:T,initialized:M})=>{if(!M)return;const Y=k.findNode(t.id);if(Y){if(!A){if(j.value){const{connectable:le,draggable:Ve}=j.value;k.updateNode(t.id,()=>({connectable:le,draggable:Ve})),j.value=null}return}j.value||(j.value={connectable:!!Y.connectable,draggable:Y.draggable??!0}),k.updateNode(t.id,()=>({connectable:!1,draggable:T}))}},{immediate:!0}),(A,T)=>(p(),D(We,{"editing-secrets":e(z),"onUpdate:editingSecrets":T[2]||(T[2]=M=>J(z)?z.value=M:null),"loading-secrets":e(v),"initial-secrets":e(u),"loading-page":e($),instance:t.data.instance,component:e(m),entities:e(w).library.entities,"input-resolver-outputs":e(g).inputResolverOutputs,"input-resolver-dependent-map":e(g).inputResolverDependentMap,"is-valid-connection":Ce,"instance-lock":e(y),state:e(a),editable:t.data.editable&&!e(i),ghost:e(i),stores:("markRaw"in A?A.markRaw:e(Re))(e(l)),"workspace-store":e(x),"all-instances":e(g).instances,"onSave:args":T[3]||(T[3]=(M,Y,le)=>e(g).updateInstance(M,Y,le)),"onSave:secrets":T[4]||(T[4]=(M,Y)=>e(I).updateInstanceSecrets(M,Y)),"onOpen:secrets":b,"onOpen:terminal":Z,"onOperation:launch":T[5]||(T[5]=M=>e(d).launchInstanceOperation(M,t.data.instance)),"onOperation:cancel":T[6]||(T[6]=M=>e(d).cancelInstanceOperation(e(a).lastOperationState.operationId,t.data.instance.id)),onContextmenu:T[7]||(T[7]=M=>e(c)?.showContextMenu(M)),"onOpen:composite":T[8]||(T[8]=M=>e(x).openCompositeInstancePanel(e(h).projectId,e(a).id)),"onOpen:page":F},{status:s(()=>[n(e(Ge),{state:e(a),operation:e(o),"expected-input-hash":e(I).inputHashOutputs.get(e(r).id)?.inputHash,"validation-output":e(f).validationOutputs.get(e(r).id)},null,8,["state","operation","expected-input-hash","validation-output"])]),default:s(()=>[n(e(It),{ref_key:"contextMenu",ref:c,stores:e(l),instance:e(r),component:e(m),state:e(a),editable:t.data.editable&&!e(i),locked:!!e(y),ghost:e(i)},null,8,["stores","instance","component","state","editable","locked","ghost"]),e(L)?(p(),D(e(xt),{key:0,visible:e(N),"onUpdate:visible":T[0]||(T[0]=M=>J(N)?N.value=M:null),meta:e(L),content:e(W),onClose:T[1]||(T[1]=M=>N.value=!1)},null,8,["visible","meta","content"])):P("",!0)]),_:1},8,["editing-secrets","loading-secrets","initial-secrets","loading-page","instance","component","entities","input-resolver-outputs","input-resolver-dependent-map","instance-lock","state","editable","ghost","stores","workspace-store","all-instances"]))}}),$e=q({__name:"NodeContextMenu",props:Q({title:{},subtitle:{},isDeletable:{type:Function}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(t,{expose:l}){const{selection:x,vueFlowStore:h,deleteNodes:I}=we(),g=_(t,"visible"),w=Ue(),d=ie("contextMenu"),f=async y=>{d.value&&await d.value.showContextMenu(y)},{off:r}=h.onViewportChange(()=>{g.value=!1});qe(()=>{r(),g.value=!1}),l({showContextMenu:f});const m=S(()=>t.isDeletable(w.node)?x.selectedNodeIds.has(w.id)?Array.from(x.selectedNodes).filter(t.isDeletable):[w.node]:[]),a=S(()=>m.value.length===1?"Delete":`Delete selected (${m.value.length})`);return(y,o)=>(p(),D(Je,{ref_key:"contextMenu",ref:d,visible:g.value,"onUpdate:visible":o[1]||(o[1]=i=>g.value=i),title:t.title,subtitle:t.subtitle},{default:s(()=>[y.$slots.default?(p(),U(R,{key:0},[n(G),je(y.$slots,"default")],64)):P("",!0),e(m).length>0?(p(),U(R,{key:1},[n(G),n(E,{title:e(a),icon:"mdi-delete",color:"error",onClick:o[0]||(o[0]=i=>e(I)(e(m)))},null,8,["title"])],64)):P("",!0)]),_:3},8,["visible","title","subtitle"]))}});export{Ot as _,Pt as a,Ft as b,It as c};
|
|
1
|
+
import{q as K,I as be,b2 as De,b3 as Te,_ as pe,g as he,aD as we,aW as re,n as Oe,aq as Pe,av as Fe,b4 as Me,aE as Ue}from"#entry";import{E as q,g as S,Z as D,_ as P,W as p,aE as ne,a1 as s,X as n,ay as oe,a2 as B,a3 as H,F as e,aS as Ne,aW as ie,K as U,aN as Ie,$ as O,ac as xe,aO as Q,av as _,a9 as R,af as ae,b8 as ce,aB as fe,r as V,w as ee,aw as me,bc as ke,bd as Se,be as se,az as Be,b as J,aR as Ae,aA as G,aC as ve,aD as ge,ai as te,a0 as ue,a$ as Le,aH as ze,aJ as de,bf as Ee,m as Re,N as qe,ab as je}from"./Dm4QKadl.js";import{H as He,I as We}from"./dwrHE3tM.js";import{I as Ge}from"./BqeRdtD4.js";import{a as E,_ as Je}from"./ga9TZ2z5.js";import{C as Ke}from"./DhQfdAdO.js";import{P as Xe}from"./DHuTDtaT.js";const ye=q({__name:"EditorLoader",props:{text:{},value:{}},setup(t){const{instancesStore:l}=K(),x=S(()=>t.value===-1?t.text:`${t.text} ${t.value}/${l.totalInstanceCount}...`);return(h,I)=>t.text?(p(),D(ne,{key:0,variant:"tonal"},{default:s(()=>[n(oe,{class:"text-overline"},{default:s(()=>[B(H(e(x)),1)]),_:1}),n(Ne,{indeterminate:t.value===-1,"model-value":t.value,max:e(l).totalInstanceCount,height:4,color:"primary",class:"w-full"},null,8,["indeterminate","model-value","max"])]),_:1})):P("",!0)}}),Ot=q({__name:"EditorLoaderPopup",setup(t){const{instancesStore:l,stateStore:x}=K(),h=S(()=>l.initializationPhase==="resolving"||x.initializationPhase==="calculating");return(I,g)=>e(h)?(p(),D(ne,{key:0,variant:"tonal"},{default:s(()=>[e(l).initializationPhase==="resolving"?(p(),D(ye,{key:0,text:"Resolving instance inputs",value:e(l).resolvedInstanceCount},null,8,["value"])):P("",!0),e(x).initializationPhase==="calculating"?(p(),D(ye,{key:1,text:"Detecting instance changes",value:e(x).calculatedInputHashCount},null,8,["value"])):P("",!0)]),_:1})):P("",!0)}}),Pt=q({__name:"HubNodeWrapper",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},setup(t){const{stateStore:l}=K(),x=ie("contextMenu");return(h,I)=>(p(),D(He,{hub:t.data.hub,onContextmenu:I[0]||(I[0]=g=>e(x)?.showContextMenu(g))},{default:s(()=>[n(e($e),{ref_key:"contextMenu",ref:x,title:"Hub",subtitle:t.data.hub.id,"is-deletable":g=>e(l).isNodeDeletable(g)},null,8,["subtitle","is-deletable"])]),_:1},8,["hub"]))}}),Ye={key:0},Ze={class:"d-flex flex-column"},Qe={key:0,class:"text-caption text-medium-emphasis"},_e={key:1,class:"text-body-2 text-medium-emphasis pa-4"},et=q({__name:"OperationPlanTree",props:{phases:{}},setup(t){const{instancesStore:l,libraryStore:x}=K(),h=S(()=>{const f=[];for(const r of t.phases){const m={id:`phase-${r.type}`,title:`${r.type.charAt(0).toUpperCase()+r.type.slice(1)} Phase`,subtitle:`${r.instances.length} instance${r.instances.length===1?"":"s"}`,icon:w(r.type),iconColor:d(r.type),phaseType:r.type,children:[]},a=I(r.instances);m.children=a,f.push(m)}return f}),I=f=>{const r=new Map;for(const a of f)r.has(a.id)||r.set(a.id,{...a,children:[]});for(const a of f)a.parentId&&r.has(a.parentId)&&r.get(a.parentId).children.push(a);return f.filter(a=>!a.parentId||!r.has(a.parentId)).map(a=>g(a,r))},g=(f,r)=>{const m=l.instances.get(f.id),a=m?x.library.components[m.type]:null,y={id:f.id,title:a&&m?`${a.meta.title} "${m.name}"`:f.id,subtitle:f.message,icon:a?.meta.icon??"iconamoon:component",iconColor:a?.meta.iconColor,phaseType:"instance"},o=r.get(f.id);return o&&o.children.length>0&&(y.children=o.children.map(i=>g(i,r))),y},w=f=>{switch(f){case"preview":return"mdi-eye";case"destroy":return"mdi-delete";case"update":return"mdi-update";case"refresh":return"mdi-refresh";default:return"mdi-cog"}},d=f=>{switch(f){case"preview":return"secondary";case"destroy":return"error";case"update":return"primary";case"refresh":return"info";default:return"secondary"}};return(f,r)=>t.phases.length>0?(p(),U("div",Ye,[n(Ie,{items:e(h),"item-title":"title","item-value":"id",density:"compact","open-all":"","indent-lines":"","bg-color":"#2d2d2d"},{prepend:s(({item:m})=>[n(e(be),{icon:m.icon,color:m.iconColor,width:"20",class:"mr-2"},null,8,["icon","color"])]),title:s(({item:m})=>[O("div",Ze,[O("div",{class:xe(["text-body-2",m.phaseType==="instance"?"font-weight-regular":"font-weight-medium"])},H(m.title),3),m.subtitle?(p(),U("div",Qe,H(m.subtitle),1)):P("",!0)])]),_:1},8,["items"])])):(p(),U("div",_e," No changes planned for this operation. "))}}),tt={key:0},nt={class:"text-caption"},at=q({__name:"OperationOptions",props:Q({operation:{}},{options:{default:{}},optionsModifiers:{}}),emits:["update:options"],setup(t){const l=_(t,"options"),x=[{key:"forceUpdateDependencies",label:"Force update dependencies",description:"Force update all dependencies regardless of their current state. Bypasses hash-based change detection for dependency chains.",showForOperations:["update"]},{key:"ignoreDependencies",label:"Ignore dependencies",description:"Skip dependency inclusion entirely. Only the requested instances are operated on, even if their dependencies are outdated or failed.",warning:"Ignoring dependencies will skip undeployed or failed prerequisites. Expect the operation to fail unless every required instance is handled manually.",showForOperations:["update"]},{key:"forceUpdateChildren",label:"Force update children instances",description:"Force update all children of composite instances regardless of their state. Overrides selective child inclusion logic.",showForOperations:["update"]},{key:"destroyDependentInstances",label:"Destroy dependent instances",description:"Include dependent instances when destroying instances. Traverses the dependency graph in reverse to prevent orphaned instances.",defaultValue:!0,showForOperations:["destroy","recreate"]},{key:"invokeDestroyTriggers",label:"Invoke destroy triggers",description:"Execute destroy triggers when destroying instances. Controls trigger execution during the destruction phase.",defaultValue:!0},{key:"deleteUnreachableResources",label:"Delete unreachable resources",description:"Delete Pulumi resources that are no longer referenced in the state. Deletes orphaned resources within individual instances.",warning:"All resources that will not be reachable at the moment of the destroy operation will be removed from the state. Only use when you are sure that these resources do not actually exist!"},{key:"forceDeleteState",label:"Force delete state",description:"Force deletion of instance state even if the destroy operation fails. Bypasses normal destroy procedures as emergency fallback.",warning:"This will delete the stack state and all resources in it even if the destroy operation failed. Use only when the stack is unrecoverable and you want to start from scratch.",showForOperations:["destroy","recreate"]},{key:"allowPartialCompositeInstanceUpdate",label:"Allow partial update of composite instances",description:"Allow update of individual composite children without requiring all siblings. When enabled, only necessary children are included.",showForOperations:["update","recreate"]},{key:"allowPartialCompositeInstanceDestruction",label:"Allow partial destruction of composite instances",description:"Allow partial destruction of composite instances during cascade operations. When enabled, cascade destruction includes only directly dependent children.",showForOperations:["destroy","recreate"]},{key:"refresh",label:"Refresh state before operation",description:"Also refresh the state of instances during the operation. Synchronizes state with actual infrastructure."},{key:"debug",label:"Enable debug logging",description:"Enable debug logging for Pulumi engine and resource providers. Sets TF_LOG=DEBUG for Terraform providers.",warning:"Debug mode may expose sensitive information including credentials in the logs. Use only when absolutely necessary for troubleshooting."}],h=S(()=>x.filter(g=>g.showForOperations?g.showForOperations.includes(t.operation):!0)),I=(g,w)=>{const d=w??!1;g==="forceUpdateDependencies"&&d&&(l.value.ignoreDependencies=!1),g==="ignoreDependencies"&&d&&(l.value.forceUpdateDependencies=!1),l.value[g]=d};return(g,w)=>l.value?(p(),U("div",tt,[(p(!0),U(R,null,ae(e(h),d=>(p(),U(R,{key:d.key},[n(ce,{"model-value":l.value[d.key],"onUpdate:modelValue":f=>I(d.key,f),class:xe(d===e(h)[0]?"mt-2":""),label:d.label,density:"compact","hide-details":""},null,8,["model-value","onUpdate:modelValue","class","label"]),O("div",nt,H(d.description),1)],64))),128)),(p(!0),U(R,null,ae(e(h),d=>(p(),U(R,{key:`warning-${d.key}`},[d.warning&&l.value[d.key]?(p(),D(fe,{key:0,density:"compact",type:"warning",variant:"outlined",class:"mt-4"},{default:s(()=>[B(H(d.warning),1)]),_:2},1024)):P("",!0)],64))),128))])):P("",!0)}}),st={class:"metadata-section"},ot={class:"options-header"},it={class:"text-body-2 text-medium-emphasis mb-4"},lt={class:"options-scrollable"},rt={class:"plan-header"},dt={class:"plan-scrollable"},ct=q({__name:"InstanceOperationDialog",props:Q({instances:{},component:{},operation:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const l=_(t,"visible"),{operationsStore:x,projectStore:h}=K(),I=S(()=>t.instances.length>1),g=S(()=>t.instances[0]),w=V({forceUpdateDependencies:!1,ignoreDependencies:!1,forceUpdateChildren:!1,destroyDependentInstances:!1,invokeDestroyTriggers:!0,deleteUnreachableResources:!1,forceDeleteState:!1,allowPartialCompositeInstanceUpdate:!1,allowPartialCompositeInstanceDestruction:!1,refresh:!1}),d=V([]),f=V(!1),r=V(null),m=V(""),a=V("");ee([()=>t.operation,()=>t.instances],()=>{t.instances.length!==0&&(m.value=I.value?De(t.operation,t.instances):Te(t.operation,g.value),w.value={...w.value,destroyDependentInstances:t.operation==="destroy"})},{immediate:!0}),ee(()=>w.value,()=>{y()},{deep:!0}),ee(()=>l.value,v=>{v&&y()});const y=async()=>{if(l.value){f.value=!0,r.value=null;try{const v=await x.planOperation({projectId:h.projectId,type:t.operation,instanceIds:t.instances.map(u=>u.id),options:w.value});d.value=v}catch(v){console.error("Failed to load operation plan:",v),r.value=v instanceof Error?v.message:"Unknown error"}finally{f.value=!1}}},o=S(()=>{const v=new Set,u=new Set,F=new Set,X=new Set,Z=new Set;for(const b of d.value)for(const c of b.instances){if(Z.add(c.id),b.type==="update"){v.add(c.id);continue}if(b.type==="destroy"){u.add(c.id);continue}if(b.type==="refresh"){F.add(c.id);continue}b.type==="preview"&&X.add(c.id)}return{update:v.size,destroy:u.size,refresh:F.size,preview:X.size,unique:Z.size}}),i=v=>`${v} instance${v===1?"":"s"}`,C=S(()=>{switch(t.operation){case"update":return"Update";case"preview":return"Preview";case"refresh":return"Refresh";case"destroy":return"Destroy";case"recreate":return"Recreate";default:return"Unknown operation"}}),$=S(()=>{const v=o.value;switch(t.operation){case"update":{const{update:u}=v;return u===0?C.value:`Update ${i(u)}`}case"recreate":return v.unique===0?C.value:`Recreate ${i(v.unique)}`;case"destroy":return v.destroy===0?C.value:`Destroy ${i(v.destroy)}`;case"refresh":return v.refresh===0?C.value:`Refresh ${i(v.refresh)}`;case"preview":return v.preview===0?C.value:`Preview ${i(v.preview)}`;default:return v.unique===0?C.value:`${C.value} ${i(v.unique)}`}}),N=S(()=>{switch(t.operation){case"update":return"primary";case"preview":return"secondary";case"refresh":return"info";case"destroy":return"error";case"recreate":return"warning";default:return"primary"}}),L=V(!1),W=async()=>{L.value=!0;try{await x.launchOperation({projectId:h.projectId,type:t.operation,instanceIds:t.instances.map(v=>v.id),options:w.value,meta:{title:m.value,description:a.value}}),l.value=!1}finally{L.value=!1}},z=S(()=>I.value?`${C.value} ${t.instances.length} instances`:t.component?`${C.value} ${t.component.meta.title} "${g.value.name}"`:`${C.value} "${g.value.name}"`);return(v,u)=>(p(),D(me,{modelValue:l.value,"onUpdate:modelValue":u[4]||(u[4]=F=>l.value=F),"max-width":"1200px",class:"operation-dialog"},{default:s(()=>[n(ne,{title:e(z),color:t.component?.meta.color??"#2d2d2d",class:"operation-card"},{prepend:s(()=>[t.component&&!e(I)?(p(),D(e(Ke),{key:0,meta:t.component.meta},null,8,["meta"])):e(I)?(p(),D(ue,{key:1},{default:s(()=>[...u[5]||(u[5]=[B("mdi-format-list-bulleted",-1)])]),_:1})):(p(),D(ue,{key:2},{default:s(()=>[...u[6]||(u[6]=[B("mdi-cube-outline",-1)])]),_:1}))]),default:s(()=>[n(oe,{class:"operation-card-content"},{default:s(()=>[n(ke,{fluid:"",class:"pa-0 fill-height"},{default:s(()=>[n(Se,{"no-gutters":"",class:"fill-height"},{default:s(()=>[n(se,{cols:"12",md:"5",class:"pr-md-4 column-container"},{default:s(()=>[O("div",st,[u[7]||(u[7]=O("div",{class:"text-overline mb-2"},"Metadata",-1)),n(Be,{modelValue:e(m),"onUpdate:modelValue":u[0]||(u[0]=F=>J(m)?m.value=F:null),label:"Title",variant:"outlined",density:"compact",class:"mb-3",hint:"A descriptive title for this operation (optional)","persistent-hint":""},null,8,["modelValue"]),n(Ae,{modelValue:e(a),"onUpdate:modelValue":u[1]||(u[1]=F=>J(a)?a.value=F:null),label:"Description",variant:"outlined",density:"compact",rows:"2",hint:"Describe the purpose of this operation (optional)","persistent-hint":""},null,8,["modelValue"])]),n(G,{class:"my-4"}),O("div",ot,[u[10]||(u[10]=O("div",{class:"text-overline mb-2"},"Options",-1)),O("p",it,[u[8]||(u[8]=B(" Configure how the ",-1)),O("b",null,H(t.operation),1),u[9]||(u[9]=B(" operation should be executed. These options control the behavior and scope of the operation. ",-1))])]),O("div",lt,[n(at,{options:e(w),"onUpdate:options":u[2]||(u[2]=F=>J(w)?w.value=F:null),operation:t.operation},null,8,["options","operation"])])]),_:1}),n(G,{vertical:"",class:"d-none d-md-flex"}),n(se,{cols:"12",md:"7",class:"pl-md-4 column-container"},{default:s(()=>[O("div",rt,[u[11]||(u[11]=O("div",{class:"text-overline mb-2"},"Execution Plan",-1)),u[12]||(u[12]=O("p",{class:"text-body-2 text-medium-emphasis mb-4"}," Preview of instances that will be affected by this operation. The plan shows the execution phases and which instances will be processed. ",-1)),e(r)?(p(),D(fe,{key:0,type:"error",variant:"outlined",density:"compact",class:"mb-3"},{default:s(()=>[B(" Failed to load operation plan: "+H(e(r)),1)]),_:1})):P("",!0)]),O("div",dt,[n(et,{phases:e(d)},null,8,["phases"])])]),_:1})]),_:1})]),_:1})]),_:1}),n(ve,null,{default:s(()=>[n(ge),n(te,{onClick:u[3]||(u[3]=F=>l.value=!1)},{default:s(()=>[...u[13]||(u[13]=[B("Cancel",-1)])]),_:1}),n(te,{color:e(N),loading:e(L),disabled:e(f),onClick:W},{default:s(()=>[B(H(e($)),1)]),_:1},8,["color","loading","disabled"])]),_:1})]),_:1},8,["title","color"])]),_:1},8,["modelValue"]))}}),ut=pe(ct,[["__scopeId","data-v-8655a745"]]),pt={class:"tree-scrollable"},ft={class:"d-flex flex-column"},mt={class:"text-body-2 font-weight-regular"},vt={class:"text-caption text-medium-emphasis"},gt=q({__name:"ForgetInstanceStateDialog",props:Q({instances:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const l=_(t,"visible"),{stateStore:x,libraryStore:h}=K(),I=S(()=>t.instances.length>1),g=S(()=>t.instances[0]),w=V(!1),d=V(!1),f=V(!1),r=S(()=>t.instances.map(y=>{const o=h.library.components?.[y.type];return{id:y.id,title:o?`${o.meta.title} "${y.name}"`:`${y.type} "${y.name}"`,subtitle:y.id,icon:o?.meta.icon??"iconamoon:component",iconColor:o?.meta.iconColor}})),m=async()=>{w.value=!0;try{await x.forgetInstanceStates(t.instances.map(y=>y.id),d.value,f.value),l.value=!1}finally{w.value=!1}},a=S(()=>{if(t.instances.length===0)return"Forget state";if(!I.value){const y=g.value,o=h.library.components?.[y.type];return o?`Forget state of ${o.meta.title} "${y.name}"`:`Forget state of ${y.type} "${y.name}"`}return`Forget state of ${t.instances.length} instances`});return(y,o)=>(p(),D(me,{modelValue:l.value,"onUpdate:modelValue":o[3]||(o[3]=i=>l.value=i),"max-width":"1200px",class:"forget-dialog"},{default:s(()=>[n(ne,{title:e(a),color:"#2d2d2d",class:"forget-card"},{default:s(()=>[n(oe,{class:"forget-card-content"},{default:s(()=>[n(ke,{fluid:"",class:"pa-0 fill-height"},{default:s(()=>[n(Se,{"no-gutters":"",class:"fill-height"},{default:s(()=>[n(se,{cols:"12",md:"5",class:"pr-md-4 column-container"},{default:s(()=>[o[5]||(o[5]=O("div",{class:"text-overline mb-2"},"Options",-1)),n(ce,{modelValue:e(d),"onUpdate:modelValue":o[0]||(o[0]=i=>J(d)?d.value=i:null),label:"Delete all secrets associated with this instance",density:"compact","hide-details":""},null,8,["modelValue"]),n(ce,{modelValue:e(f),"onUpdate:modelValue":o[1]||(o[1]=i=>J(f)?f.value=i:null),label:"Clear all terminal data associated with this instance",density:"compact","hide-details":""},null,8,["modelValue"]),n(fe,{density:"compact",type:"warning",variant:"outlined",class:"mt-4 alert-auto"},{default:s(()=>[...o[4]||(o[4]=[O("div",null," No destroy operation will be performed, so all resources will be left in place and unreachable by HighState. ",-1),O("div",null," You should only use this operation when the instance is unreachable/unrecoverable and you want to start from scratch. ",-1)])]),_:1})]),_:1}),n(G,{vertical:"",class:"d-none d-md-flex"}),n(se,{cols:"12",md:"7",class:"pl-md-4 mt-4 mt-md-0 column-container"},{default:s(()=>[o[6]||(o[6]=O("div",{class:"text-overline mb-2"},"Instances",-1)),O("div",pt,[n(Ie,{items:e(r),"item-title":"title","item-value":"id",density:"compact","bg-color":"#2d2d2d",class:"forget-instance-tree"},{prepend:s(({item:i})=>[n(e(be),{icon:i.icon,color:i.iconColor,width:"20",class:"mr-2"},null,8,["icon","color"])]),title:s(({item:i})=>[O("div",ft,[O("div",mt,H(i.title),1),O("div",vt,H(i.subtitle),1)])]),_:1},8,["items"])])]),_:1})]),_:1})]),_:1})]),_:1}),n(ve,null,{default:s(()=>[n(ge),n(te,{onClick:o[2]||(o[2]=i=>l.value=!1)},{default:s(()=>[...o[7]||(o[7]=[B("Cancel",-1)])]),_:1}),n(te,{loading:e(w),onClick:m},{default:s(()=>[B(" Forget State"+H(e(I)?` (${t.instances.length})`:""),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}}),yt=pe(gt,[["__scopeId","data-v-7881a32c"]]),bt={class:"session-list-cointainer"},ht=q({__name:"TerminalListSubmenu",props:Q({stateId:{},terminalIds:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const{instancesStore:l,stateStore:x}=K(),{state:h,execute:I,isLoading:g}=x.getTerminalsState(S(()=>t.terminalIds)),{state:w,execute:d,isLoading:f}=l.getTerminalSessionsState(S(()=>t.stateId)),r=_(t,"visible");ee(r,i=>{i&&(d(),I())});const m=i=>i.finishedAt?`Finished at ${new Date(i.finishedAt).toLocaleString()}`:`Started at ${new Date(i.startedAt).toLocaleString()}`,a=i=>{const C=Ee();return i.finishedAt?"#9E9E9E":C.current.value.colors.success},y=V(null),o=async i=>{y.value=i;try{await l.openTerminal(i,!0)}finally{y.value=null}};return(i,C)=>(p(),D(e(E),{icon:"mdi-console",title:"Terminals"},{append:s(()=>[n(ue,{icon:"mdi-menu-right",size:"x-small"})]),default:s(()=>[n(Le,{modelValue:r.value,"onUpdate:modelValue":C[0]||(C[0]=$=>r.value=$),"open-on-focus":!1,"open-on-hover":"","close-on-content-click":!1,submenu:"",activator:"parent"},{default:s(()=>[n(ze,{density:"compact",variant:"text"},{default:s(()=>[n(de,{class:"text-overline"},{default:s(()=>[...C[1]||(C[1]=[B("Available Terminals",-1)])]),_:1}),(p(!0),U(R,null,ae(e(h),$=>(p(),D(e(E),{key:$.id,disabled:!!e(y),title:$.meta.title,subtitle:$.meta.description,"custom-icon":$.meta.icon,loading:e(y)===$.id,icon:"mdi-console",onClick:N=>o($.id)},null,8,["disabled","title","subtitle","custom-icon","loading","onClick"]))),128)),n(G,{class:"mt-2 mb-2"}),n(de,{class:"text-overline"},{default:s(()=>[...C[2]||(C[2]=[B("Sessions",-1)])]),_:1}),O("div",bt,[(p(!0),U(R,null,ae(e(w),$=>(p(),D(e(E),{key:$.id,title:$.meta.title,subtitle:m($),"custom-icon":$.meta.icon,icon:"mdi-console",color:a($),onClick:N=>e(l).openTerminalSession($)},null,8,["title","subtitle","custom-icon","color","onClick"]))),128))]),e(w).length===0?(p(),D(de,{key:0,class:"text-disabled"},{default:s(()=>[...C[3]||(C[3]=[B(" No sessions found ",-1)])]),_:1})):P("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1}))}}),wt=pe(ht,[["__scopeId","data-v-7c86584d"]]),It=q({__name:"InstanceContextMenu",props:{instance:{},component:{},state:{},stores:{},operation:{},locked:{type:Boolean},editable:{type:Boolean},ghost:{type:Boolean,default:!1}},setup(t,{expose:l}){const{projectStore:x,stateStore:h,operationsStore:I}=t.stores,g=he(),{selection:w}=we(),d=V(!1),f=V(!1),r=V("update"),m=V([]),a=V(!1),y=V([]),o=S(()=>w.selectedInstances.length>1&&w.selectedInstances.some(c=>c.id===t.instance.id)?w.selectedInstances:[t.instance]),i=S(()=>o.value.length>1),C=(b,c,k)=>{if(k==="preview"&&(i.value||b.kind!=="unit"))return!1;const j=Pe(c?.lastOperationState?.status);switch(k){case"update":return!j;case"refresh":return re(c)&&!j;case"preview":return!j;case"recreate":case"destroy":return re(c)&&!j;default:return!1}},$=b=>t.ghost&&b!=="destroy"?!1:o.value.some(c=>{const k=h.instanceStates.get(c.id);return C(c,k,b)}),N=b=>t.ghost&&b!=="destroy"?!1:o.value.every(c=>{const k=h.instanceStates.get(c.id);return C(c,k,b)}),L=S(()=>o.value.some(b=>{const c=h.instanceStates.get(b.id);return re(c)})),W=b=>{const c=o.value.length;return c===1?b==="update"?L.value?"Update":"Create":b.charAt(0).toUpperCase()+b.slice(1):b==="update"?`${L.value?"Update":"Create"} selected (${c})`:`${b.charAt(0).toUpperCase()+b.slice(1)} selected (${c})`},z=b=>{if(i.value)return"mdi-format-list-bulleted";switch(b){case"update":return L.value?"mdi-play":"mdi-rocket-launch";case"refresh":return"mdi-reload";case"preview":return"mdi-eye";case"recreate":return"mdi-restart";case"destroy":return"mdi-stop";default:return"mdi-play"}},v=b=>{r.value=b,m.value=o.value,f.value=!0,d.value=!1,w.clearSelection()},u=()=>{y.value=o.value,a.value=!0,d.value=!1,w.clearSelection()},F=ie("contextMenu"),X=async b=>{F.value&&await F.value.showContextMenu(b)},Z=async()=>{if(o.value.length!==1||t.instance.kind!=="unit"){d.value=!1;return}const b=await I.launchInstanceOperation("preview",t.instance);d.value=!1,t.state&&await g.openLogsPanel(x.projectId,b.id,t.state.id)};return l({showContextMenu:X}),(b,c)=>(p(),U(R,null,[n(e($e),{ref_key:"contextMenu",ref:F,visible:e(d),"onUpdate:visible":c[6]||(c[6]=k=>J(d)?d.value=k:null),title:"Instance",subtitle:t.instance.id,"is-deletable":k=>t.stores.stateStore.isNodeDeletable(k)},{default:s(()=>[$("update")?(p(),D(e(E),{key:0,title:W("update"),icon:z("update"),color:"primary",disabled:t.locked||!N("update"),onClick:c[0]||(c[0]=k=>v("update"))},null,8,["title","icon","disabled"])):P("",!0),$("refresh")?(p(),D(e(E),{key:1,title:W("refresh"),icon:z("refresh"),color:"primary",disabled:t.locked||!N("refresh"),onClick:c[1]||(c[1]=k=>v("refresh"))},null,8,["title","icon","disabled"])):P("",!0),$("preview")?(p(),D(e(E),{key:2,title:W("preview"),icon:z("preview"),color:"secondary",disabled:t.locked||!N("preview"),onClick:Z},null,8,["title","icon","disabled"])):P("",!0),t.state?.lastOperationState?(p(),U(R,{key:3},[n(G),n(e(E),{title:"Open Logs",icon:"mdi-text",color:"primary",onClick:c[2]||(c[2]=k=>e(h).openInstanceLogs(t.instance))})],64)):P("",!0),n(G),n(e(E),{title:"View in Settings",icon:"mdi-cog",color:"primary",onClick:c[3]||(c[3]=()=>{const k=e(h).getInstanceState(t.instance.id);k&&("navigateTo"in b?b.navigateTo:e(Oe))({name:"settings.instance-details",params:{projectId:e(x).projectId,stateId:k.id}}),d.value=!1})}),t.state?.terminalIds?.length?(p(),U(R,{key:4},[n(G),n(wt,{"state-id":t.state.id,"terminal-ids":t.state.terminalIds},null,8,["state-id","terminal-ids"])],64)):P("",!0),e(L)?(p(),U(R,{key:5},[n(G),$("recreate")?(p(),D(e(E),{key:0,title:W("recreate"),icon:z("recreate"),color:"warning",disabled:t.locked||!N("recreate"),onClick:c[4]||(c[4]=k=>v("recreate"))},null,8,["title","icon","disabled"])):P("",!0),$("destroy")?(p(),D(e(E),{key:1,title:W("destroy"),icon:z("destroy"),color:"error",disabled:t.locked||!N("destroy"),onClick:c[5]||(c[5]=k=>v("destroy"))},null,8,["title","icon","disabled"])):P("",!0),n(e(E),{title:e(i)?`Forget State selected (${e(o).length})`:"Forget State",icon:"mdi-delete-forever",color:"error",disabled:t.locked,onClick:u},null,8,["title","disabled"])],64)):P("",!0)]),_:1},8,["visible","subtitle","is-deletable"]),n(ut,{visible:e(f),"onUpdate:visible":c[7]||(c[7]=k=>J(f)?f.value=k:null),operation:e(r),instances:e(m),component:t.component},null,8,["visible","operation","instances","component"]),n(yt,{visible:e(a),"onUpdate:visible":c[8]||(c[8]=k=>J(a)?a.value=k:null),instances:e(y)},null,8,["visible","instances"])],64))}}),xt=q({__name:"PageDialog",props:Q({meta:{},content:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const l=_(t,"visible");return(x,h)=>(p(),D(me,{modelValue:l.value,"onUpdate:modelValue":h[1]||(h[1]=I=>l.value=I),"max-width":"80vh","max-height":"60vh"},{default:s(()=>[n(ne,{title:t.meta.title,color:"#2d2d2d"},{default:s(()=>[n(oe,{style:{"overflow-y":"scroll"}},{default:s(()=>[n(Xe,{content:t.content},null,8,["content"])]),_:1}),n(ve,null,{default:s(()=>[n(ge),n(te,{onClick:h[0]||(h[0]=I=>l.value=!1)},{default:s(()=>[...h[2]||(h[2]=[B("Close",-1)])]),_:1})]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}}),Ft=q({__name:"InstanceNodeWrapper",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},setup(t){const l=K(),x=he(),{projectStore:h,stateStore:I,instancesStore:g,libraryStore:w,operationsStore:d,validationStore:f}=l,r=S(()=>t.data.instance),m=S(()=>{const A=w.library.components[r.value.type];if(!A)throw new Error(`component "${r.value.type}" for instance "${r.value.id}" not found in library`);return A}),a=S(()=>I.instanceStates.get(r.value.id)),y=S(()=>a.value&&I.instanceLocks.get(a.value.id)),o=S(()=>d.getLastInstanceOperation(r.value.id)),i=S(()=>g.isGhostInstance(r.value.id)),C=S(()=>i.value&&a.value?.source==="resident"),$=V(!1),N=V(!1),L=V(),W=V([]),z=V(!1),v=V(!1),u=V({}),F=async()=>{$.value=!0;try{if(!a.value?.pageIds)return;const A=a.value.pageIds;if(!A.length)return;const T=await I.getPage(A[0]);if(!T)return;W.value=T.content,L.value=T.meta,N.value=!0}finally{$.value=!1}},X=V(!1),Z=async()=>{X.value=!0;try{if(!a.value?.terminalIds||a.value.terminalIds.length===0)return;await g.openTerminal(a.value.terminalIds[0])}finally{X.value=!1}},b=async()=>{v.value=!0;try{if(!a.value)return;const A=await l.stateStore.getInstanceSecrets(a.value.id);u.value={...A},z.value=!0}finally{v.value=!1}},c=ie("contextMenu"),k=Fe(),j=V(null),Ce=A=>i.value?!1:Me(k,w.library,A);return ee(()=>({ghost:i.value,resident:C.value,initialized:k.areNodesInitialized.value}),({ghost:A,resident:T,initialized:M})=>{if(!M)return;const Y=k.findNode(t.id);if(Y){if(!A){if(j.value){const{connectable:le,draggable:Ve}=j.value;k.updateNode(t.id,()=>({connectable:le,draggable:Ve})),j.value=null}return}j.value||(j.value={connectable:!!Y.connectable,draggable:Y.draggable??!0}),k.updateNode(t.id,()=>({connectable:!1,draggable:T}))}},{immediate:!0}),(A,T)=>(p(),D(We,{"editing-secrets":e(z),"onUpdate:editingSecrets":T[2]||(T[2]=M=>J(z)?z.value=M:null),"loading-secrets":e(v),"initial-secrets":e(u),"loading-page":e($),instance:t.data.instance,component:e(m),entities:e(w).library.entities,"input-resolver-outputs":e(g).inputResolverOutputs,"input-resolver-dependent-map":e(g).inputResolverDependentMap,"is-valid-connection":Ce,"instance-lock":e(y),state:e(a),editable:t.data.editable&&!e(i),ghost:e(i),stores:("markRaw"in A?A.markRaw:e(Re))(e(l)),"workspace-store":e(x),"all-instances":e(g).instances,"onSave:args":T[3]||(T[3]=(M,Y,le)=>e(g).updateInstance(M,Y,le)),"onSave:secrets":T[4]||(T[4]=(M,Y)=>e(I).updateInstanceSecrets(M,Y)),"onOpen:secrets":b,"onOpen:terminal":Z,"onOperation:launch":T[5]||(T[5]=M=>e(d).launchInstanceOperation(M,t.data.instance)),"onOperation:cancel":T[6]||(T[6]=M=>e(d).cancelInstanceOperation(e(a).lastOperationState.operationId,t.data.instance.id)),onContextmenu:T[7]||(T[7]=M=>e(c)?.showContextMenu(M)),"onOpen:composite":T[8]||(T[8]=M=>e(x).openCompositeInstancePanel(e(h).projectId,e(a).id)),"onOpen:page":F},{status:s(()=>[n(e(Ge),{state:e(a),operation:e(o),"expected-input-hash":e(I).inputHashOutputs.get(e(r).id)?.inputHash,"validation-output":e(f).validationOutputs.get(e(r).id)},null,8,["state","operation","expected-input-hash","validation-output"])]),default:s(()=>[n(e(It),{ref_key:"contextMenu",ref:c,stores:e(l),instance:e(r),component:e(m),state:e(a),editable:t.data.editable&&!e(i),locked:!!e(y),ghost:e(i)},null,8,["stores","instance","component","state","editable","locked","ghost"]),e(L)?(p(),D(e(xt),{key:0,visible:e(N),"onUpdate:visible":T[0]||(T[0]=M=>J(N)?N.value=M:null),meta:e(L),content:e(W),onClose:T[1]||(T[1]=M=>N.value=!1)},null,8,["visible","meta","content"])):P("",!0)]),_:1},8,["editing-secrets","loading-secrets","initial-secrets","loading-page","instance","component","entities","input-resolver-outputs","input-resolver-dependent-map","instance-lock","state","editable","ghost","stores","workspace-store","all-instances"]))}}),$e=q({__name:"NodeContextMenu",props:Q({title:{},subtitle:{},isDeletable:{type:Function}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(t,{expose:l}){const{selection:x,vueFlowStore:h,deleteNodes:I}=we(),g=_(t,"visible"),w=Ue(),d=ie("contextMenu"),f=async y=>{d.value&&await d.value.showContextMenu(y)},{off:r}=h.onViewportChange(()=>{g.value=!1});qe(()=>{r(),g.value=!1}),l({showContextMenu:f});const m=S(()=>t.isDeletable(w.node)?x.selectedNodeIds.has(w.id)?Array.from(x.selectedNodes).filter(t.isDeletable):[w.node]:[]),a=S(()=>m.value.length===1?"Delete":`Delete selected (${m.value.length})`);return(y,o)=>(p(),D(Je,{ref_key:"contextMenu",ref:d,visible:g.value,"onUpdate:visible":o[1]||(o[1]=i=>g.value=i),title:t.title,subtitle:t.subtitle},{default:s(()=>[y.$slots.default?(p(),U(R,{key:0},[n(G),je(y.$slots,"default")],64)):P("",!0),e(m).length>0?(p(),U(R,{key:1},[n(G),n(E,{title:e(a),icon:"mdi-delete",color:"error",onClick:o[0]||(o[0]=i=>e(I)(e(m)))},null,8,["title"])],64)):P("",!0)]),_:3},8,["visible","title","subtitle"]))}});export{Ot as _,Pt as a,Ft as b,It as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as z,l as O,x as A,y as G,z as F,A as H,B as S,q as L,t as N,s as k,n as q}from"#entry";import{I as x}from"./BmDdxTjo.js";import{S as W}from"./DXh9HyqW.js";import{D as K,a as X}from"./BxZD33h1.js";import{O as Z}from"./CvELRi2k.js";import{_ as h}from"./CeMkeBDb.js";import{_ as J}from"./Bh0qehhp.js";import{_ as Q}from"./BUXOnL59.js";import{_ as Y}from"./CJ6lOLXp.js";import{_}from"./D4OhWExI.js";import{E as $,Z as D,W as R,F as e,a1 as i,X as o,n as T,aL as B,$ as V,ai as ee,a2 as M,a3 as te,aF as ae,ay as se,aE as oe,aM as ie}from"./Dm4QKadl.js";import{_ as ne}from"./U3pqMjXV.js";import{G as re,H as le,I as de}from"./
|
|
1
|
+
import{v as z,l as O,x as A,y as G,z as F,A as H,B as S,q as L,t as N,s as k,n as q}from"#entry";import{I as x}from"./BmDdxTjo.js";import{S as W}from"./DXh9HyqW.js";import{D as K,a as X}from"./BxZD33h1.js";import{O as Z}from"./CvELRi2k.js";import{_ as h}from"./CeMkeBDb.js";import{_ as J}from"./Bh0qehhp.js";import{_ as Q}from"./BUXOnL59.js";import{_ as Y}from"./CJ6lOLXp.js";import{_}from"./D4OhWExI.js";import{E as $,Z as D,W as R,F as e,a1 as i,X as o,n as T,aL as B,$ as V,ai as ee,a2 as M,a3 as te,aF as ae,ay as se,aE as oe,aM as ie}from"./Dm4QKadl.js";import{_ as ne}from"./U3pqMjXV.js";import{G as re,H as le,I as de}from"./dwrHE3tM.js";import"./CmALWFRB.js";import"./D1Jbgd7O.js";import"./Cw6nGM9K.js";import"./DtFoCuZo.js";import"./CwUT5n6w.js";import"./DxuitVdg.js";import"./M3Z1JMP1.js";import"./CQ4fj8p0.js";import"./GAB5JH5K.js";import"./0ekw3e2V.js";import"./DcmvOc98.js";import"./CfV455SO.js";import"./DhQfdAdO.js";import"./DXtl0MQI.js";const ue=$({__name:"PreviewCanvas",props:{instances:{},hubs:{default:()=>[]},components:{},entities:{},autoPosition:{type:Boolean,default:!0},interactive:{type:Boolean,default:!1}},emits:["ready"],setup(s,{emit:l}){const d=l,f=z.createId(),w=O.child({customCanvasId:f}),{outputs:P,dependentMap:b,set:y,dispatchInitialNodes:j}=A("InputResolver",w,G,!0),c=async n=>{n.nodeFactory.createNodesForModels(s.instances,s.hubs,{readonly:!0});for(const r of s.instances){const U=s.components[r.type];y(`instance:${r.id}`,{kind:"instance",instance:r,component:U})}for(const r of s.hubs)y(`hub:${r.id}`,{kind:"hub",hub:r});const I=[j()];s.autoPosition?I.push(F(n.vueFlowStore).then(()=>H(n.vueFlowStore)).then(()=>n.vueFlowStore.fitView()).then(()=>T()).then(()=>S(n.vueFlowStore,n.onNodesMoved,n.edgeEndpointOffsets))):I.push(F(n.vueFlowStore).then(()=>n.vueFlowStore.fitView()).then(()=>T()).then(()=>S(n.vueFlowStore,n.onNodesMoved,n.edgeEndpointOffsets))),await Promise.all(I),d("ready")};return(n,I)=>(R(),D(re,{"canvas-id":["custom",e(f)],onInit:c,"input-resolver-outputs":e(P),components:s.components,entities:s.entities,minimap:!1,interactive:s.interactive},{"node-instance":i(({data:r})=>[o(e(de),{instance:r.instance,component:s.components[r.instance.type],entities:s.entities,"input-resolver-outputs":e(P),"input-resolver-dependent-map":e(b),editable:""},null,8,["instance","component","entities","input-resolver-outputs","input-resolver-dependent-map"])]),"node-hub":i(({data:r})=>[o(le,{hub:r.hub},null,8,["hub"])]),_:1},8,["canvas-id","input-resolver-outputs","components","entities","interactive"]))}}),pe={class:"d-flex ga-6",style:{"min-height":"400px"}},me={class:"text-body-2 text-capitalize"},ze=$({__name:"[stateId]",props:{params:{}},async setup(s){let l,d;const{settingsStore:f,instancesStore:w,stateStore:P,libraryStore:b}=L(),{projectStore:y}=L();y.initializing?([l,d]=B(()=>k(()=>y.initialized).toBe(!0)),await l,d(),y.addLibraryRoot()):([l,d]=B(()=>y.initialize1()),await l,d(),[l,d]=B(()=>y.initialize2()),await l,d()),[l,d]=B(()=>k(()=>w.initializationPhase!=="loading").toBe(!0)),await l,d(),[l,d]=B(()=>k(()=>P.statesLoaded).toBe(!0)),await l,d();const j=P.getStateByStateId(s.params.stateId)?.instanceId;if(!j)throw N({statusCode:404,statusMessage:"Instance not found for the given state ID"});const c=w.instances.get(j);if(!c)throw N({statusCode:404,statusMessage:"Instance not found"});const n=b.library.components[c.type],I=n?.meta,r=[{key:"instanceId",label:"Instance ID"},{key:"stateId",label:"State ID"},{key:"type",label:"Component Type"},{key:"kind",label:"Kind"}],U=b.library.components,E=b.library.entities,u=f.terminalsForState(s.params.stateId),p=f.secretsForState(s.params.stateId),m=f.pagesForState(s.params.stateId),g=f.triggersForState(s.params.stateId),v=f.artifactsForState(s.params.stateId);return u.load(),p.load(),m.load(),g.load(),v.load(),(C,t)=>(R(),D(e(K),null,{default:i(()=>[o(W,{meta:e(I),"fallback-icon":"mdi-cube-outline",title:e(n).meta.title,description:e(c).name},{actions:i(()=>[o(ee,{variant:"outlined","prepend-icon":"mdi-vector-square",onClick:t[0]||(t[0]=()=>{("navigateTo"in C?C.navigateTo:e(q))({name:"project",params:{projectId:s.params.projectId}})})},{default:i(()=>[...t[21]||(t[21]=[M(" View in Canvas ",-1)])]),_:1})]),_:1},8,["meta","title","description"]),V("div",pe,[o(e(X),{title:"Instance Details",items:r,style:{flex:"1"}},{"item.instanceId":i(()=>[o(e(x),{truncate:!1,value:e(c).id},null,8,["value"])]),"item.stateId":i(()=>[o(e(x),{truncate:!1,value:s.params.stateId},null,8,["value"])]),"item.type":i(()=>[o(e(x),{truncate:!1,value:e(c).type},null,8,["value"])]),"item.kind":i(()=>[V("div",me,te(e(c).kind),1)]),_:1}),o(oe,{style:{flex:"1",border:"solid 2px #2d2d2d"},elevation:0},{default:i(()=>[o(ae,{class:"d-flex align-center"},{default:i(()=>[...t[22]||(t[22]=[M("Preview",-1)])]),_:1}),o(se,{class:"pa-0",style:{height:"350px"}},{default:i(()=>[o(e(ue),{instances:[e(c)],hubs:[],components:e(U),entities:e(E),"auto-position":!1},null,8,["instances","components","entities"])]),_:1})]),_:1})]),o(ie,{elevation:0},{default:i(()=>[o(e(Z),{title:"Instance Model",data:e(c)},null,8,["data"]),o(e(h),{title:"Terminals",icon:"mdi-console",count:e(u).data.value.total},{default:i(()=>[o(e(J),{search:e(u).search.value,"onUpdate:search":t[1]||(t[1]=a=>e(u).search.value=a),"sort-by":e(u).sortBy.value,"onUpdate:sortBy":t[2]||(t[2]=a=>e(u).sortBy.value=a),page:e(u).page.value,"onUpdate:page":t[3]||(t[3]=a=>e(u).page.value=a),"items-per-page":e(u).itemsPerPage.value,"onUpdate:itemsPerPage":t[4]||(t[4]=a=>e(u).itemsPerPage.value=a),"project-id":s.params.projectId,data:e(u).data.value,loading:e(u).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),o(e(h),{title:"Secrets",icon:"mdi-key-variant",count:e(p).data.value.total},{default:i(()=>[o(e(Q),{search:e(p).search.value,"onUpdate:search":t[5]||(t[5]=a=>e(p).search.value=a),"sort-by":e(p).sortBy.value,"onUpdate:sortBy":t[6]||(t[6]=a=>e(p).sortBy.value=a),page:e(p).page.value,"onUpdate:page":t[7]||(t[7]=a=>e(p).page.value=a),"items-per-page":e(p).itemsPerPage.value,"onUpdate:itemsPerPage":t[8]||(t[8]=a=>e(p).itemsPerPage.value=a),"project-id":s.params.projectId,data:e(p).data.value,loading:e(p).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),o(e(h),{title:"Pages",icon:"mdi-file-document-outline",count:e(m).data.value.total},{default:i(()=>[o(e(Y),{search:e(m).search.value,"onUpdate:search":t[9]||(t[9]=a=>e(m).search.value=a),"sort-by":e(m).sortBy.value,"onUpdate:sortBy":t[10]||(t[10]=a=>e(m).sortBy.value=a),page:e(m).page.value,"onUpdate:page":t[11]||(t[11]=a=>e(m).page.value=a),"items-per-page":e(m).itemsPerPage.value,"onUpdate:itemsPerPage":t[12]||(t[12]=a=>e(m).itemsPerPage.value=a),"project-id":s.params.projectId,data:e(m).data.value,loading:e(m).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),o(e(h),{title:"Triggers",icon:"mdi-lightning-bolt",count:e(g).data.value.total},{default:i(()=>[o(e(_),{search:e(g).search.value,"onUpdate:search":t[13]||(t[13]=a=>e(g).search.value=a),"sort-by":e(g).sortBy.value,"onUpdate:sortBy":t[14]||(t[14]=a=>e(g).sortBy.value=a),page:e(g).page.value,"onUpdate:page":t[15]||(t[15]=a=>e(g).page.value=a),"items-per-page":e(g).itemsPerPage.value,"onUpdate:itemsPerPage":t[16]||(t[16]=a=>e(g).itemsPerPage.value=a),"project-id":s.params.projectId,data:e(g).data.value,loading:e(g).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),o(e(h),{title:"Artifacts",icon:"mdi-package-variant",count:e(v).data.value.total},{default:i(()=>[o(e(ne),{search:e(v).search.value,"onUpdate:search":t[17]||(t[17]=a=>e(v).search.value=a),"sort-by":e(v).sortBy.value,"onUpdate:sortBy":t[18]||(t[18]=a=>e(v).sortBy.value=a),page:e(v).page.value,"onUpdate:page":t[19]||(t[19]=a=>e(v).page.value=a),"items-per-page":e(v).itemsPerPage.value,"onUpdate:itemsPerPage":t[20]||(t[20]=a=>e(v).itemsPerPage.value=a),"project-id":s.params.projectId,data:e(v).data.value,loading:e(v).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"])]),_:1})]),_:1}))}});export{ze as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a_ as V,a$ as A,b0 as B,aD as C,b1 as K,s as x,l as L,z as G,B as O,aw as z,q as U,aT as q,v as W,k as X}from"#entry";import{_ as Z,a as J,b as Q}from"./
|
|
1
|
+
import{a_ as V,a$ as A,b0 as B,aD as C,b1 as K,s as x,l as L,z as G,B as O,aw as z,q as U,aT as q,v as W,k as X}from"#entry";import{_ as Z,a as J,b as Q}from"./C4zpeTvm.js";import{a as Y,g as ee,i as te}from"./oZs8U75K.js";import{_ as ne,G as oe}from"./dwrHE3tM.js";import{E as F,Z as D,W as P,aE as ae,a1 as g,$ as re,X as v,u as ie,aL as _,I as se,F as p,ak as M,al as $}from"./Dm4QKadl.js";import{P as de}from"./CN9dMhDM.js";import"./CmALWFRB.js";import"./D1Jbgd7O.js";import"./BqeRdtD4.js";import"./Cw6nGM9K.js";import"./YXI84j39.js";import"./ga9TZ2z5.js";import"./DXtl0MQI.js";import"./DhQfdAdO.js";import"./DHuTDtaT.js";import"./CwUT5n6w.js";import"./D-AHKB2i.js";const ue=F({__name:"ExtraElementPanel",setup(I){const d=u=>{Y(u.dataTransfer)};return(u,n)=>(P(),D(ae,null,{default:g(()=>[re("div",{draggable:"true",style:{cursor:"grab"},onDragstart:d},[v(ne)],32)]),_:1}))}}),k=V({name:"project-panel",getStoreId:I=>`projects/${I}/panel`,create:({storeId:I,id:[d],logger:u})=>A(I,()=>{const{instancesStore:n}=B(d),{vueFlowStore:r,nodeFactory:a,onHubMoved:y,onInstanceMoved:h,onHubNodeDeleted:j,onInstanceNodeDeleted:l,onNodesMoved:f,edgeEndpointOffsets:c}=C("project",d),{$client:w}=ie(),H=K(async e=>{await w.workspace.setProjectViewport.mutate({projectId:d,viewport:e})},1e3);r.onViewportChange(H);const N=async()=>{L.info({projectId:d},"initializing project panel store");const e=await w.workspace.getProjectViewport.query({projectId:d});e&&(r.defaultViewport.value=e)},R=async()=>{a.createNodesForModels(n.getProjectInstances(),[...n.hubs.values()]),G(r).then(()=>O(r,f,c))};h(e=>{n.patchInstance(e,["position"])}),y(e=>{n.patchHub(e,["position"])}),j(e=>{n.deleteHub(e.data.hub,!e.data.blueprint)}),l(e=>{n.deleteInstance(e.data.instance,!e.data.blueprint)});const S=e=>{const{inputInstance:t,outputInstance:o,inputHub:i,outputHub:s,outputKey:b,inputKey:m}=z(r,e);if(t&&o)return n.addInstanceInput(t,m,{instanceId:o.id,output:b});if(s&&t&&m)return n.addInstanceHubInput(t,m,{hubId:s.id});if(s&&t)return n.addInstanceInjectionInput(t,{hubId:s.id});if(o&&i)return n.addHubInput(i,{instanceId:o.id,output:b});if(s&&i)return n.addHubInjectionInput(i,{hubId:s.id});throw u.error({msg:"unexpected connection while adding",connection:e,inputInstance:t,outputInstance:o,inputHub:i,outputHub:s,outputKey:b,inputKey:m}),new Error("Invalid connection")},T=e=>{const{inputInstance:t,outputInstance:o,inputHub:i,outputHub:s,outputKey:b,inputKey:m}=z(r,e);if(t&&o)return n.removeInstanceInput(t,m,{instanceId:o.id,output:b});if(s&&t&&m)return n.removeInstanceHubInput(t,m,{hubId:s.id});if(s&&t)return n.removeInstanceInjectionInput(t,{hubId:s.id});if(o&&i)return n.removeHubInput(i,{instanceId:o.id,output:b});if(s&&i)return n.removeHubInjectionInput(i,{hubId:s.id});throw u.error({msg:"unexpected connection while removing",edge:e,inputInstance:t,outputInstance:o,inputHub:i,outputHub:s,outputKey:b,inputKey:m}),new Error("Invalid connection")};r.onConnect(S);let E=!1;return r.onEdgeUpdate(async({edge:e,connection:t})=>{E=!0,await T(e),await S(t)}),r.onEdgeUpdateEnd(async({edge:e})=>{try{if(E)return;await T(e)}finally{E=!1}}),n.onInstanceInputAdded(({instance:e,inputName:t,input:o})=>{a.createEdgeForInstanceInput(e,t,o)}),n.onInstanceHubInputAdded(({instance:e,inputName:t,input:o})=>{a.createEdgeForInstanceHubInput(e,t,o)}),n.onInstanceInjectionInputAdded(({instance:e,input:t})=>{a.createEdgeForInstanceInjectionInput(e,t)}),n.onHubInputAdded(({hub:e,input:t})=>{a.createEdgeForHubInput(e,t)}),n.onHubInjectionInputAdded(({hub:e,input:t})=>{a.createEdgeForHubInjectionInput(e,t)}),n.onInstanceInputRemoved(({instance:e,inputName:t,input:o})=>{a.removeEdgeForInstanceInput(e,t,o)}),n.onInstanceHubInputRemoved(({instance:e,inputName:t,input:o})=>{a.removeEdgeForInstanceHubInput(e,t,o)}),n.onInstanceInjectionInputRemoved(({instance:e,input:t})=>{a.removeEdgeForInstanceInjectionInput(e,t)}),n.onHubInputRemoved(({hub:e,input:t})=>{a.removeEdgeForHubInput(e,t)}),n.onHubInjectionInputRemoved(({hub:e,input:t})=>{a.removeEdgeForHubInjectionInput(e,t)}),n.onInstanceNameChanged(({oldId:e,newId:t})=>{const o=a.instanceIdToNodeIdMap.get(e);a.instanceIdToNodeIdMap.set(t,o),a.instanceIdToNodeIdMap.delete(e),r.updateNodeData(o,{})}),n.onInstanceCreated(async({instance:e,blueprint:t})=>{const o=a.createNodeFromInstance(e,{blueprint:t});if(await x(r.areNodesInitialized).toBe(!0),!t){if(n.isGhostInstance(e.id))return;r.updateNode(o.id,i=>{const s={x:i.position.x-i.dimensions.width/2,y:i.position.y-i.dimensions.height/2};return e.position=s,{position:s}})}}),n.onInstanceDeleted(e=>{const t=a.instanceIdToNodeIdMap.get(e);t&&(r.removeNodes(t),a.instanceIdToNodeIdMap.delete(e))}),n.onHubDeleted(e=>{r.removeNodes(e)}),n.onHubCreated(async({hub:e,blueprint:t})=>{a.createNodeFromHub(e,{blueprint:t}),await x(r.areNodesInitialized).toBe(!0),t||r.updateNode(e.id,o=>{const i={x:o.position.x-o.dimensions.width/2,y:o.position.y-o.dimensions.height/2};return e.position=i,{position:i}})}),{initialize:N,placeNodes:R}})}),ce=F({__name:"ProjectCanvas",async setup(I){let d,u;const n=C(),r=k(),{projectStore:a,instancesStore:y,libraryStore:h}=U();a.initializing?([d,u]=_(()=>x(()=>a.initialized).toBe(!0)),await d,u(),a.addLibraryRoot()):([d,u]=_(()=>a.initialize1()),await d,u(),[d,u]=_(()=>a.initialize2()),await d,u()),[d,u]=_(()=>r.initialize()),await d,u(),se(r.placeNodes);const j=l=>{if(l.preventDefault(),!l.dataTransfer||n.blueprint)return;let f;const c=ee(l.dataTransfer);if(c){const w=y.getNextInstanceName(c),H=q(c,w),N=h.library.components[c];f={boundary:{width:360,height:260},instances:[{id:H,name:w,type:c,kind:N.kind,position:{x:0,y:0}}],hubs:[]}}else if(te(l.dataTransfer))f={boundary:{width:74,height:74},instances:[],hubs:[{id:W.createId(),position:{x:0,y:0}}]};else return;n.blueprint=f};return(l,f)=>(P(),D(p(oe),{canvasId:["project",p(a).projectId],components:p(h).library.components,entities:p(h).library.entities,"input-resolver-outputs":p(y).inputResolverOutputs,editable:"",onDragover:j},{"node-instance":g(c=>[v(p(Q),M($(c)),null,16)]),"node-hub":g(c=>[v(p(J),M($(c)),null,16)]),"panel-bottom-left":g(()=>[v(p(Z))]),"panel-bottom-right":g(()=>[v(p(ue))]),_:1},8,["canvasId","components","entities","input-resolver-outputs"]))}}),Ce=F({__name:"index",props:{params:{}},setup(I){return X(I.params.projectId),C.ensureCreated("project",I.params.projectId),k.ensureCreated(I.params.projectId),(d,u)=>(P(),D(p(de),{"project-id":I.params.projectId,"can-unlock":""},{default:g(()=>[v(p(ce))]),_:1},8,["project-id"]))}});export{Ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as o,e as s}from"#entry";import{K as a,W as i,$ as t,a3 as r}from"./Dm4QKadl.js";import"./CmALWFRB.js";import"./D1Jbgd7O.js";const u={class:"antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"},
|
|
1
|
+
import{_ as o,e as s}from"#entry";import{K as a,W as i,$ as t,a3 as r}from"./Dm4QKadl.js";import"./CmALWFRB.js";import"./D1Jbgd7O.js";const u={class:"antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"},l={class:"max-w-520px text-center"},c=["textContent"],d=["textContent"],p=["textContent"],f={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Internal server error"},description:{type:String,default:"This page is temporarily unavailable."},refresh:{type:String,default:"Refresh this page"}},setup(e){const n=e;return s({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(m,g)=>(i(),a("div",u,[t("div",l,[t("h1",{class:"font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]",textContent:r(e.statusCode)},null,8,c),t("h2",{class:"font-semibold mb-2 sm:text-3xl text-2xl",textContent:r(e.statusMessage)},null,8,d),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:r(e.description)},null,8,p)])]))}},k=o(f,[["__scopeId","data-v-10c09a29"]]);export{k as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as k,a_ as L,a$ as H,aD as M,b0 as A,b1 as W,z as q,A as G,B as K,s as X,_ as Y,k as Z}from"#entry";import{c as J,_ as Q,a as U,b as tt}from"./C4zpeTvm.js";import{E as b,g as p,aW as et,Z as I,W as l,F as t,a1 as f,X as g,u as nt,aL as h,I as at,ak as V,al as $,_ as B,a8 as O,K as F,$ as N,a3 as st,aY as ot}from"./Dm4QKadl.js";import{I as it,a as rt,G as ct}from"./dwrHE3tM.js";import{I as ut}from"./BqeRdtD4.js";import{_ as dt}from"./DhQfdAdO.js";import{P as pt}from"./CN9dMhDM.js";import"./CmALWFRB.js";import"./D1Jbgd7O.js";import"./ga9TZ2z5.js";import"./DXtl0MQI.js";import"./DHuTDtaT.js";import"./CwUT5n6w.js";import"./Cw6nGM9K.js";import"./YXI84j39.js";import"./D-AHKB2i.js";const lt=b({__name:"CompositeInstanceInputNode",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{},instance:{}},setup(e){const a=k(),{instancesStore:n,libraryStore:o,stateStore:u,validationStore:i,operationsStore:s}=a,y=p(()=>u.instanceLocks.get(e.instance.id)),v=p(()=>o.library.components[e.instance.type]),c=p(()=>u.getInstanceState(e.instance.id)),S=et("contextMenu");return(j,d)=>(l(),I(t(it),{instance:e.instance,component:t(v),entities:t(o).library.entities,state:t(c),editable:t(n).instances.has(e.instance.id),"input-resolver-outputs":t(n).inputResolverOutputs,"input-resolver-dependent-map":t(n).inputResolverDependentMap,"io-type":"inputs","io-mirror":!0,"hide-show-composite":!0,"onSave:args":d[0]||(d[0]=(m,C,w)=>t(n).updateInstance(m,C,w)),"onOperation:launch":d[1]||(d[1]=m=>t(s).launchInstanceOperation(m,e.data.instance)),"onOperation:cancel":d[2]||(d[2]=m=>t(s).cancelInstanceOperation(t(c).lastOperationState.operationId,e.data.instance.id)),onContextmenu:d[3]||(d[3]=m=>t(S)?.showContextMenu(m))},{status:f(()=>[g(t(ut),{state:t(c),"expected-input-hash":t(u).inputHashOutputs.get(e.instance.id)?.inputHash,"validation-output":t(i).validationOutputs.get(e.instance.id)},null,8,["state","expected-input-hash","validation-output"])]),default:f(()=>[g(t(J),{ref_key:"contextMenu",ref:S,stores:t(a),instance:e.instance,component:t(v),state:t(c),editable:!1,locked:!!t(y)},null,8,["stores","instance","component","state","locked"])]),_:1},8,["instance","component","entities","state","editable","input-resolver-outputs","input-resolver-dependent-map"]))}}),mt=b({__name:"CompositeInstanceOutputNode",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{},instance:{}},setup(e){const{libraryStore:a}=k(),n=p(()=>a.library.components[e.instance.type]);return(o,u)=>(l(),I(t(dt),{component:t(n),subtitle:"Outputs",style:{overflow:"visible"}},{default:f(()=>[g(t(rt),{instance:e.instance,component:t(n),entities:t(a).library.entities,type:"outputs",mirror:!0},null,8,["instance","component","entities"])]),_:1},8,["component"]))}}),_=L({name:"instance",getStoreId:(e,a,n)=>`projects/${e}/composites/${a}/${n}`,create:({storeId:e,id:[a,n,o],logger:u})=>H(e,()=>{const{vueFlowStore:i,nodeFactory:s,onNodesMoved:y,edgeEndpointOffsets:v}=M("instance",a,n,o),{$client:c}=nt(),{instancesStore:S,stateStore:j}=A(a),d=p(()=>j.stateIdToStateMap.get(n)),m=p(()=>{const r=d.value;return r?S.instances.get(r.instanceId):void 0}),C=async()=>{u.info({projectId:a},"initializing composite instance store");const r=await c.workspace.getCompositeViewport.query({projectId:a,stateId:n});r&&(i.defaultViewport.value=r),u.info({projectId:a,stateId:n},"composite instance store initialized")},w=()=>{const r=m.value;if(!r)throw new Error(`Virtual instance not found for state: ${n}`);const E=s.createNodeFromInstance(r,{type:"inputs"}),T=S.getInstanceChildren(r.id);if(s.createNodesForModels(T,[],{readonly:!0}),r.outputs&&Object.keys(r.outputs).length>0){s.createNodeFromInstance(r,{id:"outputs",type:"outputs",readonly:!0}),s.instanceIdToNodeIdMap.set(r.id,E.id);for(const[x,D]of Object.entries(r.outputs))for(const P of D){const z=S.instances.get(P.instanceId);z&&s.createEdgeForInstanceOutput(z,x,P)}}q(i).then(()=>G(i)).then(()=>i.fitView()).then(()=>i.updateNodeInternals(i.getNodes.value.map(x=>x.id))).then(()=>K(i,y,v))},R=W(async r=>{await c.workspace.setCompositeViewport.mutate({projectId:a,stateId:n,viewport:r})},1e3);return i.onViewportChange(R),{initialize:C,placeNodes:w,stateId:n,instanceState:d,instance:m,version:o}})}),ft=b({__name:"CompositeInstanceCanvas",async setup(e){let a,n;const{projectStore:o,instancesStore:u,libraryStore:i}=k(),s=_();return o.initializing?([a,n]=h(()=>X(()=>o.initialized).toBe(!0)),await a,n(),o.addLibraryRoot()):([a,n]=h(()=>o.initialize1()),await a,n(),[a,n]=h(()=>o.initialize2()),await a,n()),[a,n]=h(()=>s.initialize()),await a,n(),at(s.placeNodes),(y,v)=>(l(),I(t(ct),{canvasId:["instance",t(o).projectId,t(s).stateId,t(s).version],components:t(i).library.components,entities:t(i).library.entities,"input-resolver-outputs":t(u).inputResolverOutputs,editable:""},{"node-instance":f(c=>[g(t(tt),V($(c)),null,16)]),"node-inputs":f(c=>[t(s).instance?(l(),I(lt,O({key:0},c,{instance:t(s).instance}),null,16,["instance"])):B("",!0)]),"node-outputs":f(c=>[t(s).instance?(l(),I(mt,O({key:0},c,{instance:t(s).instance,type:"outputs"}),null,16,["instance"])):B("",!0)]),"node-hub":f(c=>[g(t(U),V($(c)),null,16)]),"panel-bottom-left":f(()=>[g(t(Q))]),_:1},8,["canvasId","components","entities","input-resolver-outputs"]))}}),yt=Y(ft,[["__scopeId","data-v-2e3534bb"]]),vt=b({__name:"CompositeInstanceWrapper",props:{projectId:{},stateId:{},version:{}},setup(e){return M.ensureCreated("instance",e.projectId,e.stateId,e.version),_.ensureCreated(e.projectId,e.stateId,e.version),(a,n)=>(l(),I(yt,{"project-id":e.projectId,"state-id":e.stateId,version:e.version},null,8,["project-id","state-id","version"]))}}),It={key:1,class:"d-flex justify-center align-center h-100"},gt={class:"text-center"},St={key:2,class:"d-flex justify-center align-center h-100"},_t=b({__name:"index",props:{params:{}},setup(e){const{instancesStore:a,stateStore:n}=Z(e.params.projectId),o=p(()=>n.stateIdToStateMap.get(e.params.stateId)),u=p(()=>{const y=o.value;return y?a.instances.get(y.instanceId):void 0}),i=p(()=>a.initializationPhase==="ready"&&n.initializationPhase==="ready"),s=p(()=>!!(o.value&&u.value));return(y,v)=>(l(),I(t(pt),{"project-id":e.params.projectId,"can-unlock":""},{default:f(()=>[t(i)&&t(s)?(l(),I(t(vt),{key:t(a).evaluationVersion,"project-id":e.params.projectId,"state-id":e.params.stateId,version:t(a).evaluationVersion},null,8,["project-id","state-id","version"])):t(i)?(l(),F("div",It,[N("div",gt,[v[0]||(v[0]=N("h3",null,"Instance state not found",-1)),N("p",null,"No instance state found for state ID: "+st(e.params.stateId),1)])])):(l(),F("div",St,[g(ot,{indeterminate:"",color:"dark",size:"32"})]))]),_:1},8,["project-id"]))}});export{_t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"033f259e-8ba9-4c82-8824-56febea80b7d","timestamp":1770242095484}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"033f259e-8ba9-4c82-8824-56febea80b7d","timestamp":1770242095484,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
|
@@ -11,4 +11,4 @@ import{av as Dt,aw as Vi,ax as Cn,ay as Ai,az as In,aA as Qt,l as Mi,_ as te,aB
|
|
|
11
11
|
h${-(B.value.width-2*e.maskBorderRadius)}
|
|
12
12
|
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},-${e.maskBorderRadius}
|
|
13
13
|
v${-(B.value.height-2*e.maskBorderRadius)}
|
|
14
|
-
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);Tn(w=>{if(A.value){const V=be(A.value),k=G=>{if(G.sourceEvent.type!=="wheel"||!f.value||!m.value)return;const W=G.sourceEvent.ctrlKey&&Oi()?10:1,J=-G.sourceEvent.deltaY*(G.sourceEvent.deltaMode===1?.05:G.sourceEvent.deltaMode?1:.002)*e.zoomStep,ne=u.value.zoom*2**(J*W);m.value.scaleTo(f.value,ne)},T=G=>{if(G.sourceEvent.type!=="mousemove"||!f.value||!m.value)return;const W=K.value*Math.max(1,u.value.zoom)*(e.inversePan?-1:1),J={x:u.value.x-G.sourceEvent.movementX*W,y:u.value.y-G.sourceEvent.movementY*W},ne=[[0,0],[l.value.width,l.value.height]],ie=Zt.translate(J.x,J.y).scale(u.value.zoom),se=m.value.constrain()(ie,ne,d.value);m.value.transform(f.value,se)},X=il().wheelDelta(G=>Ri(G)*(e.zoomStep/10)).on("zoom",e.pannable?T:()=>{}).on("zoom.wheel",e.zoomable?k:()=>{});V.call(X),w(()=>{V.on("zoom",null)})}},{flush:"post"});function Ve(w){const[V,k]=pe(w);t("click",{event:w,position:{x:V,y:k}})}function Ae(w,V){const k={event:w,node:V,connectedEdges:ze([V],s.value)};c.miniMapNodeClick(k),t("nodeClick",k)}function h(w,V){const k={event:w,node:V,connectedEdges:ze([V],s.value)};c.miniMapNodeDoubleClick(k),t("nodeDblclick",k)}function p(w,V){const k={event:w,node:V,connectedEdges:ze([V],s.value)};c.miniMapNodeMouseEnter(k),t("nodeMouseenter",k)}function v(w,V){const k={event:w,node:V,connectedEdges:ze([V],s.value)};c.miniMapNodeMouseMove(k),t("nodeMousemove",k)}function S(w,V){const k={event:w,node:V,connectedEdges:ze([V],s.value)};c.miniMapNodeMouseLeave(k),t("nodeMouseleave",k)}return(w,V)=>(y(),C(g(at),{position:w.position,class:ke(["vue-flow__minimap",{pannable:w.pannable,zoomable:w.zoomable}])},{default:b(()=>[(y(),E("svg",{ref_key:"el",ref:A,width:z.value,height:I.value,viewBox:[L.value.x,L.value.y,L.value.width,L.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${g(r)}`,onClick:Ve},[w.ariaLabel?(y(),E("title",{key:0,id:`vue-flow__minimap-${g(r)}`},ee(w.ariaLabel),9,ll)):O("",!0),(y(!0),E(P,null,oe(g(x),k=>(y(),C(rl,{id:k.id,key:k.id,f:"",position:k.computedPosition,dimensions:k.dimensions,selected:k.selected,dragging:k.dragging,style:ve(k.style),class:ke(R.value(k)),color:H.value(k),"border-radius":w.nodeBorderRadius,"stroke-color":N.value(k),"stroke-width":w.nodeStrokeWidth,"shape-rendering":g(D),type:k.type,hidden:k.hidden,onClick:T=>Ae(T,k),onDblclick:T=>h(T,k),onMouseenter:T=>p(T,k),onMousemove:T=>v(T,k),onMouseleave:T=>S(T,k)},null,8,["id","position","dimensions","selected","dragging","style","class","color","border-radius","stroke-color","stroke-width","shape-rendering","type","hidden","onClick","onDblclick","onMouseenter","onMousemove","onMouseleave"]))),128)),j("path",{class:"vue-flow__minimap-mask",d:ye.value,fill:w.maskColor,stroke:w.maskStrokeColor,"stroke-width":w.maskStrokeWidth,"fill-rule":"evenodd"},null,8,ul)],8,sl))]),_:1},8,["position","class"]))}}),fl={class:"vue-flow-container"},hl={key:0},ml={key:0},gl={key:1},vl=q({__name:"GenericCanvas",props:{canvasId:{},inputResolverOutputs:{},components:{},entities:{},interactive:{type:Boolean,default:!0},editable:{type:Boolean,default:!1},minimap:{type:Boolean,default:!0}},emits:["dragover","init"],setup(e,{emit:t}){const n=t,i=Lt.ensureCreated(...e.canvasId);return Tn(()=>{i.edgeEndpointOffsets.setInputResolverOutputs(e.inputResolverOutputs)}),n("init",i),(o,a)=>{const r=zi;return y(),C(r,null,{default:b(()=>[j("div",fl,[$(g(Ti),{"min-zoom":.1,"max-zoom":1,"snap-to-grid":!0,onDragover:a[1]||(a[1]=s=>n("dragover",s))},{"node-instance":b(s=>[Q(o.$slots,"node-instance",Me(Fe(s)),void 0,!0)]),"node-inputs":b(s=>[Q(o.$slots,"node-inputs",Me(Fe(s)),void 0,!0)]),"node-outputs":b(s=>[Q(o.$slots,"node-outputs",Me(Fe(s)),void 0,!0)]),"node-hub":b(s=>[Q(o.$slots,"node-hub",Me(Fe(s)),void 0,!0)]),"edge-custom":b(s=>[$(g(go),Ue(s,{"input-resolver-outputs":e.inputResolverOutputs,components:e.components,entities:e.entities}),null,16,["input-resolver-outputs","components","entities"])]),default:b(()=>[$(g(Mo),{"pattern-color":"#aaa",gap:32}),e.minimap?(y(),C(g(dl),{key:0,position:"top-right"})):O("",!0),$(g(at),{position:"top-left"},{default:b(()=>[e.interactive?(y(),E("div",hl,[a[6]||(a[6]=U(" Hold Control to add nodes to selection and Alt to remove them ",-1)),a[7]||(a[7]=j("br",null,null,-1)),e.editable?(y(),E("div",ml,"Press Ctrl+V to paste blueprint from clipboard")):O("",!0),g(i).selection.selectedNodeIds.size>0?(y(),E("div",gl,[U(" Selected "+ee(g(i).selection.selectedNodeIds.size)+" nodes ",1),a[2]||(a[2]=j("br",null,null,-1)),a[3]||(a[3]=U(" Press Escape to clear selection ",-1)),a[4]||(a[4]=j("br",null,null,-1)),a[5]||(a[5]=U(" Press Ctrl+C to copy selected nodes to clipboard ",-1))])):O("",!0)])):O("",!0)]),_:1}),$(g(at),{position:"bottom-right"},{default:b(()=>[Q(o.$slots,"panel-bottom-right",{},void 0,!0)]),_:3}),$(g(at),{position:"bottom-left"},{default:b(()=>[Q(o.$slots,"panel-bottom-left",{},void 0,!0)]),_:3}),$(g(xo),{"selection-mode":g(i).selection.selectionMode,"selection-area":g(i).selection.selectionArea},null,8,["selection-mode","selection-area"]),$(Ki,{modelValue:g(i).blueprintCopied,"onUpdate:modelValue":a[0]||(a[0]=s=>g(i).blueprintCopied=s),location:"top center",color:"info"},{default:b(()=>[...a[8]||(a[8]=[U(" Blueprint copied to clipboard ",-1)])]),_:1},8,["modelValue"])]),_:3})])]),_:3})}}}),ru=te(vl,[["__scopeId","data-v-fd0cbe42"]]),yl=["innerHTML"],Ke=q({__name:"ArgumentDescription",props:{description:{}},setup(e){return(t,n)=>(y(),E("div",{class:"markdown-body pl-4 text-disabled",innerHTML:("renderMarkdown"in t?t.renderMarkdown:g(Bi))(e.description)},null,8,yl))}}),pl={class:"editor"},wl=q({__name:"CodeArgumentInput",props:{modelValue:{},argument:{},instance:{}},emits:["update:model-value"],setup(e,{emit:t}){const n=Ee("");typeof e.modelValue=="string"?n.value=e.modelValue:n.value=Nn.safeParse(e.modelValue)?.data?.value??"";const i=t,o=a=>{e.argument.kind==="code"?i("update:model-value",a):i("update:model-value",{[Hi.Yaml]:!0,value:a}),n.value=a};return(a,r)=>(y(),C(Bn,{title:e.argument.title,color:"#2d2d2d","bg-color":"#1e1e1e"},{title:b(()=>[j("div",null,ee(e.argument.title),1)]),text:b(()=>[e.argument.description?(y(),C(Ke,{key:0,description:e.argument.description,class:"mb-4"},null,8,["description"])):O("",!0),j("div",pl,[e.argument.kind==="code"?(y(),C(g(nn),{key:0,value:g(n),"onUpdate:value":o,theme:"dark-plus",class:"editor",language:e.argument.language??"text",options:{tabSize:2}},null,8,["value","language"])):(y(),C(g(nn),{key:1,value:g(n),"onUpdate:value":o,theme:"vs-dark",language:"yaml",path:`${e.instance.type}.${e.argument.name}`,options:{tabSize:2}},null,8,["value","path"]))])]),_:1},8,["title"]))}}),bi=te(wl,[["__scopeId","data-v-d566ed14"]]),wt=q({__name:"PlainArgumentInput",props:xe({argument:{},instance:{},isSecret:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Je(e,"modelValue");t.value===void 0&&e.argument.default!==void 0&&(t.value=e.argument.default);const n=Ee(!1),i=M(()=>e.isSecret?n.value?"text":"password":"text"),o=M(()=>e.argument.default!=null?String(e.argument.default):"");return(a,r)=>(y(),E("div",null,[e.argument.kind==="input"&&e.argument.type==="string"?(y(),C(Hn,{key:0,modelValue:t.value,"onUpdate:modelValue":r[1]||(r[1]=s=>t.value=s),label:e.argument.title,placeholder:g(o),type:g(i),variant:"outlined",density:"compact","hide-details":""},{"append-inner":b(()=>[e.isSecret?(y(),C(Z,{key:0,onClick:r[0]||(r[0]=s=>n.value=!g(n))},{default:b(()=>[U(ee(g(n)?"mdi-eye-off":"mdi-eye"),1)]),_:1})):O("",!0)]),_:1},8,["modelValue","label","placeholder","type"])):e.argument.kind==="input"&&(e.argument.type==="number"||e.argument.type==="integer")?(y(),C(Ji,{key:1,modelValue:t.value,"onUpdate:modelValue":r[3]||(r[3]=s=>t.value=s),label:e.argument.title,placeholder:g(o),variant:"outlined",density:"compact","hide-details":""},{"append-inner":b(()=>[e.isSecret?(y(),C(Z,{key:0,onClick:r[2]||(r[2]=s=>n.value=!g(n))},{default:b(()=>[U(ee(g(n)?"mdi-eye-off":"mdi-eye"),1)]),_:1})):O("",!0)]),_:1},8,["modelValue","label","placeholder"])):e.argument.kind==="combobox"?(y(),C(Zi,{key:2,modelValue:t.value,"onUpdate:modelValue":r[4]||(r[4]=s=>t.value=s),label:e.argument.title,placeholder:g(o),variant:"outlined",density:"compact",multiple:"",chips:"","hide-details":""},null,8,["modelValue","label","placeholder"])):e.argument.kind==="select"?(y(),C(Fn,{key:3,modelValue:t.value,"onUpdate:modelValue":r[5]||(r[5]=s=>t.value=s),label:e.argument.title,placeholder:g(o),items:e.argument.enum,variant:"outlined",density:"compact",multiple:e.argument.multiple,"hide-details":""},null,8,["modelValue","label","placeholder","items","multiple"])):(y(),C(Qi,{key:4,modelValue:t.value,"onUpdate:modelValue":r[6]||(r[6]=s=>t.value=s),label:e.argument.title,density:"compact","hide-details":""},null,8,["modelValue","label"])),e.argument.description?(y(),C(Ke,{key:5,class:"mt-2",description:e.argument.description},null,8,["description"])):O("",!0)]))}}),bl={class:"d-flex flex-column ga-4"},ki=q({__name:"GroupArgumentInput",props:xe({argument:{},instance:{},isSecret:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Je(e,"modelValue");t.value===void 0&&(t.value=e.argument.default??{});const n=(o,a)=>{t.value={...t.value,[o]:a}},i=M(()=>e.argument.discriminator?t.value[e.argument.discriminator.name]??"":"");for(const o of e.argument.fields[i.value]??[])t.value[o.name]===void 0&&o.default!==void 0&&(t.value[o.name]=o.default);return Pn(i,o=>{if(!e.argument.discriminator)return;const a=e.argument.fields[o]??[],r={[e.argument.discriminator.name]:o};for(const s of a)r[s.name]=s.default;t.value=r}),(o,a)=>(y(),C(Bn,{color:"#2d2d2d","bg-color":"#2d2d2d"},{title:b(()=>[j("div",null,ee(e.argument.title),1)]),text:b(()=>[e.argument.description?(y(),C(Ke,{key:0,description:e.argument.description,class:"mb-4"},null,8,["description"])):O("",!0),j("div",bl,[e.argument.discriminator?(y(),E(P,{key:1},[j("div",null,[$(Fn,{"model-value":t.value[e.argument.discriminator.name],items:Object.keys(e.argument.fields),label:e.argument.discriminator.title,variant:"outlined",density:"compact","hide-details":"","onUpdate:modelValue":a[0]||(a[0]=r=>n(e.argument.discriminator.name,r))},null,8,["model-value","items","label"]),e.argument.discriminator.description?(y(),C(Ke,{key:0,class:"mt-2",description:e.argument.discriminator.description},null,8,["description"])):O("",!0)]),(y(!0),E(P,null,oe(e.argument.fields[g(i)]??[],r=>(y(),C(wt,{"model-value":t.value[r.name],key:r.name,argument:r,instance:e.instance,"is-secret":e.isSecret,"onUpdate:modelValue":s=>n(r.name,s)},null,8,["model-value","argument","instance","is-secret","onUpdate:modelValue"]))),128))],64)):(y(!0),E(P,{key:0},oe(e.argument.fields[""],r=>(y(),C(wt,{"model-value":t.value[r.name],key:r.name,argument:r,instance:e.instance,"is-secret":e.isSecret,"onUpdate:modelValue":s=>n(r.name,s)},null,8,["model-value","argument","instance","is-secret","onUpdate:modelValue"]))),128))])]),_:1}))}});function xi(e,t){const n={...e};for(const i in t){const o=t[i];o.schema.default&&n[i]===void 0&&(n[i]=He(o.schema.default))}return n}function Si(e,t){if(typeof e!="object"||e===null||t.type!=="object"||!t.properties)return e;const n={};for(const i in e){const o=t.properties[i],a=e[i];$i(a,o)||(n[i]=Si(a,o))}return n}function $i(e,t){const n=Nn.safeParse(e);if(n.success)return n.data.value.trim()==="";if(t.default!==void 0){if(e==null)return!0;const i=JSON.stringify(t.default),o=JSON.stringify(Si(e,t));if(i===o)return!0}return t.type==="boolean"?!1:Array.isArray(e)?e.length===0:typeof e=="object"?e===null||Object.keys(e).length===0:typeof e=="string"?e.trim()==="":typeof e=="number"?isNaN(e)||e===0:typeof e>"u"}function Ci(e,t){const n={};for(const i in e)t[i]&&($i(e[i],t[i].schema)||(n[i]=e[i]));return n}function ct(e,t,n,i,o){if(i.type==="boolean")return{name:e,title:t,description:n,kind:"checkbox",default:o??i.default??!1};if(i.type==="array"){if(typeof i.items!="object"||Array.isArray(i.items))return null;if(i.items?.type==="string"||i.items?.type==="number"||i.items?.type==="integer")return i.items.enum?{name:e,title:t,description:n,kind:"select",type:i.items.type,enum:i.items.enum,multiple:!0,default:o??i.default}:{name:e,title:t,description:n,kind:"combobox",type:i.items.type,default:o??i.default}}return i.type!=="string"&&i.type!=="number"&&i.type!=="integer"?null:i.enum?{name:e,title:t,description:n,kind:"select",type:i.type,enum:i.enum,multiple:!1,default:o??i.default}:{name:e,title:t,description:n,kind:"input",type:i.type,default:o??i.default}}function kl(e){return e.type!=="object"?!1:!!(e.additionalProperties&&Object.keys(e.additionalProperties).length>0||e.propertyNames&&Object.keys(e.propertyNames).length>0||e.patternProperties&&Object.keys(e.patternProperties).length>0)}function xl(e){const t=new Map;for(const n of e)if(!(n.type!=="object"||!n.properties))for(const[i,o]of Object.entries(n.properties)){if(typeof o!="object"||o.const===void 0)continue;const a=t.get(i)??0;t.set(i,a+1)}for(const[n,i]of t.entries()){if(!i||i<e.length)continue;const o=e[0].properties?.[n];if(o&&typeof o=="object"&&o.const!==void 0)return ct(n,o.title??Mt(n),o.description,o)}return null}function Ii(e,t){const n=[],i=[];for(const[o,a]of Object.entries(t)){if(a.schema.anyOf){const s=xl(a.schema.anyOf);if(s){const u={};for(const d of a.schema.anyOf){if(typeof d!="object"||!d.properties)continue;const c=d.properties[s.name].const?.toString();if(c===void 0)continue;const f=[];for(const[m,x]of Object.entries(d.properties)){if(typeof x!="object"||m===s.name)continue;const A=ct(m,x.title??Mt(m),x.description,x,d.default?.[m]);A&&f.push(A)}u[c]=f}Object.keys(u).length>0&&i.push({name:o,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"group",discriminator:s,fields:u,default:He(a.schema.default)});continue}}if(a.schema.type==="object"){if(a.schema.complex||kl(a.schema))_t(e,o,a.schema),i.push({name:o,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"structured",default:He(a.schema.default)});else{const s=[];for(const[u,d]of Object.entries(a.schema.properties??{})){if(typeof d!="object")continue;const l=ct(u,d.title??Mt(u),d.description,d,a.schema.default?.[u]);l&&s.push(l)}s.length>0&&i.push({name:o,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"group",discriminator:void 0,fields:{"":s},default:He(a.schema.default)})}continue}if(a.schema.type==="string"&&(a.schema.language||a.schema.multiline)){i.push({name:o,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"code",language:Fi().optional().safeParse(a.schema.language).data,default:a.schema.default});continue}const r=ct(o,a.meta.title,a.meta.description??a.schema.description,a.schema);if(r){n.push(r);continue}_t(e,o,a.schema),i.push({name:o,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"structured",default:He(a.schema.default)})}return{plainArguments:n,expandableArguments:i}}const Sl="The name of the instance. It must be unique within the same type across the project.",$l=q({__name:"InstanceArgumentEditor",props:xe({instance:{},component:{},state:{},allInstances:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:xe(["save"],["update:modelValue"]),setup(e,{emit:t}){const n=Je(e,"modelValue"),i=Ee(e.instance.name),o=Dn(xi(e.instance.args??{},e.component.args)),a=async()=>{n.value=!1,await ft(),Object.assign(o,e.instance.args)},r=t,s=async()=>{const f=Ci(o,e.component.args);r("save",e.instance.id,i.value,f),await ft(),n.value=!1},u=[f=>!!f||"Name is required",f=>f===e.instance.name||!e.allInstances.has(Pi(e.instance.type,f))||"Instance with this name and type already exists",f=>{const m=Di.safeParse(f);return m.success||m.error.issues[0].message}],{plainArguments:d,expandableArguments:l}=Ii(e.component.type,e.component.args),c=Ee(!0);return(f,m)=>(y(),C(Ln,{modelValue:n.value,"onUpdate:modelValue":m[2]||(m[2]=x=>n.value=x),class:"dialog",fullscreen:""},{default:b(()=>[$(Ut,{variant:"flat",color:e.component.meta.color??"#2d2d2d",title:e.component.meta.title,subtitle:e.component.meta.description},{prepend:b(()=>[$(g(qt),{meta:e.component.meta},null,8,["meta"])]),default:b(()=>[$(Se),$(bt,{class:"d-flex flex-column pt-4 ga-4 dialog-scroll"},{default:b(()=>[$(_i,{modelValue:g(c),"onUpdate:modelValue":m[1]||(m[1]=x=>Nt(c)?c.value=x:null)},{default:b(()=>[$(Hn,{modelValue:g(i),"onUpdate:modelValue":m[0]||(m[0]=x=>Nt(i)?i.value=x:null),label:"Name",variant:"outlined",density:"compact",rules:u},null,8,["modelValue"]),$(Ke,{class:"mt-2",description:Sl})]),_:1},8,["modelValue"]),(y(!0),E(P,null,oe(g(d),x=>(y(),C(wt,{key:x.name,modelValue:g(o)[x.name],"onUpdate:modelValue":A=>g(o)[x.name]=A,argument:x,instance:e.instance},null,8,["modelValue","onUpdate:modelValue","argument","instance"]))),128)),g(l).length>0?(y(),C(Un,{key:0,elevation:0},{default:b(()=>[(y(!0),E(P,null,oe(g(l),x=>(y(),E(P,{key:x.name},[x.kind==="group"?(y(),C(ki,{key:0,modelValue:g(o)[x.name],"onUpdate:modelValue":A=>g(o)[x.name]=A,argument:x,instance:e.instance},null,8,["modelValue","onUpdate:modelValue","argument","instance"])):(y(),C(bi,{key:1,modelValue:g(o)[x.name],"onUpdate:modelValue":A=>g(o)[x.name]=A,argument:x,instance:e.instance},null,8,["modelValue","onUpdate:modelValue","argument","instance"]))],64))),128))]),_:1})):O("",!0)]),_:1}),$(Se),$(kt,{class:"d-flex py-0"},{default:b(()=>[$(qe),$(re,{onClick:a},{default:b(()=>[...m[3]||(m[3]=[U("Cancel",-1)])]),_:1}),$(re,{onClick:s,color:"primary",disabled:!g(c)},{default:b(()=>[...m[4]||(m[4]=[U("Save",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1},8,["color","title","subtitle"])]),_:1},8,["modelValue"]))}}),Cl=te($l,[["__scopeId","data-v-9e94e3ac"]]),Il=q({__name:"InstanceSecretEditor",props:xe({instance:{},state:{},component:{},initialSecrets:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:xe(["save"],["update:modelValue"]),setup(e,{emit:t}){const n=Je(e,"modelValue"),i=Dn(xi(e.initialSecrets,e.component.secrets)),o=t,a=async()=>{n.value=!1,await ft(),Object.assign(i,e.initialSecrets)},r=async()=>{const d=Ci(i,e.component.secrets);e.state&&o("save",e.state.id,d),await ft(),n.value=!1},{plainArguments:s,expandableArguments:u}=Ii(e.component.type,e.component.secrets);return(d,l)=>(y(),C(Ln,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=c=>n.value=c),class:"dialog"},{default:b(()=>[$(Ut,{variant:"flat",color:e.component.meta.color??"#2d2d2d",title:e.component.meta.title,subtitle:e.component.meta.description},{prepend:b(()=>[$(g(qt),{meta:e.component.meta},null,8,["meta"])]),default:b(()=>[$(Se),$(bt,{class:"d-flex flex-column pt-4 ga-4",style:{"max-height":"60vh",overflow:"scroll"}},{default:b(()=>[(y(!0),E(P,null,oe(g(s),c=>(y(),C(wt,{key:c.name,modelValue:g(i)[c.name],"onUpdate:modelValue":f=>g(i)[c.name]=f,argument:c,instance:e.instance,"is-secret":""},null,8,["modelValue","onUpdate:modelValue","argument","instance"]))),128)),g(u).length>0?(y(),C(Un,{key:0,elevation:0},{default:b(()=>[(y(!0),E(P,null,oe(g(u),c=>(y(),E(P,{key:c.name},[c.kind==="group"?(y(),C(ki,{key:0,argument:c,instance:e.instance,modelValue:g(i)[c.name],"onUpdate:modelValue":f=>g(i)[c.name]=f,"is-secret":""},null,8,["argument","instance","modelValue","onUpdate:modelValue"])):(y(),C(bi,{key:1,modelValue:g(i)[c.name],"onUpdate:modelValue":f=>g(i)[c.name]=f,argument:c,instance:e.instance},null,8,["modelValue","onUpdate:modelValue","argument","instance"]))],64))),128))]),_:1})):O("",!0)]),_:1}),$(Se),$(kt,{class:"d-flex py-0"},{default:b(()=>[$(qe),$(re,{onClick:a},{default:b(()=>[...l[1]||(l[1]=[U("Cancel",-1)])]),_:1}),$(re,{onClick:r,color:"primary"},{default:b(()=>[...l[2]||(l[2]=[U("Save",-1)])]),_:1})]),_:1})]),_:1},8,["color","title","subtitle"])]),_:1},8,["modelValue"]))}}),Vl=te(Il,[["__scopeId","data-v-9b4053a7"]]);function Al(e,t){return Array.isArray(e)?e.length===0?"[]":"[...]":typeof e=="object"?"{...}":typeof e=="string"&&t.language?"...":String(e)}const Ml={class:"d-flex text-disabled text-start text-no-wrap"},Nl={key:0,class:"d-flex ml-auto text-error"},El={key:1,class:"d-flex ml-auto text-truncate pl-4"},Rl=q({__name:"InstanceNodeArgumentList",props:{instance:{},component:{}},setup(e){const t=M(()=>{const n=[];for(const[i,o]of Object.entries(e.component.args))!o.required&&(e.instance.args?.[i]==null||e.instance.args?.[i]===o.schema.default)||n.push({name:o.meta.title,value:Al(e.instance.args?.[i],o.schema),requiredAndNotSet:o.required&&e.instance.args?.[i]==null});return n});return(n,i)=>g(t).length>0?(y(),E(P,{key:0},[$(Se),$(bt,{class:"d-flex flex-column gap-2 px-2 py-2"},{default:b(()=>[(y(!0),E(P,null,oe(g(t),({name:o,value:a,requiredAndNotSet:r})=>(y(),E("div",{key:o,class:"d-flex flex-row"},[j("div",Ml,ee(o),1),r?(y(),E("div",Nl,"not set")):(y(),E("div",El,ee(a),1))]))),128))]),_:1})],64)):O("",!0)}}),Ol=q({__name:"InstanceStatusFieldItem",props:{item:{}},setup(e){return(t,n)=>(y(),C(eo,{title:e.item},{append:b(()=>[$(g(Yn),{content:e.item},null,8,["content"])]),_:1},8,["title"]))}}),zl={class:"d-flex flex-row"},Tl={class:"d-flex text-disabled text-start text-no-wrap text-secondary"},Bl=["title"],Hl=q({__name:"InstanceStatusField",props:{statusField:{}},setup(e){const t=M(()=>Array.isArray(e.statusField.value)?e.statusField.value.join(", "):String(e.statusField.value)),n=M(()=>Array.isArray(e.statusField.value)?e.statusField.value.length===0?"[]":e.statusField.value.length===1?e.statusField.value[0]:`${e.statusField.value.length} items`:String(e.statusField.value)),i=M(()=>Array.isArray(e.statusField.value)?e.statusField.value.length>1:!1);return(o,a)=>(y(),E("div",zl,[j("div",Tl,[e.statusField.meta.icon?(y(),C(g(En),{key:0,icon:e.statusField.meta.icon,color:e.statusField.meta.iconColor,width:16,class:"mr-1"},null,8,["icon","color"])):O("",!0),U(" "+ee(e.statusField.meta.title),1)]),$(to,{"open-on-hover":"","close-on-content-click":!1,location:"end",disabled:!g(i)},{activator:b(({props:r})=>[j("div",Ue(r,{class:"d-flex ml-auto text-truncate pl-4",title:g(i)?"":g(t)}),[j("span",{class:ke(["text-truncate",{underline:g(i)}])},ee(g(n)),3)],16,Bl)]),default:b(()=>[$(no,{density:"compact",variant:"text"},{default:b(()=>[(y(!0),E(P,null,oe(e.statusField.value,(r,s)=>(y(),C(Ol,{key:s,item:r},null,8,["item"]))),128))]),_:1})]),_:1},8,["disabled"]),$(g(Yn),{content:g(t)},null,8,["content"])]))}}),Fl=te(Hl,[["__scopeId","data-v-d5d4ae75"]]),Pl=q({__name:"InstanceStatusFieldList",props:{instance:{},state:{}},setup(e){const t=M(()=>e.state.statusFields?.filter(n=>n.value===void 0?!1:n.complementaryTo?!e.instance.args?.[n.complementaryTo]||JSON.stringify(e.instance.args[n.complementaryTo])!==JSON.stringify(n.value):!0)??[]);return(n,i)=>g(t).length>0?(y(),E(P,{key:0},[$(Se),$(bt,{class:"d-flex flex-column gap-2 px-2 py-2"},{default:b(()=>[(y(!0),E(P,null,oe(g(t),o=>(y(),C(Fl,{key:o.name,"status-field":o},null,8,["status-field"]))),128))]),_:1})],64)):O("",!0)}}),Dl=q({__name:"InstanceNodeActions",props:{component:{},state:{},locked:{type:Boolean},editable:{type:Boolean},hideShowComposite:{type:Boolean},loadingSecrets:{type:Boolean},loadingTerminal:{type:Boolean},loadingPage:{type:Boolean},ghost:{type:Boolean,default:!1}},emits:["open:args","open:secrets","open:terminal","open:page","open:composite","operation:launch","operation:cancel"],setup(e,{emit:t}){const n=M(()=>Rn(e.component)&&Object.keys(e.component.secrets).length>0),i=M(()=>Li(e.state?.lastOperationState?.status)),o=M(()=>e.state?.evaluationState&&e.state.evaluationState.status==="evaluating"),a=M(()=>e.state&&(o.value||e.state.lastOperationState?.status==="pending"||e.state.lastOperationState?.totalResourceCount===0||e.state.lastOperationState?.currentResourceCount===0||e.state.lastOperationState?.currentResourceCount===e.state.lastOperationState?.totalResourceCount)),r=M(()=>{if(!e.state?.lastOperationState)return 0;const{currentResourceCount:c,totalResourceCount:f}=e.state.lastOperationState;return c&&f?c/f*100:0}),s=M(()=>e.state?.terminalIds&&e.state.terminalIds.length>0),u=M(()=>e.state?.pageIds&&e.state.pageIds.length>0),d=M(()=>e.state?.lastOperationState?.status==="pending"?"":e.state?.lastOperationState?.status==="destroying"?"error":"primary"),l=t;return(c,f)=>(y(),C(kt,{class:"py-0 h-auto"},{default:b(()=>[Q(c.$slots,"status",{},()=>[$(Xe,{color:""},{default:b(()=>[$(g(so),{size:20,icon:"mdi-circle-outline"})]),_:1})],!0),$(qe),!e.ghost&&!g(Ui)(e.state)&&!g(i)?(y(),C(re,{key:0,size:"small",variant:"tonal",class:"toolbar-button",title:"Create",disabled:e.locked,onClick:f[0]||(f[0]=m=>l("operation:launch","update"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[8]||(f[8]=[U("mdi-rocket-launch",-1)])]),_:1})]),_:1},8,["disabled"])):!e.ghost&&!g(i)?(y(),C(re,{key:1,size:"small",variant:"tonal",class:"toolbar-button",title:"Update",disabled:e.locked,onClick:f[1]||(f[1]=m=>l("operation:launch","update"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[9]||(f[9]=[U("mdi-play",-1)])]),_:1})]),_:1},8,["disabled"])):O("",!0),g(i)?(y(),C(re,{key:2,size:"small",variant:"tonal",color:"error",class:"toolbar-button",title:"Cancel Operation",onClick:f[2]||(f[2]=m=>l("operation:cancel"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[10]||(f[10]=[U("mdi-cancel",-1)])]),_:1})]),_:1})):O("",!0),e.editable&&!e.ghost&&!g(i)?(y(),C(re,{key:3,size:"small",variant:"tonal",class:"toolbar-button",title:"Edit Arguments",locked:e.locked,onClick:f[3]||(f[3]=m=>l("open:args"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[11]||(f[11]=[U("mdi-pencil",-1)])]),_:1})]),_:1},8,["locked"])):O("",!0),e.editable&&!e.ghost&&!g(i)&&g(n)?(y(),C(re,{key:4,size:"small",variant:"tonal",class:"toolbar-button",loading:e.loadingSecrets,locked:e.locked,title:"Edit Secrets",onClick:f[4]||(f[4]=m=>l("open:secrets"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[12]||(f[12]=[U("mdi-key",-1)])]),_:1})]),_:1},8,["loading","locked"])):O("",!0),!e.ghost&&g(s)?(y(),C(re,{key:5,size:"small",variant:"tonal",class:"toolbar-button",loading:e.loadingTerminal,title:"Open Terminal",onClick:f[5]||(f[5]=m=>l("open:terminal"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[13]||(f[13]=[U("mdi-console",-1)])]),_:1})]),_:1},8,["loading"])):O("",!0),!e.ghost&&g(u)?(y(),C(re,{key:6,size:"small",variant:"tonal",class:"toolbar-button",title:"Open Page",loading:e.loadingPage,onClick:f[6]||(f[6]=m=>l("open:page"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[14]||(f[14]=[U("mdi-file-document",-1)])]),_:1})]),_:1},8,["loading"])):O("",!0),!e.ghost&&e.component.kind==="composite"&&!e.hideShowComposite?(y(),C(re,{key:7,size:"small",variant:"tonal",class:"toolbar-button",title:"Show Structure",onClick:f[7]||(f[7]=m=>l("open:composite"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[15]||(f[15]=[U("mdi-cube-outline",-1)])]),_:1})]),_:1})):O("",!0),g(o)||g(i)?(y(),C(io,{key:8,size:"small",color:g(d),indeterminate:g(a),"model-value":g(r),absolute:"",location:"bottom"},null,8,["color","indeterminate","model-value"])):O("",!0)]),_:3}))}}),Ll=te(Dl,[["__scopeId","data-v-fac542c3"]]),Ul={key:0,class:"text-h6"},ql={key:1},Xl=q({__name:"InstanceNodeLockBadge",props:{instanceLock:{}},setup(e){return(t,n)=>(y(),C(qn,{disabled:!e.instanceLock.meta.title&&!e.instanceLock.meta.description},{activator:b(({props:i})=>[$(Xe,Me(Fe(i)),{default:b(()=>[$(Z,null,{default:b(()=>[...n[0]||(n[0]=[U("mdi-lock",-1)])]),_:1}),e.instanceLock.meta.icon?(y(),C(g(En),{key:0,class:"ml-1",icon:e.instanceLock.meta.icon,width:18,color:e.instanceLock.meta.iconColor},null,8,["icon","color"])):O("",!0)]),_:1},16)]),default:b(()=>[e.instanceLock.meta.title?(y(),E("div",Ul,ee(e.instanceLock.meta.title),1)):O("",!0),e.instanceLock.meta.description?(y(),E("div",ql,ee(e.instanceLock.meta.description),1)):O("",!0)]),_:1},8,["disabled"]))}}),Yl=q({__name:"InstanceNodeIOSideHandle",props:{name:{},side:{},handleColor:{},isValidConnection:{type:Function}},setup(e){return(t,n)=>(y(),E(P,null,[$(g(Vn),{id:e.name,type:e.side==="left"?"target":"source",position:e.side==="left"?g(dt).Left:g(dt).Right,class:ke(["handle",[e.side==="left"?"left-handle":"right-handle"]]),"is-valid-connection":e.isValidConnection},null,8,["id","type","position","class","is-valid-connection"]),j("div",{class:ke(["handle-dot",[e.side==="left"?"handle-dot-left":"handle-dot-right"]]),style:ve({backgroundColor:e.handleColor})},null,6)],64))}}),$n=te(Yl,[["__scopeId","data-v-ae6b4385"]]);function Gl(e){const t=e.replace("#",""),n=parseInt(t.substring(0,2),16),i=parseInt(t.substring(2,2),16),o=parseInt(t.substring(4,2),16);return(n*299+i*587+o*114)/1e3>=128?"#000":"#fff"}const Wl={ref:"column",class:"d-flex flex-column gr-2 column"},jl=q({__name:"InstanceNodeIOSide",props:{instance:{},component:{},entities:{},type:{},side:{},isValidConnection:{type:Function},resolvedInputs:{},resolvedInjectionInput:{},usedOutputs:{},forceShowAllHandles:{type:Boolean},preventShowAllHandles:{type:Boolean}},setup(e){const t=(l,c)=>{const f=e.component[l][c];return e.entities[f.type]?.meta.color??"#607D8B"},n=(l,c)=>Gl(t(l,c)),i=l=>{const c=e.instance.inputs&&!!e.instance.inputs[l]&&e.instance.inputs[l].length>0,f=e.instance.hubInputs&&!!e.instance.hubInputs[l]&&e.instance.hubInputs[l].length>0;return c||f},o=l=>e.component.inputs[l].required?!e.resolvedInputs?.[l]?.length:!1,a=Xn("column"),{isOutside:r}=qi(a),s=M(()=>e.forceShowAllHandles||!r.value&&!e.preventShowAllHandles),u=M(()=>e.resolvedInjectionInput?e.resolvedInjectionInput.length===1?"1 input":`${e.resolvedInjectionInput.length} inputs`:"no inputs"),d=M(()=>e.instance.injectionInputs&&e.instance.injectionInputs.length>0);return(l,c)=>(y(),E("div",Wl,[e.type==="inputs"&&e.side==="left"&&Object.keys(e.component.inputs).length>0&&(g(d)||g(s))?(y(),C(Xe,{key:0,style:{backgroundColor:"#3F51B5",color:"white"},"text-color":"white",class:"rounded handle-chip"},{default:b(()=>[$(Z,{class:"mr-1",style:{"margin-left":"-2px"}},{default:b(()=>[...c[0]||(c[0]=[U("mdi-router",-1)])]),_:1}),U(" "+ee(g(u))+" ",1),$($n,{name:"",side:e.side,"is-valid-connection":e.isValidConnection,"handle-color":"#3F51B5"},null,8,["side","is-valid-connection"])]),_:1})):O("",!0),(y(!0),E(P,null,oe(e.component[e.type],(f,m)=>(y(),E(P,{key:m},[e.side==="right"&&e.type==="inputs"||e.type==="outputs"&&(!e.usedOutputs||e.usedOutputs.has(m))||e.type==="inputs"&&(i(m)||o(m))||g(s)?(y(),C(Xe,{key:0,style:ve({backgroundColor:t(e.type,m),color:n(e.type,m)}),"text-color":"white",class:"rounded handle-chip"},{default:b(()=>[U(ee(f.meta.title)+" ",1),$($n,{name:m,side:e.side,"is-valid-connection":e.isValidConnection,"handle-color":t(e.type,m)},null,8,["name","side","is-valid-connection","handle-color"])]),_:2},1032,["style"])):O("",!0)],64))),128))],512))}}),ot=te(jl,[["__scopeId","data-v-c3646ddb"]]),Kl=q({__name:"InstanceNodeIO",props:{instance:{},component:{},entities:{},type:{default:"both"},mirror:{type:Boolean},isValidConnection:{type:Function},usedOutputs:{},resolvedInputs:{},resolvedInjectionInput:{},forceShowAllHandles:{type:Boolean},preventShowAllHandles:{type:Boolean}},setup(e){return(t,n)=>(y(),C(kt,{class:"align-start align-stretch component-node-io"},{default:b(()=>[e.mirror?(y(),E(P,{key:1},[e.type==="both"||e.type==="outputs"?(y(),C(ot,{key:0,instance:e.instance,component:e.component,entities:e.entities,"is-valid-connection":e.isValidConnection,type:"outputs","used-outputs":e.usedOutputs,side:"left","force-show-all-handles":e.forceShowAllHandles,"prevent-show-all-handles":e.preventShowAllHandles},null,8,["instance","component","entities","is-valid-connection","used-outputs","force-show-all-handles","prevent-show-all-handles"])):O("",!0),$(qe),e.type==="both"||e.type==="inputs"?(y(),C(ot,{key:1,instance:e.instance,component:e.component,entities:e.entities,"is-valid-connection":e.isValidConnection,type:"inputs",side:"right","resolved-inputs":e.resolvedInputs,"force-show-all-handles":e.forceShowAllHandles,"prevent-show-all-handles":e.preventShowAllHandles},null,8,["instance","component","entities","is-valid-connection","resolved-inputs","force-show-all-handles","prevent-show-all-handles"])):O("",!0)],64)):(y(),E(P,{key:0},[e.type==="both"||e.type==="inputs"?(y(),C(ot,{key:0,instance:e.instance,component:e.component,entities:e.entities,"is-valid-connection":e.isValidConnection,type:"inputs","resolved-inputs":e.resolvedInputs,"resolved-injection-input":e.resolvedInjectionInput,"force-show-all-handles":e.forceShowAllHandles,"prevent-show-all-handles":e.preventShowAllHandles,side:"left"},null,8,["instance","component","entities","is-valid-connection","resolved-inputs","resolved-injection-input","force-show-all-handles","prevent-show-all-handles"])):O("",!0),$(qe),e.type==="both"||e.type==="outputs"?(y(),C(ot,{key:1,instance:e.instance,component:e.component,entities:e.entities,"is-valid-connection":e.isValidConnection,type:"outputs","used-outputs":e.usedOutputs,side:"right","force-show-all-handles":e.forceShowAllHandles,"prevent-show-all-handles":e.preventShowAllHandles},null,8,["instance","component","entities","is-valid-connection","used-outputs","force-show-all-handles","prevent-show-all-handles"])):O("",!0)],64))]),_:1}))}}),Jl=te(Kl,[["__scopeId","data-v-917ac605"]]),Zl={class:"instance-node__badges"},Ql=q({__name:"InstanceNode",props:xe({instance:{},component:{},entities:{},inputResolverOutputs:{},inputResolverDependentMap:{},allInstances:{default:()=>new Map},state:{},instanceLock:{},loadingSecrets:{type:Boolean},loadingTerminal:{type:Boolean},loadingPage:{type:Boolean},initialSecrets:{},editable:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},ioType:{default:"both"},ioMirror:{type:Boolean},hideShowComposite:{type:Boolean},isValidConnection:{type:Function}},{editingSecrets:{type:Boolean,default:!1},editingSecretsModifiers:{}}),emits:xe(["open:secrets","open:terminal","open:page","open:composite","operation:launch","operation:cancel","save:args","save:secrets","contextmenu"],["update:editingSecrets"]),setup(e,{emit:t}){const n=t,i=Je(e,"editingSecrets"),o=Ee(!1),a=M(()=>Object.keys(e.component.inputs).length>0),r=M(()=>Object.keys(e.component.outputs).length>0),s=M(()=>a.value||r.value),u=M(()=>Cn(e.inputResolverOutputs,e.instance.id)),d=M(()=>In(e.inputResolverOutputs,e.instance.id).map(H=>H.input)),l=M(()=>{const H=en(e.inputResolverOutputs,e.instance.id)??{},N=Object.values(H).flat(),R=new Set,F=e.inputResolverDependentMap.get(`instance:${e.instance.id}`)??[],B=Y=>{(Y.input.instanceId===e.instance.id||N.some(K=>K.instanceId===Y.input.instanceId))&&R.add(Y.input.output)};for(const Y of F){const K=e.inputResolverOutputs.get(Y);if(K)if(K.kind==="instance")for(const L of Object.values(K.resolvedInputs))for(const ye of L)B(ye);else for(const L of K.resolvedInputs)B(L)}if(e.instance.parentId){const Y=en(e.inputResolverOutputs,e.instance.parentId)??{};for(const K of Object.values(Y).flat())K.instanceId===e.instance.id&&R.add(K.output)}return R});Pn(l,H=>{H.size!==0&&c.updateNodeInternals([m.node.id])});const{vueFlowStore:c,selection:f}=Lt(),m=An(),x=M(()=>Mn(m.node,c)),A=M(()=>c.connectionStartHandle.value?.nodeId===m.node.id),z=Xn("componentCard"),I=M(()=>c.viewport.value.zoom<.5),D=M(()=>z.value?Math.min(z.value.$el.clientWidth,z.value.$el.clientHeight)*.7:0);return(H,N)=>(y(),E(P,null,[$(g(ro),{class:ke({"instance-card--ghost":e.ghost}),component:e.component,subtitle:e.instance.name,"blueprint-status":x.value,selected:g(f).isNodeSelected(g(m).node),style:{overflow:"visible"},onContextmenu:N[11]||(N[11]=R=>n("contextmenu",R)),ref:"componentCard"},{append:b(()=>[j("div",Zl,[e.ghost?(y(),C(qn,{key:0,location:"top"},{activator:b(({props:R})=>[$(Xe,Ue(R,{class:"instance-node__ghost-chip",color:"primary"}),{default:b(()=>[$(Z,{size:"16"},{default:b(()=>[...N[13]||(N[13]=[U("mdi-ghost",-1)])]),_:1})]),_:1},16)]),default:b(()=>[N[14]||(N[14]=j("span",null," This instance is a ghost. It is no longer a part of the project, but Highstate still tracks it. ",-1))]),_:1})):O("",!0),e.instanceLock?(y(),C(Xl,{key:1,"instance-lock":e.instanceLock},null,8,["instance-lock"])):O("",!0)])]),default:b(()=>[Q(H.$slots,"default",{},void 0,!0),g(o)?(y(),C(g(Cl),{key:0,modelValue:g(o),"onUpdate:modelValue":N[0]||(N[0]=R=>Nt(o)?o.value=R:null),instance:e.instance,component:e.component,state:e.state,"all-instances":e.allInstances,onSave:N[1]||(N[1]=(R,F,B)=>n("save:args",R,F,B))},null,8,["modelValue","instance","component","state","all-instances"])):O("",!0),g(Rn)(e.component)&&i.value?(y(),C(g(Vl),{key:1,modelValue:i.value,"onUpdate:modelValue":N[2]||(N[2]=R=>i.value=R),instance:e.instance,state:e.state,component:e.component,"initial-secrets":e.initialSecrets??{},onSave:N[3]||(N[3]=(R,F)=>n("save:secrets",R,F))},null,8,["modelValue","instance","state","component","initial-secrets"])):O("",!0),$(Rl,{instance:e.instance,component:e.component},null,8,["instance","component"]),s.value?(y(),E(P,{key:2},[$(Se),$(Jl,{component:e.component,instance:e.instance,entities:e.entities,"is-valid-connection":e.isValidConnection,type:e.ioType,mirror:e.ioMirror,"used-outputs":l.value,"resolved-inputs":u.value,"resolved-injection-input":d.value,"force-show-all-handles":A.value,"prevent-show-all-handles":g(o)||i.value||!e.editable||I.value},null,8,["component","instance","entities","is-valid-connection","type","mirror","used-outputs","resolved-inputs","resolved-injection-input","force-show-all-handles","prevent-show-all-handles"])],64)):O("",!0),e.state?(y(),C(Pl,{key:3,instance:e.instance,state:e.state},null,8,["instance","state"])):O("",!0),$(Se),$(Ll,{"loading-secrets":e.loadingSecrets,"loading-terminal":e.loadingTerminal,"loading-page":e.loadingPage,instance:e.instance,component:e.component,state:e.state,locked:!!e.instanceLock,editable:e.editable,ghost:e.ghost,"hide-show-composite":e.hideShowComposite,"onOpen:args":N[4]||(N[4]=R=>o.value=!0),"onOpen:secrets":N[5]||(N[5]=R=>e.state?n("open:secrets"):i.value=!0),"onOpen:terminal":N[6]||(N[6]=R=>n("open:terminal")),"onOpen:page":N[7]||(N[7]=R=>n("open:page")),"onOpen:composite":N[8]||(N[8]=R=>n("open:composite")),"onOperation:launch":N[9]||(N[9]=R=>n("operation:launch",R)),"onOperation:cancel":N[10]||(N[10]=R=>n("operation:cancel"))},{status:b(()=>[Q(H.$slots,"status",{},void 0,!0)]),_:3},8,["loading-secrets","loading-terminal","loading-page","instance","component","state","locked","editable","ghost","hide-show-composite"])]),_:3},8,["class","component","subtitle","blueprint-status","selected"]),$(oo,{modelValue:I.value,"onUpdate:modelValue":N[12]||(N[12]=R=>I.value=R),scrim:"#1e1e1e",opacity:1,absolute:"",class:"align-center justify-center",style:ve(`border: 3px solid ${e.component.meta.iconColor??"#3f51b5"}; border-radius: 8px`),contained:""},{default:b(()=>[$(g(qt),{meta:e.component.meta,size:D.value},null,8,["meta","size"])]),_:1},8,["modelValue","style"])],64))}}),su=te(Ql,[["__scopeId","data-v-731e9c68"]]);export{ru as G,au as H,su as I,yo as _,Jl as a};
|
|
14
|
+
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);Tn(w=>{if(A.value){const V=be(A.value),k=G=>{if(G.sourceEvent.type!=="wheel"||!f.value||!m.value)return;const W=G.sourceEvent.ctrlKey&&Oi()?10:1,J=-G.sourceEvent.deltaY*(G.sourceEvent.deltaMode===1?.05:G.sourceEvent.deltaMode?1:.002)*e.zoomStep,ne=u.value.zoom*2**(J*W);m.value.scaleTo(f.value,ne)},T=G=>{if(G.sourceEvent.type!=="mousemove"||!f.value||!m.value)return;const W=K.value*Math.max(1,u.value.zoom)*(e.inversePan?-1:1),J={x:u.value.x-G.sourceEvent.movementX*W,y:u.value.y-G.sourceEvent.movementY*W},ne=[[0,0],[l.value.width,l.value.height]],ie=Zt.translate(J.x,J.y).scale(u.value.zoom),se=m.value.constrain()(ie,ne,d.value);m.value.transform(f.value,se)},X=il().wheelDelta(G=>Ri(G)*(e.zoomStep/10)).on("zoom",e.pannable?T:()=>{}).on("zoom.wheel",e.zoomable?k:()=>{});V.call(X),w(()=>{V.on("zoom",null)})}},{flush:"post"});function Ve(w){const[V,k]=pe(w);t("click",{event:w,position:{x:V,y:k}})}function Ae(w,V){const k={event:w,node:V,connectedEdges:ze([V],s.value)};c.miniMapNodeClick(k),t("nodeClick",k)}function h(w,V){const k={event:w,node:V,connectedEdges:ze([V],s.value)};c.miniMapNodeDoubleClick(k),t("nodeDblclick",k)}function p(w,V){const k={event:w,node:V,connectedEdges:ze([V],s.value)};c.miniMapNodeMouseEnter(k),t("nodeMouseenter",k)}function v(w,V){const k={event:w,node:V,connectedEdges:ze([V],s.value)};c.miniMapNodeMouseMove(k),t("nodeMousemove",k)}function S(w,V){const k={event:w,node:V,connectedEdges:ze([V],s.value)};c.miniMapNodeMouseLeave(k),t("nodeMouseleave",k)}return(w,V)=>(y(),C(g(at),{position:w.position,class:ke(["vue-flow__minimap",{pannable:w.pannable,zoomable:w.zoomable}])},{default:b(()=>[(y(),E("svg",{ref_key:"el",ref:A,width:z.value,height:I.value,viewBox:[L.value.x,L.value.y,L.value.width,L.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${g(r)}`,onClick:Ve},[w.ariaLabel?(y(),E("title",{key:0,id:`vue-flow__minimap-${g(r)}`},ee(w.ariaLabel),9,ll)):O("",!0),(y(!0),E(P,null,oe(g(x),k=>(y(),C(rl,{id:k.id,key:k.id,f:"",position:k.computedPosition,dimensions:k.dimensions,selected:k.selected,dragging:k.dragging,style:ve(k.style),class:ke(R.value(k)),color:H.value(k),"border-radius":w.nodeBorderRadius,"stroke-color":N.value(k),"stroke-width":w.nodeStrokeWidth,"shape-rendering":g(D),type:k.type,hidden:k.hidden,onClick:T=>Ae(T,k),onDblclick:T=>h(T,k),onMouseenter:T=>p(T,k),onMousemove:T=>v(T,k),onMouseleave:T=>S(T,k)},null,8,["id","position","dimensions","selected","dragging","style","class","color","border-radius","stroke-color","stroke-width","shape-rendering","type","hidden","onClick","onDblclick","onMouseenter","onMousemove","onMouseleave"]))),128)),j("path",{class:"vue-flow__minimap-mask",d:ye.value,fill:w.maskColor,stroke:w.maskStrokeColor,"stroke-width":w.maskStrokeWidth,"fill-rule":"evenodd"},null,8,ul)],8,sl))]),_:1},8,["position","class"]))}}),fl={class:"vue-flow-container"},hl={key:0},ml={key:0},gl={key:1},vl=q({__name:"GenericCanvas",props:{canvasId:{},inputResolverOutputs:{},components:{},entities:{},interactive:{type:Boolean,default:!0},editable:{type:Boolean,default:!1},minimap:{type:Boolean,default:!0}},emits:["dragover","init"],setup(e,{emit:t}){const n=t,i=Lt.ensureCreated(...e.canvasId);return Tn(()=>{i.edgeEndpointOffsets.setInputResolverOutputs(e.inputResolverOutputs)}),n("init",i),(o,a)=>{const r=zi;return y(),C(r,null,{default:b(()=>[j("div",fl,[$(g(Ti),{"min-zoom":.1,"max-zoom":1,"snap-to-grid":!0,onDragover:a[1]||(a[1]=s=>n("dragover",s))},{"node-instance":b(s=>[Q(o.$slots,"node-instance",Me(Fe(s)),void 0,!0)]),"node-inputs":b(s=>[Q(o.$slots,"node-inputs",Me(Fe(s)),void 0,!0)]),"node-outputs":b(s=>[Q(o.$slots,"node-outputs",Me(Fe(s)),void 0,!0)]),"node-hub":b(s=>[Q(o.$slots,"node-hub",Me(Fe(s)),void 0,!0)]),"edge-custom":b(s=>[$(g(go),Ue(s,{"input-resolver-outputs":e.inputResolverOutputs,components:e.components,entities:e.entities}),null,16,["input-resolver-outputs","components","entities"])]),default:b(()=>[$(g(Mo),{"pattern-color":"#aaa",gap:32}),e.minimap?(y(),C(g(dl),{key:0,position:"top-right"})):O("",!0),$(g(at),{position:"top-left"},{default:b(()=>[e.interactive?(y(),E("div",hl,[a[6]||(a[6]=U(" Hold Control to add nodes to selection and Alt to remove them ",-1)),a[7]||(a[7]=j("br",null,null,-1)),e.editable?(y(),E("div",ml,"Press Ctrl+V to paste blueprint from clipboard")):O("",!0),g(i).selection.selectedNodeIds.size>0?(y(),E("div",gl,[U(" Selected "+ee(g(i).selection.selectedNodeIds.size)+" nodes ",1),a[2]||(a[2]=j("br",null,null,-1)),a[3]||(a[3]=U(" Press Escape to clear selection ",-1)),a[4]||(a[4]=j("br",null,null,-1)),a[5]||(a[5]=U(" Press Ctrl+C to copy selected nodes to clipboard ",-1))])):O("",!0)])):O("",!0)]),_:1}),$(g(at),{position:"bottom-right"},{default:b(()=>[Q(o.$slots,"panel-bottom-right",{},void 0,!0)]),_:3}),$(g(at),{position:"bottom-left"},{default:b(()=>[Q(o.$slots,"panel-bottom-left",{},void 0,!0)]),_:3}),$(g(xo),{"selection-mode":g(i).selection.selectionMode,"selection-area":g(i).selection.selectionArea},null,8,["selection-mode","selection-area"]),$(Ki,{modelValue:g(i).blueprintCopied,"onUpdate:modelValue":a[0]||(a[0]=s=>g(i).blueprintCopied=s),location:"top center",color:"info"},{default:b(()=>[...a[8]||(a[8]=[U(" Blueprint copied to clipboard ",-1)])]),_:1},8,["modelValue"])]),_:3})])]),_:3})}}}),ru=te(vl,[["__scopeId","data-v-fd0cbe42"]]),yl=["innerHTML"],Ke=q({__name:"ArgumentDescription",props:{description:{}},setup(e){return(t,n)=>(y(),E("div",{class:"markdown-body pl-4 text-disabled",innerHTML:("renderMarkdown"in t?t.renderMarkdown:g(Bi))(e.description)},null,8,yl))}}),pl={class:"editor"},wl=q({__name:"CodeArgumentInput",props:{modelValue:{},argument:{},instance:{}},emits:["update:model-value"],setup(e,{emit:t}){const n=Ee("");typeof e.modelValue=="string"?n.value=e.modelValue:n.value=Nn.safeParse(e.modelValue)?.data?.value??"";const i=t,o=a=>{e.argument.kind==="code"?i("update:model-value",a):i("update:model-value",{[Hi.Yaml]:!0,value:a}),n.value=a};return(a,r)=>(y(),C(Bn,{title:e.argument.title,color:"#2d2d2d","bg-color":"#1e1e1e"},{title:b(()=>[j("div",null,ee(e.argument.title),1)]),text:b(()=>[e.argument.description?(y(),C(Ke,{key:0,description:e.argument.description,class:"mb-4"},null,8,["description"])):O("",!0),j("div",pl,[e.argument.kind==="code"?(y(),C(g(nn),{key:0,value:g(n),"onUpdate:value":o,theme:"dark-plus",class:"editor",language:e.argument.language??"text",options:{tabSize:2}},null,8,["value","language"])):(y(),C(g(nn),{key:1,value:g(n),"onUpdate:value":o,theme:"vs-dark",language:"yaml",path:`${e.instance.type}.${e.argument.name}`,options:{tabSize:2}},null,8,["value","path"]))])]),_:1},8,["title"]))}}),bi=te(wl,[["__scopeId","data-v-d566ed14"]]),wt=q({__name:"PlainArgumentInput",props:xe({argument:{},instance:{},isSecret:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Je(e,"modelValue");t.value===void 0&&e.argument.default!==void 0&&(t.value=e.argument.default);const n=Ee(!1),i=M(()=>e.isSecret?n.value?"text":"password":"text"),o=M(()=>e.argument.default!=null?String(e.argument.default):"");return(a,r)=>(y(),E("div",null,[e.argument.kind==="input"&&e.argument.type==="string"?(y(),C(Hn,{key:0,modelValue:t.value,"onUpdate:modelValue":r[1]||(r[1]=s=>t.value=s),label:e.argument.title,placeholder:g(o),type:g(i),variant:"outlined",density:"compact","hide-details":""},{"append-inner":b(()=>[e.isSecret?(y(),C(Z,{key:0,onClick:r[0]||(r[0]=s=>n.value=!g(n))},{default:b(()=>[U(ee(g(n)?"mdi-eye-off":"mdi-eye"),1)]),_:1})):O("",!0)]),_:1},8,["modelValue","label","placeholder","type"])):e.argument.kind==="input"&&(e.argument.type==="number"||e.argument.type==="integer")?(y(),C(Ji,{key:1,modelValue:t.value,"onUpdate:modelValue":r[3]||(r[3]=s=>t.value=s),label:e.argument.title,placeholder:g(o),variant:"outlined",density:"compact","hide-details":""},{"append-inner":b(()=>[e.isSecret?(y(),C(Z,{key:0,onClick:r[2]||(r[2]=s=>n.value=!g(n))},{default:b(()=>[U(ee(g(n)?"mdi-eye-off":"mdi-eye"),1)]),_:1})):O("",!0)]),_:1},8,["modelValue","label","placeholder"])):e.argument.kind==="combobox"?(y(),C(Zi,{key:2,modelValue:t.value,"onUpdate:modelValue":r[4]||(r[4]=s=>t.value=s),label:e.argument.title,placeholder:g(o),variant:"outlined",density:"compact",multiple:"",chips:"","hide-details":""},null,8,["modelValue","label","placeholder"])):e.argument.kind==="select"?(y(),C(Fn,{key:3,modelValue:t.value,"onUpdate:modelValue":r[5]||(r[5]=s=>t.value=s),label:e.argument.title,placeholder:g(o),items:e.argument.enum,variant:"outlined",density:"compact",multiple:e.argument.multiple,"hide-details":""},null,8,["modelValue","label","placeholder","items","multiple"])):(y(),C(Qi,{key:4,modelValue:t.value,"onUpdate:modelValue":r[6]||(r[6]=s=>t.value=s),label:e.argument.title,density:"compact","hide-details":""},null,8,["modelValue","label"])),e.argument.description?(y(),C(Ke,{key:5,class:"mt-2",description:e.argument.description},null,8,["description"])):O("",!0)]))}}),bl={class:"d-flex flex-column ga-4"},ki=q({__name:"GroupArgumentInput",props:xe({argument:{},instance:{},isSecret:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Je(e,"modelValue");t.value===void 0&&(t.value=e.argument.default??{});const n=(o,a)=>{t.value={...t.value,[o]:a}},i=M(()=>e.argument.discriminator?t.value[e.argument.discriminator.name]??"":"");for(const o of e.argument.fields[i.value]??[])t.value[o.name]===void 0&&o.default!==void 0&&(t.value[o.name]=o.default);return Pn(i,o=>{if(!e.argument.discriminator)return;const a=e.argument.fields[o]??[],r={[e.argument.discriminator.name]:o};for(const s of a)r[s.name]=s.default;t.value=r}),(o,a)=>(y(),C(Bn,{color:"#2d2d2d","bg-color":"#2d2d2d"},{title:b(()=>[j("div",null,ee(e.argument.title),1)]),text:b(()=>[e.argument.description?(y(),C(Ke,{key:0,description:e.argument.description,class:"mb-4"},null,8,["description"])):O("",!0),j("div",bl,[e.argument.discriminator?(y(),E(P,{key:1},[j("div",null,[$(Fn,{"model-value":t.value[e.argument.discriminator.name],items:Object.keys(e.argument.fields),label:e.argument.discriminator.title,variant:"outlined",density:"compact","hide-details":"","onUpdate:modelValue":a[0]||(a[0]=r=>n(e.argument.discriminator.name,r))},null,8,["model-value","items","label"]),e.argument.discriminator.description?(y(),C(Ke,{key:0,class:"mt-2",description:e.argument.discriminator.description},null,8,["description"])):O("",!0)]),(y(!0),E(P,null,oe(e.argument.fields[g(i)]??[],r=>(y(),C(wt,{"model-value":t.value[r.name],key:r.name,argument:r,instance:e.instance,"is-secret":e.isSecret,"onUpdate:modelValue":s=>n(r.name,s)},null,8,["model-value","argument","instance","is-secret","onUpdate:modelValue"]))),128))],64)):(y(!0),E(P,{key:0},oe(e.argument.fields[""],r=>(y(),C(wt,{"model-value":t.value[r.name],key:r.name,argument:r,instance:e.instance,"is-secret":e.isSecret,"onUpdate:modelValue":s=>n(r.name,s)},null,8,["model-value","argument","instance","is-secret","onUpdate:modelValue"]))),128))])]),_:1}))}});function xi(e,t){const n={...e};for(const i in t){const o=t[i];o.schema.default&&n[i]===void 0&&(n[i]=He(o.schema.default))}return n}function Si(e,t){if(typeof e!="object"||e===null||t.type!=="object"||!t.properties)return e;const n={};for(const i in e){const o=t.properties[i],a=e[i];$i(a,o)||(n[i]=Si(a,o))}return n}function $i(e,t){const n=Nn.safeParse(e);if(n.success)return n.data.value.trim()==="";if(t.default!==void 0){if(e==null)return!0;const i=JSON.stringify(t.default),o=JSON.stringify(Si(e,t));if(i===o)return!0}return t.type==="boolean"?!1:Array.isArray(e)?e.length===0:typeof e=="object"?e===null||Object.keys(e).length===0:typeof e=="string"?e.trim()==="":typeof e=="number"?isNaN(e)||e===0:typeof e>"u"}function Ci(e,t){const n={};for(const i in e)t[i]&&($i(e[i],t[i].schema)||(n[i]=e[i]));return n}function ct(e,t,n,i,o){if(i.type==="boolean")return{name:e,title:t,description:n,kind:"checkbox",default:o??i.default??!1};if(i.type==="array"){if(typeof i.items!="object"||Array.isArray(i.items))return null;if(i.items?.type==="string"||i.items?.type==="number"||i.items?.type==="integer")return i.items.enum?{name:e,title:t,description:n,kind:"select",type:i.items.type,enum:i.items.enum,multiple:!0,default:o??i.default}:{name:e,title:t,description:n,kind:"combobox",type:i.items.type,default:o??i.default}}return i.type!=="string"&&i.type!=="number"&&i.type!=="integer"?null:i.enum?{name:e,title:t,description:n,kind:"select",type:i.type,enum:i.enum,multiple:!1,default:o??i.default}:{name:e,title:t,description:n,kind:"input",type:i.type,default:o??i.default}}function kl(e){return e.type!=="object"?!1:!!(e.additionalProperties&&Object.keys(e.additionalProperties).length>0||e.propertyNames&&Object.keys(e.propertyNames).length>0||e.patternProperties&&Object.keys(e.patternProperties).length>0)}function xl(e){const t=new Map;for(const n of e)if(!(n.type!=="object"||!n.properties))for(const[i,o]of Object.entries(n.properties)){if(typeof o!="object"||o.const===void 0)continue;const a=t.get(i)??0;t.set(i,a+1)}for(const[n,i]of t.entries()){if(!i||i<e.length)continue;const o=e[0].properties?.[n];if(o&&typeof o=="object"&&o.const!==void 0)return ct(n,o.title??Mt(n),o.description,o)}return null}function Ii(e,t){const n=[],i=[];for(const[o,a]of Object.entries(t)){if(a.schema.anyOf){const s=xl(a.schema.anyOf);if(s){const u={};for(const d of a.schema.anyOf){if(typeof d!="object"||!d.properties)continue;const c=d.properties[s.name].const?.toString();if(c===void 0)continue;const f=[];for(const[m,x]of Object.entries(d.properties)){if(typeof x!="object"||m===s.name)continue;const A=ct(m,x.title??Mt(m),x.description,x,d.default?.[m]);A&&f.push(A)}u[c]=f}Object.keys(u).length>0&&i.push({name:o,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"group",discriminator:s,fields:u,default:He(a.schema.default)});continue}}if(a.schema.type==="object"){if(a.schema.complex||kl(a.schema))_t(e,o,a.schema),i.push({name:o,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"structured",default:He(a.schema.default)});else{const s=[];for(const[u,d]of Object.entries(a.schema.properties??{})){if(typeof d!="object")continue;const l=ct(u,d.title??Mt(u),d.description,d,a.schema.default?.[u]);l&&s.push(l)}s.length>0&&i.push({name:o,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"group",discriminator:void 0,fields:{"":s},default:He(a.schema.default)})}continue}if(a.schema.type==="string"&&(a.schema.language||a.schema.multiline)){i.push({name:o,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"code",language:Fi().optional().safeParse(a.schema.language).data,default:a.schema.default});continue}const r=ct(o,a.meta.title,a.meta.description??a.schema.description,a.schema);if(r){n.push(r);continue}_t(e,o,a.schema),i.push({name:o,title:a.meta.title,description:a.meta.description??a.schema.description,kind:"structured",default:He(a.schema.default)})}return{plainArguments:n,expandableArguments:i}}const Sl="The name of the instance. It must be unique within the same type across the project.",$l=q({__name:"InstanceArgumentEditor",props:xe({instance:{},component:{},state:{},allInstances:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:xe(["save"],["update:modelValue"]),setup(e,{emit:t}){const n=Je(e,"modelValue"),i=Ee(e.instance.name),o=Dn(xi(e.instance.args??{},e.component.args)),a=async()=>{n.value=!1,await ft(),Object.assign(o,e.instance.args)},r=t,s=async()=>{const f=Ci(o,e.component.args);r("save",e.instance.id,i.value,f),await ft(),n.value=!1},u=[f=>!!f||"Name is required",f=>f===e.instance.name||!e.allInstances.has(Pi(e.instance.type,f))||"Instance with this name and type already exists",f=>{const m=Di.safeParse(f);return m.success||m.error.issues[0].message}],{plainArguments:d,expandableArguments:l}=Ii(e.component.type,e.component.args),c=Ee(!0);return(f,m)=>(y(),C(Ln,{modelValue:n.value,"onUpdate:modelValue":m[2]||(m[2]=x=>n.value=x),class:"dialog",fullscreen:""},{default:b(()=>[$(Ut,{variant:"flat",color:e.component.meta.color??"#2d2d2d",title:e.component.meta.title,subtitle:e.component.meta.description},{prepend:b(()=>[$(g(qt),{meta:e.component.meta},null,8,["meta"])]),default:b(()=>[$(Se),$(bt,{class:"d-flex flex-column pt-4 ga-4 dialog-scroll"},{default:b(()=>[$(_i,{modelValue:g(c),"onUpdate:modelValue":m[1]||(m[1]=x=>Nt(c)?c.value=x:null)},{default:b(()=>[$(Hn,{modelValue:g(i),"onUpdate:modelValue":m[0]||(m[0]=x=>Nt(i)?i.value=x:null),label:"Name",variant:"outlined",density:"compact",rules:u},null,8,["modelValue"]),$(Ke,{class:"mt-2",description:Sl})]),_:1},8,["modelValue"]),(y(!0),E(P,null,oe(g(d),x=>(y(),C(wt,{key:x.name,modelValue:g(o)[x.name],"onUpdate:modelValue":A=>g(o)[x.name]=A,argument:x,instance:e.instance},null,8,["modelValue","onUpdate:modelValue","argument","instance"]))),128)),g(l).length>0?(y(),C(Un,{key:0,elevation:0},{default:b(()=>[(y(!0),E(P,null,oe(g(l),x=>(y(),E(P,{key:x.name},[x.kind==="group"?(y(),C(ki,{key:0,modelValue:g(o)[x.name],"onUpdate:modelValue":A=>g(o)[x.name]=A,argument:x,instance:e.instance},null,8,["modelValue","onUpdate:modelValue","argument","instance"])):(y(),C(bi,{key:1,modelValue:g(o)[x.name],"onUpdate:modelValue":A=>g(o)[x.name]=A,argument:x,instance:e.instance},null,8,["modelValue","onUpdate:modelValue","argument","instance"]))],64))),128))]),_:1})):O("",!0)]),_:1}),$(Se),$(kt,{class:"d-flex py-0"},{default:b(()=>[$(qe),$(re,{onClick:a},{default:b(()=>[...m[3]||(m[3]=[U("Cancel",-1)])]),_:1}),$(re,{onClick:s,color:"primary",disabled:!g(c)},{default:b(()=>[...m[4]||(m[4]=[U("Save",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1},8,["color","title","subtitle"])]),_:1},8,["modelValue"]))}}),Cl=te($l,[["__scopeId","data-v-9e94e3ac"]]),Il=q({__name:"InstanceSecretEditor",props:xe({instance:{},state:{},component:{},initialSecrets:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:xe(["save"],["update:modelValue"]),setup(e,{emit:t}){const n=Je(e,"modelValue"),i=Dn(xi(e.initialSecrets,e.component.secrets)),o=t,a=async()=>{n.value=!1,await ft(),Object.assign(i,e.initialSecrets)},r=async()=>{const d=Ci(i,e.component.secrets);e.state&&o("save",e.state.id,d),await ft(),n.value=!1},{plainArguments:s,expandableArguments:u}=Ii(e.component.type,e.component.secrets);return(d,l)=>(y(),C(Ln,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=c=>n.value=c),class:"dialog"},{default:b(()=>[$(Ut,{variant:"flat",color:e.component.meta.color??"#2d2d2d",title:e.component.meta.title,subtitle:e.component.meta.description},{prepend:b(()=>[$(g(qt),{meta:e.component.meta},null,8,["meta"])]),default:b(()=>[$(Se),$(bt,{class:"d-flex flex-column pt-4 ga-4",style:{"max-height":"60vh",overflow:"scroll"}},{default:b(()=>[(y(!0),E(P,null,oe(g(s),c=>(y(),C(wt,{key:c.name,modelValue:g(i)[c.name],"onUpdate:modelValue":f=>g(i)[c.name]=f,argument:c,instance:e.instance,"is-secret":""},null,8,["modelValue","onUpdate:modelValue","argument","instance"]))),128)),g(u).length>0?(y(),C(Un,{key:0,elevation:0},{default:b(()=>[(y(!0),E(P,null,oe(g(u),c=>(y(),E(P,{key:c.name},[c.kind==="group"?(y(),C(ki,{key:0,argument:c,instance:e.instance,modelValue:g(i)[c.name],"onUpdate:modelValue":f=>g(i)[c.name]=f,"is-secret":""},null,8,["argument","instance","modelValue","onUpdate:modelValue"])):(y(),C(bi,{key:1,modelValue:g(i)[c.name],"onUpdate:modelValue":f=>g(i)[c.name]=f,argument:c,instance:e.instance},null,8,["modelValue","onUpdate:modelValue","argument","instance"]))],64))),128))]),_:1})):O("",!0)]),_:1}),$(Se),$(kt,{class:"d-flex py-0"},{default:b(()=>[$(qe),$(re,{onClick:a},{default:b(()=>[...l[1]||(l[1]=[U("Cancel",-1)])]),_:1}),$(re,{onClick:r,color:"primary"},{default:b(()=>[...l[2]||(l[2]=[U("Save",-1)])]),_:1})]),_:1})]),_:1},8,["color","title","subtitle"])]),_:1},8,["modelValue"]))}}),Vl=te(Il,[["__scopeId","data-v-9b4053a7"]]);function Al(e,t){return Array.isArray(e)?e.length===0?"[]":"[...]":typeof e=="object"?"{...}":typeof e=="string"&&t.language?"...":String(e)}const Ml={class:"d-flex text-disabled text-start text-no-wrap"},Nl={key:0,class:"d-flex ml-auto text-error"},El={key:1,class:"d-flex ml-auto text-truncate pl-4"},Rl=q({__name:"InstanceNodeArgumentList",props:{instance:{},component:{}},setup(e){const t=M(()=>{const n=[];for(const[i,o]of Object.entries(e.component.args))!o.required&&(e.instance.args?.[i]==null||e.instance.args?.[i]===o.schema.default)||n.push({name:o.meta.title,value:Al(e.instance.args?.[i],o.schema),requiredAndNotSet:o.required&&e.instance.args?.[i]==null});return n});return(n,i)=>g(t).length>0?(y(),E(P,{key:0},[$(Se),$(bt,{class:"d-flex flex-column gap-2 px-2 py-2"},{default:b(()=>[(y(!0),E(P,null,oe(g(t),({name:o,value:a,requiredAndNotSet:r})=>(y(),E("div",{key:o,class:"d-flex flex-row"},[j("div",Ml,ee(o),1),r?(y(),E("div",Nl,"not set")):(y(),E("div",El,ee(a),1))]))),128))]),_:1})],64)):O("",!0)}}),Ol=q({__name:"InstanceStatusFieldItem",props:{item:{}},setup(e){return(t,n)=>(y(),C(eo,{title:e.item},{append:b(()=>[$(g(Yn),{content:e.item},null,8,["content"])]),_:1},8,["title"]))}}),zl={class:"d-flex flex-row"},Tl={class:"d-flex text-disabled text-start text-no-wrap text-secondary"},Bl=["title"],Hl=q({__name:"InstanceStatusField",props:{statusField:{}},setup(e){const t=M(()=>Array.isArray(e.statusField.value)?e.statusField.value.join(", "):String(e.statusField.value)),n=M(()=>Array.isArray(e.statusField.value)?e.statusField.value.length===0?"[]":e.statusField.value.length===1?e.statusField.value[0]:`${e.statusField.value.length} items`:String(e.statusField.value)),i=M(()=>Array.isArray(e.statusField.value)?e.statusField.value.length>1:!1);return(o,a)=>(y(),E("div",zl,[j("div",Tl,[e.statusField.meta.icon?(y(),C(g(En),{key:0,icon:e.statusField.meta.icon,color:e.statusField.meta.iconColor,width:16,class:"mr-1"},null,8,["icon","color"])):O("",!0),U(" "+ee(e.statusField.meta.title),1)]),$(to,{"open-on-hover":"","close-on-content-click":!1,location:"end",disabled:!g(i)},{activator:b(({props:r})=>[j("div",Ue(r,{class:"d-flex ml-auto text-truncate pl-4",title:g(i)?"":g(t)}),[j("span",{class:ke(["text-truncate",{underline:g(i)}])},ee(g(n)),3)],16,Bl)]),default:b(()=>[$(no,{density:"compact",variant:"text"},{default:b(()=>[(y(!0),E(P,null,oe(e.statusField.value,(r,s)=>(y(),C(Ol,{key:s,item:r},null,8,["item"]))),128))]),_:1})]),_:1},8,["disabled"]),$(g(Yn),{content:g(t)},null,8,["content"])]))}}),Fl=te(Hl,[["__scopeId","data-v-d5d4ae75"]]),Pl=q({__name:"InstanceStatusFieldList",props:{instance:{},state:{}},setup(e){const t=M(()=>e.state.statusFields?.filter(n=>n.value===void 0?!1:n.complementaryTo?!e.instance.args?.[n.complementaryTo]||JSON.stringify(e.instance.args[n.complementaryTo])!==JSON.stringify(n.value):!0)??[]);return(n,i)=>g(t).length>0?(y(),E(P,{key:0},[$(Se),$(bt,{class:"d-flex flex-column gap-2 px-2 py-2"},{default:b(()=>[(y(!0),E(P,null,oe(g(t),o=>(y(),C(Fl,{key:o.name,"status-field":o},null,8,["status-field"]))),128))]),_:1})],64)):O("",!0)}}),Dl=q({__name:"InstanceNodeActions",props:{component:{},state:{},locked:{type:Boolean},editable:{type:Boolean},hideShowComposite:{type:Boolean},loadingSecrets:{type:Boolean},loadingTerminal:{type:Boolean},loadingPage:{type:Boolean},ghost:{type:Boolean,default:!1}},emits:["open:args","open:secrets","open:terminal","open:page","open:composite","operation:launch","operation:cancel"],setup(e,{emit:t}){const n=M(()=>Rn(e.component)&&Object.keys(e.component.secrets).length>0),i=M(()=>Li(e.state?.lastOperationState?.status)),o=M(()=>e.state?.evaluationState&&e.state.evaluationState.status==="evaluating"),a=M(()=>e.state&&(o.value||e.state.lastOperationState?.status==="pending"||e.state.lastOperationState?.totalResourceCount===0||e.state.lastOperationState?.currentResourceCount===0||e.state.lastOperationState?.currentResourceCount===e.state.lastOperationState?.totalResourceCount)),r=M(()=>{if(!e.state?.lastOperationState)return 0;const{currentResourceCount:c,totalResourceCount:f}=e.state.lastOperationState;return c&&f?c/f*100:0}),s=M(()=>e.state?.terminalIds&&e.state.terminalIds.length>0),u=M(()=>e.state?.pageIds&&e.state.pageIds.length>0),d=M(()=>e.state?.lastOperationState?.status==="pending"?"":e.state?.lastOperationState?.status==="destroying"?"error":"primary"),l=t;return(c,f)=>(y(),C(kt,{class:"py-0 h-auto"},{default:b(()=>[Q(c.$slots,"status",{},()=>[$(Xe,{color:""},{default:b(()=>[$(g(so),{size:20,icon:"mdi-circle-outline"})]),_:1})],!0),$(qe),!e.ghost&&!g(Ui)(e.state)&&!g(i)?(y(),C(re,{key:0,size:"small",variant:"tonal",class:"toolbar-button",title:"Create",disabled:e.locked,onClick:f[0]||(f[0]=m=>l("operation:launch","update"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[8]||(f[8]=[U("mdi-rocket-launch",-1)])]),_:1})]),_:1},8,["disabled"])):!e.ghost&&!g(i)?(y(),C(re,{key:1,size:"small",variant:"tonal",class:"toolbar-button",title:"Update",disabled:e.locked,onClick:f[1]||(f[1]=m=>l("operation:launch","update"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[9]||(f[9]=[U("mdi-play",-1)])]),_:1})]),_:1},8,["disabled"])):O("",!0),g(i)?(y(),C(re,{key:2,size:"small",variant:"tonal",color:"error",class:"toolbar-button",title:"Cancel Operation",onClick:f[2]||(f[2]=m=>l("operation:cancel"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[10]||(f[10]=[U("mdi-cancel",-1)])]),_:1})]),_:1})):O("",!0),e.editable&&!e.ghost&&!g(i)?(y(),C(re,{key:3,size:"small",variant:"tonal",class:"toolbar-button",title:"Edit Arguments",locked:e.locked,onClick:f[3]||(f[3]=m=>l("open:args"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[11]||(f[11]=[U("mdi-pencil",-1)])]),_:1})]),_:1},8,["locked"])):O("",!0),e.editable&&!e.ghost&&!g(i)&&g(n)?(y(),C(re,{key:4,size:"small",variant:"tonal",class:"toolbar-button",loading:e.loadingSecrets,locked:e.locked,title:"Edit Secrets",onClick:f[4]||(f[4]=m=>l("open:secrets"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[12]||(f[12]=[U("mdi-key",-1)])]),_:1})]),_:1},8,["loading","locked"])):O("",!0),!e.ghost&&g(s)?(y(),C(re,{key:5,size:"small",variant:"tonal",class:"toolbar-button",loading:e.loadingTerminal,title:"Open Terminal",onClick:f[5]||(f[5]=m=>l("open:terminal"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[13]||(f[13]=[U("mdi-console",-1)])]),_:1})]),_:1},8,["loading"])):O("",!0),!e.ghost&&g(u)?(y(),C(re,{key:6,size:"small",variant:"tonal",class:"toolbar-button",title:"Open Page",loading:e.loadingPage,onClick:f[6]||(f[6]=m=>l("open:page"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[14]||(f[14]=[U("mdi-file-document",-1)])]),_:1})]),_:1},8,["loading"])):O("",!0),!e.ghost&&e.component.kind==="composite"&&!e.hideShowComposite?(y(),C(re,{key:7,size:"small",variant:"tonal",class:"toolbar-button",title:"Show Structure",onClick:f[7]||(f[7]=m=>l("open:composite"))},{default:b(()=>[$(Z,null,{default:b(()=>[...f[15]||(f[15]=[U("mdi-cube-outline",-1)])]),_:1})]),_:1})):O("",!0),g(o)||g(i)?(y(),C(io,{key:8,size:"small",color:g(d),indeterminate:g(a),"model-value":g(r),absolute:"",location:"bottom"},null,8,["color","indeterminate","model-value"])):O("",!0)]),_:3}))}}),Ll=te(Dl,[["__scopeId","data-v-fac542c3"]]),Ul={key:0,class:"text-h6"},ql={key:1},Xl=q({__name:"InstanceNodeLockBadge",props:{instanceLock:{}},setup(e){return(t,n)=>(y(),C(qn,{disabled:!e.instanceLock.meta.title&&!e.instanceLock.meta.description},{activator:b(({props:i})=>[$(Xe,Me(Fe(i)),{default:b(()=>[$(Z,null,{default:b(()=>[...n[0]||(n[0]=[U("mdi-lock",-1)])]),_:1}),e.instanceLock.meta.icon?(y(),C(g(En),{key:0,class:"ml-1",icon:e.instanceLock.meta.icon,width:18,color:e.instanceLock.meta.iconColor},null,8,["icon","color"])):O("",!0)]),_:1},16)]),default:b(()=>[e.instanceLock.meta.title?(y(),E("div",Ul,ee(e.instanceLock.meta.title),1)):O("",!0),e.instanceLock.meta.description?(y(),E("div",ql,ee(e.instanceLock.meta.description),1)):O("",!0)]),_:1},8,["disabled"]))}}),Yl=q({__name:"InstanceNodeIOSideHandle",props:{name:{},side:{},handleColor:{},isValidConnection:{type:Function}},setup(e){return(t,n)=>(y(),E(P,null,[$(g(Vn),{id:e.name,type:e.side==="left"?"target":"source",position:e.side==="left"?g(dt).Left:g(dt).Right,class:ke(["handle",[e.side==="left"?"left-handle":"right-handle"]]),"is-valid-connection":e.isValidConnection},null,8,["id","type","position","class","is-valid-connection"]),j("div",{class:ke(["handle-dot",[e.side==="left"?"handle-dot-left":"handle-dot-right"]]),style:ve({backgroundColor:e.handleColor})},null,6)],64))}}),$n=te(Yl,[["__scopeId","data-v-ae6b4385"]]);function Gl(e){const t=e.replace("#",""),n=parseInt(t.substring(0,2),16),i=parseInt(t.substring(2,2),16),o=parseInt(t.substring(4,2),16);return(n*299+i*587+o*114)/1e3>=128?"#000":"#fff"}const Wl={ref:"column",class:"d-flex flex-column gr-2 column"},jl=q({__name:"InstanceNodeIOSide",props:{instance:{},component:{},entities:{},type:{},side:{},isValidConnection:{type:Function},resolvedInputs:{},resolvedInjectionInput:{},usedOutputs:{},forceShowAllHandles:{type:Boolean},preventShowAllHandles:{type:Boolean}},setup(e){const t=(l,c)=>{const f=e.component[l][c];return e.entities[f.type]?.meta.color??"#607D8B"},n=(l,c)=>Gl(t(l,c)),i=l=>{const c=e.instance.inputs&&!!e.instance.inputs[l]&&e.instance.inputs[l].length>0,f=e.instance.hubInputs&&!!e.instance.hubInputs[l]&&e.instance.hubInputs[l].length>0;return c||f},o=l=>e.component.inputs[l].required?!e.resolvedInputs?.[l]?.length:!1,a=Xn("column"),{isOutside:r}=qi(a),s=M(()=>e.forceShowAllHandles||!r.value&&!e.preventShowAllHandles),u=M(()=>e.resolvedInjectionInput?e.resolvedInjectionInput.length===1?"1 input":`${e.resolvedInjectionInput.length} inputs`:"no inputs"),d=M(()=>e.instance.injectionInputs&&e.instance.injectionInputs.length>0);return(l,c)=>(y(),E("div",Wl,[e.type==="inputs"&&e.side==="left"&&Object.keys(e.component.inputs).length>0&&(g(d)||g(s))?(y(),C(Xe,{key:0,style:{backgroundColor:"#3F51B5",color:"white"},"text-color":"white",class:"rounded handle-chip"},{default:b(()=>[$(Z,{class:"mr-1",style:{"margin-left":"-2px"}},{default:b(()=>[...c[0]||(c[0]=[U("mdi-router",-1)])]),_:1}),U(" "+ee(g(u))+" ",1),$($n,{name:"",side:e.side,"is-valid-connection":e.isValidConnection,"handle-color":"#3F51B5"},null,8,["side","is-valid-connection"])]),_:1})):O("",!0),(y(!0),E(P,null,oe(e.component[e.type],(f,m)=>(y(),E(P,{key:m},[e.side==="right"&&e.type==="inputs"||e.type==="outputs"&&(!e.usedOutputs||e.usedOutputs.has(m))||e.type==="inputs"&&(i(m)||o(m))||g(s)?(y(),C(Xe,{key:0,style:ve({backgroundColor:t(e.type,m),color:n(e.type,m)}),"text-color":"white",class:"rounded handle-chip"},{default:b(()=>[U(ee(f.meta.title)+" ",1),$($n,{name:m,side:e.side,"is-valid-connection":e.isValidConnection,"handle-color":t(e.type,m)},null,8,["name","side","is-valid-connection","handle-color"])]),_:2},1032,["style"])):O("",!0)],64))),128))],512))}}),ot=te(jl,[["__scopeId","data-v-c3646ddb"]]),Kl=q({__name:"InstanceNodeIO",props:{instance:{},component:{},entities:{},type:{default:"both"},mirror:{type:Boolean},isValidConnection:{type:Function},usedOutputs:{},resolvedInputs:{},resolvedInjectionInput:{},forceShowAllHandles:{type:Boolean},preventShowAllHandles:{type:Boolean}},setup(e){return(t,n)=>(y(),C(kt,{class:"align-start align-stretch component-node-io"},{default:b(()=>[e.mirror?(y(),E(P,{key:1},[e.type==="both"||e.type==="outputs"?(y(),C(ot,{key:0,instance:e.instance,component:e.component,entities:e.entities,"is-valid-connection":e.isValidConnection,type:"outputs","used-outputs":e.usedOutputs,side:"left","force-show-all-handles":e.forceShowAllHandles,"prevent-show-all-handles":e.preventShowAllHandles},null,8,["instance","component","entities","is-valid-connection","used-outputs","force-show-all-handles","prevent-show-all-handles"])):O("",!0),$(qe),e.type==="both"||e.type==="inputs"?(y(),C(ot,{key:1,instance:e.instance,component:e.component,entities:e.entities,"is-valid-connection":e.isValidConnection,type:"inputs",side:"right","resolved-inputs":e.resolvedInputs,"force-show-all-handles":e.forceShowAllHandles,"prevent-show-all-handles":e.preventShowAllHandles},null,8,["instance","component","entities","is-valid-connection","resolved-inputs","force-show-all-handles","prevent-show-all-handles"])):O("",!0)],64)):(y(),E(P,{key:0},[e.type==="both"||e.type==="inputs"?(y(),C(ot,{key:0,instance:e.instance,component:e.component,entities:e.entities,"is-valid-connection":e.isValidConnection,type:"inputs","resolved-inputs":e.resolvedInputs,"resolved-injection-input":e.resolvedInjectionInput,"force-show-all-handles":e.forceShowAllHandles,"prevent-show-all-handles":e.preventShowAllHandles,side:"left"},null,8,["instance","component","entities","is-valid-connection","resolved-inputs","resolved-injection-input","force-show-all-handles","prevent-show-all-handles"])):O("",!0),$(qe),e.type==="both"||e.type==="outputs"?(y(),C(ot,{key:1,instance:e.instance,component:e.component,entities:e.entities,"is-valid-connection":e.isValidConnection,type:"outputs","used-outputs":e.usedOutputs,side:"right","force-show-all-handles":e.forceShowAllHandles,"prevent-show-all-handles":e.preventShowAllHandles},null,8,["instance","component","entities","is-valid-connection","used-outputs","force-show-all-handles","prevent-show-all-handles"])):O("",!0)],64))]),_:1}))}}),Jl=te(Kl,[["__scopeId","data-v-917ac605"]]),Zl={class:"instance-node__badges"},Ql=q({__name:"InstanceNode",props:xe({instance:{},component:{},entities:{},inputResolverOutputs:{},inputResolverDependentMap:{},allInstances:{default:()=>new Map},state:{},instanceLock:{},loadingSecrets:{type:Boolean},loadingTerminal:{type:Boolean},loadingPage:{type:Boolean},initialSecrets:{},editable:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},ioType:{default:"both"},ioMirror:{type:Boolean},hideShowComposite:{type:Boolean},isValidConnection:{type:Function}},{editingSecrets:{type:Boolean,default:!1},editingSecretsModifiers:{}}),emits:xe(["open:secrets","open:terminal","open:page","open:composite","operation:launch","operation:cancel","save:args","save:secrets","contextmenu"],["update:editingSecrets"]),setup(e,{emit:t}){const n=t,i=Je(e,"editingSecrets"),o=Ee(!1),a=M(()=>Object.keys(e.component.inputs).length>0),r=M(()=>Object.keys(e.component.outputs).length>0),s=M(()=>a.value||r.value),u=M(()=>Cn(e.inputResolverOutputs,e.instance.id)),d=M(()=>In(e.inputResolverOutputs,e.instance.id).map(H=>H.input)),l=M(()=>{const H=en(e.inputResolverOutputs,e.instance.id)??{},N=Object.values(H).flat(),R=new Set,F=e.inputResolverDependentMap.get(`instance:${e.instance.id}`)??[],B=Y=>{(Y.instanceId===e.instance.id||N.some(K=>K.instanceId===Y.instanceId))&&R.add(Y.output)};for(const Y of F){const K=e.inputResolverOutputs.get(Y);if(K)if(K.kind==="instance")for(const L of Object.values(K.instance.inputs??{}))for(const ye of L)B(ye);else for(const L of Object.values(K.hub.inputs??{}))B(L)}if(e.instance.parentId){const Y=en(e.inputResolverOutputs,e.instance.parentId)??{};for(const K of Object.values(Y).flat())K.instanceId===e.instance.id&&R.add(K.output)}return R});Pn(l,H=>{H.size!==0&&c.updateNodeInternals([m.node.id])});const{vueFlowStore:c,selection:f}=Lt(),m=An(),x=M(()=>Mn(m.node,c)),A=M(()=>c.connectionStartHandle.value?.nodeId===m.node.id),z=Xn("componentCard"),I=M(()=>c.viewport.value.zoom<.5),D=M(()=>z.value?Math.min(z.value.$el.clientWidth,z.value.$el.clientHeight)*.7:0);return(H,N)=>(y(),E(P,null,[$(g(ro),{class:ke({"instance-card--ghost":e.ghost}),component:e.component,subtitle:e.instance.name,"blueprint-status":x.value,selected:g(f).isNodeSelected(g(m).node),style:{overflow:"visible"},onContextmenu:N[11]||(N[11]=R=>n("contextmenu",R)),ref:"componentCard"},{append:b(()=>[j("div",Zl,[e.ghost?(y(),C(qn,{key:0,location:"top"},{activator:b(({props:R})=>[$(Xe,Ue(R,{class:"instance-node__ghost-chip",color:"primary"}),{default:b(()=>[$(Z,{size:"16"},{default:b(()=>[...N[13]||(N[13]=[U("mdi-ghost",-1)])]),_:1})]),_:1},16)]),default:b(()=>[N[14]||(N[14]=j("span",null," This instance is a ghost. It is no longer a part of the project, but Highstate still tracks it. ",-1))]),_:1})):O("",!0),e.instanceLock?(y(),C(Xl,{key:1,"instance-lock":e.instanceLock},null,8,["instance-lock"])):O("",!0)])]),default:b(()=>[Q(H.$slots,"default",{},void 0,!0),g(o)?(y(),C(g(Cl),{key:0,modelValue:g(o),"onUpdate:modelValue":N[0]||(N[0]=R=>Nt(o)?o.value=R:null),instance:e.instance,component:e.component,state:e.state,"all-instances":e.allInstances,onSave:N[1]||(N[1]=(R,F,B)=>n("save:args",R,F,B))},null,8,["modelValue","instance","component","state","all-instances"])):O("",!0),g(Rn)(e.component)&&i.value?(y(),C(g(Vl),{key:1,modelValue:i.value,"onUpdate:modelValue":N[2]||(N[2]=R=>i.value=R),instance:e.instance,state:e.state,component:e.component,"initial-secrets":e.initialSecrets??{},onSave:N[3]||(N[3]=(R,F)=>n("save:secrets",R,F))},null,8,["modelValue","instance","state","component","initial-secrets"])):O("",!0),$(Rl,{instance:e.instance,component:e.component},null,8,["instance","component"]),s.value?(y(),E(P,{key:2},[$(Se),$(Jl,{component:e.component,instance:e.instance,entities:e.entities,"is-valid-connection":e.isValidConnection,type:e.ioType,mirror:e.ioMirror,"used-outputs":l.value,"resolved-inputs":u.value,"resolved-injection-input":d.value,"force-show-all-handles":A.value,"prevent-show-all-handles":g(o)||i.value||!e.editable||I.value},null,8,["component","instance","entities","is-valid-connection","type","mirror","used-outputs","resolved-inputs","resolved-injection-input","force-show-all-handles","prevent-show-all-handles"])],64)):O("",!0),e.state?(y(),C(Pl,{key:3,instance:e.instance,state:e.state},null,8,["instance","state"])):O("",!0),$(Se),$(Ll,{"loading-secrets":e.loadingSecrets,"loading-terminal":e.loadingTerminal,"loading-page":e.loadingPage,instance:e.instance,component:e.component,state:e.state,locked:!!e.instanceLock,editable:e.editable,ghost:e.ghost,"hide-show-composite":e.hideShowComposite,"onOpen:args":N[4]||(N[4]=R=>o.value=!0),"onOpen:secrets":N[5]||(N[5]=R=>e.state?n("open:secrets"):i.value=!0),"onOpen:terminal":N[6]||(N[6]=R=>n("open:terminal")),"onOpen:page":N[7]||(N[7]=R=>n("open:page")),"onOpen:composite":N[8]||(N[8]=R=>n("open:composite")),"onOperation:launch":N[9]||(N[9]=R=>n("operation:launch",R)),"onOperation:cancel":N[10]||(N[10]=R=>n("operation:cancel"))},{status:b(()=>[Q(H.$slots,"status",{},void 0,!0)]),_:3},8,["loading-secrets","loading-terminal","loading-page","instance","component","state","locked","editable","ghost","hide-show-composite"])]),_:3},8,["class","component","subtitle","blueprint-status","selected"]),$(oo,{modelValue:I.value,"onUpdate:modelValue":N[12]||(N[12]=R=>I.value=R),scrim:"#1e1e1e",opacity:1,absolute:"",class:"align-center justify-center",style:ve(`border: 3px solid ${e.component.meta.iconColor??"#3f51b5"}; border-radius: 8px`),contained:""},{default:b(()=>[$(g(qt),{meta:e.component.meta,size:D.value},null,8,["meta","size"])]),_:1},8,["modelValue","style"])],64))}}),su=te(Ql,[["__scopeId","data-v-295e709c"]]);export{ru as G,au as H,su as I,yo as _,Jl as a};
|