writer 1.25.0__py3-none-any.whl → 1.25.0rc1__py3-none-any.whl

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.
Files changed (57) hide show
  1. writer/ai/__init__.py +1 -4
  2. writer/static/assets/BaseMarkdown-FwGt2vSH.js +1 -0
  3. writer/static/assets/{BlueprintToolbar-CSKyGsgb.js → BlueprintToolbar-BMXwGb2u.js} +1 -1
  4. writer/static/assets/{BuilderApp-CXGhU9Dc.js → BuilderApp-Bc8bFIhZ.js} +3 -3
  5. writer/static/assets/{BuilderApplicationSelect-D4YCpoaq.js → BuilderApplicationSelect-BywbYEbV.js} +2 -2
  6. writer/static/assets/{BuilderBlueprintLibraryPanel-Bviy4WUX.js → BuilderBlueprintLibraryPanel-S0VfwhtM.js} +1 -1
  7. writer/static/assets/{BuilderEmbeddedCodeEditor-eTd4Hh29.js → BuilderEmbeddedCodeEditor-D2_cZcVV.js} +6 -6
  8. writer/static/assets/{BuilderGraphSelect-BSVTkG-Q.js → BuilderGraphSelect-B1Db2C-E.js} +2 -2
  9. writer/static/assets/{BuilderInsertionLabel-BQTfooyn.js → BuilderInsertionLabel-C0tezdX8.js} +1 -1
  10. writer/static/assets/{BuilderInsertionOverlay-CirmjKch.js → BuilderInsertionOverlay-CpSJ_I0n.js} +1 -1
  11. writer/static/assets/{BuilderJournal-Do4CUC4U.js → BuilderJournal-1g17w1GH.js} +2 -2
  12. writer/static/assets/{BuilderModelSelect-CDg6LxWs.js → BuilderModelSelect-DrR5Rglv.js} +2 -2
  13. writer/static/assets/{BuilderSettings-D96bVVVm.js → BuilderSettings-X4fk1HYG.js} +5 -5
  14. writer/static/assets/{BuilderSettingsArtifactAPITriggerDetails-2hONOdPT.js → BuilderSettingsArtifactAPITriggerDetails-Dw1Ri3jn.js} +1 -1
  15. writer/static/assets/{BuilderSettingsDeploySharedBlueprint-Ct5FVU3z.js → BuilderSettingsDeploySharedBlueprint-CCOpcUFl.js} +1 -1
  16. writer/static/assets/{BuilderSettingsHandlers-wr4bqW4s.js → BuilderSettingsHandlers-BgYJCyal.js} +1 -1
  17. writer/static/assets/{BuilderSidebarComponentTree-XfwZ-TqP.js → BuilderSidebarComponentTree-DkH5bpJF.js} +1 -1
  18. writer/static/assets/{BuilderSidebarToolkit-BAq285RS.js → BuilderSidebarToolkit-CSTGjrbD.js} +2 -2
  19. writer/static/assets/{BuilderTemplateEditor-DOyCVTe3.js → BuilderTemplateEditor-BVQ9oKC3.js} +1 -1
  20. writer/static/assets/{BuilderVault-7la3LjZT.js → BuilderVault-B4aITu1c.js} +1 -1
  21. writer/static/assets/{ComponentRenderer-DRTUw3PP.js → ComponentRenderer-BgoKk-_d.js} +1 -1
  22. writer/static/assets/{SharedCopyClipboardButton-BAhxC5LU.js → SharedCopyClipboardButton-CXfaup9Y.js} +1 -1
  23. writer/static/assets/{WdsCheckbox-Bi_HXvVT.js → WdsCheckbox-COE3JsDI.js} +1 -1
  24. writer/static/assets/{WdsDropdownMenu-BPKaOD8s.js → WdsDropdownMenu-vcOuT7Hf.js} +1 -1
  25. writer/static/assets/{WdsFieldWrapper-CwqGDrlP.js → WdsFieldWrapper-CH9Jr2FR.js} +1 -1
  26. writer/static/assets/{WdsTabs-q0kVCXxi.js → WdsTabs-DgEkeI3u.js} +1 -1
  27. writer/static/assets/{cssMode-BFJ2uFDF.js → cssMode-CIIcCccL.js} +1 -1
  28. writer/static/assets/{freemarker2-DrweqdQ1.js → freemarker2-CX6rQp7v.js} +1 -1
  29. writer/static/assets/{handlebars-d2aT2S4T.js → handlebars-BILn7ZdU.js} +1 -1
  30. writer/static/assets/{html-DkR8jQS-.js → html-BE45IdHd.js} +1 -1
  31. writer/static/assets/{htmlMode-ChyeBcvP.js → htmlMode--15KzHI6.js} +1 -1
  32. writer/static/assets/{index-uhDDPaD2.js → index-CzJKxzXJ.js} +1 -1
  33. writer/static/assets/{index-DHZHZi5W.js → index-DVo1rFbH.js} +1 -1
  34. writer/static/assets/{index-Bj5EqtwJ.js → index-tflVuual.js} +12 -12
  35. writer/static/assets/{javascript-DtI3gL80.js → javascript-CjpEwYUU.js} +1 -1
  36. writer/static/assets/{jsonMode-B9CbMObz.js → jsonMode-Cxnzu5mt.js} +1 -1
  37. writer/static/assets/{liquid-D620qh4W.js → liquid-DZXffNps.js} +1 -1
  38. writer/static/assets/{mapbox-gl-IM8CBmd8.js → mapbox-gl-CIiXHAHs.js} +1 -1
  39. writer/static/assets/{mdx-CrO1Zrq5.js → mdx-4PVV3Q81.js} +1 -1
  40. writer/static/assets/{pdf-5wahDYbm.js → pdf-UGfOV19v.js} +1 -1
  41. writer/static/assets/{plotly.min-DmBAN9XQ.js → plotly.min-C53ew1kV.js} +1 -1
  42. writer/static/assets/{python-BwZnPvHK.js → python-oNRBgtKZ.js} +1 -1
  43. writer/static/assets/{razor-DIsRzgu4.js → razor-DZZhL_i1.js} +1 -1
  44. writer/static/assets/{tsMode-CG0rBgC9.js → tsMode-Bqbt_v_d.js} +1 -1
  45. writer/static/assets/{typescript-BBvXo7TF.js → typescript-DppMnPAt.js} +1 -1
  46. writer/static/assets/{useBlueprintRun-DQUAcK67.js → useBlueprintRun-BD33TyWf.js} +1 -1
  47. writer/static/assets/{useKeyValueEditor-vhhDzyE2.js → useKeyValueEditor-5TP3lm3C.js} +1 -1
  48. writer/static/assets/{useListResources-DGx8U65A.js → useListResources-BzIfongE.js} +1 -1
  49. writer/static/assets/{xml-nERONKOk.js → xml-B_oO3GDq.js} +1 -1
  50. writer/static/assets/{yaml-B9E-sHku.js → yaml-COzNYEy2.js} +1 -1
  51. writer/static/index.html +1 -1
  52. {writer-1.25.0.dist-info → writer-1.25.0rc1.dist-info}/METADATA +1 -1
  53. {writer-1.25.0.dist-info → writer-1.25.0rc1.dist-info}/RECORD +56 -56
  54. writer/static/assets/BaseMarkdown-CsWzSrDd.js +0 -1
  55. {writer-1.25.0.dist-info → writer-1.25.0rc1.dist-info}/WHEEL +0 -0
  56. {writer-1.25.0.dist-info → writer-1.25.0rc1.dist-info}/entry_points.txt +0 -0
  57. {writer-1.25.0.dist-info → writer-1.25.0rc1.dist-info}/licenses/LICENSE.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  function __vite__mapDeps(indexes) {
2
2
  if (!__vite__mapDeps.viteFileDeps) {
3
- __vite__mapDeps.viteFileDeps = ["./index-5u5REPT4.js","./serialization-DJC7NP0N.js","./Arrow.dom-GBJpMYQS.js","./SharedCopyClipboardButton-BAhxC5LU.js","./WdsDropdownMenu-BPKaOD8s.js","./WdsCheckbox-Bi_HXvVT.js","./WdsCheckbox-DKvpPA4D.css","./WdsDropdownMenu-CzzPN9Wg.css","./SharedCopyClipboardButton-BipJKGtz.css","./index-uhDDPaD2.js","./pdf-5wahDYbm.js","./BlueprintToolbar-CSKyGsgb.js","./useBlueprintRun-DQUAcK67.js","./BlueprintToolbar-wpfX0jo_.css","./BuilderSettingsDeploySharedBlueprint-Ct5FVU3z.js","./WdsFieldWrapper-CwqGDrlP.js","./WdsFieldWrapper-CsemOh8D.css","./BuilderSettingsDeploySharedBlueprint-KJTl8gxP.css","./ComponentRenderer-DRTUw3PP.js","./ComponentRenderer-72hqvEvI.css","./BuilderApp-CXGhU9Dc.js","./marked.esm-273vDTCT.js","./BuilderApp-WimUfNZr.css"]
3
+ __vite__mapDeps.viteFileDeps = ["./index-5u5REPT4.js","./serialization-DJC7NP0N.js","./Arrow.dom-GBJpMYQS.js","./SharedCopyClipboardButton-CXfaup9Y.js","./WdsDropdownMenu-vcOuT7Hf.js","./WdsCheckbox-COE3JsDI.js","./WdsCheckbox-DKvpPA4D.css","./WdsDropdownMenu-CzzPN9Wg.css","./SharedCopyClipboardButton-BipJKGtz.css","./index-CzJKxzXJ.js","./pdf-UGfOV19v.js","./BlueprintToolbar-BMXwGb2u.js","./useBlueprintRun-BD33TyWf.js","./BlueprintToolbar-wpfX0jo_.css","./BuilderSettingsDeploySharedBlueprint-CCOpcUFl.js","./WdsFieldWrapper-CH9Jr2FR.js","./WdsFieldWrapper-CsemOh8D.css","./BuilderSettingsDeploySharedBlueprint-KJTl8gxP.css","./ComponentRenderer-BgoKk-_d.js","./ComponentRenderer-72hqvEvI.css","./BuilderApp-Bc8bFIhZ.js","./marked.esm-273vDTCT.js","./BuilderApp-WimUfNZr.css"]
4
4
  }
5
5
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
6
6
  }
@@ -8162,13 +8162,13 @@ if is_ok:
8162
8162
  state["msg"] = "+It worked!"
8163
8163
  else:
8164
8164
  state["msg"] = "-It failed"
8165
- \`\`\``)};typeof om=="function"&&om(_g);const xae=ke(_g,[["__scopeId","data-v-5eb22d34"]]),Cae={key:0,class:"name"},Aae={key:1,class:"description"},Sae={class:"value"},$ae={key:2,class:"note"},Eae="A component that prominently displays a metric value and associated information.",Iae={writer:{name:"Metric",description:Eae,category:"Content",fields:{name:{name:"Name",init:"Metric",type:Q.Text},metricValue:{name:"Value",default:"-",type:Q.Text,desc:"The main value to be displayed. It's not limited to numbers."},description:{name:"Description",type:Q.Text},note:{name:"Note",init:"+Pass",type:Q.Text,desc:"Prefix with '+' for a positive message, with '-' for a negative message."},primaryTextColor:ua,secondaryTextColor:In,positiveColor:{name:"Positive",default:Ht.Green3,type:Q.Color,category:ot.Style},neutralColor:{name:"Neutral",default:"var(--separatorColor)",type:Q.Color,category:ot.Style},negativeColor:{name:"Negative",default:Ht.Orange2,type:Q.Color,category:ot.Style},cssClasses:mt},previewField:"name"}},kae=$e({...Iae,__name:"CoreMetric",setup(e){const t=re(ne.evaluatedFields),a=H(()=>{const o=t.note.value;if(!o)return"neutral";const s=o.charAt(0);return s=="+"?"positive":s=="-"?"negative":"neutral"}),n=H(()=>{const o=t.note.value;if(!o)return;const s=o.charAt(0);return s=="+"||s=="-"?o.substring(1):o}),r=H(()=>({"--messageActiveSentimentColor":{positive:t.positiveColor.value,neutral:t.neutralColor.value,negative:t.negativeColor.value}[a.value]}));return(o,s)=>($(),R("div",{class:"CoreMetric",style:bt(r.value)},[E(t).name.value?($(),R("div",Cae,je(E(t).name.value),1)):ge("",!0),E(t).description.value?($(),R("div",Aae,je(E(t).description.value),1)):ge("",!0),Z("h2",Sae,je(E(t).metricValue.value),1),n.value?($(),R("div",$ae,je(n.value),1)):ge("",!0)],4))}}),Tae=ke(kae,[["__scopeId","data-v-7b11fe28"]]),Pae="A component that displays Plotly graphs.",Lae={data:[{x:["a","b","c"],y:[22,25,29],type:"bar"}]},Vae={writer:{name:"Plotly graph",description:Pae,category:"Content",fields:{spec:{name:"Graph specification",default:JSON.stringify(Lae,null,2),desc:"Plotly graph specification. Pass it using state, e.g. @{fig}, or paste a JSON specification.",type:Q.Object},cssClasses:mt},events:{"plotly-click":{desc:"Sends a list with the clicked points.",eventPayloadExample:{curveNumber:0,pointNumber:2,x:"c",y:29,label:"c",xaxis:{anchor:"y"},yaxis:{anchor:"x"}}},"plotly-selected":{desc:"Sends a list with the selected points."},"plotly-deselect":{desc:"Triggered when points are deselected."}}}},bg=$e({...Vae,__name:"CorePlotlyGraph",setup(e){const t=pt("rootEl"),a=pt("chartTargetEl"),n=re(ne.evaluatedFields),r=H(()=>n.spec.value),o={paper_bgcolor:Ht.White,plot_bgcolor:Ht.Gray1,colorway:[Ht.Blue4,Ht.Blue4,Ht.Orange4,Ht.Green5],font:{family:"Poppins, sans-serif",size:12,color:Ht.Black},hoverlabel:{color:Ht.White,bgcolor:Ht.Black}},s=async()=>{var f,m,g;if(!r.value||!a.value)return;const u=await zt(()=>import("./plotly.min-DmBAN9XQ.js").then(_=>_.p),[],import.meta.url);if(!t.value||t.value.clientHeight==0)return;const h={...r.value,layout:{...o,...(f=r.value)==null?void 0:f.layout}};u.newPlot(a.value,h),l(),(g=(m=r.value)==null?void 0:m.layout)!=null&&g.autosize&&i()};function i(){const u=t.value.parentElement;u!=null&&u.clientHeight&&(t.value.style.height="100%",a.value.style.height="100%")}function l(){a.value.on("plotly_click",d("plotly-click")),a.value.on("plotly_selected",d("plotly-selected")),a.value.on("plotly_deselect",d("plotly-deselect"))}function c(u){var h,f;return{curveNumber:u.curveNumber,pointNumber:u.pointNumber,pointNumbers:u.pointNumbers,x:u.x,y:u.y,z:u.z,label:u.label,lat:u.lat,lon:u.lon,xaxis:{anchor:(h=u.xaxis)==null?void 0:h.anchor},yaxis:{anchor:(f=u.yaxis)==null?void 0:f.anchor}}}function d(u){return h=>{var m;const f=new CustomEvent(u,{detail:{payload:(m=h==null?void 0:h.points)==null?void 0:m.map(g=>c(g))}});t.value.dispatchEvent(f)}}return We(r,u=>{u&&s()}),ia(async()=>{await s(),t.value&&new ResizeObserver(s).observe(t.value,{box:"border-box"})}),(u,h)=>($(),R("div",{ref_key:"rootEl",ref:t,class:"CorePlotlyGraph"},[Z("div",{ref_key:"chartTargetEl",ref:a,class:"target"},null,512),h[0]||(h[0]=Z("div",{class:"mask"},null,-1))],512))}}),sm=e=>{e.writer&&(e.writer.docs=`You can listen to events triggered by Plotly.js and add interactivity to your charts.
8165
+ \`\`\``)};typeof om=="function"&&om(_g);const xae=ke(_g,[["__scopeId","data-v-5eb22d34"]]),Cae={key:0,class:"name"},Aae={key:1,class:"description"},Sae={class:"value"},$ae={key:2,class:"note"},Eae="A component that prominently displays a metric value and associated information.",Iae={writer:{name:"Metric",description:Eae,category:"Content",fields:{name:{name:"Name",init:"Metric",type:Q.Text},metricValue:{name:"Value",default:"-",type:Q.Text,desc:"The main value to be displayed. It's not limited to numbers."},description:{name:"Description",type:Q.Text},note:{name:"Note",init:"+Pass",type:Q.Text,desc:"Prefix with '+' for a positive message, with '-' for a negative message."},primaryTextColor:ua,secondaryTextColor:In,positiveColor:{name:"Positive",default:Ht.Green3,type:Q.Color,category:ot.Style},neutralColor:{name:"Neutral",default:"var(--separatorColor)",type:Q.Color,category:ot.Style},negativeColor:{name:"Negative",default:Ht.Orange2,type:Q.Color,category:ot.Style},cssClasses:mt},previewField:"name"}},kae=$e({...Iae,__name:"CoreMetric",setup(e){const t=re(ne.evaluatedFields),a=H(()=>{const o=t.note.value;if(!o)return"neutral";const s=o.charAt(0);return s=="+"?"positive":s=="-"?"negative":"neutral"}),n=H(()=>{const o=t.note.value;if(!o)return;const s=o.charAt(0);return s=="+"||s=="-"?o.substring(1):o}),r=H(()=>({"--messageActiveSentimentColor":{positive:t.positiveColor.value,neutral:t.neutralColor.value,negative:t.negativeColor.value}[a.value]}));return(o,s)=>($(),R("div",{class:"CoreMetric",style:bt(r.value)},[E(t).name.value?($(),R("div",Cae,je(E(t).name.value),1)):ge("",!0),E(t).description.value?($(),R("div",Aae,je(E(t).description.value),1)):ge("",!0),Z("h2",Sae,je(E(t).metricValue.value),1),n.value?($(),R("div",$ae,je(n.value),1)):ge("",!0)],4))}}),Tae=ke(kae,[["__scopeId","data-v-7b11fe28"]]),Pae="A component that displays Plotly graphs.",Lae={data:[{x:["a","b","c"],y:[22,25,29],type:"bar"}]},Vae={writer:{name:"Plotly graph",description:Pae,category:"Content",fields:{spec:{name:"Graph specification",default:JSON.stringify(Lae,null,2),desc:"Plotly graph specification. Pass it using state, e.g. @{fig}, or paste a JSON specification.",type:Q.Object},cssClasses:mt},events:{"plotly-click":{desc:"Sends a list with the clicked points.",eventPayloadExample:{curveNumber:0,pointNumber:2,x:"c",y:29,label:"c",xaxis:{anchor:"y"},yaxis:{anchor:"x"}}},"plotly-selected":{desc:"Sends a list with the selected points."},"plotly-deselect":{desc:"Triggered when points are deselected."}}}},bg=$e({...Vae,__name:"CorePlotlyGraph",setup(e){const t=pt("rootEl"),a=pt("chartTargetEl"),n=re(ne.evaluatedFields),r=H(()=>n.spec.value),o={paper_bgcolor:Ht.White,plot_bgcolor:Ht.Gray1,colorway:[Ht.Blue4,Ht.Blue4,Ht.Orange4,Ht.Green5],font:{family:"Poppins, sans-serif",size:12,color:Ht.Black},hoverlabel:{color:Ht.White,bgcolor:Ht.Black}},s=async()=>{var f,m,g;if(!r.value||!a.value)return;const u=await zt(()=>import("./plotly.min-C53ew1kV.js").then(_=>_.p),[],import.meta.url);if(!t.value||t.value.clientHeight==0)return;const h={...r.value,layout:{...o,...(f=r.value)==null?void 0:f.layout}};u.newPlot(a.value,h),l(),(g=(m=r.value)==null?void 0:m.layout)!=null&&g.autosize&&i()};function i(){const u=t.value.parentElement;u!=null&&u.clientHeight&&(t.value.style.height="100%",a.value.style.height="100%")}function l(){a.value.on("plotly_click",d("plotly-click")),a.value.on("plotly_selected",d("plotly-selected")),a.value.on("plotly_deselect",d("plotly-deselect"))}function c(u){var h,f;return{curveNumber:u.curveNumber,pointNumber:u.pointNumber,pointNumbers:u.pointNumbers,x:u.x,y:u.y,z:u.z,label:u.label,lat:u.lat,lon:u.lon,xaxis:{anchor:(h=u.xaxis)==null?void 0:h.anchor},yaxis:{anchor:(f=u.yaxis)==null?void 0:f.anchor}}}function d(u){return h=>{var m;const f=new CustomEvent(u,{detail:{payload:(m=h==null?void 0:h.points)==null?void 0:m.map(g=>c(g))}});t.value.dispatchEvent(f)}}return We(r,u=>{u&&s()}),ia(async()=>{await s(),t.value&&new ResizeObserver(s).observe(t.value,{box:"border-box"})}),(u,h)=>($(),R("div",{ref_key:"rootEl",ref:t,class:"CorePlotlyGraph"},[Z("div",{ref_key:"chartTargetEl",ref:a,class:"target"},null,512),h[0]||(h[0]=Z("div",{class:"mask"},null,-1))],512))}}),sm=e=>{e.writer&&(e.writer.docs=`You can listen to events triggered by Plotly.js and add interactivity to your charts.
8166
8166
  For example, implement cross-filtering.`)};typeof sm=="function"&&sm(bg);const Oae=ke(bg,[["__scopeId","data-v-44c39dcb"]]),Hae={},Rae={class:"SharedControlBar"},Nae={class:"SharedControlBar__content"},Dae={key:0,class:"SharedControlBar__actions"};function Bae(e,t){return $(),R("div",Rae,[Z("div",Nae,[qt(e.$slots,"default",{},void 0,!0)]),e.$slots.actions?($(),R("div",Dae,[qt(e.$slots,"actions",{},void 0,!0)])):ge("",!0)])}const $d=ke(Hae,[["render",Bae],["__scopeId","data-v-1256a7fb"]]),Fae=`
8167
8167
  def click_handler(state):
8168
8168
 
8169
8169
  # Increment counter when the text is clicked
8170
8170
 
8171
- state["counter"] += 1`,jae="A component to display plain text or formatted text using Markdown syntax.",Uae={writer:{name:"Text",description:jae,category:"Content",fields:{text:{name:"Text",init:"Text",desc:"Add text directly, or reference state elements with @{my_text}.",type:Q.Text,control:Ui.Textarea},useMarkdown:Ut({name:"Enable markdown",desc:"The Markdown output will be sanitised; unsafe elements will be removed.",default:"no"}),alignment:{name:"Alignment",default:"left",type:Q.Text,options:{left:"Left",center:"Center",right:"Right"},category:ot.Style},quickCopy:xd({default:"no"}),primaryTextColor:ua,cssClasses:mt},events:{"wf-click":{desc:"Capture single clicks.",stub:Fae.trim()}},previewField:"text"}},zae=$e({...Uae,__name:"CoreText",setup(e){const t=sr({loader:()=>zt(()=>import("./SharedCopyClipboardButton-BAhxC5LU.js"),__vite__mapDeps([3,4,5,6,7,8]),import.meta.url)}),a=pt("rootEl"),n=re(ne.evaluatedFields),r=re(ne.componentId),o=re(ne.core),s=re(ne.isBeingEdited),i=H(()=>!n.text.value),l=H(()=>!i.value||s.value),c=H(()=>{var m;return{cursor:typeof((m=o.getComponentById(r).handlers)==null?void 0:m["wf-click"])<"u"?"pointer":"unset"}}),d=H(()=>({"text-align":n.alignment.value}));function u(h){const f=Zi(h);a.value.dispatchEvent(f)}return(h,f)=>l.value?($(),R("div",{key:0,ref_key:"rootEl",ref:a,class:"CoreText",style:bt(c.value),onClick:u},[i.value?($(),Ie(Sd,{key:0,"component-id":E(r)},null,8,["component-id"])):($(),Ie($d,{key:1},{actions:Xe(()=>[E(n).quickCopy.value?($(),Ie(E(t),{key:0,label:"Copy text",value:E(n).text.value},null,8,["value"])):ge("",!0)]),default:Xe(()=>[E(n).useMarkdown.value?($(),Ie(K3,{key:0,"raw-text":E(n).text.value,style:bt(d.value)},null,8,["raw-text","style"])):($(),R("p",{key:1,class:"plainText",style:bt(d.value)},je(E(n).text.value),5))]),_:1}))],4)):ge("",!0)}}),qae=ke(zae,[["__scopeId","data-v-26fe47d1"]]),wg="A component that displays Vega-Lite/Altair charts.",Wae={$schema:"https://vega.github.io/schema/vega-lite/v5.json",description:wg,data:{values:[{a:"A",b:100},{a:"B",b:200},{a:"C",b:150},{a:"D",b:300}]},mark:"bar",encoding:{x:{field:"a",type:"nominal"},y:{field:"b",type:"quantitative"}}},Zae={writer:{deprecated:!0,name:"Vega Lite chart",description:wg,category:"Content",fields:{spec:{name:"Chart specification",default:JSON.stringify(Wae,null,2),desc:"Vega-Lite chart specification. Pass a Vega Altair chart using state or paste a JSON specification.",type:Q.Object},cssClasses:mt}}},xg=$e({...Zae,__name:"CoreVegaLiteChart",setup(e){const t=pt("rootEl"),a=pt("chartTargetEl"),n=re(ne.evaluatedFields),r=async()=>{if(!n.spec.value||!a.value)return;const{default:o}=await zt(()=>import("./vega-embed.module-SNP5iNdJ.js"),[],import.meta.url);await o(a.value,n.spec.value)};return We(()=>n.spec.value,o=>{o&&r()}),ia(()=>{r(),new ResizeObserver(r).observe(t.value,{box:"border-box"})}),(o,s)=>($(),R("div",{ref_key:"rootEl",ref:t,class:"CoreVegaLiteChart"},[Z("div",{ref_key:"chartTargetEl",ref:a,class:"target"},null,512)],512))}}),im=e=>{e.writer&&(e.writer.docs=`Generate a chart using Altair and pass it via state; it'll be converted to Vega-Lite specification.
8171
+ state["counter"] += 1`,jae="A component to display plain text or formatted text using Markdown syntax.",Uae={writer:{name:"Text",description:jae,category:"Content",fields:{text:{name:"Text",init:"Text",desc:"Add text directly, or reference state elements with @{my_text}.",type:Q.Text,control:Ui.Textarea},useMarkdown:Ut({name:"Enable markdown",desc:"The Markdown output will be sanitised; unsafe elements will be removed.",default:"no"}),alignment:{name:"Alignment",default:"left",type:Q.Text,options:{left:"Left",center:"Center",right:"Right"},category:ot.Style},quickCopy:xd({default:"no"}),primaryTextColor:ua,cssClasses:mt},events:{"wf-click":{desc:"Capture single clicks.",stub:Fae.trim()}},previewField:"text"}},zae=$e({...Uae,__name:"CoreText",setup(e){const t=sr({loader:()=>zt(()=>import("./SharedCopyClipboardButton-CXfaup9Y.js"),__vite__mapDeps([3,4,5,6,7,8]),import.meta.url)}),a=pt("rootEl"),n=re(ne.evaluatedFields),r=re(ne.componentId),o=re(ne.core),s=re(ne.isBeingEdited),i=H(()=>!n.text.value),l=H(()=>!i.value||s.value),c=H(()=>{var m;return{cursor:typeof((m=o.getComponentById(r).handlers)==null?void 0:m["wf-click"])<"u"?"pointer":"unset"}}),d=H(()=>({"text-align":n.alignment.value}));function u(h){const f=Zi(h);a.value.dispatchEvent(f)}return(h,f)=>l.value?($(),R("div",{key:0,ref_key:"rootEl",ref:a,class:"CoreText",style:bt(c.value),onClick:u},[i.value?($(),Ie(Sd,{key:0,"component-id":E(r)},null,8,["component-id"])):($(),Ie($d,{key:1},{actions:Xe(()=>[E(n).quickCopy.value?($(),Ie(E(t),{key:0,label:"Copy text",value:E(n).text.value},null,8,["value"])):ge("",!0)]),default:Xe(()=>[E(n).useMarkdown.value?($(),Ie(K3,{key:0,"raw-text":E(n).text.value,style:bt(d.value)},null,8,["raw-text","style"])):($(),R("p",{key:1,class:"plainText",style:bt(d.value)},je(E(n).text.value),5))]),_:1}))],4)):ge("",!0)}}),qae=ke(zae,[["__scopeId","data-v-26fe47d1"]]),wg="A component that displays Vega-Lite/Altair charts.",Wae={$schema:"https://vega.github.io/schema/vega-lite/v5.json",description:wg,data:{values:[{a:"A",b:100},{a:"B",b:200},{a:"C",b:150},{a:"D",b:300}]},mark:"bar",encoding:{x:{field:"a",type:"nominal"},y:{field:"b",type:"quantitative"}}},Zae={writer:{deprecated:!0,name:"Vega Lite chart",description:wg,category:"Content",fields:{spec:{name:"Chart specification",default:JSON.stringify(Wae,null,2),desc:"Vega-Lite chart specification. Pass a Vega Altair chart using state or paste a JSON specification.",type:Q.Object},cssClasses:mt}}},xg=$e({...Zae,__name:"CoreVegaLiteChart",setup(e){const t=pt("rootEl"),a=pt("chartTargetEl"),n=re(ne.evaluatedFields),r=async()=>{if(!n.spec.value||!a.value)return;const{default:o}=await zt(()=>import("./vega-embed.module-SNP5iNdJ.js"),[],import.meta.url);await o(a.value,n.spec.value)};return We(()=>n.spec.value,o=>{o&&r()}),ia(()=>{r(),new ResizeObserver(r).observe(t.value,{box:"border-box"})}),(o,s)=>($(),R("div",{ref_key:"rootEl",ref:t,class:"CoreVegaLiteChart"},[Z("div",{ref_key:"chartTargetEl",ref:a,class:"target"},null,512)],512))}}),im=e=>{e.writer&&(e.writer.docs=`Generate a chart using Altair and pass it via state; it'll be converted to Vega-Lite specification.
8172
8172
 
8173
8173
  \`state["my_chart"] = chart\`
8174
8174
 
@@ -8182,7 +8182,7 @@ Alternatively, you can pack bytes or files in state:
8182
8182
 
8183
8183
  \`state["vid_f"] = wf.pack_file(vid_file, "video/mp4")\`
8184
8184
 
8185
- Afterwards, you can reference the video using the syntax \`@{vid_f}\`.`)};typeof lm=="function"&&lm(Cg);const Qae=ke(Cg,[["__scopeId","data-v-23bc2e6c"]]),ene={class:"CoreLink"},tne=["href","target","rel"],ane={writer:{name:"Link",description:"A component to create a hyperlink.",category:"Content",fields:{url:{name:"URL",type:Q.Text,default:"https://writer.com",desc:"Specify a URL or choose a page. Keep in mind that you can only link to pages for which a key has been specified.",options:e=>Object.fromEntries(e.getComponents("root",{sortedByPosition:!0}).map(t=>t.content.key).filter(t=>!!t).map(t=>[`#${t}`,`Page with key: ${t}`]))},target:{name:"Target",type:Q.Text,options:{_self:"Self",_blank:"Blank",_parent:"Parent",_top:"Top"},desc:"Specifies where to open the linked document.",default:"_blank"},rel:{name:"Rel",type:Q.Text,desc:"Specifies the relationship between the current document and the linked document."},text:{name:"Text",default:"",type:Q.Text,desc:"The text to display in the link."},primaryTextColor:ua,cssClasses:mt}}},nne=$e({...ane,__name:"CoreLink",setup(e){const t=re(ne.evaluatedFields),a=H(()=>t.text.value||t.url.value);return(n,r)=>($(),R("div",ene,[Z("a",{href:E(t).url.value,target:E(t).target.value,rel:E(t).rel.value},je(a.value),9,tne)]))}}),rne=ke(nne,[["__scopeId","data-v-db333917"]]);function Tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function*one(e,t="",a=new WeakSet){if(Tr(e)&&!a.has(e)){a.add(e);for(const n in e){const r=t?`${t}.${n}`:n;yield r,typeof e[n]=="object"&&e[n]!==null&&!Array.isArray(e[n])&&(yield*one(e[n],r,a))}}}function Ki(){const e=new AbortController;return Ir(()=>{e.abort()}),e}class ql extends Error{constructor(t="Operation aborted"){super(t),this.name=ql.name}}function sne(e,{onProgress:t,signal:a}={}){const n=new FileReader;return new Promise((r,o)=>{if(n.onload=()=>{r(String(n.result)||"")},n.onerror=()=>{o(n.error??new Error("Failed to read file"))},n.onprogress=({lengthComputable:s,loaded:i,total:l})=>{if(typeof t=="function"&&s){const c=Math.round(i/l*100);t(c,i,l)}},n.onabort=()=>{o(new ql)},a instanceof AbortSignal){if(a.aborted){n.abort();return}a.addEventListener("abort",()=>n.abort(),{once:!0})}n.readAsDataURL(e)})}let ine=0;function cm(e){var a;return{id:((a=window.crypto)==null?void 0:a.randomUUID())??`file-${ine++}`,file:e,name:e.name,size:e.size}}function lne(e){return Tr(e)&&"name"in e&&"type"in e&&"data"in e&&typeof e.data=="string"&&e.data.startsWith("data:")}function Ag({multiple:e}){const t=Ki(),a=$t([]);function n(d){return d.reduce((u,h)=>u+h.size,0)}function r(d){const u=d.map(h=>cm(h));a.value=Pa(e)?a.value.concat(u):u.slice(0,1)}function o(d){a.value=a.value.filter(u=>u.id!==d)}function s(d){const u=d.map(h=>cm(h));a.value=Pa(e)?u:u.slice(0,1)}function i(){a.value=[]}async function l(){const d=[],u=[];return t.signal.aborted?{encodedFiles:d,rejectedFiles:u}:((await Promise.allSettled(a.value.map(async({file:f})=>{const m=await sne(f,{signal:t.signal});return{name:f.name,type:f.type,data:m}}))).forEach(f=>{if(f.status==="fulfilled")d.push(f.value);else if(f.reason instanceof Error){if(f.reason instanceof ql)return;u.push(f.reason)}}),{encodedFiles:d,rejectedFiles:u})}async function c(d){const u=[];return t.signal.aborted?{decodedFiles:u}:((await Promise.allSettled(d.filter(f=>lne(f)).map(async f=>{const m=await fetch(f.data,{signal:t.signal}),g=await m.blob(),_=g.type||m.headers.get("Content-Type")||f.type||"";return new File([g],f.name,{type:_})}))).forEach(f=>{f.status==="fulfilled"&&u.push(f.value)}),{decodedFiles:u})}return{files:jt(a),calcTotalSize:n,addFiles:r,removeFile:o,replaceFiles:s,clearFiles:i,encodeFiles:l,decodeFiles:c}}const cne=async(e,t)=>e.size<=2*1024*1024?e:new Promise(a=>{const n=document.createElement("canvas"),r=n.getContext("2d");if(!r){t.warn(`Canvas 2D context not available for image optimization: ${e.name}, using original`),a(e);return}const o=new Image,s=URL.createObjectURL(e);o.onload=()=>{let{width:c,height:d}=o;if(c>1920||d>1080){const u=Math.min(1920/c,1080/d);c=Math.floor(c*u),d=Math.floor(d*u)}n.width=c,n.height=d,r.drawImage(o,0,0,c,d),URL.revokeObjectURL(s),n.toBlob(u=>{u?a(new File([u],e.name,{type:"image/jpeg"})):(t.warn(`Failed to compress image: ${e.name}, using original`),a(e))},"image/jpeg",.85)},o.onerror=()=>{URL.revokeObjectURL(s),t.warn(`Failed to optimize image: ${e.name}, using original`),a(e)},o.src=s}),dne={class:"CoreChatbotAvatar"},une=$e({__name:"CoreChatbotAvatar",props:{initials:{type:String,required:!0}},setup(e){return(t,a)=>($(),R("div",dne,je(e.initials),1))}}),hne=ke(une,[["__scopeId","data-v-ce5bb453"]]),pne={class:"WdsModal__main"},fne={key:1,class:"WdsModal__main__title"},mne={class:"WdsModal__main__title__header"},vne={key:0},gne={class:"WdsModal__main__content"},yne={key:2,class:"WdsModal__main__footer"},Mne={key:0,class:"WdsModal__main__footer__hint"},_ne={key:1,class:"WdsModal__main__footer__actions"},bne=$e({__name:"WdsModal",props:{title:{type:String,required:!1,default:null},size:{type:String,required:!1,default:"normal"},description:{type:String,required:!1,default:null},actions:{type:Array,required:!1,default:()=>[]},allowOverflow:{type:Boolean,required:!1},displayCloseButton:{type:Boolean,required:!1},hint:{type:String,required:!1,default:void 0}},emits:{close:()=>!0},setup(e){const t=e,{title:a,actions:n}=a0(t);return(r,o)=>{var s,i;return $(),Ie(_v,{to:"#modal"},[Z("div",{class:ft(["WdsModal colorTransformer",{"WdsModal--overflow":e.allowOverflow,"WdsModal--wide":e.size=="wide"}]),tabindex:"-1"},[Z("div",pne,[e.displayCloseButton?($(),Ie(La,{key:0,variant:"neutral",size:"smallIcon",class:"WdsModal__main__closeBtn",onClick:o[0]||(o[0]=l=>r.$emit("close"))},{default:Xe(()=>[Ce(_t,{name:"x"})]),_:1})):ge("",!0),E(a)||e.description?($(),R("div",fne,[Z("div",mne,[Z("h2",null,je(E(a)),1),qt(r.$slots,"titleActions",{},void 0,!0)]),e.description?($(),R("summary",vne,je(e.description),1)):ge("",!0)])):ge("",!0),Z("div",gne,[qt(r.$slots,"default",{},void 0,!0)]),((s=E(n))==null?void 0:s.length)>0||e.hint?($(),R("div",yne,[e.hint?($(),R("p",Mne,je(e.hint),1)):ge("",!0),((i=E(n))==null?void 0:i.length)>0?($(),R("div",_ne,[($(!0),R(Je,null,Ot(E(n),(l,c)=>($(),Ie(La,{key:c,variant:c==E(n).length-1?"primary":"tertiary",disabled:l.disabled,loading:l.loading,onClick:l.fn},{default:Xe(()=>[l.icon?($(),Ie(_t,{key:0,name:l.icon},null,8,["name"])):ge("",!0),pa(" "+je(l.desc),1)]),_:2},1032,["variant","disabled","loading","onClick"]))),128))])):ge("",!0)])):ge("",!0)])],2)])}}}),Sg=ke(bne,[["__scopeId","data-v-dcb8fed3"]]),wne=["aria-busy"],xne={key:1,class:"CoreChatbotMessage__content__text"},Cne={key:0,class:"content-fragment"},Ane={key:1},Sne={key:0,class:"message-images-wrapper"},$ne={class:"message-images-container"},Ene=["src","aria-label","onClick","onKeydown"],Ine={key:2,class:"CoreChatbotMessage__content__actions"},kne=["onClick"],Tne={key:0,class:"subheading"},Pne={class:"name"},Lne={key:1,class:"desc"},Vne=["src"],One=$e({__name:"CoreChatbotMessage",props:{initials:{type:String,required:!0},useMarkdown:{type:Boolean,required:!1},message:{type:Object,required:!1,default:void 0},assistantRoleColor:{type:String,required:!1,default:""},isLoading:{type:Boolean,required:!1}},emits:{actionClick:e=>typeof e=="object"&&e!==null},setup(e){const t=sr({loader:()=>zt(()=>import("./BaseMarkdown-CsWzSrDd.js"),[],import.meta.url)}),a=sr({loader:()=>zt(()=>Promise.resolve().then(()=>Ite),void 0,import.meta.url)}),n=e,r=H(()=>{var f;return((f=n.message)==null?void 0:f.actions)??[]}),o=H(()=>n.isLoading&&!i.value),s=H(()=>{var f;return n.isLoading?"assistant":((f=n.message)==null?void 0:f.role)??""}),i=H(()=>{var m;const f=(m=n.message)==null?void 0:m.content;return Array.isArray(f)?f:(f==null?void 0:f.trim())??""}),l=H(()=>{switch(s.value){case"user":return"var(--userRoleColor)";case"assistant":return n.assistantRoleColor||"linear-gradient(264deg, #f5ebff 0.71%, #eef1ff 100%)";default:return""}}),c=f=>{const m=f.target;m.style.display="none"},d=ye(),u=f=>f.some(m=>{var g;return m.type==="image_url"&&((g=m.image_url)==null?void 0:g.url)}),h=(f,m)=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),d.value=m)};return(f,m)=>($(),R(Je,null,[Z("div",{class:"CoreChatbotMessage","aria-busy":e.isLoading},[Ce(hne,{initials:e.initials},null,8,["initials"]),Z("div",{class:"CoreChatbotMessage__content",style:bt({background:l.value})},[o.value?($(),Ie(E(a),{key:0})):($(),R("div",xne,[Array.isArray(i.value)?($(),R(Je,{key:0},[($(!0),R(Je,null,Ot(i.value,(g,_)=>($(),R(Je,{key:`text-${_}`},[g.type==="text"?($(),R("div",Cne,[e.useMarkdown?($(),Ie(E(t),{key:0,"raw-text":g.text||""},null,8,["raw-text"])):($(),R("span",Ane,je(g.text),1))])):ge("",!0)],64))),128)),u(i.value)?($(),R("div",Sne,[Z("div",$ne,[($(!0),R(Je,null,Ot(i.value,(g,_)=>{var b,v,y;return $(),R(Je,{key:`image-${_}`},[g.type==="image_url"&&((b=g.image_url)!=null&&b.url)?($(),R("img",{key:0,src:(v=g.image_url)==null?void 0:v.url,alt:"Image from conversation",class:"message-image-preview",loading:"lazy",role:"button",tabindex:"0","aria-label":`Open image in modal - ${(y=g.image_url)==null?void 0:y.url}`,onError:c,onClick:M=>d.value=g.image_url.url,onKeydown:M=>h(M,g.image_url.url)},null,40,Ene)):ge("",!0)],64)}),128))])])):ge("",!0)],64)):($(),R(Je,{key:1},[e.useMarkdown?($(),Ie(E(t),{key:0,"raw-text":i.value},null,8,["raw-text"])):($(),R(Je,{key:1},[pa(je(i.value),1)],64))],64))])),r.value.length?($(),R("div",Ine,[($(!0),R(Je,null,Ot(r.value,(g,_)=>($(),R("button",{key:_,class:"action",onClick:b=>f.$emit("actionClick",g)},[g.subheading?($(),R("div",Tne,je(g.subheading),1)):ge("",!0),Z("h3",Pne,je(g.name),1),g.desc?($(),R("div",Lne,je(g.desc),1)):ge("",!0)],8,kne))),128))])):ge("",!0)],4)],8,wne),d.value?($(),Ie(Sg,{key:0,"display-close-button":!0,onClose:m[0]||(m[0]=g=>d.value=void 0)},{default:Xe(()=>[Z("img",{src:d.value,alt:"Full size image",class:"image-modal-img"},null,8,Vne)]),_:1})):ge("",!0)],64))}}),dm=ke(One,[["__scopeId","data-v-5d4e07d9"]]),Hne=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Rne=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Nne=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Dne=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],um=(e,t,a)=>{let n=e;return typeof t=="string"||Array.isArray(t)?n=e.toLocaleString(t,a):(t===!0||a!==void 0)&&(n=e.toLocaleString(void 0,a)),n};function fl(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};const a=t.bits?t.binary?Dne:Nne:t.binary?Rne:Hne,n=t.space?" ":"";if(t.signed&&e===0)return` 0${n}${a[0]}`;const r=e<0,o=r?"-":t.signed?"+":"";r&&(e=-e);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),e<1){const d=um(e,t.locale,s);return o+d+n+a[0]}const i=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),a.length-1);e/=(t.binary?1024:1e3)**i,s||(e=e.toPrecision(3));const l=um(Number(e),t.locale,s),c=a[i];return o+l+n+c}const Bne={class:"filesArea"},Fne={key:1,class:"list"},jne=["title"],Une={class:"size"},zne={class:"filesButtons"},qne={key:0,class:"sizeExceededMessage"},Wne={key:1,class:"pastedImagesArea"},Zne={class:"pastedImagesList"},Kne=["src"],Gne={class:"inputArea"},Jne={class:"inputButtons"},Xne="A chatbot component to build human-to-AI interactions.",Yne=`
8185
+ Afterwards, you can reference the video using the syntax \`@{vid_f}\`.`)};typeof lm=="function"&&lm(Cg);const Qae=ke(Cg,[["__scopeId","data-v-23bc2e6c"]]),ene={class:"CoreLink"},tne=["href","target","rel"],ane={writer:{name:"Link",description:"A component to create a hyperlink.",category:"Content",fields:{url:{name:"URL",type:Q.Text,default:"https://writer.com",desc:"Specify a URL or choose a page. Keep in mind that you can only link to pages for which a key has been specified.",options:e=>Object.fromEntries(e.getComponents("root",{sortedByPosition:!0}).map(t=>t.content.key).filter(t=>!!t).map(t=>[`#${t}`,`Page with key: ${t}`]))},target:{name:"Target",type:Q.Text,options:{_self:"Self",_blank:"Blank",_parent:"Parent",_top:"Top"},desc:"Specifies where to open the linked document.",default:"_blank"},rel:{name:"Rel",type:Q.Text,desc:"Specifies the relationship between the current document and the linked document."},text:{name:"Text",default:"",type:Q.Text,desc:"The text to display in the link."},primaryTextColor:ua,cssClasses:mt}}},nne=$e({...ane,__name:"CoreLink",setup(e){const t=re(ne.evaluatedFields),a=H(()=>t.text.value||t.url.value);return(n,r)=>($(),R("div",ene,[Z("a",{href:E(t).url.value,target:E(t).target.value,rel:E(t).rel.value},je(a.value),9,tne)]))}}),rne=ke(nne,[["__scopeId","data-v-db333917"]]);function Tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function*one(e,t="",a=new WeakSet){if(Tr(e)&&!a.has(e)){a.add(e);for(const n in e){const r=t?`${t}.${n}`:n;yield r,typeof e[n]=="object"&&e[n]!==null&&!Array.isArray(e[n])&&(yield*one(e[n],r,a))}}}function Ki(){const e=new AbortController;return Ir(()=>{e.abort()}),e}class ql extends Error{constructor(t="Operation aborted"){super(t),this.name=ql.name}}function sne(e,{onProgress:t,signal:a}={}){const n=new FileReader;return new Promise((r,o)=>{if(n.onload=()=>{r(String(n.result)||"")},n.onerror=()=>{o(n.error??new Error("Failed to read file"))},n.onprogress=({lengthComputable:s,loaded:i,total:l})=>{if(typeof t=="function"&&s){const c=Math.round(i/l*100);t(c,i,l)}},n.onabort=()=>{o(new ql)},a instanceof AbortSignal){if(a.aborted){n.abort();return}a.addEventListener("abort",()=>n.abort(),{once:!0})}n.readAsDataURL(e)})}let ine=0;function cm(e){var a;return{id:((a=window.crypto)==null?void 0:a.randomUUID())??`file-${ine++}`,file:e,name:e.name,size:e.size}}function lne(e){return Tr(e)&&"name"in e&&"type"in e&&"data"in e&&typeof e.data=="string"&&e.data.startsWith("data:")}function Ag({multiple:e}){const t=Ki(),a=$t([]);function n(d){return d.reduce((u,h)=>u+h.size,0)}function r(d){const u=d.map(h=>cm(h));a.value=Pa(e)?a.value.concat(u):u.slice(0,1)}function o(d){a.value=a.value.filter(u=>u.id!==d)}function s(d){const u=d.map(h=>cm(h));a.value=Pa(e)?u:u.slice(0,1)}function i(){a.value=[]}async function l(){const d=[],u=[];return t.signal.aborted?{encodedFiles:d,rejectedFiles:u}:((await Promise.allSettled(a.value.map(async({file:f})=>{const m=await sne(f,{signal:t.signal});return{name:f.name,type:f.type,data:m}}))).forEach(f=>{if(f.status==="fulfilled")d.push(f.value);else if(f.reason instanceof Error){if(f.reason instanceof ql)return;u.push(f.reason)}}),{encodedFiles:d,rejectedFiles:u})}async function c(d){const u=[];return t.signal.aborted?{decodedFiles:u}:((await Promise.allSettled(d.filter(f=>lne(f)).map(async f=>{const m=await fetch(f.data,{signal:t.signal}),g=await m.blob(),_=g.type||m.headers.get("Content-Type")||f.type||"";return new File([g],f.name,{type:_})}))).forEach(f=>{f.status==="fulfilled"&&u.push(f.value)}),{decodedFiles:u})}return{files:jt(a),calcTotalSize:n,addFiles:r,removeFile:o,replaceFiles:s,clearFiles:i,encodeFiles:l,decodeFiles:c}}const cne=async(e,t)=>e.size<=2*1024*1024?e:new Promise(a=>{const n=document.createElement("canvas"),r=n.getContext("2d");if(!r){t.warn(`Canvas 2D context not available for image optimization: ${e.name}, using original`),a(e);return}const o=new Image,s=URL.createObjectURL(e);o.onload=()=>{let{width:c,height:d}=o;if(c>1920||d>1080){const u=Math.min(1920/c,1080/d);c=Math.floor(c*u),d=Math.floor(d*u)}n.width=c,n.height=d,r.drawImage(o,0,0,c,d),URL.revokeObjectURL(s),n.toBlob(u=>{u?a(new File([u],e.name,{type:"image/jpeg"})):(t.warn(`Failed to compress image: ${e.name}, using original`),a(e))},"image/jpeg",.85)},o.onerror=()=>{URL.revokeObjectURL(s),t.warn(`Failed to optimize image: ${e.name}, using original`),a(e)},o.src=s}),dne={class:"CoreChatbotAvatar"},une=$e({__name:"CoreChatbotAvatar",props:{initials:{type:String,required:!0}},setup(e){return(t,a)=>($(),R("div",dne,je(e.initials),1))}}),hne=ke(une,[["__scopeId","data-v-ce5bb453"]]),pne={class:"WdsModal__main"},fne={key:1,class:"WdsModal__main__title"},mne={class:"WdsModal__main__title__header"},vne={key:0},gne={class:"WdsModal__main__content"},yne={key:2,class:"WdsModal__main__footer"},Mne={key:0,class:"WdsModal__main__footer__hint"},_ne={key:1,class:"WdsModal__main__footer__actions"},bne=$e({__name:"WdsModal",props:{title:{type:String,required:!1,default:null},size:{type:String,required:!1,default:"normal"},description:{type:String,required:!1,default:null},actions:{type:Array,required:!1,default:()=>[]},allowOverflow:{type:Boolean,required:!1},displayCloseButton:{type:Boolean,required:!1},hint:{type:String,required:!1,default:void 0}},emits:{close:()=>!0},setup(e){const t=e,{title:a,actions:n}=a0(t);return(r,o)=>{var s,i;return $(),Ie(_v,{to:"#modal"},[Z("div",{class:ft(["WdsModal colorTransformer",{"WdsModal--overflow":e.allowOverflow,"WdsModal--wide":e.size=="wide"}]),tabindex:"-1"},[Z("div",pne,[e.displayCloseButton?($(),Ie(La,{key:0,variant:"neutral",size:"smallIcon",class:"WdsModal__main__closeBtn",onClick:o[0]||(o[0]=l=>r.$emit("close"))},{default:Xe(()=>[Ce(_t,{name:"x"})]),_:1})):ge("",!0),E(a)||e.description?($(),R("div",fne,[Z("div",mne,[Z("h2",null,je(E(a)),1),qt(r.$slots,"titleActions",{},void 0,!0)]),e.description?($(),R("summary",vne,je(e.description),1)):ge("",!0)])):ge("",!0),Z("div",gne,[qt(r.$slots,"default",{},void 0,!0)]),((s=E(n))==null?void 0:s.length)>0||e.hint?($(),R("div",yne,[e.hint?($(),R("p",Mne,je(e.hint),1)):ge("",!0),((i=E(n))==null?void 0:i.length)>0?($(),R("div",_ne,[($(!0),R(Je,null,Ot(E(n),(l,c)=>($(),Ie(La,{key:c,variant:c==E(n).length-1?"primary":"tertiary",disabled:l.disabled,loading:l.loading,onClick:l.fn},{default:Xe(()=>[l.icon?($(),Ie(_t,{key:0,name:l.icon},null,8,["name"])):ge("",!0),pa(" "+je(l.desc),1)]),_:2},1032,["variant","disabled","loading","onClick"]))),128))])):ge("",!0)])):ge("",!0)])],2)])}}}),Sg=ke(bne,[["__scopeId","data-v-dcb8fed3"]]),wne=["aria-busy"],xne={key:1,class:"CoreChatbotMessage__content__text"},Cne={key:0,class:"content-fragment"},Ane={key:1},Sne={key:0,class:"message-images-wrapper"},$ne={class:"message-images-container"},Ene=["src","aria-label","onClick","onKeydown"],Ine={key:2,class:"CoreChatbotMessage__content__actions"},kne=["onClick"],Tne={key:0,class:"subheading"},Pne={class:"name"},Lne={key:1,class:"desc"},Vne=["src"],One=$e({__name:"CoreChatbotMessage",props:{initials:{type:String,required:!0},useMarkdown:{type:Boolean,required:!1},message:{type:Object,required:!1,default:void 0},assistantRoleColor:{type:String,required:!1,default:""},isLoading:{type:Boolean,required:!1}},emits:{actionClick:e=>typeof e=="object"&&e!==null},setup(e){const t=sr({loader:()=>zt(()=>import("./BaseMarkdown-FwGt2vSH.js"),[],import.meta.url)}),a=sr({loader:()=>zt(()=>Promise.resolve().then(()=>Ite),void 0,import.meta.url)}),n=e,r=H(()=>{var f;return((f=n.message)==null?void 0:f.actions)??[]}),o=H(()=>n.isLoading&&!i.value),s=H(()=>{var f;return n.isLoading?"assistant":((f=n.message)==null?void 0:f.role)??""}),i=H(()=>{var m;const f=(m=n.message)==null?void 0:m.content;return Array.isArray(f)?f:(f==null?void 0:f.trim())??""}),l=H(()=>{switch(s.value){case"user":return"var(--userRoleColor)";case"assistant":return n.assistantRoleColor||"linear-gradient(264deg, #f5ebff 0.71%, #eef1ff 100%)";default:return""}}),c=f=>{const m=f.target;m.style.display="none"},d=ye(),u=f=>f.some(m=>{var g;return m.type==="image_url"&&((g=m.image_url)==null?void 0:g.url)}),h=(f,m)=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),d.value=m)};return(f,m)=>($(),R(Je,null,[Z("div",{class:"CoreChatbotMessage","aria-busy":e.isLoading},[Ce(hne,{initials:e.initials},null,8,["initials"]),Z("div",{class:"CoreChatbotMessage__content",style:bt({background:l.value})},[o.value?($(),Ie(E(a),{key:0})):($(),R("div",xne,[Array.isArray(i.value)?($(),R(Je,{key:0},[($(!0),R(Je,null,Ot(i.value,(g,_)=>($(),R(Je,{key:`text-${_}`},[g.type==="text"?($(),R("div",Cne,[e.useMarkdown?($(),Ie(E(t),{key:0,"raw-text":g.text||""},null,8,["raw-text"])):($(),R("span",Ane,je(g.text),1))])):ge("",!0)],64))),128)),u(i.value)?($(),R("div",Sne,[Z("div",$ne,[($(!0),R(Je,null,Ot(i.value,(g,_)=>{var b,v,y;return $(),R(Je,{key:`image-${_}`},[g.type==="image_url"&&((b=g.image_url)!=null&&b.url)?($(),R("img",{key:0,src:(v=g.image_url)==null?void 0:v.url,alt:"Image from conversation",class:"message-image-preview",loading:"lazy",role:"button",tabindex:"0","aria-label":`Open image in modal - ${(y=g.image_url)==null?void 0:y.url}`,onError:c,onClick:M=>d.value=g.image_url.url,onKeydown:M=>h(M,g.image_url.url)},null,40,Ene)):ge("",!0)],64)}),128))])])):ge("",!0)],64)):($(),R(Je,{key:1},[e.useMarkdown?($(),Ie(E(t),{key:0,"raw-text":i.value},null,8,["raw-text"])):($(),R(Je,{key:1},[pa(je(i.value),1)],64))],64))])),r.value.length?($(),R("div",Ine,[($(!0),R(Je,null,Ot(r.value,(g,_)=>($(),R("button",{key:_,class:"action",onClick:b=>f.$emit("actionClick",g)},[g.subheading?($(),R("div",Tne,je(g.subheading),1)):ge("",!0),Z("h3",Pne,je(g.name),1),g.desc?($(),R("div",Lne,je(g.desc),1)):ge("",!0)],8,kne))),128))])):ge("",!0)],4)],8,wne),d.value?($(),Ie(Sg,{key:0,"display-close-button":!0,onClose:m[0]||(m[0]=g=>d.value=void 0)},{default:Xe(()=>[Z("img",{src:d.value,alt:"Full size image",class:"image-modal-img"},null,8,Vne)]),_:1})):ge("",!0)],64))}}),dm=ke(One,[["__scopeId","data-v-5d4e07d9"]]),Hne=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Rne=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Nne=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Dne=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],um=(e,t,a)=>{let n=e;return typeof t=="string"||Array.isArray(t)?n=e.toLocaleString(t,a):(t===!0||a!==void 0)&&(n=e.toLocaleString(void 0,a)),n};function fl(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};const a=t.bits?t.binary?Dne:Nne:t.binary?Rne:Hne,n=t.space?" ":"";if(t.signed&&e===0)return` 0${n}${a[0]}`;const r=e<0,o=r?"-":t.signed?"+":"";r&&(e=-e);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),e<1){const d=um(e,t.locale,s);return o+d+n+a[0]}const i=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),a.length-1);e/=(t.binary?1024:1e3)**i,s||(e=e.toPrecision(3));const l=um(Number(e),t.locale,s),c=a[i];return o+l+n+c}const Bne={class:"filesArea"},Fne={key:1,class:"list"},jne=["title"],Une={class:"size"},zne={class:"filesButtons"},qne={key:0,class:"sizeExceededMessage"},Wne={key:1,class:"pastedImagesArea"},Zne={class:"pastedImagesList"},Kne=["src"],Gne={class:"inputArea"},Jne={class:"inputButtons"},Xne="A chatbot component to build human-to-AI interactions.",Yne=`
8186
8186
  def handle_message_simple(payload, state):
8187
8187
 
8188
8188
  # payload contains a dict in the form { "role": "user", "message": "hello"}
@@ -8295,8 +8295,8 @@ def handle_file_upload(state, payload):
8295
8295
  def handle_tag_click(state, payload):
8296
8296
  state["selected_tag_id"] = payload`,lre="A component to display coloured tag pills.",cre={writer:{name:"Tags",description:lre,category:"Content",fields:{tags:{name:"Tags",desc:"Key-value object with tags. Must be a JSON string or a state reference to a dictionary.",type:Q.KeyValue,default:"{}"},referenceColor:{name:"Reference",desc:"The colour to be used as reference for chroma and luminance, and as the starting point for hue rotation.",type:Q.Color,default:Ht.Blue5,category:ot.Style},seed:{name:"Seed value",desc:"Choose a different value to reshuffle colours.",type:Q.Number,default:"1",category:ot.Style},rotateHue:Ut({name:"Rotate hue",desc:"If active, rotates the hue depending on the content of the string. If turned off, the reference colour is always used.",default:"yes",category:ot.Style}),primaryTextColor:ua,cssClasses:mt},events:{"wf-tag-click":{desc:"Triggered when a tag is clicked.",stub:ire.trim(),eventPayloadExample:"tagKey"}},previewField:"text"}},dre=$e({...cre,__name:"CoreTags",setup(e){ji(h=>({"89f17936":l.value?"pointer":"auto"}));const t=[{h:-78,s:-34,l:16},{h:-61,s:-37,l:16},{h:-2,s:0,l:24},{h:-12,s:0,l:29},{h:28,s:-20,l:24},{h:-61,s:-95,l:25},{h:-173,s:0,l:16},{h:-228,s:0,l:22},{h:69,s:0,l:25},{h:70,s:0,l:29}],a=pt("rootEl"),n=re(ne.evaluatedFields),r=re(ne.componentId),o=re(ne.core),s=re(ne.isBeingEdited),{isLinked:i}=mg(o,r,"wf-tag-click"),l=H(()=>{var f;return i.value?!0:typeof((f=o.getComponentById(r).handlers)==null?void 0:f["wf-tag-click"])<"u"});function c(h){if(!n.rotateHue.value)return n.referenceColor.value;const f=Ig(n.referenceColor.value),m=t[d(h)];return f.set("hsl.h",`${Math.sign(m.h)==-1?"-":"+"}${Math.abs(m.h)}`).set("hsl.s",`${Math.sign(m.s)==-1?"-":"+"}${Math.abs(m.s/100)}`).set("hsl.l",`${Math.sign(m.l)==-1?"-":"+"}${Math.abs(m.l/100)}`).css()}function d(h){let f=n.seed.value*52673&4294967295;for(let g=0;g<h.length;g++)f=(g+1)*h.charCodeAt(g)^f&4294967295;return Math.abs(f)%t.length}function u(h){const f=new CustomEvent("wf-tag-click",{detail:{payload:h}});a.value.dispatchEvent(f)}return(h,f)=>E(s)||Object.entries(E(n).tags.value??[]).length>0?($(),R("div",{key:0,ref_key:"rootEl",ref:a,class:"CoreTags"},[Object.entries(E(n).tags.value??[]).length>0?($(!0),R(Je,{key:0},Ot(E(n).tags.value,(m,g)=>($(),R("p",{key:g,class:"CoreTags__tag",style:bt({background:c(g)}),onClick:_=>u(g)},[Z("span",{"data-writer-tooltip":m,"data-writer-tooltip-strategy":"overflow"},je(m),9,ore)],12,rre))),128)):($(),R("p",sre,f[0]||(f[0]=[Z("span",null,"Empty Tags",-1)])))],512)):ge("",!0)}}),ure=ke(dre,[["__scopeId","data-v-b71b9399"]]),hre={class:"info"},pre={key:1,class:"caption"},fre={class:"container","data-writer-container":""},mre=`
8297
8297
  def handle_avatar_click():
8298
- print("The avatar was clicked")`,vre="A component to display user avatars.",gre={writer:{deprecated:!0,name:"Avatar",description:vre,category:"Content",allowedChildrenTypes:["*"],fields:{name:{name:"Name",type:Q.Text},imageSrc:{name:"Image source",desc:"A valid URL. Alternatively, you can provide a state reference to a packed file.",type:Q.Text},caption:{name:"Caption",desc:"Add an optional caption under the name, such as the person's job title.",type:Q.Text},size:{name:"Size",type:Q.Text,options:{small:"Small",medium:"Medium",large:"Large"},default:"medium",category:ot.Style},orientation:{name:"Orientation",type:Q.Text,options:{horizontal:"Horizontal",vertical:"Vertical"},default:"horizontal",category:ot.Style},primaryTextColor:ua,secondaryTextColor:In,separatorColor:wa,cssClasses:mt},events:{"wf-click":{desc:"Triggered when the avatar is clicked.",stub:mre.trim()}},previewField:"text"}},yre=$e({...gre,__name:"CoreAvatar",setup(e){ji(l=>({"220148ac":o.value?"pointer":"auto"}));const t=pt("rootEl"),a=re(ne.evaluatedFields),n=re(ne.componentId),r=re(ne.core),o=H(()=>{var c;return typeof((c=r.getComponentById(n).handlers)==null?void 0:c["wf-click"])<"u"}),s=H(()=>({backgroundImage:a.imageSrc.value?`url(${a.imageSrc.value})`:"none",cursor:o.value?"pointer":"auto"}));function i(l){const c=Zi(l);t.value.dispatchEvent(c)}return(l,c)=>($(),R("div",{ref_key:"rootEl",ref:t,class:ft(["CoreAvatar",[E(a).size.value,E(a).orientation.value]])},[Z("div",{class:"image",style:bt(s.value),onClick:i},[E(a).imageSrc.value?ge("",!0):($(),Ie(_t,{key:0,name:"circle-user-round"}))],4),Z("div",hre,[E(a).name.value?($(),R("div",{key:0,class:"name",onClick:i},je(E(a).name.value),1)):ge("",!0),E(a).caption.value?($(),R("div",pre,je(E(a).caption.value),1)):ge("",!0),Z("div",fre,[qt(l.$slots,"default",{},void 0,!0)])])],2))}}),Mre=ke(yre,[["__scopeId","data-v-1a2cbd13"]]),_re={key:0,class:"CoreAnnotatedText__annotation__subject"},bre={writer:{name:"Annotated text",description:"Shows text with annotations",category:"Content",fields:{text:{name:"Annotated text",type:Q.Object,desc:"Value array with text/annotations. Must be a JSON string or a state reference to an array.",init:`["This ",["is", "Verb"]," some ",["annotated", "Adjective"], ["text", "Noun"]," for those of ",["you", "Pronoun"]," who ",["like", "Verb"]," this sort of ",["thing", "Noun"],". ","And here's a ",["word", "", "#faf"]," with a fancy background but no label."]`,validator:KE},referenceColor:{name:"Reference",desc:"The colour to be used as reference for chroma and luminance, and as the starting point for hue rotation.",type:Q.Color,default:Ht.Blue5,category:ot.Style},seed:{name:"Seed value",desc:"Choose a different value to reshuffle colours.",type:Q.Number,default:"1",category:ot.Style},rotateHue:Ut({name:"Rotate hue",desc:"If active, rotates the hue depending on the content of the string. If turned off, the reference colour is always used.",default:"yes",category:ot.Style}),useMarkdown:Ut({name:"Enable markdown",desc:"If active, the output will be sanitized; unsafe elements will be removed.",default:"no"}),copyButtons:xd({default:"no"}),buttonColor:cr,buttonTextColor:dr,primaryTextColor:ua,cssClasses:mt},previewField:"data"}},wre=$e({...bre,__name:"CoreAnnotatedText",setup(e){const t=sr({loader:()=>zt(()=>import("./SharedCopyClipboardButton-BAhxC5LU.js"),__vite__mapDeps([3,4,5,6,7,8]),import.meta.url)}),a=re(ne.evaluatedFields),n=H(()=>a.text.value??[]),r=re(ne.isBeingEdited),o=re(ne.componentId),s=H(()=>!a.text.value),i=H(()=>!s.value||r.value),l=H(()=>!!a.useMarkdown.value),c=[{h:-78,s:-34,l:16},{h:-61,s:-37,l:16},{h:-2,s:0,l:24},{h:-12,s:0,l:29},{h:28,s:-20,l:24},{h:-61,s:-95,l:25},{h:-173,s:0,l:16},{h:-228,s:0,l:22},{h:69,s:0,l:25},{h:70,s:0,l:29}];let d=[...c],u={},h=a.seed.value;function f(){const S=ye("");We([l,n],async()=>{if(!l.value)return S.value="";S.value=await F()},{immediate:!0});function L(te){const[J,be]=te,oe=be?`<span class="CoreAnnotatedText__annotation__subject">${be}</span>`:"";return`<span class="CoreAnnotatedText__annotation" style="background: ${b(te)}">${J}${oe}</span>`}async function F(){const te=n.value.reduce((be,oe)=>typeof oe=="string"?`${be} ${oe}`:Array.isArray(oe)?`${be} ${L(oe)}`:be,"");return await(await zt(()=>import("./marked.esm-273vDTCT.js"),[],import.meta.url)).parse(te)}return jt(S)}const m=f();function g(S,L){return S.set("hsl.h",`${Math.sign(L.h)==-1?"-":"+"}${Math.abs(L.h)}`).set("hsl.s",`${Math.sign(L.s)==-1?"-":"+"}${Math.abs(L.s/100)}`).set("hsl.l",`${Math.sign(L.l)==-1?"-":"+"}${Math.abs(L.l/100)}`).css()}function _(S,L=c.length){let F=a.seed.value*52673&4294967295;for(let J=0;J<S.length;J++)F=(J+1)*S.charCodeAt(J)^F&4294967295;return Math.abs(F)%L}function b(S){return S[2]||v(S[1])}function v(S){if(!a.rotateHue.value)return a.referenceColor.value;const L=Ig(a.referenceColor.value);if(h!==a.seed.value&&(d=[...c],u={},h=a.seed.value),u[S])return g(L,u[S]);d.length===0&&(d=[...c]);const F=_(S,d.length),te=d[F];return u[S]=te,d.splice(F,1),g(L,te)}const y=H(()=>n.value.reduce((S,L)=>typeof L=="string"?S+L:S+L[0],"")),M=H(()=>{try{return JSON.stringify(n.value)}catch{return n.value.join("")}}),x=H(()=>[{label:"Copy text",value:y.value},{label:"Copy JSON",value:M.value}]);return(S,L)=>i.value?($(),Ie($d,{key:0,class:"CoreAnnotatedText"},{actions:Xe(()=>[E(a).copyButtons.value?($(),Ie(E(t),{key:0,options:x.value},null,8,["options"])):ge("",!0)]),default:Xe(()=>[l.value?($(),Ie(Z3,{key:0,"raw-markdown":E(m),class:"CoreAnnotatedText__markdown"},null,8,["raw-markdown"])):($(),R(Je,{key:1},[s.value?($(),Ie(Sd,{key:0,"component-id":E(o)},null,8,["component-id"])):ge("",!0),($(!0),R(Je,null,Ot(n.value,(F,te)=>($(),R("span",{key:String(F)+te},[typeof F=="string"?($(),R(Je,{key:0},[pa(je(F),1)],64)):ge("",!0),Array.isArray(F)?($(),R("span",{key:1,class:"CoreAnnotatedText__annotation",style:bt({backgroundColor:b(F)})},[pa(je(F[0])+" ",1),F[1]?($(),R("span",_re,je(F[1]),1)):ge("",!0)],4)):ge("",!0)]))),128))],64))]),_:1})):ge("",!0)}}),xre=ke(wre,[["__scopeId","data-v-a540a40b"]]);function kg(e){return wl()?(Xc(e),!0):!1}const Wl=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Cre=Object.prototype.toString,Are=e=>Cre.call(e)==="[object Object]";function Sre(e){let t;function a(){return t||(t=e()),t}return a.reset=async()=>{const n=t;t=void 0,n&&await n},a}function X2(e){return Array.isArray(e)?e:[e]}function $re(e,t,a={}){const{immediate:n=!0,immediateCallback:r=!1}=a,o=$t(!1);let s;function i(){s&&(clearTimeout(s),s=void 0)}function l(){o.value=!1,i()}function c(...d){r&&e(),i(),o.value=!0,s=setTimeout(()=>{o.value=!1,s=void 0,e(...d)},Pa(t))}return n&&(o.value=!0,Wl&&c()),kg(l),{isPending:Fr(o),start:c,stop:l}}function Ere(e,t,a){return We(e,t,{...a,immediate:!0})}const Ire=Wl?window:void 0,Tg=Wl?window.navigator:void 0;function kre(e){var t;const a=Pa(e);return(t=a==null?void 0:a.$el)!=null?t:a}function is(...e){const t=[],a=()=>{t.forEach(i=>i()),t.length=0},n=(i,l,c,d)=>(i.addEventListener(l,c,d),()=>i.removeEventListener(l,c,d)),r=H(()=>{const i=X2(Pa(e[0])).filter(l=>l!=null);return i.every(l=>typeof l!="string")?i:void 0}),o=Ere(()=>{var i,l;return[(l=(i=r.value)==null?void 0:i.map(c=>kre(c)))!=null?l:[Ire].filter(c=>c!=null),X2(Pa(r.value?e[1]:e[0])),X2(E(r.value?e[2]:e[1])),Pa(r.value?e[3]:e[2])]},([i,l,c,d])=>{if(a(),!(i!=null&&i.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const u=Are(d)?{...d}:d;t.push(...i.flatMap(h=>l.flatMap(f=>c.map(m=>n(h,f,m,u)))))},{flush:"post"}),s=()=>{o(),a()};return kg(a),s}function Tre(){const e=$t(!1),t=gn();return t&&ia(()=>{e.value=!0},t),e}function Pg(e){const t=Tre();return H(()=>(t.value,!!e()))}function pm(e,t={}){const{controls:a=!1,navigator:n=Tg}=t,r=Pg(()=>n&&"permissions"in n),o=$t(),s=typeof e=="string"?{name:e}:e,i=$t(),l=()=>{var d,u;i.value=(u=(d=o.value)==null?void 0:d.state)!=null?u:"prompt"};is(o,"change",l,{passive:!0});const c=Sre(async()=>{if(r.value){if(!o.value)try{o.value=await n.permissions.query(s)}catch{o.value=void 0}finally{l()}if(a)return St(o.value)}});return c(),a?{state:i,isSupported:r,query:c}:i}function Lg(e={}){const{navigator:t=Tg,read:a=!1,source:n,copiedDuring:r=1500,legacy:o=!1}=e,s=Pg(()=>t&&"clipboard"in t),i=pm("clipboard-read"),l=pm("clipboard-write"),c=H(()=>s.value||o),d=$t(""),u=$t(!1),h=$re(()=>u.value=!1,r,{immediate:!1});async function f(){let v=!(s.value&&b(i.value));if(!v)try{d.value=await t.clipboard.readText()}catch{v=!0}v&&(d.value=_())}c.value&&a&&is(["copy","cut"],f,{passive:!0});async function m(v=Pa(n)){if(c.value&&v!=null){let y=!(s.value&&b(l.value));if(!y)try{await t.clipboard.writeText(v)}catch{y=!0}y&&g(v),d.value=v,u.value=!0,h.start()}}function g(v){const y=document.createElement("textarea");y.value=v??"",y.style.position="absolute",y.style.opacity="0",document.body.appendChild(y),y.select(),document.execCommand("copy"),y.remove()}function _(){var v,y,M;return(M=(y=(v=document==null?void 0:document.getSelection)==null?void 0:v.call(document))==null?void 0:y.toString())!=null?M:""}function b(v){return v==="granted"||v==="prompt"}return{isSupported:c,text:d,copied:u,copy:m}}function Pre(e,t={}){var a,n;const r=$t(!1),o=$t(null);let s=0,i=!0;if(Wl){const l=typeof t=="function"?{onDrop:t}:t,c=(a=l.multiple)!=null?a:!0,d=(n=l.preventDefaultForUnhandled)!=null?n:!1,u=_=>{var b,v;const y=Array.from((v=(b=_.dataTransfer)==null?void 0:b.files)!=null?v:[]);return y.length===0?null:c?y:[y[0]]},h=_=>{const b=E(l.dataTypes);return typeof b=="function"?b(_):b!=null&&b.length?_.length===0?!1:_.every(v=>b.some(y=>v.includes(y))):!0},f=_=>{const b=Array.from(_??[]).map(M=>M.type),v=h(b),y=c||_.length<=1;return v&&y},m=()=>/^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent)&&!("chrome"in window),g=(_,b)=>{var v,y,M,x,S,L;const F=(v=_.dataTransfer)==null?void 0:v.items;if(i=(y=F&&f(F))!=null?y:!1,d&&_.preventDefault(),!m()&&!i){_.dataTransfer&&(_.dataTransfer.dropEffect="none");return}_.preventDefault(),_.dataTransfer&&(_.dataTransfer.dropEffect="copy");const te=u(_);switch(b){case"enter":s+=1,r.value=!0,(M=l.onEnter)==null||M.call(l,null,_);break;case"over":(x=l.onOver)==null||x.call(l,null,_);break;case"leave":s-=1,s===0&&(r.value=!1),(S=l.onLeave)==null||S.call(l,null,_);break;case"drop":s=0,r.value=!1,i&&(o.value=te,(L=l.onDrop)==null||L.call(l,te,_));break}};is(e,"dragenter",_=>g(_,"enter")),is(e,"dragover",_=>g(_,"over")),is(e,"dragleave",_=>g(_,"leave")),is(e,"drop",_=>g(_,"drop"))}return{files:o,isOverDropZone:r}}function Zl(e){return!!(["string","number","boolean"].includes(typeof e)||e===null)}function Vg(e){return Zl(e)?!1:Array.isArray(e)}function Og(e){return Tr(e)}function Hg(e){return Zl(e)?1:Object.keys(e).length}function Rg(e){return typeof e.open=="boolean"&&Array.isArray(e.path)}const Lre=["open","disabled"],Vre={class:"SharedCollapsible__summary"},Ore={class:"content"},Hre=$e({__name:"SharedCollapsible",props:{open:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},icons:{type:Object,required:!1,default:void 0}},emits:{toggle:e=>typeof e=="boolean"},setup(e,{emit:t}){const a=e,n=t,r=ye(a.open);We(mn(a,"open"),i=>r.value=i);const o=H(()=>{if(a.icons!==void 0)return r.value?a.icons.open:a.icons.close});function s(i){const l=i.newState==="open";r.value=l,n("toggle",l)}return(i,l)=>($(),R("details",{class:ft(["SharedCollapsible",{"SharedCollapsible--customMarker":e.icons}]),open:r.value,disabled:e.disabled,onToggle:s},[Z("summary",Vre,[e.icons?($(),Ie(_t,{key:0,name:o.value},null,8,["name"])):ge("",!0),qt(i.$slots,"title",{},void 0,!0)]),Z("div",Ore,[qt(i.$slots,"content",{},void 0,!0)])],42,Lre))}}),Rre=ke(Hre,[["__scopeId","data-v-e02188e5"]]),Nre=$e({__name:"SharedJsonViewerChildrenCounter",props:{data:{type:[String,Number,Boolean,Object,Array,null],required:!0}},setup(e){const t=e,a=o=>`Object{${o}}`,n=o=>`Array[${o}]`,r=H(()=>{const o=Hg(t.data);return o===0?a(0):Vg(t.data)?n(o):Og(t.data)?a(o):a(0)});return(o,s)=>($(),R("span",null,je(r.value),1))}}),Ng=ke(Nre,[["__scopeId","data-v-2641ae29"]]),Dre={class:"SharedJsonViewerCollapsible__title"},Bre={key:0},Fre={class:"SharedJsonViewerCollapsible__content"},jre=$e({__name:"SharedJsonViewerCollapsible",props:{open:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},title:{type:String,required:!1,default:void 0},data:{type:[String,Number,Boolean,Object,Array,null],required:!1,default:void 0}},emits:{toggle:e=>typeof e=="boolean"},setup(e){return(t,a)=>($(),Ie(Rre,{open:e.open,disabled:e.disabled,icons:{close:"chevron-right",open:"chevron-down"},onToggle:a[0]||(a[0]=n=>t.$emit("toggle",n))},{title:Xe(()=>[Z("div",Dre,[e.title?($(),R("span",Bre,je(e.title),1)):ge("",!0),e.data?($(),Ie(Ng,{key:1,data:e.data},null,8,["data"])):ge("",!0)])]),content:Xe(()=>[Z("div",Fre,[qt(t.$slots,"default",{},void 0,!0)])]),_:3},8,["open","disabled"]))}}),Dg=ke(jre,[["__scopeId","data-v-f7561f2f"]]),Ure={class:"SharedJsonViewerValue"},zre=$e({__name:"SharedJsonViewerValue",props:{data:{type:[String,Number,Boolean,Object,Array,null],required:!0},maxValueLength:{type:Number,default:1e3}},setup(e){const t=e,a=H(()=>{const n=JSON.stringify(t.data);return n.length<=t.maxValueLength?n:`${n.slice(0,t.maxValueLength)}..."`});return(n,r)=>($(),R("span",Ure,je(a.value),1))}}),Bg=ke(zre,[["__scopeId","data-v-6842c28f"]]),qre={class:"SharedJsonViewerObject"},Wre={key:0,class:"SharedJsonViewerObject__value"},Zre=$e({__name:"SharedJsonViewerObject",props:{data:{type:[Object,Array],required:!0},path:{type:Array,default:()=>[]},initialDepth:{type:Number,default:0}},emits:{toggle:Rg},setup(e,{emit:t}){const a=e,n=mn(a,"initialDepth"),r=t,o=ye([]),s=H(()=>a.path.length+1);We(n,()=>{if(n.value===0){o.value=[];return}if(!(n.value===-1||n.value>s.value))return;const d=new Set([...o.value,...Object.keys(a.data)]);o.value=Array.from(d)},{immediate:!0});function i(c,d){d?o.value=[...o.value,c]:o.value=o.value.filter(u=>u!==c),r("toggle",{open:d,path:[...a.path,c]})}function l(c){return o.value.includes(String(c))}return(c,d)=>($(),R("div",qre,[($(!0),R(Je,null,Ot(Object.entries(e.data),([u,h],f)=>($(),R(Je,{key:f},[E(Zl)(h)||E(Hg)(h)===0?($(),R("div",Wre,[Z("span",null,je(u),1),d[1]||(d[1]=pa(": ")),Ce(Bg,{data:h},null,8,["data"])])):($(),Ie(Dg,{key:1,open:l(u),title:u,data:h,onToggle:m=>i(u,m)},{default:Xe(()=>[l(u)?($(),Ie(jg,{key:0,data:h,path:[...e.path,u],"initial-depth":n.value,onToggle:d[0]||(d[0]=m=>c.$emit("toggle",m))},null,8,["data","path","initial-depth"])):ge("",!0)]),_:2},1032,["open","title","data","onToggle"]))],64))),128))]))}}),fm=ke(Zre,[["__scopeId","data-v-72c975d1"]]);function Fg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Kre(e,t){return t.search(new RegExp(`(^|\\n)\\s*"?${Fg(e)}"?\\s*:\\s*`))}function Gre(e,t){return t.search(new RegExp(`(^|\\n)\\s*"?${Fg(e)}"?\\s*(\\n\\s*)?(Object\\{\\d+\\}|Array\\[\\d+\\])`))}function Jre(e,t){const a=[];return Object.keys(e).forEach(n=>{const r=Kre(n,t);r!==-1&&a.push({type:"key-value",key:n,index:r});const o=Gre(n,t);o!==-1&&a.push({type:"collapsed",key:n,index:o})}),a.sort((n,r)=>n.index-r.index),a}function Xre(e,t,a){const n=new Map;Object.entries(e).forEach(([o,s])=>{n.set(o,Tr(s)?new Set(Object.keys(s)):new Set)});const r=[];return a.forEach((o,s)=>{if(o.type!=="collapsed")return;const i=n.get(o.key)??new Set;let l=t.length;for(let c=s+1;c<a.length;c++){const d=a[c];if(!(d.index<=o.index)){if(d.type==="collapsed"){l=d.index;break}if(d.type==="key-value"&&!i.has(d.key)){l=d.index;break}}}r.push({key:o.key,startIndex:o.index,endIndex:l})}),r}function Yre(e,t){const a=new Set;return e.forEach(n=>{if(n.type!=="key-value")return;t.some(o=>n.index>=o.startIndex&&n.index<o.endIndex)||a.add(n.key)}),a}function Qre(e,t){return t.find(n=>n.key===e.key&&n.startIndex===e.index)??t.find(n=>n.key===e.key)??null}function Dc(e,t){const a=Jre(e,t),n=Xre(e,t,a),r=Yre(a,n),o={array:[],object:{}};function s(l,c){o.array.push(c),o.object[l]=c}a.forEach(l=>{if(l.key in o.object)return;const c=e[l.key];switch(l.type){case"key-value":{r.has(l.key)&&s(l.key,c);break}case"collapsed":{const d=Qre(l,n),u=d?t.slice(d.startIndex,d.endIndex):t;if(!Tr(c)){s(l.key,c);break}const h=Dc(c,u),f=h.array.length>0||Object.keys(h.object).length>0;s(l.key,f?h.object:c);break}}});const i=o.array.length===0||Object.keys(o.object).length===0;return a.length>0&&i&&Object.entries(e).forEach(([l,c])=>{s(l,c)}),{array:o.array,object:o.object,tokenCount:a.length}}function eoe(e,t){const a=t.replace(/\r\n/g,`
8299
- `);if(Tr(e)){const{object:n}=Dc(e,a);return n}if(Array.isArray(e)){const n={};e.forEach((i,l)=>{n[String(l)]=i});const{array:r,tokenCount:o}=Dc(n,a);if(r.length>0)return r;const s=/(^|\n)\s*Array\[\d+\]/;return o>0||s.test(a)?e.slice():[]}return{}}const jg=$e({__name:"SharedJsonViewer",props:{data:{type:[String,Number,Boolean,Object,Array,null],required:!0},path:{type:Array,default:()=>[]},hideRoot:{type:Boolean,required:!1},initialDepth:{type:Number,default:0},enableCopyToJson:{type:Boolean,required:!1}},emits:{toggle:Rg},setup(e){const t=sr({loader:()=>zt(()=>import("./SharedCopyClipboardButton-BAhxC5LU.js"),__vite__mapDeps([3,4,5,6,7,8]),import.meta.url)}),a=e,n=H(()=>a.path.length===0&&!a.hideRoot),r=H(()=>a.initialDepth===-1||a.initialDepth>0);function o(d){if(d===void 0)return JSON.stringify(null);try{return JSON.stringify(d,null,2)}catch{return JSON.stringify(null)}}const s=H(()=>o(a.data)),{copy:i}=Lg();function l(d){return Array.isArray(d)?d.length===0:Tr(d)?Object.keys(d).length===0:!1}function c(d,u){var m;d.stopPropagation();const h=(((m=window.getSelection())==null?void 0:m.toString())??"").trim();if(!h)return;const f=eoe(u,h);l(f)||(d.preventDefault(),i(o(f)))}return(d,u)=>($(),Ie($d,null,{actions:Xe(()=>[e.enableCopyToJson?($(),Ie(E(t),{key:0,label:"Copy JSON",value:s.value},null,8,["value"])):ge("",!0)]),default:Xe(()=>[E(Og)(e.data)||E(Vg)(e.data)?($(),R(Je,{key:0},[n.value?($(),Ie(Dg,{key:0,open:r.value,data:e.data,onToggle:u[1]||(u[1]=h=>d.$emit("toggle",{path:[],open:h})),onCopy:u[2]||(u[2]=h=>c(h,e.data))},{default:Xe(()=>[Ce(fm,{data:e.data,path:e.path,"initial-depth":e.initialDepth,onToggle:u[0]||(u[0]=h=>d.$emit("toggle",h))},null,8,["data","path","initial-depth"])]),_:1},8,["open","data"])):($(),Ie(fm,{key:1,data:e.data,path:e.path,"initial-depth":e.initialDepth,onToggle:u[3]||(u[3]=h=>d.$emit("toggle",h)),onCopy:u[4]||(u[4]=h=>c(h,e.data))},null,8,["data","path","initial-depth"]))],64)):E(Zl)(e.data)?($(),Ie(Bg,{key:1,data:e.data},null,8,["data"])):($(),Ie(Ng,{key:2,data:{}}))]),_:1}))}}),toe={class:"CoreJsonViewer"},aoe="A component to explore JSON data as a hierarchy.",noe={name:"JSON Viewer",description:"A JSON tree viewer where you can expand the keys.",sample:{description:"This sample is opened by default",bool:!0,null:null,list:[1,"two",{key:3}]},sampleClosed:{description:"This sample is not opened by default"},createdAt:new Date},roe={name:"JSON viewer",description:aoe,category:"Content",fields:{data:{name:"Data",init:JSON.stringify(noe),type:Q.Object},initialDepth:{name:"Initial depth",desc:"Sets the initial viewing depth of the JSON tree hierarchy. Use -1 to display the full hierarchy.",type:Q.Number,init:"0",validator:fn},hideRoot:Ut({name:"Hide root",desc:"Don't show the type of the root node when it's an Object or an Array.",default:"no",category:ot.Style}),copy:xd({default:"no"}),jsonViewerIndentationSpacing:{name:"JSON indentation",type:Q.Width,category:ot.Style,applyStyleVariable:!0,validator:ig},secondaryTextColor:In,separatorColor:wa,cssClasses:mt},previewField:"data"},ooe={writer:roe},soe=$e({...ooe,__name:"CoreJsonViewer",setup(e){const t=re(ne.evaluatedFields),a=H(()=>t.data.value),n=H(()=>Number(t.initialDepth.value)||0);return(r,o)=>($(),R("div",toe,[Ce(jg,{data:a.value??{},"initial-depth":n.value,"enable-copy-to-json":E(t).copy.value,"hide-root":E(t).hideRoot.value},null,8,["data","initial-depth","enable-copy-to-json","hide-root"])]))}});function ioe(e,t={minimumFractionDigits:0,maximumFractionDigits:1}){const a=new Intl.NumberFormat(void 0,{style:"percent",...t});return H(()=>a.format(e.value))}const loe=["aria-valuetext","aria-valuemin","aria-valuemax","aria-valuenow","aria-busy","tabindex"],coe={key:0,class:"CoreProgressBar__title"},doe={key:0,class:"CoreProgressBar__title__label"},uoe={key:1,class:"CoreProgressBar__title__progress"},hoe={class:"CoreProgressBar__bar"},poe=`
8298
+ print("The avatar was clicked")`,vre="A component to display user avatars.",gre={writer:{deprecated:!0,name:"Avatar",description:vre,category:"Content",allowedChildrenTypes:["*"],fields:{name:{name:"Name",type:Q.Text},imageSrc:{name:"Image source",desc:"A valid URL. Alternatively, you can provide a state reference to a packed file.",type:Q.Text},caption:{name:"Caption",desc:"Add an optional caption under the name, such as the person's job title.",type:Q.Text},size:{name:"Size",type:Q.Text,options:{small:"Small",medium:"Medium",large:"Large"},default:"medium",category:ot.Style},orientation:{name:"Orientation",type:Q.Text,options:{horizontal:"Horizontal",vertical:"Vertical"},default:"horizontal",category:ot.Style},primaryTextColor:ua,secondaryTextColor:In,separatorColor:wa,cssClasses:mt},events:{"wf-click":{desc:"Triggered when the avatar is clicked.",stub:mre.trim()}},previewField:"text"}},yre=$e({...gre,__name:"CoreAvatar",setup(e){ji(l=>({"220148ac":o.value?"pointer":"auto"}));const t=pt("rootEl"),a=re(ne.evaluatedFields),n=re(ne.componentId),r=re(ne.core),o=H(()=>{var c;return typeof((c=r.getComponentById(n).handlers)==null?void 0:c["wf-click"])<"u"}),s=H(()=>({backgroundImage:a.imageSrc.value?`url(${a.imageSrc.value})`:"none",cursor:o.value?"pointer":"auto"}));function i(l){const c=Zi(l);t.value.dispatchEvent(c)}return(l,c)=>($(),R("div",{ref_key:"rootEl",ref:t,class:ft(["CoreAvatar",[E(a).size.value,E(a).orientation.value]])},[Z("div",{class:"image",style:bt(s.value),onClick:i},[E(a).imageSrc.value?ge("",!0):($(),Ie(_t,{key:0,name:"circle-user-round"}))],4),Z("div",hre,[E(a).name.value?($(),R("div",{key:0,class:"name",onClick:i},je(E(a).name.value),1)):ge("",!0),E(a).caption.value?($(),R("div",pre,je(E(a).caption.value),1)):ge("",!0),Z("div",fre,[qt(l.$slots,"default",{},void 0,!0)])])],2))}}),Mre=ke(yre,[["__scopeId","data-v-1a2cbd13"]]),_re={key:0,class:"CoreAnnotatedText__annotation__subject"},bre={writer:{name:"Annotated text",description:"Shows text with annotations",category:"Content",fields:{text:{name:"Annotated text",type:Q.Object,desc:"Value array with text/annotations. Must be a JSON string or a state reference to an array.",init:`["This ",["is", "Verb"]," some ",["annotated", "Adjective"], ["text", "Noun"]," for those of ",["you", "Pronoun"]," who ",["like", "Verb"]," this sort of ",["thing", "Noun"],". ","And here's a ",["word", "", "#faf"]," with a fancy background but no label."]`,validator:KE},referenceColor:{name:"Reference",desc:"The colour to be used as reference for chroma and luminance, and as the starting point for hue rotation.",type:Q.Color,default:Ht.Blue5,category:ot.Style},seed:{name:"Seed value",desc:"Choose a different value to reshuffle colours.",type:Q.Number,default:"1",category:ot.Style},rotateHue:Ut({name:"Rotate hue",desc:"If active, rotates the hue depending on the content of the string. If turned off, the reference colour is always used.",default:"yes",category:ot.Style}),useMarkdown:Ut({name:"Enable markdown",desc:"If active, the output will be sanitized; unsafe elements will be removed.",default:"no"}),copyButtons:xd({default:"no"}),buttonColor:cr,buttonTextColor:dr,primaryTextColor:ua,cssClasses:mt},previewField:"data"}},wre=$e({...bre,__name:"CoreAnnotatedText",setup(e){const t=sr({loader:()=>zt(()=>import("./SharedCopyClipboardButton-CXfaup9Y.js"),__vite__mapDeps([3,4,5,6,7,8]),import.meta.url)}),a=re(ne.evaluatedFields),n=H(()=>a.text.value??[]),r=re(ne.isBeingEdited),o=re(ne.componentId),s=H(()=>!a.text.value),i=H(()=>!s.value||r.value),l=H(()=>!!a.useMarkdown.value),c=[{h:-78,s:-34,l:16},{h:-61,s:-37,l:16},{h:-2,s:0,l:24},{h:-12,s:0,l:29},{h:28,s:-20,l:24},{h:-61,s:-95,l:25},{h:-173,s:0,l:16},{h:-228,s:0,l:22},{h:69,s:0,l:25},{h:70,s:0,l:29}];let d=[...c],u={},h=a.seed.value;function f(){const S=ye("");We([l,n],async()=>{if(!l.value)return S.value="";S.value=await F()},{immediate:!0});function L(te){const[J,be]=te,oe=be?`<span class="CoreAnnotatedText__annotation__subject">${be}</span>`:"";return`<span class="CoreAnnotatedText__annotation" style="background: ${b(te)}">${J}${oe}</span>`}async function F(){const te=n.value.reduce((be,oe)=>typeof oe=="string"?`${be} ${oe}`:Array.isArray(oe)?`${be} ${L(oe)}`:be,"");return await(await zt(()=>import("./marked.esm-273vDTCT.js"),[],import.meta.url)).parse(te)}return jt(S)}const m=f();function g(S,L){return S.set("hsl.h",`${Math.sign(L.h)==-1?"-":"+"}${Math.abs(L.h)}`).set("hsl.s",`${Math.sign(L.s)==-1?"-":"+"}${Math.abs(L.s/100)}`).set("hsl.l",`${Math.sign(L.l)==-1?"-":"+"}${Math.abs(L.l/100)}`).css()}function _(S,L=c.length){let F=a.seed.value*52673&4294967295;for(let J=0;J<S.length;J++)F=(J+1)*S.charCodeAt(J)^F&4294967295;return Math.abs(F)%L}function b(S){return S[2]||v(S[1])}function v(S){if(!a.rotateHue.value)return a.referenceColor.value;const L=Ig(a.referenceColor.value);if(h!==a.seed.value&&(d=[...c],u={},h=a.seed.value),u[S])return g(L,u[S]);d.length===0&&(d=[...c]);const F=_(S,d.length),te=d[F];return u[S]=te,d.splice(F,1),g(L,te)}const y=H(()=>n.value.reduce((S,L)=>typeof L=="string"?S+L:S+L[0],"")),M=H(()=>{try{return JSON.stringify(n.value)}catch{return n.value.join("")}}),x=H(()=>[{label:"Copy text",value:y.value},{label:"Copy JSON",value:M.value}]);return(S,L)=>i.value?($(),Ie($d,{key:0,class:"CoreAnnotatedText"},{actions:Xe(()=>[E(a).copyButtons.value?($(),Ie(E(t),{key:0,options:x.value},null,8,["options"])):ge("",!0)]),default:Xe(()=>[l.value?($(),Ie(Z3,{key:0,"raw-markdown":E(m),class:"CoreAnnotatedText__markdown"},null,8,["raw-markdown"])):($(),R(Je,{key:1},[s.value?($(),Ie(Sd,{key:0,"component-id":E(o)},null,8,["component-id"])):ge("",!0),($(!0),R(Je,null,Ot(n.value,(F,te)=>($(),R("span",{key:String(F)+te},[typeof F=="string"?($(),R(Je,{key:0},[pa(je(F),1)],64)):ge("",!0),Array.isArray(F)?($(),R("span",{key:1,class:"CoreAnnotatedText__annotation",style:bt({backgroundColor:b(F)})},[pa(je(F[0])+" ",1),F[1]?($(),R("span",_re,je(F[1]),1)):ge("",!0)],4)):ge("",!0)]))),128))],64))]),_:1})):ge("",!0)}}),xre=ke(wre,[["__scopeId","data-v-a540a40b"]]);function kg(e){return wl()?(Xc(e),!0):!1}const Wl=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Cre=Object.prototype.toString,Are=e=>Cre.call(e)==="[object Object]";function Sre(e){let t;function a(){return t||(t=e()),t}return a.reset=async()=>{const n=t;t=void 0,n&&await n},a}function X2(e){return Array.isArray(e)?e:[e]}function $re(e,t,a={}){const{immediate:n=!0,immediateCallback:r=!1}=a,o=$t(!1);let s;function i(){s&&(clearTimeout(s),s=void 0)}function l(){o.value=!1,i()}function c(...d){r&&e(),i(),o.value=!0,s=setTimeout(()=>{o.value=!1,s=void 0,e(...d)},Pa(t))}return n&&(o.value=!0,Wl&&c()),kg(l),{isPending:Fr(o),start:c,stop:l}}function Ere(e,t,a){return We(e,t,{...a,immediate:!0})}const Ire=Wl?window:void 0,Tg=Wl?window.navigator:void 0;function kre(e){var t;const a=Pa(e);return(t=a==null?void 0:a.$el)!=null?t:a}function is(...e){const t=[],a=()=>{t.forEach(i=>i()),t.length=0},n=(i,l,c,d)=>(i.addEventListener(l,c,d),()=>i.removeEventListener(l,c,d)),r=H(()=>{const i=X2(Pa(e[0])).filter(l=>l!=null);return i.every(l=>typeof l!="string")?i:void 0}),o=Ere(()=>{var i,l;return[(l=(i=r.value)==null?void 0:i.map(c=>kre(c)))!=null?l:[Ire].filter(c=>c!=null),X2(Pa(r.value?e[1]:e[0])),X2(E(r.value?e[2]:e[1])),Pa(r.value?e[3]:e[2])]},([i,l,c,d])=>{if(a(),!(i!=null&&i.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const u=Are(d)?{...d}:d;t.push(...i.flatMap(h=>l.flatMap(f=>c.map(m=>n(h,f,m,u)))))},{flush:"post"}),s=()=>{o(),a()};return kg(a),s}function Tre(){const e=$t(!1),t=gn();return t&&ia(()=>{e.value=!0},t),e}function Pg(e){const t=Tre();return H(()=>(t.value,!!e()))}function pm(e,t={}){const{controls:a=!1,navigator:n=Tg}=t,r=Pg(()=>n&&"permissions"in n),o=$t(),s=typeof e=="string"?{name:e}:e,i=$t(),l=()=>{var d,u;i.value=(u=(d=o.value)==null?void 0:d.state)!=null?u:"prompt"};is(o,"change",l,{passive:!0});const c=Sre(async()=>{if(r.value){if(!o.value)try{o.value=await n.permissions.query(s)}catch{o.value=void 0}finally{l()}if(a)return St(o.value)}});return c(),a?{state:i,isSupported:r,query:c}:i}function Lg(e={}){const{navigator:t=Tg,read:a=!1,source:n,copiedDuring:r=1500,legacy:o=!1}=e,s=Pg(()=>t&&"clipboard"in t),i=pm("clipboard-read"),l=pm("clipboard-write"),c=H(()=>s.value||o),d=$t(""),u=$t(!1),h=$re(()=>u.value=!1,r,{immediate:!1});async function f(){let v=!(s.value&&b(i.value));if(!v)try{d.value=await t.clipboard.readText()}catch{v=!0}v&&(d.value=_())}c.value&&a&&is(["copy","cut"],f,{passive:!0});async function m(v=Pa(n)){if(c.value&&v!=null){let y=!(s.value&&b(l.value));if(!y)try{await t.clipboard.writeText(v)}catch{y=!0}y&&g(v),d.value=v,u.value=!0,h.start()}}function g(v){const y=document.createElement("textarea");y.value=v??"",y.style.position="absolute",y.style.opacity="0",document.body.appendChild(y),y.select(),document.execCommand("copy"),y.remove()}function _(){var v,y,M;return(M=(y=(v=document==null?void 0:document.getSelection)==null?void 0:v.call(document))==null?void 0:y.toString())!=null?M:""}function b(v){return v==="granted"||v==="prompt"}return{isSupported:c,text:d,copied:u,copy:m}}function Pre(e,t={}){var a,n;const r=$t(!1),o=$t(null);let s=0,i=!0;if(Wl){const l=typeof t=="function"?{onDrop:t}:t,c=(a=l.multiple)!=null?a:!0,d=(n=l.preventDefaultForUnhandled)!=null?n:!1,u=_=>{var b,v;const y=Array.from((v=(b=_.dataTransfer)==null?void 0:b.files)!=null?v:[]);return y.length===0?null:c?y:[y[0]]},h=_=>{const b=E(l.dataTypes);return typeof b=="function"?b(_):b!=null&&b.length?_.length===0?!1:_.every(v=>b.some(y=>v.includes(y))):!0},f=_=>{const b=Array.from(_??[]).map(M=>M.type),v=h(b),y=c||_.length<=1;return v&&y},m=()=>/^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent)&&!("chrome"in window),g=(_,b)=>{var v,y,M,x,S,L;const F=(v=_.dataTransfer)==null?void 0:v.items;if(i=(y=F&&f(F))!=null?y:!1,d&&_.preventDefault(),!m()&&!i){_.dataTransfer&&(_.dataTransfer.dropEffect="none");return}_.preventDefault(),_.dataTransfer&&(_.dataTransfer.dropEffect="copy");const te=u(_);switch(b){case"enter":s+=1,r.value=!0,(M=l.onEnter)==null||M.call(l,null,_);break;case"over":(x=l.onOver)==null||x.call(l,null,_);break;case"leave":s-=1,s===0&&(r.value=!1),(S=l.onLeave)==null||S.call(l,null,_);break;case"drop":s=0,r.value=!1,i&&(o.value=te,(L=l.onDrop)==null||L.call(l,te,_));break}};is(e,"dragenter",_=>g(_,"enter")),is(e,"dragover",_=>g(_,"over")),is(e,"dragleave",_=>g(_,"leave")),is(e,"drop",_=>g(_,"drop"))}return{files:o,isOverDropZone:r}}function Zl(e){return!!(["string","number","boolean"].includes(typeof e)||e===null)}function Vg(e){return Zl(e)?!1:Array.isArray(e)}function Og(e){return Tr(e)}function Hg(e){return Zl(e)?1:Object.keys(e).length}function Rg(e){return typeof e.open=="boolean"&&Array.isArray(e.path)}const Lre=["open","disabled"],Vre={class:"SharedCollapsible__summary"},Ore={class:"content"},Hre=$e({__name:"SharedCollapsible",props:{open:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},icons:{type:Object,required:!1,default:void 0}},emits:{toggle:e=>typeof e=="boolean"},setup(e,{emit:t}){const a=e,n=t,r=ye(a.open);We(mn(a,"open"),i=>r.value=i);const o=H(()=>{if(a.icons!==void 0)return r.value?a.icons.open:a.icons.close});function s(i){const l=i.newState==="open";r.value=l,n("toggle",l)}return(i,l)=>($(),R("details",{class:ft(["SharedCollapsible",{"SharedCollapsible--customMarker":e.icons}]),open:r.value,disabled:e.disabled,onToggle:s},[Z("summary",Vre,[e.icons?($(),Ie(_t,{key:0,name:o.value},null,8,["name"])):ge("",!0),qt(i.$slots,"title",{},void 0,!0)]),Z("div",Ore,[qt(i.$slots,"content",{},void 0,!0)])],42,Lre))}}),Rre=ke(Hre,[["__scopeId","data-v-e02188e5"]]),Nre=$e({__name:"SharedJsonViewerChildrenCounter",props:{data:{type:[String,Number,Boolean,Object,Array,null],required:!0}},setup(e){const t=e,a=o=>`Object{${o}}`,n=o=>`Array[${o}]`,r=H(()=>{const o=Hg(t.data);return o===0?a(0):Vg(t.data)?n(o):Og(t.data)?a(o):a(0)});return(o,s)=>($(),R("span",null,je(r.value),1))}}),Ng=ke(Nre,[["__scopeId","data-v-2641ae29"]]),Dre={class:"SharedJsonViewerCollapsible__title"},Bre={key:0},Fre={class:"SharedJsonViewerCollapsible__content"},jre=$e({__name:"SharedJsonViewerCollapsible",props:{open:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},title:{type:String,required:!1,default:void 0},data:{type:[String,Number,Boolean,Object,Array,null],required:!1,default:void 0}},emits:{toggle:e=>typeof e=="boolean"},setup(e){return(t,a)=>($(),Ie(Rre,{open:e.open,disabled:e.disabled,icons:{close:"chevron-right",open:"chevron-down"},onToggle:a[0]||(a[0]=n=>t.$emit("toggle",n))},{title:Xe(()=>[Z("div",Dre,[e.title?($(),R("span",Bre,je(e.title),1)):ge("",!0),e.data?($(),Ie(Ng,{key:1,data:e.data},null,8,["data"])):ge("",!0)])]),content:Xe(()=>[Z("div",Fre,[qt(t.$slots,"default",{},void 0,!0)])]),_:3},8,["open","disabled"]))}}),Dg=ke(jre,[["__scopeId","data-v-f7561f2f"]]),Ure={class:"SharedJsonViewerValue"},zre=$e({__name:"SharedJsonViewerValue",props:{data:{type:[String,Number,Boolean,Object,Array,null],required:!0},maxValueLength:{type:Number,default:1e3}},setup(e){const t=e,a=H(()=>{const n=JSON.stringify(t.data);return n.length<=t.maxValueLength?n:`${n.slice(0,t.maxValueLength)}..."`});return(n,r)=>($(),R("span",Ure,je(a.value),1))}}),Bg=ke(zre,[["__scopeId","data-v-6842c28f"]]),qre={class:"SharedJsonViewerObject"},Wre={key:0,class:"SharedJsonViewerObject__value"},Zre=$e({__name:"SharedJsonViewerObject",props:{data:{type:[Object,Array],required:!0},path:{type:Array,default:()=>[]},initialDepth:{type:Number,default:0}},emits:{toggle:Rg},setup(e,{emit:t}){const a=e,n=mn(a,"initialDepth"),r=t,o=ye([]),s=H(()=>a.path.length+1);We(n,()=>{if(n.value===0){o.value=[];return}if(!(n.value===-1||n.value>s.value))return;const d=new Set([...o.value,...Object.keys(a.data)]);o.value=Array.from(d)},{immediate:!0});function i(c,d){d?o.value=[...o.value,c]:o.value=o.value.filter(u=>u!==c),r("toggle",{open:d,path:[...a.path,c]})}function l(c){return o.value.includes(String(c))}return(c,d)=>($(),R("div",qre,[($(!0),R(Je,null,Ot(Object.entries(e.data),([u,h],f)=>($(),R(Je,{key:f},[E(Zl)(h)||E(Hg)(h)===0?($(),R("div",Wre,[Z("span",null,je(u),1),d[1]||(d[1]=pa(": ")),Ce(Bg,{data:h},null,8,["data"])])):($(),Ie(Dg,{key:1,open:l(u),title:u,data:h,onToggle:m=>i(u,m)},{default:Xe(()=>[l(u)?($(),Ie(jg,{key:0,data:h,path:[...e.path,u],"initial-depth":n.value,onToggle:d[0]||(d[0]=m=>c.$emit("toggle",m))},null,8,["data","path","initial-depth"])):ge("",!0)]),_:2},1032,["open","title","data","onToggle"]))],64))),128))]))}}),fm=ke(Zre,[["__scopeId","data-v-72c975d1"]]);function Fg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Kre(e,t){return t.search(new RegExp(`(^|\\n)\\s*"?${Fg(e)}"?\\s*:\\s*`))}function Gre(e,t){return t.search(new RegExp(`(^|\\n)\\s*"?${Fg(e)}"?\\s*(\\n\\s*)?(Object\\{\\d+\\}|Array\\[\\d+\\])`))}function Jre(e,t){const a=[];return Object.keys(e).forEach(n=>{const r=Kre(n,t);r!==-1&&a.push({type:"key-value",key:n,index:r});const o=Gre(n,t);o!==-1&&a.push({type:"collapsed",key:n,index:o})}),a.sort((n,r)=>n.index-r.index),a}function Xre(e,t,a){const n=new Map;Object.entries(e).forEach(([o,s])=>{n.set(o,Tr(s)?new Set(Object.keys(s)):new Set)});const r=[];return a.forEach((o,s)=>{if(o.type!=="collapsed")return;const i=n.get(o.key)??new Set;let l=t.length;for(let c=s+1;c<a.length;c++){const d=a[c];if(!(d.index<=o.index)){if(d.type==="collapsed"){l=d.index;break}if(d.type==="key-value"&&!i.has(d.key)){l=d.index;break}}}r.push({key:o.key,startIndex:o.index,endIndex:l})}),r}function Yre(e,t){const a=new Set;return e.forEach(n=>{if(n.type!=="key-value")return;t.some(o=>n.index>=o.startIndex&&n.index<o.endIndex)||a.add(n.key)}),a}function Qre(e,t){return t.find(n=>n.key===e.key&&n.startIndex===e.index)??t.find(n=>n.key===e.key)??null}function Dc(e,t){const a=Jre(e,t),n=Xre(e,t,a),r=Yre(a,n),o={array:[],object:{}};function s(l,c){o.array.push(c),o.object[l]=c}a.forEach(l=>{if(l.key in o.object)return;const c=e[l.key];switch(l.type){case"key-value":{r.has(l.key)&&s(l.key,c);break}case"collapsed":{const d=Qre(l,n),u=d?t.slice(d.startIndex,d.endIndex):t;if(!Tr(c)){s(l.key,c);break}const h=Dc(c,u),f=h.array.length>0||Object.keys(h.object).length>0;s(l.key,f?h.object:c);break}}});const i=o.array.length===0||Object.keys(o.object).length===0;return a.length>0&&i&&Object.entries(e).forEach(([l,c])=>{s(l,c)}),{array:o.array,object:o.object,tokenCount:a.length}}function eoe(e,t){const a=t.replace(/\r\n/g,`
8299
+ `);if(Tr(e)){const{object:n}=Dc(e,a);return n}if(Array.isArray(e)){const n={};e.forEach((i,l)=>{n[String(l)]=i});const{array:r,tokenCount:o}=Dc(n,a);if(r.length>0)return r;const s=/(^|\n)\s*Array\[\d+\]/;return o>0||s.test(a)?e.slice():[]}return{}}const jg=$e({__name:"SharedJsonViewer",props:{data:{type:[String,Number,Boolean,Object,Array,null],required:!0},path:{type:Array,default:()=>[]},hideRoot:{type:Boolean,required:!1},initialDepth:{type:Number,default:0},enableCopyToJson:{type:Boolean,required:!1}},emits:{toggle:Rg},setup(e){const t=sr({loader:()=>zt(()=>import("./SharedCopyClipboardButton-CXfaup9Y.js"),__vite__mapDeps([3,4,5,6,7,8]),import.meta.url)}),a=e,n=H(()=>a.path.length===0&&!a.hideRoot),r=H(()=>a.initialDepth===-1||a.initialDepth>0);function o(d){if(d===void 0)return JSON.stringify(null);try{return JSON.stringify(d,null,2)}catch{return JSON.stringify(null)}}const s=H(()=>o(a.data)),{copy:i}=Lg();function l(d){return Array.isArray(d)?d.length===0:Tr(d)?Object.keys(d).length===0:!1}function c(d,u){var m;d.stopPropagation();const h=(((m=window.getSelection())==null?void 0:m.toString())??"").trim();if(!h)return;const f=eoe(u,h);l(f)||(d.preventDefault(),i(o(f)))}return(d,u)=>($(),Ie($d,null,{actions:Xe(()=>[e.enableCopyToJson?($(),Ie(E(t),{key:0,label:"Copy JSON",value:s.value},null,8,["value"])):ge("",!0)]),default:Xe(()=>[E(Og)(e.data)||E(Vg)(e.data)?($(),R(Je,{key:0},[n.value?($(),Ie(Dg,{key:0,open:r.value,data:e.data,onToggle:u[1]||(u[1]=h=>d.$emit("toggle",{path:[],open:h})),onCopy:u[2]||(u[2]=h=>c(h,e.data))},{default:Xe(()=>[Ce(fm,{data:e.data,path:e.path,"initial-depth":e.initialDepth,onToggle:u[0]||(u[0]=h=>d.$emit("toggle",h))},null,8,["data","path","initial-depth"])]),_:1},8,["open","data"])):($(),Ie(fm,{key:1,data:e.data,path:e.path,"initial-depth":e.initialDepth,onToggle:u[3]||(u[3]=h=>d.$emit("toggle",h)),onCopy:u[4]||(u[4]=h=>c(h,e.data))},null,8,["data","path","initial-depth"]))],64)):E(Zl)(e.data)?($(),Ie(Bg,{key:1,data:e.data},null,8,["data"])):($(),Ie(Ng,{key:2,data:{}}))]),_:1}))}}),toe={class:"CoreJsonViewer"},aoe="A component to explore JSON data as a hierarchy.",noe={name:"JSON Viewer",description:"A JSON tree viewer where you can expand the keys.",sample:{description:"This sample is opened by default",bool:!0,null:null,list:[1,"two",{key:3}]},sampleClosed:{description:"This sample is not opened by default"},createdAt:new Date},roe={name:"JSON viewer",description:aoe,category:"Content",fields:{data:{name:"Data",init:JSON.stringify(noe),type:Q.Object},initialDepth:{name:"Initial depth",desc:"Sets the initial viewing depth of the JSON tree hierarchy. Use -1 to display the full hierarchy.",type:Q.Number,init:"0",validator:fn},hideRoot:Ut({name:"Hide root",desc:"Don't show the type of the root node when it's an Object or an Array.",default:"no",category:ot.Style}),copy:xd({default:"no"}),jsonViewerIndentationSpacing:{name:"JSON indentation",type:Q.Width,category:ot.Style,applyStyleVariable:!0,validator:ig},secondaryTextColor:In,separatorColor:wa,cssClasses:mt},previewField:"data"},ooe={writer:roe},soe=$e({...ooe,__name:"CoreJsonViewer",setup(e){const t=re(ne.evaluatedFields),a=H(()=>t.data.value),n=H(()=>Number(t.initialDepth.value)||0);return(r,o)=>($(),R("div",toe,[Ce(jg,{data:a.value??{},"initial-depth":n.value,"enable-copy-to-json":E(t).copy.value,"hide-root":E(t).hideRoot.value},null,8,["data","initial-depth","enable-copy-to-json","hide-root"])]))}});function ioe(e,t={minimumFractionDigits:0,maximumFractionDigits:1}){const a=new Intl.NumberFormat(void 0,{style:"percent",...t});return H(()=>a.format(e.value))}const loe=["aria-valuetext","aria-valuemin","aria-valuemax","aria-valuenow","aria-busy","tabindex"],coe={key:0,class:"CoreProgressBar__title"},doe={key:0,class:"CoreProgressBar__title__label"},uoe={key:1,class:"CoreProgressBar__title__progress"},hoe={class:"CoreProgressBar__bar"},poe=`
8300
8300
  def handle_progress_bar_click():
8301
8301
  print("The Progress bar was clicked")`,foe="A component to display a progression.",moe={name:"Progress bar",description:foe,category:"Content",allowedChildrenTypes:["*"],fields:{label:{name:"Label",type:Q.Text,default:""},value:{name:"Value",type:Q.Number},min:{name:"Minimum value",type:Q.Number,default:"0"},max:{name:"Maximum value",type:Q.Number,default:"1"},displayPercentage:Ut({name:"Display percentage",default:"no",category:ot.Style}),accentColor:Ia,primaryTextColor:ua,separatorColor:wa,cssClasses:mt},events:{"wf-click":{desc:"Triggered when the Progress bar is clicked.",stub:poe.trim()}}},voe={writer:moe},goe=$e({...voe,__name:"CoreProgressBar",setup(e){const t=pt("rootEl"),a=re(ne.evaluatedFields),n=re(ne.componentId),r=re(ne.core),o=H(()=>{var g;return String((g=a.label)==null?void 0:g.value)}),s=H(()=>Number(a.value.value)),i=H(()=>Number(a.min.value)),l=H(()=>Number(a.max.value)),c=H(()=>!!a.displayPercentage.value),d=H(()=>{if(!(s.value===void 0||Number.isNaN(s.value)))return(s.value-i.value)/(l.value-i.value)}),u=ioe(d),h=H(()=>({width:d.value===void 0?void 0:`${d.value*100}%`})),f=H(()=>{var _;return typeof((_=r.getComponentById(n).handlers)==null?void 0:_["wf-click"])<"u"});function m(g){if(!f.value)return;const _=Zi(g);t.value.dispatchEvent(_)}return(g,_)=>($(),R("div",{ref_key:"rootEl",ref:t,class:ft(["CoreProgressBar",{"CoreProgressBar--clickable":f.value}]),role:"progressbar","aria-valuetext":d.value===void 0?null:E(u),"aria-valuemin":i.value,"aria-valuemax":l.value,"aria-valuenow":d.value===void 0?null:s.value,"aria-busy":d.value<1||d.value===void 0,tabindex:f.value?"0":null,onKeydown:Sr(m,["enter"]),onClick:m},[o.value||c.value?($(),R("div",coe,[o.value?($(),R("label",doe,je(o.value),1)):ge("",!0),c.value&&d.value!==void 0?($(),R("span",uoe,je(E(u)),1)):ge("",!0)])):ge("",!0),Z("div",hoe,[Z("div",{class:ft(["CoreProgressBar__bar__value",{"CoreProgressBar__bar__value--indeterminate":d.value===void 0}]),style:bt(h.value)},null,6)])],42,loe))}}),yoe=ke(goe,[["__scopeId","data-v-f479ce87"]]),Moe=/[\\]?@{([^}]*)}/;function Kl(e,t){const a=new RegExp(Moe.source,"g");function n(d,u){var _;const h=[];let f="",m=0,g=0;for(;g<d.length;){const b=d.charAt(g);b=="\\"?g+1<d.length&&(f+=d.charAt(g+1),g++):b=="."?m==0?(h.push(f),f=""):f+=b:b=="["?(m==0?(h.push(f),f=""):f+=b,m++):b=="]"?(m--,m==0?f=(_=r(f,u))==null?void 0:_.toString():f+=b):f+=b,g++}return f&&h.push(f),h}function r(d,u){let f=u?o(u):void 0;const m=(t==null?void 0:t.secrets.value)??{};let g={...e.userState.value,...m?{vault:m}:{}};const _=n(d,u);if(_[0]==="vault")return"********";for(let v=0;v<_.length;v++)f=f==null?void 0:f[_[v]],g=g==null?void 0:g[_[v]];return f??g}function o(d){var h,f;const u={};for(let m=0;m<d.length-1;m++){const g=d[m],{componentId:_}=g,{type:b}=e.getComponentById(_);if(b!=="repeater"||m+1>=d.length)continue;const v=d.slice(0,m+1),y=d.slice(0,m+2),{instanceNumber:M}=y.at(-1),x=l(v,"repeaterObject");if(!x)continue;const S=Object.entries(x),L=l(v,"keyVariable"),F=l(v,"valueVariable");u[L]=(h=S[M])==null?void 0:h[0],u[F]=(f=S[M])==null?void 0:f[1]}return u}function s(d,u){return d==null?"":d.replace(a,(f,m)=>{if(f.charAt(0)=="\\")return f.substring(1);const g=m.trim();if(!g)return"";const _=r(g,u);return typeof _>"u"?"":typeof _=="object"?JSON.stringify(_):_.toString()})}function i(d){var g;const u=(g=d.at(-1))==null?void 0:g.componentId,h=e.getComponentById(u);if(!h)return;const f={},{fields:m}=e.getComponentDefinition(h.type);if(m)return Object.keys(m).forEach(_=>{f[_]=H(()=>l(d,_))}),f}function l(d,u){var M;const{componentId:h}=d.at(-1),f=e.getComponentById(h);if(!f)return;const{fields:m}=e.getComponentDefinition(f.type),g=(M=f.content)==null?void 0:M[u],_=m[u].default,b=s(g,d),v=m[u].type,y=typeof b>"u"||b===null||b==="";if(v==Q.Object||v==Q.KeyValue||v==Q.Tools){if(!b)return JSON.parse(_||null);if(typeof b!="string")return b;try{return JSON.parse(b)}catch{return JSON.parse(_||null)}}else if(v==Q.Number){const x=_===null?null:parseFloat(_);if(y)return x??null;const S=parseFloat(b);return typeof S>"u"||Number.isNaN(S)?x??null:S}else if(v==Q.Boolean){const x=y?_:b;return x==="yes"||x==="true"}else return v==Q.IdKey?g:y?_||"":b}function c(d,u){const h=e.getComponentById(d);if(!h)return;if(typeof h.visible>"u"||h.visible.expression===!0)return!0;if(h.visible.expression===!1)return!1;const f=r(h.visible.binding,u);return h.visible.reversed===!0?!f:!!f}return{getEvaluatedFields:i,isComponentVisible:c,evaluateExpression:r}}function Va(e,t,a,n="",r){const o=ye(),s=ye(!1),i=ye(null),l=t.at(-1).componentId;H(()=>e.getComponentById(l));const{evaluateExpression:c}=Kl(e,r);function d(){var f;const h=e.getComponentById(l);if((f=h==null?void 0:h.binding)!=null&&f.stateRef)return c(h.binding.stateRef,t)}function u(h,f,m){if(o.value=h,s.value){i.value={eventValue:h,emitEventType:f};return}s.value=!0;const g=()=>{s.value=!1,i.value&&(u(i.value.eventValue,i.value.emitEventType),i.value=null),m==null||m()},_=new CustomEvent(f,{detail:{payload:h,callback:g}});a.value instanceof HTMLElement?a.value.dispatchEvent(_):a.value.$el.dispatchEvent(_)}return We(()=>d(),h=>{s.value||(o.value=h)},{immediate:!0}),We(o,h=>{typeof h>"u"&&(o.value=n)},{immediate:!0}),{formValue:o,handleInput:u}}const _oe={key:0},boe=$e({__name:"BaseInputWrapper",props:{label:{type:String,required:!1,default:void 0},isHorizontal:{type:Boolean,required:!1}},setup(e){return(t,a)=>($(),R("div",{ref:"rootEl",class:ft(["BaseInputWrapper",{horizontal:e.isHorizontal}])},[e.label?($(),R("label",_oe,je(e.label),1)):ge("",!0),qt(t.$slots,"default",{},void 0,!0)],2))}}),Wa=ke(boe,[["__scopeId","data-v-1cbc4730"]]),woe=["checked","value"],xoe=["for"],mm={a:"Option A",b:"Option B"},Coe="A user input component that allows users to choose multiple values from a list of options using checkboxes.",Aoe=`
8302
8302
  def onchange_handler(state, payload):
@@ -8331,7 +8331,7 @@ def onchange_handler(state, payload):
8331
8331
  name = uploaded_file.get("name")
8332
8332
  file_data = uploaded_file.get("data")
8333
8333
  with open(f"{name}-{i}.jpeg", "wb") as file_handle:
8334
- file_handle.write(file_data)`.trim(),yse={writer:{name:"File input",description:vse,category:"Input",fields:{label:{name:"Label",init:"Input Label",type:Q.Text},allowFileTypes:{name:"Allowed file types",type:Q.Text,init:[".pdf",".txt",".doc",".docx","image/*"].join(", "),desc:"Provides hints for browsers to select the correct file types. You can specify extensions and MIME types separated by comma, or leave empty to accept any file."},allowMultipleFiles:Ut({name:"Allow multiple files",default:"no"}),cssClasses:mt},events:{"wf-file-change":{desc:"Capture changes to this control.",stub:gse,bindable:!0,eventPayloadExample:[{name:"hello.txt",type:"text/plain",data:"data:text/plain;base64,SGVsbG8gd29ybGQK"}]}}}},Mse=$e({...yse,__name:"CoreFileInput",setup(e){const t=re(ne.evaluatedFields),a=ye(null),n=re(ne.core),r=re(ne.instancePath),{formValue:o,handleInput:s}=Va(n,r,a),i=H(()=>{var y;return(((y=t.allowFileTypes)==null?void 0:y.value)??"").split(",")}),l=H(()=>!!t.allowMultipleFiles.value),{files:c,calcTotalSize:d,replaceFiles:u,encodeFiles:h,decodeFiles:f}=Ag({multiple:l});ia(async()=>{if(Array.isArray(o.value)){const{decodedFiles:y}=await f(o.value);u(y)}});const m=200*1024*1024,g=ye(!1),_=ye(null);async function b(y){if(g.value)return;if(d(y)>m){_.value=`Files are too big. Total size limit is ${fl(m)}.`;return}g.value=!0,_.value=null,u(y);const{encodedFiles:M}=await h();if(M.length===0){g.value=!1;return}s(M,"wf-file-change"),g.value=!1}function v(y){const M=window.URL.createObjectURL(y),x=document.createElement("a");x.href=M,x.download=y.name,x.click(),x.remove(),setTimeout(()=>{window.URL.revokeObjectURL(M)},200)}return(y,M)=>($(),Ie(Wa,{ref_key:"rootInstance",ref:a,label:E(t).label.value,class:"CoreFileInput"},{default:Xe(()=>[Z("div",pse,[Ce(hse,{multiple:l.value,"accepted-file-types":i.value,"total-size-limit":m,onDrop:b},null,8,["multiple","accepted-file-types"]),E(c).length>0?($(),R("ul",fse,[($(!0),R(Je,null,Ot(E(c),x=>($(),R("li",{key:x.id},[Ce(rse,{status:g.value?"uploading":"ready",name:x.name,size:x.size,onDownload:S=>v(x.file)},null,8,["status","name","size","onDownload"])]))),128))])):ge("",!0),_.value?($(),R("div",mse,[Z("span",null,je(_.value),1)])):ge("",!0)])]),_:1},8,["label"]))}}),_se=ke(Mse,[["__scopeId","data-v-bac48dfb"]]),Y2=new Map;function bse(){function e(a){const n=Y2.get(a);if(n!==void 0)return n;const r=fetch(a,{method:"HEAD"}).then(o=>{if(o.ok)return o.headers.get("Content-Type")||void 0}).catch(()=>{});return Y2.set(a,r),r}function t(){Y2.clear()}return{fetchAssetContentType:e,clearCache:t}}const wse=["src"],xse=$e({__name:"SharedImgWithFallback",props:{urls:{type:Array,required:!0},loaderMaxWidthPx:{type:Number,default:void 0},loaderMaxHeightPx:{type:Number,default:void 0}},setup(e){const t=e,a=H(()=>{const c={};return t.loaderMaxWidthPx!==void 0&&(c.maxWidth=`${t.loaderMaxWidthPx}px`,c.width=`${t.loaderMaxWidthPx}px`),t.loaderMaxHeightPx!==void 0&&(c.maxHeight=`${t.loaderMaxHeightPx}px`,c.height=`${t.loaderMaxHeightPx}px`),c}),n=ye(""),r=ye(!0),o=ye([]);let s=0;const{fetchAssetContentType:i}=bse();function l(c,d){return c.length!==d.length?!1:c.every((u,h)=>u===d[h])}return We(mn(t,"urls"),async c=>{if(l(c,o.value))return;o.value=[...c],r.value=!0,n.value="";const d=++s;for(const u of c){if(d!==s)return;const h=await i(u);if(d!==s)return;if(!(!h||h==="text/html")){n.value=u;break}}d===s&&(r.value=!1)},{immediate:!0}),(c,d)=>r.value?($(),Ie($0,{key:0,class:"skeleton",style:bt(a.value)},null,8,["style"])):($(),R("img",{key:1,src:n.value},null,8,wse))}}),qg=ke(xse,[["__scopeId","data-v-dd586442"]]),Cse={};function Ase(e,t){return $(),Ie(m0,{name:"slide-fade"},{default:Xe(()=>[qt(e.$slots,"default",{},void 0,!0)]),_:3})}const Sse=ke(Cse,[["render",Ase],["__scopeId","data-v-75fe1e40"]]),$se={key:1,class:"WdsSelect__trigger__multiSelectLabel"},Ese={key:0,class:"WdsSelect__trigger__multiSelectLabel__placeholder"},Ise=["data-writer-tooltip"],kse={class:"WdsSelect__trigger__arrow"},Tse=$e({__name:"WdsSelect",props:Fn({options:{type:Array,default:()=>[]},placeholder:{type:String,required:!1,default:void 0},defaultIcon:{type:String,required:!1,default:void 0},hideIcons:{type:Boolean,required:!1},enableSearch:{type:Boolean,required:!1},enableMultiSelection:{type:Boolean,required:!1},loading:{type:Boolean,required:!1}},{modelValue:{type:[String,Array],required:!0,default:void 0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=sr({loader:()=>zt(()=>import("./WdsDropdownMenu-BPKaOD8s.js").then(v=>v.b),__vite__mapDeps([4,5,6,7]),import.meta.url)}),a=e,n=ir(e,"modelValue"),r=ye(!1),o=pt("trigger"),s=pt("dropdown"),i=H(()=>a.enableSearch?[]:[i6({allowedPlacements:["bottom","top"]})]),{floatingStyles:l,update:c}=c6(o,s,{placement:"bottom",middleware:i}),d=H(()=>n.value?(Array.isArray(n.value)?n.value:[n.value]).filter(Boolean):[]),u=H(()=>d.value.map(v=>a.options.find(y=>y.value===v)??{value:v,label:v})),h=H(()=>n.value&&!a.options.some(v=>v.value===n.value)),f=H(()=>h.value?String(n.value):u.value.map(v=>v.label).sort().join(" / ")),m=H(()=>{var v;return h.value?"circle-question-mark":a.hideIcons?"":((v=u.value.at(0))==null?void 0:v.icon)??a.defaultIcon??"circle-question-mark"}),g=b0(o);We(g,()=>{g.value||setTimeout(()=>r.value=!1,300)},{immediate:!0});function _(v){a.enableMultiSelection||(r.value=!1),n.value=v}function b(v){Array.isArray(n.value)&&(n.value=n.value.filter(y=>y!==v))}return(v,y)=>($(),R("div",{ref_key:"trigger",ref:o,class:"WdsSelect"},[Z("div",{class:"WdsSelect__trigger",role:"button",tabindex:"0",onClick:y[0]||(y[0]=M=>r.value=!r.value),onKeydown:y[1]||(y[1]=Sr(M=>r.value=!r.value,["enter"]))},[(h.value||!e.hideIcons)&&!e.enableMultiSelection?($(),R(Je,{key:0},[Array.isArray(m.value)?($(),Ie(qg,{key:0,urls:m.value,"loader-max-width-px":18,"loader-max-height-px":18},null,8,["urls"])):($(),Ie(_t,{key:1,name:m.value},null,8,["name"]))],64)):ge("",!0),e.enableMultiSelection?($(),R("div",$se,[($(!0),R(Je,null,Ot(u.value,M=>($(),Ie(zg,{key:M.value,text:M.label,closable:"",onClose:x=>b(M.value)},null,8,["text","onClose"]))),128)),u.value.length===0&&e.placeholder?($(),R("p",Ese,je(e.placeholder),1)):ge("",!0)])):($(),R("div",{key:2,class:"WdsSelect__trigger__label","data-writer-tooltip-strategy":"overflow","data-writer-tooltip":f.value},je(f.value??e.placeholder),9,Ise)),Z("div",kse,[Ce(_t,{name:r.value?"chevron-up":"chevron-down"},null,8,["name"])])],32),Ce(Sse,null,{default:Xe(()=>[r.value?($(),Ie(E(t),{key:0,ref_key:"dropdown",ref:s,"enable-search":e.enableSearch,"enable-multi-selection":e.enableMultiSelection,"hide-icons":e.hideIcons,loading:e.loading,options:e.options,selected:n.value,style:bt(E(l)),onSelect:_,onSearch:E(c)},null,8,["enable-search","enable-multi-selection","hide-icons","loading","options","selected","style","onSearch"])):ge("",!0)]),_:1})],512))}}),Ed=ke(Tse,[["__scopeId","data-v-da33a38f"]]),Hde=Object.freeze(Object.defineProperty({__proto__:null,default:Ed},Symbol.toStringTag,{value:"Module"})),Pse="A user input component that allows users to select multiple values from a searchable list of options.",ym={a:"Option A",b:"Option B"},Lse=`
8334
+ file_handle.write(file_data)`.trim(),yse={writer:{name:"File input",description:vse,category:"Input",fields:{label:{name:"Label",init:"Input Label",type:Q.Text},allowFileTypes:{name:"Allowed file types",type:Q.Text,init:[".pdf",".txt",".doc",".docx","image/*"].join(", "),desc:"Provides hints for browsers to select the correct file types. You can specify extensions and MIME types separated by comma, or leave empty to accept any file."},allowMultipleFiles:Ut({name:"Allow multiple files",default:"no"}),cssClasses:mt},events:{"wf-file-change":{desc:"Capture changes to this control.",stub:gse,bindable:!0,eventPayloadExample:[{name:"hello.txt",type:"text/plain",data:"data:text/plain;base64,SGVsbG8gd29ybGQK"}]}}}},Mse=$e({...yse,__name:"CoreFileInput",setup(e){const t=re(ne.evaluatedFields),a=ye(null),n=re(ne.core),r=re(ne.instancePath),{formValue:o,handleInput:s}=Va(n,r,a),i=H(()=>{var y;return(((y=t.allowFileTypes)==null?void 0:y.value)??"").split(",")}),l=H(()=>!!t.allowMultipleFiles.value),{files:c,calcTotalSize:d,replaceFiles:u,encodeFiles:h,decodeFiles:f}=Ag({multiple:l});ia(async()=>{if(Array.isArray(o.value)){const{decodedFiles:y}=await f(o.value);u(y)}});const m=200*1024*1024,g=ye(!1),_=ye(null);async function b(y){if(g.value)return;if(d(y)>m){_.value=`Files are too big. Total size limit is ${fl(m)}.`;return}g.value=!0,_.value=null,u(y);const{encodedFiles:M}=await h();if(M.length===0){g.value=!1;return}s(M,"wf-file-change"),g.value=!1}function v(y){const M=window.URL.createObjectURL(y),x=document.createElement("a");x.href=M,x.download=y.name,x.click(),x.remove(),setTimeout(()=>{window.URL.revokeObjectURL(M)},200)}return(y,M)=>($(),Ie(Wa,{ref_key:"rootInstance",ref:a,label:E(t).label.value,class:"CoreFileInput"},{default:Xe(()=>[Z("div",pse,[Ce(hse,{multiple:l.value,"accepted-file-types":i.value,"total-size-limit":m,onDrop:b},null,8,["multiple","accepted-file-types"]),E(c).length>0?($(),R("ul",fse,[($(!0),R(Je,null,Ot(E(c),x=>($(),R("li",{key:x.id},[Ce(rse,{status:g.value?"uploading":"ready",name:x.name,size:x.size,onDownload:S=>v(x.file)},null,8,["status","name","size","onDownload"])]))),128))])):ge("",!0),_.value?($(),R("div",mse,[Z("span",null,je(_.value),1)])):ge("",!0)])]),_:1},8,["label"]))}}),_se=ke(Mse,[["__scopeId","data-v-bac48dfb"]]),Y2=new Map;function bse(){function e(a){const n=Y2.get(a);if(n!==void 0)return n;const r=fetch(a,{method:"HEAD"}).then(o=>{if(o.ok)return o.headers.get("Content-Type")||void 0}).catch(()=>{});return Y2.set(a,r),r}function t(){Y2.clear()}return{fetchAssetContentType:e,clearCache:t}}const wse=["src"],xse=$e({__name:"SharedImgWithFallback",props:{urls:{type:Array,required:!0},loaderMaxWidthPx:{type:Number,default:void 0},loaderMaxHeightPx:{type:Number,default:void 0}},setup(e){const t=e,a=H(()=>{const c={};return t.loaderMaxWidthPx!==void 0&&(c.maxWidth=`${t.loaderMaxWidthPx}px`,c.width=`${t.loaderMaxWidthPx}px`),t.loaderMaxHeightPx!==void 0&&(c.maxHeight=`${t.loaderMaxHeightPx}px`,c.height=`${t.loaderMaxHeightPx}px`),c}),n=ye(""),r=ye(!0),o=ye([]);let s=0;const{fetchAssetContentType:i}=bse();function l(c,d){return c.length!==d.length?!1:c.every((u,h)=>u===d[h])}return We(mn(t,"urls"),async c=>{if(l(c,o.value))return;o.value=[...c],r.value=!0,n.value="";const d=++s;for(const u of c){if(d!==s)return;const h=await i(u);if(d!==s)return;if(!(!h||h==="text/html")){n.value=u;break}}d===s&&(r.value=!1)},{immediate:!0}),(c,d)=>r.value?($(),Ie($0,{key:0,class:"skeleton",style:bt(a.value)},null,8,["style"])):($(),R("img",{key:1,src:n.value},null,8,wse))}}),qg=ke(xse,[["__scopeId","data-v-dd586442"]]),Cse={};function Ase(e,t){return $(),Ie(m0,{name:"slide-fade"},{default:Xe(()=>[qt(e.$slots,"default",{},void 0,!0)]),_:3})}const Sse=ke(Cse,[["render",Ase],["__scopeId","data-v-75fe1e40"]]),$se={key:1,class:"WdsSelect__trigger__multiSelectLabel"},Ese={key:0,class:"WdsSelect__trigger__multiSelectLabel__placeholder"},Ise=["data-writer-tooltip"],kse={class:"WdsSelect__trigger__arrow"},Tse=$e({__name:"WdsSelect",props:Fn({options:{type:Array,default:()=>[]},placeholder:{type:String,required:!1,default:void 0},defaultIcon:{type:String,required:!1,default:void 0},hideIcons:{type:Boolean,required:!1},enableSearch:{type:Boolean,required:!1},enableMultiSelection:{type:Boolean,required:!1},loading:{type:Boolean,required:!1}},{modelValue:{type:[String,Array],required:!0,default:void 0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=sr({loader:()=>zt(()=>import("./WdsDropdownMenu-vcOuT7Hf.js").then(v=>v.b),__vite__mapDeps([4,5,6,7]),import.meta.url)}),a=e,n=ir(e,"modelValue"),r=ye(!1),o=pt("trigger"),s=pt("dropdown"),i=H(()=>a.enableSearch?[]:[i6({allowedPlacements:["bottom","top"]})]),{floatingStyles:l,update:c}=c6(o,s,{placement:"bottom",middleware:i}),d=H(()=>n.value?(Array.isArray(n.value)?n.value:[n.value]).filter(Boolean):[]),u=H(()=>d.value.map(v=>a.options.find(y=>y.value===v)??{value:v,label:v})),h=H(()=>n.value&&!a.options.some(v=>v.value===n.value)),f=H(()=>h.value?String(n.value):u.value.map(v=>v.label).sort().join(" / ")),m=H(()=>{var v;return h.value?"circle-question-mark":a.hideIcons?"":((v=u.value.at(0))==null?void 0:v.icon)??a.defaultIcon??"circle-question-mark"}),g=b0(o);We(g,()=>{g.value||setTimeout(()=>r.value=!1,300)},{immediate:!0});function _(v){a.enableMultiSelection||(r.value=!1),n.value=v}function b(v){Array.isArray(n.value)&&(n.value=n.value.filter(y=>y!==v))}return(v,y)=>($(),R("div",{ref_key:"trigger",ref:o,class:"WdsSelect"},[Z("div",{class:"WdsSelect__trigger",role:"button",tabindex:"0",onClick:y[0]||(y[0]=M=>r.value=!r.value),onKeydown:y[1]||(y[1]=Sr(M=>r.value=!r.value,["enter"]))},[(h.value||!e.hideIcons)&&!e.enableMultiSelection?($(),R(Je,{key:0},[Array.isArray(m.value)?($(),Ie(qg,{key:0,urls:m.value,"loader-max-width-px":18,"loader-max-height-px":18},null,8,["urls"])):($(),Ie(_t,{key:1,name:m.value},null,8,["name"]))],64)):ge("",!0),e.enableMultiSelection?($(),R("div",$se,[($(!0),R(Je,null,Ot(u.value,M=>($(),Ie(zg,{key:M.value,text:M.label,closable:"",onClose:x=>b(M.value)},null,8,["text","onClose"]))),128)),u.value.length===0&&e.placeholder?($(),R("p",Ese,je(e.placeholder),1)):ge("",!0)])):($(),R("div",{key:2,class:"WdsSelect__trigger__label","data-writer-tooltip-strategy":"overflow","data-writer-tooltip":f.value},je(f.value??e.placeholder),9,Ise)),Z("div",kse,[Ce(_t,{name:r.value?"chevron-up":"chevron-down"},null,8,["name"])])],32),Ce(Sse,null,{default:Xe(()=>[r.value?($(),Ie(E(t),{key:0,ref_key:"dropdown",ref:s,"enable-search":e.enableSearch,"enable-multi-selection":e.enableMultiSelection,"hide-icons":e.hideIcons,loading:e.loading,options:e.options,selected:n.value,style:bt(E(l)),onSelect:_,onSearch:E(c)},null,8,["enable-search","enable-multi-selection","hide-icons","loading","options","selected","style","onSearch"])):ge("",!0)]),_:1})],512))}}),Ed=ke(Tse,[["__scopeId","data-v-da33a38f"]]),Hde=Object.freeze(Object.defineProperty({__proto__:null,default:Ed},Symbol.toStringTag,{value:"Module"})),Pse="A user input component that allows users to select multiple values from a searchable list of options.",ym={a:"Option A",b:"Option B"},Lse=`
8335
8335
  def onchange_handler(state, payload):
8336
8336
 
8337
8337
  # Set the state variable "selected" to the selected option
@@ -8435,7 +8435,7 @@ def webcam_handler(payload):
8435
8435
 
8436
8436
  image_file = payload
8437
8437
  with open(f"capture-{timestamp}.png", "wb") as file_handle:
8438
- file_handle.write(image_file)`.trim(),Gle={writer:{deprecated:!0,name:"Webcam capture",description:Zle,category:"Other",fields:{refreshRate:{name:"Refresh rate (ms)",init:"200",default:"200",desc:"Set to 0 for manual capture.",type:Q.Number,validator:fn},buttonColor:cr,buttonTextColor:dr,buttonShadow:so,separatorColor:wa,cssClasses:mt},events:{"wf-webcam":{desc:"Sent when a frame is captured. Its payload contains the captured frame in PNG format.",stub:Kle.trim(),eventPayloadExample:"data:image/png;base64,azerty"}}}},Jle=$e({...Gle,__name:"CoreWebcamCapture",setup(e){const t=ye(!1),a=pt("rootEl"),n=document.createElement("canvas"),r=pt("videoEl"),o=re(ne.evaluatedFields),s=ye(null),i=ye(null),l=fa();ia(async()=>{var _,b;s.value=await c(),i.value=(b=(_=s.value)==null?void 0:_[0])==null?void 0:b.deviceId}),Ir(()=>{g()});const c=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(v=>v.kind=="videoinput"),d=H(()=>o.refreshRate.value);We(d,(_,b)=>{_>0&&b<=0&&f()}),We(i,async()=>{t.value&&(g(),await m())});const u=async()=>{if(t.value=!t.value,!t.value){g();return}await m(),f()},h=()=>(n.getContext("2d").drawImage(r.value,0,0),n.toDataURL("image/png")),f=()=>{const _=new CustomEvent("wf-webcam",{detail:{payload:h(),callback:()=>{d.value<=0||!t.value||setTimeout(()=>{f()},d.value)}}});a.value.dispatchEvent(_)},m=async()=>(r.value.style.display="",new Promise((_,b)=>{navigator.mediaDevices.getUserMedia||(l.error("This browser doesn't support webcam connection."),b());const v={video:!0};s.value.length>1&&(v.video={deviceId:i.value}),navigator.mediaDevices.getUserMedia(v).then(y=>{r.value.srcObject=y;const M=y.getVideoTracks()[0].getSettings().width,x=y.getVideoTracks()[0].getSettings().height;n.setAttribute("width",M.toString()),n.setAttribute("height",x.toString()),_()}).catch(y=>{l.error("An error occurred when trying to use the webcam.",y),b()})})),g=()=>{const _=r.value.srcObject;_&&_.getTracks().map(v=>v.stop()),r.value.srcObject=null,r.value.style.display="none"};return(_,b)=>{var v;return $(),R("div",{ref_key:"rootEl",ref:a,class:"CoreWebcamCapture"},[Ya(Z("div",zle,[Z("video",{ref_key:"videoEl",ref:r,autoplay:"true"},null,512)],512),[[jn,t.value]]),Z("div",qle,[d.value==0?($(),Ie(La,{key:0,onClick:f},{default:Xe(()=>b[1]||(b[1]=[pa(" Capture image ")])),_:1})):ge("",!0),Ce(La,{onClick:u},{default:Xe(()=>[pa(je(t.value?"Stop capture":"Start webcam capture"),1)]),_:1}),((v=s.value)==null?void 0:v.length)>1?($(),Ie(Ug,{key:1,modelValue:i.value,"onUpdate:modelValue":b[0]||(b[0]=y=>i.value=y)},{default:Xe(()=>[($(!0),R(Je,null,Ot(s.value,(y,M)=>($(),R("option",{key:y.deviceId,value:y.deviceId},je(y.label||`Webcam ${M+1}`),9,Wle))),128))]),_:1},8,["modelValue"])):ge("",!0)])],512)}}}),Xle=ke(Jle,[["__scopeId","data-v-c89e0cac"]]),Yle={writer:{name:"Reuse component",slot:"*",description:"Those components are used to reuse other components. Reused components share the same state and are updated together.",category:"Other",allowedChildrenTypes:[],fields:{proxyId:{name:"Component id",type:Q.Text,desc:"The id of the component to reuse."}}}},Qle=$e({...Yle,__name:"CoreReuse",props:{contextSlot:{}},setup(e){const t=e,a=re(ne.evaluatedFields),r=re(ne.instancePath).at(-2).componentId,o=re(ne.core),s=re(ne.renderProxiedComponent),i=re(ne.isBeingEdited),l=re(ne.componentId),c=ye(En("div","")),d=ye(!0),u=H(()=>{var g;return(g=o.getComponentById(a.proxyId.value))==null?void 0:g.type}),h=H(()=>u.value?o.getComponentDefinition(u.value):null);function f(g,_){d.value=t.contextSlot==="default",c.value=En("div",{class:["CoreReuse",_],style:{color:"var(--primaryTextColor)"}},i.value?g:"")}function m(){if(!a.proxyId.value)return f("No component selected to reuse","empty");if(l===a.proxyId.value||!h.value)return f("The id specified for reuse doesn't match any component.","invalid-value");if(!o.getContainableTypes(r).includes(u.value))return f("The component cannot be reused here.","invalid-context");d.value=t.contextSlot===(h.value.slot??"default");const g=s(a.proxyId.value,0,{class:["CoreReuse"]});c.value=g}return We([a.proxyId,h],m,{immediate:!0}),(g,_)=>d.value?($(),Ie(Ts(c.value),{key:0})):ge("",!0)}}),e2e={key:0,class:"controls"},t2e={key:2},a2e=["page"],n2e="A component to embed PDF documents.",r2e={writer:{name:"PDF",description:n2e,category:"Embed",fields:{source:{name:"PDF source",type:Q.Text,desc:"A valid URL. Alternatively, you can provide a state reference to a packed PDF file."},highlights:{name:"Highlights",default:JSON.stringify([]),desc:"A list of highlights to be applied to the PDF as a JSON array of strings.",type:Q.Object,validator:lg},selectedMatch:{name:"Selected highlight match",default:null,desc:"The index of the selected highlight match.",type:Q.Number},page:{name:"Page",type:Q.Number,desc:"The page to be displayed."},controls:Ut({name:"Enable controls",desc:"Show controls to navigate the PDF.",default:"yes"}),containerBackgroundColor:kr,separatorColor:wa,primaryTextColor:ua,cssClasses:mt}}},o2e=$e({...r2e,__name:"CorePDF",setup(e){const t=re(ne.evaluatedFields,{});let a,n,r;const o=H(()=>t.highlights.value.filter(Boolean)),s=$t({completeWords:!1,ignoreCase:!0}),i=ye(1),l=ye(1),c=$t([]),d=ye(0),u=pt("rootEl"),h=pt("viewerEl"),f=ye(!1),m=ye(0),g=$t([]);function _(ee){return Tr(ee)&&"name"in ee&&"type"in ee&&"data"in ee&&typeof ee.data=="string"&&ee.data.startsWith("data:")}function b(ee){if(!(typeof ee!="string"||!ee.trim())){try{const j=JSON.parse(ee);if(Array.isArray(j)&&j.length>0){const K=j[0];if(_(K))return K.data}}catch{}return ee}}const v=H(()=>{var j;if(!((j=t.source)!=null&&j.value))return;const ee=b(t.source.value);if(ee)try{return Rw(ee)}catch{return}}),y=H(()=>v.value===void 0?{url:t.source.value,isEvalSupported:!1}:{data:v.value,isEvalSupported:!1});ia(async()=>{const ee=await zt(()=>import("./index-uhDDPaD2.js"),__vite__mapDeps([9,10]),import.meta.url),j=await zt(()=>import("./pdf-5wahDYbm.js"),[],import.meta.url);j.GlobalWorkerOptions.workerSrc=new URL(""+new URL("pdf.worker.min-CyUfim15.mjs",import.meta.url).href,import.meta.url).toString(),r=ee.VuePDF;const K=ee.usePDF;({pdf:a,pages:n}=K(y)),M()});function M(){f.value=!0,m.value=0,g.value=[],c.value=[]}function x(ee){g.value=[...g.value,{matches:ee.matches,page:ee.page}]}function S(ee){m.value++}function L(){c.value=g.value.reduce((ee,j)=>{const K=j.matches.map((G,T)=>({page:j.page,str:G.str,index:T}));return ee.push(...K),ee},[]).sort((ee,j)=>ee.page===j.page?ee.index-j.index:ee.page-j.page)}function F(){L(),d.value&&be(d.value),t.selectedMatch.value&&(d.value=t.selectedMatch.value)}function te(ee){const j=ee.target.getBoundingClientRect(),K=[...ee.target.children].filter(G=>G.className.includes("page")).find(G=>{const T=G.getBoundingClientRect(),O=T.y-j.y;return O<j.height/2&&O+T.height>j.height/2});K&&(l.value=Number(K.getAttribute("page")))}function J(ee,j){let K=0,G=ee;for(;G&&G!==j;)K+=G.offsetTop,G=G.offsetParent;return K}function be(ee){if(ee<1||ee>c.value.length)return;const j=c.value[ee-1];if(!j)return;const G=u.value.querySelectorAll(`div[page='${j.page}'] span.highlight`)[j.index];G instanceof HTMLElement&&(h.value.scrollTop=J(G,h.value))}const oe=ee=>{if(ee<1||ee>(n==null?void 0:n.value))return;const j=u.value.querySelector("div[page='"+ee+"']");j instanceof HTMLElement&&(h.value.scrollTop=J(j,h.value))};function Te(){d.value<c.value.length?d.value=d.value+1:d.value=1}function Ue(){d.value>1?d.value=d.value-1:d.value=c.value.length}function Ze(){i.value=i.value<2?i.value+.1:i.value}function Me(){i.value=i.value>.25?i.value-.1:i.value}return We(m,()=>{var ee;m.value===(n==null?void 0:n.value)&&(ee=t.page)!=null&&ee.value&&oe(t.page.value)}),We([g,m],()=>{(o.value.length==0||g.value.length===(n==null?void 0:n.value))&&m.value===(n==null?void 0:n.value)&&(F(),f.value=!1)}),We([i,t.source],M),We(o,()=>{g.value=[],c.value=[]}),We(d,()=>{be(d.value)}),We(t.selectedMatch,()=>{d.value=t.selectedMatch.value}),We(t.page,()=>{oe(t.page.value)}),(ee,j)=>($(),R("div",{ref_key:"rootEl",ref:u,class:"CorePDF"},[E(t).controls.value?($(),R("div",e2e,[Ce(wn,{onClick:j[0]||(j[0]=()=>oe(l.value-1))},{default:Xe(()=>[Ce(_t,{name:"arrow-up"})]),_:1}),Ce(wn,{onClick:j[1]||(j[1]=()=>oe(l.value+1))},{default:Xe(()=>[Ce(_t,{name:"arrow-down"})]),_:1}),($(),R("span",{key:l.value},je(l.value)+" / "+je(E(n)),1)),Ce(wn,{disabled:f.value,onClick:Ze},{default:Xe(()=>[Ce(_t,{name:"zoom-in"})]),_:1},8,["disabled"]),Ce(wn,{disabled:f.value,onClick:Me},{default:Xe(()=>[Ce(_t,{name:"zoom-out"})]),_:1},8,["disabled"]),Z("span",null,je(Math.round(i.value*100))+"%",1),j[2]||(j[2]=Z("span",{class:"separator"},null,-1)),c.value.length?($(),Ie(wn,{key:0,onClick:Ue},{default:Xe(()=>[Ce(_t,{name:"chevron-left"})]),_:1})):ge("",!0),c.value.length?($(),Ie(wn,{key:1,onClick:Te},{default:Xe(()=>[Ce(_t,{name:"chevron-right"})]),_:1})):ge("",!0),c.value.length?($(),R("span",t2e,"Matches "+je(d.value)+" / "+je(c.value.length),1)):ge("",!0)])):ge("",!0),Z("div",{ref_key:"viewerEl",ref:h,class:"viewer",onScroll:te},[($(!0),R(Je,null,Ot(E(n),K=>($(),R("div",{key:K,page:K,class:"page"},[Ce(E(r),{scale:i.value,pdf:E(a),page:K,"text-layer":"","highlight-text":o.value,"highlight-options":s.value,onHighlight:x,onLoaded:S},null,8,["scale","pdf","page","highlight-text","highlight-options"])],8,a2e))),128))],544),j[3]||(j[3]=Z("div",{class:"mask"},null,-1))],512))}}),s2e=ke(o2e,[["__scopeId","data-v-0e66d538"]]),i2e={key:0,class:"noURLProvided"},l2e=["src","referrerpolicy"],c2e="A component to embed an external resource in an iframe.",d2e=`
8438
+ file_handle.write(image_file)`.trim(),Gle={writer:{deprecated:!0,name:"Webcam capture",description:Zle,category:"Other",fields:{refreshRate:{name:"Refresh rate (ms)",init:"200",default:"200",desc:"Set to 0 for manual capture.",type:Q.Number,validator:fn},buttonColor:cr,buttonTextColor:dr,buttonShadow:so,separatorColor:wa,cssClasses:mt},events:{"wf-webcam":{desc:"Sent when a frame is captured. Its payload contains the captured frame in PNG format.",stub:Kle.trim(),eventPayloadExample:"data:image/png;base64,azerty"}}}},Jle=$e({...Gle,__name:"CoreWebcamCapture",setup(e){const t=ye(!1),a=pt("rootEl"),n=document.createElement("canvas"),r=pt("videoEl"),o=re(ne.evaluatedFields),s=ye(null),i=ye(null),l=fa();ia(async()=>{var _,b;s.value=await c(),i.value=(b=(_=s.value)==null?void 0:_[0])==null?void 0:b.deviceId}),Ir(()=>{g()});const c=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(v=>v.kind=="videoinput"),d=H(()=>o.refreshRate.value);We(d,(_,b)=>{_>0&&b<=0&&f()}),We(i,async()=>{t.value&&(g(),await m())});const u=async()=>{if(t.value=!t.value,!t.value){g();return}await m(),f()},h=()=>(n.getContext("2d").drawImage(r.value,0,0),n.toDataURL("image/png")),f=()=>{const _=new CustomEvent("wf-webcam",{detail:{payload:h(),callback:()=>{d.value<=0||!t.value||setTimeout(()=>{f()},d.value)}}});a.value.dispatchEvent(_)},m=async()=>(r.value.style.display="",new Promise((_,b)=>{navigator.mediaDevices.getUserMedia||(l.error("This browser doesn't support webcam connection."),b());const v={video:!0};s.value.length>1&&(v.video={deviceId:i.value}),navigator.mediaDevices.getUserMedia(v).then(y=>{r.value.srcObject=y;const M=y.getVideoTracks()[0].getSettings().width,x=y.getVideoTracks()[0].getSettings().height;n.setAttribute("width",M.toString()),n.setAttribute("height",x.toString()),_()}).catch(y=>{l.error("An error occurred when trying to use the webcam.",y),b()})})),g=()=>{const _=r.value.srcObject;_&&_.getTracks().map(v=>v.stop()),r.value.srcObject=null,r.value.style.display="none"};return(_,b)=>{var v;return $(),R("div",{ref_key:"rootEl",ref:a,class:"CoreWebcamCapture"},[Ya(Z("div",zle,[Z("video",{ref_key:"videoEl",ref:r,autoplay:"true"},null,512)],512),[[jn,t.value]]),Z("div",qle,[d.value==0?($(),Ie(La,{key:0,onClick:f},{default:Xe(()=>b[1]||(b[1]=[pa(" Capture image ")])),_:1})):ge("",!0),Ce(La,{onClick:u},{default:Xe(()=>[pa(je(t.value?"Stop capture":"Start webcam capture"),1)]),_:1}),((v=s.value)==null?void 0:v.length)>1?($(),Ie(Ug,{key:1,modelValue:i.value,"onUpdate:modelValue":b[0]||(b[0]=y=>i.value=y)},{default:Xe(()=>[($(!0),R(Je,null,Ot(s.value,(y,M)=>($(),R("option",{key:y.deviceId,value:y.deviceId},je(y.label||`Webcam ${M+1}`),9,Wle))),128))]),_:1},8,["modelValue"])):ge("",!0)])],512)}}}),Xle=ke(Jle,[["__scopeId","data-v-c89e0cac"]]),Yle={writer:{name:"Reuse component",slot:"*",description:"Those components are used to reuse other components. Reused components share the same state and are updated together.",category:"Other",allowedChildrenTypes:[],fields:{proxyId:{name:"Component id",type:Q.Text,desc:"The id of the component to reuse."}}}},Qle=$e({...Yle,__name:"CoreReuse",props:{contextSlot:{}},setup(e){const t=e,a=re(ne.evaluatedFields),r=re(ne.instancePath).at(-2).componentId,o=re(ne.core),s=re(ne.renderProxiedComponent),i=re(ne.isBeingEdited),l=re(ne.componentId),c=ye(En("div","")),d=ye(!0),u=H(()=>{var g;return(g=o.getComponentById(a.proxyId.value))==null?void 0:g.type}),h=H(()=>u.value?o.getComponentDefinition(u.value):null);function f(g,_){d.value=t.contextSlot==="default",c.value=En("div",{class:["CoreReuse",_],style:{color:"var(--primaryTextColor)"}},i.value?g:"")}function m(){if(!a.proxyId.value)return f("No component selected to reuse","empty");if(l===a.proxyId.value||!h.value)return f("The id specified for reuse doesn't match any component.","invalid-value");if(!o.getContainableTypes(r).includes(u.value))return f("The component cannot be reused here.","invalid-context");d.value=t.contextSlot===(h.value.slot??"default");const g=s(a.proxyId.value,0,{class:["CoreReuse"]});c.value=g}return We([a.proxyId,h],m,{immediate:!0}),(g,_)=>d.value?($(),Ie(Ts(c.value),{key:0})):ge("",!0)}}),e2e={key:0,class:"controls"},t2e={key:2},a2e=["page"],n2e="A component to embed PDF documents.",r2e={writer:{name:"PDF",description:n2e,category:"Embed",fields:{source:{name:"PDF source",type:Q.Text,desc:"A valid URL. Alternatively, you can provide a state reference to a packed PDF file."},highlights:{name:"Highlights",default:JSON.stringify([]),desc:"A list of highlights to be applied to the PDF as a JSON array of strings.",type:Q.Object,validator:lg},selectedMatch:{name:"Selected highlight match",default:null,desc:"The index of the selected highlight match.",type:Q.Number},page:{name:"Page",type:Q.Number,desc:"The page to be displayed."},controls:Ut({name:"Enable controls",desc:"Show controls to navigate the PDF.",default:"yes"}),containerBackgroundColor:kr,separatorColor:wa,primaryTextColor:ua,cssClasses:mt}}},o2e=$e({...r2e,__name:"CorePDF",setup(e){const t=re(ne.evaluatedFields,{});let a,n,r;const o=H(()=>t.highlights.value.filter(Boolean)),s=$t({completeWords:!1,ignoreCase:!0}),i=ye(1),l=ye(1),c=$t([]),d=ye(0),u=pt("rootEl"),h=pt("viewerEl"),f=ye(!1),m=ye(0),g=$t([]);function _(ee){return Tr(ee)&&"name"in ee&&"type"in ee&&"data"in ee&&typeof ee.data=="string"&&ee.data.startsWith("data:")}function b(ee){if(!(typeof ee!="string"||!ee.trim())){try{const j=JSON.parse(ee);if(Array.isArray(j)&&j.length>0){const K=j[0];if(_(K))return K.data}}catch{}return ee}}const v=H(()=>{var j;if(!((j=t.source)!=null&&j.value))return;const ee=b(t.source.value);if(ee)try{return Rw(ee)}catch{return}}),y=H(()=>v.value===void 0?{url:t.source.value,isEvalSupported:!1}:{data:v.value,isEvalSupported:!1});ia(async()=>{const ee=await zt(()=>import("./index-CzJKxzXJ.js"),__vite__mapDeps([9,10]),import.meta.url),j=await zt(()=>import("./pdf-UGfOV19v.js"),[],import.meta.url);j.GlobalWorkerOptions.workerSrc=new URL(""+new URL("pdf.worker.min-CyUfim15.mjs",import.meta.url).href,import.meta.url).toString(),r=ee.VuePDF;const K=ee.usePDF;({pdf:a,pages:n}=K(y)),M()});function M(){f.value=!0,m.value=0,g.value=[],c.value=[]}function x(ee){g.value=[...g.value,{matches:ee.matches,page:ee.page}]}function S(ee){m.value++}function L(){c.value=g.value.reduce((ee,j)=>{const K=j.matches.map((G,T)=>({page:j.page,str:G.str,index:T}));return ee.push(...K),ee},[]).sort((ee,j)=>ee.page===j.page?ee.index-j.index:ee.page-j.page)}function F(){L(),d.value&&be(d.value),t.selectedMatch.value&&(d.value=t.selectedMatch.value)}function te(ee){const j=ee.target.getBoundingClientRect(),K=[...ee.target.children].filter(G=>G.className.includes("page")).find(G=>{const T=G.getBoundingClientRect(),O=T.y-j.y;return O<j.height/2&&O+T.height>j.height/2});K&&(l.value=Number(K.getAttribute("page")))}function J(ee,j){let K=0,G=ee;for(;G&&G!==j;)K+=G.offsetTop,G=G.offsetParent;return K}function be(ee){if(ee<1||ee>c.value.length)return;const j=c.value[ee-1];if(!j)return;const G=u.value.querySelectorAll(`div[page='${j.page}'] span.highlight`)[j.index];G instanceof HTMLElement&&(h.value.scrollTop=J(G,h.value))}const oe=ee=>{if(ee<1||ee>(n==null?void 0:n.value))return;const j=u.value.querySelector("div[page='"+ee+"']");j instanceof HTMLElement&&(h.value.scrollTop=J(j,h.value))};function Te(){d.value<c.value.length?d.value=d.value+1:d.value=1}function Ue(){d.value>1?d.value=d.value-1:d.value=c.value.length}function Ze(){i.value=i.value<2?i.value+.1:i.value}function Me(){i.value=i.value>.25?i.value-.1:i.value}return We(m,()=>{var ee;m.value===(n==null?void 0:n.value)&&(ee=t.page)!=null&&ee.value&&oe(t.page.value)}),We([g,m],()=>{(o.value.length==0||g.value.length===(n==null?void 0:n.value))&&m.value===(n==null?void 0:n.value)&&(F(),f.value=!1)}),We([i,t.source],M),We(o,()=>{g.value=[],c.value=[]}),We(d,()=>{be(d.value)}),We(t.selectedMatch,()=>{d.value=t.selectedMatch.value}),We(t.page,()=>{oe(t.page.value)}),(ee,j)=>($(),R("div",{ref_key:"rootEl",ref:u,class:"CorePDF"},[E(t).controls.value?($(),R("div",e2e,[Ce(wn,{onClick:j[0]||(j[0]=()=>oe(l.value-1))},{default:Xe(()=>[Ce(_t,{name:"arrow-up"})]),_:1}),Ce(wn,{onClick:j[1]||(j[1]=()=>oe(l.value+1))},{default:Xe(()=>[Ce(_t,{name:"arrow-down"})]),_:1}),($(),R("span",{key:l.value},je(l.value)+" / "+je(E(n)),1)),Ce(wn,{disabled:f.value,onClick:Ze},{default:Xe(()=>[Ce(_t,{name:"zoom-in"})]),_:1},8,["disabled"]),Ce(wn,{disabled:f.value,onClick:Me},{default:Xe(()=>[Ce(_t,{name:"zoom-out"})]),_:1},8,["disabled"]),Z("span",null,je(Math.round(i.value*100))+"%",1),j[2]||(j[2]=Z("span",{class:"separator"},null,-1)),c.value.length?($(),Ie(wn,{key:0,onClick:Ue},{default:Xe(()=>[Ce(_t,{name:"chevron-left"})]),_:1})):ge("",!0),c.value.length?($(),Ie(wn,{key:1,onClick:Te},{default:Xe(()=>[Ce(_t,{name:"chevron-right"})]),_:1})):ge("",!0),c.value.length?($(),R("span",t2e,"Matches "+je(d.value)+" / "+je(c.value.length),1)):ge("",!0)])):ge("",!0),Z("div",{ref_key:"viewerEl",ref:h,class:"viewer",onScroll:te},[($(!0),R(Je,null,Ot(E(n),K=>($(),R("div",{key:K,page:K,class:"page"},[Ce(E(r),{scale:i.value,pdf:E(a),page:K,"text-layer":"","highlight-text":o.value,"highlight-options":s.value,onHighlight:x,onLoaded:S},null,8,["scale","pdf","page","highlight-text","highlight-options"])],8,a2e))),128))],544),j[3]||(j[3]=Z("div",{class:"mask"},null,-1))],512))}}),s2e=ke(o2e,[["__scopeId","data-v-0e66d538"]]),i2e={key:0,class:"noURLProvided"},l2e=["src","referrerpolicy"],c2e="A component to embed an external resource in an iframe.",d2e=`
8439
8439
  def load_handler(state):
8440
8440
 
8441
8441
  # Sets status message when resource is loaded
@@ -8504,16 +8504,16 @@ def handle_app_open(state):
8504
8504
 
8505
8505
  page_key = payload.get("page_key")
8506
8506
  route_vars = payload.get("route_vars")
8507
- `.trim(),V2e="The root component of the application, which serves as the starting point of the component hierarchy.",O2e={writer:{name:"Root",category:"Root",description:V2e,allowedChildrenTypes:["page"],fields:{appName:{name:"App name",type:Q.Text,desc:"The app name will be shown in the browser's title bar."},cssClasses:mt,buttonColor:cr,buttonShadow:so,accentColor:Ia,contentPadding:Ds,primaryTextColor:ua,buttonTextColor:dr,emptinessColor:dg,containerShadow:Rs,secondaryTextColor:In,separatorColor:wa,contentVAlign:wd,contentHAlign:Ns,contentWidth:QE},events:{"wf-app-open":{desc:"Captures the first application load, including page key and route vars.",stub:L2e},"wf-hashchange":{desc:"Capture changes to the URL hash, including page key and route vars.",stub:P2e}}}},H2e=$e({...O2e,__name:"CoreRoot",setup(e){const t=re(ne.core),a=re(ne.builderManager),n=re(ne.getChildrenVNodes),r=pt("rootEl"),{isComponentVisible:o}=Kl(t),s=H(()=>{const c=t.activePageId.value;if(!!t.getComponentById(c)&&t.isChildOf("root",c))return c;const u=t.getComponents("root",{includeBMC:!0,includeCMC:!0,sortedByPosition:!0});if(u.length==0)return null;const h=u.filter(f=>o(f.id));return h.length==0?null:h[0].id});ia(()=>{s.value&&t.activePageId.value!==s.value&&t.setActivePageId(s.value)});function i(){var u;const c=I2e(),d=new CustomEvent("wf-hashchange",{detail:{payload:c}});(u=r.value)==null||u.dispatchEvent(d),c.pageKey&&t.setActivePageFromKey(c.pageKey)}We(s,c=>{var h;const u=(h=t.getComponentById(c).content)==null?void 0:h.key;a&&!a.isComponentIdSelected(c)&&a.setSelection(null),qa().then(()=>{var f,m;window.scrollTo(0,0),(m=(f=document.querySelector(".ComponentRenderer"))==null?void 0:f.parentElement)==null||m.scrollTo(0,0)}),T2e(u)});const l=Ki();return ks(()=>{window.addEventListener("hashchange",()=>i(),{signal:l.signal}),i()}),(c,d)=>($(),R("div",{ref_key:"rootEl",ref:r,class:"CoreRoot","data-writer-container":""},[($(!0),R(Je,null,Ot(E(n)(),u=>($(),R(Je,{key:u.key},[u.key===`${s.value}:0`?($(),Ie(Ts(u),{key:0})):ge("",!0)],64))),128))],512))}}),R2e=ke(H2e,[["__scopeId","data-v-391634de"]]),N2e={key:0,class:"noAccessTokenProvided"},D2e=[{lat:37.79322359164316,lng:-122.39999318828129,name:"Marker"}],B2e={writer:{deprecated:!0,name:"Mapbox",description:"A component to embed a Mapbox map. It can be used to display a map with markers.",docs:"For this component you need Mapbox access token: https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",category:"Embed",fields:{accessToken:{name:"Access Token",default:"",desc:"Access token from Mapbox",type:Q.Text},mapStyle:{name:"Map style",default:"mapbox://styles/mapbox/standard",type:Q.Text,desc:"Map style URL"},zoom:{name:"Zoom",default:"8",type:Q.Number},lat:{name:"Latitude",default:"37.79322359164316",type:Q.Number,validator:_d},lng:{name:"Longitude",default:"-122.39999318828129",type:Q.Number,validator:bd},markers:{name:"Markers",init:JSON.stringify(D2e,null,2),desc:"",type:Q.Object,validator:cg},controls:Ut({name:"Enable controls",default:"yes",desc:"Show map controls"}),cssClasses:mt},events:{"mapbox-marker-click":{desc:"Capture single clicks on markers.",eventPayloadExample:[{lat:1,lng:1,name:"Marker"}]},"mapbox-click":{desc:"Capture single click on map.",eventPayloadExample:{lat:1,lng:1}}}}},F2e=$e({...B2e,__name:"CoreMapbox",setup(e){const t=re(ne.evaluatedFields),a=pt("rootEl"),n=pt("mapEl"),r=H(()=>[t.lng.value,t.lat.value]),o=ye(null);let s=[],i=null;const l=async()=>{if(!n.value||!t.accessToken.value)return;const d=await zt(()=>import("./mapbox-gl-IM8CBmd8.js").then(u=>u.m),[],import.meta.url);try{d.accessToken=t.accessToken.value,d.default&&(d.default.accessToken=t.accessToken.value),o.value=new d.Map({container:n.value,style:t.mapStyle.value,center:r.value,zoom:t.zoom.value}),o.value.on("click",u=>{const h=new CustomEvent("mapbox-click",{detail:{payload:{lat:u.lngLat.lat,lng:u.lngLat.lng}}});a.value.dispatchEvent(h)}),i=new d.NavigationControl,t.controls.value&&o.value.addControl(i),t.markers.value&&o.value.on("load",c)}catch(u){fa().error(u)}},c=async()=>{var u,h;if(!o.value)return;const d=await zt(()=>import("./mapbox-gl-IM8CBmd8.js").then(f=>f.m),[],import.meta.url);s.forEach(f=>f.remove()),s=[],(h=(u=t.markers)==null?void 0:u.value)==null||h.forEach(f=>{const m=new d.Marker().setLngLat([f.lng,f.lat]).addTo(o.value).setPopup(new d.Popup().setText(f.name));s.push(m),m.getElement().addEventListener("click",g=>{const _=new CustomEvent("mapbox-marker-click",{detail:{payload:f}});a.value.dispatchEvent(_),g.stopPropagation()})})};return We(t.controls,()=>{o.value&&(t.controls?o.value.addControl(i):o.value.removeControl(i))}),We(t.markers,async()=>{o.value&&await c()}),We(t.mapStyle,()=>{o.value&&o.value.setStyle(t.mapStyle.value)}),We(r,()=>{var d,u;o.value&&((d=r.value)!=null&&d.lat)&&((u=r.value)!=null&&u.lng)&&o.value.setCenter(r.value)}),We(t.zoom,()=>{o.value&&t.zoom.value&&o.value.setZoom(t.zoom.value)}),We([n,t.accessToken],()=>{l()}),(d,u)=>($(),R("div",{ref_key:"rootEl",ref:a,class:"CoreMapbox"},[E(t).accessToken.value?($(),R("div",{key:1,ref_key:"mapEl",ref:n,class:"map"},null,512)):($(),R("div",N2e,u[0]||(u[0]=[Z("h2",null,"MapBox cannot be initialised.",-1),Z("h3",null,"An access token hasn't been provided.",-1)]))),u[1]||(u[1]=Z("div",{class:"mask"},null,-1))],512))}}),j2e=ke(F2e,[["__scopeId","data-v-4859a323"]]),Td=new Set(["root","blueprints_root"]),Pd=new Set(["page","blueprints_blueprint"]),Nde=new Set([...Td,...Pd]);function U2e(e,t){const{type:a}=e[t],o=Rd().map(i=>({type:i,definition:Vi(i)})).filter(i=>i.definition.allowedParentTypes&&!i.definition.allowedParentTypes.includes(a));return new Set(o.map(i=>i.type))}function z2e(e,t){const{type:a,parentId:n}=e[t],r=Rd().filter(l=>!Td.has(l)),{allowedChildrenTypes:o,toolkit:s}=Vi(a);if(!o)return new Set([]);let i=new Set(o);if(o.includes("*")&&(i=new Set([...i,...r])),i.delete("inherit")){if(!n)return i;const l=Ld(e,n);i=new Set([...i,...l])}return s&&(i=new Set(Array.from(i).filter(l=>Vi(l).toolkit==s))),i}function Ld(e,t){const a=Array.from(z2e(e,t)),n=Array.from(U2e(e,t));return a.filter(o=>!n.includes(o))}function q2e(e){return Tr(e)&&"type"in e&&e.type==="writer/clipboard"&&"components"in e&&Array.isArray(e.components)}function W2e(){const e=fa();async function t(){try{const n=await navigator.clipboard.readText(),r=JSON.parse(n);return q2e(r)?r.components:void 0}catch(n){if(n instanceof Error&&n.name==="NotAllowedError")throw Error("Please allow clipboard access in your browser settings or try again");return}}function a(n){const r={type:"writer/clipboard",components:n};try{navigator.clipboard.writeText(JSON.stringify(r))}catch(o){e.warn("Failed to write components in the clipboard",o)}}return{get:t,set:a}}function Z2e(e,t){let a=E(t);const n=new Set;for(;a&&!n.has(a);){n.add(a);const r=e.getComponentById(a);if(!r)return;if(Pd.has(r.type))return r;a=r.parentId}}const Yg="true";function Dde(e){var a;const t=(a=e==null?void 0:e.content)==null?void 0:a.isSharedBlueprint;return String(t)===Yg}function Bs(e,t,a){const n=W2e();function r(){let B="";const N=new Uint16Array(16);return window.crypto.getRandomValues(N),N.forEach(U=>{B+=(U%36).toString(36)}),B}function o(I){const B=e.getComponentById(I);if(!B||B.position==0||!e.getComponentById(B.parentId))return;const se=Me(I,-1),Se=`move-up-${I}`;t.openMutationTransaction(Se,"Move up"),t.registerPreMutation(se),se.position++,t.registerPostMutation(se),t.registerPreMutation(B),B.position--,t.registerPostMutation(B),t.closeMutationTransaction(Se),e.sendComponentUpdate()}function s(I){const B=e.getComponentById(I);if(!B||!e.getComponentById(B.parentId)||B.position==-2)return;const se=Me(I,1);if(!se)return;const Se=`move-down-${I}`;t.openMutationTransaction(Se,"Move down"),t.registerPreMutation(se),se.position--,t.registerPostMutation(se),t.registerPreMutation(B),B.position++,t.registerPostMutation(B),t.closeMutationTransaction(Se),e.sendComponentUpdate()}function i(I,B,N){const U=e.getComponentById(I);if(!U)return;const se=e.getComponentById(U.parentId);if(!se||I==B||se.id==B&&N===null)return;const Se=`move-${I}`;t.openMutationTransaction(Se,"Move"),t.registerPreMutation(U),m(I,-1),U.position=N??xe(B,U.type),U.parentId=B,m(I,1),t.registerPostMutation(U),t.closeMutationTransaction(Se),e.sendComponentUpdate()}function l(I,B){const N=e.getComponentById(I);if(!N)return!1;const U=e.getContainableTypes(I);return!(N!=null&&N.isCodeManaged)&&!e.isChildOf(B.id,I)&&U.includes(B.type)}function c(I){const B=e.getComponentById(I),N=Me(I,1);if(N&&l(N.id,B))return i(I,N.id),N.id}function d(I){const B=e.getComponentById(I),N=e.getComponentById(B.parentId).parentId;if(N&&l(N,B))return i(I,N,0),N}function u(I,B,N,U){const se=r(),Se=e.getComponentDefinition(I),{fields:Ne}=Se,ut={...(U==null?void 0:U.content)??{}};return Object.entries(Ne??{}).forEach(([Ee,Oe])=>{Ee in ut||(ut[Ee]=Oe.init)}),{...U??{},id:se,type:I,parentId:B,content:ut,handlers:{},position:N??xe(B,I)}}function h(I,B,N,U){const se=u(I,B,N,U);se.id=(U==null?void 0:U.id)??se.id;const Se=`create-${se.id}`;return t.openMutationTransaction(Se,"Create"),e.addComponent(se),m(se.id,1),t.registerPostMutation(se),t.closeMutationTransaction(Se),e.sendComponentUpdate(),a==null||a.track(I.startsWith("blueprints_")?"blueprints_block_added":"ui_block_added",{componentId:se.id}),se.id}function f(I,B){if(B.length===0)return[];const N=B.reduce((Se,{type:Ne,position:ut,initProperties:ie},Ee)=>{const Oe=Ee===0?I:Se.at(-1).id??I,Pe=u(Ne,Oe,ut,ie);return Pe.id=(ie==null?void 0:ie.id)??Pe.id,Se.push(Pe),Se},[]),U=N.map(Se=>Se.id),se=`create-${U.join("-")}`;t.openMutationTransaction(se,"Create");for(const Se of N)e.addComponent(Se),m(Se.id,1),t.registerPostMutation(Se),a==null||a.track(Se.type.startsWith("blueprints_")?"blueprints_block_added":"ui_block_added",{componentId:Se.id});return t.closeMutationTransaction(se),e.sendComponentUpdate(),U}function m(I,B){const N=e.getComponentById(I);if(e.getComponentDefinition(N.type).positionless)return;e.getComponents(N.parentId,{includeBMC:!0,includeCMC:!1}).filter(Ne=>Ne.id!==I).filter(Ne=>Ne.position>=N.position).map(Ne=>{t.registerPreMutation(Ne),Ne.position+=B,t.registerPostMutation(Ne)})}function g(I){const B=e.getComponentById(I),N=[],U=se=>{const Se=e.getComponents(se.id);N.push(se),Se.map(Ne=>U(Ne))};return U(B),N}function _(I){return e.getComponents().filter(B=>{var N;return(N=B.outs)==null?void 0:N.find(U=>U.toNodeId==I)})}function b(...I){const B=I.map(U=>e.getComponentById(U)).filter(Boolean);if(B.length===0)return;const N=`delete-${B.map(U=>U.id).join(",")}`;t.openMutationTransaction(N,"Delete");for(const U of B){U.parentId&&m(U.id,-1);const se=_(U.id);for(const Ne of se)t.registerPreMutation(Ne),Ne.outs=[...Ne.outs.filter(ut=>ut.toNodeId!==U.id)];a==null||a.track(U.type.startsWith("blueprints_")?"blueprints_block_deleted":"ui_block_deleted",{componentId:U.id});const Se=g(U.id);for(const Ne of Se)t.registerPreMutation(Ne),e.deleteComponent(Ne.id),t.removeSelectedComponentId(Ne.id)}for(const{pageType:U,rootId:se}of[{rootId:"root",pageType:"page"},{rootId:"blueprints_root",pageType:"blueprints_blueprint"}]){if(e.getComponents(se,{includeBMC:!0,includeCMC:!0}).length>0)continue;const Ne=u(U,se);e.addComponent(Ne),t.registerPostMutation(Ne),e.setActivePageId(Ne.id)}t.closeMutationTransaction(N),e.sendComponentUpdate()}function v(I){return b(I)}function y(I){return Td.has(I)}function M(I){const B=e.getComponentById(I);return!y(I)&&!(B!=null&&B.isCodeManaged)}function x(I){const B=e.getComponentById(I);return!(B!=null&&B.isCodeManaged)&&e.getContainableTypes(I).length>0}function S(I){return!y(I)}function L(I){const B=e.getComponentById(I);return!y(I)&&!(B!=null&&B.isCodeManaged)}function F(I){const B=e.getComponentById(I);return!y(I)&&!(B!=null&&B.isCodeManaged)}function te(I){return!y(I)}function J(I){return e.getComponents(I).length>0}function be(I){return!!Me(I,1)}function oe(I){return!!Me(I,-1)}function Te(I,B){const N=e.getComponentById(I);if(!N)return;const U=N.parentId;if(!U)return;let se;B&&(se=B.split(",").slice(0,-1).join(",")),t.setSelection(U,se)}function Ue(I){const B=e.getComponents(I).sort((N,U)=>N.position-U.position).at(0);B&&t.setSelection(B.id)}function Ze(I){const B=e.getComponentById(I);return B?(t.setSelection(B.id),!0):!1}function Me(I,B){if(y(I))return;const N=e.getComponentById(I);if(!N)return;const{parentId:U,position:se}=N,Se=se+B;return e.getComponents(U,{includeBMC:!0,includeCMC:!1}).find(Ne=>Ne.position===Se&&Ne.parentId===U)}function ee(I){var se,Se;if(y(I))return;const B=(se=e.getComponentById(I))==null?void 0:se.parentId;if(!B)return;const N=e.getComponents(B).sort((Ne,ut)=>Ne.position-ut.position),U=N.findIndex(Ne=>Ne.id===I);U===-1&&U+1===N.length||t.setSelection((Se=N[U+1])==null?void 0:Se.id)}function j(I){const B=Me(I,-1);B&&t.setSelection(B.id)}function K(I){if(I.length==0)return!1;const B={};return[...e.getComponents(),...I].forEach(U=>{B[U.id]=U}),I.map(U=>Ld(B,U.parentId).includes(U.type)).every(U=>U)}function G(I){const B=e.getComponentById(I);return!(!B||B.isCodeManaged)}function T(I){const B=ut=>e.getComponents(ut,{includeBMC:!0,includeCMC:!1}).filter(Oe=>{var Ke;return!((Ke=e.getComponentDefinition(Oe.type))==null?void 0:Ke.positionless)}).length,N=e.getComponentById(I);if(!N||N.isCodeManaged)return{up:!1,down:!1};if(e.getComponentDefinition(N.type).positionless)return{up:!1,down:!1};const se=N.parentId?B(N.parentId):0,Se=se>0&&N.position>0,Ne=se>0&&N.position<se-1;return{up:Se,down:Ne}}function O(I){if(!e.getComponentById(I))return;const N=g(I);n.set(N),t.setSelection(null),v(I),e.sendComponentUpdate()}function k(I){const B=JSON.parse(JSON.stringify(I));return B.forEach(N=>{delete N.isCodeManaged;const U=r();B.filter(se=>se.id!==N.id).map(se=>{var Se;se.parentId==N.id&&(se.parentId=U),(Se=se.outs)==null||Se.forEach(Ne=>{Ne.toNodeId==N.id&&(Ne.toNodeId=U)})}),N.id=U,typeof N.x<"u"&&typeof N.y<"u"&&(N.x+=36,N.y+=36)}),B}function C(I){if(!e.getComponentById(I))return;const N=g(I),U=k(N);n.set(U)}async function P(I){if(!e.getComponentById(I))return;const N=await n.get();if(!N)throw Error("The clipboard doesn't contain Writer data");if(!N.length)throw Error("The clipboard doesn't contain components");const U=N[0];return typeof U.outs<"u"&&U.parentId!==I&&(U.outs=[]),ae(I,N)}function ae(I,B){var se;n.set(k(B));const N=B[0];if(N.parentId=I,N.position=xe(I,N.type),!K(B)){const Se=(se=e.getComponentById(I))==null?void 0:se.parentId;if(Se)return ae(Se,B);throw Error("Could not paste the components here")}const U=`paste-copy-${I}`;t.openMutationTransaction(U,"Paste from copy"),B.map(Se=>{e.addComponent(Se),t.registerPostMutation(Se)}),t.closeMutationTransaction(U),e.sendComponentUpdate()}function xe(I,B){if(e.getComponentDefinition(B).positionless)return-2;const U=e.getComponents(I,{includeBMC:!0,includeCMC:!1}).filter(se=>se.position!==-2);return U.length>0?Math.max(Math.max(...U.map(Se=>Se.position))+1,0):0}function ve(){var B,N;const I=t.getMutationTransactionsSnapshot();return{isUndoAvailable:!!I.undo,isRedoAvailable:!!I.redo,undoDesc:(B=I.undo)==null?void 0:B.desc,redoDesc:(N=I.redo)==null?void 0:N.desc}}function ze(){const I=t.consumeUndoTransaction();I&&(Object.entries(I.mutations).forEach(([B,N])=>{if(N.jsonPre&&N.jsonPost){e.addComponent(JSON.parse(N.jsonPre));return}if(!N.jsonPre&&N.jsonPost){e.deleteComponent(B);return}if(N.jsonPre&&!N.jsonPost){e.addComponent(JSON.parse(N.jsonPre));return}}),e.sendComponentUpdate())}function Ye(){const I=t.consumeRedoTransaction();I&&(Object.entries(I.mutations).forEach(([B,N])=>{if(N.jsonPre&&N.jsonPost){e.addComponent(JSON.parse(N.jsonPost));return}if(!N.jsonPre&&N.jsonPost){e.addComponent(JSON.parse(N.jsonPost));return}if(N.jsonPre&&!N.jsonPost){e.deleteComponent(B);return}}),e.sendComponentUpdate())}function ct(I,B,N){const U=e.getComponentById(I);if(!U)return;const se=`edit-${I}-content-${B}`;t.openMutationTransaction(se,"Edit property",!0),t.registerPreMutation(U),U.content[B]=N,t.registerPostMutation(U),t.closeMutationTransaction(se),e.sendComponentUpdate()}function wt(I,B){const N=e.getComponentById(I);if(!N)return;const U=`add-${I}-out-${B.outId}-${B.toNodeId}`;t.openMutationTransaction(U,"Add out",!0),t.registerPreMutation(N),N.outs=[...N.outs??[],B],t.registerPostMutation(N),t.closeMutationTransaction(U),e.sendComponentUpdate(),a==null||a.track("ui_blueprint_connected",{componentIds:[I,B.toNodeId],outId:B.outId})}function D(I,B){const N=e.getComponentById(I);if(!N)return;const U=`edit-${I}-out-${B.outId}-${B.toNodeId}`;t.openMutationTransaction(U,"Edit out",!0),t.registerPreMutation(N),N.outs=N.outs.filter(se=>!(B.outId===se.outId&&B.toNodeId===se.toNodeId)),t.registerPostMutation(N),t.closeMutationTransaction(U),e.sendComponentUpdate()}function q(I,B,N){const U=e.getComponentById(I);if(!U)return;const se=`change-${I}-coordinates`;t.openMutationTransaction(se,"Change coordinates",!1),t.registerPreMutation(U),U.x=Math.floor(B),U.y=Math.floor(N),t.registerPostMutation(U),t.closeMutationTransaction(se),e.sendComponentUpdate()}function he(I){const B=Object.entries(I);if(B.length==0)return;const N=`change-multiple-coordinates-${Object.keys(I).join(",")}`;t.openMutationTransaction(N,"Change coordinates",!1),B.forEach(([U,{x:se,y:Se}])=>{const Ne=e.getComponentById(U);Ne&&(t.registerPreMutation(Ne),Ne.x=Math.floor(se),Ne.y=Math.floor(Se),t.registerPostMutation(Ne))}),t.closeMutationTransaction(N),e.sendComponentUpdate()}function me(I,B,N="",U=!1){const se=e.getComponentById(I);if(!se)return;const Se=`change-visibility-${I}`;t.openMutationTransaction(Se,"Change visibility",!0),t.registerPreMutation(se),se.visible==null&&(se.visible={expression:!0,binding:"",reversed:!1}),typeof B=="boolean"?se.visible.expression=B:B=="custom"&&(se.visible={expression:"custom",binding:N,reversed:U}),t.registerPostMutation(se),t.closeMutationTransaction(Se),e.sendComponentUpdate()}function _e(I,B,N){const U=e.getComponentById(I);if(!U)return;let se;if(N)se=N;else{const Ne=e.getComponentDefinition(U.type),ie=Object.entries(Ne.events).filter(([Ee,Oe])=>Oe.bindable).map(([Ee,Oe])=>Ee);se=ie==null?void 0:ie[0]}if(!se)return;const Se=`change-binding-${I}`;t.openMutationTransaction(Se,"Change binding",!0),t.registerPreMutation(U),B?U.binding={eventType:se,stateRef:B}:delete U.binding,t.registerPostMutation(U),t.closeMutationTransaction(Se),e.sendComponentUpdate()}function Ae(I,B,N){const U=e.getComponentById(I);if(!U)return;const se=`set-handler-${I}`;t.openMutationTransaction(se,"Set event handler",!0),t.registerPreMutation(U),N?(U.handlers||(U.handlers={}),U.handlers[B]=N):(delete U.handlers[B],Object.keys(U.handlers).length==0&&delete U.handlers),t.registerPostMutation(U),t.closeMutationTransaction(se),e.sendComponentUpdate()}async function pe(I){var se;const B=e.getComponentById(I);if(!B||!((se=e.getComponentDefinition(B.type))==null?void 0:se.name))return;const U=Z2e(e,I);if(U){switch(U==null?void 0:U.type){case"page":t.mode.value="ui";break;case"blueprints_blueprint":t.mode.value="blueprints";break}return e.setActivePageId(U.id),U.id}}function ce(I){return g(I).slice(1).filter(N=>{var U;return N.type!=="note"&&((U=e.getComponentDefinition(N.type))==null?void 0:U.category)!=="Internal"})}function ue(I){const B=r(),N=u("blueprints_blueprint","blueprints_root",void 0,{content:{key:I.title,isSharedBlueprint:Yg,sourceBlueprintId:I.id,deployedVersion:String(I.version),deployedDescription:I.description}});N.id=B;const U=k(I.components),se=new Set(U.map(Ne=>Ne.id));if(U.forEach(Ne=>{(!Ne.parentId||!se.has(Ne.parentId))&&(Ne.parentId=B)}),!K([N,...U]))throw Error("Cannot install blueprint: components are not compatible");const Se=`install-shared-blueprint-${B}`;return t.openMutationTransaction(Se,"Install shared blueprint"),e.addComponent(N),t.registerPostMutation(N),U.forEach(Ne=>{e.addComponent(Ne),t.registerPostMutation(Ne)}),t.closeMutationTransaction(Se),e.sendComponentUpdate(),a==null||a.track("blueprints_shared_installed",{blueprintId:I.id}),B}return{generateNewComponentId:r,moveComponent:i,moveComponentUp:o,moveComponentDown:s,cutComponent:O,copyComponent:C,pasteComponent:P,createAndInsertComponent:h,createAndInsertComponentsTree:f,removeComponentSubtree:v,removeComponentsSubtree:b,isPasteAllowed:G,undo:ze,redo:Ye,setContentValue:ct,addOut:wt,removeOut:D,changeCoordinates:q,changeCoordinatesMultiple:he,setVisibleValue:me,setBinding:_e,getUndoRedoSnapshot:ve,setHandlerValue:Ae,isAddAllowed:x,isCopyAllowed:S,isCutAllowed:L,isDeleteAllowed:F,isGoToParentAllowed:te,isGoToChildAllowed:J,isGoToNextSiblingAllowed:be,isGoToPrevSiblingAllowed:oe,repositionHigherSiblings:m,isDraggingAllowed:M,getEnabledMoves:T,goToParent:Te,goToChild:Ue,goToNextSibling:ee,goToPrevSibling:j,goToComponentParentPage:pe,moveComponentInsideNextSibling:c,moveComponentToParent:d,selectChild:Ze,extractBlueprintComponents:ce,installSharedBlueprint:ue}}const K2e=30,G2e=/^application\/json;writer=(?<componentType>\w+),(?<componentId>[\w\-]*)$/,ei=ye(null),vr=ye(null),I1=ye(!1);let ec=null,k1=null;function J2e(e){function t(_){const b=_.dataTransfer.types[0],v=b==null?void 0:b.match(G2e);if(!(v!=null&&v.groups))return;const{componentType:y,componentId:M}=v.groups;return{draggedType:y,draggedId:y==="blueprints_shared"?"":M,sourceBlueprintId:y==="blueprints_shared"?M:void 0}}function a(_){const y=(_.closest("[data-writer-cage]")??_).closest("[data-writer-id]");if(y)return y.dataset.writerId}function n(_){const b=t(_);if(!b)return;const{draggedType:v,draggedId:y}=b,M=a(_.target);if(!o(M,y,v))return;let S={};v==="blueprints_shared"&&b.sourceBlueprintId&&(S={sourceBlueprintId:b.sourceBlueprintId});const L={draggedType:v,draggedId:y,parentId:ei.value,position:k1,dragContent:S};return g(_),L}function r(_,b,v){const y=e.getComponentById(_);if(!y)return!1;const M=e.getContainableTypes(_);return!(y!=null&&y.isCodeManaged)&&!e.isChildOf(b,_)&&M.includes(v)}function o(_,b,v){const y=e.getComponentById(_);if(y)return r(_,b,v)?_:y.parentId?o(y.parentId,b,v):null}function s(_){if(I1.value){l(_);return}i(_)}function i(_){const b=t(_);if(!b)return;const{draggedType:v,draggedId:y}=b,M=_.target,x=a(M),S=o(x,y,v);if(!S||S==y)return;const F=M.closest(`[data-writer-id="${S}"]`).dataset.writerInstancePath;if(_.preventDefault(),vr.value!==F)ec=Date.now();else if(Date.now()-ec>=Ew){I1.value=!0,h(vr.value);return}ei.value=S,vr.value=F}function l(_){const b=t(_);if(!b)return;_.preventDefault();const v=document.querySelector(`[data-writer-instance-path="${vr.value}"]`);if(u(_.clientX,_.clientY,v)>K2e){g(_);return}const y=c(vr.value);if(y.length==0)return;const M=d(_.clientX,_.clientY,y);if(!M)return;const{el:x}=M,{draggedId:S}=b,L=parseInt(x.dataset.writerPosition),F=e.getComponentById(S);if(y.map(te=>{te.classList.contains("highlighted")&&te.classList.remove("highlighted")}),!x.classList.contains("highlighted")){if(x.classList.add("highlighted"),F&&F.parentId==ei.value&&L>F.position){k1=L-1;return}k1=L}}function c(_){const b=m(_);return Array.from(b.querySelectorAll("[data-writer-position]"))}function d(_,b,v){const y=v.map(M=>({el:M,distance:u(_,b,M)})).sort((M,x)=>M.distance>x.distance?1:-1);return y==null?void 0:y[0]}function u(_,b,v){const{top:y,left:M,right:x,bottom:S}=v.getBoundingClientRect(),L=Math.max(M-_,0,_-x),F=Math.max(y-b,0,b-S);return Math.sqrt(L*L+F*F)}function h(_){m(_).classList.add("crackedContainer")}function f(_){m(_).classList.remove("crackedContainer")}function m(_){const b=document.querySelector(`[data-writer-instance-path="${_}"]`);if(b.hasAttribute("data-writer-container"))return b;const v=b.querySelectorAll("[data-writer-container]");for(let y=0;y<v.length;y++){const M=v[y];if(M.closest("[data-writer-instance-path]")==b)return M}}function g(_){_.preventDefault(),vr.value&&(f(vr.value),vr.value=null),ei.value=null,ec=null,k1=null,I1.value=!1}return{candidateId:ei,candidateInstancePath:vr,isParentSuitable:r,isCandidacyConfirmed:I1,getComponentInfoFromDrag:t,dropComponent:n,assignInsertionCandidacy:s,removeInsertionCandidacy:g}}function tc(e,t){return Math.ceil(e/t)*t}function Em(e,t){return Math.round(e/t)*t}function Qg(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}function Im({x:e,y:t},a){return{x:Em(e,a),y:Em(t,a)}}function Bc({x:e,y:t},{x:a,y:n}){return{x:e+a,y:t+n}}function km(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function T1(e,t,a){return e>=t&&e<=a}function Tm(e,t,a,n){return T1(e,a,n)||T1(t,a,n)||T1(a,e,t)||T1(n,e,t)}function X2e(e,t){const a=Tm(e.x,e.x+e.width,t.x,t.x+t.width),n=Tm(e.y,e.y+e.height,t.y,t.y+t.height);return a&&n}function Pm(e,t,a){const n=[{x:-a,y:-a},{x:-a,y:0},{x:-a,y:a},{x:0,y:-a},{x:0,y:a},{x:a,y:-a},{x:a,y:0},{x:a,y:a}],r=new Set,o=[],s=[];function i({x:f,y:m}){return{width:e.width,height:e.height,x:f,y:m}}function l(f){if(f.x<0||f.y<0)return!1;const m=i(f);return!t.some(g=>X2e(m,g))}function c(f){const m=`${f.x},${f.y}`;r.has(m)||(o.push(f),r.add(m))}for(c({x:e.x,y:e.y});o.length;){const f=o.shift();if(f===void 0)return;if(l(f)&&s.push(f),s.length===0)for(const m of n)c(Bc(f,m))}const d=km(e),u=f=>Qg(d,km(i(f))),h=s.sort((f,m)=>u(f)-u(m)).shift();return h?i(h):void 0}const Y2e="data:image/svg+xml,%3csvg%20width='29'%20height='33'%20viewBox='0%200%2029%2033'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2417_109697)'%3e%3cpath%20d='M14.4995%200C22.2315%200%2028.4995%206.26801%2028.4995%2014C28.4995%2019.8214%2024.9459%2024.8114%2019.8901%2026.9229L14.4995%2032.3135L9.10791%2026.9229C4.05258%2024.8112%200.499512%2019.821%200.499512%2014C0.499512%206.26801%206.76753%200%2014.4995%200Z'%20fill='%23EDE2FF'/%3e%3cpath%20d='M15.1662%2011.3333H11.1662M17.8328%2014H11.1662M20.4995%2016C20.4995%2016.3536%2020.359%2016.6928%2020.109%2016.9428C19.8589%2017.1929%2019.5198%2017.3333%2019.1662%2017.3333H11.1662L8.49951%2020V9.33333C8.49951%208.97971%208.63999%208.64057%208.89004%208.39052C9.14008%208.14048%209.47922%208%209.83285%208H19.1662C19.5198%208%2019.8589%208.14048%2020.109%208.39052C20.359%208.64057%2020.4995%208.97971%2020.4995%209.33333V16Z'%20stroke='black'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2417_109697'%3e%3crect%20width='28'%20height='33'%20fill='white'%20transform='translate(0.499512)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Q2e="data:image/svg+xml,%3csvg%20width='31'%20height='35'%20viewBox='0%200%2031%2035'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2417_109696)'%20filter='url(%23filter0_d_2417_109696)'%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'%20fill='%23D4B2F7'/%3e%3cpath%20d='M16.1662%2011.3333H12.1662M18.8328%2014H12.1662M21.4995%2016C21.4995%2016.3536%2021.359%2016.6928%2021.109%2016.9428C20.8589%2017.1929%2020.5198%2017.3333%2020.1662%2017.3333H12.1662L9.49951%2020V9.33333C9.49951%208.97971%209.63999%208.64057%209.89004%208.39052C10.1401%208.14048%2010.4792%208%2010.8328%208H20.1662C20.5198%208%2020.8589%208.14048%2021.109%208.39052C21.359%208.64057%2021.4995%208.97971%2021.4995%209.33333V16Z'%20stroke='black'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_2417_109696'%20x='0.499512'%20y='0'%20width='30'%20height='35'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='1'/%3e%3cfeGaussianBlur%20stdDeviation='0.5'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.74902%200%200%200%200%200.796078%200%200%200%200%201%200%200%200%201%200'/%3e%3cfeBlend%20mode='multiply'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_2417_109696'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_2417_109696'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_2417_109696'%3e%3crect%20width='28'%20height='33'%20fill='white'%20transform='translate(1.49951)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ece="data:image/svg+xml,%3csvg%20width='31'%20height='35'%20viewBox='0%200%2031%2035'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2417_109695)'%20filter='url(%23filter0_d_2417_109695)'%3e%3cmask%20id='path-1-inside-1_2417_109695'%20fill='white'%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'/%3e%3c/mask%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'%20fill='%23D4B2F7'/%3e%3cpath%20d='M20.8901%2026.9229L20.5048%2026.0001L20.3226%2026.0762L20.183%2026.2157L20.8901%2026.9229ZM15.4995%2032.3135L14.7925%2033.0206L15.4996%2033.7276L16.2066%2033.0206L15.4995%2032.3135ZM10.1079%2026.9229L10.815%2026.2157L10.6754%2026.0762L10.4933%2026.0001L10.1079%2026.9229ZM15.4995%200V1C22.6792%201%2028.4995%206.8203%2028.4995%2014H29.4995H30.4995C30.4995%205.71573%2023.7838%20-1%2015.4995%20-1V0ZM29.4995%2014H28.4995C28.4995%2019.4038%2025.2015%2024.0386%2020.5048%2026.0001L20.8901%2026.9229L21.2755%2027.8456C26.6903%2025.5843%2030.4995%2020.2389%2030.4995%2014H29.4995ZM20.8901%2026.9229L20.183%2026.2157L14.7924%2031.6064L15.4995%2032.3135L16.2066%2033.0206L21.5972%2027.63L20.8901%2026.9229ZM15.4995%2032.3135L16.2066%2031.6063L10.815%2026.2157L10.1079%2026.9229L9.40087%2027.63L14.7925%2033.0206L15.4995%2032.3135ZM10.1079%2026.9229L10.4933%2026.0001C5.79702%2024.0385%202.49951%2019.4035%202.49951%2014H1.49951H0.499512C0.499512%2020.2385%204.30814%2025.584%209.72248%2027.8456L10.1079%2026.9229ZM1.49951%2014H2.49951C2.49951%206.8203%208.31981%201%2015.4995%201V0V-1C7.21524%20-1%200.499512%205.71573%200.499512%2014H1.49951Z'%20fill='white'%20mask='url(%23path-1-inside-1_2417_109695)'/%3e%3cpath%20d='M16.1662%2011.3333H12.1662M18.8328%2014H12.1662M21.4995%2016C21.4995%2016.3536%2021.359%2016.6928%2021.109%2016.9428C20.8589%2017.1929%2020.5198%2017.3333%2020.1662%2017.3333H12.1662L9.49951%2020V9.33333C9.49951%208.97971%209.63999%208.64057%209.89004%208.39052C10.1401%208.14048%2010.4792%208%2010.8328%208H20.1662C20.5198%208%2020.8589%208.14048%2021.109%208.39052C21.359%208.64057%2021.4995%208.97971%2021.4995%209.33333V16Z'%20stroke='black'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_2417_109695'%20x='0.499512'%20y='0'%20width='30'%20height='35'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='1'/%3e%3cfeGaussianBlur%20stdDeviation='0.5'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.74902%200%200%200%200%200.796078%200%200%200%200%201%200%200%200%201%200'/%3e%3cfeBlend%20mode='multiply'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_2417_109695'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_2417_109695'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_2417_109695'%3e%3crect%20width='28'%20height='33'%20fill='white'%20transform='translate(1.49951)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",tce="data:image/svg+xml,%3csvg%20width='31'%20height='35'%20viewBox='0%200%2031%2035'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2417_109694)'%20filter='url(%23filter0_d_2417_109694)'%3e%3cmask%20id='path-1-inside-1_2417_109694'%20fill='white'%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'/%3e%3c/mask%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'%20fill='%23D4B2F7'/%3e%3cpath%20d='M20.8901%2026.9229L20.5048%2026.0001L20.3226%2026.0762L20.183%2026.2157L20.8901%2026.9229ZM15.4995%2032.3135L14.7925%2033.0206L15.4996%2033.7276L16.2066%2033.0206L15.4995%2032.3135ZM10.1079%2026.9229L10.815%2026.2157L10.6754%2026.0762L10.4933%2026.0001L10.1079%2026.9229ZM15.4995%200V1C22.6792%201%2028.4995%206.8203%2028.4995%2014H29.4995H30.4995C30.4995%205.71573%2023.7838%20-1%2015.4995%20-1V0ZM29.4995%2014H28.4995C28.4995%2019.4038%2025.2015%2024.0386%2020.5048%2026.0001L20.8901%2026.9229L21.2755%2027.8456C26.6903%2025.5843%2030.4995%2020.2389%2030.4995%2014H29.4995ZM20.8901%2026.9229L20.183%2026.2157L14.7924%2031.6064L15.4995%2032.3135L16.2066%2033.0206L21.5972%2027.63L20.8901%2026.9229ZM15.4995%2032.3135L16.2066%2031.6063L10.815%2026.2157L10.1079%2026.9229L9.40087%2027.63L14.7925%2033.0206L15.4995%2032.3135ZM10.1079%2026.9229L10.4933%2026.0001C5.79702%2024.0385%202.49951%2019.4035%202.49951%2014H1.49951H0.499512C0.499512%2020.2385%204.30814%2025.584%209.72248%2027.8456L10.1079%2026.9229ZM1.49951%2014H2.49951C2.49951%206.8203%208.31981%201%2015.4995%201V0V-1C7.21524%20-1%200.499512%205.71573%200.499512%2014H1.49951Z'%20fill='white'%20mask='url(%23path-1-inside-1_2417_109694)'/%3e%3cpath%20d='M21.4995%2016C21.4995%2016.3536%2021.359%2016.6928%2021.109%2016.9428C20.8589%2017.1929%2020.5198%2017.3333%2020.1662%2017.3333H12.1662L9.49951%2020V9.33333C9.49951%208.97971%209.63999%208.64057%209.89004%208.39052C10.1401%208.14048%2010.4792%208%2010.8328%208H20.1662C20.5198%208%2020.8589%208.14048%2021.109%208.39052C21.359%208.64057%2021.4995%208.97971%2021.4995%209.33333V16Z'%20stroke='black'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_2417_109694'%20x='0.499512'%20y='0'%20width='30'%20height='35'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='1'/%3e%3cfeGaussianBlur%20stdDeviation='0.5'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.74902%200%200%200%200%200.796078%200%200%200%200%201%200%200%200%201%200'/%3e%3cfeBlend%20mode='multiply'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_2417_109694'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_2417_109694'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_2417_109694'%3e%3crect%20width='28'%20height='33'%20fill='white'%20transform='translate(1.49951)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ace="data:image/svg+xml,%3csvg%20width='31'%20height='35'%20viewBox='0%200%2031%2035'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2417_109693)'%20filter='url(%23filter0_d_2417_109693)'%3e%3cmask%20id='path-1-inside-1_2417_109693'%20fill='white'%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'/%3e%3c/mask%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'%20fill='black'/%3e%3cpath%20d='M20.8901%2026.9229L20.5048%2026.0001L20.3226%2026.0762L20.183%2026.2157L20.8901%2026.9229ZM15.4995%2032.3135L14.7925%2033.0206L15.4996%2033.7276L16.2066%2033.0206L15.4995%2032.3135ZM10.1079%2026.9229L10.815%2026.2157L10.6754%2026.0762L10.4933%2026.0001L10.1079%2026.9229ZM15.4995%200V1C22.6792%201%2028.4995%206.8203%2028.4995%2014H29.4995H30.4995C30.4995%205.71573%2023.7838%20-1%2015.4995%20-1V0ZM29.4995%2014H28.4995C28.4995%2019.4038%2025.2015%2024.0386%2020.5048%2026.0001L20.8901%2026.9229L21.2755%2027.8456C26.6903%2025.5843%2030.4995%2020.2389%2030.4995%2014H29.4995ZM20.8901%2026.9229L20.183%2026.2157L14.7924%2031.6064L15.4995%2032.3135L16.2066%2033.0206L21.5972%2027.63L20.8901%2026.9229ZM15.4995%2032.3135L16.2066%2031.6063L10.815%2026.2157L10.1079%2026.9229L9.40087%2027.63L14.7925%2033.0206L15.4995%2032.3135ZM10.1079%2026.9229L10.4933%2026.0001C5.79702%2024.0385%202.49951%2019.4035%202.49951%2014H1.49951H0.499512C0.499512%2020.2385%204.30814%2025.584%209.72248%2027.8456L10.1079%2026.9229ZM1.49951%2014H2.49951C2.49951%206.8203%208.31981%201%2015.4995%201V0V-1C7.21524%20-1%200.499512%205.71573%200.499512%2014H1.49951Z'%20fill='white'%20mask='url(%23path-1-inside-1_2417_109693)'/%3e%3cpath%20d='M15.4995%2010.6667V14.6667M13.4995%2012.6667H17.4995M21.4995%2016C21.4995%2016.3536%2021.359%2016.6928%2021.109%2016.9428C20.8589%2017.1929%2020.5198%2017.3333%2020.1662%2017.3333H12.1662L9.49951%2020V9.33333C9.49951%208.97971%209.63999%208.64057%209.89004%208.39052C10.1401%208.14048%2010.4792%208%2010.8328%208H20.1662C20.5198%208%2020.8589%208.14048%2021.109%208.39052C21.359%208.64057%2021.4995%208.97971%2021.4995%209.33333V16Z'%20stroke='white'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_2417_109693'%20x='0.499512'%20y='0'%20width='30'%20height='35'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='1'/%3e%3cfeGaussianBlur%20stdDeviation='0.5'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.74902%200%200%200%200%200.796078%200%200%200%200%201%200%200%200%201%200'/%3e%3cfeBlend%20mode='multiply'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_2417_109693'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_2417_109693'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_2417_109693'%3e%3crect%20width='28'%20height='33'%20fill='white'%20transform='translate(1.49951)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",nce=["src"],rce=$e({__name:"BaseNote",props:{componentId:{type:String,required:!0}},setup(e){const t=e,a=re(ne.core),n=re(ne.notesManager),r=H(()=>a.getComponentById(t.componentId)),{state:o}=n.useNoteInformation(r),s=H(()=>{switch(o.value){case"hover":return Q2e;case"active":return ece;case"new":return tce;case"cursor":return ace;default:return Y2e}});function i(){n.selectNote(t.componentId,"show")}return(l,c)=>($(),R("button",{type:"button",class:"BaseNote","data-writer-unselectable":"true",onMouseenter:c[0]||(c[0]=d=>E(n).hoveredNoteId.value=e.componentId),onMouseleave:c[1]||(c[1]=d=>E(n).hoveredNoteId.value=void 0),onClick:i},[Z("img",{src:s.value,width:"32",height:"32"},null,8,nce)],32))}}),oce=ke(rce,[["__scopeId","data-v-1f4e58ab"]]),Lm=5;function sce(e){const{wrapperRef:t,builderManager:a,isAnnotating:n}=e,r=$t({isSelecting:!1,startX:0,startY:0,left:0,top:0,width:0,height:0}),o=Ki(),s=H(()=>r.value.isSelecting),i=ye(!1),l=ye(!1);let c=null,d=null,u=null,h=null,f=null,m=null;function g(ee){if(a.mode.value==="preview"){i.value=!1;return}if(n.value){i.value=!1;return}if(ee.shiftKey||ee.ctrlKey||ee.metaKey){i.value=!1;return}if(a.mode.value==="blueprints"&&!ee.altKey){i.value=!1;return}if(!(ee.target instanceof Element)){i.value=!1;return}const j=ee.target,K=t.value;if(!K||!K.contains(j)){i.value=!1;return}if(j.closest("[data-writer-id]"))if(a.mode.value==="blueprints"){if(!b(j)){i.value=!1;return}}else{i.value=!1;return}if(!y(j)){i.value=!1;return}if(a.mode.value==="blueprints"&&!v(j)){i.value=!1;return}i.value=!0}function _(ee){return a.mode.value==="preview"||n.value?!1:a.mode.value==="blueprints"?!(!ee.altKey||ee.shiftKey||ee.ctrlKey||ee.metaKey):!(ee.shiftKey||ee.ctrlKey||ee.metaKey||ee.altKey)}function b(ee){const j=ee.closest("[data-writer-id]");if(!j)return!0;const K=ee.closest(".BlueprintsBlueprint");return K?j===K:!1}function v(ee){const j=ee.closest(".BlueprintsBlueprint");if(!j)return!1;const K=j.querySelector(".nodeContainer");return K?K.contains(ee):!1}function y(ee){return!(ee.closest("[data-writer-unselectable]")||ee.classList.contains("selectionRectangle"))}function M(ee,j){const K=ee.querySelectorAll("[data-writer-id]"),G=[];for(const T of Array.from(K)){if(T.closest("[data-writer-unselectable]"))continue;const O=T.getBoundingClientRect();if(O.left>=j.left&&O.right<=j.right&&O.top>=j.top&&O.bottom<=j.bottom){const C=T.dataset.writerId,P=T.dataset.writerInstancePath;C&&G.push({componentId:C,instancePath:P&&P.trim()?P:void 0})}}return G}function x(){r.value.isSelecting&&(c&&(c.abort(),c=null),d!==null&&(cancelAnimationFrame(d),d=null),u=null,h!==null&&(cancelAnimationFrame(h),h=null),f=null,m!==null&&(clearTimeout(m),m=null),r.value={...r.value,isSelecting:!1},document.body.style.userSelect="",document.body.style.cursor="")}function S(ee){const K=window.getComputedStyle(ee).transform;let G=1,T=1;if(K&&K!=="none"){const O=K.match(/matrix\(([^)]+)\)/);if(O){const k=O[1].split(",").map(C=>parseFloat(C.trim()));k.length>=4&&(G=k[0],T=k[3])}}return{scaleX:G,scaleY:T}}function L(ee,j){const K=ee.getBoundingClientRect(),{scaleX:G,scaleY:T}=S(ee);return{left:K.left+j.left*G,top:K.top+j.top*T,right:K.left+(j.left+j.width)*G,bottom:K.top+(j.top+j.height)*T}}function F(ee){if(!r.value.isSelecting||a.mode.value==="preview")return;const j=t.value;if(j)try{const K=j.getBoundingClientRect(),{scaleX:G,scaleY:T}=S(j),O=(ee.clientX-K.left)/G,k=(ee.clientY-K.top)/T+j.scrollTop,{startX:C,startY:P}=r.value,ae=Math.min(C,O),xe=Math.min(P,k)-j.scrollTop,ve=Math.abs(O-C),ze=Math.abs(k-P);r.value={...r.value,left:ae,top:xe,width:ve,height:ze}}catch{x()}}function te(ee){r.value.isSelecting&&a.mode.value!=="preview"&&(f=ee,h===null&&(h=requestAnimationFrame(()=>{f&&(F(f),f=null),h=null})))}function J(ee){r.value.isSelecting&&(te(ee),ee.preventDefault())}function be(ee){if(!_(ee)||!(ee.target instanceof Element))return;const j=ee.target;if(j.closest("[data-writer-id]"))if(a.mode.value==="blueprints"){if(!b(j))return}else return;if(!y(j))return;const G=t.value;if(!G||!G.contains(j))return;ee.stopPropagation(),ee.preventDefault();const T=G.getBoundingClientRect(),{scaleX:O,scaleY:k}=S(G),C=(ee.clientX-T.left)/O,P=(ee.clientY-T.top)/k+G.scrollTop;r.value={isSelecting:!0,startX:C,startY:P,left:C,top:P-G.scrollTop,width:0,height:0},document.body.style.userSelect="none",document.body.style.cursor="crosshair",c=new AbortController,G.addEventListener("mousemove",J,{signal:c.signal})}function oe(ee){if(r.value.isSelecting){a.mode.value==="blueprints"&&ee.stopPropagation(),te(ee),ee.preventDefault();return}u=ee,d===null&&(d=requestAnimationFrame(()=>{u&&(g(u),u=null),d=null}))}function Te(ee){if(!r.value.isSelecting)return;if(a.mode.value==="preview"){x();return}const{left:j,top:K,width:G,height:T}=r.value;if(G<Lm||T<Lm){x();return}ee.stopPropagation(),ee.preventDefault(),ee.stopImmediatePropagation();const O=t.value;if(!O){x();return}const k=L(O,{left:j,top:K,width:G,height:T}),C=M(O,k);if(C.length>0){const[P,...ae]=C;a.setSelection(P.componentId,P.instancePath,"click"),ae.forEach(({componentId:xe,instancePath:ve})=>{a.appendSelection(xe,ve,"click")}),l.value=!0,m&&clearTimeout(m),qa().then(()=>{requestAnimationFrame(()=>{l.value=!1,m=null})})}else a.setSelection(null);x()}function Ue(ee){if(r.value.isSelecting){const j=t.value;if(j&&ee.target instanceof Node&&j.contains(ee.target))return;x()}}function Ze(ee){l.value&&(ee.preventDefault(),ee.stopPropagation(),ee.stopImmediatePropagation())}Wn(()=>{m&&clearTimeout(m),o.abort(),x()});function Me(ee){i.value=!1}return{selectionRect:r,isCursorSelecting:s,isHoveringSelectableArea:i,justCompletedDragSelection:l,handleMousedown:be,handleMousemove:oe,handleMouseup:Te,handleMouseleave:Me,handleDocumentMouseup:Ue,handleDocumentClick:Ze}}const ice=["d"],lce=["d"],cce=["cx","cy"],dce=["x1","y1","x2","y2","stroke"],uce=["x1","y1","x2","y2","stroke"],ti=30,hce=$e({__name:"BlueprintArrow",props:{arrow:{},isSelected:{type:Boolean},isEngaged:{type:Boolean}},emits:["delete"],setup(e,{emit:t}){const a=t,n=e,r=H(()=>{const i=n.arrow.x2-n.arrow.x1,l=n.arrow.y2-n.arrow.y1;return[{x:n.arrow.x1,y:n.arrow.y1},{x:n.arrow.x1+ti,y:n.arrow.y1},{x:n.arrow.x1+ti,y:n.arrow.y1+l*.25},{x:n.arrow.x1+i*.5,y:n.arrow.y1+l*.5},{x:n.arrow.x2-ti,y:n.arrow.y1+l*.75},{x:n.arrow.x2-ti,y:n.arrow.y2},{x:n.arrow.x2,y:n.arrow.y2}]}),o=H(()=>{const i=n.arrow.x2-n.arrow.x1,l=r.value;let c;return i>ti?(c=`M ${l[0].x} ${l[0].y}`,c+=`C ${l[3].x} ${l[0].y}, ${l[3].x} ${l[6].y}, ${l[6].x} ${l[6].y}`):(c=`M ${l[0].x} ${l[0].y}`,c+=`C ${l[1].x} ${l[1].y}, ${l[2].x} ${l[2].y}, ${l[3].x} ${l[3].y}`,c+=`C ${l[4].x} ${l[4].y}, ${l[5].x} ${l[5].y}, ${l[6].x} ${l[6].y}`),c});function s(){a("delete")}return(i,l)=>($(),R("g",{class:ft(["BlueprintArrow",{engaged:i.isEngaged}]),tabindex:"0","data-writer-unselectable":"true"},[Z("path",{d:o.value,style:bt({stroke:i.arrow.color})},null,12,ice),Z("path",{d:o.value,style:bt({stroke:i.arrow.color,strokeWidth:12,opacity:i.isSelected?"0.2":"0"})},null,12,lce),i.isSelected?($(),R("g",{key:0,class:"delete",tabindex:"0","aria-label":"Delete relation",onClick:s,onKeydown:Sr(s,["enter"])},[Z("circle",{cx:r.value[3].x,cy:r.value[3].y,r:"12"},null,8,cce),Z("line",{class:"cross",x1:r.value[3].x-4,y1:r.value[3].y-4,x2:r.value[3].x+4,y2:r.value[3].y+4,stroke:i.arrow.color,"stroke-width":"2"},null,8,dce),Z("line",{class:"cross",x1:r.value[3].x+4,y1:r.value[3].y-4,x2:r.value[3].x-4,y2:r.value[3].y+4,stroke:i.arrow.color,"stroke-width":"2"},null,8,uce)],32)):ge("",!0)],2))}}),Vm=ke(hce,[["__scopeId","data-v-343694d1"]]),pce=$e({__name:"BlueprintMiniMap",props:{nodeContainerEl:{},renderOffset:{},zoomLevel:{}},emits:["changeRenderOffset"],setup(e,{emit:t}){ji(v=>({"5436111d":`${l.value.width}px`,"2f2ee374":`${l.value.height}px`,"791851f1":c.value.isDisplayed?"":"none"}));const a=re(ne.builderManager),n=pt("rootEl"),r=t,o=new ResizeObserver(f),s=new MutationObserver(f),i=ye(.2),l=ye({width:166,height:100}),c=ye({width:260,height:1,top:0,left:0,isDisplayed:!1}),d=ye({width:1,height:1,top:0,left:0}),u=e,h=ye([]);function f(){if(!u.nodeContainerEl)return;const v=Array.from(u.nodeContainerEl.querySelectorAll("[data-writer-id]")),y=u.nodeContainerEl.getBoundingClientRect();let M=0,x=0;h.value=v.map(S=>{const L=S.getBoundingClientRect();return M=Math.max(M,L.right+u.renderOffset.x*u.zoomLevel-y.left),x=Math.max(x,L.bottom+u.renderOffset.y*u.zoomLevel-y.top),{id:S.dataset.writerId,width:L.width,height:L.height,top:L.top+u.renderOffset.y*u.zoomLevel-y.top,left:L.left+u.renderOffset.x*u.zoomLevel-y.left}}),l.value={width:260,height:y.height/y.width*y.width/7},i.value=Math.min(l.value.width/(y.width+300),l.value.height/(y.height+300),l.value.width/(M+300),l.value.height/(x+300),l.value.width/(u.renderOffset.x*u.zoomLevel+y.width),l.value.height/(u.renderOffset.y*u.zoomLevel+y.height)),d.value={top:u.renderOffset.y*u.zoomLevel,left:u.renderOffset.x*u.zoomLevel,width:y.width,height:y.height},c.value={...d.value,isDisplayed:c.value.isDisplayed}}function m(v){const y=u.nodeContainerEl.getBoundingClientRect(),M=n.value.getBoundingClientRect();c.value={...c.value,top:Math.min(Math.max(0,(v.pageY-M.top)*(1/i.value)-y.height/2),M.height*(1/i.value)-y.height),left:Math.min(Math.max(0,(v.pageX-M.left)*(1/i.value)-y.width/2),M.width*(1/i.value)-y.width)}}function g(){c.value.isDisplayed=!0}function _(){c.value.isDisplayed=!1}function b(v){v.stopPropagation(),a.setSelection(null),r("changeRenderOffset",{x:c.value.left*(1/u.zoomLevel),y:c.value.top*(1/u.zoomLevel)})}return ia(async()=>{o.observe(u.nodeContainerEl),s.observe(u.nodeContainerEl,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style"]}),await qa(),f()}),Wn(()=>{o.disconnect(),s.disconnect()}),(v,y)=>($(),R("div",{ref_key:"rootEl",ref:n,class:"BlueprintMiniMap",onMouseenter:g,onMouseleave:_,onMousemove:m,onClick:b},[Z("div",{class:"selectedArea",style:bt({top:`${d.value.top*i.value}px`,left:`${d.value.left*i.value}px`,width:`${d.value.width*i.value}px`,height:`${d.value.height*i.value}px`})},null,4),Z("div",{class:"selector",style:bt({top:`${c.value.top*i.value}px`,left:`${c.value.left*i.value}px`,width:`${c.value.width*i.value}px`,height:`${c.value.height*i.value}px`})},null,4),($(!0),R(Je,null,Ot(h.value,M=>($(),R("div",{key:M.id,class:ft(["node",{selected:E(a).isComponentIdSelected(M.id)}]),style:bt({top:`${M.top*i.value}px`,left:`${M.left*i.value}px`,width:`${M.width*i.value}px`,height:`${M.height*i.value}px`})},null,6))),128))],544))}}),fce=ke(pce,[["__scopeId","data-v-05861f5c"]]);function mce(){var t;return((t=navigator==null?void 0:navigator.userAgentData)==null?void 0:t.platform)||(navigator==null?void 0:navigator.platform)}function Wr(){return Vd()?"⌘ ":"Ctrl+"}function Fc(e){return Vd()?e.metaKey:e.ctrlKey}function Vd(){return mce().toLowerCase().indexOf("mac")!=-1}const vce={class:"bar"},gce={class:"autoArranger"},yce={class:"zoomer"},Mce={class:"miniMapCollapser"},Om=.01,P1=.2,_ce=$e({__name:"BlueprintNavigator",props:{nodeContainerEl:{},renderOffset:{},zoomLevel:{}},emits:["changeRenderOffset","changeZoomLevel","resetZoom","autoArrange"],setup(e,{emit:t}){const a=e,{zoomLevel:n}=a0(a),r=pt("rootEl"),o=t,s=ye(!0),i=ye(l(n.value));function l(v){return`${Math.floor(v*100)}%`}function c(){s.value=!s.value}function d(){o("autoArrange")}function u(v){o("changeRenderOffset",v)}function h(){const v=n.value+P1;o("changeZoomLevel",v)}function f(){const v=n.value-P1;o("changeZoomLevel",v)}function m(v){const y=v.key;let M=n.value;if(y=="ArrowUp")M+=Om;else if(y=="ArrowDown")M-=Om;else return;o("changeZoomLevel",M)}function g(v){var x;const y=(x=v.target)==null?void 0:x.value;let M=parseInt(y)/100;isNaN(M)&&(M=1),i.value=l(M),o("changeZoomLevel",M)}function _(){o("resetZoom")}We(n,v=>{i.value=l(v)});function b(v){if(Fc(v)===!1)return;let y=n.value;if(v.key=="+"||v.key=="=")v.preventDefault(),y+=P1;else if(v.key=="-")v.preventDefault(),y-=P1;else return;o("changeZoomLevel",y)}return ia(()=>{document.addEventListener("keydown",b)}),Wn(()=>{document.removeEventListener("keydown",b)}),(v,y)=>($(),R("div",{ref_key:"rootEl",ref:r,"data-writer-unselectable":"true",class:"BlueprintNavigator",onKeydown:b},[v.nodeContainerEl&&s.value?($(),Ie(fce,{key:0,"node-container-el":v.nodeContainerEl,"render-offset":v.renderOffset,"zoom-level":E(n),class:"miniMap",onChangeRenderOffset:u},null,8,["node-container-el","render-offset","zoom-level"])):ge("",!0),Z("div",vce,[Z("div",gce,[Ce(La,{variant:"neutral",size:"smallIcon","data-writer-tooltip":"Auto arrange blocks","data-writer-tooltip-placement":"left",onClick:d},{default:Xe(()=>[Ce(_t,{name:"grid-3x3"})]),_:1})]),Z("div",yce,[Ce(La,{variant:"neutral",size:"smallIcon","data-writer-tooltip":E(n)>E(bo).minLevel?`Zoom out (${E(Wr)()}-)`:"Can't zoom further","data-writer-tooltip-placement":"left",onClick:f},{default:Xe(()=>[Ce(_t,{name:"minus"})]),_:1},8,["data-writer-tooltip"]),Ce(fg,{modelValue:i.value,"onUpdate:modelValue":y[0]||(y[0]=M=>i.value=M),class:"zoomLevelInput",onKeydown:m,onChange:g},null,8,["modelValue"]),Ce(La,{variant:"neutral",size:"smallIcon","data-writer-tooltip":E(n)<E(bo).maxLevel?`Zoom in (${E(Wr)()}+)`:"Can't zoom further","data-writer-tooltip-placement":"right",onClick:h},{default:Xe(()=>[Ce(_t,{name:"plus"})]),_:1},8,["data-writer-tooltip"]),Ce(La,{variant:"neutral",size:"smallIcon","data-writer-tooltip":"Reset zoom","data-writer-tooltip-placement":"right",onClick:_},{default:Xe(()=>[Ce(_t,{name:"undo-2"})]),_:1})]),Z("div",Mce,[Ce(La,{variant:"neutral",size:"smallIcon","data-writer-tooltip":s.value?"Close minimap":"Open minimap","data-writer-tooltip-placement":"right",onClick:c},{default:Xe(()=>[Ce(_t,{name:s.value?"minimize-2":"maximize-2"},null,8,["name"])]),_:1},8,["data-writer-tooltip"])])])],544))}}),bce=ke(_ce,[["__scopeId","data-v-ee6553db"]]),wce={},xce={width:"592",height:"592",viewBox:"0 0 592 592",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Cce(e,t){return $(),R("svg",xce,t[0]||(t[0]=[Z("g",null,[Z("g",{"clip-path":"url(#paint0_angular_167_137448_clip_path)"},[Z("g",{transform:"matrix(0.208791 0.208791 -0.208791 0.208791 296.078 296.082)"},[Z("foreignObject",{x:"-1003.39",y:"-1003.39",width:"2006.77",height:"2006.77"},[Z("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{background:`conic-gradient(
8507
+ `.trim(),V2e="The root component of the application, which serves as the starting point of the component hierarchy.",O2e={writer:{name:"Root",category:"Root",description:V2e,allowedChildrenTypes:["page"],fields:{appName:{name:"App name",type:Q.Text,desc:"The app name will be shown in the browser's title bar."},cssClasses:mt,buttonColor:cr,buttonShadow:so,accentColor:Ia,contentPadding:Ds,primaryTextColor:ua,buttonTextColor:dr,emptinessColor:dg,containerShadow:Rs,secondaryTextColor:In,separatorColor:wa,contentVAlign:wd,contentHAlign:Ns,contentWidth:QE},events:{"wf-app-open":{desc:"Captures the first application load, including page key and route vars.",stub:L2e},"wf-hashchange":{desc:"Capture changes to the URL hash, including page key and route vars.",stub:P2e}}}},H2e=$e({...O2e,__name:"CoreRoot",setup(e){const t=re(ne.core),a=re(ne.builderManager),n=re(ne.getChildrenVNodes),r=pt("rootEl"),{isComponentVisible:o}=Kl(t),s=H(()=>{const c=t.activePageId.value;if(!!t.getComponentById(c)&&t.isChildOf("root",c))return c;const u=t.getComponents("root",{includeBMC:!0,includeCMC:!0,sortedByPosition:!0});if(u.length==0)return null;const h=u.filter(f=>o(f.id));return h.length==0?null:h[0].id});ia(()=>{s.value&&t.activePageId.value!==s.value&&t.setActivePageId(s.value)});function i(){var u;const c=I2e(),d=new CustomEvent("wf-hashchange",{detail:{payload:c}});(u=r.value)==null||u.dispatchEvent(d),c.pageKey&&t.setActivePageFromKey(c.pageKey)}We(s,c=>{var h;const u=(h=t.getComponentById(c).content)==null?void 0:h.key;a&&!a.isComponentIdSelected(c)&&a.setSelection(null),qa().then(()=>{var f,m;window.scrollTo(0,0),(m=(f=document.querySelector(".ComponentRenderer"))==null?void 0:f.parentElement)==null||m.scrollTo(0,0)}),T2e(u)});const l=Ki();return ks(()=>{window.addEventListener("hashchange",()=>i(),{signal:l.signal}),i()}),(c,d)=>($(),R("div",{ref_key:"rootEl",ref:r,class:"CoreRoot","data-writer-container":""},[($(!0),R(Je,null,Ot(E(n)(),u=>($(),R(Je,{key:u.key},[u.key===`${s.value}:0`?($(),Ie(Ts(u),{key:0})):ge("",!0)],64))),128))],512))}}),R2e=ke(H2e,[["__scopeId","data-v-391634de"]]),N2e={key:0,class:"noAccessTokenProvided"},D2e=[{lat:37.79322359164316,lng:-122.39999318828129,name:"Marker"}],B2e={writer:{deprecated:!0,name:"Mapbox",description:"A component to embed a Mapbox map. It can be used to display a map with markers.",docs:"For this component you need Mapbox access token: https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",category:"Embed",fields:{accessToken:{name:"Access Token",default:"",desc:"Access token from Mapbox",type:Q.Text},mapStyle:{name:"Map style",default:"mapbox://styles/mapbox/standard",type:Q.Text,desc:"Map style URL"},zoom:{name:"Zoom",default:"8",type:Q.Number},lat:{name:"Latitude",default:"37.79322359164316",type:Q.Number,validator:_d},lng:{name:"Longitude",default:"-122.39999318828129",type:Q.Number,validator:bd},markers:{name:"Markers",init:JSON.stringify(D2e,null,2),desc:"",type:Q.Object,validator:cg},controls:Ut({name:"Enable controls",default:"yes",desc:"Show map controls"}),cssClasses:mt},events:{"mapbox-marker-click":{desc:"Capture single clicks on markers.",eventPayloadExample:[{lat:1,lng:1,name:"Marker"}]},"mapbox-click":{desc:"Capture single click on map.",eventPayloadExample:{lat:1,lng:1}}}}},F2e=$e({...B2e,__name:"CoreMapbox",setup(e){const t=re(ne.evaluatedFields),a=pt("rootEl"),n=pt("mapEl"),r=H(()=>[t.lng.value,t.lat.value]),o=ye(null);let s=[],i=null;const l=async()=>{if(!n.value||!t.accessToken.value)return;const d=await zt(()=>import("./mapbox-gl-CIiXHAHs.js").then(u=>u.m),[],import.meta.url);try{d.accessToken=t.accessToken.value,d.default&&(d.default.accessToken=t.accessToken.value),o.value=new d.Map({container:n.value,style:t.mapStyle.value,center:r.value,zoom:t.zoom.value}),o.value.on("click",u=>{const h=new CustomEvent("mapbox-click",{detail:{payload:{lat:u.lngLat.lat,lng:u.lngLat.lng}}});a.value.dispatchEvent(h)}),i=new d.NavigationControl,t.controls.value&&o.value.addControl(i),t.markers.value&&o.value.on("load",c)}catch(u){fa().error(u)}},c=async()=>{var u,h;if(!o.value)return;const d=await zt(()=>import("./mapbox-gl-CIiXHAHs.js").then(f=>f.m),[],import.meta.url);s.forEach(f=>f.remove()),s=[],(h=(u=t.markers)==null?void 0:u.value)==null||h.forEach(f=>{const m=new d.Marker().setLngLat([f.lng,f.lat]).addTo(o.value).setPopup(new d.Popup().setText(f.name));s.push(m),m.getElement().addEventListener("click",g=>{const _=new CustomEvent("mapbox-marker-click",{detail:{payload:f}});a.value.dispatchEvent(_),g.stopPropagation()})})};return We(t.controls,()=>{o.value&&(t.controls?o.value.addControl(i):o.value.removeControl(i))}),We(t.markers,async()=>{o.value&&await c()}),We(t.mapStyle,()=>{o.value&&o.value.setStyle(t.mapStyle.value)}),We(r,()=>{var d,u;o.value&&((d=r.value)!=null&&d.lat)&&((u=r.value)!=null&&u.lng)&&o.value.setCenter(r.value)}),We(t.zoom,()=>{o.value&&t.zoom.value&&o.value.setZoom(t.zoom.value)}),We([n,t.accessToken],()=>{l()}),(d,u)=>($(),R("div",{ref_key:"rootEl",ref:a,class:"CoreMapbox"},[E(t).accessToken.value?($(),R("div",{key:1,ref_key:"mapEl",ref:n,class:"map"},null,512)):($(),R("div",N2e,u[0]||(u[0]=[Z("h2",null,"MapBox cannot be initialised.",-1),Z("h3",null,"An access token hasn't been provided.",-1)]))),u[1]||(u[1]=Z("div",{class:"mask"},null,-1))],512))}}),j2e=ke(F2e,[["__scopeId","data-v-4859a323"]]),Td=new Set(["root","blueprints_root"]),Pd=new Set(["page","blueprints_blueprint"]),Nde=new Set([...Td,...Pd]);function U2e(e,t){const{type:a}=e[t],o=Rd().map(i=>({type:i,definition:Vi(i)})).filter(i=>i.definition.allowedParentTypes&&!i.definition.allowedParentTypes.includes(a));return new Set(o.map(i=>i.type))}function z2e(e,t){const{type:a,parentId:n}=e[t],r=Rd().filter(l=>!Td.has(l)),{allowedChildrenTypes:o,toolkit:s}=Vi(a);if(!o)return new Set([]);let i=new Set(o);if(o.includes("*")&&(i=new Set([...i,...r])),i.delete("inherit")){if(!n)return i;const l=Ld(e,n);i=new Set([...i,...l])}return s&&(i=new Set(Array.from(i).filter(l=>Vi(l).toolkit==s))),i}function Ld(e,t){const a=Array.from(z2e(e,t)),n=Array.from(U2e(e,t));return a.filter(o=>!n.includes(o))}function q2e(e){return Tr(e)&&"type"in e&&e.type==="writer/clipboard"&&"components"in e&&Array.isArray(e.components)}function W2e(){const e=fa();async function t(){try{const n=await navigator.clipboard.readText(),r=JSON.parse(n);return q2e(r)?r.components:void 0}catch(n){if(n instanceof Error&&n.name==="NotAllowedError")throw Error("Please allow clipboard access in your browser settings or try again");return}}function a(n){const r={type:"writer/clipboard",components:n};try{navigator.clipboard.writeText(JSON.stringify(r))}catch(o){e.warn("Failed to write components in the clipboard",o)}}return{get:t,set:a}}function Z2e(e,t){let a=E(t);const n=new Set;for(;a&&!n.has(a);){n.add(a);const r=e.getComponentById(a);if(!r)return;if(Pd.has(r.type))return r;a=r.parentId}}const Yg="true";function Dde(e){var a;const t=(a=e==null?void 0:e.content)==null?void 0:a.isSharedBlueprint;return String(t)===Yg}function Bs(e,t,a){const n=W2e();function r(){let B="";const N=new Uint16Array(16);return window.crypto.getRandomValues(N),N.forEach(U=>{B+=(U%36).toString(36)}),B}function o(I){const B=e.getComponentById(I);if(!B||B.position==0||!e.getComponentById(B.parentId))return;const se=Me(I,-1),Se=`move-up-${I}`;t.openMutationTransaction(Se,"Move up"),t.registerPreMutation(se),se.position++,t.registerPostMutation(se),t.registerPreMutation(B),B.position--,t.registerPostMutation(B),t.closeMutationTransaction(Se),e.sendComponentUpdate()}function s(I){const B=e.getComponentById(I);if(!B||!e.getComponentById(B.parentId)||B.position==-2)return;const se=Me(I,1);if(!se)return;const Se=`move-down-${I}`;t.openMutationTransaction(Se,"Move down"),t.registerPreMutation(se),se.position--,t.registerPostMutation(se),t.registerPreMutation(B),B.position++,t.registerPostMutation(B),t.closeMutationTransaction(Se),e.sendComponentUpdate()}function i(I,B,N){const U=e.getComponentById(I);if(!U)return;const se=e.getComponentById(U.parentId);if(!se||I==B||se.id==B&&N===null)return;const Se=`move-${I}`;t.openMutationTransaction(Se,"Move"),t.registerPreMutation(U),m(I,-1),U.position=N??xe(B,U.type),U.parentId=B,m(I,1),t.registerPostMutation(U),t.closeMutationTransaction(Se),e.sendComponentUpdate()}function l(I,B){const N=e.getComponentById(I);if(!N)return!1;const U=e.getContainableTypes(I);return!(N!=null&&N.isCodeManaged)&&!e.isChildOf(B.id,I)&&U.includes(B.type)}function c(I){const B=e.getComponentById(I),N=Me(I,1);if(N&&l(N.id,B))return i(I,N.id),N.id}function d(I){const B=e.getComponentById(I),N=e.getComponentById(B.parentId).parentId;if(N&&l(N,B))return i(I,N,0),N}function u(I,B,N,U){const se=r(),Se=e.getComponentDefinition(I),{fields:Ne}=Se,ut={...(U==null?void 0:U.content)??{}};return Object.entries(Ne??{}).forEach(([Ee,Oe])=>{Ee in ut||(ut[Ee]=Oe.init)}),{...U??{},id:se,type:I,parentId:B,content:ut,handlers:{},position:N??xe(B,I)}}function h(I,B,N,U){const se=u(I,B,N,U);se.id=(U==null?void 0:U.id)??se.id;const Se=`create-${se.id}`;return t.openMutationTransaction(Se,"Create"),e.addComponent(se),m(se.id,1),t.registerPostMutation(se),t.closeMutationTransaction(Se),e.sendComponentUpdate(),a==null||a.track(I.startsWith("blueprints_")?"blueprints_block_added":"ui_block_added",{componentId:se.id}),se.id}function f(I,B){if(B.length===0)return[];const N=B.reduce((Se,{type:Ne,position:ut,initProperties:ie},Ee)=>{const Oe=Ee===0?I:Se.at(-1).id??I,Pe=u(Ne,Oe,ut,ie);return Pe.id=(ie==null?void 0:ie.id)??Pe.id,Se.push(Pe),Se},[]),U=N.map(Se=>Se.id),se=`create-${U.join("-")}`;t.openMutationTransaction(se,"Create");for(const Se of N)e.addComponent(Se),m(Se.id,1),t.registerPostMutation(Se),a==null||a.track(Se.type.startsWith("blueprints_")?"blueprints_block_added":"ui_block_added",{componentId:Se.id});return t.closeMutationTransaction(se),e.sendComponentUpdate(),U}function m(I,B){const N=e.getComponentById(I);if(e.getComponentDefinition(N.type).positionless)return;e.getComponents(N.parentId,{includeBMC:!0,includeCMC:!1}).filter(Ne=>Ne.id!==I).filter(Ne=>Ne.position>=N.position).map(Ne=>{t.registerPreMutation(Ne),Ne.position+=B,t.registerPostMutation(Ne)})}function g(I){const B=e.getComponentById(I),N=[],U=se=>{const Se=e.getComponents(se.id);N.push(se),Se.map(Ne=>U(Ne))};return U(B),N}function _(I){return e.getComponents().filter(B=>{var N;return(N=B.outs)==null?void 0:N.find(U=>U.toNodeId==I)})}function b(...I){const B=I.map(U=>e.getComponentById(U)).filter(Boolean);if(B.length===0)return;const N=`delete-${B.map(U=>U.id).join(",")}`;t.openMutationTransaction(N,"Delete");for(const U of B){U.parentId&&m(U.id,-1);const se=_(U.id);for(const Ne of se)t.registerPreMutation(Ne),Ne.outs=[...Ne.outs.filter(ut=>ut.toNodeId!==U.id)];a==null||a.track(U.type.startsWith("blueprints_")?"blueprints_block_deleted":"ui_block_deleted",{componentId:U.id});const Se=g(U.id);for(const Ne of Se)t.registerPreMutation(Ne),e.deleteComponent(Ne.id),t.removeSelectedComponentId(Ne.id)}for(const{pageType:U,rootId:se}of[{rootId:"root",pageType:"page"},{rootId:"blueprints_root",pageType:"blueprints_blueprint"}]){if(e.getComponents(se,{includeBMC:!0,includeCMC:!0}).length>0)continue;const Ne=u(U,se);e.addComponent(Ne),t.registerPostMutation(Ne),e.setActivePageId(Ne.id)}t.closeMutationTransaction(N),e.sendComponentUpdate()}function v(I){return b(I)}function y(I){return Td.has(I)}function M(I){const B=e.getComponentById(I);return!y(I)&&!(B!=null&&B.isCodeManaged)}function x(I){const B=e.getComponentById(I);return!(B!=null&&B.isCodeManaged)&&e.getContainableTypes(I).length>0}function S(I){return!y(I)}function L(I){const B=e.getComponentById(I);return!y(I)&&!(B!=null&&B.isCodeManaged)}function F(I){const B=e.getComponentById(I);return!y(I)&&!(B!=null&&B.isCodeManaged)}function te(I){return!y(I)}function J(I){return e.getComponents(I).length>0}function be(I){return!!Me(I,1)}function oe(I){return!!Me(I,-1)}function Te(I,B){const N=e.getComponentById(I);if(!N)return;const U=N.parentId;if(!U)return;let se;B&&(se=B.split(",").slice(0,-1).join(",")),t.setSelection(U,se)}function Ue(I){const B=e.getComponents(I).sort((N,U)=>N.position-U.position).at(0);B&&t.setSelection(B.id)}function Ze(I){const B=e.getComponentById(I);return B?(t.setSelection(B.id),!0):!1}function Me(I,B){if(y(I))return;const N=e.getComponentById(I);if(!N)return;const{parentId:U,position:se}=N,Se=se+B;return e.getComponents(U,{includeBMC:!0,includeCMC:!1}).find(Ne=>Ne.position===Se&&Ne.parentId===U)}function ee(I){var se,Se;if(y(I))return;const B=(se=e.getComponentById(I))==null?void 0:se.parentId;if(!B)return;const N=e.getComponents(B).sort((Ne,ut)=>Ne.position-ut.position),U=N.findIndex(Ne=>Ne.id===I);U===-1&&U+1===N.length||t.setSelection((Se=N[U+1])==null?void 0:Se.id)}function j(I){const B=Me(I,-1);B&&t.setSelection(B.id)}function K(I){if(I.length==0)return!1;const B={};return[...e.getComponents(),...I].forEach(U=>{B[U.id]=U}),I.map(U=>Ld(B,U.parentId).includes(U.type)).every(U=>U)}function G(I){const B=e.getComponentById(I);return!(!B||B.isCodeManaged)}function T(I){const B=ut=>e.getComponents(ut,{includeBMC:!0,includeCMC:!1}).filter(Oe=>{var Ke;return!((Ke=e.getComponentDefinition(Oe.type))==null?void 0:Ke.positionless)}).length,N=e.getComponentById(I);if(!N||N.isCodeManaged)return{up:!1,down:!1};if(e.getComponentDefinition(N.type).positionless)return{up:!1,down:!1};const se=N.parentId?B(N.parentId):0,Se=se>0&&N.position>0,Ne=se>0&&N.position<se-1;return{up:Se,down:Ne}}function O(I){if(!e.getComponentById(I))return;const N=g(I);n.set(N),t.setSelection(null),v(I),e.sendComponentUpdate()}function k(I){const B=JSON.parse(JSON.stringify(I));return B.forEach(N=>{delete N.isCodeManaged;const U=r();B.filter(se=>se.id!==N.id).map(se=>{var Se;se.parentId==N.id&&(se.parentId=U),(Se=se.outs)==null||Se.forEach(Ne=>{Ne.toNodeId==N.id&&(Ne.toNodeId=U)})}),N.id=U,typeof N.x<"u"&&typeof N.y<"u"&&(N.x+=36,N.y+=36)}),B}function C(I){if(!e.getComponentById(I))return;const N=g(I),U=k(N);n.set(U)}async function P(I){if(!e.getComponentById(I))return;const N=await n.get();if(!N)throw Error("The clipboard doesn't contain Writer data");if(!N.length)throw Error("The clipboard doesn't contain components");const U=N[0];return typeof U.outs<"u"&&U.parentId!==I&&(U.outs=[]),ae(I,N)}function ae(I,B){var se;n.set(k(B));const N=B[0];if(N.parentId=I,N.position=xe(I,N.type),!K(B)){const Se=(se=e.getComponentById(I))==null?void 0:se.parentId;if(Se)return ae(Se,B);throw Error("Could not paste the components here")}const U=`paste-copy-${I}`;t.openMutationTransaction(U,"Paste from copy"),B.map(Se=>{e.addComponent(Se),t.registerPostMutation(Se)}),t.closeMutationTransaction(U),e.sendComponentUpdate()}function xe(I,B){if(e.getComponentDefinition(B).positionless)return-2;const U=e.getComponents(I,{includeBMC:!0,includeCMC:!1}).filter(se=>se.position!==-2);return U.length>0?Math.max(Math.max(...U.map(Se=>Se.position))+1,0):0}function ve(){var B,N;const I=t.getMutationTransactionsSnapshot();return{isUndoAvailable:!!I.undo,isRedoAvailable:!!I.redo,undoDesc:(B=I.undo)==null?void 0:B.desc,redoDesc:(N=I.redo)==null?void 0:N.desc}}function ze(){const I=t.consumeUndoTransaction();I&&(Object.entries(I.mutations).forEach(([B,N])=>{if(N.jsonPre&&N.jsonPost){e.addComponent(JSON.parse(N.jsonPre));return}if(!N.jsonPre&&N.jsonPost){e.deleteComponent(B);return}if(N.jsonPre&&!N.jsonPost){e.addComponent(JSON.parse(N.jsonPre));return}}),e.sendComponentUpdate())}function Ye(){const I=t.consumeRedoTransaction();I&&(Object.entries(I.mutations).forEach(([B,N])=>{if(N.jsonPre&&N.jsonPost){e.addComponent(JSON.parse(N.jsonPost));return}if(!N.jsonPre&&N.jsonPost){e.addComponent(JSON.parse(N.jsonPost));return}if(N.jsonPre&&!N.jsonPost){e.deleteComponent(B);return}}),e.sendComponentUpdate())}function ct(I,B,N){const U=e.getComponentById(I);if(!U)return;const se=`edit-${I}-content-${B}`;t.openMutationTransaction(se,"Edit property",!0),t.registerPreMutation(U),U.content[B]=N,t.registerPostMutation(U),t.closeMutationTransaction(se),e.sendComponentUpdate()}function wt(I,B){const N=e.getComponentById(I);if(!N)return;const U=`add-${I}-out-${B.outId}-${B.toNodeId}`;t.openMutationTransaction(U,"Add out",!0),t.registerPreMutation(N),N.outs=[...N.outs??[],B],t.registerPostMutation(N),t.closeMutationTransaction(U),e.sendComponentUpdate(),a==null||a.track("ui_blueprint_connected",{componentIds:[I,B.toNodeId],outId:B.outId})}function D(I,B){const N=e.getComponentById(I);if(!N)return;const U=`edit-${I}-out-${B.outId}-${B.toNodeId}`;t.openMutationTransaction(U,"Edit out",!0),t.registerPreMutation(N),N.outs=N.outs.filter(se=>!(B.outId===se.outId&&B.toNodeId===se.toNodeId)),t.registerPostMutation(N),t.closeMutationTransaction(U),e.sendComponentUpdate()}function q(I,B,N){const U=e.getComponentById(I);if(!U)return;const se=`change-${I}-coordinates`;t.openMutationTransaction(se,"Change coordinates",!1),t.registerPreMutation(U),U.x=Math.floor(B),U.y=Math.floor(N),t.registerPostMutation(U),t.closeMutationTransaction(se),e.sendComponentUpdate()}function he(I){const B=Object.entries(I);if(B.length==0)return;const N=`change-multiple-coordinates-${Object.keys(I).join(",")}`;t.openMutationTransaction(N,"Change coordinates",!1),B.forEach(([U,{x:se,y:Se}])=>{const Ne=e.getComponentById(U);Ne&&(t.registerPreMutation(Ne),Ne.x=Math.floor(se),Ne.y=Math.floor(Se),t.registerPostMutation(Ne))}),t.closeMutationTransaction(N),e.sendComponentUpdate()}function me(I,B,N="",U=!1){const se=e.getComponentById(I);if(!se)return;const Se=`change-visibility-${I}`;t.openMutationTransaction(Se,"Change visibility",!0),t.registerPreMutation(se),se.visible==null&&(se.visible={expression:!0,binding:"",reversed:!1}),typeof B=="boolean"?se.visible.expression=B:B=="custom"&&(se.visible={expression:"custom",binding:N,reversed:U}),t.registerPostMutation(se),t.closeMutationTransaction(Se),e.sendComponentUpdate()}function _e(I,B,N){const U=e.getComponentById(I);if(!U)return;let se;if(N)se=N;else{const Ne=e.getComponentDefinition(U.type),ie=Object.entries(Ne.events).filter(([Ee,Oe])=>Oe.bindable).map(([Ee,Oe])=>Ee);se=ie==null?void 0:ie[0]}if(!se)return;const Se=`change-binding-${I}`;t.openMutationTransaction(Se,"Change binding",!0),t.registerPreMutation(U),B?U.binding={eventType:se,stateRef:B}:delete U.binding,t.registerPostMutation(U),t.closeMutationTransaction(Se),e.sendComponentUpdate()}function Ae(I,B,N){const U=e.getComponentById(I);if(!U)return;const se=`set-handler-${I}`;t.openMutationTransaction(se,"Set event handler",!0),t.registerPreMutation(U),N?(U.handlers||(U.handlers={}),U.handlers[B]=N):(delete U.handlers[B],Object.keys(U.handlers).length==0&&delete U.handlers),t.registerPostMutation(U),t.closeMutationTransaction(se),e.sendComponentUpdate()}async function pe(I){var se;const B=e.getComponentById(I);if(!B||!((se=e.getComponentDefinition(B.type))==null?void 0:se.name))return;const U=Z2e(e,I);if(U){switch(U==null?void 0:U.type){case"page":t.mode.value="ui";break;case"blueprints_blueprint":t.mode.value="blueprints";break}return e.setActivePageId(U.id),U.id}}function ce(I){return g(I).slice(1).filter(N=>{var U;return N.type!=="note"&&((U=e.getComponentDefinition(N.type))==null?void 0:U.category)!=="Internal"})}function ue(I){const B=r(),N=u("blueprints_blueprint","blueprints_root",void 0,{content:{key:I.title,isSharedBlueprint:Yg,sourceBlueprintId:I.id,deployedVersion:String(I.version),deployedDescription:I.description}});N.id=B;const U=k(I.components),se=new Set(U.map(Ne=>Ne.id));if(U.forEach(Ne=>{(!Ne.parentId||!se.has(Ne.parentId))&&(Ne.parentId=B)}),!K([N,...U]))throw Error("Cannot install blueprint: components are not compatible");const Se=`install-shared-blueprint-${B}`;return t.openMutationTransaction(Se,"Install shared blueprint"),e.addComponent(N),t.registerPostMutation(N),U.forEach(Ne=>{e.addComponent(Ne),t.registerPostMutation(Ne)}),t.closeMutationTransaction(Se),e.sendComponentUpdate(),a==null||a.track("blueprints_shared_installed",{blueprintId:I.id}),B}return{generateNewComponentId:r,moveComponent:i,moveComponentUp:o,moveComponentDown:s,cutComponent:O,copyComponent:C,pasteComponent:P,createAndInsertComponent:h,createAndInsertComponentsTree:f,removeComponentSubtree:v,removeComponentsSubtree:b,isPasteAllowed:G,undo:ze,redo:Ye,setContentValue:ct,addOut:wt,removeOut:D,changeCoordinates:q,changeCoordinatesMultiple:he,setVisibleValue:me,setBinding:_e,getUndoRedoSnapshot:ve,setHandlerValue:Ae,isAddAllowed:x,isCopyAllowed:S,isCutAllowed:L,isDeleteAllowed:F,isGoToParentAllowed:te,isGoToChildAllowed:J,isGoToNextSiblingAllowed:be,isGoToPrevSiblingAllowed:oe,repositionHigherSiblings:m,isDraggingAllowed:M,getEnabledMoves:T,goToParent:Te,goToChild:Ue,goToNextSibling:ee,goToPrevSibling:j,goToComponentParentPage:pe,moveComponentInsideNextSibling:c,moveComponentToParent:d,selectChild:Ze,extractBlueprintComponents:ce,installSharedBlueprint:ue}}const K2e=30,G2e=/^application\/json;writer=(?<componentType>\w+),(?<componentId>[\w\-]*)$/,ei=ye(null),vr=ye(null),I1=ye(!1);let ec=null,k1=null;function J2e(e){function t(_){const b=_.dataTransfer.types[0],v=b==null?void 0:b.match(G2e);if(!(v!=null&&v.groups))return;const{componentType:y,componentId:M}=v.groups;return{draggedType:y,draggedId:y==="blueprints_shared"?"":M,sourceBlueprintId:y==="blueprints_shared"?M:void 0}}function a(_){const y=(_.closest("[data-writer-cage]")??_).closest("[data-writer-id]");if(y)return y.dataset.writerId}function n(_){const b=t(_);if(!b)return;const{draggedType:v,draggedId:y}=b,M=a(_.target);if(!o(M,y,v))return;let S={};v==="blueprints_shared"&&b.sourceBlueprintId&&(S={sourceBlueprintId:b.sourceBlueprintId});const L={draggedType:v,draggedId:y,parentId:ei.value,position:k1,dragContent:S};return g(_),L}function r(_,b,v){const y=e.getComponentById(_);if(!y)return!1;const M=e.getContainableTypes(_);return!(y!=null&&y.isCodeManaged)&&!e.isChildOf(b,_)&&M.includes(v)}function o(_,b,v){const y=e.getComponentById(_);if(y)return r(_,b,v)?_:y.parentId?o(y.parentId,b,v):null}function s(_){if(I1.value){l(_);return}i(_)}function i(_){const b=t(_);if(!b)return;const{draggedType:v,draggedId:y}=b,M=_.target,x=a(M),S=o(x,y,v);if(!S||S==y)return;const F=M.closest(`[data-writer-id="${S}"]`).dataset.writerInstancePath;if(_.preventDefault(),vr.value!==F)ec=Date.now();else if(Date.now()-ec>=Ew){I1.value=!0,h(vr.value);return}ei.value=S,vr.value=F}function l(_){const b=t(_);if(!b)return;_.preventDefault();const v=document.querySelector(`[data-writer-instance-path="${vr.value}"]`);if(u(_.clientX,_.clientY,v)>K2e){g(_);return}const y=c(vr.value);if(y.length==0)return;const M=d(_.clientX,_.clientY,y);if(!M)return;const{el:x}=M,{draggedId:S}=b,L=parseInt(x.dataset.writerPosition),F=e.getComponentById(S);if(y.map(te=>{te.classList.contains("highlighted")&&te.classList.remove("highlighted")}),!x.classList.contains("highlighted")){if(x.classList.add("highlighted"),F&&F.parentId==ei.value&&L>F.position){k1=L-1;return}k1=L}}function c(_){const b=m(_);return Array.from(b.querySelectorAll("[data-writer-position]"))}function d(_,b,v){const y=v.map(M=>({el:M,distance:u(_,b,M)})).sort((M,x)=>M.distance>x.distance?1:-1);return y==null?void 0:y[0]}function u(_,b,v){const{top:y,left:M,right:x,bottom:S}=v.getBoundingClientRect(),L=Math.max(M-_,0,_-x),F=Math.max(y-b,0,b-S);return Math.sqrt(L*L+F*F)}function h(_){m(_).classList.add("crackedContainer")}function f(_){m(_).classList.remove("crackedContainer")}function m(_){const b=document.querySelector(`[data-writer-instance-path="${_}"]`);if(b.hasAttribute("data-writer-container"))return b;const v=b.querySelectorAll("[data-writer-container]");for(let y=0;y<v.length;y++){const M=v[y];if(M.closest("[data-writer-instance-path]")==b)return M}}function g(_){_.preventDefault(),vr.value&&(f(vr.value),vr.value=null),ei.value=null,ec=null,k1=null,I1.value=!1}return{candidateId:ei,candidateInstancePath:vr,isParentSuitable:r,isCandidacyConfirmed:I1,getComponentInfoFromDrag:t,dropComponent:n,assignInsertionCandidacy:s,removeInsertionCandidacy:g}}function tc(e,t){return Math.ceil(e/t)*t}function Em(e,t){return Math.round(e/t)*t}function Qg(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}function Im({x:e,y:t},a){return{x:Em(e,a),y:Em(t,a)}}function Bc({x:e,y:t},{x:a,y:n}){return{x:e+a,y:t+n}}function km(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function T1(e,t,a){return e>=t&&e<=a}function Tm(e,t,a,n){return T1(e,a,n)||T1(t,a,n)||T1(a,e,t)||T1(n,e,t)}function X2e(e,t){const a=Tm(e.x,e.x+e.width,t.x,t.x+t.width),n=Tm(e.y,e.y+e.height,t.y,t.y+t.height);return a&&n}function Pm(e,t,a){const n=[{x:-a,y:-a},{x:-a,y:0},{x:-a,y:a},{x:0,y:-a},{x:0,y:a},{x:a,y:-a},{x:a,y:0},{x:a,y:a}],r=new Set,o=[],s=[];function i({x:f,y:m}){return{width:e.width,height:e.height,x:f,y:m}}function l(f){if(f.x<0||f.y<0)return!1;const m=i(f);return!t.some(g=>X2e(m,g))}function c(f){const m=`${f.x},${f.y}`;r.has(m)||(o.push(f),r.add(m))}for(c({x:e.x,y:e.y});o.length;){const f=o.shift();if(f===void 0)return;if(l(f)&&s.push(f),s.length===0)for(const m of n)c(Bc(f,m))}const d=km(e),u=f=>Qg(d,km(i(f))),h=s.sort((f,m)=>u(f)-u(m)).shift();return h?i(h):void 0}const Y2e="data:image/svg+xml,%3csvg%20width='29'%20height='33'%20viewBox='0%200%2029%2033'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2417_109697)'%3e%3cpath%20d='M14.4995%200C22.2315%200%2028.4995%206.26801%2028.4995%2014C28.4995%2019.8214%2024.9459%2024.8114%2019.8901%2026.9229L14.4995%2032.3135L9.10791%2026.9229C4.05258%2024.8112%200.499512%2019.821%200.499512%2014C0.499512%206.26801%206.76753%200%2014.4995%200Z'%20fill='%23EDE2FF'/%3e%3cpath%20d='M15.1662%2011.3333H11.1662M17.8328%2014H11.1662M20.4995%2016C20.4995%2016.3536%2020.359%2016.6928%2020.109%2016.9428C19.8589%2017.1929%2019.5198%2017.3333%2019.1662%2017.3333H11.1662L8.49951%2020V9.33333C8.49951%208.97971%208.63999%208.64057%208.89004%208.39052C9.14008%208.14048%209.47922%208%209.83285%208H19.1662C19.5198%208%2019.8589%208.14048%2020.109%208.39052C20.359%208.64057%2020.4995%208.97971%2020.4995%209.33333V16Z'%20stroke='black'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2417_109697'%3e%3crect%20width='28'%20height='33'%20fill='white'%20transform='translate(0.499512)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Q2e="data:image/svg+xml,%3csvg%20width='31'%20height='35'%20viewBox='0%200%2031%2035'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2417_109696)'%20filter='url(%23filter0_d_2417_109696)'%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'%20fill='%23D4B2F7'/%3e%3cpath%20d='M16.1662%2011.3333H12.1662M18.8328%2014H12.1662M21.4995%2016C21.4995%2016.3536%2021.359%2016.6928%2021.109%2016.9428C20.8589%2017.1929%2020.5198%2017.3333%2020.1662%2017.3333H12.1662L9.49951%2020V9.33333C9.49951%208.97971%209.63999%208.64057%209.89004%208.39052C10.1401%208.14048%2010.4792%208%2010.8328%208H20.1662C20.5198%208%2020.8589%208.14048%2021.109%208.39052C21.359%208.64057%2021.4995%208.97971%2021.4995%209.33333V16Z'%20stroke='black'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_2417_109696'%20x='0.499512'%20y='0'%20width='30'%20height='35'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='1'/%3e%3cfeGaussianBlur%20stdDeviation='0.5'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.74902%200%200%200%200%200.796078%200%200%200%200%201%200%200%200%201%200'/%3e%3cfeBlend%20mode='multiply'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_2417_109696'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_2417_109696'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_2417_109696'%3e%3crect%20width='28'%20height='33'%20fill='white'%20transform='translate(1.49951)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ece="data:image/svg+xml,%3csvg%20width='31'%20height='35'%20viewBox='0%200%2031%2035'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2417_109695)'%20filter='url(%23filter0_d_2417_109695)'%3e%3cmask%20id='path-1-inside-1_2417_109695'%20fill='white'%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'/%3e%3c/mask%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'%20fill='%23D4B2F7'/%3e%3cpath%20d='M20.8901%2026.9229L20.5048%2026.0001L20.3226%2026.0762L20.183%2026.2157L20.8901%2026.9229ZM15.4995%2032.3135L14.7925%2033.0206L15.4996%2033.7276L16.2066%2033.0206L15.4995%2032.3135ZM10.1079%2026.9229L10.815%2026.2157L10.6754%2026.0762L10.4933%2026.0001L10.1079%2026.9229ZM15.4995%200V1C22.6792%201%2028.4995%206.8203%2028.4995%2014H29.4995H30.4995C30.4995%205.71573%2023.7838%20-1%2015.4995%20-1V0ZM29.4995%2014H28.4995C28.4995%2019.4038%2025.2015%2024.0386%2020.5048%2026.0001L20.8901%2026.9229L21.2755%2027.8456C26.6903%2025.5843%2030.4995%2020.2389%2030.4995%2014H29.4995ZM20.8901%2026.9229L20.183%2026.2157L14.7924%2031.6064L15.4995%2032.3135L16.2066%2033.0206L21.5972%2027.63L20.8901%2026.9229ZM15.4995%2032.3135L16.2066%2031.6063L10.815%2026.2157L10.1079%2026.9229L9.40087%2027.63L14.7925%2033.0206L15.4995%2032.3135ZM10.1079%2026.9229L10.4933%2026.0001C5.79702%2024.0385%202.49951%2019.4035%202.49951%2014H1.49951H0.499512C0.499512%2020.2385%204.30814%2025.584%209.72248%2027.8456L10.1079%2026.9229ZM1.49951%2014H2.49951C2.49951%206.8203%208.31981%201%2015.4995%201V0V-1C7.21524%20-1%200.499512%205.71573%200.499512%2014H1.49951Z'%20fill='white'%20mask='url(%23path-1-inside-1_2417_109695)'/%3e%3cpath%20d='M16.1662%2011.3333H12.1662M18.8328%2014H12.1662M21.4995%2016C21.4995%2016.3536%2021.359%2016.6928%2021.109%2016.9428C20.8589%2017.1929%2020.5198%2017.3333%2020.1662%2017.3333H12.1662L9.49951%2020V9.33333C9.49951%208.97971%209.63999%208.64057%209.89004%208.39052C10.1401%208.14048%2010.4792%208%2010.8328%208H20.1662C20.5198%208%2020.8589%208.14048%2021.109%208.39052C21.359%208.64057%2021.4995%208.97971%2021.4995%209.33333V16Z'%20stroke='black'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_2417_109695'%20x='0.499512'%20y='0'%20width='30'%20height='35'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='1'/%3e%3cfeGaussianBlur%20stdDeviation='0.5'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.74902%200%200%200%200%200.796078%200%200%200%200%201%200%200%200%201%200'/%3e%3cfeBlend%20mode='multiply'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_2417_109695'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_2417_109695'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_2417_109695'%3e%3crect%20width='28'%20height='33'%20fill='white'%20transform='translate(1.49951)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",tce="data:image/svg+xml,%3csvg%20width='31'%20height='35'%20viewBox='0%200%2031%2035'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2417_109694)'%20filter='url(%23filter0_d_2417_109694)'%3e%3cmask%20id='path-1-inside-1_2417_109694'%20fill='white'%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'/%3e%3c/mask%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'%20fill='%23D4B2F7'/%3e%3cpath%20d='M20.8901%2026.9229L20.5048%2026.0001L20.3226%2026.0762L20.183%2026.2157L20.8901%2026.9229ZM15.4995%2032.3135L14.7925%2033.0206L15.4996%2033.7276L16.2066%2033.0206L15.4995%2032.3135ZM10.1079%2026.9229L10.815%2026.2157L10.6754%2026.0762L10.4933%2026.0001L10.1079%2026.9229ZM15.4995%200V1C22.6792%201%2028.4995%206.8203%2028.4995%2014H29.4995H30.4995C30.4995%205.71573%2023.7838%20-1%2015.4995%20-1V0ZM29.4995%2014H28.4995C28.4995%2019.4038%2025.2015%2024.0386%2020.5048%2026.0001L20.8901%2026.9229L21.2755%2027.8456C26.6903%2025.5843%2030.4995%2020.2389%2030.4995%2014H29.4995ZM20.8901%2026.9229L20.183%2026.2157L14.7924%2031.6064L15.4995%2032.3135L16.2066%2033.0206L21.5972%2027.63L20.8901%2026.9229ZM15.4995%2032.3135L16.2066%2031.6063L10.815%2026.2157L10.1079%2026.9229L9.40087%2027.63L14.7925%2033.0206L15.4995%2032.3135ZM10.1079%2026.9229L10.4933%2026.0001C5.79702%2024.0385%202.49951%2019.4035%202.49951%2014H1.49951H0.499512C0.499512%2020.2385%204.30814%2025.584%209.72248%2027.8456L10.1079%2026.9229ZM1.49951%2014H2.49951C2.49951%206.8203%208.31981%201%2015.4995%201V0V-1C7.21524%20-1%200.499512%205.71573%200.499512%2014H1.49951Z'%20fill='white'%20mask='url(%23path-1-inside-1_2417_109694)'/%3e%3cpath%20d='M21.4995%2016C21.4995%2016.3536%2021.359%2016.6928%2021.109%2016.9428C20.8589%2017.1929%2020.5198%2017.3333%2020.1662%2017.3333H12.1662L9.49951%2020V9.33333C9.49951%208.97971%209.63999%208.64057%209.89004%208.39052C10.1401%208.14048%2010.4792%208%2010.8328%208H20.1662C20.5198%208%2020.8589%208.14048%2021.109%208.39052C21.359%208.64057%2021.4995%208.97971%2021.4995%209.33333V16Z'%20stroke='black'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_2417_109694'%20x='0.499512'%20y='0'%20width='30'%20height='35'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='1'/%3e%3cfeGaussianBlur%20stdDeviation='0.5'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.74902%200%200%200%200%200.796078%200%200%200%200%201%200%200%200%201%200'/%3e%3cfeBlend%20mode='multiply'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_2417_109694'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_2417_109694'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_2417_109694'%3e%3crect%20width='28'%20height='33'%20fill='white'%20transform='translate(1.49951)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ace="data:image/svg+xml,%3csvg%20width='31'%20height='35'%20viewBox='0%200%2031%2035'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2417_109693)'%20filter='url(%23filter0_d_2417_109693)'%3e%3cmask%20id='path-1-inside-1_2417_109693'%20fill='white'%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'/%3e%3c/mask%3e%3cpath%20d='M15.4995%200C23.2315%200%2029.4995%206.26801%2029.4995%2014C29.4995%2019.8214%2025.9459%2024.8114%2020.8901%2026.9229L15.4995%2032.3135L10.1079%2026.9229C5.05258%2024.8112%201.49951%2019.821%201.49951%2014C1.49951%206.26801%207.76753%200%2015.4995%200Z'%20fill='black'/%3e%3cpath%20d='M20.8901%2026.9229L20.5048%2026.0001L20.3226%2026.0762L20.183%2026.2157L20.8901%2026.9229ZM15.4995%2032.3135L14.7925%2033.0206L15.4996%2033.7276L16.2066%2033.0206L15.4995%2032.3135ZM10.1079%2026.9229L10.815%2026.2157L10.6754%2026.0762L10.4933%2026.0001L10.1079%2026.9229ZM15.4995%200V1C22.6792%201%2028.4995%206.8203%2028.4995%2014H29.4995H30.4995C30.4995%205.71573%2023.7838%20-1%2015.4995%20-1V0ZM29.4995%2014H28.4995C28.4995%2019.4038%2025.2015%2024.0386%2020.5048%2026.0001L20.8901%2026.9229L21.2755%2027.8456C26.6903%2025.5843%2030.4995%2020.2389%2030.4995%2014H29.4995ZM20.8901%2026.9229L20.183%2026.2157L14.7924%2031.6064L15.4995%2032.3135L16.2066%2033.0206L21.5972%2027.63L20.8901%2026.9229ZM15.4995%2032.3135L16.2066%2031.6063L10.815%2026.2157L10.1079%2026.9229L9.40087%2027.63L14.7925%2033.0206L15.4995%2032.3135ZM10.1079%2026.9229L10.4933%2026.0001C5.79702%2024.0385%202.49951%2019.4035%202.49951%2014H1.49951H0.499512C0.499512%2020.2385%204.30814%2025.584%209.72248%2027.8456L10.1079%2026.9229ZM1.49951%2014H2.49951C2.49951%206.8203%208.31981%201%2015.4995%201V0V-1C7.21524%20-1%200.499512%205.71573%200.499512%2014H1.49951Z'%20fill='white'%20mask='url(%23path-1-inside-1_2417_109693)'/%3e%3cpath%20d='M15.4995%2010.6667V14.6667M13.4995%2012.6667H17.4995M21.4995%2016C21.4995%2016.3536%2021.359%2016.6928%2021.109%2016.9428C20.8589%2017.1929%2020.5198%2017.3333%2020.1662%2017.3333H12.1662L9.49951%2020V9.33333C9.49951%208.97971%209.63999%208.64057%209.89004%208.39052C10.1401%208.14048%2010.4792%208%2010.8328%208H20.1662C20.5198%208%2020.8589%208.14048%2021.109%208.39052C21.359%208.64057%2021.4995%208.97971%2021.4995%209.33333V16Z'%20stroke='white'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_2417_109693'%20x='0.499512'%20y='0'%20width='30'%20height='35'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='1'/%3e%3cfeGaussianBlur%20stdDeviation='0.5'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.74902%200%200%200%200%200.796078%200%200%200%200%201%200%200%200%201%200'/%3e%3cfeBlend%20mode='multiply'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_2417_109693'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_2417_109693'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_2417_109693'%3e%3crect%20width='28'%20height='33'%20fill='white'%20transform='translate(1.49951)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",nce=["src"],rce=$e({__name:"BaseNote",props:{componentId:{type:String,required:!0}},setup(e){const t=e,a=re(ne.core),n=re(ne.notesManager),r=H(()=>a.getComponentById(t.componentId)),{state:o}=n.useNoteInformation(r),s=H(()=>{switch(o.value){case"hover":return Q2e;case"active":return ece;case"new":return tce;case"cursor":return ace;default:return Y2e}});function i(){n.selectNote(t.componentId,"show")}return(l,c)=>($(),R("button",{type:"button",class:"BaseNote","data-writer-unselectable":"true",onMouseenter:c[0]||(c[0]=d=>E(n).hoveredNoteId.value=e.componentId),onMouseleave:c[1]||(c[1]=d=>E(n).hoveredNoteId.value=void 0),onClick:i},[Z("img",{src:s.value,width:"32",height:"32"},null,8,nce)],32))}}),oce=ke(rce,[["__scopeId","data-v-1f4e58ab"]]),Lm=5;function sce(e){const{wrapperRef:t,builderManager:a,isAnnotating:n}=e,r=$t({isSelecting:!1,startX:0,startY:0,left:0,top:0,width:0,height:0}),o=Ki(),s=H(()=>r.value.isSelecting),i=ye(!1),l=ye(!1);let c=null,d=null,u=null,h=null,f=null,m=null;function g(ee){if(a.mode.value==="preview"){i.value=!1;return}if(n.value){i.value=!1;return}if(ee.shiftKey||ee.ctrlKey||ee.metaKey){i.value=!1;return}if(a.mode.value==="blueprints"&&!ee.altKey){i.value=!1;return}if(!(ee.target instanceof Element)){i.value=!1;return}const j=ee.target,K=t.value;if(!K||!K.contains(j)){i.value=!1;return}if(j.closest("[data-writer-id]"))if(a.mode.value==="blueprints"){if(!b(j)){i.value=!1;return}}else{i.value=!1;return}if(!y(j)){i.value=!1;return}if(a.mode.value==="blueprints"&&!v(j)){i.value=!1;return}i.value=!0}function _(ee){return a.mode.value==="preview"||n.value?!1:a.mode.value==="blueprints"?!(!ee.altKey||ee.shiftKey||ee.ctrlKey||ee.metaKey):!(ee.shiftKey||ee.ctrlKey||ee.metaKey||ee.altKey)}function b(ee){const j=ee.closest("[data-writer-id]");if(!j)return!0;const K=ee.closest(".BlueprintsBlueprint");return K?j===K:!1}function v(ee){const j=ee.closest(".BlueprintsBlueprint");if(!j)return!1;const K=j.querySelector(".nodeContainer");return K?K.contains(ee):!1}function y(ee){return!(ee.closest("[data-writer-unselectable]")||ee.classList.contains("selectionRectangle"))}function M(ee,j){const K=ee.querySelectorAll("[data-writer-id]"),G=[];for(const T of Array.from(K)){if(T.closest("[data-writer-unselectable]"))continue;const O=T.getBoundingClientRect();if(O.left>=j.left&&O.right<=j.right&&O.top>=j.top&&O.bottom<=j.bottom){const C=T.dataset.writerId,P=T.dataset.writerInstancePath;C&&G.push({componentId:C,instancePath:P&&P.trim()?P:void 0})}}return G}function x(){r.value.isSelecting&&(c&&(c.abort(),c=null),d!==null&&(cancelAnimationFrame(d),d=null),u=null,h!==null&&(cancelAnimationFrame(h),h=null),f=null,m!==null&&(clearTimeout(m),m=null),r.value={...r.value,isSelecting:!1},document.body.style.userSelect="",document.body.style.cursor="")}function S(ee){const K=window.getComputedStyle(ee).transform;let G=1,T=1;if(K&&K!=="none"){const O=K.match(/matrix\(([^)]+)\)/);if(O){const k=O[1].split(",").map(C=>parseFloat(C.trim()));k.length>=4&&(G=k[0],T=k[3])}}return{scaleX:G,scaleY:T}}function L(ee,j){const K=ee.getBoundingClientRect(),{scaleX:G,scaleY:T}=S(ee);return{left:K.left+j.left*G,top:K.top+j.top*T,right:K.left+(j.left+j.width)*G,bottom:K.top+(j.top+j.height)*T}}function F(ee){if(!r.value.isSelecting||a.mode.value==="preview")return;const j=t.value;if(j)try{const K=j.getBoundingClientRect(),{scaleX:G,scaleY:T}=S(j),O=(ee.clientX-K.left)/G,k=(ee.clientY-K.top)/T+j.scrollTop,{startX:C,startY:P}=r.value,ae=Math.min(C,O),xe=Math.min(P,k)-j.scrollTop,ve=Math.abs(O-C),ze=Math.abs(k-P);r.value={...r.value,left:ae,top:xe,width:ve,height:ze}}catch{x()}}function te(ee){r.value.isSelecting&&a.mode.value!=="preview"&&(f=ee,h===null&&(h=requestAnimationFrame(()=>{f&&(F(f),f=null),h=null})))}function J(ee){r.value.isSelecting&&(te(ee),ee.preventDefault())}function be(ee){if(!_(ee)||!(ee.target instanceof Element))return;const j=ee.target;if(j.closest("[data-writer-id]"))if(a.mode.value==="blueprints"){if(!b(j))return}else return;if(!y(j))return;const G=t.value;if(!G||!G.contains(j))return;ee.stopPropagation(),ee.preventDefault();const T=G.getBoundingClientRect(),{scaleX:O,scaleY:k}=S(G),C=(ee.clientX-T.left)/O,P=(ee.clientY-T.top)/k+G.scrollTop;r.value={isSelecting:!0,startX:C,startY:P,left:C,top:P-G.scrollTop,width:0,height:0},document.body.style.userSelect="none",document.body.style.cursor="crosshair",c=new AbortController,G.addEventListener("mousemove",J,{signal:c.signal})}function oe(ee){if(r.value.isSelecting){a.mode.value==="blueprints"&&ee.stopPropagation(),te(ee),ee.preventDefault();return}u=ee,d===null&&(d=requestAnimationFrame(()=>{u&&(g(u),u=null),d=null}))}function Te(ee){if(!r.value.isSelecting)return;if(a.mode.value==="preview"){x();return}const{left:j,top:K,width:G,height:T}=r.value;if(G<Lm||T<Lm){x();return}ee.stopPropagation(),ee.preventDefault(),ee.stopImmediatePropagation();const O=t.value;if(!O){x();return}const k=L(O,{left:j,top:K,width:G,height:T}),C=M(O,k);if(C.length>0){const[P,...ae]=C;a.setSelection(P.componentId,P.instancePath,"click"),ae.forEach(({componentId:xe,instancePath:ve})=>{a.appendSelection(xe,ve,"click")}),l.value=!0,m&&clearTimeout(m),qa().then(()=>{requestAnimationFrame(()=>{l.value=!1,m=null})})}else a.setSelection(null);x()}function Ue(ee){if(r.value.isSelecting){const j=t.value;if(j&&ee.target instanceof Node&&j.contains(ee.target))return;x()}}function Ze(ee){l.value&&(ee.preventDefault(),ee.stopPropagation(),ee.stopImmediatePropagation())}Wn(()=>{m&&clearTimeout(m),o.abort(),x()});function Me(ee){i.value=!1}return{selectionRect:r,isCursorSelecting:s,isHoveringSelectableArea:i,justCompletedDragSelection:l,handleMousedown:be,handleMousemove:oe,handleMouseup:Te,handleMouseleave:Me,handleDocumentMouseup:Ue,handleDocumentClick:Ze}}const ice=["d"],lce=["d"],cce=["cx","cy"],dce=["x1","y1","x2","y2","stroke"],uce=["x1","y1","x2","y2","stroke"],ti=30,hce=$e({__name:"BlueprintArrow",props:{arrow:{},isSelected:{type:Boolean},isEngaged:{type:Boolean}},emits:["delete"],setup(e,{emit:t}){const a=t,n=e,r=H(()=>{const i=n.arrow.x2-n.arrow.x1,l=n.arrow.y2-n.arrow.y1;return[{x:n.arrow.x1,y:n.arrow.y1},{x:n.arrow.x1+ti,y:n.arrow.y1},{x:n.arrow.x1+ti,y:n.arrow.y1+l*.25},{x:n.arrow.x1+i*.5,y:n.arrow.y1+l*.5},{x:n.arrow.x2-ti,y:n.arrow.y1+l*.75},{x:n.arrow.x2-ti,y:n.arrow.y2},{x:n.arrow.x2,y:n.arrow.y2}]}),o=H(()=>{const i=n.arrow.x2-n.arrow.x1,l=r.value;let c;return i>ti?(c=`M ${l[0].x} ${l[0].y}`,c+=`C ${l[3].x} ${l[0].y}, ${l[3].x} ${l[6].y}, ${l[6].x} ${l[6].y}`):(c=`M ${l[0].x} ${l[0].y}`,c+=`C ${l[1].x} ${l[1].y}, ${l[2].x} ${l[2].y}, ${l[3].x} ${l[3].y}`,c+=`C ${l[4].x} ${l[4].y}, ${l[5].x} ${l[5].y}, ${l[6].x} ${l[6].y}`),c});function s(){a("delete")}return(i,l)=>($(),R("g",{class:ft(["BlueprintArrow",{engaged:i.isEngaged}]),tabindex:"0","data-writer-unselectable":"true"},[Z("path",{d:o.value,style:bt({stroke:i.arrow.color})},null,12,ice),Z("path",{d:o.value,style:bt({stroke:i.arrow.color,strokeWidth:12,opacity:i.isSelected?"0.2":"0"})},null,12,lce),i.isSelected?($(),R("g",{key:0,class:"delete",tabindex:"0","aria-label":"Delete relation",onClick:s,onKeydown:Sr(s,["enter"])},[Z("circle",{cx:r.value[3].x,cy:r.value[3].y,r:"12"},null,8,cce),Z("line",{class:"cross",x1:r.value[3].x-4,y1:r.value[3].y-4,x2:r.value[3].x+4,y2:r.value[3].y+4,stroke:i.arrow.color,"stroke-width":"2"},null,8,dce),Z("line",{class:"cross",x1:r.value[3].x+4,y1:r.value[3].y-4,x2:r.value[3].x-4,y2:r.value[3].y+4,stroke:i.arrow.color,"stroke-width":"2"},null,8,uce)],32)):ge("",!0)],2))}}),Vm=ke(hce,[["__scopeId","data-v-343694d1"]]),pce=$e({__name:"BlueprintMiniMap",props:{nodeContainerEl:{},renderOffset:{},zoomLevel:{}},emits:["changeRenderOffset"],setup(e,{emit:t}){ji(v=>({"5436111d":`${l.value.width}px`,"2f2ee374":`${l.value.height}px`,"791851f1":c.value.isDisplayed?"":"none"}));const a=re(ne.builderManager),n=pt("rootEl"),r=t,o=new ResizeObserver(f),s=new MutationObserver(f),i=ye(.2),l=ye({width:166,height:100}),c=ye({width:260,height:1,top:0,left:0,isDisplayed:!1}),d=ye({width:1,height:1,top:0,left:0}),u=e,h=ye([]);function f(){if(!u.nodeContainerEl)return;const v=Array.from(u.nodeContainerEl.querySelectorAll("[data-writer-id]")),y=u.nodeContainerEl.getBoundingClientRect();let M=0,x=0;h.value=v.map(S=>{const L=S.getBoundingClientRect();return M=Math.max(M,L.right+u.renderOffset.x*u.zoomLevel-y.left),x=Math.max(x,L.bottom+u.renderOffset.y*u.zoomLevel-y.top),{id:S.dataset.writerId,width:L.width,height:L.height,top:L.top+u.renderOffset.y*u.zoomLevel-y.top,left:L.left+u.renderOffset.x*u.zoomLevel-y.left}}),l.value={width:260,height:y.height/y.width*y.width/7},i.value=Math.min(l.value.width/(y.width+300),l.value.height/(y.height+300),l.value.width/(M+300),l.value.height/(x+300),l.value.width/(u.renderOffset.x*u.zoomLevel+y.width),l.value.height/(u.renderOffset.y*u.zoomLevel+y.height)),d.value={top:u.renderOffset.y*u.zoomLevel,left:u.renderOffset.x*u.zoomLevel,width:y.width,height:y.height},c.value={...d.value,isDisplayed:c.value.isDisplayed}}function m(v){const y=u.nodeContainerEl.getBoundingClientRect(),M=n.value.getBoundingClientRect();c.value={...c.value,top:Math.min(Math.max(0,(v.pageY-M.top)*(1/i.value)-y.height/2),M.height*(1/i.value)-y.height),left:Math.min(Math.max(0,(v.pageX-M.left)*(1/i.value)-y.width/2),M.width*(1/i.value)-y.width)}}function g(){c.value.isDisplayed=!0}function _(){c.value.isDisplayed=!1}function b(v){v.stopPropagation(),a.setSelection(null),r("changeRenderOffset",{x:c.value.left*(1/u.zoomLevel),y:c.value.top*(1/u.zoomLevel)})}return ia(async()=>{o.observe(u.nodeContainerEl),s.observe(u.nodeContainerEl,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style"]}),await qa(),f()}),Wn(()=>{o.disconnect(),s.disconnect()}),(v,y)=>($(),R("div",{ref_key:"rootEl",ref:n,class:"BlueprintMiniMap",onMouseenter:g,onMouseleave:_,onMousemove:m,onClick:b},[Z("div",{class:"selectedArea",style:bt({top:`${d.value.top*i.value}px`,left:`${d.value.left*i.value}px`,width:`${d.value.width*i.value}px`,height:`${d.value.height*i.value}px`})},null,4),Z("div",{class:"selector",style:bt({top:`${c.value.top*i.value}px`,left:`${c.value.left*i.value}px`,width:`${c.value.width*i.value}px`,height:`${c.value.height*i.value}px`})},null,4),($(!0),R(Je,null,Ot(h.value,M=>($(),R("div",{key:M.id,class:ft(["node",{selected:E(a).isComponentIdSelected(M.id)}]),style:bt({top:`${M.top*i.value}px`,left:`${M.left*i.value}px`,width:`${M.width*i.value}px`,height:`${M.height*i.value}px`})},null,6))),128))],544))}}),fce=ke(pce,[["__scopeId","data-v-05861f5c"]]);function mce(){var t;return((t=navigator==null?void 0:navigator.userAgentData)==null?void 0:t.platform)||(navigator==null?void 0:navigator.platform)}function Wr(){return Vd()?"⌘ ":"Ctrl+"}function Fc(e){return Vd()?e.metaKey:e.ctrlKey}function Vd(){return mce().toLowerCase().indexOf("mac")!=-1}const vce={class:"bar"},gce={class:"autoArranger"},yce={class:"zoomer"},Mce={class:"miniMapCollapser"},Om=.01,P1=.2,_ce=$e({__name:"BlueprintNavigator",props:{nodeContainerEl:{},renderOffset:{},zoomLevel:{}},emits:["changeRenderOffset","changeZoomLevel","resetZoom","autoArrange"],setup(e,{emit:t}){const a=e,{zoomLevel:n}=a0(a),r=pt("rootEl"),o=t,s=ye(!0),i=ye(l(n.value));function l(v){return`${Math.floor(v*100)}%`}function c(){s.value=!s.value}function d(){o("autoArrange")}function u(v){o("changeRenderOffset",v)}function h(){const v=n.value+P1;o("changeZoomLevel",v)}function f(){const v=n.value-P1;o("changeZoomLevel",v)}function m(v){const y=v.key;let M=n.value;if(y=="ArrowUp")M+=Om;else if(y=="ArrowDown")M-=Om;else return;o("changeZoomLevel",M)}function g(v){var x;const y=(x=v.target)==null?void 0:x.value;let M=parseInt(y)/100;isNaN(M)&&(M=1),i.value=l(M),o("changeZoomLevel",M)}function _(){o("resetZoom")}We(n,v=>{i.value=l(v)});function b(v){if(Fc(v)===!1)return;let y=n.value;if(v.key=="+"||v.key=="=")v.preventDefault(),y+=P1;else if(v.key=="-")v.preventDefault(),y-=P1;else return;o("changeZoomLevel",y)}return ia(()=>{document.addEventListener("keydown",b)}),Wn(()=>{document.removeEventListener("keydown",b)}),(v,y)=>($(),R("div",{ref_key:"rootEl",ref:r,"data-writer-unselectable":"true",class:"BlueprintNavigator",onKeydown:b},[v.nodeContainerEl&&s.value?($(),Ie(fce,{key:0,"node-container-el":v.nodeContainerEl,"render-offset":v.renderOffset,"zoom-level":E(n),class:"miniMap",onChangeRenderOffset:u},null,8,["node-container-el","render-offset","zoom-level"])):ge("",!0),Z("div",vce,[Z("div",gce,[Ce(La,{variant:"neutral",size:"smallIcon","data-writer-tooltip":"Auto arrange blocks","data-writer-tooltip-placement":"left",onClick:d},{default:Xe(()=>[Ce(_t,{name:"grid-3x3"})]),_:1})]),Z("div",yce,[Ce(La,{variant:"neutral",size:"smallIcon","data-writer-tooltip":E(n)>E(bo).minLevel?`Zoom out (${E(Wr)()}-)`:"Can't zoom further","data-writer-tooltip-placement":"left",onClick:f},{default:Xe(()=>[Ce(_t,{name:"minus"})]),_:1},8,["data-writer-tooltip"]),Ce(fg,{modelValue:i.value,"onUpdate:modelValue":y[0]||(y[0]=M=>i.value=M),class:"zoomLevelInput",onKeydown:m,onChange:g},null,8,["modelValue"]),Ce(La,{variant:"neutral",size:"smallIcon","data-writer-tooltip":E(n)<E(bo).maxLevel?`Zoom in (${E(Wr)()}+)`:"Can't zoom further","data-writer-tooltip-placement":"right",onClick:h},{default:Xe(()=>[Ce(_t,{name:"plus"})]),_:1},8,["data-writer-tooltip"]),Ce(La,{variant:"neutral",size:"smallIcon","data-writer-tooltip":"Reset zoom","data-writer-tooltip-placement":"right",onClick:_},{default:Xe(()=>[Ce(_t,{name:"undo-2"})]),_:1})]),Z("div",Mce,[Ce(La,{variant:"neutral",size:"smallIcon","data-writer-tooltip":s.value?"Close minimap":"Open minimap","data-writer-tooltip-placement":"right",onClick:c},{default:Xe(()=>[Ce(_t,{name:s.value?"minimize-2":"maximize-2"},null,8,["name"])]),_:1},8,["data-writer-tooltip"])])])],544))}}),bce=ke(_ce,[["__scopeId","data-v-ee6553db"]]),wce={},xce={width:"592",height:"592",viewBox:"0 0 592 592",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Cce(e,t){return $(),R("svg",xce,t[0]||(t[0]=[Z("g",null,[Z("g",{"clip-path":"url(#paint0_angular_167_137448_clip_path)"},[Z("g",{transform:"matrix(0.208791 0.208791 -0.208791 0.208791 296.078 296.082)"},[Z("foreignObject",{x:"-1003.39",y:"-1003.39",width:"2006.77",height:"2006.77"},[Z("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{background:`conic-gradient(
8508
8508
  from 90deg,
8509
8509
  rgba(240, 207, 255, 1) 0deg,
8510
8510
  rgba(191, 203, 255, 1) 360deg
8511
- )`,height:"100%",width:"100%",opacity:"1"}})])])]),Z("ellipse",{cx:"296.078",cy:"296.082",rx:"295.275",ry:"295.275",transform:"rotate(-45 296.078 296.082)"})],-1),Z("defs",null,[Z("clipPath",{id:"paint0_angular_167_137448_clip_path"},[Z("ellipse",{cx:"296.078",cy:"296.082",rx:"295.275",ry:"295.275",transform:"rotate(-45 296.078 296.082)"})])],-1)]))}const ac=ke(wce,[["render",Cce]]),Ace={class:"BlueprintsAutogenContents"},Sce={class:"BlueprintsAutogenContents__contents"},$ce=$e({__name:"BlueprintsAutogenContents",props:{isBusy:{type:Boolean,required:!0}},setup(e){return(t,a)=>($(),R("div",Ace,[Z("div",Sce,[qt(t.$slots,"default",{},void 0,!0)]),Z("div",{class:ft(["BlueprintsAutogenContents__background",{busy:e.isBusy}])},[Ce(ac,{class:"rotating-circle left"}),Ce(ac,{class:"rotating-circle center"}),Ce(ac,{class:"rotating-circle right"})],2)]))}}),Ece=ke($ce,[["__scopeId","data-v-6ed2673c"]]),Ice="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='48'%20height='48'%20rx='24'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M34.0187%2028.9434L37.2255%2015.7128H32.7659L30.812%2015.7128L34.0187%2028.9434Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M25.4266%2015.7128H20.967L25.4266%2034.1126L27.4085%2034.1126H31.8681L27.4085%2015.7128H25.4266L25.4266%2015.7128Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.5635%2015.7129H13.1038L13.1039%2015.7132H11.1219L15.5816%2034.113H20.0413L20.0412%2034.1126H22.0231L17.5635%2015.7129Z'%20fill='white'/%3e%3c/svg%3e",kce={class:"BlueprintsGenerationLoader"},Tce={class:"rotating-text"},Pce=4e3,Lce=$e({__name:"BlueprintsGenerationLoader",setup(e){const t=["Analyzing requirements","Shopping for blocks","Connecting the dots","Wiring the circuits","Flipping the switches"],a=ye(0),n=setInterval(()=>{a.value=(a.value+1)%t.length},Pce);return Wn(()=>clearInterval(n)),(r,o)=>($(),R("div",kce,[o[0]||(o[0]=Z("img",{src:Ice,alt:"Writer Framework logo",width:"72px",height:"72px"},null,-1)),Ce(Ad,{class:"dot-loader",color:"black"}),Z("p",Tce,[($(),R(Je,null,Ot(t,(s,i)=>Z("span",{key:i,class:ft({active:a.value===i})},je(s),3)),64))])]))}}),Vce=ke(Lce,[["__scopeId","data-v-78564a74"]]),gr=$t([]);function Od(){const e={};function t(r){const o=gr.value.findIndex(s=>s.id===r);o!==-1&&(gr.value=gr.value.filter((s,i)=>o!==i))}function a(r){e[r.id]&&(clearTimeout(e[r.id]),delete e[r.id]),!r.closable&&r.delayMs!==1/0&&(e[r.id]=setTimeout(()=>t(r.id),r.delayMs??3e3))}function n(r){if("id"in r&&gr.value.some(i=>i.id===r.id))return gr.value=gr.value.map(i=>i.id===r.id?r:i),a(r),r.id;const o="id"in r?r.id:new Date().getTime(),s={...r,id:o};return gr.value=[...gr.value,s],a(s),o}return{pushToast:n,removeToast:t,toasts:jt(gr)}}var Oce={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1},wo,Ca,ra,xo,si,Co,ii;class Hce{constructor(t){Yo(this,xo);Yo(this,Co);Yo(this,wo,void 0);Yo(this,Ca,void 0);Yo(this,ra,void 0);s1(this,wo,t==null?void 0:t.signal),s1(this,Ca,(t==null?void 0:t.baseUrl)??window.location.origin),s1(this,ra,{signal:xt(this,wo),credentials:"include",headers:{"Content-Type":"application/json","X-Client":"Framework"}})}async fetchApplicationDeployment(t,a){const n=new URL(`/api/template/organization/${t}/application/${a}/deployment`,xt(this,Ca)),r=await fetch(n,xt(this,ra));if(!r.ok)throw Error(await r.text());return r.json()}async fetchOrganizationUsers(t,a={}){const n=new URL(`/api/user/v2/organization/${t}`,xt(this,Ca)),r=new URLSearchParams;for(const[s,i]of Object.entries(a))r.append(s,String(i));const o=await fetch(`${n}?${r.toString()}`,xt(this,ra));if(!o.ok)throw Error(await o.text());return o.json()}async publishApplication(t,a,n){const r=new URL(`/api/template/organization/${t}/application/${a}/publish`,xt(this,Ca)),o=await fetch(r,{...xt(this,ra),method:"PUT",body:JSON.stringify(n)});if(!o.ok)throw Error(await o.text());return o.json()}async updateApplicationMetadata(t,a,n){const r=new URL(`/api/template/organization/${t}/application/${a}/metadata`,xt(this,Ca)),o=await fetch(r,{...xt(this,ra),method:"PUT",body:JSON.stringify(n)});if(!o.ok)throw Error(await o.text());return o.json()}async fetchUserProfile(){const t=new URL("/api/user/v2/profile",xt(this,Ca)),a=await fetch(t,xt(this,ra));if(!a.ok)throw Error(await a.text());return a.json()}async fetchUserById(t){const a=new URL(`/api/user/v2/user/${t}`,xt(this,Ca)),n=await fetch(a,xt(this,ra));if(!n.ok)throw Error(await n.text());return n.json()}async analyticsIdentify(){const t=new URL("/api/analytics/identify",xt(this,Ca)),a=await fetch(t,{...xt(this,ra),method:"POST",body:JSON.stringify({traits:{}})});if(!a.ok)throw Error(await a.text())}async analyticsTrack(t,a){const n=new URL("/api/analytics/track",xt(this,Ca)),r=await fetch(n,{...xt(this,ra),method:"POST",body:JSON.stringify({eventName:t,properties:a})});if(!r.ok)throw Error(await r.text())}async analyticsPage(t,a,n){const r=new URL("/api/analytics/page",xt(this,Ca)),o=await fetch(r,{method:"POST",body:JSON.stringify({name:t,organizationId:a,properties:n}),signal:xt(this,wo),credentials:"include"});if(!o.ok)throw Error(await o.text())}async fetchThirdUserProfile(t){const a=new URL(`/api/user/v2/user/${t}`,xt(this,Ca)),n=await fetch(a,xt(this,ra));if(!n.ok)throw Error(await n.text());return n.json()}async createSecret(t,a,n,r){const o=await fetch(fr(this,xo,si).call(this,t,a),{...xt(this,ra),method:"POST",body:JSON.stringify({key:n,secret:r})});if(!o.ok)throw Error(await o.text());return o.json()}async fetchSecret(t,a,n){const r=await fetch(fr(this,xo,si).call(this,t,a,n),xt(this,ra));if(!r.ok)throw Error(await r.text());return r.json()}async deleteSecret(t,a,n){const r=await fetch(fr(this,xo,si).call(this,t,a,n),{...xt(this,ra),method:"DELETE"});if(!r.ok)throw Error(await r.text());return r.json()}async updateSecret(t,a,n,r){const o=await fetch(fr(this,xo,si).call(this,t,a,n),{...xt(this,ra),method:"PUT",body:JSON.stringify({key:n,secret:r})});if(!o.ok)throw Error(await o.text());return o.json()}async fetchMcpConnectedApps(t,a){const n=new URL(`/api/mcp-gateway/v2/organization/${t}/app-configurations`,xt(this,Ca)),r=new URLSearchParams({limit:"100"}),o={...xt(this,ra).headers};a&&(o["X-Agent-Id"]=a);const s=`${n}?${r.toString()}`,i=await fetch(s,{...xt(this,ra),headers:o});if(!i.ok){const c=await i.text();throw Error(c)}return(await i.json()).result||[]}async fetchMcpAppFunctions(t,a){const n=new URL(`/api/mcp-gateway/v1/functions/list/${t}`,xt(this,Ca)),r={...xt(this,ra).headers};a&&(r["X-Agent-Id"]=a);const o=await fetch(n,{...xt(this,ra),headers:r});if(!o.ok){const s=await o.text();throw Error(s)}return await o.json()}async fetchMcpTools(t,a){var o,s;const n=await this.fetchMcpConnectedApps(t,a),r=[];for(const i of n){const l=i.appId;if(l)try{const c=await this.fetchMcpAppFunctions(l,a),d=i.allFunctionsEnabled??!0,u=i.enabledFunctions||[];let h;d?h=c:u.length>0?h=c.filter(m=>m.name&&u.includes(m.name)):h=[];const f=((o=i.connector)==null?void 0:o.displayName)||((s=i.connector)==null?void 0:s.name)||i.name||"";for(const m of h)r.push({appId:l,appName:f,functionName:m.name||"",function:m,connector:i.connector?{logo:i.connector.logo}:void 0})}catch(c){fa().error("Error fetching MCP app functions:",c)}}return r}async fetchConfigJs(){const t=new URL("/env/config.js",xt(this,Ca)),a=await fetch(t,{signal:xt(this,wo),credentials:"include",headers:{"X-Client":"Framework"},...xt(this,ra)});if(!a.ok){const n=await a.text();throw Error(n)}return a.text()}async publishSharedBlueprint(t,a){const n=fr(this,Co,ii).call(this),r=new URL(`/api/agent-storage/v1/organization/${t}/shared-blueprints`,n),o=await fetch(r,{...xt(this,ra),method:"POST",body:JSON.stringify({title:a.title,description:a.description,components:a.components,metadata:a.metadata,existing_snippet_id:a.existingSnippetId||null})});if(!o.ok)throw Error(await o.text());return o.json()}async listSharedBlueprints(t,a){const n=fr(this,Co,ii).call(this),r=new URL(`/api/agent-storage/v1/organization/${t}/shared-blueprints`,n);a&&r.searchParams.append("search",a);const o=await fetch(r,xt(this,ra));if(!o.ok)throw Error(await o.text());return o.json()}async getSharedBlueprint(t,a){const n=fr(this,Co,ii).call(this),r=new URL(`/api/agent-storage/v1/organization/${t}/shared-blueprints/${a}`,n),o=await fetch(r,xt(this,ra));if(!o.ok)throw Error(await o.text());return o.json()}async deleteSharedBlueprint(t,a){const n=fr(this,Co,ii).call(this),r=new URL(`/api/agent-storage/v1/organization/${t}/shared-blueprints/${a}`,n),o=await fetch(r,{...xt(this,ra),method:"DELETE"});if(!o.ok)throw Error(await o.text())}}wo=new WeakMap,Ca=new WeakMap,ra=new WeakMap,xo=new WeakSet,si=function(t,a,n){const r=new URL(`/api/template/organization/${t}/agent/${a}/secret`,xt(this,Ca));return n?`${r}/${n}`:r},Co=new WeakSet,ii=function(){return Oce.VITE_AGENT_STORAGE_URL||xt(this,Ca)};var Rce={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function io(e={}){const t=Rce.VITE_WRITER_BASE_URL??window.location.origin;return{writerApi:new Hce({...e,baseUrl:t}),apiBaseUrl:t}}let nc=!1;const Hm="[AgentEditor]";function Hd(e){const t=new AbortController,a=fa(),{writerApi:n}=io({signal:t.signal}),r=e.isWriterCloudApp;if(!nc){const f=We(r,async()=>{if(!(nc||!r.value)){nc=!0;try{const m=n.fetchUserProfile();await Promise.allSettled([n.analyticsIdentify(),o(m),s(m)])}catch(m){a.error("Failed to identify the current user for analytics",m)}finally{f()}}},{immediate:!0})}async function o(f=n.fetchUserProfile()){if(e.mode.value==="run")return;const m=await zt(()=>import("./index-DHZHZi5W.js").then(_=>_.i),[],import.meta.url);m.init("S6dr31v4MO4wuteztVhxysLkoA9HsZ6HnDaOTDLqNXHYZq-1P02ek-E3BR4Zgv4pMwdoYO",{fastUrl:"https://fast.chameleon.io/"});const g=await f;m.identify(`segment-prefix-${g.id}`,{email:g==null?void 0:g.email,name:(g==null?void 0:g.fullName)??`${g==null?void 0:g.firstName} ${g.lastName}`})}async function s(f=n.fetchUserProfile()){if(!r.value)return;const m=await zt(()=>import("./index.esm-B1ZQtduY.js"),[],import.meta.url);if(!m.isInitialized()){m.init({orgId:"o-2316W7-na1",devMode:!1});try{const g=await f;await m.FullStory("setIdentityAsync",{uid:`segment-prefix-${g.id}`,properties:g,consent:!0})}catch(g){a.error("Failed to set FullStory identity",g)}}}async function i(f,m){if(!r.value)return;const{FullStory:g}=await zt(()=>import("./index.esm-B1ZQtduY.js"),[],import.meta.url);return g("trackEventAsync",{name:f,properties:m})}function l(f,m){if(r.value)return n.analyticsTrack(f,m)}function c(f){const m=e.getComponentById(f);if(!m)return{};const g=e.getComponentDefinition(m.type);return g?{name:g.name,category:g.category}:{}}function d(f){const m=structuredClone(f);return typeof m.componentId=="string"&&(m.component=c(m.componentId),delete m.componentId),Array.isArray(m.componentIds)&&(m.components=m.componentIds.map(c),delete m.componentIds),{writerApplicationId:e.writerAppId.value,writerOrganizationId:String(e.writerOrgId.value),...m}}async function u(f,m={}){if(!r.value)return;const g=`${Hm} ${f}`,_=d(m);return a.log("[tracking]",g,_),await Promise.all([l(g,_),i(g,_)]).catch(a.error)}function h(f,m={}){if(r.value&&e.writerOrgId.value)return n.analyticsPage(`${Hm} ${f}`,e.writerOrgId.value,d(m))}return{track:u,page:h}}function Li(e,t=window.location.toString()){return new URL(`.${e}`,t).toString()}function Bde(e){return e.startsWith("/")?Li(e):e}const Nce={class:"BlueprintsAutogen"},Dce={class:"BlueprintsAutogen__panel"},Bce={class:"BlueprintsAutogen__error"},Fce={class:"BlueprintsAutogen__buttons"},jce=$e({__name:"BlueprintsAutogen",emits:["blockGeneration"],setup(e,{emit:t}){const a=re(ne.core),n=re(ne.builderManager),{generateNewComponentId:r}=Bs(a,n),o=Hd(a),{pushToast:s}=Od(),i=ye(!1),l=ye(""),c=ye(null);let d=null;const u=t;function h(){d&&d.abort(),u("blockGeneration",null)}ia(()=>{o.track("blueprints_auto_gen_opened")});function f(_){const b={};return _.forEach(v=>{const y=r();b[v.id]=y,v.id=y}),_.forEach(v=>{var y;(y=v.outs)==null||y.forEach(M=>{M.toNodeId=b[M.toNodeId]})}),_.forEach(v=>{Object.entries(b).forEach(([y,M])=>{const x=new RegExp(`(@{\\s*results\\.)aig${y}\\b`,"g");Object.entries(v.content).forEach(([S,L])=>{const F=L.replace(x,(te,J)=>te.replace(J,M));v.content[S]=F})})}),_}async function m(){var b;const _=l.value;if(!_){c.value="Please add instructions to create your blueprint.";return}i.value=!0,c.value=null,d&&d.abort(),d=new AbortController,o.track("blueprints_auto_gen_started",{prompt:l.value});try{const v=await fetch(Li("/api/autogen"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:_}),signal:d.signal});if(!v.ok){c.value="Agent failed to generate. Try again.";return}const y=await v.json(),M=f((b=y.blueprint)==null?void 0:b.components);u("blockGeneration",{components:M}),s({type:"success",message:"Blueprint generated"})}catch(v){v.name!=="AbortError"&&(c.value="Agent failed to generate. Try again.");return}finally{i.value=!1,d=null}o.track("blueprints_auto_gen_completed")}function g(){d&&d.abort(),i.value=!1}return(_,b)=>($(),R("div",Nce,[Z("h2",null,je(i.value?"Generating agent":"What would you like this agent to do?"),1),Ce(Ece,{"is-busy":i.value,class:ft({busy:i.value})},{default:Xe(()=>[i.value?($(),Ie(Vce,{key:1})):($(),R("div",{key:0,class:ft(["BlueprintsAutogen__main",{error:c.value}])},[Ce(_0,{modelValue:l.value,"onUpdate:modelValue":b[0]||(b[0]=v=>l.value=v),rows:"10",placeholder:`Describe a workflow
8511
+ )`,height:"100%",width:"100%",opacity:"1"}})])])]),Z("ellipse",{cx:"296.078",cy:"296.082",rx:"295.275",ry:"295.275",transform:"rotate(-45 296.078 296.082)"})],-1),Z("defs",null,[Z("clipPath",{id:"paint0_angular_167_137448_clip_path"},[Z("ellipse",{cx:"296.078",cy:"296.082",rx:"295.275",ry:"295.275",transform:"rotate(-45 296.078 296.082)"})])],-1)]))}const ac=ke(wce,[["render",Cce]]),Ace={class:"BlueprintsAutogenContents"},Sce={class:"BlueprintsAutogenContents__contents"},$ce=$e({__name:"BlueprintsAutogenContents",props:{isBusy:{type:Boolean,required:!0}},setup(e){return(t,a)=>($(),R("div",Ace,[Z("div",Sce,[qt(t.$slots,"default",{},void 0,!0)]),Z("div",{class:ft(["BlueprintsAutogenContents__background",{busy:e.isBusy}])},[Ce(ac,{class:"rotating-circle left"}),Ce(ac,{class:"rotating-circle center"}),Ce(ac,{class:"rotating-circle right"})],2)]))}}),Ece=ke($ce,[["__scopeId","data-v-6ed2673c"]]),Ice="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='48'%20height='48'%20rx='24'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M34.0187%2028.9434L37.2255%2015.7128H32.7659L30.812%2015.7128L34.0187%2028.9434Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M25.4266%2015.7128H20.967L25.4266%2034.1126L27.4085%2034.1126H31.8681L27.4085%2015.7128H25.4266L25.4266%2015.7128Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.5635%2015.7129H13.1038L13.1039%2015.7132H11.1219L15.5816%2034.113H20.0413L20.0412%2034.1126H22.0231L17.5635%2015.7129Z'%20fill='white'/%3e%3c/svg%3e",kce={class:"BlueprintsGenerationLoader"},Tce={class:"rotating-text"},Pce=4e3,Lce=$e({__name:"BlueprintsGenerationLoader",setup(e){const t=["Analyzing requirements","Shopping for blocks","Connecting the dots","Wiring the circuits","Flipping the switches"],a=ye(0),n=setInterval(()=>{a.value=(a.value+1)%t.length},Pce);return Wn(()=>clearInterval(n)),(r,o)=>($(),R("div",kce,[o[0]||(o[0]=Z("img",{src:Ice,alt:"Writer Framework logo",width:"72px",height:"72px"},null,-1)),Ce(Ad,{class:"dot-loader",color:"black"}),Z("p",Tce,[($(),R(Je,null,Ot(t,(s,i)=>Z("span",{key:i,class:ft({active:a.value===i})},je(s),3)),64))])]))}}),Vce=ke(Lce,[["__scopeId","data-v-78564a74"]]),gr=$t([]);function Od(){const e={};function t(r){const o=gr.value.findIndex(s=>s.id===r);o!==-1&&(gr.value=gr.value.filter((s,i)=>o!==i))}function a(r){e[r.id]&&(clearTimeout(e[r.id]),delete e[r.id]),!r.closable&&r.delayMs!==1/0&&(e[r.id]=setTimeout(()=>t(r.id),r.delayMs??3e3))}function n(r){if("id"in r&&gr.value.some(i=>i.id===r.id))return gr.value=gr.value.map(i=>i.id===r.id?r:i),a(r),r.id;const o="id"in r?r.id:new Date().getTime(),s={...r,id:o};return gr.value=[...gr.value,s],a(s),o}return{pushToast:n,removeToast:t,toasts:jt(gr)}}var Oce={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1},wo,Ca,ra,xo,si,Co,ii;class Hce{constructor(t){Yo(this,xo);Yo(this,Co);Yo(this,wo,void 0);Yo(this,Ca,void 0);Yo(this,ra,void 0);s1(this,wo,t==null?void 0:t.signal),s1(this,Ca,(t==null?void 0:t.baseUrl)??window.location.origin),s1(this,ra,{signal:xt(this,wo),credentials:"include",headers:{"Content-Type":"application/json","X-Client":"Framework"}})}async fetchApplicationDeployment(t,a){const n=new URL(`/api/template/organization/${t}/application/${a}/deployment`,xt(this,Ca)),r=await fetch(n,xt(this,ra));if(!r.ok)throw Error(await r.text());return r.json()}async fetchOrganizationUsers(t,a={}){const n=new URL(`/api/user/v2/organization/${t}`,xt(this,Ca)),r=new URLSearchParams;for(const[s,i]of Object.entries(a))r.append(s,String(i));const o=await fetch(`${n}?${r.toString()}`,xt(this,ra));if(!o.ok)throw Error(await o.text());return o.json()}async publishApplication(t,a,n){const r=new URL(`/api/template/organization/${t}/application/${a}/publish`,xt(this,Ca)),o=await fetch(r,{...xt(this,ra),method:"PUT",body:JSON.stringify(n)});if(!o.ok)throw Error(await o.text());return o.json()}async updateApplicationMetadata(t,a,n){const r=new URL(`/api/template/organization/${t}/application/${a}/metadata`,xt(this,Ca)),o=await fetch(r,{...xt(this,ra),method:"PUT",body:JSON.stringify(n)});if(!o.ok)throw Error(await o.text());return o.json()}async fetchUserProfile(){const t=new URL("/api/user/v2/profile",xt(this,Ca)),a=await fetch(t,xt(this,ra));if(!a.ok)throw Error(await a.text());return a.json()}async fetchUserById(t){const a=new URL(`/api/user/v2/user/${t}`,xt(this,Ca)),n=await fetch(a,xt(this,ra));if(!n.ok)throw Error(await n.text());return n.json()}async analyticsIdentify(){const t=new URL("/api/analytics/identify",xt(this,Ca)),a=await fetch(t,{...xt(this,ra),method:"POST",body:JSON.stringify({traits:{}})});if(!a.ok)throw Error(await a.text())}async analyticsTrack(t,a){const n=new URL("/api/analytics/track",xt(this,Ca)),r=await fetch(n,{...xt(this,ra),method:"POST",body:JSON.stringify({eventName:t,properties:a})});if(!r.ok)throw Error(await r.text())}async analyticsPage(t,a,n){const r=new URL("/api/analytics/page",xt(this,Ca)),o=await fetch(r,{method:"POST",body:JSON.stringify({name:t,organizationId:a,properties:n}),signal:xt(this,wo),credentials:"include"});if(!o.ok)throw Error(await o.text())}async fetchThirdUserProfile(t){const a=new URL(`/api/user/v2/user/${t}`,xt(this,Ca)),n=await fetch(a,xt(this,ra));if(!n.ok)throw Error(await n.text());return n.json()}async createSecret(t,a,n,r){const o=await fetch(fr(this,xo,si).call(this,t,a),{...xt(this,ra),method:"POST",body:JSON.stringify({key:n,secret:r})});if(!o.ok)throw Error(await o.text());return o.json()}async fetchSecret(t,a,n){const r=await fetch(fr(this,xo,si).call(this,t,a,n),xt(this,ra));if(!r.ok)throw Error(await r.text());return r.json()}async deleteSecret(t,a,n){const r=await fetch(fr(this,xo,si).call(this,t,a,n),{...xt(this,ra),method:"DELETE"});if(!r.ok)throw Error(await r.text());return r.json()}async updateSecret(t,a,n,r){const o=await fetch(fr(this,xo,si).call(this,t,a,n),{...xt(this,ra),method:"PUT",body:JSON.stringify({key:n,secret:r})});if(!o.ok)throw Error(await o.text());return o.json()}async fetchMcpConnectedApps(t,a){const n=new URL(`/api/mcp-gateway/v2/organization/${t}/app-configurations`,xt(this,Ca)),r=new URLSearchParams({limit:"100"}),o={...xt(this,ra).headers};a&&(o["X-Agent-Id"]=a);const s=`${n}?${r.toString()}`,i=await fetch(s,{...xt(this,ra),headers:o});if(!i.ok){const c=await i.text();throw Error(c)}return(await i.json()).result||[]}async fetchMcpAppFunctions(t,a){const n=new URL(`/api/mcp-gateway/v1/functions/list/${t}`,xt(this,Ca)),r={...xt(this,ra).headers};a&&(r["X-Agent-Id"]=a);const o=await fetch(n,{...xt(this,ra),headers:r});if(!o.ok){const s=await o.text();throw Error(s)}return await o.json()}async fetchMcpTools(t,a){var o,s;const n=await this.fetchMcpConnectedApps(t,a),r=[];for(const i of n){const l=i.appId;if(l)try{const c=await this.fetchMcpAppFunctions(l,a),d=i.allFunctionsEnabled??!0,u=i.enabledFunctions||[];let h;d?h=c:u.length>0?h=c.filter(m=>m.name&&u.includes(m.name)):h=[];const f=((o=i.connector)==null?void 0:o.displayName)||((s=i.connector)==null?void 0:s.name)||i.name||"";for(const m of h)r.push({appId:l,appName:f,functionName:m.name||"",function:m,connector:i.connector?{logo:i.connector.logo}:void 0})}catch(c){fa().error("Error fetching MCP app functions:",c)}}return r}async fetchConfigJs(){const t=new URL("/env/config.js",xt(this,Ca)),a=await fetch(t,{signal:xt(this,wo),credentials:"include",headers:{"X-Client":"Framework"},...xt(this,ra)});if(!a.ok){const n=await a.text();throw Error(n)}return a.text()}async publishSharedBlueprint(t,a){const n=fr(this,Co,ii).call(this),r=new URL(`/api/agent-storage/v1/organization/${t}/shared-blueprints`,n),o=await fetch(r,{...xt(this,ra),method:"POST",body:JSON.stringify({title:a.title,description:a.description,components:a.components,metadata:a.metadata,existing_snippet_id:a.existingSnippetId||null})});if(!o.ok)throw Error(await o.text());return o.json()}async listSharedBlueprints(t,a){const n=fr(this,Co,ii).call(this),r=new URL(`/api/agent-storage/v1/organization/${t}/shared-blueprints`,n);a&&r.searchParams.append("search",a);const o=await fetch(r,xt(this,ra));if(!o.ok)throw Error(await o.text());return o.json()}async getSharedBlueprint(t,a){const n=fr(this,Co,ii).call(this),r=new URL(`/api/agent-storage/v1/organization/${t}/shared-blueprints/${a}`,n),o=await fetch(r,xt(this,ra));if(!o.ok)throw Error(await o.text());return o.json()}async deleteSharedBlueprint(t,a){const n=fr(this,Co,ii).call(this),r=new URL(`/api/agent-storage/v1/organization/${t}/shared-blueprints/${a}`,n),o=await fetch(r,{...xt(this,ra),method:"DELETE"});if(!o.ok)throw Error(await o.text())}}wo=new WeakMap,Ca=new WeakMap,ra=new WeakMap,xo=new WeakSet,si=function(t,a,n){const r=new URL(`/api/template/organization/${t}/agent/${a}/secret`,xt(this,Ca));return n?`${r}/${n}`:r},Co=new WeakSet,ii=function(){return Oce.VITE_AGENT_STORAGE_URL||xt(this,Ca)};var Rce={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function io(e={}){const t=Rce.VITE_WRITER_BASE_URL??window.location.origin;return{writerApi:new Hce({...e,baseUrl:t}),apiBaseUrl:t}}let nc=!1;const Hm="[AgentEditor]";function Hd(e){const t=new AbortController,a=fa(),{writerApi:n}=io({signal:t.signal}),r=e.isWriterCloudApp;if(!nc){const f=We(r,async()=>{if(!(nc||!r.value)){nc=!0;try{const m=n.fetchUserProfile();await Promise.allSettled([n.analyticsIdentify(),o(m),s(m)])}catch(m){a.error("Failed to identify the current user for analytics",m)}finally{f()}}},{immediate:!0})}async function o(f=n.fetchUserProfile()){if(e.mode.value==="run")return;const m=await zt(()=>import("./index-DVo1rFbH.js").then(_=>_.i),[],import.meta.url);m.init("S6dr31v4MO4wuteztVhxysLkoA9HsZ6HnDaOTDLqNXHYZq-1P02ek-E3BR4Zgv4pMwdoYO",{fastUrl:"https://fast.chameleon.io/"});const g=await f;m.identify(`segment-prefix-${g.id}`,{email:g==null?void 0:g.email,name:(g==null?void 0:g.fullName)??`${g==null?void 0:g.firstName} ${g.lastName}`})}async function s(f=n.fetchUserProfile()){if(!r.value)return;const m=await zt(()=>import("./index.esm-B1ZQtduY.js"),[],import.meta.url);if(!m.isInitialized()){m.init({orgId:"o-2316W7-na1",devMode:!1});try{const g=await f;await m.FullStory("setIdentityAsync",{uid:`segment-prefix-${g.id}`,properties:g,consent:!0})}catch(g){a.error("Failed to set FullStory identity",g)}}}async function i(f,m){if(!r.value)return;const{FullStory:g}=await zt(()=>import("./index.esm-B1ZQtduY.js"),[],import.meta.url);return g("trackEventAsync",{name:f,properties:m})}function l(f,m){if(r.value)return n.analyticsTrack(f,m)}function c(f){const m=e.getComponentById(f);if(!m)return{};const g=e.getComponentDefinition(m.type);return g?{name:g.name,category:g.category}:{}}function d(f){const m=structuredClone(f);return typeof m.componentId=="string"&&(m.component=c(m.componentId),delete m.componentId),Array.isArray(m.componentIds)&&(m.components=m.componentIds.map(c),delete m.componentIds),{writerApplicationId:e.writerAppId.value,writerOrganizationId:String(e.writerOrgId.value),...m}}async function u(f,m={}){if(!r.value)return;const g=`${Hm} ${f}`,_=d(m);return a.log("[tracking]",g,_),await Promise.all([l(g,_),i(g,_)]).catch(a.error)}function h(f,m={}){if(r.value&&e.writerOrgId.value)return n.analyticsPage(`${Hm} ${f}`,e.writerOrgId.value,d(m))}return{track:u,page:h}}function Li(e,t=window.location.toString()){return new URL(`.${e}`,t).toString()}function Bde(e){return e.startsWith("/")?Li(e):e}const Nce={class:"BlueprintsAutogen"},Dce={class:"BlueprintsAutogen__panel"},Bce={class:"BlueprintsAutogen__error"},Fce={class:"BlueprintsAutogen__buttons"},jce=$e({__name:"BlueprintsAutogen",emits:["blockGeneration"],setup(e,{emit:t}){const a=re(ne.core),n=re(ne.builderManager),{generateNewComponentId:r}=Bs(a,n),o=Hd(a),{pushToast:s}=Od(),i=ye(!1),l=ye(""),c=ye(null);let d=null;const u=t;function h(){d&&d.abort(),u("blockGeneration",null)}ia(()=>{o.track("blueprints_auto_gen_opened")});function f(_){const b={};return _.forEach(v=>{const y=r();b[v.id]=y,v.id=y}),_.forEach(v=>{var y;(y=v.outs)==null||y.forEach(M=>{M.toNodeId=b[M.toNodeId]})}),_.forEach(v=>{Object.entries(b).forEach(([y,M])=>{const x=new RegExp(`(@{\\s*results\\.)aig${y}\\b`,"g");Object.entries(v.content).forEach(([S,L])=>{const F=L.replace(x,(te,J)=>te.replace(J,M));v.content[S]=F})})}),_}async function m(){var b;const _=l.value;if(!_){c.value="Please add instructions to create your blueprint.";return}i.value=!0,c.value=null,d&&d.abort(),d=new AbortController,o.track("blueprints_auto_gen_started",{prompt:l.value});try{const v=await fetch(Li("/api/autogen"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:_}),signal:d.signal});if(!v.ok){c.value="Agent failed to generate. Try again.";return}const y=await v.json(),M=f((b=y.blueprint)==null?void 0:b.components);u("blockGeneration",{components:M}),s({type:"success",message:"Blueprint generated"})}catch(v){v.name!=="AbortError"&&(c.value="Agent failed to generate. Try again.");return}finally{i.value=!1,d=null}o.track("blueprints_auto_gen_completed")}function g(){d&&d.abort(),i.value=!1}return(_,b)=>($(),R("div",Nce,[Z("h2",null,je(i.value?"Generating agent":"What would you like this agent to do?"),1),Ce(Ece,{"is-busy":i.value,class:ft({busy:i.value})},{default:Xe(()=>[i.value?($(),Ie(Vce,{key:1})):($(),R("div",{key:0,class:ft(["BlueprintsAutogen__main",{error:c.value}])},[Ce(_0,{modelValue:l.value,"onUpdate:modelValue":b[0]||(b[0]=v=>l.value=v),rows:"10",placeholder:`Describe a workflow
8512
8512
 
8513
8513
  example:
8514
8514
  - Connect to Google Keyword Planner and get the best keywords for my site www.writer.com
8515
8515
  - Get an article from Wordpress using the API
8516
- - Draft a new article with updates based on the target keywords`,style:{height:"100%"}},null,8,["modelValue"])],2))]),_:1},8,["is-busy","class"]),Z("div",Dce,[Z("p",Bce,je(c.value),1),Z("div",Fce,[i.value?($(),Ie(La,{key:0,variant:"tertiary",onClick:g},{default:Xe(()=>b[1]||(b[1]=[pa(" Back ")])),_:1})):ge("",!0),Ce(La,{variant:"tertiary",onClick:h},{default:Xe(()=>b[2]||(b[2]=[pa(" Skip ")])),_:1}),Ce(La,{variant:"secondary",disabled:i.value,onClick:m},{default:Xe(()=>[Ce(_t,{name:"sparkles"}),pa(" "+je(i.value?"Autogenerating...":"Autogenerate agent"),1)]),_:1},8,["disabled"])])])]))}}),Uce=ke(jce,[["__scopeId","data-v-50d9936c"]]),zce=["data-writer-unselectable"],qce={class:"BlueprintsBlueprint__svg"},Wce=["x","y"],Zce=["cx","cy","fill"],Kce={key:0,width:"100%",height:"100%",fill:"url(#grid)",fil:""},{log:Gce}=fa(),xa=24,Jce="A container component representing a single blueprint within the application.",Xce={writer:{name:"Blueprint",toolkit:"blueprints",category:"Root",description:Jce,allowedChildrenTypes:["*"],allowedParentTypes:["blueprints_root"],fields:{key:{name:"Blueprint key",desc:"Unique identifier. It's needed to enable navigation to this Blueprint.",type:Q.IdKey,validator:WE}}}},bo={minLevel:.2,maxLevel:1,step:.25,initialLevel:1},Yce=$e({...Xce,__name:"BlueprintsBlueprint",setup(e){ji(fe=>({"3cf15168":J.value}));const t=sr({loader:()=>zt(()=>import("./BlueprintToolbar-CSKyGsgb.js"),__vite__mapDeps([11,12,13]),import.meta.url),loadingComponentProps:{width:"250px",height:"40px"}}),a=sr({loader:()=>zt(()=>import("./BuilderSettingsDeploySharedBlueprint-Ct5FVU3z.js"),__vite__mapDeps([14,15,16,17]),import.meta.url)}),n=re(ne.core),r=re(ne.builderManager),o=re(ne.notesManager),s=re(ne.renderProxiedComponent),i=re(ne.componentId),l=re(ne.isAutogenModalShown,ye(!1));function c(){l.value=!0}const d=ye(!1),u=pt("rootEl"),h=pt("nodeContainerEl"),{selectionRect:f,isCursorSelecting:m,isHoveringSelectableArea:g,justCompletedDragSelection:_,handleMousedown:b,handleMousemove:v,handleMouseup:y,handleMouseleave:M,handleDocumentMouseup:x,handleDocumentClick:S}=sce({wrapperRef:h,builderManager:r,isAnnotating:o.isAnnotating}),L=$t([]),F=$t({x:0,y:0}),te=$t(null),J=ye(bo.initialLevel),be=new MutationObserver(ve),oe=$t({}),Te=xa*4,Ue=xa*6,Ze=H(()=>n.getComponents(i,{sortedByPosition:!0}).filter(fe=>fe.type!=="note")),Me=H(()=>Array.from(o.getNotes(i))),ee=Hd(n),{createAndInsertComponent:j,addOut:K,removeOut:G,changeCoordinatesMultiple:T}=Bs(n,r,ee),{getComponentInfoFromDrag:O}=J2e(n),k=$t(null),C=$t(null),P=$t(null),ae=xe();function xe(){const fe="blueprint__hideGrid",Le=ye(localStorage.getItem(fe)===null);return We(Le,Re=>Re?localStorage.removeItem(fe):localStorage.setItem(fe,"1")),Le}function ve(){L.value=Ze.value.reduce((fe,Le)=>{var Re;if(!((Re=Le.outs)!=null&&Re.length))return fe;for(const Ve of Le.outs){const Ge=N(Le.id,Ve.outId,void 0,Ve.toNodeId);Ge&&fe.push(Ge)}return fe},[])}const ze=H(()=>{var fe,Le;return k.value===null&&!((fe=C.value)!=null&&fe.isPerfected)&&!((Le=P.value)!=null&&Le.isPerfected)?null:!0});function Ye(fe){if(_.value){fe.preventDefault(),fe.stopPropagation();return}if(te.value=null,fe.target instanceof Element&&!fe.target.closest("[data-writer-unselectable]")&&o.isAnnotating.value){const{x:Le,y:Re}=ce(fe);o.createNote(i,{x:Le,y:Re})}}function ct(){const fe=new Map;function Le(Ve,Ge){var Mt;if(fe.values().find(At=>At.has(Ve)))return;fe.has(Ge)||fe.set(Ge,new Set),fe.get(Ge).add(Ve),(Mt=Ve.outs)==null||Mt.forEach(At=>{const Yt=n.getComponentById(At.toNodeId);Le(Yt,Ge+1)})}const Re=new Map;return Ze.value.forEach(Ve=>{var Ge;(Ge=Ve.outs)==null||Ge.forEach(dt=>{Re.has(dt.toNodeId)||Re.set(dt.toNodeId,new Set),Re.get(dt.toNodeId).add(Ve.id)})}),Ze.value.filter(Ve=>!Re.has(Ve.id)).forEach(Ve=>{Le(Ve,0)}),fe}function wt(fe){const Le=`[data-writer-id="${fe}"]`,Re=h.value.querySelector(Le);if(Re)return Re.getBoundingClientRect()}function D(fe){var Ge;const Le=wt(fe);if(!Le)return;const Re=(Ge=u.value)==null?void 0:Ge.getBoundingClientRect();if(!Re)return;const Ve=dt=>{const rt=tc(dt,xa);return rt===dt?rt+1:rt-1};return{x:F.value.x+(Le.x-Re.x)*pe.value,y:F.value.y+(Le.y-Re.y)*pe.value,width:Ve(Le.width*pe.value),height:Ve(Le.height*pe.value)}}function q(fe){const Le=new Map,Re=new Map;return fe.forEach((Ve,Ge)=>{let dt=0,rt=0;Ve.forEach(Mt=>{const At=wt(Mt.id);At&&(Re.set(Mt.id,{height:At.height*pe.value}),dt+=At.height*pe.value+Te,rt=Math.max(rt,At.width*pe.value))}),Le.set(Ge,{height:dt-Te,width:rt})}),{columnDimensions:Le,nodeDimensions:Re}}function he(){me("currentY")}function me(fe){const Le={currentY:(At,Yt)=>At.y>Yt.y?1:-1,socketPosition:(At,Yt)=>{const[la,ca]=[At,Yt].map(Gt=>Ze.value.map(ha=>{var va;return(va=ha.outs)==null?void 0:va.filter(ya=>ya.toNodeId===Gt.id).map(ya=>({fromNodeId:ha.id,fromOutId:ya.outId}))}).filter(Boolean).flat());if(!la||la.length===0||!ca||ca.length===0)return 0;const qe=document.querySelector(`[data-writer-id="${la[0].fromNodeId}"] [data-writer-socket-id="${la[0].fromOutId}"]`),Y=document.querySelector(`[data-writer-id="${ca[0].fromNodeId}"] [data-writer-socket-id="${ca[0].fromOutId}"]`);if(!qe||!Y)return 0;const Fe=qe.getBoundingClientRect(),at=Y.getBoundingClientRect();return Fe.y>at.y?-1:1}},Re=ct(),{columnDimensions:Ve,nodeDimensions:Ge}=q(Re),dt=Math.max(...Array.from(Ve.values()).map(At=>At.height)),rt={};let Mt=Ue/2;for(let At=0;At<Re.size;At++){const Yt=Array.from(Re.get(At)).sort(Le[fe]),{width:la,height:ca}=Ve.get(At);let qe=tc((dt-ca)/2+Te,xa);Yt.forEach(Y=>{const Fe=Im({x:Mt,y:qe},xa);rt[Y.id]=Fe,qe+=Ge.get(Y.id).height+Te}),Mt+=tc(la+Ue,xa)}T(rt)}function _e(fe,Le){Se();const Ve=document.querySelector(`[data-writer-id="${Le}"]`).getBoundingClientRect(),Ge=(fe.pageX-Ve.x)*pe.value,dt=(fe.pageY-Ve.y)*pe.value;C.value={nodeId:Le,offset:{x:Ge,y:dt},isPerfected:!1}}function Ae(fe,Le){k.value={fromNodeId:fe,fromOutId:Le}}const pe=H(()=>1/J.value);function ce(fe){const Le=u.value.getBoundingClientRect(),Re=F.value.x+(fe.pageX-Le.x)*(1/J.value),Ve=F.value.y+(fe.pageY-Le.y)*(1/J.value);return{x:Re,y:Ve}}function ue(fe){fe.preventDefault(),fe.stopPropagation();const Le=O(fe);if(!Le)return;const{draggedType:Re,draggedId:Ve,sourceBlueprintId:Ge}=Le;if(Ve)return;const{x:dt,y:rt}=ce(fe);if(dt<0||rt<0)return;ht(Re,{x:dt,y:rt},Ge?{sourceBlueprintId:Ge}:void 0)}function I(fe,Le){if(te.value==Le){te.value=null;return}fe.stopPropagation(),te.value=Le,r.setSelection(null)}async function B(fe){if(!fe.toNodeId)return;const Le={outId:fe.fromOutId,toNodeId:fe.toNodeId};G(fe.fromNodeId,Le)}function N(fe,Le,Re,Ve){var ca;let Ge,dt,rt,Mt;const At=(ca=u.value)==null?void 0:ca.getBoundingClientRect();if(!At)return;rt=((Re==null?void 0:Re.x)-At.x)*pe.value,Mt=((Re==null?void 0:Re.y)-At.y)*pe.value;const Yt=document.querySelector(`[data-writer-id="${fe}"] [data-writer-socket-id="${Le}"]`);if(!Yt)return;const la=Yt.getBoundingClientRect();if(Ge=(la.x-At.x+la.width/2)*pe.value,dt=(la.y-At.y+la.height/2)*pe.value,!!Yt){if(typeof Ve<"u"){const Y=document.querySelector(`[data-writer-id="${Ve}"]`).getBoundingClientRect();rt=(Y.x-At.x)*pe.value,Mt=(Y.y-At.y+Y.height/2)*pe.value}return{x1:Ge,y1:dt,x2:rt,y2:Mt,color:getComputedStyle(Yt).outlineColor,fromNodeId:fe,fromOutId:Le,toNodeId:Ve}}}function U(fe){const Re=fe.target.closest(".BlueprintsBlueprint [data-writer-id]");return Re==null?void 0:Re.dataset.writerId}function se(fe){let Le,Re;Re=U(fe),typeof Re>"u"&&(Le={x:fe.pageX,y:fe.pageY});const{fromNodeId:Ve,fromOutId:Ge}=k.value;Re!=Ve&&(k.value={...k.value,liveArrow:N(Ve,Ge,Le,Re)})}function Se(){P.value=null,k.value=null,C.value=null}function Ne(fe){const Le=Object.entries(fe).filter(([Re,Ve])=>{const Ge=n.getComponentById(Re);return(Ge==null?void 0:Ge.x)!==Ve.x||(Ge==null?void 0:Ge.y)!==Ve.y}).reduce((Re,[Ve,Ge])=>{const dt=Im(Ge,xa),rt=D(Ve),Mt={...rt,...dt},At=Ze.value.filter(ca=>ca.id!==Ve).map(ca=>D(ca.id)).filter(Boolean),{x:Yt,y:la}=Pm(Mt,At,xa);return(rt.x!==Yt||rt.y!==la)&&(Re[Ve]={x:Yt,y:la}),Re},{});Object.keys(Le).length!==0&&T(Le)}function ut(){Ne(oe.value),oe.value={}}function ie(fe){const{nodeId:Le,offset:Re}=C.value,{x:Ve,y:Ge}=ce(fe),dt=Math.max(Math.floor(Ve-Re.x),0),rt=Math.max(Math.floor(Ge-Re.y),0),Mt=n.getComponentById(Le);Qg({x:Mt.x,y:Mt.y},{x:dt,y:rt})>10&&(C.value={...C.value,isPerfected:!0});const Yt={x:dt-Mt.x,y:rt-Mt.y};if(!r.selection.value.some(qe=>qe.componentId===Le)){oe.value={...oe.value,[Le]:{x:dt,y:rt}};return}const ca=r.selection.value.map(qe=>n.getComponentById(qe.componentId)).filter(qe=>qe.id!==Le&&qe.x!==void 0&&qe.y!==void 0).reduce((qe,Y)=>(qe[Y.id]=Bc({x:Y.x,y:Y.y},Yt),qe),{});oe.value={...oe.value,...ca,[Le]:{x:dt,y:rt}}}function Ee(fe){const Le=u.value.getBoundingClientRect(),Re=fe.pageX-Le.x,Ve=fe.pageY-Le.y,{x:Ge,y:dt}=P.value.offset;P.value={isPerfected:!0,offset:{x:Re,y:Ve}},kn(F.value.x+(Ge-Re)*1*pe.value,F.value.y+(dt-Ve)*1*pe.value)}function Oe(){return f.value.isSelecting}function Pe(fe){if(v(fe),!Oe()&&fe.buttons==1){if(k.value){se(fe);return}if(C.value){ie(fe);return}if(P.value&&!Oe()){Ee(fe);return}}}function Ke(fe){if(Oe()||(Se(),fe.buttons!=1))return;const Le=u.value.getBoundingClientRect(),Re=fe.pageX-Le.x,Ve=fe.pageY-Le.y;P.value={offset:{x:Re,y:Ve},isPerfected:!1}}async function it(fe){C.value&&ut();const Le=k.value;if(Se(),Le===null)return;const Re=U(fe);if(!Re)return;const{fromNodeId:Ve,fromOutId:Ge}=Le;Ve!=Re&&K(Le.fromNodeId,{toNodeId:Re,outId:Ge})}function ht(fe,Le,Re){const Ve=Ze.value.map(Mt=>D(Mt.id)).filter(Boolean),{x:Ge,y:dt}=Pm({...Le,width:240,height:180},Ve,xa),rt=Object.keys(Re??{}).length>0?{x:Ge,y:dt,content:Re}:{x:Ge,y:dt};j(fe,i,void 0,rt)}function Ft(fe){var rt;const Le=wt(fe),Re=(rt=u.value)==null?void 0:rt.getBoundingClientRect();if(!Le||!Re)return;const{width:Ve,height:Ge}=Le,dt=n.getComponentById(fe);dt&&kn(dt.x-Re.width/2+Ve/2,dt.y-Re.height/2+Ge/2)}function ma(fe){kn(fe.x,fe.y)}function Wt(fe){const Le=Ze.value.map(Ge=>({id:Ge.id,type:Ge.type,content:Ge.content,outs:Ge.outs})),Re=JSON.stringify(Le),Ve=`
8516
+ - Draft a new article with updates based on the target keywords`,style:{height:"100%"}},null,8,["modelValue"])],2))]),_:1},8,["is-busy","class"]),Z("div",Dce,[Z("p",Bce,je(c.value),1),Z("div",Fce,[i.value?($(),Ie(La,{key:0,variant:"tertiary",onClick:g},{default:Xe(()=>b[1]||(b[1]=[pa(" Back ")])),_:1})):ge("",!0),Ce(La,{variant:"tertiary",onClick:h},{default:Xe(()=>b[2]||(b[2]=[pa(" Skip ")])),_:1}),Ce(La,{variant:"secondary",disabled:i.value,onClick:m},{default:Xe(()=>[Ce(_t,{name:"sparkles"}),pa(" "+je(i.value?"Autogenerating...":"Autogenerate agent"),1)]),_:1},8,["disabled"])])])]))}}),Uce=ke(jce,[["__scopeId","data-v-50d9936c"]]),zce=["data-writer-unselectable"],qce={class:"BlueprintsBlueprint__svg"},Wce=["x","y"],Zce=["cx","cy","fill"],Kce={key:0,width:"100%",height:"100%",fill:"url(#grid)",fil:""},{log:Gce}=fa(),xa=24,Jce="A container component representing a single blueprint within the application.",Xce={writer:{name:"Blueprint",toolkit:"blueprints",category:"Root",description:Jce,allowedChildrenTypes:["*"],allowedParentTypes:["blueprints_root"],fields:{key:{name:"Blueprint key",desc:"Unique identifier. It's needed to enable navigation to this Blueprint.",type:Q.IdKey,validator:WE}}}},bo={minLevel:.2,maxLevel:1,step:.25,initialLevel:1},Yce=$e({...Xce,__name:"BlueprintsBlueprint",setup(e){ji(fe=>({"3cf15168":J.value}));const t=sr({loader:()=>zt(()=>import("./BlueprintToolbar-BMXwGb2u.js"),__vite__mapDeps([11,12,13]),import.meta.url),loadingComponentProps:{width:"250px",height:"40px"}}),a=sr({loader:()=>zt(()=>import("./BuilderSettingsDeploySharedBlueprint-CCOpcUFl.js"),__vite__mapDeps([14,15,16,17]),import.meta.url)}),n=re(ne.core),r=re(ne.builderManager),o=re(ne.notesManager),s=re(ne.renderProxiedComponent),i=re(ne.componentId),l=re(ne.isAutogenModalShown,ye(!1));function c(){l.value=!0}const d=ye(!1),u=pt("rootEl"),h=pt("nodeContainerEl"),{selectionRect:f,isCursorSelecting:m,isHoveringSelectableArea:g,justCompletedDragSelection:_,handleMousedown:b,handleMousemove:v,handleMouseup:y,handleMouseleave:M,handleDocumentMouseup:x,handleDocumentClick:S}=sce({wrapperRef:h,builderManager:r,isAnnotating:o.isAnnotating}),L=$t([]),F=$t({x:0,y:0}),te=$t(null),J=ye(bo.initialLevel),be=new MutationObserver(ve),oe=$t({}),Te=xa*4,Ue=xa*6,Ze=H(()=>n.getComponents(i,{sortedByPosition:!0}).filter(fe=>fe.type!=="note")),Me=H(()=>Array.from(o.getNotes(i))),ee=Hd(n),{createAndInsertComponent:j,addOut:K,removeOut:G,changeCoordinatesMultiple:T}=Bs(n,r,ee),{getComponentInfoFromDrag:O}=J2e(n),k=$t(null),C=$t(null),P=$t(null),ae=xe();function xe(){const fe="blueprint__hideGrid",Le=ye(localStorage.getItem(fe)===null);return We(Le,Re=>Re?localStorage.removeItem(fe):localStorage.setItem(fe,"1")),Le}function ve(){L.value=Ze.value.reduce((fe,Le)=>{var Re;if(!((Re=Le.outs)!=null&&Re.length))return fe;for(const Ve of Le.outs){const Ge=N(Le.id,Ve.outId,void 0,Ve.toNodeId);Ge&&fe.push(Ge)}return fe},[])}const ze=H(()=>{var fe,Le;return k.value===null&&!((fe=C.value)!=null&&fe.isPerfected)&&!((Le=P.value)!=null&&Le.isPerfected)?null:!0});function Ye(fe){if(_.value){fe.preventDefault(),fe.stopPropagation();return}if(te.value=null,fe.target instanceof Element&&!fe.target.closest("[data-writer-unselectable]")&&o.isAnnotating.value){const{x:Le,y:Re}=ce(fe);o.createNote(i,{x:Le,y:Re})}}function ct(){const fe=new Map;function Le(Ve,Ge){var Mt;if(fe.values().find(At=>At.has(Ve)))return;fe.has(Ge)||fe.set(Ge,new Set),fe.get(Ge).add(Ve),(Mt=Ve.outs)==null||Mt.forEach(At=>{const Yt=n.getComponentById(At.toNodeId);Le(Yt,Ge+1)})}const Re=new Map;return Ze.value.forEach(Ve=>{var Ge;(Ge=Ve.outs)==null||Ge.forEach(dt=>{Re.has(dt.toNodeId)||Re.set(dt.toNodeId,new Set),Re.get(dt.toNodeId).add(Ve.id)})}),Ze.value.filter(Ve=>!Re.has(Ve.id)).forEach(Ve=>{Le(Ve,0)}),fe}function wt(fe){const Le=`[data-writer-id="${fe}"]`,Re=h.value.querySelector(Le);if(Re)return Re.getBoundingClientRect()}function D(fe){var Ge;const Le=wt(fe);if(!Le)return;const Re=(Ge=u.value)==null?void 0:Ge.getBoundingClientRect();if(!Re)return;const Ve=dt=>{const rt=tc(dt,xa);return rt===dt?rt+1:rt-1};return{x:F.value.x+(Le.x-Re.x)*pe.value,y:F.value.y+(Le.y-Re.y)*pe.value,width:Ve(Le.width*pe.value),height:Ve(Le.height*pe.value)}}function q(fe){const Le=new Map,Re=new Map;return fe.forEach((Ve,Ge)=>{let dt=0,rt=0;Ve.forEach(Mt=>{const At=wt(Mt.id);At&&(Re.set(Mt.id,{height:At.height*pe.value}),dt+=At.height*pe.value+Te,rt=Math.max(rt,At.width*pe.value))}),Le.set(Ge,{height:dt-Te,width:rt})}),{columnDimensions:Le,nodeDimensions:Re}}function he(){me("currentY")}function me(fe){const Le={currentY:(At,Yt)=>At.y>Yt.y?1:-1,socketPosition:(At,Yt)=>{const[la,ca]=[At,Yt].map(Gt=>Ze.value.map(ha=>{var va;return(va=ha.outs)==null?void 0:va.filter(ya=>ya.toNodeId===Gt.id).map(ya=>({fromNodeId:ha.id,fromOutId:ya.outId}))}).filter(Boolean).flat());if(!la||la.length===0||!ca||ca.length===0)return 0;const qe=document.querySelector(`[data-writer-id="${la[0].fromNodeId}"] [data-writer-socket-id="${la[0].fromOutId}"]`),Y=document.querySelector(`[data-writer-id="${ca[0].fromNodeId}"] [data-writer-socket-id="${ca[0].fromOutId}"]`);if(!qe||!Y)return 0;const Fe=qe.getBoundingClientRect(),at=Y.getBoundingClientRect();return Fe.y>at.y?-1:1}},Re=ct(),{columnDimensions:Ve,nodeDimensions:Ge}=q(Re),dt=Math.max(...Array.from(Ve.values()).map(At=>At.height)),rt={};let Mt=Ue/2;for(let At=0;At<Re.size;At++){const Yt=Array.from(Re.get(At)).sort(Le[fe]),{width:la,height:ca}=Ve.get(At);let qe=tc((dt-ca)/2+Te,xa);Yt.forEach(Y=>{const Fe=Im({x:Mt,y:qe},xa);rt[Y.id]=Fe,qe+=Ge.get(Y.id).height+Te}),Mt+=tc(la+Ue,xa)}T(rt)}function _e(fe,Le){Se();const Ve=document.querySelector(`[data-writer-id="${Le}"]`).getBoundingClientRect(),Ge=(fe.pageX-Ve.x)*pe.value,dt=(fe.pageY-Ve.y)*pe.value;C.value={nodeId:Le,offset:{x:Ge,y:dt},isPerfected:!1}}function Ae(fe,Le){k.value={fromNodeId:fe,fromOutId:Le}}const pe=H(()=>1/J.value);function ce(fe){const Le=u.value.getBoundingClientRect(),Re=F.value.x+(fe.pageX-Le.x)*(1/J.value),Ve=F.value.y+(fe.pageY-Le.y)*(1/J.value);return{x:Re,y:Ve}}function ue(fe){fe.preventDefault(),fe.stopPropagation();const Le=O(fe);if(!Le)return;const{draggedType:Re,draggedId:Ve,sourceBlueprintId:Ge}=Le;if(Ve)return;const{x:dt,y:rt}=ce(fe);if(dt<0||rt<0)return;ht(Re,{x:dt,y:rt},Ge?{sourceBlueprintId:Ge}:void 0)}function I(fe,Le){if(te.value==Le){te.value=null;return}fe.stopPropagation(),te.value=Le,r.setSelection(null)}async function B(fe){if(!fe.toNodeId)return;const Le={outId:fe.fromOutId,toNodeId:fe.toNodeId};G(fe.fromNodeId,Le)}function N(fe,Le,Re,Ve){var ca;let Ge,dt,rt,Mt;const At=(ca=u.value)==null?void 0:ca.getBoundingClientRect();if(!At)return;rt=((Re==null?void 0:Re.x)-At.x)*pe.value,Mt=((Re==null?void 0:Re.y)-At.y)*pe.value;const Yt=document.querySelector(`[data-writer-id="${fe}"] [data-writer-socket-id="${Le}"]`);if(!Yt)return;const la=Yt.getBoundingClientRect();if(Ge=(la.x-At.x+la.width/2)*pe.value,dt=(la.y-At.y+la.height/2)*pe.value,!!Yt){if(typeof Ve<"u"){const Y=document.querySelector(`[data-writer-id="${Ve}"]`).getBoundingClientRect();rt=(Y.x-At.x)*pe.value,Mt=(Y.y-At.y+Y.height/2)*pe.value}return{x1:Ge,y1:dt,x2:rt,y2:Mt,color:getComputedStyle(Yt).outlineColor,fromNodeId:fe,fromOutId:Le,toNodeId:Ve}}}function U(fe){const Re=fe.target.closest(".BlueprintsBlueprint [data-writer-id]");return Re==null?void 0:Re.dataset.writerId}function se(fe){let Le,Re;Re=U(fe),typeof Re>"u"&&(Le={x:fe.pageX,y:fe.pageY});const{fromNodeId:Ve,fromOutId:Ge}=k.value;Re!=Ve&&(k.value={...k.value,liveArrow:N(Ve,Ge,Le,Re)})}function Se(){P.value=null,k.value=null,C.value=null}function Ne(fe){const Le=Object.entries(fe).filter(([Re,Ve])=>{const Ge=n.getComponentById(Re);return(Ge==null?void 0:Ge.x)!==Ve.x||(Ge==null?void 0:Ge.y)!==Ve.y}).reduce((Re,[Ve,Ge])=>{const dt=Im(Ge,xa),rt=D(Ve),Mt={...rt,...dt},At=Ze.value.filter(ca=>ca.id!==Ve).map(ca=>D(ca.id)).filter(Boolean),{x:Yt,y:la}=Pm(Mt,At,xa);return(rt.x!==Yt||rt.y!==la)&&(Re[Ve]={x:Yt,y:la}),Re},{});Object.keys(Le).length!==0&&T(Le)}function ut(){Ne(oe.value),oe.value={}}function ie(fe){const{nodeId:Le,offset:Re}=C.value,{x:Ve,y:Ge}=ce(fe),dt=Math.max(Math.floor(Ve-Re.x),0),rt=Math.max(Math.floor(Ge-Re.y),0),Mt=n.getComponentById(Le);Qg({x:Mt.x,y:Mt.y},{x:dt,y:rt})>10&&(C.value={...C.value,isPerfected:!0});const Yt={x:dt-Mt.x,y:rt-Mt.y};if(!r.selection.value.some(qe=>qe.componentId===Le)){oe.value={...oe.value,[Le]:{x:dt,y:rt}};return}const ca=r.selection.value.map(qe=>n.getComponentById(qe.componentId)).filter(qe=>qe.id!==Le&&qe.x!==void 0&&qe.y!==void 0).reduce((qe,Y)=>(qe[Y.id]=Bc({x:Y.x,y:Y.y},Yt),qe),{});oe.value={...oe.value,...ca,[Le]:{x:dt,y:rt}}}function Ee(fe){const Le=u.value.getBoundingClientRect(),Re=fe.pageX-Le.x,Ve=fe.pageY-Le.y,{x:Ge,y:dt}=P.value.offset;P.value={isPerfected:!0,offset:{x:Re,y:Ve}},kn(F.value.x+(Ge-Re)*1*pe.value,F.value.y+(dt-Ve)*1*pe.value)}function Oe(){return f.value.isSelecting}function Pe(fe){if(v(fe),!Oe()&&fe.buttons==1){if(k.value){se(fe);return}if(C.value){ie(fe);return}if(P.value&&!Oe()){Ee(fe);return}}}function Ke(fe){if(Oe()||(Se(),fe.buttons!=1))return;const Le=u.value.getBoundingClientRect(),Re=fe.pageX-Le.x,Ve=fe.pageY-Le.y;P.value={offset:{x:Re,y:Ve},isPerfected:!1}}async function it(fe){C.value&&ut();const Le=k.value;if(Se(),Le===null)return;const Re=U(fe);if(!Re)return;const{fromNodeId:Ve,fromOutId:Ge}=Le;Ve!=Re&&K(Le.fromNodeId,{toNodeId:Re,outId:Ge})}function ht(fe,Le,Re){const Ve=Ze.value.map(Mt=>D(Mt.id)).filter(Boolean),{x:Ge,y:dt}=Pm({...Le,width:240,height:180},Ve,xa),rt=Object.keys(Re??{}).length>0?{x:Ge,y:dt,content:Re}:{x:Ge,y:dt};j(fe,i,void 0,rt)}function Ft(fe){var rt;const Le=wt(fe),Re=(rt=u.value)==null?void 0:rt.getBoundingClientRect();if(!Le||!Re)return;const{width:Ve,height:Ge}=Le,dt=n.getComponentById(fe);dt&&kn(dt.x-Re.width/2+Ve/2,dt.y-Re.height/2+Ge/2)}function ma(fe){kn(fe.x,fe.y)}function Wt(fe){const Le=Ze.value.map(Ge=>({id:Ge.id,type:Ge.type,content:Ge.content,outs:Ge.outs})),Re=JSON.stringify(Le),Ve=`
8517
8517
  <example>
8518
8518
  <description>
8519
8519
  ${fe}
@@ -8521,5 +8521,5 @@ example:
8521
8521
  <blueprint>
8522
8522
  ${Re}
8523
8523
  </blueprint>
8524
- </example>`.trim();Gce(Ve)}function ln(fe){J.value=Math.max(Math.min(bo.maxLevel,fe),bo.minLevel)}function Pr(fe){ln(fe)}function kn(fe,Le){F.value={x:Math.max(0,fe),y:Math.max(0,Le)}}function lo(fe){kn(F.value.x+fe.deltaX*pe.value,F.value.y+fe.deltaY*pe.value)}function Ro(fe){const Le=.006666666666666667,Re=u.value.getBoundingClientRect(),Ve=J.value;J.value=Math.min(Math.max(J.value-fe.deltaY*Le,bo.minLevel),bo.maxLevel);const Ge={w:Re.width*(1/Ve)*pe.value*(J.value-Ve),h:Re.height*(1/Ve)*pe.value*(J.value-Ve)},dt={x:(fe.pageX-Re.x)/Re.width,y:(fe.pageY-Re.y)/Re.height};kn(F.value.x+Ge.w*dt.x,F.value.y+Ge.h*dt.y)}async function No(fe){if(fe.preventDefault(),!fe.ctrlKey&&!Fc(fe)){lo(fe);return}Ro(fe)}async function Do(){const{width:Le,height:Re,x:Ve,y:Ge}=u.value.getBoundingClientRect(),dt=h.value.querySelectorAll("[data-writer-id]"),{maxX:rt,maxY:Mt}=Array.from(dt).reduce((Yt,la)=>{const ca=la.getBoundingClientRect();return{maxY:Math.max(Yt.maxY,(ca.bottom-Ge)*pe.value+F.value.y),maxX:Math.max(Yt.maxX,(ca.right-Ve)*pe.value+F.value.x)}},{maxY:0,maxX:0}),At=Math.min((Le-48)/rt,(Re-48)/Mt);ln(At),kn(0,0)}async function Bo(fe){if(l.value=!1,!fe)return;const{components:Le}=fe;Le.forEach(Re=>{j(Re.type,i,void 0,Re)}),await qa(),me("socketPosition")}We(r.firstSelectedItem,fe=>{fe&&(te.value=null,n.isChildOf(i,fe.componentId)&&fe.source!=="click"&&Ft(fe.componentId))});function Fo(fe){if(Fc(fe)&&(fe.code==="Backquote"||fe.code==="Backslash")){ae.value=!ae.value;return}if(!r.selection.value.length)return;const Re=fe.target;if(Re.tagName==="INPUT"||Re.tagName==="TEXTAREA"||Re.getAttribute("contenteditable")==="true")return;function Ve(){switch(fe.key){case"ArrowDown":return{x:0,y:xa};case"ArrowUp":return{x:0,y:-xa};case"ArrowLeft":return{x:-xa,y:0};case"ArrowRight":return{x:xa,y:0}}}const Ge=Ve();if(Ge===void 0)return;fe.preventDefault();const dt=r.selection.value.map(rt=>n.getComponentById(rt.componentId)).filter(rt=>(rt==null?void 0:rt.x)!==void 0&&(rt==null?void 0:rt.y)!==void 0).reduce((rt,Mt)=>(rt[Mt.id]=Bc({x:Mt.x,y:Mt.y},Ge),rt),{});Ne(dt)}const ur=Ki();return ia(async()=>{var fe;await Do(),await qa(),ve(),(fe=u.value)==null||fe.addEventListener("wheel",No,{signal:ur.signal}),document.addEventListener("keydown",Fo,{signal:ur.signal}),document.addEventListener("mouseup",x,{signal:ur.signal}),document.addEventListener("click",S,{signal:ur.signal,capture:!0}),be.observe(h.value,{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0,characterData:!0}),window.createAutogenExample=Wt}),Wn(()=>{ur.abort(),be.disconnect()}),(fe,Le)=>{var Re;return $(),R("div",{ref_key:"rootEl",ref:u,class:ft(["BlueprintsBlueprint",{isSelecting:E(m),canSelect:E(g)&&!E(m)}]),"data-writer-unselectable":ze.value,onClick:Ye,onDragover:Le[6]||(Le[6]=sn(()=>{},["prevent","stop"])),onDrop:ue,onMousemove:Pe,onMousedown:Ke,onMouseup:it},[Z("div",{ref_key:"nodeContainerEl",ref:h,class:"nodeContainer",onMousedown:Le[0]||(Le[0]=(...Ve)=>E(b)&&E(b)(...Ve)),onMousemove:Le[1]||(Le[1]=(...Ve)=>E(v)&&E(v)(...Ve)),onMouseup:Le[2]||(Le[2]=(...Ve)=>E(y)&&E(y)(...Ve)),onMouseleave:Le[3]||(Le[3]=(...Ve)=>E(M)&&E(M)(...Ve))},[($(),R("svg",qce,[Z("defs",null,[Z("pattern",{id:"grid",width:xa,height:xa,patternUnits:"userSpaceOnUse",x:-F.value.x-xa/2,y:-F.value.y-xa/2},[Z("circle",{cx:xa/2,cy:xa/2,r:"1",fill:E(Ht).Gray3},null,8,Zce)],8,Wce)]),E(ae)?($(),R("rect",Kce)):ge("",!0),($(!0),R(Je,null,Ot(L.value,(Ve,Ge)=>($(),Ie(Vm,{key:Ge,arrow:Ve,"is-selected":te.value==Ge,"is-engaged":te.value==Ge||E(r).isComponentIdSelected(Ve.fromNodeId)||E(r).isComponentIdSelected(Ve.toNodeId),onClick:dt=>I(dt,Ge),onDelete:dt=>B(Ve)},null,8,["arrow","is-selected","is-engaged","onClick","onDelete"]))),128)),(Re=k.value)!=null&&Re.liveArrow?($(),Ie(Vm,{key:"liveArrow",arrow:k.value.liveArrow,"is-selected":!1,"is-engaged":!0},null,8,["arrow"])):ge("",!0)])),($(!0),R(Je,null,Ot(Ze.value,Ve=>{var Ge,dt,rt,Mt,At,Yt,la,ca;return $(),Ie(Ts(E(s)(Ve.id,0)),{key:Ve.id,style:bt({top:`${(((dt=(Ge=oe.value)==null?void 0:Ge[Ve.id])==null?void 0:dt.y)??Ve.y)-F.value.y}px`,left:`${(((Mt=(rt=oe.value)==null?void 0:rt[Ve.id])==null?void 0:Mt.x)??Ve.x)-F.value.x}px`,"border-color":((Yt=(At=k.value)==null?void 0:At.liveArrow)==null?void 0:Yt.toNodeId)==Ve.id?(ca=(la=k.value)==null?void 0:la.liveArrow)==null?void 0:ca.color:void 0}),onMousedown:sn(qe=>_e(qe,Ve.id),["stop"]),onOutMousedown:qe=>Ae(Ve.id,qe)},null,40,["style","onMousedown","onOutMousedown"])}),128)),($(!0),R(Je,null,Ot(Me.value,Ve=>{var Ge,dt,rt,Mt;return $(),Ie(oce,{key:Ve.id,"component-id":Ve.id,style:bt({top:`${(((dt=(Ge=oe.value)==null?void 0:Ge[Ve.id])==null?void 0:dt.y)??Ve.y)-F.value.y}px`,left:`${(((Mt=(rt=oe.value)==null?void 0:rt[Ve.id])==null?void 0:Mt.x)??Ve.x)-F.value.x}px`})},null,8,["component-id","style"])}),128)),E(f).isSelecting?($(),R("div",{key:0,class:"selectionRectangle",style:bt({left:`${E(f).left}px`,top:`${E(f).top}px`,width:`${E(f).width}px`,height:`${E(f).height}px`})},null,4)):ge("",!0)],544),Ce(E(t),{class:"blueprintsToolbar",onAutogenClick:c,onDeploy:Le[4]||(Le[4]=Ve=>d.value=!0)}),E(l)?($(),Ie(Sg,{key:0},{default:Xe(()=>[Ce(Uce,{onBlockGeneration:Bo})]),_:1})):ge("",!0),Ce(E(a),{modelValue:d.value,"onUpdate:modelValue":Le[5]||(Le[5]=Ve=>d.value=Ve),"blueprint-id":E(i)},null,8,["modelValue","blueprint-id"]),E(h)?($(),Ie(bce,{key:1,"node-container-el":E(h),"render-offset":F.value,"zoom-level":J.value,class:"navigator",onAutoArrange:he,onChangeRenderOffset:ma,onChangeZoomLevel:Pr,onResetZoom:Do},null,8,["node-container-el","render-offset","zoom-level"])):ge("",!0)],42,zce)}}}),Qce=ke(Yce,[["__scopeId","data-v-d8dd8762"]]);function e0e(e,t){const a=(t==null?void 0:t.wf)??re(ne.core),n=(t==null?void 0:t.ssbm)??re(ne.builderManager);if(!a)throw new Error("Missing core injection.");if(!n)throw new Error("Missing builderManager injection.");const r=fa(),o=H(()=>a.getComponentById(Pa(e.componentId)));We(o,h=>{h||r.error(`useComponentFieldViewModel: component with id "${Pa(e.componentId)}" not found`)},{immediate:!0});const s=H(()=>{var m,g,_;const h=Pa(e.defaultValue);if(typeof h=="string")return h;const f=a.getComponentDefinition((m=o.value)==null?void 0:m.type);return((_=(g=f==null?void 0:f.fields)==null?void 0:g[Pa(e.fieldKey)])==null?void 0:_.default)??""}),{setContentValue:i}=Bs(a,n);function l(h){o.value&&i(o.value.id,Pa(e.fieldKey),h)}const c=ye(!1);We([()=>Pa(e.componentId),()=>Pa(e.fieldKey)],()=>{c.value=!1});const d=H(()=>{var f,m;const h=(m=(f=o.value)==null?void 0:f.content)==null?void 0:m[Pa(e.fieldKey)];return c.value&&typeof h=="string"?h:h||s.value});return H({get:()=>d.value,set:h=>{c.value=!0,l(h)}})}const t0e={class:"alias"},a0e=["contenteditable"],n0e=$e({__name:"BlueprintsNodeNamer",props:{componentId:{},blockName:{}},setup(e){const a=e0e({componentId:mn(e,"componentId"),fieldKey:"alias"}),n=H(()=>!!a.value),r=pt("aliasEditorEl"),o=ye(!1);async function s(){if(o.value)return;o.value=!0,await qa();const c=r.value;c.focus();const d=document.createRange(),u=window.getSelection();d.setStart(c,c.childNodes.length),d.collapse(!0),u.removeAllRanges(),u.addRange(d)}function i(){const c=r.value.textContent;r.value.blur(),o.value=!1,a.value=c}function l(c){o.value&&c.stopPropagation()}return(c,d)=>($(),R("div",{class:ft(["BlueprintsNodeNamer",{beingEdited:o.value,hasEyebrow:n.value||o.value}]),"data-writer-unselectable":"true"},[Z("div",{class:"blockName",onClick:s},je(c.blockName),1),Z("div",t0e,[n.value||o.value?($(),R("div",{key:0,ref_key:"aliasEditorEl",ref:r,class:"aliasEditor",contenteditable:o.value,"data-writer-unselectable":"true",onClick:s,onMousemove:l,onBlur:i,onKeydown:Sr(i,["enter"])},je(E(a)),41,a0e)):ge("",!0)])],2))}}),r0e=ke(n0e,[["__scopeId","data-v-ac3126a4"]]);function e8(e,t){const a=H(()=>{const r=E(t);if(r)return e.getComponentById(r)}),n=H(()=>{var o;const r=(o=a.value)==null?void 0:o.type;if(r)return e.getComponentDefinition(r)});return{component:a,definition:n}}function o0e(e,t){return H(()=>{var s;const{type:a,id:n}=E(e)??{},r=(s=E(t))==null?void 0:s.outs;return a&&!Pd.has(a)&&a.startsWith("blueprints_")&&(r==null?void 0:r.success)!==void 0?`@{results.${n}}`:""})}const s0e=$e({__name:"SharedMoreDropdown",props:{options:{type:Array,default:()=>[]},triggerSize:{type:String,default:"smallIcon"},triggerVariant:{type:String,default:"neutral"},triggerCustomSize:{type:String,default:void 0},triggerIcon:{type:String,default:"ellipsis"},disabled:{type:Boolean},hideIcons:{type:Boolean,required:!1},dropdownPlacement:{type:String,required:!1,default:"bottom-end"},floatingMiddleware:{type:Array,required:!1,default:()=>[i6({allowedPlacements:["bottom-end","top-end"]})]}},emits:{select:e=>typeof e=="string"},setup(e,{emit:t}){const a=sr({loader:()=>zt(()=>import("./WdsDropdownMenu-BPKaOD8s.js").then(u=>u.b),__vite__mapDeps([4,5,6,7]),import.meta.url)}),n=e,r=t,o=ye(!1),s=pt("trigger"),i=pt("dropdown"),{floatingStyles:l}=c6(s,i,{placement:mn(n,"dropdownPlacement"),middleware:mn(n,"floatingMiddleware")}),c=b0(s);We(c,()=>{c.value||qa().then(()=>o.value=!1)},{immediate:!0});function d(u){o.value=!1,r("select",u)}return(u,h)=>($(),R("div",{ref_key:"trigger",ref:s,class:"SharedMoreDropdown"},[Ce(La,{variant:e.triggerVariant,size:e.triggerSize,disabled:e.disabled,"custom-size":e.triggerCustomSize,onClick:h[0]||(h[0]=sn(f=>o.value=!o.value,["stop"]))},{default:Xe(()=>[Ce(_t,{name:e.triggerIcon},null,8,["name"])]),_:1},8,["variant","size","disabled","custom-size"]),o.value?($(),Ie(E(a),{key:0,ref_key:"dropdown",ref:i,class:"SharedMoreDropdown__dropdown",options:e.options,style:bt(E(l)),"hide-icons":e.hideIcons,onSelect:d},null,8,["options","style","hide-icons"])):ge("",!0)],512))}}),t8=ke(s0e,[["__scopeId","data-v-df890e8f"]]),i0e=Object.freeze(Object.defineProperty({__proto__:null,default:t8},Symbol.toStringTag,{value:"Module"}));var ls=(e=>(e.Add="add",e.MoveUp="moveUp",e.MoveDown="moveDown",e.Cut="cut",e.Copy="copy",e.Paste="paste",e.GoToParent="goToParent",e.Delete="delete",e))(ls||{});function l0e(e){return typeof e=="string"&&Object.values(ls).includes(e)}function c0e(e,t,a,n={},r){const{moveComponentUp:o,moveComponentDown:s,cutComponent:i,pasteComponent:l,copyComponent:c,isAddAllowed:d,isCopyAllowed:u,isCutAllowed:h,isGoToParentAllowed:f,isPasteAllowed:m,isDeleteAllowed:g,getEnabledMoves:_,removeComponentsSubtree:b,goToParent:v}=Bs(e,t,a),y=Od(),M=H(()=>r?E(r).componentId:t.firstSelectedId.value),x=H(()=>r?E(r).instancePath:t.firstSelectedItem.value.instancePath),S=H(()=>{var Ze,Me;const oe=e.getComponentById(M.value);if(!oe)return{};const{up:Te,down:Ue}=_(M.value);return{isAddEnabled:d(M.value),componentTypeName:(Ze=e.getComponentDefinition(oe.type))==null?void 0:Ze.name,toolkit:(Me=e.getComponentDefinition(oe.type))==null?void 0:Me.toolkit,isMoveUpEnabled:Te,isMoveDownEnabled:Ue,isCopyEnabled:u(M.value),isCutEnabled:h(M.value),isGoToParentEnabled:f(M.value),isDeleteEnabled:g(M.value)}}),L=H(()=>t.firstSelectedId.value?m(t.firstSelectedId.value):!1);async function F(){try{await l(M.value)}catch(oe){y.pushToast({type:"error",message:String(oe)})}}function te(){if(!S.value.isDeleteEnabled)return;if(r){b(E(r).componentId);return}const oe=t.selection.value.map(Te=>Te.componentId);oe.length!==0&&b(...oe)}const J=H(()=>[{value:"add",label:"Add child",icon:"plus",disabled:!S.value.isAddEnabled},{value:"moveUp",label:"Move up",shortcut:`${Wr()}↑`,icon:"arrow-up",disabled:!S.value.isMoveUpEnabled},{value:"moveDown",label:"Move down",shortcut:`${Wr()}↓`,icon:"arrow-down",disabled:!S.value.isMoveDownEnabled},{value:"cut",label:"Cut",shortcut:`${Wr()}X`,icon:"scissors",disabled:!S.value.isCutEnabled},{value:"copy",label:"Copy",shortcut:`${Wr()}C`,icon:"clipboard",disabled:!S.value.isCopyEnabled},{value:"paste",label:"Paste",shortcut:`${Wr()}V`,icon:"clipboard-paste",disabled:!L.value},{value:"goToParent",label:"View parent",shortcut:`${Wr()}⇧↑`,icon:"list-tree",disabled:!S.value.isGoToParentEnabled},{value:"delete",label:"Delete",shortcut:Vd()?"⌫":"Del",icon:"trash-2",variant:"danger",disabled:!S.value.isDeleteEnabled}]);function be(oe){var Te;switch(oe){case"add":break;case"moveUp":o(M.value);break;case"moveDown":s(M.value);break;case"cut":i(M.value);break;case"copy":c(M.value);break;case"paste":F();break;case"goToParent":v(M.value,x.value);break;case"delete":te();break}(Te=n[oe])==null||Te.call(n)}return{dropdownOptions:J,handleDropdownSelect:be}}function a8(e){return e.map(t=>`${t.componentId}:${t.instanceNumber}`).join(",")}function Fde(e){return e?e.split(",").map(t=>{const[a,n]=t.split(":");return{componentId:a,instanceNumber:Number(n)}}):[]}const d0e={class:"BlueprintsNodeActions"},u0e=$e({__name:"BlueprintsNodeActions",props:{showDisplayErrorOption:{type:Boolean}},emits:{showError:()=>!0},setup(e,{emit:t}){const a=re(ne.core),n=re(ne.builderManager),r=re(ne.componentId),o=re(ne.instancePath),s=e,i=t,{component:l,definition:c}=e8(a,r),d=o0e(l,c),u=Hd(a),{copy:h,copied:f}=Lg();function m(){h(d.value)}const g=c0e(a,n,u,{},{instancePath:a8(o),componentId:r});function _(y){switch(l0e(y)&&g.handleDropdownSelect(y),y){case"showError":i("showError");break}}const b=new Set([ls.Add,ls.MoveUp,ls.MoveDown,ls.Paste]),v=H(()=>{const y=g.dropdownOptions.value.filter(M=>!b.has(M.value)).map(M=>(delete M.shortcut,M));return s.showDisplayErrorOption&&y.unshift({value:"showError",label:"Add error path",icon:"split"}),y});return(y,M)=>($(),R("div",d0e,[E(d)?($(),Ie(La,{key:0,size:"smallIcon",variant:"neutral","data-writer-tooltip-placement":"bottom","data-writer-unselectable":!0,"data-writer-tooltip":E(f)?"Copied!":"Copy result variable",onClick:sn(m,["prevent"])},{default:Xe(()=>[Ce(_t,{name:"at-sign"})]),_:1},8,["data-writer-tooltip"])):ge("",!0),Ce(t8,{"data-automation-action":"node-actions-dropdown",options:v.value,"data-writer-unselectable":!0,"trigger-custom-size":"32px","trigger-icon":"ellipsis-vertical",onSelect:_},null,8,["options"])]))}}),Rm=ke(u0e,[["__scopeId","data-v-ca70c7e7"]]),h0e={class:"BlueprintsNodeOutput"},p0e=["data-writer-socket-id"],f0e=$e({__name:"BlueprintsNodeOutput",props:{outId:{type:String,required:!0},out:{type:Object,required:!0},displayLabel:{type:Boolean}},emits:{click:()=>!0},setup(e){return(t,a)=>($(),R("div",h0e,[e.displayLabel?($(),R(Je,{key:0},[pa(je(e.out.name),1)],64)):ge("",!0),Z("div",{class:ft(["BlueprintsNodeOutput__ball",e.out.style]),"data-writer-socket-id":e.outId,"data-writer-unselectable":!0,onClickCapture:a[0]||(a[0]=sn(()=>{},["stop"])),onMousedownCapture:a[1]||(a[1]=sn(n=>t.$emit("click"),["stop"]))},null,42,p0e)]))}}),rc=ke(f0e,[["__scopeId","data-v-cbba3510"]]),m0e={class:"BlueprintsNodeLogs"},v0e=$e({__name:"BlueprintsNodeLogs",props:{count:{type:Number,required:!0},completionStyle:{type:String,required:!1,default:void 0}},emits:{click:()=>!0},setup(e){const t=e,a=H(()=>t.count===1?"1 output":`${t.count} outputs`);return(n,r)=>($(),R("div",m0e,[Z("button",{class:ft(["BlueprintsNodeLogs__btn",{"BlueprintsNodeLogs__btn--success":e.completionStyle=="success","BlueprintsNodeLogs__btn--skipped":e.completionStyle=="skipped","BlueprintsNodeLogs__btn--stopped":e.completionStyle=="stopped","BlueprintsNodeLogs__btn--error":e.completionStyle=="error"}]),"data-writer-unselectable":!0,type:"button",onClick:r[0]||(r[0]=o=>n.$emit("click"))},je(a.value),3)]))}}),g0e=ke(v0e,[["__scopeId","data-v-daf51f8d"]]);function jc(e){if(!e)return{};if(typeof e=="string")try{const t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}return typeof e=="object"?e:{}}function y0e(e,t){const a=H(()=>{var i;const r=Object.entries(((i=e.value)==null?void 0:i.fields)??{}).filter(([l,c])=>c.type===Q.Tools);if(r.length===0)return!1;const o=r.map(([l])=>{var c;return{fieldKey:l,tools:jc((c=t[l])==null?void 0:c.value)}});return o.some(({tools:l})=>Object.keys(l).length>0)?o.every(({tools:l})=>{const c=Object.keys(l);return c.length===0?!0:!c.some(d=>{var u;return((u=l[d])==null?void 0:u.type)==="function"})}):!1});function n(r){var i;const o=jc((i=t[r])==null?void 0:i.value),s=Object.keys(o);return s.length===0?!1:!s.some(l=>{var c;return((c=o[l])==null?void 0:c.type)==="function"})}return{hasOnlyNonFunctionTools:a,hasToolsButNoFunctionTools:n}}const M0e={key:0,class:"BlueprintsNode__main__outputs__output BlueprintsNode__main__outputs__empty"},_0e=$e({__name:"BlueprintsNodeTools",props:{fieldKey:{},fieldType:{},fieldValue:{},hasOutputs:{type:Boolean}},setup(e){const t=e,a=H(()=>t.fieldType!==Q.Tools?{}:jc(t.fieldValue)),n=H(()=>{if(t.fieldType!==Q.Tools)return!1;const l=Object.keys(a.value);return l.length===0?!1:!l.some(c=>{var d;return((d=a.value[c])==null?void 0:d.type)==="function"})});function r(l){return l!==null&&typeof l=="object"&&"type"in l&&l.type==="function"}const o=H(()=>Object.keys(a.value).filter(l=>!r(a.value[l]))),s=H(()=>o.value.length>0?o.value.join(", "):!t.hasOutputs&&n.value?"No outputs":"None configured."),i=H(()=>!t.hasOutputs||o.value.length>0);return(l,c)=>i.value?($(),R("div",M0e,je(s.value),1)):ge("",!0)}}),b0e=ke(_0e,[["__scopeId","data-v-09778394"]]);function n8(e,t){var r,o;if((t==null?void 0:t.type)!=="blueprints_shared")return null;const a=(r=t.content)==null?void 0:r.sourceBlueprintId;if(!a)return null;const n=e.getComponentById(a);return((o=n==null?void 0:n.content)==null?void 0:o.key)||null}function jde(e,t){const a=H(()=>e.getComponentDefinition(E(t).type)),n=H(()=>{var c;const s=E(t),{type:i,content:l}=s;return i=="html"&&(l!=null&&l.element)?l==null?void 0:l.element:i=="blueprints_blueprint"?(l==null?void 0:l.key)||"Blueprint":i=="blueprints_shared"?n8(e,s)||"Shared Blueprint":((c=a.value)==null?void 0:c.name)??`Unknown (${i})`}),r=H(()=>{var d,u;const s=(d=a.value)==null?void 0:d.previewField;if(!s)return;const i=(u=E(t).content)==null?void 0:u[s];let l;const c=70;return(i==null?void 0:i.length)>c?l=i.substring(0,c)+"...":l=i,l}),o=H(()=>{const s=E(t).type,i=a.value.category;return[`/components/${s}.svg`,`/components/category_${i}.svg`,s.startsWith("blueprints_")?`/components/blueprints_category_${i}.svg`:void 0].filter(Boolean).map(l=>Li(l))});return{name:n,previewText:r,possibleImageUrls:o}}const w0e={key:0,class:"BlueprintsNode__side"},x0e={class:"BlueprintsNode__extraBorder"},C0e={key:0,class:"runner"},A0e={class:"BlueprintsNode__main"},S0e={class:"BlueprintsNode__main__title"},$0e={key:0,class:"deprecationNotice"},E0e={key:0,class:"BlueprintsNode__main__outputs__title"},I0e={key:0,class:"BlueprintsNode__main__outputs__title"},k0e={key:1,class:"BlueprintsNode__main__footer"},T0e={writer:{name:"Node",description:"A Blueprints node.",toolkit:"blueprints",category:"Other",fields:{alias:{name:"Alias",type:Q.Text}},allowedParentTypes:["blueprints_blueprint"],previewField:"alias"}},P0e=$e({...T0e,__name:"BlueprintsNode",emits:["outMousedown","engaged"],setup(e,{emit:t}){const a=t,n=re(ne.core),r=re(ne.builderManager),{removeOut:o}=Bs(n,r),s=re(ne.componentId),i=re(ne.evaluatedFields),l=H(()=>{var K;return((K=h==null?void 0:h.value)==null?void 0:K.category)=="Triggers"}),c=H(()=>{var K;return((K=h==null?void 0:h.value)==null?void 0:K.category)=="Writer"}),d=H(()=>{var K;return(K=h==null?void 0:h.value)==null?void 0:K.deprecated}),{component:u,definition:h}=e8(n,s),f=H(()=>{var K;return u.value&&(n8(n,u.value)||((K=h.value)==null?void 0:K.name))||"Unknown"}),m=H(()=>{var K,G,T;return S.value==null?null:S.value=="skipped"?"skipped":S.value=="stopped"?"stopped":S.value=="in_progress"?"running":((T=(G=(K=h.value)==null?void 0:K.outs)==null?void 0:G[S.value])==null?void 0:T.style)??"success"}),{hasOnlyNonFunctionTools:g}=y0e(H(()=>h.value),i),_=H(()=>Object.entries(h.value.outs??{}).some(([G,T])=>{var k,C;return T.style!=="dynamic"||!T.field?!1:((C=(k=h.value.fields)==null?void 0:k[T.field])==null?void 0:C.type)!==Q.Tools})),b=H(()=>_.value?"OR":g.value?"No outputs":"THEN"),v=H(()=>g.value||!oe.value&&Object.keys(Me.value).length>0),y=H(()=>{var T,O;const K=r.getLogEntries(),G=((O=(T=K.find(k=>!!k.blueprintExecution))==null?void 0:T.blueprintExecution)==null?void 0:O.runId)??null;return K.filter(k=>{var C;return((C=k==null?void 0:k.blueprintExecution)==null?void 0:C.runId)===G})}),M={in_progress:5,error:4,success:3,stopped:2,skipped:1,none:0},x=H(()=>y.value.map(G=>G.blueprintExecution).filter(Boolean).flatMap(G=>G.summary.filter(T=>T.componentId===u.value.id).filter(T=>!!T.outcome))),S=H(()=>{let K="none";for(const G of x.value)(M[G.outcome]??M.success)>M[K]&&(K=G.outcome);return K==="none"?null:K}),L=H(()=>r.isComponentIdSelected(s)),F=ye(!1),te=H(()=>!J.value||be.value?!1:!F.value),J=H(()=>{var K,G;return((G=(K=h.value)==null?void 0:K.outs)==null?void 0:G.error)!==void 0}),be=H(()=>{var G;return J.value?((G=u.value.outs)==null?void 0:G.some(T=>T.outId==="error"))?!0:F.value:!1}),oe=H(()=>!(Object.keys(Me.value??{}).length>0||Object.keys(Ue.value??{}).length>0||Object.keys(Te.value??{}).length>1)),Te=H(()=>Object.entries(h.value.outs??{}).reduce((K,[G,T])=>(T.style=="dynamic"||G==="error"&&!be.value||(K[G]=T),K),{}),{}),Ue=H(()=>{var G;const K=new Set([...Object.keys(Te.value),...Object.values(Me.value).flatMap(Object.keys)]);return(((G=u.value)==null?void 0:G.outs)??[]).reduce((T,{outId:O})=>{if(!K.has(O))return T[O]={name:O,style:"dynamic",description:""},T},{})});function Ze(K){const T=h.value.fields[K].type==Q.Tools,O=Object.keys(i[K].value??{});return T?O.filter(C=>{var P;return((P=i[K].value[C])==null?void 0:P.type)=="function"}):O}const Me=H(()=>{const K={};return Object.entries(h.value.outs??{}).forEach(([G,T])=>{if(T.style!=="dynamic")return;if(!T.field){K.default??(K.default={}),K.default[G]={...T};return}K[T.field]={},Ze(T.field).forEach(k=>{K[T.field][`${G}_${k}`]={name:k,description:"Dynamically created",style:"dynamic"}})}),K});We(Me,()=>{var T,O;const K=Object.values(Me.value).flatMap(Object.keys);(((O=(T=u.value)==null?void 0:T.outs)==null?void 0:O.filter(k=>!K.includes(k.outId)&&!(k.outId in Te.value)))??[]).forEach(k=>{u.value&&o(u.value.id,k)})},{immediate:!0});const ee=H(()=>{if(["success","error","skipped","stopped"].includes(m.value)){const G=`/status/${m.value}.svg`;return[Li(G)]}const K=[`/components/${u.value.type}.svg`,`/components/blueprints_category_${h.value.category}.svg`];return n.featureFlags.value.includes("custom_block_icons")&&K.unshift(`/static/components/${u.value.id}.svg`),K.map(G=>Li(G))});function j(){x.value.at(-1)&&(r.openPanels.value.add("log"),r.setSelection(s,void 0,"click"))}return We(L,()=>{a("engaged")}),(K,G)=>($(),R("div",{class:ft(["BlueprintsNode",{"BlueprintsNode--trigger":l.value,"BlueprintsNode--intelligent":c.value,"BlueprintsNode--deprecated":d.value,"BlueprintsNode--running":m.value=="running","BlueprintsNode--success":m.value=="success","BlueprintsNode--skipped":m.value=="skipped","BlueprintsNode--stopped":m.value=="stopped","BlueprintsNode--error":m.value=="error"}])},[c.value&&m.value===null?($(),R("div",w0e)):ge("",!0),Z("div",x0e,[m.value=="running"?($(),R("div",C0e)):ge("",!0)]),Z("div",A0e,[Z("div",S0e,[Ce(qg,{urls:ee.value,class:"icon","loader-max-width-px":24,"loader-max-height-px":24},null,8,["urls"]),Ce(r0e,{"component-id":E(s),class:"nodeNamer","block-name":f.value},null,8,["component-id","block-name"]),d.value?($(),R("div",$0e," Deprecated ")):ge("",!0),l.value?($(),Ie(Rm,{key:1,"show-display-error-option":te.value,onShowError:G[0]||(G[0]=T=>F.value=!0)},null,8,["show-display-error-option"])):ge("",!0)]),($(!0),R(Je,null,Ot(Me.value,(T,O)=>{var k,C,P,ae;return $(),R("div",{key:O,class:"BlueprintsNode__main__outputs"},[(k=E(h).fields)!=null&&k[O]?($(),R("h4",E0e,je(E(h).fields[O].name),1)):ge("",!0),($(!0),R(Je,null,Ot(T,(xe,ve)=>($(),Ie(rc,{key:ve,class:"BlueprintsNode__main__outputs__output","out-id":ve,out:xe,"display-label":"",onClick:ze=>K.$emit("outMousedown",ve)},null,8,["out-id","out","onClick"]))),128)),Ce(b0e,{"field-key":O,"field-type":((P=(C=E(h).fields)==null?void 0:C[O])==null?void 0:P.type)??"","field-value":(ae=E(i)[O])==null?void 0:ae.value,"has-outputs":Object.keys(T).length>0},null,8,["field-key","field-type","field-value","has-outputs"])])}),128)),Object.keys(Te.value).length>0?($(),R("div",{key:0,class:ft(["BlueprintsNode__main__outputs",{"BlueprintsNode__main__outputs--float":oe.value&&!l.value}])},[v.value?($(),R("h4",I0e,je(b.value),1)):ge("",!0),($(!0),R(Je,null,Ot(Te.value,(T,O)=>($(),Ie(rc,{key:O,class:"BlueprintsNode__main__outputs__output","out-id":O,out:T,"display-label":!oe.value,onClick:k=>K.$emit("outMousedown",O)},null,8,["out-id","out","display-label","onClick"]))),128)),($(!0),R(Je,null,Ot(Ue.value,(T,O)=>($(),Ie(rc,{key:O,class:"BlueprintsNode__main__outputs__output","out-id":O,out:T,"display-label":"",onClick:k=>K.$emit("outMousedown",O)},null,8,["out-id","out","onClick"]))),128))],2)):ge("",!0),l.value?ge("",!0):($(),R("div",k0e,[x.value.length>0?($(),Ie(g0e,{key:0,"completion-style":m.value,count:x.value.length,onClick:j},null,8,["completion-style","count"])):ge("",!0),Ce(Rm,{"show-display-error-option":te.value,onShowError:G[1]||(G[1]=T=>F.value=!0)},null,8,["show-display-error-option"])]))])],2))}}),L0e=ke(P0e,[["__scopeId","data-v-810cc87f"]]),V0e={class:"BlueprintsRoot","data-writer-container":""},O0e="The root component of the application, which serves as the starting point of the component hierarchy.",H0e={writer:{name:"Blueprints Root",toolkit:"blueprints",category:"Root",description:O0e,allowedChildrenTypes:["blueprints_blueprint"],fields:{}}},R0e=$e({...H0e,__name:"BlueprintsRoot",setup(e){const t=re(ne.core),a=re(ne.getChildrenVNodes),n=H(()=>{const r=t.activePageId.value;if(!!t.getComponentById(r)&&t.isChildOf("blueprints_root",r))return r;const s=t.getComponents("blueprints_root",{includeBMC:!0,includeCMC:!1,sortedByPosition:!0});return s.length==0?null:s[0].id});return ia(()=>{n.value&&t.activePageId.value!==n.value&&t.setActivePageId(n.value)}),(r,o)=>($(),R("div",V0e,[($(!0),R(Je,null,Ot(E(a)(),s=>($(),R(Je,{key:s.key},[s.key===`${n.value}:0`?($(),Ie(Ts(s),{key:0})):ge("",!0)],64))),128))]))}}),N0e=ke(R0e,[["__scopeId","data-v-367e0c79"]]),D0e={name:"Note",description:"Internal note displayed only in edit mode",category:"Internal",fields:{parentInstancePath:{name:"Parent's instance path",type:Q.Text},content:{name:"Content",type:Q.Text,control:Ui.Textarea},createdAt:{name:"Created At",type:Q.Text},createdBy:{name:"Created By",type:Q.Number}}},B0e={writer:D0e};function F0e(e,t,a,n,r,o){return ge("",!0)}const j0e=ke(B0e,[["render",F0e]]);let r8=[];function U0e(e){r8=e??[]}function o8(e){return!e||e.length===0?!0:e.some(t=>r8.includes(t))}const vl={root:R2e,page:$2e,sidebar:L1e,button:ple,text:qae,section:x1e,header:m1e,heading:rae,dataframe:Jte,html:Jg,pagination:Vle,repeater:Nle,column:o1e,columns:c1e,tab:N1e,tabs:W1e,link:rne,horizontalstack:M1e,separator:$1e,image:uae,pdf:s2e,iframe:f2e,googlemaps:_2e,mapbox:j2e,timer:Ule,textinput:bie,textareainput:Sie,numberinput:Fse,sliderinput:cie,rangeinput:vie,colorinput:Roe,dateinput:Uoe,timeinput:Pie,radioinput:Kse,checkboxinput:Eoe,dropdowninput:Joe,selectinput:Yse,multiselectinput:Hse,fileinput:_se,webcamcapture:Xle,vegalitechart:Kae,plotlygraph:Oae,metric:Tae,message:xae,videoplayer:Qae,chatbot:are,step:ele,steps:ile,ratinginput:Fie,tags:ure,switchinput:Zie,reuse:Qle,avatar:Mre,annotatedtext:xre,jsonviewer:soe,blueprints_root:N0e,blueprints_blueprint:Qce,progressbar:yoe,note:j0e},wi=Ri({});function Nm(e){const t=`Component type "${e}" not supported. If it's a custom component, please ensure it's been loaded.`;return{writer:{name:"Fallback Component",allowedChildrenTypes:["*"],description:t,category:"Fallback"},setup(a,{slots:n}){return()=>En("div",{"data-writer-container":"",style:{color:"var(--primaryTextColor)"}},[t,n.default({})])}}}function z0e(e){var r,o;const t={blueprints_node:L0e},a=wi[e];if(!a)return;const n=a.baseType;return{...t[n],writer:{...t[n].writer,...wi[e].writer,fields:{...(r=t[n].writer)==null?void 0:r.fields,...(o=wi[e].writer)==null?void 0:o.fields}}}}function q0e(e){var n;const t=z0e(e)??vl[e]??Nm(e),a=(n=t==null?void 0:t.writer)==null?void 0:n.featureFlags;return o8(a)?t:Nm(e)}function Vi(e){var t;return(t=q0e(e))==null?void 0:t.writer}function Rd(){return[...Object.keys(vl),...Object.keys(wi)].filter(t=>{var n,r;const a=(r=(n=vl[t])==null?void 0:n.writer)==null?void 0:r.featureFlags;return o8(a)})}function W0e(e,t){vl[e]=t}function Z0e(e,t){wi[e]=t}function K0e(e){let t=!1;return J0e(e),Object.entries(e).forEach(([,a])=>{t=Q0e(a,e)||t,t=G0e(a)||t}),t}function G0e(e){const t=fa(),a=Vi(e.type);if(!a||a.category=="Fallback")return t.error(`Component ${e.id} (${e.type}). Invalid component type.`),!1;let n=!1;return n=ade(e),n=tde(e)||n,X0e(e,a),Y0e(e,a),n}function Uc(e,t,a={}){a[e]=!0,Object.entries(t).filter(([,n])=>n.parentId===e).forEach(([n])=>Uc(n,t,a))}function J0e(e){const t=fa(),a=Object.fromEntries(Object.entries(e).map(([n])=>[n,!1]));Uc("root",e,a),Uc("blueprints_root",e,a),Object.entries(a).forEach(([n,r])=>{r||t.warn(`Component ${n} (${e[n].type}). Orphan component.`)})}function X0e(e,t){const a=fa(),n=Object.keys(t.fields??{});e.content&&Object.keys(e.content).forEach(r=>{n.includes(r)||a.warn(`Component ${e.id} (${e.type}). Field key "${r}" is defined in the component but not in the template.`)})}function Y0e(e,t){const a=Object.keys(t.events??{});if(!e.binding)return;const n=e.binding.eventType;if(a.includes(n)&&t.events[n].bindable)return;fa().warn(`Component ${e.id} (${e.type}). The component is bound to event "${e.binding.eventType}" but the template doesn't define that event or it's not bindable.`)}function Q0e(e,t){const a=fa();let n=!1;e.id=="root"&&e.position!==0&&a.error("Root must be at position 0."),e.position==-1&&a.error(`Component ${e.id} (${e.type}). Invalid position.`);const r=Object.values(t).filter(i=>i.parentId===e.id&&i.position!==-2&&!i.isCodeManaged);let o=0;return r.forEach(i=>{o+=i.position}),(r.length-1)*r.length/2!==o&&(a.error(`Component ${e.id} (${e.type}). Invalid children positions. Automated fix will be applied.`),ede(r),n=!0),n}function ede(e){e.sort((t,a)=>t.position>a.position?1:-1),e.map((t,a)=>{t.position=a})}function tde(e){var a,n,r;let t=!1;if(Object.keys(e.handlers??{}).forEach(o=>{if(!o.startsWith("ss-"))return;const s=`wf-${o.substring(3)}`;e.handlers[s]=e.handlers[o],t=!0,delete e.handlers[o]}),(n=(a=e.binding)==null?void 0:a.eventType)!=null&&n.startsWith("ss-")){const s=`wf-${((r=e.binding)==null?void 0:r.eventType).substring(3)}`;e.binding.eventType=s,t=!0}return t}function ade(e,t){let a=!1;if(e.type=="column"){if("horizontalAlignment"in e.content){const n={left:"start",center:"center",right:"end"};e.content.contentHAlign=n[e.content.horizontalAlignment]||e.content.horizontalAlignment,delete e.content.horizontalAlignment,a=!0}if("verticalAlignment"in e.content){const n={normal:"unset",top:"start",center:"center",bottom:"end"};e.content.contentVAlign=n[e.content.verticalAlignment]||e.content.verticalAlignment,delete e.content.verticalAlignment,a=!0}}else if(e.type=="horizontalstack"){if("alignment"in e.content){const n={left:"start",center:"center",right:"end"};e.content.contentHAlign=n[e.content.alignment]||e.content.alignment,delete e.content.alignment,a=!0}}else e.type=="section"&&"snapMode"in e.content&&(delete e.content.snapMode,a=!0);return a}function nde(e){let t="";const a=[];let n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s==="."&&!n){a.push(t),t="";continue}t+=s,s==="\\"?n=!0:n=!1}return a.push(t),a.map(o=>o.replaceAll("\\.","."))}const rde="WriterCustomComponentTemplates";async function ode(e){await Promise.all(e.map(async t=>{const a=t.toLocaleLowerCase();a.endsWith(".js")?await sde(t):a.endsWith(".css")&&lde(t)}))}async function sde(e){var a;const t=fa();t.log(`Importing custom component templates at "${e}"...`),await zt(()=>import(s8()+e),[],import.meta.url),(a=Object.entries(window[rde]))==null||a.forEach(([n,r])=>{ide(n)?(W0e(`custom_${n}`,r),t.log(`Registering template for "${n}".`)):t.warn(`custom component '${n}' is ignored. A custom component should be declared using only alphanumeric lowercase and _.`)})}function ide(e){return/^[a-z0-9_]+$/.test(e)}function lde(e){const t=document.createElement("link");t.rel="stylesheet",t.href=s8()+e,document.head.appendChild(t)}function s8(){let e=window.location.pathname;return e.endsWith("/")||(e+="/"),`${e}extensions/`}function cde(e){return new Promise((t,a)=>{const n=new FileReader;n.onload=()=>{t(n.result)},n.onerror=r=>{a(r)},n.readAsArrayBuffer(e)})}async function dde(e){const t=await cde(e);if(!t)return;const a=new TextDecoder("utf-8");return JSON.parse(a.decode(t))}function ude(e,t){const a=URL.createObjectURL(e);try{const n=document.createElement("a");n.href=a,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}finally{URL.revokeObjectURL(a)}}function Ude(e,t){const a=JSON.stringify(e,null,2),n=new Blob([a],{type:"application/json"});ude(n,t)}const i8=5e3,oc=5;function hde(e){return typeof e!="object"||e===null?!1:e.type==="file"&&typeof e.content=="string"}function zde(e){return typeof e!="object"||e===null?!1:e.type==="binary"}function Fs(e){return typeof e!="object"||e===null?!1:e.type==="directory"&&typeof e.children=="object"}function*pde(e,t=[]){if(!Fs(e)){yield t;return}for(const[a,n]of Object.entries(e.children))yield*pde(n,[...t,a])}function*fde(e,t=[]){if(yield t,!!Fs(e))for(const[a,n]of Object.entries(e.children))yield*fde(n,[...t,a])}function Nd(e,t){if(e.length===0)return t;if(!Fs(t))return;const[a,...n]=e,r=t.children[a];return n.length===0?r:Nd(n,r)}function zc(e,t,a={type:"file",content:"",complete:!0}){var o;const n=structuredClone(t);let r=n;for(let s=0;s<e.length;s++){if(!Fs(r))return n;const i=e.at(s);if(s===e.length-1)return r.children[i]=a,n;(o=r.children)[i]??(o[i]={type:"directory",children:{}}),r=r.children[i]}return n}function mde(e,t,a){const n=Nd(e,a);if(Fs(n)||n===void 0)return a;const r=l8(e,a);return zc(t,r,structuredClone(n))}function l8(e,t){return c8(e,structuredClone(t))}function c8(e,t){if(!Fs(t)||!(e.at(0)in t.children))return t;if(e.length===1)return delete t.children[e.at(0)],t;const a=c8(e.slice(1),t.children[e.at(0)]);return a.type==="directory"&&Object.keys(a.children).length===0&&delete t.children[e.at(0)],t}const vde=6e4;function gde(){let e=null;const t=ye(null),a=ye(null),n=ye(),r=$t([]),o=ye(null),s=$t({type:"directory",children:{}}),i=ye({}),l=ye([]),c=ye({}),d=ye({});let u;const h=ye("idle");let f=0;const m=ye(new Map);let g=[],_=[];const b=[];let v=!1;const y=ye(),M=H(()=>{var ie;return Number((ie=n.value)==null?void 0:ie.organizationId)||void 0}),x=H(()=>{var ie;return(ie=n.value)==null?void 0:ie.id}),S=H(()=>{var ie;return(ie=n.value)==null?void 0:ie.apiKey}),L=H(()=>{var ie;return((ie=n.value)==null?void 0:ie.baseUrl)??"https://api.writer.com"}),F=H(()=>!!(x.value||M.value));async function te(){await J(),oe(),a.value=="edit"}async function J(){Ze();let ie=null,Ee=null;try{Ee=await fetch("./api/init",{method:"post",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify({proposedSessionId:e})});const Pe=await Ee.text();ie=JSON.parse(Pe)}catch{throw new Error(`Failed to acquire initialization data. Server responded with ${(Ee==null?void 0:Ee.status)??"no response"} status.`)}if(Ee.status>400)throw"Connection rejected.";ie.extensionPaths&&await ode(ie.extensionPaths),a.value=ie.mode,i.value=ie.components,d.value=ie.userState,c.value=structuredClone(ie.userState),j(ie.mail),e=ie.sessionId,t.value=new Date().getTime(),r.value=ie.featureFlags,U0e(r.value),n.value=ie.writerApplication,be(ie.abstractTemplates),l.value=ie.userFunctions,o.value=ie.runCode,s.value=ie.sourceFiles,await Me(),!(a.value!="edit"||!K0e(ie.components))&&await pe()}function be(ie){Object.entries(ie??{}).forEach(([Ee,Oe])=>{Z0e(Ee,Oe)})}function oe(){setTimeout(()=>{me("keepAlive",{},oe)},vde)}function Te(ie){ie&&Object.entries(ie).forEach(([Ee,Oe])=>{const Pe=Ee.charAt(0),Ke=nde(Ee.substring(1)),it=Ke.length-1;let ht=d.value;const Ft=Pe==="-";for(let ma=0;ma<it;ma++){const Wt=ht==null?void 0:ht[Ke[ma]];typeof Wt=="object"&&Wt!==null?ht=Wt:Ft||(ht[Ke[ma]]={},ht=ht[Ke[ma]])}Ft?delete ht[Ke.at(-1)]:ht[Ke.at(-1)]=Oe})}function Ue(ie){ie&&(i.value=ie)}function Ze(){m.value.forEach(({callback:ie})=>{ie==null||ie({ok:!1})}),m.value.clear()}async function Me(){if(u&&h.value==="connected")return;const ie=fa(),Ee=new URL("./api/stream",window.location.href);Ee.protocol=Ee.protocol.replace("https","wss"),Ee.protocol=Ee.protocol.replace("http","ws"),u=new WebSocket(Ee.href),u.onopen=()=>{h.value="connected",ie.log("WebSocket connected. Initialising stream..."),me("streamInit",{sessionId:e}),v&&(v=!1,pe().catch(Pe=>{ie.error("Failed to retry component update after reconnect:",Pe),v=!0}))};function Oe(Pe){var it,ht,Ft,ma;if(Pe.messageType=="announcement"&&Pe.payload.type=="codeUpdate"){u.close(),J();return}if(Pe.messageType=="announcement"&&Pe.payload.type=="collaborationUpdate"){b.forEach(Wt=>Wt.fn(Pe.payload.payload));return}if(Pe.messageType=="announcement"&&Pe.payload.type=="componentUpdate"){const Wt={};Object.entries(i.value).forEach(([ln,Pr])=>{Pr.isCodeManaged&&(Wt[ln]=Pr)}),i.value={...Wt,...Pe.payload.payload};return}if(Pe.messageType=="announcement"&&Pe.payload.type=="mail"){j(Pe.payload.payload);return}(Pe.messageType=="eventResponse"||Pe.messageType=="stateEnquiryResponse")&&(Te((it=Pe.payload)==null?void 0:it.mutations),j((ht=Pe.payload)==null?void 0:ht.mail),Ue((Ft=Pe.payload)==null?void 0:Ft.components));const Ke=m.value.get(Pe.trackingId);(ma=Ke==null?void 0:Ke.callback)==null||ma.call(Ke,{ok:!0,payload:Pe.payload}),m.value.delete(Pe.trackingId)}return u.onmessage=async Pe=>{let Ke;try{Pe.data instanceof Blob?Ke=await dde(Pe.data):Ke=JSON.parse(Pe.data)}catch(it){ie.error("Error parsing WebSocket message:",it);return}try{Oe(Ke)}catch(it){ie.error("Error processing WebSocket message:",it)}},u.onclose=async Pe=>{if(u=null,Pe.code==1008){h.value="offline",ie.error("Invalid session. Reinitialising..."),await J();return}Pe.code==4001?(h.value="suspended",ie.info("WebSocket closed due to code update. Attempting to reconnect...")):(h.value="offline",ie.error(`WebSocket closed with code ${Pe.code}. Attempting to reconnect...`)),setTimeout(async()=>{try{await Me(),ie.info("Reconnected.")}catch{ie.error("Couldn't reconnect.")}},i8)},new Promise((Pe,Ke)=>{u.addEventListener("open",()=>Pe(),{once:!0}),u.addEventListener("close",()=>{Ke(new Error("WebSocket connection closed before establishing."))},{once:!0})})}function ee(ie=1e3){u&&(u.onclose=()=>{},u.close(ie),h.value="offline")}function j(ie=[]){g.push(...ie),g=g.filter(Ee=>{const Oe=_.filter(Pe=>Pe.mailType==Ee.type);if(Oe.length==0)return Ee;Oe.forEach(Pe=>Pe.fn(Ee.payload))})}function K(ie){b.push({fn:ie})}function G(ie,Ee){_.push({mailType:ie,fn:Ee}),j()}function T(ie,Ee){_=_.filter(Oe=>!(Oe.mailType===ie&&Oe.fn===Ee))}function O(ie){var Oe;let Ee=null;if(ie instanceof CustomEvent)Ee=((Oe=ie.detail)==null?void 0:Oe.payload)??null;else{const Pe={};for(const Ke in ie){const it=ie[Ke];typeof it!="function"&&(it instanceof Object||(Pe[Ke]=it))}Ee=Pe}return Ee}async function k(ie,Ee,Oe){var Ft,ma;const Pe=Oe?O(ie):null;let Ke,it;ie instanceof CustomEvent&&(Ke=(Ft=ie.detail)==null?void 0:Ft.callback,it=(ma=ie.detail)==null?void 0:ma.handler),me("event",async()=>({type:ie.type,instancePath:Ee,handler:it,payload:await Pe}),Ke,!0)}async function C(ie){return new Promise(Ee=>{me("collaborationPing",ie,()=>{Ee()})})}async function P(ie){return new Promise((Ee,Oe)=>{me("hashRequest",{message:ie},Ke=>{var it;if(!Ke.ok)return Oe("Couldn't connect to the server.");Ee((it=Ke.payload)==null?void 0:it.message)})})}function ae(ie,Ee){const Oe=structuredClone(St(s.value)),Pe=Nd(Ee,Oe);hde(Pe)&&(Pe.content=ie,Pe.complete=!0,s.value=Oe)}async function xe(ie){return new Promise((Ee,Oe)=>{me("createSourceFile",{path:ie},Ke=>{var it;if(!Ke.ok)return Oe("Couldn't connect to the server.");if((it=Ke.payload)!=null&&it.error)return Oe("Couldn't create the file.");s.value=zc(ie,St(s.value)),Ee()})})}async function ve(ie,Ee){return new Promise((Oe,Pe)=>{me("uploadSourceFile",{path:ie,content:Ee},it=>{var ht,Ft;if(!it.ok)return Pe("Couldn't connect to the server.");if((ht=it.payload)!=null&&ht.error)return Pe("Couldn't upload the file.");s.value=((Ft=it.payload)==null?void 0:Ft.sourceFiles)??zc(ie,St(s.value)),Oe()})})}async function ze(ie,Ee){return new Promise((Oe,Pe)=>{me("renameSourceFile",{from:ie,to:Ee},it=>{var ht;if(!it.ok)return Pe("Couldn't connect to the server.");if((ht=it.payload)!=null&&ht.error)return Pe("Couldn't rename the file.");s.value=mde(ie,Ee,St(s.value)),Oe()})})}async function Ye(ie){return new Promise((Ee,Oe)=>{me("deleteSourceFile",{path:ie},Ke=>{var it;if(!Ke.ok)return Oe("Couldn't connect to the server.");if((it=Ke.payload)!=null&&it.error)return Oe("Couldn't delete the file.");s.value=l8(ie,St(s.value)),Ee()})})}async function ct(ie,Ee=["main.py"]){return new Promise((Oe,Pe)=>{me("codeSaveRequest",{code:ie,path:Ee},it=>{if(!it.ok)return Pe("Couldn't connect to the server.");ae(ie,Ee),Oe()}),Ee.join("/")==="main.py"&&(h.value="suspended")})}function wt(ie){return new Promise((Ee,Oe)=>{me("loadSourceFile",{path:ie},Ke=>{if(!Ke.ok)return Oe("Couldn't connect to the server.");ae(Ke.payload.content,ie),Ee()})})}async function D(ie){return new Promise((Ee,Oe)=>{me("listResources",{resource_type:ie},Ke=>{var it;if(!Ke.ok)return Oe("Couldn't connect to the server.");Ee(((it=Ke.payload)==null?void 0:it.data)??[])})})}async function q(ie){me("stateEnquiry",{},ie,!0)}function he(ie){const Pe=(Ke=0)=>{const it=m.value.get(ie);it!==void 0&&(Ke==0&&it.type=="stateEnquiry"||q(()=>setTimeout(()=>Pe(Ke+1),150)))};setTimeout(()=>Pe(0),150)}async function me(ie,Ee,Oe,Pe=!1){if(h.value=="offline"||h.value=="suspended"){Oe==null||Oe({ok:!1});return}const Ke=fa(),it=f++;try{(Oe||Pe)&&m.value.set(it,{type:ie,callback:Oe}),Pe&&he(it);let ht;typeof Ee=="function"?ht=await Ee():ht=Ee;const Ft={type:ie,trackingId:it,payload:ht};if(u.readyState!==WebSocket.OPEN)throw"Connection lost.";u.send(JSON.stringify(Ft,G3))}catch(ht){Ke.error("sendFrontendMessage error",ht),Oe==null||Oe({ok:!1})}}function _e(ie){delete i.value[ie]}function Ae(ie){i.value[ie.id]=ie}async function pe(){const ie={};Object.entries(i.value).forEach(([Oe,Pe])=>{Pe.isCodeManaged||(ie[Oe]=Pe)});const Ee={components:ie};return new Promise((Oe,Pe)=>{me("componentUpdate",Ee,it=>{if(!it.ok)return v=!0,Pe("Couldn't connect to the server.");Oe()})})}async function ce(){return new Promise((ie,Ee)=>{me("writerVaultUpdate",{},Pe=>{if(!Pe.ok)return Ee("Couldn't connect to the server.");ie()})})}function ue(ie){return i.value[ie]}function I(ie,Ee){let Oe=i.value[Ee];do{if(Oe.parentId==ie)return!0;Oe=i.value[Oe.parentId]}while(Oe);return!1}function B(ie,{includeBMC:Ee=!0,includeCMC:Oe=!0,sortedByPosition:Pe=!1}={}){let Ke=Object.values(i.value);return typeof ie<"u"&&(Ke=Ke.filter(it=>it.parentId==ie)),Ke=Ke.filter(it=>{const ht=it.isCodeManaged;return Ee&&!ht||Oe&&ht}),Pe&&(Ke=Ke.sort((it,ht)=>it.isCodeManaged&&!ht.isCodeManaged?1:!it.isCodeManaged&&ht.isCodeManaged?-1:it.position>ht.position?1:-1)),Ke}function*N(ie,Ee={}){for(const Oe of B(ie,Ee))yield Oe,yield*N(Oe.id,Ee)}function U(ie){const Oe=B("root").filter(Pe=>Pe.content.key==ie);Oe.length!=0&&se(Oe[0].id)}function se(ie){y.value=ie}function Se(ie){return Ld(i.value,ie)}function Ne(){return u}return{webSocket:u,syncHealth:h,frontendMessageMap:jt(m),mode:jt(a),userFunctions:jt(l),addMailSubscription:G,removeMailSubscription:T,addCollaborationPingSubscription:K,init:te,forwardEvent:k,hashMessage:P,runCode:jt(o),sourceFiles:jt(s),sendCodeSaveRequest:ct,sendCreateSourceFileRequest:xe,sendRenameSourceFileRequest:ze,sendDeleteSourceFileRequest:Ye,sendFileUploadRequest:ve,requestSourceFileLoading:wt,sendListResourcesRequest:D,sendComponentUpdate:pe,sendWriterVaultUpdate:ce,sendCollaborationPing:C,addComponent:Ae,deleteComponent:_e,getComponentById:ue,getComponents:B,getComponentsNested:N,setActivePageId:se,activePageId:jt(y),setActivePageFromKey:U,getComponentDefinition:Vi,getSupportedComponentTypes:Rd,getContainableTypes:Se,sessionTimestamp:jt(t),userState:jt(d),userStateInitial:jt(c),isChildOf:I,featureFlags:jt(r),getWebSocket:Ne,stopSync:ee,writerApplication:jt(n),isWriterCloudApp:F,writerOrgId:M,writerAppId:x,writerApiKey:S,writerBaseUrl:L}}const yde=2e3,Mde=1e3,_de=5e3;function bde(e){const t=ye({});let a=null,n=null;const r=ye({}),o=ye(null),s=ye({}),i=ye([]),{writerApi:l}=io(),c=H(()=>{const b={};return i.value.forEach(v=>{var x,S;const y=v.userId;(((S=(x=r.value[y])==null?void 0:x.selection)==null?void 0:S.map(L=>L.instancePath))??[]).forEach(L=>{b[L]=[...b[L]??[],y]})}),b});function d(b){const v=b.userId;if(v!=null){if(b.action=="leave"){delete r.value[v];return}r.value={...r.value,[v]:b}}}function u(b,v,y){return b||v?`${b} ${v}`:y||"Unknown"}async function h(b){const v=s.value[b];if(v)return v;const y=await l.fetchThirdUserProfile(b),M=u(y.firstName,y.lastName,y.email);return s.value[b]={userId:b,displayName:M,avatar:y.avatar,email:y.email},s.value[b]}async function f(){const v=Object.keys(r.value).map(y=>h(parseInt(y)));return Promise.all(v)}async function m(){clearTimeout(n);const b=[];Object.keys(r.value).forEach(v=>{var x;const y=(x=r.value[v])==null?void 0:x.time;if(!y)return;Date.now()-new Date(y).getTime()>_de&&b.push(v)}),b.forEach(v=>delete r.value[v]),i.value=await f(),n=setTimeout(m,Mde)}function g(b){t.value={...t.value,...b}}function _(){e.sendCollaborationPing({userId:o.value,action:"auto",time:new Date,...t.value}),t.value.action="auto",clearTimeout(a),a=setTimeout(_,yde)}return{groomSnapshot:m,updateOutgoingPing:g,sendCollaborationPing:_,handleIncomingCollaborationUpdate:d,connectedProfiles:i,connectedUsersByInstancePath:c}}let Dm;async function qc(e=io().writerApi){return Dm??(Dm=e.fetchUserProfile()),await Dm}function qde(e=io().writerApi){const t=$t(),a=$t(),n=ye(!1);async function r(){a.value=void 0,n.value=!0;try{t.value=await qc(e)}catch(o){a.value=o,t.value=void 0}finally{n.value=!1}}return ia(r),{user:jt(t),isLoading:jt(n),error:jt(a)}}const L1={};function Wde(e,t=io().writerApi){const a=$t(),n=$t(),r=ye(!1);async function o(s){n.value=void 0,r.value=!0;try{L1[s]??(L1[s]=t.fetchUserById(s)),a.value=await L1[s]}catch(i){n.value=i,a.value=void 0}finally{r.value=!1}}return We(e,o,{immediate:!0}),{user:jt(a),isLoading:jt(r),error:jt(n)}}function wde(e,t){const a=Od(),{removeComponentSubtree:n,generateNewComponentId:r}=Bs(e,t),o=ye(!1),s=ye(),i=ye("show"),l=ye(),c=$t(),d=H(()=>s.value?y(s.value):void 0);async function u(S){const L=x(S).createdBy.value,F=await qc();return L===F.id}async function h(S,L="show"){if(S===void 0){c.value=void 0,s.value=void 0,i.value="show";return}if(L==="edit"){const F=y(S);if(!await u(F))return a.pushToast({type:"error",message:"You cannot edit this note because it was created by another user"})}i.value=L,s.value=S,f(S)}function f(S){let L=e.getComponentById(S);for(;L;){switch(L.type){case"blueprints_root":t.mode.value="blueprints";break;case"root":t.mode.value="ui";break;case"blueprints_blueprint":case"page":e.setActivePageId(L.id);break}L=e.getComponentById(L.parentId)}}async function m(S,L){let F;"instancePath"in L&&(F=typeof L.instancePath=="string"?L.instancePath:a8(L.instancePath));const te=await qc(),J=r();return c.value={id:J,type:"note",parentId:S,content:{parentInstancePath:F,content:"",createdBy:String(te.id),createdAt:new Date().toISOString()},x:"x"in L?L.x:void 0,y:"y"in L?L.y:void 0},await h(J,"edit"),J}We(s,()=>{c.value&&c.value.id!==s.value&&(c.value=void 0)});async function g(S){const L=y(S);if(!await u(L))return a.pushToast({type:"error",message:"You cannot delete this note because it was created by another user"});h(void 0),n(S)}function*_(){yield*v("root"),yield*v("blueprints_root")}function*b(S){if(!S){yield*_();return}const L=S.toLocaleLowerCase();for(const F of _()){if(!F.content.content)continue;String(F.content.content).toLocaleLowerCase().includes(L)&&(yield F)}}function*v(S){var L;for(const F of e.getComponentsNested(S))F.type==="note"&&(yield F);if(c.value){let F=c.value.parentId;for(;F;){if(F===S){yield jt(c.value);return}F=(L=e.getComponentById(F))==null?void 0:L.parentId}}}function y(S){var F;const L=e.getComponentById(S);if((L==null?void 0:L.type)==="note")return L;if(((F=c.value)==null?void 0:F.id)===S)return jt(c.value)}const M=S=>{var L;return String(((L=S.content)==null?void 0:L.content)??"")};function x(S){const L=new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}),F=H(()=>{var K,G,T;const Me=(K=E(S))==null?void 0:K.id,ee=(G=E(S))==null?void 0:G.content;return l.value===Me?"hover":((T=d.value)==null?void 0:T.id)===Me?ee.content?"active":"new":"default"}),te=H(()=>M(E(S))),J=H(()=>E(S).content.createdAt),be=H(()=>E(S).content.parentInstancePath),oe=H(()=>{var ee;const Me=(ee=E(S).content)==null?void 0:ee.createdBy;return Me?Number(Me):void 0}),Te=H(()=>{if(!J.value)return"";const Me=new Date(J.value);return L.format(Me)}),Ue=H(()=>Ze(E(S).id)==="blueprints_root"?"blueprints":"ui");function Ze(Me){const ee=e.getComponentById(Me);return ee?Ze(ee.parentId)??Me:Me}return{content:te,type:Ue,createdBy:oe,createdAt:J,createdAtFormatted:Te,state:F,parentInstancePath:be}}return{isAnnotating:o,createNote:m,getNotes:v,selectNote:h,searchNotes:b,getAllNotes:_,deleteNote:g,selectedNoteId:jt(s),selectedNoteMode:jt(i),selectedNote:d,hoveredNoteId:l,useNoteInformation:x,getNoteContent:M}}function xde(e){const t="vault",a=$t({}),n=ye(!1),r=ye(!1),o=ye(!1),{writerApi:s}=io();async function i(){try{return(await s.fetchSecret(e.writerOrgId.value,e.writerAppId.value,t)).secret}catch{return}}async function l(){if(e.isWriterCloudApp.value){n.value=!0,o.value=!1;try{const d=await i();a.value=d??{}}finally{n.value=!1}}}async function c(d){if(!e.isWriterCloudApp.value)return;r.value=!0,o.value=!1;const u=await i();try{u===void 0?await s.createSecret(e.writerOrgId.value,e.writerAppId.value,t,d):await s.updateSecret(e.writerOrgId.value,e.writerAppId.value,t,d),a.value=d}catch(h){o.value=h}finally{r.value=!1}}return{secrets:a,load:l,readonly:H(()=>n.value||r.value),isLoading:jt(n),isSaving:jt(r),update:c}}function Cde(e){const t=fa();async function a(){if(!e.isWriterCloudApp.value){t.log("Skipping config.js load - not a Writer Cloud App");return}if(!(typeof window<"u"&&window.__WRITER_APP_CONFIG__))try{const{writerApi:n}=io(),r=await n.fetchConfigJs(),o=document.createElement("script");o.textContent=r,document.head.appendChild(o)}catch(n){t.warn("Failed to load config.js via WriterApi ",n)}}return{loadConfigJs:a}}const _n=gde();globalThis.vue=aw;globalThis.injectionKeys=ne;globalThis.core=_n;const Kr=fa();async function Ade(){await _n.init();const e=_n.mode.value,t=e=="edit"?Ow():void 0,a=wde(_n,t),n=e=="edit"?xde(_n):void 0,r=e=="edit"?bde(_n):void 0;t&&(_n.addMailSubscription("logEntry",t.handleLogEntry),_n.addCollaborationPingSubscription(r.handleIncomingCollaborationUpdate),globalThis.wfbm=t),Kr.log(`Mounting app in mode ${e}...`);const{default:o}=e==="run"&&await zt(()=>import("./ComponentRenderer-DRTUw3PP.js"),__vite__mapDeps([18,19]),import.meta.url),{default:s}=e==="edit"&&await zt(()=>import("./BuilderApp-CXGhU9Dc.js").then(c=>c.c),__vite__mapDeps([20,5,6,21,22]),import.meta.url),i=rl(o||s);i.use(Aw),i.provide(ne.core,_n),i.provide(ne.builderManager,t),i.provide(ne.notesManager,a),i.provide(ne.collaborationManager,r),i.provide(ne.secretsManager,n),i.mount("#app");const{loadConfigJs:l}=Cde(_n);l().catch(Kr.error),_n.isWriterCloudApp.value&&r&&await Sde(r).catch(Kr.error),_n.isWriterCloudApp.value&&n&&n.load().catch(Kr.error)}async function Sde(e){const{writerApi:t}=io(),a=await t.fetchUserProfile();e.updateOutgoingPing({userId:a.id,action:"join"}),e.sendCollaborationPing(),e.groomSnapshot(),window.addEventListener("beforeunload",function(){e.updateOutgoingPing({action:"leave"}),e.sendCollaborationPing()})}async function $de(){var e;for(let t=0;t<oc;t++)try{await Ade();return}catch(a){if(t<oc-1){if(Kr.warn(`Core initialization failed (attempt ${t+1}/${oc}). Retrying...`,a),document.getElementById("loading_L1")&&!document.getElementById("loading_message")&&t>=2){const r=document.createElement("div");r.id="loading_message",r.textContent=`We're getting things ready.
8524
+ </example>`.trim();Gce(Ve)}function ln(fe){J.value=Math.max(Math.min(bo.maxLevel,fe),bo.minLevel)}function Pr(fe){ln(fe)}function kn(fe,Le){F.value={x:Math.max(0,fe),y:Math.max(0,Le)}}function lo(fe){kn(F.value.x+fe.deltaX*pe.value,F.value.y+fe.deltaY*pe.value)}function Ro(fe){const Le=.006666666666666667,Re=u.value.getBoundingClientRect(),Ve=J.value;J.value=Math.min(Math.max(J.value-fe.deltaY*Le,bo.minLevel),bo.maxLevel);const Ge={w:Re.width*(1/Ve)*pe.value*(J.value-Ve),h:Re.height*(1/Ve)*pe.value*(J.value-Ve)},dt={x:(fe.pageX-Re.x)/Re.width,y:(fe.pageY-Re.y)/Re.height};kn(F.value.x+Ge.w*dt.x,F.value.y+Ge.h*dt.y)}async function No(fe){if(fe.preventDefault(),!fe.ctrlKey&&!Fc(fe)){lo(fe);return}Ro(fe)}async function Do(){const{width:Le,height:Re,x:Ve,y:Ge}=u.value.getBoundingClientRect(),dt=h.value.querySelectorAll("[data-writer-id]"),{maxX:rt,maxY:Mt}=Array.from(dt).reduce((Yt,la)=>{const ca=la.getBoundingClientRect();return{maxY:Math.max(Yt.maxY,(ca.bottom-Ge)*pe.value+F.value.y),maxX:Math.max(Yt.maxX,(ca.right-Ve)*pe.value+F.value.x)}},{maxY:0,maxX:0}),At=Math.min((Le-48)/rt,(Re-48)/Mt);ln(At),kn(0,0)}async function Bo(fe){if(l.value=!1,!fe)return;const{components:Le}=fe;Le.forEach(Re=>{j(Re.type,i,void 0,Re)}),await qa(),me("socketPosition")}We(r.firstSelectedItem,fe=>{fe&&(te.value=null,n.isChildOf(i,fe.componentId)&&fe.source!=="click"&&Ft(fe.componentId))});function Fo(fe){if(Fc(fe)&&(fe.code==="Backquote"||fe.code==="Backslash")){ae.value=!ae.value;return}if(!r.selection.value.length)return;const Re=fe.target;if(Re.tagName==="INPUT"||Re.tagName==="TEXTAREA"||Re.getAttribute("contenteditable")==="true")return;function Ve(){switch(fe.key){case"ArrowDown":return{x:0,y:xa};case"ArrowUp":return{x:0,y:-xa};case"ArrowLeft":return{x:-xa,y:0};case"ArrowRight":return{x:xa,y:0}}}const Ge=Ve();if(Ge===void 0)return;fe.preventDefault();const dt=r.selection.value.map(rt=>n.getComponentById(rt.componentId)).filter(rt=>(rt==null?void 0:rt.x)!==void 0&&(rt==null?void 0:rt.y)!==void 0).reduce((rt,Mt)=>(rt[Mt.id]=Bc({x:Mt.x,y:Mt.y},Ge),rt),{});Ne(dt)}const ur=Ki();return ia(async()=>{var fe;await Do(),await qa(),ve(),(fe=u.value)==null||fe.addEventListener("wheel",No,{signal:ur.signal}),document.addEventListener("keydown",Fo,{signal:ur.signal}),document.addEventListener("mouseup",x,{signal:ur.signal}),document.addEventListener("click",S,{signal:ur.signal,capture:!0}),be.observe(h.value,{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0,characterData:!0}),window.createAutogenExample=Wt}),Wn(()=>{ur.abort(),be.disconnect()}),(fe,Le)=>{var Re;return $(),R("div",{ref_key:"rootEl",ref:u,class:ft(["BlueprintsBlueprint",{isSelecting:E(m),canSelect:E(g)&&!E(m)}]),"data-writer-unselectable":ze.value,onClick:Ye,onDragover:Le[6]||(Le[6]=sn(()=>{},["prevent","stop"])),onDrop:ue,onMousemove:Pe,onMousedown:Ke,onMouseup:it},[Z("div",{ref_key:"nodeContainerEl",ref:h,class:"nodeContainer",onMousedown:Le[0]||(Le[0]=(...Ve)=>E(b)&&E(b)(...Ve)),onMousemove:Le[1]||(Le[1]=(...Ve)=>E(v)&&E(v)(...Ve)),onMouseup:Le[2]||(Le[2]=(...Ve)=>E(y)&&E(y)(...Ve)),onMouseleave:Le[3]||(Le[3]=(...Ve)=>E(M)&&E(M)(...Ve))},[($(),R("svg",qce,[Z("defs",null,[Z("pattern",{id:"grid",width:xa,height:xa,patternUnits:"userSpaceOnUse",x:-F.value.x-xa/2,y:-F.value.y-xa/2},[Z("circle",{cx:xa/2,cy:xa/2,r:"1",fill:E(Ht).Gray3},null,8,Zce)],8,Wce)]),E(ae)?($(),R("rect",Kce)):ge("",!0),($(!0),R(Je,null,Ot(L.value,(Ve,Ge)=>($(),Ie(Vm,{key:Ge,arrow:Ve,"is-selected":te.value==Ge,"is-engaged":te.value==Ge||E(r).isComponentIdSelected(Ve.fromNodeId)||E(r).isComponentIdSelected(Ve.toNodeId),onClick:dt=>I(dt,Ge),onDelete:dt=>B(Ve)},null,8,["arrow","is-selected","is-engaged","onClick","onDelete"]))),128)),(Re=k.value)!=null&&Re.liveArrow?($(),Ie(Vm,{key:"liveArrow",arrow:k.value.liveArrow,"is-selected":!1,"is-engaged":!0},null,8,["arrow"])):ge("",!0)])),($(!0),R(Je,null,Ot(Ze.value,Ve=>{var Ge,dt,rt,Mt,At,Yt,la,ca;return $(),Ie(Ts(E(s)(Ve.id,0)),{key:Ve.id,style:bt({top:`${(((dt=(Ge=oe.value)==null?void 0:Ge[Ve.id])==null?void 0:dt.y)??Ve.y)-F.value.y}px`,left:`${(((Mt=(rt=oe.value)==null?void 0:rt[Ve.id])==null?void 0:Mt.x)??Ve.x)-F.value.x}px`,"border-color":((Yt=(At=k.value)==null?void 0:At.liveArrow)==null?void 0:Yt.toNodeId)==Ve.id?(ca=(la=k.value)==null?void 0:la.liveArrow)==null?void 0:ca.color:void 0}),onMousedown:sn(qe=>_e(qe,Ve.id),["stop"]),onOutMousedown:qe=>Ae(Ve.id,qe)},null,40,["style","onMousedown","onOutMousedown"])}),128)),($(!0),R(Je,null,Ot(Me.value,Ve=>{var Ge,dt,rt,Mt;return $(),Ie(oce,{key:Ve.id,"component-id":Ve.id,style:bt({top:`${(((dt=(Ge=oe.value)==null?void 0:Ge[Ve.id])==null?void 0:dt.y)??Ve.y)-F.value.y}px`,left:`${(((Mt=(rt=oe.value)==null?void 0:rt[Ve.id])==null?void 0:Mt.x)??Ve.x)-F.value.x}px`})},null,8,["component-id","style"])}),128)),E(f).isSelecting?($(),R("div",{key:0,class:"selectionRectangle",style:bt({left:`${E(f).left}px`,top:`${E(f).top}px`,width:`${E(f).width}px`,height:`${E(f).height}px`})},null,4)):ge("",!0)],544),Ce(E(t),{class:"blueprintsToolbar",onAutogenClick:c,onDeploy:Le[4]||(Le[4]=Ve=>d.value=!0)}),E(l)?($(),Ie(Sg,{key:0},{default:Xe(()=>[Ce(Uce,{onBlockGeneration:Bo})]),_:1})):ge("",!0),Ce(E(a),{modelValue:d.value,"onUpdate:modelValue":Le[5]||(Le[5]=Ve=>d.value=Ve),"blueprint-id":E(i)},null,8,["modelValue","blueprint-id"]),E(h)?($(),Ie(bce,{key:1,"node-container-el":E(h),"render-offset":F.value,"zoom-level":J.value,class:"navigator",onAutoArrange:he,onChangeRenderOffset:ma,onChangeZoomLevel:Pr,onResetZoom:Do},null,8,["node-container-el","render-offset","zoom-level"])):ge("",!0)],42,zce)}}}),Qce=ke(Yce,[["__scopeId","data-v-d8dd8762"]]);function e0e(e,t){const a=(t==null?void 0:t.wf)??re(ne.core),n=(t==null?void 0:t.ssbm)??re(ne.builderManager);if(!a)throw new Error("Missing core injection.");if(!n)throw new Error("Missing builderManager injection.");const r=fa(),o=H(()=>a.getComponentById(Pa(e.componentId)));We(o,h=>{h||r.error(`useComponentFieldViewModel: component with id "${Pa(e.componentId)}" not found`)},{immediate:!0});const s=H(()=>{var m,g,_;const h=Pa(e.defaultValue);if(typeof h=="string")return h;const f=a.getComponentDefinition((m=o.value)==null?void 0:m.type);return((_=(g=f==null?void 0:f.fields)==null?void 0:g[Pa(e.fieldKey)])==null?void 0:_.default)??""}),{setContentValue:i}=Bs(a,n);function l(h){o.value&&i(o.value.id,Pa(e.fieldKey),h)}const c=ye(!1);We([()=>Pa(e.componentId),()=>Pa(e.fieldKey)],()=>{c.value=!1});const d=H(()=>{var f,m;const h=(m=(f=o.value)==null?void 0:f.content)==null?void 0:m[Pa(e.fieldKey)];return c.value&&typeof h=="string"?h:h||s.value});return H({get:()=>d.value,set:h=>{c.value=!0,l(h)}})}const t0e={class:"alias"},a0e=["contenteditable"],n0e=$e({__name:"BlueprintsNodeNamer",props:{componentId:{},blockName:{}},setup(e){const a=e0e({componentId:mn(e,"componentId"),fieldKey:"alias"}),n=H(()=>!!a.value),r=pt("aliasEditorEl"),o=ye(!1);async function s(){if(o.value)return;o.value=!0,await qa();const c=r.value;c.focus();const d=document.createRange(),u=window.getSelection();d.setStart(c,c.childNodes.length),d.collapse(!0),u.removeAllRanges(),u.addRange(d)}function i(){const c=r.value.textContent;r.value.blur(),o.value=!1,a.value=c}function l(c){o.value&&c.stopPropagation()}return(c,d)=>($(),R("div",{class:ft(["BlueprintsNodeNamer",{beingEdited:o.value,hasEyebrow:n.value||o.value}]),"data-writer-unselectable":"true"},[Z("div",{class:"blockName",onClick:s},je(c.blockName),1),Z("div",t0e,[n.value||o.value?($(),R("div",{key:0,ref_key:"aliasEditorEl",ref:r,class:"aliasEditor",contenteditable:o.value,"data-writer-unselectable":"true",onClick:s,onMousemove:l,onBlur:i,onKeydown:Sr(i,["enter"])},je(E(a)),41,a0e)):ge("",!0)])],2))}}),r0e=ke(n0e,[["__scopeId","data-v-ac3126a4"]]);function e8(e,t){const a=H(()=>{const r=E(t);if(r)return e.getComponentById(r)}),n=H(()=>{var o;const r=(o=a.value)==null?void 0:o.type;if(r)return e.getComponentDefinition(r)});return{component:a,definition:n}}function o0e(e,t){return H(()=>{var s;const{type:a,id:n}=E(e)??{},r=(s=E(t))==null?void 0:s.outs;return a&&!Pd.has(a)&&a.startsWith("blueprints_")&&(r==null?void 0:r.success)!==void 0?`@{results.${n}}`:""})}const s0e=$e({__name:"SharedMoreDropdown",props:{options:{type:Array,default:()=>[]},triggerSize:{type:String,default:"smallIcon"},triggerVariant:{type:String,default:"neutral"},triggerCustomSize:{type:String,default:void 0},triggerIcon:{type:String,default:"ellipsis"},disabled:{type:Boolean},hideIcons:{type:Boolean,required:!1},dropdownPlacement:{type:String,required:!1,default:"bottom-end"},floatingMiddleware:{type:Array,required:!1,default:()=>[i6({allowedPlacements:["bottom-end","top-end"]})]}},emits:{select:e=>typeof e=="string"},setup(e,{emit:t}){const a=sr({loader:()=>zt(()=>import("./WdsDropdownMenu-vcOuT7Hf.js").then(u=>u.b),__vite__mapDeps([4,5,6,7]),import.meta.url)}),n=e,r=t,o=ye(!1),s=pt("trigger"),i=pt("dropdown"),{floatingStyles:l}=c6(s,i,{placement:mn(n,"dropdownPlacement"),middleware:mn(n,"floatingMiddleware")}),c=b0(s);We(c,()=>{c.value||qa().then(()=>o.value=!1)},{immediate:!0});function d(u){o.value=!1,r("select",u)}return(u,h)=>($(),R("div",{ref_key:"trigger",ref:s,class:"SharedMoreDropdown"},[Ce(La,{variant:e.triggerVariant,size:e.triggerSize,disabled:e.disabled,"custom-size":e.triggerCustomSize,onClick:h[0]||(h[0]=sn(f=>o.value=!o.value,["stop"]))},{default:Xe(()=>[Ce(_t,{name:e.triggerIcon},null,8,["name"])]),_:1},8,["variant","size","disabled","custom-size"]),o.value?($(),Ie(E(a),{key:0,ref_key:"dropdown",ref:i,class:"SharedMoreDropdown__dropdown",options:e.options,style:bt(E(l)),"hide-icons":e.hideIcons,onSelect:d},null,8,["options","style","hide-icons"])):ge("",!0)],512))}}),t8=ke(s0e,[["__scopeId","data-v-df890e8f"]]),i0e=Object.freeze(Object.defineProperty({__proto__:null,default:t8},Symbol.toStringTag,{value:"Module"}));var ls=(e=>(e.Add="add",e.MoveUp="moveUp",e.MoveDown="moveDown",e.Cut="cut",e.Copy="copy",e.Paste="paste",e.GoToParent="goToParent",e.Delete="delete",e))(ls||{});function l0e(e){return typeof e=="string"&&Object.values(ls).includes(e)}function c0e(e,t,a,n={},r){const{moveComponentUp:o,moveComponentDown:s,cutComponent:i,pasteComponent:l,copyComponent:c,isAddAllowed:d,isCopyAllowed:u,isCutAllowed:h,isGoToParentAllowed:f,isPasteAllowed:m,isDeleteAllowed:g,getEnabledMoves:_,removeComponentsSubtree:b,goToParent:v}=Bs(e,t,a),y=Od(),M=H(()=>r?E(r).componentId:t.firstSelectedId.value),x=H(()=>r?E(r).instancePath:t.firstSelectedItem.value.instancePath),S=H(()=>{var Ze,Me;const oe=e.getComponentById(M.value);if(!oe)return{};const{up:Te,down:Ue}=_(M.value);return{isAddEnabled:d(M.value),componentTypeName:(Ze=e.getComponentDefinition(oe.type))==null?void 0:Ze.name,toolkit:(Me=e.getComponentDefinition(oe.type))==null?void 0:Me.toolkit,isMoveUpEnabled:Te,isMoveDownEnabled:Ue,isCopyEnabled:u(M.value),isCutEnabled:h(M.value),isGoToParentEnabled:f(M.value),isDeleteEnabled:g(M.value)}}),L=H(()=>t.firstSelectedId.value?m(t.firstSelectedId.value):!1);async function F(){try{await l(M.value)}catch(oe){y.pushToast({type:"error",message:String(oe)})}}function te(){if(!S.value.isDeleteEnabled)return;if(r){b(E(r).componentId);return}const oe=t.selection.value.map(Te=>Te.componentId);oe.length!==0&&b(...oe)}const J=H(()=>[{value:"add",label:"Add child",icon:"plus",disabled:!S.value.isAddEnabled},{value:"moveUp",label:"Move up",shortcut:`${Wr()}↑`,icon:"arrow-up",disabled:!S.value.isMoveUpEnabled},{value:"moveDown",label:"Move down",shortcut:`${Wr()}↓`,icon:"arrow-down",disabled:!S.value.isMoveDownEnabled},{value:"cut",label:"Cut",shortcut:`${Wr()}X`,icon:"scissors",disabled:!S.value.isCutEnabled},{value:"copy",label:"Copy",shortcut:`${Wr()}C`,icon:"clipboard",disabled:!S.value.isCopyEnabled},{value:"paste",label:"Paste",shortcut:`${Wr()}V`,icon:"clipboard-paste",disabled:!L.value},{value:"goToParent",label:"View parent",shortcut:`${Wr()}⇧↑`,icon:"list-tree",disabled:!S.value.isGoToParentEnabled},{value:"delete",label:"Delete",shortcut:Vd()?"⌫":"Del",icon:"trash-2",variant:"danger",disabled:!S.value.isDeleteEnabled}]);function be(oe){var Te;switch(oe){case"add":break;case"moveUp":o(M.value);break;case"moveDown":s(M.value);break;case"cut":i(M.value);break;case"copy":c(M.value);break;case"paste":F();break;case"goToParent":v(M.value,x.value);break;case"delete":te();break}(Te=n[oe])==null||Te.call(n)}return{dropdownOptions:J,handleDropdownSelect:be}}function a8(e){return e.map(t=>`${t.componentId}:${t.instanceNumber}`).join(",")}function Fde(e){return e?e.split(",").map(t=>{const[a,n]=t.split(":");return{componentId:a,instanceNumber:Number(n)}}):[]}const d0e={class:"BlueprintsNodeActions"},u0e=$e({__name:"BlueprintsNodeActions",props:{showDisplayErrorOption:{type:Boolean}},emits:{showError:()=>!0},setup(e,{emit:t}){const a=re(ne.core),n=re(ne.builderManager),r=re(ne.componentId),o=re(ne.instancePath),s=e,i=t,{component:l,definition:c}=e8(a,r),d=o0e(l,c),u=Hd(a),{copy:h,copied:f}=Lg();function m(){h(d.value)}const g=c0e(a,n,u,{},{instancePath:a8(o),componentId:r});function _(y){switch(l0e(y)&&g.handleDropdownSelect(y),y){case"showError":i("showError");break}}const b=new Set([ls.Add,ls.MoveUp,ls.MoveDown,ls.Paste]),v=H(()=>{const y=g.dropdownOptions.value.filter(M=>!b.has(M.value)).map(M=>(delete M.shortcut,M));return s.showDisplayErrorOption&&y.unshift({value:"showError",label:"Add error path",icon:"split"}),y});return(y,M)=>($(),R("div",d0e,[E(d)?($(),Ie(La,{key:0,size:"smallIcon",variant:"neutral","data-writer-tooltip-placement":"bottom","data-writer-unselectable":!0,"data-writer-tooltip":E(f)?"Copied!":"Copy result variable",onClick:sn(m,["prevent"])},{default:Xe(()=>[Ce(_t,{name:"at-sign"})]),_:1},8,["data-writer-tooltip"])):ge("",!0),Ce(t8,{"data-automation-action":"node-actions-dropdown",options:v.value,"data-writer-unselectable":!0,"trigger-custom-size":"32px","trigger-icon":"ellipsis-vertical",onSelect:_},null,8,["options"])]))}}),Rm=ke(u0e,[["__scopeId","data-v-ca70c7e7"]]),h0e={class:"BlueprintsNodeOutput"},p0e=["data-writer-socket-id"],f0e=$e({__name:"BlueprintsNodeOutput",props:{outId:{type:String,required:!0},out:{type:Object,required:!0},displayLabel:{type:Boolean}},emits:{click:()=>!0},setup(e){return(t,a)=>($(),R("div",h0e,[e.displayLabel?($(),R(Je,{key:0},[pa(je(e.out.name),1)],64)):ge("",!0),Z("div",{class:ft(["BlueprintsNodeOutput__ball",e.out.style]),"data-writer-socket-id":e.outId,"data-writer-unselectable":!0,onClickCapture:a[0]||(a[0]=sn(()=>{},["stop"])),onMousedownCapture:a[1]||(a[1]=sn(n=>t.$emit("click"),["stop"]))},null,42,p0e)]))}}),rc=ke(f0e,[["__scopeId","data-v-cbba3510"]]),m0e={class:"BlueprintsNodeLogs"},v0e=$e({__name:"BlueprintsNodeLogs",props:{count:{type:Number,required:!0},completionStyle:{type:String,required:!1,default:void 0}},emits:{click:()=>!0},setup(e){const t=e,a=H(()=>t.count===1?"1 output":`${t.count} outputs`);return(n,r)=>($(),R("div",m0e,[Z("button",{class:ft(["BlueprintsNodeLogs__btn",{"BlueprintsNodeLogs__btn--success":e.completionStyle=="success","BlueprintsNodeLogs__btn--skipped":e.completionStyle=="skipped","BlueprintsNodeLogs__btn--stopped":e.completionStyle=="stopped","BlueprintsNodeLogs__btn--error":e.completionStyle=="error"}]),"data-writer-unselectable":!0,type:"button",onClick:r[0]||(r[0]=o=>n.$emit("click"))},je(a.value),3)]))}}),g0e=ke(v0e,[["__scopeId","data-v-daf51f8d"]]);function jc(e){if(!e)return{};if(typeof e=="string")try{const t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}return typeof e=="object"?e:{}}function y0e(e,t){const a=H(()=>{var i;const r=Object.entries(((i=e.value)==null?void 0:i.fields)??{}).filter(([l,c])=>c.type===Q.Tools);if(r.length===0)return!1;const o=r.map(([l])=>{var c;return{fieldKey:l,tools:jc((c=t[l])==null?void 0:c.value)}});return o.some(({tools:l})=>Object.keys(l).length>0)?o.every(({tools:l})=>{const c=Object.keys(l);return c.length===0?!0:!c.some(d=>{var u;return((u=l[d])==null?void 0:u.type)==="function"})}):!1});function n(r){var i;const o=jc((i=t[r])==null?void 0:i.value),s=Object.keys(o);return s.length===0?!1:!s.some(l=>{var c;return((c=o[l])==null?void 0:c.type)==="function"})}return{hasOnlyNonFunctionTools:a,hasToolsButNoFunctionTools:n}}const M0e={key:0,class:"BlueprintsNode__main__outputs__output BlueprintsNode__main__outputs__empty"},_0e=$e({__name:"BlueprintsNodeTools",props:{fieldKey:{},fieldType:{},fieldValue:{},hasOutputs:{type:Boolean}},setup(e){const t=e,a=H(()=>t.fieldType!==Q.Tools?{}:jc(t.fieldValue)),n=H(()=>{if(t.fieldType!==Q.Tools)return!1;const l=Object.keys(a.value);return l.length===0?!1:!l.some(c=>{var d;return((d=a.value[c])==null?void 0:d.type)==="function"})});function r(l){return l!==null&&typeof l=="object"&&"type"in l&&l.type==="function"}const o=H(()=>Object.keys(a.value).filter(l=>!r(a.value[l]))),s=H(()=>o.value.length>0?o.value.join(", "):!t.hasOutputs&&n.value?"No outputs":"None configured."),i=H(()=>!t.hasOutputs||o.value.length>0);return(l,c)=>i.value?($(),R("div",M0e,je(s.value),1)):ge("",!0)}}),b0e=ke(_0e,[["__scopeId","data-v-09778394"]]);function n8(e,t){var r,o;if((t==null?void 0:t.type)!=="blueprints_shared")return null;const a=(r=t.content)==null?void 0:r.sourceBlueprintId;if(!a)return null;const n=e.getComponentById(a);return((o=n==null?void 0:n.content)==null?void 0:o.key)||null}function jde(e,t){const a=H(()=>e.getComponentDefinition(E(t).type)),n=H(()=>{var c;const s=E(t),{type:i,content:l}=s;return i=="html"&&(l!=null&&l.element)?l==null?void 0:l.element:i=="blueprints_blueprint"?(l==null?void 0:l.key)||"Blueprint":i=="blueprints_shared"?n8(e,s)||"Shared Blueprint":((c=a.value)==null?void 0:c.name)??`Unknown (${i})`}),r=H(()=>{var d,u;const s=(d=a.value)==null?void 0:d.previewField;if(!s)return;const i=(u=E(t).content)==null?void 0:u[s];let l;const c=70;return(i==null?void 0:i.length)>c?l=i.substring(0,c)+"...":l=i,l}),o=H(()=>{const s=E(t).type,i=a.value.category;return[`/components/${s}.svg`,`/components/category_${i}.svg`,s.startsWith("blueprints_")?`/components/blueprints_category_${i}.svg`:void 0].filter(Boolean).map(l=>Li(l))});return{name:n,previewText:r,possibleImageUrls:o}}const w0e={key:0,class:"BlueprintsNode__side"},x0e={class:"BlueprintsNode__extraBorder"},C0e={key:0,class:"runner"},A0e={class:"BlueprintsNode__main"},S0e={class:"BlueprintsNode__main__title"},$0e={key:0,class:"deprecationNotice"},E0e={key:0,class:"BlueprintsNode__main__outputs__title"},I0e={key:0,class:"BlueprintsNode__main__outputs__title"},k0e={key:1,class:"BlueprintsNode__main__footer"},T0e={writer:{name:"Node",description:"A Blueprints node.",toolkit:"blueprints",category:"Other",fields:{alias:{name:"Alias",type:Q.Text}},allowedParentTypes:["blueprints_blueprint"],previewField:"alias"}},P0e=$e({...T0e,__name:"BlueprintsNode",emits:["outMousedown","engaged"],setup(e,{emit:t}){const a=t,n=re(ne.core),r=re(ne.builderManager),{removeOut:o}=Bs(n,r),s=re(ne.componentId),i=re(ne.evaluatedFields),l=H(()=>{var K;return((K=h==null?void 0:h.value)==null?void 0:K.category)=="Triggers"}),c=H(()=>{var K;return((K=h==null?void 0:h.value)==null?void 0:K.category)=="Writer"}),d=H(()=>{var K;return(K=h==null?void 0:h.value)==null?void 0:K.deprecated}),{component:u,definition:h}=e8(n,s),f=H(()=>{var K;return u.value&&(n8(n,u.value)||((K=h.value)==null?void 0:K.name))||"Unknown"}),m=H(()=>{var K,G,T;return S.value==null?null:S.value=="skipped"?"skipped":S.value=="stopped"?"stopped":S.value=="in_progress"?"running":((T=(G=(K=h.value)==null?void 0:K.outs)==null?void 0:G[S.value])==null?void 0:T.style)??"success"}),{hasOnlyNonFunctionTools:g}=y0e(H(()=>h.value),i),_=H(()=>Object.entries(h.value.outs??{}).some(([G,T])=>{var k,C;return T.style!=="dynamic"||!T.field?!1:((C=(k=h.value.fields)==null?void 0:k[T.field])==null?void 0:C.type)!==Q.Tools})),b=H(()=>_.value?"OR":g.value?"No outputs":"THEN"),v=H(()=>g.value||!oe.value&&Object.keys(Me.value).length>0),y=H(()=>{var T,O;const K=r.getLogEntries(),G=((O=(T=K.find(k=>!!k.blueprintExecution))==null?void 0:T.blueprintExecution)==null?void 0:O.runId)??null;return K.filter(k=>{var C;return((C=k==null?void 0:k.blueprintExecution)==null?void 0:C.runId)===G})}),M={in_progress:5,error:4,success:3,stopped:2,skipped:1,none:0},x=H(()=>y.value.map(G=>G.blueprintExecution).filter(Boolean).flatMap(G=>G.summary.filter(T=>T.componentId===u.value.id).filter(T=>!!T.outcome))),S=H(()=>{let K="none";for(const G of x.value)(M[G.outcome]??M.success)>M[K]&&(K=G.outcome);return K==="none"?null:K}),L=H(()=>r.isComponentIdSelected(s)),F=ye(!1),te=H(()=>!J.value||be.value?!1:!F.value),J=H(()=>{var K,G;return((G=(K=h.value)==null?void 0:K.outs)==null?void 0:G.error)!==void 0}),be=H(()=>{var G;return J.value?((G=u.value.outs)==null?void 0:G.some(T=>T.outId==="error"))?!0:F.value:!1}),oe=H(()=>!(Object.keys(Me.value??{}).length>0||Object.keys(Ue.value??{}).length>0||Object.keys(Te.value??{}).length>1)),Te=H(()=>Object.entries(h.value.outs??{}).reduce((K,[G,T])=>(T.style=="dynamic"||G==="error"&&!be.value||(K[G]=T),K),{}),{}),Ue=H(()=>{var G;const K=new Set([...Object.keys(Te.value),...Object.values(Me.value).flatMap(Object.keys)]);return(((G=u.value)==null?void 0:G.outs)??[]).reduce((T,{outId:O})=>{if(!K.has(O))return T[O]={name:O,style:"dynamic",description:""},T},{})});function Ze(K){const T=h.value.fields[K].type==Q.Tools,O=Object.keys(i[K].value??{});return T?O.filter(C=>{var P;return((P=i[K].value[C])==null?void 0:P.type)=="function"}):O}const Me=H(()=>{const K={};return Object.entries(h.value.outs??{}).forEach(([G,T])=>{if(T.style!=="dynamic")return;if(!T.field){K.default??(K.default={}),K.default[G]={...T};return}K[T.field]={},Ze(T.field).forEach(k=>{K[T.field][`${G}_${k}`]={name:k,description:"Dynamically created",style:"dynamic"}})}),K});We(Me,()=>{var T,O;const K=Object.values(Me.value).flatMap(Object.keys);(((O=(T=u.value)==null?void 0:T.outs)==null?void 0:O.filter(k=>!K.includes(k.outId)&&!(k.outId in Te.value)))??[]).forEach(k=>{u.value&&o(u.value.id,k)})},{immediate:!0});const ee=H(()=>{if(["success","error","skipped","stopped"].includes(m.value)){const G=`/status/${m.value}.svg`;return[Li(G)]}const K=[`/components/${u.value.type}.svg`,`/components/blueprints_category_${h.value.category}.svg`];return n.featureFlags.value.includes("custom_block_icons")&&K.unshift(`/static/components/${u.value.id}.svg`),K.map(G=>Li(G))});function j(){x.value.at(-1)&&(r.openPanels.value.add("log"),r.setSelection(s,void 0,"click"))}return We(L,()=>{a("engaged")}),(K,G)=>($(),R("div",{class:ft(["BlueprintsNode",{"BlueprintsNode--trigger":l.value,"BlueprintsNode--intelligent":c.value,"BlueprintsNode--deprecated":d.value,"BlueprintsNode--running":m.value=="running","BlueprintsNode--success":m.value=="success","BlueprintsNode--skipped":m.value=="skipped","BlueprintsNode--stopped":m.value=="stopped","BlueprintsNode--error":m.value=="error"}])},[c.value&&m.value===null?($(),R("div",w0e)):ge("",!0),Z("div",x0e,[m.value=="running"?($(),R("div",C0e)):ge("",!0)]),Z("div",A0e,[Z("div",S0e,[Ce(qg,{urls:ee.value,class:"icon","loader-max-width-px":24,"loader-max-height-px":24},null,8,["urls"]),Ce(r0e,{"component-id":E(s),class:"nodeNamer","block-name":f.value},null,8,["component-id","block-name"]),d.value?($(),R("div",$0e," Deprecated ")):ge("",!0),l.value?($(),Ie(Rm,{key:1,"show-display-error-option":te.value,onShowError:G[0]||(G[0]=T=>F.value=!0)},null,8,["show-display-error-option"])):ge("",!0)]),($(!0),R(Je,null,Ot(Me.value,(T,O)=>{var k,C,P,ae;return $(),R("div",{key:O,class:"BlueprintsNode__main__outputs"},[(k=E(h).fields)!=null&&k[O]?($(),R("h4",E0e,je(E(h).fields[O].name),1)):ge("",!0),($(!0),R(Je,null,Ot(T,(xe,ve)=>($(),Ie(rc,{key:ve,class:"BlueprintsNode__main__outputs__output","out-id":ve,out:xe,"display-label":"",onClick:ze=>K.$emit("outMousedown",ve)},null,8,["out-id","out","onClick"]))),128)),Ce(b0e,{"field-key":O,"field-type":((P=(C=E(h).fields)==null?void 0:C[O])==null?void 0:P.type)??"","field-value":(ae=E(i)[O])==null?void 0:ae.value,"has-outputs":Object.keys(T).length>0},null,8,["field-key","field-type","field-value","has-outputs"])])}),128)),Object.keys(Te.value).length>0?($(),R("div",{key:0,class:ft(["BlueprintsNode__main__outputs",{"BlueprintsNode__main__outputs--float":oe.value&&!l.value}])},[v.value?($(),R("h4",I0e,je(b.value),1)):ge("",!0),($(!0),R(Je,null,Ot(Te.value,(T,O)=>($(),Ie(rc,{key:O,class:"BlueprintsNode__main__outputs__output","out-id":O,out:T,"display-label":!oe.value,onClick:k=>K.$emit("outMousedown",O)},null,8,["out-id","out","display-label","onClick"]))),128)),($(!0),R(Je,null,Ot(Ue.value,(T,O)=>($(),Ie(rc,{key:O,class:"BlueprintsNode__main__outputs__output","out-id":O,out:T,"display-label":"",onClick:k=>K.$emit("outMousedown",O)},null,8,["out-id","out","onClick"]))),128))],2)):ge("",!0),l.value?ge("",!0):($(),R("div",k0e,[x.value.length>0?($(),Ie(g0e,{key:0,"completion-style":m.value,count:x.value.length,onClick:j},null,8,["completion-style","count"])):ge("",!0),Ce(Rm,{"show-display-error-option":te.value,onShowError:G[1]||(G[1]=T=>F.value=!0)},null,8,["show-display-error-option"])]))])],2))}}),L0e=ke(P0e,[["__scopeId","data-v-810cc87f"]]),V0e={class:"BlueprintsRoot","data-writer-container":""},O0e="The root component of the application, which serves as the starting point of the component hierarchy.",H0e={writer:{name:"Blueprints Root",toolkit:"blueprints",category:"Root",description:O0e,allowedChildrenTypes:["blueprints_blueprint"],fields:{}}},R0e=$e({...H0e,__name:"BlueprintsRoot",setup(e){const t=re(ne.core),a=re(ne.getChildrenVNodes),n=H(()=>{const r=t.activePageId.value;if(!!t.getComponentById(r)&&t.isChildOf("blueprints_root",r))return r;const s=t.getComponents("blueprints_root",{includeBMC:!0,includeCMC:!1,sortedByPosition:!0});return s.length==0?null:s[0].id});return ia(()=>{n.value&&t.activePageId.value!==n.value&&t.setActivePageId(n.value)}),(r,o)=>($(),R("div",V0e,[($(!0),R(Je,null,Ot(E(a)(),s=>($(),R(Je,{key:s.key},[s.key===`${n.value}:0`?($(),Ie(Ts(s),{key:0})):ge("",!0)],64))),128))]))}}),N0e=ke(R0e,[["__scopeId","data-v-367e0c79"]]),D0e={name:"Note",description:"Internal note displayed only in edit mode",category:"Internal",fields:{parentInstancePath:{name:"Parent's instance path",type:Q.Text},content:{name:"Content",type:Q.Text,control:Ui.Textarea},createdAt:{name:"Created At",type:Q.Text},createdBy:{name:"Created By",type:Q.Number}}},B0e={writer:D0e};function F0e(e,t,a,n,r,o){return ge("",!0)}const j0e=ke(B0e,[["render",F0e]]);let r8=[];function U0e(e){r8=e??[]}function o8(e){return!e||e.length===0?!0:e.some(t=>r8.includes(t))}const vl={root:R2e,page:$2e,sidebar:L1e,button:ple,text:qae,section:x1e,header:m1e,heading:rae,dataframe:Jte,html:Jg,pagination:Vle,repeater:Nle,column:o1e,columns:c1e,tab:N1e,tabs:W1e,link:rne,horizontalstack:M1e,separator:$1e,image:uae,pdf:s2e,iframe:f2e,googlemaps:_2e,mapbox:j2e,timer:Ule,textinput:bie,textareainput:Sie,numberinput:Fse,sliderinput:cie,rangeinput:vie,colorinput:Roe,dateinput:Uoe,timeinput:Pie,radioinput:Kse,checkboxinput:Eoe,dropdowninput:Joe,selectinput:Yse,multiselectinput:Hse,fileinput:_se,webcamcapture:Xle,vegalitechart:Kae,plotlygraph:Oae,metric:Tae,message:xae,videoplayer:Qae,chatbot:are,step:ele,steps:ile,ratinginput:Fie,tags:ure,switchinput:Zie,reuse:Qle,avatar:Mre,annotatedtext:xre,jsonviewer:soe,blueprints_root:N0e,blueprints_blueprint:Qce,progressbar:yoe,note:j0e},wi=Ri({});function Nm(e){const t=`Component type "${e}" not supported. If it's a custom component, please ensure it's been loaded.`;return{writer:{name:"Fallback Component",allowedChildrenTypes:["*"],description:t,category:"Fallback"},setup(a,{slots:n}){return()=>En("div",{"data-writer-container":"",style:{color:"var(--primaryTextColor)"}},[t,n.default({})])}}}function z0e(e){var r,o;const t={blueprints_node:L0e},a=wi[e];if(!a)return;const n=a.baseType;return{...t[n],writer:{...t[n].writer,...wi[e].writer,fields:{...(r=t[n].writer)==null?void 0:r.fields,...(o=wi[e].writer)==null?void 0:o.fields}}}}function q0e(e){var n;const t=z0e(e)??vl[e]??Nm(e),a=(n=t==null?void 0:t.writer)==null?void 0:n.featureFlags;return o8(a)?t:Nm(e)}function Vi(e){var t;return(t=q0e(e))==null?void 0:t.writer}function Rd(){return[...Object.keys(vl),...Object.keys(wi)].filter(t=>{var n,r;const a=(r=(n=vl[t])==null?void 0:n.writer)==null?void 0:r.featureFlags;return o8(a)})}function W0e(e,t){vl[e]=t}function Z0e(e,t){wi[e]=t}function K0e(e){let t=!1;return J0e(e),Object.entries(e).forEach(([,a])=>{t=Q0e(a,e)||t,t=G0e(a)||t}),t}function G0e(e){const t=fa(),a=Vi(e.type);if(!a||a.category=="Fallback")return t.error(`Component ${e.id} (${e.type}). Invalid component type.`),!1;let n=!1;return n=ade(e),n=tde(e)||n,X0e(e,a),Y0e(e,a),n}function Uc(e,t,a={}){a[e]=!0,Object.entries(t).filter(([,n])=>n.parentId===e).forEach(([n])=>Uc(n,t,a))}function J0e(e){const t=fa(),a=Object.fromEntries(Object.entries(e).map(([n])=>[n,!1]));Uc("root",e,a),Uc("blueprints_root",e,a),Object.entries(a).forEach(([n,r])=>{r||t.warn(`Component ${n} (${e[n].type}). Orphan component.`)})}function X0e(e,t){const a=fa(),n=Object.keys(t.fields??{});e.content&&Object.keys(e.content).forEach(r=>{n.includes(r)||a.warn(`Component ${e.id} (${e.type}). Field key "${r}" is defined in the component but not in the template.`)})}function Y0e(e,t){const a=Object.keys(t.events??{});if(!e.binding)return;const n=e.binding.eventType;if(a.includes(n)&&t.events[n].bindable)return;fa().warn(`Component ${e.id} (${e.type}). The component is bound to event "${e.binding.eventType}" but the template doesn't define that event or it's not bindable.`)}function Q0e(e,t){const a=fa();let n=!1;e.id=="root"&&e.position!==0&&a.error("Root must be at position 0."),e.position==-1&&a.error(`Component ${e.id} (${e.type}). Invalid position.`);const r=Object.values(t).filter(i=>i.parentId===e.id&&i.position!==-2&&!i.isCodeManaged);let o=0;return r.forEach(i=>{o+=i.position}),(r.length-1)*r.length/2!==o&&(a.error(`Component ${e.id} (${e.type}). Invalid children positions. Automated fix will be applied.`),ede(r),n=!0),n}function ede(e){e.sort((t,a)=>t.position>a.position?1:-1),e.map((t,a)=>{t.position=a})}function tde(e){var a,n,r;let t=!1;if(Object.keys(e.handlers??{}).forEach(o=>{if(!o.startsWith("ss-"))return;const s=`wf-${o.substring(3)}`;e.handlers[s]=e.handlers[o],t=!0,delete e.handlers[o]}),(n=(a=e.binding)==null?void 0:a.eventType)!=null&&n.startsWith("ss-")){const s=`wf-${((r=e.binding)==null?void 0:r.eventType).substring(3)}`;e.binding.eventType=s,t=!0}return t}function ade(e,t){let a=!1;if(e.type=="column"){if("horizontalAlignment"in e.content){const n={left:"start",center:"center",right:"end"};e.content.contentHAlign=n[e.content.horizontalAlignment]||e.content.horizontalAlignment,delete e.content.horizontalAlignment,a=!0}if("verticalAlignment"in e.content){const n={normal:"unset",top:"start",center:"center",bottom:"end"};e.content.contentVAlign=n[e.content.verticalAlignment]||e.content.verticalAlignment,delete e.content.verticalAlignment,a=!0}}else if(e.type=="horizontalstack"){if("alignment"in e.content){const n={left:"start",center:"center",right:"end"};e.content.contentHAlign=n[e.content.alignment]||e.content.alignment,delete e.content.alignment,a=!0}}else e.type=="section"&&"snapMode"in e.content&&(delete e.content.snapMode,a=!0);return a}function nde(e){let t="";const a=[];let n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s==="."&&!n){a.push(t),t="";continue}t+=s,s==="\\"?n=!0:n=!1}return a.push(t),a.map(o=>o.replaceAll("\\.","."))}const rde="WriterCustomComponentTemplates";async function ode(e){await Promise.all(e.map(async t=>{const a=t.toLocaleLowerCase();a.endsWith(".js")?await sde(t):a.endsWith(".css")&&lde(t)}))}async function sde(e){var a;const t=fa();t.log(`Importing custom component templates at "${e}"...`),await zt(()=>import(s8()+e),[],import.meta.url),(a=Object.entries(window[rde]))==null||a.forEach(([n,r])=>{ide(n)?(W0e(`custom_${n}`,r),t.log(`Registering template for "${n}".`)):t.warn(`custom component '${n}' is ignored. A custom component should be declared using only alphanumeric lowercase and _.`)})}function ide(e){return/^[a-z0-9_]+$/.test(e)}function lde(e){const t=document.createElement("link");t.rel="stylesheet",t.href=s8()+e,document.head.appendChild(t)}function s8(){let e=window.location.pathname;return e.endsWith("/")||(e+="/"),`${e}extensions/`}function cde(e){return new Promise((t,a)=>{const n=new FileReader;n.onload=()=>{t(n.result)},n.onerror=r=>{a(r)},n.readAsArrayBuffer(e)})}async function dde(e){const t=await cde(e);if(!t)return;const a=new TextDecoder("utf-8");return JSON.parse(a.decode(t))}function ude(e,t){const a=URL.createObjectURL(e);try{const n=document.createElement("a");n.href=a,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}finally{URL.revokeObjectURL(a)}}function Ude(e,t){const a=JSON.stringify(e,null,2),n=new Blob([a],{type:"application/json"});ude(n,t)}const i8=5e3,oc=5;function hde(e){return typeof e!="object"||e===null?!1:e.type==="file"&&typeof e.content=="string"}function zde(e){return typeof e!="object"||e===null?!1:e.type==="binary"}function Fs(e){return typeof e!="object"||e===null?!1:e.type==="directory"&&typeof e.children=="object"}function*pde(e,t=[]){if(!Fs(e)){yield t;return}for(const[a,n]of Object.entries(e.children))yield*pde(n,[...t,a])}function*fde(e,t=[]){if(yield t,!!Fs(e))for(const[a,n]of Object.entries(e.children))yield*fde(n,[...t,a])}function Nd(e,t){if(e.length===0)return t;if(!Fs(t))return;const[a,...n]=e,r=t.children[a];return n.length===0?r:Nd(n,r)}function zc(e,t,a={type:"file",content:"",complete:!0}){var o;const n=structuredClone(t);let r=n;for(let s=0;s<e.length;s++){if(!Fs(r))return n;const i=e.at(s);if(s===e.length-1)return r.children[i]=a,n;(o=r.children)[i]??(o[i]={type:"directory",children:{}}),r=r.children[i]}return n}function mde(e,t,a){const n=Nd(e,a);if(Fs(n)||n===void 0)return a;const r=l8(e,a);return zc(t,r,structuredClone(n))}function l8(e,t){return c8(e,structuredClone(t))}function c8(e,t){if(!Fs(t)||!(e.at(0)in t.children))return t;if(e.length===1)return delete t.children[e.at(0)],t;const a=c8(e.slice(1),t.children[e.at(0)]);return a.type==="directory"&&Object.keys(a.children).length===0&&delete t.children[e.at(0)],t}const vde=6e4;function gde(){let e=null;const t=ye(null),a=ye(null),n=ye(),r=$t([]),o=ye(null),s=$t({type:"directory",children:{}}),i=ye({}),l=ye([]),c=ye({}),d=ye({});let u;const h=ye("idle");let f=0;const m=ye(new Map);let g=[],_=[];const b=[];let v=!1;const y=ye(),M=H(()=>{var ie;return Number((ie=n.value)==null?void 0:ie.organizationId)||void 0}),x=H(()=>{var ie;return(ie=n.value)==null?void 0:ie.id}),S=H(()=>{var ie;return(ie=n.value)==null?void 0:ie.apiKey}),L=H(()=>{var ie;return((ie=n.value)==null?void 0:ie.baseUrl)??"https://api.writer.com"}),F=H(()=>!!(x.value||M.value));async function te(){await J(),oe(),a.value=="edit"}async function J(){Ze();let ie=null,Ee=null;try{Ee=await fetch("./api/init",{method:"post",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify({proposedSessionId:e})});const Pe=await Ee.text();ie=JSON.parse(Pe)}catch{throw new Error(`Failed to acquire initialization data. Server responded with ${(Ee==null?void 0:Ee.status)??"no response"} status.`)}if(Ee.status>400)throw"Connection rejected.";ie.extensionPaths&&await ode(ie.extensionPaths),a.value=ie.mode,i.value=ie.components,d.value=ie.userState,c.value=structuredClone(ie.userState),j(ie.mail),e=ie.sessionId,t.value=new Date().getTime(),r.value=ie.featureFlags,U0e(r.value),n.value=ie.writerApplication,be(ie.abstractTemplates),l.value=ie.userFunctions,o.value=ie.runCode,s.value=ie.sourceFiles,await Me(),!(a.value!="edit"||!K0e(ie.components))&&await pe()}function be(ie){Object.entries(ie??{}).forEach(([Ee,Oe])=>{Z0e(Ee,Oe)})}function oe(){setTimeout(()=>{me("keepAlive",{},oe)},vde)}function Te(ie){ie&&Object.entries(ie).forEach(([Ee,Oe])=>{const Pe=Ee.charAt(0),Ke=nde(Ee.substring(1)),it=Ke.length-1;let ht=d.value;const Ft=Pe==="-";for(let ma=0;ma<it;ma++){const Wt=ht==null?void 0:ht[Ke[ma]];typeof Wt=="object"&&Wt!==null?ht=Wt:Ft||(ht[Ke[ma]]={},ht=ht[Ke[ma]])}Ft?delete ht[Ke.at(-1)]:ht[Ke.at(-1)]=Oe})}function Ue(ie){ie&&(i.value=ie)}function Ze(){m.value.forEach(({callback:ie})=>{ie==null||ie({ok:!1})}),m.value.clear()}async function Me(){if(u&&h.value==="connected")return;const ie=fa(),Ee=new URL("./api/stream",window.location.href);Ee.protocol=Ee.protocol.replace("https","wss"),Ee.protocol=Ee.protocol.replace("http","ws"),u=new WebSocket(Ee.href),u.onopen=()=>{h.value="connected",ie.log("WebSocket connected. Initialising stream..."),me("streamInit",{sessionId:e}),v&&(v=!1,pe().catch(Pe=>{ie.error("Failed to retry component update after reconnect:",Pe),v=!0}))};function Oe(Pe){var it,ht,Ft,ma;if(Pe.messageType=="announcement"&&Pe.payload.type=="codeUpdate"){u.close(),J();return}if(Pe.messageType=="announcement"&&Pe.payload.type=="collaborationUpdate"){b.forEach(Wt=>Wt.fn(Pe.payload.payload));return}if(Pe.messageType=="announcement"&&Pe.payload.type=="componentUpdate"){const Wt={};Object.entries(i.value).forEach(([ln,Pr])=>{Pr.isCodeManaged&&(Wt[ln]=Pr)}),i.value={...Wt,...Pe.payload.payload};return}if(Pe.messageType=="announcement"&&Pe.payload.type=="mail"){j(Pe.payload.payload);return}(Pe.messageType=="eventResponse"||Pe.messageType=="stateEnquiryResponse")&&(Te((it=Pe.payload)==null?void 0:it.mutations),j((ht=Pe.payload)==null?void 0:ht.mail),Ue((Ft=Pe.payload)==null?void 0:Ft.components));const Ke=m.value.get(Pe.trackingId);(ma=Ke==null?void 0:Ke.callback)==null||ma.call(Ke,{ok:!0,payload:Pe.payload}),m.value.delete(Pe.trackingId)}return u.onmessage=async Pe=>{let Ke;try{Pe.data instanceof Blob?Ke=await dde(Pe.data):Ke=JSON.parse(Pe.data)}catch(it){ie.error("Error parsing WebSocket message:",it);return}try{Oe(Ke)}catch(it){ie.error("Error processing WebSocket message:",it)}},u.onclose=async Pe=>{if(u=null,Pe.code==1008){h.value="offline",ie.error("Invalid session. Reinitialising..."),await J();return}Pe.code==4001?(h.value="suspended",ie.info("WebSocket closed due to code update. Attempting to reconnect...")):(h.value="offline",ie.error(`WebSocket closed with code ${Pe.code}. Attempting to reconnect...`)),setTimeout(async()=>{try{await Me(),ie.info("Reconnected.")}catch{ie.error("Couldn't reconnect.")}},i8)},new Promise((Pe,Ke)=>{u.addEventListener("open",()=>Pe(),{once:!0}),u.addEventListener("close",()=>{Ke(new Error("WebSocket connection closed before establishing."))},{once:!0})})}function ee(ie=1e3){u&&(u.onclose=()=>{},u.close(ie),h.value="offline")}function j(ie=[]){g.push(...ie),g=g.filter(Ee=>{const Oe=_.filter(Pe=>Pe.mailType==Ee.type);if(Oe.length==0)return Ee;Oe.forEach(Pe=>Pe.fn(Ee.payload))})}function K(ie){b.push({fn:ie})}function G(ie,Ee){_.push({mailType:ie,fn:Ee}),j()}function T(ie,Ee){_=_.filter(Oe=>!(Oe.mailType===ie&&Oe.fn===Ee))}function O(ie){var Oe;let Ee=null;if(ie instanceof CustomEvent)Ee=((Oe=ie.detail)==null?void 0:Oe.payload)??null;else{const Pe={};for(const Ke in ie){const it=ie[Ke];typeof it!="function"&&(it instanceof Object||(Pe[Ke]=it))}Ee=Pe}return Ee}async function k(ie,Ee,Oe){var Ft,ma;const Pe=Oe?O(ie):null;let Ke,it;ie instanceof CustomEvent&&(Ke=(Ft=ie.detail)==null?void 0:Ft.callback,it=(ma=ie.detail)==null?void 0:ma.handler),me("event",async()=>({type:ie.type,instancePath:Ee,handler:it,payload:await Pe}),Ke,!0)}async function C(ie){return new Promise(Ee=>{me("collaborationPing",ie,()=>{Ee()})})}async function P(ie){return new Promise((Ee,Oe)=>{me("hashRequest",{message:ie},Ke=>{var it;if(!Ke.ok)return Oe("Couldn't connect to the server.");Ee((it=Ke.payload)==null?void 0:it.message)})})}function ae(ie,Ee){const Oe=structuredClone(St(s.value)),Pe=Nd(Ee,Oe);hde(Pe)&&(Pe.content=ie,Pe.complete=!0,s.value=Oe)}async function xe(ie){return new Promise((Ee,Oe)=>{me("createSourceFile",{path:ie},Ke=>{var it;if(!Ke.ok)return Oe("Couldn't connect to the server.");if((it=Ke.payload)!=null&&it.error)return Oe("Couldn't create the file.");s.value=zc(ie,St(s.value)),Ee()})})}async function ve(ie,Ee){return new Promise((Oe,Pe)=>{me("uploadSourceFile",{path:ie,content:Ee},it=>{var ht,Ft;if(!it.ok)return Pe("Couldn't connect to the server.");if((ht=it.payload)!=null&&ht.error)return Pe("Couldn't upload the file.");s.value=((Ft=it.payload)==null?void 0:Ft.sourceFiles)??zc(ie,St(s.value)),Oe()})})}async function ze(ie,Ee){return new Promise((Oe,Pe)=>{me("renameSourceFile",{from:ie,to:Ee},it=>{var ht;if(!it.ok)return Pe("Couldn't connect to the server.");if((ht=it.payload)!=null&&ht.error)return Pe("Couldn't rename the file.");s.value=mde(ie,Ee,St(s.value)),Oe()})})}async function Ye(ie){return new Promise((Ee,Oe)=>{me("deleteSourceFile",{path:ie},Ke=>{var it;if(!Ke.ok)return Oe("Couldn't connect to the server.");if((it=Ke.payload)!=null&&it.error)return Oe("Couldn't delete the file.");s.value=l8(ie,St(s.value)),Ee()})})}async function ct(ie,Ee=["main.py"]){return new Promise((Oe,Pe)=>{me("codeSaveRequest",{code:ie,path:Ee},it=>{if(!it.ok)return Pe("Couldn't connect to the server.");ae(ie,Ee),Oe()}),Ee.join("/")==="main.py"&&(h.value="suspended")})}function wt(ie){return new Promise((Ee,Oe)=>{me("loadSourceFile",{path:ie},Ke=>{if(!Ke.ok)return Oe("Couldn't connect to the server.");ae(Ke.payload.content,ie),Ee()})})}async function D(ie){return new Promise((Ee,Oe)=>{me("listResources",{resource_type:ie},Ke=>{var it;if(!Ke.ok)return Oe("Couldn't connect to the server.");Ee(((it=Ke.payload)==null?void 0:it.data)??[])})})}async function q(ie){me("stateEnquiry",{},ie,!0)}function he(ie){const Pe=(Ke=0)=>{const it=m.value.get(ie);it!==void 0&&(Ke==0&&it.type=="stateEnquiry"||q(()=>setTimeout(()=>Pe(Ke+1),150)))};setTimeout(()=>Pe(0),150)}async function me(ie,Ee,Oe,Pe=!1){if(h.value=="offline"||h.value=="suspended"){Oe==null||Oe({ok:!1});return}const Ke=fa(),it=f++;try{(Oe||Pe)&&m.value.set(it,{type:ie,callback:Oe}),Pe&&he(it);let ht;typeof Ee=="function"?ht=await Ee():ht=Ee;const Ft={type:ie,trackingId:it,payload:ht};if(u.readyState!==WebSocket.OPEN)throw"Connection lost.";u.send(JSON.stringify(Ft,G3))}catch(ht){Ke.error("sendFrontendMessage error",ht),Oe==null||Oe({ok:!1})}}function _e(ie){delete i.value[ie]}function Ae(ie){i.value[ie.id]=ie}async function pe(){const ie={};Object.entries(i.value).forEach(([Oe,Pe])=>{Pe.isCodeManaged||(ie[Oe]=Pe)});const Ee={components:ie};return new Promise((Oe,Pe)=>{me("componentUpdate",Ee,it=>{if(!it.ok)return v=!0,Pe("Couldn't connect to the server.");Oe()})})}async function ce(){return new Promise((ie,Ee)=>{me("writerVaultUpdate",{},Pe=>{if(!Pe.ok)return Ee("Couldn't connect to the server.");ie()})})}function ue(ie){return i.value[ie]}function I(ie,Ee){let Oe=i.value[Ee];do{if(Oe.parentId==ie)return!0;Oe=i.value[Oe.parentId]}while(Oe);return!1}function B(ie,{includeBMC:Ee=!0,includeCMC:Oe=!0,sortedByPosition:Pe=!1}={}){let Ke=Object.values(i.value);return typeof ie<"u"&&(Ke=Ke.filter(it=>it.parentId==ie)),Ke=Ke.filter(it=>{const ht=it.isCodeManaged;return Ee&&!ht||Oe&&ht}),Pe&&(Ke=Ke.sort((it,ht)=>it.isCodeManaged&&!ht.isCodeManaged?1:!it.isCodeManaged&&ht.isCodeManaged?-1:it.position>ht.position?1:-1)),Ke}function*N(ie,Ee={}){for(const Oe of B(ie,Ee))yield Oe,yield*N(Oe.id,Ee)}function U(ie){const Oe=B("root").filter(Pe=>Pe.content.key==ie);Oe.length!=0&&se(Oe[0].id)}function se(ie){y.value=ie}function Se(ie){return Ld(i.value,ie)}function Ne(){return u}return{webSocket:u,syncHealth:h,frontendMessageMap:jt(m),mode:jt(a),userFunctions:jt(l),addMailSubscription:G,removeMailSubscription:T,addCollaborationPingSubscription:K,init:te,forwardEvent:k,hashMessage:P,runCode:jt(o),sourceFiles:jt(s),sendCodeSaveRequest:ct,sendCreateSourceFileRequest:xe,sendRenameSourceFileRequest:ze,sendDeleteSourceFileRequest:Ye,sendFileUploadRequest:ve,requestSourceFileLoading:wt,sendListResourcesRequest:D,sendComponentUpdate:pe,sendWriterVaultUpdate:ce,sendCollaborationPing:C,addComponent:Ae,deleteComponent:_e,getComponentById:ue,getComponents:B,getComponentsNested:N,setActivePageId:se,activePageId:jt(y),setActivePageFromKey:U,getComponentDefinition:Vi,getSupportedComponentTypes:Rd,getContainableTypes:Se,sessionTimestamp:jt(t),userState:jt(d),userStateInitial:jt(c),isChildOf:I,featureFlags:jt(r),getWebSocket:Ne,stopSync:ee,writerApplication:jt(n),isWriterCloudApp:F,writerOrgId:M,writerAppId:x,writerApiKey:S,writerBaseUrl:L}}const yde=2e3,Mde=1e3,_de=5e3;function bde(e){const t=ye({});let a=null,n=null;const r=ye({}),o=ye(null),s=ye({}),i=ye([]),{writerApi:l}=io(),c=H(()=>{const b={};return i.value.forEach(v=>{var x,S;const y=v.userId;(((S=(x=r.value[y])==null?void 0:x.selection)==null?void 0:S.map(L=>L.instancePath))??[]).forEach(L=>{b[L]=[...b[L]??[],y]})}),b});function d(b){const v=b.userId;if(v!=null){if(b.action=="leave"){delete r.value[v];return}r.value={...r.value,[v]:b}}}function u(b,v,y){return b||v?`${b} ${v}`:y||"Unknown"}async function h(b){const v=s.value[b];if(v)return v;const y=await l.fetchThirdUserProfile(b),M=u(y.firstName,y.lastName,y.email);return s.value[b]={userId:b,displayName:M,avatar:y.avatar,email:y.email},s.value[b]}async function f(){const v=Object.keys(r.value).map(y=>h(parseInt(y)));return Promise.all(v)}async function m(){clearTimeout(n);const b=[];Object.keys(r.value).forEach(v=>{var x;const y=(x=r.value[v])==null?void 0:x.time;if(!y)return;Date.now()-new Date(y).getTime()>_de&&b.push(v)}),b.forEach(v=>delete r.value[v]),i.value=await f(),n=setTimeout(m,Mde)}function g(b){t.value={...t.value,...b}}function _(){e.sendCollaborationPing({userId:o.value,action:"auto",time:new Date,...t.value}),t.value.action="auto",clearTimeout(a),a=setTimeout(_,yde)}return{groomSnapshot:m,updateOutgoingPing:g,sendCollaborationPing:_,handleIncomingCollaborationUpdate:d,connectedProfiles:i,connectedUsersByInstancePath:c}}let Dm;async function qc(e=io().writerApi){return Dm??(Dm=e.fetchUserProfile()),await Dm}function qde(e=io().writerApi){const t=$t(),a=$t(),n=ye(!1);async function r(){a.value=void 0,n.value=!0;try{t.value=await qc(e)}catch(o){a.value=o,t.value=void 0}finally{n.value=!1}}return ia(r),{user:jt(t),isLoading:jt(n),error:jt(a)}}const L1={};function Wde(e,t=io().writerApi){const a=$t(),n=$t(),r=ye(!1);async function o(s){n.value=void 0,r.value=!0;try{L1[s]??(L1[s]=t.fetchUserById(s)),a.value=await L1[s]}catch(i){n.value=i,a.value=void 0}finally{r.value=!1}}return We(e,o,{immediate:!0}),{user:jt(a),isLoading:jt(r),error:jt(n)}}function wde(e,t){const a=Od(),{removeComponentSubtree:n,generateNewComponentId:r}=Bs(e,t),o=ye(!1),s=ye(),i=ye("show"),l=ye(),c=$t(),d=H(()=>s.value?y(s.value):void 0);async function u(S){const L=x(S).createdBy.value,F=await qc();return L===F.id}async function h(S,L="show"){if(S===void 0){c.value=void 0,s.value=void 0,i.value="show";return}if(L==="edit"){const F=y(S);if(!await u(F))return a.pushToast({type:"error",message:"You cannot edit this note because it was created by another user"})}i.value=L,s.value=S,f(S)}function f(S){let L=e.getComponentById(S);for(;L;){switch(L.type){case"blueprints_root":t.mode.value="blueprints";break;case"root":t.mode.value="ui";break;case"blueprints_blueprint":case"page":e.setActivePageId(L.id);break}L=e.getComponentById(L.parentId)}}async function m(S,L){let F;"instancePath"in L&&(F=typeof L.instancePath=="string"?L.instancePath:a8(L.instancePath));const te=await qc(),J=r();return c.value={id:J,type:"note",parentId:S,content:{parentInstancePath:F,content:"",createdBy:String(te.id),createdAt:new Date().toISOString()},x:"x"in L?L.x:void 0,y:"y"in L?L.y:void 0},await h(J,"edit"),J}We(s,()=>{c.value&&c.value.id!==s.value&&(c.value=void 0)});async function g(S){const L=y(S);if(!await u(L))return a.pushToast({type:"error",message:"You cannot delete this note because it was created by another user"});h(void 0),n(S)}function*_(){yield*v("root"),yield*v("blueprints_root")}function*b(S){if(!S){yield*_();return}const L=S.toLocaleLowerCase();for(const F of _()){if(!F.content.content)continue;String(F.content.content).toLocaleLowerCase().includes(L)&&(yield F)}}function*v(S){var L;for(const F of e.getComponentsNested(S))F.type==="note"&&(yield F);if(c.value){let F=c.value.parentId;for(;F;){if(F===S){yield jt(c.value);return}F=(L=e.getComponentById(F))==null?void 0:L.parentId}}}function y(S){var F;const L=e.getComponentById(S);if((L==null?void 0:L.type)==="note")return L;if(((F=c.value)==null?void 0:F.id)===S)return jt(c.value)}const M=S=>{var L;return String(((L=S.content)==null?void 0:L.content)??"")};function x(S){const L=new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}),F=H(()=>{var K,G,T;const Me=(K=E(S))==null?void 0:K.id,ee=(G=E(S))==null?void 0:G.content;return l.value===Me?"hover":((T=d.value)==null?void 0:T.id)===Me?ee.content?"active":"new":"default"}),te=H(()=>M(E(S))),J=H(()=>E(S).content.createdAt),be=H(()=>E(S).content.parentInstancePath),oe=H(()=>{var ee;const Me=(ee=E(S).content)==null?void 0:ee.createdBy;return Me?Number(Me):void 0}),Te=H(()=>{if(!J.value)return"";const Me=new Date(J.value);return L.format(Me)}),Ue=H(()=>Ze(E(S).id)==="blueprints_root"?"blueprints":"ui");function Ze(Me){const ee=e.getComponentById(Me);return ee?Ze(ee.parentId)??Me:Me}return{content:te,type:Ue,createdBy:oe,createdAt:J,createdAtFormatted:Te,state:F,parentInstancePath:be}}return{isAnnotating:o,createNote:m,getNotes:v,selectNote:h,searchNotes:b,getAllNotes:_,deleteNote:g,selectedNoteId:jt(s),selectedNoteMode:jt(i),selectedNote:d,hoveredNoteId:l,useNoteInformation:x,getNoteContent:M}}function xde(e){const t="vault",a=$t({}),n=ye(!1),r=ye(!1),o=ye(!1),{writerApi:s}=io();async function i(){try{return(await s.fetchSecret(e.writerOrgId.value,e.writerAppId.value,t)).secret}catch{return}}async function l(){if(e.isWriterCloudApp.value){n.value=!0,o.value=!1;try{const d=await i();a.value=d??{}}finally{n.value=!1}}}async function c(d){if(!e.isWriterCloudApp.value)return;r.value=!0,o.value=!1;const u=await i();try{u===void 0?await s.createSecret(e.writerOrgId.value,e.writerAppId.value,t,d):await s.updateSecret(e.writerOrgId.value,e.writerAppId.value,t,d),a.value=d}catch(h){o.value=h}finally{r.value=!1}}return{secrets:a,load:l,readonly:H(()=>n.value||r.value),isLoading:jt(n),isSaving:jt(r),update:c}}function Cde(e){const t=fa();async function a(){if(!e.isWriterCloudApp.value){t.log("Skipping config.js load - not a Writer Cloud App");return}if(!(typeof window<"u"&&window.__WRITER_APP_CONFIG__))try{const{writerApi:n}=io(),r=await n.fetchConfigJs(),o=document.createElement("script");o.textContent=r,document.head.appendChild(o)}catch(n){t.warn("Failed to load config.js via WriterApi ",n)}}return{loadConfigJs:a}}const _n=gde();globalThis.vue=aw;globalThis.injectionKeys=ne;globalThis.core=_n;const Kr=fa();async function Ade(){await _n.init();const e=_n.mode.value,t=e=="edit"?Ow():void 0,a=wde(_n,t),n=e=="edit"?xde(_n):void 0,r=e=="edit"?bde(_n):void 0;t&&(_n.addMailSubscription("logEntry",t.handleLogEntry),_n.addCollaborationPingSubscription(r.handleIncomingCollaborationUpdate),globalThis.wfbm=t),Kr.log(`Mounting app in mode ${e}...`);const{default:o}=e==="run"&&await zt(()=>import("./ComponentRenderer-BgoKk-_d.js"),__vite__mapDeps([18,19]),import.meta.url),{default:s}=e==="edit"&&await zt(()=>import("./BuilderApp-Bc8bFIhZ.js").then(c=>c.c),__vite__mapDeps([20,5,6,21,22]),import.meta.url),i=rl(o||s);i.use(Aw),i.provide(ne.core,_n),i.provide(ne.builderManager,t),i.provide(ne.notesManager,a),i.provide(ne.collaborationManager,r),i.provide(ne.secretsManager,n),i.mount("#app");const{loadConfigJs:l}=Cde(_n);l().catch(Kr.error),_n.isWriterCloudApp.value&&r&&await Sde(r).catch(Kr.error),_n.isWriterCloudApp.value&&n&&n.load().catch(Kr.error)}async function Sde(e){const{writerApi:t}=io(),a=await t.fetchUserProfile();e.updateOutgoingPing({userId:a.id,action:"join"}),e.sendCollaborationPing(),e.groomSnapshot(),window.addEventListener("beforeunload",function(){e.updateOutgoingPing({action:"leave"}),e.sendCollaborationPing()})}async function $de(){var e;for(let t=0;t<oc;t++)try{await Ade();return}catch(a){if(t<oc-1){if(Kr.warn(`Core initialization failed (attempt ${t+1}/${oc}). Retrying...`,a),document.getElementById("loading_L1")&&!document.getElementById("loading_message")&&t>=2){const r=document.createElement("div");r.id="loading_message",r.textContent=`We're getting things ready.
8525
8525
  Hang tight while we connect...`,r.style.cssText="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);margin-top:120px;text-align:center;font-family: 'Poppins','Helvetica Neue','Lucida Grande',sans-serif;color:#666;font-size:14px;line-height:1.4;max-width:400px;padding:0 20px;z-index:1000;white-space:pre-line;opacity:0;transition:opacity 0.5s ease-in;",(e=document.getElementById("loading_L1"))==null||e.appendChild(r),setTimeout(()=>{r.style.opacity="1"},50)}await new Promise(r=>setTimeout(r,i8*(t+1)));continue}throw a}}Kr.log("Initialising core...");$de().then(async()=>{Kr.log("Core initialised.")}).catch(e=>{Kr.error("Core initialisation failed.",e);const t=document.createElement("div");t.className="error-message",t.setAttribute("role","alert"),t.style.cssText='padding: 20px; color: #d32f2f; background: #ffebee; border: 1px solid #e57373; border-radius: 4px; margin: 20px; font-family: "Poppins", "Helvetica Neue", "Lucida Grande", sans-serif;';const a=document.createElement("div");a.textContent="Failed to initialise application"+(e!=null&&e.message?`: ${e.message}`:"");const n=document.createElement("div");n.style.marginTop="12px",n.textContent="This might mean the Agent Builder is still being prepared. Try reloading the page in a few seconds.";const r=document.createElement("button");r.textContent="Reload page",r.className="WdsButton WdsButton--small WdsButton--tertiary",r.style.cssText="margin-top: 16px; font-size: .875rem; font-weight: 600; border-radius: 300px; padding: 4px 16px; height: 32px; background: var(--wdsColorWhite); color: var(--wdsColorBlack); border-color: var(--wdsColorGray2); border-width: 1px; border-style: solid; box-shadow: var(--buttonShadow); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; outline: none; position: relative; overflow: hidden; max-width: 100%; width: fit-content;",r.onclick=()=>window.location.reload(),t.appendChild(a),t.appendChild(n),t.appendChild(r);const o=document.getElementById("loading_L1");o==null||o.remove();const s=document.getElementById("loading_message");s&&s.remove(),document.body.appendChild(t)});export{fa as $,pa as A,Sd as B,Td as C,Je as D,Ot as E,ot as F,ft as G,Ode as H,ks as I,qt as J,bt as K,qa as L,T2e as M,Rde as N,I2e as O,Bde as P,zt as Q,E as R,ge as S,jg as T,Ki as U,Od as V,La as W,io as X,$t as Y,jt as Z,ke as _,ne as a,b0 as a$,Wde as a0,$0 as a1,t8 as a2,Sg as a3,Lg as a4,Ice as a5,bs as a6,ba as a7,Wn as a8,fl as a9,Y_ as aA,_0 as aB,e0e as aC,Sw as aD,Vd as aE,Ad as aF,Ub as aG,a0 as aH,Fde as aI,mn as aJ,t_ as aK,oce as aL,J2e as aM,Pw as aN,E0 as aO,Bi as aP,Xx as aQ,c6 as aR,Dx as aS,Dde as aT,K3 as aU,Sv as aV,one as aW,Pd as aX,jde as aY,gte as aZ,kde as a_,Wr as aa,hse as ab,_v as ac,Fc as ad,St as ae,pde as af,Nd as ag,Fs as ah,zde as ai,zc as aj,hde as ak,fde as al,l8 as am,Fn as an,sr as ao,ir as ap,sn as aq,Sr as ar,Sse as as,Ht as at,o_ as au,O_ as av,fg as aw,Bs as ax,Hv as ay,qde as az,Ie as b,Tde as b0,Pde as b1,Ir as b2,Ui as b3,Moe as b4,Ug as b5,Ts as b6,Q as b7,Lde as b8,Vde as b9,i0e as bA,zE as ba,YE as bb,c0e as bc,ls as bd,ji as be,e8 as bf,o0e as bg,n8 as bh,Ew as bi,Ed as bj,zg as bk,qg as bl,Li as bm,Ude as bn,m0 as bo,Ev as bp,Mg as bq,Rd as br,Vi as bs,Nde as bt,Yg as bu,mg as bv,gn as bw,iv as bx,cv as by,Hde as bz,H as c,$e as d,L0e as e,R as f,Z as g,q0e as h,re as i,a8 as j,En as k,Kl as l,pt as m,Ri as n,$ as o,Bv as p,ia as q,ye as r,Ya as s,je as t,Hd as u,jn as v,We as w,Ce as x,_t as y,Xe as z};