@iterms/tinyflow-ai-vue 0.2.3

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.
@@ -0,0 +1,12 @@
1
+ (function(nt,We){typeof exports=="object"&&typeof module<"u"?We(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],We):(nt=typeof globalThis<"u"?globalThis:nt||self,We(nt.TinyflowVue={},nt.Vue))})(this,function(nt,We){"use strict";var ub=Object.defineProperty;var Wf=nt=>{throw TypeError(nt)};var cb=(nt,We,yt)=>We in nt?ub(nt,We,{enumerable:!0,configurable:!0,writable:!0,value:yt}):nt[We]=yt;var kt=(nt,We,yt)=>cb(nt,typeof We!="symbol"?We+"":We,yt),vl=(nt,We,yt)=>We.has(nt)||Wf("Cannot "+yt);var ke=(nt,We,yt)=>(vl(nt,We,"read from private field"),yt?yt.call(nt):We.get(nt)),mt=(nt,We,yt)=>We.has(nt)?Wf("Cannot add the same private member more than once"):We instanceof WeakSet?We.add(nt):We.set(nt,yt),At=(nt,We,yt,Bn)=>(vl(nt,We,"write to private field"),Bn?Bn.call(nt,yt):We.set(nt,yt),yt),Eo=(nt,We,yt)=>(vl(nt,We,"access private method"),yt);var Lf,fi,_o,bo,vr,gi,hi,zr,xo,pr,Gn,Rr,Jn,Xf,Zf,pl,mr,Co,vi,Ns,Kf,Qn,vn;typeof window<"u"&&((Lf=window.__svelte??(window.__svelte={})).v??(Lf.v=new Set)).add("5");let Bn=!1,jf=!1;function Uf(){Bn=!0}Uf();const _i=1,bi=2,ml=4,Gf=8,Jf=16,Qf=1,e1=2,yl=4,t1=8,n1=16,wl=1,r1=2,_l="[",Vs="[!",Os="]",yr={},St=Symbol(),o1="http://www.w3.org/1999/xhtml",i1="http://www.w3.org/2000/svg",s1="@attach",bl=!1;var qr=Array.isArray,a1=Array.prototype.indexOf,As=Array.from,xi=Object.keys,wr=Object.defineProperty,qn=Object.getOwnPropertyDescriptor,xl=Object.getOwnPropertyDescriptors,l1=Object.prototype,u1=Array.prototype,Ls=Object.getPrototypeOf,Cl=Object.isExtensible;function ko(e){return typeof e=="function"}const wt=()=>{};function c1(e){return e()}function So(e){for(var t=0;t<e.length;t++)e[t]()}function d1(){var e,t,n=new Promise((r,o)=>{e=r,t=o});return{promise:n,resolve:e,reject:t}}function er(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const Gt=2,Is=4,Ci=8,Po=16,Yn=32,_r=64,$l=128,an=256,$i=512,_t=1024,Wt=2048,tr=4096,pn=8192,br=16384,zs=32768,Yr=65536,El=1<<17,f1=1<<18,Rs=1<<19,Bs=1<<20,qs=1<<21,Ys=1<<22,xr=1<<23,kn=Symbol("$state"),Fs=Symbol("legacy props"),g1=Symbol(""),Ws=new class extends Error{constructor(){super(...arguments);kt(this,"name","StaleReactionError");kt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},h1=1,Xs=3,Fr=8;function v1(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Ei(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function p1(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function m1(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function y1(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function w1(e){throw new Error("https://svelte.dev/e/effect_orphan")}function _1(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function b1(){throw new Error("https://svelte.dev/e/hydration_failed")}function x1(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function C1(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function $1(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function E1(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function No(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function k1(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}let He=!1;function Jt(e){He=e}let Ye;function Lt(e){if(e===null)throw No(),yr;return Ye=e}function Sn(){return Lt(Nn(Ye))}function Y(e){if(He){if(Nn(Ye)!==null)throw No(),yr;Ye=e}}function Te(e=1){if(He){for(var t=e,n=Ye;t--;)n=Nn(n);Ye=n}}function Zs(){for(var e=0,t=Ye;;){if(t.nodeType===Fr){var n=t.data;if(n===Os){if(e===0)return t;e-=1}else(n===_l||n===Vs)&&(e+=1)}var r=Nn(t);t.remove(),t=r}}function kl(e){if(!e||e.nodeType!==Fr)throw No(),yr;return e.data}function Sl(e){return e===this.v}function Ks(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Pl(e){return!Ks(e,this.v)}let st=null;function ki(e){st=e}function Cr(e){return js().get(e)}function Wr(e,t){return js().set(e,t),t}function S1(e){return js().has(e)}function fe(e,t=!1,n){st={p:st,c:null,e:null,s:e,x:null,l:Bn&&!t?{s:null,u:null,$:[]}:null}}function ge(e){var t=st,n=t.e;if(n!==null){t.e=null;for(var r of n)Xl(r)}return e!==void 0&&(t.x=e),st=t.p,e??{}}function To(){return!Bn||st!==null&&st.l===null}function js(e){return st===null&&Ei(),st.c??(st.c=new Map(P1(st)||void 0))}function P1(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}const N1=new WeakMap;function T1(e){var t=ze;if(t===null)return Xe.f|=xr,e;if((t.f&zs)===0){if((t.f&$l)===0)throw!t.parent&&e instanceof Error&&Nl(e),e;t.b.error(e)}else Us(e,t)}function Us(e,t){for(;t!==null;){if((t.f&$l)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw e instanceof Error&&Nl(e),e}function Nl(e){const t=N1.get(e);t&&(wr(e,"message",{value:t.message}),wr(e,"stack",{value:t.stack}))}const M1=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let Mo=[],Ho=[];function Tl(){var e=Mo;Mo=[],So(e)}function Ml(){var e=Ho;Ho=[],So(e)}function Do(e){Mo.length===0&&queueMicrotask(Tl),Mo.push(e)}function H1(e){Ho.length===0&&M1(Ml),Ho.push(e)}function D1(){Mo.length>0&&Tl(),Ho.length>0&&Ml()}function V1(){for(var e=ze.b;e!==null&&!e.has_pending_snippet();)e=e.parent;return e===null&&v1(),e}function Vo(e){var t=Gt|Wt,n=Xe!==null&&(Xe.f&Gt)!==0?Xe:null;return ze===null||n!==null&&(n.f&an)!==0?t|=an:ze.f|=Rs,{ctx:st,deps:null,effects:null,equals:Sl,f:t,fn:e,reactions:null,rv:0,v:St,wv:0,parent:n??ze,ac:null}}function O1(e,t){let n=ze;n===null&&p1();var r=n.b,o=void 0,i=Kr(St),s=null,a=!Xe;return F1(()=>{try{var l=e()}catch(h){l=Promise.reject(h)}var c=()=>l;o=(s==null?void 0:s.then(c,c))??Promise.resolve(l),s=o;var u=It,g=r.pending;a&&(r.update_pending_count(1),g||u.increment());const f=(h,v=void 0)=>{s=null,g||u.activate(),v?v!==Ws&&(i.f|=xr,Oo(i,v)):((i.f&xr)!==0&&(i.f^=xr),Oo(i,h)),a&&(r.update_pending_count(-1),g||u.decrement()),Ol()};if(o.then(f,h=>f(null,h||"unknown")),u)return()=>{queueMicrotask(()=>u.neuter())}}),new Promise(l=>{function c(u){function g(){u===o?l(i):c(o)}u.then(g,g)}c(o)})}function Ee(e){const t=Vo(e);return tu(t),t}function Me(e){const t=Vo(e);return t.equals=Pl,t}function Hl(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Rt(t[n])}}function A1(e){for(var t=e.parent;t!==null;){if((t.f&Gt)===0)return t;t=t.parent}return null}function Gs(e){var t,n=ze;Hn(A1(e));try{Hl(e),t=iu(e)}finally{Hn(n)}return t}function Dl(e){var t=Gs(e);if(e.equals(t)||(e.v=t,e.wv=ru()),!kr)if(nr!==null)nr.set(e,e.v);else{var n=(or||(e.f&an)!==0)&&e.deps!==null?tr:_t;xt(e,n)}}function Vl(e,t,n){const r=To()?Vo:Me;if(t.length===0){n(e.map(r));return}var o=It,i=ze,s=L1(),a=V1();Promise.all(t.map(l=>O1(l))).then(l=>{o==null||o.activate(),s();try{n([...e.map(r),...l])}catch(c){(i.f&br)===0&&Us(c,i)}o==null||o.deactivate(),Ol()}).catch(l=>{a.error(l)})}function L1(){var e=ze,t=Xe,n=st;return function(){Hn(e),Mn(t),ki(n)}}function Ol(){Hn(null),Mn(null),ki(null)}const Si=new Set;let It=null,nr=null,Al=new Set,Pi=[];function Ll(){const e=Pi.shift();Pi.length>0&&queueMicrotask(Ll),e()}let Xr=[],Ni=null,Js=!1;const Ps=class Ps{constructor(){mt(this,Jn);mt(this,fi,new Map);mt(this,_o,new Map);mt(this,bo,new Set);mt(this,vr,0);mt(this,gi,null);mt(this,hi,!1);mt(this,zr,[]);mt(this,xo,[]);mt(this,pr,[]);mt(this,Gn,[]);mt(this,Rr,[]);kt(this,"skipped_effects",new Set)}capture(t,n){ke(this,_o).has(t)||ke(this,_o).set(t,n),ke(this,fi).set(t,t.v)}activate(){It=this}deactivate(){It=null;for(const t of Al)if(Al.delete(t),t(),It!==null)break}neuter(){At(this,hi,!0)}flush(){Xr.length>0?this.flush_effects():Eo(this,Jn,pl).call(this),It===this&&(ke(this,vr)===0&&Si.delete(this),this.deactivate())}flush_effects(){var t=jr;Js=!0;try{var n=0;for(Ql(!0);Xr.length>0;){if(n++>1e3){var r,o;I1()}Eo(this,Jn,Xf).call(this,Xr),$r.clear()}}finally{Js=!1,Ql(t),Ni=null}}increment(){At(this,vr,ke(this,vr)+1)}decrement(){if(At(this,vr,ke(this,vr)-1),ke(this,vr)===0){for(const t of ke(this,pr))xt(t,Wt),rr(t);for(const t of ke(this,Gn))xt(t,Wt),rr(t);for(const t of ke(this,Rr))xt(t,Wt),rr(t);At(this,pr,[]),At(this,Gn,[]),this.flush()}else this.deactivate()}add_callback(t){ke(this,bo).add(t)}settled(){return(ke(this,gi)??At(this,gi,d1())).promise}static ensure(t=!0){if(It===null){const n=It=new Ps;Si.add(It),t&&Ps.enqueue(()=>{It===n&&n.flush()})}return It}static enqueue(t){Pi.length===0&&queueMicrotask(Ll),Pi.unshift(t)}};fi=new WeakMap,_o=new WeakMap,bo=new WeakMap,vr=new WeakMap,gi=new WeakMap,hi=new WeakMap,zr=new WeakMap,xo=new WeakMap,pr=new WeakMap,Gn=new WeakMap,Rr=new WeakMap,Jn=new WeakSet,Xf=function(t){var i;Xr=[];var n=null;if(Si.size>1){n=new Map,nr=new Map;for(const[s,a]of ke(this,fi))n.set(s,{v:s.v,wv:s.wv}),s.v=a;for(const s of Si)if(s!==this)for(const[a,l]of ke(s,_o))n.has(a)||(n.set(a,{v:a.v,wv:a.wv}),a.v=l)}for(const s of t)Eo(this,Jn,Zf).call(this,s);if(ke(this,zr).length===0&&ke(this,vr)===0){var r=ke(this,pr),o=ke(this,Gn);At(this,pr,[]),At(this,Gn,[]),At(this,Rr,[]),Eo(this,Jn,pl).call(this),Il(r),Il(o),(i=ke(this,gi))==null||i.resolve()}else{for(const s of ke(this,pr))xt(s,_t);for(const s of ke(this,Gn))xt(s,_t);for(const s of ke(this,Rr))xt(s,_t)}if(n){for(const[s,{v:a,wv:l}]of n)s.wv<=l&&(s.v=a);nr=null}for(const s of ke(this,zr))Ur(s);for(const s of ke(this,xo))Ur(s);At(this,zr,[]),At(this,xo,[])},Zf=function(t){var u;t.f^=_t;for(var n=t.first;n!==null;){var r=n.f,o=(r&(Yn|_r))!==0,i=o&&(r&_t)!==0,s=i||(r&pn)!==0||this.skipped_effects.has(n);if(!s&&n.fn!==null){if(o)n.f^=_t;else if((r&Is)!==0)ke(this,Gn).push(n);else if(zo(n))if((r&Ys)!==0){var a=(u=n.b)!=null&&u.pending?ke(this,xo):ke(this,zr);a.push(n)}else(n.f&Po)!==0&&ke(this,Rr).push(n),Ur(n);var l=n.first;if(l!==null){n=l;continue}}var c=n.parent;for(n=n.next;n===null&&c!==null;)n=c.next,c=c.parent}},pl=function(){if(!ke(this,hi))for(const t of ke(this,bo))t();ke(this,bo).clear()};let Zr=Ps;function y(e){var t;const n=Zr.ensure(!1);for(;;){if(D1(),Xr.length===0)return n===It&&n.flush(),Ni=null,t;n.flush_effects()}}function I1(){try{_1()}catch(e){Us(e,Ni)}}function Il(e){var t=e.length;if(t!==0){for(var n=0;n<t;n++){var r=e[n];if((r.f&(br|pn))===0&&zo(r)){var o=Mi;if(Ur(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null&&r.ac===null?Ul(r):r.fn=null),Mi>o&&(r.f&Bs)!==0)break}}for(;n<t;n+=1)rr(e[n])}}function rr(e){for(var t=Ni=e;t.parent!==null;){t=t.parent;var n=t.f;if(Js&&t===ze&&(n&Po)!==0)return;if((n&(_r|Yn))!==0){if((n&_t)===0)return;t.f^=_t}}Xr.push(t)}const $r=new Map;function Kr(e,t){var n={f:0,v:e,reactions:null,equals:Sl,rv:0,wv:0};return n}function zt(e,t){const n=Kr(e);return tu(n),n}function ae(e,t=!1,n=!0){var o;const r=Kr(e);return t||(r.equals=Pl),Bn&&n&&st!==null&&st.l!==null&&((o=st.l).s??(o.s=[])).push(r),r}function te(e,t,n=!1){Xe!==null&&(!Tn||(Xe.f&El)!==0)&&To()&&(Xe.f&(Gt|Po|Ys|El))!==0&&!(Bt!=null&&Bt.includes(e))&&E1();let r=n?Pn(t):t;return Oo(e,r)}function Oo(e,t){if(!e.equals(t)){var n=e.v;kr?$r.set(e,t):$r.set(e,n),e.v=t,Zr.ensure().capture(e,n),(e.f&Gt)!==0&&((e.f&Wt)!==0&&Gs(e),xt(e,(e.f&an)===0?_t:tr)),e.wv=ru(),Rl(e,Wt),To()&&ze!==null&&(ze.f&_t)!==0&&(ze.f&(Yn|_r))===0&&(cn===null?X1([e]):cn.push(e))}return t}function zl(e,t=1){var n=d(e),r=t===1?n++:n--;return te(e,n),r}function Qs(e){te(e,e.v+1)}function Rl(e,t){var n=e.reactions;if(n!==null)for(var r=To(),o=n.length,i=0;i<o;i++){var s=n[i],a=s.f;!r&&s===ze||((a&Wt)===0&&xt(s,t),(a&Gt)!==0?Rl(s,tr):(a&Wt)===0&&rr(s))}}function Pn(e){if(typeof e!="object"||e===null||kn in e)return e;const t=Ls(e);if(t!==l1&&t!==u1)return e;var n=new Map,r=qr(e),o=zt(0),i=Sr,s=a=>{if(Sr===i)return a();var l=Xe,c=Sr;Mn(null),nu(i);var u=a();return Mn(l),nu(c),u};return r&&n.set("length",zt(e.length)),new Proxy(e,{defineProperty(a,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&C1();var u=n.get(l);return u===void 0?u=s(()=>{var g=zt(c.value);return n.set(l,g),g}):te(u,c.value,!0),!0},deleteProperty(a,l){var c=n.get(l);if(c===void 0){if(l in a){const u=s(()=>zt(St));n.set(l,u),Qs(o)}}else te(c,St),Qs(o);return!0},get(a,l,c){var h;if(l===kn)return e;var u=n.get(l),g=l in a;if(u===void 0&&(!g||(h=qn(a,l))!=null&&h.writable)&&(u=s(()=>{var v=Pn(g?a[l]:St),b=zt(v);return b}),n.set(l,u)),u!==void 0){var f=d(u);return f===St?void 0:f}return Reflect.get(a,l,c)},getOwnPropertyDescriptor(a,l){var c=Reflect.getOwnPropertyDescriptor(a,l);if(c&&"value"in c){var u=n.get(l);u&&(c.value=d(u))}else if(c===void 0){var g=n.get(l),f=g==null?void 0:g.v;if(g!==void 0&&f!==St)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return c},has(a,l){var f;if(l===kn)return!0;var c=n.get(l),u=c!==void 0&&c.v!==St||Reflect.has(a,l);if(c!==void 0||ze!==null&&(!u||(f=qn(a,l))!=null&&f.writable)){c===void 0&&(c=s(()=>{var h=u?Pn(a[l]):St,v=zt(h);return v}),n.set(l,c));var g=d(c);if(g===St)return!1}return u},set(a,l,c,u){var _;var g=n.get(l),f=l in a;if(r&&l==="length")for(var h=c;h<g.v;h+=1){var v=n.get(h+"");v!==void 0?te(v,St):h in a&&(v=s(()=>zt(St)),n.set(h+"",v))}if(g===void 0)(!f||(_=qn(a,l))!=null&&_.writable)&&(g=s(()=>zt(void 0)),te(g,Pn(c)),n.set(l,g));else{f=g.v!==St;var b=s(()=>Pn(c));te(g,b)}var C=Reflect.getOwnPropertyDescriptor(a,l);if(C!=null&&C.set&&C.set.call(u,c),!f){if(r&&typeof l=="string"){var x=n.get("length"),p=Number(l);Number.isInteger(p)&&p>=x.v&&te(x,p+1)}Qs(o)}return!0},ownKeys(a){d(o);var l=Reflect.ownKeys(a).filter(g=>{var f=n.get(g);return f===void 0||f.v!==St});for(var[c,u]of n)u.v!==St&&!(c in a)&&l.push(c);return l},setPrototypeOf(){$1()}})}function Bl(e){try{if(e!==null&&typeof e=="object"&&kn in e)return e[kn]}catch{}return e}function z1(e,t){return Object.is(Bl(e),Bl(t))}var Xt,ql,Yl,Fl;function ea(){if(Xt===void 0){Xt=window,ql=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Yl=qn(t,"firstChild").get,Fl=qn(t,"nextSibling").get,Cl(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Cl(n)&&(n.__t=void 0)}}function ln(e=""){return document.createTextNode(e)}function bt(e){return Yl.call(e)}function Nn(e){return Fl.call(e)}function W(e,t){if(!He)return bt(e);var n=bt(Ye);if(n===null)n=Ye.appendChild(ln());else if(t&&n.nodeType!==Xs){var r=ln();return n==null||n.before(r),Lt(r),r}return Lt(n),n}function he(e,t){if(!He){var n=bt(e);return n instanceof Comment&&n.data===""?Nn(n):n}return Ye}function B(e,t=1,n=!1){let r=He?Ye:e;for(var o;t--;)o=r,r=Nn(r);if(!He)return r;if(n&&(r==null?void 0:r.nodeType)!==Xs){var i=ln();return r===null?o==null||o.after(i):r.before(i),Lt(i),i}return Lt(r),r}function ta(e){e.textContent=""}function na(){return!1}function Wl(e){ze===null&&Xe===null&&w1(),Xe!==null&&(Xe.f&an)!==0&&ze===null&&y1(),kr&&m1()}function R1(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function mn(e,t,n,r=!0){var o=ze;o!==null&&(o.f&pn)!==0&&(e|=pn);var i={ctx:st,deps:null,nodes_start:null,nodes_end:null,f:e|Wt,first:null,fn:t,last:null,next:null,parent:o,b:o&&o.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(n)try{Ur(i),i.f|=zs}catch(l){throw Rt(i),l}else t!==null&&rr(i);var s=n&&i.deps===null&&i.first===null&&i.nodes_start===null&&i.teardown===null&&(i.f&Rs)===0;if(!s&&r&&(o!==null&&R1(i,o),Xe!==null&&(Xe.f&Gt)!==0)){var a=Xe;(a.effects??(a.effects=[])).push(i)}return i}function ra(e){const t=mn(Ci,null,!1);return xt(t,_t),t.teardown=e,t}function un(e){Wl();var t=ze.f,n=!Xe&&(t&Yn)!==0&&(t&zs)===0;if(n){var r=st;(r.e??(r.e=[])).push(e)}else return Xl(e)}function Xl(e){return mn(Is|Bs,e,!1)}function B1(e){return Wl(),mn(Ci|Bs,e,!0)}function q1(e){Zr.ensure();const t=mn(_r,e,!0);return()=>{Rt(t)}}function Y1(e){Zr.ensure();const t=mn(_r,e,!0);return(n={})=>new Promise(r=>{n.outro?Lo(t,()=>{Rt(t),r(void 0)}):(Rt(t),r(void 0))})}function Qt(e){return mn(Is,e,!1)}function ve(e,t){var n=st,r={effect:null,ran:!1,deps:e};n.l.$.push(r),r.effect=Ao(()=>{e(),!r.ran&&(r.ran=!0,G(t))})}function Pt(){var e=st;Ao(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&_t)!==0&&xt(n,tr),zo(n)&&Ur(n),t.ran=!1}})}function F1(e){return mn(Ys|Rs,e,!0)}function Ao(e,t=0){return mn(Ci|t,e,!0)}function De(e,t=[],n=[]){Vl(t,n,r=>{mn(Ci,()=>e(...r.map(d)),!0)})}function Er(e,t=0){var n=mn(Po|t,e,!0);return n}function yn(e,t=!0){return mn(Yn,e,!0,t)}function Zl(e){var t=e.teardown;if(t!==null){const n=kr,r=Xe;eu(!0),Mn(null);try{t.call(null)}finally{eu(n),Mn(r)}}}function Kl(e,t=!1){var o;var n=e.first;for(e.first=e.last=null;n!==null;){(o=n.ac)==null||o.abort(Ws);var r=n.next;(n.f&_r)!==0?n.parent=null:Rt(n,t),n=r}}function W1(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&Yn)===0&&Rt(t),t=n}}function Rt(e,t=!0){var n=!1;(t||(e.f&f1)!==0)&&e.nodes_start!==null&&e.nodes_end!==null&&(jl(e.nodes_start,e.nodes_end),n=!0),Kl(e,t&&!n),Hi(e,0),xt(e,br);var r=e.transitions;if(r!==null)for(const i of r)i.stop();Zl(e);var o=e.parent;o!==null&&o.first!==null&&Ul(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=e.ac=null}function jl(e,t){for(;e!==null;){var n=e===t?null:Nn(e);e.remove(),e=n}}function Ul(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Lo(e,t){var n=[];oa(e,n,!0),Gl(n,()=>{Rt(e),t&&t()})}function Gl(e,t){var n=e.length;if(n>0){var r=()=>--n||t();for(var o of e)o.out(r)}else t()}function oa(e,t,n){if((e.f&pn)===0){if(e.f^=pn,e.transitions!==null)for(const s of e.transitions)(s.is_global||n)&&t.push(s);for(var r=e.first;r!==null;){var o=r.next,i=(r.f&Yr)!==0||(r.f&Yn)!==0;oa(r,t,i?n:!1),r=o}}}function Ti(e){Jl(e,!0)}function Jl(e,t){if((e.f&pn)!==0){e.f^=pn,(e.f&_t)===0&&(xt(e,Wt),rr(e));for(var n=e.first;n!==null;){var r=n.next,o=(n.f&Yr)!==0||(n.f&Yn)!==0;Jl(n,o?t:!1),n=r}if(e.transitions!==null)for(const i of e.transitions)(i.is_global||t)&&i.in()}}let jr=!1;function Ql(e){jr=e}let kr=!1;function eu(e){kr=e}let Xe=null,Tn=!1;function Mn(e){Xe=e}let ze=null;function Hn(e){ze=e}let Bt=null;function tu(e){Xe!==null&&(Bt===null?Bt=[e]:Bt.push(e))}let qt=null,en=0,cn=null;function X1(e){cn=e}let Mi=1,Io=0,Sr=Io;function nu(e){Sr=e}let or=!1;function ru(){return++Mi}function zo(e){var g;var t=e.f;if((t&Wt)!==0)return!0;if((t&tr)!==0){var n=e.deps,r=(t&an)!==0;if(n!==null){var o,i,s=(t&$i)!==0,a=r&&ze!==null&&!or,l=n.length;if((s||a)&&(ze===null||(ze.f&br)===0)){var c=e,u=c.parent;for(o=0;o<l;o++)i=n[o],(s||!((g=i==null?void 0:i.reactions)!=null&&g.includes(c)))&&(i.reactions??(i.reactions=[])).push(c);s&&(c.f^=$i),a&&u!==null&&(u.f&an)===0&&(c.f^=an)}for(o=0;o<l;o++)if(i=n[o],zo(i)&&Dl(i),i.wv>e.wv)return!0}(!r||ze!==null&&!or)&&xt(e,_t)}return!1}function ou(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Bt!=null&&Bt.includes(e)))for(var o=0;o<r.length;o++){var i=r[o];(i.f&Gt)!==0?ou(i,t,!1):t===i&&(n?xt(i,Wt):(i.f&_t)!==0&&xt(i,tr),rr(i))}}function iu(e){var v;var t=qt,n=en,r=cn,o=Xe,i=or,s=Bt,a=st,l=Tn,c=Sr,u=e.f;qt=null,en=0,cn=null,or=(u&an)!==0&&(Tn||!jr||Xe===null),Xe=(u&(Yn|_r))===0?e:null,Bt=null,ki(e.ctx),Tn=!1,Sr=++Io,e.ac!==null&&(e.ac.abort(Ws),e.ac=null);try{e.f|=qs;var g=(0,e.fn)(),f=e.deps;if(qt!==null){var h;if(Hi(e,en),f!==null&&en>0)for(f.length=en+qt.length,h=0;h<qt.length;h++)f[en+h]=qt[h];else e.deps=f=qt;if(!or||(u&Gt)!==0&&e.reactions!==null)for(h=en;h<f.length;h++)((v=f[h]).reactions??(v.reactions=[])).push(e)}else f!==null&&en<f.length&&(Hi(e,en),f.length=en);if(To()&&cn!==null&&!Tn&&f!==null&&(e.f&(Gt|tr|Wt))===0)for(h=0;h<cn.length;h++)ou(cn[h],e);return o!==null&&o!==e&&(Io++,cn!==null&&(r===null?r=cn:r.push(...cn))),(e.f&xr)!==0&&(e.f^=xr),g}catch(b){return T1(b)}finally{e.f^=qs,qt=t,en=n,cn=r,Xe=o,or=i,Bt=s,ki(a),Tn=l,Sr=c}}function Z1(e,t){let n=t.reactions;if(n!==null){var r=a1.call(n,e);if(r!==-1){var o=n.length-1;o===0?n=t.reactions=null:(n[r]=n[o],n.pop())}}n===null&&(t.f&Gt)!==0&&(qt===null||!qt.includes(t))&&(xt(t,tr),(t.f&(an|$i))===0&&(t.f^=$i),Hl(t),Hi(t,0))}function Hi(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Z1(e,n[r])}function Ur(e){var t=e.f;if((t&br)===0){xt(e,_t);var n=ze,r=jr;ze=e,jr=!0;try{(t&Po)!==0?W1(e):Kl(e),Zl(e);var o=iu(e);e.teardown=typeof o=="function"?o:null,e.wv=Mi;var i;bl&&jf&&(e.f&Wt)!==0&&e.deps}finally{jr=r,ze=n}}}function d(e){var t=e.f,n=(t&Gt)!==0;if(Xe!==null&&!Tn){var r=ze!==null&&(ze.f&br)!==0;if(!r&&!(Bt!=null&&Bt.includes(e))){var o=Xe.deps;if((Xe.f&qs)!==0)e.rv<Io&&(e.rv=Io,qt===null&&o!==null&&o[en]===e?en++:qt===null?qt=[e]:(!or||!qt.includes(e))&&qt.push(e));else{(Xe.deps??(Xe.deps=[])).push(e);var i=e.reactions;i===null?e.reactions=[Xe]:i.includes(Xe)||i.push(Xe)}}}else if(n&&e.deps===null&&e.effects===null){var s=e,a=s.parent;a!==null&&(a.f&an)===0&&(s.f^=an)}if(kr){if($r.has(e))return $r.get(e);if(n){s=e;var l=s.v;return((s.f&_t)===0&&s.reactions!==null||su(s))&&(l=Gs(s)),$r.set(s,l),l}}else if(n){if(s=e,nr!=null&&nr.has(s))return nr.get(s);zo(s)&&Dl(s)}if((e.f&xr)!==0)throw e.v;return e.v}function su(e){if(e.v===St)return!0;if(e.deps===null)return!1;for(const t of e.deps)if($r.has(t)||(t.f&Gt)!==0&&su(t))return!0;return!1}function G(e){var t=Tn;try{return Tn=!0,e()}finally{Tn=t}}const K1=-7169;function xt(e,t){e.f=e.f&K1|t}function q(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(kn in e)ia(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&kn in n&&ia(n)}}}function ia(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{ia(e[r],t)}catch{}const n=Ls(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=xl(n);for(let o in r){const i=r[o].get;if(i)try{i.call(e)}catch{}}}}}function j1(e,t){if(t){const n=document.body;e.autofocus=!0,Do(()=>{document.activeElement===n&&e.focus()})}}function U1(e){He&&bt(e)!==null&&ta(e)}let au=!1;function G1(){au||(au=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function J1(e){var t=Xe,n=ze;Mn(null),Hn(null);try{return e()}finally{Mn(t),Hn(n)}}const lu=new Set,sa=new Set;function uu(e,t,n,r={}){function o(i){if(r.capture||Ro.call(t,i),!i.cancelBubble)return J1(()=>n==null?void 0:n.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Do(()=>{t.addEventListener(e,o,r)}):t.addEventListener(e,o,r),o}function ut(e,t,n,r,o){var i={capture:r,passive:o},s=uu(e,t,n,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&ra(()=>{t.removeEventListener(e,s,i)})}function Gr(e){for(var t=0;t<e.length;t++)lu.add(e[t]);for(var n of sa)n(e)}function Ro(e){var p;var t=this,n=t.ownerDocument,r=e.type,o=((p=e.composedPath)==null?void 0:p.call(e))||[],i=o[0]||e.target,s=0,a=e.__root;if(a){var l=o.indexOf(a);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var c=o.indexOf(t);if(c===-1)return;l<=c&&(s=l)}if(i=o[s]||e.target,i!==t){wr(e,"currentTarget",{configurable:!0,get(){return i||n}});var u=Xe,g=ze;Mn(null),Hn(null);try{for(var f,h=[];i!==null;){var v=i.assignedSlot||i.parentNode||i.host||null;try{var b=i["__"+r];if(b!=null&&(!i.disabled||e.target===i))if(qr(b)){var[C,...x]=b;C.apply(i,[e,...x])}else b.call(i,e)}catch(_){f?h.push(_):f=_}if(e.cancelBubble||v===t||v===null)break;i=v}if(f){for(let _ of h)queueMicrotask(()=>{throw _});throw f}}finally{e.__root=t,delete e.currentTarget,Mn(u),Hn(g)}}}function aa(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function Zt(e,t){var n=ze;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function ie(e,t){var n=(t&wl)!==0,r=(t&r1)!==0,o,i=!e.startsWith("<!>");return()=>{if(He)return Zt(Ye,null),Ye;o===void 0&&(o=aa(i?e:"<!>"+e),n||(o=bt(o)));var s=r||ql?document.importNode(o,!0):o.cloneNode(!0);if(n){var a=bt(s),l=s.lastChild;Zt(a,l)}else Zt(s,s);return s}}function Q1(e,t,n="svg"){var r=!e.startsWith("<!>"),o=(t&wl)!==0,i=`<${n}>${r?e:"<!>"+e}</${n}>`,s;return()=>{if(He)return Zt(Ye,null),Ye;if(!s){var a=aa(i),l=bt(a);if(o)for(s=document.createDocumentFragment();bt(l);)s.appendChild(bt(l));else s=bt(l)}var c=s.cloneNode(!0);if(o){var u=bt(c),g=c.lastChild;Zt(u,g)}else Zt(c,c);return c}}function Ce(e,t){return Q1(e,t,"svg")}function Re(e=""){if(!He){var t=ln(e+"");return Zt(t,t),t}var n=Ye;return n.nodeType!==Xs&&(n.before(n=ln()),Lt(n)),Zt(n,n),n}function Ze(){if(He)return Zt(Ye,null),Ye;var e=document.createDocumentFragment(),t=document.createComment(""),n=ln();return e.append(t,n),Zt(t,n),e}function D(e,t){if(He){ze.nodes_end=Ye,Sn();return}e!==null&&e.before(t)}function eg(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const tg=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function ng(e){return tg.includes(e)}const rg={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function og(e){return e=e.toLowerCase(),rg[e]??e}const ig=["touchstart","touchmove"];function sg(e){return ig.includes(e)}const ag=["textarea","script","style","title"];function lg(e){return ag.includes(e)}function vt(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n+"")}function cu(e,t){return du(e,t)}function ug(e,t){ea(),t.intro=t.intro??!1;const n=t.target,r=He,o=Ye;try{for(var i=bt(n);i&&(i.nodeType!==Fr||i.data!==_l);)i=Nn(i);if(!i)throw yr;Jt(!0),Lt(i),Sn();const s=du(e,{...t,anchor:i});if(Ye===null||Ye.nodeType!==Fr||Ye.data!==Os)throw No(),yr;return Jt(!1),s}catch(s){if(s===yr)return t.recover===!1&&b1(),ea(),ta(n),Jt(!1),cu(e,t);throw s}finally{Jt(r),Lt(o)}}const Jr=new Map;function du(e,{target:t,anchor:n,props:r={},events:o,context:i,intro:s=!0}){ea();var a=new Set,l=g=>{for(var f=0;f<g.length;f++){var h=g[f];if(!a.has(h)){a.add(h);var v=sg(h);t.addEventListener(h,Ro,{passive:v});var b=Jr.get(h);b===void 0?(document.addEventListener(h,Ro,{passive:v}),Jr.set(h,1)):Jr.set(h,b+1)}}};l(As(lu)),sa.add(l);var c=void 0,u=Y1(()=>{var g=n??t.appendChild(ln());return yn(()=>{if(i){fe({});var f=st;f.c=i}o&&(r.$$events=o),He&&Zt(g,null),c=e(g,r)||{},He&&(ze.nodes_end=Ye),i&&ge()}),()=>{var v;for(var f of a){t.removeEventListener(f,Ro);var h=Jr.get(f);--h===0?(document.removeEventListener(f,Ro),Jr.delete(f)):Jr.set(f,h)}sa.delete(l),g!==n&&((v=g.parentNode)==null||v.removeChild(g))}});return la.set(c,u),c}let la=new WeakMap;function cg(e,t){const n=la.get(e);return n?(la.delete(e),n(t)):Promise.resolve()}function Pr(e,t,...n){var r=e,o=wt,i;Er(()=>{o!==(o=t())&&(i&&(Rt(i),i=null),i=yn(()=>o(r,...n)))},Yr),He&&(r=Ye)}function dn(e){st===null&&Ei(),Bn&&st.l!==null?fg(st).m.push(e):un(()=>{const t=G(e);if(typeof t=="function")return t})}function ua(e){st===null&&Ei(),dn(()=>()=>G(e))}function dg(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function Di(){const e=st;return e===null&&Ei(),(t,n,r)=>{var i;const o=(i=e.s.$$events)==null?void 0:i[t];if(o){const s=qr(o)?o.slice():[o],a=dg(t,n,r);for(const l of s)l.call(e.x,a);return!a.defaultPrevented}return!0}}function fg(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}function me(e,t,n=!1){He&&Sn();var r=e,o=null,i=null,s=St,a=n?Yr:0,l=!1;const c=(h,v=!0)=>{l=!0,f(v,h)};var u=null;function g(){u!==null&&(u.lastChild.remove(),r.before(u),u=null);var h=s?o:i,v=s?i:o;h&&Ti(h),v&&Lo(v,()=>{s?i=null:o=null})}const f=(h,v)=>{if(s===(s=h))return;let b=!1;if(He){const k=kl(r)===Vs;!!s===k&&(r=Zs(),Lt(r),Jt(!1),b=!0)}var C=na(),x=r;if(C&&(u=document.createDocumentFragment(),u.append(x=ln())),s?o??(o=v&&yn(()=>v(x))):i??(i=v&&yn(()=>v(x))),C){var p=It,_=s?o:i,m=s?i:o;_&&p.skipped_effects.delete(_),m&&p.skipped_effects.add(m),p.add_callback(g)}else g();b&&Jt(!0)};Er(()=>{l=!1,t(c),l||f(null,null)},a),He&&(r=Ye)}function Qr(e,t){return t}function gg(e,t,n){for(var r=e.items,o=[],i=t.length,s=0;s<i;s++)oa(t[s].e,o,!0);var a=i>0&&o.length===0&&n!==null;if(a){var l=n.parentNode;ta(l),l.append(n),r.clear(),Dn(e,t[0].prev,t[i-1].next)}Gl(o,()=>{for(var c=0;c<i;c++){var u=t[c];a||(r.delete(u.k),Dn(e,u.prev,u.next)),Rt(u.e,!a)}})}function Yt(e,t,n,r,o,i=null){var s=e,a={flags:t,items:new Map,first:null},l=(t&ml)!==0;if(l){var c=e;s=He?Lt(bt(c)):c.appendChild(ln())}He&&Sn();var u=null,g=!1,f=new Map,h=Me(()=>{var x=n();return qr(x)?x:x==null?[]:As(x)}),v,b;function C(){hg(b,v,a,f,s,o,t,r,n),i!==null&&(v.length===0?u?Ti(u):u=yn(()=>i(s)):u!==null&&Lo(u,()=>{u=null}))}Er(()=>{b??(b=ze),v=d(h);var x=v.length;if(g&&x===0)return;g=x===0;let p=!1;if(He){var _=kl(s)===Vs;_!==(x===0)&&(s=Zs(),Lt(s),Jt(!1),p=!0)}if(He){for(var m=null,k,N=0;N<x;N++){if(Ye.nodeType===Fr&&Ye.data===Os){s=Ye,p=!0,Jt(!1);break}var P=v[N],O=r(P,N);k=ca(Ye,a,m,null,P,O,N,o,t,n),a.items.set(O,k),m=k}x>0&&Lt(Zs())}if(He)x===0&&i&&(u=yn(()=>i(s)));else if(na()){var L=new Set,V=It;for(N=0;N<x;N+=1){P=v[N],O=r(P,N);var A=a.items.get(O)??f.get(O);A?(t&(_i|bi))!==0&&fu(A,P,N,t):(k=ca(null,a,null,null,P,O,N,o,t,n,!0),f.set(O,k)),L.add(O)}for(const[I,R]of a.items)L.has(I)||V.skipped_effects.add(R.e);V.add_callback(C)}else C();p&&Jt(!0),d(h)}),He&&(s=Ye)}function hg(e,t,n,r,o,i,s,a,l){var H,z,j,Z;var c=(s&Gf)!==0,u=(s&(_i|bi))!==0,g=t.length,f=n.items,h=n.first,v=h,b,C=null,x,p=[],_=[],m,k,N,P;if(c)for(P=0;P<g;P+=1)m=t[P],k=a(m,P),N=f.get(k),N!==void 0&&((H=N.a)==null||H.measure(),(x??(x=new Set)).add(N));for(P=0;P<g;P+=1){if(m=t[P],k=a(m,P),N=f.get(k),N===void 0){var O=r.get(k);if(O!==void 0){r.delete(k),f.set(k,O);var L=C?C.next:v;Dn(n,C,O),Dn(n,O,L),da(O,L,o),C=O}else{var V=v?v.e.nodes_start:o;C=ca(V,n,C,C===null?n.first:C.next,m,k,P,i,s,l)}f.set(k,C),p=[],_=[],v=C.next;continue}if(u&&fu(N,m,P,s),(N.e.f&pn)!==0&&(Ti(N.e),c&&((z=N.a)==null||z.unfix(),(x??(x=new Set)).delete(N))),N!==v){if(b!==void 0&&b.has(N)){if(p.length<_.length){var A=_[0],I;C=A.prev;var R=p[0],E=p[p.length-1];for(I=0;I<p.length;I+=1)da(p[I],A,o);for(I=0;I<_.length;I+=1)b.delete(_[I]);Dn(n,R.prev,E.next),Dn(n,C,R),Dn(n,E,A),v=A,C=E,P-=1,p=[],_=[]}else b.delete(N),da(N,v,o),Dn(n,N.prev,N.next),Dn(n,N,C===null?n.first:C.next),Dn(n,C,N),C=N;continue}for(p=[],_=[];v!==null&&v.k!==k;)(v.e.f&pn)===0&&(b??(b=new Set)).add(v),_.push(v),v=v.next;if(v===null)continue;N=v}p.push(N),C=N,v=N.next}if(v!==null||b!==void 0){for(var $=b===void 0?[]:As(b);v!==null;)(v.e.f&pn)===0&&$.push(v),v=v.next;var S=$.length;if(S>0){var T=(s&ml)!==0&&g===0?o:null;if(c){for(P=0;P<S;P+=1)(j=$[P].a)==null||j.measure();for(P=0;P<S;P+=1)(Z=$[P].a)==null||Z.fix()}gg(n,$,T)}}c&&Do(()=>{var ee;if(x!==void 0)for(N of x)(ee=N.a)==null||ee.apply()}),e.first=n.first&&n.first.e,e.last=C&&C.e;for(var M of r.values())Rt(M.e);r.clear()}function fu(e,t,n,r){(r&_i)!==0&&Oo(e.v,t),(r&bi)!==0?Oo(e.i,n):e.i=n}function ca(e,t,n,r,o,i,s,a,l,c,u){var g=(l&_i)!==0,f=(l&Jf)===0,h=g?f?ae(o,!1,!1):Kr(o):o,v=(l&bi)===0?s:Kr(s),b={i:v,v:h,k:i,a:null,e:null,prev:n,next:r};try{if(e===null){var C=document.createDocumentFragment();C.append(e=ln())}return b.e=yn(()=>a(e,h,v,c),He),b.e.prev=n&&n.e,b.e.next=r&&r.e,n===null?u||(t.first=b):(n.next=b,n.e.next=b.e),r!==null&&(r.prev=b,r.e.prev=b.e),b}finally{}}function da(e,t,n){for(var r=e.next?e.next.e.nodes_start:n,o=t?t.e.nodes_start:n,i=e.e.nodes_start;i!==null&&i!==r;){var s=Nn(i);o.before(i),i=s}}function Dn(e,t,n){t===null?e.first=n:(t.next=n,t.e.next=n&&n.e),n!==null&&(n.prev=t,n.e.prev=t&&t.e)}function fa(e,t,n=!1,r=!1,o=!1){var i=e,s="";De(()=>{var a=ze;if(s===(s=t()??"")){He&&Sn();return}if(a.nodes_start!==null&&(jl(a.nodes_start,a.nodes_end),a.nodes_start=a.nodes_end=null),s!==""){if(He){Ye.data;for(var l=Sn(),c=l;l!==null&&(l.nodeType!==Fr||l.data!=="");)c=l,l=Nn(l);if(l===null)throw No(),yr;Zt(Ye,c),i=Lt(l);return}var u=s+"";n?u=`<svg>${u}</svg>`:r&&(u=`<math>${u}</math>`);var g=aa(u);if((n||r)&&(g=bt(g)),Zt(bt(g),g.lastChild),n||r)for(;bt(g);)i.before(bt(g));else i.before(g)}})}function Dt(e,t,n,r,o){var a;He&&Sn();var i=(a=t.$$slots)==null?void 0:a[n],s=!1;i===!0&&(i=t[n==="default"?"children":n],s=!0),i===void 0||i(e,s?()=>r:r)}function vg(e){const t={};e.children&&(t.default=!0);for(const n in e.$$slots)t[n]=!0;return t}function gu(e,t,n){He&&Sn();var r=e,o,i,s=null,a=null;function l(){i&&(Lo(i),i=null),s&&(s.lastChild.remove(),r.before(s),s=null),i=a,a=null}Er(()=>{if(o!==(o=t())){var c=na();if(o){var u=r;c&&(s=document.createDocumentFragment(),s.append(u=ln())),a=yn(()=>n(u,o))}c?It.add_callback(l):l()}},Yr),He&&(r=Ye)}function pg(e,t,n,r,o,i){let s=He;He&&Sn();var a,l,c=null;He&&Ye.nodeType===h1&&(c=Ye,Sn());var u=He?Ye:e,g;Er(()=>{const f=t()||null;var h=f==="svg"?i1:null;f!==a&&(g&&(f===null?Lo(g,()=>{g=null,l=null}):f===l?Ti(g):Rt(g)),f&&f!==l&&(g=yn(()=>{if(c=He?c:h?document.createElementNS(h,f):document.createElement(f),Zt(c,c),r){He&&lg(f)&&c.append(document.createComment(""));var v=He?bt(c):c.appendChild(ln());He&&(v===null?Jt(!1):Lt(v)),r(c,v)}ze.nodes_end=c,u.before(c)})),a=f,a&&(l=a))},Yr),s&&(Jt(!0),Lt(u))}function at(e,t){Do(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+t.hash)){const o=document.createElement("style");o.id=t.hash,o.textContent=t.code,r.appendChild(o)}})}function Vt(e,t,n){Qt(()=>{var r=G(()=>t(e,n==null?void 0:n())||{});if(n&&(r!=null&&r.update)){var o=!1,i={};Ao(()=>{var s=n();q(s),o&&Ks(i,s)&&(i=s,r.update(s))}),o=!0}if(r!=null&&r.destroy)return()=>r.destroy()})}function mg(e,t){var n=void 0,r;Er(()=>{n!==(n=t())&&(r&&(Rt(r),r=null),n&&(r=yn(()=>{Qt(()=>n(e))})))})}function hu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=hu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function yg(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=hu(e))&&(r&&(r+=" "),r+=t);return r}function wn(e){return typeof e=="object"?yg(e):e??""}const vu=[...`
2
+ \r\f \v\uFEFF`];function wg(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var o in n)if(n[o])r=r?r+" "+o:o;else if(r.length)for(var i=o.length,s=0;(s=r.indexOf(o,s))>=0;){var a=s+i;(s===0||vu.includes(r[s-1]))&&(a===r.length||vu.includes(r[a]))?r=(s===0?"":r.substring(0,s))+r.substring(a+1):s=a}}return r===""?null:r}function pu(e,t=!1){var n=t?" !important;":";",r="";for(var o in e){var i=e[o];i!=null&&i!==""&&(r+=" "+o+": "+i+n)}return r}function ga(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function _g(e,t){if(t){var n="",r,o;if(Array.isArray(t)?(r=t[0],o=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,s=0,a=!1,l=[];r&&l.push(...Object.keys(r).map(ga)),o&&l.push(...Object.keys(o).map(ga));var c=0,u=-1;const b=e.length;for(var g=0;g<b;g++){var f=e[g];if(a?f==="/"&&e[g-1]==="*"&&(a=!1):i?i===f&&(i=!1):f==="/"&&e[g+1]==="*"?a=!0:f==='"'||f==="'"?i=f:f==="("?s++:f===")"&&s--,!a&&i===!1&&s===0){if(f===":"&&u===-1)u=g;else if(f===";"||g===b-1){if(u!==-1){var h=ga(e.substring(c,u).trim());if(!l.includes(h)){f!==";"&&g++;var v=e.substring(c,g).trim();n+=" "+v+";"}}c=g+1,u=-1}}}}return r&&(n+=pu(r)),o&&(n+=pu(o,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function Ot(e,t,n,r,o,i){var s=e.__className;if(He||s!==n||s===void 0){var a=wg(n,r,i);(!He||a!==e.getAttribute("class"))&&(a==null?e.removeAttribute("class"):t?e.className=a:e.setAttribute("class",a)),e.__className=n}else if(i&&o!==i)for(var l in i){var c=!!i[l];(o==null||c!==!!o[l])&&e.classList.toggle(l,c)}return i}function ha(e,t={},n,r){for(var o in n){var i=n[o];t[o]!==i&&(n[o]==null?e.style.removeProperty(o):e.style.setProperty(o,i,r))}}function pt(e,t,n,r){var o=e.__style;if(He||o!==t){var i=_g(t,r);(!He||i!==e.getAttribute("style"))&&(i==null?e.removeAttribute("style"):e.style.cssText=i),e.__style=t}else r&&(Array.isArray(r)?(ha(e,n==null?void 0:n[0],r[0]),ha(e,n==null?void 0:n[1],r[1],"important")):ha(e,n,r));return r}function va(e,t,n=!1){if(e.multiple){if(t==null)return;if(!qr(t))return k1();for(var r of e.options)r.selected=t.includes(mu(r));return}for(r of e.options){var o=mu(r);if(z1(o,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function bg(e){var t=new MutationObserver(()=>{va(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ra(()=>{t.disconnect()})}function mu(e){return"__value"in e?e.__value:e.value}const Bo=Symbol("class"),Nr=Symbol("style"),yu=Symbol("is custom element"),wu=Symbol("is html");function ir(e){if(He){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;be(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var o=e.checked;be(e,"checked",null),e.checked=o}}};e.__on_r=n,H1(n),G1()}}function Vi(e,t){var n=Oi(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function xg(e,t){var n=Oi(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function Cg(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function be(e,t,n,r){var o=Oi(e);He&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=n)&&(t==="loading"&&(e[g1]=n),n==null?e.removeAttribute(t):typeof n!="string"&&bu(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function $g(e,t,n,r,o=!1){var i=Oi(e),s=i[yu],a=!i[wu];let l=He&&s;l&&Jt(!1);var c=t||{},u=e.tagName==="OPTION";for(var g in t)g in n||(n[g]=null);n.class?n.class=wn(n.class):(r||n[Bo])&&(n.class=null),n[Nr]&&(n.style??(n.style=null));var f=bu(e);for(const _ in n){let m=n[_];if(u&&_==="value"&&m==null){e.value=e.__value="",c[_]=m;continue}if(_==="class"){var h=e.namespaceURI==="http://www.w3.org/1999/xhtml";Ot(e,h,m,r,t==null?void 0:t[Bo],n[Bo]),c[_]=m,c[Bo]=n[Bo];continue}if(_==="style"){pt(e,m,t==null?void 0:t[Nr],n[Nr]),c[_]=m,c[Nr]=n[Nr];continue}var v=c[_];if(!(m===v&&!(m===void 0&&e.hasAttribute(_)))){c[_]=m;var b=_[0]+_[1];if(b!=="$$")if(b==="on"){const k={},N="$$"+_;let P=_.slice(2);var C=ng(P);if(eg(P)&&(P=P.slice(0,-7),k.capture=!0),!C&&v){if(m!=null)continue;e.removeEventListener(P,c[N],k),c[N]=null}if(m!=null)if(C)e[`__${P}`]=m,Gr([P]);else{let O=function(L){c[_].call(this,L)};c[N]=uu(P,e,O,k)}else C&&(e[`__${P}`]=void 0)}else if(_==="style")be(e,_,m);else if(_==="autofocus")j1(e,!!m);else if(!s&&(_==="__value"||_==="value"&&m!=null))e.value=e.__value=m;else if(_==="selected"&&u)Cg(e,m);else{var x=_;a||(x=og(x));var p=x==="defaultValue"||x==="defaultChecked";if(m==null&&!s&&!p)if(i[_]=null,x==="value"||x==="checked"){let k=e;const N=t===void 0;if(x==="value"){let P=k.defaultValue;k.removeAttribute(x),k.defaultValue=P,k.value=k.__value=N?P:null}else{let P=k.defaultChecked;k.removeAttribute(x),k.defaultChecked=P,k.checked=N?P:!1}}else e.removeAttribute(_);else p||f.includes(x)&&(s||typeof m!="string")?e[x]=m:typeof m!="function"&&be(e,x,m)}}}return l&&Jt(!0),c}function tn(e,t,n=[],r=[],o,i=!1){Vl(n,r,s=>{var a=void 0,l={},c=e.nodeName==="SELECT",u=!1;if(Er(()=>{var f=t(...s.map(d)),h=$g(e,a,f,o,i);u&&c&&"value"in f&&va(e,f.value);for(let b of Object.getOwnPropertySymbols(l))f[b]||Rt(l[b]);for(let b of Object.getOwnPropertySymbols(f)){var v=f[b];b.description===s1&&(!a||v!==a[b])&&(l[b]&&Rt(l[b]),l[b]=yn(()=>mg(e,()=>v))),h[b]=v}a=h}),c){var g=e;Qt(()=>{va(g,a.value,!0),bg(g)})}u=!0})}function Oi(e){return e.__attributes??(e.__attributes={[yu]:e.nodeName.includes("-"),[wu]:e.namespaceURI===o1})}var _u=new Map;function bu(e){var t=_u.get(e.nodeName);if(t)return t;_u.set(e.nodeName,t=[]);for(var n,r=e,o=Element.prototype;o!==r;){n=xl(r);for(var i in n)n[i].set&&t.push(i);r=Ls(r)}return t}const Ts=class Ts{constructor(t){mt(this,Ns);mt(this,mr,new WeakMap);mt(this,Co);mt(this,vi);At(this,vi,t)}observe(t,n){var r=ke(this,mr).get(t)||new Set;return r.add(n),ke(this,mr).set(t,r),Eo(this,Ns,Kf).call(this).observe(t,ke(this,vi)),()=>{var o=ke(this,mr).get(t);o.delete(n),o.size===0&&(ke(this,mr).delete(t),ke(this,Co).unobserve(t))}}};mr=new WeakMap,Co=new WeakMap,vi=new WeakMap,Ns=new WeakSet,Kf=function(){return ke(this,Co)??At(this,Co,new ResizeObserver(t=>{for(var n of t){Ts.entries.set(n.target,n);for(var r of ke(this,mr).get(n.target)||[])r(n)}}))},kt(Ts,"entries",new WeakMap);let pa=Ts;var Eg=new pa({box:"border-box"});function xu(e,t,n){var r=Eg.observe(e,()=>n(e[t]));Qt(()=>(G(()=>n(e[t])),r))}function Cu(e,t){return e===t||(e==null?void 0:e[kn])===t}function Vn(e={},t,n,r){return Qt(()=>{var o,i;return Ao(()=>{o=i,i=[],G(()=>{e!==n(...i)&&(t(e,...i),o&&Cu(n(...o),e)&&t(null,...o))})}),()=>{Do(()=>{i&&Cu(n(...i),e)&&t(null,...i)})}}),e}function qe(e=!1){const t=st,n=t.l.u;if(!n)return;let r=()=>q(t.s);if(e){let o=0,i={};const s=Vo(()=>{let a=!1;const l=t.s;for(const c in l)l[c]!==i[c]&&(i[c]=l[c],a=!0);return a&&o++,o});r=()=>d(s)}n.b.length&&B1(()=>{$u(t,r),So(n.b)}),un(()=>{const o=G(()=>n.m.map(c1));return()=>{for(const i of o)typeof i=="function"&&i()}}),n.a.length&&un(()=>{$u(t,r),So(n.a)})}function $u(e,t){if(e.l.s)for(const n of e.l.s)d(n);t()}function je(e,t){var i;var n=(i=e.$$events)==null?void 0:i[t.type],r=qr(n)?n.slice():n==null?[]:[n];for(var o of r)o.call(this,t)}function ma(e,t,n){if(e==null)return t(void 0),n&&n(void 0),wt;const r=G(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const eo=[];function fn(e,t){return{subscribe:xe(e,t).subscribe}}function xe(e,t=wt){let n=null;const r=new Set;function o(a){if(Ks(e,a)&&(e=a,n)){const l=!eo.length;for(const c of r)c[1](),eo.push(c,e);if(l){for(let c=0;c<eo.length;c+=2)eo[c][0](eo[c+1]);eo.length=0}}}function i(a){o(a(e))}function s(a,l=wt){const c=[a,l];return r.add(c),r.size===1&&(n=t(o,i)||wt),a(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:o,update:i,subscribe:s}}function sr(e,t,n){const r=!Array.isArray(e),o=r?[e]:e;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const i=t.length<2;return fn(n,(s,a)=>{let l=!1;const c=[];let u=0,g=wt;const f=()=>{if(u)return;g();const v=t(r?c[0]:c,s,a);i?s(v):g=typeof v=="function"?v:wt},h=o.map((v,b)=>ma(v,C=>{c[b]=C,u&=~(1<<b),l&&f()},()=>{u|=1<<b}));return l=!0,f(),function(){So(h),g(),l=!1}})}function J(e){let t;return ma(e,n=>t=n)(),t}let Ai=!1,ya=Symbol();function oe(e,t,n){const r=n[t]??(n[t]={store:null,source:ae(void 0),unsubscribe:wt});if(r.store!==e&&!(ya in n))if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=wt;else{var o=!0;r.unsubscribe=ma(e,i=>{o?r.source.v=i:te(r.source,i)}),o=!1}return e&&ya in n?J(e):d(r.source)}function kg(e,t,n){let r=n[t];return r&&r.store!==e&&(r.unsubscribe(),r.unsubscribe=wt),e}function Li(e,t){return e.set(t),t}function ct(){const e={};function t(){ra(()=>{for(var n in e)e[n].unsubscribe();wr(e,ya,{enumerable:!1,value:!0})})}return[e,t]}function Sg(e){var t=Ai;try{return Ai=!1,[e(),Ai]}finally{Ai=t}}const Pg={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function Nt(e,t,n){return new Proxy({props:e,exclude:t},Pg)}const Ng={get(e,t){if(!e.exclude.includes(t))return d(e.version),t in e.special?e.special[t]():e.props[t]},set(e,t,n){if(!(t in e.special)){var r=ze;try{Hn(e.parent_effect),e.special[t]=w({get[t](){return e.props[t]}},t,yl)}finally{Hn(r)}}return e.special[t](n),zl(e.version),!0},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},deleteProperty(e,t){return e.exclude.includes(t)||(e.exclude.push(t),zl(e.version)),!0},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function ft(e,t){return new Proxy({props:e,exclude:t,special:{},version:Kr(0),parent_effect:ze},Ng)}const Tg={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(ko(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let o=e.props[r];ko(o)&&(o=o());const i=qn(o,t);if(i&&i.set)return i.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(ko(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r){const o=qn(r,t);return o&&!o.configurable&&(o.configurable=!0),o}}},has(e,t){if(t===kn||t===Fs)return!1;for(let n of e.props)if(ko(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props)if(ko(n)&&(n=n()),!!n){for(const r in n)t.includes(r)||t.push(r);for(const r of Object.getOwnPropertySymbols(n))t.includes(r)||t.push(r)}return t}};function ht(...e){return new Proxy({props:e},Tg)}function w(e,t,n,r){var _;var o=!Bn||(n&e1)!==0,i=(n&t1)!==0,s=(n&n1)!==0,a=r,l=!0,c=()=>(l&&(l=!1,a=s?G(r):r),a),u;if(i){var g=kn in e||Fs in e;u=((_=qn(e,t))==null?void 0:_.set)??(g&&t in e?m=>e[t]=m:void 0)}var f,h=!1;i?[f,h]=Sg(()=>e[t]):f=e[t],f===void 0&&r!==void 0&&(f=c(),u&&(o&&x1(),u(f)));var v;if(o?v=()=>{var m=e[t];return m===void 0?c():(l=!0,m)}:v=()=>{var m=e[t];return m!==void 0&&(a=void 0),m===void 0?a:m},o&&(n&yl)===0)return v;if(u){var b=e.$$legacy;return function(m,k){return arguments.length>0?((!o||!k||b||h)&&u(k?v():m),m):v()}}var C=!1,x=((n&Qf)!==0?Vo:Me)(()=>(C=!1,v()));i&&d(x);var p=ze;return function(m,k){if(arguments.length>0){const N=k?d(x):o&&i?Pn(m):m;return te(x,N),C=!0,a!==void 0&&(a=N),m}return kr&&C||(p.f&br)!==0?x.v:d(x)}}function Mg(e){return new Hg(e)}class Hg{constructor(t){mt(this,Qn);mt(this,vn);var i;var n=new Map,r=(s,a)=>{var l=ae(a,!1,!1);return n.set(s,l),l};const o=new Proxy({...t.props||{},$$events:{}},{get(s,a){return d(n.get(a)??r(a,Reflect.get(s,a)))},has(s,a){return a===Fs?!0:(d(n.get(a)??r(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,l){return te(n.get(a)??r(a,l),l),Reflect.set(s,a,l)}});At(this,vn,(t.hydrate?ug:cu)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((i=t==null?void 0:t.props)!=null&&i.$$host)||t.sync===!1)&&y(),At(this,Qn,o.$$events);for(const s of Object.keys(ke(this,vn)))s==="$set"||s==="$destroy"||s==="$on"||wr(this,s,{get(){return ke(this,vn)[s]},set(a){ke(this,vn)[s]=a},enumerable:!0});ke(this,vn).$set=s=>{Object.assign(o,s)},ke(this,vn).$destroy=()=>{cg(ke(this,vn))}}$set(t){ke(this,vn).$set(t)}$on(t,n){ke(this,Qn)[t]=ke(this,Qn)[t]||[];const r=(...o)=>n.call(this,...o);return ke(this,Qn)[t].push(r),()=>{ke(this,Qn)[t]=ke(this,Qn)[t].filter(o=>o!==r)}}$destroy(){ke(this,vn).$destroy()}}Qn=new WeakMap,vn=new WeakMap;let Eu;typeof HTMLElement=="function"&&(Eu=class extends HTMLElement{constructor(t,n,r){super();kt(this,"$$ctor");kt(this,"$$s");kt(this,"$$c");kt(this,"$$cn",!1);kt(this,"$$d",{});kt(this,"$$r",!1);kt(this,"$$p_d",{});kt(this,"$$l",{});kt(this,"$$l_u",new Map);kt(this,"$$me");this.$$ctor=t,this.$$s=n,r&&this.attachShadow({mode:"open"})}addEventListener(t,n,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){const o=this.$$c.$on(t,n);this.$$l_u.set(n,o)}super.addEventListener(t,n,r)}removeEventListener(t,n,r){if(super.removeEventListener(t,n,r),this.$$c){const o=this.$$l_u.get(n);o&&(o(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(o){return i=>{const s=document.createElement("slot");o!=="default"&&(s.name=o),D(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=Dg(this);for(const o of this.$$s)o in r&&(o==="default"&&!this.$$d.children?(this.$$d.children=t(o),n.default=!0):n[o]=t(o));for(const o of this.attributes){const i=this.$$g_p(o.name);i in this.$$d||(this.$$d[i]=Ii(i,o.value,this.$$p_d,"toProp"))}for(const o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=Mg({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=q1(()=>{Ao(()=>{var o;this.$$r=!0;for(const i of xi(this.$$c)){if(!((o=this.$$p_d[i])!=null&&o.reflect))continue;this.$$d[i]=this.$$c[i];const s=Ii(i,this.$$d[i],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,s)}this.$$r=!1})});for(const o in this.$$l)for(const i of this.$$l[o]){const s=this.$$c.$on(o,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(t,n,r){var o;this.$$r||(t=this.$$g_p(t),this.$$d[t]=Ii(t,r,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return xi(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function Ii(e,t,n,r){var i;const o=(i=n[e])==null?void 0:i.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!n[e])return t;if(r==="toAttribute")switch(o){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(o){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Dg(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function ce(e,t,n,r,o,i){let s=class extends Eu{constructor(){super(e,n,o),this.$$p_d=t}static get observedAttributes(){return xi(t).map(a=>(t[a].attribute||a).toLowerCase())}};return xi(t).forEach(a=>{wr(s.prototype,a,{get(){return this.$$c&&a in this.$$c?this.$$c[a]:this.$$d[a]},set(l){var g;l=Ii(a,l,t),this.$$d[a]=l;var c=this.$$c;if(c){var u=(g=qn(c,a))==null?void 0:g.get;u?c[a]=l:c.$set({[a]:l})}}})}),r.forEach(a=>{wr(s.prototype,a,{get(){var l;return(l=this.$$c)==null?void 0:l[a]}})}),e.element=s,s}function lt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=lt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Vg={value:()=>{}};function zi(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ri(n)}function Ri(e){this._=e}function Og(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ri.prototype=zi.prototype={constructor:Ri,on:function(e,t){var n=this._,r=Og(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Ag(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=ku(n[o],e.name,t);else if(t==null)for(o in n)n[o]=ku(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ri(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function Ag(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function ku(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Vg,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var wa="http://www.w3.org/1999/xhtml";const Su={svg:"http://www.w3.org/2000/svg",xhtml:wa,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Bi(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Su.hasOwnProperty(t)?{space:Su[t],local:e}:e}function Lg(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===wa&&t.documentElement.namespaceURI===wa?t.createElement(e):t.createElementNS(n,e)}}function Ig(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Pu(e){var t=Bi(e);return(t.local?Ig:Lg)(t)}function zg(){}function _a(e){return e==null?zg:function(){return this.querySelector(e)}}function Rg(e){typeof e!="function"&&(e=_a(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=new Array(s),l,c,u=0;u<s;++u)(l=i[u])&&(c=e.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new nn(r,this._parents)}function Bg(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qg(){return[]}function Nu(e){return e==null?qg:function(){return this.querySelectorAll(e)}}function Yg(e){return function(){return Bg(e.apply(this,arguments))}}function Fg(e){typeof e=="function"?e=Yg(e):e=Nu(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(r.push(e.call(l,l.__data__,c,s)),o.push(l));return new nn(r,o)}function Tu(e){return function(){return this.matches(e)}}function Mu(e){return function(t){return t.matches(e)}}var Wg=Array.prototype.find;function Xg(e){return function(){return Wg.call(this.children,e)}}function Zg(){return this.firstElementChild}function Kg(e){return this.select(e==null?Zg:Xg(typeof e=="function"?e:Mu(e)))}var jg=Array.prototype.filter;function Ug(){return Array.from(this.children)}function Gg(e){return function(){return jg.call(this.children,e)}}function Jg(e){return this.selectAll(e==null?Ug:Gg(typeof e=="function"?e:Mu(e)))}function Qg(e){typeof e!="function"&&(e=Tu(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new nn(r,this._parents)}function Hu(e){return new Array(e.length)}function eh(){return new nn(this._enter||this._groups.map(Hu),this._parents)}function qi(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}qi.prototype={constructor:qi,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function th(e){return function(){return e}}function nh(e,t,n,r,o,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new qi(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function rh(e,t,n,r,o,i,s){var a,l,c=new Map,u=t.length,g=i.length,f=new Array(u),h;for(a=0;a<u;++a)(l=t[a])&&(f[a]=h=s.call(l,l.__data__,a,t)+"",c.has(h)?o[a]=l:c.set(h,l));for(a=0;a<g;++a)h=s.call(e,i[a],a,i)+"",(l=c.get(h))?(r[a]=l,l.__data__=i[a],c.delete(h)):n[a]=new qi(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(f[a])===l&&(o[a]=l)}function oh(e){return e.__data__}function ih(e,t){if(!arguments.length)return Array.from(this,oh);var n=t?rh:nh,r=this._parents,o=this._groups;typeof e!="function"&&(e=th(e));for(var i=o.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=r[c],g=o[c],f=g.length,h=sh(e.call(u,u&&u.__data__,c,r)),v=h.length,b=a[c]=new Array(v),C=s[c]=new Array(v),x=l[c]=new Array(f);n(u,g,b,C,x,h,t);for(var p=0,_=0,m,k;p<v;++p)if(m=b[p]){for(p>=_&&(_=p+1);!(k=C[_])&&++_<v;);m._next=k||null}}return s=new nn(s,r),s._enter=a,s._exit=l,s}function sh(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ah(){return new nn(this._exit||this._groups.map(Hu),this._parents)}function lh(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function uh(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var c=n[l],u=r[l],g=c.length,f=a[l]=new Array(g),h,v=0;v<g;++v)(h=c[v]||u[v])&&(f[v]=h);for(;l<o;++l)a[l]=n[l];return new nn(a,this._parents)}function ch(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function dh(e){e||(e=fh);function t(g,f){return g&&f?e(g.__data__,f.__data__):!g-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,l=o[i]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new nn(o,this._parents).order()}function fh(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function gh(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function hh(){return Array.from(this)}function vh(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function ph(){let e=0;for(const t of this)++e;return e}function mh(){return!this.node()}function yh(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function wh(e){return function(){this.removeAttribute(e)}}function _h(e){return function(){this.removeAttributeNS(e.space,e.local)}}function bh(e,t){return function(){this.setAttribute(e,t)}}function xh(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ch(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function $h(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Eh(e,t){var n=Bi(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?_h:wh:typeof t=="function"?n.local?$h:Ch:n.local?xh:bh)(n,t))}function Du(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function kh(e){return function(){this.style.removeProperty(e)}}function Sh(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ph(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Nh(e,t,n){return arguments.length>1?this.each((t==null?kh:typeof t=="function"?Ph:Sh)(e,t,n??"")):to(this.node(),e)}function to(e,t){return e.style.getPropertyValue(t)||Du(e).getComputedStyle(e,null).getPropertyValue(t)}function Th(e){return function(){delete this[e]}}function Mh(e,t){return function(){this[e]=t}}function Hh(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Dh(e,t){return arguments.length>1?this.each((t==null?Th:typeof t=="function"?Hh:Mh)(e,t)):this.node()[e]}function Vu(e){return e.trim().split(/^|\s+/)}function ba(e){return e.classList||new Ou(e)}function Ou(e){this._node=e,this._names=Vu(e.getAttribute("class")||"")}Ou.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Au(e,t){for(var n=ba(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Lu(e,t){for(var n=ba(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Vh(e){return function(){Au(this,e)}}function Oh(e){return function(){Lu(this,e)}}function Ah(e,t){return function(){(t.apply(this,arguments)?Au:Lu)(this,e)}}function Lh(e,t){var n=Vu(e+"");if(arguments.length<2){for(var r=ba(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?Ah:t?Vh:Oh)(n,t))}function Ih(){this.textContent=""}function zh(e){return function(){this.textContent=e}}function Rh(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Bh(e){return arguments.length?this.each(e==null?Ih:(typeof e=="function"?Rh:zh)(e)):this.node().textContent}function qh(){this.innerHTML=""}function Yh(e){return function(){this.innerHTML=e}}function Fh(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Wh(e){return arguments.length?this.each(e==null?qh:(typeof e=="function"?Fh:Yh)(e)):this.node().innerHTML}function Xh(){this.nextSibling&&this.parentNode.appendChild(this)}function Zh(){return this.each(Xh)}function Kh(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function jh(){return this.each(Kh)}function Uh(e){var t=typeof e=="function"?e:Pu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Gh(){return null}function Jh(e,t){var n=typeof e=="function"?e:Pu(e),r=t==null?Gh:typeof t=="function"?t:_a(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Qh(){var e=this.parentNode;e&&e.removeChild(this)}function ev(){return this.each(Qh)}function tv(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nv(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rv(e){return this.select(e?nv:tv)}function ov(e){return arguments.length?this.property("__data__",e):this.node().__data__}function iv(e){return function(t){e.call(this,t,this.__data__)}}function sv(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function av(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function lv(e,t,n){return function(){var r=this.__on,o,i=iv(t);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function uv(e,t,n){var r=sv(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(o=0,u=a[l];o<i;++o)if((s=r[o]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?lv:av,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function Iu(e,t,n){var r=Du(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function cv(e,t){return function(){return Iu(this,e,t)}}function dv(e,t){return function(){return Iu(this,e,t.apply(this,arguments))}}function fv(e,t){return this.each((typeof t=="function"?dv:cv)(e,t))}function*gv(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var zu=[null];function nn(e,t){this._groups=e,this._parents=t}function qo(){return new nn([[document.documentElement]],zu)}function hv(){return this}nn.prototype=qo.prototype={constructor:nn,select:Rg,selectAll:Fg,selectChild:Kg,selectChildren:Jg,filter:Qg,data:ih,enter:eh,exit:ah,join:lh,merge:uh,selection:hv,order:ch,sort:dh,call:gh,nodes:hh,node:vh,size:ph,empty:mh,each:yh,attr:Eh,style:Nh,property:Dh,classed:Lh,text:Bh,html:Wh,raise:Zh,lower:jh,append:Uh,insert:Jh,remove:ev,clone:rv,datum:ov,on:uv,dispatch:fv,[Symbol.iterator]:gv};function gn(e){return typeof e=="string"?new nn([[document.querySelector(e)]],[document.documentElement]):new nn([[e]],zu)}function vv(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _n(e,t){if(e=vv(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const pv={passive:!1},Yo={capture:!0,passive:!1};function xa(e){e.stopImmediatePropagation()}function no(e){e.preventDefault(),e.stopImmediatePropagation()}function Ru(e){var t=e.document.documentElement,n=gn(e).on("dragstart.drag",no,Yo);"onselectstart"in t?n.on("selectstart.drag",no,Yo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Bu(e,t){var n=e.document.documentElement,r=gn(e).on("dragstart.drag",null);t&&(r.on("click.drag",no,Yo),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Yi=e=>()=>e;function Ca(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}Ca.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function mv(e){return!e.ctrlKey&&!e.button}function yv(){return this.parentNode}function wv(e,t){return t??{x:e.x,y:e.y}}function _v(){return navigator.maxTouchPoints||"ontouchstart"in this}function bv(){var e=mv,t=yv,n=wv,r=_v,o={},i=zi("start","drag","end"),s=0,a,l,c,u,g=0;function f(m){m.on("mousedown.drag",h).filter(r).on("touchstart.drag",C).on("touchmove.drag",x,pv).on("touchend.drag touchcancel.drag",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(m,k){if(!(u||!e.call(this,m,k))){var N=_(this,t.call(this,m,k),m,k,"mouse");N&&(gn(m.view).on("mousemove.drag",v,Yo).on("mouseup.drag",b,Yo),Ru(m.view),xa(m),c=!1,a=m.clientX,l=m.clientY,N("start",m))}}function v(m){if(no(m),!c){var k=m.clientX-a,N=m.clientY-l;c=k*k+N*N>g}o.mouse("drag",m)}function b(m){gn(m.view).on("mousemove.drag mouseup.drag",null),Bu(m.view,c),no(m),o.mouse("end",m)}function C(m,k){if(e.call(this,m,k)){var N=m.changedTouches,P=t.call(this,m,k),O=N.length,L,V;for(L=0;L<O;++L)(V=_(this,P,m,k,N[L].identifier,N[L]))&&(xa(m),V("start",m,N[L]))}}function x(m){var k=m.changedTouches,N=k.length,P,O;for(P=0;P<N;++P)(O=o[k[P].identifier])&&(no(m),O("drag",m,k[P]))}function p(m){var k=m.changedTouches,N=k.length,P,O;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),P=0;P<N;++P)(O=o[k[P].identifier])&&(xa(m),O("end",m,k[P]))}function _(m,k,N,P,O,L){var V=i.copy(),A=_n(L||N,k),I,R,E;if((E=n.call(m,new Ca("beforestart",{sourceEvent:N,target:f,identifier:O,active:s,x:A[0],y:A[1],dx:0,dy:0,dispatch:V}),P))!=null)return I=E.x-A[0]||0,R=E.y-A[1]||0,function $(S,T,M){var H=A,z;switch(S){case"start":o[O]=$,z=s++;break;case"end":delete o[O],--s;case"drag":A=_n(M||T,k),z=s;break}V.call(S,m,new Ca(S,{sourceEvent:T,subject:E,target:f,identifier:O,active:z,x:A[0]+I,y:A[1]+R,dx:A[0]-H[0],dy:A[1]-H[1],dispatch:V}),P)}}return f.filter=function(m){return arguments.length?(e=typeof m=="function"?m:Yi(!!m),f):e},f.container=function(m){return arguments.length?(t=typeof m=="function"?m:Yi(m),f):t},f.subject=function(m){return arguments.length?(n=typeof m=="function"?m:Yi(m),f):n},f.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Yi(!!m),f):r},f.on=function(){var m=i.on.apply(i,arguments);return m===i?f:m},f.clickDistance=function(m){return arguments.length?(g=(m=+m)*m,f):Math.sqrt(g)},f}function $a(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function qu(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Fo(){}var Wo=.7,Fi=1/Wo,ro="\\s*([+-]?\\d+)\\s*",Xo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",On="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xv=/^#([0-9a-f]{3,8})$/,Cv=new RegExp(`^rgb\\(${ro},${ro},${ro}\\)$`),$v=new RegExp(`^rgb\\(${On},${On},${On}\\)$`),Ev=new RegExp(`^rgba\\(${ro},${ro},${ro},${Xo}\\)$`),kv=new RegExp(`^rgba\\(${On},${On},${On},${Xo}\\)$`),Sv=new RegExp(`^hsl\\(${Xo},${On},${On}\\)$`),Pv=new RegExp(`^hsla\\(${Xo},${On},${On},${Xo}\\)$`),Yu={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};$a(Fo,Zo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fu,formatHex:Fu,formatHex8:Nv,formatHsl:Tv,formatRgb:Wu,toString:Wu});function Fu(){return this.rgb().formatHex()}function Nv(){return this.rgb().formatHex8()}function Tv(){return Uu(this).formatHsl()}function Wu(){return this.rgb().formatRgb()}function Zo(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=xv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Xu(t):n===3?new Kt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Wi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Wi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Cv.exec(e))?new Kt(t[1],t[2],t[3],1):(t=$v.exec(e))?new Kt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ev.exec(e))?Wi(t[1],t[2],t[3],t[4]):(t=kv.exec(e))?Wi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Sv.exec(e))?ju(t[1],t[2]/100,t[3]/100,1):(t=Pv.exec(e))?ju(t[1],t[2]/100,t[3]/100,t[4]):Yu.hasOwnProperty(e)?Xu(Yu[e]):e==="transparent"?new Kt(NaN,NaN,NaN,0):null}function Xu(e){return new Kt(e>>16&255,e>>8&255,e&255,1)}function Wi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Kt(e,t,n,r)}function Mv(e){return e instanceof Fo||(e=Zo(e)),e?(e=e.rgb(),new Kt(e.r,e.g,e.b,e.opacity)):new Kt}function Ea(e,t,n,r){return arguments.length===1?Mv(e):new Kt(e,t,n,r??1)}function Kt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}$a(Kt,Ea,qu(Fo,{brighter(e){return e=e==null?Fi:Math.pow(Fi,e),new Kt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wo:Math.pow(Wo,e),new Kt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Kt(Tr(this.r),Tr(this.g),Tr(this.b),Xi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Zu,formatHex:Zu,formatHex8:Hv,formatRgb:Ku,toString:Ku}));function Zu(){return`#${Mr(this.r)}${Mr(this.g)}${Mr(this.b)}`}function Hv(){return`#${Mr(this.r)}${Mr(this.g)}${Mr(this.b)}${Mr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ku(){const e=Xi(this.opacity);return`${e===1?"rgb(":"rgba("}${Tr(this.r)}, ${Tr(this.g)}, ${Tr(this.b)}${e===1?")":`, ${e})`}`}function Xi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mr(e){return e=Tr(e),(e<16?"0":"")+e.toString(16)}function ju(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new bn(e,t,n,r)}function Uu(e){if(e instanceof bn)return new bn(e.h,e.s,e.l,e.opacity);if(e instanceof Fo||(e=Zo(e)),!e)return new bn;if(e instanceof bn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new bn(s,a,l,e.opacity)}function Dv(e,t,n,r){return arguments.length===1?Uu(e):new bn(e,t,n,r??1)}function bn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}$a(bn,Dv,qu(Fo,{brighter(e){return e=e==null?Fi:Math.pow(Fi,e),new bn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wo:Math.pow(Wo,e),new bn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Kt(ka(e>=240?e-240:e+120,o,r),ka(e,o,r),ka(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new bn(Gu(this.h),Zi(this.s),Zi(this.l),Xi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Xi(this.opacity);return`${e===1?"hsl(":"hsla("}${Gu(this.h)}, ${Zi(this.s)*100}%, ${Zi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Gu(e){return e=(e||0)%360,e<0?e+360:e}function Zi(e){return Math.max(0,Math.min(1,e||0))}function ka(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ju=e=>()=>e;function Vv(e,t){return function(n){return e+n*t}}function Ov(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Av(e){return(e=+e)==1?Qu:function(t,n){return n-t?Ov(t,n,e):Ju(isNaN(t)?n:t)}}function Qu(e,t){var n=t-e;return n?Vv(e,n):Ju(isNaN(e)?t:e)}const ec=function e(t){var n=Av(t);function r(o,i){var s=n((o=Ea(o)).r,(i=Ea(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),c=Qu(o.opacity,i.opacity);return function(u){return o.r=s(u),o.g=a(u),o.b=l(u),o.opacity=c(u),o+""}}return r.gamma=e,r}(1);function ar(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Sa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Pa=new RegExp(Sa.source,"g");function Lv(e){return function(){return e}}function Iv(e){return function(t){return e(t)+""}}function zv(e,t){var n=Sa.lastIndex=Pa.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Sa.exec(e))&&(o=Pa.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:ar(r,o)})),n=Pa.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?Iv(l[0].x):Lv(t):(t=l.length,function(c){for(var u=0,g;u<t;++u)a[(g=l[u]).i]=g.x(c);return a.join("")})}var tc=180/Math.PI,Na={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function nc(e,t,n,r,o,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*tc,skewX:Math.atan(l)*tc,scaleX:s,scaleY:a}}var Ki;function Rv(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Na:nc(t.a,t.b,t.c,t.d,t.e,t.f)}function Bv(e){return e==null||(Ki||(Ki=document.createElementNS("http://www.w3.org/2000/svg","g")),Ki.setAttribute("transform",e),!(e=Ki.transform.baseVal.consolidate()))?Na:(e=e.matrix,nc(e.a,e.b,e.c,e.d,e.e,e.f))}function rc(e,t,n,r){function o(c){return c.length?c.pop()+" ":""}function i(c,u,g,f,h,v){if(c!==g||u!==f){var b=h.push("translate(",null,t,null,n);v.push({i:b-4,x:ar(c,g)},{i:b-2,x:ar(u,f)})}else(g||f)&&h.push("translate("+g+t+f+n)}function s(c,u,g,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:g.push(o(g)+"rotate(",null,r)-2,x:ar(c,u)})):u&&g.push(o(g)+"rotate("+u+r)}function a(c,u,g,f){c!==u?f.push({i:g.push(o(g)+"skewX(",null,r)-2,x:ar(c,u)}):u&&g.push(o(g)+"skewX("+u+r)}function l(c,u,g,f,h,v){if(c!==g||u!==f){var b=h.push(o(h)+"scale(",null,",",null,")");v.push({i:b-4,x:ar(c,g)},{i:b-2,x:ar(u,f)})}else(g!==1||f!==1)&&h.push(o(h)+"scale("+g+","+f+")")}return function(c,u){var g=[],f=[];return c=e(c),u=e(u),i(c.translateX,c.translateY,u.translateX,u.translateY,g,f),s(c.rotate,u.rotate,g,f),a(c.skewX,u.skewX,g,f),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,g,f),c=u=null,function(h){for(var v=-1,b=f.length,C;++v<b;)g[(C=f[v]).i]=C.x(h);return g.join("")}}}var qv=rc(Rv,"px, ","px)","deg)"),Yv=rc(Bv,", ",")",")"),Fv=1e-12;function oc(e){return((e=Math.exp(e))+1/e)/2}function Wv(e){return((e=Math.exp(e))-1/e)/2}function Xv(e){return((e=Math.exp(2*e))-1)/(e+1)}const Zv=function e(t,n,r){function o(i,s){var a=i[0],l=i[1],c=i[2],u=s[0],g=s[1],f=s[2],h=u-a,v=g-l,b=h*h+v*v,C,x;if(b<Fv)x=Math.log(f/c)/t,C=function(P){return[a+P*h,l+P*v,c*Math.exp(t*P*x)]};else{var p=Math.sqrt(b),_=(f*f-c*c+r*b)/(2*c*n*p),m=(f*f-c*c-r*b)/(2*f*n*p),k=Math.log(Math.sqrt(_*_+1)-_),N=Math.log(Math.sqrt(m*m+1)-m);x=(N-k)/t,C=function(P){var O=P*x,L=oc(k),V=c/(n*p)*(L*Xv(t*O+k)-Wv(k));return[a+V*h,l+V*v,c*L/oc(t*O+k)]}}return C.duration=x*1e3*t/Math.SQRT2,C}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},o}(Math.SQRT2,2,4);var oo=0,Ko=0,jo=0,ic=1e3,ji,Uo,Ui=0,Hr=0,Gi=0,Go=typeof performance=="object"&&performance.now?performance:Date,sc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ta(){return Hr||(sc(Kv),Hr=Go.now()+Gi)}function Kv(){Hr=0}function Ji(){this._call=this._time=this._next=null}Ji.prototype=ac.prototype={constructor:Ji,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ta():+n)+(t==null?0:+t),!this._next&&Uo!==this&&(Uo?Uo._next=this:ji=this,Uo=this),this._call=e,this._time=n,Ma()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ma())}};function ac(e,t,n){var r=new Ji;return r.restart(e,t,n),r}function jv(){Ta(),++oo;for(var e=ji,t;e;)(t=Hr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--oo}function lc(){Hr=(Ui=Go.now())+Gi,oo=Ko=0;try{jv()}finally{oo=0,Gv(),Hr=0}}function Uv(){var e=Go.now(),t=e-Ui;t>ic&&(Gi-=t,Ui=e)}function Gv(){for(var e,t=ji,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ji=n);Uo=e,Ma(r)}function Ma(e){if(!oo){Ko&&(Ko=clearTimeout(Ko));var t=e-Hr;t>24?(e<1/0&&(Ko=setTimeout(lc,e-Go.now()-Gi)),jo&&(jo=clearInterval(jo))):(jo||(Ui=Go.now(),jo=setInterval(Uv,ic)),oo=1,sc(lc))}}function uc(e,t,n){var r=new Ji;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var Jv=zi("start","end","cancel","interrupt"),Qv=[],cc=0,dc=1,Ha=2,Qi=3,fc=4,Da=5,es=6;function ts(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;e0(e,n,{name:t,index:r,group:o,on:Jv,tween:Qv,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:cc})}function Va(e,t){var n=xn(e,t);if(n.state>cc)throw new Error("too late; already scheduled");return n}function An(e,t){var n=xn(e,t);if(n.state>Qi)throw new Error("too late; already running");return n}function xn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function e0(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=ac(i,0,n.time);function i(c){n.state=dc,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,g,f,h;if(n.state!==dc)return l();for(u in r)if(h=r[u],h.name===n.name){if(h.state===Qi)return uc(s);h.state===fc?(h.state=es,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[u]):+u<t&&(h.state=es,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[u])}if(uc(function(){n.state===Qi&&(n.state=fc,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Ha,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ha){for(n.state=Qi,o=new Array(f=n.tween.length),u=0,g=-1;u<f;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(o[++g]=h);o.length=g+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Da,1),g=-1,f=o.length;++g<f;)o[g].call(e,u);n.state===Da&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=es,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function ns(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>Ha&&r.state<Da,r.state=es,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function t0(e){return this.each(function(){ns(this,e)})}function n0(e,t){var n,r;return function(){var o=An(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function r0(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=An(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=a;break}l===c&&o.push(a)}i.tween=o}}function o0(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=xn(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?n0:r0)(n,e,t))}function Oa(e,t,n){var r=e._id;return e.each(function(){var o=An(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return xn(o,r).value[t]}}function gc(e,t){var n;return(typeof t=="number"?ar:t instanceof Zo?ec:(n=Zo(t))?(t=n,ec):zv)(e,t)}function i0(e){return function(){this.removeAttribute(e)}}function s0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function a0(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function l0(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function u0(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function c0(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function d0(e,t){var n=Bi(e),r=n==="transform"?Yv:gc;return this.attrTween(e,typeof t=="function"?(n.local?c0:u0)(n,r,Oa(this,"attr."+e,t)):t==null?(n.local?s0:i0)(n):(n.local?l0:a0)(n,r,t))}function f0(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function g0(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function h0(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&g0(e,i)),n}return o._value=t,o}function v0(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&f0(e,i)),n}return o._value=t,o}function p0(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Bi(e);return this.tween(n,(r.local?h0:v0)(r,t))}function m0(e,t){return function(){Va(this,e).delay=+t.apply(this,arguments)}}function y0(e,t){return t=+t,function(){Va(this,e).delay=t}}function w0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?m0:y0)(t,e)):xn(this.node(),t).delay}function _0(e,t){return function(){An(this,e).duration=+t.apply(this,arguments)}}function b0(e,t){return t=+t,function(){An(this,e).duration=t}}function x0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_0:b0)(t,e)):xn(this.node(),t).duration}function C0(e,t){if(typeof t!="function")throw new Error;return function(){An(this,e).ease=t}}function $0(e){var t=this._id;return arguments.length?this.each(C0(t,e)):xn(this.node(),t).ease}function E0(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;An(this,e).ease=n}}function k0(e){if(typeof e!="function")throw new Error;return this.each(E0(this._id,e))}function S0(e){typeof e!="function"&&(e=Tu(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new Fn(r,this._parents,this._name,this._id)}function P0(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var l=t[a],c=n[a],u=l.length,g=s[a]=new Array(u),f,h=0;h<u;++h)(f=l[h]||c[h])&&(g[h]=f);for(;a<r;++a)s[a]=t[a];return new Fn(s,this._parents,this._name,this._id)}function N0(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function T0(e,t,n){var r,o,i=N0(t)?Va:An;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function M0(e,t){var n=this._id;return arguments.length<2?xn(this.node(),n).on.on(e):this.each(T0(n,e,t))}function H0(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function D0(){return this.on("end.remove",H0(this._id))}function V0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=_a(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],l=a.length,c=i[s]=new Array(l),u,g,f=0;f<l;++f)(u=a[f])&&(g=e.call(u,u.__data__,f,a))&&("__data__"in u&&(g.__data__=u.__data__),c[f]=g,ts(c[f],t,n,f,c,xn(u,n)));return new Fn(i,this._parents,t,n)}function O0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Nu(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var l=r[a],c=l.length,u,g=0;g<c;++g)if(u=l[g]){for(var f=e.call(u,u.__data__,g,l),h,v=xn(u,n),b=0,C=f.length;b<C;++b)(h=f[b])&&ts(h,t,n,b,f,v);i.push(f),s.push(u)}return new Fn(i,s,t,n)}var A0=qo.prototype.constructor;function L0(){return new A0(this._groups,this._parents)}function I0(e,t){var n,r,o;return function(){var i=to(this,e),s=(this.style.removeProperty(e),to(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function hc(e){return function(){this.style.removeProperty(e)}}function z0(e,t,n){var r,o=n+"",i;return function(){var s=to(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function R0(e,t,n){var r,o,i;return function(){var s=to(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),to(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function B0(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=An(this,e),c=l.on,u=l.value[i]==null?a||(a=hc(t)):void 0;(c!==n||o!==u)&&(r=(n=c).copy()).on(s,o=u),l.on=r}}function q0(e,t,n){var r=(e+="")=="transform"?qv:gc;return t==null?this.styleTween(e,I0(e,r)).on("end.style."+e,hc(e)):typeof t=="function"?this.styleTween(e,R0(e,r,Oa(this,"style."+e,t))).each(B0(this._id,e)):this.styleTween(e,z0(e,r,t),n).on("end.style."+e,null)}function Y0(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function F0(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&Y0(e,s,n)),r}return i._value=t,i}function W0(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,F0(e,t,n??""))}function X0(e){return function(){this.textContent=e}}function Z0(e){return function(){var t=e(this);this.textContent=t??""}}function K0(e){return this.tween("text",typeof e=="function"?Z0(Oa(this,"text",e)):X0(e==null?"":e+""))}function j0(e){return function(t){this.textContent=e.call(this,t)}}function U0(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&j0(o)),t}return r._value=e,r}function G0(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,U0(e))}function J0(){for(var e=this._name,t=this._id,n=vc(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=xn(l,t);ts(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Fn(r,this._parents,e,n)}function Q0(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--o===0&&i()}};n.each(function(){var c=An(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),o===0&&i()})}var ep=0;function Fn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function vc(){return++ep}var Wn=qo.prototype;Fn.prototype={constructor:Fn,select:V0,selectAll:O0,selectChild:Wn.selectChild,selectChildren:Wn.selectChildren,filter:S0,merge:P0,selection:L0,transition:J0,call:Wn.call,nodes:Wn.nodes,node:Wn.node,size:Wn.size,empty:Wn.empty,each:Wn.each,on:M0,attr:d0,attrTween:p0,style:q0,styleTween:W0,text:K0,textTween:G0,remove:D0,tween:o0,delay:w0,duration:x0,ease:$0,easeVarying:k0,end:Q0,[Symbol.iterator]:Wn[Symbol.iterator]};function tp(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var np={time:null,delay:0,duration:250,ease:tp};function rp(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function op(e){var t,n;e instanceof Fn?(t=e._id,e=e._name):(t=vc(),(n=np).time=Ta(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&ts(l,e,t,c,s,n||rp(l,t));return new Fn(r,this._parents,e,t)}qo.prototype.interrupt=t0,qo.prototype.transition=op;const rs=e=>()=>e;function ip(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Xn(e,t,n){this.k=e,this.x=t,this.y=n}Xn.prototype={constructor:Xn,scale:function(e){return e===1?this:new Xn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Xn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var os=new Xn(1,0,0);pc.prototype=Xn.prototype;function pc(e){for(;!e.__zoom;)if(!(e=e.parentNode))return os;return e.__zoom}function Aa(e){e.stopImmediatePropagation()}function Jo(e){e.preventDefault(),e.stopImmediatePropagation()}function sp(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ap(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function mc(){return this.__zoom||os}function lp(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function up(){return navigator.maxTouchPoints||"ontouchstart"in this}function cp(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function yc(){var e=sp,t=ap,n=cp,r=lp,o=up,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Zv,c=zi("start","zoom","end"),u,g,f,h=500,v=150,b=0,C=10;function x(E){E.property("__zoom",mc).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",V).filter(o).on("touchstart.zoom",A).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",R).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(E,$,S,T){var M=E.selection?E.selection():E;M.property("__zoom",mc),E!==M?k(E,$,S,T):M.interrupt().each(function(){N(this,arguments).event(T).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},x.scaleBy=function(E,$,S,T){x.scaleTo(E,function(){var M=this.__zoom.k,H=typeof $=="function"?$.apply(this,arguments):$;return M*H},S,T)},x.scaleTo=function(E,$,S,T){x.transform(E,function(){var M=t.apply(this,arguments),H=this.__zoom,z=S==null?m(M):typeof S=="function"?S.apply(this,arguments):S,j=H.invert(z),Z=typeof $=="function"?$.apply(this,arguments):$;return n(_(p(H,Z),z,j),M,s)},S,T)},x.translateBy=function(E,$,S,T){x.transform(E,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof S=="function"?S.apply(this,arguments):S),t.apply(this,arguments),s)},null,T)},x.translateTo=function(E,$,S,T,M){x.transform(E,function(){var H=t.apply(this,arguments),z=this.__zoom,j=T==null?m(H):typeof T=="function"?T.apply(this,arguments):T;return n(os.translate(j[0],j[1]).scale(z.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof S=="function"?-S.apply(this,arguments):-S),H,s)},T,M)};function p(E,$){return $=Math.max(i[0],Math.min(i[1],$)),$===E.k?E:new Xn($,E.x,E.y)}function _(E,$,S){var T=$[0]-S[0]*E.k,M=$[1]-S[1]*E.k;return T===E.x&&M===E.y?E:new Xn(E.k,T,M)}function m(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function k(E,$,S,T){E.on("start.zoom",function(){N(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(T).end()}).tween("zoom",function(){var M=this,H=arguments,z=N(M,H).event(T),j=t.apply(M,H),Z=S==null?m(j):typeof S=="function"?S.apply(M,H):S,ee=Math.max(j[1][0]-j[0][0],j[1][1]-j[0][1]),re=M.__zoom,Q=typeof $=="function"?$.apply(M,H):$,de=l(re.invert(Z).concat(ee/re.k),Q.invert(Z).concat(ee/Q.k));return function(ne){if(ne===1)ne=Q;else{var _e=de(ne),Ne=ee/_e[2];ne=new Xn(Ne,Z[0]-_e[0]*Ne,Z[1]-_e[1]*Ne)}z.zoom(null,ne)}})}function N(E,$,S){return!S&&E.__zooming||new P(E,$)}function P(E,$){this.that=E,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,$),this.taps=0}P.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,$){return this.mouse&&E!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var $=gn(this.that).datum();c.call(E,this.that,new ip(E,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:c}),$)}};function O(E,...$){if(!e.apply(this,arguments))return;var S=N(this,$).event(E),T=this.__zoom,M=Math.max(i[0],Math.min(i[1],T.k*Math.pow(2,r.apply(this,arguments)))),H=_n(E);if(S.wheel)(S.mouse[0][0]!==H[0]||S.mouse[0][1]!==H[1])&&(S.mouse[1]=T.invert(S.mouse[0]=H)),clearTimeout(S.wheel);else{if(T.k===M)return;S.mouse=[H,T.invert(H)],ns(this),S.start()}Jo(E),S.wheel=setTimeout(z,v),S.zoom("mouse",n(_(p(T,M),S.mouse[0],S.mouse[1]),S.extent,s));function z(){S.wheel=null,S.end()}}function L(E,...$){if(f||!e.apply(this,arguments))return;var S=E.currentTarget,T=N(this,$,!0).event(E),M=gn(E.view).on("mousemove.zoom",Z,!0).on("mouseup.zoom",ee,!0),H=_n(E,S),z=E.clientX,j=E.clientY;Ru(E.view),Aa(E),T.mouse=[H,this.__zoom.invert(H)],ns(this),T.start();function Z(re){if(Jo(re),!T.moved){var Q=re.clientX-z,de=re.clientY-j;T.moved=Q*Q+de*de>b}T.event(re).zoom("mouse",n(_(T.that.__zoom,T.mouse[0]=_n(re,S),T.mouse[1]),T.extent,s))}function ee(re){M.on("mousemove.zoom mouseup.zoom",null),Bu(re.view,T.moved),Jo(re),T.event(re).end()}}function V(E,...$){if(e.apply(this,arguments)){var S=this.__zoom,T=_n(E.changedTouches?E.changedTouches[0]:E,this),M=S.invert(T),H=S.k*(E.shiftKey?.5:2),z=n(_(p(S,H),T,M),t.apply(this,$),s);Jo(E),a>0?gn(this).transition().duration(a).call(k,z,T,E):gn(this).call(x.transform,z,T,E)}}function A(E,...$){if(e.apply(this,arguments)){var S=E.touches,T=S.length,M=N(this,$,E.changedTouches.length===T).event(E),H,z,j,Z;for(Aa(E),z=0;z<T;++z)j=S[z],Z=_n(j,this),Z=[Z,this.__zoom.invert(Z),j.identifier],M.touch0?!M.touch1&&M.touch0[2]!==Z[2]&&(M.touch1=Z,M.taps=0):(M.touch0=Z,H=!0,M.taps=1+!!u);u&&(u=clearTimeout(u)),H&&(M.taps<2&&(g=Z[0],u=setTimeout(function(){u=null},h)),ns(this),M.start())}}function I(E,...$){if(this.__zooming){var S=N(this,$).event(E),T=E.changedTouches,M=T.length,H,z,j,Z;for(Jo(E),H=0;H<M;++H)z=T[H],j=_n(z,this),S.touch0&&S.touch0[2]===z.identifier?S.touch0[0]=j:S.touch1&&S.touch1[2]===z.identifier&&(S.touch1[0]=j);if(z=S.that.__zoom,S.touch1){var ee=S.touch0[0],re=S.touch0[1],Q=S.touch1[0],de=S.touch1[1],ne=(ne=Q[0]-ee[0])*ne+(ne=Q[1]-ee[1])*ne,_e=(_e=de[0]-re[0])*_e+(_e=de[1]-re[1])*_e;z=p(z,Math.sqrt(ne/_e)),j=[(ee[0]+Q[0])/2,(ee[1]+Q[1])/2],Z=[(re[0]+de[0])/2,(re[1]+de[1])/2]}else if(S.touch0)j=S.touch0[0],Z=S.touch0[1];else return;S.zoom("touch",n(_(z,j,Z),S.extent,s))}}function R(E,...$){if(this.__zooming){var S=N(this,$).event(E),T=E.changedTouches,M=T.length,H,z;for(Aa(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),H=0;H<M;++H)z=T[H],S.touch0&&S.touch0[2]===z.identifier?delete S.touch0:S.touch1&&S.touch1[2]===z.identifier&&delete S.touch1;if(S.touch1&&!S.touch0&&(S.touch0=S.touch1,delete S.touch1),S.touch0)S.touch0[1]=this.__zoom.invert(S.touch0[0]);else if(S.end(),S.taps===2&&(z=_n(z,this),Math.hypot(g[0]-z[0],g[1]-z[1])<C)){var j=gn(this).on("dblclick.zoom");j&&j.apply(this,arguments)}}}return x.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:rs(+E),x):r},x.filter=function(E){return arguments.length?(e=typeof E=="function"?E:rs(!!E),x):e},x.touchable=function(E){return arguments.length?(o=typeof E=="function"?E:rs(!!E),x):o},x.extent=function(E){return arguments.length?(t=typeof E=="function"?E:rs([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),x):t},x.scaleExtent=function(E){return arguments.length?(i[0]=+E[0],i[1]=+E[1],x):[i[0],i[1]]},x.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],x):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},x.constrain=function(E){return arguments.length?(n=E,x):n},x.duration=function(E){return arguments.length?(a=+E,x):a},x.interpolate=function(E){return arguments.length?(l=E,x):l},x.on=function(){var E=c.on.apply(c,arguments);return E===c?x:E},x.clickDistance=function(E){return arguments.length?(b=(E=+E)*E,x):Math.sqrt(b)},x.tapDistance=function(E){return arguments.length?(C=+E,x):C},x}const io={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},is=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]];var Dr;(function(e){e.Strict="strict",e.Loose="loose"})(Dr||(Dr={}));var Zn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Zn||(Zn={}));var ss;(function(e){e.Partial="partial",e.Full="full"})(ss||(ss={}));const La={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var so;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(so||(so={}));var Vr;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Vr||(Vr={}));var Se;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Se||(Se={}));const wc={[Se.Left]:Se.Right,[Se.Right]:Se.Left,[Se.Top]:Se.Bottom,[Se.Bottom]:Se.Top};function dp(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(const n of e.keys())if(!t.has(n))return!1;return!0}function _c(e,t,n){if(!n)return;const r=[];e.forEach((o,i)=>{t!=null&&t.has(i)||r.push(o)}),r.length&&n(r)}function bc(e){return e===null?null:e?"valid":"invalid"}const fp=e=>"id"in e&&"source"in e&&"target"in e,gp=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ia=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Qo=(e,t=[0,0])=>{const{width:n,height:r}=Kn(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},hp=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):Ia(o)?o:t.nodeLookup.get(o.id));const a=s?us(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return as(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ls(n)},ei=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const o=us(r);n=as(n,o)}}),ls(n)},xc=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const a={...ni(t,[n,r,o]),width:t.width/o,height:t.height/o},l=[];for(const c of e.values()){const{measured:u,selectable:g=!0,hidden:f=!1}=c;if(s&&!g||f)continue;const h=u.width??c.width??c.initialWidth??null,v=u.height??c.height??c.initialHeight??null,b=ti(a,lo(c)),C=(h??0)*(v??0),x=i&&b>0;(!c.internals.handleBounds||x||b>=C||c.dragging)&&l.push(c)}return l},za=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function vp(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function pp({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=vp(e,s),l=ei(a),c=qa(l,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(c,{duration:s==null?void 0:s.duration}),Promise.resolve(!0)}function mp({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},u=s.origin??r;let g=o;if(s.extent==="parent"&&!s.expandParent)if(!a)i==null||i("005",io.error005());else{const h=a.measured.width,v=a.measured.height;h&&v&&(g=[[l,c],[l+h,c+v]])}else a&&co(s.extent)&&(g=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);const f=co(g)?Or(t,g,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",io.error015())),{position:{x:f.x-l+(s.measured.width??0)*u[0],y:f.y-c+(s.measured.height??0)*u[1]},positionAbsolute:f}}async function Cc({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const h=i.has(f.id),v=!h&&f.parentId&&s.find(b=>b.id===f.parentId);(h||v)&&s.push(f)}const a=new Set(t.map(f=>f.id)),l=r.filter(f=>f.deletable!==!1),u=za(s,l);for(const f of l)a.has(f.id)&&!u.find(v=>v.id===f.id)&&u.push(f);if(!o)return{edges:u,nodes:s};const g=await o({nodes:s,edges:u});return typeof g=="boolean"?g?{edges:u,nodes:s}:{edges:[],nodes:[]}:g}const ao=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Or=(e={x:0,y:0},t,n)=>({x:ao(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ao(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function $c(e,t,n){const{width:r,height:o}=Kn(n),{x:i,y:s}=n.internals.positionAbsolute;return Or(e,[[i,s],[i+r,s+o]],t)}const Ec=(e,t,n)=>e<t?ao(Math.abs(e-t),1,t)/t:e>n?-ao(Math.abs(e-n),1,t)/t:0,kc=(e,t,n=15,r=40)=>{const o=Ec(e.x,r,t.width-r)*n,i=Ec(e.y,r,t.height-r)*n;return[o,i]},as=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ra=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),ls=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),lo=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Ia(e)?e.internals.positionAbsolute:Qo(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},us=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Ia(e)?e.internals.positionAbsolute:Qo(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},Sc=(e,t)=>ls(as(Ra(e),Ra(t))),ti=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Pc=e=>Ln(e.width)&&Ln(e.height)&&Ln(e.x)&&Ln(e.y),Ln=e=>!isNaN(e)&&isFinite(e),yp=(e,t)=>{},Ba=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ni=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const a={x:(e-n)/o,y:(t-r)/o};return i?Ba(a,s):a},cs=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function uo(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function wp(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=uo(e,n),o=uo(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=uo(e.top??e.y??0,n),o=uo(e.bottom??e.y??0,n),i=uo(e.left??e.x??0,t),s=uo(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function _p(e,t,n,r,o,i){const{x:s,y:a}=cs(e,[t,n,r]),{x:l,y:c}=cs({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=o-l,g=i-c;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(g)}}const qa=(e,t,n,r,o,i)=>{const s=wp(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),u=ao(c,r,o),g=e.x+e.width/2,f=e.y+e.height/2,h=t/2-g*u,v=n/2-f*u,b=_p(e,h,v,u,t,n),C={left:Math.min(b.left-s.left,0),top:Math.min(b.top-s.top,0),right:Math.min(b.right-s.right,0),bottom:Math.min(b.bottom-s.bottom,0)};return{x:h-C.left+C.right,y:v-C.top+C.bottom,zoom:u}},ds=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function co(e){return e!==void 0&&e!=="parent"}function Kn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function fs(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function bp(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const a=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function xp(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function Ya(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=jn(e),a=ni({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:l,y:c}=n?Ba(a,t):a;return{xSnapped:l,ySnapped:c,...a}}const Nc=e=>({width:e.offsetWidth,height:e.offsetHeight}),Cp=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},$p=["INPUT","SELECT","TEXTAREA"];function Ep(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:$p.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Tc=e=>"clientX"in e,jn=(e,t)=>{var i,s;const n=Tc(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},Mc=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Nc(s)}})};function kp({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+o*.375+s*.375+n*.125,c=t*.125+i*.375+a*.375+r*.125,u=Math.abs(l-e),g=Math.abs(c-t);return[l,c,u,g]}function gs(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Hc({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case Se.Left:return[t-gs(t-r,i),n];case Se.Right:return[t+gs(r-t,i),n];case Se.Top:return[t,n-gs(n-o,i)];case Se.Bottom:return[t,n+gs(o-n,i)]}}function Dc({sourceX:e,sourceY:t,sourcePosition:n=Se.Bottom,targetX:r,targetY:o,targetPosition:i=Se.Top,curvature:s=.25}){const[a,l]=Hc({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[c,u]=Hc({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[g,f,h,v]=kp({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${r},${o}`,g,f,h,v]}function Vc({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[i,a,o,s]}function Sp({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1}){if(!o)return r;const i=n||t.selected||e.selected,s=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(i?s:0)}function Pp({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=as(us(e),us(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return ti(s,ls(i))>0}const Np=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Tp=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Mp=(e,t)=>{if(!e.source||!e.target)return t;let n;return fp(e)?n={...e}:n={...e,id:Np(e)},Tp(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Fa({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=Vc({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const Oc={[Se.Left]:{x:-1,y:0},[Se.Right]:{x:1,y:0},[Se.Top]:{x:0,y:-1},[Se.Bottom]:{x:0,y:1}},Hp=({source:e,sourcePosition:t=Se.Bottom,target:n})=>t===Se.Left||t===Se.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Ac=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Dp({source:e,sourcePosition:t=Se.Bottom,target:n,targetPosition:r=Se.Top,center:o,offset:i}){const s=Oc[t],a=Oc[r],l={x:e.x+s.x*i,y:e.y+s.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},u=Hp({source:l,sourcePosition:t,target:c}),g=u.x!==0?"x":"y",f=u[g];let h=[],v,b;const C={x:0,y:0},x={x:0,y:0},[p,_,m,k]=Vc({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[g]*a[g]===-1){v=o.x??p,b=o.y??_;const P=[{x:v,y:l.y},{x:v,y:c.y}],O=[{x:l.x,y:b},{x:c.x,y:b}];s[g]===f?h=g==="x"?P:O:h=g==="x"?O:P}else{const P=[{x:l.x,y:c.y}],O=[{x:c.x,y:l.y}];if(g==="x"?h=s.x===f?O:P:h=s.y===f?P:O,t===r){const R=Math.abs(e[g]-n[g]);if(R<=i){const E=Math.min(i-1,i-R);s[g]===f?C[g]=(l[g]>e[g]?-1:1)*E:x[g]=(c[g]>n[g]?-1:1)*E}}if(t!==r){const R=g==="x"?"y":"x",E=s[g]===a[R],$=l[R]>c[R],S=l[R]<c[R];(s[g]===1&&(!E&&$||E&&S)||s[g]!==1&&(!E&&S||E&&$))&&(h=g==="x"?P:O)}const L={x:l.x+C.x,y:l.y+C.y},V={x:c.x+x.x,y:c.y+x.y},A=Math.max(Math.abs(L.x-h[0].x),Math.abs(V.x-h[0].x)),I=Math.max(Math.abs(L.y-h[0].y),Math.abs(V.y-h[0].y));A>=I?(v=(L.x+V.x)/2,b=h[0].y):(v=h[0].x,b=(L.y+V.y)/2)}return[[e,{x:l.x+C.x,y:l.y+C.y},...h,{x:c.x+x.x,y:c.y+x.y},n],v,b,m,k]}function Vp(e,t,n,r){const o=Math.min(Ac(e,t)/2,Ac(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+o*c},${s}Q ${i},${s} ${i},${s+o*u}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+o*l}Q ${i},${s} ${i+o*a},${s}`}function hs({sourceX:e,sourceY:t,sourcePosition:n=Se.Bottom,targetX:r,targetY:o,targetPosition:i=Se.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20}){const[u,g,f,h,v]=Dp({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:c});return[u.reduce((C,x,p)=>{let _="";return p>0&&p<u.length-1?_=Vp(u[p-1],x,u[p+1],s):_=`${p===0?"M":"L"}${x.x} ${x.y}`,C+=_,C},""),g,f,h,v]}function Lc(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Op(e){var g;const{sourceNode:t,targetNode:n}=e;if(!Lc(t)||!Lc(n))return null;const r=t.internals.handleBounds||Ic(t.handles),o=n.internals.handleBounds||Ic(n.handles),i=zc((r==null?void 0:r.source)??[],e.sourceHandle),s=zc(e.connectionMode===Dr.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(g=e.onError)==null||g.call(e,"008",io.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(i==null?void 0:i.position)||Se.Bottom,l=(s==null?void 0:s.position)||Se.Top,c=ri(t,i,a),u=ri(n,s,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:l}}function Ic(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function ri(e,t,n=Se.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Kn(e);if(r)return{x:o+s/2,y:i+a/2};switch((t==null?void 0:t.position)??n){case Se.Top:return{x:o+s/2,y:i};case Se.Right:return{x:o+s,y:i+a/2};case Se.Bottom:return{x:o+s/2,y:i+a};case Se.Left:return{x:o,y:i+a/2}}}function zc(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Wa(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Ap(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||r,a.markerEnd||o].forEach(l=>{if(l&&typeof l=="object"){const c=Wa(l,t);i.has(c)||(s.push({id:c,color:l.color||n,...l}),i.add(c))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}function Lp(e,t,n,r,o){let i=.5;o==="start"?i=0:o==="end"&&(i=1);let s=[(e.x+e.width*i)*t.zoom+t.x,e.y*t.zoom+t.y-r],a=[-100*i,-100];switch(n){case Se.Right:s=[(e.x+e.width)*t.zoom+t.x+r,(e.y+e.height*i)*t.zoom+t.y],a=[0,-100*i];break;case Se.Bottom:s[1]=(e.y+e.height)*t.zoom+t.y+r,a[1]=0;break;case Se.Left:s=[e.x*t.zoom+t.x-r,(e.y+e.height*i)*t.zoom+t.y],a=[-100,-100*i];break}return`translate(${s[0]}px, ${s[1]}px) translate(${a[0]}%, ${a[1]}%)`}const Xa={nodeOrigin:[0,0],nodeExtent:is,elevateNodesOnSelect:!0,defaults:{}},Ip={...Xa,checkEquality:!0};function Za(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function zp(e,t,n){const r=Za(Xa,n);for(const o of e.values())if(o.parentId)Ka(o,e,t,r);else{const i=Qo(o,r.nodeOrigin),s=co(o.extent)?o.extent:r.nodeExtent,a=Or(i,s,Kn(o));o.internals.positionAbsolute=a}}function Rc(e,t,n,r){var l,c;const o=Za(Ip,r);let i=e.length>0;const s=new Map(t),a=o!=null&&o.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const u of e){let g=s.get(u.id);if(o.checkEquality&&u===(g==null?void 0:g.internals.userNode))t.set(u.id,g);else{const f=Qo(u,o.nodeOrigin),h=co(u.extent)?u.extent:o.nodeExtent,v=Or(f,h,Kn(u));g={...o.defaults,...u,measured:{width:(l=u.measured)==null?void 0:l.width,height:(c=u.measured)==null?void 0:c.height},internals:{positionAbsolute:v,handleBounds:u.measured?g==null?void 0:g.internals.handleBounds:void 0,z:Bc(u,a),userNode:u}},t.set(u.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(i=!1),u.parentId&&Ka(g,t,n,r)}return i}function Rp(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Ka(e,t,n,r){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:s}=Za(Xa,r),a=e.parentId,l=t.get(a);if(!l){console.warn(`Parent node ${a} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Rp(e,n);const c=o?1e3:0,{x:u,y:g,z:f}=Bp(e,l,i,s,c),{positionAbsolute:h}=e.internals,v=u!==h.x||g!==h.y;(v||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:u,y:g}:h,z:f}})}function Bc(e,t){return(Ln(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Bp(e,t,n,r,o){const{x:i,y:s}=t.internals.positionAbsolute,a=Kn(e),l=Qo(e,n),c=co(e.extent)?Or(l,e.extent,a):l;let u=Or({x:i+c.x,y:s+c.y},r,a);e.extent==="parent"&&(u=$c(u,a,t));const g=Bc(e,o),f=t.internals.z??0;return{x:u.x,y:u.y,z:f>g?f:g}}function qp(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const a of e){const l=t.get(a.parentId);if(!l)continue;const c=((s=i.get(a.parentId))==null?void 0:s.expandedRect)??lo(l),u=Sc(c,a.rect);i.set(a.parentId,{expandedRect:u,parent:l})}return i.size>0&&i.forEach(({expandedRect:a,parent:l},c)=>{var _;const u=l.internals.positionAbsolute,g=Kn(l),f=l.origin??r,h=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,v=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,b=Math.max(g.width,Math.round(a.width)),C=Math.max(g.height,Math.round(a.height)),x=(b-g.width)*f[0],p=(C-g.height)*f[1];(h>0||v>0||x||p)&&(o.push({id:c,type:"position",position:{x:l.position.x-h+x,y:l.position.y-v+p}}),(_=n.get(c))==null||_.forEach(m=>{e.some(k=>k.id===m.id)||o.push({id:m.id,type:"position",position:{x:m.position.x+h,y:m.position.y+v}})})),(g.width<a.width||g.height<a.height||h||v)&&o.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:b+(h?f[0]*h-x:0),height:C+(v?f[1]*v-p:0)}})}),o}function Yp(e,t,n,r,o,i){const s=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!s)return{changes:[],updatedInternals:a};const l=[],c=window.getComputedStyle(s),{m22:u}=new window.DOMMatrixReadOnly(c.transform),g=[];for(const f of e.values()){const h=t.get(f.id);if(!h)continue;if(h.hidden){t.set(h.id,{...h,internals:{...h.internals,handleBounds:void 0}}),a=!0;continue}const v=Nc(f.nodeElement),b=h.measured.width!==v.width||h.measured.height!==v.height;if(!!(v.width&&v.height&&(b||!h.internals.handleBounds||f.force))){const x=f.nodeElement.getBoundingClientRect(),p=co(h.extent)?h.extent:i;let{positionAbsolute:_}=h.internals;h.parentId&&h.extent==="parent"?_=$c(_,v,t.get(h.parentId)):p&&(_=Or(_,p,v));const m={...h,measured:v,internals:{...h.internals,positionAbsolute:_,handleBounds:{source:Mc("source",f.nodeElement,x,u,h.id),target:Mc("target",f.nodeElement,x,u,h.id)}}};t.set(h.id,m),h.parentId&&Ka(m,t,n,{nodeOrigin:o}),a=!0,b&&(l.push({id:h.id,type:"dimensions",dimensions:v}),h.expandParent&&h.parentId&&g.push({id:h.id,parentId:h.parentId,rect:lo(m,o)}))}}if(g.length>0){const f=qp(g,t,n,o);l.push(...f)}return{changes:l,updatedInternals:a}}async function Fp({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function qc(e,t,n,r,o,i){let s=o;const a=r.get(s)||new Map;r.set(s,a.set(n,t)),s=`${o}-${e}`;const l=r.get(s)||new Map;if(r.set(s,l.set(n,t)),i){s=`${o}-${e}-${i}`;const c=r.get(s)||new Map;r.set(s,c.set(n,t))}}function Yc(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:a=null}=r,l={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:a},c=`${o}-${s}--${i}-${a}`,u=`${i}-${a}--${o}-${s}`;qc("source",l,u,e,o,s),qc("target",l,c,e,i,a),t.set(r.id,r)}}function Wp(e,t){if(e===null||t===null)return!1;const n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t];if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(n[o].id!==r[o].id||n[o].type!==r[o].type||!Object.is(n[o].data,r[o].data))return!1;return!0}function Fc(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Fc(n,t):!1}function Wc(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Xp(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!Fc(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&o.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return o}function ja({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,a,l;const o=[];for(const[c,u]of t){const g=(s=n.get(c))==null?void 0:s.internals.userNode;g&&o.push({...g,position:u.position,dragging:r})}if(!e)return[o[0],o];const i=(a=n.get(e))==null?void 0:a.internals.userNode;return[i?{...i,position:((l=t.get(e))==null?void 0:l.position)||i.position,dragging:r}:o[0],o]}function Zp({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,a=new Map,l=!1,c={x:0,y:0},u=null,g=!1,f=null,h=!1;function v({noDragClassName:C,handleSelector:x,domNode:p,isSelectable:_,nodeId:m,nodeClickDistance:k=0}){f=gn(p);function N({x:V,y:A},I){const{nodeLookup:R,nodeExtent:E,snapGrid:$,snapToGrid:S,nodeOrigin:T,onNodeDrag:M,onSelectionDrag:H,onError:z,updateNodePositions:j}=t();i={x:V,y:A};let Z=!1,ee={x:0,y:0,x2:0,y2:0};if(a.size>1&&E){const re=ei(a);ee=Ra(re)}for(const[re,Q]of a){if(!R.has(re))continue;let de={x:V-Q.distance.x,y:A-Q.distance.y};S&&(de=Ba(de,$));let ne=[[E[0][0],E[0][1]],[E[1][0],E[1][1]]];if(a.size>1&&E&&!Q.extent){const{positionAbsolute:Ve}=Q.internals,le=Ve.x-ee.x+E[0][0],pe=Ve.x+Q.measured.width-ee.x2+E[1][0],se=Ve.y-ee.y+E[0][1],U=Ve.y+Q.measured.height-ee.y2+E[1][1];ne=[[le,se],[pe,U]]}const{position:_e,positionAbsolute:Ne}=mp({nodeId:re,nextPosition:de,nodeLookup:R,nodeExtent:ne,nodeOrigin:T,onError:z});Z=Z||Q.position.x!==_e.x||Q.position.y!==_e.y,Q.position=_e,Q.internals.positionAbsolute=Ne}if(Z&&(j(a,!0),I&&(r||M||!m&&H))){const[re,Q]=ja({nodeId:m,dragItems:a,nodeLookup:R});r==null||r(I,a,re,Q),M==null||M(I,re,Q),m||H==null||H(I,Q)}}async function P(){if(!u)return;const{transform:V,panBy:A,autoPanSpeed:I,autoPanOnNodeDrag:R}=t();if(!R){l=!1,cancelAnimationFrame(s);return}const[E,$]=kc(c,u,I);(E!==0||$!==0)&&(i.x=(i.x??0)-E/V[2],i.y=(i.y??0)-$/V[2],await A({x:E,y:$})&&N(i,null)),s=requestAnimationFrame(P)}function O(V){var Z;const{nodeLookup:A,multiSelectionActive:I,nodesDraggable:R,transform:E,snapGrid:$,snapToGrid:S,selectNodesOnDrag:T,onNodeDragStart:M,onSelectionDragStart:H,unselectNodesAndEdges:z}=t();g=!0,(!T||!_)&&!I&&m&&((Z=A.get(m))!=null&&Z.selected||z()),_&&T&&m&&(e==null||e(m));const j=Ya(V.sourceEvent,{transform:E,snapGrid:$,snapToGrid:S,containerBounds:u});if(i=j,a=Xp(A,R,j,m),a.size>0&&(n||M||!m&&H)){const[ee,re]=ja({nodeId:m,dragItems:a,nodeLookup:A});n==null||n(V.sourceEvent,a,ee,re),M==null||M(V.sourceEvent,ee,re),m||H==null||H(V.sourceEvent,re)}}const L=bv().clickDistance(k).on("start",V=>{const{domNode:A,nodeDragThreshold:I,transform:R,snapGrid:E,snapToGrid:$}=t();u=(A==null?void 0:A.getBoundingClientRect())||null,h=!1,I===0&&O(V),i=Ya(V.sourceEvent,{transform:R,snapGrid:E,snapToGrid:$,containerBounds:u}),c=jn(V.sourceEvent,u)}).on("drag",V=>{const{autoPanOnNodeDrag:A,transform:I,snapGrid:R,snapToGrid:E,nodeDragThreshold:$,nodeLookup:S}=t(),T=Ya(V.sourceEvent,{transform:I,snapGrid:R,snapToGrid:E,containerBounds:u});if((V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||m&&!S.has(m))&&(h=!0),!h){if(!l&&A&&g&&(l=!0,P()),!g){const M=T.xSnapped-(i.x??0),H=T.ySnapped-(i.y??0);Math.sqrt(M*M+H*H)>$&&O(V)}(i.x!==T.xSnapped||i.y!==T.ySnapped)&&a&&g&&(c=jn(V.sourceEvent,u),N(T,V.sourceEvent))}}).on("end",V=>{if(!(!g||h)&&(l=!1,g=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:A,updateNodePositions:I,onNodeDragStop:R,onSelectionDragStop:E}=t();if(I(a,!1),o||R||!m&&E){const[$,S]=ja({nodeId:m,dragItems:a,nodeLookup:A,dragging:!1});o==null||o(V.sourceEvent,a,$,S),R==null||R(V.sourceEvent,$,S),m||E==null||E(V.sourceEvent,S)}}}).filter(V=>{const A=V.target;return!V.button&&(!C||!Wc(A,`.${C}`,p))&&(!x||Wc(A,x,p))});f.call(L)}function b(){f==null||f.on(".drag",null)}return{update:v,destroy:b}}function Kp(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())ti(o,lo(i))>0&&r.push(i);return r}const jp=250;function Up(e,t,n,r){var a,l;let o=[],i=1/0;const s=Kp(e,n,t+jp);for(const c of s){const u=[...((a=c.internals.handleBounds)==null?void 0:a.source)??[],...((l=c.internals.handleBounds)==null?void 0:l.target)??[]];for(const g of u){if(r.nodeId===g.nodeId&&r.type===g.type&&r.id===g.id)continue;const{x:f,y:h}=ri(c,g,g.position,!0),v=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(h-e.y,2));v>t||(v<i?(o=[{...g,x:f,y:h}],i=v):v===i&&o.push({...g,x:f,y:h}))}}if(!o.length)return null;if(o.length>1){const c=r.type==="source"?"target":"source";return o.find(u=>u.type===c)??o[0]}return o[0]}function Xc(e,t,n,r,o,i=!1){var c,u,g;const s=r.get(e);if(!s)return null;const a=o==="strict"?(c=s.internals.handleBounds)==null?void 0:c[t]:[...((u=s.internals.handleBounds)==null?void 0:u.source)??[],...((g=s.internals.handleBounds)==null?void 0:g.target)??[]],l=(n?a==null?void 0:a.find(f=>f.id===n):a==null?void 0:a[0])??null;return l&&i?{...l,...ri(s,l,l.position,!0)}:l}function Zc(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Gp(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Kc=()=>!0;function Jp(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:g,panBy:f,cancelConnection:h,onConnectStart:v,onConnect:b,onConnectEnd:C,isValidConnection:x=Kc,onReconnectEnd:p,updateConnection:_,getTransform:m,getFromHandle:k,autoPanSpeed:N}){const P=Cp(e.target);let O=0,L;const{x:V,y:A}=jn(e),I=P==null?void 0:P.elementFromPoint(V,A),R=Zc(i,I),E=a==null?void 0:a.getBoundingClientRect();if(!E||!R)return;const $=Xc(o,R,r,l,t);if(!$)return;let S=jn(e,E),T=!1,M=null,H=!1,z=null;function j(){if(!u||!E)return;const[Ne,Ve]=kc(S,E,N);f({x:Ne,y:Ve}),O=requestAnimationFrame(j)}const Z={...$,nodeId:o,type:R,position:$.position},ee=l.get(o),Q={inProgress:!0,isValid:null,from:ri(ee,Z,Se.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:ee,to:S,toHandle:null,toPosition:wc[Z.position],toNode:null};_(Q);let de=Q;v==null||v(e,{nodeId:o,handleId:r,handleType:R});function ne(Ne){if(!k()||!Z){_e(Ne);return}const Ve=m();S=jn(Ne,E),L=Up(ni(S,Ve,!1,[1,1]),n,l,Z),T||(j(),T=!0);const le=jc(Ne,{handle:L,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:x,doc:P,lib:c,flowId:g,nodeLookup:l});z=le.handleDomNode,M=le.connection,H=Gp(!!L,le.isValid);const pe={...de,isValid:H,to:L&&H?cs({x:L.x,y:L.y},Ve):S,toHandle:le.toHandle,toPosition:H&&le.toHandle?le.toHandle.position:wc[Z.position],toNode:le.toHandle?l.get(le.toHandle.nodeId):null};H&&L&&de.toHandle&&pe.toHandle&&de.toHandle.type===pe.toHandle.type&&de.toHandle.nodeId===pe.toHandle.nodeId&&de.toHandle.id===pe.toHandle.id&&de.to.x===pe.to.x&&de.to.y===pe.to.y||(_(pe),de=pe)}function _e(Ne){(L||z)&&M&&H&&(b==null||b(M));const{inProgress:Ve,...le}=de,pe={...le,toPosition:de.toHandle?de.toPosition:null};C==null||C(Ne,pe),i&&(p==null||p(Ne,pe)),h(),cancelAnimationFrame(O),T=!1,H=!1,M=null,z=null,P.removeEventListener("mousemove",ne),P.removeEventListener("mouseup",_e),P.removeEventListener("touchmove",ne),P.removeEventListener("touchend",_e)}P.addEventListener("mousemove",ne),P.addEventListener("mouseup",_e),P.addEventListener("touchmove",ne),P.addEventListener("touchend",_e)}function jc(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=Kc,nodeLookup:u}){const g=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:v}=jn(e),b=s.elementFromPoint(h,v),C=b!=null&&b.classList.contains(`${a}-flow__handle`)?b:f,x={handleDomNode:C,isValid:!1,connection:null,toHandle:null};if(C){const p=Zc(void 0,C),_=C.getAttribute("data-nodeid"),m=C.getAttribute("data-handleid"),k=C.classList.contains("connectable"),N=C.classList.contains("connectableend");if(!_||!p)return x;const P={source:g?_:r,sourceHandle:g?m:o,target:g?r:_,targetHandle:g?o:m};x.connection=P;const L=k&&N&&(n===Dr.Strict?g&&p==="source"||!g&&p==="target":_!==r||m!==o);x.isValid=L&&c(P),x.toHandle=Xc(_,p,m,u,n,!1)}return x}const Qp={onPointerDown:Jp,isValid:jc};function e2({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=gn(e);function i({translateExtent:a,width:l,height:c,zoomStep:u=10,pannable:g=!0,zoomable:f=!0,inversePan:h=!1}){const v=_=>{const m=n();if(_.sourceEvent.type!=="wheel"||!t)return;const k=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*u,N=m[2]*Math.pow(2,k);t.scaleTo(N)};let b=[0,0];const C=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(b=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},x=_=>{const m=n();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!t)return;const k=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],N=[k[0]-b[0],k[1]-b[1]];b=k;const P=r()*Math.max(m[2],Math.log(m[2]))*(h?-1:1),O={x:m[0]-N[0]*P,y:m[1]-N[1]*P},L=[[0,0],[l,c]];t.setViewportConstrained({x:O.x,y:O.y,zoom:m[2]},L,a)},p=yc().on("start",C).on("zoom",g?x:null).on("zoom.wheel",f?v:null);o.call(p,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:_n}}const t2=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,vs=e=>({x:e.x,y:e.y,zoom:e.k}),Ua=({x:e,y:t,zoom:n})=>os.translate(e,t).scale(n),fo=(e,t)=>e.target.closest(`.${t}`),Uc=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Ga=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},Gc=e=>{const t=e.ctrlKey&&ds()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function n2({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(fo(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();const g=n.property("__zoom").k||1;if(u.ctrlKey&&s){const C=_n(u),x=Gc(u),p=g*Math.pow(2,x);r.scaleTo(n,p,C,u);return}const f=u.deltaMode===1?20:1;let h=o===Zn.Vertical?0:u.deltaX*f,v=o===Zn.Horizontal?0:u.deltaY*f;!ds()&&u.shiftKey&&o!==Zn.Vertical&&(h=u.deltaY*f,v=0),r.translateBy(n,-(h/g)*i,-(v/g)*i,{internal:!0});const b=vs(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,a==null||a(u,b)),e.isPanScrolling&&(l==null||l(u,b),e.panScrollTimeout=setTimeout(()=>{c==null||c(u,b),e.isPanScrolling=!1},150))}}function r2({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,a=fo(r,e);if(r.ctrlKey&&i&&a&&r.preventDefault(),s||a)return null;r.preventDefault(),n.call(this,r,o)}}function o2({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,a;if((i=r.sourceEvent)!=null&&i.internal)return;const o=vs(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function i2({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,a;e.usedRightMouseButton=!!(n&&Uc(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((a=i.sourceEvent)!=null&&a.internal)&&(o==null||o(i.sourceEvent,vs(i.transform)))}}function s2({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var a;if(!((a=s.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,i&&Uc(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o&&t2(e.prevViewport,s.transform))){const l=vs(s.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,l)},n?150:0)}}}function a2({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:c}){return u=>{var v;const g=e||t,f=n&&u.ctrlKey;if(u.button===1&&u.type==="mousedown"&&(fo(u,`${c}-flow__node`)||fo(u,`${c}-flow__edge`)))return!0;if(!r&&!g&&!o&&!i&&!n||s||fo(u,a)&&u.type==="wheel"||fo(u,l)&&(u.type!=="wheel"||o&&u.type==="wheel"&&!e)||!n&&u.ctrlKey&&u.type==="wheel")return!1;if(!n&&u.type==="touchstart"&&((v=u.touches)==null?void 0:v.length)>1)return u.preventDefault(),!1;if(!g&&!o&&!f&&u.type==="wheel"||!r&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(r)&&!r.includes(u.button)&&u.type==="mousedown")return!1;const h=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||u.type==="wheel")&&h}}function l2({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:o,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),f=yc().clickDistance(!Ln(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(o),h=gn(e).call(f);_({x:i.x,y:i.y,zoom:ao(i.zoom,t,n)},[[0,0],[g.width,g.height]],o);const v=h.on("wheel.zoom"),b=h.on("dblclick.zoom");f.wheelDelta(Gc);function C(I,R){return h?new Promise(E=>{f==null||f.transform(Ga(h,R==null?void 0:R.duration,()=>E(!0)),I)}):Promise.resolve(!1)}function x({noWheelClassName:I,noPanClassName:R,onPaneContextMenu:E,userSelectionActive:$,panOnScroll:S,panOnDrag:T,panOnScrollMode:M,panOnScrollSpeed:H,preventScrolling:z,zoomOnPinch:j,zoomOnScroll:Z,zoomOnDoubleClick:ee,zoomActivationKeyPressed:re,lib:Q,onTransformChange:de}){$&&!u.isZoomingOrPanning&&p();const _e=S&&!re&&!$?n2({zoomPanValues:u,noWheelClassName:I,d3Selection:h,d3Zoom:f,panOnScrollMode:M,panOnScrollSpeed:H,zoomOnPinch:j,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):r2({noWheelClassName:I,preventScrolling:z,d3ZoomHandler:v});if(h.on("wheel.zoom",_e,{passive:!1}),!$){const Ve=o2({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",Ve);const le=i2({zoomPanValues:u,panOnDrag:T,onPaneContextMenu:!!E,onPanZoom:s,onTransformChange:de});f.on("zoom",le);const pe=s2({zoomPanValues:u,panOnDrag:T,panOnScroll:S,onPaneContextMenu:E,onPanZoomEnd:l,onDraggingChange:c});f.on("end",pe)}const Ne=a2({zoomActivationKeyPressed:re,panOnDrag:T,zoomOnScroll:Z,panOnScroll:S,zoomOnDoubleClick:ee,zoomOnPinch:j,userSelectionActive:$,noPanClassName:R,noWheelClassName:I,lib:Q});f.filter(Ne),ee?h.on("dblclick.zoom",b):h.on("dblclick.zoom",null)}function p(){f.on("zoom",null)}async function _(I,R,E){const $=Ua(I),S=f==null?void 0:f.constrain()($,R,E);return S&&await C(S),new Promise(T=>T(S))}async function m(I,R){const E=Ua(I);return await C(E,R),new Promise($=>$(E))}function k(I){if(h){const R=Ua(I),E=h.property("__zoom");(E.k!==I.zoom||E.x!==I.x||E.y!==I.y)&&(f==null||f.transform(h,R,null,{sync:!0}))}}function N(){const I=h?pc(h.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function P(I,R){return h?new Promise(E=>{f==null||f.scaleTo(Ga(h,R==null?void 0:R.duration,()=>E(!0)),I)}):Promise.resolve(!1)}function O(I,R){return h?new Promise(E=>{f==null||f.scaleBy(Ga(h,R==null?void 0:R.duration,()=>E(!0)),I)}):Promise.resolve(!1)}function L(I){f==null||f.scaleExtent(I)}function V(I){f==null||f.translateExtent(I)}function A(I){const R=!Ln(I)||I<0?0:I;f==null||f.clickDistance(R)}return{update:x,destroy:p,setViewport:m,setViewportConstrained:_,getViewport:N,scaleTo:P,scaleBy:O,setScaleExtent:L,setTranslateExtent:V,syncViewport:k,setClickDistance:A}}var Jc;(function(e){e.Line="line",e.Handle="handle"})(Jc||(Jc={}));var u2=ie('<div role="button" tabindex="-1"><!></div>');function lr(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(ee,"$connectable",n),i=()=>oe(_e,"$connectionRadius",n),s=()=>oe(de,"$domNode",n),a=()=>oe(ne,"$nodeLookup",n),l=()=>oe(Q,"$connectionMode",n),c=()=>oe(le,"$lib",n),u=()=>oe(we,"$autoPanOnConnect",n),g=()=>oe(Ae,"$flowId",n),f=()=>oe(Ve,"$isValidConnectionStore",n),h=()=>oe(se,"$onedgecreate",n),v=()=>oe(Be,"$onConnectAction",n),b=()=>oe(Le,"$onConnectStartAction",n),C=()=>oe(ye,"$onConnectEndAction",n),x=()=>oe(Ne,"$viewport",n),p=()=>oe(Ue,"$connection",n),_=()=>oe(Pe,"$edges",n),m=()=>oe(Oe,"$connectionLookup",n),k=ae(),N=ae(),P=ae(),O=ae(),L=ae(),V=ae(),A=ae(),I=ae();let R=w(t,"id",12,void 0),E=w(t,"type",12,"source"),$=w(t,"position",28,()=>Se.Top),S=w(t,"style",12,void 0),T=w(t,"isValidConnection",12,void 0),M=w(t,"onconnect",12,void 0),H=w(t,"ondisconnect",12,void 0),z=w(t,"isConnectable",12,void 0),j=w(t,"class",12,void 0);const Z=Cr("svelteflow__node_id"),ee=Cr("svelteflow__node_connectable"),re=et(),{connectionMode:Q,domNode:de,nodeLookup:ne,connectionRadius:_e,viewport:Ne,isValidConnection:Ve,lib:le,addEdge:pe,onedgecreate:se,panBy:U,cancelConnection:ue,updateConnection:F,autoPanOnConnect:we,edges:Pe,connectionLookup:Oe,onconnect:Be,onconnectstart:Le,onconnectend:ye,flowId:Ae,connection:Ue}=re;function gt($e){const Fe=Tc($e);(Fe&&$e.button===0||!Fe)&&Qp.onPointerDown($e,{handleId:d(P),nodeId:Z,isTarget:d(k),connectionRadius:i(),domNode:s(),nodeLookup:a(),connectionMode:l(),lib:c(),autoPanOnConnect:u(),flowId:g(),isValidConnection:T()??f(),updateConnection:F,cancelConnection:ue,panBy:U,onConnect:Ie=>{var Et;const Mt=h()?h()(Ie):Ie;Mt&&(pe(Mt),(Et=v())==null||Et(Ie))},onConnectStart:(Ie,Mt)=>{var Et;(Et=b())==null||Et(Ie,{nodeId:Mt.nodeId,handleId:Mt.handleId,handleType:Mt.handleType})},onConnectEnd:(Ie,Mt)=>{var Et;(Et=C())==null||Et(Ie,Mt)},getTransform:()=>[x().x,x().y,x().zoom],getFromHandle:()=>p().fromHandle})}let K=ae(null),Ge=ae();ve(()=>q(E()),()=>{te(k,E()==="target")}),ve(()=>(q(z()),o()),()=>{te(N,z()!==void 0?z():o())}),ve(()=>q(R()),()=>{te(P,R()||null)}),ve(()=>(q(M()),q(H()),_(),m(),q(E()),q(R())),()=>{(M()||H())&&(_(),te(Ge,m().get(`${Z}-${E()}${R()?`-${R()}`:""}`)))}),ve(()=>(d(K),d(Ge),q(H()),q(M())),()=>{if(d(K)&&!dp(d(Ge),d(K))){const $e=d(Ge)??new Map;_c(d(K),$e,H()),_c($e,d(K),M())}te(K,d(Ge)??new Map)}),ve(()=>p(),()=>{te(O,!!p().fromHandle)}),ve(()=>(p(),q(E()),d(P)),()=>{var $e,Fe,Ie;te(L,(($e=p().fromHandle)==null?void 0:$e.nodeId)===Z&&((Fe=p().fromHandle)==null?void 0:Fe.type)===E()&&((Ie=p().fromHandle)==null?void 0:Ie.id)===d(P))}),ve(()=>(p(),q(E()),d(P)),()=>{var $e,Fe,Ie;te(V,(($e=p().toHandle)==null?void 0:$e.nodeId)===Z&&((Fe=p().toHandle)==null?void 0:Fe.type)===E()&&((Ie=p().toHandle)==null?void 0:Ie.id)===d(P))}),ve(()=>(l(),p(),q(E()),d(P)),()=>{var $e,Fe,Ie;te(A,l()===Dr.Strict?(($e=p().fromHandle)==null?void 0:$e.type)!==E():Z!==((Fe=p().fromHandle)==null?void 0:Fe.nodeId)||d(P)!==((Ie=p().fromHandle)==null?void 0:Ie.id))}),ve(()=>(d(V),p()),()=>{te(I,d(V)&&p().isValid)}),Pt(),qe();var rt=u2();let dt;var on=W(rt);Dt(on,t,"default",{}),Y(rt),De(($e,Fe)=>{be(rt,"data-handleid",d(P)),be(rt,"data-nodeid",Z),be(rt,"data-handlepos",$()),be(rt,"data-id",`${g()??""}-${Z??""}-${(R()||"")??""}-${E()??""}`),dt=Ot(rt,1,$e,null,dt,Fe),pt(rt,S())},[()=>wn((q(lt),q($()),q(j()),G(()=>lt(["svelte-flow__handle",`svelte-flow__handle-${$()}`,"nodrag","nopan",$(),j()])))),()=>({valid:d(I),connectingto:d(V),connectingfrom:d(L),source:!d(k),target:d(k),connectablestart:d(N),connectableend:d(N),connectable:d(N),connectionindicator:d(N)&&(!d(O)||d(A))})]),ut("mousedown",rt,gt),ut("touchstart",rt,gt),D(e,rt);var tt=ge({get id(){return R()},set id($e){R($e),y()},get type(){return E()},set type($e){E($e),y()},get position(){return $()},set position($e){$($e),y()},get style(){return S()},set style($e){S($e),y()},get isValidConnection(){return T()},set isValidConnection($e){T($e),y()},get onconnect(){return M()},set onconnect($e){M($e),y()},get ondisconnect(){return H()},set ondisconnect($e){H($e),y()},get isConnectable(){return z()},set isConnectable($e){z($e),y()},get class(){return j()},set class($e){j($e),y()}});return r(),tt}ce(lr,{id:{},type:{},position:{},style:{},isValidConnection:{},onconnect:{},ondisconnect:{},isConnectable:{},class:{}},["default"],[],!0);var c2=ie("<!> <!>",1);function ps(e,t){const n=ft(t,["children","$$slots","$$events","$$legacy","$$host"]);ft(n,["data","targetPosition","sourcePosition"]),fe(t,!1);let r=w(t,"data",28,()=>({label:"Node"})),o=w(t,"targetPosition",12,void 0),i=w(t,"sourcePosition",12,void 0);qe();var s=c2(),a=he(s);{let u=Me(()=>(q(o()),q(Se),G(()=>o()??Se.Top)));lr(a,{type:"target",get position(){return d(u)}})}var l=B(a),c=B(l);{let u=Me(()=>(q(i()),q(Se),G(()=>i()??Se.Bottom)));lr(c,{type:"source",get position(){return d(u)}})}return De(()=>vt(l,` ${q(r()),G(()=>{var u;return(u=r())==null?void 0:u.label})??""} `)),D(e,s),ge({get data(){return r()},set data(u){r(u),y()},get targetPosition(){return o()},set targetPosition(u){o(u),y()},get sourcePosition(){return i()},set sourcePosition(u){i(u),y()}})}ce(ps,{data:{},targetPosition:{},sourcePosition:{}},[],[],!0);var d2=ie(" <!>",1);function Qc(e,t){const n=ft(t,["children","$$slots","$$events","$$legacy","$$host"]);ft(n,["data","sourcePosition"]),fe(t,!1);let r=w(t,"data",28,()=>({label:"Node"})),o=w(t,"sourcePosition",12,void 0);qe(),Te();var i=d2(),s=he(i),a=B(s);{let l=Me(()=>(q(o()),q(Se),G(()=>o()??Se.Bottom)));lr(a,{type:"source",get position(){return d(l)}})}return De(()=>vt(s,`${q(r()),G(()=>{var l;return(l=r())==null?void 0:l.label})??""} `)),D(e,i),ge({get data(){return r()},set data(l){r(l),y()},get sourcePosition(){return o()},set sourcePosition(l){o(l),y()}})}ce(Qc,{data:{},sourcePosition:{}},[],[],!0);var f2=ie(" <!>",1);function ed(e,t){const n=ft(t,["children","$$slots","$$events","$$legacy","$$host"]);ft(n,["data","targetPosition"]),fe(t,!1);let r=w(t,"data",28,()=>({label:"Node"})),o=w(t,"targetPosition",12,void 0);qe(),Te();var i=f2(),s=he(i),a=B(s);{let l=Me(()=>(q(o()),q(Se),G(()=>o()??Se.Top)));lr(a,{type:"target",get position(){return d(l)}})}return De(()=>vt(s,`${q(r()),G(()=>{var l;return(l=r())==null?void 0:l.label})??""} `)),D(e,i),ge({get data(){return r()},set data(l){r(l),y()},get targetPosition(){return o()},set targetPosition(l){o(l),y()}})}ce(ed,{data:{},targetPosition:{}},[],[],!0);function td(e,t){const n=ft(t,["children","$$slots","$$events","$$legacy","$$host"]);ft(n,[])}ce(td,{},[],[],!0);function nd(e,t,n){if(!t)return;const r=n?t.querySelector(n):t;r&&r.appendChild(e)}function go(e,{target:t,domNode:n}){return nd(e,n,t),{async update({target:r,domNode:o}){nd(e,o,r)},destroy(){e.parentNode&&e.parentNode.removeChild(e)}}}var g2=ie("<div><!></div>");function rd(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(i,"$domNode",n),{domNode:i}=et();qe();var s=g2(),a=W(s);Dt(a,t,"default",{}),Y(s),Vt(s,(l,c)=>go==null?void 0:go(l,c),()=>({target:".svelte-flow__edgelabel-renderer",domNode:o()})),D(e,s),ge(),r()}ce(rd,{},["default"],[],!0);function od(){const{edgeLookup:e,selectionRect:t,selectionRectMode:n,multiselectionKeyPressed:r,addSelectedEdges:o,unselectNodesAndEdges:i,elementsSelectable:s}=et();return a=>{const l=J(e).get(a);if(!l){console.warn("012",io.error012(a));return}(l.selectable||J(s)&&typeof l.selectable>"u")&&(t.set(null),n.set(null),l.selected?l.selected&&J(r)&&i({nodes:[],edges:[l]}):o([a]))}}var h2=ie('<div class="svelte-flow__edge-label" role="button" tabindex="-1"><!></div>');function id(e,t){fe(t,!1);let n=w(t,"style",12,void 0),r=w(t,"x",12,void 0),o=w(t,"y",12,void 0);const i=od(),s=Cr("svelteflow__edge_id");return qe(),rd(e,{children:(a,l)=>{var c=h2();let u;var g=W(c);Dt(g,t,"default",{}),Y(c),De(f=>u=pt(c,"pointer-events: all;"+n(),u,f),[()=>({transform:`translate(-50%, -50%) translate(${r()??""}px,${o()??""}px)`})]),ut("keyup",c,()=>{}),ut("click",c,()=>{s&&i(s)}),D(a,c)},$$slots:{default:!0}}),ge({get style(){return n()},set style(a){n(a),y()},get x(){return r()},set x(a){r(a),y()},get y(){return o()},set y(a){o(a),y()}})}ce(id,{style:{},x:{},y:{}},["default"],[],!0);var v2=Ce('<path fill="none" class="svelte-flow__edge-interaction"></path>'),p2=Ce('<path fill="none"></path><!><!>',1);function oi(e,t){fe(t,!1);let n=w(t,"id",12,void 0),r=w(t,"path",12),o=w(t,"label",12,void 0),i=w(t,"labelX",12,void 0),s=w(t,"labelY",12,void 0),a=w(t,"labelStyle",12,void 0),l=w(t,"markerStart",12,void 0),c=w(t,"markerEnd",12,void 0),u=w(t,"style",12,void 0),g=w(t,"interactionWidth",12,20),f=w(t,"class",12,void 0),h=g()===void 0?20:g();qe();var v=p2(),b=he(v),C=B(b);{var x=m=>{var k=v2();be(k,"stroke-opacity",0),De(()=>{be(k,"d",r()),be(k,"stroke-width",h)}),D(m,k)};me(C,m=>{h&&m(x)})}var p=B(C);{var _=m=>{id(m,{get x(){return i()},get y(){return s()},get style(){return a()},children:(k,N)=>{Te();var P=Re();De(()=>vt(P,o())),D(k,P)},$$slots:{default:!0}})};me(p,m=>{o()&&m(_)})}return De(m=>{be(b,"id",n()),be(b,"d",r()),Ot(b,0,m),be(b,"marker-start",l()),be(b,"marker-end",c()),pt(b,u())},[()=>wn((q(lt),q(f()),G(()=>lt(["svelte-flow__edge-path",f()]))))]),D(e,v),ge({get id(){return n()},set id(m){n(m),y()},get path(){return r()},set path(m){r(m),y()},get label(){return o()},set label(m){o(m),y()},get labelX(){return i()},set labelX(m){i(m),y()},get labelY(){return s()},set labelY(m){s(m),y()},get labelStyle(){return a()},set labelStyle(m){a(m),y()},get markerStart(){return l()},set markerStart(m){l(m),y()},get markerEnd(){return c()},set markerEnd(m){c(m),y()},get style(){return u()},set style(m){u(m),y()},get interactionWidth(){return g()},set interactionWidth(m){g(m),y()},get class(){return f()},set class(m){f(m),y()}})}ce(oi,{id:{},path:{},label:{},labelX:{},labelY:{},labelStyle:{},markerStart:{},markerEnd:{},style:{},interactionWidth:{},class:{}},[],[],!0);function ms(e,t){const n=ft(t,["children","$$slots","$$events","$$legacy","$$host"]);ft(n,["label","labelStyle","style","markerStart","markerEnd","interactionWidth","sourceX","sourceY","sourcePosition","targetX","targetY","targetPosition"]),fe(t,!1);const r=ae(),o=ae(),i=ae();let s=w(t,"label",12,void 0),a=w(t,"labelStyle",12,void 0),l=w(t,"style",12,void 0),c=w(t,"markerStart",12,void 0),u=w(t,"markerEnd",12,void 0),g=w(t,"interactionWidth",12,void 0),f=w(t,"sourceX",12),h=w(t,"sourceY",12),v=w(t,"sourcePosition",12),b=w(t,"targetX",12),C=w(t,"targetY",12),x=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),q(f()),q(h()),q(b()),q(C()),q(v()),q(x())),()=>{(p=>{var _=er(p,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(Dc({sourceX:f(),sourceY:h(),targetX:b(),targetY:C(),sourcePosition:v(),targetPosition:x()}))}),Pt(),qe(),oi(e,{get path(){return d(r)},get labelX(){return d(o)},get labelY(){return d(i)},get label(){return s()},get labelStyle(){return a()},get markerStart(){return c()},get markerEnd(){return u()},get interactionWidth(){return g()},get style(){return l()}}),ge({get label(){return s()},set label(p){s(p),y()},get labelStyle(){return a()},set labelStyle(p){a(p),y()},get style(){return l()},set style(p){l(p),y()},get markerStart(){return c()},set markerStart(p){c(p),y()},get markerEnd(){return u()},set markerEnd(p){u(p),y()},get interactionWidth(){return g()},set interactionWidth(p){g(p),y()},get sourceX(){return f()},set sourceX(p){f(p),y()},get sourceY(){return h()},set sourceY(p){h(p),y()},get sourcePosition(){return v()},set sourcePosition(p){v(p),y()},get targetX(){return b()},set targetX(p){b(p),y()},get targetY(){return C()},set targetY(p){C(p),y()},get targetPosition(){return x()},set targetPosition(p){x(p),y()}})}ce(ms,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function sd(e,t){const n=ft(t,["children","$$slots","$$events","$$legacy","$$host"]);ft(n,["label","labelStyle","style","markerStart","markerEnd","interactionWidth","sourceX","sourceY","sourcePosition","targetX","targetY","targetPosition"]),fe(t,!1);const r=ae(),o=ae(),i=ae();let s=w(t,"label",12,void 0),a=w(t,"labelStyle",12,void 0),l=w(t,"style",12,void 0),c=w(t,"markerStart",12,void 0),u=w(t,"markerEnd",12,void 0),g=w(t,"interactionWidth",12,void 0),f=w(t,"sourceX",12),h=w(t,"sourceY",12),v=w(t,"sourcePosition",12),b=w(t,"targetX",12),C=w(t,"targetY",12),x=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),q(f()),q(h()),q(b()),q(C()),q(v()),q(x())),()=>{(p=>{var _=er(p,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(hs({sourceX:f(),sourceY:h(),targetX:b(),targetY:C(),sourcePosition:v(),targetPosition:x()}))}),Pt(),qe(),oi(e,{get path(){return d(r)},get labelX(){return d(o)},get labelY(){return d(i)},get label(){return s()},get labelStyle(){return a()},get markerStart(){return c()},get markerEnd(){return u()},get interactionWidth(){return g()},get style(){return l()}}),ge({get label(){return s()},set label(p){s(p),y()},get labelStyle(){return a()},set labelStyle(p){a(p),y()},get style(){return l()},set style(p){l(p),y()},get markerStart(){return c()},set markerStart(p){c(p),y()},get markerEnd(){return u()},set markerEnd(p){u(p),y()},get interactionWidth(){return g()},set interactionWidth(p){g(p),y()},get sourceX(){return f()},set sourceX(p){f(p),y()},get sourceY(){return h()},set sourceY(p){h(p),y()},get sourcePosition(){return v()},set sourcePosition(p){v(p),y()},get targetX(){return b()},set targetX(p){b(p),y()},get targetY(){return C()},set targetY(p){C(p),y()},get targetPosition(){return x()},set targetPosition(p){x(p),y()}})}ce(sd,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function ad(e,t){const n=ft(t,["children","$$slots","$$events","$$legacy","$$host"]);ft(n,["label","labelStyle","style","markerStart","markerEnd","interactionWidth","sourceX","sourceY","targetX","targetY"]),fe(t,!1);const r=ae(),o=ae(),i=ae();let s=w(t,"label",12,void 0),a=w(t,"labelStyle",12,void 0),l=w(t,"style",12,void 0),c=w(t,"markerStart",12,void 0),u=w(t,"markerEnd",12,void 0),g=w(t,"interactionWidth",12,void 0),f=w(t,"sourceX",12),h=w(t,"sourceY",12),v=w(t,"targetX",12),b=w(t,"targetY",12);return ve(()=>(d(r),d(o),d(i),q(f()),q(h()),q(v()),q(b())),()=>{(C=>{var x=er(C,3);te(r,x[0]),te(o,x[1]),te(i,x[2])})(Fa({sourceX:f(),sourceY:h(),targetX:v(),targetY:b()}))}),Pt(),qe(),oi(e,{get path(){return d(r)},get labelX(){return d(o)},get labelY(){return d(i)},get label(){return s()},get labelStyle(){return a()},get markerStart(){return c()},get markerEnd(){return u()},get interactionWidth(){return g()},get style(){return l()}}),ge({get label(){return s()},set label(C){s(C),y()},get labelStyle(){return a()},set labelStyle(C){a(C),y()},get style(){return l()},set style(C){l(C),y()},get markerStart(){return c()},set markerStart(C){c(C),y()},get markerEnd(){return u()},set markerEnd(C){u(C),y()},get interactionWidth(){return g()},set interactionWidth(C){g(C),y()},get sourceX(){return f()},set sourceX(C){f(C),y()},get sourceY(){return h()},set sourceY(C){h(C),y()},get targetX(){return v()},set targetX(C){v(C),y()},get targetY(){return b()},set targetY(C){b(C),y()}})}ce(ad,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},targetX:{},targetY:{}},[],[],!0);function ld(e,t){const n=ft(t,["children","$$slots","$$events","$$legacy","$$host"]);ft(n,["label","labelStyle","style","markerStart","markerEnd","interactionWidth","sourceX","sourceY","sourcePosition","targetX","targetY","targetPosition"]),fe(t,!1);const r=ae(),o=ae(),i=ae();let s=w(t,"label",12,void 0),a=w(t,"labelStyle",12,void 0),l=w(t,"style",12,void 0),c=w(t,"markerStart",12,void 0),u=w(t,"markerEnd",12,void 0),g=w(t,"interactionWidth",12,void 0),f=w(t,"sourceX",12),h=w(t,"sourceY",12),v=w(t,"sourcePosition",12),b=w(t,"targetX",12),C=w(t,"targetY",12),x=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),q(f()),q(h()),q(b()),q(C()),q(v()),q(x())),()=>{(p=>{var _=er(p,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(hs({sourceX:f(),sourceY:h(),targetX:b(),targetY:C(),sourcePosition:v(),targetPosition:x(),borderRadius:0}))}),Pt(),qe(),oi(e,{get path(){return d(r)},get labelX(){return d(o)},get labelY(){return d(i)},get label(){return s()},get labelStyle(){return a()},get markerStart(){return c()},get markerEnd(){return u()},get interactionWidth(){return g()},get style(){return l()}}),ge({get label(){return s()},set label(p){s(p),y()},get labelStyle(){return a()},set labelStyle(p){a(p),y()},get style(){return l()},set style(p){l(p),y()},get markerStart(){return c()},set markerStart(p){c(p),y()},get markerEnd(){return u()},set markerEnd(p){u(p),y()},get interactionWidth(){return g()},set interactionWidth(p){g(p),y()},get sourceX(){return f()},set sourceX(p){f(p),y()},get sourceY(){return h()},set sourceY(p){h(p),y()},get sourcePosition(){return v()},set sourcePosition(p){v(p),y()},get targetX(){return b()},set targetX(p){b(p),y()},get targetY(){return C()},set targetY(p){C(p),y()},get targetPosition(){return x()},set targetPosition(p){x(p),y()}})}ce(ld,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function m2(e,t){const n=e.set,r=t.set,o=J(e),i=J(t);let a=o.length===0&&i.length>0?i:o;e.set(a);const l=c=>{const u=n(c);return a=u,r(a),u};e.set=t.set=l,e.update=t.update=c=>l(c(a))}function y2(e,t){const n=e.set,r=t.set;let o=J(t);e.set(o);const i=s=>{n(s),r(s),o=s};e.set=t.set=i,e.update=t.update=s=>i(s(o))}const w2=(e,t,n)=>{if(!n)return;const r=J(e),o=t.set,i=n.set;let s=n?J(n):{x:0,y:0,zoom:1};t.set(s),t.set=a=>(o(a),i(a),s=a,a),n.set=a=>(r==null||r.syncViewport(a),o(a),i(a),s=a,a),t.update=a=>{t.set(a(s))},n.update=a=>{n.set(a(s))}},_2=(e,t,n,r=[0,0],o=is,i,s,a,l,c,u,g,f)=>{const{subscribe:h,set:v,update:b}=xe([]);let C=e,x={},p=!0;const _=P=>{const O=Rc(P,t,n,{elevateNodesOnSelect:p,nodeOrigin:r,nodeExtent:o,defaults:x,checkEquality:!1});return J(i)&&O&&J(l)&&(pp({nodes:t,width:J(c),height:J(u),panZoom:J(l),minZoom:J(g),maxZoom:J(f)},J(s)).then(V=>{var A;(A=J(a))==null||A.resolve(V),a.set(null)}),i.set(!1),s.set(void 0)),C=P,v(C),C},m=P=>_(P(C)),k=P=>{x=P},N=P=>{p=P.elevateNodesOnSelect??p};return _(C),{subscribe:h,set:_,update:m,setDefaultOptions:k,setOptions:N}},b2=(e,t,n,r)=>{const{subscribe:o,set:i,update:s}=xe([]);let a=e,l={};const c=f=>{const h=l?f.map(v=>({...l,...v})):f;Yc(t,n,h),a=h,i(a)},u=f=>c(f(a)),g=f=>{l=f};return c(a),{subscribe:o,set:c,update:u,setDefaultOptions:g}},ud={input:Qc,output:ed,default:ps,group:td},cd={straight:ad,smoothstep:sd,default:ms,step:ld},x2=({nodes:e=[],edges:t=[],width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s})=>{const a=new Map,l=new Map,c=new Map,u=new Map,g=i??[0,0],f=s??is;Rc(e,a,l,{nodeExtent:f,nodeOrigin:g,elevateNodesOnSelect:!1,checkEquality:!1}),Yc(c,u,t);let h={x:0,y:0,zoom:1};if(o&&n&&r){const N=ei(a,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))});h=qa(N,n,r,.5,2,.1)}const v=xe(!1),b=xe(void 0),C=xe(null),x=xe(null),p=xe(500),_=xe(500),m=xe(.5),k=xe(2);return{flowId:xe(null),nodes:_2(e,a,l,g,f,v,b,C,x,p,_,m,k),nodeLookup:fn(a),parentLookup:fn(l),edgeLookup:fn(u),visibleNodes:fn([]),edges:b2(t,c,u),visibleEdges:fn([]),connectionLookup:fn(c),width:p,height:_,minZoom:m,maxZoom:k,nodeOrigin:xe(g),nodeDragThreshold:xe(1),nodeExtent:xe(f),translateExtent:xe(is),autoPanOnNodeDrag:xe(!0),autoPanOnConnect:xe(!0),fitViewQueued:v,fitViewOptions:b,fitViewResolver:C,panZoom:x,snapGrid:xe(null),dragging:xe(!1),selectionRect:xe(null),selectionKeyPressed:xe(!1),multiselectionKeyPressed:xe(!1),deleteKeyPressed:xe(!1),panActivationKeyPressed:xe(!1),zoomActivationKeyPressed:xe(!1),selectionRectMode:xe(null),selectionMode:xe(ss.Partial),nodeTypes:xe(ud),edgeTypes:xe(cd),viewport:xe(h),connectionMode:xe(Dr.Strict),domNode:xe(null),connection:fn(La),connectionLineType:xe(so.Bezier),connectionRadius:xe(20),isValidConnection:xe(()=>!0),nodesDraggable:xe(!0),nodesConnectable:xe(!0),elementsSelectable:xe(!0),selectNodesOnDrag:xe(!0),markers:fn([]),defaultMarkerColor:xe("#b1b1b7"),lib:fn("svelte"),onlyRenderVisibleElements:xe(!1),onerror:xe(yp),ondelete:xe(void 0),onedgecreate:xe(void 0),onconnect:xe(void 0),onconnectstart:xe(void 0),onconnectend:xe(void 0),onbeforedelete:xe(void 0),nodesInitialized:xe(!1),edgesInitialized:xe(!1),viewportInitialized:xe(!1),initialized:fn(!1)}};function C2(e){const t=sr([e.edges,e.nodes,e.nodeLookup,e.onlyRenderVisibleElements,e.viewport,e.width,e.height],([n,,r,o,i,s,a])=>o&&s&&a?n.filter(c=>{const u=r.get(c.source),g=r.get(c.target);return u&&g&&Pp({sourceNode:u,targetNode:g,width:s,height:a,transform:[i.x,i.y,i.zoom]})}):n);return sr([t,e.nodes,e.nodeLookup,e.connectionMode,e.onerror],([n,,r,o,i])=>n.reduce((a,l)=>{const c=r.get(l.source),u=r.get(l.target);if(!c||!u)return a;const g=Op({id:l.id,sourceNode:c,targetNode:u,sourceHandle:l.sourceHandle||null,targetHandle:l.targetHandle||null,connectionMode:o,onError:i});return g&&a.push({...l,zIndex:Sp({selected:l.selected,zIndex:l.zIndex,sourceNode:c,targetNode:u,elevateOnSelect:!1}),...g}),a},[]))}function $2(e){return sr([e.nodeLookup,e.onlyRenderVisibleElements,e.width,e.height,e.viewport,e.nodes],([t,n,r,o,i])=>{const s=[i.x,i.y,i.zoom];return n?xc(t,{x:0,y:0,width:r,height:o},s,!0):Array.from(t.values())})}const ys=Symbol();function dd({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s}){const a=x2({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s});function l($){a.nodeTypes.set({...ud,...$})}function c($){a.edgeTypes.set({...cd,...$})}function u($){const S=J(a.edges);a.edges.set(Mp($,S))}const g=($,S=!1)=>{var M;const T=J(a.nodeLookup);for(const[H,z]of $){const j=(M=T.get(H))==null?void 0:M.internals.userNode;j&&(j.position=z.position,j.dragging=S)}a.nodes.update(H=>H)};function f($){var z,j,Z;const S=J(a.nodeLookup),T=J(a.parentLookup),{changes:M,updatedInternals:H}=Yp($,S,J(a.parentLookup),J(a.domNode),J(a.nodeOrigin));if(H){zp(S,T,{nodeOrigin:i,nodeExtent:s});for(const ee of M){const re=(z=S.get(ee.id))==null?void 0:z.internals.userNode;if(re)switch(ee.type){case"dimensions":{const Q={...re.measured,...ee.dimensions};ee.setAttributes&&(re.width=((j=ee.dimensions)==null?void 0:j.width)??re.width,re.height=((Z=ee.dimensions)==null?void 0:Z.height)??re.height),re.measured=Q;break}case"position":re.position=ee.position??re.position;break}}a.nodes.update(ee=>ee),J(a.nodesInitialized)||a.nodesInitialized.set(!0)}}function h($){const S=J(a.fitViewResolver)??xp();return a.fitViewQueued.set(!0),a.fitViewOptions.set($),a.fitViewResolver.set(S),a.nodes.set(J(a.nodes)),S.promise}function v($,S){const T=J(a.panZoom);return T?T.scaleBy($,S):Promise.resolve(!1)}function b($){return v(1.2,$)}function C($){return v(1/1.2,$)}function x($){const S=J(a.panZoom);S&&(S.setScaleExtent([$,J(a.maxZoom)]),a.minZoom.set($))}function p($){const S=J(a.panZoom);S&&(S.setScaleExtent([J(a.minZoom),$]),a.maxZoom.set($))}function _($){const S=J(a.panZoom);S&&(S.setTranslateExtent($),a.translateExtent.set($))}function m($){let S=!1;return $.forEach(T=>{T.selected&&(T.selected=!1,S=!0)}),S}function k($){var S;(S=J(a.panZoom))==null||S.setClickDistance($)}function N($){m(($==null?void 0:$.nodes)||J(a.nodes))&&a.nodes.set(J(a.nodes)),m(($==null?void 0:$.edges)||J(a.edges))&&a.edges.set(J(a.edges))}a.deleteKeyPressed.subscribe(async $=>{var S;if($){const T=J(a.nodes),M=J(a.edges),H=T.filter(ee=>ee.selected),z=M.filter(ee=>ee.selected),{nodes:j,edges:Z}=await Cc({nodesToRemove:H,edgesToRemove:z,nodes:T,edges:M,onBeforeDelete:J(a.onbeforedelete)});(j.length||Z.length)&&(a.nodes.update(ee=>ee.filter(re=>!j.some(Q=>Q.id===re.id))),a.edges.update(ee=>ee.filter(re=>!Z.some(Q=>Q.id===re.id))),(S=J(a.ondelete))==null||S({nodes:j,edges:Z}))}});function P($){const S=J(a.multiselectionKeyPressed);a.nodes.update(T=>T.map(M=>{const H=$.includes(M.id),z=S&&M.selected||H;return M.selected=z,M})),S||a.edges.update(T=>T.map(M=>(M.selected=!1,M)))}function O($){const S=J(a.multiselectionKeyPressed);a.edges.update(T=>T.map(M=>{const H=$.includes(M.id),z=S&&M.selected||H;return M.selected=z,M})),S||a.nodes.update(T=>T.map(M=>(M.selected=!1,M)))}function L($){var T;const S=(T=J(a.nodes))==null?void 0:T.find(M=>M.id===$);if(!S){console.warn("012",io.error012($));return}a.selectionRect.set(null),a.selectionRectMode.set(null),S.selected?S.selected&&J(a.multiselectionKeyPressed)&&N({nodes:[S],edges:[]}):P([$])}function V($){const S=J(a.viewport);return Fp({delta:$,panZoom:J(a.panZoom),transform:[S.x,S.y,S.zoom],translateExtent:J(a.translateExtent),width:J(a.width),height:J(a.height)})}const A=xe(La),I=$=>{A.set({...$})};function R(){A.set(La)}function E(){a.selectionRect.set(null),a.selectionRectMode.set(null),a.snapGrid.set(null),a.isValidConnection.set(()=>!0),N(),R()}return{...a,visibleEdges:C2(a),visibleNodes:$2(a),connection:sr([A,a.viewport],([$,S])=>$.inProgress?{...$,to:ni($.to,[S.x,S.y,S.zoom])}:{...$}),markers:sr([a.edges,a.defaultMarkerColor,a.flowId],([$,S,T])=>Ap($,{defaultColor:S,id:T})),initialized:(()=>{let $=!1;const S=J(a.nodes).length,T=J(a.edges).length;return sr([a.nodesInitialized,a.edgesInitialized,a.viewportInitialized],([M,H,z])=>$||(S===0?$=z:T===0?$=z&&M:$=z&&M&&H,$))})(),syncNodeStores:$=>m2(a.nodes,$),syncEdgeStores:$=>y2(a.edges,$),syncViewport:$=>w2(a.panZoom,a.viewport,$),setNodeTypes:l,setEdgeTypes:c,addEdge:u,updateNodePositions:g,updateNodeInternals:f,zoomIn:b,zoomOut:C,fitView:$=>h($),setMinZoom:x,setMaxZoom:p,setTranslateExtent:_,setPaneClickDistance:k,unselectNodesAndEdges:N,addSelectedNodes:P,addSelectedEdges:O,handleNodeSelection:L,panBy:V,updateConnection:I,cancelConnection:R,reset:E}}function et(){const e=Cr(ys);if(!e)throw new Error("In order to use useStore you need to wrap your component in a <SvelteFlowProvider />");return e.getStore()}function E2({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s}){const a=dd({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s});return Wr(ys,{getStore:()=>a}),a}function Ja(e,t){const{panZoom:n,minZoom:r,maxZoom:o,initialViewport:i,viewport:s,dragging:a,translateExtent:l,paneClickDistance:c}=t,u=l2({domNode:e,minZoom:r,maxZoom:o,translateExtent:l,viewport:i,paneClickDistance:c,onDraggingChange:a.set}),g=u.getViewport();return s.set(g),n.set(u),u.update(t),{update(f){u.update(f)}}}var k2=ie('<div class="svelte-flow__zoom svelte-4xkw84"><!></div>');const S2={hash:"svelte-4xkw84",code:".svelte-flow__zoom.svelte-4xkw84 {width:100%;height:100%;position:absolute;top:0;left:0;z-index:4;}"};function fd(e,t){fe(t,!1),at(e,S2);const[n,r]=ct(),o=()=>oe(M,"$panActivationKeyPressed",n),i=()=>oe(R,"$minZoom",n),s=()=>oe(E,"$maxZoom",n),a=()=>oe(H,"$zoomActivationKeyPressed",n),l=()=>oe(I,"$selectionRect",n),c=()=>oe(S,"$translateExtent",n),u=()=>oe(T,"$lib",n),g=ae(),f=ae(),h=ae();let v=w(t,"initialViewport",12,void 0),b=w(t,"onMoveStart",12,void 0),C=w(t,"onMove",12,void 0),x=w(t,"onMoveEnd",12,void 0),p=w(t,"panOnScrollMode",12),_=w(t,"preventScrolling",12),m=w(t,"zoomOnScroll",12),k=w(t,"zoomOnDoubleClick",12),N=w(t,"zoomOnPinch",12),P=w(t,"panOnDrag",12),O=w(t,"panOnScroll",12),L=w(t,"paneClickDistance",12);const{viewport:V,panZoom:A,selectionRect:I,minZoom:R,maxZoom:E,dragging:$,translateExtent:S,lib:T,panActivationKeyPressed:M,zoomActivationKeyPressed:H,viewportInitialized:z}=et(),j=Q=>V.set({x:Q[0],y:Q[1],zoom:Q[2]});dn(()=>{Li(z,!0)}),ve(()=>q(v()),()=>{te(g,v()||{x:0,y:0,zoom:1})}),ve(()=>(o(),q(P())),()=>{te(f,o()||P())}),ve(()=>(o(),q(O())),()=>{te(h,o()||O())}),Pt(),qe();var Z=k2(),ee=W(Z);Dt(ee,t,"default",{}),Y(Z),Vt(Z,(Q,de)=>Ja==null?void 0:Ja(Q,de),()=>({viewport:V,minZoom:i(),maxZoom:s(),initialViewport:d(g),dragging:$,panZoom:A,onPanZoomStart:b(),onPanZoom:C(),onPanZoomEnd:x(),zoomOnScroll:m(),zoomOnDoubleClick:k(),zoomOnPinch:N(),panOnScroll:d(h),panOnDrag:d(f),panOnScrollSpeed:.5,panOnScrollMode:p()||Zn.Free,zoomActivationKeyPressed:a(),preventScrolling:typeof _()=="boolean"?_():!0,noPanClassName:"nopan",noWheelClassName:"nowheel",userSelectionActive:!!l(),translateExtent:c(),lib:u(),paneClickDistance:L(),onTransformChange:j})),D(e,Z);var re=ge({get initialViewport(){return v()},set initialViewport(Q){v(Q),y()},get onMoveStart(){return b()},set onMoveStart(Q){b(Q),y()},get onMove(){return C()},set onMove(Q){C(Q),y()},get onMoveEnd(){return x()},set onMoveEnd(Q){x(Q),y()},get panOnScrollMode(){return p()},set panOnScrollMode(Q){p(Q),y()},get preventScrolling(){return _()},set preventScrolling(Q){_(Q),y()},get zoomOnScroll(){return m()},set zoomOnScroll(Q){m(Q),y()},get zoomOnDoubleClick(){return k()},set zoomOnDoubleClick(Q){k(Q),y()},get zoomOnPinch(){return N()},set zoomOnPinch(Q){N(Q),y()},get panOnDrag(){return P()},set panOnDrag(Q){P(Q),y()},get panOnScroll(){return O()},set panOnScroll(Q){O(Q),y()},get paneClickDistance(){return L()},set paneClickDistance(Q){L(Q),y()}});return r(),re}ce(fd,{initialViewport:{},onMoveStart:{},onMove:{},onMoveEnd:{},panOnScrollMode:{},preventScrolling:{},zoomOnScroll:{},zoomOnDoubleClick:{},zoomOnPinch:{},panOnDrag:{},panOnScroll:{},paneClickDistance:{}},["default"],[],!0);function gd(e,t){return n=>{n.target===t&&(e==null||e(n))}}function hd(e){return t=>{const n=e.includes(t.id);return t.selected!==n&&(t.selected=n),t}}var P2=ie("<div><!></div>");const N2={hash:"svelte-1esy7hx",code:".svelte-flow__pane.svelte-1esy7hx {position:absolute;top:0;left:0;width:100%;height:100%;}"};function vd(e,t){fe(t,!1),at(e,N2);const[n,r]=ct(),o=()=>oe($,"$panActivationKeyPressed",n),i=()=>oe(R,"$selectionKeyPressed",n),s=()=>oe(A,"$selectionRect",n),a=()=>oe(V,"$elementsSelectable",n),l=()=>oe(I,"$selectionRectMode",n),c=()=>oe(T,"$connection",n),u=()=>oe(P,"$edges",n),g=()=>oe(N,"$nodeLookup",n),f=()=>oe(O,"$viewport",n),h=()=>oe(E,"$selectionMode",n),v=()=>oe(L,"$dragging",n),b=ae(),C=ae(),x=ae();let p=w(t,"panOnDrag",12,void 0),_=w(t,"selectionOnDrag",12,void 0);const m=Di(),{nodes:k,nodeLookup:N,edges:P,viewport:O,dragging:L,elementsSelectable:V,selectionRect:A,selectionRectMode:I,selectionKeyPressed:R,selectionMode:E,panActivationKeyPressed:$,unselectNodesAndEdges:S,connection:T}=et();let M=ae(),H=null,z=[],j=!1;function Z(se){if(j||c().inProgress){j=!1;return}m("paneclick",{event:se}),S(),I.set(null)}function ee(se){var F,we;if(H=d(M).getBoundingClientRect(),!V||!d(C)||se.button!==0||se.target!==d(M)||!H)return;(we=(F=se.target)==null?void 0:F.setPointerCapture)==null||we.call(F,se.pointerId);const{x:U,y:ue}=jn(se,H);S(),A.set({width:0,height:0,startX:U,startY:ue,x:U,y:ue})}function re(se){if(!d(C)||!H||!s())return;j=!0;const U=jn(se,H),ue=s().startX??0,F=s().startY??0,we={...s(),x:U.x<ue?U.x:ue,y:U.y<F?U.y:F,width:Math.abs(U.x-ue),height:Math.abs(U.y-F)},Pe=z.map(ye=>ye.id),Oe=za(z,u()).map(ye=>ye.id);z=xc(g(),we,[f().x,f().y,f().zoom],h()===ss.Partial,!0);const Be=za(z,u()).map(ye=>ye.id),Le=z.map(ye=>ye.id);(Pe.length!==Le.length||Le.some(ye=>!Pe.includes(ye)))&&k.update(ye=>ye.map(hd(Le))),(Oe.length!==Be.length||Be.some(ye=>!Oe.includes(ye)))&&P.update(ye=>ye.map(hd(Be))),I.set("user"),A.set(we)}function Q(se){var U,ue;se.button===0&&((ue=(U=se.target)==null?void 0:U.releasePointerCapture)==null||ue.call(U,se.pointerId),!d(C)&&l()==="user"&&se.target===d(M)&&(Z==null||Z(se)),A.set(null),z.length>0&&Li(I,"nodes"),i()&&(j=!1))}const de=se=>{var U;if(Array.isArray(d(b))&&((U=d(b))!=null&&U.includes(2))){se.preventDefault();return}m("panecontextmenu",{event:se})};ve(()=>(o(),q(p())),()=>{te(b,o()||p())}),ve(()=>(i(),s(),q(_()),d(b)),()=>{te(C,i()||s()||_()&&d(b)!==!0)}),ve(()=>(a(),d(C),l()),()=>{te(x,a()&&(d(C)||l()==="user"))}),Pt(),qe();var ne=P2(),_e=Ee(()=>d(x)?void 0:gd(Z,d(M))),Ne=Ee(()=>gd(de,d(M)));let Ve;var le=W(ne);Dt(le,t,"default",{}),Y(ne),Vn(ne,se=>te(M,se),()=>d(M)),De(se=>Ve=Ot(ne,1,"svelte-flow__pane svelte-1esy7hx",null,Ve,se),[()=>({draggable:p()===!0||Array.isArray(p())&&p().includes(0),dragging:v(),selection:d(C)})]),ut("click",ne,function(...se){var U;(U=d(_e))==null||U.apply(this,se)}),ut("pointerdown",ne,function(...se){var U;(U=d(x)?ee:void 0)==null||U.apply(this,se)}),ut("pointermove",ne,function(...se){var U;(U=d(x)?re:void 0)==null||U.apply(this,se)}),ut("pointerup",ne,function(...se){var U;(U=d(x)?Q:void 0)==null||U.apply(this,se)}),ut("contextmenu",ne,function(...se){var U;(U=d(Ne))==null||U.apply(this,se)}),D(e,ne);var pe=ge({get panOnDrag(){return p()},set panOnDrag(se){p(se),y()},get selectionOnDrag(){return _()},set selectionOnDrag(se){_(se),y()}});return r(),pe}ce(vd,{panOnDrag:{},selectionOnDrag:{}},["default"],[],!0);var T2=ie('<div class="svelte-flow__viewport xyflow__viewport svelte-1floaup"><!></div>');const M2={hash:"svelte-1floaup",code:".svelte-flow__viewport.svelte-1floaup {width:100%;height:100%;position:absolute;top:0;left:0;}"};function pd(e,t){fe(t,!1),at(e,M2);const[n,r]=ct(),o=()=>oe(i,"$viewport",n),{viewport:i}=et();qe();var s=T2(),a=W(s);Dt(a,t,"default",{}),Y(s),De(()=>pt(s,`transform: translate(${o().x??""}px, ${o().y??""}px) scale(${o().zoom??""})`)),D(e,s),ge(),r()}ce(pd,{},["default"],[],!0);function ho(e,t){const{store:n,onDrag:r,onDragStart:o,onDragStop:i,onNodeMouseDown:s}=t,a=Zp({onDrag:r,onDragStart:o,onDragStop:i,onNodeMouseDown:s,getStoreItems:()=>{const c=J(n.snapGrid),u=J(n.viewport);return{nodes:J(n.nodes),nodeLookup:J(n.nodeLookup),edges:J(n.edges),nodeExtent:J(n.nodeExtent),snapGrid:c||[0,0],snapToGrid:!!c,nodeOrigin:J(n.nodeOrigin),multiSelectionActive:J(n.multiselectionKeyPressed),domNode:J(n.domNode),transform:[u.x,u.y,u.zoom],autoPanOnNodeDrag:J(n.autoPanOnNodeDrag),nodesDraggable:J(n.nodesDraggable),selectNodesOnDrag:J(n.selectNodesOnDrag),nodeDragThreshold:J(n.nodeDragThreshold),unselectNodesAndEdges:n.unselectNodesAndEdges,updateNodePositions:n.updateNodePositions,panBy:n.panBy}}});function l(c,u){if(u.disabled){a.destroy();return}a.update({domNode:c,noDragClassName:u.noDragClass,handleSelector:u.handleSelector,nodeId:u.nodeId,isSelectable:u.isSelectable,nodeClickDistance:u.nodeClickDistance})}return l(e,t),{update(c){l(e,c)},destroy(){a.destroy()}}}function H2({width:e,height:t,initialWidth:n,initialHeight:r,measuredWidth:o,measuredHeight:i}){if(o===void 0&&i===void 0){const s=e??n,a=t??r;return{width:s?`width:${s}px;`:"",height:a?`height:${a}px;`:""}}return{width:e?`width:${e}px;`:"",height:t?`height:${t}px;`:""}}var D2=ie("<div><!></div>");function md(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(ne,"$nodeTypes",n),i=()=>oe(pe,"$elementsSelectable",n),s=()=>oe(se,"$nodesDraggable",n),a=()=>oe(we,"$connectableStore",n),l=ae(void 0,!0),c=ae(void 0,!0),u=ae(void 0,!0),g=ae(void 0,!0);let f=w(t,"node",13),h=w(t,"id",13),v=w(t,"data",29,()=>({})),b=w(t,"selected",13,!1),C=w(t,"draggable",13,void 0),x=w(t,"selectable",13,void 0),p=w(t,"connectable",13,!0),_=w(t,"deletable",13,!0),m=w(t,"hidden",13,!1),k=w(t,"dragging",13,!1),N=w(t,"resizeObserver",13,null),P=w(t,"style",13,void 0),O=w(t,"type",13,"default"),L=w(t,"isParent",13,!1),V=w(t,"positionX",13),A=w(t,"positionY",13),I=w(t,"sourcePosition",13,void 0),R=w(t,"targetPosition",13,void 0),E=w(t,"zIndex",13),$=w(t,"measuredWidth",13,void 0),S=w(t,"measuredHeight",13,void 0),T=w(t,"initialWidth",13,void 0),M=w(t,"initialHeight",13,void 0),H=w(t,"width",13,void 0),z=w(t,"height",13,void 0),j=w(t,"dragHandle",13,void 0),Z=w(t,"initialized",13,!1),ee=w(t,"parentId",13,void 0),re=w(t,"nodeClickDistance",13,void 0),Q=w(t,"class",13,"");const de=et(),{nodeTypes:ne,nodeDragThreshold:_e,selectNodesOnDrag:Ne,handleNodeSelection:Ve,updateNodeInternals:le,elementsSelectable:pe,nodesDraggable:se}=de;let U=ae(void 0,!0),ue=ae(null,!0);const F=Di(),we=xe(p());let Pe=ae(void 0,!0),Oe=ae(void 0,!0),Be=ae(void 0,!0);Wr("svelteflow__node_id",h()),Wr("svelteflow__node_connectable",we),ua(()=>{var K;d(ue)&&((K=N())==null||K.unobserve(d(ue)))});function Le(K){x()&&(!J(Ne)||!C()||J(_e)>0)&&Ve(h()),F("nodeclick",{node:f().internals.userNode,event:K})}ve(()=>q(O()),()=>{te(l,O()||"default")}),ve(()=>(o(),d(l)),()=>{te(c,!!o()[d(l)])}),ve(()=>(o(),d(l),ps),()=>{te(u,o()[d(l)]||ps)}),ve(()=>(d(c),q(O())),()=>{d(c)||console.warn("003",io.error003(O()))}),ve(()=>(q(H()),q(z()),q(T()),q(M()),q($()),q(S())),()=>{te(g,H2({width:H(),height:z(),initialWidth:T(),initialHeight:M(),measuredWidth:$(),measuredHeight:S()}))}),ve(()=>q(p()),()=>{we.set(!!p())}),ve(()=>(d(Pe),d(l),d(Oe),q(I()),d(Be),q(R()),q(h()),d(U)),()=>{(d(Pe)&&d(l)!==d(Pe)||d(Oe)&&I()!==d(Oe)||d(Be)&&R()!==d(Be))&&requestAnimationFrame(()=>le(new Map([[h(),{id:h(),nodeElement:d(U),force:!0}]]))),te(Pe,d(l)),te(Oe,I()),te(Be,R())}),ve(()=>(q(N()),d(U),d(ue),q(Z())),()=>{N()&&(d(U)!==d(ue)||!Z())&&(d(ue)&&N().unobserve(d(ue)),d(U)&&N().observe(d(U)),te(ue,d(U)))}),Pt(),qe(!0);var ye=Ze(),Ae=he(ye);{var Ue=K=>{var Ge=D2();let rt,dt;var on=W(Ge);{let tt=Me(()=>b()??!1),$e=Me(()=>x()??i()??!0),Fe=Me(()=>_()??!0),Ie=Me(()=>C()??s()??!0);gu(on,()=>d(u),(Mt,Et)=>{Et(Mt,{get data(){return v()},get id(){return h()},get selected(){return d(tt)},get selectable(){return d($e)},get deletable(){return d(Fe)},get sourcePosition(){return I()},get targetPosition(){return R()},get zIndex(){return E()},get dragging(){return k()},get draggable(){return d(Ie)},get dragHandle(){return j()},get parentId(){return ee()},get type(){return d(l)},get isConnectable(){return a()},get positionAbsoluteX(){return V()},get positionAbsoluteY(){return A()},get width(){return H()},get height(){return z()}})})}Y(Ge),Vt(Ge,(tt,$e)=>ho==null?void 0:ho(tt,$e),()=>({nodeId:h(),isSelectable:x(),disabled:!1,handleSelector:j(),noDragClass:"nodrag",nodeClickDistance:re(),onNodeMouseDown:Ve,onDrag:(tt,$e,Fe,Ie)=>{F("nodedrag",{event:tt,targetNode:Fe,nodes:Ie})},onDragStart:(tt,$e,Fe,Ie)=>{F("nodedragstart",{event:tt,targetNode:Fe,nodes:Ie})},onDragStop:(tt,$e,Fe,Ie)=>{F("nodedragstop",{event:tt,targetNode:Fe,nodes:Ie})},store:de})),Vn(Ge,tt=>te(U,tt),()=>d(U)),Qt(()=>ut("click",Ge,Le)),Qt(()=>ut("mouseenter",Ge,tt=>F("nodemouseenter",{node:f(),event:tt}))),Qt(()=>ut("mouseleave",Ge,tt=>F("nodemouseleave",{node:f(),event:tt}))),Qt(()=>ut("mousemove",Ge,tt=>F("nodemousemove",{node:f(),event:tt}))),Qt(()=>ut("contextmenu",Ge,tt=>F("nodecontextmenu",{node:f(),event:tt}))),De((tt,$e,Fe)=>{be(Ge,"data-id",h()),rt=Ot(Ge,1,tt,null,rt,$e),dt=pt(Ge,`${P()??""??""};${d(g),G(()=>d(g).width)??""}${d(g),G(()=>d(g).height)??""}`,dt,Fe)},[()=>wn((q(lt),d(l),q(Q()),G(()=>lt(["svelte-flow__node",`svelte-flow__node-${d(l)}`,Q()])))),()=>({dragging:k(),selected:b(),draggable:C(),connectable:p(),selectable:x(),nopan:C(),parent:L()}),()=>({"z-index":E(),transform:`translate(${V()??""}px, ${A()??""}px)`,visibility:Z()?"visible":"hidden"})]),D(K,Ge)};me(Ae,K=>{m()||K(Ue)})}D(e,ye);var gt=ge({get node(){return f()},set node(K){f(K),y()},get id(){return h()},set id(K){h(K),y()},get data(){return v()},set data(K){v(K),y()},get selected(){return b()},set selected(K){b(K),y()},get draggable(){return C()},set draggable(K){C(K),y()},get selectable(){return x()},set selectable(K){x(K),y()},get connectable(){return p()},set connectable(K){p(K),y()},get deletable(){return _()},set deletable(K){_(K),y()},get hidden(){return m()},set hidden(K){m(K),y()},get dragging(){return k()},set dragging(K){k(K),y()},get resizeObserver(){return N()},set resizeObserver(K){N(K),y()},get style(){return P()},set style(K){P(K),y()},get type(){return O()},set type(K){O(K),y()},get isParent(){return L()},set isParent(K){L(K),y()},get positionX(){return V()},set positionX(K){V(K),y()},get positionY(){return A()},set positionY(K){A(K),y()},get sourcePosition(){return I()},set sourcePosition(K){I(K),y()},get targetPosition(){return R()},set targetPosition(K){R(K),y()},get zIndex(){return E()},set zIndex(K){E(K),y()},get measuredWidth(){return $()},set measuredWidth(K){$(K),y()},get measuredHeight(){return S()},set measuredHeight(K){S(K),y()},get initialWidth(){return T()},set initialWidth(K){T(K),y()},get initialHeight(){return M()},set initialHeight(K){M(K),y()},get width(){return H()},set width(K){H(K),y()},get height(){return z()},set height(K){z(K),y()},get dragHandle(){return j()},set dragHandle(K){j(K),y()},get initialized(){return Z()},set initialized(K){Z(K),y()},get parentId(){return ee()},set parentId(K){ee(K),y()},get nodeClickDistance(){return re()},set nodeClickDistance(K){re(K),y()},get class(){return Q()},set class(K){Q(K),y()}});return r(),gt}ce(md,{node:{},id:{},data:{},selected:{},draggable:{},selectable:{},connectable:{},deletable:{},hidden:{},dragging:{},resizeObserver:{},style:{},type:{},isParent:{},positionX:{},positionY:{},sourcePosition:{},targetPosition:{},zIndex:{},measuredWidth:{},measuredHeight:{},initialWidth:{},initialHeight:{},width:{},height:{},dragHandle:{},initialized:{},parentId:{},nodeClickDistance:{},class:{}},[],[],!0);var V2=ie('<div class="svelte-flow__nodes svelte-tf4uy4"></div>');const O2={hash:"svelte-tf4uy4",code:".svelte-flow__nodes.svelte-tf4uy4 {width:100%;height:100%;position:absolute;left:0;top:0;}"};function yd(e,t){fe(t,!1),at(e,O2);const[n,r]=ct(),o=()=>oe(u,"$visibleNodes",n),i=()=>oe(g,"$nodesDraggable",n),s=()=>oe(h,"$elementsSelectable",n),a=()=>oe(f,"$nodesConnectable",n),l=()=>oe(b,"$parentLookup",n);let c=w(t,"nodeClickDistance",12,0);const{visibleNodes:u,nodesDraggable:g,nodesConnectable:f,elementsSelectable:h,updateNodeInternals:v,parentLookup:b}=et(),C=typeof ResizeObserver>"u"?null:new ResizeObserver(_=>{const m=new Map;_.forEach(k=>{const N=k.target.getAttribute("data-id");m.set(N,{id:N,nodeElement:k.target,force:!0})}),v(m)});ua(()=>{C==null||C.disconnect()}),qe();var x=V2();Yt(x,5,o,_=>_.id,(_,m)=>{{let k=Me(()=>(d(m),G(()=>!!d(m).selected))),N=Me(()=>(d(m),G(()=>!!d(m).hidden))),P=Me(()=>(d(m),i(),G(()=>!!(d(m).draggable||i()&&typeof d(m).draggable>"u")))),O=Me(()=>(d(m),s(),G(()=>!!(d(m).selectable||s()&&typeof d(m).selectable>"u")))),L=Me(()=>(d(m),a(),G(()=>!!(d(m).connectable||a()&&typeof d(m).connectable>"u")))),V=Me(()=>(d(m),G(()=>d(m).deletable??!0))),A=Me(()=>(l(),d(m),G(()=>l().has(d(m).id)))),I=Me(()=>(d(m),G(()=>d(m).type??"default"))),R=Me(()=>(d(m),G(()=>d(m).internals.z??0))),E=Me(()=>(q(fs),d(m),G(()=>fs(d(m)))));md(_,{get node(){return d(m)},get id(){return d(m),G(()=>d(m).id)},get data(){return d(m),G(()=>d(m).data)},get selected(){return d(k)},get hidden(){return d(N)},get draggable(){return d(P)},get selectable(){return d(O)},get connectable(){return d(L)},get deletable(){return d(V)},get positionX(){return d(m),G(()=>d(m).internals.positionAbsolute.x)},get positionY(){return d(m),G(()=>d(m).internals.positionAbsolute.y)},get isParent(){return d(A)},get style(){return d(m),G(()=>d(m).style)},get class(){return d(m),G(()=>d(m).class)},get type(){return d(I)},get sourcePosition(){return d(m),G(()=>d(m).sourcePosition)},get targetPosition(){return d(m),G(()=>d(m).targetPosition)},get dragging(){return d(m),G(()=>d(m).dragging)},get zIndex(){return d(R)},get dragHandle(){return d(m),G(()=>d(m).dragHandle)},get initialized(){return d(E)},get width(){return d(m),G(()=>d(m).width)},get height(){return d(m),G(()=>d(m).height)},get initialWidth(){return d(m),G(()=>d(m).initialWidth)},get initialHeight(){return d(m),G(()=>d(m).initialHeight)},get measuredWidth(){return d(m),G(()=>d(m).measured.width)},get measuredHeight(){return d(m),G(()=>d(m).measured.height)},get parentId(){return d(m),G(()=>d(m).parentId)},get resizeObserver(){return C},get nodeClickDistance(){return c()},$$events:{nodeclick($){je.call(this,t,$)},nodemouseenter($){je.call(this,t,$)},nodemousemove($){je.call(this,t,$)},nodemouseleave($){je.call(this,t,$)},nodedrag($){je.call(this,t,$)},nodedragstart($){je.call(this,t,$)},nodedragstop($){je.call(this,t,$)},nodecontextmenu($){je.call(this,t,$)}}})}}),Y(x),D(e,x);var p=ge({get nodeClickDistance(){return c()},set nodeClickDistance(_){c(_),y()}});return r(),p}ce(yd,{nodeClickDistance:{}},[],[],!0);var A2=Ce('<svg><g role="img"><!></g></svg>');function wd(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(Q,"$edgeTypes",n),i=()=>oe(de,"$flowId",n),s=()=>oe(ne,"$elementsSelectable",n),a=()=>oe(re,"$edgeLookup",n),l=ae(void 0,!0),c=ae(void 0,!0),u=ae(void 0,!0),g=ae(void 0,!0),f=ae(void 0,!0);let h=w(t,"id",13),v=w(t,"type",13,"default"),b=w(t,"source",13,""),C=w(t,"target",13,""),x=w(t,"data",29,()=>({})),p=w(t,"style",13,void 0),_=w(t,"zIndex",13,void 0),m=w(t,"animated",13,!1),k=w(t,"selected",13,!1),N=w(t,"selectable",13,void 0),P=w(t,"deletable",13,void 0),O=w(t,"hidden",13,!1),L=w(t,"label",13,void 0),V=w(t,"labelStyle",13,void 0),A=w(t,"markerStart",13,void 0),I=w(t,"markerEnd",13,void 0),R=w(t,"sourceHandle",13,void 0),E=w(t,"targetHandle",13,void 0),$=w(t,"sourceX",13),S=w(t,"sourceY",13),T=w(t,"targetX",13),M=w(t,"targetY",13),H=w(t,"sourcePosition",13),z=w(t,"targetPosition",13),j=w(t,"ariaLabel",13,void 0),Z=w(t,"interactionWidth",13,void 0),ee=w(t,"class",13,"");Wr("svelteflow__edge_id",h());const{edgeLookup:re,edgeTypes:Q,flowId:de,elementsSelectable:ne}=et(),_e=Di(),Ne=od();function Ve(F){const we=a().get(h());we&&(Ne(h()),_e("edgeclick",{event:F,edge:we}))}function le(F,we){const Pe=a().get(h());Pe&&_e(we,{event:F,edge:Pe})}ve(()=>q(v()),()=>{te(l,v()||"default")}),ve(()=>(o(),d(l),ms),()=>{te(c,o()[d(l)]||ms)}),ve(()=>(q(A()),i()),()=>{te(u,A()?`url('#${Wa(A(),i())}')`:void 0)}),ve(()=>(q(I()),i()),()=>{te(g,I()?`url('#${Wa(I(),i())}')`:void 0)}),ve(()=>(q(N()),s()),()=>{te(f,N()??s())}),Pt(),qe(!0);var pe=Ze(),se=he(pe);{var U=F=>{var we=A2();let Pe;var Oe=W(we);let Be;var Le=W(Oe);{let ye=Me(()=>P()??!0);gu(Le,()=>d(c),(Ae,Ue)=>{Ue(Ae,{get id(){return h()},get source(){return b()},get target(){return C()},get sourceX(){return $()},get sourceY(){return S()},get targetX(){return T()},get targetY(){return M()},get sourcePosition(){return H()},get targetPosition(){return z()},get animated(){return m()},get selected(){return k()},get label(){return L()},get labelStyle(){return V()},get data(){return x()},get style(){return p()},get interactionWidth(){return Z()},get selectable(){return d(f)},get deletable(){return d(ye)},get type(){return d(l)},get sourceHandleId(){return R()},get targetHandleId(){return E()},get markerStart(){return d(u)},get markerEnd(){return d(g)}})})}Y(Oe),Y(we),De((ye,Ae,Ue)=>{Pe=pt(we,"",Pe,ye),Be=Ot(Oe,0,Ae,null,Be,Ue),be(Oe,"data-id",h()),be(Oe,"aria-label",j()===null?void 0:j()?j():`Edge from ${b()} to ${C()}`)},[()=>({"z-index":_()}),()=>wn((q(lt),q(ee()),G(()=>lt(["svelte-flow__edge",ee()])))),()=>({animated:m(),selected:k(),selectable:d(f)})]),ut("click",Oe,Ve),ut("contextmenu",Oe,ye=>{le(ye,"edgecontextmenu")}),ut("mouseenter",Oe,ye=>{le(ye,"edgemouseenter")}),ut("mouseleave",Oe,ye=>{le(ye,"edgemouseleave")}),D(F,we)};me(se,F=>{O()||F(U)})}D(e,pe);var ue=ge({get id(){return h()},set id(F){h(F),y()},get type(){return v()},set type(F){v(F),y()},get source(){return b()},set source(F){b(F),y()},get target(){return C()},set target(F){C(F),y()},get data(){return x()},set data(F){x(F),y()},get style(){return p()},set style(F){p(F),y()},get zIndex(){return _()},set zIndex(F){_(F),y()},get animated(){return m()},set animated(F){m(F),y()},get selected(){return k()},set selected(F){k(F),y()},get selectable(){return N()},set selectable(F){N(F),y()},get deletable(){return P()},set deletable(F){P(F),y()},get hidden(){return O()},set hidden(F){O(F),y()},get label(){return L()},set label(F){L(F),y()},get labelStyle(){return V()},set labelStyle(F){V(F),y()},get markerStart(){return A()},set markerStart(F){A(F),y()},get markerEnd(){return I()},set markerEnd(F){I(F),y()},get sourceHandle(){return R()},set sourceHandle(F){R(F),y()},get targetHandle(){return E()},set targetHandle(F){E(F),y()},get sourceX(){return $()},set sourceX(F){$(F),y()},get sourceY(){return S()},set sourceY(F){S(F),y()},get targetX(){return T()},set targetX(F){T(F),y()},get targetY(){return M()},set targetY(F){M(F),y()},get sourcePosition(){return H()},set sourcePosition(F){H(F),y()},get targetPosition(){return z()},set targetPosition(F){z(F),y()},get ariaLabel(){return j()},set ariaLabel(F){j(F),y()},get interactionWidth(){return Z()},set interactionWidth(F){Z(F),y()},get class(){return ee()},set class(F){ee(F),y()}});return r(),ue}ce(wd,{id:{},type:{},source:{},target:{},data:{},style:{},zIndex:{},animated:{},selected:{},selectable:{},deletable:{},hidden:{},label:{},labelStyle:{},markerStart:{},markerEnd:{},sourceHandle:{},targetHandle:{},sourceX:{},sourceY:{},targetX:{},targetY:{},sourcePosition:{},targetPosition:{},ariaLabel:{},interactionWidth:{},class:{}},[],[],!0);function _d(e,t){fe(t,!1);let n=w(t,"onMount",12,void 0),r=w(t,"onDestroy",12,void 0);return dn(()=>{var o;return(o=n())==null||o(),r()}),qe(),ge({get onMount(){return n()},set onMount(o){n(o),y()},get onDestroy(){return r()},set onDestroy(o){r(o),y()}})}ce(_d,{onMount:{},onDestroy:{}},[],[],!0);var L2=Ce("<defs></defs>");function bd(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(i,"$markers",n),{markers:i}=et();qe();var s=L2();Yt(s,5,o,a=>a.id,(a,l)=>{xd(a,ht(()=>d(l)))}),Y(s),D(e,s),ge(),r()}ce(bd,{},[],[],!0);var I2=Ce('<polyline stroke-linecap="round" stroke-linejoin="round" fill="none" points="-5,-4 0,0 -5,4"></polyline>'),z2=Ce('<polyline stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>'),R2=Ce('<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>');function xd(e,t){fe(t,!1);let n=w(t,"id",12),r=w(t,"type",12),o=w(t,"width",12,12.5),i=w(t,"height",12,12.5),s=w(t,"markerUnits",12,"strokeWidth"),a=w(t,"orient",12,"auto-start-reverse"),l=w(t,"color",12,void 0),c=w(t,"strokeWidth",12,void 0);qe();var u=R2(),g=W(u);{var f=v=>{var b=I2();De(()=>{be(b,"stroke",l()),be(b,"stroke-width",c())}),D(v,b)},h=v=>{var b=Ze(),C=he(b);{var x=p=>{var _=z2();De(()=>{be(_,"stroke",l()),be(_,"stroke-width",c()),be(_,"fill",l())}),D(p,_)};me(C,p=>{q(r()),q(Vr),G(()=>r()===Vr.ArrowClosed)&&p(x)},!0)}D(v,b)};me(g,v=>{q(r()),q(Vr),G(()=>r()===Vr.Arrow)?v(f):v(h,!1)})}return Y(u),De(()=>{be(u,"id",n()),be(u,"markerWidth",`${o()}`),be(u,"markerHeight",`${i()}`),be(u,"markerUnits",s()),be(u,"orient",a())}),D(e,u),ge({get id(){return n()},set id(v){n(v),y()},get type(){return r()},set type(v){r(v),y()},get width(){return o()},set width(v){o(v),y()},get height(){return i()},set height(v){i(v),y()},get markerUnits(){return s()},set markerUnits(v){s(v),y()},get orient(){return a()},set orient(v){a(v),y()},get color(){return l()},set color(v){l(v),y()},get strokeWidth(){return c()},set strokeWidth(v){c(v),y()}})}ce(xd,{id:{},type:{},width:{},height:{},markerUnits:{},orient:{},color:{},strokeWidth:{}},[],[],!0);var B2=ie('<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!> <!></div>');function Cd(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(a,"$visibleEdges",n),i=()=>oe(u,"$elementsSelectable",n);let s=w(t,"defaultEdgeOptions",12);const{visibleEdges:a,edgesInitialized:l,edges:{setDefaultOptions:c},elementsSelectable:u}=et();dn(()=>{s()&&c(s())}),qe();var g=B2(),f=W(g),h=W(f);bd(h,{}),Y(f);var v=B(f,2);Yt(v,1,o,p=>p.id,(p,_)=>{{let m=Me(()=>(d(_),i(),G(()=>d(_).selectable??i()))),k=Me(()=>(d(_),G(()=>d(_).type||"default")));wd(p,{get id(){return d(_),G(()=>d(_).id)},get source(){return d(_),G(()=>d(_).source)},get target(){return d(_),G(()=>d(_).target)},get data(){return d(_),G(()=>d(_).data)},get style(){return d(_),G(()=>d(_).style)},get animated(){return d(_),G(()=>d(_).animated)},get selected(){return d(_),G(()=>d(_).selected)},get selectable(){return d(m)},get deletable(){return d(_),G(()=>d(_).deletable)},get hidden(){return d(_),G(()=>d(_).hidden)},get label(){return d(_),G(()=>d(_).label)},get labelStyle(){return d(_),G(()=>d(_).labelStyle)},get markerStart(){return d(_),G(()=>d(_).markerStart)},get markerEnd(){return d(_),G(()=>d(_).markerEnd)},get sourceHandle(){return d(_),G(()=>d(_).sourceHandle)},get targetHandle(){return d(_),G(()=>d(_).targetHandle)},get sourceX(){return d(_),G(()=>d(_).sourceX)},get sourceY(){return d(_),G(()=>d(_).sourceY)},get targetX(){return d(_),G(()=>d(_).targetX)},get targetY(){return d(_),G(()=>d(_).targetY)},get sourcePosition(){return d(_),G(()=>d(_).sourcePosition)},get targetPosition(){return d(_),G(()=>d(_).targetPosition)},get ariaLabel(){return d(_),G(()=>d(_).ariaLabel)},get interactionWidth(){return d(_),G(()=>d(_).interactionWidth)},get class(){return d(_),G(()=>d(_).class)},get type(){return d(k)},get zIndex(){return d(_),G(()=>d(_).zIndex)},$$events:{edgeclick(N){je.call(this,t,N)},edgecontextmenu(N){je.call(this,t,N)},edgemouseenter(N){je.call(this,t,N)},edgemouseleave(N){je.call(this,t,N)}}})}});var b=B(v,2);{var C=p=>{_d(p,{onMount:()=>{Li(l,!0)},onDestroy:()=>{Li(l,!1)}})};me(b,p=>{o(),G(()=>o().length>0)&&p(C)})}Y(g),D(e,g);var x=ge({get defaultEdgeOptions(){return s()},set defaultEdgeOptions(p){s(p),y()}});return r(),x}ce(Cd,{defaultEdgeOptions:{}},[],[],!0);var q2=ie('<div class="svelte-flow__selection svelte-1iugwpu"></div>');const Y2={hash:"svelte-1iugwpu",code:".svelte-flow__selection.svelte-1iugwpu {position:absolute;top:0;left:0;}"};function Qa(e,t){fe(t,!1),at(e,Y2);let n=w(t,"x",12,0),r=w(t,"y",12,0),o=w(t,"width",12,0),i=w(t,"height",12,0),s=w(t,"isVisible",12,!0);var a=Ze(),l=he(a);{var c=u=>{var g=q2();let f;De(h=>f=pt(g,"",f,h),[()=>({width:typeof o()=="string"?o():`${o()}px`,height:typeof i()=="string"?i():`${i()}px`,transform:`translate(${n()}px, ${r()}px)`})]),D(u,g)};me(l,u=>{s()&&u(c)})}return D(e,a),ge({get x(){return n()},set x(u){n(u),y()},get y(){return r()},set y(u){r(u),y()},get width(){return o()},set width(u){o(u),y()},get height(){return i()},set height(u){i(u),y()},get isVisible(){return s()},set isVisible(u){s(u),y()}})}ce(Qa,{x:{},y:{},width:{},height:{},isVisible:{}},[],[],!0);function $d(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(s,"$selectionRect",n),i=()=>oe(a,"$selectionRectMode",n),{selectionRect:s,selectionRectMode:a}=et();qe();{let l=Me(()=>!!(o()&&i()==="user")),c=Me(()=>{var h;return(h=o())==null?void 0:h.width}),u=Me(()=>{var h;return(h=o())==null?void 0:h.height}),g=Me(()=>{var h;return(h=o())==null?void 0:h.x}),f=Me(()=>{var h;return(h=o())==null?void 0:h.y});Qa(e,{get isVisible(){return d(l)},get width(){return d(c)},get height(){return d(u)},get x(){return d(g)},get y(){return d(f)}})}ge(),r()}ce($d,{},[],[],!0);var F2=ie('<div class="selection-wrapper nopan svelte-5pxri" role="button" tabindex="-1"><!></div>');const W2={hash:"svelte-5pxri",code:".selection-wrapper.svelte-5pxri {position:absolute;top:0;left:0;z-index:7;pointer-events:all;}"};function Ed(e,t){fe(t,!1),at(e,W2);const[n,r]=ct(),o=()=>oe(l,"$selectionRectMode",n),i=()=>oe(u,"$nodeLookup",n),s=()=>oe(c,"$nodes",n),a=et(),{selectionRectMode:l,nodes:c,nodeLookup:u}=a,g=Di();let f=ae(null);function h(p){const _=s().filter(m=>m.selected);g("selectioncontextmenu",{nodes:_,event:p})}function v(p){const _=s().filter(m=>m.selected);g("selectionclick",{nodes:_,event:p})}ve(()=>(o(),i(),s()),()=>{o()==="nodes"&&(te(f,ei(i(),{filter:p=>!!p.selected})),s())}),Pt(),qe();var b=Ze(),C=he(b);{var x=p=>{var _=F2(),m=W(_);Qa(m,{width:"100%",height:"100%",x:0,y:0}),Y(_),Vt(_,(k,N)=>ho==null?void 0:ho(k,N),()=>({disabled:!1,store:a,onDrag:(k,N,P,O)=>{g("nodedrag",{event:k,targetNode:null,nodes:O})},onDragStart:(k,N,P,O)=>{g("nodedragstart",{event:k,targetNode:null,nodes:O})},onDragStop:(k,N,P,O)=>{g("nodedragstop",{event:k,targetNode:null,nodes:O})}})),Qt(()=>ut("contextmenu",_,h)),Qt(()=>ut("click",_,v)),Qt(()=>ut("keyup",_,()=>{})),De(()=>pt(_,`width: ${d(f),G(()=>d(f).width)??""}px; height: ${d(f),G(()=>d(f).height)??""}px; transform: translate(${d(f),G(()=>d(f).x)??""}px, ${d(f),G(()=>d(f).y)??""}px)`)),D(p,_)};me(C,p=>{o(),d(f),q(Ln),G(()=>o()==="nodes"&&d(f)&&Ln(d(f).x)&&Ln(d(f).y))&&p(x)})}D(e,b),ge(),r()}ce(Ed,{},[],[],!0);function ot(e,t){let{enabled:n=!0,trigger:r,type:o="keydown"}=t;function i(s){const a=Array.isArray(r)?r:[r],l={alt:s.altKey,ctrl:s.ctrlKey,shift:s.shiftKey,meta:s.metaKey};for(const c of a){const u={modifier:[],preventDefault:!1,enabled:!0,...c},{modifier:g,key:f,callback:h,preventDefault:v,enabled:b}=u;if(b){if(g.length&&!(Array.isArray(g)?g:[g]).map(p=>typeof p=="string"?[p]:p).some(p=>p.every(_=>l[_])))continue;if(s.key===f){v&&s.preventDefault();const C={node:e,trigger:u,originalEvent:s};e.dispatchEvent(new CustomEvent("shortcut",{detail:C})),h==null||h(C)}}}}return n&&e.addEventListener(o,i),{update:s=>{const{enabled:a=!0,type:l="keydown"}=s;n&&(!a||o!==l)?e.removeEventListener(o,i):!n&&a&&e.addEventListener(l,i),n=a,o=l,r=s.trigger},destroy:()=>{e.removeEventListener(o,i)}}}function kd(e,t){fe(t,!1);let n=w(t,"selectionKey",12,"Shift"),r=w(t,"multiSelectionKey",28,()=>ds()?"Meta":"Control"),o=w(t,"deleteKey",12,"Backspace"),i=w(t,"panActivationKey",12," "),s=w(t,"zoomActivationKey",28,()=>ds()?"Meta":"Control");const{selectionKeyPressed:a,multiselectionKeyPressed:l,deleteKeyPressed:c,panActivationKeyPressed:u,zoomActivationKeyPressed:g,selectionRect:f}=et();function h(p){return p!==null&&typeof p=="object"}function v(p){return h(p)?p.modifier||[]:[]}function b(p){return p==null?"":h(p)?p.key:p}function C(p,_){return(Array.isArray(p)?p:[p]).map(k=>{const N=b(k);return{key:N,modifier:v(k),enabled:N!==null,callback:_}})}function x(){f.set(null),a.set(!1),l.set(!1),c.set(!1),u.set(!1),g.set(!1)}return qe(),ut("blur",Xt,x),ut("contextmenu",Xt,x),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:C(n(),()=>a.set(!0)),type:"keydown"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:C(n(),()=>a.set(!1)),type:"keyup"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:C(r(),()=>l.set(!0)),type:"keydown"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:C(r(),()=>l.set(!1)),type:"keyup"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:C(o(),p=>{!(p.originalEvent.ctrlKey||p.originalEvent.metaKey||p.originalEvent.shiftKey)&&!Ep(p.originalEvent)&&c.set(!0)}),type:"keydown"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:C(o(),()=>c.set(!1)),type:"keyup"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:C(i(),()=>u.set(!0)),type:"keydown"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:C(i(),()=>u.set(!1)),type:"keyup"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:C(s(),()=>g.set(!0)),type:"keydown"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:C(s(),()=>g.set(!1)),type:"keyup"})),ge({get selectionKey(){return n()},set selectionKey(p){n(p),y()},get multiSelectionKey(){return r()},set multiSelectionKey(p){r(p),y()},get deleteKey(){return o()},set deleteKey(p){o(p),y()},get panActivationKey(){return i()},set panActivationKey(p){i(p),y()},get zoomActivationKey(){return s()},set zoomActivationKey(p){s(p),y()}})}ce(kd,{selectionKey:{},multiSelectionKey:{},deleteKey:{},panActivationKey:{},zoomActivationKey:{}},[],[],!0);var X2=Ce('<path fill="none" class="svelte-flow__connection-path"></path>'),Z2=Ce('<svg class="svelte-flow__connectionline"><g><!><!></g></svg>');function Sd(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(h,"$connection",n),i=()=>oe(v,"$connectionLineType",n),s=()=>oe(g,"$width",n),a=()=>oe(f,"$height",n);let l=w(t,"containerStyle",12,""),c=w(t,"style",12,""),u=w(t,"isCustomComponent",12,!1);const{width:g,height:f,connection:h,connectionLineType:v}=et();let b=ae(null);ve(()=>(o(),q(u()),i(),d(b),Fa),()=>{if(o().inProgress&&!u()){const{from:m,to:k,fromPosition:N,toPosition:P}=o(),O={sourceX:m.x,sourceY:m.y,sourcePosition:N,targetX:k.x,targetY:k.y,targetPosition:P};switch(i()){case so.Bezier:(L=>{var V=er(L,1);te(b,V[0])})(Dc(O));break;case so.Step:(L=>{var V=er(L,1);te(b,V[0])})(hs({...O,borderRadius:0}));break;case so.SmoothStep:(L=>{var V=er(L,1);te(b,V[0])})(hs(O));break;default:(L=>{var V=er(L,1);te(b,V[0])})(Fa(O))}}}),Pt(),qe();var C=Ze(),x=he(C);{var p=m=>{var k=Z2(),N=W(k),P=W(N);Dt(P,t,"connectionLine",{});var O=B(P);{var L=V=>{var A=X2();De(()=>{be(A,"d",d(b)),pt(A,c())}),D(V,A)};me(O,V=>{u()||V(L)})}Y(N),Y(k),De(V=>{be(k,"width",s()),be(k,"height",a()),pt(k,l()),Ot(N,0,V)},[()=>wn((q(lt),q(bc),o(),G(()=>lt(["svelte-flow__connection",bc(o().isValid)]))))]),D(m,k)};me(x,m=>{o(),G(()=>o().inProgress)&&m(p)})}D(e,C);var _=ge({get containerStyle(){return l()},set containerStyle(m){l(m),y()},get style(){return c()},set style(m){c(m),y()},get isCustomComponent(){return u()},set isCustomComponent(m){u(m),y()}});return r(),_}ce(Sd,{containerStyle:{},style:{},isCustomComponent:{}},["connectionLine"],[],!0);var K2=ie("<div><!></div>");function ii(e,t){const n=ft(t,["children","$$slots","$$events","$$legacy","$$host"]),r=ft(n,["position","style","class"]);fe(t,!1);const[o,i]=ct(),s=()=>oe(g,"$selectionRectMode",o),a=ae();let l=w(t,"position",12,"top-right"),c=w(t,"style",12,void 0),u=w(t,"class",12,void 0);const{selectionRectMode:g}=et();ve(()=>q(l()),()=>{te(a,`${l()}`.split("-"))}),Pt(),qe();var f=K2();tn(f,(b,C)=>({class:b,style:c(),...r,[Nr]:C}),[()=>(q(lt),q(u()),d(a),G(()=>lt(["svelte-flow__panel",u(),...d(a)]))),()=>({"pointer-events":s()?"none":""})]);var h=W(f);Dt(h,t,"default",{}),Y(f),D(e,f);var v=ge({get position(){return l()},set position(b){l(b),y()},get style(){return c()},set style(b){c(b),y()},get class(){return u()},set class(b){u(b),y()}});return i(),v}ce(ii,{position:{},style:{},class:{}},["default"],[],!0);var j2=ie('<a href="https://svelteflow.dev" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>');function Pd(e,t){fe(t,!1);let n=w(t,"proOptions",12,void 0),r=w(t,"position",12,"bottom-right");qe();var o=Ze(),i=he(o);{var s=a=>{ii(a,{get position(){return r()},class:"svelte-flow__attribution","data-message":"Feel free to remove the attribution or check out how you could support us: https://svelteflow.dev/support-us",children:(l,c)=>{var u=j2();D(l,u)},$$slots:{default:!0}})};me(i,a=>{q(n()),G(()=>{var l;return!((l=n())!=null&&l.hideAttribution)})&&a(s)})}return D(e,o),ge({get proOptions(){return n()},set proOptions(a){n(a),y()},get position(){return r()},set position(a){r(a),y()}})}ce(Pd,{proOptions:{},position:{}},[],[],!0);function Nd(e,{nodeTypes:t,edgeTypes:n,minZoom:r,maxZoom:o,translateExtent:i,paneClickDistance:s}){t!==void 0&&e.setNodeTypes(t),n!==void 0&&e.setEdgeTypes(n),r!==void 0&&e.setMinZoom(r),o!==void 0&&e.setMaxZoom(o),i!==void 0&&e.setTranslateExtent(i),s!==void 0&&e.setPaneClickDistance(s)}const U2=e=>Object.keys(e);function Td(e,t){U2(t).forEach(n=>{const r=t[n];r!==void 0&&e[n].set(r)})}function G2(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function J2(e="light"){return fn("light",n=>{if(e!=="system"){n(e);return}const r=G2(),o=()=>n(r!=null&&r.matches?"dark":"light");return n(r!=null&&r.matches?"dark":"light"),r==null||r.addEventListener("change",o),()=>{r==null||r.removeEventListener("change",o)}})}var Q2=ie('<!> <!> <div class="svelte-flow__edgelabel-renderer"></div> <div class="svelte-flow__viewport-portal"></div> <!> <!>',1),em=ie("<!> <!>",1),tm=ie("<div><!> <!> <!> <!></div>");const nm={hash:"svelte-18e9ir1",code:".svelte-flow.svelte-18e9ir1 {width:100%;height:100%;overflow:hidden;position:relative;z-index:0;background-color:var(--background-color, var(--background-color-default));}:root {--background-color-default: #fff;--background-pattern-color-default: #ddd;--minimap-mask-color-default: rgba(240, 240, 240, 0.6);--minimap-mask-stroke-color-default: none;--minimap-mask-stroke-width-default: 1;--controls-button-background-color-default: #fefefe;--controls-button-background-color-hover-default: #f4f4f4;--controls-button-color-default: inherit;--controls-button-color-hover-default: inherit;--controls-button-border-color-default: #eee;}"};function Md(e,t){const n=vg(t),r=ft(t,["children","$$slots","$$events","$$legacy","$$host"]),o=ft(r,["id","nodes","edges","fitView","fitViewOptions","minZoom","maxZoom","initialViewport","viewport","nodeTypes","edgeTypes","selectionKey","selectionMode","panActivationKey","multiSelectionKey","zoomActivationKey","nodesDraggable","nodesConnectable","nodeDragThreshold","elementsSelectable","snapGrid","deleteKey","connectionRadius","connectionLineType","connectionMode","connectionLineStyle","connectionLineContainerStyle","onMoveStart","onMove","onMoveEnd","isValidConnection","translateExtent","nodeExtent","onlyRenderVisibleElements","panOnScrollMode","preventScrolling","zoomOnScroll","zoomOnDoubleClick","zoomOnPinch","panOnScroll","panOnDrag","selectionOnDrag","autoPanOnConnect","autoPanOnNodeDrag","onerror","ondelete","onedgecreate","attributionPosition","proOptions","defaultEdgeOptions","width","height","colorMode","onconnect","onconnectstart","onconnectend","onbeforedelete","oninit","nodeOrigin","paneClickDistance","nodeClickDistance","defaultMarkerColor","style","class"]);fe(t,!1),at(e,nm);const[i,s]=ct(),a=()=>oe(_(),"$viewport",i),l=()=>oe(gl,"$initialized",i),c=()=>oe(d(u),"$colorModeClass",i),u=ae();let g=w(t,"id",12,"1"),f=w(t,"nodes",12),h=w(t,"edges",12),v=w(t,"fitView",12,void 0),b=w(t,"fitViewOptions",12,void 0),C=w(t,"minZoom",12,void 0),x=w(t,"maxZoom",12,void 0),p=w(t,"initialViewport",12,void 0),_=w(t,"viewport",12,void 0),m=w(t,"nodeTypes",12,void 0),k=w(t,"edgeTypes",12,void 0),N=w(t,"selectionKey",12,void 0),P=w(t,"selectionMode",12,void 0),O=w(t,"panActivationKey",12,void 0),L=w(t,"multiSelectionKey",12,void 0),V=w(t,"zoomActivationKey",12,void 0),A=w(t,"nodesDraggable",12,void 0),I=w(t,"nodesConnectable",12,void 0),R=w(t,"nodeDragThreshold",12,void 0),E=w(t,"elementsSelectable",12,void 0),$=w(t,"snapGrid",12,void 0),S=w(t,"deleteKey",12,void 0),T=w(t,"connectionRadius",12,void 0),M=w(t,"connectionLineType",12,void 0),H=w(t,"connectionMode",28,()=>Dr.Strict),z=w(t,"connectionLineStyle",12,""),j=w(t,"connectionLineContainerStyle",12,""),Z=w(t,"onMoveStart",12,void 0),ee=w(t,"onMove",12,void 0),re=w(t,"onMoveEnd",12,void 0),Q=w(t,"isValidConnection",12,void 0),de=w(t,"translateExtent",12,void 0),ne=w(t,"nodeExtent",12,void 0),_e=w(t,"onlyRenderVisibleElements",12,void 0),Ne=w(t,"panOnScrollMode",28,()=>Zn.Free),Ve=w(t,"preventScrolling",12,!0),le=w(t,"zoomOnScroll",12,!0),pe=w(t,"zoomOnDoubleClick",12,!0),se=w(t,"zoomOnPinch",12,!0),U=w(t,"panOnScroll",12,!1),ue=w(t,"panOnDrag",12,!0),F=w(t,"selectionOnDrag",12,void 0),we=w(t,"autoPanOnConnect",12,!0),Pe=w(t,"autoPanOnNodeDrag",12,!0),Oe=w(t,"onerror",12,void 0),Be=w(t,"ondelete",12,void 0),Le=w(t,"onedgecreate",12,void 0),ye=w(t,"attributionPosition",12,void 0),Ae=w(t,"proOptions",12,void 0),Ue=w(t,"defaultEdgeOptions",12,void 0),gt=w(t,"width",12,void 0),K=w(t,"height",12,void 0),Ge=w(t,"colorMode",12,"light"),rt=w(t,"onconnect",12,void 0),dt=w(t,"onconnectstart",12,void 0),on=w(t,"onconnectend",12,void 0),tt=w(t,"onbeforedelete",12,void 0),$e=w(t,"oninit",12,void 0),Fe=w(t,"nodeOrigin",12,void 0),Ie=w(t,"paneClickDistance",12,0),Mt=w(t,"nodeClickDistance",12,0),Et=w(t,"defaultMarkerColor",12,"#b1b1b7"),pi=w(t,"style",12,void 0),Br=w(t,"class",12,void 0),mi=ae(),Ht=ae(),Ft=ae();const $o=a()||p(),Qe=S1(ys)?et():E2({nodes:J(f()),edges:J(h()),width:gt(),height:K(),fitView:v(),nodeOrigin:Fe(),nodeExtent:ne()});dn(()=>(Qe.width.set(d(Ht)),Qe.height.set(d(Ft)),Qe.domNode.set(d(mi)),Qe.syncNodeStores(f()),Qe.syncEdgeStores(h()),Qe.syncViewport(_()),v()!==void 0&&Qe.fitViewQueued.set(v()),b()&&Qe.fitViewOptions.set(b()),Nd(Qe,{nodeTypes:m(),edgeTypes:k(),minZoom:C(),maxZoom:x(),translateExtent:de(),paneClickDistance:Ie()}),()=>{Qe.reset()}));const{initialized:gl}=Qe;let yi=ae(!1);ve(()=>(d(Ht),d(Ft)),()=>{d(Ht)!==void 0&&d(Ft)!==void 0&&(Qe.width.set(d(Ht)),Qe.height.set(d(Ft)))}),ve(()=>(d(yi),l(),q($e())),()=>{var X;!d(yi)&&l()&&((X=$e())==null||X(),te(yi,!0))}),ve(()=>(q(g()),q(M()),q(T()),q(P()),q($()),q(Et()),q(A()),q(I()),q(E()),q(_e()),q(Q()),q(we()),q(Pe()),q(Oe()),q(Be()),q(Le()),q(H()),q(R()),q(rt()),q(dt()),q(on()),q(tt()),q(Fe()),Td),()=>{const X={flowId:g(),connectionLineType:M(),connectionRadius:T(),selectionMode:P(),snapGrid:$(),defaultMarkerColor:Et(),nodesDraggable:A(),nodesConnectable:I(),elementsSelectable:E(),onlyRenderVisibleElements:_e(),isValidConnection:Q(),autoPanOnConnect:we(),autoPanOnNodeDrag:Pe(),onerror:Oe(),ondelete:Be(),onedgecreate:Le(),connectionMode:H(),nodeDragThreshold:R(),onconnect:rt(),onconnectstart:dt(),onconnectend:on(),onbeforedelete:tt(),nodeOrigin:Fe()};Td(Qe,X)}),ve(()=>(q(m()),q(k()),q(C()),q(x()),q(de()),q(Ie())),()=>{Nd(Qe,{nodeTypes:m(),edgeTypes:k(),minZoom:C(),maxZoom:x(),translateExtent:de(),paneClickDistance:Ie()})}),ve(()=>q(Ge()),()=>{kg(te(u,J2(Ge())),"$colorModeClass",i)}),Pt(),qe();var sn=tm();tn(sn,X=>({style:pi(),class:X,"data-testid":"svelte-flow__wrapper",...o,role:"application"}),[()=>(q(lt),q(Br()),c(),G(()=>lt(["svelte-flow",Br(),c()])))],void 0,"svelte-18e9ir1");var Ms=W(sn);kd(Ms,{get selectionKey(){return N()},get deleteKey(){return S()},get panActivationKey(){return O()},get multiSelectionKey(){return L()},get zoomActivationKey(){return V()}});var Hs=B(Ms,2);{let X=Me(()=>(q(Ne()),q(Zn),G(()=>Ne()===void 0?Zn.Free:Ne()))),U_=Me(()=>Ve()===void 0?!0:Ve()),G_=Me(()=>le()===void 0?!0:le()),J_=Me(()=>pe()===void 0?!0:pe()),Q_=Me(()=>se()===void 0?!0:se()),eb=Me(()=>U()===void 0?!1:U()),tb=Me(()=>ue()===void 0?!0:ue()),nb=Me(()=>Ie()===void 0?0:Ie());fd(Hs,{get initialViewport(){return $o},get onMoveStart(){return Z()},get onMove(){return ee()},get onMoveEnd(){return re()},get panOnScrollMode(){return d(X)},get preventScrolling(){return d(U_)},get zoomOnScroll(){return d(G_)},get zoomOnDoubleClick(){return d(J_)},get zoomOnPinch(){return d(Q_)},get panOnScroll(){return d(eb)},get panOnDrag(){return d(tb)},get paneClickDistance(){return d(nb)},children:(rb,fb)=>{{let ob=Me(()=>ue()===void 0?!0:ue());vd(rb,{get panOnDrag(){return d(ob)},get selectionOnDrag(){return F()},$$events:{paneclick(wi){je.call(this,t,wi)},panecontextmenu(wi){je.call(this,t,wi)}},children:(wi,gb)=>{var If=em(),zf=he(If);pd(zf,{children:(sb,hb)=>{var Rf=Q2(),Bf=he(Rf);Cd(Bf,{get defaultEdgeOptions(){return Ue()},$$events:{edgeclick(Ke){je.call(this,t,Ke)},edgecontextmenu(Ke){je.call(this,t,Ke)},edgemouseenter(Ke){je.call(this,t,Ke)},edgemouseleave(Ke){je.call(this,t,Ke)}}});var qf=B(Bf,2);Sd(qf,{get containerStyle(){return j()},get style(){return z()},isCustomComponent:G(()=>n.connectionLine),$$slots:{connectionLine:(Ke,vb)=>{var Ff=Ze(),lb=he(Ff);Dt(lb,t,"connectionLine",{}),D(Ke,Ff)}}});var Yf=B(qf,6);yd(Yf,{get nodeClickDistance(){return Mt()},$$events:{nodeclick(Ke){je.call(this,t,Ke)},nodemouseenter(Ke){je.call(this,t,Ke)},nodemousemove(Ke){je.call(this,t,Ke)},nodemouseleave(Ke){je.call(this,t,Ke)},nodedragstart(Ke){je.call(this,t,Ke)},nodedrag(Ke){je.call(this,t,Ke)},nodedragstop(Ke){je.call(this,t,Ke)},nodecontextmenu(Ke){je.call(this,t,Ke)}}});var ab=B(Yf,2);Ed(ab,{$$events:{selectionclick(Ke){je.call(this,t,Ke)},selectioncontextmenu(Ke){je.call(this,t,Ke)},nodedragstart(Ke){je.call(this,t,Ke)},nodedrag(Ke){je.call(this,t,Ke)},nodedragstop(Ke){je.call(this,t,Ke)}}}),D(sb,Rf)},$$slots:{default:!0}});var ib=B(zf,2);$d(ib,{}),D(wi,If)},$$slots:{default:!0}})}},$$slots:{default:!0}})}var Ds=B(Hs,2);Pd(Ds,{get proOptions(){return Ae()},get position(){return ye()}});var hl=B(Ds,2);Dt(hl,t,"default",{}),Y(sn),Vn(sn,X=>te(mi,X),()=>d(mi)),xu(sn,"clientWidth",X=>te(Ht,X)),xu(sn,"clientHeight",X=>te(Ft,X)),ut("dragover",sn,function(X){je.call(this,t,X)}),ut("drop",sn,function(X){je.call(this,t,X)}),D(e,sn);var j_=ge({get id(){return g()},set id(X){g(X),y()},get nodes(){return f()},set nodes(X){f(X),y()},get edges(){return h()},set edges(X){h(X),y()},get fitView(){return v()},set fitView(X){v(X),y()},get fitViewOptions(){return b()},set fitViewOptions(X){b(X),y()},get minZoom(){return C()},set minZoom(X){C(X),y()},get maxZoom(){return x()},set maxZoom(X){x(X),y()},get initialViewport(){return p()},set initialViewport(X){p(X),y()},get viewport(){return _()},set viewport(X){_(X),y()},get nodeTypes(){return m()},set nodeTypes(X){m(X),y()},get edgeTypes(){return k()},set edgeTypes(X){k(X),y()},get selectionKey(){return N()},set selectionKey(X){N(X),y()},get selectionMode(){return P()},set selectionMode(X){P(X),y()},get panActivationKey(){return O()},set panActivationKey(X){O(X),y()},get multiSelectionKey(){return L()},set multiSelectionKey(X){L(X),y()},get zoomActivationKey(){return V()},set zoomActivationKey(X){V(X),y()},get nodesDraggable(){return A()},set nodesDraggable(X){A(X),y()},get nodesConnectable(){return I()},set nodesConnectable(X){I(X),y()},get nodeDragThreshold(){return R()},set nodeDragThreshold(X){R(X),y()},get elementsSelectable(){return E()},set elementsSelectable(X){E(X),y()},get snapGrid(){return $()},set snapGrid(X){$(X),y()},get deleteKey(){return S()},set deleteKey(X){S(X),y()},get connectionRadius(){return T()},set connectionRadius(X){T(X),y()},get connectionLineType(){return M()},set connectionLineType(X){M(X),y()},get connectionMode(){return H()},set connectionMode(X){H(X),y()},get connectionLineStyle(){return z()},set connectionLineStyle(X){z(X),y()},get connectionLineContainerStyle(){return j()},set connectionLineContainerStyle(X){j(X),y()},get onMoveStart(){return Z()},set onMoveStart(X){Z(X),y()},get onMove(){return ee()},set onMove(X){ee(X),y()},get onMoveEnd(){return re()},set onMoveEnd(X){re(X),y()},get isValidConnection(){return Q()},set isValidConnection(X){Q(X),y()},get translateExtent(){return de()},set translateExtent(X){de(X),y()},get nodeExtent(){return ne()},set nodeExtent(X){ne(X),y()},get onlyRenderVisibleElements(){return _e()},set onlyRenderVisibleElements(X){_e(X),y()},get panOnScrollMode(){return Ne()},set panOnScrollMode(X){Ne(X),y()},get preventScrolling(){return Ve()},set preventScrolling(X){Ve(X),y()},get zoomOnScroll(){return le()},set zoomOnScroll(X){le(X),y()},get zoomOnDoubleClick(){return pe()},set zoomOnDoubleClick(X){pe(X),y()},get zoomOnPinch(){return se()},set zoomOnPinch(X){se(X),y()},get panOnScroll(){return U()},set panOnScroll(X){U(X),y()},get panOnDrag(){return ue()},set panOnDrag(X){ue(X),y()},get selectionOnDrag(){return F()},set selectionOnDrag(X){F(X),y()},get autoPanOnConnect(){return we()},set autoPanOnConnect(X){we(X),y()},get autoPanOnNodeDrag(){return Pe()},set autoPanOnNodeDrag(X){Pe(X),y()},get onerror(){return Oe()},set onerror(X){Oe(X),y()},get ondelete(){return Be()},set ondelete(X){Be(X),y()},get onedgecreate(){return Le()},set onedgecreate(X){Le(X),y()},get attributionPosition(){return ye()},set attributionPosition(X){ye(X),y()},get proOptions(){return Ae()},set proOptions(X){Ae(X),y()},get defaultEdgeOptions(){return Ue()},set defaultEdgeOptions(X){Ue(X),y()},get width(){return gt()},set width(X){gt(X),y()},get height(){return K()},set height(X){K(X),y()},get colorMode(){return Ge()},set colorMode(X){Ge(X),y()},get onconnect(){return rt()},set onconnect(X){rt(X),y()},get onconnectstart(){return dt()},set onconnectstart(X){dt(X),y()},get onconnectend(){return on()},set onconnectend(X){on(X),y()},get onbeforedelete(){return tt()},set onbeforedelete(X){tt(X),y()},get oninit(){return $e()},set oninit(X){$e(X),y()},get nodeOrigin(){return Fe()},set nodeOrigin(X){Fe(X),y()},get paneClickDistance(){return Ie()},set paneClickDistance(X){Ie(X),y()},get nodeClickDistance(){return Mt()},set nodeClickDistance(X){Mt(X),y()},get defaultMarkerColor(){return Et()},set defaultMarkerColor(X){Et(X),y()},get style(){return pi()},set style(X){pi(X),y()},get class(){return Br()},set class(X){Br(X),y()}});return s(),j_}ce(Md,{id:{},nodes:{},edges:{},fitView:{},fitViewOptions:{},minZoom:{},maxZoom:{},initialViewport:{},viewport:{},nodeTypes:{},edgeTypes:{},selectionKey:{},selectionMode:{},panActivationKey:{},multiSelectionKey:{},zoomActivationKey:{},nodesDraggable:{},nodesConnectable:{},nodeDragThreshold:{},elementsSelectable:{},snapGrid:{},deleteKey:{},connectionRadius:{},connectionLineType:{},connectionMode:{},connectionLineStyle:{},connectionLineContainerStyle:{},onMoveStart:{},onMove:{},onMoveEnd:{},isValidConnection:{},translateExtent:{},nodeExtent:{},onlyRenderVisibleElements:{},panOnScrollMode:{},preventScrolling:{},zoomOnScroll:{},zoomOnDoubleClick:{},zoomOnPinch:{},panOnScroll:{},panOnDrag:{},selectionOnDrag:{},autoPanOnConnect:{},autoPanOnNodeDrag:{},onerror:{},ondelete:{},onedgecreate:{},attributionPosition:{},proOptions:{},defaultEdgeOptions:{},width:{},height:{},colorMode:{},onconnect:{},onconnectstart:{},onconnectend:{},onbeforedelete:{},oninit:{},nodeOrigin:{},paneClickDistance:{},nodeClickDistance:{},defaultMarkerColor:{},style:{},class:{}},["connectionLine","default"],[],!0);function Hd(e,t){fe(t,!1);let n=w(t,"initialNodes",12,void 0),r=w(t,"initialEdges",12,void 0),o=w(t,"initialWidth",12,void 0),i=w(t,"initialHeight",12,void 0),s=w(t,"fitView",12,void 0),a=w(t,"nodeOrigin",12,void 0);const l=dd({nodes:n(),edges:r(),width:o(),height:i(),nodeOrigin:a(),fitView:s()});Wr(ys,{getStore:()=>l}),ua(()=>{l.reset()}),qe();var c=Ze(),u=he(c);return Dt(u,t,"default",{}),D(e,c),ge({get initialNodes(){return n()},set initialNodes(g){n(g),y()},get initialEdges(){return r()},set initialEdges(g){r(g),y()},get initialWidth(){return o()},set initialWidth(g){o(g),y()},get initialHeight(){return i()},set initialHeight(g){i(g),y()},get fitView(){return s()},set fitView(g){s(g),y()},get nodeOrigin(){return a()},set nodeOrigin(g){a(g),y()}})}ce(Hd,{initialNodes:{},initialEdges:{},initialWidth:{},initialHeight:{},fitView:{},nodeOrigin:{}},["default"],[],!0);var rm=ie("<button><!></button>");function si(e,t){const n=ft(t,["children","$$slots","$$events","$$legacy","$$host"]),r=ft(n,["class","bgColor","bgColorHover","color","colorHover","borderColor"]);fe(t,!1);let o=w(t,"class",12,void 0),i=w(t,"bgColor",12,void 0),s=w(t,"bgColorHover",12,void 0),a=w(t,"color",12,void 0),l=w(t,"colorHover",12,void 0),c=w(t,"borderColor",12,void 0);qe();var u=rm();tn(u,(f,h)=>({type:"button",class:f,...r,[Nr]:h}),[()=>(q(lt),q(o()),G(()=>lt(["svelte-flow__controls-button",o()]))),()=>({"--xy-controls-button-background-color-props":i(),"--xy-controls-button-background-color-hover-props":s(),"--xy-controls-button-color-props":a(),"--xy-controls-button-color-hover-props":l(),"--xy-controls-button-border-color-props":c()})]);var g=W(u);return Dt(g,t,"default",{class:"button-svg"}),Y(u),ut("click",u,function(f){je.call(this,t,f)}),D(e,u),ge({get class(){return o()},set class(f){o(f),y()},get bgColor(){return i()},set bgColor(f){i(f),y()},get bgColorHover(){return s()},set bgColorHover(f){s(f),y()},get color(){return a()},set color(f){a(f),y()},get colorHover(){return l()},set colorHover(f){l(f),y()},get borderColor(){return c()},set borderColor(f){c(f),y()}})}ce(si,{class:{},bgColor:{},bgColorHover:{},color:{},colorHover:{},borderColor:{}},["default"],[],!0);var om=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"></path></svg>');function Dd(e){var t=om();D(e,t)}ce(Dd,{},[],[],!0);var im=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg>');function Vd(e){var t=im();D(e,t)}ce(Vd,{},[],[],!0);var sm=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 30"><path d="M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"></path></svg>');function Od(e){var t=sm();D(e,t)}ce(Od,{},[],[],!0);var am=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"></path></svg>');function Ad(e){var t=am();D(e,t)}ce(Ad,{},[],[],!0);var lm=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"></path></svg>');function Ld(e){var t=lm();D(e,t)}ce(Ld,{},[],[],!0);var um=ie("<!> <!>",1),cm=ie("<!> <!> <!> <!> <!> <!>",1);function Id(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(M,"$nodesDraggable",n),i=()=>oe(H,"$nodesConnectable",n),s=()=>oe(z,"$elementsSelectable",n),a=()=>oe($,"$viewport",n),l=()=>oe(S,"$minZoom",n),c=()=>oe(T,"$maxZoom",n),u=ae(),g=ae(),f=ae(),h=ae();let v=w(t,"position",12,"bottom-left"),b=w(t,"showZoom",12,!0),C=w(t,"showFitView",12,!0),x=w(t,"showLock",12,!0),p=w(t,"buttonBgColor",12,void 0),_=w(t,"buttonBgColorHover",12,void 0),m=w(t,"buttonColor",12,void 0),k=w(t,"buttonColorHover",12,void 0),N=w(t,"buttonBorderColor",12,void 0),P=w(t,"ariaLabel",12,void 0),O=w(t,"style",12,void 0),L=w(t,"orientation",12,"vertical"),V=w(t,"fitViewOptions",12,void 0),A=w(t,"class",12,"");const{zoomIn:I,zoomOut:R,fitView:E,viewport:$,minZoom:S,maxZoom:T,nodesDraggable:M,nodesConnectable:H,elementsSelectable:z}=et(),j={bgColor:p(),bgColorHover:_(),color:m(),colorHover:k(),borderColor:N()},Z=()=>{I()},ee=()=>{R()},re=()=>{E(V())},Q=()=>{te(u,!d(u)),M.set(d(u)),H.set(d(u)),z.set(d(u))};ve(()=>(o(),i(),s()),()=>{te(u,o()||i()||s())}),ve(()=>(a(),l()),()=>{te(g,a().zoom<=l())}),ve(()=>(a(),c()),()=>{te(f,a().zoom>=c())}),ve(()=>q(L()),()=>{te(h,L()==="horizontal"?"horizontal":"vertical")}),Pt(),qe();{let ne=Me(()=>(q(lt),d(h),q(A()),G(()=>lt(["svelte-flow__controls",d(h),A()])))),_e=Me(()=>P()??"Svelte Flow controls");ii(e,{get class(){return d(ne)},get position(){return v()},"data-testid":"svelte-flow__controls",get"aria-label"(){return d(_e)},get style(){return O()},children:(Ne,Ve)=>{var le=cm(),pe=he(le);Dt(pe,t,"before",{});var se=B(pe,2);{var U=Le=>{var ye=um(),Ae=he(ye);si(Ae,ht({class:"svelte-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",get disabled(){return d(f)}},()=>j,{$$events:{click:Z},children:(gt,K)=>{Dd(gt)},$$slots:{default:!0}}));var Ue=B(Ae,2);si(Ue,ht({class:"svelte-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",get disabled(){return d(g)}},()=>j,{$$events:{click:ee},children:(gt,K)=>{Vd(gt)},$$slots:{default:!0}})),D(Le,ye)};me(se,Le=>{b()&&Le(U)})}var ue=B(se,2);{var F=Le=>{si(Le,ht({class:"svelte-flow__controls-fitview",title:"fit view","aria-label":"fit view"},()=>j,{$$events:{click:re},children:(ye,Ae)=>{Od(ye)},$$slots:{default:!0}}))};me(ue,Le=>{C()&&Le(F)})}var we=B(ue,2);{var Pe=Le=>{si(Le,ht({class:"svelte-flow__controls-interactive",title:"toggle interactivity","aria-label":"toggle interactivity"},()=>j,{$$events:{click:Q},children:(ye,Ae)=>{var Ue=Ze(),gt=he(Ue);{var K=rt=>{Ld(rt)},Ge=rt=>{Ad(rt)};me(gt,rt=>{d(u)?rt(K):rt(Ge,!1)})}D(ye,Ue)},$$slots:{default:!0}}))};me(we,Le=>{x()&&Le(Pe)})}var Oe=B(we,2);Dt(Oe,t,"default",{});var Be=B(Oe,2);Dt(Be,t,"after",{}),D(Ne,le)},$$slots:{default:!0}})}var de=ge({get position(){return v()},set position(ne){v(ne),y()},get showZoom(){return b()},set showZoom(ne){b(ne),y()},get showFitView(){return C()},set showFitView(ne){C(ne),y()},get showLock(){return x()},set showLock(ne){x(ne),y()},get buttonBgColor(){return p()},set buttonBgColor(ne){p(ne),y()},get buttonBgColorHover(){return _()},set buttonBgColorHover(ne){_(ne),y()},get buttonColor(){return m()},set buttonColor(ne){m(ne),y()},get buttonColorHover(){return k()},set buttonColorHover(ne){k(ne),y()},get buttonBorderColor(){return N()},set buttonBorderColor(ne){N(ne),y()},get ariaLabel(){return P()},set ariaLabel(ne){P(ne),y()},get style(){return O()},set style(ne){O(ne),y()},get orientation(){return L()},set orientation(ne){L(ne),y()},get fitViewOptions(){return V()},set fitViewOptions(ne){V(ne),y()},get class(){return A()},set class(ne){A(ne),y()}});return r(),de}ce(Id,{position:{},showZoom:{},showFitView:{},showLock:{},buttonBgColor:{},buttonBgColorHover:{},buttonColor:{},buttonColorHover:{},buttonBorderColor:{},ariaLabel:{},style:{},orientation:{},fitViewOptions:{},class:{}},["before","default","after"],[],!0);var ur;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ur||(ur={}));var dm=Ce("<circle></circle>");function zd(e,t){fe(t,!1);let n=w(t,"radius",12,5),r=w(t,"class",12,"");qe();var o=dm();return De(i=>{be(o,"cx",n()),be(o,"cy",n()),be(o,"r",n()),Ot(o,0,i)},[()=>wn((q(lt),q(r()),G(()=>lt(["svelte-flow__background-pattern","dots",r()]))))]),D(e,o),ge({get radius(){return n()},set radius(i){n(i),y()},get class(){return r()},set class(i){r(i),y()}})}ce(zd,{radius:{},class:{}},[],[],!0);var fm=Ce("<path></path>");function Rd(e,t){fe(t,!1);let n=w(t,"lineWidth",12,1),r=w(t,"dimensions",12),o=w(t,"variant",12,void 0),i=w(t,"class",12,"");qe();var s=fm();return De(a=>{be(s,"stroke-width",n()),be(s,"d",(q(r()),G(()=>`M${r()[0]/2} 0 V${r()[1]} M0 ${r()[1]/2} H${r()[0]}`))),Ot(s,0,a)},[()=>wn((q(lt),q(o()),q(i()),G(()=>lt(["svelte-flow__background-pattern",o(),i()]))))]),D(e,s),ge({get lineWidth(){return n()},set lineWidth(a){n(a),y()},get dimensions(){return r()},set dimensions(a){r(a),y()},get variant(){return o()},set variant(a){o(a),y()},get class(){return i()},set class(a){i(a),y()}})}ce(Rd,{lineWidth:{},dimensions:{},variant:{},class:{}},[],[],!0);const gm={[ur.Dots]:1,[ur.Lines]:1,[ur.Cross]:6};var hm=Ce('<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>');const vm={hash:"svelte-1r7pe8d",code:".svelte-flow__background.svelte-1r7pe8d {position:absolute;width:100%;height:100%;top:0;left:0;}"};function Bd(e,t){fe(t,!1),at(e,vm);const[n,r]=ct(),o=()=>oe(k,"$flowId",n),i=()=>oe(m,"$viewport",n),s=ae(),a=ae(),l=ae(),c=ae(),u=ae();let g=w(t,"id",12,void 0),f=w(t,"variant",28,()=>ur.Dots),h=w(t,"gap",12,20),v=w(t,"size",12,1),b=w(t,"lineWidth",12,1),C=w(t,"bgColor",12,void 0),x=w(t,"patternColor",12,void 0),p=w(t,"patternClass",12,void 0),_=w(t,"class",12,"");const{viewport:m,flowId:k}=et(),N=v()||gm[f()],P=f()===ur.Dots,O=f()===ur.Cross,L=Array.isArray(h())?h():[h(),h()];ve(()=>(o(),q(g())),()=>{te(s,`background-pattern-${o()}-${g()?g():""}`)}),ve(()=>i(),()=>{te(a,[L[0]*i().zoom||1,L[1]*i().zoom||1])}),ve(()=>i(),()=>{te(l,N*i().zoom)}),ve(()=>(d(l),d(a)),()=>{te(c,O?[d(l),d(l)]:d(a))}),ve(()=>(d(l),d(c)),()=>{te(u,P?[d(l)/2,d(l)/2]:[d(c)[0]/2,d(c)[1]/2])}),Pt(),qe();var V=hm();let A;var I=W(V),R=W(I);{var E=M=>{{let H=Me(()=>d(l)/2);zd(M,{get radius(){return d(H)},get class(){return p()}})}},$=M=>{Rd(M,{get dimensions(){return d(c)},get variant(){return f()},get lineWidth(){return b()},get class(){return p()}})};me(R,M=>{P?M(E):M($,!1)})}Y(I);var S=B(I);Y(V),De((M,H)=>{Ot(V,0,M,"svelte-1r7pe8d"),A=pt(V,"",A,H),be(I,"id",d(s)),be(I,"x",(i(),d(a),G(()=>i().x%d(a)[0]))),be(I,"y",(i(),d(a),G(()=>i().y%d(a)[1]))),be(I,"width",(d(a),G(()=>d(a)[0]))),be(I,"height",(d(a),G(()=>d(a)[1]))),be(I,"patternTransform",(d(u),G(()=>`translate(-${d(u)[0]},-${d(u)[1]})`))),be(S,"fill",`url(#${d(s)})`)},[()=>wn((q(lt),q(_()),G(()=>lt(["svelte-flow__background",_()])))),()=>({"--xy-background-color-props":C(),"--xy-background-pattern-color-props":x()})]),D(e,V);var T=ge({get id(){return g()},set id(M){g(M),y()},get variant(){return f()},set variant(M){f(M),y()},get gap(){return h()},set gap(M){h(M),y()},get size(){return v()},set size(M){v(M),y()},get lineWidth(){return b()},set lineWidth(M){b(M),y()},get bgColor(){return C()},set bgColor(M){C(M),y()},get patternColor(){return x()},set patternColor(M){x(M),y()},get patternClass(){return p()},set patternClass(M){p(M),y()},get class(){return _()},set class(M){_(M),y()}});return r(),T}ce(Bd,{id:{},variant:{},gap:{},size:{},lineWidth:{},bgColor:{},patternColor:{},patternClass:{},class:{}},[],[],!0);var pm=Ce("<rect></rect>");function qd(e,t){fe(t,!1);let n=w(t,"x",12),r=w(t,"y",12),o=w(t,"width",12,0),i=w(t,"height",12,0),s=w(t,"borderRadius",12,5),a=w(t,"color",12,void 0),l=w(t,"shapeRendering",12),c=w(t,"strokeColor",12,void 0),u=w(t,"strokeWidth",12,2),g=w(t,"selected",12,!1),f=w(t,"class",12,"");qe();var h=pm();let v;return De((b,C)=>{v=Ot(h,0,b,null,v,C),be(h,"x",n()),be(h,"y",r()),be(h,"rx",s()),be(h,"ry",s()),be(h,"width",o()),be(h,"height",i()),pt(h,`${a()?`fill: ${a()};`:""}${c()?`stroke: ${c()};`:""}${u()?`stroke-width: ${u()};`:""}`),be(h,"shape-rendering",l())},[()=>wn((q(lt),q(f()),G(()=>lt(["svelte-flow__minimap-node",f()])))),()=>({selected:g()})]),D(e,h),ge({get x(){return n()},set x(b){n(b),y()},get y(){return r()},set y(b){r(b),y()},get width(){return o()},set width(b){o(b),y()},get height(){return i()},set height(b){i(b),y()},get borderRadius(){return s()},set borderRadius(b){s(b),y()},get color(){return a()},set color(b){a(b),y()},get shapeRendering(){return l()},set shapeRendering(b){l(b),y()},get strokeColor(){return c()},set strokeColor(b){c(b),y()},get strokeWidth(){return u()},set strokeWidth(b){u(b),y()},get selected(){return g()},set selected(b){g(b),y()},get class(){return f()},set class(b){f(b),y()}})}ce(qd,{x:{},y:{},width:{},height:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},selected:{},class:{}},[],[],!0);function el(e,t){const n=e2({domNode:e,panZoom:t.panZoom,getTransform:()=>{const o=J(t.viewport);return[o.x,o.y,o.zoom]},getViewScale:t.getViewScale});function r(o){n.update({translateExtent:o.translateExtent,width:o.width,height:o.height,inversePan:o.inversePan,zoomStep:o.zoomStep,pannable:o.pannable,zoomable:o.zoomable})}return{update:r,destroy(){n.destroy()}}}const tl=e=>e instanceof Function?e:()=>e;var mm=Ce("<title> </title>"),ym=Ce('<svg class="svelte-flow__minimap-svg" role="img"><!><!><path class="svelte-flow__minimap-mask" fill-rule="evenodd" pointer-events="none"></path></svg>');function Yd(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(ue,"$flowId",n),i=()=>oe(pe,"$viewport",n),s=()=>oe(se,"$containerWidth",n),a=()=>oe(U,"$containerHeight",n),l=()=>oe(le,"$nodeLookup",n),c=()=>oe(Ve,"$nodes",n),u=()=>oe(F,"$panZoom",n),g=()=>oe(we,"$translateExtent",n),f=ae(),h=ae(),v=ae(),b=ae(),C=ae(),x=ae(),p=ae(),_=ae(),m=ae(),k=ae(),N=ae(),P=ae(),O=ae();let L=w(t,"position",12,"bottom-right"),V=w(t,"ariaLabel",12,"Mini map"),A=w(t,"nodeStrokeColor",12,"transparent"),I=w(t,"nodeColor",12,void 0),R=w(t,"nodeClass",12,""),E=w(t,"nodeBorderRadius",12,5),$=w(t,"nodeStrokeWidth",12,2),S=w(t,"bgColor",12,void 0),T=w(t,"maskColor",12,void 0),M=w(t,"maskStrokeColor",12,void 0),H=w(t,"maskStrokeWidth",12,void 0),z=w(t,"width",12,void 0),j=w(t,"height",12,void 0),Z=w(t,"pannable",12,!0),ee=w(t,"zoomable",12,!0),re=w(t,"inversePan",12,void 0),Q=w(t,"zoomStep",12,void 0),de=w(t,"style",12,""),ne=w(t,"class",12,"");const _e=200,Ne=150,{nodes:Ve,nodeLookup:le,viewport:pe,width:se,height:U,flowId:ue,panZoom:F,translateExtent:we}=et(),Pe=I()===void 0?void 0:tl(I()),Oe=tl(A()),Be=tl(R()),Le=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",ye=`svelte-flow__minimap-desc-${o()}`;let Ae=ae(d(f));const Ue=()=>d(x);ve(()=>(i(),s(),a()),()=>{te(f,{x:-i().x/i().zoom,y:-i().y/i().zoom,width:s()/i().zoom,height:a()/i().zoom})}),ve(()=>(l(),d(f),c()),()=>{te(Ae,l().size>0?Sc(ei(l(),{filter:K=>!K.hidden}),d(f)):d(f)),c()}),ve(()=>q(z()),()=>{te(h,z()??_e)}),ve(()=>q(j()),()=>{te(v,j()??Ne)}),ve(()=>(d(Ae),d(h)),()=>{te(b,d(Ae).width/d(h))}),ve(()=>(d(Ae),d(v)),()=>{te(C,d(Ae).height/d(v))}),ve(()=>(d(b),d(C)),()=>{te(x,Math.max(d(b),d(C)))}),ve(()=>(d(x),d(h)),()=>{te(p,d(x)*d(h))}),ve(()=>(d(x),d(v)),()=>{te(_,d(x)*d(v))}),ve(()=>d(x),()=>{te(m,5*d(x))}),ve(()=>(d(Ae),d(p),d(m)),()=>{te(k,d(Ae).x-(d(p)-d(Ae).width)/2-d(m))}),ve(()=>(d(Ae),d(_),d(m)),()=>{te(N,d(Ae).y-(d(_)-d(Ae).height)/2-d(m))}),ve(()=>(d(p),d(m)),()=>{te(P,d(p)+d(m)*2)}),ve(()=>(d(_),d(m)),()=>{te(O,d(_)+d(m)*2)}),Pt(),qe();{let K=Me(()=>de()+(S()?`;--xy-minimap-background-color-props:${S()}`:"")),Ge=Me(()=>(q(lt),q(ne()),G(()=>lt(["svelte-flow__minimap",ne()]))));ii(e,{get position(){return L()},get style(){return d(K)},get class(){return d(Ge)},"data-testid":"svelte-flow__minimap",children:(rt,dt)=>{var on=Ze(),tt=he(on);{var $e=Fe=>{var Ie=ym();let Mt;var Et=W(Ie);{var pi=Ht=>{var Ft=mm(),$o=W(Ft,!0);Y(Ft),De(()=>{be(Ft,"id",ye),vt($o,V())}),D(Ht,Ft)};me(Et,Ht=>{V()&&Ht(pi)})}var Br=B(Et);Yt(Br,1,c,Ht=>Ht.id,(Ht,Ft)=>{var $o=Ze();const Qe=Me(()=>(l(),d(Ft),G(()=>l().get(d(Ft).id))));var gl=he($o);{var yi=sn=>{const Ms=Me(()=>(q(Kn),q(d(Qe)),G(()=>Kn(d(Qe)))));{let Hs=Me(()=>(q(d(Qe)),G(()=>Pe==null?void 0:Pe(d(Qe))))),Ds=Me(()=>(q(d(Qe)),G(()=>Oe(d(Qe))))),hl=Me(()=>(q(d(Qe)),G(()=>Be(d(Qe)))));qd(sn,ht({get x(){return q(d(Qe)),G(()=>d(Qe).internals.positionAbsolute.x)},get y(){return q(d(Qe)),G(()=>d(Qe).internals.positionAbsolute.y)}},()=>d(Ms),{get selected(){return q(d(Qe)),G(()=>d(Qe).selected)},get color(){return d(Hs)},get borderRadius(){return E()},get strokeColor(){return d(Ds)},get strokeWidth(){return $()},get shapeRendering(){return Le},get class(){return d(hl)}}))}};me(gl,sn=>{q(d(Qe)),q(fs),G(()=>d(Qe)&&fs(d(Qe)))&&sn(yi)})}D(Ht,$o)});var mi=B(Br);Y(Ie),Vt(Ie,(Ht,Ft)=>el==null?void 0:el(Ht,Ft),()=>({panZoom:u(),viewport:pe,getViewScale:Ue,translateExtent:g(),width:s(),height:a(),inversePan:re(),zoomStep:Q(),pannable:Z(),zoomable:ee()})),De(Ht=>{be(Ie,"width",d(h)),be(Ie,"height",d(v)),be(Ie,"viewBox",`${d(k)??""} ${d(N)??""} ${d(P)??""} ${d(O)??""}`),be(Ie,"aria-labelledby",ye),Mt=pt(Ie,"",Mt,Ht),be(mi,"d",`M${d(k)-d(m)},${d(N)-d(m)}h${d(P)+d(m)*2}v${d(O)+d(m)*2}h${-d(P)-d(m)*2}z
3
+ M${d(f),G(()=>d(f).x)??""},${d(f),G(()=>d(f).y)??""}h${d(f),G(()=>d(f).width)??""}v${d(f),G(()=>d(f).height)??""}h${d(f),G(()=>-d(f).width)??""}z`)},[()=>({"--xy-minimap-mask-background-color-props":T(),"--xy-minimap-mask-stroke-color-props":M(),"--xy-minimap-mask-stroke-width-props":H()?H()*d(x):void 0})]),D(Fe,Ie)};me(tt,Fe=>{u()&&Fe($e)})}D(rt,on)},$$slots:{default:!0}})}var gt=ge({get position(){return L()},set position(K){L(K),y()},get ariaLabel(){return V()},set ariaLabel(K){V(K),y()},get nodeStrokeColor(){return A()},set nodeStrokeColor(K){A(K),y()},get nodeColor(){return I()},set nodeColor(K){I(K),y()},get nodeClass(){return R()},set nodeClass(K){R(K),y()},get nodeBorderRadius(){return E()},set nodeBorderRadius(K){E(K),y()},get nodeStrokeWidth(){return $()},set nodeStrokeWidth(K){$(K),y()},get bgColor(){return S()},set bgColor(K){S(K),y()},get maskColor(){return T()},set maskColor(K){T(K),y()},get maskStrokeColor(){return M()},set maskStrokeColor(K){M(K),y()},get maskStrokeWidth(){return H()},set maskStrokeWidth(K){H(K),y()},get width(){return z()},set width(K){z(K),y()},get height(){return j()},set height(K){j(K),y()},get pannable(){return Z()},set pannable(K){Z(K),y()},get zoomable(){return ee()},set zoomable(K){ee(K),y()},get inversePan(){return re()},set inversePan(K){re(K),y()},get zoomStep(){return Q()},set zoomStep(K){Q(K),y()},get style(){return de()},set style(K){de(K),y()},get class(){return ne()},set class(K){ne(K),y()}});return r(),gt}ce(Yd,{position:{},ariaLabel:{},nodeStrokeColor:{},nodeColor:{},nodeClass:{},nodeBorderRadius:{},nodeStrokeWidth:{},bgColor:{},maskColor:{},maskStrokeColor:{},maskStrokeWidth:{},width:{},height:{},pannable:{},zoomable:{},inversePan:{},zoomStep:{},style:{},class:{}},[],[],!0);const Fd=e=>gp(e);function jt(){const{zoomIn:e,zoomOut:t,fitView:n,onbeforedelete:r,snapGrid:o,viewport:i,width:s,height:a,minZoom:l,maxZoom:c,panZoom:u,nodes:g,edges:f,domNode:h,nodeLookup:v,nodeOrigin:b,edgeLookup:C,connectionLookup:x}=et(),p=k=>{var V,A;const N=J(v),P=Fd(k)?k:N.get(k.id),O=P.parentId?bp(P.position,P.measured,P.parentId,N,J(b)):P.position,L={...P,position:O,width:((V=P.measured)==null?void 0:V.width)??P.width,height:((A=P.measured)==null?void 0:A.height)??P.height};return lo(L)},_=(k,N,P={replace:!1})=>{var V;const O=(V=J(v).get(k))==null?void 0:V.internals.userNode;if(!O)return;const L=typeof N=="function"?N(O):N;P.replace?g.update(A=>A.map(I=>I.id===k?Fd(L)?L:{...I,...L}:I)):(Object.assign(O,L),g.update(A=>A))},m=k=>J(v).get(k);return{zoomIn:e,zoomOut:t,getInternalNode:m,getNode:k=>{var N;return(N=m(k))==null?void 0:N.internals.userNode},getNodes:k=>k===void 0?J(g):Wd(J(v),k),getEdge:k=>J(C).get(k),getEdges:k=>k===void 0?J(f):Wd(J(C),k),setZoom:(k,N)=>{const P=J(u);return P?P.scaleTo(k,{duration:N==null?void 0:N.duration}):Promise.resolve(!1)},getZoom:()=>J(i).zoom,setViewport:async(k,N)=>{const P=J(i),O=J(u);return O?(await O.setViewport({x:k.x??P.x,y:k.y??P.y,zoom:k.zoom??P.zoom},{duration:N==null?void 0:N.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>J(i),setCenter:async(k,N,P)=>{const O=typeof(P==null?void 0:P.zoom)<"u"?P.zoom:J(c),L=J(u);return L?(await L.setViewport({x:J(s)/2-k*O,y:J(a)/2-N*O,zoom:O},{duration:P==null?void 0:P.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitView:n,fitBounds:async(k,N)=>{const P=J(u);if(!P)return Promise.resolve(!1);const O=qa(k,J(s),J(a),J(l),J(c),(N==null?void 0:N.padding)??.1);return await P.setViewport(O,{duration:N==null?void 0:N.duration}),Promise.resolve(!0)},getIntersectingNodes:(k,N=!0,P)=>{const O=Pc(k),L=O?k:p(k);return L?(P||J(g)).filter(V=>{const A=J(v).get(V.id);if(!A||!O&&V.id===k.id)return!1;const I=lo(A),R=ti(I,L);return N&&R>0||R>=L.width*L.height}):[]},isNodeIntersecting:(k,N,P=!0)=>{const L=Pc(k)?k:p(k);if(!L)return!1;const V=ti(L,N);return P&&V>0||V>=L.width*L.height},deleteElements:async({nodes:k=[],edges:N=[]})=>{const{nodes:P,edges:O}=await Cc({nodesToRemove:k,edgesToRemove:N,nodes:J(g),edges:J(f),onBeforeDelete:J(r)});return P&&g.update(L=>L.filter(V=>!P.some(({id:A})=>A===V.id))),O&&f.update(L=>L.filter(V=>!O.some(({id:A})=>A===V.id))),{deletedNodes:P,deletedEdges:O}},screenToFlowPosition:(k,N={snapToGrid:!0})=>{const P=J(h);if(!P)return k;const O=N.snapToGrid?J(o):!1,{x:L,y:V,zoom:A}=J(i),{x:I,y:R}=P.getBoundingClientRect(),E={x:k.x-I,y:k.y-R};return ni(E,[L,V,A],O!==null,O||[1,1])},flowToScreenPosition:k=>{const N=J(h);if(!N)return k;const{x:P,y:O,zoom:L}=J(i),{x:V,y:A}=N.getBoundingClientRect(),I=cs(k,[P,O,L]);return{x:I.x+V,y:I.y+A}},toObject:()=>({nodes:J(g).map(k=>({...k,position:{...k.position},data:{...k.data}})),edges:J(f).map(k=>({...k})),viewport:{...J(i)}}),updateNode:_,updateNodeData:(k,N,P)=>{var V;const O=(V=J(v).get(k))==null?void 0:V.internals.userNode;if(!O)return;const L=typeof N=="function"?N(O):N;O.data=P!=null&&P.replace?L:{...O.data,...L},g.update(A=>A)},getNodesBounds:k=>{const N=J(v),P=J(b);return hp(k,{nodeLookup:N,nodeOrigin:P})},getHandleConnections:({type:k,id:N,nodeId:P})=>{var O;return Array.from(((O=J(x).get(`${P}-${k}-${N??null}`))==null?void 0:O.values())??[])},viewport:i}}function Wd(e,t){var r;const n=[];for(const o of t){const i=e.get(o);if(i){const s="internals"in i?(r=i.internals)==null?void 0:r.userNode:i;n.push(s)}}return n}var wm=ie('<div class="svelte-flow__node-toolbar"><!></div>');function Xd(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(_,"$nodes",n),i=()=>oe(p,"$nodeLookup",n),s=()=>oe(x,"$viewport",n),a=()=>oe(C,"$domNode",n),l=ae(),c=ae(),u=ae();let g=w(t,"nodeId",12,void 0),f=w(t,"position",12,void 0),h=w(t,"align",12,void 0),v=w(t,"offset",12,void 0),b=w(t,"isVisible",12,void 0);const{domNode:C,viewport:x,nodeLookup:p,nodes:_}=et(),{getNodesBounds:m}=jt(),k=Cr("svelteflow__node_id");let N=ae(),P=ae([]),O=v()!==void 0?v():10,L=f()!==void 0?f():Se.Top,V=h()!==void 0?h():"center";ve(()=>(o(),q(g()),i()),()=>{o();const $=Array.isArray(g())?g():[g()||k];te(P,$.reduce((S,T)=>{const M=i().get(T);return M&&S.push(M),S},[]))}),ve(()=>(d(P),s()),()=>{const $=m(d(P));$&&te(N,Lp($,s(),L,O,V))}),ve(()=>d(P),()=>{te(l,d(P).length===0?1:Math.max(...d(P).map($=>($.internals.z||5)+1)))}),ve(()=>o(),()=>{te(c,o().filter($=>$.selected).length)}),ve(()=>(q(b()),d(P),d(c)),()=>{te(u,typeof b()=="boolean"?b():d(P).length===1&&d(P)[0].selected&&d(c)===1)}),Pt(),qe();var A=Ze(),I=he(A);{var R=$=>{var S=wm();let T;var M=W(S);Dt(M,t,"default",{}),Y(S),Vt(S,(H,z)=>go==null?void 0:go(H,z),()=>({domNode:a()})),De((H,z)=>{be(S,"data-id",H),T=pt(S,"",T,z)},[()=>(d(P),G(()=>d(P).reduce((H,z)=>`${H}${z.id} `,"").trim())),()=>({position:"absolute",transform:d(N),"z-index":d(l)})]),D($,S)};me(I,$=>{a()&&d(u)&&d(P)&&$(R)})}D(e,A);var E=ge({get nodeId(){return g()},set nodeId($){g($),y()},get position(){return f()},set position($){f($),y()},get align(){return h()},set align($){h($),y()},get offset(){return v()},set offset($){v($),y()},get isVisible(){return b()},set isVisible($){b($),y()}});return r(),E}ce(Xd,{nodeId:{},position:{},align:{},offset:{},isVisible:{}},["default"],[],!0);function Ar(e){const{nodes:t,nodeLookup:n}=et();let r=[],o=!0;return sr([t,n],([,i],s)=>{var u;const a=[],l=Array.isArray(e),c=l?e:[e];for(const g of c){const f=(u=i.get(g))==null?void 0:u.internals.userNode;f&&a.push({id:f.id,type:f.type,data:f.data})}(!Wp(a,r)||o)&&(r=a,s(l?a:a[0]??null),o=!1)})}const Zd="tinyflow-component";class _m{constructor(t){kt(this,"options");kt(this,"rootEl");kt(this,"svelteFlowInstance");if(typeof t.element!="string"&&!(t.element instanceof Element))throw new Error("element must be a string or Element");this._setOptions(t),this._init()}_init(){if(typeof this.options.element=="string"){if(this.rootEl=document.querySelector(this.options.element),!this.rootEl)throw new Error(`element not found by document.querySelector('${this.options.element}')`)}else if(this.options.element instanceof Element)this.rootEl=this.options.element;else throw new Error("element must be a string or Element");const t=document.createElement(Zd);t.style.display="block",t.style.width="100%",t.style.height="100%",t.classList.add("tf-theme-light"),t.options=this.options,t.onInit=n=>{this.svelteFlowInstance=n},this.rootEl.appendChild(t)}_setOptions(t){this.options={...t}}getOptions(){return this.options}getData(){return this.svelteFlowInstance.toObject()}setData(t){this.options.data=t;const n=document.createElement(Zd);n.style.display="block",n.style.width="100%",n.style.height="100%",n.classList.add("tf-theme-light"),n.options=this.options,n.onInit=r=>{this.svelteFlowInstance=r},this.destroy(),this.rootEl.appendChild(n)}destroy(){for(;this.rootEl.firstChild;)this.rootEl.removeChild(this.rootEl.firstChild)}}const ws=(()=>{const e=xe([]),t=xe([]),n=xe({x:250,y:100,zoom:1});return{nodes:e,edges:t,viewport:n,init:(r,o)=>{e.set(r),t.set(o)},addNode:r=>{e.update(o=>[...o,r])},removeNode:r=>{e.update(o=>o.filter(i=>i.id!==r))},updateNode:(r,o)=>{e.update(i=>i.map(s=>s.id===r?o:s))},updateNodeData:(r,o)=>{e.update(i=>i.map(s=>s.id===r?{...s,data:{...s.data,...o}}:s))},selectNodeOnly:r=>{e.update(o=>o.map(i=>i.id===r?{...i,selected:!0}:{...i,selected:!1}))},addEdge:r=>{t.update(o=>[...o,r])},removeEdge:r=>{t.update(o=>o.filter(i=>i.id!==r))},updateEdge:(r,o)=>{t.update(i=>i.map(s=>s.id===r?o:s))},updateEdgeData:(r,o)=>{t.update(i=>i.map(s=>s.id===r?{...s,data:o}:s))}}})();var bm=ie("<button><!></button>");function Je(e,t){fe(t,!0);const n=w(t,"children",7),r=w(t,"primary",7),o=Nt(t,["$$slots","$$events","$$legacy","$$host","children","primary"]);var i=bm();tn(i,()=>({type:"button",...o,class:`tf-btn ${r()?"tf-btn-primary":""} nopan nodrag ${t.class??""}`}));var s=W(i);return Pr(s,()=>n()??wt),Y(i),D(e,i),ge({get children(){return n()},set children(a){n(a),y()},get primary(){return r()},set primary(a){r(a),y()}})}ce(Je,{children:{},primary:{}},[],[],!0);var xm=ie("<input/>");function Kd(e,t){fe(t,!0);const n=Nt(t,["$$slots","$$events","$$legacy","$$host"]);var r=xm();ir(r),tn(r,()=>({type:"checkbox",...n,class:`tf-checkbox nopan nodrag ${t.class??""}`})),D(e,r),ge()}ce(Kd,{},[],[],!0);var Cm=ie('<div><input type="hidden"/> <!> <!></div>');const $m={hash:"svelte-1swt2gg",code:".tf-chosen.svelte-1swt2gg {display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:5px;}"};function jd(e,t){fe(t,!0),at(e,$m);const n=w(t,"placeholder",7),r=w(t,"label",7),o=w(t,"value",7),i=w(t,"buttonText",7,"选择..."),s=w(t,"onChosen",7),a=Nt(t,["$$slots","$$events","$$legacy","$$host","placeholder","label","value","buttonText","onChosen"]);var l=Cm();tn(l,()=>({...a,class:`tf-chosen nopan nodrag ${t.class??""}`}),void 0,void 0,"svelte-1swt2gg");var c=W(l);ir(c);var u=B(c,2);Ct(u,{get value(){return r()},get placeholder(){return n()},style:"flex-grow: 1;",disabled:!0});var g=B(u,2);return Je(g,{onclick:f=>{var h;(h=s())==null||h(o(),r(),f)},style:"padding: 3px",children:(f,h)=>{Te();var v=Re();De(()=>vt(v,i())),D(f,v)},$$slots:{default:!0}}),Y(l),De(()=>Vi(c,o())),D(e,l),ge({get placeholder(){return n()},set placeholder(f){n(f),y()},get label(){return r()},set label(f){r(f),y()},get value(){return o()},set value(f){o(f),y()},get buttonText(){return i()},set buttonText(f="选择..."){i(f),y()},get onChosen(){return s()},set onChosen(f){s(f),y()}})}ce(jd,{placeholder:{},label:{},value:{},buttonText:{},onChosen:{}},[],[],!0);var Em=ie("<input/>");function Ct(e,t){fe(t,!0);const n=Nt(t,["$$slots","$$events","$$legacy","$$host"]);var r=Em();ir(r),tn(r,()=>({type:"text",spellcheck:"false",...n,class:`tf-input nopan nodrag ${t.class??""}`})),D(e,r),ge()}ce(Ct,{},[],[],!0);var km=ie("<textarea></textarea>");function Tt(e,t){fe(t,!0);const n=w(t,"value",7),r=Nt(t,["$$slots","$$events","$$legacy","$$host","value"]);var o=km();return U1(o),tn(o,()=>({spellcheck:"false",...r,class:`tf-textarea nodrag nowheel ${t.class??""}`,value:n()||""})),D(e,o),ge({get value(){return n()},set value(i){n(i),y()}})}ce(Tt,{value:{}},[],[],!0);var Sm=ie('<div role="button"><!></div>'),Pm=ie("<div></div>");function Ud(e,t){const n=ft(t,["children","$$slots","$$events","$$legacy","$$host"]),r=ft(n,["items","onChange","activeIndex"]);fe(t,!1);let o=w(t,"items",28,()=>[]),i=w(t,"onChange",12,()=>{}),s=w(t,"activeIndex",12,0);function a(c,u){var g;s(u),(g=i())==null||g(c,u)}qe();var l=Pm();return tn(l,()=>({...r,class:`tf-tabs ${q(r),G(()=>r.class)??""}`})),Yt(l,5,o,Qr,(c,u,g)=>{var f=Sm();be(f,"tabindex",g),f.__click=()=>a(d(u),g),f.__keydown=C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),a(d(u),g))};var h=W(f);{var v=C=>{var x=Re();De(()=>vt(x,(d(u),G(()=>d(u).label)))),D(C,x)},b=C=>{var x=Ze(),p=he(x);Pr(p,()=>(d(u),G(()=>d(u).label)??wt)),D(C,x)};me(h,C=>{d(u),G(()=>typeof d(u).label=="string")?C(v):C(b,!1)})}Y(f),De(()=>Ot(f,1,`tf-tabs-item ${g===s()?"active":""}`)),D(c,f)}),Y(l),D(e,l),ge({get items(){return o()},set items(c){o(c),y()},get onChange(){return i()},set onChange(c){i(c),y()},get activeIndex(){return s()},set activeIndex(c){s(c),y()}})}Gr(["click","keydown"]),ce(Ud,{items:{},onChange:{},activeIndex:{}},[],[],!0);var Nm=(e,t,n)=>t(d(n)),Tm=(e,t,n)=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),t(d(n)))},Mm=ie('<span class="tf-collapse-item-title-icon"><!></span>'),Hm=ie('<div class="tf-collapse-item-description"><!></div>'),Dm=ie('<div class="tf-collapse-item-content"><!></div>'),Vm=ie('<div class="tf-collapse-item"><div class="tf-collapse-item-title" role="button"><!> <!> <span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"></path></svg></span></div> <!> <!></div>'),Om=ie("<div></div>");const Am={hash:"svelte-1jfktzw",code:`
4
+ /* 定义旋转的 CSS 类 */.rotate-90.svelte-1jfktzw {transform:rotate(90deg);transition:transform 0.3s ease;}`};function Gd(e,t){fe(t,!0),at(e,Am);let n=w(t,"items",7),r=w(t,"onChange",7),o=w(t,"activeKeys",31,()=>Pn([]));function i(a){var l;o().includes(a.key)?o(o().filter(c=>c!==a.key)):(o().push(a.key),o(o())),(l=r())==null||l(a,o())}var s=Om();return Yt(s,21,n,Qr,(a,l,c)=>{var u=Vm(),g=W(u);be(g,"tabindex",c),g.__click=[Nm,i,l],g.__keydown=[Tm,i,l];var f=W(g);{var h=m=>{var k=Mm(),N=W(k);cr(N,{get target(){return d(l).icon}}),Y(k),D(m,k)};me(f,m=>{d(l).icon&&m(h)})}var v=B(f,2);cr(v,{get target(){return d(l).title}});var b=B(v,2);Y(g);var C=B(g,2);{var x=m=>{var k=Hm(),N=W(k);cr(N,{get target(){return d(l).description}}),Y(k),D(m,k)};me(C,m=>{d(l).description&&m(x)})}var p=B(C,2);{var _=m=>{var k=Dm(),N=W(k);cr(N,{get target(){return d(l).content}}),Y(k),D(m,k)};me(p,m=>{o().includes(d(l).key)&&m(_)})}Y(u),De(m=>Ot(b,1,`tf-collapse-item-title-arrow ${m??""}`,"svelte-1jfktzw"),[()=>o().includes(d(l).key)?"rotate-90":""]),D(a,u)}),Y(s),De(()=>{pt(s,t.style),Ot(s,1,`tf-collapse ${t.class??""}`,"svelte-1jfktzw")}),D(e,s),ge({get items(){return n()},set items(a){n(a),y()},get onChange(){return r()},set onChange(a){r(a),y()},get activeKeys(){return o()},set activeKeys(a=[]){o(a),y()}})}Gr(["click","keydown"]),ce(Gd,{items:{},onChange:{},activeKeys:{}},[],[],!0);function cr(e,t){fe(t,!0);let n=w(t,"target",7);typeof n()>"u"&&n("undefined");var r=Ze(),o=he(r);{var i=a=>{var l=Ze(),c=he(l);Pr(c,()=>n()??wt),D(a,l)},s=a=>{var l=Ze(),c=he(l);fa(c,n),D(a,l)};me(o,a=>{typeof n()=="function"?a(i):a(s,!1)})}return D(e,r),ge({get target(){return n()},set target(a){n(a),y()}})}ce(cr,{target:{}},[],[],!0);var Lm=(e,t,n)=>t(d(n)),Im=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 14L8 10H16L12 14Z"></path></svg>'),zm=ie('<div class="tf-select-content-children"><!></div>'),Rm=ie('<button class="tf-select-content-item"><span><!></span> <!></button> <!>',1),Bm=ie('<div class="tf-select-content nopan nodrag"><!></div>'),qm=ie("<!> <!>",1),Ym=ie('<div class="tf-select-input-placeholder"> </div>'),Fm=ie('<button><div class="tf-select-input-value"></div> <div class="tf-select-input-arrow"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"></path></svg></div></button>'),Wm=ie("<div><!></div>");function hn(e,t){fe(t,!0);const n=(x,p=wt)=>{var _=Ze(),m=he(_);Yt(m,19,p,(k,N)=>`${N}_${k.value}`,(k,N)=>{var P=Rm(),O=he(P);O.__click=[Lm,v,N];var L=W(O),V=W(L);{var A=$=>{var S=Im();D($,S)};me(V,$=>{d(N).children&&d(N).children.length>0&&$(A)})}Y(L);var I=B(L,2);cr(I,{get target(){return d(N).label}}),Y(O);var R=B(O,2);{var E=$=>{var S=zm(),T=W(S);n(T,()=>d(N).children),Y(S),D($,S)};me(R,$=>{d(N).children&&d(N).children.length>0&&(a()||c().includes(d(N).value))&&$(E)})}D(k,P)}),D(x,_)};let r=w(t,"items",7),o=w(t,"onSelect",7),i=w(t,"value",23,()=>[]),s=w(t,"defaultValue",23,()=>[]),a=w(t,"expandAll",7,!0),l=w(t,"multiple",7,!1),c=w(t,"expandValue",23,()=>[]),u=w(t,"placeholder",7),g=Nt(t,["$$slots","$$events","$$legacy","$$host","items","onSelect","value","defaultValue","expandAll","multiple","expandValue","placeholder"]),f=Ee(()=>{const x=[],p=_=>{for(let m of _)i().length>0?i().includes(m.value)&&x.push(m):s().includes(m.value)&&x.push(m),m.children&&m.children.length>0&&p(m.children)};return p(r()),x}),h;function v(x){var p;h==null||h.hide(),(p=o())==null||p(x)}var b=Wm();tn(b,()=>({...g,class:`tf-select ${g.class??""}`}));var C=W(b);return Vn(wo(C,{floating:p=>{var _=Bm(),m=W(_);n(m,r),Y(_),D(p,_)},children:(p,_)=>{var m=Fm();tn(m,()=>({class:"tf-select-input nopan nodrag",...g}));var k=W(m);Yt(k,23,()=>d(f),(N,P)=>`${P}_${N.value}`,(N,P,O)=>{var L=Ze(),V=he(L);{var A=R=>{var E=Ze(),$=he(E);{var S=T=>{cr(T,{get target(){return d(P).label}})};me($,T=>{d(O)===0&&T(S)})}D(R,E)},I=R=>{var E=qm(),$=he(E);cr($,{get target(){return d(P).label}});var S=B($,2);{var T=M=>{var H=Re(",");D(M,H)};me(S,M=>{d(O)<d(f).length-1&&M(T)})}D(R,E)};me(V,R=>{l()?R(I,!1):R(A)})}D(N,L)},N=>{var P=Ym(),O=W(P,!0);Y(P),De(()=>vt(O,u())),D(N,P)}),Y(k),Te(2),Y(m),D(p,m)},$$slots:{floating:!0,default:!0}}),p=>h=p,()=>h),Y(b),D(e,b),ge({get items(){return r()},set items(x){r(x),y()},get onSelect(){return o()},set onSelect(x){o(x),y()},get value(){return i()},set value(x=[]){i(x),y()},get defaultValue(){return s()},set defaultValue(x=[]){s(x),y()},get expandAll(){return a()},set expandAll(x=!0){a(x),y()},get multiple(){return l()},set multiple(x=!1){l(x),y()},get expandValue(){return c()},set expandValue(x=[]){c(x),y()},get placeholder(){return u()},set placeholder(x){u(x),y()}})}Gr(["click"]),ce(hn,{items:{},onSelect:{},value:{},defaultValue:{},expandAll:{},multiple:{},expandValue:{},placeholder:{}},[],[],!0);const ai=Math.min,vo=Math.max,_s=Math.round,In=e=>({x:e,y:e}),Xm={left:"right",right:"left",bottom:"top",top:"bottom"},Zm={start:"end",end:"start"};function nl(e,t,n){return vo(e,ai(t,n))}function li(e,t){return typeof e=="function"?e(t):e}function Lr(e){return e.split("-")[0]}function ui(e){return e.split("-")[1]}function Jd(e){return e==="x"?"y":"x"}function rl(e){return e==="y"?"height":"width"}const Km=new Set(["top","bottom"]);function dr(e){return Km.has(Lr(e))?"y":"x"}function ol(e){return Jd(dr(e))}function jm(e,t,n){n===void 0&&(n=!1);const r=ui(e),o=ol(e),i=rl(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=bs(s)),[s,bs(s)]}function Um(e){const t=bs(e);return[il(e),t,il(t)]}function il(e){return e.replace(/start|end/g,t=>Zm[t])}const Qd=["left","right"],ef=["right","left"],Gm=["top","bottom"],Jm=["bottom","top"];function Qm(e,t,n){switch(e){case"top":case"bottom":return n?t?ef:Qd:t?Qd:ef;case"left":case"right":return t?Gm:Jm;default:return[]}}function ey(e,t,n,r){const o=ui(e);let i=Qm(Lr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(il)))),i}function bs(e){return e.replace(/left|right|bottom|top/g,t=>Xm[t])}function ty(e){return{top:0,right:0,bottom:0,left:0,...e}}function tf(e){return typeof e!="number"?ty(e):{top:e,right:e,bottom:e,left:e}}function xs(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function nf(e,t,n){let{reference:r,floating:o}=e;const i=dr(t),s=ol(t),a=rl(s),l=Lr(t),c=i==="y",u=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:g};break;case"left":h={x:r.x-o.width,y:g};break;default:h={x:r.x,y:r.y}}switch(ui(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}const ny=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:g}=nf(c,r,l),f=r,h={},v=0;for(let b=0;b<a.length;b++){const{name:C,fn:x}=a[b],{x:p,y:_,data:m,reset:k}=await x({x:u,y:g,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=p??u,g=_??g,h={...h,[C]:{...h[C],...m}},k&&v<=50&&(v++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(c=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:u,y:g}=nf(c,f,l)),b=-1)}return{x:u,y:g,placement:f,strategy:o,middlewareData:h}};async function rf(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:g="floating",altBoundary:f=!1,padding:h=0}=li(t,e),v=tf(h),C=a[f?g==="floating"?"reference":"floating":g],x=xs(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(C)))==null||n?C:C.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),p=g==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),m=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},k=xs(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:_,strategy:l}):p);return{top:(x.top-k.top+v.top)/m.y,bottom:(k.bottom-x.bottom+v.bottom)/m.y,left:(x.left-k.left+v.left)/m.x,right:(k.right-x.right+v.right)/m.x}}const ry=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=li(e,t)||{};if(c==null)return{};const g=tf(u),f={x:n,y:r},h=ol(o),v=rl(h),b=await s.getDimensions(c),C=h==="y",x=C?"top":"left",p=C?"bottom":"right",_=C?"clientHeight":"clientWidth",m=i.reference[v]+i.reference[h]-f[h]-i.floating[v],k=f[h]-i.reference[h],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let P=N?N[_]:0;(!P||!await(s.isElement==null?void 0:s.isElement(N)))&&(P=a.floating[_]||i.floating[v]);const O=m/2-k/2,L=P/2-b[v]/2-1,V=ai(g[x],L),A=ai(g[p],L),I=V,R=P-b[v]-A,E=P/2-b[v]/2+O,$=nl(I,E,R),S=!l.arrow&&ui(o)!=null&&E!==$&&i.reference[v]/2-(E<I?V:A)-b[v]/2<0,T=S?E<I?E-I:E-R:0;return{[h]:f[h]+T,data:{[h]:$,centerOffset:E-$-T,...S&&{alignmentOffset:T}},reset:S}}}),oy=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:g=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...C}=li(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Lr(o),p=dr(a),_=Lr(a)===a,m=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=f||(_||!b?[bs(a)]:Um(a)),N=v!=="none";!f&&N&&k.push(...ey(a,b,v,m));const P=[a,...k],O=await rf(t,C),L=[];let V=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&L.push(O[x]),g){const E=jm(o,s,m);L.push(O[E[0]],O[E[1]])}if(V=[...V,{placement:o,overflows:L}],!L.every(E=>E<=0)){var A,I;const E=(((A=i.flip)==null?void 0:A.index)||0)+1,$=P[E];if($&&(!(g==="alignment"?p!==dr($):!1)||V.every(M=>M.overflows[0]>0&&dr(M.placement)===p)))return{data:{index:E,overflows:V},reset:{placement:$}};let S=(I=V.filter(T=>T.overflows[0]<=0).sort((T,M)=>T.overflows[1]-M.overflows[1])[0])==null?void 0:I.placement;if(!S)switch(h){case"bestFit":{var R;const T=(R=V.filter(M=>{if(N){const H=dr(M.placement);return H===p||H==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(H=>H>0).reduce((H,z)=>H+z,0)]).sort((M,H)=>M[1]-H[1])[0])==null?void 0:R[0];T&&(S=T);break}case"initialPlacement":S=a;break}if(o!==S)return{reset:{placement:S}}}return{}}}},iy=new Set(["left","top"]);async function sy(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Lr(n),a=ui(n),l=dr(n)==="y",c=iy.has(s)?-1:1,u=i&&l?-1:1,g=li(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return a&&typeof v=="number"&&(h=a==="end"?v*-1:v),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const ay=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await sy(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},ly=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:C=>{let{x,y:p}=C;return{x,y:p}}},...l}=li(e,t),c={x:n,y:r},u=await rf(t,l),g=dr(Lr(o)),f=Jd(g);let h=c[f],v=c[g];if(i){const C=f==="y"?"top":"left",x=f==="y"?"bottom":"right",p=h+u[C],_=h-u[x];h=nl(p,h,_)}if(s){const C=g==="y"?"top":"left",x=g==="y"?"bottom":"right",p=v+u[C],_=v-u[x];v=nl(p,v,_)}const b=a.fn({...t,[f]:h,[g]:v});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[f]:i,[g]:s}}}}}};function Cs(){return typeof window<"u"}function po(e){return of(e)?(e.nodeName||"").toLowerCase():"#document"}function rn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Un(e){var t;return(t=(of(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function of(e){return Cs()?e instanceof Node||e instanceof rn(e).Node:!1}function Cn(e){return Cs()?e instanceof Element||e instanceof rn(e).Element:!1}function zn(e){return Cs()?e instanceof HTMLElement||e instanceof rn(e).HTMLElement:!1}function sf(e){return!Cs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof rn(e).ShadowRoot}const uy=new Set(["inline","contents"]);function ci(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$n(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!uy.has(o)}const cy=new Set(["table","td","th"]);function dy(e){return cy.has(po(e))}const fy=[":popover-open",":modal"];function $s(e){return fy.some(t=>{try{return e.matches(t)}catch{return!1}})}const gy=["transform","translate","scale","rotate","perspective"],hy=["transform","translate","scale","rotate","perspective","filter"],vy=["paint","layout","strict","content"];function sl(e){const t=al(),n=Cn(e)?$n(e):e;return gy.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||hy.some(r=>(n.willChange||"").includes(r))||vy.some(r=>(n.contain||"").includes(r))}function py(e){let t=fr(e);for(;zn(t)&&!mo(t);){if(sl(t))return t;if($s(t))return null;t=fr(t)}return null}function al(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const my=new Set(["html","body","#document"]);function mo(e){return my.has(po(e))}function $n(e){return rn(e).getComputedStyle(e)}function Es(e){return Cn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fr(e){if(po(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sf(e)&&e.host||Un(e);return sf(t)?t.host:t}function af(e){const t=fr(e);return mo(t)?e.ownerDocument?e.ownerDocument.body:e.body:zn(t)&&ci(t)?t:af(t)}function lf(e,t,n){var r;t===void 0&&(t=[]);const o=af(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=rn(o);return i?(ll(s),t.concat(s,s.visualViewport||[],ci(o)?o:[],[])):t.concat(o,lf(o,[]))}function ll(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uf(e){const t=$n(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=zn(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=_s(n)!==i||_s(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function cf(e){return Cn(e)?e:e.contextElement}function yo(e){const t=cf(e);if(!zn(t))return In(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=uf(t);let s=(i?_s(n.width):n.width)/r,a=(i?_s(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const yy=In(0);function df(e){const t=rn(e);return!al()||!t.visualViewport?yy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==rn(e)?!1:t}function di(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=cf(e);let s=In(1);t&&(r?Cn(r)&&(s=yo(r)):s=yo(e));const a=wy(i,n,r)?df(i):In(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,g=o.height/s.y;if(i){const f=rn(i),h=r&&Cn(r)?rn(r):r;let v=f,b=ll(v);for(;b&&r&&h!==v;){const C=yo(b),x=b.getBoundingClientRect(),p=$n(b),_=x.left+(b.clientLeft+parseFloat(p.paddingLeft))*C.x,m=x.top+(b.clientTop+parseFloat(p.paddingTop))*C.y;l*=C.x,c*=C.y,u*=C.x,g*=C.y,l+=_,c+=m,v=rn(b),b=ll(v)}}return xs({width:u,height:g,x:l,y:c})}function ul(e,t){const n=Es(e).scrollLeft;return t?t.left+n:di(Un(e)).left+n}function ff(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:ul(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function _y(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Un(r),a=t?$s(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=In(1);const u=In(0),g=zn(r);if((g||!g&&!i)&&((po(r)!=="body"||ci(s))&&(l=Es(r)),zn(r))){const h=di(r);c=yo(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=s&&!g&&!i?ff(s,l,!0):In(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function by(e){return Array.from(e.getClientRects())}function xy(e){const t=Un(e),n=Es(e),r=e.ownerDocument.body,o=vo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=vo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ul(e);const a=-n.scrollTop;return $n(r).direction==="rtl"&&(s+=vo(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Cy(e,t){const n=rn(e),r=Un(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=al();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}const $y=new Set(["absolute","fixed"]);function Ey(e,t){const n=di(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=zn(e)?yo(e):In(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function gf(e,t,n){let r;if(t==="viewport")r=Cy(e,n);else if(t==="document")r=xy(Un(e));else if(Cn(t))r=Ey(t,n);else{const o=df(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return xs(r)}function hf(e,t){const n=fr(e);return n===t||!Cn(n)||mo(n)?!1:$n(n).position==="fixed"||hf(n,t)}function ky(e,t){const n=t.get(e);if(n)return n;let r=lf(e,[]).filter(a=>Cn(a)&&po(a)!=="body"),o=null;const i=$n(e).position==="fixed";let s=i?fr(e):e;for(;Cn(s)&&!mo(s);){const a=$n(s),l=sl(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&$y.has(o.position)||ci(s)&&!l&&hf(e,s))?r=r.filter(u=>u!==s):o=a,s=fr(s)}return t.set(e,r),r}function Sy(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?$s(t)?[]:ky(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const g=gf(t,u,o);return c.top=vo(g.top,c.top),c.right=ai(g.right,c.right),c.bottom=ai(g.bottom,c.bottom),c.left=vo(g.left,c.left),c},gf(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Py(e){const{width:t,height:n}=uf(e);return{width:t,height:n}}function Ny(e,t,n){const r=zn(t),o=Un(t),i=n==="fixed",s=di(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=In(0);function c(){l.x=ul(o)}if(r||!r&&!i)if((po(t)!=="body"||ci(o))&&(a=Es(t)),r){const h=di(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?ff(o,a):In(0),g=s.left+a.scrollLeft-l.x-u.x,f=s.top+a.scrollTop-l.y-u.y;return{x:g,y:f,width:s.width,height:s.height}}function cl(e){return $n(e).position==="static"}function vf(e,t){if(!zn(e)||$n(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Un(e)===n&&(n=n.ownerDocument.body),n}function pf(e,t){const n=rn(e);if($s(e))return n;if(!zn(e)){let o=fr(e);for(;o&&!mo(o);){if(Cn(o)&&!cl(o))return o;o=fr(o)}return n}let r=vf(e,t);for(;r&&dy(r)&&cl(r);)r=vf(r,t);return r&&mo(r)&&cl(r)&&!sl(r)?n:r||py(e)||n}const Ty=async function(e){const t=this.getOffsetParent||pf,n=this.getDimensions,r=await n(e.floating);return{reference:Ny(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function My(e){return $n(e).direction==="rtl"}const Hy={convertOffsetParentRelativeRectToViewportRelativeRect:_y,getDocumentElement:Un,getClippingRect:Sy,getOffsetParent:pf,getElementRects:Ty,getClientRects:by,getDimensions:Py,getScale:yo,isElement:Cn,isRTL:My},Dy=ay,Vy=ly,Oy=oy,Ay=ry,Ly=(e,t,n)=>{const r=new Map,o={platform:Hy,...n},i={...o.platform,_c:r};return ny(e,t,{...o,platform:i})},Iy=({trigger:e,triggerEvent:t,floatContent:n,placement:r="bottom",offsetOptions:o,flipOptions:i,shiftOptions:s,interactive:a,showArrow:l})=>{if(typeof e=="string"){const x=document.querySelector(e);if(x)e=x;else throw new Error("element not found by document.querySelector('"+e+"')")}let c;if(typeof n=="string"){const x=document.querySelector(n);if(x)c=x;else throw new Error("element not found by document.querySelector('"+n+"')")}else c=n;let u;l&&(u=document.createElement("div"),u.style.position="absolute",u.style.backgroundColor="#222",u.style.width="8px",u.style.height="8px",u.style.transform="rotate(45deg)",u.style.display="none",c.firstElementChild.before(u));function g(){Ly(e,c,{placement:r,middleware:[Dy(o),Oy(i),Vy(s),...l?[Ay({element:u})]:[]]}).then(({x,y:p,placement:_,middlewareData:m})=>{if(Object.assign(c.style,{left:`${x}px`,top:`${p}px`}),l){const{x:k,y:N}=m.arrow,P={top:"bottom",right:"left",bottom:"top",left:"right"}[_.split("-")[0]];Object.assign(u.style,{zIndex:-1,left:k!=null?`${k}px`:"",top:N!=null?`${N}px`:"",right:"",bottom:"",[P]:"2px"})}})}let f=!1;function h(){c.style.display="block",c.style.visibility="block",c.style.position="absolute",l&&(u.style.display="block"),f=!0,g()}function v(){c.style.display="none",l&&(u.style.display="none"),f=!1}function b(x){x.stopPropagation(),f?v():h()}function C(x){c.contains(x.target)||v()}return(!t||t.length==0)&&(t=["click"]),t.forEach(x=>{e.addEventListener(x,b)}),document.addEventListener("click",C),{destroy(){t.forEach(x=>{e.removeEventListener(x,b)}),document.removeEventListener("click",C)},hide(){v()},isVisible(){return f}}};var zy=ie('<div style="position: relative"><div><!></div> <div style="display: none; width: 100%;z-index: 9999"><!></div></div>');function wo(e,t){fe(t,!0);const n=w(t,"children",7),r=w(t,"floating",7),o=w(t,"placement",7,"bottom");let i,s,a;dn(()=>(a=Iy({trigger:i,floatContent:s,interactive:!0,placement:o()}),()=>{a.destroy()}));function l(){a.hide()}var c=zy(),u=W(c),g=W(u);Pr(g,n),Y(u),Vn(u,v=>i=v,()=>i);var f=B(u,2),h=W(f);return Pr(h,r),Y(f),Vn(f,v=>s=v,()=>s),Y(c),D(e,c),ge({hide:l,get children(){return n()},set children(v){n(v),y()},get floating(){return r()},set floating(v){r(v),y()},get placement(){return o()},set placement(v="bottom"){o(v),y()}})}ce(wo,{children:{},floating:{},placement:{}},[],["hide"],!0);function it(e,t){fe(t,!0);const n=w(t,"children",7),r=w(t,"level",7,1),o=w(t,"mt",7),i=w(t,"mb",7);var s=Ze(),a=he(s);return pg(a,()=>`h${r()}`,!1,(l,c)=>{tn(l,()=>({class:"tf-heading",style:`margin-top:${o()||"0"};margin-bottom:${i()||"0"}`}));var u=Ze(),g=he(u);Pr(g,()=>n()??wt),D(c,u)}),D(e,s),ge({get children(){return n()},set children(l){n(l),y()},get level(){return r()},set level(l=1){r(l),y()},get mt(){return o()},set mt(l){o(l),y()},get mb(){return i()},set mb(l){i(l),y()}})}ce(it,{children:{},level:{},mt:{},mb:{}},[],[],!0);var Ry=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-1rvn4a8"><path d="M4.5 10.5C3.675 10.5 3 11.175 3 12C3 12.825 3.675 13.5 4.5 13.5C5.325 13.5 6 12.825 6 12C6 11.175 5.325 10.5 4.5 10.5ZM19.5 10.5C18.675 10.5 18 11.175 18 12C18 12.825 18.675 13.5 19.5 13.5C20.325 13.5 21 12.825 21 12C21 11.175 20.325 10.5 19.5 10.5ZM12 10.5C11.175 10.5 10.5 11.175 10.5 12C10.5 12.825 11.175 13.5 12 13.5C12.825 13.5 13.5 12.825 13.5 12C13.5 11.175 12.825 10.5 12 10.5Z" class="svelte-1rvn4a8"></path></svg>');const By={hash:"svelte-1rvn4a8",code:".input-btn-more {border:1px solid transparent;padding:3px;&:hover {background:#eee;border:1px solid transparent;}}"};function ks(e,t){fe(t,!0),at(e,By);const n=Nt(t,["$$slots","$$events","$$legacy","$$host"]);Je(e,ht(()=>n,{get class(){return`input-btn-more ${t.class??""}`},children:(r,o)=>{var i=Ry();D(r,i)},$$slots:{default:!0}})),ge()}ce(ks,{},[],[],!0);const qy=()=>{const e=et();return{deleteNode:n=>{e.nodes.update(r=>r.filter(o=>o.id!==n)),e.edges.update(r=>r.filter(o=>o.source!==n&&o.target!==n))}}},Ir=(e=16)=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=new Uint8Array(e);return crypto.getRandomValues(n),Array.from(n,r=>t[r%t.length]).join("")},Yy=()=>{const{nodes:e,nodeLookup:t}=et();return{copyNode:r=>{var s;const i=(s=J(t).get(r))==null?void 0:s.internals.userNode;if(i){const a=Ir(),l={...i,id:a,position:{x:i.position.x+50,y:i.position.y+50}};e.update(c=>[...c,l]),e.update(c=>c.map(u=>u.id===a?{...u,selected:!0}:{...u,selected:!1}))}}}},gr=()=>Cr("tinyflow_options");function $t(){return Cr("svelteflow__node_id")}var Fy=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"></path></svg>'),Wy=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z"></path></svg>'),Xy=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M8 18.3915V5.60846L18.2264 12L8 18.3915ZM6 3.80421V20.1957C6 20.9812 6.86395 21.46 7.53 21.0437L20.6432 12.848C21.2699 12.4563 21.2699 11.5436 20.6432 11.152L7.53 2.95621C6.86395 2.53993 6 3.01878 6 3.80421Z"></path></svg>'),Zy=ie('<div class="input-item svelte-1jesvb7">执行条件: <!></div>'),Ky=(e,t,n)=>{const r=e.target.checked;t(n,{async:r})},jy=ie('<div class="settings svelte-1jesvb7"><div class="input-item svelte-1jesvb7">节点名称: <!></div> <div class="input-item svelte-1jesvb7">参数描述: <!></div> <!> <label class="input-item-inline svelte-1jesvb7"><span>异步执行:</span> <input type="checkbox"/></label></div>'),Uy=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3.33946 17.0002C2.90721 16.2515 2.58277 15.4702 2.36133 14.6741C3.3338 14.1779 3.99972 13.1668 3.99972 12.0002C3.99972 10.8345 3.3348 9.824 2.36353 9.32741C2.81025 7.71651 3.65857 6.21627 4.86474 4.99001C5.7807 5.58416 6.98935 5.65534 7.99972 5.072C9.01009 4.48866 9.55277 3.40635 9.4962 2.31604C11.1613 1.8846 12.8847 1.90004 14.5031 2.31862C14.4475 3.40806 14.9901 4.48912 15.9997 5.072C17.0101 5.65532 18.2187 5.58416 19.1346 4.99007C19.7133 5.57986 20.2277 6.25151 20.66 7.00021C21.0922 7.7489 21.4167 8.53025 21.6381 9.32628C20.6656 9.82247 19.9997 10.8336 19.9997 12.0002C19.9997 13.166 20.6646 14.1764 21.6359 14.673C21.1892 16.2839 20.3409 17.7841 19.1347 19.0104C18.2187 18.4163 17.0101 18.3451 15.9997 18.9284C14.9893 19.5117 14.4467 20.5941 14.5032 21.6844C12.8382 22.1158 11.1148 22.1004 9.49633 21.6818C9.55191 20.5923 9.00929 19.5113 7.99972 18.9284C6.98938 18.3451 5.78079 18.4162 4.86484 19.0103C4.28617 18.4205 3.77172 17.7489 3.33946 17.0002ZM8.99972 17.1964C10.0911 17.8265 10.8749 18.8227 11.2503 19.9659C11.7486 20.0133 12.2502 20.014 12.7486 19.9675C13.1238 18.8237 13.9078 17.8268 14.9997 17.1964C16.0916 16.5659 17.347 16.3855 18.5252 16.6324C18.8146 16.224 19.0648 15.7892 19.2729 15.334C18.4706 14.4373 17.9997 13.2604 17.9997 12.0002C17.9997 10.74 18.4706 9.5632 19.2729 8.6665C19.1688 8.4405 19.0538 8.21822 18.9279 8.00021C18.802 7.78219 18.667 7.57148 18.5233 7.36842C17.3457 7.61476 16.0911 7.43414 14.9997 6.80405C13.9083 6.17395 13.1246 5.17768 12.7491 4.03455C12.2509 3.98714 11.7492 3.98646 11.2509 4.03292C10.8756 5.17671 10.0916 6.17364 8.99972 6.80405C7.9078 7.43447 6.65245 7.61494 5.47428 7.36803C5.18485 7.77641 4.93463 8.21117 4.72656 8.66637C5.52881 9.56311 5.99972 10.74 5.99972 12.0002C5.99972 13.2604 5.52883 14.4372 4.72656 15.3339C4.83067 15.5599 4.94564 15.7822 5.07152 16.0002C5.19739 16.2182 5.3324 16.4289 5.47612 16.632C6.65377 16.3857 7.90838 16.5663 8.99972 17.1964ZM11.9997 15.0002C10.3429 15.0002 8.99972 13.6571 8.99972 12.0002C8.99972 10.3434 10.3429 9.00021 11.9997 9.00021C13.6566 9.00021 14.9997 10.3434 14.9997 12.0002C14.9997 13.6571 13.6566 15.0002 11.9997 15.0002ZM11.9997 13.0002C12.552 13.0002 12.9997 12.5525 12.9997 12.0002C12.9997 11.4479 12.552 11.0002 11.9997 11.0002C11.4474 11.0002 10.9997 11.4479 10.9997 12.0002C10.9997 12.5525 11.4474 13.0002 11.9997 13.0002Z"></path></svg>'),Gy=ie('<div class="tf-node-toolbar svelte-1jesvb7"><!> <!> <!> <!></div>'),Jy=ie('<!> <div class="tf-node-wrapper"><div class="tf-node-wrapper-title">iTerms.ai</div> <div class="tf-node-wrapper-body"><!></div></div> <!> <!> <!>',1);const Qy={hash:"svelte-1jesvb7",code:".tf-node-toolbar.svelte-1jesvb7 {display:flex;gap:5px;padding:5px;border-radius:5px;background:#fff;border:1px solid #eee;box-shadow:0 0 5px rgba(0, 0, 0, 0.1);}.tf-node-toolbar-item {border:1px solid transparent;}.settings.svelte-1jesvb7 {display:flex;flex-direction:column;gap:10px;padding:10px;background:#fff;border:1px solid #ddd;border-radius:5px;width:200px;box-shadow:0 0 10px 2px rgba(0, 0, 0, 0.1);}.settings.svelte-1jesvb7 .input-item:where(.svelte-1jesvb7) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:#666;}.settings.svelte-1jesvb7 .input-item-inline:where(.svelte-1jesvb7) {display:flex;align-items:center;font-size:12px;color:#666;}"};function En(e,t){fe(t,!0),at(e,Qy);const n=w(t,"data",7),r=w(t,"id",7,""),o=w(t,"icon",7),i=w(t,"handle",7),s=w(t,"children",7),a=w(t,"allowExecute",7,!0),l=w(t,"allowCopy",7,!0),c=w(t,"allowDelete",7,!0),u=w(t,"allowSetting",7,!0),g=w(t,"allowSettingOfCondition",7,!0),f=w(t,"showSourceHandle",7,!0),h=w(t,"showTargetHandle",7,!0),v=w(t,"onCollapse",7);let b=n().expand?["key"]:[];const{updateNodeData:C,getNode:x}=jt(),p=Ee(()=>[{key:"key",icon:o(),title:n().title,description:n().description,content:s()}]),{deleteNode:_}=qy(),{copyNode:m}=Yy(),k=gr(),N=()=>{var H;(H=k.onNodeExecute)==null||H.call(k,x(r()))};let P=$t();var O=Jy(),L=he(O);{var V=H=>{Xd(H,{get position(){return Se.Top},align:"end",children:(z,j)=>{var Z=Gy(),ee=W(Z);{var re=le=>{Je(le,{class:"tf-node-toolbar-item",onclick:()=>{_(r())},children:(pe,se)=>{var U=Fy();D(pe,U)},$$slots:{default:!0}})};me(ee,le=>{c()&&le(re)})}var Q=B(ee,2);{var de=le=>{Je(le,{class:"tf-node-toolbar-item",onclick:()=>{m(r())},children:(pe,se)=>{var U=Wy();D(pe,U)},$$slots:{default:!0}})};me(Q,le=>{l()&&le(de)})}var ne=B(Q,2);{var _e=le=>{Je(le,{class:"tf-node-toolbar-item",onclick:N,children:(pe,se)=>{var U=Xy();D(pe,U)},$$slots:{default:!0}})};me(ne,le=>{a()&&le(_e)})}var Ne=B(ne,2);{var Ve=le=>{wo(le,{placement:"bottom",floating:se=>{var U=jy(),ue=W(U),F=B(W(ue));Ct(F,{style:"width: 100%;",onchange:Ae=>{const Ue=Ae.target.value;C(P,{title:Ue})},get value(){return n().title}}),Y(ue);var we=B(ue,2),Pe=B(W(we));Tt(Pe,{rows:3,style:"width: 100%;",onchange:Ae=>{const Ue=Ae.target.value;C(P,{description:Ue})},get value(){return n().description}}),Y(we);var Oe=B(we,2);{var Be=Ae=>{var Ue=Zy(),gt=B(W(Ue));Tt(gt,{rows:2,style:"width: 100%;",onchange:K=>{const Ge=K.target.value;C(P,{condition:Ge})},get value(){return n().condition}}),Y(Ue),D(Ae,Ue)};me(Oe,Ae=>{g()&&Ae(Be)})}var Le=B(Oe,2),ye=B(W(Le),2);ir(ye),ye.__change=[Ky,C,P],Y(Le),Y(U),De(()=>xg(ye,!!n().async)),D(se,U)},children:(se,U)=>{Je(se,{class:"tf-node-toolbar-item",children:(ue,F)=>{var we=Uy();D(ue,we)},$$slots:{default:!0}})},$$slots:{floating:!0,default:!0}})};me(Ne,le=>{u()&&le(Ve)})}Y(Z),D(z,Z)},$$slots:{default:!0}})};me(L,H=>{(a()||l()||c())&&H(V)})}var A=B(L,2),I=B(W(A),2),R=W(I);Gd(R,{get items(){return d(p)},get activeKeys(){return b},onChange:(H,z)=>{var j;C(r(),{expand:z==null?void 0:z.includes("key")}),(j=v())==null||j(z!=null&&z.includes("key")?"key":"")}}),Y(I),Y(A);var E=B(A,2);{var $=H=>{lr(H,{type:"target",get position(){return Se.Left},style:" left: -12px;top: 20px"})};me(E,H=>{h()&&H($)})}var S=B(E,2);{var T=H=>{lr(H,{type:"source",get position(){return Se.Right},style:"right: -12px;top: 20px"})};me(S,H=>{f()&&H(T)})}var M=B(S,2);return Pr(M,()=>i()??wt),D(e,O),ge({get data(){return n()},set data(H){n(H),y()},get id(){return r()},set id(H=""){r(H),y()},get icon(){return o()},set icon(H){o(H),y()},get handle(){return i()},set handle(H){i(H),y()},get children(){return s()},set children(H){s(H),y()},get allowExecute(){return a()},set allowExecute(H=!0){a(H),y()},get allowCopy(){return l()},set allowCopy(H=!0){l(H),y()},get allowDelete(){return c()},set allowDelete(H=!0){c(H),y()},get allowSetting(){return u()},set allowSetting(H=!0){u(H),y()},get allowSettingOfCondition(){return g()},set allowSettingOfCondition(H=!0){g(H),y()},get showSourceHandle(){return f()},set showSourceHandle(H=!0){f(H),y()},get showTargetHandle(){return h()},set showTargetHandle(H=!0){h(H),y()},get onCollapse(){return v()},set onCollapse(H){v(H),y()}})}Gr(["change"]),ce(En,{data:{},id:{},icon:{},handle:{},children:{},allowExecute:{},allowCopy:{},allowDelete:{},allowSetting:{},allowSettingOfCondition:{},showSourceHandle:{},showTargetHandle:{},onCollapse:{}},[],[],!0);const mf=[{value:"String",label:"String"},{value:"Number",label:"Number"},{value:"Boolean",label:"Boolean"},{value:"File",label:"File"},{value:"Object",label:"Object"},{value:"Array",label:"Array"}],ew=[{value:"ref",label:"引用"},{value:"fixed",label:"固定值"}];var tw=ie('<div class="input-more-setting svelte-laou7w"><div class="input-more-item svelte-laou7w">参数类型: <!></div> <div class="input-more-item svelte-laou7w">默认值: <!></div> <div class="input-more-item svelte-laou7w">参数描述: <!></div> <div class="input-more-item svelte-laou7w"><!></div></div>'),nw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4.5 10.5C3.675 10.5 3 11.175 3 12C3 12.825 3.675 13.5 4.5 13.5C5.325 13.5 6 12.825 6 12C6 11.175 5.325 10.5 4.5 10.5ZM19.5 10.5C18.675 10.5 18 11.175 18 12C18 12.825 18.675 13.5 19.5 13.5C20.325 13.5 21 12.825 21 12C21 11.175 20.325 10.5 19.5 10.5ZM12 10.5C11.175 10.5 10.5 11.175 10.5 12C10.5 12.825 11.175 13.5 12 13.5C12.825 13.5 13.5 12.825 13.5 12C13.5 11.175 12.825 10.5 12 10.5Z"></path></svg>'),rw=ie('<div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div>',1);const ow={hash:"svelte-laou7w",code:".input-item.svelte-laou7w {display:flex;align-items:center;}.input-more-setting.svelte-laou7w {display:flex;flex-direction:column;gap:10px;padding:10px;background:#fff;border:1px solid #ddd;border-radius:5px;width:200px;box-shadow:0 0 10px 2px rgba(0, 0, 0, 0.1);}.input-more-setting.svelte-laou7w .input-more-item:where(.svelte-laou7w) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:#666;}"};function yf(e,t){fe(t,!0),at(e,ow);const[n,r]=ct(),o=()=>oe(d(l),"$node",n),i=w(t,"parameter",7),s=w(t,"index",7);let a=$t(),l=Ee(()=>Ar(a)),c=Ee(()=>{var L,V;return{...i(),...(V=(L=o())==null?void 0:L.data)==null?void 0:V.parameters[s()]}});const{updateNodeData:u}=jt(),g=(L,V)=>{u(a,A=>{let I=A.data.parameters;return I[s()][L]=V,{parameters:I}})},f=L=>{const V=L.target.value;g("name",V)},h=L=>{const V=L.target.checked;g("required",V)},v=L=>{const V=L.value;V&&g("dataType",V)};let b;const C=()=>{u(a,L=>{let V=L.data.parameters;return V.splice(s(),1),{parameters:[...V]}}),b==null||b.hide()};var x=rw(),p=he(x),_=W(p);Ct(_,{style:"width: 100%;",get value(){return d(c).name},placeholder:"请输入参数名称",oninput:f}),Y(p);var m=B(p,2),k=W(m);Kd(k,{get checked(){return d(c).required},onchange:h}),Y(m);var N=B(m,2),P=W(N);Vn(wo(P,{placement:"bottom",floating:V=>{var A=tw(),I=W(A),R=B(W(I));{let z=Ee(()=>d(c).dataType?[d(c).dataType]:["String"]);hn(R,{get items(){return mf},style:"width: 100%",onSelect:v,get value(){return d(z)}})}Y(I);var E=B(I,2),$=B(W(E));Tt($,{rows:1,style:"width: 100%;",get value(){return d(c).defaultValue},onchange:z=>{const j=z.target.value;g("defaultValue",j)}}),Y(E);var S=B(E,2),T=B(W(S));Tt(T,{rows:3,style:"width: 100%;",get value(){return d(c).description},onchange:z=>{const j=z.target.value;g("description",j)}}),Y(S);var M=B(S,2),H=W(M);Je(H,{onclick:C,children:(z,j)=>{Te();var Z=Re("删除");D(z,Z)},$$slots:{default:!0}}),Y(M),Y(A),D(V,A)},children:(V,A)=>{Je(V,{class:"input-btn-more",children:(I,R)=>{var E=nw();D(I,E)},$$slots:{default:!0}})},$$slots:{floating:!0,default:!0}}),V=>b=V,()=>b),Y(N),D(e,x);var O=ge({get parameter(){return i()},set parameter(L){i(L),y()},get index(){return s()},set index(L){s(L),y()}});return r(),O}ce(yf,{parameter:{},index:{}},[],[],!0);var iw=ie('<div class="input-header svelte-3n0wca">参数名称</div> <div class="input-header svelte-3n0wca">必填</div> <div class="input-header svelte-3n0wca"></div>',1),sw=ie('<div class="none-params svelte-3n0wca">无输入参数</div>'),aw=ie('<div class="input-container svelte-3n0wca"><!> <!></div>');const lw={hash:"svelte-3n0wca",code:`.input-container.svelte-3n0wca {display:grid;grid-template-columns:80% 10% 10%;row-gap:5px;column-gap:3px;}.input-container.svelte-3n0wca .none-params:where(.svelte-3n0wca) {font-size:12px;background:#f8f8f8;height:40px;display:flex;justify-content:center;align-items:center;border-radius:5px;width:calc(100% - 5px);grid-column:1 / -1;
5
+ /* 从第一列开始到最后一列结束 */}.input-container.svelte-3n0wca .input-header:where(.svelte-3n0wca) {font-size:12px;color:#666;}`};function wf(e,t){fe(t,!0),at(e,lw);const[n,r]=ct(),o=()=>oe(d(s),"$node",n);let i=$t(),s=Ee(()=>Ar(i)),a=Ee(()=>{var f,h;return[...((h=(f=o())==null?void 0:f.data)==null?void 0:h.parameters)||[]]});var l=aw(),c=W(l);{var u=f=>{var h=iw();Te(4),D(f,h)};me(c,f=>{d(a).length!==0&&f(u)})}var g=B(c,2);Yt(g,19,()=>d(a),f=>f.id,(f,h,v)=>{yf(f,{get parameter(){return d(h)},get index(){return d(v)}})},f=>{var h=sw();D(f,h)}),Y(l),D(e,l),ge(),r()}ce(wf,{},[],[],!0);const Ss=e=>(!e||e.length==0||e.forEach(t=>{t.id||(t.id=Ir()),Ss(t.children)}),e),Rn=()=>{const{updateNodeData:e}=jt();return{addParameter:(t,n="parameters",r)=>{Ss(r==null?void 0:r.children);const o={name:"",dataType:"String",refType:"ref",...r,id:Ir()};e(t,i=>{let s=i.data[n];return s?s.push(o):s=[o],{[n]:[...s]}})}}};var uw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12C15 13.6569 13.6569 15 12 15Z"></path></svg>'),cw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),dw=ie('<div class="heading svelte-r5g35l"><!> <!></div> <!>',1);const fw={hash:"svelte-r5g35l",code:".heading.svelte-r5g35l {display:flex;margin-bottom:10px;}.input-btn-more {border:1px solid transparent;padding:3px;}.input-btn-more:hover {background:#eee;border:1px solid transparent;}"};function _f(e,t){fe(t,!0),at(e,fw);const n=w(t,"data",7),r=Nt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn();return En(e,ht(()=>r,{get data(){return n()},allowExecute:!1,showTargetHandle:!1,allowSettingOfCondition:!1,icon:a=>{var l=uw();D(a,l)},children:(a,l)=>{var c=dw(),u=he(c),g=W(u);it(g,{level:3,children:(v,b)=>{Te();var C=Re("输入参数");D(v,C)},$$slots:{default:!0}});var f=B(g,2);Je(f,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"parameters",{refType:"input"})},children:(v,b)=>{var C=cw();D(v,C)},$$slots:{default:!0}}),Y(u);var h=B(u,2);wf(h,{}),D(a,c)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(s){n(s),y()}})}ce(_f,{data:{}},[],[],!0);const bf=(e,t,n)=>{for(const r of n)r.target===t&&r.source&&(e.push(r.source),bf(e,r.source,n))},xf=(e,t,n)=>!e||e.length===0?[]:e.map(r=>({label:r.name+(n?` (Array<${r.dataType||"String"}>)`:` (${r.dataType||"String"})`),value:t+"."+r.name,children:xf(r.children,t+"."+r.name,n)})),Cf=(e,t,n)=>{if(e.type==="startNode"){const r=e.data.parameters,o=[];if(r)for(const i of r)o.push({label:i.name+(t?` (Array<${i.dataType||"String"}>)`:` (${i.dataType||"String"})`),value:e.id+"."+i.name});return{label:e.data.title,value:e.id,children:o}}else{if(e.type==="loopNode"&&n.parentId)return{label:e.data.title,value:e.id,children:[{label:"loopItem",value:e.id+".loopItem"},{label:"index (Number)",value:e.id+".index"}]};{const r=e.data.outputDefs;if(r)return{label:e.data.title,value:e.id,children:xf(r,e.id,t)}}}},gw=(e=!1)=>{const t=$t(),n=Ar(t),{nodes:r,edges:o,nodeLookup:i}=et();return sr([n,r,o,i],([s,a,l,c])=>{if(!s)return[];const u=c.get(t),g=[];if(e)for(const f of a){const h=f.parentId===s.id;if(h){const v=Cf(f,h,u);v&&g.push(v)}}else{const f=[];bf(f,t,l);for(const h of a)if(f.includes(h.id)){const v=h.parentId===s.id,b=Cf(h,v,u);b&&g.push(b)}}return g})};var hw=ie('<div class="input-more-setting svelte-laou7w"><div class="input-more-item svelte-laou7w">数据来源: <!></div> <div class="input-more-item svelte-laou7w">默认值: <!></div> <div class="input-more-item svelte-laou7w">参数描述: <!></div> <div class="input-more-item svelte-laou7w"><!></div></div>'),vw=ie('<div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div>',1);const pw={hash:"svelte-laou7w",code:".input-item.svelte-laou7w {display:flex;align-items:center;}.input-more-setting.svelte-laou7w {display:flex;flex-direction:column;gap:10px;padding:10px;background:#fff;border:1px solid #ddd;border-radius:5px;width:200px;box-shadow:0 0 10px 2px rgba(0, 0, 0, 0.1);}.input-more-setting.svelte-laou7w .input-more-item:where(.svelte-laou7w) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:#666;}"};function $f(e,t){fe(t,!0),at(e,pw);const[n,r]=ct(),o=()=>oe(d(g),"$node",n),i=()=>oe(m,"$selectItems",n);dn(()=>{d(f).refType||x({value:"ref"})});const s=w(t,"parameter",7),a=w(t,"index",7),l=w(t,"dataKeyName",7),c=w(t,"useChildrenOnly",7);let u=$t(),g=Ee(()=>Ar(u)),f=Ee(()=>{var $;return{...s(),...($=o())==null?void 0:$.data[l()][a()]}});const{updateNodeData:h}=jt(),v=($,S)=>{h(u,T=>{let M=T.data[l()];return M[a()]={...M[a()],[$]:S},{[l()]:M}})},b=($,S)=>{const T=S.target.value;v($,T)},C=$=>{const S=$.value;v("ref",S)},x=$=>{const S=$.value;v("refType",S)};let p;const _=()=>{h(u,$=>{let S=$.data[l()];return S.splice(a(),1),{[l()]:[...S]}}),p==null||p.hide()},m=gw(c());var k=vw(),N=he(k),P=W(N);{let $=Ee(()=>d(f).nameDisabled===!0);Ct(P,{style:"width: 100%;",get value(){return d(f).name},placeholder:"请输入参数名称",get disabled(){return d($)},oninput:S=>b("name",S)})}Y(N);var O=B(N,2),L=W(O);{var V=$=>{Ct($,{get value(){return d(f).value},placeholder:"请输入参数值",oninput:S=>b("value",S)})},A=$=>{var S=Ze(),T=he(S);{var M=H=>{{let z=Ee(()=>[d(f).ref]);hn(H,{get items(){return i()},style:"width: 100%",defaultValue:["ref"],get value(){return d(z)},expandAll:!0,onSelect:C})}};me(T,H=>{d(f).refType!=="input"&&H(M)},!0)}D($,S)};me(L,$=>{d(f).refType==="fixed"?$(V):$(A,!1)})}Y(O);var I=B(O,2),R=W(I);Vn(wo(R,{placement:"bottom",floating:S=>{var T=hw(),M=W(T),H=B(W(M));{let de=Ee(()=>d(f).refType?[d(f).refType]:[]);hn(H,{get items(){return ew},style:"width: 100%",defaultValue:["ref"],get value(){return d(de)},onSelect:x})}Y(M);var z=B(M,2),j=B(W(z));Tt(j,{rows:1,style:"width: 100%;",onchange:de=>{b("defaultValue",de)},get value(){return d(f).defaultValue}}),Y(z);var Z=B(z,2),ee=B(W(Z));Tt(ee,{rows:3,style:"width: 100%;",onchange:de=>{b("description",de)},get value(){return d(f).description}}),Y(Z);var re=B(Z,2),Q=W(re);Je(Q,{onclick:_,children:(de,ne)=>{Te();var _e=Re("删除");D(de,_e)},$$slots:{default:!0}}),Y(re),Y(T),D(S,T)},children:(S,T)=>{ks(S,{})},$$slots:{floating:!0,default:!0}}),S=>p=S,()=>p),Y(I),D(e,k);var E=ge({get parameter(){return s()},set parameter($){s($),y()},get index(){return a()},set index($){a($),y()},get dataKeyName(){return l()},set dataKeyName($){l($),y()},get useChildrenOnly(){return c()},set useChildrenOnly($){c($),y()}});return r(),E}ce($f,{parameter:{},index:{},dataKeyName:{},useChildrenOnly:{}},[],[],!0);var mw=ie('<div class="input-header svelte-1sm1mgi">参数名称</div> <div class="input-header svelte-1sm1mgi">参数值</div> <div class="input-header svelte-1sm1mgi"></div>',1),yw=ie('<div class="none-params svelte-1sm1mgi"> </div>'),ww=ie('<div class="input-container svelte-1sm1mgi"><!> <!></div>');const _w={hash:"svelte-1sm1mgi",code:`.input-container.svelte-1sm1mgi {display:grid;grid-template-columns:40% 50% 10%;row-gap:5px;column-gap:3px;}.input-container.svelte-1sm1mgi .none-params:where(.svelte-1sm1mgi) {font-size:12px;background:#f8f8f8;height:40px;display:flex;justify-content:center;align-items:center;border-radius:5px;width:calc(100% - 5px);grid-column:1 / -1;
6
+ /* 从第一列开始到最后一列结束 */}.input-container.svelte-1sm1mgi .input-header:where(.svelte-1sm1mgi) {font-size:12px;color:#666;}`};function Ut(e,t){fe(t,!0),at(e,_w);const[n,r]=ct(),o=()=>oe(d(c),"$node",n),i=w(t,"noneParameterText",7,"无输入参数"),s=w(t,"dataKeyName",7,"parameters"),a=w(t,"useChildrenOnly",7);let l=$t(),c=Ee(()=>Ar(l)),u=Ee(()=>{var C;return[...((C=o())==null?void 0:C.data[s()])||[]]});var g=ww(),f=W(g);{var h=C=>{var x=mw();Te(4),D(C,x)};me(f,C=>{d(u).length!==0&&C(h)})}var v=B(f,2);Yt(v,19,()=>d(u),C=>C.id,(C,x,p)=>{$f(C,{get parameter(){return d(x)},get index(){return d(p)},get dataKeyName(){return s()},get useChildrenOnly(){return a()}})},C=>{var x=yw(),p=W(x,!0);Y(x),De(()=>vt(p,i())),D(C,x)}),Y(g),D(e,g);var b=ge({get noneParameterText(){return i()},set noneParameterText(C="无输入参数"){i(C),y()},get dataKeyName(){return s()},set dataKeyName(C="parameters"){s(C),y()},get useChildrenOnly(){return a()},set useChildrenOnly(C){a(C),y()}});return r(),b}ce(Ut,{noneParameterText:{},dataKeyName:{},useChildrenOnly:{}},[],[],!0);var bw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M6 5.1438V16.0002H18.3391L6 5.1438ZM4 2.932C4 2.07155 5.01456 1.61285 5.66056 2.18123L21.6501 16.2494C22.3423 16.8584 21.9116 18.0002 20.9896 18.0002H6V22H4V2.932Z"></path></svg>'),xw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Cw=ie('<div class="heading svelte-11h445j"><!> <!></div> <!>',1);const $w={hash:"svelte-11h445j",code:".heading.svelte-11h445j {display:flex;margin-bottom:10px;}"};function Ef(e,t){fe(t,!0),at(e,$w);const n=w(t,"data",7),r=Nt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn();return En(e,ht({get data(){return n()}},()=>r,{allowExecute:!1,showSourceHandle:!1,icon:a=>{var l=bw();D(a,l)},children:(a,l)=>{var c=Cw(),u=he(c),g=W(u);it(g,{level:3,children:(v,b)=>{Te();var C=Re("输出参数");D(v,C)},$$slots:{default:!0}});var f=B(g,2);Je(f,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(v,b)=>{var C=xw();D(v,C)},$$slots:{default:!0}}),Y(u);var h=B(u,2);Ut(h,{noneParameterText:"无输出参数",dataKeyName:"outputDefs"}),D(a,c)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(s){n(s),y()}})}ce(Ef,{data:{}},[],[],!0);const dl=e=>JSON.parse(JSON.stringify(e));var Ew=Ce('<svg style="transform: scaleY(-1)" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M13 8V16C13 17.6569 11.6569 19 10 19H7.82929C7.41746 20.1652 6.30622 21 5 21C3.34315 21 2 19.6569 2 18C2 16.3431 3.34315 15 5 15C6.30622 15 7.41746 15.8348 7.82929 17H10C10.5523 17 11 16.5523 11 16V8C11 6.34315 12.3431 5 14 5H17V2L22 6L17 10V7H14C13.4477 7 13 7.44772 13 8ZM5 19C5.55228 19 6 18.5523 6 18C6 17.4477 5.55228 17 5 17C4.44772 17 4 17.4477 4 18C4 18.5523 4.44772 19 5 19Z"></path></svg>'),kw=ie('<div class="input-more-item svelte-1cfeest"><!></div>'),Sw=ie('<div class="input-more-setting svelte-1cfeest"><div class="input-more-item svelte-1cfeest">默认值: <!></div> <div class="input-more-item svelte-1cfeest">参数描述: <!></div> <!></div>'),Pw=ie('<div class="input-item svelte-1cfeest"><!> <!></div> <div class="input-item svelte-1cfeest"><!> <!></div> <div class="input-item svelte-1cfeest"><!></div>',1);const Nw={hash:"svelte-1cfeest",code:".input-item.svelte-1cfeest {display:flex;align-items:center;gap:2px;}.input-more-setting.svelte-1cfeest {display:flex;flex-direction:column;gap:10px;padding:10px;background:#fff;border:1px solid #ddd;border-radius:5px;width:200px;box-shadow:0 0 10px 2px rgba(0, 0, 0, 0.1);}.input-more-setting.svelte-1cfeest .input-more-item:where(.svelte-1cfeest) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:#666;}"};function kf(e,t){fe(t,!0),at(e,Nw);const[n,r]=ct(),o=()=>oe(d(c),"$node",n),i=w(t,"parameter",7),s=w(t,"position",7),a=w(t,"dataKeyName",7);let l=$t(),c=Ee(()=>Ar(l)),u=Ee(()=>{var S;let E=(S=o())==null?void 0:S.data[a()],$;if(E&&s().length>0){let T=E;for(let M=0;M<s().length;M++){const H=s()[M];M==s().length-1?$=T[H]:T=T[H].children}}return{...i(),...$}});const{updateNodeData:g}=jt(),f=(E,$)=>{g(l,S=>{const T=S.data[a()];if(T&&s().length>0){let M=T;for(let H=0;H<s().length;H++){const z=s()[H];H==s().length-1?M[z]={...M[z],[E]:$}:M=M[z].children}}return{[a()]:[...dl(T)]}})},h=(E,$)=>{const S=$.target.value;f(E,S)},v=E=>{const $=E.value;f("dataType",$)};let b;const C=()=>{g(l,E=>{let $=E.data[a()];if($&&s().length>0){let S=$;for(let T=0;T<s().length;T++){const M=s()[T];T==s().length-1?S.splice(M,1):S=S[M].children}}return{[a()]:[...dl($)]}}),b==null||b.hide()},x=()=>{g(l,E=>{let $=E.data[a()];if($&&s().length>0){let S=$;for(let T=0;T<s().length;T++){const M=s()[T];T==s().length-1?S[M].children?S[M].children.push({id:Ir(),name:"newParam",dataType:"String"}):S[M].children=[{id:Ir(),name:"newParam",dataType:"String"}]:S=S[M].children}}return{[a()]:[...dl($)]}})};var p=Pw(),_=he(p),m=W(_);{var k=E=>{var $=Ze(),S=he($);Yt(S,17,s,Qr,(T,M)=>{Te();var H=Re(" ");D(T,H)}),D(E,$)};me(m,E=>{s().length>1&&E(k)})}var N=B(m,2);{let E=Ee(()=>d(u).nameDisabled===!0);Ct(N,{style:"width: 100%;",get value(){return d(u).name},placeholder:"请输入参数名称",oninput:$=>{h("name",$)},get disabled(){return d(E)}})}Y(_);var P=B(_,2),O=W(P);{let E=Ee(()=>d(u).dataType?[d(u).dataType]:[]),$=Ee(()=>d(u).dataTypeDisabled===!0);hn(O,{get items(){return mf},style:"width: 100%",defaultValue:["String"],get value(){return d(E)},get disabled(){return d($)},onSelect:v})}var L=B(O,2);{var V=E=>{Je(E,{class:"input-btn-more",style:"margin-left: auto",onclick:x,children:($,S)=>{var T=Ew();D($,T)},$$slots:{default:!0}})};me(L,E=>{(d(u).dataType==="Object"||d(u).dataType==="Array")&&d(u).addChildDisabled!==!0&&E(V)})}Y(P);var A=B(P,2),I=W(A);Vn(wo(I,{placement:"bottom",floating:$=>{var S=Sw(),T=W(S),M=B(W(T));{let ee=Ee(()=>d(u).defaultValue||"");Tt(M,{rows:1,style:"width: 100%;",get value(){return d(ee)},onchange:re=>{h("defaultValue",re)}})}Y(T);var H=B(T,2),z=B(W(H));{let ee=Ee(()=>d(u).description||"");Tt(z,{rows:3,style:"width: 100%;",get value(){return d(ee)},onchange:re=>{h("description",re)}})}Y(H);var j=B(H,2);{var Z=ee=>{var re=kw(),Q=W(re);Je(Q,{onclick:C,children:(de,ne)=>{Te();var _e=Re("删除");D(de,_e)},$$slots:{default:!0}}),Y(re),D(ee,re)};me(j,ee=>{d(u).deleteDisabled!==!0&&ee(Z)})}Y(S),D($,S)},children:($,S)=>{ks($,{})},$$slots:{floating:!0,default:!0}}),$=>b=$,()=>b),Y(A),D(e,p);var R=ge({get parameter(){return i()},set parameter(E){i(E),y()},get position(){return s()},set position(E){s(E),y()},get dataKeyName(){return a()},set dataKeyName(E){a(E),y()}});return r(),R}ce(kf,{parameter:{},position:{},dataKeyName:{}},[],[],!0);var Tw=ie("<!> <!>",1),Mw=ie('<div class="none-params svelte-1sm1mgi"> </div>'),Hw=ie('<div class="input-header svelte-1sm1mgi">参数名称</div> <div class="input-header svelte-1sm1mgi">参数类型</div> <div class="input-header svelte-1sm1mgi"></div>',1),Dw=ie('<div class="input-container svelte-1sm1mgi"><!> <!></div>');const Vw={hash:"svelte-1sm1mgi",code:`.input-container.svelte-1sm1mgi {display:grid;grid-template-columns:40% 50% 10%;row-gap:5px;column-gap:3px;}.input-container.svelte-1sm1mgi .none-params:where(.svelte-1sm1mgi) {font-size:12px;background:#f8f8f8;height:40px;display:flex;justify-content:center;align-items:center;border-radius:5px;width:calc(100% - 5px);grid-column:1 / -1;
7
+ /* 从第一列开始到最后一列结束 */}.input-container.svelte-1sm1mgi .input-header:where(.svelte-1sm1mgi) {font-size:12px;color:#666;}`};function hr(e,t){fe(t,!0),at(e,Vw);const[n,r]=ct(),o=()=>oe(d(c),"$node",n),i=(C,x=wt,p=wt)=>{var _=Ze(),m=he(_);Yt(m,19,x,k=>`${k.id}_${k.children?k.children.length:0}`,(k,N,P)=>{var O=Tw(),L=he(O);{let I=Ee(()=>[...p(),d(P)]);kf(L,{get parameter(){return d(N)},get position(){return d(I)},get dataKeyName(){return a()}})}var V=B(L,2);{var A=I=>{{let R=Ee(()=>[...p(),d(P)]);i(I,()=>d(N).children,()=>d(R))}};me(V,I=>{d(N).children&&I(A)})}D(k,O)},k=>{var N=Ze(),P=he(N);{var O=L=>{var V=Mw(),A=W(V,!0);Y(V),De(()=>vt(A,s())),D(L,V)};me(P,L=>{p().length===0&&L(O)})}D(k,N)}),D(C,_)},s=w(t,"noneParameterText",7,"无输出参数"),a=w(t,"dataKeyName",7,"outputDefs");let l=$t(),c=Ee(()=>Ar(l)),u=Ee(()=>{var C;return[...((C=o())==null?void 0:C.data[a()])||[]]});var g=Dw(),f=W(g);{var h=C=>{var x=Hw();Te(4),D(C,x)};me(f,C=>{d(u).length!==0&&C(h)})}var v=B(f,2);i(v,()=>d(u)||[],()=>[]),Y(g),D(e,g);var b=ge({get noneParameterText(){return s()},set noneParameterText(C="无输出参数"){s(C),y()},get dataKeyName(){return a()},set dataKeyName(C="outputDefs"){a(C),y()}});return r(),b}ce(hr,{noneParameterText:{},dataKeyName:{}},[],[],!0);var Ow=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20.7134 7.12811L20.4668 7.69379C20.2864 8.10792 19.7136 8.10792 19.5331 7.69379L19.2866 7.12811C18.8471 6.11947 18.0555 5.31641 17.0677 4.87708L16.308 4.53922C15.8973 4.35653 15.8973 3.75881 16.308 3.57612L17.0252 3.25714C18.0384 2.80651 18.8442 1.97373 19.2761 0.930828L19.5293 0.319534C19.7058 -0.106511 20.2942 -0.106511 20.4706 0.319534L20.7238 0.930828C21.1558 1.97373 21.9616 2.80651 22.9748 3.25714L23.6919 3.57612C24.1027 3.75881 24.1027 4.35653 23.6919 4.53922L22.9323 4.87708C21.9445 5.31641 21.1529 6.11947 20.7134 7.12811ZM9 2C13.0675 2 16.426 5.03562 16.9337 8.96494L19.1842 12.5037C19.3324 12.7367 19.3025 13.0847 18.9593 13.2317L17 14.071V17C17 18.1046 16.1046 19 15 19H13.001L13 22H4L4.00025 18.3061C4.00033 17.1252 3.56351 16.0087 2.7555 15.0011C1.65707 13.6313 1 11.8924 1 10C1 5.58172 4.58172 2 9 2ZM9 4C5.68629 4 3 6.68629 3 10C3 11.3849 3.46818 12.6929 4.31578 13.7499C5.40965 15.114 6.00036 16.6672 6.00025 18.3063L6.00013 20H11.0007L11.0017 17H15V12.7519L16.5497 12.0881L15.0072 9.66262L14.9501 9.22118C14.5665 6.25141 12.0243 4 9 4ZM19.4893 16.9929L21.1535 18.1024C22.32 16.3562 23 14.2576 23 12.0001C23 11.317 22.9378 10.6486 22.8186 10L20.8756 10.5C20.9574 10.9878 21 11.489 21 12.0001C21 13.8471 20.4436 15.5642 19.4893 16.9929Z"></path></svg>'),Aw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Lw=(e,t,n)=>t(n,{temperature:parseFloat(e.target.value)}),Iw=(e,t,n)=>t(n,{topP:parseFloat(e.target.value)}),zw=(e,t,n)=>t(n,{topK:parseInt(e.target.value)}),Rw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Bw=ie('<div class="heading svelte-q0cqsa"><!> <!></div> <!> <!> <div class="setting-title svelte-q0cqsa">模型</div> <div class="setting-item svelte-q0cqsa"><!> <!></div> <div class="setting-title svelte-q0cqsa">采样参数</div> <div class="setting-item svelte-q0cqsa"><div class="slider-container svelte-q0cqsa"><span class="svelte-q0cqsa"> </span> <input class="nodrag svelte-q0cqsa" type="range" min="0" max="1" step="0.1"/></div></div> <div class="setting-item svelte-q0cqsa"><div class="slider-container svelte-q0cqsa"><span class="svelte-q0cqsa"> </span> <input class="nodrag svelte-q0cqsa" type="range" min="0" max="1" step="0.1"/></div></div> <div class="setting-item svelte-q0cqsa"><div class="slider-container svelte-q0cqsa"><span class="svelte-q0cqsa"> </span> <input class="nodrag svelte-q0cqsa" type="range" min="0" max="100" step="1"/></div></div> <div class="setting-title svelte-q0cqsa">系统提示词</div> <div class="setting-item svelte-q0cqsa"><!></div> <div class="setting-title svelte-q0cqsa">用户提示词</div> <div class="setting-item svelte-q0cqsa"><!></div> <div class="heading svelte-q0cqsa"><!> <!> <!></div> <!>',1);const qw={hash:"svelte-q0cqsa",code:`.heading.svelte-q0cqsa {display:flex;align-items:center;margin-bottom:10px;}.setting-title.svelte-q0cqsa {font-size:12px;color:#999;margin-bottom:4px;margin-top:10px;}.setting-item.svelte-q0cqsa {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}
8
+
9
+ /* 新增样式 */.slider-container.svelte-q0cqsa {width:100%;display:flex;flex-direction:column;gap:4px;}.slider-container.svelte-q0cqsa span:where(.svelte-q0cqsa) {font-size:12px;color:#666;display:flex;justify-content:space-between;align-items:center;}input[type="range"].svelte-q0cqsa {width:100%;height:4px;background:#ddd;border-radius:2px;outline:none;-webkit-appearance:none;}input[type="range"].svelte-q0cqsa::-webkit-slider-thumb {-webkit-appearance:none;width:14px;height:14px;background:#007bff;border-radius:50%;cursor:pointer;}`};function Sf(e,t){fe(t,!0),at(e,qw);const n=w(t,"data",7),r=Nt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn(),s=gr();let a=zt(Pn([]));dn(async()=>{var g,f;const u=await((f=(g=s.provider)==null?void 0:g.llm)==null?void 0:f.call(g));d(a).push(...u||[])});const{updateNodeData:l}=jt(),c=u=>{l(o,()=>({outType:u})),u==="text"?l(o,{outputDefs:[{name:"output",dataType:"String",dataTypeDisabled:!0,deleteDisabled:!0}]}):l(o,{outputDefs:[]})};return un(()=>{n().outType||c("text")}),En(e,ht({get data(){return n()}},()=>r,{icon:g=>{var f=Ow();D(g,f)},children:(g,f)=>{var h=Bw(),v=he(h),b=W(v);it(b,{level:3,children:(le,pe)=>{Te();var se=Re("输入参数");D(le,se)},$$slots:{default:!0}});var C=B(b,2);Je(C,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(le,pe)=>{var se=Aw();D(le,se)},$$slots:{default:!0}}),Y(v);var x=B(v,2);Ut(x,{});var p=B(x,2);it(p,{level:3,mt:"10px",children:(le,pe)=>{Te();var se=Re("模型设置");D(le,se)},$$slots:{default:!0}});var _=B(p,4),m=W(_);{let le=Ee(()=>n().llmId?[n().llmId]:[]);hn(m,{get items(){return d(a)},style:"width: 100%",placeholder:"请选择模型",onSelect:pe=>{const se=pe.value;l(o,()=>({llmId:se}))},get value(){return d(le)}})}var k=B(m,2);ks(k,{}),Y(_);var N=B(_,4),P=W(N),O=W(P),L=W(O);Y(O);var V=B(O,2);ir(V),V.__input=[Lw,l,o],Y(P),Y(N);var A=B(N,2),I=W(A),R=W(I),E=W(R);Y(R);var $=B(R,2);ir($),$.__input=[Iw,l,o],Y(I),Y(A);var S=B(A,2),T=W(S),M=W(T),H=W(M);Y(M);var z=B(M,2);ir(z),z.__input=[zw,l,o],Y(T),Y(S);var j=B(S,4),Z=W(j);{let le=Ee(()=>n().systemPrompt||"");Tt(Z,{rows:5,placeholder:"请输入系统提示词",style:"width: 100%",get value(){return d(le)},oninput:pe=>{l(o,{systemPrompt:pe.target.value})}})}Y(j);var ee=B(j,4),re=W(ee);{let le=Ee(()=>n().userPrompt||"");Tt(re,{rows:5,placeholder:"请输入用户提示词",style:"width: 100%",get value(){return d(le)},oninput:pe=>{l(o,{userPrompt:pe.target.value})}})}Y(ee);var Q=B(ee,2),de=W(Q);it(de,{level:3,mt:"10px",children:(le,pe)=>{Te();var se=Re("输出参数");D(le,se)},$$slots:{default:!0}});var ne=B(de,2);{let le=Ee(()=>n().outType?[n().outType]:[]);hn(ne,{items:[{label:"文本",value:"text"},{label:"JSON",value:"json"}],style:"width: 100px;margin-left: auto",defaultValue:"text",onSelect:pe=>{c(pe.value)},get value(){return d(le)}})}var _e=B(ne,2);{var Ne=le=>{Je(le,{class:"input-btn-more",style:"margin-left: 10px",onclick:()=>{i(o,"outputDefs")},children:(pe,se)=>{var U=Rw();D(pe,U)},$$slots:{default:!0}})};me(_e,le=>{n().outType==="json"&&le(Ne)})}Y(Q);var Ve=B(Q,2);hr(Ve,{}),De(()=>{vt(L,`Temperature: ${n().temperature??.5??""}`),Vi(V,n().temperature??.5),vt(E,`Top P: ${n().topP??.9??""}`),Vi($,n().topP??.9),vt(H,`Top K: ${n().topK??50??""}`),Vi(z,n().topK??50)}),D(g,h)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(u){n(u),y()}})}Gr(["input"]),ce(Sf,{data:{}},[],[],!0);var Yw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M23 12L15.9289 19.0711L14.5147 17.6569L20.1716 12L14.5147 6.34317L15.9289 4.92896L23 12ZM3.82843 12L9.48528 17.6569L8.07107 19.0711L1 12L8.07107 4.92896L9.48528 6.34317L3.82843 12Z"></path></svg>'),Fw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Ww=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Xw=ie('<div class="heading svelte-15t2v24"><!> <!></div> <!> <!> <div class="setting-title svelte-15t2v24">执行引擎</div> <div class="setting-item svelte-15t2v24"><!></div> <div class="setting-title svelte-15t2v24">执行代码</div> <div class="setting-item svelte-15t2v24"><!></div> <div class="heading svelte-15t2v24"><!> <!></div> <!>',1);const Zw={hash:"svelte-15t2v24",code:".heading.svelte-15t2v24 {display:flex;margin-bottom:10px;}.setting-title.svelte-15t2v24 {font-size:12px;color:#999;margin-bottom:4px;margin-top:10px;}.setting-item.svelte-15t2v24 {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}"};function Pf(e,t){fe(t,!0),at(e,Zw);const n=w(t,"data",7),r=Nt(t,["$$slots","$$events","$$legacy","$$host","data"]);dn(()=>{n().engine||s(o,()=>({engine:"qlexpress"}))});const o=$t(),{addParameter:i}=Rn(),{updateNodeData:s}=jt(),a=[{label:"QLExpress",value:"qlexpress"},{label:"Groovy",value:"groovy"},{label:"JavaScript",value:"js"}];return En(e,ht({get data(){return n()}},()=>r,{icon:c=>{var u=Yw();D(c,u)},children:(c,u)=>{var g=Xw(),f=he(g),h=W(f);it(h,{level:3,children:(L,V)=>{Te();var A=Re("输入参数");D(L,A)},$$slots:{default:!0}});var v=B(h,2);Je(v,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(L,V)=>{var A=Fw();D(L,A)},$$slots:{default:!0}}),Y(f);var b=B(f,2);Ut(b,{});var C=B(b,2);it(C,{level:3,mt:"10px",children:(L,V)=>{Te();var A=Re("代码");D(L,A)},$$slots:{default:!0}});var x=B(C,4),p=W(x);{let L=Ee(()=>n().engine?[n().engine]:["qlexpress"]);hn(p,{get items(){return a},style:"width: 100%",placeholder:"请选择执行引擎",onSelect:V=>{const A=V.value;s(o,()=>({engine:A}))},get value(){return d(L)}})}Y(x);var _=B(x,4),m=W(_);{let L=Ee(()=>n().code||"");Tt(m,{rows:10,placeholder:"请输入执行代码,注:输出内容需添加到_result中,如:_result.put(key, value)",style:"width: 100%",onchange:V=>{s(o,()=>({code:V.target.value}))},get value(){return d(L)}})}Y(_);var k=B(_,2),N=W(k);it(N,{level:3,mt:"10px",children:(L,V)=>{Te();var A=Re("输出参数");D(L,A)},$$slots:{default:!0}});var P=B(N,2);Je(P,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(L,V)=>{var A=Ww();D(L,A)},$$slots:{default:!0}}),Y(k);var O=B(k,2);hr(O,{}),D(c,g)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(l){n(l),y()}})}ce(Pf,{data:{}},[],[],!0);var Kw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 4C2 3.44772 2.44772 3 3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4ZM4 5V19H20V5H4ZM7 8H17V11H15V10H13V14H14.5V16H9.5V14H11V10H9V11H7V8Z"></path></svg>'),jw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Uw=ie('<div class="heading svelte-15t2v24"><!> <!></div> <!> <!> <div class="setting-item svelte-15t2v24"><!></div> <div class="heading svelte-15t2v24"><!></div> <!>',1);const Gw={hash:"svelte-15t2v24",code:".heading.svelte-15t2v24 {display:flex;margin-bottom:10px;}.setting-item.svelte-15t2v24 {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}"};function Nf(e,t){fe(t,!0),at(e,Gw);const n=w(t,"data",7),r=Nt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn(),{updateNodeData:s}=jt();return un(()=>{(!n().outputDefs||n().outputDefs.length===0)&&i(o,"outputDefs",{name:"output",dataType:"String",dataTypeDisabled:!0,deleteDisabled:!0})}),En(e,ht({get data(){return n()}},()=>r,{icon:l=>{var c=Kw();D(l,c)},children:(l,c)=>{var u=Uw(),g=he(u),f=W(g);it(f,{level:3,children:(k,N)=>{Te();var P=Re("输入参数");D(k,P)},$$slots:{default:!0}});var h=B(f,2);Je(h,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(k,N)=>{var P=jw();D(k,P)},$$slots:{default:!0}}),Y(g);var v=B(g,2);Ut(v,{});var b=B(v,2);it(b,{level:3,mt:"10px",mb:"10px",children:(k,N)=>{Te();var P=Re("模板内容");D(k,P)},$$slots:{default:!0}});var C=B(b,2),x=W(C);{let k=Ee(()=>n().template||"");Tt(x,{rows:10,placeholder:"请输入模板内容",style:"width: 100%",onchange:N=>{s(o,()=>({template:N.target.value}))},get value(){return d(k)}})}Y(C);var p=B(C,2),_=W(p);it(_,{level:3,mt:"10px",children:(k,N)=>{Te();var P=Re("输出参数");D(k,P)},$$slots:{default:!0}}),Y(p);var m=B(p,2);hr(m,{}),D(l,u)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(a){n(a),y()}})}ce(Nf,{data:{}},[],[],!0);var Jw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M6.23509 6.45329C4.85101 7.89148 4 9.84636 4 12C4 16.4183 7.58172 20 12 20C13.0808 20 14.1116 19.7857 15.0521 19.3972C15.1671 18.6467 14.9148 17.9266 14.8116 17.6746C14.582 17.115 13.8241 16.1582 12.5589 14.8308C12.2212 14.4758 12.2429 14.2035 12.3636 13.3943L12.3775 13.3029C12.4595 12.7486 12.5971 12.4209 14.4622 12.1248C15.4097 11.9746 15.6589 12.3533 16.0043 12.8777C16.0425 12.9358 16.0807 12.9928 16.1198 13.0499C16.4479 13.5297 16.691 13.6394 17.0582 13.8064C17.2227 13.881 17.428 13.9751 17.7031 14.1314C18.3551 14.504 18.3551 14.9247 18.3551 15.8472V15.9518C18.3551 16.3434 18.3168 16.6872 18.2566 16.9859C19.3478 15.6185 20 13.8854 20 12C20 8.70089 18.003 5.8682 15.1519 4.64482C14.5987 5.01813 13.8398 5.54726 13.575 5.91C13.4396 6.09538 13.2482 7.04166 12.6257 7.11976C12.4626 7.14023 12.2438 7.12589 12.012 7.11097C11.3905 7.07058 10.5402 7.01606 10.268 7.75495C10.0952 8.2232 10.0648 9.49445 10.6239 10.1543C10.7134 10.2597 10.7307 10.4547 10.6699 10.6735C10.59 10.9608 10.4286 11.1356 10.3783 11.1717C10.2819 11.1163 10.0896 10.8931 9.95938 10.7412C9.64554 10.3765 9.25405 9.92233 8.74797 9.78176C8.56395 9.73083 8.36166 9.68867 8.16548 9.64736C7.6164 9.53227 6.99443 9.40134 6.84992 9.09302C6.74442 8.8672 6.74488 8.55621 6.74529 8.22764C6.74529 7.8112 6.74529 7.34029 6.54129 6.88256C6.46246 6.70541 6.35689 6.56446 6.23509 6.45329ZM12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22Z"></path></svg>'),Qw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),e_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),t_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),n_=ie('<div class="heading svelte-1mo2w1q" style="padding-top: 10px"><!> <!></div> <!>',1),r_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),o_=ie('<div class="heading svelte-1mo2w1q" style="padding-top: 10px"><!> <!></div> <!>',1),i_=ie('<div style="width: 100%"><!></div>'),s_=ie('<div style="width: 100%"><!></div>'),a_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),l_=ie('<div class="heading svelte-1mo2w1q"><!> <!></div> <!> <!> <div style="display: flex;gap: 2px;width: 100%;padding: 10px 0"><div><!></div> <div style="width: 100%"><!></div></div> <div class="heading svelte-1mo2w1q"><!> <!></div> <!> <!> <div class="radio-group svelte-1mo2w1q"><label class="svelte-1mo2w1q"><!>none</label> <label class="svelte-1mo2w1q"><!>form-data</label> <label class="svelte-1mo2w1q"><!>x-www-form-urlencoded</label> <label class="svelte-1mo2w1q"><!>json</label> <label class="svelte-1mo2w1q"><!>raw</label></div> <!> <!> <!> <!> <div class="heading svelte-1mo2w1q"><!> <!></div> <!>',1);const u_={hash:"svelte-1mo2w1q",code:".heading.svelte-1mo2w1q {display:flex;margin-bottom:10px;}.radio-group.svelte-1mo2w1q {display:flex;margin:10px 0;}.radio-group.svelte-1mo2w1q label:where(.svelte-1mo2w1q) {display:flex;font-size:14px;}"};function Tf(e,t){fe(t,!0),at(e,u_);const n=w(t,"data",7),r=Nt(t,["$$slots","$$events","$$legacy","$$host","data"]);dn(()=>{n().method||a(i,()=>({method:"get"}))});const o=[{value:"get",label:"GET"},{value:"post",label:"POST"},{value:"put",label:"PUT"},{value:"delete",label:"DELETE"},{value:"head",label:"HEAD"},{value:"patch",label:"PATCH"}],i=$t(),{addParameter:s}=Rn(),{updateNodeData:a}=jt();return En(e,ht({get data(){return n()}},()=>r,{icon:c=>{var u=Jw();D(c,u)},children:(c,u)=>{var g=l_(),f=he(g),h=W(f);it(h,{level:3,children:(U,ue)=>{Te();var F=Re("输入参数");D(U,F)},$$slots:{default:!0}});var v=B(h,2);Je(v,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i)},children:(U,ue)=>{var F=Qw();D(U,F)},$$slots:{default:!0}}),Y(f);var b=B(f,2);Ut(b,{});var C=B(b,2);it(C,{level:3,mt:"10px",children:(U,ue)=>{Te();var F=Re("URL 地址");D(U,F)},$$slots:{default:!0}});var x=B(C,2),p=W(x),_=W(p);{let U=Ee(()=>n().method?[n().method]:["get"]);hn(_,{get items(){return o},style:"width: 100%",placeholder:"请选择请求方式",onSelect:ue=>{const F=ue.value;a(i,()=>({method:F}))},get value(){return d(U)}})}Y(p);var m=B(p,2),k=W(m);{let U=Ee(()=>n().url||"");Ct(k,{placeholder:"请输入url",style:"width: 100%",onchange:ue=>{a(i,()=>({url:ue.target.value}))},get value(){return d(U)}})}Y(m),Y(x);var N=B(x,2),P=W(N);it(P,{level:3,children:(U,ue)=>{Te();var F=Re("Http 头信息");D(U,F)},$$slots:{default:!0}});var O=B(P,2);Je(O,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"headers")},children:(U,ue)=>{var F=e_();D(U,F)},$$slots:{default:!0}}),Y(N);var L=B(N,2);Ut(L,{dataKeyName:"headers"});var V=B(L,2);it(V,{level:3,mt:"10px",children:(U,ue)=>{Te();var F=Re("Body");D(U,F)},$$slots:{default:!0}});var A=B(V,2),I=W(A),R=W(I);{let U=Ee(()=>!n().bodyType);Ct(R,{type:"radio",name:"bodyType",value:"",get checked(){return d(U)},onchange:ue=>{var F;(F=ue.target)!=null&&F.checked&&a(i,{bodyType:""})}})}Te(),Y(I);var E=B(I,2),$=W(E);{let U=Ee(()=>n().bodyType==="form-data");Ct($,{type:"radio",name:"bodyType",value:"form-data",get checked(){return d(U)},onchange:ue=>{var F;(F=ue.target)!=null&&F.checked&&a(i,{bodyType:"form-data"})}})}Te(),Y(E);var S=B(E,2),T=W(S);{let U=Ee(()=>n().bodyType==="x-www-form-urlencoded");Ct(T,{type:"radio",name:"bodyType",value:"x-www-form-urlencoded",get checked(){return d(U)},onchange:ue=>{var F;(F=ue.target)!=null&&F.checked&&a(i,{bodyType:"x-www-form-urlencoded"})}})}Te(),Y(S);var M=B(S,2),H=W(M);{let U=Ee(()=>n().bodyType==="json");Ct(H,{type:"radio",name:"bodyType",value:"json",get checked(){return d(U)},onchange:ue=>{var F;(F=ue.target)!=null&&F.checked&&a(i,{bodyType:"json"})}})}Te(),Y(M);var z=B(M,2),j=W(z);{let U=Ee(()=>n().bodyType==="raw");Ct(j,{type:"radio",name:"bodyType",value:"raw",get checked(){return d(U)},onchange:ue=>{var F;(F=ue.target)!=null&&F.checked&&a(i,{bodyType:"raw"})}})}Te(),Y(z),Y(A);var Z=B(A,2);{var ee=U=>{var ue=n_(),F=he(ue),we=W(F);it(we,{level:3,children:(Be,Le)=>{Te();var ye=Re("参数");D(Be,ye)},$$slots:{default:!0}});var Pe=B(we,2);Je(Pe,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"formData")},children:(Be,Le)=>{var ye=t_();D(Be,ye)},$$slots:{default:!0}}),Y(F);var Oe=B(F,2);Ut(Oe,{dataKeyName:"formData"}),D(U,ue)};me(Z,U=>{n().bodyType==="form-data"&&U(ee)})}var re=B(Z,2);{var Q=U=>{var ue=o_(),F=he(ue),we=W(F);it(we,{level:3,children:(Be,Le)=>{Te();var ye=Re("Body 参数");D(Be,ye)},$$slots:{default:!0}});var Pe=B(we,2);Je(Pe,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"formUrlencoded")},children:(Be,Le)=>{var ye=r_();D(Be,ye)},$$slots:{default:!0}}),Y(F);var Oe=B(F,2);Ut(Oe,{dataKeyName:"formUrlencoded"}),D(U,ue)};me(re,U=>{n().bodyType==="x-www-form-urlencoded"&&U(Q)})}var de=B(re,2);{var ne=U=>{var ue=i_(),F=W(ue);Tt(F,{rows:5,style:"width: 100%",placeholder:"请输入 json 信息",get value(){return n().bodyJson},oninput:we=>{a(i,{bodyJson:we.target.value})}}),Y(ue),D(U,ue)};me(de,U=>{n().bodyType==="json"&&U(ne)})}var _e=B(de,2);{var Ne=U=>{var ue=s_(),F=W(ue);Tt(F,{rows:5,style:"width: 100%",placeholder:"请输入请求信息",get value(){return n().bodyRaw},oninput:we=>{a(i,{bodyRaw:we.target.value})}}),Y(ue),D(U,ue)};me(_e,U=>{n().bodyType==="raw"&&U(Ne)})}var Ve=B(_e,2),le=W(Ve);it(le,{level:3,mt:"10px",children:(U,ue)=>{Te();var F=Re("输出参数");D(U,F)},$$slots:{default:!0}});var pe=B(le,2);Je(pe,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"outputDefs")},children:(U,ue)=>{var F=a_();D(U,F)},$$slots:{default:!0}}),Y(Ve);var se=B(Ve,2);hr(se,{}),D(c,g)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(l){n(l),y()}})}ce(Tf,{data:{}},[],[],!0);var c_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15.5 5C13.567 5 12 6.567 12 8.5C12 10.433 13.567 12 15.5 12C17.433 12 19 10.433 19 8.5C19 6.567 17.433 5 15.5 5ZM10 8.5C10 5.46243 12.4624 3 15.5 3C18.5376 3 21 5.46243 21 8.5C21 9.6575 20.6424 10.7315 20.0317 11.6175L22.7071 14.2929L21.2929 15.7071L18.6175 13.0317C17.7315 13.6424 16.6575 14 15.5 14C12.4624 14 10 11.5376 10 8.5ZM3 4H8V6H3V4ZM3 11H8V13H3V11ZM21 18V20H3V18H21Z"></path></svg>'),d_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),f_=ie('<div class="heading svelte-15t2v24"><!> <!></div> <!> <!> <div class="setting-title svelte-15t2v24">知识库</div> <div class="setting-item svelte-15t2v24"><!></div> <div class="setting-title svelte-15t2v24">关键字</div> <div class="setting-item svelte-15t2v24"><!></div> <div class="setting-title svelte-15t2v24">获取数据量</div> <div class="setting-item svelte-15t2v24"><!></div> <div class="heading svelte-15t2v24"><!></div> <!>',1);const g_={hash:"svelte-15t2v24",code:".heading.svelte-15t2v24 {display:flex;margin-bottom:10px;}.setting-title.svelte-15t2v24 {font-size:12px;color:#999;margin-bottom:4px;margin-top:10px;}.setting-item.svelte-15t2v24 {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}"};function Mf(e,t){fe(t,!0),at(e,g_);const n=w(t,"data",7),r=Nt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn(),s=gr();let a=zt(Pn([]));dn(async()=>{var u,g;const c=await((g=(u=s.provider)==null?void 0:u.knowledge)==null?void 0:g.call(u));d(a).push(...c||[])});const{updateNodeData:l}=jt();return un(()=>{(!n().outputDefs||n().outputDefs.length===0)&&i(o,"outputDefs",{name:"documents",dataType:"Array",nameDisabled:!0,dataTypeDisabled:!0,addChildDisabled:!0,deleteDisabled:!0,children:[{name:"title",dataType:"String",nameDisabled:!0,dataTypeDisabled:!0,deleteDisabled:!0},{name:"content",dataType:"String",nameDisabled:!0,dataTypeDisabled:!0,deleteDisabled:!0},{name:"documentId",dataType:"Number",nameDisabled:!0,dataTypeDisabled:!0,deleteDisabled:!0},{name:"knowledgeId",dataType:"Number",nameDisabled:!0,dataTypeDisabled:!0,deleteDisabled:!0}]})}),En(e,ht({get data(){return n()}},()=>r,{icon:u=>{var g=c_();D(u,g)},children:(u,g)=>{var f=f_(),h=he(f),v=W(h);it(v,{level:3,children:(A,I)=>{Te();var R=Re("输入参数");D(A,R)},$$slots:{default:!0}});var b=B(v,2);Je(b,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(A,I)=>{var R=d_();D(A,R)},$$slots:{default:!0}}),Y(h);var C=B(h,2);Ut(C,{});var x=B(C,2);it(x,{level:3,mt:"10px",children:(A,I)=>{Te();var R=Re("知识库设置");D(A,R)},$$slots:{default:!0}});var p=B(x,4),_=W(p);{let A=Ee(()=>n().knowledgeId?[n().knowledgeId]:[]);hn(_,{get items(){return d(a)},style:"width: 100%",placeholder:"请选择知识库",onSelect:I=>{const R=I.value;l(o,()=>({knowledgeId:R}))},get value(){return d(A)}})}Y(p);var m=B(p,4),k=W(m);Ct(k,{placeholder:"请输入关键字",style:"width: 100%",get value(){return n().keyword},onchange:A=>{const I=A.target.value;l(o,()=>({keyword:I}))}}),Y(m);var N=B(m,4),P=W(N);{let A=Ee(()=>n().limit||"");Ct(P,{placeholder:"搜索的数据条数",style:"width: 100%",onchange:I=>{const R=I.target.value;l(o,()=>({limit:R}))},get value(){return d(A)}})}Y(N);var O=B(N,2),L=W(O);it(L,{level:3,mt:"10px",children:(A,I)=>{Te();var R=Re("输出参数");D(A,R)},$$slots:{default:!0}}),Y(O);var V=B(O,2);hr(V,{}),D(u,f)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(c){n(c),y()}})}ce(Mf,{data:{}},[],[],!0);var h_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"></path></svg>'),v_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),p_=ie('<div class="heading svelte-15t2v24"><!> <!></div> <!> <!> <div class="setting-title svelte-15t2v24">搜索引擎</div> <div class="setting-item svelte-15t2v24"><!></div> <div class="setting-title svelte-15t2v24">关键字</div> <div class="setting-item svelte-15t2v24"><!></div> <div class="setting-title svelte-15t2v24">搜索数据量</div> <div class="setting-item svelte-15t2v24"><!></div> <div class="heading svelte-15t2v24"><!></div> <!>',1);const m_={hash:"svelte-15t2v24",code:".heading.svelte-15t2v24 {display:flex;margin-bottom:10px;}.setting-title.svelte-15t2v24 {font-size:12px;color:#999;margin-bottom:4px;margin-top:10px;}.setting-item.svelte-15t2v24 {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}"};function Hf(e,t){fe(t,!0),at(e,m_);const n=w(t,"data",7),r=Nt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn(),s=gr();let a=zt(Pn([]));dn(async()=>{var u,g;const c=await((g=(u=s.provider)==null?void 0:u.searchEngine)==null?void 0:g.call(u));d(a).push(...c||[])});const{updateNodeData:l}=jt();return un(()=>{(!n().outputDefs||n().outputDefs.length===0)&&i(o,"outputDefs",{name:"documents",dataType:"Array",nameDisabled:!0,dataTypeDisabled:!0,addChildDisabled:!0,deleteDisabled:!0,children:[{name:"title",dataType:"String",nameDisabled:!0,dataTypeDisabled:!0,deleteDisabled:!0},{name:"content",dataType:"String",nameDisabled:!0,dataTypeDisabled:!0,deleteDisabled:!0}]})}),En(e,ht({get data(){return n()}},()=>r,{icon:u=>{var g=h_();D(u,g)},children:(u,g)=>{var f=p_(),h=he(f),v=W(h);it(v,{level:3,children:(A,I)=>{Te();var R=Re("输入参数");D(A,R)},$$slots:{default:!0}});var b=B(v,2);Je(b,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(A,I)=>{var R=v_();D(A,R)},$$slots:{default:!0}}),Y(h);var C=B(h,2);Ut(C,{});var x=B(C,2);it(x,{level:3,mt:"10px",children:(A,I)=>{Te();var R=Re("搜索引擎设置");D(A,R)},$$slots:{default:!0}});var p=B(x,4),_=W(p);{let A=Ee(()=>n().engine?[n().engine]:[]);hn(_,{get items(){return d(a)},style:"width: 100%",placeholder:"请选择搜索引擎",onSelect:I=>{const R=I.value;l(o,()=>({engine:R}))},get value(){return d(A)}})}Y(p);var m=B(p,4),k=W(m);Ct(k,{placeholder:"请输入关键字",style:"width: 100%",get value(){return n().keyword},onchange:A=>{const I=A.target.value;l(o,()=>({keyword:I}))}}),Y(m);var N=B(m,4),P=W(N);Ct(P,{placeholder:"搜索的数据条数",style:"width: 100%",get value(){return n().limit},onchange:A=>{const I=A.target.value;l(o,()=>({limit:I}))}}),Y(N);var O=B(N,2),L=W(O);it(L,{level:3,mt:"10px",children:(A,I)=>{Te();var R=Re("输出参数");D(A,R)},$$slots:{default:!0}}),Y(O);var V=B(O,2);hr(V,{}),D(u,f)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(c){n(c),y()}})}ce(Hf,{data:{}},[],[],!0);var y_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5.46257 4.43262C7.21556 2.91688 9.5007 2 12 2C17.5228 2 22 6.47715 22 12C22 14.1361 21.3302 16.1158 20.1892 17.7406L17 12H20C20 7.58172 16.4183 4 12 4C9.84982 4 7.89777 4.84827 6.46023 6.22842L5.46257 4.43262ZM18.5374 19.5674C16.7844 21.0831 14.4993 22 12 22C6.47715 22 2 17.5228 2 12C2 9.86386 2.66979 7.88416 3.8108 6.25944L7 12H4C4 16.4183 7.58172 20 12 20C14.1502 20 16.1022 19.1517 17.5398 17.7716L18.5374 19.5674Z"></path></svg>'),w_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),__=ie('<div class="heading svelte-1eqcy61"><!></div> <!> <div class="heading svelte-1eqcy61"><!> <!></div> <!>',1);const b_={hash:"svelte-1eqcy61",code:".heading.svelte-1eqcy61 {display:flex;margin:10px 0;align-items:center;}.loop_handle_wrapper ::after {content:'循环体';width:100px;height:20px;background:#000;color:#fff;display:flex;justify-content:center;align-items:center;}"};function Df(e,t){fe(t,!0),at(e,b_);const n=w(t,"data",7),r=Nt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn();return un(()=>{(!n().loopVars||n().loopVars.length===0)&&i(o,"loopVars",{name:"loopVar",nameDisabled:!0,deleteDisabled:!0})}),En(e,ht({get data(){return n()}},()=>r,{icon:l=>{var c=y_();D(l,c)},handle:l=>{lr(l,{type:"source",get position(){return Se.Bottom},id:"loop_handle",style:"bottom: -12px;width: 100px",class:"loop_handle_wrapper"})},children:(l,c)=>{var u=__(),g=he(u),f=W(g);it(f,{level:3,children:(p,_)=>{Te();var m=Re("循环变量");D(p,m)},$$slots:{default:!0}}),Y(g);var h=B(g,2);Ut(h,{dataKeyName:"loopVars"});var v=B(h,2),b=W(v);it(b,{level:3,children:(p,_)=>{Te();var m=Re("输出参数");D(p,m)},$$slots:{default:!0}});var C=B(b,2);Je(C,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(p,_)=>{var m=w_();D(p,m)},$$slots:{default:!0}}),Y(v);var x=B(v,2);Ut(x,{noneParameterText:"无输出参数",dataKeyName:"outputDefs",useChildrenOnly:!0}),D(l,u)},$$slots:{icon:!0,handle:!0,default:!0}})),ge({get data(){return n()},set data(s){n(s),y()}})}ce(Df,{data:{}},[],[],!0);const x_={startNode:_f,codeNode:Pf,llmNode:Sf,templateNode:Nf,httpNode:Tf,knowledgeNode:Mf,searchEngineNode:Hf,loopNode:Df,endNode:Ef};var C_=ie("<!> ",1);function fl(e,t){fe(t,!0);const n=w(t,"icon",7),r=w(t,"title",7),o=w(t,"type",7),i=w(t,"description",7),s=w(t,"extra",7);return Je(e,{draggable:!0,ondragstart:l=>{if(!l.dataTransfer)return null;const c={type:o(),data:{title:r(),description:i(),...s()}};l.dataTransfer.setData("application/tinyflow",JSON.stringify(c)),l.dataTransfer.effectAllowed="move"},get"data-node-type"(){return o()},children:(l,c)=>{var u=C_(),g=he(u);fa(g,n);var f=B(g);De(()=>vt(f,` ${r()??""}`)),D(l,u)},$$slots:{default:!0}}),ge({get icon(){return n()},set icon(l){n(l),y()},get title(){return r()},set title(l){r(l),y()},get type(){return o()},set type(l){o(l),y()},get description(){return i()},set description(l){i(l),y()},get extra(){return s()},set extra(l){s(l),y()}})}ce(fl,{icon:{},title:{},type:{},description:{},extra:{}},[],[],!0);var $_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"></path></svg>'),E_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"></path></svg>'),k_=ie('<div><div class="tf-toolbar-container "><div class="tf-toolbar-container-header"><!></div> <div class="tf-toolbar-container-body"><div class="tf-toolbar-container-base"></div> <div class="tf-toolbar-container-tools"></div></div></div> <!></div>');function Vf(e,t){fe(t,!0);let n=zt("base"),r=zt("show");const o=[{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12C15 13.6569 13.6569 15 12 15Z"></path></svg>',title:"开始节点",type:"startNode",sortNo:100,description:"开始定义输入参数"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5.46257 4.43262C7.21556 2.91688 9.5007 2 12 2C17.5228 2 22 6.47715 22 12C22 14.1361 21.3302 16.1158 20.1892 17.7406L17 12H20C20 7.58172 16.4183 4 12 4C9.84982 4 7.89777 4.84827 6.46023 6.22842L5.46257 4.43262ZM18.5374 19.5674C16.7844 21.0831 14.4993 22 12 22C6.47715 22 2 17.5228 2 12C2 9.86386 2.66979 7.88416 3.8108 6.25944L7 12H4C4 16.4183 7.58172 20 12 20C14.1502 20 16.1022 19.1517 17.5398 17.7716L18.5374 19.5674Z"></path></svg>',title:"循环",type:"loopNode",sortNo:200,description:"用于循环执行任务"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20.7134 7.12811L20.4668 7.69379C20.2864 8.10792 19.7136 8.10792 19.5331 7.69379L19.2866 7.12811C18.8471 6.11947 18.0555 5.31641 17.0677 4.87708L16.308 4.53922C15.8973 4.35653 15.8973 3.75881 16.308 3.57612L17.0252 3.25714C18.0384 2.80651 18.8442 1.97373 19.2761 0.930828L19.5293 0.319534C19.7058 -0.106511 20.2942 -0.106511 20.4706 0.319534L20.7238 0.930828C21.1558 1.97373 21.9616 2.80651 22.9748 3.25714L23.6919 3.57612C24.1027 3.75881 24.1027 4.35653 23.6919 4.53922L22.9323 4.87708C21.9445 5.31641 21.1529 6.11947 20.7134 7.12811ZM9 2C13.0675 2 16.426 5.03562 16.9337 8.96494L19.1842 12.5037C19.3324 12.7367 19.3025 13.0847 18.9593 13.2317L17 14.071V17C17 18.1046 16.1046 19 15 19H13.001L13 22H4L4.00025 18.3061C4.00033 17.1252 3.56351 16.0087 2.7555 15.0011C1.65707 13.6313 1 11.8924 1 10C1 5.58172 4.58172 2 9 2ZM9 4C5.68629 4 3 6.68629 3 10C3 11.3849 3.46818 12.6929 4.31578 13.7499C5.40965 15.114 6.00036 16.6672 6.00025 18.3063L6.00013 20H11.0007L11.0017 17H15V12.7519L16.5497 12.0881L15.0072 9.66262L14.9501 9.22118C14.5665 6.25141 12.0243 4 9 4ZM19.4893 16.9929L21.1535 18.1024C22.32 16.3562 23 14.2576 23 12.0001C23 11.317 22.9378 10.6486 22.8186 10L20.8756 10.5C20.9574 10.9878 21 11.489 21 12.0001C21 13.8471 20.4436 15.5642 19.4893 16.9929Z"></path></svg>',title:"大模型",type:"llmNode",sortNo:300,description:"使用大模型处理问题"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15.5 5C13.567 5 12 6.567 12 8.5C12 10.433 13.567 12 15.5 12C17.433 12 19 10.433 19 8.5C19 6.567 17.433 5 15.5 5ZM10 8.5C10 5.46243 12.4624 3 15.5 3C18.5376 3 21 5.46243 21 8.5C21 9.6575 20.6424 10.7315 20.0317 11.6175L22.7071 14.2929L21.2929 15.7071L18.6175 13.0317C17.7315 13.6424 16.6575 14 15.5 14C12.4624 14 10 11.5376 10 8.5ZM3 4H8V6H3V4ZM3 11H8V13H3V11ZM21 18V20H3V18H21Z"></path></svg>',title:"知识库",type:"knowledgeNode",sortNo:400,description:"通过知识库获取内容"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"></path></svg>',title:"搜索引擎",type:"searchEngineNode",sortNo:500,description:"通过搜索引擎搜索内容"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M6.23509 6.45329C4.85101 7.89148 4 9.84636 4 12C4 16.4183 7.58172 20 12 20C13.0808 20 14.1116 19.7857 15.0521 19.3972C15.1671 18.6467 14.9148 17.9266 14.8116 17.6746C14.582 17.115 13.8241 16.1582 12.5589 14.8308C12.2212 14.4758 12.2429 14.2035 12.3636 13.3943L12.3775 13.3029C12.4595 12.7486 12.5971 12.4209 14.4622 12.1248C15.4097 11.9746 15.6589 12.3533 16.0043 12.8777C16.0425 12.9358 16.0807 12.9928 16.1198 13.0499C16.4479 13.5297 16.691 13.6394 17.0582 13.8064C17.2227 13.881 17.428 13.9751 17.7031 14.1314C18.3551 14.504 18.3551 14.9247 18.3551 15.8472V15.9518C18.3551 16.3434 18.3168 16.6872 18.2566 16.9859C19.3478 15.6185 20 13.8854 20 12C20 8.70089 18.003 5.8682 15.1519 4.64482C14.5987 5.01813 13.8398 5.54726 13.575 5.91C13.4396 6.09538 13.2482 7.04166 12.6257 7.11976C12.4626 7.14023 12.2438 7.12589 12.012 7.11097C11.3905 7.07058 10.5402 7.01606 10.268 7.75495C10.0952 8.2232 10.0648 9.49445 10.6239 10.1543C10.7134 10.2597 10.7307 10.4547 10.6699 10.6735C10.59 10.9608 10.4286 11.1356 10.3783 11.1717C10.2819 11.1163 10.0896 10.8931 9.95938 10.7412C9.64554 10.3765 9.25405 9.92233 8.74797 9.78176C8.56395 9.73083 8.36166 9.68867 8.16548 9.64736C7.6164 9.53227 6.99443 9.40134 6.84992 9.09302C6.74442 8.8672 6.74488 8.55621 6.74529 8.22764C6.74529 7.8112 6.74529 7.34029 6.54129 6.88256C6.46246 6.70541 6.35689 6.56446 6.23509 6.45329ZM12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22Z"></path></svg>',title:"Http 请求",type:"httpNode",sortNo:600,description:"通过 HTTP 请求获取数据"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M23 12L15.9289 19.0711L14.5147 17.6569L20.1716 12L14.5147 6.34317L15.9289 4.92896L23 12ZM3.82843 12L9.48528 17.6569L8.07107 19.0711L1 12L8.07107 4.92896L9.48528 6.34317L3.82843 12Z"></path></svg>',title:"动态代码",type:"codeNode",sortNo:700,description:"动态执行代码"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 4C2 3.44772 2.44772 3 3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4ZM4 5V19H20V5H4ZM7 8H17V11H15V10H13V14H14.5V16H9.5V14H11V10H9V11H7V8Z"></path></svg>',title:"内容模板",type:"templateNode",sortNo:800,description:"通过模板引擎生成内容"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M6 5.1438V16.0002H18.3391L6 5.1438ZM4 2.932C4 2.07155 5.01456 1.61285 5.66056 2.18123L21.6501 16.2494C22.3423 16.8584 21.9116 18.0002 20.9896 18.0002H6V22H4V2.932Z"></path></svg>',title:"结束节点",type:"endNode",sortNo:900,description:"结束定义输出参数"}],i=[{label:"基础节点",value:"base"},{label:"业务工具",value:"tools"}],s=[],a=gr(),l=a.customNodes;if(l){const x=Object.keys(l).sort((p,_)=>(l[p].sortNo||0)-(l[_].sortNo||0));for(let p of x)l[p].group==="base"?o.push({type:p,...l[p]}):s.push({icon:l[p].icon,title:l[p].title,type:p});o.sort((p,_)=>(p.sortNo||0)-(_.sortNo||0))}if(a.hiddenNodes){const x=typeof a.hiddenNodes=="function"?a.hiddenNodes():a.hiddenNodes;if(Array.isArray(x)){for(let p of x)for(let _=0;_<o.length;_++)if(o[_].type===p){o.splice(_,1);break}}}var c=k_(),u=W(c),g=W(u),f=W(g);Ud(f,{style:"width: 100%",get items(){return i},onChange:x=>{te(n,x.value.toString(),!0)}}),Y(g);var h=B(g,2),v=W(h);Yt(v,21,()=>o,Qr,(x,p)=>{fl(x,ht(()=>d(p)))}),Y(v);var b=B(v,2);Yt(b,21,()=>s,Qr,(x,p)=>{fl(x,ht(()=>d(p)))}),Y(b),Y(h),Y(u);var C=B(u,2);Je(C,{onclick:()=>{te(r,d(r)?"":"show",!0)},children:(x,p)=>{var _=Ze(),m=he(_);{var k=P=>{var O=$_();D(P,O)},N=P=>{var O=E_();D(P,O)};me(m,P=>{d(r)==="show"?P(k):P(N,!1)})}D(x,_)},$$slots:{default:!0}}),Y(c),De(()=>{Ot(c,1,`tf-toolbar ${d(r)??""}`),pt(v,`display: ${d(n)==="base"?"flex":"none"}`),pt(b,`display: ${d(n)!=="base"?"flex":"none"}`)}),D(e,c),ge()}ce(Vf,{},[],[],!0);const S_=()=>{const{nodeLookup:e}=et();return{getNode:n=>{var o;return(o=J(e).get(n))==null?void 0:o.internals.userNode}}},P_=()=>{const{nodes:e}=et();return{ensureParentInNodesBefore:(n,r)=>{e.update(o=>{let i=-1;for(let l=0;l<o.length;l++)if(o[l].id===n){i=l;break}if(i<=0)return o;let s=-1;for(let l=0;l<i;l++)if(o[l].parentId===n||o[l].id===r){s=l;break}if(s==-1)return o;const a=o[i];for(let l=i;l>s;l--)o[l]=o[l-1];return o[s]=a,o})}}},N_=()=>{const{edges:e}=et();return{getEdgesByTarget:n=>J(e).filter(o=>o.target===n)}};var T_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),M_=ie('<div class="heading svelte-q0cqsa"><!> <!></div> <!>',1),H_=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),D_=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),V_=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><div class="slider-container svelte-q0cqsa"><span class="svelte-q0cqsa"> </span> <input/></div></div>',1),O_=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),A_=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),L_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),I_=ie('<div class="heading svelte-q0cqsa"><!> <!></div> <!>',1),z_=ie("<!> <!> <div></div> <!>",1);const R_={hash:"svelte-q0cqsa",code:`.heading.svelte-q0cqsa {display:flex;align-items:center;margin-bottom:10px;}.setting-title.svelte-q0cqsa {font-size:12px;color:#999;margin-bottom:4px;margin-top:10px;}.setting-item.svelte-q0cqsa {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}
10
+
11
+ /* 新增样式 */.slider-container.svelte-q0cqsa {width:100%;display:flex;flex-direction:column;gap:4px;}.slider-container.svelte-q0cqsa span:where(.svelte-q0cqsa) {font-size:12px;color:#666;display:flex;justify-content:space-between;align-items:center;}input[type="range"].svelte-q0cqsa {width:100%;height:4px;background:#ddd;border-radius:2px;outline:none;-webkit-appearance:none;}input[type="range"].svelte-q0cqsa::-webkit-slider-thumb {-webkit-appearance:none;width:14px;height:14px;background:#007bff;border-radius:50%;cursor:pointer;}`};function Of(e,t){var C;fe(t,!0),at(e,R_);const n=w(t,"data",7),r=Nt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn(),s=jt(),{updateNodeData:a}=s,l=x=>{a(o,x)},c=(x,p)=>{var _;l({[x]:(_=p.target)==null?void 0:_.value})},u={...r,id:o,data:n()},g=document.createElement("div"),h=gr().customNodes[t.type];(C=h.render)==null||C.call(h,g,u,s);const v=h.forms;let b;un(()=>{n().expand&&b&&b.append(g)}),un(()=>{var x;n()&&((x=h.onUpdate)==null||x.call(h,g,{...u,data:n()}))}),un(()=>{!n().parameters&&h.parameters&&l({parameters:Ss(JSON.parse(JSON.stringify(h.parameters)))})}),un(()=>{!n().outputDefs&&h.outputDefs&&l({outputDefs:Ss(JSON.parse(JSON.stringify(h.outputDefs)))})});{const x=_=>{var m=Ze(),k=he(m);fa(k,()=>h.icon),D(_,m)};let p=Ee(()=>({...n(),description:h.description}));En(e,ht({get data(){return d(p)}},()=>r,{icon:x,children:(_,m)=>{var k=z_(),N=he(k);{var P=R=>{var E=M_(),$=he(E),S=W($);it(S,{level:3,children:(z,j)=>{Te();var Z=Re("输入参数");D(z,Z)},$$slots:{default:!0}});var T=B(S,2);{var M=z=>{Je(z,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(j,Z)=>{var ee=T_();D(j,ee)},$$slots:{default:!0}})};me(T,z=>{h.parametersAddEnable!==!1&&z(M)})}Y($);var H=B($,2);Ut(H,{}),D(R,E)};me(N,R=>{h.parametersEnable!==!1&&R(P)})}var O=B(N,2);{var L=R=>{var E=Ze(),$=he(E);Yt($,17,()=>v,Qr,(S,T)=>{var M=Ze(),H=he(M);{var z=Z=>{var ee=H_(),re=he(ee),Q=W(re,!0);Y(re);var de=B(re,2),ne=W(de);{let _e=Ee(()=>n()[d(T).name]||d(T).defaultValue);Ct(ne,ht({get placeholder(){return d(T).placeholder},style:"width: 100%",get value(){return d(_e)}},()=>d(T).attrs,{onchange:Ne=>{c(d(T).name,Ne)}}))}Y(de),De(()=>vt(Q,d(T).label)),D(Z,ee)},j=Z=>{var ee=Ze(),re=he(ee);{var Q=ne=>{var _e=D_(),Ne=he(_e),Ve=W(Ne,!0);Y(Ne);var le=B(Ne,2),pe=W(le);{let se=Ee(()=>n()[d(T).name]||d(T).defaultValue);Tt(pe,ht({rows:3,get placeholder(){return d(T).placeholder},style:"width: 100%",get value(){return d(se)}},()=>d(T).attrs,{onchange:U=>{c(d(T).name,U)}}))}Y(le),De(()=>vt(Ve,d(T).label)),D(ne,_e)},de=ne=>{var _e=Ze(),Ne=he(_e);{var Ve=pe=>{var se=V_(),U=he(se),ue=W(U,!0);Y(U);var F=B(U,2),we=W(F),Pe=W(we),Oe=W(Pe);Y(Pe);var Be=B(Pe,2);ir(Be);var Le=ye=>l({[d(T).name]:parseFloat(ye.target.value)});tn(Be,()=>({class:"nodrag",type:"range",...d(T).attrs,value:n()[d(T).name]??d(T).defaultValue,oninput:Le}),void 0,void 0,"svelte-q0cqsa"),Y(we),Y(F),De(()=>{vt(ue,d(T).label),vt(Oe,`${d(T).description??""}: ${n()[d(T).name]??d(T).defaultValue??""}`)}),D(pe,se)},le=pe=>{var se=Ze(),U=he(se);{var ue=we=>{var Pe=O_(),Oe=he(Pe),Be=W(Oe,!0);Y(Oe);var Le=B(Oe,2),ye=W(Le);{let Ae=Ee(()=>d(T).options||[]),Ue=Ee(()=>n()[d(T).name]?[n()[d(T).name]]:[d(T).defaultValue]);hn(ye,{get items(){return d(Ae)},style:"width: 100%",get placeholder(){return d(T).placeholder},onSelect:gt=>{const K=gt.value;l({[d(T).name]:K})},get value(){return d(Ue)}})}Y(Le),De(()=>vt(Be,d(T).label)),D(we,Pe)},F=we=>{var Pe=Ze(),Oe=he(Pe);{var Be=ye=>{var Ae=A_(),Ue=he(Ae),gt=W(Ue,!0);Y(Ue);var K=B(Ue,2),Ge=W(K);{let rt=Ee(()=>{var dt;return(dt=d(T).chosen)==null?void 0:dt.buttonText});jd(Ge,{style:"width: 100%",get placeholder(){return d(T).placeholder},get buttonText(){return d(rt)},onChosen:(dt,on,tt)=>{var $e,Fe;(Fe=($e=d(T).chosen)==null?void 0:$e.onChosen)==null||Fe.call($e,l,dt,on,tt)},get value(){var dt;return n()[((dt=d(T).chosen)==null?void 0:dt.valueDataKey)||""]},get label(){var dt;return n()[((dt=d(T).chosen)==null?void 0:dt.labelDataKey)||""]}})}Y(K),De(()=>vt(gt,d(T).label)),D(ye,Ae)},Le=ye=>{var Ae=Ze(),Ue=he(Ae);{var gt=K=>{it(K,ht({level:3,mt:"10px"},()=>d(T).attrs,{children:(Ge,rt)=>{Te();var dt=Re();De(()=>vt(dt,d(T).label)),D(Ge,dt)},$$slots:{default:!0}}))};me(Ue,K=>{d(T).type==="heading"&&K(gt)},!0)}D(ye,Ae)};me(Oe,ye=>{d(T).type==="chosen"?ye(Be):ye(Le,!1)},!0)}D(we,Pe)};me(U,we=>{d(T).type==="select"?we(ue):we(F,!1)},!0)}D(pe,se)};me(Ne,pe=>{d(T).type==="slider"?pe(Ve):pe(le,!1)},!0)}D(ne,_e)};me(re,ne=>{d(T).type==="textarea"?ne(Q):ne(de,!1)},!0)}D(Z,ee)};me(H,Z=>{d(T).type==="input"?Z(z):Z(j,!1)})}D(S,M)}),D(R,E)};me(O,R=>{v&&R(L)})}var V=B(O,2);Vn(V,R=>b=R,()=>b);var A=B(V,2);{var I=R=>{var E=I_(),$=he(E),S=W($);it(S,{level:3,mt:"10px",children:(z,j)=>{Te();var Z=Re("输出参数");D(z,Z)},$$slots:{default:!0}});var T=B(S,2);{var M=z=>{Je(z,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(j,Z)=>{var ee=L_();D(j,ee)},$$slots:{default:!0}})};me(T,z=>{h.outputDefsAddEnable!==!1&&z(M)})}Y($);var H=B($,2);hr(H,{}),D(R,E)};me(A,R=>{h.outputDefsEnable!==!1&&R(I)})}De(()=>{pt(V,h.rootStyle||""),Ot(V,1,wn(h.rootClass),"svelte-q0cqsa")}),D(_,k)},$$slots:{icon:!0,default:!0}}))}return ge({get data(){return n()},set data(x){n(x),y()}})}ce(Of,{data:{}},[],[],!0);const B_=()=>{const e=et();return{updateEdgeData:(n,r,o)=>{const i=J(e.edgeLookup).get(n);if(!i)return;const s=typeof r=="function"?r(i):r;i.data=o!=null&&o.replace?s:{...i.data,...s},e.edges.update(a=>a.map(l=>l.id===n?i:l))}}},q_=()=>{const{edges:e}=et();return{deleteEdge:n=>{e.update(r=>r.filter(o=>o.id!==n))}}};var Y_=ie('<div class="panel-content svelte-80qc4q"><div>边属性设置</div> <div class="setting-title svelte-80qc4q">边条件设置</div> <div class="setting-item svelte-80qc4q"><!></div> <div class="setting-item svelte-80qc4q" style="padding: 8px 0"><!> <!></div></div>'),F_=ie("<!> <!> <!> <!>",1),W_=ie('<div style="position: relative; height: 100%; width: 100%;overflow: hidden"><!> <!></div>');const X_={hash:"svelte-80qc4q",code:".panel-content.svelte-80qc4q {padding:10px;background-color:#fff;border-radius:5px;box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);width:200px;border:1px solid #efefef;}.setting-title.svelte-80qc4q {margin:10px 0;font-size:12px;color:#999;}.setting-item.svelte-80qc4q {display:flex;gap:5px;align-items:center;justify-content:end;}"};function Af(e,t){fe(t,!0),at(e,X_);const[n,r]=ct(),o=()=>oe(L,"$nodes",n),i=()=>oe(V,"$edges",n),s=()=>oe(A,"$viewport",n),a=w(t,"onInit",7),l=jt();a()(l);let c=zt(!1),u=zt(void 0);const{updateEdgeData:g}=B_(),f=T=>{T.preventDefault(),T.dataTransfer&&(T.dataTransfer.dropEffect="move")},h=T=>{var Z;T.preventDefault();const M=l.screenToFlowPosition({x:T.clientX-250,y:T.clientY-100}),H=(Z=T.dataTransfer)==null?void 0:Z.getData("application/tinyflow"),z=H?JSON.parse(H):{},j={id:`node_${Ir()}`,position:M,data:{},...z};ws.addNode(j),ws.selectNodeOnly(j.id)},{getNode:v}=S_(),b=T=>{const M=v(T.source),H=v(T.target);if(T.sourceHandle==="loop_handle"||M.parentId){const z=l.getEdges();for(let j of z)if(j.target===T.target){const Z=v(j.source);if(T.sourceHandle==="loop_handle"&&Z.parentId!==M.id||M.parentId&&Z.parentId!==M.parentId)return!1}}return!(!M.parentId&&H.parentId&&H.parentId!==M.id)},{ensureParentInNodesBefore:C}=P_(),x=(T,M)=>{if(!M.isValid)return;const H=M.toNode;if(H.parentId)return;const z=M.fromNode,j=M.fromHandle,Z={position:{...H.position}};if(j.id==="loop_handle"?Z.parentId=z.id:z.parentId&&(Z.parentId=z.parentId),Z.parentId){const ee=v(Z.parentId);Z.position={x:H.position.x-ee.position.x,y:H.position.y-ee.position.y},C(Z.parentId,H.id),l.updateNode(H.id,Z)}},{getEdgesByTarget:p}=N_(),_=T=>{T.edges.forEach(H=>{var j;H.id===((j=d(u))==null?void 0:j.id)&&(te(u,null),te(c,!1));const z=v(H.target);if(z&&z.parentId){const Z=p(H.target),ee=v(z.parentId);if(Z.length===0)l.updateNode(z.id,{parentId:void 0,position:{x:z.position.x+ee.position.x,y:z.position.y+ee.position.y}});else{let re=!1;for(let Q=0;Q<Z.length;Q++){const de=Z[Q],ne=v(de.source);if(ne.parentId||ne.type==="loopNode"){re=!0;break}}re||l.updateNode(z.id,{parentId:void 0,position:{x:z.position.x+ee.position.x,y:z.position.y+ee.position.y}})}}})},{deleteEdge:m}=q_(),k=(T,M)=>{},N=T=>{},P={},O=gr().customNodes;if(O)for(let T of Object.keys(O))P[T]=Of;const{nodes:L,edges:V,viewport:A}=et(),I=gr().onDataChange;I&&(L.subscribe(()=>{I({nodes:o(),edges:i(),viewport:s()},{eventType:"nodesChange"})}),V.subscribe(()=>{I({nodes:o(),edges:i(),viewport:s()},{eventType:"edgesChange"})}),A.subscribe(()=>{I({nodes:o(),edges:i(),viewport:s()},{eventType:"viewportChange"})}));var R=W_(),E=W(R);{let T=Ee(()=>({...x_,...P})),M=Ee(()=>({markerEnd:{type:Vr.ArrowClosed,width:20,height:20}}));Md(E,ht({get nodeTypes(){return d(T)}},()=>ws,{class:"tinyflow-logo",isValidConnection:b,onconnectend:x,onconnectstart:k,onconnect:N,connectionRadius:50,onedgecreate:H=>({...H,id:Ir()}),ondelete:_,onclick:H=>{const z=H.target;z.classList.contains("svelte-flow__edge-interaction")||z.classList.contains("panel-content")||z.closest(".panel-content")||(te(c,!1),te(u,null))},get defaultEdgeOptions(){return d(M)},$$events:{drop:h,dragover:f,edgeclick:H=>{te(c,!0),te(u,H.detail.edge,!0)}},children:(H,z)=>{var j=F_(),Z=he(j);Bd(Z,{});var ee=B(Z,2);Id(ee,{});var re=B(ee,2);Yd(re,{});var Q=B(re,2);{var de=ne=>{ii(ne,{children:(_e,Ne)=>{var Ve=Y_(),le=B(W(Ve),4),pe=W(le);{let F=Ee(()=>{var we,Pe;return(Pe=(we=d(u))==null?void 0:we.data)==null?void 0:Pe.condition});Tt(pe,{rows:3,placeholder:"请输入边条件",style:"width: 100%",get value(){return d(F)},onchange:we=>{var Pe;d(u)&&g(d(u).id,{condition:(Pe=we.target)==null?void 0:Pe.value})}})}Y(le);var se=B(le,2),U=W(se);Je(U,{onclick:()=>{var F;m((F=d(u))==null?void 0:F.id),te(c,!1)},children:(F,we)=>{Te();var Pe=Re("删除");D(F,Pe)},$$slots:{default:!0}});var ue=B(U,2);Je(ue,{primary:!0,onclick:()=>{te(c,!1)},children:(F,we)=>{Te();var Pe=Re("保存");D(F,Pe)},$$slots:{default:!0}}),Y(se),Y(Ve),D(_e,Ve)},$$slots:{default:!0}})};me(Q,ne=>{d(c)&&ne(de)})}D(H,j)},$$slots:{default:!0}}))}var $=B(E,2);Vf($,{}),Y(R),D(e,R);var S=ge({get onInit(){return a()},set onInit(T){a(T),y()}});return r(),S}ce(Af,{onInit:{}},[],[],!0);function Z_(e,t){fe(t,!0);const n=w(t,"options",7),r=w(t,"onInit",7);let{data:o}=n();if(typeof o=="string")try{o=JSON.parse(o.trim())}catch{console.error("Invalid JSON data:",o)}return ws.init((o==null?void 0:o.nodes)||[],(o==null?void 0:o.edges)||[]),Wr("tinyflow_options",n()),Hd(e,{fitView:!0,children:(i,s)=>{Af(i,{get onInit(){return r()}})},$$slots:{default:!0}}),ge({get options(){return n()},set options(i){n(i),y()},get onInit(){return r()},set onInit(i){r(i),y()}})}customElements.define("tinyflow-component",ce(Z_,{options:{},onInit:{}},[],[],!1));const K_=We.defineComponent({__name:"Tinyflow",props:{className:{},style:{},data:{},provider:{},customNodes:{},onNodeExecute:{type:Function},hiddenNodes:{type:[Array,Function]},onDataChange:{type:Function}},setup(e,{expose:t}){const n=e,r=We.ref(null);let o=null;return We.onMounted(()=>{r.value&&(o=new _m({...n,element:r.value}))}),We.onUnmounted(()=>{o&&(o.destroy(),o=null)}),t({getData:()=>o?o.getData():(console.warn("Tinyflow instance is not initialized"),null)}),(s,a)=>(We.openBlock(),We.createElementBlock("div",{ref_key:"divRef",ref:r,class:We.normalizeClass(["tinyflow",s.className]),style:We.normalizeStyle(s.style)},null,6))}});nt.Tinyflow=K_,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"})});
12
+ //# sourceMappingURL=index.umd.js.map