@iterms/tinyflow-ai-vue 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,12 +1,38 @@
1
- (function(rt,We){typeof exports=="object"&&typeof module<"u"?We(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],We):(rt=typeof globalThis<"u"?globalThis:rt||self,We(rt.TinyflowVue={},rt.Vue))})(this,function(rt,We){"use strict";var cb=Object.defineProperty;var Xf=rt=>{throw TypeError(rt)};var db=(rt,We,yt)=>We in rt?cb(rt,We,{enumerable:!0,configurable:!0,writable:!0,value:yt}):rt[We]=yt;var kt=(rt,We,yt)=>db(rt,typeof We!="symbol"?We+"":We,yt),vl=(rt,We,yt)=>We.has(rt)||Xf("Cannot "+yt);var ke=(rt,We,yt)=>(vl(rt,We,"read from private field"),yt?yt.call(rt):We.get(rt)),mt=(rt,We,yt)=>We.has(rt)?Xf("Cannot add the same private member more than once"):We instanceof WeakSet?We.add(rt):We.set(rt,yt),At=(rt,We,yt,Bn)=>(vl(rt,We,"write to private field"),Bn?Bn.call(rt,yt):We.set(rt,yt),yt),Eo=(rt,We,yt)=>(vl(rt,We,"access private method"),yt);var If,fi,_o,bo,vr,gi,hi,zr,xo,pr,Jn,Rr,Qn,Zf,Kf,pl,mr,Co,vi,Ns,Uf,er,vn;typeof window<"u"&&((If=window.__svelte??(window.__svelte={})).v??(If.v=new Set)).add("5");let Bn=!1,jf=!1;function Gf(){Bn=!0}Gf();const _i=1,bi=2,ml=4,Jf=8,Qf=16,e1=1,t1=2,yl=4,n1=8,r1=16,wl=1,o1=2,_l="[",Vs="[!",Os="]",yr={},St=Symbol(),i1="http://www.w3.org/1999/xhtml",s1="http://www.w3.org/2000/svg",a1="@attach",bl=!1;var qr=Array.isArray,l1=Array.prototype.indexOf,As=Array.from,xi=Object.keys,wr=Object.defineProperty,qn=Object.getOwnPropertyDescriptor,xl=Object.getOwnPropertyDescriptors,u1=Object.prototype,c1=Array.prototype,Ls=Object.getPrototypeOf,Cl=Object.isExtensible;function ko(e){return typeof e=="function"}const wt=()=>{};function d1(e){return e()}function So(e){for(var t=0;t<e.length;t++)e[t]()}function f1(){var e,t,n=new Promise((r,o)=>{e=r,t=o});return{promise:n,resolve:e,reject:t}}function tr(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,nr=4096,pn=8192,br=16384,zs=32768,Yr=65536,El=1<<17,g1=1<<18,Rs=1<<19,Bs=1<<20,qs=1<<21,Ys=1<<22,xr=1<<23,kn=Symbol("$state"),Fs=Symbol("legacy props"),h1=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")}},v1=1,Xs=3,Fr=8;function p1(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Ei(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function m1(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function y1(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function w1(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function _1(e){throw new Error("https://svelte.dev/e/effect_orphan")}function b1(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function x1(){throw new Error("https://svelte.dev/e/hydration_failed")}function C1(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function $1(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function E1(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function k1(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function No(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function S1(){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 at=null;function ki(e){at=e}function Cr(e){return Us().get(e)}function Wr(e,t){return Us().set(e,t),t}function P1(e){return Us().has(e)}function fe(e,t=!1,n){at={p:at,c:null,e:null,s:e,x:null,l:Bn&&!t?{s:null,u:null,$:[]}:null}}function ge(e){var t=at,n=t.e;if(n!==null){t.e=null;for(var r of n)Xl(r)}return e!==void 0&&(t.x=e),at=t.p,e??{}}function To(){return!Bn||at!==null&&at.l===null}function Us(e){return at===null&&Ei(),at.c??(at.c=new Map(N1(at)||void 0))}function N1(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}const T1=new WeakMap;function M1(e){var t=Ie;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 js(e,t)}function js(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=T1.get(e);t&&(wr(e,"message",{value:t.message}),wr(e,"stack",{value:t.stack}))}const H1=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 D1(e){Ho.length===0&&H1(Ml),Ho.push(e)}function V1(){Mo.length>0&&Tl(),Ho.length>0&&Ml()}function O1(){for(var e=Ie.b;e!==null&&!e.has_pending_snippet();)e=e.parent;return e===null&&p1(),e}function Vo(e){var t=Gt|Wt,n=Xe!==null&&(Xe.f&Gt)!==0?Xe:null;return Ie===null||n!==null&&(n.f&an)!==0?t|=an:Ie.f|=Rs,{ctx:at,deps:null,effects:null,equals:Sl,f:t,fn:e,reactions:null,rv:0,v:St,wv:0,parent:n??Ie,ac:null}}function A1(e,t){let n=Ie;n===null&&m1();var r=n.b,o=void 0,i=Kr(St),s=null,a=!Xe;return W1(()=>{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 L1(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=Ie;Hn(L1(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(rr!==null)rr.set(e,e.v);else{var n=(ir||(e.f&an)!==0)&&e.deps!==null?nr:_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=Ie,s=I1(),a=O1();Promise.all(t.map(l=>A1(l))).then(l=>{o==null||o.activate(),s();try{n([...e.map(r),...l])}catch(c){(i.f&br)===0&&js(c,i)}o==null||o.deactivate(),Ol()}).catch(l=>{a.error(l)})}function I1(){var e=Ie,t=Xe,n=at;return function(){Hn(e),Mn(t),ki(n)}}function Ol(){Hn(null),Mn(null),ki(null)}const Si=new Set;let It=null,rr=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,Qn);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,Jn,[]);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,Qn,pl).call(this),It===this&&(ke(this,vr)===0&&Si.delete(this),this.deactivate())}flush_effects(){var t=Ur;Js=!0;try{var n=0;for(Ql(!0);Xr.length>0;){if(n++>1e3){var r,o;z1()}Eo(this,Qn,Zf).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),or(t);for(const t of ke(this,Jn))xt(t,Wt),or(t);for(const t of ke(this,Rr))xt(t,Wt),or(t);At(this,pr,[]),At(this,Jn,[]),this.flush()}else this.deactivate()}add_callback(t){ke(this,bo).add(t)}settled(){return(ke(this,gi)??At(this,gi,f1())).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,Jn=new WeakMap,Rr=new WeakMap,Qn=new WeakSet,Zf=function(t){var i;Xr=[];var n=null;if(Si.size>1){n=new Map,rr=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,Qn,Kf).call(this,s);if(ke(this,zr).length===0&&ke(this,vr)===0){var r=ke(this,pr),o=ke(this,Jn);At(this,pr,[]),At(this,Jn,[]),At(this,Rr,[]),Eo(this,Qn,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,Jn))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);rr=null}for(const s of ke(this,zr))jr(s);for(const s of ke(this,xo))jr(s);At(this,zr,[]),At(this,xo,[])},Kf=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,Jn).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),jr(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(V1(),Xr.length===0)return n===It&&n.flush(),Ni=null,t;n.flush_effects()}}function z1(){try{b1()}catch(e){js(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(jr(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null&&r.ac===null?jl(r):r.fn=null),Mi>o&&(r.f&Bs)!==0)break}}for(;n<t;n+=1)or(e[n])}}function or(e){for(var t=Ni=e;t.parent!==null;){t=t.parent;var n=t.f;if(Js&&t===Ie&&(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&&at!==null&&at.l!==null&&((o=at.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))&&k1();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:nr)),e.wv=ru(),Rl(e,Wt),To()&&Ie!==null&&(Ie.f&_t)!==0&&(Ie.f&(Yn|_r))===0&&(cn===null?Z1([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===Ie||((a&Wt)===0&&xt(s,t),(a&Gt)!==0?Rl(s,nr):(a&Wt)===0&&or(s))}}function Pn(e){if(typeof e!="object"||e===null||kn in e)return e;const t=Ls(e);if(t!==u1&&t!==c1)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)&&$1();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||Ie!==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 x=Reflect.getOwnPropertyDescriptor(a,l);if(x!=null&&x.set&&x.set.call(u,c),!f){if(r&&typeof l=="string"){var C=n.get("length"),p=Number(l);Number.isInteger(p)&&p>=C.v&&te(C,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(){E1()}})}function Bl(e){try{if(e!==null&&typeof e=="object"&&kn in e)return e[kn]}catch{}return e}function R1(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 R(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){Ie===null&&Xe===null&&_1(),Xe!==null&&(Xe.f&an)!==0&&Ie===null&&w1(),kr&&y1()}function B1(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=Ie;o!==null&&(o.f&pn)!==0&&(e|=pn);var i={ctx:at,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{jr(i),i.f|=zs}catch(l){throw Rt(i),l}else t!==null&&or(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&&B1(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=Ie.f,n=!Xe&&(t&Yn)!==0&&(t&zs)===0;if(n){var r=at;(r.e??(r.e=[])).push(e)}else return Xl(e)}function Xl(e){return mn(Is|Bs,e,!1)}function q1(e){return Wl(),mn(Ci|Bs,e,!0)}function Y1(e){Zr.ensure();const t=mn(_r,e,!0);return()=>{Rt(t)}}function F1(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=at,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=at;Ao(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&_t)!==0&&xt(n,nr),zo(n)&&jr(n),t.ran=!1}})}function W1(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 X1(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&g1)!==0)&&e.nodes_start!==null&&e.nodes_end!==null&&(Ul(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&&jl(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=e.ac=null}function Ul(e,t){for(;e!==null;){var n=e===t?null:Nn(e);e.remove(),e=n}}function jl(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),or(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 Ur=!1;function Ql(e){Ur=e}let kr=!1;function eu(e){kr=e}let Xe=null,Tn=!1;function Mn(e){Xe=e}let Ie=null;function Hn(e){Ie=e}let Bt=null;function tu(e){Xe!==null&&(Bt===null?Bt=[e]:Bt.push(e))}let qt=null,en=0,cn=null;function Z1(e){cn=e}let Mi=1,Io=0,Sr=Io;function nu(e){Sr=e}let ir=!1;function ru(){return++Mi}function zo(e){var g;var t=e.f;if((t&Wt)!==0)return!0;if((t&nr)!==0){var n=e.deps,r=(t&an)!==0;if(n!==null){var o,i,s=(t&$i)!==0,a=r&&Ie!==null&&!ir,l=n.length;if((s||a)&&(Ie===null||(Ie.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||Ie!==null&&!ir)&&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,nr),or(i))}}function iu(e){var v;var t=qt,n=en,r=cn,o=Xe,i=ir,s=Bt,a=at,l=Tn,c=Sr,u=e.f;qt=null,en=0,cn=null,ir=(u&an)!==0&&(Tn||!Ur||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(!ir||(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|nr|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 M1(b)}finally{e.f^=qs,qt=t,en=n,cn=r,Xe=o,ir=i,Bt=s,ki(a),Tn=l,Sr=c}}function K1(e,t){let n=t.reactions;if(n!==null){var r=l1.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,nr),(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++)K1(e,n[r])}function jr(e){var t=e.f;if((t&br)===0){xt(e,_t);var n=Ie,r=Ur;Ie=e,Ur=!0;try{(t&Po)!==0?X1(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{Ur=r,Ie=n}}}function d(e){var t=e.f,n=(t&Gt)!==0;if(Xe!==null&&!Tn){var r=Ie!==null&&(Ie.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]:(!ir||!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,rr!=null&&rr.has(s))return rr.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 U1=-7169;function xt(e,t){e.f=e.f&U1|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 G1(e){He&&bt(e)!==null&&ta(e)}let au=!1;function J1(){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 Q1(e){var t=Xe,n=Ie;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 Q1(()=>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 ct(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=Ie;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[x,...C]=b;x.apply(i,[e,...C])}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=Ie;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function ie(e,t){var n=(t&wl)!==0,r=(t&o1)!==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 eg(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 eg(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){Ie.nodes_end=Ye,Sn();return}e!==null&&e.before(t)}function tg(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const ng=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function rg(e){return ng.includes(e)}const og={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 ig(e){return e=e.toLowerCase(),og[e]??e}const sg=["touchstart","touchmove"];function ag(e){return sg.includes(e)}const lg=["textarea","script","style","title"];function ug(e){return lg.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 cg(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&&x1(),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=ag(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=F1(()=>{var g=n??t.appendChild(ln());return yn(()=>{if(i){fe({});var f=at;f.c=i}o&&(r.$$events=o),He&&Zt(g,null),c=e(g,r)||{},He&&(Ie.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 dg(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){at===null&&Ei(),Bn&&at.l!==null?gg(at).m.push(e):un(()=>{const t=G(e);if(typeof t=="function")return t})}function ua(e){at===null&&Ei(),dn(()=>()=>G(e))}function fg(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function Di(){const e=at;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=fg(t,n,r);for(const l of s)l.call(e.x,a);return!a.defaultPrevented}return!0}}function gg(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}function ye(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 x=na(),C=r;if(x&&(u=document.createDocumentFragment(),u.append(C=ln())),s?o??(o=v&&yn(()=>v(C))):i??(i=v&&yn(()=>v(C))),x){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 hg(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 C=n();return qr(C)?C:C==null?[]:As(C)}),v,b;function x(){vg(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=Ie),v=d(h);var C=v.length;if(g&&C===0)return;g=C===0;let p=!1;if(He){var _=kl(s)===Vs;_!==(C===0)&&(s=Zs(),Lt(s),Jt(!1),p=!0)}if(He){for(var m=null,k,N=0;N<C;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}C>0&&Lt(Zs())}if(He)C===0&&i&&(u=yn(()=>i(s)));else if(na()){var L=new Set,V=It;for(N=0;N<C;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,B]of a.items)L.has(I)||V.skipped_effects.add(B.e);V.add_callback(x)}else x();p&&Jt(!0),d(h)}),He&&(s=Ye)}function vg(e,t,n,r,o,i,s,a,l){var H,z,U,Z;var c=(s&Jf)!==0,u=(s&(_i|bi))!==0,g=t.length,f=n.items,h=n.first,v=h,b,x=null,C,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(),(C??(C=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=x?x.next:v;Dn(n,x,O),Dn(n,O,L),da(O,L,o),x=O}else{var V=v?v.e.nodes_start:o;x=ca(V,n,x,x===null?n.first:x.next,m,k,P,i,s,l)}f.set(k,x),p=[],_=[],v=x.next;continue}if(u&&fu(N,m,P,s),(N.e.f&pn)!==0&&(Ti(N.e),c&&((z=N.a)==null||z.unfix(),(C??(C=new Set)).delete(N))),N!==v){if(b!==void 0&&b.has(N)){if(p.length<_.length){var A=_[0],I;x=A.prev;var B=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,B.prev,E.next),Dn(n,x,B),Dn(n,E,A),v=A,x=E,P-=1,p=[],_=[]}else b.delete(N),da(N,v,o),Dn(n,N.prev,N.next),Dn(n,N,x===null?n.first:x.next),Dn(n,x,N),x=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),x=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)(U=$[P].a)==null||U.measure();for(P=0;P<S;P+=1)(Z=$[P].a)==null||Z.fix()}hg(n,$,T)}}c&&Do(()=>{var ee;if(C!==void 0)for(N of C)(ee=N.a)==null||ee.apply()}),e.first=n.first&&n.first.e,e.last=x&&x.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&Qf)===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 x=document.createDocumentFragment();x.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=Ie;if(s===(s=t()??"")){He&&Sn();return}if(a.nodes_start!==null&&(Ul(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 pg(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 mg(e,t,n,r,o,i){let s=He;He&&Sn();var a,l,c=null;He&&Ye.nodeType===v1&&(c=Ye,Sn());var u=He?Ye:e,g;Er(()=>{const f=t()||null;var h=f==="svg"?s1: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&&ug(f)&&c.append(document.createComment(""));var v=He?bt(c):c.appendChild(ln());He&&(v===null?Jt(!1):Lt(v)),r(c,v)}Ie.nodes_end=c,u.before(c)})),a=f,a&&(l=a))},Yr),s&&(Jt(!0),Lt(u))}function lt(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 yg(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 wg(){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"?wg(e):e??""}const vu=[...`
2
- \r\f \v\uFEFF`];function _g(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 bg(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=_g(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=bg(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 S1();for(var r of e.options)r.selected=t.includes(mu(r));return}for(r of e.options){var o=mu(r);if(R1(o,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function xg(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 Fn(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,D1(n),J1()}}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 _u(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[h1]=n),n==null?e.removeAttribute(t):typeof n!="string"&&xu(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=xu(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 x=rg(P);if(tg(P)&&(P=P.slice(0,-7),k.capture=!0),!x&&v){if(m!=null)continue;e.removeEventListener(P,c[N],k),c[N]=null}if(m!=null)if(x)e[`__${P}`]=m,Gr([P]);else{let O=function(L){c[_].call(this,L)};c[N]=uu(P,e,O,k)}else x&&(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 C=_;a||(C=ig(C));var p=C==="defaultValue"||C==="defaultChecked";if(m==null&&!s&&!p)if(i[_]=null,C==="value"||C==="checked"){let k=e;const N=t===void 0;if(C==="value"){let P=k.defaultValue;k.removeAttribute(C),k.defaultValue=P,k.value=k.__value=N?P:null}else{let P=k.defaultChecked;k.removeAttribute(C),k.defaultChecked=P,k.checked=N?P:!1}}else e.removeAttribute(_);else p||f.includes(C)&&(s||typeof m!="string")?e[C]=m:typeof m!="function"&&be(e,C,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===a1&&(!a||v!==a[b])&&(l[b]&&Rt(l[b]),l[b]=yn(()=>yg(e,()=>v))),h[b]=v}a=h}),c){var g=e;Qt(()=>{va(g,a.value,!0),xg(g)})}u=!0})}function Oi(e){return e.__attributes??(e.__attributes={[yu]:e.nodeName.includes("-"),[wu]:e.namespaceURI===i1})}var bu=new Map;function xu(e){var t=bu.get(e.nodeName);if(t)return t;bu.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,Uf).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,Uf=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 Cu(e,t,n){var r=Eg.observe(e,()=>n(e[t]));Qt(()=>(G(()=>n(e[t])),r))}function $u(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&&$u(n(...o),e)&&t(null,...o))})}),()=>{Do(()=>{i&&$u(n(...i),e)&&t(null,...i)})}}),e}function qe(e=!1){const t=at,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&&q1(()=>{Eu(t,r),So(n.b)}),un(()=>{const o=G(()=>n.m.map(d1));return()=>{for(const i of o)typeof i=="function"&&i()}}),n.a.length&&un(()=>{Eu(t,r),So(n.a)})}function Eu(e,t){if(e.l.s)for(const n of e.l.s)d(n);t()}function Ue(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,x=>{c[b]=x,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 dt(){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=Ie;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 gt(e,t){return new Proxy({props:e,exclude:t,special:{},version:Kr(0),parent_effect:Ie},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&t1)!==0,i=(n&n1)!==0,s=(n&r1)!==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&&C1(),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 x=!1,C=((n&e1)!==0?Vo:Me)(()=>(x=!1,v()));i&&d(C);var p=Ie;return function(m,k){if(arguments.length>0){const N=k?d(C):o&&i?Pn(m):m;return te(C,N),x=!0,a!==void 0&&(a=N),m}return kr&&x||(p.f&br)!==0?C.v:d(C)}}function Mg(e){return new Hg(e)}class Hg{constructor(t){mt(this,er);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?cg: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,er,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=()=>{dg(ke(this,vn))}}$set(t){ke(this,vn).$set(t)}$on(t,n){ke(this,er)[t]=ke(this,er)[t]||[];const r=(...o)=>n.call(this,...o);return ke(this,er)[t].push(r),()=>{ke(this,er)[t]=ke(this,er)[t].filter(o=>o!==r)}}$destroy(){ke(this,vn).$destroy()}}er=new WeakMap,vn=new WeakMap;let ku;typeof HTMLElement=="function"&&(ku=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=Y1(()=>{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 ku{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 ut(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=ut(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]=Su(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Su(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 Su(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 Pu={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)),Pu.hasOwnProperty(t)?{space:Pu[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 Nu(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 Tu(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=Tu(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 Mu(e){return function(){return this.matches(e)}}function Hu(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:Hu(e)))}var Ug=Array.prototype.filter;function jg(){return Array.from(this.children)}function Gg(e){return function(){return Ug.call(this.children,e)}}function Jg(e){return this.selectAll(e==null?jg:Gg(typeof e=="function"?e:Hu(e)))}function Qg(e){typeof e!="function"&&(e=Mu(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 Du(e){return new Array(e.length)}function eh(){return new nn(this._enter||this._groups.map(Du),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),x=s[c]=new Array(v),C=l[c]=new Array(f);n(u,g,b,x,C,h,t);for(var p=0,_=0,m,k;p<v;++p)if(m=b[p]){for(p>=_&&(_=p+1);!(k=x[_])&&++_<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(Du),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 Vu(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)||Vu(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 Ou(e){return e.trim().split(/^|\s+/)}function ba(e){return e.classList||new Au(e)}function Au(e){this._node=e,this._names=Ou(e.getAttribute("class")||"")}Au.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 Lu(e,t){for(var n=ba(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Iu(e,t){for(var n=ba(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Vh(e){return function(){Lu(this,e)}}function Oh(e){return function(){Iu(this,e)}}function Ah(e,t){return function(){(t.apply(this,arguments)?Lu:Iu)(this,e)}}function Lh(e,t){var n=Ou(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 Uh(){return this.each(Kh)}function jh(e){var t=typeof e=="function"?e:Nu(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:Nu(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 zu(e,t,n){var r=Vu(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 zu(this,e,t)}}function dv(e,t){return function(){return zu(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 Ru=[null];function nn(e,t){this._groups=e,this._parents=t}function qo(){return new nn([[document.documentElement]],Ru)}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:Uh,append:jh,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]],Ru)}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 Bu(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 qu(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",x).on("touchmove.drag",C,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),Bu(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),qu(m.view,c),no(m),o.mouse("end",m)}function x(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 C(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,B,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,B=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]+B,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 Yu(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}\\)$`),Fu={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:Wu,formatHex:Wu,formatHex8:Nv,formatHsl:Tv,formatRgb:Xu,toString:Xu});function Wu(){return this.rgb().formatHex()}function Nv(){return this.rgb().formatHex8()}function Tv(){return Gu(this).formatHsl()}function Xu(){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?Zu(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]):Fu.hasOwnProperty(e)?Zu(Fu[e]):e==="transparent"?new Kt(NaN,NaN,NaN,0):null}function Zu(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,Yu(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:Ku,formatHex:Ku,formatHex8:Hv,formatRgb:Uu,toString:Uu}));function Ku(){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 Uu(){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 Gu(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?Gu(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,Yu(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(Ju(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("}${Ju(this.h)}, ${Zi(this.s)*100}%, ${Zi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ju(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 Qu=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?ec:function(t,n){return n-t?Ov(t,n,e):Qu(isNaN(t)?n:t)}}function ec(e,t){var n=t-e;return n?Vv(e,n):Qu(isNaN(e)?t:e)}const tc=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=ec(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 nc=180/Math.PI,Na={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function rc(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)*nc,skewX:Math.atan(l)*nc,scaleX:s,scaleY:a}}var Ki;function Rv(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Na:rc(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,rc(e.a,e.b,e.c,e.d,e.e,e.f))}function oc(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,x;++v<b;)g[(x=f[v]).i]=x.x(h);return g.join("")}}}var qv=oc(Rv,"px, ","px)","deg)"),Yv=oc(Bv,", ",")",")"),Fv=1e-12;function ic(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,x,C;if(b<Fv)C=Math.log(f/c)/t,x=function(P){return[a+P*h,l+P*v,c*Math.exp(t*P*C)]};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);C=(N-k)/t,x=function(P){var O=P*C,L=ic(k),V=c/(n*p)*(L*Xv(t*O+k)-Wv(k));return[a+V*h,l+V*v,c*L/ic(t*O+k)]}}return x.duration=C*1e3*t/Math.SQRT2,x}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,Uo=0,sc=1e3,Ui,jo,ji=0,Hr=0,Gi=0,Go=typeof performance=="object"&&performance.now?performance:Date,ac=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ta(){return Hr||(ac(Kv),Hr=Go.now()+Gi)}function Kv(){Hr=0}function Ji(){this._call=this._time=this._next=null}Ji.prototype=lc.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&&jo!==this&&(jo?jo._next=this:Ui=this,jo=this),this._call=e,this._time=n,Ma()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ma())}};function lc(e,t,n){var r=new Ji;return r.restart(e,t,n),r}function Uv(){Ta(),++oo;for(var e=Ui,t;e;)(t=Hr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--oo}function uc(){Hr=(ji=Go.now())+Gi,oo=Ko=0;try{Uv()}finally{oo=0,Gv(),Hr=0}}function jv(){var e=Go.now(),t=e-ji;t>sc&&(Gi-=t,ji=e)}function Gv(){for(var e,t=Ui,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:Ui=n);jo=e,Ma(r)}function Ma(e){if(!oo){Ko&&(Ko=clearTimeout(Ko));var t=e-Hr;t>24?(e<1/0&&(Ko=setTimeout(uc,e-Go.now()-Gi)),Uo&&(Uo=clearInterval(Uo))):(Uo||(ji=Go.now(),Uo=setInterval(jv,sc)),oo=1,ac(uc))}}function cc(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=[],dc=0,fc=1,Ha=2,Qi=3,gc=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:dc})}function Va(e,t){var n=xn(e,t);if(n.state>dc)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=lc(i,0,n.time);function i(c){n.state=fc,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!==fc)return l();for(u in r)if(h=r[u],h.name===n.name){if(h.state===Qi)return cc(s);h.state===gc?(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(cc(function(){n.state===Qi&&(n.state=gc,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 hc(e,t){var n;return(typeof t=="number"?ar:t instanceof Zo?tc:(n=Zo(t))?(t=n,tc):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:hc;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=Mu(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 Wn(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 Wn(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 Wn(i,this._parents,t,n)}function O0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Tu(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,x=f.length;b<x;++b)(h=f[b])&&ts(h,t,n,b,f,v);i.push(f),s.push(u)}return new Wn(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 vc(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=vc(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:hc;return t==null?this.styleTween(e,I0(e,r)).on("end.style."+e,vc(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 U0(e){return function(t){this.textContent=e.call(this,t)}}function j0(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&U0(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,j0(e))}function J0(){for(var e=this._name,t=this._id,n=pc(),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 Wn(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 Wn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function pc(){return++ep}var Xn=qo.prototype;Wn.prototype={constructor:Wn,select:V0,selectAll:O0,selectChild:Xn.selectChild,selectChildren:Xn.selectChildren,filter:S0,merge:P0,selection:L0,transition:J0,call:Xn.call,nodes:Xn.nodes,node:Xn.node,size:Xn.size,empty:Xn.empty,each:Xn.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]:Xn[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 Wn?(t=e._id,e=e._name):(t=pc(),(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 Wn(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 Zn(e,t,n){this.k=e,this.x=t,this.y=n}Zn.prototype={constructor:Zn,scale:function(e){return e===1?this:new Zn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Zn(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 Zn(1,0,0);mc.prototype=Zn.prototype;function mc(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 yc(){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 wc(){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,x=10;function C(E){E.property("__zoom",yc).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",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(E,$,S,T){var M=E.selection?E.selection():E;M.property("__zoom",yc),E!==M?k(E,$,S,T):M.interrupt().each(function(){N(this,arguments).event(T).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},C.scaleBy=function(E,$,S,T){C.scaleTo(E,function(){var M=this.__zoom.k,H=typeof $=="function"?$.apply(this,arguments):$;return M*H},S,T)},C.scaleTo=function(E,$,S,T){C.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,U=H.invert(z),Z=typeof $=="function"?$.apply(this,arguments):$;return n(_(p(H,Z),z,U),M,s)},S,T)},C.translateBy=function(E,$,S,T){C.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)},C.translateTo=function(E,$,S,T,M){C.transform(E,function(){var H=t.apply(this,arguments),z=this.__zoom,U=T==null?m(H):typeof T=="function"?T.apply(this,arguments):T;return n(os.translate(U[0],U[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 Zn($,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 Zn(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),U=t.apply(M,H),Z=S==null?m(U):typeof S=="function"?S.apply(M,H):S,ee=Math.max(U[1][0]-U[0][0],U[1][1]-U[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 Zn(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:C,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,U=E.clientY;Bu(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-U;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),qu(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(C.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,U,Z;for(Aa(E),z=0;z<T;++z)U=S[z],Z=_n(U,this),Z=[Z,this.__zoom.invert(Z),U.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,U,Z;for(Jo(E),H=0;H<M;++H)z=T[H],U=_n(z,this),S.touch0&&S.touch0[2]===z.identifier?S.touch0[0]=U:S.touch1&&S.touch1[2]===z.identifier&&(S.touch1[0]=U);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)),U=[(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)U=S.touch0[0],Z=S.touch0[1];else return;S.zoom("touch",n(_(z,U,Z),S.extent,s))}}function B(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])<x)){var U=gn(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return C.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:rs(+E),C):r},C.filter=function(E){return arguments.length?(e=typeof E=="function"?E:rs(!!E),C):e},C.touchable=function(E){return arguments.length?(o=typeof E=="function"?E:rs(!!E),C):o},C.extent=function(E){return arguments.length?(t=typeof E=="function"?E:rs([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),C):t},C.scaleExtent=function(E){return arguments.length?(i[0]=+E[0],i[1]=+E[1],C):[i[0],i[1]]},C.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],C):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},C.constrain=function(E){return arguments.length?(n=E,C):n},C.duration=function(E){return arguments.length?(a=+E,C):a},C.interpolate=function(E){return arguments.length?(l=E,C):l},C.on=function(){var E=c.on.apply(c,arguments);return E===c?C:E},C.clickDistance=function(E){return arguments.length?(b=(E=+E)*E,C):Math.sqrt(b)},C.tapDistance=function(E){return arguments.length?(x=+E,C):x},C}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 Kn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Kn||(Kn={}));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 _c={[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 bc(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 xc(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}=Un(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)},Cc=(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)),x=(h??0)*(v??0),C=i&&b>0;(!c.internals.handleBounds||C||b>=x||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 $c({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 Ec(e,t,n){const{width:r,height:o}=Un(n),{x:i,y:s}=n.internals.positionAbsolute;return Or(e,[[i,s],[i+r,s+o]],t)}const kc=(e,t,n)=>e<t?ao(Math.abs(e-t),1,t)/t:e>n?-ao(Math.abs(e-n),1,t)/t:0,Sc=(e,t,n=15,r=40)=>{const o=kc(e.x,r,t.width-r)*n,i=kc(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)}},Pc=(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)},Nc=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),x={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-x.left+x.right,y:v-x.top+x.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 Un(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 Tc=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 Mc=e=>"clientX"in e,jn=(e,t)=>{var i,s;const n=Mc(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)}},Hc=(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,...Tc(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 Dc({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 Vc({sourceX:e,sourceY:t,sourcePosition:n=Se.Bottom,targetX:r,targetY:o,targetPosition:i=Se.Top,curvature:s=.25}){const[a,l]=Dc({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[c,u]=Dc({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 Oc({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]=Oc({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const Ac={[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},Lc=(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=Ac[t],a=Ac[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 x={x:0,y:0},C={x:0,y:0},[p,_,m,k]=Oc({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 B=Math.abs(e[g]-n[g]);if(B<=i){const E=Math.min(i-1,i-B);s[g]===f?x[g]=(l[g]>e[g]?-1:1)*E:C[g]=(c[g]>n[g]?-1:1)*E}}if(t!==r){const B=g==="x"?"y":"x",E=s[g]===a[B],$=l[B]>c[B],S=l[B]<c[B];(s[g]===1&&(!E&&$||E&&S)||s[g]!==1&&(!E&&S||E&&$))&&(h=g==="x"?P:O)}const L={x:l.x+x.x,y:l.y+x.y},V={x:c.x+C.x,y:c.y+C.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+x.x,y:l.y+x.y},...h,{x:c.x+C.x,y:c.y+C.y},n],v,b,m,k]}function Vp(e,t,n,r){const o=Math.min(Lc(e,t)/2,Lc(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((x,C,p)=>{let _="";return p>0&&p<u.length-1?_=Vp(u[p-1],C,u[p+1],s):_=`${p===0?"M":"L"}${C.x} ${C.y}`,x+=_,x},""),g,f,h,v]}function Ic(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(!Ic(t)||!Ic(n))return null;const r=t.internals.handleBounds||zc(t.handles),o=n.internals.handleBounds||zc(n.handles),i=Rc((r==null?void 0:r.source)??[],e.sourceHandle),s=Rc(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 zc(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??Un(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 Rc(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,Un(o));o.internals.positionAbsolute=a}}function Bc(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,Un(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:qc(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 qc(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=Un(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=Ec(u,a,t));const g=qc(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=Pc(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=Un(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)),x=Math.max(g.height,Math.round(a.height)),C=(b-g.width)*f[0],p=(x-g.height)*f[1];(h>0||v>0||C||p)&&(o.push({id:c,type:"position",position:{x:l.position.x-h+C,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-C:0),height:x+(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=Tc(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 C=f.nodeElement.getBoundingClientRect(),p=co(h.extent)?h.extent:i;let{positionAbsolute:_}=h.internals;h.parentId&&h.extent==="parent"?_=Ec(_,v,t.get(h.parentId)):p&&(_=Or(_,p,v));const m={...h,measured:v,internals:{...h.internals,positionAbsolute:_,handleBounds:{source:Hc("source",f.nodeElement,C,u,h.id),target:Hc("target",f.nodeElement,C,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 Yc(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 Fc(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}`;Yc("source",l,u,e,o,s),Yc("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 Wc(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Wc(n,t):!1}function Xc(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||!Wc(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 Ua({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:x,handleSelector:C,domNode:p,isSelectable:_,nodeId:m,nodeClickDistance:k=0}){f=gn(p);function N({x:V,y:A},I){const{nodeLookup:B,nodeExtent:E,snapGrid:$,snapToGrid:S,nodeOrigin:T,onNodeDrag:M,onSelectionDrag:H,onError:z,updateNodePositions:U}=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(!B.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],j=Ve.y+Q.measured.height-ee.y2+E[1][1];ne=[[le,se],[pe,j]]}const{position:_e,positionAbsolute:Ne}=mp({nodeId:re,nextPosition:de,nodeLookup:B,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&&(U(a,!0),I&&(r||M||!m&&H))){const[re,Q]=Ua({nodeId:m,dragItems:a,nodeLookup:B});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:B}=t();if(!B){l=!1,cancelAnimationFrame(s);return}const[E,$]=Sc(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:B,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 U=Ya(V.sourceEvent,{transform:E,snapGrid:$,snapToGrid:S,containerBounds:u});if(i=U,a=Xp(A,B,U,m),a.size>0&&(n||M||!m&&H)){const[ee,re]=Ua({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:B,snapGrid:E,snapToGrid:$}=t();u=(A==null?void 0:A.getBoundingClientRect())||null,h=!1,I===0&&O(V),i=Ya(V.sourceEvent,{transform:B,snapGrid:E,snapToGrid:$,containerBounds:u}),c=jn(V.sourceEvent,u)}).on("drag",V=>{const{autoPanOnNodeDrag:A,transform:I,snapGrid:B,snapToGrid:E,nodeDragThreshold:$,nodeLookup:S}=t(),T=Ya(V.sourceEvent,{transform:I,snapGrid:B,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:B,onSelectionDragStop:E}=t();if(I(a,!1),o||B||!m&&E){const[$,S]=Ua({nodeId:m,dragItems:a,nodeLookup:A,dragging:!1});o==null||o(V.sourceEvent,a,$,S),B==null||B(V.sourceEvent,$,S),m||E==null||E(V.sourceEvent,S)}}}).filter(V=>{const A=V.target;return!V.button&&(!x||!Xc(A,`.${x}`,p))&&(!C||Xc(A,C,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 Up=250;function jp(e,t,n,r){var a,l;let o=[],i=1/0;const s=Kp(e,n,t+Up);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 Zc(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 Kc(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 Uc=()=>!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:x,isValidConnection:C=Uc,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),B=Kc(i,I),E=a==null?void 0:a.getBoundingClientRect();if(!E||!B)return;const $=Zc(o,B,r,l,t);if(!$)return;let S=jn(e,E),T=!1,M=null,H=!1,z=null;function U(){if(!u||!E)return;const[Ne,Ve]=Sc(S,E,N);f({x:Ne,y:Ve}),O=requestAnimationFrame(U)}const Z={...$,nodeId:o,type:B,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:_c[Z.position],toNode:null};_(Q);let de=Q;v==null||v(e,{nodeId:o,handleId:r,handleType:B});function ne(Ne){if(!k()||!Z){_e(Ne);return}const Ve=m();S=jn(Ne,E),L=jp(ni(S,Ve,!1,[1,1]),n,l,Z),T||(U(),T=!0);const le=jc(Ne,{handle:L,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:C,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:_c[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};x==null||x(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=Uc,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),x=b!=null&&b.classList.contains(`${a}-flow__handle`)?b:f,C={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const p=Kc(void 0,x),_=x.getAttribute("data-nodeid"),m=x.getAttribute("data-handleid"),k=x.classList.contains("connectable"),N=x.classList.contains("connectableend");if(!_||!p)return C;const P={source:g?_:r,sourceHandle:g?m:o,target:g?r:_,targetHandle:g?o:m};C.connection=P;const L=k&&N&&(n===Dr.Strict?g&&p==="source"||!g&&p==="target":_!==r||m!==o);C.isValid=L&&c(P),C.toHandle=Zc(_,p,m,u,n,!1)}return C}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 x=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(b=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},C=_=>{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=wc().on("start",x).on("zoom",g?C: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}),ja=({x:e,y:t,zoom:n})=>os.translate(e,t).scale(n),fo=(e,t)=>e.target.closest(`.${t}`),Gc=(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},Jc=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 x=_n(u),C=Jc(u),p=g*Math.pow(2,C);r.scaleTo(n,p,x,u);return}const f=u.deltaMode===1?20:1;let h=o===Kn.Vertical?0:u.deltaX*f,v=o===Kn.Horizontal?0:u.deltaY*f;!ds()&&u.shiftKey&&o!==Kn.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&&Gc(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&&Gc(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=wc().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(Jc);function x(I,B){return h?new Promise(E=>{f==null||f.transform(Ga(h,B==null?void 0:B.duration,()=>E(!0)),I)}):Promise.resolve(!1)}function C({noWheelClassName:I,noPanClassName:B,onPaneContextMenu:E,userSelectionActive:$,panOnScroll:S,panOnDrag:T,panOnScrollMode:M,panOnScrollSpeed:H,preventScrolling:z,zoomOnPinch:U,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:U,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:U,userSelectionActive:$,noPanClassName:B,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,B,E){const $=ja(I),S=f==null?void 0:f.constrain()($,B,E);return S&&await x(S),new Promise(T=>T(S))}async function m(I,B){const E=ja(I);return await x(E,B),new Promise($=>$(E))}function k(I){if(h){const B=ja(I),E=h.property("__zoom");(E.k!==I.zoom||E.x!==I.x||E.y!==I.y)&&(f==null||f.transform(h,B,null,{sync:!0}))}}function N(){const I=h?mc(h.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function P(I,B){return h?new Promise(E=>{f==null||f.scaleTo(Ga(h,B==null?void 0:B.duration,()=>E(!0)),I)}):Promise.resolve(!1)}function O(I,B){return h?new Promise(E=>{f==null||f.scaleBy(Ga(h,B==null?void 0:B.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 B=!Ln(I)||I<0?0:I;f==null||f.clickDistance(B)}return{update:C,destroy:p,setViewport:m,setViewportConstrained:_,getViewport:N,scaleTo:P,scaleBy:O,setScaleExtent:L,setTranslateExtent:V,syncViewport:k,setClickDistance:A}}var Qc;(function(e){e.Line="line",e.Handle="handle"})(Qc||(Qc={}));var u2=ie('<div role="button" tabindex="-1"><!></div>');function lr(e,t){fe(t,!1);const[n,r]=dt(),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(ze,"$flowId",n),f=()=>oe(Ve,"$isValidConnectionStore",n),h=()=>oe(se,"$onedgecreate",n),v=()=>oe(Be,"$onConnectAction",n),b=()=>oe(Ae,"$onConnectStartAction",n),x=()=>oe(me,"$onConnectEndAction",n),C=()=>oe(Ne,"$viewport",n),p=()=>oe(je,"$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 B=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),U=w(t,"class",12,void 0);const Z=Cr("svelteflow__node_id"),ee=Cr("svelteflow__node_connectable"),re=tt(),{connectionMode:Q,domNode:de,nodeLookup:ne,connectionRadius:_e,viewport:Ne,isValidConnection:Ve,lib:le,addEdge:pe,onedgecreate:se,panBy:j,cancelConnection:ue,updateConnection:F,autoPanOnConnect:we,edges:Pe,connectionLookup:Oe,onconnect:Be,onconnectstart:Ae,onconnectend:me,flowId:ze,connection:je}=re;function st($e){const Fe=Mc($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:j,onConnect:Le=>{var Et;const Mt=h()?h()(Le):Le;Mt&&(pe(Mt),(Et=v())==null||Et(Le))},onConnectStart:(Le,Mt)=>{var Et;(Et=b())==null||Et(Le,{nodeId:Mt.nodeId,handleId:Mt.handleId,handleType:Mt.handleType})},onConnectEnd:(Le,Mt)=>{var Et;(Et=x())==null||Et(Le,Mt)},getTransform:()=>[C().x,C().y,C().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(B()),()=>{te(P,B()||null)}),ve(()=>(q(M()),q(H()),_(),m(),q(E()),q(B())),()=>{(M()||H())&&(_(),te(Ge,m().get(`${Z}-${E()}${B()?`-${B()}`:""}`)))}),ve(()=>(d(K),d(Ge),q(H()),q(M())),()=>{if(d(K)&&!dp(d(Ge),d(K))){const $e=d(Ge)??new Map;bc(d(K),$e,H()),bc($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,Le;te(L,(($e=p().fromHandle)==null?void 0:$e.nodeId)===Z&&((Fe=p().fromHandle)==null?void 0:Fe.type)===E()&&((Le=p().fromHandle)==null?void 0:Le.id)===d(P))}),ve(()=>(p(),q(E()),d(P)),()=>{var $e,Fe,Le;te(V,(($e=p().toHandle)==null?void 0:$e.nodeId)===Z&&((Fe=p().toHandle)==null?void 0:Fe.type)===E()&&((Le=p().toHandle)==null?void 0:Le.id)===d(P))}),ve(()=>(l(),p(),q(E()),d(P)),()=>{var $e,Fe,Le;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)!==((Le=p().fromHandle)==null?void 0:Le.id))}),ve(()=>(d(V),p()),()=>{te(I,d(V)&&p().isValid)}),Pt(),qe();var Qe=u2();let ft;var on=W(Qe);Dt(on,t,"default",{}),Y(Qe),De(($e,Fe)=>{be(Qe,"data-handleid",d(P)),be(Qe,"data-nodeid",Z),be(Qe,"data-handlepos",$()),be(Qe,"data-id",`${g()??""}-${Z??""}-${(B()||"")??""}-${E()??""}`),ft=Ot(Qe,1,$e,null,ft,Fe),pt(Qe,S())},[()=>wn((q(ut),q($()),q(U()),G(()=>ut(["svelte-flow__handle",`svelte-flow__handle-${$()}`,"nodrag","nopan",$(),U()])))),()=>({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))})]),ct("mousedown",Qe,st),ct("touchstart",Qe,st),D(e,Qe);var nt=ge({get id(){return B()},set id($e){B($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 U()},set class($e){U($e),y()}});return r(),nt}ce(lr,{id:{},type:{},position:{},style:{},isValidConnection:{},onconnect:{},ondisconnect:{},isConnectable:{},class:{}},["default"],[],!0);var c2=ie("<!> <!>",1);function ps(e,t){const n=gt(t,["children","$$slots","$$events","$$legacy","$$host"]);gt(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=R(a),c=R(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 ed(e,t){const n=gt(t,["children","$$slots","$$events","$$legacy","$$host"]);gt(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=R(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(ed,{data:{},sourcePosition:{}},[],[],!0);var f2=ie(" <!>",1);function td(e,t){const n=gt(t,["children","$$slots","$$events","$$legacy","$$host"]);gt(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=R(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(td,{data:{},targetPosition:{}},[],[],!0);function nd(e,t){const n=gt(t,["children","$$slots","$$events","$$legacy","$$host"]);gt(n,[])}ce(nd,{},[],[],!0);function rd(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 rd(e,n,t),{async update({target:r,domNode:o}){rd(e,o,r)},destroy(){e.parentNode&&e.parentNode.removeChild(e)}}}var g2=ie("<div><!></div>");function od(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(i,"$domNode",n),{domNode:i}=tt();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(od,{},["default"],[],!0);function id(){const{edgeLookup:e,selectionRect:t,selectionRectMode:n,multiselectionKeyPressed:r,addSelectedEdges:o,unselectNodesAndEdges:i,elementsSelectable:s}=tt();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 sd(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=id(),s=Cr("svelteflow__edge_id");return qe(),od(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)`})]),ct("keyup",c,()=>{}),ct("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(sd,{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),x=R(b);{var C=m=>{var k=v2();be(k,"stroke-opacity",0),De(()=>{be(k,"d",r()),be(k,"stroke-width",h)}),D(m,k)};ye(x,m=>{h&&m(C)})}var p=R(x);{var _=m=>{sd(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}})};ye(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(ut),q(f()),G(()=>ut(["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=gt(t,["children","$$slots","$$events","$$legacy","$$host"]);gt(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),x=w(t,"targetY",12),C=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),q(f()),q(h()),q(b()),q(x()),q(v()),q(C())),()=>{(p=>{var _=tr(p,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(Vc({sourceX:f(),sourceY:h(),targetX:b(),targetY:x(),sourcePosition:v(),targetPosition:C()}))}),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 x()},set targetY(p){x(p),y()},get targetPosition(){return C()},set targetPosition(p){C(p),y()}})}ce(ms,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function ad(e,t){const n=gt(t,["children","$$slots","$$events","$$legacy","$$host"]);gt(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),x=w(t,"targetY",12),C=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),q(f()),q(h()),q(b()),q(x()),q(v()),q(C())),()=>{(p=>{var _=tr(p,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(hs({sourceX:f(),sourceY:h(),targetX:b(),targetY:x(),sourcePosition:v(),targetPosition:C()}))}),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 x()},set targetY(p){x(p),y()},get targetPosition(){return C()},set targetPosition(p){C(p),y()}})}ce(ad,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function ld(e,t){const n=gt(t,["children","$$slots","$$events","$$legacy","$$host"]);gt(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())),()=>{(x=>{var C=tr(x,3);te(r,C[0]),te(o,C[1]),te(i,C[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(x){s(x),y()},get labelStyle(){return a()},set labelStyle(x){a(x),y()},get style(){return l()},set style(x){l(x),y()},get markerStart(){return c()},set markerStart(x){c(x),y()},get markerEnd(){return u()},set markerEnd(x){u(x),y()},get interactionWidth(){return g()},set interactionWidth(x){g(x),y()},get sourceX(){return f()},set sourceX(x){f(x),y()},get sourceY(){return h()},set sourceY(x){h(x),y()},get targetX(){return v()},set targetX(x){v(x),y()},get targetY(){return b()},set targetY(x){b(x),y()}})}ce(ld,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},targetX:{},targetY:{}},[],[],!0);function ud(e,t){const n=gt(t,["children","$$slots","$$events","$$legacy","$$host"]);gt(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),x=w(t,"targetY",12),C=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),q(f()),q(h()),q(b()),q(x()),q(v()),q(C())),()=>{(p=>{var _=tr(p,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(hs({sourceX:f(),sourceY:h(),targetX:b(),targetY:x(),sourcePosition:v(),targetPosition:C(),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 x()},set targetY(p){x(p),y()},get targetPosition(){return C()},set targetPosition(p){C(p),y()}})}ce(ud,{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 x=e,C={},p=!0;const _=P=>{const O=Bc(P,t,n,{elevateNodesOnSelect:p,nodeOrigin:r,nodeExtent:o,defaults:C,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)),x=P,v(x),x},m=P=>_(P(x)),k=P=>{C=P},N=P=>{p=P.elevateNodesOnSelect??p};return _(x),{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;Fc(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}},cd={input:ed,output:td,default:ps,group:nd},dd={straight:ld,smoothstep:ad,default:ms,step:ud},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;Bc(e,a,l,{nodeExtent:f,nodeOrigin:g,elevateNodesOnSelect:!1,checkEquality:!1}),Fc(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),x=xe(null),C=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,x,C,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:x,panZoom:C,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(cd),edgeTypes:xe(dd),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?Cc(t,{x:0,y:0,width:r,height:o},s,!0):Array.from(t.values())})}const ys=Symbol();function fd({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({...cd,...$})}function c($){a.edgeTypes.set({...dd,...$})}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 U=(M=T.get(H))==null?void 0:M.internals.userNode;U&&(U.position=z.position,U.dragging=S)}a.nodes.update(H=>H)};function f($){var z,U,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=((U=ee.dimensions)==null?void 0:U.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 x($){return v(1/1.2,$)}function C($){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:U,edges:Z}=await $c({nodesToRemove:H,edgesToRemove:z,nodes:T,edges:M,onBeforeDelete:J(a.onbeforedelete)});(U.length||Z.length)&&(a.nodes.update(ee=>ee.filter(re=>!U.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:U,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 B(){A.set(La)}function E(){a.selectionRect.set(null),a.selectionRectMode.set(null),a.snapGrid.set(null),a.isValidConnection.set(()=>!0),N(),B()}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:x,fitView:$=>h($),setMinZoom:C,setMaxZoom:p,setTranslateExtent:_,setPaneClickDistance:k,unselectNodesAndEdges:N,addSelectedNodes:P,addSelectedEdges:O,handleNodeSelection:L,panBy:V,updateConnection:I,cancelConnection:B,reset:E}}function tt(){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=fd({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 gd(e,t){fe(t,!1),lt(e,S2);const[n,r]=dt(),o=()=>oe(M,"$panActivationKeyPressed",n),i=()=>oe(B,"$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),x=w(t,"onMove",12,void 0),C=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:B,maxZoom:E,dragging:$,translateExtent:S,lib:T,panActivationKeyPressed:M,zoomActivationKeyPressed:H,viewportInitialized:z}=tt(),U=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:x(),onPanZoomEnd:C(),zoomOnScroll:m(),zoomOnDoubleClick:k(),zoomOnPinch:N(),panOnScroll:d(h),panOnDrag:d(f),panOnScrollSpeed:.5,panOnScrollMode:p()||Kn.Free,zoomActivationKeyPressed:a(),preventScrolling:typeof _()=="boolean"?_():!0,noPanClassName:"nopan",noWheelClassName:"nowheel",userSelectionActive:!!l(),translateExtent:c(),lib:u(),paneClickDistance:L(),onTransformChange:U})),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 x()},set onMove(Q){x(Q),y()},get onMoveEnd(){return C()},set onMoveEnd(Q){C(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(gd,{initialViewport:{},onMoveStart:{},onMove:{},onMoveEnd:{},panOnScrollMode:{},preventScrolling:{},zoomOnScroll:{},zoomOnDoubleClick:{},zoomOnPinch:{},panOnDrag:{},panOnScroll:{},paneClickDistance:{}},["default"],[],!0);function hd(e,t){return n=>{n.target===t&&(e==null||e(n))}}function vd(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 pd(e,t){fe(t,!1),lt(e,N2);const[n,r]=dt(),o=()=>oe($,"$panActivationKeyPressed",n),i=()=>oe(B,"$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(),x=ae(),C=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:B,selectionMode:E,panActivationKeyPressed:$,unselectNodesAndEdges:S,connection:T}=tt();let M=ae(),H=null,z=[],U=!1;function Z(se){if(U||c().inProgress){U=!1;return}m("paneclick",{event:se}),S(),I.set(null)}function ee(se){var F,we;if(H=d(M).getBoundingClientRect(),!V||!d(x)||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:j,y:ue}=jn(se,H);S(),A.set({width:0,height:0,startX:j,startY:ue,x:j,y:ue})}function re(se){if(!d(x)||!H||!s())return;U=!0;const j=jn(se,H),ue=s().startX??0,F=s().startY??0,we={...s(),x:j.x<ue?j.x:ue,y:j.y<F?j.y:F,width:Math.abs(j.x-ue),height:Math.abs(j.y-F)},Pe=z.map(me=>me.id),Oe=za(z,u()).map(me=>me.id);z=Cc(g(),we,[f().x,f().y,f().zoom],h()===ss.Partial,!0);const Be=za(z,u()).map(me=>me.id),Ae=z.map(me=>me.id);(Pe.length!==Ae.length||Ae.some(me=>!Pe.includes(me)))&&k.update(me=>me.map(vd(Ae))),(Oe.length!==Be.length||Be.some(me=>!Oe.includes(me)))&&P.update(me=>me.map(vd(Be))),I.set("user"),A.set(we)}function Q(se){var j,ue;se.button===0&&((ue=(j=se.target)==null?void 0:j.releasePointerCapture)==null||ue.call(j,se.pointerId),!d(x)&&l()==="user"&&se.target===d(M)&&(Z==null||Z(se)),A.set(null),z.length>0&&Li(I,"nodes"),i()&&(U=!1))}const de=se=>{var j;if(Array.isArray(d(b))&&((j=d(b))!=null&&j.includes(2))){se.preventDefault();return}m("panecontextmenu",{event:se})};ve(()=>(o(),q(p())),()=>{te(b,o()||p())}),ve(()=>(i(),s(),q(_()),d(b)),()=>{te(x,i()||s()||_()&&d(b)!==!0)}),ve(()=>(a(),d(x),l()),()=>{te(C,a()&&(d(x)||l()==="user"))}),Pt(),qe();var ne=P2(),_e=Ee(()=>d(C)?void 0:hd(Z,d(M))),Ne=Ee(()=>hd(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(x)})]),ct("click",ne,function(...se){var j;(j=d(_e))==null||j.apply(this,se)}),ct("pointerdown",ne,function(...se){var j;(j=d(C)?ee:void 0)==null||j.apply(this,se)}),ct("pointermove",ne,function(...se){var j;(j=d(C)?re:void 0)==null||j.apply(this,se)}),ct("pointerup",ne,function(...se){var j;(j=d(C)?Q:void 0)==null||j.apply(this,se)}),ct("contextmenu",ne,function(...se){var j;(j=d(Ne))==null||j.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(pd,{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 md(e,t){fe(t,!1),lt(e,M2);const[n,r]=dt(),o=()=>oe(i,"$viewport",n),{viewport:i}=tt();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(md,{},["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 yd(e,t){fe(t,!1);const[n,r]=dt(),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),x=w(t,"draggable",13,void 0),C=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),B=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),U=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=tt(),{nodeTypes:ne,nodeDragThreshold:_e,selectNodesOnDrag:Ne,handleNodeSelection:Ve,updateNodeInternals:le,elementsSelectable:pe,nodesDraggable:se}=de;let j=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 Ae(K){C()&&(!J(Ne)||!x()||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(B()),q(h()),d(j)),()=>{(d(Pe)&&d(l)!==d(Pe)||d(Oe)&&I()!==d(Oe)||d(Be)&&B()!==d(Be))&&requestAnimationFrame(()=>le(new Map([[h(),{id:h(),nodeElement:d(j),force:!0}]]))),te(Pe,d(l)),te(Oe,I()),te(Be,B())}),ve(()=>(q(N()),d(j),d(ue),q(Z())),()=>{N()&&(d(j)!==d(ue)||!Z())&&(d(ue)&&N().unobserve(d(ue)),d(j)&&N().observe(d(j)),te(ue,d(j)))}),Pt(),qe(!0);var me=Ze(),ze=he(me);{var je=K=>{var Ge=D2();let Qe,ft;var on=W(Ge);{let nt=Me(()=>b()??!1),$e=Me(()=>C()??i()??!0),Fe=Me(()=>_()??!0),Le=Me(()=>x()??s()??!0);gu(on,()=>d(u),(Mt,Et)=>{Et(Mt,{get data(){return v()},get id(){return h()},get selected(){return d(nt)},get selectable(){return d($e)},get deletable(){return d(Fe)},get sourcePosition(){return I()},get targetPosition(){return B()},get zIndex(){return E()},get dragging(){return k()},get draggable(){return d(Le)},get dragHandle(){return U()},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,(nt,$e)=>ho==null?void 0:ho(nt,$e),()=>({nodeId:h(),isSelectable:C(),disabled:!1,handleSelector:U(),noDragClass:"nodrag",nodeClickDistance:re(),onNodeMouseDown:Ve,onDrag:(nt,$e,Fe,Le)=>{F("nodedrag",{event:nt,targetNode:Fe,nodes:Le})},onDragStart:(nt,$e,Fe,Le)=>{F("nodedragstart",{event:nt,targetNode:Fe,nodes:Le})},onDragStop:(nt,$e,Fe,Le)=>{F("nodedragstop",{event:nt,targetNode:Fe,nodes:Le})},store:de})),Vn(Ge,nt=>te(j,nt),()=>d(j)),Qt(()=>ct("click",Ge,Ae)),Qt(()=>ct("mouseenter",Ge,nt=>F("nodemouseenter",{node:f(),event:nt}))),Qt(()=>ct("mouseleave",Ge,nt=>F("nodemouseleave",{node:f(),event:nt}))),Qt(()=>ct("mousemove",Ge,nt=>F("nodemousemove",{node:f(),event:nt}))),Qt(()=>ct("contextmenu",Ge,nt=>F("nodecontextmenu",{node:f(),event:nt}))),De((nt,$e,Fe)=>{be(Ge,"data-id",h()),Qe=Ot(Ge,1,nt,null,Qe,$e),ft=pt(Ge,`${P()??""??""};${d(g),G(()=>d(g).width)??""}${d(g),G(()=>d(g).height)??""}`,ft,Fe)},[()=>wn((q(ut),d(l),q(Q()),G(()=>ut(["svelte-flow__node",`svelte-flow__node-${d(l)}`,Q()])))),()=>({dragging:k(),selected:b(),draggable:x(),connectable:p(),selectable:C(),nopan:x(),parent:L()}),()=>({"z-index":E(),transform:`translate(${V()??""}px, ${A()??""}px)`,visibility:Z()?"visible":"hidden"})]),D(K,Ge)};ye(ze,K=>{m()||K(je)})}D(e,me);var st=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 x()},set draggable(K){x(K),y()},get selectable(){return C()},set selectable(K){C(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 B()},set targetPosition(K){B(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 U()},set dragHandle(K){U(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(),st}ce(yd,{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 wd(e,t){fe(t,!1),lt(e,O2);const[n,r]=dt(),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}=tt(),x=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(()=>{x==null||x.disconnect()}),qe();var C=V2();Yt(C,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"))),B=Me(()=>(d(m),G(()=>d(m).internals.z??0))),E=Me(()=>(q(fs),d(m),G(()=>fs(d(m)))));yd(_,{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(B)},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 x},get nodeClickDistance(){return c()},$$events:{nodeclick($){Ue.call(this,t,$)},nodemouseenter($){Ue.call(this,t,$)},nodemousemove($){Ue.call(this,t,$)},nodemouseleave($){Ue.call(this,t,$)},nodedrag($){Ue.call(this,t,$)},nodedragstart($){Ue.call(this,t,$)},nodedragstop($){Ue.call(this,t,$)},nodecontextmenu($){Ue.call(this,t,$)}}})}}),Y(C),D(e,C);var p=ge({get nodeClickDistance(){return c()},set nodeClickDistance(_){c(_),y()}});return r(),p}ce(wd,{nodeClickDistance:{}},[],[],!0);var A2=Ce('<svg><g role="img"><!></g></svg>');function _d(e,t){fe(t,!1);const[n,r]=dt(),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,""),x=w(t,"target",13,""),C=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),B=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),U=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}=tt(),_e=Di(),Ne=id();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 j=F=>{var we=A2();let Pe;var Oe=W(we);let Be;var Ae=W(Oe);{let me=Me(()=>P()??!0);gu(Ae,()=>d(c),(ze,je)=>{je(ze,{get id(){return h()},get source(){return b()},get target(){return x()},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 C()},get style(){return p()},get interactionWidth(){return Z()},get selectable(){return d(f)},get deletable(){return d(me)},get type(){return d(l)},get sourceHandleId(){return B()},get targetHandleId(){return E()},get markerStart(){return d(u)},get markerEnd(){return d(g)}})})}Y(Oe),Y(we),De((me,ze,je)=>{Pe=pt(we,"",Pe,me),Be=Ot(Oe,0,ze,null,Be,je),be(Oe,"data-id",h()),be(Oe,"aria-label",U()===null?void 0:U()?U():`Edge from ${b()} to ${x()}`)},[()=>({"z-index":_()}),()=>wn((q(ut),q(ee()),G(()=>ut(["svelte-flow__edge",ee()])))),()=>({animated:m(),selected:k(),selectable:d(f)})]),ct("click",Oe,Ve),ct("contextmenu",Oe,me=>{le(me,"edgecontextmenu")}),ct("mouseenter",Oe,me=>{le(me,"edgemouseenter")}),ct("mouseleave",Oe,me=>{le(me,"edgemouseleave")}),D(F,we)};ye(se,F=>{O()||F(j)})}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 x()},set target(F){x(F),y()},get data(){return C()},set data(F){C(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 B()},set sourceHandle(F){B(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 U()},set ariaLabel(F){U(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(_d,{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 bd(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(bd,{onMount:{},onDestroy:{}},[],[],!0);var L2=Ce("<defs></defs>");function xd(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(i,"$markers",n),{markers:i}=tt();qe();var s=L2();Yt(s,5,o,a=>a.id,(a,l)=>{Cd(a,ht(()=>d(l)))}),Y(s),D(e,s),ge(),r()}ce(xd,{},[],[],!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 Cd(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(),x=he(b);{var C=p=>{var _=z2();De(()=>{be(_,"stroke",l()),be(_,"stroke-width",c()),be(_,"fill",l())}),D(p,_)};ye(x,p=>{q(r()),q(Vr),G(()=>r()===Vr.ArrowClosed)&&p(C)},!0)}D(v,b)};ye(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(Cd,{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 $d(e,t){fe(t,!1);const[n,r]=dt(),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}=tt();dn(()=>{s()&&c(s())}),qe();var g=B2(),f=W(g),h=W(f);xd(h,{}),Y(f);var v=R(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")));_d(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){Ue.call(this,t,N)},edgecontextmenu(N){Ue.call(this,t,N)},edgemouseenter(N){Ue.call(this,t,N)},edgemouseleave(N){Ue.call(this,t,N)}}})}});var b=R(v,2);{var x=p=>{bd(p,{onMount:()=>{Li(l,!0)},onDestroy:()=>{Li(l,!1)}})};ye(b,p=>{o(),G(()=>o().length>0)&&p(x)})}Y(g),D(e,g);var C=ge({get defaultEdgeOptions(){return s()},set defaultEdgeOptions(p){s(p),y()}});return r(),C}ce($d,{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),lt(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)};ye(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 Ed(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(s,"$selectionRect",n),i=()=>oe(a,"$selectionRectMode",n),{selectionRect:s,selectionRectMode:a}=tt();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(Ed,{},[],[],!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 kd(e,t){fe(t,!1),lt(e,W2);const[n,r]=dt(),o=()=>oe(l,"$selectionRectMode",n),i=()=>oe(u,"$nodeLookup",n),s=()=>oe(c,"$nodes",n),a=tt(),{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(),x=he(b);{var C=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(()=>ct("contextmenu",_,h)),Qt(()=>ct("click",_,v)),Qt(()=>ct("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,_)};ye(x,p=>{o(),d(f),q(Ln),G(()=>o()==="nodes"&&d(f)&&Ln(d(f).x)&&Ln(d(f).y))&&p(C)})}D(e,b),ge(),r()}ce(kd,{},[],[],!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 x={node:e,trigger:u,originalEvent:s};e.dispatchEvent(new CustomEvent("shortcut",{detail:x})),h==null||h(x)}}}}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 Sd(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}=tt();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 x(p,_){return(Array.isArray(p)?p:[p]).map(k=>{const N=b(k);return{key:N,modifier:v(k),enabled:N!==null,callback:_}})}function C(){f.set(null),a.set(!1),l.set(!1),c.set(!1),u.set(!1),g.set(!1)}return qe(),ct("blur",Xt,C),ct("contextmenu",Xt,C),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:x(n(),()=>a.set(!0)),type:"keydown"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:x(n(),()=>a.set(!1)),type:"keyup"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:x(r(),()=>l.set(!0)),type:"keydown"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:x(r(),()=>l.set(!1)),type:"keyup"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:x(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:x(o(),()=>c.set(!1)),type:"keyup"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:x(i(),()=>u.set(!0)),type:"keydown"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:x(i(),()=>u.set(!1)),type:"keyup"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:x(s(),()=>g.set(!0)),type:"keydown"})),Vt(Xt,(p,_)=>ot==null?void 0:ot(p,_),()=>({trigger:x(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(Sd,{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 Pd(e,t){fe(t,!1);const[n,r]=dt(),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}=tt();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=tr(L,1);te(b,V[0])})(Vc(O));break;case so.Step:(L=>{var V=tr(L,1);te(b,V[0])})(hs({...O,borderRadius:0}));break;case so.SmoothStep:(L=>{var V=tr(L,1);te(b,V[0])})(hs(O));break;default:(L=>{var V=tr(L,1);te(b,V[0])})(Fa(O))}}}),Pt(),qe();var x=Ze(),C=he(x);{var p=m=>{var k=Z2(),N=W(k),P=W(N);Dt(P,t,"connectionLine",{});var O=R(P);{var L=V=>{var A=X2();De(()=>{be(A,"d",d(b)),pt(A,c())}),D(V,A)};ye(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(ut),q(xc),o(),G(()=>ut(["svelte-flow__connection",xc(o().isValid)]))))]),D(m,k)};ye(C,m=>{o(),G(()=>o().inProgress)&&m(p)})}D(e,x);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(Pd,{containerStyle:{},style:{},isCustomComponent:{}},["connectionLine"],[],!0);var K2=ie("<div><!></div>");function ii(e,t){const n=gt(t,["children","$$slots","$$events","$$legacy","$$host"]),r=gt(n,["position","style","class"]);fe(t,!1);const[o,i]=dt(),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}=tt();ve(()=>q(l()),()=>{te(a,`${l()}`.split("-"))}),Pt(),qe();var f=K2();tn(f,(b,x)=>({class:b,style:c(),...r,[Nr]:x}),[()=>(q(ut),q(u()),d(a),G(()=>ut(["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 U2=ie('<a href="https://svelteflow.dev" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>');function Nd(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=U2();D(l,u)},$$slots:{default:!0}})};ye(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(Nd,{proOptions:{},position:{}},[],[],!0);function Td(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 j2=e=>Object.keys(e);function Md(e,t){j2(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 Hd(e,t){const n=pg(t),r=gt(t,["children","$$slots","$$events","$$legacy","$$host"]),o=gt(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),lt(e,nm);const[i,s]=dt(),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),x=w(t,"minZoom",12,void 0),C=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),B=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,""),U=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,()=>Kn.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),j=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),Ae=w(t,"onedgecreate",12,void 0),me=w(t,"attributionPosition",12,void 0),ze=w(t,"proOptions",12,void 0),je=w(t,"defaultEdgeOptions",12,void 0),st=w(t,"width",12,void 0),K=w(t,"height",12,void 0),Ge=w(t,"colorMode",12,"light"),Qe=w(t,"onconnect",12,void 0),ft=w(t,"onconnectstart",12,void 0),on=w(t,"onconnectend",12,void 0),nt=w(t,"onbeforedelete",12,void 0),$e=w(t,"oninit",12,void 0),Fe=w(t,"nodeOrigin",12,void 0),Le=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(),et=P1(ys)?tt():E2({nodes:J(f()),edges:J(h()),width:st(),height:K(),fitView:v(),nodeOrigin:Fe(),nodeExtent:ne()});dn(()=>(et.width.set(d(Ht)),et.height.set(d(Ft)),et.domNode.set(d(mi)),et.syncNodeStores(f()),et.syncEdgeStores(h()),et.syncViewport(_()),v()!==void 0&&et.fitViewQueued.set(v()),b()&&et.fitViewOptions.set(b()),Td(et,{nodeTypes:m(),edgeTypes:k(),minZoom:x(),maxZoom:C(),translateExtent:de(),paneClickDistance:Le()}),()=>{et.reset()}));const{initialized:gl}=et;let yi=ae(!1);ve(()=>(d(Ht),d(Ft)),()=>{d(Ht)!==void 0&&d(Ft)!==void 0&&(et.width.set(d(Ht)),et.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(Ae()),q(H()),q(B()),q(Qe()),q(ft()),q(on()),q(nt()),q(Fe()),Md),()=>{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:Ae(),connectionMode:H(),nodeDragThreshold:B(),onconnect:Qe(),onconnectstart:ft(),onconnectend:on(),onbeforedelete:nt(),nodeOrigin:Fe()};Md(et,X)}),ve(()=>(q(m()),q(k()),q(x()),q(C()),q(de()),q(Le())),()=>{Td(et,{nodeTypes:m(),edgeTypes:k(),minZoom:x(),maxZoom:C(),translateExtent:de(),paneClickDistance:Le()})}),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(ut),q(Br()),c(),G(()=>ut(["svelte-flow",Br(),c()])))],void 0,"svelte-18e9ir1");var Ms=W(sn);Sd(Ms,{get selectionKey(){return N()},get deleteKey(){return S()},get panActivationKey(){return O()},get multiSelectionKey(){return L()},get zoomActivationKey(){return V()}});var Hs=R(Ms,2);{let X=Me(()=>(q(Ne()),q(Kn),G(()=>Ne()===void 0?Kn.Free:Ne()))),G_=Me(()=>Ve()===void 0?!0:Ve()),J_=Me(()=>le()===void 0?!0:le()),Q_=Me(()=>pe()===void 0?!0:pe()),eb=Me(()=>se()===void 0?!0:se()),tb=Me(()=>j()===void 0?!1:j()),nb=Me(()=>ue()===void 0?!0:ue()),rb=Me(()=>Le()===void 0?0:Le());gd(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(G_)},get zoomOnScroll(){return d(J_)},get zoomOnDoubleClick(){return d(Q_)},get zoomOnPinch(){return d(eb)},get panOnScroll(){return d(tb)},get panOnDrag(){return d(nb)},get paneClickDistance(){return d(rb)},children:(ob,gb)=>{{let ib=Me(()=>ue()===void 0?!0:ue());pd(ob,{get panOnDrag(){return d(ib)},get selectionOnDrag(){return F()},$$events:{paneclick(wi){Ue.call(this,t,wi)},panecontextmenu(wi){Ue.call(this,t,wi)}},children:(wi,hb)=>{var zf=em(),Rf=he(zf);md(Rf,{children:(ab,vb)=>{var Bf=Q2(),qf=he(Bf);$d(qf,{get defaultEdgeOptions(){return je()},$$events:{edgeclick(Ke){Ue.call(this,t,Ke)},edgecontextmenu(Ke){Ue.call(this,t,Ke)},edgemouseenter(Ke){Ue.call(this,t,Ke)},edgemouseleave(Ke){Ue.call(this,t,Ke)}}});var Yf=R(qf,2);Pd(Yf,{get containerStyle(){return U()},get style(){return z()},isCustomComponent:G(()=>n.connectionLine),$$slots:{connectionLine:(Ke,pb)=>{var Wf=Ze(),ub=he(Wf);Dt(ub,t,"connectionLine",{}),D(Ke,Wf)}}});var Ff=R(Yf,6);wd(Ff,{get nodeClickDistance(){return Mt()},$$events:{nodeclick(Ke){Ue.call(this,t,Ke)},nodemouseenter(Ke){Ue.call(this,t,Ke)},nodemousemove(Ke){Ue.call(this,t,Ke)},nodemouseleave(Ke){Ue.call(this,t,Ke)},nodedragstart(Ke){Ue.call(this,t,Ke)},nodedrag(Ke){Ue.call(this,t,Ke)},nodedragstop(Ke){Ue.call(this,t,Ke)},nodecontextmenu(Ke){Ue.call(this,t,Ke)}}});var lb=R(Ff,2);kd(lb,{$$events:{selectionclick(Ke){Ue.call(this,t,Ke)},selectioncontextmenu(Ke){Ue.call(this,t,Ke)},nodedragstart(Ke){Ue.call(this,t,Ke)},nodedrag(Ke){Ue.call(this,t,Ke)},nodedragstop(Ke){Ue.call(this,t,Ke)}}}),D(ab,Bf)},$$slots:{default:!0}});var sb=R(Rf,2);Ed(sb,{}),D(wi,zf)},$$slots:{default:!0}})}},$$slots:{default:!0}})}var Ds=R(Hs,2);Nd(Ds,{get proOptions(){return ze()},get position(){return me()}});var hl=R(Ds,2);Dt(hl,t,"default",{}),Y(sn),Vn(sn,X=>te(mi,X),()=>d(mi)),Cu(sn,"clientWidth",X=>te(Ht,X)),Cu(sn,"clientHeight",X=>te(Ft,X)),ct("dragover",sn,function(X){Ue.call(this,t,X)}),ct("drop",sn,function(X){Ue.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 x()},set minZoom(X){x(X),y()},get maxZoom(){return C()},set maxZoom(X){C(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 B()},set nodeDragThreshold(X){B(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 U()},set connectionLineContainerStyle(X){U(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 j()},set panOnScroll(X){j(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 Ae()},set onedgecreate(X){Ae(X),y()},get attributionPosition(){return me()},set attributionPosition(X){me(X),y()},get proOptions(){return ze()},set proOptions(X){ze(X),y()},get defaultEdgeOptions(){return je()},set defaultEdgeOptions(X){je(X),y()},get width(){return st()},set width(X){st(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 Qe()},set onconnect(X){Qe(X),y()},get onconnectstart(){return ft()},set onconnectstart(X){ft(X),y()},get onconnectend(){return on()},set onconnectend(X){on(X),y()},get onbeforedelete(){return nt()},set onbeforedelete(X){nt(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 Le()},set paneClickDistance(X){Le(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(Hd,{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 Dd(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=fd({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(Dd,{initialNodes:{},initialEdges:{},initialWidth:{},initialHeight:{},fitView:{},nodeOrigin:{}},["default"],[],!0);var rm=ie("<button><!></button>");function si(e,t){const n=gt(t,["children","$$slots","$$events","$$legacy","$$host"]),r=gt(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(ut),q(o()),G(()=>ut(["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),ct("click",u,function(f){Ue.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 Vd(e){var t=om();D(e,t)}ce(Vd,{},[],[],!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 Od(e){var t=im();D(e,t)}ce(Od,{},[],[],!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 Ad(e){var t=sm();D(e,t)}ce(Ad,{},[],[],!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 Ld(e){var t=am();D(e,t)}ce(Ld,{},[],[],!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 Id(e){var t=lm();D(e,t)}ce(Id,{},[],[],!0);var um=ie("<!> <!>",1),cm=ie("<!> <!> <!> <!> <!> <!>",1);function zd(e,t){fe(t,!1);const[n,r]=dt(),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),x=w(t,"showFitView",12,!0),C=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:B,fitView:E,viewport:$,minZoom:S,maxZoom:T,nodesDraggable:M,nodesConnectable:H,elementsSelectable:z}=tt(),U={bgColor:p(),bgColorHover:_(),color:m(),colorHover:k(),borderColor:N()},Z=()=>{I()},ee=()=>{B()},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(ut),d(h),q(A()),G(()=>ut(["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=R(pe,2);{var j=Ae=>{var me=um(),ze=he(me);si(ze,ht({class:"svelte-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",get disabled(){return d(f)}},()=>U,{$$events:{click:Z},children:(st,K)=>{Vd(st)},$$slots:{default:!0}}));var je=R(ze,2);si(je,ht({class:"svelte-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",get disabled(){return d(g)}},()=>U,{$$events:{click:ee},children:(st,K)=>{Od(st)},$$slots:{default:!0}})),D(Ae,me)};ye(se,Ae=>{b()&&Ae(j)})}var ue=R(se,2);{var F=Ae=>{si(Ae,ht({class:"svelte-flow__controls-fitview",title:"fit view","aria-label":"fit view"},()=>U,{$$events:{click:re},children:(me,ze)=>{Ad(me)},$$slots:{default:!0}}))};ye(ue,Ae=>{x()&&Ae(F)})}var we=R(ue,2);{var Pe=Ae=>{si(Ae,ht({class:"svelte-flow__controls-interactive",title:"toggle interactivity","aria-label":"toggle interactivity"},()=>U,{$$events:{click:Q},children:(me,ze)=>{var je=Ze(),st=he(je);{var K=Qe=>{Id(Qe)},Ge=Qe=>{Ld(Qe)};ye(st,Qe=>{d(u)?Qe(K):Qe(Ge,!1)})}D(me,je)},$$slots:{default:!0}}))};ye(we,Ae=>{C()&&Ae(Pe)})}var Oe=R(we,2);Dt(Oe,t,"default",{});var Be=R(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 x()},set showFitView(ne){x(ne),y()},get showLock(){return C()},set showLock(ne){C(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(zd,{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 Rd(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(ut),q(r()),G(()=>ut(["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(Rd,{radius:{},class:{}},[],[],!0);var fm=Ce("<path></path>");function Bd(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(ut),q(o()),q(i()),G(()=>ut(["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(Bd,{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 qd(e,t){fe(t,!1),lt(e,vm);const[n,r]=dt(),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),x=w(t,"bgColor",12,void 0),C=w(t,"patternColor",12,void 0),p=w(t,"patternClass",12,void 0),_=w(t,"class",12,"");const{viewport:m,flowId:k}=tt(),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),B=W(I);{var E=M=>{{let H=Me(()=>d(l)/2);Rd(M,{get radius(){return d(H)},get class(){return p()}})}},$=M=>{Bd(M,{get dimensions(){return d(c)},get variant(){return f()},get lineWidth(){return b()},get class(){return p()}})};ye(B,M=>{P?M(E):M($,!1)})}Y(I);var S=R(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(ut),q(_()),G(()=>ut(["svelte-flow__background",_()])))),()=>({"--xy-background-color-props":x(),"--xy-background-pattern-color-props":C()})]),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 x()},set bgColor(M){x(M),y()},get patternColor(){return C()},set patternColor(M){C(M),y()},get patternClass(){return p()},set patternClass(M){p(M),y()},get class(){return _()},set class(M){_(M),y()}});return r(),T}ce(qd,{id:{},variant:{},gap:{},size:{},lineWidth:{},bgColor:{},patternColor:{},patternClass:{},class:{}},[],[],!0);var pm=Ce("<rect></rect>");function Yd(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,x)=>{v=Ot(h,0,b,null,v,x),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(ut),q(f()),G(()=>ut(["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(Yd,{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 Fd(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(ue,"$flowId",n),i=()=>oe(pe,"$viewport",n),s=()=>oe(se,"$containerWidth",n),a=()=>oe(j,"$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(),x=ae(),C=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),B=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),U=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:j,flowId:ue,panZoom:F,translateExtent:we}=tt(),Pe=I()===void 0?void 0:tl(I()),Oe=tl(A()),Be=tl(B()),Ae=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",me=`svelte-flow__minimap-desc-${o()}`;let ze=ae(d(f));const je=()=>d(C);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(ze,l().size>0?Pc(ei(l(),{filter:K=>!K.hidden}),d(f)):d(f)),c()}),ve(()=>q(z()),()=>{te(h,z()??_e)}),ve(()=>q(U()),()=>{te(v,U()??Ne)}),ve(()=>(d(ze),d(h)),()=>{te(b,d(ze).width/d(h))}),ve(()=>(d(ze),d(v)),()=>{te(x,d(ze).height/d(v))}),ve(()=>(d(b),d(x)),()=>{te(C,Math.max(d(b),d(x)))}),ve(()=>(d(C),d(h)),()=>{te(p,d(C)*d(h))}),ve(()=>(d(C),d(v)),()=>{te(_,d(C)*d(v))}),ve(()=>d(C),()=>{te(m,5*d(C))}),ve(()=>(d(ze),d(p),d(m)),()=>{te(k,d(ze).x-(d(p)-d(ze).width)/2-d(m))}),ve(()=>(d(ze),d(_),d(m)),()=>{te(N,d(ze).y-(d(_)-d(ze).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(ut),q(ne()),G(()=>ut(["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:(Qe,ft)=>{var on=Ze(),nt=he(on);{var $e=Fe=>{var Le=ym();let Mt;var Et=W(Le);{var pi=Ht=>{var Ft=mm(),$o=W(Ft,!0);Y(Ft),De(()=>{be(Ft,"id",me),vt($o,V())}),D(Ht,Ft)};ye(Et,Ht=>{V()&&Ht(pi)})}var Br=R(Et);Yt(Br,1,c,Ht=>Ht.id,(Ht,Ft)=>{var $o=Ze();const et=Me(()=>(l(),d(Ft),G(()=>l().get(d(Ft).id))));var gl=he($o);{var yi=sn=>{const Ms=Me(()=>(q(Un),q(d(et)),G(()=>Un(d(et)))));{let Hs=Me(()=>(q(d(et)),G(()=>Pe==null?void 0:Pe(d(et))))),Ds=Me(()=>(q(d(et)),G(()=>Oe(d(et))))),hl=Me(()=>(q(d(et)),G(()=>Be(d(et)))));Yd(sn,ht({get x(){return q(d(et)),G(()=>d(et).internals.positionAbsolute.x)},get y(){return q(d(et)),G(()=>d(et).internals.positionAbsolute.y)}},()=>d(Ms),{get selected(){return q(d(et)),G(()=>d(et).selected)},get color(){return d(Hs)},get borderRadius(){return E()},get strokeColor(){return d(Ds)},get strokeWidth(){return $()},get shapeRendering(){return Ae},get class(){return d(hl)}}))}};ye(gl,sn=>{q(d(et)),q(fs),G(()=>d(et)&&fs(d(et)))&&sn(yi)})}D(Ht,$o)});var mi=R(Br);Y(Le),Vt(Le,(Ht,Ft)=>el==null?void 0:el(Ht,Ft),()=>({panZoom:u(),viewport:pe,getViewScale:je,translateExtent:g(),width:s(),height:a(),inversePan:re(),zoomStep:Q(),pannable:Z(),zoomable:ee()})),De(Ht=>{be(Le,"width",d(h)),be(Le,"height",d(v)),be(Le,"viewBox",`${d(k)??""} ${d(N)??""} ${d(P)??""} ${d(O)??""}`),be(Le,"aria-labelledby",me),Mt=pt(Le,"",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(C):void 0})]),D(Fe,Le)};ye(nt,Fe=>{u()&&Fe($e)})}D(Qe,on)},$$slots:{default:!0}})}var st=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 B()},set nodeClass(K){B(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 U()},set height(K){U(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(),st}ce(Fd,{position:{},ariaLabel:{},nodeStrokeColor:{},nodeColor:{},nodeClass:{},nodeBorderRadius:{},nodeStrokeWidth:{},bgColor:{},maskColor:{},maskStrokeColor:{},maskStrokeWidth:{},width:{},height:{},pannable:{},zoomable:{},inversePan:{},zoomStep:{},style:{},class:{}},[],[],!0);const Wd=e=>gp(e);function Ut(){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:x,connectionLookup:C}=tt(),p=k=>{var V,A;const N=J(v),P=Wd(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?Wd(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):Xd(J(v),k),getEdge:k=>J(x).get(k),getEdges:k=>k===void 0?J(f):Xd(J(x),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=Nc(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),B=ti(I,L);return N&&B>0||B>=L.width*L.height}):[]},isNodeIntersecting:(k,N,P=!0)=>{const L=Nc(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 $c({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:B}=P.getBoundingClientRect(),E={x:k.x-I,y:k.y-B};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(C).get(`${P}-${k}-${N??null}`))==null?void 0:O.values())??[])},viewport:i}}function Xd(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 Zd(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(_,"$nodes",n),i=()=>oe(p,"$nodeLookup",n),s=()=>oe(C,"$viewport",n),a=()=>oe(x,"$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:x,viewport:C,nodeLookup:p,nodes:_}=tt(),{getNodesBounds:m}=Ut(),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 B=$=>{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)};ye(I,$=>{a()&&d(u)&&d(P)&&$(B)})}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(Zd,{nodeId:{},position:{},align:{},offset:{},isVisible:{}},["default"],[],!0);function Ar(e){const{nodes:t,nodeLookup:n}=tt();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 Kd="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(Kd);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(Kd);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 Ud(e,t){fe(t,!0);const n=Nt(t,["$$slots","$$events","$$legacy","$$host"]);var r=xm();Fn(r),tn(r,()=>({type:"checkbox",...n,class:`tf-checkbox nopan nodrag ${t.class??""}`})),D(e,r),ge()}ce(Ud,{},[],[],!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),lt(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);Fn(c);var u=R(c,2);Ct(u,{get value(){return r()},get placeholder(){return n()},style:"flex-grow: 1;",disabled:!0});var g=R(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();Fn(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 G1(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 Gd(e,t){const n=gt(t,["children","$$slots","$$events","$$legacy","$$host"]),r=gt(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=x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),a(d(u),g))};var h=W(f);{var v=x=>{var C=Re();De(()=>vt(C,(d(u),G(()=>d(u).label)))),D(x,C)},b=x=>{var C=Ze(),p=he(C);Pr(p,()=>(d(u),G(()=>d(u).label)??wt)),D(x,C)};ye(h,x=>{d(u),G(()=>typeof d(u).label=="string")?x(v):x(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(Gd,{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 Jd(e,t){fe(t,!0),lt(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)};ye(f,m=>{d(l).icon&&m(h)})}var v=R(f,2);cr(v,{get target(){return d(l).title}});var b=R(v,2);Y(g);var x=R(g,2);{var C=m=>{var k=Hm(),N=W(k);cr(N,{get target(){return d(l).description}}),Y(k),D(m,k)};ye(x,m=>{d(l).description&&m(C)})}var p=R(x,2);{var _=m=>{var k=Dm(),N=W(k);cr(N,{get target(){return d(l).content}}),Y(k),D(m,k)};ye(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(Jd,{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)};ye(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=(C,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)};ye(V,$=>{d(N).children&&d(N).children.length>0&&$(A)})}Y(L);var I=R(L,2);cr(I,{get target(){return d(N).label}}),Y(O);var B=R(O,2);{var E=$=>{var S=zm(),T=W(S);n(T,()=>d(N).children),Y(S),D($,S)};ye(B,$=>{d(N).children&&d(N).children.length>0&&(a()||c().includes(d(N).value))&&$(E)})}D(k,P)}),D(C,_)};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 C=[],p=_=>{for(let m of _)i().length>0?i().includes(m.value)&&C.push(m):s().includes(m.value)&&C.push(m),m.children&&m.children.length>0&&p(m.children)};return p(r()),C}),h;function v(C){var p;h==null||h.hide(),(p=o())==null||p(C)}var b=Wm();tn(b,()=>({...g,class:`tf-select ${g.class??""}`}));var x=W(b);return Vn(wo(x,{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=B=>{var E=Ze(),$=he(E);{var S=T=>{cr(T,{get target(){return d(P).label}})};ye($,T=>{d(O)===0&&T(S)})}D(B,E)},I=B=>{var E=qm(),$=he(E);cr($,{get target(){return d(P).label}});var S=R($,2);{var T=M=>{var H=Re(",");D(M,H)};ye(S,M=>{d(O)<d(f).length-1&&M(T)})}D(B,E)};ye(V,B=>{l()?B(I,!1):B(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(C){r(C),y()},get onSelect(){return o()},set onSelect(C){o(C),y()},get value(){return i()},set value(C=[]){i(C),y()},get defaultValue(){return s()},set defaultValue(C=[]){s(C),y()},get expandAll(){return a()},set expandAll(C=!0){a(C),y()},get multiple(){return l()},set multiple(C=!1){l(C),y()},get expandValue(){return c()},set expandValue(C=[]){c(C),y()},get placeholder(){return u()},set placeholder(C){u(C),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 Qd(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 Qd(dr(e))}function Um(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 jm(e){const t=bs(e);return[il(e),t,il(t)]}function il(e){return e.replace(/start|end/g,t=>Zm[t])}const ef=["left","right"],tf=["right","left"],Gm=["top","bottom"],Jm=["bottom","top"];function Qm(e,t,n){switch(e){case"top":case"bottom":return n?t?tf:ef:t?ef:tf;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 nf(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 rf(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}=rf(c,r,l),f=r,h={},v=0;for(let b=0;b<a.length;b++){const{name:x,fn:C}=a[b],{x:p,y:_,data:m,reset:k}=await C({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,[x]:{...h[x],...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}=rf(c,f,l)),b=-1)}return{x:u,y:g,placement:f,strategy:o,middlewareData:h}};async function of(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=nf(h),x=a[f?g==="floating"?"reference":"floating":g],C=xs(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.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:(C.top-k.top+v.top)/m.y,bottom:(k.bottom-C.bottom+v.bottom)/m.y,left:(C.left-k.left+v.left)/m.x,right:(k.right-C.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=nf(u),f={x:n,y:r},h=ol(o),v=rl(h),b=await s.getDimensions(c),x=h==="y",C=x?"top":"left",p=x?"bottom":"right",_=x?"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[C],L),A=ai(g[p],L),I=V,B=P-b[v]-A,E=P/2-b[v]/2+O,$=nl(I,E,B),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-B: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,...x}=li(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const C=Lr(o),p=dr(a),_=Lr(a)===a,m=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=f||(_||!b?[bs(a)]:jm(a)),N=v!=="none";!f&&N&&k.push(...ey(a,b,v,m));const P=[a,...k],O=await of(t,x),L=[];let V=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&L.push(O[C]),g){const E=Um(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 B;const T=(B=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:B[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:x=>{let{x:C,y:p}=x;return{x:C,y:p}}},...l}=li(e,t),c={x:n,y:r},u=await of(t,l),g=dr(Lr(o)),f=Qd(g);let h=c[f],v=c[g];if(i){const x=f==="y"?"top":"left",C=f==="y"?"bottom":"right",p=h+u[x],_=h-u[C];h=nl(p,h,_)}if(s){const x=g==="y"?"top":"left",C=g==="y"?"bottom":"right",p=v+u[x],_=v-u[C];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 sf(e)?(e.nodeName||"").toLowerCase():"#document"}function rn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gn(e){var t;return(t=(sf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sf(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 af(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||af(e)&&e.host||Gn(e);return af(t)?t.host:t}function lf(e){const t=fr(e);return mo(t)?e.ownerDocument?e.ownerDocument.body:e.body:zn(t)&&ci(t)?t:lf(t)}function uf(e,t,n){var r;t===void 0&&(t=[]);const o=lf(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,uf(o,[]))}function ll(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cf(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 df(e){return Cn(e)?e:e.contextElement}function yo(e){const t=df(e);if(!zn(t))return In(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=cf(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 ff(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=df(e);let s=In(1);t&&(r?Cn(r)&&(s=yo(r)):s=yo(e));const a=wy(i,n,r)?ff(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 x=yo(b),C=b.getBoundingClientRect(),p=$n(b),_=C.left+(b.clientLeft+parseFloat(p.paddingLeft))*x.x,m=C.top+(b.clientTop+parseFloat(p.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,g*=x.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(Gn(e)).left+n}function gf(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=Gn(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?gf(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=Gn(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=Gn(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 hf(e,t,n){let r;if(t==="viewport")r=Cy(e,n);else if(t==="document")r=xy(Gn(e));else if(Cn(t))r=Ey(t,n);else{const o=ff(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return xs(r)}function vf(e,t){const n=fr(e);return n===t||!Cn(n)||mo(n)?!1:$n(n).position==="fixed"||vf(n,t)}function ky(e,t){const n=t.get(e);if(n)return n;let r=uf(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&&vf(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=hf(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},hf(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}=cf(e);return{width:t,height:n}}function Ny(e,t,n){const r=zn(t),o=Gn(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?gf(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 pf(e,t){if(!zn(e)||$n(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Gn(e)===n&&(n=n.ownerDocument.body),n}function mf(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=pf(e,t);for(;r&&dy(r)&&cl(r);)r=pf(r,t);return r&&mo(r)&&cl(r)&&!sl(r)?n:r||py(e)||n}const Ty=async function(e){const t=this.getOffsetParent||mf,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:Gn,getClippingRect:Sy,getOffsetParent:mf,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 C=document.querySelector(e);if(C)e=C;else throw new Error("element not found by document.querySelector('"+e+"')")}let c;if(typeof n=="string"){const C=document.querySelector(n);if(C)c=C;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:C,y:p,placement:_,middlewareData:m})=>{if(Object.assign(c.style,{left:`${C}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(C){C.stopPropagation(),f?v():h()}function x(C){c.contains(C.target)||v()}return(!t||t.length==0)&&(t=["click"]),t.forEach(C=>{e.addEventListener(C,b)}),document.addEventListener("click",x),{destroy(){t.forEach(C=>{e.removeEventListener(C,b)}),document.removeEventListener("click",x)},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=R(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 mg(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),lt(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=tt();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}=tt();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-ssih1">执行条件: <!></div>'),Ky=(e,t,n)=>{const r=e.target.checked;t(n,{async:r})},Uy=(e,t,n)=>{const r=e.target.checked;t(n,{loop:r})},jy=ie('<div class="settings svelte-ssih1"><div class="input-item svelte-ssih1">节点名称: <!></div> <div class="input-item svelte-ssih1">参数描述: <!></div> <!> <label class="input-item-inline svelte-ssih1"><span>异步执行:</span> <input type="checkbox"/> <span class="loop-action-text svelte-ssih1">循环执行:</span> <input type="checkbox"/></label></div>'),Gy=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>'),Jy=ie('<div class="tf-node-toolbar svelte-ssih1"><!> <!> <!> <!></div>'),Qy=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 ew={hash:"svelte-ssih1",code:".tf-node-toolbar.svelte-ssih1 {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-ssih1 {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-ssih1 .input-item:where(.svelte-ssih1) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:#666;}.settings.svelte-ssih1 .input-item-inline:where(.svelte-ssih1) {display:flex;align-items:center;font-size:12px;color:#666;}.settings.svelte-ssih1 .input-item-inline:where(.svelte-ssih1) .loop-action-text:where(.svelte-ssih1) {margin-left:12px;}"};function En(e,t){fe(t,!0),lt(e,ew);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:x,getNode:C}=Ut(),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,C(r()))};let P=$t();var O=Qy(),L=he(O);{var V=H=>{Zd(H,{get position(){return Se.Top},align:"end",children:(z,U)=>{var Z=Jy(),ee=W(Z);{var re=le=>{Je(le,{class:"tf-node-toolbar-item",onclick:()=>{_(r())},children:(pe,se)=>{var j=Fy();D(pe,j)},$$slots:{default:!0}})};ye(ee,le=>{c()&&le(re)})}var Q=R(ee,2);{var de=le=>{Je(le,{class:"tf-node-toolbar-item",onclick:()=>{m(r())},children:(pe,se)=>{var j=Wy();D(pe,j)},$$slots:{default:!0}})};ye(Q,le=>{l()&&le(de)})}var ne=R(Q,2);{var _e=le=>{Je(le,{class:"tf-node-toolbar-item",onclick:N,children:(pe,se)=>{var j=Xy();D(pe,j)},$$slots:{default:!0}})};ye(ne,le=>{a()&&le(_e)})}var Ne=R(ne,2);{var Ve=le=>{wo(le,{placement:"bottom",floating:se=>{var j=jy(),ue=W(j),F=R(W(ue));Ct(F,{style:"width: 100%;",onchange:je=>{const st=je.target.value;x(P,{title:st})},get value(){return n().title}}),Y(ue);var we=R(ue,2),Pe=R(W(we));Tt(Pe,{rows:3,style:"width: 100%;",onchange:je=>{const st=je.target.value;x(P,{description:st})},get value(){return n().description}}),Y(we);var Oe=R(we,2);{var Be=je=>{var st=Zy(),K=R(W(st));Tt(K,{rows:2,style:"width: 100%;",onchange:Ge=>{const Qe=Ge.target.value;x(P,{condition:Qe})},get value(){return n().condition}}),Y(st),D(je,st)};ye(Oe,je=>{g()&&je(Be)})}var Ae=R(Oe,2),me=R(W(Ae),2);Fn(me),me.__change=[Ky,x,P];var ze=R(me,4);Fn(ze),ze.__change=[Uy,x,P],Y(Ae),Y(j),De(()=>{_u(me,!!n().async),_u(ze,!!n().loop)}),D(se,j)},children:(se,j)=>{Je(se,{class:"tf-node-toolbar-item",children:(ue,F)=>{var we=Gy();D(ue,we)},$$slots:{default:!0}})},$$slots:{floating:!0,default:!0}})};ye(Ne,le=>{u()&&le(Ve)})}Y(Z),D(z,Z)},$$slots:{default:!0}})};ye(L,H=>{(a()||l()||c())&&H(V)})}var A=R(L,2),I=R(W(A),2),B=W(I);Jd(B,{get items(){return d(p)},get activeKeys(){return b},onChange:(H,z)=>{var U;x(r(),{expand:z==null?void 0:z.includes("key")}),(U=v())==null||U(z!=null&&z.includes("key")?"key":"")}}),Y(I),Y(A);var E=R(A,2);{var $=H=>{lr(H,{type:"target",get position(){return Se.Left},style:" left: -12px;top: 20px"})};ye(E,H=>{h()&&H($)})}var S=R(E,2);{var T=H=>{lr(H,{type:"source",get position(){return Se.Right},style:"right: -12px;top: 20px"})};ye(S,H=>{f()&&H(T)})}var M=R(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 yf=[{value:"String",label:"String"},{value:"Number",label:"Number"},{value:"Boolean",label:"Boolean"},{value:"File",label:"File"},{value:"Object",label:"Object"},{value:"Array",label:"Array"}],tw=[{value:"ref",label:"引用"},{value:"fixed",label:"固定值"}];var nw=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>'),rw=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>'),ow=ie('<div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div>',1);const iw={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 wf(e,t){fe(t,!0),lt(e,iw);const[n,r]=dt(),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}=Ut(),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 x=()=>{u(a,L=>{let V=L.data.parameters;return V.splice(s(),1),{parameters:[...V]}}),b==null||b.hide()};var C=ow(),p=he(C),_=W(p);Ct(_,{style:"width: 100%;",get value(){return d(c).name},placeholder:"请输入参数名称",oninput:f}),Y(p);var m=R(p,2),k=W(m);Ud(k,{get checked(){return d(c).required},onchange:h}),Y(m);var N=R(m,2),P=W(N);Vn(wo(P,{placement:"bottom",floating:V=>{var A=nw(),I=W(A),B=R(W(I));{let z=Ee(()=>d(c).dataType?[d(c).dataType]:["String"]);hn(B,{get items(){return yf},style:"width: 100%",onSelect:v,get value(){return d(z)}})}Y(I);var E=R(I,2),$=R(W(E));Tt($,{rows:1,style:"width: 100%;",get value(){return d(c).defaultValue},onchange:z=>{const U=z.target.value;g("defaultValue",U)}}),Y(E);var S=R(E,2),T=R(W(S));Tt(T,{rows:3,style:"width: 100%;",get value(){return d(c).description},onchange:z=>{const U=z.target.value;g("description",U)}}),Y(S);var M=R(S,2),H=W(M);Je(H,{onclick:x,children:(z,U)=>{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,B)=>{var E=rw();D(I,E)},$$slots:{default:!0}})},$$slots:{floating:!0,default:!0}}),V=>b=V,()=>b),Y(N),D(e,C);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(wf,{parameter:{},index:{}},[],[],!0);var sw=ie('<div class="input-header svelte-3n0wca">参数名称</div> <div class="input-header svelte-3n0wca">必填</div> <div class="input-header svelte-3n0wca"></div>',1),aw=ie('<div class="none-params svelte-3n0wca">无输入参数</div>'),lw=ie('<div class="input-container svelte-3n0wca"><!> <!></div>');const uw={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 _f(e,t){fe(t,!0),lt(e,uw);const[n,r]=dt(),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=lw(),c=W(l);{var u=f=>{var h=sw();Te(4),D(f,h)};ye(c,f=>{d(a).length!==0&&f(u)})}var g=R(c,2);Yt(g,19,()=>d(a),f=>f.id,(f,h,v)=>{wf(f,{get parameter(){return d(h)},get index(){return d(v)}})},f=>{var h=aw();D(f,h)}),Y(l),D(e,l),ge(),r()}ce(_f,{},[],[],!0);const Ss=e=>(!e||e.length==0||e.forEach(t=>{t.id||(t.id=Ir()),Ss(t.children)}),e),Rn=()=>{const{updateNodeData:e}=Ut();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 cw=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>'),dw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),fw=ie('<div class="heading svelte-r5g35l"><!> <!></div> <!>',1);const gw={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 bf(e,t){fe(t,!0),lt(e,gw);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=cw();D(a,l)},children:(a,l)=>{var c=fw(),u=he(c),g=W(u);it(g,{level:3,children:(v,b)=>{Te();var x=Re("输入参数");D(v,x)},$$slots:{default:!0}});var f=R(g,2);Je(f,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"parameters",{refType:"input"})},children:(v,b)=>{var x=dw();D(v,x)},$$slots:{default:!0}}),Y(u);var h=R(u,2);_f(h,{}),D(a,c)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(s){n(s),y()}})}ce(bf,{data:{}},[],[],!0);const xf=(e,t,n)=>{for(const r of n)r.target===t&&r.source&&(e.push(r.source),xf(e,r.source,n))},Cf=(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:Cf(r.children,t+"."+r.name,n)})),$f=(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:Cf(r,e.id,t)}}}},hw=(e=!1)=>{const t=$t(),n=Ar(t),{nodes:r,edges:o,nodeLookup:i}=tt();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=$f(f,h,u);v&&g.push(v)}}else{const f=[];xf(f,t,l);for(const h of a)if(f.includes(h.id)){const v=h.parentId===s.id,b=$f(h,v,u);b&&g.push(b)}}return g})};var vw=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>'),pw=ie('<div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div>',1);const mw={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 Ef(e,t){fe(t,!0),lt(e,mw);const[n,r]=dt(),o=()=>oe(d(g),"$node",n),i=()=>oe(m,"$selectItems",n);dn(()=>{d(f).refType||C({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}=Ut(),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)},x=$=>{const S=$.value;v("ref",S)},C=$=>{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=hw(c());var k=pw(),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=R(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:x})}};ye(T,H=>{d(f).refType!=="input"&&H(M)},!0)}D($,S)};ye(L,$=>{d(f).refType==="fixed"?$(V):$(A,!1)})}Y(O);var I=R(O,2),B=W(I);Vn(wo(B,{placement:"bottom",floating:S=>{var T=vw(),M=W(T),H=R(W(M));{let de=Ee(()=>d(f).refType?[d(f).refType]:[]);hn(H,{get items(){return tw},style:"width: 100%",defaultValue:["ref"],get value(){return d(de)},onSelect:C})}Y(M);var z=R(M,2),U=R(W(z));Tt(U,{rows:1,style:"width: 100%;",onchange:de=>{b("defaultValue",de)},get value(){return d(f).defaultValue}}),Y(z);var Z=R(z,2),ee=R(W(Z));Tt(ee,{rows:3,style:"width: 100%;",onchange:de=>{b("description",de)},get value(){return d(f).description}}),Y(Z);var re=R(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(Ef,{parameter:{},index:{},dataKeyName:{},useChildrenOnly:{}},[],[],!0);var yw=ie('<div class="input-header svelte-1sm1mgi">参数名称</div> <div class="input-header svelte-1sm1mgi">参数值</div> <div class="input-header svelte-1sm1mgi"></div>',1),ww=ie('<div class="none-params svelte-1sm1mgi"> </div>'),_w=ie('<div class="input-container svelte-1sm1mgi"><!> <!></div>');const bw={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 jt(e,t){fe(t,!0),lt(e,bw);const[n,r]=dt(),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 x;return[...((x=o())==null?void 0:x.data[s()])||[]]});var g=_w(),f=W(g);{var h=x=>{var C=yw();Te(4),D(x,C)};ye(f,x=>{d(u).length!==0&&x(h)})}var v=R(f,2);Yt(v,19,()=>d(u),x=>x.id,(x,C,p)=>{Ef(x,{get parameter(){return d(C)},get index(){return d(p)},get dataKeyName(){return s()},get useChildrenOnly(){return a()}})},x=>{var C=ww(),p=W(C,!0);Y(C),De(()=>vt(p,i())),D(x,C)}),Y(g),D(e,g);var b=ge({get noneParameterText(){return i()},set noneParameterText(x="无输入参数"){i(x),y()},get dataKeyName(){return s()},set dataKeyName(x="parameters"){s(x),y()},get useChildrenOnly(){return a()},set useChildrenOnly(x){a(x),y()}});return r(),b}ce(jt,{noneParameterText:{},dataKeyName:{},useChildrenOnly:{}},[],[],!0);var xw=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>'),Cw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),$w=ie('<div class="heading svelte-11h445j"><!> <!></div> <!>',1);const Ew={hash:"svelte-11h445j",code:".heading.svelte-11h445j {display:flex;margin-bottom:10px;}"};function kf(e,t){fe(t,!0),lt(e,Ew);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=xw();D(a,l)},children:(a,l)=>{var c=$w(),u=he(c),g=W(u);it(g,{level:3,children:(v,b)=>{Te();var x=Re("输出参数");D(v,x)},$$slots:{default:!0}});var f=R(g,2);Je(f,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(v,b)=>{var x=Cw();D(v,x)},$$slots:{default:!0}}),Y(u);var h=R(u,2);jt(h,{noneParameterText:"无输出参数",dataKeyName:"outputDefs"}),D(a,c)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(s){n(s),y()}})}ce(kf,{data:{}},[],[],!0);const dl=e=>JSON.parse(JSON.stringify(e));var kw=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>'),Sw=ie('<div class="input-more-item svelte-1cfeest"><!></div>'),Pw=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>'),Nw=ie('<div class="input-item svelte-1cfeest"><!> <!></div> <div class="input-item svelte-1cfeest"><!> <!></div> <div class="input-item svelte-1cfeest"><!></div>',1);const Tw={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 Sf(e,t){fe(t,!0),lt(e,Tw);const[n,r]=dt(),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}=Ut(),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 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.splice(M,1):S=S[M].children}}return{[a()]:[...dl($)]}}),b==null||b.hide()},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[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=Nw(),_=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,$)};ye(m,E=>{s().length>1&&E(k)})}var N=R(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=R(_,2),O=W(P);{let E=Ee(()=>d(u).dataType?[d(u).dataType]:[]),$=Ee(()=>d(u).dataTypeDisabled===!0);hn(O,{get items(){return yf},style:"width: 100%",defaultValue:["String"],get value(){return d(E)},get disabled(){return d($)},onSelect:v})}var L=R(O,2);{var V=E=>{Je(E,{class:"input-btn-more",style:"margin-left: auto",onclick:C,children:($,S)=>{var T=kw();D($,T)},$$slots:{default:!0}})};ye(L,E=>{(d(u).dataType==="Object"||d(u).dataType==="Array")&&d(u).addChildDisabled!==!0&&E(V)})}Y(P);var A=R(P,2),I=W(A);Vn(wo(I,{placement:"bottom",floating:$=>{var S=Pw(),T=W(S),M=R(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=R(T,2),z=R(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 U=R(H,2);{var Z=ee=>{var re=Sw(),Q=W(re);Je(Q,{onclick:x,children:(de,ne)=>{Te();var _e=Re("删除");D(de,_e)},$$slots:{default:!0}}),Y(re),D(ee,re)};ye(U,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 B=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(),B}ce(Sf,{parameter:{},position:{},dataKeyName:{}},[],[],!0);var Mw=ie("<!> <!>",1),Hw=ie('<div class="none-params svelte-1sm1mgi"> </div>'),Dw=ie('<div class="input-header svelte-1sm1mgi">参数名称</div> <div class="input-header svelte-1sm1mgi">参数类型</div> <div class="input-header svelte-1sm1mgi"></div>',1),Vw=ie('<div class="input-container svelte-1sm1mgi"><!> <!></div>');const Ow={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),lt(e,Ow);const[n,r]=dt(),o=()=>oe(d(c),"$node",n),i=(x,C=wt,p=wt)=>{var _=Ze(),m=he(_);Yt(m,19,C,k=>`${k.id}_${k.children?k.children.length:0}`,(k,N,P)=>{var O=Mw(),L=he(O);{let I=Ee(()=>[...p(),d(P)]);Sf(L,{get parameter(){return d(N)},get position(){return d(I)},get dataKeyName(){return a()}})}var V=R(L,2);{var A=I=>{{let B=Ee(()=>[...p(),d(P)]);i(I,()=>d(N).children,()=>d(B))}};ye(V,I=>{d(N).children&&I(A)})}D(k,O)},k=>{var N=Ze(),P=he(N);{var O=L=>{var V=Hw(),A=W(V,!0);Y(V),De(()=>vt(A,s())),D(L,V)};ye(P,L=>{p().length===0&&L(O)})}D(k,N)}),D(x,_)},s=w(t,"noneParameterText",7,"无输出参数"),a=w(t,"dataKeyName",7,"outputDefs");let l=$t(),c=Ee(()=>Ar(l)),u=Ee(()=>{var x;return[...((x=o())==null?void 0:x.data[a()])||[]]});var g=Vw(),f=W(g);{var h=x=>{var C=Dw();Te(4),D(x,C)};ye(f,x=>{d(u).length!==0&&x(h)})}var v=R(f,2);i(v,()=>d(u)||[],()=>[]),Y(g),D(e,g);var b=ge({get noneParameterText(){return s()},set noneParameterText(x="无输出参数"){s(x),y()},get dataKeyName(){return a()},set dataKeyName(x="outputDefs"){a(x),y()}});return r(),b}ce(hr,{noneParameterText:{},dataKeyName:{}},[],[],!0);var Aw=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>'),Lw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Iw=(e,t,n)=>t(n,{temperature:parseFloat(e.target.value)}),zw=(e,t,n)=>t(n,{topP:parseFloat(e.target.value)}),Rw=(e,t,n)=>t(n,{topK:parseInt(e.target.value)}),Bw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),qw=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 Yw={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;}
1
+ (function(rt,We){typeof exports=="object"&&typeof module<"u"?We(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],We):(rt=typeof globalThis<"u"?globalThis:rt||self,We(rt.TinyflowVue={},rt.Vue))})(this,function(rt,We){"use strict";var xb=Object.defineProperty;var Jf=rt=>{throw TypeError(rt)};var Cb=(rt,We,wt)=>We in rt?xb(rt,We,{enumerable:!0,configurable:!0,writable:!0,value:wt}):rt[We]=wt;var Et=(rt,We,wt)=>Cb(rt,typeof We!="symbol"?We+"":We,wt),yl=(rt,We,wt)=>We.has(rt)||Jf("Cannot "+wt);var Se=(rt,We,wt)=>(yl(rt,We,"read from private field"),wt?wt.call(rt):We.get(rt)),yt=(rt,We,wt)=>We.has(rt)?Jf("Cannot add the same private member more than once"):We instanceof WeakSet?We.add(rt):We.set(rt,wt),It=(rt,We,wt,Bn)=>(yl(rt,We,"write to private field"),Bn?Bn.call(rt,wt):We.set(rt,wt),wt),Eo=(rt,We,wt)=>(yl(rt,We,"access private method"),wt);var qf,fi,bo,xo,hr,gi,hi,Rr,Co,vr,Gn,Br,Jn,Qf,e1,wl,pr,$o,vi,Ts,t1,Qn,vn;typeof window<"u"&&((qf=window.__svelte??(window.__svelte={})).v??(qf.v=new Set)).add("5");let Bn=!1,n1=!1;function r1(){Bn=!0}r1();const _i=1,bi=2,_l=4,o1=8,i1=16,s1=1,a1=2,bl=4,l1=8,u1=16,xl=1,c1=2,Cl="[",As="[!",Os="]",mr={},St=Symbol(),d1="http://www.w3.org/1999/xhtml",f1="http://www.w3.org/2000/svg",g1="@attach",$l=!1;var Yr=Array.isArray,h1=Array.prototype.indexOf,Ls=Array.from,xi=Object.keys,yr=Object.defineProperty,Fn=Object.getOwnPropertyDescriptor,kl=Object.getOwnPropertyDescriptors,v1=Object.prototype,p1=Array.prototype,Is=Object.getPrototypeOf,El=Object.isExtensible;function So(e){return typeof e=="function"}const _t=()=>{};function m1(e){return e()}function Po(e){for(var t=0;t<e.length;t++)e[t]()}function y1(){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,zs=4,Ci=8,No=16,Yn=32,wr=64,Sl=128,ln=256,$i=512,bt=1024,Xt=2048,tr=4096,pn=8192,_r=16384,Rs=32768,qr=65536,Pl=1<<17,w1=1<<18,Bs=1<<19,Fs=1<<20,Ys=1<<21,qs=1<<22,br=1<<23,Sn=Symbol("$state"),Xs=Symbol("legacy props"),_1=Symbol(""),Ws=new class extends Error{constructor(){super(...arguments);Et(this,"name","StaleReactionError");Et(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},b1=1,Zs=3,Xr=8;function x1(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function ki(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function C1(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function $1(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function k1(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function E1(e){throw new Error("https://svelte.dev/e/effect_orphan")}function S1(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function P1(){throw new Error("https://svelte.dev/e/hydration_failed")}function N1(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function T1(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function M1(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function H1(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function To(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function D1(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}let He=!1;function Jt(e){He=e}let Ye;function zt(e){if(e===null)throw To(),mr;return Ye=e}function Pn(){return zt(Tn(Ye))}function F(e){if(He){if(Tn(Ye)!==null)throw To(),mr;Ye=e}}function Te(e=1){if(He){for(var t=e,n=Ye;t--;)n=Tn(n);Ye=n}}function Ks(){for(var e=0,t=Ye;;){if(t.nodeType===Xr){var n=t.data;if(n===Os){if(e===0)return t;e-=1}else(n===Cl||n===As)&&(e+=1)}var r=Tn(t);t.remove(),t=r}}function Nl(e){if(!e||e.nodeType!==Xr)throw To(),mr;return e.data}function Tl(e){return e===this.v}function js(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Ml(e){return!js(e,this.v)}let lt=null;function Ei(e){lt=e}function xr(e){return Us().get(e)}function Wr(e,t){return Us().set(e,t),t}function V1(e){return Us().has(e)}function fe(e,t=!1,n){lt={p:lt,c:null,e:null,s:e,x:null,l:Bn&&!t?{s:null,u:null,$:[]}:null}}function ge(e){var t=lt,n=t.e;if(n!==null){t.e=null;for(var r of n)jl(r)}return e!==void 0&&(t.x=e),lt=t.p,e??{}}function Mo(){return!Bn||lt!==null&&lt.l===null}function Us(e){return lt===null&&ki(),lt.c??(lt.c=new Map(A1(lt)||void 0))}function A1(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}const O1=new WeakMap;function L1(e){var t=Ie;if(t===null)return Ze.f|=br,e;if((t.f&Rs)===0){if((t.f&Sl)===0)throw!t.parent&&e instanceof Error&&Hl(e),e;t.b.error(e)}else Gs(e,t)}function Gs(e,t){for(;t!==null;){if((t.f&Sl)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw e instanceof Error&&Hl(e),e}function Hl(e){const t=O1.get(e);t&&(yr(e,"message",{value:t.message}),yr(e,"stack",{value:t.stack}))}const I1=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let Ho=[],Do=[];function Dl(){var e=Ho;Ho=[],Po(e)}function Vl(){var e=Do;Do=[],Po(e)}function Vo(e){Ho.length===0&&queueMicrotask(Dl),Ho.push(e)}function z1(e){Do.length===0&&I1(Vl),Do.push(e)}function R1(){Ho.length>0&&Dl(),Do.length>0&&Vl()}function B1(){for(var e=Ie.b;e!==null&&!e.has_pending_snippet();)e=e.parent;return e===null&&x1(),e}function Ao(e){var t=Gt|Xt,n=Ze!==null&&(Ze.f&Gt)!==0?Ze:null;return Ie===null||n!==null&&(n.f&ln)!==0?t|=ln:Ie.f|=Bs,{ctx:lt,deps:null,effects:null,equals:Tl,f:t,fn:e,reactions:null,rv:0,v:St,wv:0,parent:n??Ie,ac:null}}function F1(e,t){let n=Ie;n===null&&C1();var r=n.b,o=void 0,i=jr(St),s=null,a=!Ze;return G1(()=>{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=Rt,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|=br,Oo(i,v)):((i.f&br)!==0&&(i.f^=br),Oo(i,h)),a&&(r.update_pending_count(-1),g||u.decrement()),Il()};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 ke(e){const t=Ao(e);return ou(t),t}function De(e){const t=Ao(e);return t.equals=Ml,t}function Al(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Bt(t[n])}}function Y1(e){for(var t=e.parent;t!==null;){if((t.f&Gt)===0)return t;t=t.parent}return null}function Js(e){var t,n=Ie;Dn(Y1(e));try{Al(e),t=lu(e)}finally{Dn(n)}return t}function Ol(e){var t=Js(e);if(e.equals(t)||(e.v=t,e.wv=su()),!kr)if(nr!==null)nr.set(e,e.v);else{var n=(or||(e.f&ln)!==0)&&e.deps!==null?tr:bt;Ct(e,n)}}function Ll(e,t,n){const r=Mo()?Ao:De;if(t.length===0){n(e.map(r));return}var o=Rt,i=Ie,s=q1(),a=B1();Promise.all(t.map(l=>F1(l))).then(l=>{o==null||o.activate(),s();try{n([...e.map(r),...l])}catch(c){(i.f&_r)===0&&Gs(c,i)}o==null||o.deactivate(),Il()}).catch(l=>{a.error(l)})}function q1(){var e=Ie,t=Ze,n=lt;return function(){Dn(e),Hn(t),Ei(n)}}function Il(){Dn(null),Hn(null),Ei(null)}const Si=new Set;let Rt=null,nr=null,zl=new Set,Pi=[];function Rl(){const e=Pi.shift();Pi.length>0&&queueMicrotask(Rl),e()}let Zr=[],Ni=null,Qs=!1;const Ns=class Ns{constructor(){yt(this,Jn);yt(this,fi,new Map);yt(this,bo,new Map);yt(this,xo,new Set);yt(this,hr,0);yt(this,gi,null);yt(this,hi,!1);yt(this,Rr,[]);yt(this,Co,[]);yt(this,vr,[]);yt(this,Gn,[]);yt(this,Br,[]);Et(this,"skipped_effects",new Set)}capture(t,n){Se(this,bo).has(t)||Se(this,bo).set(t,n),Se(this,fi).set(t,t.v)}activate(){Rt=this}deactivate(){Rt=null;for(const t of zl)if(zl.delete(t),t(),Rt!==null)break}neuter(){It(this,hi,!0)}flush(){Zr.length>0?this.flush_effects():Eo(this,Jn,wl).call(this),Rt===this&&(Se(this,hr)===0&&Si.delete(this),this.deactivate())}flush_effects(){var t=Gr;Qs=!0;try{var n=0;for(nu(!0);Zr.length>0;){if(n++>1e3){var r,o;X1()}Eo(this,Jn,Qf).call(this,Zr),Cr.clear()}}finally{Qs=!1,nu(t),Ni=null}}increment(){It(this,hr,Se(this,hr)+1)}decrement(){if(It(this,hr,Se(this,hr)-1),Se(this,hr)===0){for(const t of Se(this,vr))Ct(t,Xt),rr(t);for(const t of Se(this,Gn))Ct(t,Xt),rr(t);for(const t of Se(this,Br))Ct(t,Xt),rr(t);It(this,vr,[]),It(this,Gn,[]),this.flush()}else this.deactivate()}add_callback(t){Se(this,xo).add(t)}settled(){return(Se(this,gi)??It(this,gi,y1())).promise}static ensure(t=!0){if(Rt===null){const n=Rt=new Ns;Si.add(Rt),t&&Ns.enqueue(()=>{Rt===n&&n.flush()})}return Rt}static enqueue(t){Pi.length===0&&queueMicrotask(Rl),Pi.unshift(t)}};fi=new WeakMap,bo=new WeakMap,xo=new WeakMap,hr=new WeakMap,gi=new WeakMap,hi=new WeakMap,Rr=new WeakMap,Co=new WeakMap,vr=new WeakMap,Gn=new WeakMap,Br=new WeakMap,Jn=new WeakSet,Qf=function(t){var i;Zr=[];var n=null;if(Si.size>1){n=new Map,nr=new Map;for(const[s,a]of Se(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 Se(s,bo))n.has(a)||(n.set(a,{v:a.v,wv:a.wv}),a.v=l)}for(const s of t)Eo(this,Jn,e1).call(this,s);if(Se(this,Rr).length===0&&Se(this,hr)===0){var r=Se(this,vr),o=Se(this,Gn);It(this,vr,[]),It(this,Gn,[]),It(this,Br,[]),Eo(this,Jn,wl).call(this),Bl(r),Bl(o),(i=Se(this,gi))==null||i.resolve()}else{for(const s of Se(this,vr))Ct(s,bt);for(const s of Se(this,Gn))Ct(s,bt);for(const s of Se(this,Br))Ct(s,bt)}if(n){for(const[s,{v:a,wv:l}]of n)s.wv<=l&&(s.v=a);nr=null}for(const s of Se(this,Rr))Jr(s);for(const s of Se(this,Co))Jr(s);It(this,Rr,[]),It(this,Co,[])},e1=function(t){var u;t.f^=bt;for(var n=t.first;n!==null;){var r=n.f,o=(r&(Yn|wr))!==0,i=o&&(r&bt)!==0,s=i||(r&pn)!==0||this.skipped_effects.has(n);if(!s&&n.fn!==null){if(o)n.f^=bt;else if((r&zs)!==0)Se(this,Gn).push(n);else if(zo(n))if((r&qs)!==0){var a=(u=n.b)!=null&&u.pending?Se(this,Co):Se(this,Rr);a.push(n)}else(n.f&No)!==0&&Se(this,Br).push(n),Jr(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}},wl=function(){if(!Se(this,hi))for(const t of Se(this,xo))t();Se(this,xo).clear()};let Kr=Ns;function y(e){var t;const n=Kr.ensure(!1);for(;;){if(R1(),Zr.length===0)return n===Rt&&n.flush(),Ni=null,t;n.flush_effects()}}function X1(){try{S1()}catch(e){Gs(e,Ni)}}function Bl(e){var t=e.length;if(t!==0){for(var n=0;n<t;n++){var r=e[n];if((r.f&(_r|pn))===0&&zo(r)){var o=Mi;if(Jr(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null&&r.ac===null?Ql(r):r.fn=null),Mi>o&&(r.f&Fs)!==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(Qs&&t===Ie&&(n&No)!==0)return;if((n&(wr|Yn))!==0){if((n&bt)===0)return;t.f^=bt}}Zr.push(t)}const Cr=new Map;function jr(e,t){var n={f:0,v:e,reactions:null,equals:Tl,rv:0,wv:0};return n}function Vt(e,t){const n=jr(e);return ou(n),n}function le(e,t=!1,n=!0){var o;const r=jr(e);return t||(r.equals=Ml),Bn&&n&&lt!==null&&lt.l!==null&&((o=lt.l).s??(o.s=[])).push(r),r}function te(e,t,n=!1){Ze!==null&&(!Mn||(Ze.f&Pl)!==0)&&Mo()&&(Ze.f&(Gt|No|qs|Pl))!==0&&!(Ft!=null&&Ft.includes(e))&&H1();let r=n?Nn(t):t;return Oo(e,r)}function Oo(e,t){if(!e.equals(t)){var n=e.v;kr?Cr.set(e,t):Cr.set(e,n),e.v=t,Kr.ensure().capture(e,n),(e.f&Gt)!==0&&((e.f&Xt)!==0&&Js(e),Ct(e,(e.f&ln)===0?bt:tr)),e.wv=su(),Yl(e,Xt),Mo()&&Ie!==null&&(Ie.f&bt)!==0&&(Ie.f&(Yn|wr))===0&&(dn===null?Q1([e]):dn.push(e))}return t}function Fl(e,t=1){var n=d(e),r=t===1?n++:n--;return te(e,n),r}function ea(e){te(e,e.v+1)}function Yl(e,t){var n=e.reactions;if(n!==null)for(var r=Mo(),o=n.length,i=0;i<o;i++){var s=n[i],a=s.f;!r&&s===Ie||((a&Xt)===0&&Ct(s,t),(a&Gt)!==0?Yl(s,tr):(a&Xt)===0&&rr(s))}}function Nn(e){if(typeof e!="object"||e===null||Sn in e)return e;const t=Is(e);if(t!==v1&&t!==p1)return e;var n=new Map,r=Yr(e),o=Vt(0),i=Er,s=a=>{if(Er===i)return a();var l=Ze,c=Er;Hn(null),iu(i);var u=a();return Hn(l),iu(c),u};return r&&n.set("length",Vt(e.length)),new Proxy(e,{defineProperty(a,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&T1();var u=n.get(l);return u===void 0?u=s(()=>{var g=Vt(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(()=>Vt(St));n.set(l,u),ea(o)}}else te(c,St),ea(o);return!0},get(a,l,c){var h;if(l===Sn)return e;var u=n.get(l),g=l in a;if(u===void 0&&(!g||(h=Fn(a,l))!=null&&h.writable)&&(u=s(()=>{var v=Nn(g?a[l]:St),b=Vt(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===Sn)return!0;var c=n.get(l),u=c!==void 0&&c.v!==St||Reflect.has(a,l);if(c!==void 0||Ie!==null&&(!u||(f=Fn(a,l))!=null&&f.writable)){c===void 0&&(c=s(()=>{var h=u?Nn(a[l]):St,v=Vt(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(()=>Vt(St)),n.set(h+"",v))}if(g===void 0)(!f||(_=Fn(a,l))!=null&&_.writable)&&(g=s(()=>Vt(void 0)),te(g,Nn(c)),n.set(l,g));else{f=g.v!==St;var b=s(()=>Nn(c));te(g,b)}var x=Reflect.getOwnPropertyDescriptor(a,l);if(x!=null&&x.set&&x.set.call(u,c),!f){if(r&&typeof l=="string"){var C=n.get("length"),m=Number(l);Number.isInteger(m)&&m>=C.v&&te(C,m+1)}ea(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(){M1()}})}function ql(e){try{if(e!==null&&typeof e=="object"&&Sn in e)return e[Sn]}catch{}return e}function W1(e,t){return Object.is(ql(e),ql(t))}var Wt,Xl,Wl,Zl;function ta(){if(Wt===void 0){Wt=window,Xl=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Wl=Fn(t,"firstChild").get,Zl=Fn(t,"nextSibling").get,El(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),El(n)&&(n.__t=void 0)}}function un(e=""){return document.createTextNode(e)}function xt(e){return Wl.call(e)}function Tn(e){return Zl.call(e)}function Y(e,t){if(!He)return xt(e);var n=xt(Ye);if(n===null)n=Ye.appendChild(un());else if(t&&n.nodeType!==Zs){var r=un();return n==null||n.before(r),zt(r),r}return zt(n),n}function he(e,t){if(!He){var n=xt(e);return n instanceof Comment&&n.data===""?Tn(n):n}return Ye}function R(e,t=1,n=!1){let r=He?Ye:e;for(var o;t--;)o=r,r=Tn(r);if(!He)return r;if(n&&(r==null?void 0:r.nodeType)!==Zs){var i=un();return r===null?o==null||o.after(i):r.before(i),zt(i),i}return zt(r),r}function na(e){e.textContent=""}function ra(){return!1}function Kl(e){Ie===null&&Ze===null&&E1(),Ze!==null&&(Ze.f&ln)!==0&&Ie===null&&k1(),kr&&$1()}function Z1(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=Ie;o!==null&&(o.f&pn)!==0&&(e|=pn);var i={ctx:lt,deps:null,nodes_start:null,nodes_end:null,f:e|Xt,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{Jr(i),i.f|=Rs}catch(l){throw Bt(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&Bs)===0;if(!s&&r&&(o!==null&&Z1(i,o),Ze!==null&&(Ze.f&Gt)!==0)){var a=Ze;(a.effects??(a.effects=[])).push(i)}return i}function oa(e){const t=mn(Ci,null,!1);return Ct(t,bt),t.teardown=e,t}function cn(e){Kl();var t=Ie.f,n=!Ze&&(t&Yn)!==0&&(t&Rs)===0;if(n){var r=lt;(r.e??(r.e=[])).push(e)}else return jl(e)}function jl(e){return mn(zs|Fs,e,!1)}function K1(e){return Kl(),mn(Ci|Fs,e,!0)}function j1(e){Kr.ensure();const t=mn(wr,e,!0);return()=>{Bt(t)}}function U1(e){Kr.ensure();const t=mn(wr,e,!0);return(n={})=>new Promise(r=>{n.outro?Lo(t,()=>{Bt(t),r(void 0)}):(Bt(t),r(void 0))})}function Qt(e){return mn(zs,e,!1)}function ve(e,t){var n=lt,r={effect:null,ran:!1,deps:e};n.l.$.push(r),r.effect=Ur(()=>{e(),!r.ran&&(r.ran=!0,G(t))})}function Pt(){var e=lt;Ur(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&bt)!==0&&Ct(n,tr),zo(n)&&Jr(n),t.ran=!1}})}function G1(e){return mn(qs|Bs,e,!0)}function Ur(e,t=0){return mn(Ci|t,e,!0)}function Ve(e,t=[],n=[]){Ll(t,n,r=>{mn(Ci,()=>e(...r.map(d)),!0)})}function $r(e,t=0){var n=mn(No|t,e,!0);return n}function yn(e,t=!0){return mn(Yn,e,!0,t)}function Ul(e){var t=e.teardown;if(t!==null){const n=kr,r=Ze;ru(!0),Hn(null);try{t.call(null)}finally{ru(n),Hn(r)}}}function Gl(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&wr)!==0?n.parent=null:Bt(n,t),n=r}}function J1(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&Yn)===0&&Bt(t),t=n}}function Bt(e,t=!0){var n=!1;(t||(e.f&w1)!==0)&&e.nodes_start!==null&&e.nodes_end!==null&&(Jl(e.nodes_start,e.nodes_end),n=!0),Gl(e,t&&!n),Hi(e,0),Ct(e,_r);var r=e.transitions;if(r!==null)for(const i of r)i.stop();Ul(e);var o=e.parent;o!==null&&o.first!==null&&Ql(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:Tn(e);e.remove(),e=n}}function Ql(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=[];ia(e,n,!0),eu(n,()=>{Bt(e),t&&t()})}function eu(e,t){var n=e.length;if(n>0){var r=()=>--n||t();for(var o of e)o.out(r)}else t()}function ia(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&qr)!==0||(r.f&Yn)!==0;ia(r,t,i?n:!1),r=o}}}function Ti(e){tu(e,!0)}function tu(e,t){if((e.f&pn)!==0){e.f^=pn,(e.f&bt)===0&&(Ct(e,Xt),rr(e));for(var n=e.first;n!==null;){var r=n.next,o=(n.f&qr)!==0||(n.f&Yn)!==0;tu(n,o?t:!1),n=r}if(e.transitions!==null)for(const i of e.transitions)(i.is_global||t)&&i.in()}}let Gr=!1;function nu(e){Gr=e}let kr=!1;function ru(e){kr=e}let Ze=null,Mn=!1;function Hn(e){Ze=e}let Ie=null;function Dn(e){Ie=e}let Ft=null;function ou(e){Ze!==null&&(Ft===null?Ft=[e]:Ft.push(e))}let Yt=null,en=0,dn=null;function Q1(e){dn=e}let Mi=1,Io=0,Er=Io;function iu(e){Er=e}let or=!1;function su(){return++Mi}function zo(e){var g;var t=e.f;if((t&Xt)!==0)return!0;if((t&tr)!==0){var n=e.deps,r=(t&ln)!==0;if(n!==null){var o,i,s=(t&$i)!==0,a=r&&Ie!==null&&!or,l=n.length;if((s||a)&&(Ie===null||(Ie.f&_r)===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&ln)===0&&(c.f^=ln)}for(o=0;o<l;o++)if(i=n[o],zo(i)&&Ol(i),i.wv>e.wv)return!0}(!r||Ie!==null&&!or)&&Ct(e,bt)}return!1}function au(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Ft!=null&&Ft.includes(e)))for(var o=0;o<r.length;o++){var i=r[o];(i.f&Gt)!==0?au(i,t,!1):t===i&&(n?Ct(i,Xt):(i.f&bt)!==0&&Ct(i,tr),rr(i))}}function lu(e){var v;var t=Yt,n=en,r=dn,o=Ze,i=or,s=Ft,a=lt,l=Mn,c=Er,u=e.f;Yt=null,en=0,dn=null,or=(u&ln)!==0&&(Mn||!Gr||Ze===null),Ze=(u&(Yn|wr))===0?e:null,Ft=null,Ei(e.ctx),Mn=!1,Er=++Io,e.ac!==null&&(e.ac.abort(Ws),e.ac=null);try{e.f|=Ys;var g=(0,e.fn)(),f=e.deps;if(Yt!==null){var h;if(Hi(e,en),f!==null&&en>0)for(f.length=en+Yt.length,h=0;h<Yt.length;h++)f[en+h]=Yt[h];else e.deps=f=Yt;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(Mo()&&dn!==null&&!Mn&&f!==null&&(e.f&(Gt|tr|Xt))===0)for(h=0;h<dn.length;h++)au(dn[h],e);return o!==null&&o!==e&&(Io++,dn!==null&&(r===null?r=dn:r.push(...dn))),(e.f&br)!==0&&(e.f^=br),g}catch(b){return L1(b)}finally{e.f^=Ys,Yt=t,en=n,dn=r,Ze=o,or=i,Ft=s,Ei(a),Mn=l,Er=c}}function eg(e,t){let n=t.reactions;if(n!==null){var r=h1.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&&(Yt===null||!Yt.includes(t))&&(Ct(t,tr),(t.f&(ln|$i))===0&&(t.f^=$i),Al(t),Hi(t,0))}function Hi(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)eg(e,n[r])}function Jr(e){var t=e.f;if((t&_r)===0){Ct(e,bt);var n=Ie,r=Gr;Ie=e,Gr=!0;try{(t&No)!==0?J1(e):Gl(e),Ul(e);var o=lu(e);e.teardown=typeof o=="function"?o:null,e.wv=Mi;var i;$l&&n1&&(e.f&Xt)!==0&&e.deps}finally{Gr=r,Ie=n}}}function d(e){var t=e.f,n=(t&Gt)!==0;if(Ze!==null&&!Mn){var r=Ie!==null&&(Ie.f&_r)!==0;if(!r&&!(Ft!=null&&Ft.includes(e))){var o=Ze.deps;if((Ze.f&Ys)!==0)e.rv<Io&&(e.rv=Io,Yt===null&&o!==null&&o[en]===e?en++:Yt===null?Yt=[e]:(!or||!Yt.includes(e))&&Yt.push(e));else{(Ze.deps??(Ze.deps=[])).push(e);var i=e.reactions;i===null?e.reactions=[Ze]:i.includes(Ze)||i.push(Ze)}}}else if(n&&e.deps===null&&e.effects===null){var s=e,a=s.parent;a!==null&&(a.f&ln)===0&&(s.f^=ln)}if(kr){if(Cr.has(e))return Cr.get(e);if(n){s=e;var l=s.v;return((s.f&bt)===0&&s.reactions!==null||uu(s))&&(l=Js(s)),Cr.set(s,l),l}}else if(n){if(s=e,nr!=null&&nr.has(s))return nr.get(s);zo(s)&&Ol(s)}if((e.f&br)!==0)throw e.v;return e.v}function uu(e){if(e.v===St)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(Cr.has(t)||(t.f&Gt)!==0&&uu(t))return!0;return!1}function G(e){var t=Mn;try{return Mn=!0,e()}finally{Mn=t}}const tg=-7169;function Ct(e,t){e.f=e.f&tg|t}function q(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(Sn in e)sa(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&Sn in n&&sa(n)}}}function sa(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{sa(e[r],t)}catch{}const n=Is(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=kl(n);for(let o in r){const i=r[o].get;if(i)try{i.call(e)}catch{}}}}}function ng(e,t){if(t){const n=document.body;e.autofocus=!0,Vo(()=>{document.activeElement===n&&e.focus()})}}function rg(e){He&&xt(e)!==null&&na(e)}let cu=!1;function du(){cu||(cu=!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 fu(e){var t=Ze,n=Ie;Hn(null),Dn(null);try{return e()}finally{Hn(t),Dn(n)}}function og(e,t,n,r=n){e.addEventListener(t,()=>fu(n));const o=e.__on_r;o?e.__on_r=()=>{o(),r(!0)}:e.__on_r=()=>r(!0),du()}const gu=new Set,aa=new Set;function hu(e,t,n,r={}){function o(i){if(r.capture||Ro.call(t,i),!i.cancelBubble)return fu(()=>n==null?void 0:n.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Vo(()=>{t.addEventListener(e,o,r)}):t.addEventListener(e,o,r),o}function dt(e,t,n,r,o){var i={capture:r,passive:o},s=hu(e,t,n,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&oa(()=>{t.removeEventListener(e,s,i)})}function Sr(e){for(var t=0;t<e.length;t++)gu.add(e[t]);for(var n of aa)n(e)}function Ro(e){var m;var t=this,n=t.ownerDocument,r=e.type,o=((m=e.composedPath)==null?void 0:m.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){yr(e,"currentTarget",{configurable:!0,get(){return i||n}});var u=Ze,g=Ie;Hn(null),Dn(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(Yr(b)){var[x,...C]=b;x.apply(i,[e,...C])}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,Hn(u),Dn(g)}}}function la(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function Zt(e,t){var n=Ie;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function ie(e,t){var n=(t&xl)!==0,r=(t&c1)!==0,o,i=!e.startsWith("<!>");return()=>{if(He)return Zt(Ye,null),Ye;o===void 0&&(o=la(i?e:"<!>"+e),n||(o=xt(o)));var s=r||Xl?document.importNode(o,!0):o.cloneNode(!0);if(n){var a=xt(s),l=s.lastChild;Zt(a,l)}else Zt(s,s);return s}}function ig(e,t,n="svg"){var r=!e.startsWith("<!>"),o=(t&xl)!==0,i=`<${n}>${r?e:"<!>"+e}</${n}>`,s;return()=>{if(He)return Zt(Ye,null),Ye;if(!s){var a=la(i),l=xt(a);if(o)for(s=document.createDocumentFragment();xt(l);)s.appendChild(xt(l));else s=xt(l)}var c=s.cloneNode(!0);if(o){var u=xt(c),g=c.lastChild;Zt(u,g)}else Zt(c,c);return c}}function Ce(e,t){return ig(e,t,"svg")}function Re(e=""){if(!He){var t=un(e+"");return Zt(t,t),t}var n=Ye;return n.nodeType!==Zs&&(n.before(n=un()),zt(n)),Zt(n,n),n}function qe(){if(He)return Zt(Ye,null),Ye;var e=document.createDocumentFragment(),t=document.createComment(""),n=un();return e.append(t,n),Zt(t,n),e}function D(e,t){if(He){Ie.nodes_end=Ye,Pn();return}e!==null&&e.before(t)}function sg(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const ag=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function lg(e){return ag.includes(e)}const ug={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 cg(e){return e=e.toLowerCase(),ug[e]??e}const dg=["touchstart","touchmove"];function fg(e){return dg.includes(e)}const gg=["textarea","script","style","title"];function hg(e){return gg.includes(e)}function ft(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 vu(e,t){return pu(e,t)}function vg(e,t){ta(),t.intro=t.intro??!1;const n=t.target,r=He,o=Ye;try{for(var i=xt(n);i&&(i.nodeType!==Xr||i.data!==Cl);)i=Tn(i);if(!i)throw mr;Jt(!0),zt(i),Pn();const s=pu(e,{...t,anchor:i});if(Ye===null||Ye.nodeType!==Xr||Ye.data!==Os)throw To(),mr;return Jt(!1),s}catch(s){if(s===mr)return t.recover===!1&&P1(),ta(),na(n),Jt(!1),vu(e,t);throw s}finally{Jt(r),zt(o)}}const Qr=new Map;function pu(e,{target:t,anchor:n,props:r={},events:o,context:i,intro:s=!0}){ta();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=fg(h);t.addEventListener(h,Ro,{passive:v});var b=Qr.get(h);b===void 0?(document.addEventListener(h,Ro,{passive:v}),Qr.set(h,1)):Qr.set(h,b+1)}}};l(Ls(gu)),aa.add(l);var c=void 0,u=U1(()=>{var g=n??t.appendChild(un());return yn(()=>{if(i){fe({});var f=lt;f.c=i}o&&(r.$$events=o),He&&Zt(g,null),c=e(g,r)||{},He&&(Ie.nodes_end=Ye),i&&ge()}),()=>{var v;for(var f of a){t.removeEventListener(f,Ro);var h=Qr.get(f);--h===0?(document.removeEventListener(f,Ro),Qr.delete(f)):Qr.set(f,h)}aa.delete(l),g!==n&&((v=g.parentNode)==null||v.removeChild(g))}});return ua.set(c,u),c}let ua=new WeakMap;function pg(e,t){const n=ua.get(e);return n?(ua.delete(e),n(t)):Promise.resolve()}function Pr(e,t,...n){var r=e,o=_t,i;$r(()=>{o!==(o=t())&&(i&&(Bt(i),i=null),i=yn(()=>o(r,...n)))},qr),He&&(r=Ye)}function tn(e){lt===null&&ki(),Bn&&lt.l!==null?yg(lt).m.push(e):cn(()=>{const t=G(e);if(typeof t=="function")return t})}function ca(e){lt===null&&ki(),tn(()=>()=>G(e))}function mg(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function Di(){const e=lt;return e===null&&ki(),(t,n,r)=>{var i;const o=(i=e.s.$$events)==null?void 0:i[t];if(o){const s=Yr(o)?o.slice():[o],a=mg(t,n,r);for(const l of s)l.call(e.x,a);return!a.defaultPrevented}return!0}}function yg(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}function pe(e,t,n=!1){He&&Pn();var r=e,o=null,i=null,s=St,a=n?qr: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 E=Nl(r)===As;!!s===E&&(r=Ks(),zt(r),Jt(!1),b=!0)}var x=ra(),C=r;if(x&&(u=document.createDocumentFragment(),u.append(C=un())),s?o??(o=v&&yn(()=>v(C))):i??(i=v&&yn(()=>v(C))),x){var m=Rt,_=s?o:i,p=s?i:o;_&&m.skipped_effects.delete(_),p&&m.skipped_effects.add(p),m.add_callback(g)}else g();b&&Jt(!0)};$r(()=>{l=!1,t(c),l||f(null,null)},a),He&&(r=Ye)}function eo(e,t){return t}function wg(e,t,n){for(var r=e.items,o=[],i=t.length,s=0;s<i;s++)ia(t[s].e,o,!0);var a=i>0&&o.length===0&&n!==null;if(a){var l=n.parentNode;na(l),l.append(n),r.clear(),Vn(e,t[0].prev,t[i-1].next)}eu(o,()=>{for(var c=0;c<i;c++){var u=t[c];a||(r.delete(u.k),Vn(e,u.prev,u.next)),Bt(u.e,!a)}})}function At(e,t,n,r,o,i=null){var s=e,a={flags:t,items:new Map,first:null},l=(t&_l)!==0;if(l){var c=e;s=He?zt(xt(c)):c.appendChild(un())}He&&Pn();var u=null,g=!1,f=new Map,h=De(()=>{var C=n();return Yr(C)?C:C==null?[]:Ls(C)}),v,b;function x(){_g(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}))}$r(()=>{b??(b=Ie),v=d(h);var C=v.length;if(g&&C===0)return;g=C===0;let m=!1;if(He){var _=Nl(s)===As;_!==(C===0)&&(s=Ks(),zt(s),Jt(!1),m=!0)}if(He){for(var p=null,E,N=0;N<C;N++){if(Ye.nodeType===Xr&&Ye.data===Os){s=Ye,m=!0,Jt(!1);break}var S=v[N],A=r(S,N);E=da(Ye,a,p,null,S,A,N,o,t,n),a.items.set(A,E),p=E}C>0&&zt(Ks())}if(He)C===0&&i&&(u=yn(()=>i(s)));else if(ra()){var L=new Set,V=Rt;for(N=0;N<C;N+=1){S=v[N],A=r(S,N);var O=a.items.get(A)??f.get(A);O?(t&(_i|bi))!==0&&mu(O,S,N,t):(E=da(null,a,null,null,S,A,N,o,t,n,!0),f.set(A,E)),L.add(A)}for(const[z,B]of a.items)L.has(z)||V.skipped_effects.add(B.e);V.add_callback(x)}else x();m&&Jt(!0),d(h)}),He&&(s=Ye)}function _g(e,t,n,r,o,i,s,a,l){var H,I,W,j;var c=(s&o1)!==0,u=(s&(_i|bi))!==0,g=t.length,f=n.items,h=n.first,v=h,b,x=null,C,m=[],_=[],p,E,N,S;if(c)for(S=0;S<g;S+=1)p=t[S],E=a(p,S),N=f.get(E),N!==void 0&&((H=N.a)==null||H.measure(),(C??(C=new Set)).add(N));for(S=0;S<g;S+=1){if(p=t[S],E=a(p,S),N=f.get(E),N===void 0){var A=r.get(E);if(A!==void 0){r.delete(E),f.set(E,A);var L=x?x.next:v;Vn(n,x,A),Vn(n,A,L),fa(A,L,o),x=A}else{var V=v?v.e.nodes_start:o;x=da(V,n,x,x===null?n.first:x.next,p,E,S,i,s,l)}f.set(E,x),m=[],_=[],v=x.next;continue}if(u&&mu(N,p,S,s),(N.e.f&pn)!==0&&(Ti(N.e),c&&((I=N.a)==null||I.unfix(),(C??(C=new Set)).delete(N))),N!==v){if(b!==void 0&&b.has(N)){if(m.length<_.length){var O=_[0],z;x=O.prev;var B=m[0],k=m[m.length-1];for(z=0;z<m.length;z+=1)fa(m[z],O,o);for(z=0;z<_.length;z+=1)b.delete(_[z]);Vn(n,B.prev,k.next),Vn(n,x,B),Vn(n,k,O),v=O,x=k,S-=1,m=[],_=[]}else b.delete(N),fa(N,v,o),Vn(n,N.prev,N.next),Vn(n,N,x===null?n.first:x.next),Vn(n,x,N),x=N;continue}for(m=[],_=[];v!==null&&v.k!==E;)(v.e.f&pn)===0&&(b??(b=new Set)).add(v),_.push(v),v=v.next;if(v===null)continue;N=v}m.push(N),x=N,v=N.next}if(v!==null||b!==void 0){for(var $=b===void 0?[]:Ls(b);v!==null;)(v.e.f&pn)===0&&$.push(v),v=v.next;var P=$.length;if(P>0){var T=(s&_l)!==0&&g===0?o:null;if(c){for(S=0;S<P;S+=1)(W=$[S].a)==null||W.measure();for(S=0;S<P;S+=1)(j=$[S].a)==null||j.fix()}wg(n,$,T)}}c&&Vo(()=>{var J;if(C!==void 0)for(N of C)(J=N.a)==null||J.apply()}),e.first=n.first&&n.first.e,e.last=x&&x.e;for(var M of r.values())Bt(M.e);r.clear()}function mu(e,t,n,r){(r&_i)!==0&&Oo(e.v,t),(r&bi)!==0?Oo(e.i,n):e.i=n}function da(e,t,n,r,o,i,s,a,l,c,u){var g=(l&_i)!==0,f=(l&i1)===0,h=g?f?le(o,!1,!1):jr(o):o,v=(l&bi)===0?s:jr(s),b={i:v,v:h,k:i,a:null,e:null,prev:n,next:r};try{if(e===null){var x=document.createDocumentFragment();x.append(e=un())}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 fa(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=Tn(i);o.before(i),i=s}}function Vn(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 ga(e,t,n=!1,r=!1,o=!1){var i=e,s="";Ve(()=>{var a=Ie;if(s===(s=t()??"")){He&&Pn();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=Pn(),c=l;l!==null&&(l.nodeType!==Xr||l.data!=="");)c=l,l=Tn(l);if(l===null)throw To(),mr;Zt(Ye,c),i=zt(l);return}var u=s+"";n?u=`<svg>${u}</svg>`:r&&(u=`<math>${u}</math>`);var g=la(u);if((n||r)&&(g=xt(g)),Zt(xt(g),g.lastChild),n||r)for(;xt(g);)i.before(xt(g));else i.before(g)}})}function Ot(e,t,n,r,o){var a;He&&Pn();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 bg(e){const t={};e.children&&(t.default=!0);for(const n in e.$$slots)t[n]=!0;return t}function yu(e,t,n){He&&Pn();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}$r(()=>{if(o!==(o=t())){var c=ra();if(o){var u=r;c&&(s=document.createDocumentFragment(),s.append(u=un())),a=yn(()=>n(u,o))}c?Rt.add_callback(l):l()}},qr),He&&(r=Ye)}function xg(e,t,n,r,o,i){let s=He;He&&Pn();var a,l,c=null;He&&Ye.nodeType===b1&&(c=Ye,Pn());var u=He?Ye:e,g;$r(()=>{const f=t()||null;var h=f==="svg"?f1:null;f!==a&&(g&&(f===null?Lo(g,()=>{g=null,l=null}):f===l?Ti(g):Bt(g)),f&&f!==l&&(g=yn(()=>{if(c=He?c:h?document.createElementNS(h,f):document.createElement(f),Zt(c,c),r){He&&hg(f)&&c.append(document.createComment(""));var v=He?xt(c):c.appendChild(un());He&&(v===null?Jt(!1):zt(v)),r(c,v)}Ie.nodes_end=c,u.before(c)})),a=f,a&&(l=a))},qr),s&&(Jt(!0),zt(u))}function ot(e,t){Vo(()=>{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 Lt(e,t,n){Qt(()=>{var r=G(()=>t(e,n==null?void 0:n())||{});if(n&&(r!=null&&r.update)){var o=!1,i={};Ur(()=>{var s=n();q(s),o&&js(i,s)&&(i=s,r.update(s))}),o=!0}if(r!=null&&r.destroy)return()=>r.destroy()})}function Cg(e,t){var n=void 0,r;$r(()=>{n!==(n=t())&&(r&&(Bt(r),r=null),n&&(r=yn(()=>{Qt(()=>n(e))})))})}function wu(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=wu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $g(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=wu(e))&&(r&&(r+=" "),r+=t);return r}function wn(e){return typeof e=="object"?$g(e):e??""}const _u=[...`
2
+ \r\f \v\uFEFF`];function kg(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||_u.includes(r[s-1]))&&(a===r.length||_u.includes(r[a]))?r=(s===0?"":r.substring(0,s))+r.substring(a+1):s=a}}return r===""?null:r}function bu(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 ha(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Eg(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(ha)),o&&l.push(...Object.keys(o).map(ha));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=ha(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+=bu(r)),o&&(n+=bu(o,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function Nt(e,t,n,r,o,i){var s=e.__className;if(He||s!==n||s===void 0){var a=kg(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 va(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 mt(e,t,n,r){var o=e.__style;if(He||o!==t){var i=Eg(t,r);(!He||i!==e.getAttribute("style"))&&(i==null?e.removeAttribute("style"):e.style.cssText=i),e.__style=t}else r&&(Array.isArray(r)?(va(e,n==null?void 0:n[0],r[0]),va(e,n==null?void 0:n[1],r[1],"important")):va(e,n,r));return r}function pa(e,t,n=!1){if(e.multiple){if(t==null)return;if(!Yr(t))return D1();for(var r of e.options)r.selected=t.includes(xu(r));return}for(r of e.options){var o=xu(r);if(W1(o,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Sg(e){var t=new MutationObserver(()=>{pa(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),oa(()=>{t.disconnect()})}function xu(e){return"__value"in e?e.__value:e.value}const Bo=Symbol("class"),Nr=Symbol("style"),Cu=Symbol("is custom element"),$u=Symbol("is html");function Tr(e){if(He){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;_e(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var o=e.checked;_e(e,"checked",null),e.checked=o}}};e.__on_r=n,z1(n),du()}}function Pg(e,t){var n=Vi(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function ku(e,t){var n=Vi(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function Ng(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function _e(e,t,n,r){var o=Vi(e);He&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=n)&&(t==="loading"&&(e[_1]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Su(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Tg(e,t,n,r,o=!1){var i=Vi(e),s=i[Cu],a=!i[$u];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=Su(e);for(const _ in n){let p=n[_];if(u&&_==="value"&&p==null){e.value=e.__value="",c[_]=p;continue}if(_==="class"){var h=e.namespaceURI==="http://www.w3.org/1999/xhtml";Nt(e,h,p,r,t==null?void 0:t[Bo],n[Bo]),c[_]=p,c[Bo]=n[Bo];continue}if(_==="style"){mt(e,p,t==null?void 0:t[Nr],n[Nr]),c[_]=p,c[Nr]=n[Nr];continue}var v=c[_];if(!(p===v&&!(p===void 0&&e.hasAttribute(_)))){c[_]=p;var b=_[0]+_[1];if(b!=="$$")if(b==="on"){const E={},N="$$"+_;let S=_.slice(2);var x=lg(S);if(sg(S)&&(S=S.slice(0,-7),E.capture=!0),!x&&v){if(p!=null)continue;e.removeEventListener(S,c[N],E),c[N]=null}if(p!=null)if(x)e[`__${S}`]=p,Sr([S]);else{let A=function(L){c[_].call(this,L)};c[N]=hu(S,e,A,E)}else x&&(e[`__${S}`]=void 0)}else if(_==="style")_e(e,_,p);else if(_==="autofocus")ng(e,!!p);else if(!s&&(_==="__value"||_==="value"&&p!=null))e.value=e.__value=p;else if(_==="selected"&&u)Ng(e,p);else{var C=_;a||(C=cg(C));var m=C==="defaultValue"||C==="defaultChecked";if(p==null&&!s&&!m)if(i[_]=null,C==="value"||C==="checked"){let E=e;const N=t===void 0;if(C==="value"){let S=E.defaultValue;E.removeAttribute(C),E.defaultValue=S,E.value=E.__value=N?S:null}else{let S=E.defaultChecked;E.removeAttribute(C),E.defaultChecked=S,E.checked=N?S:!1}}else e.removeAttribute(_);else m||f.includes(C)&&(s||typeof p!="string")?e[C]=p:typeof p!="function"&&_e(e,C,p)}}}return l&&Jt(!0),c}function nn(e,t,n=[],r=[],o,i=!1){Ll(n,r,s=>{var a=void 0,l={},c=e.nodeName==="SELECT",u=!1;if($r(()=>{var f=t(...s.map(d)),h=Tg(e,a,f,o,i);u&&c&&"value"in f&&pa(e,f.value);for(let b of Object.getOwnPropertySymbols(l))f[b]||Bt(l[b]);for(let b of Object.getOwnPropertySymbols(f)){var v=f[b];b.description===g1&&(!a||v!==a[b])&&(l[b]&&Bt(l[b]),l[b]=yn(()=>Cg(e,()=>v))),h[b]=v}a=h}),c){var g=e;Qt(()=>{pa(g,a.value,!0),Sg(g)})}u=!0})}function Vi(e){return e.__attributes??(e.__attributes={[Cu]:e.nodeName.includes("-"),[$u]:e.namespaceURI===d1})}var Eu=new Map;function Su(e){var t=Eu.get(e.nodeName);if(t)return t;Eu.set(e.nodeName,t=[]);for(var n,r=e,o=Element.prototype;o!==r;){n=kl(r);for(var i in n)n[i].set&&t.push(i);r=Is(r)}return t}function Mg(e,t,n=t){og(e,"change",r=>{var o=r?e.defaultChecked:e.checked;n(o)}),(He&&e.defaultChecked!==e.checked||G(t)==null)&&n(e.checked),Ur(()=>{var r=t();e.checked=!!r})}const Ms=class Ms{constructor(t){yt(this,Ts);yt(this,pr,new WeakMap);yt(this,$o);yt(this,vi);It(this,vi,t)}observe(t,n){var r=Se(this,pr).get(t)||new Set;return r.add(n),Se(this,pr).set(t,r),Eo(this,Ts,t1).call(this).observe(t,Se(this,vi)),()=>{var o=Se(this,pr).get(t);o.delete(n),o.size===0&&(Se(this,pr).delete(t),Se(this,$o).unobserve(t))}}};pr=new WeakMap,$o=new WeakMap,vi=new WeakMap,Ts=new WeakSet,t1=function(){return Se(this,$o)??It(this,$o,new ResizeObserver(t=>{for(var n of t){Ms.entries.set(n.target,n);for(var r of Se(this,pr).get(n.target)||[])r(n)}}))},Et(Ms,"entries",new WeakMap);let ma=Ms;var Hg=new ma({box:"border-box"});function Pu(e,t,n){var r=Hg.observe(e,()=>n(e[t]));Qt(()=>(G(()=>n(e[t])),r))}function Nu(e,t){return e===t||(e==null?void 0:e[Sn])===t}function _n(e={},t,n,r){return Qt(()=>{var o,i;return Ur(()=>{o=i,i=[],G(()=>{e!==n(...i)&&(t(e,...i),o&&Nu(n(...o),e)&&t(null,...o))})}),()=>{Vo(()=>{i&&Nu(n(...i),e)&&t(null,...i)})}}),e}function Be(e=!1){const t=lt,n=t.l.u;if(!n)return;let r=()=>q(t.s);if(e){let o=0,i={};const s=Ao(()=>{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&&K1(()=>{Tu(t,r),Po(n.b)}),cn(()=>{const o=G(()=>n.m.map(m1));return()=>{for(const i of o)typeof i=="function"&&i()}}),n.a.length&&cn(()=>{Tu(t,r),Po(n.a)})}function Tu(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=Yr(n)?n.slice():n==null?[]:[n];for(var o of r)o.call(this,t)}function ya(e,t,n){if(e==null)return t(void 0),n&&n(void 0),_t;const r=G(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const to=[];function fn(e,t){return{subscribe:xe(e,t).subscribe}}function xe(e,t=_t){let n=null;const r=new Set;function o(a){if(js(e,a)&&(e=a,n)){const l=!to.length;for(const c of r)c[1](),to.push(c,e);if(l){for(let c=0;c<to.length;c+=2)to[c][0](to[c+1]);to.length=0}}}function i(a){o(a(e))}function s(a,l=_t){const c=[a,l];return r.add(c),r.size===1&&(n=t(o,i)||_t),a(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:o,update:i,subscribe:s}}function ir(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=_t;const f=()=>{if(u)return;g();const v=t(r?c[0]:c,s,a);i?s(v):g=typeof v=="function"?v:_t},h=o.map((v,b)=>ya(v,x=>{c[b]=x,u&=~(1<<b),l&&f()},()=>{u|=1<<b}));return l=!0,f(),function(){Po(h),g(),l=!1}})}function Q(e){let t;return ya(e,n=>t=n)(),t}let Ai=!1,wa=Symbol();function oe(e,t,n){const r=n[t]??(n[t]={store:null,source:le(void 0),unsubscribe:_t});if(r.store!==e&&!(wa in n))if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=_t;else{var o=!0;r.unsubscribe=ya(e,i=>{o?r.source.v=i:te(r.source,i)}),o=!1}return e&&wa in n?Q(e):d(r.source)}function Dg(e,t,n){let r=n[t];return r&&r.store!==e&&(r.unsubscribe(),r.unsubscribe=_t),e}function Oi(e,t){return e.set(t),t}function ct(){const e={};function t(){oa(()=>{for(var n in e)e[n].unsubscribe();yr(e,wa,{enumerable:!1,value:!0})})}return[e,t]}function Vg(e){var t=Ai;try{return Ai=!1,[e(),Ai]}finally{Ai=t}}const Ag={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 Tt(e,t,n){return new Proxy({props:e,exclude:t},Ag)}const Og={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=Ie;try{Dn(e.parent_effect),e.special[t]=w({get[t](){return e.props[t]}},t,bl)}finally{Dn(r)}}return e.special[t](n),Fl(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),Fl(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 ht(e,t){return new Proxy({props:e,exclude:t,special:{},version:jr(0),parent_effect:Ie},Og)}const Lg={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(So(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];So(o)&&(o=o());const i=Fn(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(So(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r){const o=Fn(r,t);return o&&!o.configurable&&(o.configurable=!0),o}}},has(e,t){if(t===Sn||t===Xs)return!1;for(let n of e.props)if(So(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props)if(So(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 vt(...e){return new Proxy({props:e},Lg)}function w(e,t,n,r){var _;var o=!Bn||(n&a1)!==0,i=(n&l1)!==0,s=(n&u1)!==0,a=r,l=!0,c=()=>(l&&(l=!1,a=s?G(r):r),a),u;if(i){var g=Sn in e||Xs in e;u=((_=Fn(e,t))==null?void 0:_.set)??(g&&t in e?p=>e[t]=p:void 0)}var f,h=!1;i?[f,h]=Vg(()=>e[t]):f=e[t],f===void 0&&r!==void 0&&(f=c(),u&&(o&&N1(),u(f)));var v;if(o?v=()=>{var p=e[t];return p===void 0?c():(l=!0,p)}:v=()=>{var p=e[t];return p!==void 0&&(a=void 0),p===void 0?a:p},o&&(n&bl)===0)return v;if(u){var b=e.$$legacy;return function(p,E){return arguments.length>0?((!o||!E||b||h)&&u(E?v():p),p):v()}}var x=!1,C=((n&s1)!==0?Ao:De)(()=>(x=!1,v()));i&&d(C);var m=Ie;return function(p,E){if(arguments.length>0){const N=E?d(C):o&&i?Nn(p):p;return te(C,N),x=!0,a!==void 0&&(a=N),p}return kr&&x||(m.f&_r)!==0?C.v:d(C)}}function Ig(e){return new zg(e)}class zg{constructor(t){yt(this,Qn);yt(this,vn);var i;var n=new Map,r=(s,a)=>{var l=le(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===Xs?!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)}});It(this,vn,(t.hydrate?vg:vu)(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(),It(this,Qn,o.$$events);for(const s of Object.keys(Se(this,vn)))s==="$set"||s==="$destroy"||s==="$on"||yr(this,s,{get(){return Se(this,vn)[s]},set(a){Se(this,vn)[s]=a},enumerable:!0});Se(this,vn).$set=s=>{Object.assign(o,s)},Se(this,vn).$destroy=()=>{pg(Se(this,vn))}}$set(t){Se(this,vn).$set(t)}$on(t,n){Se(this,Qn)[t]=Se(this,Qn)[t]||[];const r=(...o)=>n.call(this,...o);return Se(this,Qn)[t].push(r),()=>{Se(this,Qn)[t]=Se(this,Qn)[t].filter(o=>o!==r)}}$destroy(){Se(this,vn).$destroy()}}Qn=new WeakMap,vn=new WeakMap;let Mu;typeof HTMLElement=="function"&&(Mu=class extends HTMLElement{constructor(t,n,r){super();Et(this,"$$ctor");Et(this,"$$s");Et(this,"$$c");Et(this,"$$cn",!1);Et(this,"$$d",{});Et(this,"$$r",!1);Et(this,"$$p_d",{});Et(this,"$$l",{});Et(this,"$$l_u",new Map);Et(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=Rg(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]=Li(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=Ig({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=j1(()=>{Ur(()=>{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=Li(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]=Li(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 Li(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 Rg(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function ue(e,t,n,r,o,i){let s=class extends Mu{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=>{yr(s.prototype,a,{get(){return this.$$c&&a in this.$$c?this.$$c[a]:this.$$d[a]},set(l){var g;l=Li(a,l,t),this.$$d[a]=l;var c=this.$$c;if(c){var u=(g=Fn(c,a))==null?void 0:g.get;u?c[a]=l:c.$set({[a]:l})}}})}),r.forEach(a=>{yr(s.prototype,a,{get(){var l;return(l=this.$$c)==null?void 0:l[a]}})}),e.element=s,s}function ut(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=ut(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Bg={value:()=>{}};function Ii(){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 zi(n)}function zi(e){this._=e}function Fg(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}})}zi.prototype=Ii.prototype={constructor:zi,on:function(e,t){var n=this._,r=Fg(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Yg(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]=Hu(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Hu(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 zi(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 Yg(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Hu(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Bg,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var _a="http://www.w3.org/1999/xhtml";const Du={svg:"http://www.w3.org/2000/svg",xhtml:_a,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ri(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Du.hasOwnProperty(t)?{space:Du[t],local:e}:e}function qg(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===_a&&t.documentElement.namespaceURI===_a?t.createElement(e):t.createElementNS(n,e)}}function Xg(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Vu(e){var t=Ri(e);return(t.local?Xg:qg)(t)}function Wg(){}function ba(e){return e==null?Wg:function(){return this.querySelector(e)}}function Zg(e){typeof e!="function"&&(e=ba(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 rn(r,this._parents)}function Kg(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function jg(){return[]}function Au(e){return e==null?jg:function(){return this.querySelectorAll(e)}}function Ug(e){return function(){return Kg(e.apply(this,arguments))}}function Gg(e){typeof e=="function"?e=Ug(e):e=Au(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 rn(r,o)}function Ou(e){return function(){return this.matches(e)}}function Lu(e){return function(t){return t.matches(e)}}var Jg=Array.prototype.find;function Qg(e){return function(){return Jg.call(this.children,e)}}function eh(){return this.firstElementChild}function th(e){return this.select(e==null?eh:Qg(typeof e=="function"?e:Lu(e)))}var nh=Array.prototype.filter;function rh(){return Array.from(this.children)}function oh(e){return function(){return nh.call(this.children,e)}}function ih(e){return this.selectAll(e==null?rh:oh(typeof e=="function"?e:Lu(e)))}function sh(e){typeof e!="function"&&(e=Ou(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 rn(r,this._parents)}function Iu(e){return new Array(e.length)}function ah(){return new rn(this._enter||this._groups.map(Iu),this._parents)}function Bi(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Bi.prototype={constructor:Bi,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 lh(e){return function(){return e}}function uh(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 Bi(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function ch(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 Bi(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(f[a])===l&&(o[a]=l)}function dh(e){return e.__data__}function fh(e,t){if(!arguments.length)return Array.from(this,dh);var n=t?ch:uh,r=this._parents,o=this._groups;typeof e!="function"&&(e=lh(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=gh(e.call(u,u&&u.__data__,c,r)),v=h.length,b=a[c]=new Array(v),x=s[c]=new Array(v),C=l[c]=new Array(f);n(u,g,b,x,C,h,t);for(var m=0,_=0,p,E;m<v;++m)if(p=b[m]){for(m>=_&&(_=m+1);!(E=x[_])&&++_<v;);p._next=E||null}}return s=new rn(s,r),s._enter=a,s._exit=l,s}function gh(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function hh(){return new rn(this._exit||this._groups.map(Iu),this._parents)}function vh(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 ph(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 rn(a,this._parents)}function mh(){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 yh(e){e||(e=wh);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 rn(o,this._parents).order()}function wh(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _h(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function bh(){return Array.from(this)}function xh(){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 Ch(){let e=0;for(const t of this)++e;return e}function $h(){return!this.node()}function kh(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 Eh(e){return function(){this.removeAttribute(e)}}function Sh(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ph(e,t){return function(){this.setAttribute(e,t)}}function Nh(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Th(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Mh(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 Hh(e,t){var n=Ri(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?Sh:Eh:typeof t=="function"?n.local?Mh:Th:n.local?Nh:Ph)(n,t))}function zu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Dh(e){return function(){this.style.removeProperty(e)}}function Vh(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ah(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Oh(e,t,n){return arguments.length>1?this.each((t==null?Dh:typeof t=="function"?Ah:Vh)(e,t,n??"")):no(this.node(),e)}function no(e,t){return e.style.getPropertyValue(t)||zu(e).getComputedStyle(e,null).getPropertyValue(t)}function Lh(e){return function(){delete this[e]}}function Ih(e,t){return function(){this[e]=t}}function zh(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Rh(e,t){return arguments.length>1?this.each((t==null?Lh:typeof t=="function"?zh:Ih)(e,t)):this.node()[e]}function Ru(e){return e.trim().split(/^|\s+/)}function xa(e){return e.classList||new Bu(e)}function Bu(e){this._node=e,this._names=Ru(e.getAttribute("class")||"")}Bu.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 Fu(e,t){for(var n=xa(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Yu(e,t){for(var n=xa(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Bh(e){return function(){Fu(this,e)}}function Fh(e){return function(){Yu(this,e)}}function Yh(e,t){return function(){(t.apply(this,arguments)?Fu:Yu)(this,e)}}function qh(e,t){var n=Ru(e+"");if(arguments.length<2){for(var r=xa(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?Yh:t?Bh:Fh)(n,t))}function Xh(){this.textContent=""}function Wh(e){return function(){this.textContent=e}}function Zh(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Kh(e){return arguments.length?this.each(e==null?Xh:(typeof e=="function"?Zh:Wh)(e)):this.node().textContent}function jh(){this.innerHTML=""}function Uh(e){return function(){this.innerHTML=e}}function Gh(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Jh(e){return arguments.length?this.each(e==null?jh:(typeof e=="function"?Gh:Uh)(e)):this.node().innerHTML}function Qh(){this.nextSibling&&this.parentNode.appendChild(this)}function ev(){return this.each(Qh)}function tv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nv(){return this.each(tv)}function rv(e){var t=typeof e=="function"?e:Vu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ov(){return null}function iv(e,t){var n=typeof e=="function"?e:Vu(e),r=t==null?ov:typeof t=="function"?t:ba(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function sv(){var e=this.parentNode;e&&e.removeChild(this)}function av(){return this.each(sv)}function lv(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function uv(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function cv(e){return this.select(e?uv:lv)}function dv(e){return arguments.length?this.property("__data__",e):this.node().__data__}function fv(e){return function(t){e.call(this,t,this.__data__)}}function gv(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 hv(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 vv(e,t,n){return function(){var r=this.__on,o,i=fv(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 pv(e,t,n){var r=gv(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?vv:hv,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function qu(e,t,n){var r=zu(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 mv(e,t){return function(){return qu(this,e,t)}}function yv(e,t){return function(){return qu(this,e,t.apply(this,arguments))}}function wv(e,t){return this.each((typeof t=="function"?yv:mv)(e,t))}function*_v(){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 Xu=[null];function rn(e,t){this._groups=e,this._parents=t}function Fo(){return new rn([[document.documentElement]],Xu)}function bv(){return this}rn.prototype=Fo.prototype={constructor:rn,select:Zg,selectAll:Gg,selectChild:th,selectChildren:ih,filter:sh,data:fh,enter:ah,exit:hh,join:vh,merge:ph,selection:bv,order:mh,sort:yh,call:_h,nodes:bh,node:xh,size:Ch,empty:$h,each:kh,attr:Hh,style:Oh,property:Rh,classed:qh,text:Kh,html:Jh,raise:ev,lower:nv,append:rv,insert:iv,remove:av,clone:cv,datum:dv,on:pv,dispatch:wv,[Symbol.iterator]:_v};function gn(e){return typeof e=="string"?new rn([[document.querySelector(e)]],[document.documentElement]):new rn([[e]],Xu)}function xv(e){let t;for(;t=e.sourceEvent;)e=t;return e}function bn(e,t){if(e=xv(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 Cv={passive:!1},Yo={capture:!0,passive:!1};function Ca(e){e.stopImmediatePropagation()}function ro(e){e.preventDefault(),e.stopImmediatePropagation()}function Wu(e){var t=e.document.documentElement,n=gn(e).on("dragstart.drag",ro,Yo);"onselectstart"in t?n.on("selectstart.drag",ro,Yo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Zu(e,t){var n=e.document.documentElement,r=gn(e).on("dragstart.drag",null);t&&(r.on("click.drag",ro,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 Fi=e=>()=>e;function $a(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}})}$a.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function $v(e){return!e.ctrlKey&&!e.button}function kv(){return this.parentNode}function Ev(e,t){return t??{x:e.x,y:e.y}}function Sv(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pv(){var e=$v,t=kv,n=Ev,r=Sv,o={},i=Ii("start","drag","end"),s=0,a,l,c,u,g=0;function f(p){p.on("mousedown.drag",h).filter(r).on("touchstart.drag",x).on("touchmove.drag",C,Cv).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(p,E){if(!(u||!e.call(this,p,E))){var N=_(this,t.call(this,p,E),p,E,"mouse");N&&(gn(p.view).on("mousemove.drag",v,Yo).on("mouseup.drag",b,Yo),Wu(p.view),Ca(p),c=!1,a=p.clientX,l=p.clientY,N("start",p))}}function v(p){if(ro(p),!c){var E=p.clientX-a,N=p.clientY-l;c=E*E+N*N>g}o.mouse("drag",p)}function b(p){gn(p.view).on("mousemove.drag mouseup.drag",null),Zu(p.view,c),ro(p),o.mouse("end",p)}function x(p,E){if(e.call(this,p,E)){var N=p.changedTouches,S=t.call(this,p,E),A=N.length,L,V;for(L=0;L<A;++L)(V=_(this,S,p,E,N[L].identifier,N[L]))&&(Ca(p),V("start",p,N[L]))}}function C(p){var E=p.changedTouches,N=E.length,S,A;for(S=0;S<N;++S)(A=o[E[S].identifier])&&(ro(p),A("drag",p,E[S]))}function m(p){var E=p.changedTouches,N=E.length,S,A;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),S=0;S<N;++S)(A=o[E[S].identifier])&&(Ca(p),A("end",p,E[S]))}function _(p,E,N,S,A,L){var V=i.copy(),O=bn(L||N,E),z,B,k;if((k=n.call(p,new $a("beforestart",{sourceEvent:N,target:f,identifier:A,active:s,x:O[0],y:O[1],dx:0,dy:0,dispatch:V}),S))!=null)return z=k.x-O[0]||0,B=k.y-O[1]||0,function $(P,T,M){var H=O,I;switch(P){case"start":o[A]=$,I=s++;break;case"end":delete o[A],--s;case"drag":O=bn(M||T,E),I=s;break}V.call(P,p,new $a(P,{sourceEvent:T,subject:k,target:f,identifier:A,active:I,x:O[0]+z,y:O[1]+B,dx:O[0]-H[0],dy:O[1]-H[1],dispatch:V}),S)}}return f.filter=function(p){return arguments.length?(e=typeof p=="function"?p:Fi(!!p),f):e},f.container=function(p){return arguments.length?(t=typeof p=="function"?p:Fi(p),f):t},f.subject=function(p){return arguments.length?(n=typeof p=="function"?p:Fi(p),f):n},f.touchable=function(p){return arguments.length?(r=typeof p=="function"?p:Fi(!!p),f):r},f.on=function(){var p=i.on.apply(i,arguments);return p===i?f:p},f.clickDistance=function(p){return arguments.length?(g=(p=+p)*p,f):Math.sqrt(g)},f}function ka(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ku(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function qo(){}var Xo=.7,Yi=1/Xo,oo="\\s*([+-]?\\d+)\\s*",Wo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",An="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Nv=/^#([0-9a-f]{3,8})$/,Tv=new RegExp(`^rgb\\(${oo},${oo},${oo}\\)$`),Mv=new RegExp(`^rgb\\(${An},${An},${An}\\)$`),Hv=new RegExp(`^rgba\\(${oo},${oo},${oo},${Wo}\\)$`),Dv=new RegExp(`^rgba\\(${An},${An},${An},${Wo}\\)$`),Vv=new RegExp(`^hsl\\(${Wo},${An},${An}\\)$`),Av=new RegExp(`^hsla\\(${Wo},${An},${An},${Wo}\\)$`),ju={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};ka(qo,Zo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Uu,formatHex:Uu,formatHex8:Ov,formatHsl:Lv,formatRgb:Gu,toString:Gu});function Uu(){return this.rgb().formatHex()}function Ov(){return this.rgb().formatHex8()}function Lv(){return nc(this).formatHsl()}function Gu(){return this.rgb().formatRgb()}function Zo(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Nv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ju(t):n===3?new Kt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?qi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?qi(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=Tv.exec(e))?new Kt(t[1],t[2],t[3],1):(t=Mv.exec(e))?new Kt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Hv.exec(e))?qi(t[1],t[2],t[3],t[4]):(t=Dv.exec(e))?qi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Vv.exec(e))?tc(t[1],t[2]/100,t[3]/100,1):(t=Av.exec(e))?tc(t[1],t[2]/100,t[3]/100,t[4]):ju.hasOwnProperty(e)?Ju(ju[e]):e==="transparent"?new Kt(NaN,NaN,NaN,0):null}function Ju(e){return new Kt(e>>16&255,e>>8&255,e&255,1)}function qi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Kt(e,t,n,r)}function Iv(e){return e instanceof qo||(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?Iv(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}ka(Kt,Ea,Ku(qo,{brighter(e){return e=e==null?Yi:Math.pow(Yi,e),new Kt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Xo:Math.pow(Xo,e),new Kt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Kt(Mr(this.r),Mr(this.g),Mr(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:Qu,formatHex:Qu,formatHex8:zv,formatRgb:ec,toString:ec}));function Qu(){return`#${Hr(this.r)}${Hr(this.g)}${Hr(this.b)}`}function zv(){return`#${Hr(this.r)}${Hr(this.g)}${Hr(this.b)}${Hr((isNaN(this.opacity)?1:this.opacity)*255)}`}function ec(){const e=Xi(this.opacity);return`${e===1?"rgb(":"rgba("}${Mr(this.r)}, ${Mr(this.g)}, ${Mr(this.b)}${e===1?")":`, ${e})`}`}function Xi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Mr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Hr(e){return e=Mr(e),(e<16?"0":"")+e.toString(16)}function tc(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xn(e,t,n,r)}function nc(e){if(e instanceof xn)return new xn(e.h,e.s,e.l,e.opacity);if(e instanceof qo||(e=Zo(e)),!e)return new xn;if(e instanceof xn)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 xn(s,a,l,e.opacity)}function Rv(e,t,n,r){return arguments.length===1?nc(e):new xn(e,t,n,r??1)}function xn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ka(xn,Rv,Ku(qo,{brighter(e){return e=e==null?Yi:Math.pow(Yi,e),new xn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Xo:Math.pow(Xo,e),new xn(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(Sa(e>=240?e-240:e+120,o,r),Sa(e,o,r),Sa(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new xn(rc(this.h),Wi(this.s),Wi(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("}${rc(this.h)}, ${Wi(this.s)*100}%, ${Wi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rc(e){return e=(e||0)%360,e<0?e+360:e}function Wi(e){return Math.max(0,Math.min(1,e||0))}function Sa(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 oc=e=>()=>e;function Bv(e,t){return function(n){return e+n*t}}function Fv(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 Yv(e){return(e=+e)==1?ic:function(t,n){return n-t?Fv(t,n,e):oc(isNaN(t)?n:t)}}function ic(e,t){var n=t-e;return n?Bv(e,n):oc(isNaN(e)?t:e)}const sc=function e(t){var n=Yv(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=ic(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 sr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Pa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Na=new RegExp(Pa.source,"g");function qv(e){return function(){return e}}function Xv(e){return function(t){return e(t)+""}}function Wv(e,t){var n=Pa.lastIndex=Na.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Pa.exec(e))&&(o=Na.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:sr(r,o)})),n=Na.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?Xv(l[0].x):qv(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 ac=180/Math.PI,Ta={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function lc(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)*ac,skewX:Math.atan(l)*ac,scaleX:s,scaleY:a}}var Zi;function Zv(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ta:lc(t.a,t.b,t.c,t.d,t.e,t.f)}function Kv(e){return e==null||(Zi||(Zi=document.createElementNS("http://www.w3.org/2000/svg","g")),Zi.setAttribute("transform",e),!(e=Zi.transform.baseVal.consolidate()))?Ta:(e=e.matrix,lc(e.a,e.b,e.c,e.d,e.e,e.f))}function uc(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:sr(c,g)},{i:b-2,x:sr(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:sr(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:sr(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:sr(c,g)},{i:b-2,x:sr(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,x;++v<b;)g[(x=f[v]).i]=x.x(h);return g.join("")}}}var jv=uc(Zv,"px, ","px)","deg)"),Uv=uc(Kv,", ",")",")"),Gv=1e-12;function cc(e){return((e=Math.exp(e))+1/e)/2}function Jv(e){return((e=Math.exp(e))-1/e)/2}function Qv(e){return((e=Math.exp(2*e))-1)/(e+1)}const e0=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,x,C;if(b<Gv)C=Math.log(f/c)/t,x=function(S){return[a+S*h,l+S*v,c*Math.exp(t*S*C)]};else{var m=Math.sqrt(b),_=(f*f-c*c+r*b)/(2*c*n*m),p=(f*f-c*c-r*b)/(2*f*n*m),E=Math.log(Math.sqrt(_*_+1)-_),N=Math.log(Math.sqrt(p*p+1)-p);C=(N-E)/t,x=function(S){var A=S*C,L=cc(E),V=c/(n*m)*(L*Qv(t*A+E)-Jv(E));return[a+V*h,l+V*v,c*L/cc(t*A+E)]}}return x.duration=C*1e3*t/Math.SQRT2,x}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 io=0,Ko=0,jo=0,dc=1e3,Ki,Uo,ji=0,Dr=0,Ui=0,Go=typeof performance=="object"&&performance.now?performance:Date,fc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ma(){return Dr||(fc(t0),Dr=Go.now()+Ui)}function t0(){Dr=0}function Gi(){this._call=this._time=this._next=null}Gi.prototype=gc.prototype={constructor:Gi,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ma():+n)+(t==null?0:+t),!this._next&&Uo!==this&&(Uo?Uo._next=this:Ki=this,Uo=this),this._call=e,this._time=n,Ha()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ha())}};function gc(e,t,n){var r=new Gi;return r.restart(e,t,n),r}function n0(){Ma(),++io;for(var e=Ki,t;e;)(t=Dr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--io}function hc(){Dr=(ji=Go.now())+Ui,io=Ko=0;try{n0()}finally{io=0,o0(),Dr=0}}function r0(){var e=Go.now(),t=e-ji;t>dc&&(Ui-=t,ji=e)}function o0(){for(var e,t=Ki,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:Ki=n);Uo=e,Ha(r)}function Ha(e){if(!io){Ko&&(Ko=clearTimeout(Ko));var t=e-Dr;t>24?(e<1/0&&(Ko=setTimeout(hc,e-Go.now()-Ui)),jo&&(jo=clearInterval(jo))):(jo||(ji=Go.now(),jo=setInterval(r0,dc)),io=1,fc(hc))}}function vc(e,t,n){var r=new Gi;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var i0=Ii("start","end","cancel","interrupt"),s0=[],pc=0,mc=1,Da=2,Ji=3,yc=4,Va=5,Qi=6;function es(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;a0(e,n,{name:t,index:r,group:o,on:i0,tween:s0,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:pc})}function Aa(e,t){var n=Cn(e,t);if(n.state>pc)throw new Error("too late; already scheduled");return n}function On(e,t){var n=Cn(e,t);if(n.state>Ji)throw new Error("too late; already running");return n}function Cn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function a0(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=gc(i,0,n.time);function i(c){n.state=mc,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!==mc)return l();for(u in r)if(h=r[u],h.name===n.name){if(h.state===Ji)return vc(s);h.state===yc?(h.state=Qi,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[u]):+u<t&&(h.state=Qi,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[u])}if(vc(function(){n.state===Ji&&(n.state=yc,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Da,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Da){for(n.state=Ji,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=Va,1),g=-1,f=o.length;++g<f;)o[g].call(e,u);n.state===Va&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Qi,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function ts(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>Da&&r.state<Va,r.state=Qi,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function l0(e){return this.each(function(){ts(this,e)})}function u0(e,t){var n,r;return function(){var o=On(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 c0(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=On(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 d0(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Cn(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?u0:c0)(n,e,t))}function Oa(e,t,n){var r=e._id;return e.each(function(){var o=On(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Cn(o,r).value[t]}}function wc(e,t){var n;return(typeof t=="number"?sr:t instanceof Zo?sc:(n=Zo(t))?(t=n,sc):Wv)(e,t)}function f0(e){return function(){this.removeAttribute(e)}}function g0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function h0(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 v0(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 p0(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 m0(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 y0(e,t){var n=Ri(e),r=n==="transform"?Uv:wc;return this.attrTween(e,typeof t=="function"?(n.local?m0:p0)(n,r,Oa(this,"attr."+e,t)):t==null?(n.local?g0:f0)(n):(n.local?v0:h0)(n,r,t))}function w0(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function _0(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function b0(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&_0(e,i)),n}return o._value=t,o}function x0(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&w0(e,i)),n}return o._value=t,o}function C0(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=Ri(e);return this.tween(n,(r.local?b0:x0)(r,t))}function $0(e,t){return function(){Aa(this,e).delay=+t.apply(this,arguments)}}function k0(e,t){return t=+t,function(){Aa(this,e).delay=t}}function E0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$0:k0)(t,e)):Cn(this.node(),t).delay}function S0(e,t){return function(){On(this,e).duration=+t.apply(this,arguments)}}function P0(e,t){return t=+t,function(){On(this,e).duration=t}}function N0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?S0:P0)(t,e)):Cn(this.node(),t).duration}function T0(e,t){if(typeof t!="function")throw new Error;return function(){On(this,e).ease=t}}function M0(e){var t=this._id;return arguments.length?this.each(T0(t,e)):Cn(this.node(),t).ease}function H0(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;On(this,e).ease=n}}function D0(e){if(typeof e!="function")throw new Error;return this.each(H0(this._id,e))}function V0(e){typeof e!="function"&&(e=Ou(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 qn(r,this._parents,this._name,this._id)}function A0(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 qn(s,this._parents,this._name,this._id)}function O0(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 L0(e,t,n){var r,o,i=O0(t)?Aa:On;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function I0(e,t){var n=this._id;return arguments.length<2?Cn(this.node(),n).on.on(e):this.each(L0(n,e,t))}function z0(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function R0(){return this.on("end.remove",z0(this._id))}function B0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ba(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,es(c[f],t,n,f,c,Cn(u,n)));return new qn(i,this._parents,t,n)}function F0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Au(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=Cn(u,n),b=0,x=f.length;b<x;++b)(h=f[b])&&es(h,t,n,b,f,v);i.push(f),s.push(u)}return new qn(i,s,t,n)}var Y0=Fo.prototype.constructor;function q0(){return new Y0(this._groups,this._parents)}function X0(e,t){var n,r,o;return function(){var i=no(this,e),s=(this.style.removeProperty(e),no(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function _c(e){return function(){this.style.removeProperty(e)}}function W0(e,t,n){var r,o=n+"",i;return function(){var s=no(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function Z0(e,t,n){var r,o,i;return function(){var s=no(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),no(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function K0(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=On(this,e),c=l.on,u=l.value[i]==null?a||(a=_c(t)):void 0;(c!==n||o!==u)&&(r=(n=c).copy()).on(s,o=u),l.on=r}}function j0(e,t,n){var r=(e+="")=="transform"?jv:wc;return t==null?this.styleTween(e,X0(e,r)).on("end.style."+e,_c(e)):typeof t=="function"?this.styleTween(e,Z0(e,r,Oa(this,"style."+e,t))).each(K0(this._id,e)):this.styleTween(e,W0(e,r,t),n).on("end.style."+e,null)}function U0(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function G0(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&U0(e,s,n)),r}return i._value=t,i}function J0(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,G0(e,t,n??""))}function Q0(e){return function(){this.textContent=e}}function ep(e){return function(){var t=e(this);this.textContent=t??""}}function tp(e){return this.tween("text",typeof e=="function"?ep(Oa(this,"text",e)):Q0(e==null?"":e+""))}function np(e){return function(t){this.textContent=e.call(this,t)}}function rp(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&np(o)),t}return r._value=e,r}function op(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,rp(e))}function ip(){for(var e=this._name,t=this._id,n=bc(),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=Cn(l,t);es(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new qn(r,this._parents,e,n)}function sp(){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=On(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 ap=0;function qn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function bc(){return++ap}var Xn=Fo.prototype;qn.prototype={constructor:qn,select:B0,selectAll:F0,selectChild:Xn.selectChild,selectChildren:Xn.selectChildren,filter:V0,merge:A0,selection:q0,transition:ip,call:Xn.call,nodes:Xn.nodes,node:Xn.node,size:Xn.size,empty:Xn.empty,each:Xn.each,on:I0,attr:y0,attrTween:C0,style:j0,styleTween:J0,text:tp,textTween:op,remove:R0,tween:d0,delay:E0,duration:N0,ease:M0,easeVarying:D0,end:sp,[Symbol.iterator]:Xn[Symbol.iterator]};function lp(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var up={time:null,delay:0,duration:250,ease:lp};function cp(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 dp(e){var t,n;e instanceof qn?(t=e._id,e=e._name):(t=bc(),(n=up).time=Ma(),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])&&es(l,e,t,c,s,n||cp(l,t));return new qn(r,this._parents,e,t)}Fo.prototype.interrupt=l0,Fo.prototype.transition=dp;const ns=e=>()=>e;function fp(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 Wn(e,t,n){this.k=e,this.x=t,this.y=n}Wn.prototype={constructor:Wn,scale:function(e){return e===1?this:new Wn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Wn(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 rs=new Wn(1,0,0);xc.prototype=Wn.prototype;function xc(e){for(;!e.__zoom;)if(!(e=e.parentNode))return rs;return e.__zoom}function La(e){e.stopImmediatePropagation()}function Jo(e){e.preventDefault(),e.stopImmediatePropagation()}function gp(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function hp(){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 Cc(){return this.__zoom||rs}function vp(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function pp(){return navigator.maxTouchPoints||"ontouchstart"in this}function mp(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 $c(){var e=gp,t=hp,n=mp,r=vp,o=pp,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=e0,c=Ii("start","zoom","end"),u,g,f,h=500,v=150,b=0,x=10;function C(k){k.property("__zoom",Cc).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",V).filter(o).on("touchstart.zoom",O).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(k,$,P,T){var M=k.selection?k.selection():k;M.property("__zoom",Cc),k!==M?E(k,$,P,T):M.interrupt().each(function(){N(this,arguments).event(T).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},C.scaleBy=function(k,$,P,T){C.scaleTo(k,function(){var M=this.__zoom.k,H=typeof $=="function"?$.apply(this,arguments):$;return M*H},P,T)},C.scaleTo=function(k,$,P,T){C.transform(k,function(){var M=t.apply(this,arguments),H=this.__zoom,I=P==null?p(M):typeof P=="function"?P.apply(this,arguments):P,W=H.invert(I),j=typeof $=="function"?$.apply(this,arguments):$;return n(_(m(H,j),I,W),M,s)},P,T)},C.translateBy=function(k,$,P,T){C.transform(k,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof P=="function"?P.apply(this,arguments):P),t.apply(this,arguments),s)},null,T)},C.translateTo=function(k,$,P,T,M){C.transform(k,function(){var H=t.apply(this,arguments),I=this.__zoom,W=T==null?p(H):typeof T=="function"?T.apply(this,arguments):T;return n(rs.translate(W[0],W[1]).scale(I.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof P=="function"?-P.apply(this,arguments):-P),H,s)},T,M)};function m(k,$){return $=Math.max(i[0],Math.min(i[1],$)),$===k.k?k:new Wn($,k.x,k.y)}function _(k,$,P){var T=$[0]-P[0]*k.k,M=$[1]-P[1]*k.k;return T===k.x&&M===k.y?k:new Wn(k.k,T,M)}function p(k){return[(+k[0][0]+ +k[1][0])/2,(+k[0][1]+ +k[1][1])/2]}function E(k,$,P,T){k.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,I=N(M,H).event(T),W=t.apply(M,H),j=P==null?p(W):typeof P=="function"?P.apply(M,H):P,J=Math.max(W[1][0]-W[0][0],W[1][1]-W[0][1]),ne=M.__zoom,ee=typeof $=="function"?$.apply(M,H):$,ce=l(ne.invert(j).concat(J/ne.k),ee.invert(j).concat(J/ee.k));return function(re){if(re===1)re=ee;else{var we=ce(re),Ne=J/we[2];re=new Wn(Ne,j[0]-we[0]*Ne,j[1]-we[1]*Ne)}I.zoom(null,re)}})}function N(k,$,P){return!P&&k.__zooming||new S(k,$)}function S(k,$){this.that=k,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(k,$),this.taps=0}S.prototype={event:function(k){return k&&(this.sourceEvent=k),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(k,$){return this.mouse&&k!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&k!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&k!=="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(k){var $=gn(this.that).datum();c.call(k,this.that,new fp(k,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:c}),$)}};function A(k,...$){if(!e.apply(this,arguments))return;var P=N(this,$).event(k),T=this.__zoom,M=Math.max(i[0],Math.min(i[1],T.k*Math.pow(2,r.apply(this,arguments)))),H=bn(k);if(P.wheel)(P.mouse[0][0]!==H[0]||P.mouse[0][1]!==H[1])&&(P.mouse[1]=T.invert(P.mouse[0]=H)),clearTimeout(P.wheel);else{if(T.k===M)return;P.mouse=[H,T.invert(H)],ts(this),P.start()}Jo(k),P.wheel=setTimeout(I,v),P.zoom("mouse",n(_(m(T,M),P.mouse[0],P.mouse[1]),P.extent,s));function I(){P.wheel=null,P.end()}}function L(k,...$){if(f||!e.apply(this,arguments))return;var P=k.currentTarget,T=N(this,$,!0).event(k),M=gn(k.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",J,!0),H=bn(k,P),I=k.clientX,W=k.clientY;Wu(k.view),La(k),T.mouse=[H,this.__zoom.invert(H)],ts(this),T.start();function j(ne){if(Jo(ne),!T.moved){var ee=ne.clientX-I,ce=ne.clientY-W;T.moved=ee*ee+ce*ce>b}T.event(ne).zoom("mouse",n(_(T.that.__zoom,T.mouse[0]=bn(ne,P),T.mouse[1]),T.extent,s))}function J(ne){M.on("mousemove.zoom mouseup.zoom",null),Zu(ne.view,T.moved),Jo(ne),T.event(ne).end()}}function V(k,...$){if(e.apply(this,arguments)){var P=this.__zoom,T=bn(k.changedTouches?k.changedTouches[0]:k,this),M=P.invert(T),H=P.k*(k.shiftKey?.5:2),I=n(_(m(P,H),T,M),t.apply(this,$),s);Jo(k),a>0?gn(this).transition().duration(a).call(E,I,T,k):gn(this).call(C.transform,I,T,k)}}function O(k,...$){if(e.apply(this,arguments)){var P=k.touches,T=P.length,M=N(this,$,k.changedTouches.length===T).event(k),H,I,W,j;for(La(k),I=0;I<T;++I)W=P[I],j=bn(W,this),j=[j,this.__zoom.invert(j),W.identifier],M.touch0?!M.touch1&&M.touch0[2]!==j[2]&&(M.touch1=j,M.taps=0):(M.touch0=j,H=!0,M.taps=1+!!u);u&&(u=clearTimeout(u)),H&&(M.taps<2&&(g=j[0],u=setTimeout(function(){u=null},h)),ts(this),M.start())}}function z(k,...$){if(this.__zooming){var P=N(this,$).event(k),T=k.changedTouches,M=T.length,H,I,W,j;for(Jo(k),H=0;H<M;++H)I=T[H],W=bn(I,this),P.touch0&&P.touch0[2]===I.identifier?P.touch0[0]=W:P.touch1&&P.touch1[2]===I.identifier&&(P.touch1[0]=W);if(I=P.that.__zoom,P.touch1){var J=P.touch0[0],ne=P.touch0[1],ee=P.touch1[0],ce=P.touch1[1],re=(re=ee[0]-J[0])*re+(re=ee[1]-J[1])*re,we=(we=ce[0]-ne[0])*we+(we=ce[1]-ne[1])*we;I=m(I,Math.sqrt(re/we)),W=[(J[0]+ee[0])/2,(J[1]+ee[1])/2],j=[(ne[0]+ce[0])/2,(ne[1]+ce[1])/2]}else if(P.touch0)W=P.touch0[0],j=P.touch0[1];else return;P.zoom("touch",n(_(I,W,j),P.extent,s))}}function B(k,...$){if(this.__zooming){var P=N(this,$).event(k),T=k.changedTouches,M=T.length,H,I;for(La(k),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),H=0;H<M;++H)I=T[H],P.touch0&&P.touch0[2]===I.identifier?delete P.touch0:P.touch1&&P.touch1[2]===I.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(I=bn(I,this),Math.hypot(g[0]-I[0],g[1]-I[1])<x)){var W=gn(this).on("dblclick.zoom");W&&W.apply(this,arguments)}}}return C.wheelDelta=function(k){return arguments.length?(r=typeof k=="function"?k:ns(+k),C):r},C.filter=function(k){return arguments.length?(e=typeof k=="function"?k:ns(!!k),C):e},C.touchable=function(k){return arguments.length?(o=typeof k=="function"?k:ns(!!k),C):o},C.extent=function(k){return arguments.length?(t=typeof k=="function"?k:ns([[+k[0][0],+k[0][1]],[+k[1][0],+k[1][1]]]),C):t},C.scaleExtent=function(k){return arguments.length?(i[0]=+k[0],i[1]=+k[1],C):[i[0],i[1]]},C.translateExtent=function(k){return arguments.length?(s[0][0]=+k[0][0],s[1][0]=+k[1][0],s[0][1]=+k[0][1],s[1][1]=+k[1][1],C):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},C.constrain=function(k){return arguments.length?(n=k,C):n},C.duration=function(k){return arguments.length?(a=+k,C):a},C.interpolate=function(k){return arguments.length?(l=k,C):l},C.on=function(){var k=c.on.apply(c,arguments);return k===c?C:k},C.clickDistance=function(k){return arguments.length?(b=(k=+k)*k,C):Math.sqrt(b)},C.tapDistance=function(k){return arguments.length?(x=+k,C):x},C}const so={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."},os=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]];var Vr;(function(e){e.Strict="strict",e.Loose="loose"})(Vr||(Vr={}));var Zn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Zn||(Zn={}));var is;(function(e){e.Partial="partial",e.Full="full"})(is||(is={}));const Ia={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var ao;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ao||(ao={}));var Ar;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ar||(Ar={}));var Pe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Pe||(Pe={}));const kc={[Pe.Left]:Pe.Right,[Pe.Right]:Pe.Left,[Pe.Top]:Pe.Bottom,[Pe.Bottom]:Pe.Top};function yp(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 Ec(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 Sc(e){return e===null?null:e?"valid":"invalid"}const wp=e=>"id"in e&&"source"in e&&"target"in e,_p=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),za=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}},bp=(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):za(o)?o:t.nodeLookup.get(o.id));const a=s?ls(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ss(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return as(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=ls(r);n=ss(n,o)}}),as(n)},Pc=(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,uo(c)),x=(h??0)*(v??0),C=i&&b>0;(!c.internals.handleBounds||C||b>=x||c.dragging)&&l.push(c)}return l},Ra=(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 xp(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 Cp({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=xp(e,s),l=ei(a),c=Ya(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 $p({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",so.error005());else{const h=a.measured.width,v=a.measured.height;h&&v&&(g=[[l,c],[l+h,c+v]])}else a&&fo(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=fo(g)?Or(t,g,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",so.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 Nc({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=Ra(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 lo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Or=(e={x:0,y:0},t,n)=>({x:lo(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:lo(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Tc(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 Mc=(e,t,n)=>e<t?lo(Math.abs(e-t),1,t)/t:e>n?-lo(Math.abs(e-n),1,t)/t:0,Hc=(e,t,n=15,r=40)=>{const o=Mc(e.x,r,t.width-r)*n,i=Mc(e.y,r,t.height-r)*n;return[o,i]},ss=(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)}),Ba=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),as=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),uo=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=za(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}},ls=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=za(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)}},Dc=(e,t)=>as(ss(Ba(e),Ba(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)},Vc=e=>Ln(e.width)&&Ln(e.height)&&Ln(e.x)&&Ln(e.y),Ln=e=>!isNaN(e)&&isFinite(e),kp=(e,t)=>{},Fa=(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?Fa(a,s):a},us=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function co(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 Ep(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=co(e,n),o=co(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=co(e.top??e.y??0,n),o=co(e.bottom??e.y??0,n),i=co(e.left??e.x??0,t),s=co(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 Sp(e,t,n,r,o,i){const{x:s,y:a}=us(e,[t,n,r]),{x:l,y:c}=us({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 Ya=(e,t,n,r,o,i)=>{const s=Ep(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),u=lo(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=Sp(e,h,v,u,t,n),x={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-x.left+x.right,y:v-x.top+x.bottom,zoom:u}},cs=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function fo(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 ds(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 Pp(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 Np(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function qa(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?Fa(a,t):a;return{xSnapped:l,ySnapped:c,...a}}const Ac=e=>({width:e.offsetWidth,height:e.offsetHeight}),Tp=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Mp=["INPUT","SELECT","TEXTAREA"];function Hp(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:Mp.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Oc=e=>"clientX"in e,jn=(e,t)=>{var i,s;const n=Oc(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)}},Lc=(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,...Ac(s)}})};function Dp({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 fs(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Ic({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case Pe.Left:return[t-fs(t-r,i),n];case Pe.Right:return[t+fs(r-t,i),n];case Pe.Top:return[t,n-fs(n-o,i)];case Pe.Bottom:return[t,n+fs(o-n,i)]}}function zc({sourceX:e,sourceY:t,sourcePosition:n=Pe.Bottom,targetX:r,targetY:o,targetPosition:i=Pe.Top,curvature:s=.25}){const[a,l]=Ic({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[c,u]=Ic({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[g,f,h,v]=Dp({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 Rc({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 Vp({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 Ap({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=ss(ls(e),ls(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,as(i))>0}const Op=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Lp=(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)),Ip=(e,t)=>{if(!e.source||!e.target)return t;let n;return wp(e)?n={...e}:n={...e,id:Op(e)},Lp(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Xa({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=Rc({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const Bc={[Pe.Left]:{x:-1,y:0},[Pe.Right]:{x:1,y:0},[Pe.Top]:{x:0,y:-1},[Pe.Bottom]:{x:0,y:1}},zp=({source:e,sourcePosition:t=Pe.Bottom,target:n})=>t===Pe.Left||t===Pe.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},Fc=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Rp({source:e,sourcePosition:t=Pe.Bottom,target:n,targetPosition:r=Pe.Top,center:o,offset:i}){const s=Bc[t],a=Bc[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=zp({source:l,sourcePosition:t,target:c}),g=u.x!==0?"x":"y",f=u[g];let h=[],v,b;const x={x:0,y:0},C={x:0,y:0},[m,_,p,E]=Rc({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[g]*a[g]===-1){v=o.x??m,b=o.y??_;const S=[{x:v,y:l.y},{x:v,y:c.y}],A=[{x:l.x,y:b},{x:c.x,y:b}];s[g]===f?h=g==="x"?S:A:h=g==="x"?A:S}else{const S=[{x:l.x,y:c.y}],A=[{x:c.x,y:l.y}];if(g==="x"?h=s.x===f?A:S:h=s.y===f?S:A,t===r){const B=Math.abs(e[g]-n[g]);if(B<=i){const k=Math.min(i-1,i-B);s[g]===f?x[g]=(l[g]>e[g]?-1:1)*k:C[g]=(c[g]>n[g]?-1:1)*k}}if(t!==r){const B=g==="x"?"y":"x",k=s[g]===a[B],$=l[B]>c[B],P=l[B]<c[B];(s[g]===1&&(!k&&$||k&&P)||s[g]!==1&&(!k&&P||k&&$))&&(h=g==="x"?S:A)}const L={x:l.x+x.x,y:l.y+x.y},V={x:c.x+C.x,y:c.y+C.y},O=Math.max(Math.abs(L.x-h[0].x),Math.abs(V.x-h[0].x)),z=Math.max(Math.abs(L.y-h[0].y),Math.abs(V.y-h[0].y));O>=z?(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+x.x,y:l.y+x.y},...h,{x:c.x+C.x,y:c.y+C.y},n],v,b,p,E]}function Bp(e,t,n,r){const o=Math.min(Fc(e,t)/2,Fc(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 gs({sourceX:e,sourceY:t,sourcePosition:n=Pe.Bottom,targetX:r,targetY:o,targetPosition:i=Pe.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20}){const[u,g,f,h,v]=Rp({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:c});return[u.reduce((x,C,m)=>{let _="";return m>0&&m<u.length-1?_=Bp(u[m-1],C,u[m+1],s):_=`${m===0?"M":"L"}${C.x} ${C.y}`,x+=_,x},""),g,f,h,v]}function Yc(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Fp(e){var g;const{sourceNode:t,targetNode:n}=e;if(!Yc(t)||!Yc(n))return null;const r=t.internals.handleBounds||qc(t.handles),o=n.internals.handleBounds||qc(n.handles),i=Xc((r==null?void 0:r.source)??[],e.sourceHandle),s=Xc(e.connectionMode===Vr.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",so.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(i==null?void 0:i.position)||Pe.Bottom,l=(s==null?void 0:s.position)||Pe.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 qc(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=Pe.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 Pe.Top:return{x:o+s/2,y:i};case Pe.Right:return{x:o+s,y:i+a/2};case Pe.Bottom:return{x:o+s/2,y:i+a};case Pe.Left:return{x:o,y:i+a/2}}}function Xc(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 Yp(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 qp(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 Pe.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 Pe.Bottom:s[1]=(e.y+e.height)*t.zoom+t.y+r,a[1]=0;break;case Pe.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 Za={nodeOrigin:[0,0],nodeExtent:os,elevateNodesOnSelect:!0,defaults:{}},Xp={...Za,checkEquality:!0};function Ka(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Wp(e,t,n){const r=Ka(Za,n);for(const o of e.values())if(o.parentId)ja(o,e,t,r);else{const i=Qo(o,r.nodeOrigin),s=fo(o.extent)?o.extent:r.nodeExtent,a=Or(i,s,Kn(o));o.internals.positionAbsolute=a}}function Wc(e,t,n,r){var l,c;const o=Ka(Xp,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=fo(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:Zc(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&&ja(g,t,n,r)}return i}function Zp(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 ja(e,t,n,r){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:s}=Ka(Za,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}Zp(e,n);const c=o?1e3:0,{x:u,y:g,z:f}=Kp(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 Zc(e,t){return(Ln(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Kp(e,t,n,r,o){const{x:i,y:s}=t.internals.positionAbsolute,a=Kn(e),l=Qo(e,n),c=fo(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=Tc(u,a,t));const g=Zc(e,o),f=t.internals.z??0;return{x:u.x,y:u.y,z:f>g?f:g}}function jp(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)??uo(l),u=Dc(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)),x=Math.max(g.height,Math.round(a.height)),C=(b-g.width)*f[0],m=(x-g.height)*f[1];(h>0||v>0||C||m)&&(o.push({id:c,type:"position",position:{x:l.position.x-h+C,y:l.position.y-v+m}}),(_=n.get(c))==null||_.forEach(p=>{e.some(E=>E.id===p.id)||o.push({id:p.id,type:"position",position:{x:p.position.x+h,y:p.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-C:0),height:x+(v?f[1]*v-m:0)}})}),o}function Up(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=Ac(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 C=f.nodeElement.getBoundingClientRect(),m=fo(h.extent)?h.extent:i;let{positionAbsolute:_}=h.internals;h.parentId&&h.extent==="parent"?_=Tc(_,v,t.get(h.parentId)):m&&(_=Or(_,m,v));const p={...h,measured:v,internals:{...h.internals,positionAbsolute:_,handleBounds:{source:Lc("source",f.nodeElement,C,u,h.id),target:Lc("target",f.nodeElement,C,u,h.id)}}};t.set(h.id,p),h.parentId&&ja(p,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:uo(p,o)}))}}if(g.length>0){const f=jp(g,t,n,o);l.push(...f)}return{changes:l,updatedInternals:a}}async function Gp({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 Kc(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 jc(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}`;Kc("source",l,u,e,o,s),Kc("target",l,c,e,i,a),t.set(r.id,r)}}function Jp(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 Uc(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Uc(n,t):!1}function Gc(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 Qp(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!Uc(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 Ua({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 e2({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:x,handleSelector:C,domNode:m,isSelectable:_,nodeId:p,nodeClickDistance:E=0}){f=gn(m);function N({x:V,y:O},z){const{nodeLookup:B,nodeExtent:k,snapGrid:$,snapToGrid:P,nodeOrigin:T,onNodeDrag:M,onSelectionDrag:H,onError:I,updateNodePositions:W}=t();i={x:V,y:O};let j=!1,J={x:0,y:0,x2:0,y2:0};if(a.size>1&&k){const ne=ei(a);J=Ba(ne)}for(const[ne,ee]of a){if(!B.has(ne))continue;let ce={x:V-ee.distance.x,y:O-ee.distance.y};P&&(ce=Fa(ce,$));let re=[[k[0][0],k[0][1]],[k[1][0],k[1][1]]];if(a.size>1&&k&&!ee.extent){const{positionAbsolute:Ae}=ee.internals,ye=Ae.x-J.x+k[0][0],be=Ae.x+ee.measured.width-J.x2+k[1][0],de=Ae.y-J.y+k[0][1],U=Ae.y+ee.measured.height-J.y2+k[1][1];re=[[ye,de],[be,U]]}const{position:we,positionAbsolute:Ne}=$p({nodeId:ne,nextPosition:ce,nodeLookup:B,nodeExtent:re,nodeOrigin:T,onError:I});j=j||ee.position.x!==we.x||ee.position.y!==we.y,ee.position=we,ee.internals.positionAbsolute=Ne}if(j&&(W(a,!0),z&&(r||M||!p&&H))){const[ne,ee]=Ua({nodeId:p,dragItems:a,nodeLookup:B});r==null||r(z,a,ne,ee),M==null||M(z,ne,ee),p||H==null||H(z,ee)}}async function S(){if(!u)return;const{transform:V,panBy:O,autoPanSpeed:z,autoPanOnNodeDrag:B}=t();if(!B){l=!1,cancelAnimationFrame(s);return}const[k,$]=Hc(c,u,z);(k!==0||$!==0)&&(i.x=(i.x??0)-k/V[2],i.y=(i.y??0)-$/V[2],await O({x:k,y:$})&&N(i,null)),s=requestAnimationFrame(S)}function A(V){var j;const{nodeLookup:O,multiSelectionActive:z,nodesDraggable:B,transform:k,snapGrid:$,snapToGrid:P,selectNodesOnDrag:T,onNodeDragStart:M,onSelectionDragStart:H,unselectNodesAndEdges:I}=t();g=!0,(!T||!_)&&!z&&p&&((j=O.get(p))!=null&&j.selected||I()),_&&T&&p&&(e==null||e(p));const W=qa(V.sourceEvent,{transform:k,snapGrid:$,snapToGrid:P,containerBounds:u});if(i=W,a=Qp(O,B,W,p),a.size>0&&(n||M||!p&&H)){const[J,ne]=Ua({nodeId:p,dragItems:a,nodeLookup:O});n==null||n(V.sourceEvent,a,J,ne),M==null||M(V.sourceEvent,J,ne),p||H==null||H(V.sourceEvent,ne)}}const L=Pv().clickDistance(E).on("start",V=>{const{domNode:O,nodeDragThreshold:z,transform:B,snapGrid:k,snapToGrid:$}=t();u=(O==null?void 0:O.getBoundingClientRect())||null,h=!1,z===0&&A(V),i=qa(V.sourceEvent,{transform:B,snapGrid:k,snapToGrid:$,containerBounds:u}),c=jn(V.sourceEvent,u)}).on("drag",V=>{const{autoPanOnNodeDrag:O,transform:z,snapGrid:B,snapToGrid:k,nodeDragThreshold:$,nodeLookup:P}=t(),T=qa(V.sourceEvent,{transform:z,snapGrid:B,snapToGrid:k,containerBounds:u});if((V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||p&&!P.has(p))&&(h=!0),!h){if(!l&&O&&g&&(l=!0,S()),!g){const M=T.xSnapped-(i.x??0),H=T.ySnapped-(i.y??0);Math.sqrt(M*M+H*H)>$&&A(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:O,updateNodePositions:z,onNodeDragStop:B,onSelectionDragStop:k}=t();if(z(a,!1),o||B||!p&&k){const[$,P]=Ua({nodeId:p,dragItems:a,nodeLookup:O,dragging:!1});o==null||o(V.sourceEvent,a,$,P),B==null||B(V.sourceEvent,$,P),p||k==null||k(V.sourceEvent,P)}}}).filter(V=>{const O=V.target;return!V.button&&(!x||!Gc(O,`.${x}`,m))&&(!C||Gc(O,C,m))});f.call(L)}function b(){f==null||f.on(".drag",null)}return{update:v,destroy:b}}function t2(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,uo(i))>0&&r.push(i);return r}const n2=250;function r2(e,t,n,r){var a,l;let o=[],i=1/0;const s=t2(e,n,t+n2);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 Jc(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 Qc(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function o2(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const ed=()=>!0;function i2(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:x,isValidConnection:C=ed,onReconnectEnd:m,updateConnection:_,getTransform:p,getFromHandle:E,autoPanSpeed:N}){const S=Tp(e.target);let A=0,L;const{x:V,y:O}=jn(e),z=S==null?void 0:S.elementFromPoint(V,O),B=Qc(i,z),k=a==null?void 0:a.getBoundingClientRect();if(!k||!B)return;const $=Jc(o,B,r,l,t);if(!$)return;let P=jn(e,k),T=!1,M=null,H=!1,I=null;function W(){if(!u||!k)return;const[Ne,Ae]=Hc(P,k,N);f({x:Ne,y:Ae}),A=requestAnimationFrame(W)}const j={...$,nodeId:o,type:B,position:$.position},J=l.get(o),ee={inProgress:!0,isValid:null,from:ri(J,j,Pe.Left,!0),fromHandle:j,fromPosition:j.position,fromNode:J,to:P,toHandle:null,toPosition:kc[j.position],toNode:null};_(ee);let ce=ee;v==null||v(e,{nodeId:o,handleId:r,handleType:B});function re(Ne){if(!E()||!j){we(Ne);return}const Ae=p();P=jn(Ne,k),L=r2(ni(P,Ae,!1,[1,1]),n,l,j),T||(W(),T=!0);const ye=td(Ne,{handle:L,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:C,doc:S,lib:c,flowId:g,nodeLookup:l});I=ye.handleDomNode,M=ye.connection,H=o2(!!L,ye.isValid);const be={...ce,isValid:H,to:L&&H?us({x:L.x,y:L.y},Ae):P,toHandle:ye.toHandle,toPosition:H&&ye.toHandle?ye.toHandle.position:kc[j.position],toNode:ye.toHandle?l.get(ye.toHandle.nodeId):null};H&&L&&ce.toHandle&&be.toHandle&&ce.toHandle.type===be.toHandle.type&&ce.toHandle.nodeId===be.toHandle.nodeId&&ce.toHandle.id===be.toHandle.id&&ce.to.x===be.to.x&&ce.to.y===be.to.y||(_(be),ce=be)}function we(Ne){(L||I)&&M&&H&&(b==null||b(M));const{inProgress:Ae,...ye}=ce,be={...ye,toPosition:ce.toHandle?ce.toPosition:null};x==null||x(Ne,be),i&&(m==null||m(Ne,be)),h(),cancelAnimationFrame(A),T=!1,H=!1,M=null,I=null,S.removeEventListener("mousemove",re),S.removeEventListener("mouseup",we),S.removeEventListener("touchmove",re),S.removeEventListener("touchend",we)}S.addEventListener("mousemove",re),S.addEventListener("mouseup",we),S.addEventListener("touchmove",re),S.addEventListener("touchend",we)}function td(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=ed,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),x=b!=null&&b.classList.contains(`${a}-flow__handle`)?b:f,C={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const m=Qc(void 0,x),_=x.getAttribute("data-nodeid"),p=x.getAttribute("data-handleid"),E=x.classList.contains("connectable"),N=x.classList.contains("connectableend");if(!_||!m)return C;const S={source:g?_:r,sourceHandle:g?p:o,target:g?r:_,targetHandle:g?o:p};C.connection=S;const L=E&&N&&(n===Vr.Strict?g&&m==="source"||!g&&m==="target":_!==r||p!==o);C.isValid=L&&c(S),C.toHandle=Jc(_,m,p,u,n,!1)}return C}const s2={onPointerDown:i2,isValid:td};function a2({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 p=n();if(_.sourceEvent.type!=="wheel"||!t)return;const E=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*u,N=p[2]*Math.pow(2,E);t.scaleTo(N)};let b=[0,0];const x=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(b=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},C=_=>{const p=n();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!t)return;const E=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],N=[E[0]-b[0],E[1]-b[1]];b=E;const S=r()*Math.max(p[2],Math.log(p[2]))*(h?-1:1),A={x:p[0]-N[0]*S,y:p[1]-N[1]*S},L=[[0,0],[l,c]];t.setViewportConstrained({x:A.x,y:A.y,zoom:p[2]},L,a)},m=$c().on("start",x).on("zoom",g?C:null).on("zoom.wheel",f?v:null);o.call(m,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:bn}}const l2=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,hs=e=>({x:e.x,y:e.y,zoom:e.k}),Ga=({x:e,y:t,zoom:n})=>rs.translate(e,t).scale(n),go=(e,t)=>e.target.closest(`.${t}`),nd=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Ja=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},rd=e=>{const t=e.ctrlKey&&cs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function u2({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(go(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();const g=n.property("__zoom").k||1;if(u.ctrlKey&&s){const x=bn(u),C=rd(u),m=g*Math.pow(2,C);r.scaleTo(n,m,x,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;!cs()&&u.shiftKey&&o!==Zn.Vertical&&(h=u.deltaY*f,v=0),r.translateBy(n,-(h/g)*i,-(v/g)*i,{internal:!0});const b=hs(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 c2({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,a=go(r,e);if(r.ctrlKey&&i&&a&&r.preventDefault(),s||a)return null;r.preventDefault(),n.call(this,r,o)}}function d2({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,a;if((i=r.sourceEvent)!=null&&i.internal)return;const o=hs(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 f2({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,a;e.usedRightMouseButton=!!(n&&nd(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,hs(i.transform)))}}function g2({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&&nd(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o&&l2(e.prevViewport,s.transform))){const l=hs(s.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,l)},n?150:0)}}}function h2({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"&&(go(u,`${c}-flow__node`)||go(u,`${c}-flow__edge`)))return!0;if(!r&&!g&&!o&&!i&&!n||s||go(u,a)&&u.type==="wheel"||go(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 v2({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=$c().clickDistance(!Ln(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(o),h=gn(e).call(f);_({x:i.x,y:i.y,zoom:lo(i.zoom,t,n)},[[0,0],[g.width,g.height]],o);const v=h.on("wheel.zoom"),b=h.on("dblclick.zoom");f.wheelDelta(rd);function x(z,B){return h?new Promise(k=>{f==null||f.transform(Ja(h,B==null?void 0:B.duration,()=>k(!0)),z)}):Promise.resolve(!1)}function C({noWheelClassName:z,noPanClassName:B,onPaneContextMenu:k,userSelectionActive:$,panOnScroll:P,panOnDrag:T,panOnScrollMode:M,panOnScrollSpeed:H,preventScrolling:I,zoomOnPinch:W,zoomOnScroll:j,zoomOnDoubleClick:J,zoomActivationKeyPressed:ne,lib:ee,onTransformChange:ce}){$&&!u.isZoomingOrPanning&&m();const we=P&&!ne&&!$?u2({zoomPanValues:u,noWheelClassName:z,d3Selection:h,d3Zoom:f,panOnScrollMode:M,panOnScrollSpeed:H,zoomOnPinch:W,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):c2({noWheelClassName:z,preventScrolling:I,d3ZoomHandler:v});if(h.on("wheel.zoom",we,{passive:!1}),!$){const Ae=d2({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",Ae);const ye=f2({zoomPanValues:u,panOnDrag:T,onPaneContextMenu:!!k,onPanZoom:s,onTransformChange:ce});f.on("zoom",ye);const be=g2({zoomPanValues:u,panOnDrag:T,panOnScroll:P,onPaneContextMenu:k,onPanZoomEnd:l,onDraggingChange:c});f.on("end",be)}const Ne=h2({zoomActivationKeyPressed:ne,panOnDrag:T,zoomOnScroll:j,panOnScroll:P,zoomOnDoubleClick:J,zoomOnPinch:W,userSelectionActive:$,noPanClassName:B,noWheelClassName:z,lib:ee});f.filter(Ne),J?h.on("dblclick.zoom",b):h.on("dblclick.zoom",null)}function m(){f.on("zoom",null)}async function _(z,B,k){const $=Ga(z),P=f==null?void 0:f.constrain()($,B,k);return P&&await x(P),new Promise(T=>T(P))}async function p(z,B){const k=Ga(z);return await x(k,B),new Promise($=>$(k))}function E(z){if(h){const B=Ga(z),k=h.property("__zoom");(k.k!==z.zoom||k.x!==z.x||k.y!==z.y)&&(f==null||f.transform(h,B,null,{sync:!0}))}}function N(){const z=h?xc(h.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}function S(z,B){return h?new Promise(k=>{f==null||f.scaleTo(Ja(h,B==null?void 0:B.duration,()=>k(!0)),z)}):Promise.resolve(!1)}function A(z,B){return h?new Promise(k=>{f==null||f.scaleBy(Ja(h,B==null?void 0:B.duration,()=>k(!0)),z)}):Promise.resolve(!1)}function L(z){f==null||f.scaleExtent(z)}function V(z){f==null||f.translateExtent(z)}function O(z){const B=!Ln(z)||z<0?0:z;f==null||f.clickDistance(B)}return{update:C,destroy:m,setViewport:p,setViewportConstrained:_,getViewport:N,scaleTo:S,scaleBy:A,setScaleExtent:L,setTranslateExtent:V,syncViewport:E,setClickDistance:O}}var od;(function(e){e.Line="line",e.Handle="handle"})(od||(od={}));var p2=ie('<div role="button" tabindex="-1"><!></div>');function ar(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(J,"$connectable",n),i=()=>oe(we,"$connectionRadius",n),s=()=>oe(ce,"$domNode",n),a=()=>oe(re,"$nodeLookup",n),l=()=>oe(ee,"$connectionMode",n),c=()=>oe(ye,"$lib",n),u=()=>oe(ae,"$autoPanOnConnect",n),g=()=>oe(ze,"$flowId",n),f=()=>oe(Ae,"$isValidConnectionStore",n),h=()=>oe(de,"$onedgecreate",n),v=()=>oe(Fe,"$onConnectAction",n),b=()=>oe(Oe,"$onConnectStartAction",n),x=()=>oe(me,"$onConnectEndAction",n),C=()=>oe(Ne,"$viewport",n),m=()=>oe(Ue,"$connection",n),_=()=>oe(Me,"$edges",n),p=()=>oe(Ee,"$connectionLookup",n),E=le(),N=le(),S=le(),A=le(),L=le(),V=le(),O=le(),z=le();let B=w(t,"id",12,void 0),k=w(t,"type",12,"source"),$=w(t,"position",28,()=>Pe.Top),P=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),I=w(t,"isConnectable",12,void 0),W=w(t,"class",12,void 0);const j=xr("svelteflow__node_id"),J=xr("svelteflow__node_connectable"),ne=tt(),{connectionMode:ee,domNode:ce,nodeLookup:re,connectionRadius:we,viewport:Ne,isValidConnection:Ae,lib:ye,addEdge:be,onedgecreate:de,panBy:U,cancelConnection:se,updateConnection:X,autoPanOnConnect:ae,edges:Me,connectionLookup:Ee,onconnect:Fe,onconnectstart:Oe,onconnectend:me,flowId:ze,connection:Ue}=ne;function at($e){const Xe=Oc($e);(Xe&&$e.button===0||!Xe)&&s2.onPointerDown($e,{handleId:d(S),nodeId:j,isTarget:d(E),connectionRadius:i(),domNode:s(),nodeLookup:a(),connectionMode:l(),lib:c(),autoPanOnConnect:u(),flowId:g(),isValidConnection:T()??f(),updateConnection:X,cancelConnection:se,panBy:U,onConnect:Le=>{var kt;const Ht=h()?h()(Le):Le;Ht&&(be(Ht),(kt=v())==null||kt(Le))},onConnectStart:(Le,Ht)=>{var kt;(kt=b())==null||kt(Le,{nodeId:Ht.nodeId,handleId:Ht.handleId,handleType:Ht.handleType})},onConnectEnd:(Le,Ht)=>{var kt;(kt=x())==null||kt(Le,Ht)},getTransform:()=>[C().x,C().y,C().zoom],getFromHandle:()=>m().fromHandle})}let K=le(null),Ge=le();ve(()=>q(k()),()=>{te(E,k()==="target")}),ve(()=>(q(I()),o()),()=>{te(N,I()!==void 0?I():o())}),ve(()=>q(B()),()=>{te(S,B()||null)}),ve(()=>(q(M()),q(H()),_(),p(),q(k()),q(B())),()=>{(M()||H())&&(_(),te(Ge,p().get(`${j}-${k()}${B()?`-${B()}`:""}`)))}),ve(()=>(d(K),d(Ge),q(H()),q(M())),()=>{if(d(K)&&!yp(d(Ge),d(K))){const $e=d(Ge)??new Map;Ec(d(K),$e,H()),Ec($e,d(K),M())}te(K,d(Ge)??new Map)}),ve(()=>m(),()=>{te(A,!!m().fromHandle)}),ve(()=>(m(),q(k()),d(S)),()=>{var $e,Xe,Le;te(L,(($e=m().fromHandle)==null?void 0:$e.nodeId)===j&&((Xe=m().fromHandle)==null?void 0:Xe.type)===k()&&((Le=m().fromHandle)==null?void 0:Le.id)===d(S))}),ve(()=>(m(),q(k()),d(S)),()=>{var $e,Xe,Le;te(V,(($e=m().toHandle)==null?void 0:$e.nodeId)===j&&((Xe=m().toHandle)==null?void 0:Xe.type)===k()&&((Le=m().toHandle)==null?void 0:Le.id)===d(S))}),ve(()=>(l(),m(),q(k()),d(S)),()=>{var $e,Xe,Le;te(O,l()===Vr.Strict?(($e=m().fromHandle)==null?void 0:$e.type)!==k():j!==((Xe=m().fromHandle)==null?void 0:Xe.nodeId)||d(S)!==((Le=m().fromHandle)==null?void 0:Le.id))}),ve(()=>(d(V),m()),()=>{te(z,d(V)&&m().isValid)}),Pt(),Be();var Qe=p2();let gt;var sn=Y(Qe);Ot(sn,t,"default",{}),F(Qe),Ve(($e,Xe)=>{_e(Qe,"data-handleid",d(S)),_e(Qe,"data-nodeid",j),_e(Qe,"data-handlepos",$()),_e(Qe,"data-id",`${g()??""}-${j??""}-${(B()||"")??""}-${k()??""}`),gt=Nt(Qe,1,$e,null,gt,Xe),mt(Qe,P())},[()=>wn((q(ut),q($()),q(W()),G(()=>ut(["svelte-flow__handle",`svelte-flow__handle-${$()}`,"nodrag","nopan",$(),W()])))),()=>({valid:d(z),connectingto:d(V),connectingfrom:d(L),source:!d(E),target:d(E),connectablestart:d(N),connectableend:d(N),connectable:d(N),connectionindicator:d(N)&&(!d(A)||d(O))})]),dt("mousedown",Qe,at),dt("touchstart",Qe,at),D(e,Qe);var nt=ge({get id(){return B()},set id($e){B($e),y()},get type(){return k()},set type($e){k($e),y()},get position(){return $()},set position($e){$($e),y()},get style(){return P()},set style($e){P($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 I()},set isConnectable($e){I($e),y()},get class(){return W()},set class($e){W($e),y()}});return r(),nt}ue(ar,{id:{},type:{},position:{},style:{},isValidConnection:{},onconnect:{},ondisconnect:{},isConnectable:{},class:{}},["default"],[],!0);var m2=ie("<!> <!>",1);function vs(e,t){const n=ht(t,["children","$$slots","$$events","$$legacy","$$host"]);ht(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);Be();var s=m2(),a=he(s);{let u=De(()=>(q(o()),q(Pe),G(()=>o()??Pe.Top)));ar(a,{type:"target",get position(){return d(u)}})}var l=R(a),c=R(l);{let u=De(()=>(q(i()),q(Pe),G(()=>i()??Pe.Bottom)));ar(c,{type:"source",get position(){return d(u)}})}return Ve(()=>ft(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()}})}ue(vs,{data:{},targetPosition:{},sourcePosition:{}},[],[],!0);var y2=ie(" <!>",1);function id(e,t){const n=ht(t,["children","$$slots","$$events","$$legacy","$$host"]);ht(n,["data","sourcePosition"]),fe(t,!1);let r=w(t,"data",28,()=>({label:"Node"})),o=w(t,"sourcePosition",12,void 0);Be(),Te();var i=y2(),s=he(i),a=R(s);{let l=De(()=>(q(o()),q(Pe),G(()=>o()??Pe.Bottom)));ar(a,{type:"source",get position(){return d(l)}})}return Ve(()=>ft(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()}})}ue(id,{data:{},sourcePosition:{}},[],[],!0);var w2=ie(" <!>",1);function sd(e,t){const n=ht(t,["children","$$slots","$$events","$$legacy","$$host"]);ht(n,["data","targetPosition"]),fe(t,!1);let r=w(t,"data",28,()=>({label:"Node"})),o=w(t,"targetPosition",12,void 0);Be(),Te();var i=w2(),s=he(i),a=R(s);{let l=De(()=>(q(o()),q(Pe),G(()=>o()??Pe.Top)));ar(a,{type:"target",get position(){return d(l)}})}return Ve(()=>ft(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()}})}ue(sd,{data:{},targetPosition:{}},[],[],!0);function ad(e,t){const n=ht(t,["children","$$slots","$$events","$$legacy","$$host"]);ht(n,[])}ue(ad,{},[],[],!0);function ld(e,t,n){if(!t)return;const r=n?t.querySelector(n):t;r&&r.appendChild(e)}function ho(e,{target:t,domNode:n}){return ld(e,n,t),{async update({target:r,domNode:o}){ld(e,o,r)},destroy(){e.parentNode&&e.parentNode.removeChild(e)}}}var _2=ie("<div><!></div>");function ud(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(i,"$domNode",n),{domNode:i}=tt();Be();var s=_2(),a=Y(s);Ot(a,t,"default",{}),F(s),Lt(s,(l,c)=>ho==null?void 0:ho(l,c),()=>({target:".svelte-flow__edgelabel-renderer",domNode:o()})),D(e,s),ge(),r()}ue(ud,{},["default"],[],!0);function cd(){const{edgeLookup:e,selectionRect:t,selectionRectMode:n,multiselectionKeyPressed:r,addSelectedEdges:o,unselectNodesAndEdges:i,elementsSelectable:s}=tt();return a=>{const l=Q(e).get(a);if(!l){console.warn("012",so.error012(a));return}(l.selectable||Q(s)&&typeof l.selectable>"u")&&(t.set(null),n.set(null),l.selected?l.selected&&Q(r)&&i({nodes:[],edges:[l]}):o([a]))}}var b2=ie('<div class="svelte-flow__edge-label" role="button" tabindex="-1"><!></div>');function dd(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=cd(),s=xr("svelteflow__edge_id");return Be(),ud(e,{children:(a,l)=>{var c=b2();let u;var g=Y(c);Ot(g,t,"default",{}),F(c),Ve(f=>u=mt(c,"pointer-events: all;"+n(),u,f),[()=>({transform:`translate(-50%, -50%) translate(${r()??""}px,${o()??""}px)`})]),dt("keyup",c,()=>{}),dt("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()}})}ue(dd,{style:{},x:{},y:{}},["default"],[],!0);var x2=Ce('<path fill="none" class="svelte-flow__edge-interaction"></path>'),C2=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();Be();var v=C2(),b=he(v),x=R(b);{var C=p=>{var E=x2();_e(E,"stroke-opacity",0),Ve(()=>{_e(E,"d",r()),_e(E,"stroke-width",h)}),D(p,E)};pe(x,p=>{h&&p(C)})}var m=R(x);{var _=p=>{dd(p,{get x(){return i()},get y(){return s()},get style(){return a()},children:(E,N)=>{Te();var S=Re();Ve(()=>ft(S,o())),D(E,S)},$$slots:{default:!0}})};pe(m,p=>{o()&&p(_)})}return Ve(p=>{_e(b,"id",n()),_e(b,"d",r()),Nt(b,0,p),_e(b,"marker-start",l()),_e(b,"marker-end",c()),mt(b,u())},[()=>wn((q(ut),q(f()),G(()=>ut(["svelte-flow__edge-path",f()]))))]),D(e,v),ge({get id(){return n()},set id(p){n(p),y()},get path(){return r()},set path(p){r(p),y()},get label(){return o()},set label(p){o(p),y()},get labelX(){return i()},set labelX(p){i(p),y()},get labelY(){return s()},set labelY(p){s(p),y()},get labelStyle(){return a()},set labelStyle(p){a(p),y()},get markerStart(){return l()},set markerStart(p){l(p),y()},get markerEnd(){return c()},set markerEnd(p){c(p),y()},get style(){return u()},set style(p){u(p),y()},get interactionWidth(){return g()},set interactionWidth(p){g(p),y()},get class(){return f()},set class(p){f(p),y()}})}ue(oi,{id:{},path:{},label:{},labelX:{},labelY:{},labelStyle:{},markerStart:{},markerEnd:{},style:{},interactionWidth:{},class:{}},[],[],!0);function ps(e,t){const n=ht(t,["children","$$slots","$$events","$$legacy","$$host"]);ht(n,["label","labelStyle","style","markerStart","markerEnd","interactionWidth","sourceX","sourceY","sourcePosition","targetX","targetY","targetPosition"]),fe(t,!1);const r=le(),o=le(),i=le();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),x=w(t,"targetY",12),C=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),q(f()),q(h()),q(b()),q(x()),q(v()),q(C())),()=>{(m=>{var _=er(m,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(zc({sourceX:f(),sourceY:h(),targetX:b(),targetY:x(),sourcePosition:v(),targetPosition:C()}))}),Pt(),Be(),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(m){s(m),y()},get labelStyle(){return a()},set labelStyle(m){a(m),y()},get style(){return l()},set style(m){l(m),y()},get markerStart(){return c()},set markerStart(m){c(m),y()},get markerEnd(){return u()},set markerEnd(m){u(m),y()},get interactionWidth(){return g()},set interactionWidth(m){g(m),y()},get sourceX(){return f()},set sourceX(m){f(m),y()},get sourceY(){return h()},set sourceY(m){h(m),y()},get sourcePosition(){return v()},set sourcePosition(m){v(m),y()},get targetX(){return b()},set targetX(m){b(m),y()},get targetY(){return x()},set targetY(m){x(m),y()},get targetPosition(){return C()},set targetPosition(m){C(m),y()}})}ue(ps,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function fd(e,t){const n=ht(t,["children","$$slots","$$events","$$legacy","$$host"]);ht(n,["label","labelStyle","style","markerStart","markerEnd","interactionWidth","sourceX","sourceY","sourcePosition","targetX","targetY","targetPosition"]),fe(t,!1);const r=le(),o=le(),i=le();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),x=w(t,"targetY",12),C=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),q(f()),q(h()),q(b()),q(x()),q(v()),q(C())),()=>{(m=>{var _=er(m,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(gs({sourceX:f(),sourceY:h(),targetX:b(),targetY:x(),sourcePosition:v(),targetPosition:C()}))}),Pt(),Be(),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(m){s(m),y()},get labelStyle(){return a()},set labelStyle(m){a(m),y()},get style(){return l()},set style(m){l(m),y()},get markerStart(){return c()},set markerStart(m){c(m),y()},get markerEnd(){return u()},set markerEnd(m){u(m),y()},get interactionWidth(){return g()},set interactionWidth(m){g(m),y()},get sourceX(){return f()},set sourceX(m){f(m),y()},get sourceY(){return h()},set sourceY(m){h(m),y()},get sourcePosition(){return v()},set sourcePosition(m){v(m),y()},get targetX(){return b()},set targetX(m){b(m),y()},get targetY(){return x()},set targetY(m){x(m),y()},get targetPosition(){return C()},set targetPosition(m){C(m),y()}})}ue(fd,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function gd(e,t){const n=ht(t,["children","$$slots","$$events","$$legacy","$$host"]);ht(n,["label","labelStyle","style","markerStart","markerEnd","interactionWidth","sourceX","sourceY","targetX","targetY"]),fe(t,!1);const r=le(),o=le(),i=le();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())),()=>{(x=>{var C=er(x,3);te(r,C[0]),te(o,C[1]),te(i,C[2])})(Xa({sourceX:f(),sourceY:h(),targetX:v(),targetY:b()}))}),Pt(),Be(),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(x){s(x),y()},get labelStyle(){return a()},set labelStyle(x){a(x),y()},get style(){return l()},set style(x){l(x),y()},get markerStart(){return c()},set markerStart(x){c(x),y()},get markerEnd(){return u()},set markerEnd(x){u(x),y()},get interactionWidth(){return g()},set interactionWidth(x){g(x),y()},get sourceX(){return f()},set sourceX(x){f(x),y()},get sourceY(){return h()},set sourceY(x){h(x),y()},get targetX(){return v()},set targetX(x){v(x),y()},get targetY(){return b()},set targetY(x){b(x),y()}})}ue(gd,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},targetX:{},targetY:{}},[],[],!0);function hd(e,t){const n=ht(t,["children","$$slots","$$events","$$legacy","$$host"]);ht(n,["label","labelStyle","style","markerStart","markerEnd","interactionWidth","sourceX","sourceY","sourcePosition","targetX","targetY","targetPosition"]),fe(t,!1);const r=le(),o=le(),i=le();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),x=w(t,"targetY",12),C=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),q(f()),q(h()),q(b()),q(x()),q(v()),q(C())),()=>{(m=>{var _=er(m,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(gs({sourceX:f(),sourceY:h(),targetX:b(),targetY:x(),sourcePosition:v(),targetPosition:C(),borderRadius:0}))}),Pt(),Be(),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(m){s(m),y()},get labelStyle(){return a()},set labelStyle(m){a(m),y()},get style(){return l()},set style(m){l(m),y()},get markerStart(){return c()},set markerStart(m){c(m),y()},get markerEnd(){return u()},set markerEnd(m){u(m),y()},get interactionWidth(){return g()},set interactionWidth(m){g(m),y()},get sourceX(){return f()},set sourceX(m){f(m),y()},get sourceY(){return h()},set sourceY(m){h(m),y()},get sourcePosition(){return v()},set sourcePosition(m){v(m),y()},get targetX(){return b()},set targetX(m){b(m),y()},get targetY(){return x()},set targetY(m){x(m),y()},get targetPosition(){return C()},set targetPosition(m){C(m),y()}})}ue(hd,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function $2(e,t){const n=e.set,r=t.set,o=Q(e),i=Q(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 k2(e,t){const n=e.set,r=t.set;let o=Q(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 E2=(e,t,n)=>{if(!n)return;const r=Q(e),o=t.set,i=n.set;let s=n?Q(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))}},S2=(e,t,n,r=[0,0],o=os,i,s,a,l,c,u,g,f)=>{const{subscribe:h,set:v,update:b}=xe([]);let x=e,C={},m=!0;const _=S=>{const A=Wc(S,t,n,{elevateNodesOnSelect:m,nodeOrigin:r,nodeExtent:o,defaults:C,checkEquality:!1});return Q(i)&&A&&Q(l)&&(Cp({nodes:t,width:Q(c),height:Q(u),panZoom:Q(l),minZoom:Q(g),maxZoom:Q(f)},Q(s)).then(V=>{var O;(O=Q(a))==null||O.resolve(V),a.set(null)}),i.set(!1),s.set(void 0)),x=S,v(x),x},p=S=>_(S(x)),E=S=>{C=S},N=S=>{m=S.elevateNodesOnSelect??m};return _(x),{subscribe:h,set:_,update:p,setDefaultOptions:E,setOptions:N}},P2=(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;jc(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}},vd={input:id,output:sd,default:vs,group:ad},pd={straight:gd,smoothstep:fd,default:ps,step:hd},N2=({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??os;Wc(e,a,l,{nodeExtent:f,nodeOrigin:g,elevateNodesOnSelect:!1,checkEquality:!1}),jc(c,u,t);let h={x:0,y:0,zoom:1};if(o&&n&&r){const N=ei(a,{filter:S=>!!((S.width||S.initialWidth)&&(S.height||S.initialHeight))});h=Ya(N,n,r,.5,2,.1)}const v=xe(!1),b=xe(void 0),x=xe(null),C=xe(null),m=xe(500),_=xe(500),p=xe(.5),E=xe(2);return{flowId:xe(null),nodes:S2(e,a,l,g,f,v,b,x,C,m,_,p,E),nodeLookup:fn(a),parentLookup:fn(l),edgeLookup:fn(u),visibleNodes:fn([]),edges:P2(t,c,u),visibleEdges:fn([]),connectionLookup:fn(c),width:m,height:_,minZoom:p,maxZoom:E,nodeOrigin:xe(g),nodeDragThreshold:xe(1),nodeExtent:xe(f),translateExtent:xe(os),autoPanOnNodeDrag:xe(!0),autoPanOnConnect:xe(!0),fitViewQueued:v,fitViewOptions:b,fitViewResolver:x,panZoom:C,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(is.Partial),nodeTypes:xe(vd),edgeTypes:xe(pd),viewport:xe(h),connectionMode:xe(Vr.Strict),domNode:xe(null),connection:fn(Ia),connectionLineType:xe(ao.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(kp),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 T2(e){const t=ir([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&&Ap({sourceNode:u,targetNode:g,width:s,height:a,transform:[i.x,i.y,i.zoom]})}):n);return ir([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=Fp({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:Vp({selected:l.selected,zIndex:l.zIndex,sourceNode:c,targetNode:u,elevateOnSelect:!1}),...g}),a},[]))}function M2(e){return ir([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?Pc(t,{x:0,y:0,width:r,height:o},s,!0):Array.from(t.values())})}const ms=Symbol();function md({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s}){const a=N2({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s});function l($){a.nodeTypes.set({...vd,...$})}function c($){a.edgeTypes.set({...pd,...$})}function u($){const P=Q(a.edges);a.edges.set(Ip($,P))}const g=($,P=!1)=>{var M;const T=Q(a.nodeLookup);for(const[H,I]of $){const W=(M=T.get(H))==null?void 0:M.internals.userNode;W&&(W.position=I.position,W.dragging=P)}a.nodes.update(H=>H)};function f($){var I,W,j;const P=Q(a.nodeLookup),T=Q(a.parentLookup),{changes:M,updatedInternals:H}=Up($,P,Q(a.parentLookup),Q(a.domNode),Q(a.nodeOrigin));if(H){Wp(P,T,{nodeOrigin:i,nodeExtent:s});for(const J of M){const ne=(I=P.get(J.id))==null?void 0:I.internals.userNode;if(ne)switch(J.type){case"dimensions":{const ee={...ne.measured,...J.dimensions};J.setAttributes&&(ne.width=((W=J.dimensions)==null?void 0:W.width)??ne.width,ne.height=((j=J.dimensions)==null?void 0:j.height)??ne.height),ne.measured=ee;break}case"position":ne.position=J.position??ne.position;break}}a.nodes.update(J=>J),Q(a.nodesInitialized)||a.nodesInitialized.set(!0)}}function h($){const P=Q(a.fitViewResolver)??Np();return a.fitViewQueued.set(!0),a.fitViewOptions.set($),a.fitViewResolver.set(P),a.nodes.set(Q(a.nodes)),P.promise}function v($,P){const T=Q(a.panZoom);return T?T.scaleBy($,P):Promise.resolve(!1)}function b($){return v(1.2,$)}function x($){return v(1/1.2,$)}function C($){const P=Q(a.panZoom);P&&(P.setScaleExtent([$,Q(a.maxZoom)]),a.minZoom.set($))}function m($){const P=Q(a.panZoom);P&&(P.setScaleExtent([Q(a.minZoom),$]),a.maxZoom.set($))}function _($){const P=Q(a.panZoom);P&&(P.setTranslateExtent($),a.translateExtent.set($))}function p($){let P=!1;return $.forEach(T=>{T.selected&&(T.selected=!1,P=!0)}),P}function E($){var P;(P=Q(a.panZoom))==null||P.setClickDistance($)}function N($){p(($==null?void 0:$.nodes)||Q(a.nodes))&&a.nodes.set(Q(a.nodes)),p(($==null?void 0:$.edges)||Q(a.edges))&&a.edges.set(Q(a.edges))}a.deleteKeyPressed.subscribe(async $=>{var P;if($){const T=Q(a.nodes),M=Q(a.edges),H=T.filter(J=>J.selected),I=M.filter(J=>J.selected),{nodes:W,edges:j}=await Nc({nodesToRemove:H,edgesToRemove:I,nodes:T,edges:M,onBeforeDelete:Q(a.onbeforedelete)});(W.length||j.length)&&(a.nodes.update(J=>J.filter(ne=>!W.some(ee=>ee.id===ne.id))),a.edges.update(J=>J.filter(ne=>!j.some(ee=>ee.id===ne.id))),(P=Q(a.ondelete))==null||P({nodes:W,edges:j}))}});function S($){const P=Q(a.multiselectionKeyPressed);a.nodes.update(T=>T.map(M=>{const H=$.includes(M.id),I=P&&M.selected||H;return M.selected=I,M})),P||a.edges.update(T=>T.map(M=>(M.selected=!1,M)))}function A($){const P=Q(a.multiselectionKeyPressed);a.edges.update(T=>T.map(M=>{const H=$.includes(M.id),I=P&&M.selected||H;return M.selected=I,M})),P||a.nodes.update(T=>T.map(M=>(M.selected=!1,M)))}function L($){var T;const P=(T=Q(a.nodes))==null?void 0:T.find(M=>M.id===$);if(!P){console.warn("012",so.error012($));return}a.selectionRect.set(null),a.selectionRectMode.set(null),P.selected?P.selected&&Q(a.multiselectionKeyPressed)&&N({nodes:[P],edges:[]}):S([$])}function V($){const P=Q(a.viewport);return Gp({delta:$,panZoom:Q(a.panZoom),transform:[P.x,P.y,P.zoom],translateExtent:Q(a.translateExtent),width:Q(a.width),height:Q(a.height)})}const O=xe(Ia),z=$=>{O.set({...$})};function B(){O.set(Ia)}function k(){a.selectionRect.set(null),a.selectionRectMode.set(null),a.snapGrid.set(null),a.isValidConnection.set(()=>!0),N(),B()}return{...a,visibleEdges:T2(a),visibleNodes:M2(a),connection:ir([O,a.viewport],([$,P])=>$.inProgress?{...$,to:ni($.to,[P.x,P.y,P.zoom])}:{...$}),markers:ir([a.edges,a.defaultMarkerColor,a.flowId],([$,P,T])=>Yp($,{defaultColor:P,id:T})),initialized:(()=>{let $=!1;const P=Q(a.nodes).length,T=Q(a.edges).length;return ir([a.nodesInitialized,a.edgesInitialized,a.viewportInitialized],([M,H,I])=>$||(P===0?$=I:T===0?$=I&&M:$=I&&M&&H,$))})(),syncNodeStores:$=>$2(a.nodes,$),syncEdgeStores:$=>k2(a.edges,$),syncViewport:$=>E2(a.panZoom,a.viewport,$),setNodeTypes:l,setEdgeTypes:c,addEdge:u,updateNodePositions:g,updateNodeInternals:f,zoomIn:b,zoomOut:x,fitView:$=>h($),setMinZoom:C,setMaxZoom:m,setTranslateExtent:_,setPaneClickDistance:E,unselectNodesAndEdges:N,addSelectedNodes:S,addSelectedEdges:A,handleNodeSelection:L,panBy:V,updateConnection:z,cancelConnection:B,reset:k}}function tt(){const e=xr(ms);if(!e)throw new Error("In order to use useStore you need to wrap your component in a <SvelteFlowProvider />");return e.getStore()}function H2({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s}){const a=md({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s});return Wr(ms,{getStore:()=>a}),a}function Qa(e,t){const{panZoom:n,minZoom:r,maxZoom:o,initialViewport:i,viewport:s,dragging:a,translateExtent:l,paneClickDistance:c}=t,u=v2({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 D2=ie('<div class="svelte-flow__zoom svelte-4xkw84"><!></div>');const V2={hash:"svelte-4xkw84",code:".svelte-flow__zoom.svelte-4xkw84 {width:100%;height:100%;position:absolute;top:0;left:0;z-index:4;}"};function yd(e,t){fe(t,!1),ot(e,V2);const[n,r]=ct(),o=()=>oe(M,"$panActivationKeyPressed",n),i=()=>oe(B,"$minZoom",n),s=()=>oe(k,"$maxZoom",n),a=()=>oe(H,"$zoomActivationKeyPressed",n),l=()=>oe(z,"$selectionRect",n),c=()=>oe(P,"$translateExtent",n),u=()=>oe(T,"$lib",n),g=le(),f=le(),h=le();let v=w(t,"initialViewport",12,void 0),b=w(t,"onMoveStart",12,void 0),x=w(t,"onMove",12,void 0),C=w(t,"onMoveEnd",12,void 0),m=w(t,"panOnScrollMode",12),_=w(t,"preventScrolling",12),p=w(t,"zoomOnScroll",12),E=w(t,"zoomOnDoubleClick",12),N=w(t,"zoomOnPinch",12),S=w(t,"panOnDrag",12),A=w(t,"panOnScroll",12),L=w(t,"paneClickDistance",12);const{viewport:V,panZoom:O,selectionRect:z,minZoom:B,maxZoom:k,dragging:$,translateExtent:P,lib:T,panActivationKeyPressed:M,zoomActivationKeyPressed:H,viewportInitialized:I}=tt(),W=ee=>V.set({x:ee[0],y:ee[1],zoom:ee[2]});tn(()=>{Oi(I,!0)}),ve(()=>q(v()),()=>{te(g,v()||{x:0,y:0,zoom:1})}),ve(()=>(o(),q(S())),()=>{te(f,o()||S())}),ve(()=>(o(),q(A())),()=>{te(h,o()||A())}),Pt(),Be();var j=D2(),J=Y(j);Ot(J,t,"default",{}),F(j),Lt(j,(ee,ce)=>Qa==null?void 0:Qa(ee,ce),()=>({viewport:V,minZoom:i(),maxZoom:s(),initialViewport:d(g),dragging:$,panZoom:O,onPanZoomStart:b(),onPanZoom:x(),onPanZoomEnd:C(),zoomOnScroll:p(),zoomOnDoubleClick:E(),zoomOnPinch:N(),panOnScroll:d(h),panOnDrag:d(f),panOnScrollSpeed:.5,panOnScrollMode:m()||Zn.Free,zoomActivationKeyPressed:a(),preventScrolling:typeof _()=="boolean"?_():!0,noPanClassName:"nopan",noWheelClassName:"nowheel",userSelectionActive:!!l(),translateExtent:c(),lib:u(),paneClickDistance:L(),onTransformChange:W})),D(e,j);var ne=ge({get initialViewport(){return v()},set initialViewport(ee){v(ee),y()},get onMoveStart(){return b()},set onMoveStart(ee){b(ee),y()},get onMove(){return x()},set onMove(ee){x(ee),y()},get onMoveEnd(){return C()},set onMoveEnd(ee){C(ee),y()},get panOnScrollMode(){return m()},set panOnScrollMode(ee){m(ee),y()},get preventScrolling(){return _()},set preventScrolling(ee){_(ee),y()},get zoomOnScroll(){return p()},set zoomOnScroll(ee){p(ee),y()},get zoomOnDoubleClick(){return E()},set zoomOnDoubleClick(ee){E(ee),y()},get zoomOnPinch(){return N()},set zoomOnPinch(ee){N(ee),y()},get panOnDrag(){return S()},set panOnDrag(ee){S(ee),y()},get panOnScroll(){return A()},set panOnScroll(ee){A(ee),y()},get paneClickDistance(){return L()},set paneClickDistance(ee){L(ee),y()}});return r(),ne}ue(yd,{initialViewport:{},onMoveStart:{},onMove:{},onMoveEnd:{},panOnScrollMode:{},preventScrolling:{},zoomOnScroll:{},zoomOnDoubleClick:{},zoomOnPinch:{},panOnDrag:{},panOnScroll:{},paneClickDistance:{}},["default"],[],!0);function wd(e,t){return n=>{n.target===t&&(e==null||e(n))}}function _d(e){return t=>{const n=e.includes(t.id);return t.selected!==n&&(t.selected=n),t}}var A2=ie("<div><!></div>");const O2={hash:"svelte-1esy7hx",code:".svelte-flow__pane.svelte-1esy7hx {position:absolute;top:0;left:0;width:100%;height:100%;}"};function bd(e,t){fe(t,!1),ot(e,O2);const[n,r]=ct(),o=()=>oe($,"$panActivationKeyPressed",n),i=()=>oe(B,"$selectionKeyPressed",n),s=()=>oe(O,"$selectionRect",n),a=()=>oe(V,"$elementsSelectable",n),l=()=>oe(z,"$selectionRectMode",n),c=()=>oe(T,"$connection",n),u=()=>oe(S,"$edges",n),g=()=>oe(N,"$nodeLookup",n),f=()=>oe(A,"$viewport",n),h=()=>oe(k,"$selectionMode",n),v=()=>oe(L,"$dragging",n),b=le(),x=le(),C=le();let m=w(t,"panOnDrag",12,void 0),_=w(t,"selectionOnDrag",12,void 0);const p=Di(),{nodes:E,nodeLookup:N,edges:S,viewport:A,dragging:L,elementsSelectable:V,selectionRect:O,selectionRectMode:z,selectionKeyPressed:B,selectionMode:k,panActivationKeyPressed:$,unselectNodesAndEdges:P,connection:T}=tt();let M=le(),H=null,I=[],W=!1;function j(de){if(W||c().inProgress){W=!1;return}p("paneclick",{event:de}),P(),z.set(null)}function J(de){var X,ae;if(H=d(M).getBoundingClientRect(),!V||!d(x)||de.button!==0||de.target!==d(M)||!H)return;(ae=(X=de.target)==null?void 0:X.setPointerCapture)==null||ae.call(X,de.pointerId);const{x:U,y:se}=jn(de,H);P(),O.set({width:0,height:0,startX:U,startY:se,x:U,y:se})}function ne(de){if(!d(x)||!H||!s())return;W=!0;const U=jn(de,H),se=s().startX??0,X=s().startY??0,ae={...s(),x:U.x<se?U.x:se,y:U.y<X?U.y:X,width:Math.abs(U.x-se),height:Math.abs(U.y-X)},Me=I.map(me=>me.id),Ee=Ra(I,u()).map(me=>me.id);I=Pc(g(),ae,[f().x,f().y,f().zoom],h()===is.Partial,!0);const Fe=Ra(I,u()).map(me=>me.id),Oe=I.map(me=>me.id);(Me.length!==Oe.length||Oe.some(me=>!Me.includes(me)))&&E.update(me=>me.map(_d(Oe))),(Ee.length!==Fe.length||Fe.some(me=>!Ee.includes(me)))&&S.update(me=>me.map(_d(Fe))),z.set("user"),O.set(ae)}function ee(de){var U,se;de.button===0&&((se=(U=de.target)==null?void 0:U.releasePointerCapture)==null||se.call(U,de.pointerId),!d(x)&&l()==="user"&&de.target===d(M)&&(j==null||j(de)),O.set(null),I.length>0&&Oi(z,"nodes"),i()&&(W=!1))}const ce=de=>{var U;if(Array.isArray(d(b))&&((U=d(b))!=null&&U.includes(2))){de.preventDefault();return}p("panecontextmenu",{event:de})};ve(()=>(o(),q(m())),()=>{te(b,o()||m())}),ve(()=>(i(),s(),q(_()),d(b)),()=>{te(x,i()||s()||_()&&d(b)!==!0)}),ve(()=>(a(),d(x),l()),()=>{te(C,a()&&(d(x)||l()==="user"))}),Pt(),Be();var re=A2(),we=ke(()=>d(C)?void 0:wd(j,d(M))),Ne=ke(()=>wd(ce,d(M)));let Ae;var ye=Y(re);Ot(ye,t,"default",{}),F(re),_n(re,de=>te(M,de),()=>d(M)),Ve(de=>Ae=Nt(re,1,"svelte-flow__pane svelte-1esy7hx",null,Ae,de),[()=>({draggable:m()===!0||Array.isArray(m())&&m().includes(0),dragging:v(),selection:d(x)})]),dt("click",re,function(...de){var U;(U=d(we))==null||U.apply(this,de)}),dt("pointerdown",re,function(...de){var U;(U=d(C)?J:void 0)==null||U.apply(this,de)}),dt("pointermove",re,function(...de){var U;(U=d(C)?ne:void 0)==null||U.apply(this,de)}),dt("pointerup",re,function(...de){var U;(U=d(C)?ee:void 0)==null||U.apply(this,de)}),dt("contextmenu",re,function(...de){var U;(U=d(Ne))==null||U.apply(this,de)}),D(e,re);var be=ge({get panOnDrag(){return m()},set panOnDrag(de){m(de),y()},get selectionOnDrag(){return _()},set selectionOnDrag(de){_(de),y()}});return r(),be}ue(bd,{panOnDrag:{},selectionOnDrag:{}},["default"],[],!0);var L2=ie('<div class="svelte-flow__viewport xyflow__viewport svelte-1floaup"><!></div>');const I2={hash:"svelte-1floaup",code:".svelte-flow__viewport.svelte-1floaup {width:100%;height:100%;position:absolute;top:0;left:0;}"};function xd(e,t){fe(t,!1),ot(e,I2);const[n,r]=ct(),o=()=>oe(i,"$viewport",n),{viewport:i}=tt();Be();var s=L2(),a=Y(s);Ot(a,t,"default",{}),F(s),Ve(()=>mt(s,`transform: translate(${o().x??""}px, ${o().y??""}px) scale(${o().zoom??""})`)),D(e,s),ge(),r()}ue(xd,{},["default"],[],!0);function vo(e,t){const{store:n,onDrag:r,onDragStart:o,onDragStop:i,onNodeMouseDown:s}=t,a=e2({onDrag:r,onDragStart:o,onDragStop:i,onNodeMouseDown:s,getStoreItems:()=>{const c=Q(n.snapGrid),u=Q(n.viewport);return{nodes:Q(n.nodes),nodeLookup:Q(n.nodeLookup),edges:Q(n.edges),nodeExtent:Q(n.nodeExtent),snapGrid:c||[0,0],snapToGrid:!!c,nodeOrigin:Q(n.nodeOrigin),multiSelectionActive:Q(n.multiselectionKeyPressed),domNode:Q(n.domNode),transform:[u.x,u.y,u.zoom],autoPanOnNodeDrag:Q(n.autoPanOnNodeDrag),nodesDraggable:Q(n.nodesDraggable),selectNodesOnDrag:Q(n.selectNodesOnDrag),nodeDragThreshold:Q(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 z2({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 R2=ie("<div><!></div>");function Cd(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(re,"$nodeTypes",n),i=()=>oe(be,"$elementsSelectable",n),s=()=>oe(de,"$nodesDraggable",n),a=()=>oe(ae,"$connectableStore",n),l=le(void 0,!0),c=le(void 0,!0),u=le(void 0,!0),g=le(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),x=w(t,"draggable",13,void 0),C=w(t,"selectable",13,void 0),m=w(t,"connectable",13,!0),_=w(t,"deletable",13,!0),p=w(t,"hidden",13,!1),E=w(t,"dragging",13,!1),N=w(t,"resizeObserver",13,null),S=w(t,"style",13,void 0),A=w(t,"type",13,"default"),L=w(t,"isParent",13,!1),V=w(t,"positionX",13),O=w(t,"positionY",13),z=w(t,"sourcePosition",13,void 0),B=w(t,"targetPosition",13,void 0),k=w(t,"zIndex",13),$=w(t,"measuredWidth",13,void 0),P=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),I=w(t,"height",13,void 0),W=w(t,"dragHandle",13,void 0),j=w(t,"initialized",13,!1),J=w(t,"parentId",13,void 0),ne=w(t,"nodeClickDistance",13,void 0),ee=w(t,"class",13,"");const ce=tt(),{nodeTypes:re,nodeDragThreshold:we,selectNodesOnDrag:Ne,handleNodeSelection:Ae,updateNodeInternals:ye,elementsSelectable:be,nodesDraggable:de}=ce;let U=le(void 0,!0),se=le(null,!0);const X=Di(),ae=xe(m());let Me=le(void 0,!0),Ee=le(void 0,!0),Fe=le(void 0,!0);Wr("svelteflow__node_id",h()),Wr("svelteflow__node_connectable",ae),ca(()=>{var K;d(se)&&((K=N())==null||K.unobserve(d(se)))});function Oe(K){C()&&(!Q(Ne)||!x()||Q(we)>0)&&Ae(h()),X("nodeclick",{node:f().internals.userNode,event:K})}ve(()=>q(A()),()=>{te(l,A()||"default")}),ve(()=>(o(),d(l)),()=>{te(c,!!o()[d(l)])}),ve(()=>(o(),d(l),vs),()=>{te(u,o()[d(l)]||vs)}),ve(()=>(d(c),q(A())),()=>{d(c)||console.warn("003",so.error003(A()))}),ve(()=>(q(H()),q(I()),q(T()),q(M()),q($()),q(P())),()=>{te(g,z2({width:H(),height:I(),initialWidth:T(),initialHeight:M(),measuredWidth:$(),measuredHeight:P()}))}),ve(()=>q(m()),()=>{ae.set(!!m())}),ve(()=>(d(Me),d(l),d(Ee),q(z()),d(Fe),q(B()),q(h()),d(U)),()=>{(d(Me)&&d(l)!==d(Me)||d(Ee)&&z()!==d(Ee)||d(Fe)&&B()!==d(Fe))&&requestAnimationFrame(()=>ye(new Map([[h(),{id:h(),nodeElement:d(U),force:!0}]]))),te(Me,d(l)),te(Ee,z()),te(Fe,B())}),ve(()=>(q(N()),d(U),d(se),q(j())),()=>{N()&&(d(U)!==d(se)||!j())&&(d(se)&&N().unobserve(d(se)),d(U)&&N().observe(d(U)),te(se,d(U)))}),Pt(),Be(!0);var me=qe(),ze=he(me);{var Ue=K=>{var Ge=R2();let Qe,gt;var sn=Y(Ge);{let nt=De(()=>b()??!1),$e=De(()=>C()??i()??!0),Xe=De(()=>_()??!0),Le=De(()=>x()??s()??!0);yu(sn,()=>d(u),(Ht,kt)=>{kt(Ht,{get data(){return v()},get id(){return h()},get selected(){return d(nt)},get selectable(){return d($e)},get deletable(){return d(Xe)},get sourcePosition(){return z()},get targetPosition(){return B()},get zIndex(){return k()},get dragging(){return E()},get draggable(){return d(Le)},get dragHandle(){return W()},get parentId(){return J()},get type(){return d(l)},get isConnectable(){return a()},get positionAbsoluteX(){return V()},get positionAbsoluteY(){return O()},get width(){return H()},get height(){return I()}})})}F(Ge),Lt(Ge,(nt,$e)=>vo==null?void 0:vo(nt,$e),()=>({nodeId:h(),isSelectable:C(),disabled:!1,handleSelector:W(),noDragClass:"nodrag",nodeClickDistance:ne(),onNodeMouseDown:Ae,onDrag:(nt,$e,Xe,Le)=>{X("nodedrag",{event:nt,targetNode:Xe,nodes:Le})},onDragStart:(nt,$e,Xe,Le)=>{X("nodedragstart",{event:nt,targetNode:Xe,nodes:Le})},onDragStop:(nt,$e,Xe,Le)=>{X("nodedragstop",{event:nt,targetNode:Xe,nodes:Le})},store:ce})),_n(Ge,nt=>te(U,nt),()=>d(U)),Qt(()=>dt("click",Ge,Oe)),Qt(()=>dt("mouseenter",Ge,nt=>X("nodemouseenter",{node:f(),event:nt}))),Qt(()=>dt("mouseleave",Ge,nt=>X("nodemouseleave",{node:f(),event:nt}))),Qt(()=>dt("mousemove",Ge,nt=>X("nodemousemove",{node:f(),event:nt}))),Qt(()=>dt("contextmenu",Ge,nt=>X("nodecontextmenu",{node:f(),event:nt}))),Ve((nt,$e,Xe)=>{_e(Ge,"data-id",h()),Qe=Nt(Ge,1,nt,null,Qe,$e),gt=mt(Ge,`${S()??""??""};${d(g),G(()=>d(g).width)??""}${d(g),G(()=>d(g).height)??""}`,gt,Xe)},[()=>wn((q(ut),d(l),q(ee()),G(()=>ut(["svelte-flow__node",`svelte-flow__node-${d(l)}`,ee()])))),()=>({dragging:E(),selected:b(),draggable:x(),connectable:m(),selectable:C(),nopan:x(),parent:L()}),()=>({"z-index":k(),transform:`translate(${V()??""}px, ${O()??""}px)`,visibility:j()?"visible":"hidden"})]),D(K,Ge)};pe(ze,K=>{p()||K(Ue)})}D(e,me);var at=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 x()},set draggable(K){x(K),y()},get selectable(){return C()},set selectable(K){C(K),y()},get connectable(){return m()},set connectable(K){m(K),y()},get deletable(){return _()},set deletable(K){_(K),y()},get hidden(){return p()},set hidden(K){p(K),y()},get dragging(){return E()},set dragging(K){E(K),y()},get resizeObserver(){return N()},set resizeObserver(K){N(K),y()},get style(){return S()},set style(K){S(K),y()},get type(){return A()},set type(K){A(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 O()},set positionY(K){O(K),y()},get sourcePosition(){return z()},set sourcePosition(K){z(K),y()},get targetPosition(){return B()},set targetPosition(K){B(K),y()},get zIndex(){return k()},set zIndex(K){k(K),y()},get measuredWidth(){return $()},set measuredWidth(K){$(K),y()},get measuredHeight(){return P()},set measuredHeight(K){P(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 I()},set height(K){I(K),y()},get dragHandle(){return W()},set dragHandle(K){W(K),y()},get initialized(){return j()},set initialized(K){j(K),y()},get parentId(){return J()},set parentId(K){J(K),y()},get nodeClickDistance(){return ne()},set nodeClickDistance(K){ne(K),y()},get class(){return ee()},set class(K){ee(K),y()}});return r(),at}ue(Cd,{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 B2=ie('<div class="svelte-flow__nodes svelte-tf4uy4"></div>');const F2={hash:"svelte-tf4uy4",code:".svelte-flow__nodes.svelte-tf4uy4 {width:100%;height:100%;position:absolute;left:0;top:0;}"};function $d(e,t){fe(t,!1),ot(e,F2);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}=tt(),x=typeof ResizeObserver>"u"?null:new ResizeObserver(_=>{const p=new Map;_.forEach(E=>{const N=E.target.getAttribute("data-id");p.set(N,{id:N,nodeElement:E.target,force:!0})}),v(p)});ca(()=>{x==null||x.disconnect()}),Be();var C=B2();At(C,5,o,_=>_.id,(_,p)=>{{let E=De(()=>(d(p),G(()=>!!d(p).selected))),N=De(()=>(d(p),G(()=>!!d(p).hidden))),S=De(()=>(d(p),i(),G(()=>!!(d(p).draggable||i()&&typeof d(p).draggable>"u")))),A=De(()=>(d(p),s(),G(()=>!!(d(p).selectable||s()&&typeof d(p).selectable>"u")))),L=De(()=>(d(p),a(),G(()=>!!(d(p).connectable||a()&&typeof d(p).connectable>"u")))),V=De(()=>(d(p),G(()=>d(p).deletable??!0))),O=De(()=>(l(),d(p),G(()=>l().has(d(p).id)))),z=De(()=>(d(p),G(()=>d(p).type??"default"))),B=De(()=>(d(p),G(()=>d(p).internals.z??0))),k=De(()=>(q(ds),d(p),G(()=>ds(d(p)))));Cd(_,{get node(){return d(p)},get id(){return d(p),G(()=>d(p).id)},get data(){return d(p),G(()=>d(p).data)},get selected(){return d(E)},get hidden(){return d(N)},get draggable(){return d(S)},get selectable(){return d(A)},get connectable(){return d(L)},get deletable(){return d(V)},get positionX(){return d(p),G(()=>d(p).internals.positionAbsolute.x)},get positionY(){return d(p),G(()=>d(p).internals.positionAbsolute.y)},get isParent(){return d(O)},get style(){return d(p),G(()=>d(p).style)},get class(){return d(p),G(()=>d(p).class)},get type(){return d(z)},get sourcePosition(){return d(p),G(()=>d(p).sourcePosition)},get targetPosition(){return d(p),G(()=>d(p).targetPosition)},get dragging(){return d(p),G(()=>d(p).dragging)},get zIndex(){return d(B)},get dragHandle(){return d(p),G(()=>d(p).dragHandle)},get initialized(){return d(k)},get width(){return d(p),G(()=>d(p).width)},get height(){return d(p),G(()=>d(p).height)},get initialWidth(){return d(p),G(()=>d(p).initialWidth)},get initialHeight(){return d(p),G(()=>d(p).initialHeight)},get measuredWidth(){return d(p),G(()=>d(p).measured.width)},get measuredHeight(){return d(p),G(()=>d(p).measured.height)},get parentId(){return d(p),G(()=>d(p).parentId)},get resizeObserver(){return x},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,$)}}})}}),F(C),D(e,C);var m=ge({get nodeClickDistance(){return c()},set nodeClickDistance(_){c(_),y()}});return r(),m}ue($d,{nodeClickDistance:{}},[],[],!0);var Y2=Ce('<svg><g role="img"><!></g></svg>');function kd(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(ee,"$edgeTypes",n),i=()=>oe(ce,"$flowId",n),s=()=>oe(re,"$elementsSelectable",n),a=()=>oe(ne,"$edgeLookup",n),l=le(void 0,!0),c=le(void 0,!0),u=le(void 0,!0),g=le(void 0,!0),f=le(void 0,!0);let h=w(t,"id",13),v=w(t,"type",13,"default"),b=w(t,"source",13,""),x=w(t,"target",13,""),C=w(t,"data",29,()=>({})),m=w(t,"style",13,void 0),_=w(t,"zIndex",13,void 0),p=w(t,"animated",13,!1),E=w(t,"selected",13,!1),N=w(t,"selectable",13,void 0),S=w(t,"deletable",13,void 0),A=w(t,"hidden",13,!1),L=w(t,"label",13,void 0),V=w(t,"labelStyle",13,void 0),O=w(t,"markerStart",13,void 0),z=w(t,"markerEnd",13,void 0),B=w(t,"sourceHandle",13,void 0),k=w(t,"targetHandle",13,void 0),$=w(t,"sourceX",13),P=w(t,"sourceY",13),T=w(t,"targetX",13),M=w(t,"targetY",13),H=w(t,"sourcePosition",13),I=w(t,"targetPosition",13),W=w(t,"ariaLabel",13,void 0),j=w(t,"interactionWidth",13,void 0),J=w(t,"class",13,"");Wr("svelteflow__edge_id",h());const{edgeLookup:ne,edgeTypes:ee,flowId:ce,elementsSelectable:re}=tt(),we=Di(),Ne=cd();function Ae(X){const ae=a().get(h());ae&&(Ne(h()),we("edgeclick",{event:X,edge:ae}))}function ye(X,ae){const Me=a().get(h());Me&&we(ae,{event:X,edge:Me})}ve(()=>q(v()),()=>{te(l,v()||"default")}),ve(()=>(o(),d(l),ps),()=>{te(c,o()[d(l)]||ps)}),ve(()=>(q(O()),i()),()=>{te(u,O()?`url('#${Wa(O(),i())}')`:void 0)}),ve(()=>(q(z()),i()),()=>{te(g,z()?`url('#${Wa(z(),i())}')`:void 0)}),ve(()=>(q(N()),s()),()=>{te(f,N()??s())}),Pt(),Be(!0);var be=qe(),de=he(be);{var U=X=>{var ae=Y2();let Me;var Ee=Y(ae);let Fe;var Oe=Y(Ee);{let me=De(()=>S()??!0);yu(Oe,()=>d(c),(ze,Ue)=>{Ue(ze,{get id(){return h()},get source(){return b()},get target(){return x()},get sourceX(){return $()},get sourceY(){return P()},get targetX(){return T()},get targetY(){return M()},get sourcePosition(){return H()},get targetPosition(){return I()},get animated(){return p()},get selected(){return E()},get label(){return L()},get labelStyle(){return V()},get data(){return C()},get style(){return m()},get interactionWidth(){return j()},get selectable(){return d(f)},get deletable(){return d(me)},get type(){return d(l)},get sourceHandleId(){return B()},get targetHandleId(){return k()},get markerStart(){return d(u)},get markerEnd(){return d(g)}})})}F(Ee),F(ae),Ve((me,ze,Ue)=>{Me=mt(ae,"",Me,me),Fe=Nt(Ee,0,ze,null,Fe,Ue),_e(Ee,"data-id",h()),_e(Ee,"aria-label",W()===null?void 0:W()?W():`Edge from ${b()} to ${x()}`)},[()=>({"z-index":_()}),()=>wn((q(ut),q(J()),G(()=>ut(["svelte-flow__edge",J()])))),()=>({animated:p(),selected:E(),selectable:d(f)})]),dt("click",Ee,Ae),dt("contextmenu",Ee,me=>{ye(me,"edgecontextmenu")}),dt("mouseenter",Ee,me=>{ye(me,"edgemouseenter")}),dt("mouseleave",Ee,me=>{ye(me,"edgemouseleave")}),D(X,ae)};pe(de,X=>{A()||X(U)})}D(e,be);var se=ge({get id(){return h()},set id(X){h(X),y()},get type(){return v()},set type(X){v(X),y()},get source(){return b()},set source(X){b(X),y()},get target(){return x()},set target(X){x(X),y()},get data(){return C()},set data(X){C(X),y()},get style(){return m()},set style(X){m(X),y()},get zIndex(){return _()},set zIndex(X){_(X),y()},get animated(){return p()},set animated(X){p(X),y()},get selected(){return E()},set selected(X){E(X),y()},get selectable(){return N()},set selectable(X){N(X),y()},get deletable(){return S()},set deletable(X){S(X),y()},get hidden(){return A()},set hidden(X){A(X),y()},get label(){return L()},set label(X){L(X),y()},get labelStyle(){return V()},set labelStyle(X){V(X),y()},get markerStart(){return O()},set markerStart(X){O(X),y()},get markerEnd(){return z()},set markerEnd(X){z(X),y()},get sourceHandle(){return B()},set sourceHandle(X){B(X),y()},get targetHandle(){return k()},set targetHandle(X){k(X),y()},get sourceX(){return $()},set sourceX(X){$(X),y()},get sourceY(){return P()},set sourceY(X){P(X),y()},get targetX(){return T()},set targetX(X){T(X),y()},get targetY(){return M()},set targetY(X){M(X),y()},get sourcePosition(){return H()},set sourcePosition(X){H(X),y()},get targetPosition(){return I()},set targetPosition(X){I(X),y()},get ariaLabel(){return W()},set ariaLabel(X){W(X),y()},get interactionWidth(){return j()},set interactionWidth(X){j(X),y()},get class(){return J()},set class(X){J(X),y()}});return r(),se}ue(kd,{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 Ed(e,t){fe(t,!1);let n=w(t,"onMount",12,void 0),r=w(t,"onDestroy",12,void 0);return tn(()=>{var o;return(o=n())==null||o(),r()}),Be(),ge({get onMount(){return n()},set onMount(o){n(o),y()},get onDestroy(){return r()},set onDestroy(o){r(o),y()}})}ue(Ed,{onMount:{},onDestroy:{}},[],[],!0);var q2=Ce("<defs></defs>");function Sd(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(i,"$markers",n),{markers:i}=tt();Be();var s=q2();At(s,5,o,a=>a.id,(a,l)=>{Pd(a,vt(()=>d(l)))}),F(s),D(e,s),ge(),r()}ue(Sd,{},[],[],!0);var X2=Ce('<polyline stroke-linecap="round" stroke-linejoin="round" fill="none" points="-5,-4 0,0 -5,4"></polyline>'),W2=Ce('<polyline stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>'),Z2=Ce('<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>');function Pd(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);Be();var u=Z2(),g=Y(u);{var f=v=>{var b=X2();Ve(()=>{_e(b,"stroke",l()),_e(b,"stroke-width",c())}),D(v,b)},h=v=>{var b=qe(),x=he(b);{var C=m=>{var _=W2();Ve(()=>{_e(_,"stroke",l()),_e(_,"stroke-width",c()),_e(_,"fill",l())}),D(m,_)};pe(x,m=>{q(r()),q(Ar),G(()=>r()===Ar.ArrowClosed)&&m(C)},!0)}D(v,b)};pe(g,v=>{q(r()),q(Ar),G(()=>r()===Ar.Arrow)?v(f):v(h,!1)})}return F(u),Ve(()=>{_e(u,"id",n()),_e(u,"markerWidth",`${o()}`),_e(u,"markerHeight",`${i()}`),_e(u,"markerUnits",s()),_e(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()}})}ue(Pd,{id:{},type:{},width:{},height:{},markerUnits:{},orient:{},color:{},strokeWidth:{}},[],[],!0);var K2=ie('<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!> <!></div>');function Nd(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}=tt();tn(()=>{s()&&c(s())}),Be();var g=K2(),f=Y(g),h=Y(f);Sd(h,{}),F(f);var v=R(f,2);At(v,1,o,m=>m.id,(m,_)=>{{let p=De(()=>(d(_),i(),G(()=>d(_).selectable??i()))),E=De(()=>(d(_),G(()=>d(_).type||"default")));kd(m,{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(p)},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(E)},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=R(v,2);{var x=m=>{Ed(m,{onMount:()=>{Oi(l,!0)},onDestroy:()=>{Oi(l,!1)}})};pe(b,m=>{o(),G(()=>o().length>0)&&m(x)})}F(g),D(e,g);var C=ge({get defaultEdgeOptions(){return s()},set defaultEdgeOptions(m){s(m),y()}});return r(),C}ue(Nd,{defaultEdgeOptions:{}},[],[],!0);var j2=ie('<div class="svelte-flow__selection svelte-1iugwpu"></div>');const U2={hash:"svelte-1iugwpu",code:".svelte-flow__selection.svelte-1iugwpu {position:absolute;top:0;left:0;}"};function el(e,t){fe(t,!1),ot(e,U2);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=qe(),l=he(a);{var c=u=>{var g=j2();let f;Ve(h=>f=mt(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)};pe(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()}})}ue(el,{x:{},y:{},width:{},height:{},isVisible:{}},[],[],!0);function Td(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(s,"$selectionRect",n),i=()=>oe(a,"$selectionRectMode",n),{selectionRect:s,selectionRectMode:a}=tt();Be();{let l=De(()=>!!(o()&&i()==="user")),c=De(()=>{var h;return(h=o())==null?void 0:h.width}),u=De(()=>{var h;return(h=o())==null?void 0:h.height}),g=De(()=>{var h;return(h=o())==null?void 0:h.x}),f=De(()=>{var h;return(h=o())==null?void 0:h.y});el(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()}ue(Td,{},[],[],!0);var G2=ie('<div class="selection-wrapper nopan svelte-5pxri" role="button" tabindex="-1"><!></div>');const J2={hash:"svelte-5pxri",code:".selection-wrapper.svelte-5pxri {position:absolute;top:0;left:0;z-index:7;pointer-events:all;}"};function Md(e,t){fe(t,!1),ot(e,J2);const[n,r]=ct(),o=()=>oe(l,"$selectionRectMode",n),i=()=>oe(u,"$nodeLookup",n),s=()=>oe(c,"$nodes",n),a=tt(),{selectionRectMode:l,nodes:c,nodeLookup:u}=a,g=Di();let f=le(null);function h(m){const _=s().filter(p=>p.selected);g("selectioncontextmenu",{nodes:_,event:m})}function v(m){const _=s().filter(p=>p.selected);g("selectionclick",{nodes:_,event:m})}ve(()=>(o(),i(),s()),()=>{o()==="nodes"&&(te(f,ei(i(),{filter:m=>!!m.selected})),s())}),Pt(),Be();var b=qe(),x=he(b);{var C=m=>{var _=G2(),p=Y(_);el(p,{width:"100%",height:"100%",x:0,y:0}),F(_),Lt(_,(E,N)=>vo==null?void 0:vo(E,N),()=>({disabled:!1,store:a,onDrag:(E,N,S,A)=>{g("nodedrag",{event:E,targetNode:null,nodes:A})},onDragStart:(E,N,S,A)=>{g("nodedragstart",{event:E,targetNode:null,nodes:A})},onDragStop:(E,N,S,A)=>{g("nodedragstop",{event:E,targetNode:null,nodes:A})}})),Qt(()=>dt("contextmenu",_,h)),Qt(()=>dt("click",_,v)),Qt(()=>dt("keyup",_,()=>{})),Ve(()=>mt(_,`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(m,_)};pe(x,m=>{o(),d(f),q(Ln),G(()=>o()==="nodes"&&d(f)&&Ln(d(f).x)&&Ln(d(f).y))&&m(C)})}D(e,b),ge(),r()}ue(Md,{},[],[],!0);function it(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(m=>typeof m=="string"?[m]:m).some(m=>m.every(_=>l[_])))continue;if(s.key===f){v&&s.preventDefault();const x={node:e,trigger:u,originalEvent:s};e.dispatchEvent(new CustomEvent("shortcut",{detail:x})),h==null||h(x)}}}}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 Hd(e,t){fe(t,!1);let n=w(t,"selectionKey",12,"Shift"),r=w(t,"multiSelectionKey",28,()=>cs()?"Meta":"Control"),o=w(t,"deleteKey",12,"Backspace"),i=w(t,"panActivationKey",12," "),s=w(t,"zoomActivationKey",28,()=>cs()?"Meta":"Control");const{selectionKeyPressed:a,multiselectionKeyPressed:l,deleteKeyPressed:c,panActivationKeyPressed:u,zoomActivationKeyPressed:g,selectionRect:f}=tt();function h(m){return m!==null&&typeof m=="object"}function v(m){return h(m)?m.modifier||[]:[]}function b(m){return m==null?"":h(m)?m.key:m}function x(m,_){return(Array.isArray(m)?m:[m]).map(E=>{const N=b(E);return{key:N,modifier:v(E),enabled:N!==null,callback:_}})}function C(){f.set(null),a.set(!1),l.set(!1),c.set(!1),u.set(!1),g.set(!1)}return Be(),dt("blur",Wt,C),dt("contextmenu",Wt,C),Lt(Wt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:x(n(),()=>a.set(!0)),type:"keydown"})),Lt(Wt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:x(n(),()=>a.set(!1)),type:"keyup"})),Lt(Wt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:x(r(),()=>l.set(!0)),type:"keydown"})),Lt(Wt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:x(r(),()=>l.set(!1)),type:"keyup"})),Lt(Wt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:x(o(),m=>{!(m.originalEvent.ctrlKey||m.originalEvent.metaKey||m.originalEvent.shiftKey)&&!Hp(m.originalEvent)&&c.set(!0)}),type:"keydown"})),Lt(Wt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:x(o(),()=>c.set(!1)),type:"keyup"})),Lt(Wt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:x(i(),()=>u.set(!0)),type:"keydown"})),Lt(Wt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:x(i(),()=>u.set(!1)),type:"keyup"})),Lt(Wt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:x(s(),()=>g.set(!0)),type:"keydown"})),Lt(Wt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:x(s(),()=>g.set(!1)),type:"keyup"})),ge({get selectionKey(){return n()},set selectionKey(m){n(m),y()},get multiSelectionKey(){return r()},set multiSelectionKey(m){r(m),y()},get deleteKey(){return o()},set deleteKey(m){o(m),y()},get panActivationKey(){return i()},set panActivationKey(m){i(m),y()},get zoomActivationKey(){return s()},set zoomActivationKey(m){s(m),y()}})}ue(Hd,{selectionKey:{},multiSelectionKey:{},deleteKey:{},panActivationKey:{},zoomActivationKey:{}},[],[],!0);var Q2=Ce('<path fill="none" class="svelte-flow__connection-path"></path>'),em=Ce('<svg class="svelte-flow__connectionline"><g><!><!></g></svg>');function Dd(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}=tt();let b=le(null);ve(()=>(o(),q(u()),i(),d(b),Xa),()=>{if(o().inProgress&&!u()){const{from:p,to:E,fromPosition:N,toPosition:S}=o(),A={sourceX:p.x,sourceY:p.y,sourcePosition:N,targetX:E.x,targetY:E.y,targetPosition:S};switch(i()){case ao.Bezier:(L=>{var V=er(L,1);te(b,V[0])})(zc(A));break;case ao.Step:(L=>{var V=er(L,1);te(b,V[0])})(gs({...A,borderRadius:0}));break;case ao.SmoothStep:(L=>{var V=er(L,1);te(b,V[0])})(gs(A));break;default:(L=>{var V=er(L,1);te(b,V[0])})(Xa(A))}}}),Pt(),Be();var x=qe(),C=he(x);{var m=p=>{var E=em(),N=Y(E),S=Y(N);Ot(S,t,"connectionLine",{});var A=R(S);{var L=V=>{var O=Q2();Ve(()=>{_e(O,"d",d(b)),mt(O,c())}),D(V,O)};pe(A,V=>{u()||V(L)})}F(N),F(E),Ve(V=>{_e(E,"width",s()),_e(E,"height",a()),mt(E,l()),Nt(N,0,V)},[()=>wn((q(ut),q(Sc),o(),G(()=>ut(["svelte-flow__connection",Sc(o().isValid)]))))]),D(p,E)};pe(C,p=>{o(),G(()=>o().inProgress)&&p(m)})}D(e,x);var _=ge({get containerStyle(){return l()},set containerStyle(p){l(p),y()},get style(){return c()},set style(p){c(p),y()},get isCustomComponent(){return u()},set isCustomComponent(p){u(p),y()}});return r(),_}ue(Dd,{containerStyle:{},style:{},isCustomComponent:{}},["connectionLine"],[],!0);var tm=ie("<div><!></div>");function ii(e,t){const n=ht(t,["children","$$slots","$$events","$$legacy","$$host"]),r=ht(n,["position","style","class"]);fe(t,!1);const[o,i]=ct(),s=()=>oe(g,"$selectionRectMode",o),a=le();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}=tt();ve(()=>q(l()),()=>{te(a,`${l()}`.split("-"))}),Pt(),Be();var f=tm();nn(f,(b,x)=>({class:b,style:c(),...r,[Nr]:x}),[()=>(q(ut),q(u()),d(a),G(()=>ut(["svelte-flow__panel",u(),...d(a)]))),()=>({"pointer-events":s()?"none":""})]);var h=Y(f);Ot(h,t,"default",{}),F(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}ue(ii,{position:{},style:{},class:{}},["default"],[],!0);var nm=ie('<a href="https://svelteflow.dev" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>');function Vd(e,t){fe(t,!1);let n=w(t,"proOptions",12,void 0),r=w(t,"position",12,"bottom-right");Be();var o=qe(),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=nm();D(l,u)},$$slots:{default:!0}})};pe(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()}})}ue(Vd,{proOptions:{},position:{}},[],[],!0);function Ad(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 rm=e=>Object.keys(e);function Od(e,t){rm(t).forEach(n=>{const r=t[n];r!==void 0&&e[n].set(r)})}function om(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function im(e="light"){return fn("light",n=>{if(e!=="system"){n(e);return}const r=om(),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 sm=ie('<!> <!> <div class="svelte-flow__edgelabel-renderer"></div> <div class="svelte-flow__viewport-portal"></div> <!> <!>',1),am=ie("<!> <!>",1),lm=ie("<div><!> <!> <!> <!></div>");const um={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 Ld(e,t){const n=bg(t),r=ht(t,["children","$$slots","$$events","$$legacy","$$host"]),o=ht(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),ot(e,um);const[i,s]=ct(),a=()=>oe(_(),"$viewport",i),l=()=>oe(pl,"$initialized",i),c=()=>oe(d(u),"$colorModeClass",i),u=le();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),x=w(t,"minZoom",12,void 0),C=w(t,"maxZoom",12,void 0),m=w(t,"initialViewport",12,void 0),_=w(t,"viewport",12,void 0),p=w(t,"nodeTypes",12,void 0),E=w(t,"edgeTypes",12,void 0),N=w(t,"selectionKey",12,void 0),S=w(t,"selectionMode",12,void 0),A=w(t,"panActivationKey",12,void 0),L=w(t,"multiSelectionKey",12,void 0),V=w(t,"zoomActivationKey",12,void 0),O=w(t,"nodesDraggable",12,void 0),z=w(t,"nodesConnectable",12,void 0),B=w(t,"nodeDragThreshold",12,void 0),k=w(t,"elementsSelectable",12,void 0),$=w(t,"snapGrid",12,void 0),P=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,()=>Vr.Strict),I=w(t,"connectionLineStyle",12,""),W=w(t,"connectionLineContainerStyle",12,""),j=w(t,"onMoveStart",12,void 0),J=w(t,"onMove",12,void 0),ne=w(t,"onMoveEnd",12,void 0),ee=w(t,"isValidConnection",12,void 0),ce=w(t,"translateExtent",12,void 0),re=w(t,"nodeExtent",12,void 0),we=w(t,"onlyRenderVisibleElements",12,void 0),Ne=w(t,"panOnScrollMode",28,()=>Zn.Free),Ae=w(t,"preventScrolling",12,!0),ye=w(t,"zoomOnScroll",12,!0),be=w(t,"zoomOnDoubleClick",12,!0),de=w(t,"zoomOnPinch",12,!0),U=w(t,"panOnScroll",12,!1),se=w(t,"panOnDrag",12,!0),X=w(t,"selectionOnDrag",12,void 0),ae=w(t,"autoPanOnConnect",12,!0),Me=w(t,"autoPanOnNodeDrag",12,!0),Ee=w(t,"onerror",12,void 0),Fe=w(t,"ondelete",12,void 0),Oe=w(t,"onedgecreate",12,void 0),me=w(t,"attributionPosition",12,void 0),ze=w(t,"proOptions",12,void 0),Ue=w(t,"defaultEdgeOptions",12,void 0),at=w(t,"width",12,void 0),K=w(t,"height",12,void 0),Ge=w(t,"colorMode",12,"light"),Qe=w(t,"onconnect",12,void 0),gt=w(t,"onconnectstart",12,void 0),sn=w(t,"onconnectend",12,void 0),nt=w(t,"onbeforedelete",12,void 0),$e=w(t,"oninit",12,void 0),Xe=w(t,"nodeOrigin",12,void 0),Le=w(t,"paneClickDistance",12,0),Ht=w(t,"nodeClickDistance",12,0),kt=w(t,"defaultMarkerColor",12,"#b1b1b7"),pi=w(t,"style",12,void 0),Fr=w(t,"class",12,void 0),mi=le(),Dt=le(),qt=le();const ko=a()||m(),et=V1(ms)?tt():H2({nodes:Q(f()),edges:Q(h()),width:at(),height:K(),fitView:v(),nodeOrigin:Xe(),nodeExtent:re()});tn(()=>(et.width.set(d(Dt)),et.height.set(d(qt)),et.domNode.set(d(mi)),et.syncNodeStores(f()),et.syncEdgeStores(h()),et.syncViewport(_()),v()!==void 0&&et.fitViewQueued.set(v()),b()&&et.fitViewOptions.set(b()),Ad(et,{nodeTypes:p(),edgeTypes:E(),minZoom:x(),maxZoom:C(),translateExtent:ce(),paneClickDistance:Le()}),()=>{et.reset()}));const{initialized:pl}=et;let yi=le(!1);ve(()=>(d(Dt),d(qt)),()=>{d(Dt)!==void 0&&d(qt)!==void 0&&(et.width.set(d(Dt)),et.height.set(d(qt)))}),ve(()=>(d(yi),l(),q($e())),()=>{var Z;!d(yi)&&l()&&((Z=$e())==null||Z(),te(yi,!0))}),ve(()=>(q(g()),q(M()),q(T()),q(S()),q($()),q(kt()),q(O()),q(z()),q(k()),q(we()),q(ee()),q(ae()),q(Me()),q(Ee()),q(Fe()),q(Oe()),q(H()),q(B()),q(Qe()),q(gt()),q(sn()),q(nt()),q(Xe()),Od),()=>{const Z={flowId:g(),connectionLineType:M(),connectionRadius:T(),selectionMode:S(),snapGrid:$(),defaultMarkerColor:kt(),nodesDraggable:O(),nodesConnectable:z(),elementsSelectable:k(),onlyRenderVisibleElements:we(),isValidConnection:ee(),autoPanOnConnect:ae(),autoPanOnNodeDrag:Me(),onerror:Ee(),ondelete:Fe(),onedgecreate:Oe(),connectionMode:H(),nodeDragThreshold:B(),onconnect:Qe(),onconnectstart:gt(),onconnectend:sn(),onbeforedelete:nt(),nodeOrigin:Xe()};Od(et,Z)}),ve(()=>(q(p()),q(E()),q(x()),q(C()),q(ce()),q(Le())),()=>{Ad(et,{nodeTypes:p(),edgeTypes:E(),minZoom:x(),maxZoom:C(),translateExtent:ce(),paneClickDistance:Le()})}),ve(()=>q(Ge()),()=>{Dg(te(u,im(Ge())),"$colorModeClass",i)}),Pt(),Be();var an=lm();nn(an,Z=>({style:pi(),class:Z,"data-testid":"svelte-flow__wrapper",...o,role:"application"}),[()=>(q(ut),q(Fr()),c(),G(()=>ut(["svelte-flow",Fr(),c()])))],void 0,"svelte-18e9ir1");var Hs=Y(an);Hd(Hs,{get selectionKey(){return N()},get deleteKey(){return P()},get panActivationKey(){return A()},get multiSelectionKey(){return L()},get zoomActivationKey(){return V()}});var Ds=R(Hs,2);{let Z=De(()=>(q(Ne()),q(Zn),G(()=>Ne()===void 0?Zn.Free:Ne()))),ub=De(()=>Ae()===void 0?!0:Ae()),cb=De(()=>ye()===void 0?!0:ye()),db=De(()=>be()===void 0?!0:be()),fb=De(()=>de()===void 0?!0:de()),gb=De(()=>U()===void 0?!1:U()),hb=De(()=>se()===void 0?!0:se()),vb=De(()=>Le()===void 0?0:Le());yd(Ds,{get initialViewport(){return ko},get onMoveStart(){return j()},get onMove(){return J()},get onMoveEnd(){return ne()},get panOnScrollMode(){return d(Z)},get preventScrolling(){return d(ub)},get zoomOnScroll(){return d(cb)},get zoomOnDoubleClick(){return d(db)},get zoomOnPinch(){return d(fb)},get panOnScroll(){return d(gb)},get panOnDrag(){return d(hb)},get paneClickDistance(){return d(vb)},children:(pb,kb)=>{{let mb=De(()=>se()===void 0?!0:se());bd(pb,{get panOnDrag(){return d(mb)},get selectionOnDrag(){return X()},$$events:{paneclick(wi){je.call(this,t,wi)},panecontextmenu(wi){je.call(this,t,wi)}},children:(wi,Eb)=>{var Xf=am(),Wf=he(Xf);xd(Wf,{children:(wb,Sb)=>{var Zf=sm(),Kf=he(Zf);Nd(Kf,{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 jf=R(Kf,2);Dd(jf,{get containerStyle(){return W()},get style(){return I()},isCustomComponent:G(()=>n.connectionLine),$$slots:{connectionLine:(Ke,Pb)=>{var Gf=qe(),bb=he(Gf);Ot(bb,t,"connectionLine",{}),D(Ke,Gf)}}});var Uf=R(jf,6);$d(Uf,{get nodeClickDistance(){return Ht()},$$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 _b=R(Uf,2);Md(_b,{$$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(wb,Zf)},$$slots:{default:!0}});var yb=R(Wf,2);Td(yb,{}),D(wi,Xf)},$$slots:{default:!0}})}},$$slots:{default:!0}})}var Vs=R(Ds,2);Vd(Vs,{get proOptions(){return ze()},get position(){return me()}});var ml=R(Vs,2);Ot(ml,t,"default",{}),F(an),_n(an,Z=>te(mi,Z),()=>d(mi)),Pu(an,"clientWidth",Z=>te(Dt,Z)),Pu(an,"clientHeight",Z=>te(qt,Z)),dt("dragover",an,function(Z){je.call(this,t,Z)}),dt("drop",an,function(Z){je.call(this,t,Z)}),D(e,an);var lb=ge({get id(){return g()},set id(Z){g(Z),y()},get nodes(){return f()},set nodes(Z){f(Z),y()},get edges(){return h()},set edges(Z){h(Z),y()},get fitView(){return v()},set fitView(Z){v(Z),y()},get fitViewOptions(){return b()},set fitViewOptions(Z){b(Z),y()},get minZoom(){return x()},set minZoom(Z){x(Z),y()},get maxZoom(){return C()},set maxZoom(Z){C(Z),y()},get initialViewport(){return m()},set initialViewport(Z){m(Z),y()},get viewport(){return _()},set viewport(Z){_(Z),y()},get nodeTypes(){return p()},set nodeTypes(Z){p(Z),y()},get edgeTypes(){return E()},set edgeTypes(Z){E(Z),y()},get selectionKey(){return N()},set selectionKey(Z){N(Z),y()},get selectionMode(){return S()},set selectionMode(Z){S(Z),y()},get panActivationKey(){return A()},set panActivationKey(Z){A(Z),y()},get multiSelectionKey(){return L()},set multiSelectionKey(Z){L(Z),y()},get zoomActivationKey(){return V()},set zoomActivationKey(Z){V(Z),y()},get nodesDraggable(){return O()},set nodesDraggable(Z){O(Z),y()},get nodesConnectable(){return z()},set nodesConnectable(Z){z(Z),y()},get nodeDragThreshold(){return B()},set nodeDragThreshold(Z){B(Z),y()},get elementsSelectable(){return k()},set elementsSelectable(Z){k(Z),y()},get snapGrid(){return $()},set snapGrid(Z){$(Z),y()},get deleteKey(){return P()},set deleteKey(Z){P(Z),y()},get connectionRadius(){return T()},set connectionRadius(Z){T(Z),y()},get connectionLineType(){return M()},set connectionLineType(Z){M(Z),y()},get connectionMode(){return H()},set connectionMode(Z){H(Z),y()},get connectionLineStyle(){return I()},set connectionLineStyle(Z){I(Z),y()},get connectionLineContainerStyle(){return W()},set connectionLineContainerStyle(Z){W(Z),y()},get onMoveStart(){return j()},set onMoveStart(Z){j(Z),y()},get onMove(){return J()},set onMove(Z){J(Z),y()},get onMoveEnd(){return ne()},set onMoveEnd(Z){ne(Z),y()},get isValidConnection(){return ee()},set isValidConnection(Z){ee(Z),y()},get translateExtent(){return ce()},set translateExtent(Z){ce(Z),y()},get nodeExtent(){return re()},set nodeExtent(Z){re(Z),y()},get onlyRenderVisibleElements(){return we()},set onlyRenderVisibleElements(Z){we(Z),y()},get panOnScrollMode(){return Ne()},set panOnScrollMode(Z){Ne(Z),y()},get preventScrolling(){return Ae()},set preventScrolling(Z){Ae(Z),y()},get zoomOnScroll(){return ye()},set zoomOnScroll(Z){ye(Z),y()},get zoomOnDoubleClick(){return be()},set zoomOnDoubleClick(Z){be(Z),y()},get zoomOnPinch(){return de()},set zoomOnPinch(Z){de(Z),y()},get panOnScroll(){return U()},set panOnScroll(Z){U(Z),y()},get panOnDrag(){return se()},set panOnDrag(Z){se(Z),y()},get selectionOnDrag(){return X()},set selectionOnDrag(Z){X(Z),y()},get autoPanOnConnect(){return ae()},set autoPanOnConnect(Z){ae(Z),y()},get autoPanOnNodeDrag(){return Me()},set autoPanOnNodeDrag(Z){Me(Z),y()},get onerror(){return Ee()},set onerror(Z){Ee(Z),y()},get ondelete(){return Fe()},set ondelete(Z){Fe(Z),y()},get onedgecreate(){return Oe()},set onedgecreate(Z){Oe(Z),y()},get attributionPosition(){return me()},set attributionPosition(Z){me(Z),y()},get proOptions(){return ze()},set proOptions(Z){ze(Z),y()},get defaultEdgeOptions(){return Ue()},set defaultEdgeOptions(Z){Ue(Z),y()},get width(){return at()},set width(Z){at(Z),y()},get height(){return K()},set height(Z){K(Z),y()},get colorMode(){return Ge()},set colorMode(Z){Ge(Z),y()},get onconnect(){return Qe()},set onconnect(Z){Qe(Z),y()},get onconnectstart(){return gt()},set onconnectstart(Z){gt(Z),y()},get onconnectend(){return sn()},set onconnectend(Z){sn(Z),y()},get onbeforedelete(){return nt()},set onbeforedelete(Z){nt(Z),y()},get oninit(){return $e()},set oninit(Z){$e(Z),y()},get nodeOrigin(){return Xe()},set nodeOrigin(Z){Xe(Z),y()},get paneClickDistance(){return Le()},set paneClickDistance(Z){Le(Z),y()},get nodeClickDistance(){return Ht()},set nodeClickDistance(Z){Ht(Z),y()},get defaultMarkerColor(){return kt()},set defaultMarkerColor(Z){kt(Z),y()},get style(){return pi()},set style(Z){pi(Z),y()},get class(){return Fr()},set class(Z){Fr(Z),y()}});return s(),lb}ue(Ld,{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 Id(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=md({nodes:n(),edges:r(),width:o(),height:i(),nodeOrigin:a(),fitView:s()});Wr(ms,{getStore:()=>l}),ca(()=>{l.reset()}),Be();var c=qe(),u=he(c);return Ot(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()}})}ue(Id,{initialNodes:{},initialEdges:{},initialWidth:{},initialHeight:{},fitView:{},nodeOrigin:{}},["default"],[],!0);var cm=ie("<button><!></button>");function si(e,t){const n=ht(t,["children","$$slots","$$events","$$legacy","$$host"]),r=ht(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);Be();var u=cm();nn(u,(f,h)=>({type:"button",class:f,...r,[Nr]:h}),[()=>(q(ut),q(o()),G(()=>ut(["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=Y(u);return Ot(g,t,"default",{class:"button-svg"}),F(u),dt("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()}})}ue(si,{class:{},bgColor:{},bgColorHover:{},color:{},colorHover:{},borderColor:{}},["default"],[],!0);var dm=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 zd(e){var t=dm();D(e,t)}ue(zd,{},[],[],!0);var fm=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg>');function Rd(e){var t=fm();D(e,t)}ue(Rd,{},[],[],!0);var gm=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 Bd(e){var t=gm();D(e,t)}ue(Bd,{},[],[],!0);var hm=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 Fd(e){var t=hm();D(e,t)}ue(Fd,{},[],[],!0);var vm=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 Yd(e){var t=vm();D(e,t)}ue(Yd,{},[],[],!0);var pm=ie("<!> <!>",1),mm=ie("<!> <!> <!> <!> <!> <!>",1);function qd(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(M,"$nodesDraggable",n),i=()=>oe(H,"$nodesConnectable",n),s=()=>oe(I,"$elementsSelectable",n),a=()=>oe($,"$viewport",n),l=()=>oe(P,"$minZoom",n),c=()=>oe(T,"$maxZoom",n),u=le(),g=le(),f=le(),h=le();let v=w(t,"position",12,"bottom-left"),b=w(t,"showZoom",12,!0),x=w(t,"showFitView",12,!0),C=w(t,"showLock",12,!0),m=w(t,"buttonBgColor",12,void 0),_=w(t,"buttonBgColorHover",12,void 0),p=w(t,"buttonColor",12,void 0),E=w(t,"buttonColorHover",12,void 0),N=w(t,"buttonBorderColor",12,void 0),S=w(t,"ariaLabel",12,void 0),A=w(t,"style",12,void 0),L=w(t,"orientation",12,"vertical"),V=w(t,"fitViewOptions",12,void 0),O=w(t,"class",12,"");const{zoomIn:z,zoomOut:B,fitView:k,viewport:$,minZoom:P,maxZoom:T,nodesDraggable:M,nodesConnectable:H,elementsSelectable:I}=tt(),W={bgColor:m(),bgColorHover:_(),color:p(),colorHover:E(),borderColor:N()},j=()=>{z()},J=()=>{B()},ne=()=>{k(V())},ee=()=>{te(u,!d(u)),M.set(d(u)),H.set(d(u)),I.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(),Be();{let re=De(()=>(q(ut),d(h),q(O()),G(()=>ut(["svelte-flow__controls",d(h),O()])))),we=De(()=>S()??"Svelte Flow controls");ii(e,{get class(){return d(re)},get position(){return v()},"data-testid":"svelte-flow__controls",get"aria-label"(){return d(we)},get style(){return A()},children:(Ne,Ae)=>{var ye=mm(),be=he(ye);Ot(be,t,"before",{});var de=R(be,2);{var U=Oe=>{var me=pm(),ze=he(me);si(ze,vt({class:"svelte-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",get disabled(){return d(f)}},()=>W,{$$events:{click:j},children:(at,K)=>{zd(at)},$$slots:{default:!0}}));var Ue=R(ze,2);si(Ue,vt({class:"svelte-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",get disabled(){return d(g)}},()=>W,{$$events:{click:J},children:(at,K)=>{Rd(at)},$$slots:{default:!0}})),D(Oe,me)};pe(de,Oe=>{b()&&Oe(U)})}var se=R(de,2);{var X=Oe=>{si(Oe,vt({class:"svelte-flow__controls-fitview",title:"fit view","aria-label":"fit view"},()=>W,{$$events:{click:ne},children:(me,ze)=>{Bd(me)},$$slots:{default:!0}}))};pe(se,Oe=>{x()&&Oe(X)})}var ae=R(se,2);{var Me=Oe=>{si(Oe,vt({class:"svelte-flow__controls-interactive",title:"toggle interactivity","aria-label":"toggle interactivity"},()=>W,{$$events:{click:ee},children:(me,ze)=>{var Ue=qe(),at=he(Ue);{var K=Qe=>{Yd(Qe)},Ge=Qe=>{Fd(Qe)};pe(at,Qe=>{d(u)?Qe(K):Qe(Ge,!1)})}D(me,Ue)},$$slots:{default:!0}}))};pe(ae,Oe=>{C()&&Oe(Me)})}var Ee=R(ae,2);Ot(Ee,t,"default",{});var Fe=R(Ee,2);Ot(Fe,t,"after",{}),D(Ne,ye)},$$slots:{default:!0}})}var ce=ge({get position(){return v()},set position(re){v(re),y()},get showZoom(){return b()},set showZoom(re){b(re),y()},get showFitView(){return x()},set showFitView(re){x(re),y()},get showLock(){return C()},set showLock(re){C(re),y()},get buttonBgColor(){return m()},set buttonBgColor(re){m(re),y()},get buttonBgColorHover(){return _()},set buttonBgColorHover(re){_(re),y()},get buttonColor(){return p()},set buttonColor(re){p(re),y()},get buttonColorHover(){return E()},set buttonColorHover(re){E(re),y()},get buttonBorderColor(){return N()},set buttonBorderColor(re){N(re),y()},get ariaLabel(){return S()},set ariaLabel(re){S(re),y()},get style(){return A()},set style(re){A(re),y()},get orientation(){return L()},set orientation(re){L(re),y()},get fitViewOptions(){return V()},set fitViewOptions(re){V(re),y()},get class(){return O()},set class(re){O(re),y()}});return r(),ce}ue(qd,{position:{},showZoom:{},showFitView:{},showLock:{},buttonBgColor:{},buttonBgColorHover:{},buttonColor:{},buttonColorHover:{},buttonBorderColor:{},ariaLabel:{},style:{},orientation:{},fitViewOptions:{},class:{}},["before","default","after"],[],!0);var lr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(lr||(lr={}));var ym=Ce("<circle></circle>");function Xd(e,t){fe(t,!1);let n=w(t,"radius",12,5),r=w(t,"class",12,"");Be();var o=ym();return Ve(i=>{_e(o,"cx",n()),_e(o,"cy",n()),_e(o,"r",n()),Nt(o,0,i)},[()=>wn((q(ut),q(r()),G(()=>ut(["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()}})}ue(Xd,{radius:{},class:{}},[],[],!0);var wm=Ce("<path></path>");function Wd(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,"");Be();var s=wm();return Ve(a=>{_e(s,"stroke-width",n()),_e(s,"d",(q(r()),G(()=>`M${r()[0]/2} 0 V${r()[1]} M0 ${r()[1]/2} H${r()[0]}`))),Nt(s,0,a)},[()=>wn((q(ut),q(o()),q(i()),G(()=>ut(["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()}})}ue(Wd,{lineWidth:{},dimensions:{},variant:{},class:{}},[],[],!0);const _m={[lr.Dots]:1,[lr.Lines]:1,[lr.Cross]:6};var bm=Ce('<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>');const xm={hash:"svelte-1r7pe8d",code:".svelte-flow__background.svelte-1r7pe8d {position:absolute;width:100%;height:100%;top:0;left:0;}"};function Zd(e,t){fe(t,!1),ot(e,xm);const[n,r]=ct(),o=()=>oe(E,"$flowId",n),i=()=>oe(p,"$viewport",n),s=le(),a=le(),l=le(),c=le(),u=le();let g=w(t,"id",12,void 0),f=w(t,"variant",28,()=>lr.Dots),h=w(t,"gap",12,20),v=w(t,"size",12,1),b=w(t,"lineWidth",12,1),x=w(t,"bgColor",12,void 0),C=w(t,"patternColor",12,void 0),m=w(t,"patternClass",12,void 0),_=w(t,"class",12,"");const{viewport:p,flowId:E}=tt(),N=v()||_m[f()],S=f()===lr.Dots,A=f()===lr.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,A?[d(l),d(l)]:d(a))}),ve(()=>(d(l),d(c)),()=>{te(u,S?[d(l)/2,d(l)/2]:[d(c)[0]/2,d(c)[1]/2])}),Pt(),Be();var V=bm();let O;var z=Y(V),B=Y(z);{var k=M=>{{let H=De(()=>d(l)/2);Xd(M,{get radius(){return d(H)},get class(){return m()}})}},$=M=>{Wd(M,{get dimensions(){return d(c)},get variant(){return f()},get lineWidth(){return b()},get class(){return m()}})};pe(B,M=>{S?M(k):M($,!1)})}F(z);var P=R(z);F(V),Ve((M,H)=>{Nt(V,0,M,"svelte-1r7pe8d"),O=mt(V,"",O,H),_e(z,"id",d(s)),_e(z,"x",(i(),d(a),G(()=>i().x%d(a)[0]))),_e(z,"y",(i(),d(a),G(()=>i().y%d(a)[1]))),_e(z,"width",(d(a),G(()=>d(a)[0]))),_e(z,"height",(d(a),G(()=>d(a)[1]))),_e(z,"patternTransform",(d(u),G(()=>`translate(-${d(u)[0]},-${d(u)[1]})`))),_e(P,"fill",`url(#${d(s)})`)},[()=>wn((q(ut),q(_()),G(()=>ut(["svelte-flow__background",_()])))),()=>({"--xy-background-color-props":x(),"--xy-background-pattern-color-props":C()})]),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 x()},set bgColor(M){x(M),y()},get patternColor(){return C()},set patternColor(M){C(M),y()},get patternClass(){return m()},set patternClass(M){m(M),y()},get class(){return _()},set class(M){_(M),y()}});return r(),T}ue(Zd,{id:{},variant:{},gap:{},size:{},lineWidth:{},bgColor:{},patternColor:{},patternClass:{},class:{}},[],[],!0);var Cm=Ce("<rect></rect>");function Kd(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,"");Be();var h=Cm();let v;return Ve((b,x)=>{v=Nt(h,0,b,null,v,x),_e(h,"x",n()),_e(h,"y",r()),_e(h,"rx",s()),_e(h,"ry",s()),_e(h,"width",o()),_e(h,"height",i()),mt(h,`${a()?`fill: ${a()};`:""}${c()?`stroke: ${c()};`:""}${u()?`stroke-width: ${u()};`:""}`),_e(h,"shape-rendering",l())},[()=>wn((q(ut),q(f()),G(()=>ut(["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()}})}ue(Kd,{x:{},y:{},width:{},height:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},selected:{},class:{}},[],[],!0);function tl(e,t){const n=a2({domNode:e,panZoom:t.panZoom,getTransform:()=>{const o=Q(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 nl=e=>e instanceof Function?e:()=>e;var $m=Ce("<title> </title>"),km=Ce('<svg class="svelte-flow__minimap-svg" role="img"><!><!><path class="svelte-flow__minimap-mask" fill-rule="evenodd" pointer-events="none"></path></svg>');function jd(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(se,"$flowId",n),i=()=>oe(be,"$viewport",n),s=()=>oe(de,"$containerWidth",n),a=()=>oe(U,"$containerHeight",n),l=()=>oe(ye,"$nodeLookup",n),c=()=>oe(Ae,"$nodes",n),u=()=>oe(X,"$panZoom",n),g=()=>oe(ae,"$translateExtent",n),f=le(),h=le(),v=le(),b=le(),x=le(),C=le(),m=le(),_=le(),p=le(),E=le(),N=le(),S=le(),A=le();let L=w(t,"position",12,"bottom-right"),V=w(t,"ariaLabel",12,"Mini map"),O=w(t,"nodeStrokeColor",12,"transparent"),z=w(t,"nodeColor",12,void 0),B=w(t,"nodeClass",12,""),k=w(t,"nodeBorderRadius",12,5),$=w(t,"nodeStrokeWidth",12,2),P=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),I=w(t,"width",12,void 0),W=w(t,"height",12,void 0),j=w(t,"pannable",12,!0),J=w(t,"zoomable",12,!0),ne=w(t,"inversePan",12,void 0),ee=w(t,"zoomStep",12,void 0),ce=w(t,"style",12,""),re=w(t,"class",12,"");const we=200,Ne=150,{nodes:Ae,nodeLookup:ye,viewport:be,width:de,height:U,flowId:se,panZoom:X,translateExtent:ae}=tt(),Me=z()===void 0?void 0:nl(z()),Ee=nl(O()),Fe=nl(B()),Oe=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",me=`svelte-flow__minimap-desc-${o()}`;let ze=le(d(f));const Ue=()=>d(C);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(ze,l().size>0?Dc(ei(l(),{filter:K=>!K.hidden}),d(f)):d(f)),c()}),ve(()=>q(I()),()=>{te(h,I()??we)}),ve(()=>q(W()),()=>{te(v,W()??Ne)}),ve(()=>(d(ze),d(h)),()=>{te(b,d(ze).width/d(h))}),ve(()=>(d(ze),d(v)),()=>{te(x,d(ze).height/d(v))}),ve(()=>(d(b),d(x)),()=>{te(C,Math.max(d(b),d(x)))}),ve(()=>(d(C),d(h)),()=>{te(m,d(C)*d(h))}),ve(()=>(d(C),d(v)),()=>{te(_,d(C)*d(v))}),ve(()=>d(C),()=>{te(p,5*d(C))}),ve(()=>(d(ze),d(m),d(p)),()=>{te(E,d(ze).x-(d(m)-d(ze).width)/2-d(p))}),ve(()=>(d(ze),d(_),d(p)),()=>{te(N,d(ze).y-(d(_)-d(ze).height)/2-d(p))}),ve(()=>(d(m),d(p)),()=>{te(S,d(m)+d(p)*2)}),ve(()=>(d(_),d(p)),()=>{te(A,d(_)+d(p)*2)}),Pt(),Be();{let K=De(()=>ce()+(P()?`;--xy-minimap-background-color-props:${P()}`:"")),Ge=De(()=>(q(ut),q(re()),G(()=>ut(["svelte-flow__minimap",re()]))));ii(e,{get position(){return L()},get style(){return d(K)},get class(){return d(Ge)},"data-testid":"svelte-flow__minimap",children:(Qe,gt)=>{var sn=qe(),nt=he(sn);{var $e=Xe=>{var Le=km();let Ht;var kt=Y(Le);{var pi=Dt=>{var qt=$m(),ko=Y(qt,!0);F(qt),Ve(()=>{_e(qt,"id",me),ft(ko,V())}),D(Dt,qt)};pe(kt,Dt=>{V()&&Dt(pi)})}var Fr=R(kt);At(Fr,1,c,Dt=>Dt.id,(Dt,qt)=>{var ko=qe();const et=De(()=>(l(),d(qt),G(()=>l().get(d(qt).id))));var pl=he(ko);{var yi=an=>{const Hs=De(()=>(q(Kn),q(d(et)),G(()=>Kn(d(et)))));{let Ds=De(()=>(q(d(et)),G(()=>Me==null?void 0:Me(d(et))))),Vs=De(()=>(q(d(et)),G(()=>Ee(d(et))))),ml=De(()=>(q(d(et)),G(()=>Fe(d(et)))));Kd(an,vt({get x(){return q(d(et)),G(()=>d(et).internals.positionAbsolute.x)},get y(){return q(d(et)),G(()=>d(et).internals.positionAbsolute.y)}},()=>d(Hs),{get selected(){return q(d(et)),G(()=>d(et).selected)},get color(){return d(Ds)},get borderRadius(){return k()},get strokeColor(){return d(Vs)},get strokeWidth(){return $()},get shapeRendering(){return Oe},get class(){return d(ml)}}))}};pe(pl,an=>{q(d(et)),q(ds),G(()=>d(et)&&ds(d(et)))&&an(yi)})}D(Dt,ko)});var mi=R(Fr);F(Le),Lt(Le,(Dt,qt)=>tl==null?void 0:tl(Dt,qt),()=>({panZoom:u(),viewport:be,getViewScale:Ue,translateExtent:g(),width:s(),height:a(),inversePan:ne(),zoomStep:ee(),pannable:j(),zoomable:J()})),Ve(Dt=>{_e(Le,"width",d(h)),_e(Le,"height",d(v)),_e(Le,"viewBox",`${d(E)??""} ${d(N)??""} ${d(S)??""} ${d(A)??""}`),_e(Le,"aria-labelledby",me),Ht=mt(Le,"",Ht,Dt),_e(mi,"d",`M${d(E)-d(p)},${d(N)-d(p)}h${d(S)+d(p)*2}v${d(A)+d(p)*2}h${-d(S)-d(p)*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(C):void 0})]),D(Xe,Le)};pe(nt,Xe=>{u()&&Xe($e)})}D(Qe,sn)},$$slots:{default:!0}})}var at=ge({get position(){return L()},set position(K){L(K),y()},get ariaLabel(){return V()},set ariaLabel(K){V(K),y()},get nodeStrokeColor(){return O()},set nodeStrokeColor(K){O(K),y()},get nodeColor(){return z()},set nodeColor(K){z(K),y()},get nodeClass(){return B()},set nodeClass(K){B(K),y()},get nodeBorderRadius(){return k()},set nodeBorderRadius(K){k(K),y()},get nodeStrokeWidth(){return $()},set nodeStrokeWidth(K){$(K),y()},get bgColor(){return P()},set bgColor(K){P(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 I()},set width(K){I(K),y()},get height(){return W()},set height(K){W(K),y()},get pannable(){return j()},set pannable(K){j(K),y()},get zoomable(){return J()},set zoomable(K){J(K),y()},get inversePan(){return ne()},set inversePan(K){ne(K),y()},get zoomStep(){return ee()},set zoomStep(K){ee(K),y()},get style(){return ce()},set style(K){ce(K),y()},get class(){return re()},set class(K){re(K),y()}});return r(),at}ue(jd,{position:{},ariaLabel:{},nodeStrokeColor:{},nodeColor:{},nodeClass:{},nodeBorderRadius:{},nodeStrokeWidth:{},bgColor:{},maskColor:{},maskStrokeColor:{},maskStrokeWidth:{},width:{},height:{},pannable:{},zoomable:{},inversePan:{},zoomStep:{},style:{},class:{}},[],[],!0);const Ud=e=>_p(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:x,connectionLookup:C}=tt(),m=E=>{var V,O;const N=Q(v),S=Ud(E)?E:N.get(E.id),A=S.parentId?Pp(S.position,S.measured,S.parentId,N,Q(b)):S.position,L={...S,position:A,width:((V=S.measured)==null?void 0:V.width)??S.width,height:((O=S.measured)==null?void 0:O.height)??S.height};return uo(L)},_=(E,N,S={replace:!1})=>{var V;const A=(V=Q(v).get(E))==null?void 0:V.internals.userNode;if(!A)return;const L=typeof N=="function"?N(A):N;S.replace?g.update(O=>O.map(z=>z.id===E?Ud(L)?L:{...z,...L}:z)):(Object.assign(A,L),g.update(O=>O))},p=E=>Q(v).get(E);return{zoomIn:e,zoomOut:t,getInternalNode:p,getNode:E=>{var N;return(N=p(E))==null?void 0:N.internals.userNode},getNodes:E=>E===void 0?Q(g):Gd(Q(v),E),getEdge:E=>Q(x).get(E),getEdges:E=>E===void 0?Q(f):Gd(Q(x),E),setZoom:(E,N)=>{const S=Q(u);return S?S.scaleTo(E,{duration:N==null?void 0:N.duration}):Promise.resolve(!1)},getZoom:()=>Q(i).zoom,setViewport:async(E,N)=>{const S=Q(i),A=Q(u);return A?(await A.setViewport({x:E.x??S.x,y:E.y??S.y,zoom:E.zoom??S.zoom},{duration:N==null?void 0:N.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>Q(i),setCenter:async(E,N,S)=>{const A=typeof(S==null?void 0:S.zoom)<"u"?S.zoom:Q(c),L=Q(u);return L?(await L.setViewport({x:Q(s)/2-E*A,y:Q(a)/2-N*A,zoom:A},{duration:S==null?void 0:S.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitView:n,fitBounds:async(E,N)=>{const S=Q(u);if(!S)return Promise.resolve(!1);const A=Ya(E,Q(s),Q(a),Q(l),Q(c),(N==null?void 0:N.padding)??.1);return await S.setViewport(A,{duration:N==null?void 0:N.duration}),Promise.resolve(!0)},getIntersectingNodes:(E,N=!0,S)=>{const A=Vc(E),L=A?E:m(E);return L?(S||Q(g)).filter(V=>{const O=Q(v).get(V.id);if(!O||!A&&V.id===E.id)return!1;const z=uo(O),B=ti(z,L);return N&&B>0||B>=L.width*L.height}):[]},isNodeIntersecting:(E,N,S=!0)=>{const L=Vc(E)?E:m(E);if(!L)return!1;const V=ti(L,N);return S&&V>0||V>=L.width*L.height},deleteElements:async({nodes:E=[],edges:N=[]})=>{const{nodes:S,edges:A}=await Nc({nodesToRemove:E,edgesToRemove:N,nodes:Q(g),edges:Q(f),onBeforeDelete:Q(r)});return S&&g.update(L=>L.filter(V=>!S.some(({id:O})=>O===V.id))),A&&f.update(L=>L.filter(V=>!A.some(({id:O})=>O===V.id))),{deletedNodes:S,deletedEdges:A}},screenToFlowPosition:(E,N={snapToGrid:!0})=>{const S=Q(h);if(!S)return E;const A=N.snapToGrid?Q(o):!1,{x:L,y:V,zoom:O}=Q(i),{x:z,y:B}=S.getBoundingClientRect(),k={x:E.x-z,y:E.y-B};return ni(k,[L,V,O],A!==null,A||[1,1])},flowToScreenPosition:E=>{const N=Q(h);if(!N)return E;const{x:S,y:A,zoom:L}=Q(i),{x:V,y:O}=N.getBoundingClientRect(),z=us(E,[S,A,L]);return{x:z.x+V,y:z.y+O}},toObject:()=>({nodes:Q(g).map(E=>({...E,position:{...E.position},data:{...E.data}})),edges:Q(f).map(E=>({...E})),viewport:{...Q(i)}}),updateNode:_,updateNodeData:(E,N,S)=>{var V;const A=(V=Q(v).get(E))==null?void 0:V.internals.userNode;if(!A)return;const L=typeof N=="function"?N(A):N;A.data=S!=null&&S.replace?L:{...A.data,...L},g.update(O=>O)},getNodesBounds:E=>{const N=Q(v),S=Q(b);return bp(E,{nodeLookup:N,nodeOrigin:S})},getHandleConnections:({type:E,id:N,nodeId:S})=>{var A;return Array.from(((A=Q(C).get(`${S}-${E}-${N??null}`))==null?void 0:A.values())??[])},viewport:i}}function Gd(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 Em=ie('<div class="svelte-flow__node-toolbar"><!></div>');function Jd(e,t){fe(t,!1);const[n,r]=ct(),o=()=>oe(_,"$nodes",n),i=()=>oe(m,"$nodeLookup",n),s=()=>oe(C,"$viewport",n),a=()=>oe(x,"$domNode",n),l=le(),c=le(),u=le();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:x,viewport:C,nodeLookup:m,nodes:_}=tt(),{getNodesBounds:p}=jt(),E=xr("svelteflow__node_id");let N=le(),S=le([]),A=v()!==void 0?v():10,L=f()!==void 0?f():Pe.Top,V=h()!==void 0?h():"center";ve(()=>(o(),q(g()),i()),()=>{o();const $=Array.isArray(g())?g():[g()||E];te(S,$.reduce((P,T)=>{const M=i().get(T);return M&&P.push(M),P},[]))}),ve(()=>(d(S),s()),()=>{const $=p(d(S));$&&te(N,qp($,s(),L,A,V))}),ve(()=>d(S),()=>{te(l,d(S).length===0?1:Math.max(...d(S).map($=>($.internals.z||5)+1)))}),ve(()=>o(),()=>{te(c,o().filter($=>$.selected).length)}),ve(()=>(q(b()),d(S),d(c)),()=>{te(u,typeof b()=="boolean"?b():d(S).length===1&&d(S)[0].selected&&d(c)===1)}),Pt(),Be();var O=qe(),z=he(O);{var B=$=>{var P=Em();let T;var M=Y(P);Ot(M,t,"default",{}),F(P),Lt(P,(H,I)=>ho==null?void 0:ho(H,I),()=>({domNode:a()})),Ve((H,I)=>{_e(P,"data-id",H),T=mt(P,"",T,I)},[()=>(d(S),G(()=>d(S).reduce((H,I)=>`${H}${I.id} `,"").trim())),()=>({position:"absolute",transform:d(N),"z-index":d(l)})]),D($,P)};pe(z,$=>{a()&&d(u)&&d(S)&&$(B)})}D(e,O);var k=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(),k}ue(Jd,{nodeId:{},position:{},align:{},offset:{},isVisible:{}},["default"],[],!0);function Lr(e){const{nodes:t,nodeLookup:n}=tt();let r=[],o=!0;return ir([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})}(!Jp(a,r)||o)&&(r=a,s(l?a:a[0]??null),o=!1)})}const Qd="tinyflow-component";class Sm{constructor(t){Et(this,"options");Et(this,"rootEl");Et(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(Qd);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(Qd);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 ys=(()=>{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 Pm=ie("<button><!></button>");function Je(e,t){fe(t,!0);const n=w(t,"children",7),r=w(t,"primary",7),o=Tt(t,["$$slots","$$events","$$legacy","$$host","children","primary"]);var i=Pm();nn(i,()=>({type:"button",...o,class:`tf-btn ${r()?"tf-btn-primary":""} nopan nodrag ${t.class??""}`}));var s=Y(i);return Pr(s,()=>n()??_t),F(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()}})}ue(Je,{children:{},primary:{}},[],[],!0);var Nm=ie("<input/>");function ef(e,t){fe(t,!0);const n=Tt(t,["$$slots","$$events","$$legacy","$$host"]);var r=Nm();Tr(r),nn(r,()=>({type:"checkbox",...n,class:`tf-checkbox nopan nodrag ${t.class??""}`})),D(e,r),ge()}ue(ef,{},[],[],!0);var Tm=ie('<div><input type="hidden"/> <!> <!></div>');const Mm={hash:"svelte-1swt2gg",code:".tf-chosen.svelte-1swt2gg {display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:5px;}"};function tf(e,t){fe(t,!0),ot(e,Mm);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=Tt(t,["$$slots","$$events","$$legacy","$$host","placeholder","label","value","buttonText","onChosen"]);var l=Tm();nn(l,()=>({...a,class:`tf-chosen nopan nodrag ${t.class??""}`}),void 0,void 0,"svelte-1swt2gg");var c=Y(l);Tr(c);var u=R(c,2);pt(u,{get value(){return r()},get placeholder(){return n()},style:"flex-grow: 1;",disabled:!0});var g=R(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();Ve(()=>ft(v,i())),D(f,v)},$$slots:{default:!0}}),F(l),Ve(()=>Pg(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()}})}ue(tf,{placeholder:{},label:{},value:{},buttonText:{},onChosen:{}},[],[],!0);var Hm=ie("<input/>");function pt(e,t){fe(t,!0);const n=Tt(t,["$$slots","$$events","$$legacy","$$host"]);var r=Hm();Tr(r),nn(r,()=>({type:"text",spellcheck:"false",...n,class:`tf-input nopan nodrag ${t.class??""}`})),D(e,r),ge()}ue(pt,{},[],[],!0);var Dm=ie("<textarea></textarea>");function Mt(e,t){fe(t,!0);const n=w(t,"value",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","value"]);var o=Dm();return rg(o),nn(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()}})}ue(Mt,{value:{}},[],[],!0);var Vm=ie('<div role="button"><!></div>'),Am=ie("<div></div>");function nf(e,t){const n=ht(t,["children","$$slots","$$events","$$legacy","$$host"]),r=ht(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)}Be();var l=Am();return nn(l,()=>({...r,class:`tf-tabs ${q(r),G(()=>r.class)??""}`})),At(l,5,o,eo,(c,u,g)=>{var f=Vm();_e(f,"tabindex",g),f.__click=()=>a(d(u),g),f.__keydown=x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),a(d(u),g))};var h=Y(f);{var v=x=>{var C=Re();Ve(()=>ft(C,(d(u),G(()=>d(u).label)))),D(x,C)},b=x=>{var C=qe(),m=he(C);Pr(m,()=>(d(u),G(()=>d(u).label)??_t)),D(x,C)};pe(h,x=>{d(u),G(()=>typeof d(u).label=="string")?x(v):x(b,!1)})}F(f),Ve(()=>Nt(f,1,`tf-tabs-item ${g===s()?"active":""}`)),D(c,f)}),F(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()}})}Sr(["click","keydown"]),ue(nf,{items:{},onChange:{},activeIndex:{}},[],[],!0);var Om=(e,t,n)=>t(d(n)),Lm=(e,t,n)=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),t(d(n)))},Im=ie('<span class="tf-collapse-item-title-icon"><!></span>'),zm=ie('<div class="tf-collapse-item-description"><!></div>'),Rm=ie('<div class="tf-collapse-item-content"><!></div>'),Bm=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>'),Fm=ie("<div></div>");const Ym={hash:"svelte-1jfktzw",code:`
4
+ /* 定义旋转的 CSS 类 */.rotate-90.svelte-1jfktzw {transform:rotate(90deg);transition:transform 0.3s ease;}`};function rl(e,t){fe(t,!0),ot(e,Ym);let n=w(t,"items",7),r=w(t,"onChange",7),o=w(t,"activeKeys",31,()=>Nn([]));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=Fm();return At(s,21,n,eo,(a,l,c)=>{var u=Bm(),g=Y(u);_e(g,"tabindex",c),g.__click=[Om,i,l],g.__keydown=[Lm,i,l];var f=Y(g);{var h=p=>{var E=Im(),N=Y(E);ur(N,{get target(){return d(l).icon}}),F(E),D(p,E)};pe(f,p=>{d(l).icon&&p(h)})}var v=R(f,2);ur(v,{get target(){return d(l).title}});var b=R(v,2);F(g);var x=R(g,2);{var C=p=>{var E=zm(),N=Y(E);ur(N,{get target(){return d(l).description}}),F(E),D(p,E)};pe(x,p=>{d(l).description&&p(C)})}var m=R(x,2);{var _=p=>{var E=Rm(),N=Y(E);ur(N,{get target(){return d(l).content}}),F(E),D(p,E)};pe(m,p=>{o().includes(d(l).key)&&p(_)})}F(u),Ve(p=>Nt(b,1,`tf-collapse-item-title-arrow ${p??""}`,"svelte-1jfktzw"),[()=>o().includes(d(l).key)?"rotate-90":""]),D(a,u)}),F(s),Ve(()=>{mt(s,t.style),Nt(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()}})}Sr(["click","keydown"]),ue(rl,{items:{},onChange:{},activeKeys:{}},[],[],!0);function ur(e,t){fe(t,!0);let n=w(t,"target",7);typeof n()>"u"&&n("undefined");var r=qe(),o=he(r);{var i=a=>{var l=qe(),c=he(l);Pr(c,()=>n()??_t),D(a,l)},s=a=>{var l=qe(),c=he(l);ga(c,n),D(a,l)};pe(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()}})}ue(ur,{target:{}},[],[],!0);var qm=(e,t,n)=>t(d(n)),Xm=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 14L8 10H16L12 14Z"></path></svg>'),Wm=ie('<div class="tf-select-content-children"><!></div>'),Zm=ie('<button class="tf-select-content-item"><span><!></span> <!></button> <!>',1),Km=ie('<div class="tf-select-content nopan nodrag"><!></div>'),jm=ie("<!> <!>",1),Um=ie('<div class="tf-select-input-placeholder"> </div>'),Gm=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>'),Jm=ie("<div><!></div>");function hn(e,t){fe(t,!0);const n=(C,m=_t)=>{var _=qe(),p=he(_);At(p,19,m,(E,N)=>`${N}_${E.value}`,(E,N)=>{var S=Zm(),A=he(S);A.__click=[qm,v,N];var L=Y(A),V=Y(L);{var O=$=>{var P=Xm();D($,P)};pe(V,$=>{d(N).children&&d(N).children.length>0&&$(O)})}F(L);var z=R(L,2);ur(z,{get target(){return d(N).label}}),F(A);var B=R(A,2);{var k=$=>{var P=Wm(),T=Y(P);n(T,()=>d(N).children),F(P),D($,P)};pe(B,$=>{d(N).children&&d(N).children.length>0&&(a()||c().includes(d(N).value))&&$(k)})}D(E,S)}),D(C,_)};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=Tt(t,["$$slots","$$events","$$legacy","$$host","items","onSelect","value","defaultValue","expandAll","multiple","expandValue","placeholder"]),f=ke(()=>{const C=[],m=_=>{for(let p of _)i().length>0?i().includes(p.value)&&C.push(p):s().includes(p.value)&&C.push(p),p.children&&p.children.length>0&&m(p.children)};return m(r()),C}),h;function v(C){var m;h==null||h.hide(),(m=o())==null||m(C)}var b=Jm();nn(b,()=>({...g,class:`tf-select ${g.class??""}`}));var x=Y(b);return _n(_o(x,{floating:m=>{var _=Km(),p=Y(_);n(p,r),F(_),D(m,_)},children:(m,_)=>{var p=Gm();nn(p,()=>({class:"tf-select-input nopan nodrag",...g}));var E=Y(p);At(E,23,()=>d(f),(N,S)=>`${S}_${N.value}`,(N,S,A)=>{var L=qe(),V=he(L);{var O=B=>{var k=qe(),$=he(k);{var P=T=>{ur(T,{get target(){return d(S).label}})};pe($,T=>{d(A)===0&&T(P)})}D(B,k)},z=B=>{var k=jm(),$=he(k);ur($,{get target(){return d(S).label}});var P=R($,2);{var T=M=>{var H=Re(",");D(M,H)};pe(P,M=>{d(A)<d(f).length-1&&M(T)})}D(B,k)};pe(V,B=>{l()?B(z,!1):B(O)})}D(N,L)},N=>{var S=Um(),A=Y(S,!0);F(S),Ve(()=>ft(A,u())),D(N,S)}),F(E),Te(2),F(p),D(m,p)},$$slots:{floating:!0,default:!0}}),m=>h=m,()=>h),F(b),D(e,b),ge({get items(){return r()},set items(C){r(C),y()},get onSelect(){return o()},set onSelect(C){o(C),y()},get value(){return i()},set value(C=[]){i(C),y()},get defaultValue(){return s()},set defaultValue(C=[]){s(C),y()},get expandAll(){return a()},set expandAll(C=!0){a(C),y()},get multiple(){return l()},set multiple(C=!1){l(C),y()},get expandValue(){return c()},set expandValue(C=[]){c(C),y()},get placeholder(){return u()},set placeholder(C){u(C),y()}})}Sr(["click"]),ue(hn,{items:{},onSelect:{},value:{},defaultValue:{},expandAll:{},multiple:{},expandValue:{},placeholder:{}},[],[],!0);const ai=Math.min,po=Math.max,ws=Math.round,In=e=>({x:e,y:e}),Qm={left:"right",right:"left",bottom:"top",top:"bottom"},ey={start:"end",end:"start"};function ol(e,t,n){return po(e,ai(t,n))}function li(e,t){return typeof e=="function"?e(t):e}function Ir(e){return e.split("-")[0]}function ui(e){return e.split("-")[1]}function rf(e){return e==="x"?"y":"x"}function il(e){return e==="y"?"height":"width"}const ty=new Set(["top","bottom"]);function cr(e){return ty.has(Ir(e))?"y":"x"}function sl(e){return rf(cr(e))}function ny(e,t,n){n===void 0&&(n=!1);const r=ui(e),o=sl(e),i=il(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=_s(s)),[s,_s(s)]}function ry(e){const t=_s(e);return[al(e),t,al(t)]}function al(e){return e.replace(/start|end/g,t=>ey[t])}const of=["left","right"],sf=["right","left"],oy=["top","bottom"],iy=["bottom","top"];function sy(e,t,n){switch(e){case"top":case"bottom":return n?t?sf:of:t?of:sf;case"left":case"right":return t?oy:iy;default:return[]}}function ay(e,t,n,r){const o=ui(e);let i=sy(Ir(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(al)))),i}function _s(e){return e.replace(/left|right|bottom|top/g,t=>Qm[t])}function ly(e){return{top:0,right:0,bottom:0,left:0,...e}}function af(e){return typeof e!="number"?ly(e):{top:e,right:e,bottom:e,left:e}}function bs(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 lf(e,t,n){let{reference:r,floating:o}=e;const i=cr(t),s=sl(t),a=il(s),l=Ir(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 uy=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}=lf(c,r,l),f=r,h={},v=0;for(let b=0;b<a.length;b++){const{name:x,fn:C}=a[b],{x:m,y:_,data:p,reset:E}=await C({x:u,y:g,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=m??u,g=_??g,h={...h,[x]:{...h[x],...p}},E&&v<=50&&(v++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:g}=lf(c,f,l)),b=-1)}return{x:u,y:g,placement:f,strategy:o,middlewareData:h}};async function uf(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=af(h),x=a[f?g==="floating"?"reference":"floating":g],C=bs(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),m=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)),p=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},E=bs(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:_,strategy:l}):m);return{top:(C.top-E.top+v.top)/p.y,bottom:(E.bottom-C.bottom+v.bottom)/p.y,left:(C.left-E.left+v.left)/p.x,right:(E.right-C.right+v.right)/p.x}}const cy=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=af(u),f={x:n,y:r},h=sl(o),v=il(h),b=await s.getDimensions(c),x=h==="y",C=x?"top":"left",m=x?"bottom":"right",_=x?"clientHeight":"clientWidth",p=i.reference[v]+i.reference[h]-f[h]-i.floating[v],E=f[h]-i.reference[h],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let S=N?N[_]:0;(!S||!await(s.isElement==null?void 0:s.isElement(N)))&&(S=a.floating[_]||i.floating[v]);const A=p/2-E/2,L=S/2-b[v]/2-1,V=ai(g[C],L),O=ai(g[m],L),z=V,B=S-b[v]-O,k=S/2-b[v]/2+A,$=ol(z,k,B),P=!l.arrow&&ui(o)!=null&&k!==$&&i.reference[v]/2-(k<z?V:O)-b[v]/2<0,T=P?k<z?k-z:k-B:0;return{[h]:f[h]+T,data:{[h]:$,centerOffset:k-$-T,...P&&{alignmentOffset:T}},reset:P}}}),dy=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,...x}=li(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const C=Ir(o),m=cr(a),_=Ir(a)===a,p=await(l.isRTL==null?void 0:l.isRTL(c.floating)),E=f||(_||!b?[_s(a)]:ry(a)),N=v!=="none";!f&&N&&E.push(...ay(a,b,v,p));const S=[a,...E],A=await uf(t,x),L=[];let V=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&L.push(A[C]),g){const k=ny(o,s,p);L.push(A[k[0]],A[k[1]])}if(V=[...V,{placement:o,overflows:L}],!L.every(k=>k<=0)){var O,z;const k=(((O=i.flip)==null?void 0:O.index)||0)+1,$=S[k];if($&&(!(g==="alignment"?m!==cr($):!1)||V.every(M=>M.overflows[0]>0&&cr(M.placement)===m)))return{data:{index:k,overflows:V},reset:{placement:$}};let P=(z=V.filter(T=>T.overflows[0]<=0).sort((T,M)=>T.overflows[1]-M.overflows[1])[0])==null?void 0:z.placement;if(!P)switch(h){case"bestFit":{var B;const T=(B=V.filter(M=>{if(N){const H=cr(M.placement);return H===m||H==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(H=>H>0).reduce((H,I)=>H+I,0)]).sort((M,H)=>M[1]-H[1])[0])==null?void 0:B[0];T&&(P=T);break}case"initialPlacement":P=a;break}if(o!==P)return{reset:{placement:P}}}return{}}}},fy=new Set(["left","top"]);async function gy(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ir(n),a=ui(n),l=cr(n)==="y",c=fy.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 hy=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 gy(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}}}}},vy=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:x=>{let{x:C,y:m}=x;return{x:C,y:m}}},...l}=li(e,t),c={x:n,y:r},u=await uf(t,l),g=cr(Ir(o)),f=rf(g);let h=c[f],v=c[g];if(i){const x=f==="y"?"top":"left",C=f==="y"?"bottom":"right",m=h+u[x],_=h-u[C];h=ol(m,h,_)}if(s){const x=g==="y"?"top":"left",C=g==="y"?"bottom":"right",m=v+u[x],_=v-u[C];v=ol(m,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 xs(){return typeof window<"u"}function mo(e){return cf(e)?(e.nodeName||"").toLowerCase():"#document"}function on(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Un(e){var t;return(t=(cf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function cf(e){return xs()?e instanceof Node||e instanceof on(e).Node:!1}function $n(e){return xs()?e instanceof Element||e instanceof on(e).Element:!1}function zn(e){return xs()?e instanceof HTMLElement||e instanceof on(e).HTMLElement:!1}function df(e){return!xs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof on(e).ShadowRoot}const py=new Set(["inline","contents"]);function ci(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=kn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!py.has(o)}const my=new Set(["table","td","th"]);function yy(e){return my.has(mo(e))}const wy=[":popover-open",":modal"];function Cs(e){return wy.some(t=>{try{return e.matches(t)}catch{return!1}})}const _y=["transform","translate","scale","rotate","perspective"],by=["transform","translate","scale","rotate","perspective","filter"],xy=["paint","layout","strict","content"];function ll(e){const t=ul(),n=$n(e)?kn(e):e;return _y.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)||by.some(r=>(n.willChange||"").includes(r))||xy.some(r=>(n.contain||"").includes(r))}function Cy(e){let t=dr(e);for(;zn(t)&&!yo(t);){if(ll(t))return t;if(Cs(t))return null;t=dr(t)}return null}function ul(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const $y=new Set(["html","body","#document"]);function yo(e){return $y.has(mo(e))}function kn(e){return on(e).getComputedStyle(e)}function $s(e){return $n(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function dr(e){if(mo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||df(e)&&e.host||Un(e);return df(t)?t.host:t}function ff(e){const t=dr(e);return yo(t)?e.ownerDocument?e.ownerDocument.body:e.body:zn(t)&&ci(t)?t:ff(t)}function gf(e,t,n){var r;t===void 0&&(t=[]);const o=ff(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=on(o);return i?(cl(s),t.concat(s,s.visualViewport||[],ci(o)?o:[],[])):t.concat(o,gf(o,[]))}function cl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hf(e){const t=kn(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=ws(n)!==i||ws(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function vf(e){return $n(e)?e:e.contextElement}function wo(e){const t=vf(e);if(!zn(t))return In(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=hf(t);let s=(i?ws(n.width):n.width)/r,a=(i?ws(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const ky=In(0);function pf(e){const t=on(e);return!ul()||!t.visualViewport?ky:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ey(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==on(e)?!1:t}function di(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=vf(e);let s=In(1);t&&(r?$n(r)&&(s=wo(r)):s=wo(e));const a=Ey(i,n,r)?pf(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=on(i),h=r&&$n(r)?on(r):r;let v=f,b=cl(v);for(;b&&r&&h!==v;){const x=wo(b),C=b.getBoundingClientRect(),m=kn(b),_=C.left+(b.clientLeft+parseFloat(m.paddingLeft))*x.x,p=C.top+(b.clientTop+parseFloat(m.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,g*=x.y,l+=_,c+=p,v=on(b),b=cl(v)}}return bs({width:u,height:g,x:l,y:c})}function dl(e,t){const n=$s(e).scrollLeft;return t?t.left+n:di(Un(e)).left+n}function mf(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:dl(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Sy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Un(r),a=t?Cs(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)&&((mo(r)!=="body"||ci(s))&&(l=$s(r)),zn(r))){const h=di(r);c=wo(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=s&&!g&&!i?mf(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 Py(e){return Array.from(e.getClientRects())}function Ny(e){const t=Un(e),n=$s(e),r=e.ownerDocument.body,o=po(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=po(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+dl(e);const a=-n.scrollTop;return kn(r).direction==="rtl"&&(s+=po(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Ty(e,t){const n=on(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=ul();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}const My=new Set(["absolute","fixed"]);function Hy(e,t){const n=di(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=zn(e)?wo(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 yf(e,t,n){let r;if(t==="viewport")r=Ty(e,n);else if(t==="document")r=Ny(Un(e));else if($n(t))r=Hy(t,n);else{const o=pf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return bs(r)}function wf(e,t){const n=dr(e);return n===t||!$n(n)||yo(n)?!1:kn(n).position==="fixed"||wf(n,t)}function Dy(e,t){const n=t.get(e);if(n)return n;let r=gf(e,[]).filter(a=>$n(a)&&mo(a)!=="body"),o=null;const i=kn(e).position==="fixed";let s=i?dr(e):e;for(;$n(s)&&!yo(s);){const a=kn(s),l=ll(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&My.has(o.position)||ci(s)&&!l&&wf(e,s))?r=r.filter(u=>u!==s):o=a,s=dr(s)}return t.set(e,r),r}function Vy(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Cs(t)?[]:Dy(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const g=yf(t,u,o);return c.top=po(g.top,c.top),c.right=ai(g.right,c.right),c.bottom=ai(g.bottom,c.bottom),c.left=po(g.left,c.left),c},yf(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ay(e){const{width:t,height:n}=hf(e);return{width:t,height:n}}function Oy(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=dl(o)}if(r||!r&&!i)if((mo(t)!=="body"||ci(o))&&(a=$s(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?mf(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 fl(e){return kn(e).position==="static"}function _f(e,t){if(!zn(e)||kn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Un(e)===n&&(n=n.ownerDocument.body),n}function bf(e,t){const n=on(e);if(Cs(e))return n;if(!zn(e)){let o=dr(e);for(;o&&!yo(o);){if($n(o)&&!fl(o))return o;o=dr(o)}return n}let r=_f(e,t);for(;r&&yy(r)&&fl(r);)r=_f(r,t);return r&&yo(r)&&fl(r)&&!ll(r)?n:r||Cy(e)||n}const Ly=async function(e){const t=this.getOffsetParent||bf,n=this.getDimensions,r=await n(e.floating);return{reference:Oy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Iy(e){return kn(e).direction==="rtl"}const zy={convertOffsetParentRelativeRectToViewportRelativeRect:Sy,getDocumentElement:Un,getClippingRect:Vy,getOffsetParent:bf,getElementRects:Ly,getClientRects:Py,getDimensions:Ay,getScale:wo,isElement:$n,isRTL:Iy},Ry=hy,By=vy,Fy=dy,Yy=cy,qy=(e,t,n)=>{const r=new Map,o={platform:zy,...n},i={...o.platform,_c:r};return uy(e,t,{...o,platform:i})},Xy=({trigger:e,triggerEvent:t,floatContent:n,placement:r="bottom",offsetOptions:o,flipOptions:i,shiftOptions:s,interactive:a,showArrow:l})=>{if(typeof e=="string"){const C=document.querySelector(e);if(C)e=C;else throw new Error("element not found by document.querySelector('"+e+"')")}let c;if(typeof n=="string"){const C=document.querySelector(n);if(C)c=C;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(){qy(e,c,{placement:r,middleware:[Ry(o),Fy(i),By(s),...l?[Yy({element:u})]:[]]}).then(({x:C,y:m,placement:_,middlewareData:p})=>{if(Object.assign(c.style,{left:`${C}px`,top:`${m}px`}),l){const{x:E,y:N}=p.arrow,S={top:"bottom",right:"left",bottom:"top",left:"right"}[_.split("-")[0]];Object.assign(u.style,{zIndex:-1,left:E!=null?`${E}px`:"",top:N!=null?`${N}px`:"",right:"",bottom:"",[S]:"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(C){C.stopPropagation(),f?v():h()}function x(C){c.contains(C.target)||v()}return(!t||t.length==0)&&(t=["click"]),t.forEach(C=>{e.addEventListener(C,b)}),document.addEventListener("click",x),{destroy(){t.forEach(C=>{e.removeEventListener(C,b)}),document.removeEventListener("click",x)},hide(){v()},isVisible(){return f}}};var Wy=ie('<div style="position: relative"><div><!></div> <div style="display: none; width: 100%;z-index: 9999"><!></div></div>');function _o(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;tn(()=>(a=Xy({trigger:i,floatContent:s,interactive:!0,placement:o()}),()=>{a.destroy()}));function l(){a.hide()}var c=Wy(),u=Y(c),g=Y(u);Pr(g,n),F(u),_n(u,v=>i=v,()=>i);var f=R(u,2),h=Y(f);return Pr(h,r),F(f),_n(f,v=>s=v,()=>s),F(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()}})}ue(_o,{children:{},floating:{},placement:{}},[],["hide"],!0);function st(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=qe(),a=he(s);return xg(a,()=>`h${r()}`,!1,(l,c)=>{nn(l,()=>({class:"tf-heading",style:`margin-top:${o()||"0"};margin-bottom:${i()||"0"}`}));var u=qe(),g=he(u);Pr(g,()=>n()??_t),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()}})}ue(st,{children:{},level:{},mt:{},mb:{}},[],[],!0);var Zy=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 Ky={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),ot(e,Ky);const n=Tt(t,["$$slots","$$events","$$legacy","$$host"]);Je(e,vt(()=>n,{get class(){return`input-btn-more ${t.class??""}`},children:(r,o)=>{var i=Zy();D(r,i)},$$slots:{default:!0}})),ge()}ue(ks,{},[],[],!0);var jy=ie('<div role="alert" aria-live="polite"><div class="toast-content svelte-us4e73"><span class="toast-icon svelte-us4e73"> </span> <span class="toast-message svelte-us4e73"> </span> <button class="toast-close svelte-us4e73" aria-label="关闭">×</button></div></div>');const Uy={hash:"svelte-us4e73",code:`.toast.svelte-us4e73 {position:fixed;top:20px;right:20px;min-width:300px;max-width:500px;background:white;border-radius:8px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);z-index:1000;
5
+ animation: svelte-us4e73-slideIn 0.3s ease-out;border-left:4px solid;}.toast-info.svelte-us4e73 {border-left-color:#3b82f6;}.toast-success.svelte-us4e73 {border-left-color:#10b981;}.toast-warning.svelte-us4e73 {border-left-color:#f59e0b;}.toast-error.svelte-us4e73 {border-left-color:#ef4444;}.toast-content.svelte-us4e73 {display:flex;align-items:center;padding:12px 16px;gap:8px;}.toast-icon.svelte-us4e73 {font-size:16px;font-weight:bold;flex-shrink:0;}.toast-info.svelte-us4e73 .toast-icon:where(.svelte-us4e73) {color:#3b82f6;}.toast-success.svelte-us4e73 .toast-icon:where(.svelte-us4e73) {color:#10b981;}.toast-warning.svelte-us4e73 .toast-icon:where(.svelte-us4e73) {color:#f59e0b;}.toast-error.svelte-us4e73 .toast-icon:where(.svelte-us4e73) {color:#ef4444;}.toast-message.svelte-us4e73 {flex:1;font-size:14px;color:#374151;line-height:1.4;}.toast-close.svelte-us4e73 {background:none;border:none;font-size:18px;color:#9ca3af;cursor:pointer;padding:0;width:20px;height:20px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background-color 0.2s;}.toast-close.svelte-us4e73:hover {background-color:#f3f4f6;color:#6b7280;}
8
6
 
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 Pf(e,t){fe(t,!0),lt(e,Yw);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}=Ut(),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=Aw();D(g,f)},children:(g,f)=>{var h=qw(),v=he(h),b=W(v);it(b,{level:3,children:(le,pe)=>{Te();var se=Re("输入参数");D(le,se)},$$slots:{default:!0}});var x=R(b,2);Je(x,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(le,pe)=>{var se=Lw();D(le,se)},$$slots:{default:!0}}),Y(v);var C=R(v,2);jt(C,{});var p=R(C,2);it(p,{level:3,mt:"10px",children:(le,pe)=>{Te();var se=Re("模型设置");D(le,se)},$$slots:{default:!0}});var _=R(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=R(m,2);ks(k,{}),Y(_);var N=R(_,4),P=W(N),O=W(P),L=W(O);Y(O);var V=R(O,2);Fn(V),V.__input=[Iw,l,o],Y(P),Y(N);var A=R(N,2),I=W(A),B=W(I),E=W(B);Y(B);var $=R(B,2);Fn($),$.__input=[zw,l,o],Y(I),Y(A);var S=R(A,2),T=W(S),M=W(T),H=W(M);Y(M);var z=R(M,2);Fn(z),z.__input=[Rw,l,o],Y(T),Y(S);var U=R(S,4),Z=W(U);{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(U);var ee=R(U,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=R(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=R(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=R(ne,2);{var Ne=le=>{Je(le,{class:"input-btn-more",style:"margin-left: 10px",onclick:()=>{i(o,"outputDefs")},children:(pe,se)=>{var j=Bw();D(pe,j)},$$slots:{default:!0}})};ye(_e,le=>{n().outType==="json"&&le(Ne)})}Y(Q);var Ve=R(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(Pf,{data:{}},[],[],!0);var Fw=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>'),Ww=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></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>'),Zw=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 Kw={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 Nf(e,t){fe(t,!0),lt(e,Kw);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}=Ut(),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=Fw();D(c,u)},children:(c,u)=>{var g=Zw(),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=R(h,2);Je(v,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(L,V)=>{var A=Ww();D(L,A)},$$slots:{default:!0}}),Y(f);var b=R(f,2);jt(b,{});var x=R(b,2);it(x,{level:3,mt:"10px",children:(L,V)=>{Te();var A=Re("代码");D(L,A)},$$slots:{default:!0}});var C=R(x,4),p=W(C);{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(C);var _=R(C,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=R(_,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=R(N,2);Je(P,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(L,V)=>{var A=Xw();D(L,A)},$$slots:{default:!0}}),Y(k);var O=R(k,2);hr(O,{}),D(c,g)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(l){n(l),y()}})}ce(Nf,{data:{}},[],[],!0);var Uw=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>'),Gw=ie('<div class="heading svelte-15t2v24"><!> <!></div> <!> <!> <div class="setting-item svelte-15t2v24"><!></div> <div class="heading svelte-15t2v24"><!></div> <!>',1);const Jw={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 Tf(e,t){fe(t,!0),lt(e,Jw);const n=w(t,"data",7),r=Nt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn(),{updateNodeData:s}=Ut();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=Uw();D(l,c)},children:(l,c)=>{var u=Gw(),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=R(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=R(g,2);jt(v,{});var b=R(v,2);it(b,{level:3,mt:"10px",mb:"10px",children:(k,N)=>{Te();var P=Re("模板内容");D(k,P)},$$slots:{default:!0}});var x=R(b,2),C=W(x);{let k=Ee(()=>n().template||"");Tt(C,{rows:10,placeholder:"请输入模板内容",style:"width: 100%",onchange:N=>{s(o,()=>({template:N.target.value}))},get value(){return d(k)}})}Y(x);var p=R(x,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=R(p,2);hr(m,{}),D(l,u)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(a){n(a),y()}})}ce(Tf,{data:{}},[],[],!0);var Qw=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>'),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_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),r_=ie('<div class="heading svelte-1mo2w1q" style="padding-top: 10px"><!> <!></div> <!>',1),o_=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-1mo2w1q" style="padding-top: 10px"><!> <!></div> <!>',1),s_=ie('<div style="width: 100%"><!></div>'),a_=ie('<div style="width: 100%"><!></div>'),l_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),u_=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 c_={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 Mf(e,t){fe(t,!0),lt(e,c_);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}=Ut();return En(e,ht({get data(){return n()}},()=>r,{icon:c=>{var u=Qw();D(c,u)},children:(c,u)=>{var g=u_(),f=he(g),h=W(f);it(h,{level:3,children:(j,ue)=>{Te();var F=Re("输入参数");D(j,F)},$$slots:{default:!0}});var v=R(h,2);Je(v,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i)},children:(j,ue)=>{var F=e_();D(j,F)},$$slots:{default:!0}}),Y(f);var b=R(f,2);jt(b,{});var x=R(b,2);it(x,{level:3,mt:"10px",children:(j,ue)=>{Te();var F=Re("URL 地址");D(j,F)},$$slots:{default:!0}});var C=R(x,2),p=W(C),_=W(p);{let j=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(j)}})}Y(p);var m=R(p,2),k=W(m);{let j=Ee(()=>n().url||"");Ct(k,{placeholder:"请输入url",style:"width: 100%",onchange:ue=>{a(i,()=>({url:ue.target.value}))},get value(){return d(j)}})}Y(m),Y(C);var N=R(C,2),P=W(N);it(P,{level:3,children:(j,ue)=>{Te();var F=Re("Http 头信息");D(j,F)},$$slots:{default:!0}});var O=R(P,2);Je(O,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"headers")},children:(j,ue)=>{var F=t_();D(j,F)},$$slots:{default:!0}}),Y(N);var L=R(N,2);jt(L,{dataKeyName:"headers"});var V=R(L,2);it(V,{level:3,mt:"10px",children:(j,ue)=>{Te();var F=Re("Body");D(j,F)},$$slots:{default:!0}});var A=R(V,2),I=W(A),B=W(I);{let j=Ee(()=>!n().bodyType);Ct(B,{type:"radio",name:"bodyType",value:"",get checked(){return d(j)},onchange:ue=>{var F;(F=ue.target)!=null&&F.checked&&a(i,{bodyType:""})}})}Te(),Y(I);var E=R(I,2),$=W(E);{let j=Ee(()=>n().bodyType==="form-data");Ct($,{type:"radio",name:"bodyType",value:"form-data",get checked(){return d(j)},onchange:ue=>{var F;(F=ue.target)!=null&&F.checked&&a(i,{bodyType:"form-data"})}})}Te(),Y(E);var S=R(E,2),T=W(S);{let j=Ee(()=>n().bodyType==="x-www-form-urlencoded");Ct(T,{type:"radio",name:"bodyType",value:"x-www-form-urlencoded",get checked(){return d(j)},onchange:ue=>{var F;(F=ue.target)!=null&&F.checked&&a(i,{bodyType:"x-www-form-urlencoded"})}})}Te(),Y(S);var M=R(S,2),H=W(M);{let j=Ee(()=>n().bodyType==="json");Ct(H,{type:"radio",name:"bodyType",value:"json",get checked(){return d(j)},onchange:ue=>{var F;(F=ue.target)!=null&&F.checked&&a(i,{bodyType:"json"})}})}Te(),Y(M);var z=R(M,2),U=W(z);{let j=Ee(()=>n().bodyType==="raw");Ct(U,{type:"radio",name:"bodyType",value:"raw",get checked(){return d(j)},onchange:ue=>{var F;(F=ue.target)!=null&&F.checked&&a(i,{bodyType:"raw"})}})}Te(),Y(z),Y(A);var Z=R(A,2);{var ee=j=>{var ue=r_(),F=he(ue),we=W(F);it(we,{level:3,children:(Be,Ae)=>{Te();var me=Re("参数");D(Be,me)},$$slots:{default:!0}});var Pe=R(we,2);Je(Pe,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"formData")},children:(Be,Ae)=>{var me=n_();D(Be,me)},$$slots:{default:!0}}),Y(F);var Oe=R(F,2);jt(Oe,{dataKeyName:"formData"}),D(j,ue)};ye(Z,j=>{n().bodyType==="form-data"&&j(ee)})}var re=R(Z,2);{var Q=j=>{var ue=i_(),F=he(ue),we=W(F);it(we,{level:3,children:(Be,Ae)=>{Te();var me=Re("Body 参数");D(Be,me)},$$slots:{default:!0}});var Pe=R(we,2);Je(Pe,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"formUrlencoded")},children:(Be,Ae)=>{var me=o_();D(Be,me)},$$slots:{default:!0}}),Y(F);var Oe=R(F,2);jt(Oe,{dataKeyName:"formUrlencoded"}),D(j,ue)};ye(re,j=>{n().bodyType==="x-www-form-urlencoded"&&j(Q)})}var de=R(re,2);{var ne=j=>{var ue=s_(),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(j,ue)};ye(de,j=>{n().bodyType==="json"&&j(ne)})}var _e=R(de,2);{var Ne=j=>{var ue=a_(),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(j,ue)};ye(_e,j=>{n().bodyType==="raw"&&j(Ne)})}var Ve=R(_e,2),le=W(Ve);it(le,{level:3,mt:"10px",children:(j,ue)=>{Te();var F=Re("输出参数");D(j,F)},$$slots:{default:!0}});var pe=R(le,2);Je(pe,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"outputDefs")},children:(j,ue)=>{var F=l_();D(j,F)},$$slots:{default:!0}}),Y(Ve);var se=R(Ve,2);hr(se,{}),D(c,g)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(l){n(l),y()}})}ce(Mf,{data:{}},[],[],!0);var d_=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>'),f_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),g_=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 h_={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),lt(e,h_);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}=Ut();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=d_();D(u,g)},children:(u,g)=>{var f=g_(),h=he(f),v=W(h);it(v,{level:3,children:(A,I)=>{Te();var B=Re("输入参数");D(A,B)},$$slots:{default:!0}});var b=R(v,2);Je(b,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(A,I)=>{var B=f_();D(A,B)},$$slots:{default:!0}}),Y(h);var x=R(h,2);jt(x,{});var C=R(x,2);it(C,{level:3,mt:"10px",children:(A,I)=>{Te();var B=Re("知识库设置");D(A,B)},$$slots:{default:!0}});var p=R(C,4),_=W(p);{let A=Ee(()=>n().knowledgeId?[n().knowledgeId]:[]);hn(_,{get items(){return d(a)},style:"width: 100%",placeholder:"请选择知识库",onSelect:I=>{const B=I.value;l(o,()=>({knowledgeId:B}))},get value(){return d(A)}})}Y(p);var m=R(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=R(m,4),P=W(N);{let A=Ee(()=>n().limit||"");Ct(P,{placeholder:"搜索的数据条数",style:"width: 100%",onchange:I=>{const B=I.target.value;l(o,()=>({limit:B}))},get value(){return d(A)}})}Y(N);var O=R(N,2),L=W(O);it(L,{level:3,mt:"10px",children:(A,I)=>{Te();var B=Re("输出参数");D(A,B)},$$slots:{default:!0}}),Y(O);var V=R(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 v_=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>'),p_=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-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 y_={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 Df(e,t){fe(t,!0),lt(e,y_);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}=Ut();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=v_();D(u,g)},children:(u,g)=>{var f=m_(),h=he(f),v=W(h);it(v,{level:3,children:(A,I)=>{Te();var B=Re("输入参数");D(A,B)},$$slots:{default:!0}});var b=R(v,2);Je(b,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(A,I)=>{var B=p_();D(A,B)},$$slots:{default:!0}}),Y(h);var x=R(h,2);jt(x,{});var C=R(x,2);it(C,{level:3,mt:"10px",children:(A,I)=>{Te();var B=Re("搜索引擎设置");D(A,B)},$$slots:{default:!0}});var p=R(C,4),_=W(p);{let A=Ee(()=>n().engine?[n().engine]:[]);hn(_,{get items(){return d(a)},style:"width: 100%",placeholder:"请选择搜索引擎",onSelect:I=>{const B=I.value;l(o,()=>({engine:B}))},get value(){return d(A)}})}Y(p);var m=R(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=R(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=R(N,2),L=W(O);it(L,{level:3,mt:"10px",children:(A,I)=>{Te();var B=Re("输出参数");D(A,B)},$$slots:{default:!0}}),Y(O);var V=R(O,2);hr(V,{}),D(u,f)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(c){n(c),y()}})}ce(Df,{data:{}},[],[],!0);var w_=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>'),__=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),b_=ie('<div class="heading svelte-1eqcy61"><!></div> <!> <div class="heading svelte-1eqcy61"><!> <!></div> <!>',1);const x_={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 Vf(e,t){fe(t,!0),lt(e,x_);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=w_();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=b_(),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=R(g,2);jt(h,{dataKeyName:"loopVars"});var v=R(h,2),b=W(v);it(b,{level:3,children:(p,_)=>{Te();var m=Re("输出参数");D(p,m)},$$slots:{default:!0}});var x=R(b,2);Je(x,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(p,_)=>{var m=__();D(p,m)},$$slots:{default:!0}}),Y(v);var C=R(v,2);jt(C,{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(Vf,{data:{}},[],[],!0);const C_={startNode:bf,codeNode:Nf,llmNode:Pf,templateNode:Tf,httpNode:Mf,knowledgeNode:Hf,searchEngineNode:Df,loopNode:Vf,endNode:kf};var $_=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=$_(),g=he(u);fa(g,n);var f=R(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 E_=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>'),k_=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>'),S_=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 Of(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 C=Object.keys(l).sort((p,_)=>(l[p].sortNo||0)-(l[_].sortNo||0));for(let p of C)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 C=typeof a.hiddenNodes=="function"?a.hiddenNodes():a.hiddenNodes;if(Array.isArray(C)){for(let p of C)for(let _=0;_<o.length;_++)if(o[_].type===p){o.splice(_,1);break}}}var c=S_(),u=W(c),g=W(u),f=W(g);Gd(f,{style:"width: 100%",get items(){return i},onChange:C=>{te(n,C.value.toString(),!0)}}),Y(g);var h=R(g,2),v=W(h);Yt(v,21,()=>o,Qr,(C,p)=>{fl(C,ht(()=>d(p)))}),Y(v);var b=R(v,2);Yt(b,21,()=>s,Qr,(C,p)=>{fl(C,ht(()=>d(p)))}),Y(b),Y(h),Y(u);var x=R(u,2);Je(x,{onclick:()=>{te(r,d(r)?"":"show",!0)},children:(C,p)=>{var _=Ze(),m=he(_);{var k=P=>{var O=E_();D(P,O)},N=P=>{var O=k_();D(P,O)};ye(m,P=>{d(r)==="show"?P(k):P(N,!1)})}D(C,_)},$$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(Of,{},[],[],!0);const P_=()=>{const{nodeLookup:e}=tt();return{getNode:n=>{var o;return(o=J(e).get(n))==null?void 0:o.internals.userNode}}},N_=()=>{const{nodes:e}=tt();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})}}},T_=()=>{const{edges:e}=tt();return{getEdgesByTarget:n=>J(e).filter(o=>o.target===n)}};var M_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),H_=ie('<div class="heading 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>',1),O_=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),A_=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),L_=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),I_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),z_=ie('<div class="heading svelte-q0cqsa"><!> <!></div> <!>',1),R_=ie("<!> <!> <div></div> <!>",1);const B_={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;}
7
+ @keyframes svelte-us4e73-slideIn {
8
+ from {
9
+ transform: translateX(100%);
10
+ opacity: 0;
11
+ }
12
+ to {
13
+ transform: translateX(0);
14
+ opacity: 1;
15
+ }
16
+ }
10
17
 
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 Af(e,t){var x;fe(t,!0),lt(e,B_);const n=w(t,"data",7),r=Nt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn(),s=Ut(),{updateNodeData:a}=s,l=C=>{a(o,C)},c=(C,p)=>{var _;l({[C]:(_=p.target)==null?void 0:_.value})},u={...r,id:o,data:n()},g=document.createElement("div"),h=gr().customNodes[t.type];(x=h.render)==null||x.call(h,g,u,s);const v=h.forms;let b;un(()=>{n().expand&&b&&b.append(g)}),un(()=>{var C;n()&&((C=h.onUpdate)==null||C.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 C=_=>{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:C,children:(_,m)=>{var k=R_(),N=he(k);{var P=B=>{var E=H_(),$=he(E),S=W($);it(S,{level:3,children:(z,U)=>{Te();var Z=Re("输入参数");D(z,Z)},$$slots:{default:!0}});var T=R(S,2);{var M=z=>{Je(z,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(U,Z)=>{var ee=M_();D(U,ee)},$$slots:{default:!0}})};ye(T,z=>{h.parametersAddEnable!==!1&&z(M)})}Y($);var H=R($,2);jt(H,{}),D(B,E)};ye(N,B=>{h.parametersEnable!==!1&&B(P)})}var O=R(N,2);{var L=B=>{var E=Ze(),$=he(E);Yt($,17,()=>v,Qr,(S,T)=>{var M=Ze(),H=he(M);{var z=Z=>{var ee=D_(),re=he(ee),Q=W(re,!0);Y(re);var de=R(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)},U=Z=>{var ee=Ze(),re=he(ee);{var Q=ne=>{var _e=V_(),Ne=he(_e),Ve=W(Ne,!0);Y(Ne);var le=R(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:j=>{c(d(T).name,j)}}))}Y(le),De(()=>vt(Ve,d(T).label)),D(ne,_e)},de=ne=>{var _e=Ze(),Ne=he(_e);{var Ve=pe=>{var se=O_(),j=he(se),ue=W(j,!0);Y(j);var F=R(j,2),we=W(F),Pe=W(we),Oe=W(Pe);Y(Pe);var Be=R(Pe,2);Fn(Be);var Ae=me=>l({[d(T).name]:parseFloat(me.target.value)});tn(Be,()=>({class:"nodrag",type:"range",...d(T).attrs,value:n()[d(T).name]??d(T).defaultValue,oninput:Ae}),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(),j=he(se);{var ue=we=>{var Pe=A_(),Oe=he(Pe),Be=W(Oe,!0);Y(Oe);var Ae=R(Oe,2),me=W(Ae);{let ze=Ee(()=>d(T).options||[]),je=Ee(()=>n()[d(T).name]?[n()[d(T).name]]:[d(T).defaultValue]);hn(me,{get items(){return d(ze)},style:"width: 100%",get placeholder(){return d(T).placeholder},onSelect:st=>{const K=st.value;l({[d(T).name]:K})},get value(){return d(je)}})}Y(Ae),De(()=>vt(Be,d(T).label)),D(we,Pe)},F=we=>{var Pe=Ze(),Oe=he(Pe);{var Be=me=>{var ze=L_(),je=he(ze),st=W(je,!0);Y(je);var K=R(je,2),Ge=W(K);{let Qe=Ee(()=>{var ft;return(ft=d(T).chosen)==null?void 0:ft.buttonText});jd(Ge,{style:"width: 100%",get placeholder(){return d(T).placeholder},get buttonText(){return d(Qe)},onChosen:(ft,on,nt)=>{var $e,Fe;(Fe=($e=d(T).chosen)==null?void 0:$e.onChosen)==null||Fe.call($e,l,ft,on,nt)},get value(){var ft;return n()[((ft=d(T).chosen)==null?void 0:ft.valueDataKey)||""]},get label(){var ft;return n()[((ft=d(T).chosen)==null?void 0:ft.labelDataKey)||""]}})}Y(K),De(()=>vt(st,d(T).label)),D(me,ze)},Ae=me=>{var ze=Ze(),je=he(ze);{var st=K=>{it(K,ht({level:3,mt:"10px"},()=>d(T).attrs,{children:(Ge,Qe)=>{Te();var ft=Re();De(()=>vt(ft,d(T).label)),D(Ge,ft)},$$slots:{default:!0}}))};ye(je,K=>{d(T).type==="heading"&&K(st)},!0)}D(me,ze)};ye(Oe,me=>{d(T).type==="chosen"?me(Be):me(Ae,!1)},!0)}D(we,Pe)};ye(j,we=>{d(T).type==="select"?we(ue):we(F,!1)},!0)}D(pe,se)};ye(Ne,pe=>{d(T).type==="slider"?pe(Ve):pe(le,!1)},!0)}D(ne,_e)};ye(re,ne=>{d(T).type==="textarea"?ne(Q):ne(de,!1)},!0)}D(Z,ee)};ye(H,Z=>{d(T).type==="input"?Z(z):Z(U,!1)})}D(S,M)}),D(B,E)};ye(O,B=>{v&&B(L)})}var V=R(O,2);Vn(V,B=>b=B,()=>b);var A=R(V,2);{var I=B=>{var E=z_(),$=he(E),S=W($);it(S,{level:3,mt:"10px",children:(z,U)=>{Te();var Z=Re("输出参数");D(z,Z)},$$slots:{default:!0}});var T=R(S,2);{var M=z=>{Je(z,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(U,Z)=>{var ee=I_();D(U,ee)},$$slots:{default:!0}})};ye(T,z=>{h.outputDefsAddEnable!==!1&&z(M)})}Y($);var H=R($,2);hr(H,{}),D(B,E)};ye(A,B=>{h.outputDefsEnable!==!1&&B(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(C){n(C),y()}})}ce(Af,{data:{}},[],[],!0);const q_=()=>{const e=tt();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))}}},Y_=()=>{const{edges:e}=tt();return{deleteEdge:n=>{e.update(r=>r.filter(o=>o.id!==n))}}};var F_=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>'),W_=ie("<!> <!> <!> <!>",1),X_=ie('<div style="position: relative; height: 100%; width: 100%;overflow: hidden"><!> <!></div>');const Z_={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 Lf(e,t){fe(t,!0),lt(e,Z_);const[n,r]=dt(),o=()=>oe(L,"$nodes",n),i=()=>oe(V,"$edges",n),s=()=>oe(A,"$viewport",n),a=w(t,"onInit",7),l=Ut();a()(l);let c=zt(!1),u=zt(void 0);const{updateEdgeData:g}=q_(),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):{};if(Object.keys(z).length===0)return;const U={id:`node_${Ir()}`,position:M,data:{},...z};ws.addNode(U),ws.selectNodeOnly(U.id)},{getNode:v}=P_(),b=T=>{const M=v(T.source),H=v(T.target);if(T.sourceHandle==="loop_handle"||M.parentId){const z=l.getEdges();for(let U of z)if(U.target===T.target){const Z=v(U.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:x}=N_(),C=(T,M)=>{if(!M.isValid)return;const H=M.toNode;if(H.parentId)return;const z=M.fromNode,U=M.fromHandle,Z={position:{...H.position}};if(U.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},x(Z.parentId,H.id),l.updateNode(H.id,Z)}},{getEdgesByTarget:p}=T_(),_=T=>{T.edges.forEach(H=>{var U;H.id===((U=d(u))==null?void 0:U.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}=Y_(),k=(T,M)=>{},N=T=>{},P={},O=gr().customNodes;if(O)for(let T of Object.keys(O))P[T]=Af;const{nodes:L,edges:V,viewport:A}=tt(),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 B=X_(),E=W(B);{let T=Ee(()=>({...C_,...P})),M=Ee(()=>({markerEnd:{type:Vr.ArrowClosed,width:20,height:20}}));Hd(E,ht({get nodeTypes(){return d(T)}},()=>ws,{class:"tinyflow-logo",isValidConnection:b,onconnectend:C,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 U=W_(),Z=he(U);qd(Z,{});var ee=R(Z,2);zd(ee,{});var re=R(ee,2);Fd(re,{});var Q=R(re,2);{var de=ne=>{ii(ne,{children:(_e,Ne)=>{var Ve=F_(),le=R(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=R(le,2),j=W(se);Je(j,{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=R(j,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}})};ye(Q,ne=>{d(c)&&ne(de)})}D(H,U)},$$slots:{default:!0}}))}var $=R(E,2);Of($,{}),Y(B),D(e,B);var S=ge({get onInit(){return a()},set onInit(T){a(T),y()}});return r(),S}ce(Lf,{onInit:{}},[],[],!0);function K_(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()),Dd(e,{fitView:!0,children:(i,s)=>{Lf(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(K_,{options:{},onInit:{}},[],[],!1));const U_=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))}});rt.Tinyflow=U_,Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"})});
18
+ /* 响应式设计 */
19
+ @media (max-width: 640px) {.toast.svelte-us4e73 {left:20px;right:20px;min-width:auto;max-width:none;}
20
+ }`};function xf(e,t){fe(t,!0),ot(e,Uy);let n=w(t,"message",7),r=w(t,"type",7,"info"),o=w(t,"duration",7,3e3),i=w(t,"visible",7,!0),s=w(t,"onClose",7),a=Vt(void 0),l;tn(()=>(o()>0&&(l=setTimeout(()=>{var v;i(!1),(v=s())==null||v()},o())),()=>{l&&clearTimeout(l)}));function c(){var v;i(!1),(v=s())==null||v(),l&&clearTimeout(l)}function u(){switch(r()){case"success":return"✓";case"warning":return"⚠";case"error":return"✕";default:return"ℹ"}}var g=qe(),f=he(g);{var h=v=>{var b=jy(),x=Y(b),C=Y(x),m=Y(C,!0);F(C);var _=R(C,2),p=Y(_,!0);F(_);var E=R(_,2);E.__click=c,F(x),F(b),_n(b,N=>te(a,N),()=>d(a)),Ve(N=>{Nt(b,1,`toast toast-${r()??""}`,"svelte-us4e73"),ft(m,N),ft(p,n())},[u]),D(v,b)};pe(f,v=>{i()&&v(h)})}return D(e,g),ge({get message(){return n()},set message(v){n(v),y()},get type(){return r()},set type(v="info"){r(v),y()},get duration(){return o()},set duration(v=3e3){o(v),y()},get visible(){return i()},set visible(v=!0){i(v),y()},get onClose(){return s()},set onClose(v){s(v),y()}})}Sr(["click"]),ue(xf,{message:{},type:{},duration:{},visible:{},onClose:{}},[],[],!0);const gl=xe([]);let Gy=0;function Es(e){const t=`toast-${++Gy}`,n={id:t,duration:3e3,...e};return gl.update(r=>[...r,n]),t}function Jy(e){gl.update(t=>t.filter(n=>n.id!==e))}const Ss={success:(e,t)=>Es({message:e,type:"success",duration:t}),warning:(e,t)=>Es({message:e,type:"warning",duration:t}),error:(e,t)=>Es({message:e,type:"error",duration:t}),info:(e,t)=>Es({message:e,type:"info",duration:t})};var Qy=ie('<div class="toast-container svelte-1li0m91"></div>');const ew={hash:"svelte-1li0m91",code:`.toast-container.svelte-1li0m91 {position:fixed;top:20px;right:20px;z-index:1000;pointer-events:none;display:flex;flex-direction:column;gap:8px;}.toast-container.svelte-1li0m91 .toast {pointer-events:auto;position:relative;top:unset;right:unset;}
21
+
22
+ @media (max-width: 640px) {.toast-container.svelte-1li0m91 {left:20px;right:20px;}
23
+ }`};function Cf(e,t){fe(t,!1),ot(e,ew);const[n,r]=ct(),o=()=>oe(gl,"$toasts",n);function i(a){Jy(a)}Be();var s=Qy();At(s,5,o,a=>a.id,(a,l)=>{xf(a,{get message(){return d(l).message},get type(){return d(l).type},get duration(){return d(l).duration},visible:!0,onClose:()=>i(d(l).id)})}),F(s),D(e,s),ge(),r()}ue(Cf,{},[],[],!0);const tw=()=>{const e=tt();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))}}},zr=(e=16)=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=new Uint8Array(e);return crypto.getRandomValues(n),Array.from(n,r=>t[r%t.length]).join("")},nw=()=>{const{nodes:e,nodeLookup:t}=tt();return{copyNode:r=>{var s;const i=(s=Q(t).get(r))==null?void 0:s.internals.userNode;if(i){const a=zr(),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}))}}}},fr=()=>xr("tinyflow_options");function $t(){return xr("svelteflow__node_id")}var rw=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>'),ow=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>'),iw=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>'),sw=ie('<div class="input-item svelte-ssih1">执行条件: <!></div>'),aw=(e,t,n)=>{const r=e.target.checked;t(n,{async:r})},lw=(e,t,n)=>{const r=e.target.checked;t(n,{loop:r})},uw=ie('<div class="settings svelte-ssih1"><div class="input-item svelte-ssih1">节点名称: <!></div> <div class="input-item svelte-ssih1">参数描述: <!></div> <!> <label class="input-item-inline svelte-ssih1"><span>异步执行:</span> <input type="checkbox"/> <span class="loop-action-text svelte-ssih1">循环执行:</span> <input type="checkbox"/></label></div>'),cw=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>'),dw=ie('<div class="tf-node-toolbar svelte-ssih1"><!> <!> <!> <!></div>'),fw=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 gw={hash:"svelte-ssih1",code:".tf-node-toolbar.svelte-ssih1 {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-ssih1 {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-ssih1 .input-item:where(.svelte-ssih1) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:#666;}.settings.svelte-ssih1 .input-item-inline:where(.svelte-ssih1) {display:flex;align-items:center;font-size:12px;color:#666;}.settings.svelte-ssih1 .input-item-inline:where(.svelte-ssih1) .loop-action-text:where(.svelte-ssih1) {margin-left:12px;}"};function En(e,t){fe(t,!0),ot(e,gw);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:x,getNode:C}=jt(),m=ke(()=>[{key:"key",icon:o(),title:n().title,description:n().description,content:s()}]),{deleteNode:_}=tw(),{copyNode:p}=nw(),E=fr(),N=()=>{var H;(H=E.onNodeExecute)==null||H.call(E,C(r()))};let S=$t();var A=fw(),L=he(A);{var V=H=>{Jd(H,{get position(){return Pe.Top},align:"end",children:(I,W)=>{var j=dw(),J=Y(j);{var ne=ye=>{Je(ye,{class:"tf-node-toolbar-item",onclick:()=>{_(r())},children:(be,de)=>{var U=rw();D(be,U)},$$slots:{default:!0}})};pe(J,ye=>{c()&&ye(ne)})}var ee=R(J,2);{var ce=ye=>{Je(ye,{class:"tf-node-toolbar-item",onclick:()=>{p(r())},children:(be,de)=>{var U=ow();D(be,U)},$$slots:{default:!0}})};pe(ee,ye=>{l()&&ye(ce)})}var re=R(ee,2);{var we=ye=>{Je(ye,{class:"tf-node-toolbar-item",onclick:N,children:(be,de)=>{var U=iw();D(be,U)},$$slots:{default:!0}})};pe(re,ye=>{a()&&ye(we)})}var Ne=R(re,2);{var Ae=ye=>{_o(ye,{placement:"bottom",floating:de=>{var U=uw(),se=Y(U),X=R(Y(se));pt(X,{style:"width: 100%;",onchange:Ue=>{const at=Ue.target.value;x(S,{title:at})},get value(){return n().title}}),F(se);var ae=R(se,2),Me=R(Y(ae));Mt(Me,{rows:3,style:"width: 100%;",onchange:Ue=>{const at=Ue.target.value;x(S,{description:at})},get value(){return n().description}}),F(ae);var Ee=R(ae,2);{var Fe=Ue=>{var at=sw(),K=R(Y(at));Mt(K,{rows:2,style:"width: 100%;",onchange:Ge=>{const Qe=Ge.target.value;x(S,{condition:Qe})},get value(){return n().condition}}),F(at),D(Ue,at)};pe(Ee,Ue=>{g()&&Ue(Fe)})}var Oe=R(Ee,2),me=R(Y(Oe),2);Tr(me),me.__change=[aw,x,S];var ze=R(me,4);Tr(ze),ze.__change=[lw,x,S],F(Oe),F(U),Ve(()=>{ku(me,!!n().async),ku(ze,!!n().loop)}),D(de,U)},children:(de,U)=>{Je(de,{class:"tf-node-toolbar-item",children:(se,X)=>{var ae=cw();D(se,ae)},$$slots:{default:!0}})},$$slots:{floating:!0,default:!0}})};pe(Ne,ye=>{u()&&ye(Ae)})}F(j),D(I,j)},$$slots:{default:!0}})};pe(L,H=>{(a()||l()||c())&&H(V)})}var O=R(L,2),z=R(Y(O),2),B=Y(z);rl(B,{get items(){return d(m)},get activeKeys(){return b},onChange:(H,I)=>{var W;x(r(),{expand:I==null?void 0:I.includes("key")}),(W=v())==null||W(I!=null&&I.includes("key")?"key":"")}}),F(z),F(O);var k=R(O,2);{var $=H=>{ar(H,{type:"target",get position(){return Pe.Left},style:" left: -12px;top: 20px"})};pe(k,H=>{h()&&H($)})}var P=R(k,2);{var T=H=>{ar(H,{type:"source",get position(){return Pe.Right},style:"right: -12px;top: 20px"})};pe(P,H=>{f()&&H(T)})}var M=R(P,2);return Pr(M,()=>i()??_t),D(e,A),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()}})}Sr(["change"]),ue(En,{data:{},id:{},icon:{},handle:{},children:{},allowExecute:{},allowCopy:{},allowDelete:{},allowSetting:{},allowSettingOfCondition:{},showSourceHandle:{},showTargetHandle:{},onCollapse:{}},[],[],!0);const $f=[{value:"String",label:"String"},{value:"Number",label:"Number"},{value:"Boolean",label:"Boolean"},{value:"File",label:"File"},{value:"Object",label:"Object"},{value:"Array",label:"Array"}],hw=[{value:"ref",label:"引用"},{value:"fixed",label:"固定值"}];var vw=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>'),pw=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>'),mw=ie('<div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div>',1);const yw={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 kf(e,t){fe(t,!0),ot(e,yw);const[n,r]=ct(),o=()=>oe(d(l),"$node",n),i=w(t,"parameter",7),s=w(t,"index",7);let a=$t(),l=ke(()=>Lr(a)),c=ke(()=>{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,O=>{let z=O.data.parameters;return z[s()][L]=V,{parameters:z}})},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 x=()=>{u(a,L=>{let V=L.data.parameters;return V.splice(s(),1),{parameters:[...V]}}),b==null||b.hide()};var C=mw(),m=he(C),_=Y(m);pt(_,{style:"width: 100%;",get value(){return d(c).name},placeholder:"请输入参数名称",oninput:f}),F(m);var p=R(m,2),E=Y(p);ef(E,{get checked(){return d(c).required},onchange:h}),F(p);var N=R(p,2),S=Y(N);_n(_o(S,{placement:"bottom",floating:V=>{var O=vw(),z=Y(O),B=R(Y(z));{let I=ke(()=>d(c).dataType?[d(c).dataType]:["String"]);hn(B,{get items(){return $f},style:"width: 100%",onSelect:v,get value(){return d(I)}})}F(z);var k=R(z,2),$=R(Y(k));Mt($,{rows:1,style:"width: 100%;",get value(){return d(c).defaultValue},onchange:I=>{const W=I.target.value;g("defaultValue",W)}}),F(k);var P=R(k,2),T=R(Y(P));Mt(T,{rows:3,style:"width: 100%;",get value(){return d(c).description},onchange:I=>{const W=I.target.value;g("description",W)}}),F(P);var M=R(P,2),H=Y(M);Je(H,{onclick:x,children:(I,W)=>{Te();var j=Re("删除");D(I,j)},$$slots:{default:!0}}),F(M),F(O),D(V,O)},children:(V,O)=>{Je(V,{class:"input-btn-more",children:(z,B)=>{var k=pw();D(z,k)},$$slots:{default:!0}})},$$slots:{floating:!0,default:!0}}),V=>b=V,()=>b),F(N),D(e,C);var A=ge({get parameter(){return i()},set parameter(L){i(L),y()},get index(){return s()},set index(L){s(L),y()}});return r(),A}ue(kf,{parameter:{},index:{}},[],[],!0);var ww=ie('<div class="input-header svelte-3n0wca">参数名称</div> <div class="input-header svelte-3n0wca">必填</div> <div class="input-header svelte-3n0wca"></div>',1),_w=ie('<div class="none-params svelte-3n0wca">无输入参数</div>'),bw=ie('<div class="input-container svelte-3n0wca"><!> <!></div>');const xw={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;
24
+ /* 从第一列开始到最后一列结束 */}.input-container.svelte-3n0wca .input-header:where(.svelte-3n0wca) {font-size:12px;color:#666;}`};function Ef(e,t){fe(t,!0),ot(e,xw);const[n,r]=ct(),o=()=>oe(d(s),"$node",n);let i=$t(),s=ke(()=>Lr(i)),a=ke(()=>{var f,h;return[...((h=(f=o())==null?void 0:f.data)==null?void 0:h.parameters)||[]]});var l=bw(),c=Y(l);{var u=f=>{var h=ww();Te(4),D(f,h)};pe(c,f=>{d(a).length!==0&&f(u)})}var g=R(c,2);At(g,19,()=>d(a),f=>f.id,(f,h,v)=>{kf(f,{get parameter(){return d(h)},get index(){return d(v)}})},f=>{var h=_w();D(f,h)}),F(l),D(e,l),ge(),r()}ue(Ef,{},[],[],!0);const Ps=e=>(!e||e.length==0||e.forEach(t=>{t.id||(t.id=zr()),Ps(t.children)}),e),Rn=()=>{const{updateNodeData:e}=jt();return{addParameter:(t,n="parameters",r)=>{Ps(r==null?void 0:r.children);const o={name:"",dataType:"String",refType:"ref",...r,id:zr()};e(t,i=>{let s=i.data[n];return s?s.push(o):s=[o],{[n]:[...s]}})}}};var Cw=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>'),$w=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),kw=ie('<div class="heading svelte-r5g35l"><!> <!></div> <!>',1);const Ew={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 Sf(e,t){fe(t,!0),ot(e,Ew);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn();return En(e,vt(()=>r,{get data(){return n()},allowExecute:!1,showTargetHandle:!1,allowSettingOfCondition:!1,icon:a=>{var l=Cw();D(a,l)},children:(a,l)=>{var c=kw(),u=he(c),g=Y(u);st(g,{level:3,children:(v,b)=>{Te();var x=Re("输入参数");D(v,x)},$$slots:{default:!0}});var f=R(g,2);Je(f,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"parameters",{refType:"input"})},children:(v,b)=>{var x=$w();D(v,x)},$$slots:{default:!0}}),F(u);var h=R(u,2);Ef(h,{}),D(a,c)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(s){n(s),y()}})}ue(Sf,{data:{}},[],[],!0);const Pf=(e,t,n)=>{for(const r of n)r.target===t&&r.source&&(e.push(r.source),Pf(e,r.source,n))},Nf=(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:Nf(r.children,t+"."+r.name,n)})),Tf=(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:Nf(r,e.id,t)}}}},Sw=(e=!1)=>{const t=$t(),n=Lr(t),{nodes:r,edges:o,nodeLookup:i}=tt();return ir([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=Tf(f,h,u);v&&g.push(v)}}else{const f=[];Pf(f,t,l);for(const h of a)if(f.includes(h.id)){const v=h.parentId===s.id,b=Tf(h,v,u);b&&g.push(b)}}return g})};var Pw=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=ie('<div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div>',1);const Tw={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 Mf(e,t){fe(t,!0),ot(e,Tw);const[n,r]=ct(),o=()=>oe(d(g),"$node",n),i=()=>oe(p,"$selectItems",n);tn(()=>{d(f).refType||C({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=ke(()=>Lr(u)),f=ke(()=>{var $;return{...s(),...($=o())==null?void 0:$.data[l()][a()]}});const{updateNodeData:h}=jt(),v=($,P)=>{h(u,T=>{let M=T.data[l()];return M[a()]={...M[a()],[$]:P},{[l()]:M}})},b=($,P)=>{const T=P.target.value;v($,T)},x=$=>{const P=$.value;v("ref",P)},C=$=>{const P=$.value;v("refType",P)};let m;const _=()=>{h(u,$=>{let P=$.data[l()];return P.splice(a(),1),{[l()]:[...P]}}),m==null||m.hide()},p=Sw(c());var E=Nw(),N=he(E),S=Y(N);{let $=ke(()=>d(f).nameDisabled===!0);pt(S,{style:"width: 100%;",get value(){return d(f).name},placeholder:"请输入参数名称",get disabled(){return d($)},oninput:P=>b("name",P)})}F(N);var A=R(N,2),L=Y(A);{var V=$=>{pt($,{get value(){return d(f).value},placeholder:"请输入参数值",oninput:P=>b("value",P)})},O=$=>{var P=qe(),T=he(P);{var M=H=>{{let I=ke(()=>[d(f).ref]);hn(H,{get items(){return i()},style:"width: 100%",defaultValue:["ref"],get value(){return d(I)},expandAll:!0,onSelect:x})}};pe(T,H=>{d(f).refType!=="input"&&H(M)},!0)}D($,P)};pe(L,$=>{d(f).refType==="fixed"?$(V):$(O,!1)})}F(A);var z=R(A,2),B=Y(z);_n(_o(B,{placement:"bottom",floating:P=>{var T=Pw(),M=Y(T),H=R(Y(M));{let ce=ke(()=>d(f).refType?[d(f).refType]:[]);hn(H,{get items(){return hw},style:"width: 100%",defaultValue:["ref"],get value(){return d(ce)},onSelect:C})}F(M);var I=R(M,2),W=R(Y(I));Mt(W,{rows:1,style:"width: 100%;",onchange:ce=>{b("defaultValue",ce)},get value(){return d(f).defaultValue}}),F(I);var j=R(I,2),J=R(Y(j));Mt(J,{rows:3,style:"width: 100%;",onchange:ce=>{b("description",ce)},get value(){return d(f).description}}),F(j);var ne=R(j,2),ee=Y(ne);Je(ee,{onclick:_,children:(ce,re)=>{Te();var we=Re("删除");D(ce,we)},$$slots:{default:!0}}),F(ne),F(T),D(P,T)},children:(P,T)=>{ks(P,{})},$$slots:{floating:!0,default:!0}}),P=>m=P,()=>m),F(z),D(e,E);var k=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(),k}ue(Mf,{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),Hw=ie('<div class="none-params svelte-1sm1mgi"> </div>'),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;
25
+ /* 从第一列开始到最后一列结束 */}.input-container.svelte-1sm1mgi .input-header:where(.svelte-1sm1mgi) {font-size:12px;color:#666;}`};function Ut(e,t){fe(t,!0),ot(e,Vw);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=ke(()=>Lr(l)),u=ke(()=>{var x;return[...((x=o())==null?void 0:x.data[s()])||[]]});var g=Dw(),f=Y(g);{var h=x=>{var C=Mw();Te(4),D(x,C)};pe(f,x=>{d(u).length!==0&&x(h)})}var v=R(f,2);At(v,19,()=>d(u),x=>x.id,(x,C,m)=>{Mf(x,{get parameter(){return d(C)},get index(){return d(m)},get dataKeyName(){return s()},get useChildrenOnly(){return a()}})},x=>{var C=Hw(),m=Y(C,!0);F(C),Ve(()=>ft(m,i())),D(x,C)}),F(g),D(e,g);var b=ge({get noneParameterText(){return i()},set noneParameterText(x="无输入参数"){i(x),y()},get dataKeyName(){return s()},set dataKeyName(x="parameters"){s(x),y()},get useChildrenOnly(){return a()},set useChildrenOnly(x){a(x),y()}});return r(),b}ue(Ut,{noneParameterText:{},dataKeyName:{},useChildrenOnly:{}},[],[],!0);var Aw=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>'),Ow=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Lw=ie('<div class="heading svelte-11h445j"><!> <!></div> <!>',1);const Iw={hash:"svelte-11h445j",code:".heading.svelte-11h445j {display:flex;margin-bottom:10px;}"};function Hf(e,t){fe(t,!0),ot(e,Iw);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn();return En(e,vt({get data(){return n()}},()=>r,{allowExecute:!1,showSourceHandle:!1,icon:a=>{var l=Aw();D(a,l)},children:(a,l)=>{var c=Lw(),u=he(c),g=Y(u);st(g,{level:3,children:(v,b)=>{Te();var x=Re("输出参数");D(v,x)},$$slots:{default:!0}});var f=R(g,2);Je(f,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(v,b)=>{var x=Ow();D(v,x)},$$slots:{default:!0}}),F(u);var h=R(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()}})}ue(Hf,{data:{}},[],[],!0);const hl=e=>JSON.parse(JSON.stringify(e));var zw=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>'),Rw=ie('<div class="input-more-item svelte-1cfeest"><!></div>'),Bw=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>'),Fw=ie('<div class="input-item svelte-1cfeest"><!> <!></div> <div class="input-item svelte-1cfeest"><!> <!></div> <div class="input-item svelte-1cfeest"><!></div>',1);const Yw={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 Df(e,t){fe(t,!0),ot(e,Yw);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=ke(()=>Lr(l)),u=ke(()=>{var P;let k=(P=o())==null?void 0:P.data[a()],$;if(k&&s().length>0){let T=k;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=(k,$)=>{g(l,P=>{const T=P.data[a()];if(T&&s().length>0){let M=T;for(let H=0;H<s().length;H++){const I=s()[H];H==s().length-1?M[I]={...M[I],[k]:$}:M=M[I].children}}return{[a()]:[...hl(T)]}})},h=(k,$)=>{const P=$.target.value;f(k,P)},v=k=>{const $=k.value;f("dataType",$)};let b;const x=()=>{g(l,k=>{let $=k.data[a()];if($&&s().length>0){let P=$;for(let T=0;T<s().length;T++){const M=s()[T];T==s().length-1?P.splice(M,1):P=P[M].children}}return{[a()]:[...hl($)]}}),b==null||b.hide()},C=()=>{g(l,k=>{let $=k.data[a()];if($&&s().length>0){let P=$;for(let T=0;T<s().length;T++){const M=s()[T];T==s().length-1?P[M].children?P[M].children.push({id:zr(),name:"newParam",dataType:"String"}):P[M].children=[{id:zr(),name:"newParam",dataType:"String"}]:P=P[M].children}}return{[a()]:[...hl($)]}})};var m=Fw(),_=he(m),p=Y(_);{var E=k=>{var $=qe(),P=he($);At(P,17,s,eo,(T,M)=>{Te();var H=Re(" ");D(T,H)}),D(k,$)};pe(p,k=>{s().length>1&&k(E)})}var N=R(p,2);{let k=ke(()=>d(u).nameDisabled===!0);pt(N,{style:"width: 100%;",get value(){return d(u).name},placeholder:"请输入参数名称",oninput:$=>{h("name",$)},get disabled(){return d(k)}})}F(_);var S=R(_,2),A=Y(S);{let k=ke(()=>d(u).dataType?[d(u).dataType]:[]),$=ke(()=>d(u).dataTypeDisabled===!0);hn(A,{get items(){return $f},style:"width: 100%",defaultValue:["String"],get value(){return d(k)},get disabled(){return d($)},onSelect:v})}var L=R(A,2);{var V=k=>{Je(k,{class:"input-btn-more",style:"margin-left: auto",onclick:C,children:($,P)=>{var T=zw();D($,T)},$$slots:{default:!0}})};pe(L,k=>{(d(u).dataType==="Object"||d(u).dataType==="Array")&&d(u).addChildDisabled!==!0&&k(V)})}F(S);var O=R(S,2),z=Y(O);_n(_o(z,{placement:"bottom",floating:$=>{var P=Bw(),T=Y(P),M=R(Y(T));{let J=ke(()=>d(u).defaultValue||"");Mt(M,{rows:1,style:"width: 100%;",get value(){return d(J)},onchange:ne=>{h("defaultValue",ne)}})}F(T);var H=R(T,2),I=R(Y(H));{let J=ke(()=>d(u).description||"");Mt(I,{rows:3,style:"width: 100%;",get value(){return d(J)},onchange:ne=>{h("description",ne)}})}F(H);var W=R(H,2);{var j=J=>{var ne=Rw(),ee=Y(ne);Je(ee,{onclick:x,children:(ce,re)=>{Te();var we=Re("删除");D(ce,we)},$$slots:{default:!0}}),F(ne),D(J,ne)};pe(W,J=>{d(u).deleteDisabled!==!0&&J(j)})}F(P),D($,P)},children:($,P)=>{ks($,{})},$$slots:{floating:!0,default:!0}}),$=>b=$,()=>b),F(O),D(e,m);var B=ge({get parameter(){return i()},set parameter(k){i(k),y()},get position(){return s()},set position(k){s(k),y()},get dataKeyName(){return a()},set dataKeyName(k){a(k),y()}});return r(),B}ue(Df,{parameter:{},position:{},dataKeyName:{}},[],[],!0);var qw=ie("<!> <!>",1),Xw=ie('<div class="none-params svelte-1sm1mgi"> </div>'),Ww=ie('<div class="input-header svelte-1sm1mgi">参数名称</div> <div class="input-header svelte-1sm1mgi">参数类型</div> <div class="input-header svelte-1sm1mgi"></div>',1),Zw=ie('<div class="input-container svelte-1sm1mgi"><!> <!></div>');const Kw={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;
26
+ /* 从第一列开始到最后一列结束 */}.input-container.svelte-1sm1mgi .input-header:where(.svelte-1sm1mgi) {font-size:12px;color:#666;}`};function gr(e,t){fe(t,!0),ot(e,Kw);const[n,r]=ct(),o=()=>oe(d(c),"$node",n),i=(x,C=_t,m=_t)=>{var _=qe(),p=he(_);At(p,19,C,E=>`${E.id}_${E.children?E.children.length:0}`,(E,N,S)=>{var A=qw(),L=he(A);{let z=ke(()=>[...m(),d(S)]);Df(L,{get parameter(){return d(N)},get position(){return d(z)},get dataKeyName(){return a()}})}var V=R(L,2);{var O=z=>{{let B=ke(()=>[...m(),d(S)]);i(z,()=>d(N).children,()=>d(B))}};pe(V,z=>{d(N).children&&z(O)})}D(E,A)},E=>{var N=qe(),S=he(N);{var A=L=>{var V=Xw(),O=Y(V,!0);F(V),Ve(()=>ft(O,s())),D(L,V)};pe(S,L=>{m().length===0&&L(A)})}D(E,N)}),D(x,_)},s=w(t,"noneParameterText",7,"无输出参数"),a=w(t,"dataKeyName",7,"outputDefs");let l=$t(),c=ke(()=>Lr(l)),u=ke(()=>{var x;return[...((x=o())==null?void 0:x.data[a()])||[]]});var g=Zw(),f=Y(g);{var h=x=>{var C=Ww();Te(4),D(x,C)};pe(f,x=>{d(u).length!==0&&x(h)})}var v=R(f,2);i(v,()=>d(u)||[],()=>[]),F(g),D(e,g);var b=ge({get noneParameterText(){return s()},set noneParameterText(x="无输出参数"){s(x),y()},get dataKeyName(){return a()},set dataKeyName(x="outputDefs"){a(x),y()}});return r(),b}ue(gr,{noneParameterText:{},dataKeyName:{}},[],[],!0);var jw=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>'),Uw=(e,t,n,r)=>{t(n,{enableThinking:r().enableThinking})},Gw=ie('<div class="setting-item svelte-9hg0j2"><div class="setting-item-container svelte-9hg0j2"><span class="svelte-9hg0j2"> </span> <div class="input-with-unit svelte-9hg0j2"><!></div></div></div> <div class="setting-item svelte-9hg0j2"><div class="setting-item-container svelte-9hg0j2"><span class="svelte-9hg0j2"> </span> <div class="input-with-unit svelte-9hg0j2"><!></div></div></div> <div class="setting-item svelte-9hg0j2"><div class="setting-item-container svelte-9hg0j2"><span class="svelte-9hg0j2"> </span> <div class="input-with-unit svelte-9hg0j2"><!></div></div></div> <div class="setting-item svelte-9hg0j2"><div class="setting-item-container svelte-9hg0j2"><span class="svelte-9hg0j2"> </span> <div class="input-with-unit svelte-9hg0j2"><!></div></div></div> <div class="setting-item svelte-9hg0j2"><div class="setting-item-container svelte-9hg0j2"><span class="svelte-9hg0j2"> </span> <div class="input-with-unit svelte-9hg0j2"><!></div></div></div> <div class="setting-item svelte-9hg0j2"><div class="setting-item-container svelte-9hg0j2"><span class="svelte-9hg0j2"> </span> <div class="switch-group svelte-9hg0j2"><label class="switch svelte-9hg0j2"><input type="checkbox" class="svelte-9hg0j2"/> <span class="slider svelte-9hg0j2"></span></label></div></div></div>',1),Jw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></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_=ie('<div class="heading svelte-9hg0j2"><!> <!></div> <!> <!> <div class="setting-title svelte-9hg0j2">模型</div> <div class="setting-item svelte-9hg0j2"><!> <!></div> <div class="setting-title svelte-9hg0j2">系统提示词</div> <div class="setting-item svelte-9hg0j2"><!></div> <div class="setting-title svelte-9hg0j2">用户提示词</div> <div class="setting-item svelte-9hg0j2"><!></div> <!> <div class="heading svelte-9hg0j2"><!> <!> <!></div> <!>',1);const t_={hash:"svelte-9hg0j2",code:`.heading.svelte-9hg0j2 {display:flex;align-items:center;margin-bottom:10px;}.setting-title.svelte-9hg0j2 {font-size:12px;color:#999;margin-bottom:4px;margin-top:10px;}.setting-item.svelte-9hg0j2 {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}
27
+
28
+ /* 新增样式 */.setting-item-container.svelte-9hg0j2 {width:100%;display:flex;flex-direction:column;gap:4px;}.setting-item-container.svelte-9hg0j2 span:where(.svelte-9hg0j2) {font-size:12px;color:#666;display:flex;justify-content:space-between;align-items:center;}
29
+
30
+ /* Switch 组件样式 */.switch-group.svelte-9hg0j2 {display:flex;align-items:center;}.switch.svelte-9hg0j2 {position:relative;display:inline-block;width:40px;height:20px;}.switch.svelte-9hg0j2 input:where(.svelte-9hg0j2) {opacity:0;width:0;height:0;}.slider.svelte-9hg0j2 {position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:.4s;border-radius:20px;}.slider.svelte-9hg0j2:before {position:absolute;content:"";height:16px;width:16px;left:2px;bottom:2px;background-color:white;transition:.4s;border-radius:50%;}input.svelte-9hg0j2:checked + .slider:where(.svelte-9hg0j2) {background-color:var(--tf-main-bg);}input.svelte-9hg0j2:checked + .slider:where(.svelte-9hg0j2):before {transform:translateX(20px);}
31
+
32
+ /* 输入框带单位的样式 */.input-with-unit.svelte-9hg0j2 {position:relative;display:flex;align-items:center;width:100%;}.input-with-unit.svelte-9hg0j2 input {width:100%;padding-right:25px !important;}.input-with-unit.svelte-9hg0j2 input::-webkit-outer-spin-button,
33
+ .input-with-unit.svelte-9hg0j2 input::-webkit-inner-spin-button {-webkit-appearance:none;margin:0;}
34
+
35
+ /* Firefox */.input-with-unit.svelte-9hg0j2 input[type=number] {-moz-appearance:textfield;}`};function Vf(e,t){fe(t,!0),ot(e,t_);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn(),s=fr();let a=Vt(Nn([]));tn(async()=>{var f,h;const g=await((h=(f=s.provider)==null?void 0:f.llm)==null?void 0:h.call(f));d(a).push(...g||[]),n()&&(n().enableThinking=n().enableThinking!==void 0?n().enableThinking:!1)});const{updateNodeData:l}=jt(),c=g=>{l(o,()=>({outType:g})),g==="text"?l(o,{outputDefs:[{name:"output",dataType:"String",dataTypeDisabled:!0,deleteDisabled:!0}]}):l(o,{outputDefs:[]})};cn(()=>{n().outType||c("text")});let u=n().advancedExpand?["advanced"]:[];{const g=h=>{var v=jw();D(h,v)},f=h=>{var v=Gw(),b=he(v),x=Y(b),C=Y(x),m=Y(C);F(C);var _=R(C,2),p=Y(_);pt(p,{get value(){return n().temperature},type:"number",placeholder:"请输入Temperature",onchange:X=>{const ae=X.target.value;ae>=0&&ae<2?l(o,{temperature:ae}):Ss.warning("Temperature的范围是[0,2)")}}),F(_),F(x),F(b);var E=R(b,2),N=Y(E),S=Y(N),A=Y(S);F(S);var L=R(S,2),V=Y(L);pt(V,{get value(){return n().topP},type:"number",placeholder:"请输入Top P",onchange:X=>{const ae=X.target.value;ae>0&&ae<=1?l(o,{topP:ae}):Ss.warning("Top P的范围是(0,1]")}}),F(L),F(N),F(E);var O=R(E,2),z=Y(O),B=Y(z),k=Y(B);F(B);var $=R(B,2),P=Y($);pt(P,{get value(){return n().maxTokens},type:"number",placeholder:"请输入Max Tokens",oninput:X=>{const ae=X.target.value;l(o,{maxTokens:ae})}}),F($),F(z),F(O);var T=R(O,2),M=Y(T),H=Y(M),I=Y(H);F(H);var W=R(H,2),j=Y(W);pt(j,{get value(){return n().presencePenalty},type:"number",placeholder:"请输入Presence Penalty",onchange:X=>{const ae=X.target.value;ae>=-2&&ae<=2?l(o,{presencePenalty:ae}):Ss.warning("Presence Penalty的范围是[-2.0, 2.0]")}}),F(W),F(M),F(T);var J=R(T,2),ne=Y(J),ee=Y(ne),ce=Y(ee);F(ee);var re=R(ee,2),we=Y(re);pt(we,{get value(){return n().frequencyPenalty},type:"number",placeholder:"请输入Frequency Penalty",onchange:X=>{const ae=X.target.value;ae>=-2&&ae<=2?l(o,{frequencyPenalty:ae}):Ss.warning("Frequency Penalty的范围是[-2.0, 2.0]")}}),F(re),F(ne),F(J);var Ne=R(J,2),Ae=Y(Ne),ye=Y(Ae),be=Y(ye);F(ye);var de=R(ye,2),U=Y(de),se=Y(U);Tr(se),se.__change=[Uw,l,o,n],Te(2),F(U),F(de),F(Ae),F(Ne),Ve(()=>{ft(m,`Temperature: ${n().temperature??""}`),ft(A,`Top P: ${n().topP??""}`),ft(k,`Max Tokens: ${n().maxTokens??""}`),ft(I,`Presence Penalty: ${n().presencePenalty??""}`),ft(ce,`Frequency Penalty: ${n().frequencyPenalty??""}`),ft(be,`Enable Thinking: ${n().enableThinking??""}`)}),Mg(se,()=>n().enableThinking,X=>n().enableThinking=X),D(h,v)};En(e,vt({get data(){return n()}},()=>r,{icon:g,advancedContent:f,children:(h,v)=>{var b=e_(),x=he(b),C=Y(x);st(C,{level:3,children:(H,I)=>{Te();var W=Re("输入参数");D(H,W)},$$slots:{default:!0}});var m=R(C,2);Je(m,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(H,I)=>{var W=Jw();D(H,W)},$$slots:{default:!0}}),F(x);var _=R(x,2);Ut(_,{});var p=R(_,2);st(p,{level:3,mt:"10px",children:(H,I)=>{Te();var W=Re("模型设置");D(H,W)},$$slots:{default:!0}});var E=R(p,4),N=Y(E);{let H=ke(()=>n().llmId?[n().llmId]:[]);hn(N,{get items(){return d(a)},style:"width: 100%",placeholder:"请选择模型",onSelect:I=>{const W=I.value;l(o,()=>({llmId:W}))},get value(){return d(H)}})}var S=R(N,2);ks(S,{}),F(E);var A=R(E,4),L=Y(A);{let H=ke(()=>n().systemPrompt||"");Mt(L,{rows:5,placeholder:"请输入系统提示词",style:"width: 100%",get value(){return d(H)},oninput:I=>{l(o,{systemPrompt:I.target.value})}})}F(A);var V=R(A,4),O=Y(V);{let H=ke(()=>n().userPrompt||"");Mt(O,{rows:5,placeholder:"请输入用户提示词",style:"width: 100%",get value(){return d(H)},oninput:I=>{l(o,{userPrompt:I.target.value})}})}F(V);var z=R(V,2);{let H=ke(()=>[{key:"advanced",title:"高级设置",description:"展开查看更多高级参数",content:f}]);rl(z,{get items(){return d(H)},get activeKeys(){return u},onChange:(I,W)=>{const j=W==null?void 0:W.includes("advanced");l(o,{advancedExpand:j}),u=j?["advanced"]:[]}})}var B=R(z,2),k=Y(B);st(k,{level:3,mt:"10px",children:(H,I)=>{Te();var W=Re("输出参数");D(H,W)},$$slots:{default:!0}});var $=R(k,2);{let H=ke(()=>n().outType?[n().outType]:[]);hn($,{items:[{label:"文本",value:"text"},{label:"JSON",value:"json"}],style:"width: 100px;margin-left: auto",defaultValue:"text",onSelect:I=>{c(I.value)},get value(){return d(H)}})}var P=R($,2);{var T=H=>{Je(H,{class:"input-btn-more",style:"margin-left: 10px",onclick:()=>{i(o,"outputDefs")},children:(I,W)=>{var j=Qw();D(I,j)},$$slots:{default:!0}})};pe(P,H=>{n().outType==="json"&&H(T)})}F(B);var M=R(B,2);gr(M,{}),D(h,b)},$$slots:{icon:!0,advancedContent:!0,default:!0}}))}return ge({get data(){return n()},set data(g){n(g),y()}})}Sr(["change"]),ue(Vf,{data:{}},[],[],!0);var n_=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>'),r_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),o_=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-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 s_={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 Af(e,t){fe(t,!0),ot(e,s_);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]);tn(()=>{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,vt({get data(){return n()}},()=>r,{icon:c=>{var u=n_();D(c,u)},children:(c,u)=>{var g=i_(),f=he(g),h=Y(f);st(h,{level:3,children:(L,V)=>{Te();var O=Re("输入参数");D(L,O)},$$slots:{default:!0}});var v=R(h,2);Je(v,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(L,V)=>{var O=r_();D(L,O)},$$slots:{default:!0}}),F(f);var b=R(f,2);Ut(b,{});var x=R(b,2);st(x,{level:3,mt:"10px",children:(L,V)=>{Te();var O=Re("代码");D(L,O)},$$slots:{default:!0}});var C=R(x,4),m=Y(C);{let L=ke(()=>n().engine?[n().engine]:["qlexpress"]);hn(m,{get items(){return a},style:"width: 100%",placeholder:"请选择执行引擎",onSelect:V=>{const O=V.value;s(o,()=>({engine:O}))},get value(){return d(L)}})}F(C);var _=R(C,4),p=Y(_);{let L=ke(()=>n().code||"");Mt(p,{rows:10,placeholder:"请输入执行代码,注:输出内容需添加到_result中,如:_result.put(key, value)",style:"width: 100%",onchange:V=>{s(o,()=>({code:V.target.value}))},get value(){return d(L)}})}F(_);var E=R(_,2),N=Y(E);st(N,{level:3,mt:"10px",children:(L,V)=>{Te();var O=Re("输出参数");D(L,O)},$$slots:{default:!0}});var S=R(N,2);Je(S,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(L,V)=>{var O=o_();D(L,O)},$$slots:{default:!0}}),F(E);var A=R(E,2);gr(A,{}),D(c,g)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(l){n(l),y()}})}ue(Af,{data:{}},[],[],!0);var a_=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>'),l_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),u_=ie('<div class="heading svelte-15t2v24"><!> <!></div> <!> <!> <div class="setting-item svelte-15t2v24"><!></div> <div class="heading svelte-15t2v24"><!></div> <!>',1);const c_={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 Of(e,t){fe(t,!0),ot(e,c_);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn(),{updateNodeData:s}=jt();return cn(()=>{(!n().outputDefs||n().outputDefs.length===0)&&i(o,"outputDefs",{name:"output",dataType:"String",dataTypeDisabled:!0,deleteDisabled:!0})}),En(e,vt({get data(){return n()}},()=>r,{icon:l=>{var c=a_();D(l,c)},children:(l,c)=>{var u=u_(),g=he(u),f=Y(g);st(f,{level:3,children:(E,N)=>{Te();var S=Re("输入参数");D(E,S)},$$slots:{default:!0}});var h=R(f,2);Je(h,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(E,N)=>{var S=l_();D(E,S)},$$slots:{default:!0}}),F(g);var v=R(g,2);Ut(v,{});var b=R(v,2);st(b,{level:3,mt:"10px",mb:"10px",children:(E,N)=>{Te();var S=Re("模板内容");D(E,S)},$$slots:{default:!0}});var x=R(b,2),C=Y(x);{let E=ke(()=>n().template||"");Mt(C,{rows:10,placeholder:"请输入模板内容",style:"width: 100%",onchange:N=>{s(o,()=>({template:N.target.value}))},get value(){return d(E)}})}F(x);var m=R(x,2),_=Y(m);st(_,{level:3,mt:"10px",children:(E,N)=>{Te();var S=Re("输出参数");D(E,S)},$$slots:{default:!0}}),F(m);var p=R(m,2);gr(p,{}),D(l,u)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(a){n(a),y()}})}ue(Of,{data:{}},[],[],!0);var d_=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>'),f_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),g_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),h_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),v_=ie('<div class="heading svelte-1mo2w1q" style="padding-top: 10px"><!> <!></div> <!>',1),p_=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-1mo2w1q" style="padding-top: 10px"><!> <!></div> <!>',1),y_=ie('<div style="width: 100%"><!></div>'),w_=ie('<div style="width: 100%"><!></div>'),__=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),b_=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 x_={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 Lf(e,t){fe(t,!0),ot(e,x_);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]);tn(()=>{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,vt({get data(){return n()}},()=>r,{icon:c=>{var u=d_();D(c,u)},children:(c,u)=>{var g=b_(),f=he(g),h=Y(f);st(h,{level:3,children:(U,se)=>{Te();var X=Re("输入参数");D(U,X)},$$slots:{default:!0}});var v=R(h,2);Je(v,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i)},children:(U,se)=>{var X=f_();D(U,X)},$$slots:{default:!0}}),F(f);var b=R(f,2);Ut(b,{});var x=R(b,2);st(x,{level:3,mt:"10px",children:(U,se)=>{Te();var X=Re("URL 地址");D(U,X)},$$slots:{default:!0}});var C=R(x,2),m=Y(C),_=Y(m);{let U=ke(()=>n().method?[n().method]:["get"]);hn(_,{get items(){return o},style:"width: 100%",placeholder:"请选择请求方式",onSelect:se=>{const X=se.value;a(i,()=>({method:X}))},get value(){return d(U)}})}F(m);var p=R(m,2),E=Y(p);{let U=ke(()=>n().url||"");pt(E,{placeholder:"请输入url",style:"width: 100%",onchange:se=>{a(i,()=>({url:se.target.value}))},get value(){return d(U)}})}F(p),F(C);var N=R(C,2),S=Y(N);st(S,{level:3,children:(U,se)=>{Te();var X=Re("Http 头信息");D(U,X)},$$slots:{default:!0}});var A=R(S,2);Je(A,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"headers")},children:(U,se)=>{var X=g_();D(U,X)},$$slots:{default:!0}}),F(N);var L=R(N,2);Ut(L,{dataKeyName:"headers"});var V=R(L,2);st(V,{level:3,mt:"10px",children:(U,se)=>{Te();var X=Re("Body");D(U,X)},$$slots:{default:!0}});var O=R(V,2),z=Y(O),B=Y(z);{let U=ke(()=>!n().bodyType);pt(B,{type:"radio",name:"bodyType",value:"",get checked(){return d(U)},onchange:se=>{var X;(X=se.target)!=null&&X.checked&&a(i,{bodyType:""})}})}Te(),F(z);var k=R(z,2),$=Y(k);{let U=ke(()=>n().bodyType==="form-data");pt($,{type:"radio",name:"bodyType",value:"form-data",get checked(){return d(U)},onchange:se=>{var X;(X=se.target)!=null&&X.checked&&a(i,{bodyType:"form-data"})}})}Te(),F(k);var P=R(k,2),T=Y(P);{let U=ke(()=>n().bodyType==="x-www-form-urlencoded");pt(T,{type:"radio",name:"bodyType",value:"x-www-form-urlencoded",get checked(){return d(U)},onchange:se=>{var X;(X=se.target)!=null&&X.checked&&a(i,{bodyType:"x-www-form-urlencoded"})}})}Te(),F(P);var M=R(P,2),H=Y(M);{let U=ke(()=>n().bodyType==="json");pt(H,{type:"radio",name:"bodyType",value:"json",get checked(){return d(U)},onchange:se=>{var X;(X=se.target)!=null&&X.checked&&a(i,{bodyType:"json"})}})}Te(),F(M);var I=R(M,2),W=Y(I);{let U=ke(()=>n().bodyType==="raw");pt(W,{type:"radio",name:"bodyType",value:"raw",get checked(){return d(U)},onchange:se=>{var X;(X=se.target)!=null&&X.checked&&a(i,{bodyType:"raw"})}})}Te(),F(I),F(O);var j=R(O,2);{var J=U=>{var se=v_(),X=he(se),ae=Y(X);st(ae,{level:3,children:(Fe,Oe)=>{Te();var me=Re("参数");D(Fe,me)},$$slots:{default:!0}});var Me=R(ae,2);Je(Me,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"formData")},children:(Fe,Oe)=>{var me=h_();D(Fe,me)},$$slots:{default:!0}}),F(X);var Ee=R(X,2);Ut(Ee,{dataKeyName:"formData"}),D(U,se)};pe(j,U=>{n().bodyType==="form-data"&&U(J)})}var ne=R(j,2);{var ee=U=>{var se=m_(),X=he(se),ae=Y(X);st(ae,{level:3,children:(Fe,Oe)=>{Te();var me=Re("Body 参数");D(Fe,me)},$$slots:{default:!0}});var Me=R(ae,2);Je(Me,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"formUrlencoded")},children:(Fe,Oe)=>{var me=p_();D(Fe,me)},$$slots:{default:!0}}),F(X);var Ee=R(X,2);Ut(Ee,{dataKeyName:"formUrlencoded"}),D(U,se)};pe(ne,U=>{n().bodyType==="x-www-form-urlencoded"&&U(ee)})}var ce=R(ne,2);{var re=U=>{var se=y_(),X=Y(se);Mt(X,{rows:5,style:"width: 100%",placeholder:"请输入 json 信息",get value(){return n().bodyJson},oninput:ae=>{a(i,{bodyJson:ae.target.value})}}),F(se),D(U,se)};pe(ce,U=>{n().bodyType==="json"&&U(re)})}var we=R(ce,2);{var Ne=U=>{var se=w_(),X=Y(se);Mt(X,{rows:5,style:"width: 100%",placeholder:"请输入请求信息",get value(){return n().bodyRaw},oninput:ae=>{a(i,{bodyRaw:ae.target.value})}}),F(se),D(U,se)};pe(we,U=>{n().bodyType==="raw"&&U(Ne)})}var Ae=R(we,2),ye=Y(Ae);st(ye,{level:3,mt:"10px",children:(U,se)=>{Te();var X=Re("输出参数");D(U,X)},$$slots:{default:!0}});var be=R(ye,2);Je(be,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"outputDefs")},children:(U,se)=>{var X=__();D(U,X)},$$slots:{default:!0}}),F(Ae);var de=R(Ae,2);gr(de,{}),D(c,g)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(l){n(l),y()}})}ue(Lf,{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>'),$_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),k_=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 E_={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 If(e,t){fe(t,!0),ot(e,E_);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn(),s=fr();let a=Vt(Nn([]));tn(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 cn(()=>{(!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,vt({get data(){return n()}},()=>r,{icon:u=>{var g=C_();D(u,g)},children:(u,g)=>{var f=k_(),h=he(f),v=Y(h);st(v,{level:3,children:(O,z)=>{Te();var B=Re("输入参数");D(O,B)},$$slots:{default:!0}});var b=R(v,2);Je(b,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(O,z)=>{var B=$_();D(O,B)},$$slots:{default:!0}}),F(h);var x=R(h,2);Ut(x,{});var C=R(x,2);st(C,{level:3,mt:"10px",children:(O,z)=>{Te();var B=Re("知识库设置");D(O,B)},$$slots:{default:!0}});var m=R(C,4),_=Y(m);{let O=ke(()=>n().knowledgeId?[n().knowledgeId]:[]);hn(_,{get items(){return d(a)},style:"width: 100%",placeholder:"请选择知识库",onSelect:z=>{const B=z.value;l(o,()=>({knowledgeId:B}))},get value(){return d(O)}})}F(m);var p=R(m,4),E=Y(p);pt(E,{placeholder:"请输入关键字",style:"width: 100%",get value(){return n().keyword},onchange:O=>{const z=O.target.value;l(o,()=>({keyword:z}))}}),F(p);var N=R(p,4),S=Y(N);{let O=ke(()=>n().limit||"");pt(S,{placeholder:"搜索的数据条数",style:"width: 100%",onchange:z=>{const B=z.target.value;l(o,()=>({limit:B}))},get value(){return d(O)}})}F(N);var A=R(N,2),L=Y(A);st(L,{level:3,mt:"10px",children:(O,z)=>{Te();var B=Re("输出参数");D(O,B)},$$slots:{default:!0}}),F(A);var V=R(A,2);gr(V,{}),D(u,f)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(c){n(c),y()}})}ue(If,{data:{}},[],[],!0);var S_=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>'),P_=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-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 T_={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 zf(e,t){fe(t,!0),ot(e,T_);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn(),s=fr();let a=Vt(Nn([]));tn(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 cn(()=>{(!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,vt({get data(){return n()}},()=>r,{icon:u=>{var g=S_();D(u,g)},children:(u,g)=>{var f=N_(),h=he(f),v=Y(h);st(v,{level:3,children:(O,z)=>{Te();var B=Re("输入参数");D(O,B)},$$slots:{default:!0}});var b=R(v,2);Je(b,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(O,z)=>{var B=P_();D(O,B)},$$slots:{default:!0}}),F(h);var x=R(h,2);Ut(x,{});var C=R(x,2);st(C,{level:3,mt:"10px",children:(O,z)=>{Te();var B=Re("搜索引擎设置");D(O,B)},$$slots:{default:!0}});var m=R(C,4),_=Y(m);{let O=ke(()=>n().engine?[n().engine]:[]);hn(_,{get items(){return d(a)},style:"width: 100%",placeholder:"请选择搜索引擎",onSelect:z=>{const B=z.value;l(o,()=>({engine:B}))},get value(){return d(O)}})}F(m);var p=R(m,4),E=Y(p);pt(E,{placeholder:"请输入关键字",style:"width: 100%",get value(){return n().keyword},onchange:O=>{const z=O.target.value;l(o,()=>({keyword:z}))}}),F(p);var N=R(p,4),S=Y(N);pt(S,{placeholder:"搜索的数据条数",style:"width: 100%",get value(){return n().limit},onchange:O=>{const z=O.target.value;l(o,()=>({limit:z}))}}),F(N);var A=R(N,2),L=Y(A);st(L,{level:3,mt:"10px",children:(O,z)=>{Te();var B=Re("输出参数");D(O,B)},$$slots:{default:!0}}),F(A);var V=R(A,2);gr(V,{}),D(u,f)},$$slots:{icon:!0,default:!0}})),ge({get data(){return n()},set data(c){n(c),y()}})}ue(zf,{data:{}},[],[],!0);var M_=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>'),H_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),D_=ie('<div class="heading svelte-1eqcy61"><!></div> <!> <div class="heading svelte-1eqcy61"><!> <!></div> <!>',1);const V_={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 Rf(e,t){fe(t,!0),ot(e,V_);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn();return cn(()=>{(!n().loopVars||n().loopVars.length===0)&&i(o,"loopVars",{name:"loopVar",nameDisabled:!0,deleteDisabled:!0})}),En(e,vt({get data(){return n()}},()=>r,{icon:l=>{var c=M_();D(l,c)},handle:l=>{ar(l,{type:"source",get position(){return Pe.Bottom},id:"loop_handle",style:"bottom: -12px;width: 100px",class:"loop_handle_wrapper"})},children:(l,c)=>{var u=D_(),g=he(u),f=Y(g);st(f,{level:3,children:(m,_)=>{Te();var p=Re("循环变量");D(m,p)},$$slots:{default:!0}}),F(g);var h=R(g,2);Ut(h,{dataKeyName:"loopVars"});var v=R(h,2),b=Y(v);st(b,{level:3,children:(m,_)=>{Te();var p=Re("输出参数");D(m,p)},$$slots:{default:!0}});var x=R(b,2);Je(x,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(m,_)=>{var p=H_();D(m,p)},$$slots:{default:!0}}),F(v);var C=R(v,2);Ut(C,{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()}})}ue(Rf,{data:{}},[],[],!0);const A_={startNode:Sf,codeNode:Af,llmNode:Vf,templateNode:Of,httpNode:Lf,knowledgeNode:If,searchEngineNode:zf,loopNode:Rf,endNode:Hf};var O_=ie("<!> ",1);function vl(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=O_(),g=he(u);ga(g,n);var f=R(g);Ve(()=>ft(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()}})}ue(vl,{icon:{},title:{},type:{},description:{},extra:{}},[],[],!0);var L_=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>'),I_=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>'),z_=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 Bf(e,t){fe(t,!0);let n=Vt("base"),r=Vt("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=fr(),l=a.customNodes;if(l){const C=Object.keys(l).sort((m,_)=>(l[m].sortNo||0)-(l[_].sortNo||0));for(let m of C)l[m].group==="base"?o.push({type:m,...l[m]}):s.push({icon:l[m].icon,title:l[m].title,type:m});o.sort((m,_)=>(m.sortNo||0)-(_.sortNo||0))}if(a.hiddenNodes){const C=typeof a.hiddenNodes=="function"?a.hiddenNodes():a.hiddenNodes;if(Array.isArray(C)){for(let m of C)for(let _=0;_<o.length;_++)if(o[_].type===m){o.splice(_,1);break}}}var c=z_(),u=Y(c),g=Y(u),f=Y(g);nf(f,{style:"width: 100%",get items(){return i},onChange:C=>{te(n,C.value.toString(),!0)}}),F(g);var h=R(g,2),v=Y(h);At(v,21,()=>o,eo,(C,m)=>{vl(C,vt(()=>d(m)))}),F(v);var b=R(v,2);At(b,21,()=>s,eo,(C,m)=>{vl(C,vt(()=>d(m)))}),F(b),F(h),F(u);var x=R(u,2);Je(x,{onclick:()=>{te(r,d(r)?"":"show",!0)},children:(C,m)=>{var _=qe(),p=he(_);{var E=S=>{var A=L_();D(S,A)},N=S=>{var A=I_();D(S,A)};pe(p,S=>{d(r)==="show"?S(E):S(N,!1)})}D(C,_)},$$slots:{default:!0}}),F(c),Ve(()=>{Nt(c,1,`tf-toolbar ${d(r)??""}`),mt(v,`display: ${d(n)==="base"?"flex":"none"}`),mt(b,`display: ${d(n)!=="base"?"flex":"none"}`)}),D(e,c),ge()}ue(Bf,{},[],[],!0);const R_=()=>{const{nodeLookup:e}=tt();return{getNode:n=>{var o;return(o=Q(e).get(n))==null?void 0:o.internals.userNode}}},B_=()=>{const{nodes:e}=tt();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})}}},F_=()=>{const{edges:e}=tt();return{getEdgesByTarget:n=>Q(e).filter(o=>o.target===n)}};var Y_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),q_=ie('<div class="heading svelte-q0cqsa"><!> <!></div> <!>',1),X_=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),W_=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),Z_=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),K_=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),j_=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),U_=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),G_=ie('<div class="heading svelte-q0cqsa"><!> <!></div> <!>',1),J_=ie("<!> <!> <div></div> <!>",1);const Q_={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;}
36
+
37
+ /* 新增样式 */.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 Ff(e,t){var x;fe(t,!0),ot(e,Q_);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=$t(),{addParameter:i}=Rn(),s=jt(),{updateNodeData:a}=s,l=C=>{a(o,C)},c=(C,m)=>{var _;l({[C]:(_=m.target)==null?void 0:_.value})},u={...r,id:o,data:n()},g=document.createElement("div"),h=fr().customNodes[t.type];(x=h.render)==null||x.call(h,g,u,s);const v=h.forms;let b;cn(()=>{n().expand&&b&&b.append(g)}),cn(()=>{var C;n()&&((C=h.onUpdate)==null||C.call(h,g,{...u,data:n()}))}),cn(()=>{!n().parameters&&h.parameters&&l({parameters:Ps(JSON.parse(JSON.stringify(h.parameters)))})}),cn(()=>{!n().outputDefs&&h.outputDefs&&l({outputDefs:Ps(JSON.parse(JSON.stringify(h.outputDefs)))})});{const C=_=>{var p=qe(),E=he(p);ga(E,()=>h.icon),D(_,p)};let m=ke(()=>({...n(),description:h.description}));En(e,vt({get data(){return d(m)}},()=>r,{icon:C,children:(_,p)=>{var E=J_(),N=he(E);{var S=B=>{var k=q_(),$=he(k),P=Y($);st(P,{level:3,children:(I,W)=>{Te();var j=Re("输入参数");D(I,j)},$$slots:{default:!0}});var T=R(P,2);{var M=I=>{Je(I,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(W,j)=>{var J=Y_();D(W,J)},$$slots:{default:!0}})};pe(T,I=>{h.parametersAddEnable!==!1&&I(M)})}F($);var H=R($,2);Ut(H,{}),D(B,k)};pe(N,B=>{h.parametersEnable!==!1&&B(S)})}var A=R(N,2);{var L=B=>{var k=qe(),$=he(k);At($,17,()=>v,eo,(P,T)=>{var M=qe(),H=he(M);{var I=j=>{var J=X_(),ne=he(J),ee=Y(ne,!0);F(ne);var ce=R(ne,2),re=Y(ce);{let we=ke(()=>n()[d(T).name]||d(T).defaultValue);pt(re,vt({get placeholder(){return d(T).placeholder},style:"width: 100%",get value(){return d(we)}},()=>d(T).attrs,{onchange:Ne=>{c(d(T).name,Ne)}}))}F(ce),Ve(()=>ft(ee,d(T).label)),D(j,J)},W=j=>{var J=qe(),ne=he(J);{var ee=re=>{var we=W_(),Ne=he(we),Ae=Y(Ne,!0);F(Ne);var ye=R(Ne,2),be=Y(ye);{let de=ke(()=>n()[d(T).name]||d(T).defaultValue);Mt(be,vt({rows:3,get placeholder(){return d(T).placeholder},style:"width: 100%",get value(){return d(de)}},()=>d(T).attrs,{onchange:U=>{c(d(T).name,U)}}))}F(ye),Ve(()=>ft(Ae,d(T).label)),D(re,we)},ce=re=>{var we=qe(),Ne=he(we);{var Ae=be=>{var de=Z_(),U=he(de),se=Y(U,!0);F(U);var X=R(U,2),ae=Y(X),Me=Y(ae),Ee=Y(Me);F(Me);var Fe=R(Me,2);Tr(Fe);var Oe=me=>l({[d(T).name]:parseFloat(me.target.value)});nn(Fe,()=>({class:"nodrag",type:"range",...d(T).attrs,value:n()[d(T).name]??d(T).defaultValue,oninput:Oe}),void 0,void 0,"svelte-q0cqsa"),F(ae),F(X),Ve(()=>{ft(se,d(T).label),ft(Ee,`${d(T).description??""}: ${n()[d(T).name]??d(T).defaultValue??""}`)}),D(be,de)},ye=be=>{var de=qe(),U=he(de);{var se=ae=>{var Me=K_(),Ee=he(Me),Fe=Y(Ee,!0);F(Ee);var Oe=R(Ee,2),me=Y(Oe);{let ze=ke(()=>d(T).options||[]),Ue=ke(()=>n()[d(T).name]?[n()[d(T).name]]:[d(T).defaultValue]);hn(me,{get items(){return d(ze)},style:"width: 100%",get placeholder(){return d(T).placeholder},onSelect:at=>{const K=at.value;l({[d(T).name]:K})},get value(){return d(Ue)}})}F(Oe),Ve(()=>ft(Fe,d(T).label)),D(ae,Me)},X=ae=>{var Me=qe(),Ee=he(Me);{var Fe=me=>{var ze=j_(),Ue=he(ze),at=Y(Ue,!0);F(Ue);var K=R(Ue,2),Ge=Y(K);{let Qe=ke(()=>{var gt;return(gt=d(T).chosen)==null?void 0:gt.buttonText});tf(Ge,{style:"width: 100%",get placeholder(){return d(T).placeholder},get buttonText(){return d(Qe)},onChosen:(gt,sn,nt)=>{var $e,Xe;(Xe=($e=d(T).chosen)==null?void 0:$e.onChosen)==null||Xe.call($e,l,gt,sn,nt)},get value(){var gt;return n()[((gt=d(T).chosen)==null?void 0:gt.valueDataKey)||""]},get label(){var gt;return n()[((gt=d(T).chosen)==null?void 0:gt.labelDataKey)||""]}})}F(K),Ve(()=>ft(at,d(T).label)),D(me,ze)},Oe=me=>{var ze=qe(),Ue=he(ze);{var at=K=>{st(K,vt({level:3,mt:"10px"},()=>d(T).attrs,{children:(Ge,Qe)=>{Te();var gt=Re();Ve(()=>ft(gt,d(T).label)),D(Ge,gt)},$$slots:{default:!0}}))};pe(Ue,K=>{d(T).type==="heading"&&K(at)},!0)}D(me,ze)};pe(Ee,me=>{d(T).type==="chosen"?me(Fe):me(Oe,!1)},!0)}D(ae,Me)};pe(U,ae=>{d(T).type==="select"?ae(se):ae(X,!1)},!0)}D(be,de)};pe(Ne,be=>{d(T).type==="slider"?be(Ae):be(ye,!1)},!0)}D(re,we)};pe(ne,re=>{d(T).type==="textarea"?re(ee):re(ce,!1)},!0)}D(j,J)};pe(H,j=>{d(T).type==="input"?j(I):j(W,!1)})}D(P,M)}),D(B,k)};pe(A,B=>{v&&B(L)})}var V=R(A,2);_n(V,B=>b=B,()=>b);var O=R(V,2);{var z=B=>{var k=G_(),$=he(k),P=Y($);st(P,{level:3,mt:"10px",children:(I,W)=>{Te();var j=Re("输出参数");D(I,j)},$$slots:{default:!0}});var T=R(P,2);{var M=I=>{Je(I,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(W,j)=>{var J=U_();D(W,J)},$$slots:{default:!0}})};pe(T,I=>{h.outputDefsAddEnable!==!1&&I(M)})}F($);var H=R($,2);gr(H,{}),D(B,k)};pe(O,B=>{h.outputDefsEnable!==!1&&B(z)})}Ve(()=>{mt(V,h.rootStyle||""),Nt(V,1,wn(h.rootClass),"svelte-q0cqsa")}),D(_,E)},$$slots:{icon:!0,default:!0}}))}return ge({get data(){return n()},set data(C){n(C),y()}})}ue(Ff,{data:{}},[],[],!0);const eb=()=>{const e=tt();return{updateEdgeData:(n,r,o)=>{const i=Q(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))}}},tb=()=>{const{edges:e}=tt();return{deleteEdge:n=>{e.update(r=>r.filter(o=>o.id!==n))}}};var nb=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>'),rb=ie("<!> <!> <!> <!>",1),ob=ie('<div style="position: relative; height: 100%; width: 100%;overflow: hidden"><!> <!> <!></div>');const ib={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 Yf(e,t){fe(t,!0),ot(e,ib);const[n,r]=ct(),o=()=>oe(L,"$nodes",n),i=()=>oe(V,"$edges",n),s=()=>oe(O,"$viewport",n),a=w(t,"onInit",7),l=jt();a()(l);let c=Vt(!1),u=Vt(void 0);const{updateEdgeData:g}=eb(),f=M=>{M.preventDefault(),M.dataTransfer&&(M.dataTransfer.dropEffect="move")},h=M=>{var J;M.preventDefault();const H=l.screenToFlowPosition({x:M.clientX-250,y:M.clientY-100}),I=(J=M.dataTransfer)==null?void 0:J.getData("application/tinyflow"),W=I?JSON.parse(I):{};if(Object.keys(W).length===0)return;const j={id:`node_${zr()}`,position:H,data:{},...W};ys.addNode(j),ys.selectNodeOnly(j.id)},{getNode:v}=R_(),b=M=>{const H=v(M.source),I=v(M.target);if(M.sourceHandle==="loop_handle"||H.parentId){const W=l.getEdges();for(let j of W)if(j.target===M.target){const J=v(j.source);if(M.sourceHandle==="loop_handle"&&J.parentId!==H.id||H.parentId&&J.parentId!==H.parentId)return!1}}return!(!H.parentId&&I.parentId&&I.parentId!==H.id)},{ensureParentInNodesBefore:x}=B_(),C=(M,H)=>{if(!H.isValid)return;const I=H.toNode;if(I.parentId)return;const W=H.fromNode,j=H.fromHandle,J={position:{...I.position}};if(j.id==="loop_handle"?J.parentId=W.id:W.parentId&&(J.parentId=W.parentId),J.parentId){const ne=v(J.parentId);J.position={x:I.position.x-ne.position.x,y:I.position.y-ne.position.y},x(J.parentId,I.id),l.updateNode(I.id,J)}},{getEdgesByTarget:m}=F_(),_=M=>{M.edges.forEach(I=>{var j;I.id===((j=d(u))==null?void 0:j.id)&&(te(u,null),te(c,!1));const W=v(I.target);if(W&&W.parentId){const J=m(I.target),ne=v(W.parentId);if(J.length===0)l.updateNode(W.id,{parentId:void 0,position:{x:W.position.x+ne.position.x,y:W.position.y+ne.position.y}});else{let ee=!1;for(let ce=0;ce<J.length;ce++){const re=J[ce],we=v(re.source);if(we.parentId||we.type==="loopNode"){ee=!0;break}}ee||l.updateNode(W.id,{parentId:void 0,position:{x:W.position.x+ne.position.x,y:W.position.y+ne.position.y}})}}})},{deleteEdge:p}=tb(),E=(M,H)=>{},N=M=>{},S={},A=fr().customNodes;if(A)for(let M of Object.keys(A))S[M]=Ff;const{nodes:L,edges:V,viewport:O}=tt(),z=fr().onDataChange;z&&(L.subscribe(()=>{z({nodes:o(),edges:i(),viewport:s()},{eventType:"nodesChange"})}),V.subscribe(()=>{z({nodes:o(),edges:i(),viewport:s()},{eventType:"edgesChange"})}),O.subscribe(()=>{z({nodes:o(),edges:i(),viewport:s()},{eventType:"viewportChange"})}));var B=ob(),k=Y(B);{let M=ke(()=>({...A_,...S})),H=ke(()=>({markerEnd:{type:Ar.ArrowClosed,width:20,height:20}}));Ld(k,vt({get nodeTypes(){return d(M)}},()=>ys,{class:"tinyflow-logo",isValidConnection:b,onconnectend:C,onconnectstart:E,onconnect:N,connectionRadius:50,onedgecreate:I=>({...I,id:zr()}),ondelete:_,onclick:I=>{const W=I.target;W.classList.contains("svelte-flow__edge-interaction")||W.classList.contains("panel-content")||W.closest(".panel-content")||(te(c,!1),te(u,null))},get defaultEdgeOptions(){return d(H)},$$events:{drop:h,dragover:f,edgeclick:I=>{te(c,!0),te(u,I.detail.edge,!0)}},children:(I,W)=>{var j=rb(),J=he(j);Zd(J,{});var ne=R(J,2);qd(ne,{});var ee=R(ne,2);jd(ee,{});var ce=R(ee,2);{var re=we=>{ii(we,{children:(Ne,Ae)=>{var ye=nb(),be=R(Y(ye),4),de=Y(be);{let ae=ke(()=>{var Me,Ee;return(Ee=(Me=d(u))==null?void 0:Me.data)==null?void 0:Ee.condition});Mt(de,{rows:3,placeholder:"请输入边条件",style:"width: 100%",get value(){return d(ae)},onchange:Me=>{var Ee;d(u)&&g(d(u).id,{condition:(Ee=Me.target)==null?void 0:Ee.value})}})}F(be);var U=R(be,2),se=Y(U);Je(se,{onclick:()=>{var ae;p((ae=d(u))==null?void 0:ae.id),te(c,!1)},children:(ae,Me)=>{Te();var Ee=Re("删除");D(ae,Ee)},$$slots:{default:!0}});var X=R(se,2);Je(X,{primary:!0,onclick:()=>{te(c,!1)},children:(ae,Me)=>{Te();var Ee=Re("保存");D(ae,Ee)},$$slots:{default:!0}}),F(U),F(ye),D(Ne,ye)},$$slots:{default:!0}})};pe(ce,we=>{d(c)&&we(re)})}D(I,j)},$$slots:{default:!0}}))}var $=R(k,2);Bf($,{});var P=R($,2);Cf(P,{}),F(B),D(e,B);var T=ge({get onInit(){return a()},set onInit(M){a(M),y()}});return r(),T}ue(Yf,{onInit:{}},[],[],!0);function sb(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 ys.init((o==null?void 0:o.nodes)||[],(o==null?void 0:o.edges)||[]),Wr("tinyflow_options",n()),Id(e,{fitView:!0,children:(i,s)=>{Yf(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",ue(sb,{options:{},onInit:{}},[],[],!1));const ab=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 Sm({...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))}});rt.Tinyflow=ab,Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"})});
12
38
  //# sourceMappingURL=index.umd.js.map