@iterms/tinyflow-ai-vue 0.2.8 → 0.2.9
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.js +1693 -1688
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +11 -11
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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&<.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&<!==null&<.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&<.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;
|
|
1
|
+
(function(rt,qe){typeof exports=="object"&&typeof module<"u"?qe(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],qe):(rt=typeof globalThis<"u"?globalThis:rt||self,qe(rt.TinyflowVue={},rt.Vue))})(this,function(rt,qe){"use strict";var bx=Object.defineProperty;var Jf=rt=>{throw TypeError(rt)};var Cx=(rt,qe,wt)=>qe in rt?bx(rt,qe,{enumerable:!0,configurable:!0,writable:!0,value:wt}):rt[qe]=wt;var Et=(rt,qe,wt)=>Cx(rt,typeof qe!="symbol"?qe+"":qe,wt),yl=(rt,qe,wt)=>qe.has(rt)||Jf("Cannot "+wt);var Se=(rt,qe,wt)=>(yl(rt,qe,"read from private field"),wt?wt.call(rt):qe.get(rt)),yt=(rt,qe,wt)=>qe.has(rt)?Jf("Cannot add the same private member more than once"):qe instanceof WeakSet?qe.add(rt):qe.set(rt,wt),It=(rt,qe,wt,Bn)=>(yl(rt,qe,"write to private field"),Bn?Bn.call(rt,wt):qe.set(rt,wt),wt),Eo=(rt,qe,wt)=>(yl(rt,qe,"access private method"),wt);var Xf,fi,xo,bo,hr,gi,hi,Rr,Co,vr,Gn,Br,Jn,Qf,e1,wl,pr,$o,vi,Ts,t1,Qn,vn;typeof window<"u"&&((Xf=window.__svelte??(window.__svelte={})).v??(Xf.v=new Set)).add("5");let Bn=!1,n1=!1;function r1(){Bn=!0}r1();const _i=1,xi=2,_l=4,o1=8,i1=16,s1=1,a1=2,xl=4,l1=8,u1=16,bl=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,bi=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,xt=1024,Wt=2048,tr=4096,pn=8192,_r=16384,Rs=32768,Xr=65536,Pl=1<<17,w1=1<<18,Bs=1<<19,Fs=1<<20,Ys=1<<21,Xs=1<<22,xr=1<<23,Sn=Symbol("$state"),Ws=Symbol("legacy props"),_1=Symbol(""),qs=new class extends Error{constructor(){super(...arguments);Et(this,"name","StaleReactionError");Et(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},x1=1,Zs=3,Wr=8;function b1(){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===Wr){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!==Wr)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 br(e){return Us().get(e)}function qr(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&<.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|=xr,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&&b1(),e}function Ao(e){var t=Gt|Wt,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!==qs&&(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()),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:xt;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=X1(),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 X1(){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,xo,new Map);yt(this,bo,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,xo).has(t)||Se(this,xo).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;W1()}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,Wt),rr(t);for(const t of Se(this,Gn))Ct(t,Wt),rr(t);for(const t of Se(this,Br))Ct(t,Wt),rr(t);It(this,vr,[]),It(this,Gn,[]),this.flush()}else this.deactivate()}add_callback(t){Se(this,bo).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,xo=new WeakMap,bo=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,xo))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,xt);for(const s of Se(this,Gn))Ct(s,xt);for(const s of Se(this,Br))Ct(s,xt)}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^=xt;for(var n=t.first;n!==null;){var r=n.f,o=(r&(Yn|wr))!==0,i=o&&(r&xt)!==0,s=i||(r&pn)!==0||this.skipped_effects.has(n);if(!s&&n.fn!==null){if(o)n.f^=xt;else if((r&zs)!==0)Se(this,Gn).push(n);else if(zo(n))if((r&Xs)!==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,bo))t();Se(this,bo).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 W1(){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&xt)===0)return;t.f^=xt}}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&<!==null&<.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|Xs|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&Wt)!==0&&Js(e),Ct(e,(e.f&ln)===0?xt:tr)),e.wv=su(),Yl(e,Wt),Mo()&&Ie!==null&&(Ie.f&xt)!==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&Wt)===0&&Ct(s,t),(a&Gt)!==0?Yl(s,tr):(a&Wt)===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),x=Vt(v);return x}),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 x=s(()=>Nn(c));te(g,x)}var b=Reflect.getOwnPropertyDescriptor(a,l);if(b!=null&&b.set&&b.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 Xl(e){try{if(e!==null&&typeof e=="object"&&Sn in e)return e[Sn]}catch{}return e}function q1(e,t){return Object.is(Xl(e),Xl(t))}var qt,Wl,ql,Zl;function ta(){if(qt===void 0){qt=window,Wl=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;ql=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 bt(e){return ql.call(e)}function Tn(e){return Zl.call(e)}function Y(e,t){if(!He)return bt(e);var n=bt(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=bt(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|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|=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,xt),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&xt)!==0&&Ct(n,tr),zo(n)&&Jr(n),t.ran=!1}})}function G1(e){return mn(Xs|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(qs);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&Xr)!==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&xt)===0&&(Ct(e,Wt),rr(e));for(var n=e.first;n!==null;){var r=n.next,o=(n.f&Xr)!==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&Wt)!==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,xt)}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,Wt):(i.f&xt)!==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(qs),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|Wt))===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&xr)!==0&&(e.f^=xr),g}catch(x){return L1(x)}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,xt);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&Wt)!==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&xt)===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&xr)!==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 X(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&&bt(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 x=i["__"+r];if(x!=null&&(!i.disabled||e.target===i))if(Yr(x)){var[b,...C]=x;b.apply(i,[e,...C])}else x.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&bl)!==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=bt(o)));var s=r||Wl?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 ig(e,t,n="svg"){var r=!e.startsWith("<!>"),o=(t&bl)!==0,i=`<${n}>${r?e:"<!>"+e}</${n}>`,s;return()=>{if(He)return Zt(Ye,null),Ye;if(!s){var a=la(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 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 Xe(){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=bt(n);i&&(i.nodeType!==Wr||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!==Wr||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 x=Qr.get(h);x===void 0?(document.addEventListener(h,Ro,{passive:v}),Qr.set(h,1)):Qr.set(h,x+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)))},Xr),He&&(r=Ye)}function tn(e){lt===null&&ki(),Bn&<.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?Xr: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 x=!1;if(He){const E=Nl(r)===As;!!s===E&&(r=Ks(),zt(r),Jt(!1),x=!0)}var b=ra(),C=r;if(b&&(u=document.createDocumentFragment(),u.append(C=un())),s?o??(o=v&&yn(()=>v(C))):i??(i=v&&yn(()=>v(C))),b){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();x&&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(bt(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,x;function b(){_g(x,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(()=>{x??(x=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===Wr&&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|xi))!==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(b)}else b();m&&Jt(!0),d(h)}),He&&(s=Ye)}function _g(e,t,n,r,o,i,s,a,l){var H,I,q,j;var c=(s&o1)!==0,u=(s&(_i|xi))!==0,g=t.length,f=n.items,h=n.first,v=h,x,b=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=b?b.next:v;Vn(n,b,A),Vn(n,A,L),fa(A,L,o),b=A}else{var V=v?v.e.nodes_start:o;b=da(V,n,b,b===null?n.first:b.next,p,E,S,i,s,l)}f.set(E,b),m=[],_=[],v=b.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(x!==void 0&&x.has(N)){if(m.length<_.length){var O=_[0],z;b=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)x.delete(_[z]);Vn(n,B.prev,k.next),Vn(n,b,B),Vn(n,k,O),v=O,b=k,S-=1,m=[],_=[]}else x.delete(N),fa(N,v,o),Vn(n,N.prev,N.next),Vn(n,N,b===null?n.first:b.next),Vn(n,b,N),b=N;continue}for(m=[],_=[];v!==null&&v.k!==E;)(v.e.f&pn)===0&&(x??(x=new Set)).add(v),_.push(v),v=v.next;if(v===null)continue;N=v}m.push(N),b=N,v=N.next}if(v!==null||x!==void 0){for(var $=x===void 0?[]:Ls(x);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)(q=$[S].a)==null||q.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=b&&b.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&xi)!==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&xi)===0?s:jr(s),x={i:v,v:h,k:i,a:null,e:null,prev:n,next:r};try{if(e===null){var b=document.createDocumentFragment();b.append(e=un())}return x.e=yn(()=>a(e,h,v,c),He),x.e.prev=n&&n.e,x.e.next=r&&r.e,n===null?u||(t.first=x):(n.next=x,n.e.next=x.e),r!==null&&(r.prev=x,r.e.prev=x.e),x}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!==Wr||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=bt(g)),Zt(bt(g),g.lastChild),n||r)for(;bt(g);)i.before(bt(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 xg(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()}},Xr),He&&(r=Ye)}function bg(e,t,n,r,o,i){let s=He;He&&Pn();var a,l,c=null;He&&Ye.nodeType===x1&&(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?bt(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))},Xr),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();X(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 xu(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 x=e.length;for(var g=0;g<x;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===x-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+=xu(r)),o&&(n+=xu(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(bu(r));return}for(r of e.options){var o=bu(r);if(q1(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 bu(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 x=_[0]+_[1];if(x!=="$$")if(x==="on"){const E={},N="$$"+_;let S=_.slice(2);var b=lg(S);if(sg(S)&&(S=S.slice(0,-7),E.capture=!0),!b&&v){if(p!=null)continue;e.removeEventListener(S,c[N],E),c[N]=null}if(p!=null)if(b)e[`__${S}`]=p,Sr([S]);else{let A=function(L){c[_].call(this,L)};c[N]=hu(S,e,A,E)}else b&&(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 x of Object.getOwnPropertySymbols(l))f[x]||Bt(l[x]);for(let x of Object.getOwnPropertySymbols(f)){var v=f[x];x.description===g1&&(!a||v!==a[x])&&(l[x]&&Bt(l[x]),l[x]=yn(()=>Cg(e,()=>v))),h[x]=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=()=>X(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:be(e,t).subscribe}}function be(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,x)=>ya(v,b=>{c[x]=b,u&=~(1<<x),l&&f()},()=>{u|=1<<x}));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,xl)}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===Ws)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||Ws 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&xl)===0)return v;if(u){var x=e.$$legacy;return function(p,E){return arguments.length>0?((!o||!E||x||h)&&u(E?v():p),p):v()}}var b=!1,C=((n&s1)!==0?Ao:De)(()=>(b=!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),b=!0,a!==void 0&&(a=N),p}return kr&&b||(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===Ws?!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 bi(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 bi(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 bi(t).map(a=>(t[a].attribute||a).toLowerCase())}};return bi(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 Xg(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 Wg(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Vu(e){var t=Ri(e);return(t.local?Wg:Xg)(t)}function qg(){}function xa(e){return e==null?qg:function(){return this.querySelector(e)}}function Zg(e){typeof e!="function"&&(e=xa(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,x=a[c]=new Array(v),b=s[c]=new Array(v),C=l[c]=new Array(f);n(u,g,x,b,C,h,t);for(var m=0,_=0,p,E;m<v;++m)if(p=x[m]){for(m>=_&&(_=m+1);!(E=b[_])&&++_<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 xh(){return Array.from(this)}function bh(){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 ba(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=ba(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Yu(e,t){for(var n=ba(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 Xh(e,t){var n=Ru(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"?Yh:t?Bh:Fh)(n,t))}function Wh(){this.textContent=""}function qh(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?Wh:(typeof e=="function"?Zh:qh)(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:xa(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 Xu(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 Xu(this,e,t)}}function yv(e,t){return function(){return Xu(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 Wu=[null];function rn(e,t){this._groups=e,this._parents=t}function Fo(){return new rn([[document.documentElement]],Wu)}function xv(){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:xv,order:mh,sort:yh,call:_h,nodes:xh,node:bh,size:Ch,empty:$h,each:kh,attr:Hh,style:Oh,property:Rh,classed:Xh,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]],Wu)}function bv(e){let t;for(;t=e.sourceEvent;)e=t;return e}function xn(e,t){if(e=bv(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 qu(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",b).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",x,Yo),qu(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 x(p){gn(p.view).on("mousemove.drag mouseup.drag",null),Zu(p.view,c),ro(p),o.mouse("end",p)}function b(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=xn(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=xn(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 Xo(){}var Wo=.7,Yi=1/Wo,oo="\\s*([+-]?\\d+)\\s*",qo="\\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},${qo}\\)$`),Dv=new RegExp(`^rgba\\(${An},${An},${An},${qo}\\)$`),Vv=new RegExp(`^hsl\\(${qo},${An},${An}\\)$`),Av=new RegExp(`^hsla\\(${qo},${An},${An},${qo}\\)$`),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(Xo,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?Xi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Xi(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))?Xi(t[1],t[2],t[3],t[4]):(t=Dv.exec(e))?Xi(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 Xi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Kt(e,t,n,r)}function Iv(e){return e instanceof Xo||(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(Xo,{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?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(Mr(this.r),Mr(this.g),Mr(this.b),Wi(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=Wi(this.opacity);return`${e===1?"rgb(":"rgba("}${Mr(this.r)}, ${Mr(this.g)}, ${Mr(this.b)}${e===1?")":`, ${e})`}`}function Wi(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 bn(e,t,n,r)}function nc(e){if(e instanceof bn)return new bn(e.h,e.s,e.l,e.opacity);if(e instanceof Xo||(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 Rv(e,t,n,r){return arguments.length===1?nc(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}ka(bn,Rv,Ku(Xo,{brighter(e){return e=e==null?Yi:Math.pow(Yi,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(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 bn(rc(this.h),qi(this.s),qi(this.l),Wi(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=Wi(this.opacity);return`${e===1?"hsl(":"hsla("}${rc(this.h)}, ${qi(this.s)*100}%, ${qi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rc(e){return e=(e||0)%360,e<0?e+360:e}function qi(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 Xv(e){return function(){return e}}function Wv(e){return function(t){return e(t)+""}}function qv(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]?Wv(l[0].x):Xv(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 x=h.push("translate(",null,t,null,n);v.push({i:x-4,x:sr(c,g)},{i:x-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 x=h.push(o(h)+"scale(",null,",",null,")");v.push({i:x-4,x:sr(c,g)},{i:x-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,x=f.length,b;++v<x;)g[(b=f[v]).i]=b.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,x=h*h+v*v,b,C;if(x<Gv)C=Math.log(f/c)/t,b=function(S){return[a+S*h,l+S*v,c*Math.exp(t*S*C)]};else{var m=Math.sqrt(x),_=(f*f-c*c+r*x)/(2*c*n*m),p=(f*f-c*c-r*x)/(2*f*n*m),E=Math.log(Math.sqrt(_*_+1)-_),N=Math.log(Math.sqrt(p*p+1)-p);C=(N-E)/t,b=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 b.duration=C*1e3*t/Math.SQRT2,b}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):qv)(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 x0(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 b0(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?x0:b0)(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 Xn(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 Xn(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=xa(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 Xn(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),x=0,b=f.length;x<b;++x)(h=f[x])&&es(h,t,n,x,f,v);i.push(f),s.push(u)}return new Xn(i,s,t,n)}var Y0=Fo.prototype.constructor;function X0(){return new Y0(this._groups,this._parents)}function W0(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 q0(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,W0(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,q0(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=xc(),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 Xn(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 Xn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function xc(){return++ap}var Wn=Fo.prototype;Xn.prototype={constructor:Xn,select:B0,selectAll:F0,selectChild:Wn.selectChild,selectChildren:Wn.selectChildren,filter:V0,merge:A0,selection:X0,transition:ip,call:Wn.call,nodes:Wn.nodes,node:Wn.node,size:Wn.size,empty:Wn.empty,each:Wn.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]:Wn[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 Xn?(t=e._id,e=e._name):(t=xc(),(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 Xn(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 qn(e,t,n){this.k=e,this.x=t,this.y=n}qn.prototype={constructor:qn,scale:function(e){return e===1?this:new qn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new qn(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 qn(1,0,0);bc.prototype=qn.prototype;function bc(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,x=0,b=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,q=H.invert(I),j=typeof $=="function"?$.apply(this,arguments):$;return n(_(m(H,j),I,q),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,q=T==null?p(H):typeof T=="function"?T.apply(this,arguments):T;return n(rs.translate(q[0],q[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 qn($,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 qn(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),q=t.apply(M,H),j=P==null?p(q):typeof P=="function"?P.apply(M,H):P,J=Math.max(q[1][0]-q[0][0],q[1][1]-q[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 qn(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=xn(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=xn(k,P),I=k.clientX,q=k.clientY;qu(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-q;T.moved=ee*ee+ce*ce>x}T.event(ne).zoom("mouse",n(_(T.that.__zoom,T.mouse[0]=xn(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=xn(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,q,j;for(La(k),I=0;I<T;++I)q=P[I],j=xn(q,this),j=[j,this.__zoom.invert(j),q.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,q,j;for(Jo(k),H=0;H<M;++H)I=T[H],q=xn(I,this),P.touch0&&P.touch0[2]===I.identifier?P.touch0[0]=q:P.touch1&&P.touch1[2]===I.identifier&&(P.touch1[0]=q);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)),q=[(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)q=P.touch0[0],j=P.touch0[1];else return;P.zoom("touch",n(_(I,q,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=xn(I,this),Math.hypot(g[0]-I[0],g[1]-I[1])<b)){var q=gn(this).on("dblclick.zoom");q&&q.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?(x=(k=+k)*k,C):Math.sqrt(x)},C.tapDistance=function(k){return arguments.length?(b=+k,C):b},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}},xp=(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,x=ti(a,uo(c)),b=(h??0)*(v??0),C=i&&x>0;(!c.internals.handleBounds||C||x>=b||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 bp(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=bp(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(x=>x.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,x=Sp(e,h,v,u,t,n),b={left:Math.min(x.left-s.left,0),top:Math.min(x.top-s.top,0),right:Math.min(x.right-s.right,0),bottom:Math.min(x.bottom-s.bottom,0)};return{x:h-b.left+b.right,y:v-b.top+b.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 Xa(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 Wa({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,x;const b={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,x=o.y??_;const S=[{x:v,y:l.y},{x:v,y:c.y}],A=[{x:l.x,y:x},{x:c.x,y:x}];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?b[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+b.x,y:l.y+b.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,x=h[0].y):(v=h[0].x,x=(L.y+V.y)/2)}return[[e,{x:l.x+b.x,y:l.y+b.y},...h,{x:c.x+C.x,y:c.y+C.y},n],v,x,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((b,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}`,b+=_,b},""),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||Xc(t.handles),o=n.internals.handleBounds||Xc(n.handles),i=Wc((r==null?void 0:r.source)??[],e.sourceHandle),s=Wc(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 Xc(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 Wc(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function qa(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=qa(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 Xp(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:{}},Wp={...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 qp(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 qc(e,t,n,r){var l,c;const o=Ka(Wp,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,x=Math.max(g.width,Math.round(a.width)),b=Math.max(g.height,Math.round(a.height)),C=(x-g.width)*f[0],m=(b-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:x+(h?f[0]*h-C:0),height:b+(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),x=h.measured.width!==v.width||h.measured.height!==v.height;if(!!(v.width&&v.height&&(x||!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,x&&(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:b,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:q}=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],xe=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],[xe,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&&(q(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 q=Xa(V.sourceEvent,{transform:k,snapGrid:$,snapToGrid:P,containerBounds:u});if(i=q,a=Qp(O,B,q,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=Xa(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=Xa(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&&(!b||!Gc(O,`.${b}`,m))&&(!C||Gc(O,C,m))});f.call(L)}function x(){f==null||f.on(".drag",null)}return{update:v,destroy:x}}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:x,onConnectEnd:b,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 q(){if(!u||!k)return;const[Ne,Ae]=Hc(P,k,N);f({x:Ne,y:Ae}),A=requestAnimationFrame(q)}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||(q(),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 xe={...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&&xe.toHandle&&ce.toHandle.type===xe.toHandle.type&&ce.toHandle.nodeId===xe.toHandle.nodeId&&ce.toHandle.id===xe.toHandle.id&&ce.to.x===xe.to.x&&ce.to.y===xe.to.y||(_(xe),ce=xe)}function we(Ne){(L||I)&&M&&H&&(x==null||x(M));const{inProgress:Ae,...ye}=ce,xe={...ye,toPosition:ce.toHandle?ce.toPosition:null};b==null||b(Ne,xe),i&&(m==null||m(Ne,xe)),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),x=s.elementFromPoint(h,v),b=x!=null&&x.classList.contains(`${a}-flow__handle`)?x:f,C={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const m=Qc(void 0,b),_=b.getAttribute("data-nodeid"),p=b.getAttribute("data-handleid"),E=b.classList.contains("connectable"),N=b.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 x=[0,0];const b=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(x=[_.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]-x[0],E[1]-x[1]];x=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",b).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:xn}}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 b=xn(u),C=rd(u),m=g*Math.pow(2,C);r.scaleTo(n,m,b,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 x=hs(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,a==null||a(u,x)),e.isPanScrolling&&(l==null||l(u,x),e.panScrollTimeout=setTimeout(()=>{c==null||c(u,x),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"),x=h.on("dblclick.zoom");f.wheelDelta(rd);function b(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:q,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:q,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 xe=g2({zoomPanValues:u,panOnDrag:T,panOnScroll:P,onPaneContextMenu:k,onPanZoomEnd:l,onDraggingChange:c});f.on("end",xe)}const Ne=h2({zoomActivationKeyPressed:ne,panOnDrag:T,zoomOnScroll:j,panOnScroll:P,zoomOnDoubleClick:J,zoomOnPinch:q,userSelectionActive:$,noPanClassName:B,noWheelClassName:z,lib:ee});f.filter(Ne),J?h.on("dblclick.zoom",x):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 b(P),new Promise(T=>T(P))}async function p(z,B){const k=Ga(z);return await b(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?bc(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),x=()=>oe(Oe,"$onConnectStartAction",n),b=()=>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),q=w(t,"class",12,void 0);const j=br("svelteflow__node_id"),J=br("svelteflow__node_connectable"),ne=tt(),{connectionMode:ee,domNode:ce,nodeLookup:re,connectionRadius:we,viewport:Ne,isValidConnection:Ae,lib:ye,addEdge:xe,onedgecreate:de,panBy:U,cancelConnection:se,updateConnection:W,autoPanOnConnect:ae,edges:Me,connectionLookup:Ee,onconnect:Fe,onconnectstart:Oe,onconnectend:me,flowId:ze,connection:Ue}=ne;function at($e){const We=Oc($e);(We&&$e.button===0||!We)&&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:W,cancelConnection:se,panBy:U,onConnect:Le=>{var kt;const Ht=h()?h()(Le):Le;Ht&&(xe(Ht),(kt=v())==null||kt(Le))},onConnectStart:(Le,Ht)=>{var kt;(kt=x())==null||kt(Le,{nodeId:Ht.nodeId,handleId:Ht.handleId,handleType:Ht.handleType})},onConnectEnd:(Le,Ht)=>{var kt;(kt=b())==null||kt(Le,Ht)},getTransform:()=>[C().x,C().y,C().zoom],getFromHandle:()=>m().fromHandle})}let K=le(null),Ge=le();ve(()=>X(k()),()=>{te(E,k()==="target")}),ve(()=>(X(I()),o()),()=>{te(N,I()!==void 0?I():o())}),ve(()=>X(B()),()=>{te(S,B()||null)}),ve(()=>(X(M()),X(H()),_(),p(),X(k()),X(B())),()=>{(M()||H())&&(_(),te(Ge,p().get(`${j}-${k()}${B()?`-${B()}`:""}`)))}),ve(()=>(d(K),d(Ge),X(H()),X(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(),X(k()),d(S)),()=>{var $e,We,Le;te(L,(($e=m().fromHandle)==null?void 0:$e.nodeId)===j&&((We=m().fromHandle)==null?void 0:We.type)===k()&&((Le=m().fromHandle)==null?void 0:Le.id)===d(S))}),ve(()=>(m(),X(k()),d(S)),()=>{var $e,We,Le;te(V,(($e=m().toHandle)==null?void 0:$e.nodeId)===j&&((We=m().toHandle)==null?void 0:We.type)===k()&&((Le=m().toHandle)==null?void 0:Le.id)===d(S))}),ve(()=>(l(),m(),X(k()),d(S)),()=>{var $e,We,Le;te(O,l()===Vr.Strict?(($e=m().fromHandle)==null?void 0:$e.type)!==k():j!==((We=m().fromHandle)==null?void 0:We.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,We)=>{_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,We),mt(Qe,P())},[()=>wn((X(ut),X($()),X(q()),G(()=>ut(["svelte-flow__handle",`svelte-flow__handle-${$()}`,"nodrag","nopan",$(),q()])))),()=>({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 q()},set class($e){q($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(()=>(X(o()),X(Pe),G(()=>o()??Pe.Top)));ar(a,{type:"target",get position(){return d(u)}})}var l=R(a),c=R(l);{let u=De(()=>(X(i()),X(Pe),G(()=>i()??Pe.Bottom)));ar(c,{type:"source",get position(){return d(u)}})}return Ve(()=>ft(l,` ${X(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(()=>(X(o()),X(Pe),G(()=>o()??Pe.Bottom)));ar(a,{type:"source",get position(){return d(l)}})}return Ve(()=>ft(s,`${X(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(()=>(X(o()),X(Pe),G(()=>o()??Pe.Top)));ar(a,{type:"target",get position(){return d(l)}})}return Ve(()=>ft(s,`${X(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 x2=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=br("svelteflow__edge_id");return Be(),ud(e,{children:(a,l)=>{var c=x2();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 b2=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(),x=he(v),b=R(x);{var C=p=>{var E=b2();_e(E,"stroke-opacity",0),Ve(()=>{_e(E,"d",r()),_e(E,"stroke-width",h)}),D(p,E)};pe(b,p=>{h&&p(C)})}var m=R(b);{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(x,"id",n()),_e(x,"d",r()),Nt(x,0,p),_e(x,"marker-start",l()),_e(x,"marker-end",c()),mt(x,u())},[()=>wn((X(ut),X(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),x=w(t,"targetX",12),b=w(t,"targetY",12),C=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),X(f()),X(h()),X(x()),X(b()),X(v()),X(C())),()=>{(m=>{var _=er(m,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(zc({sourceX:f(),sourceY:h(),targetX:x(),targetY:b(),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 x()},set targetX(m){x(m),y()},get targetY(){return b()},set targetY(m){b(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),x=w(t,"targetX",12),b=w(t,"targetY",12),C=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),X(f()),X(h()),X(x()),X(b()),X(v()),X(C())),()=>{(m=>{var _=er(m,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(gs({sourceX:f(),sourceY:h(),targetX:x(),targetY:b(),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 x()},set targetX(m){x(m),y()},get targetY(){return b()},set targetY(m){b(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),x=w(t,"targetY",12);return ve(()=>(d(r),d(o),d(i),X(f()),X(h()),X(v()),X(x())),()=>{(b=>{var C=er(b,3);te(r,C[0]),te(o,C[1]),te(i,C[2])})(Wa({sourceX:f(),sourceY:h(),targetX:v(),targetY:x()}))}),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(b){s(b),y()},get labelStyle(){return a()},set labelStyle(b){a(b),y()},get style(){return l()},set style(b){l(b),y()},get markerStart(){return c()},set markerStart(b){c(b),y()},get markerEnd(){return u()},set markerEnd(b){u(b),y()},get interactionWidth(){return g()},set interactionWidth(b){g(b),y()},get sourceX(){return f()},set sourceX(b){f(b),y()},get sourceY(){return h()},set sourceY(b){h(b),y()},get targetX(){return v()},set targetX(b){v(b),y()},get targetY(){return x()},set targetY(b){x(b),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),x=w(t,"targetX",12),b=w(t,"targetY",12),C=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),X(f()),X(h()),X(x()),X(b()),X(v()),X(C())),()=>{(m=>{var _=er(m,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(gs({sourceX:f(),sourceY:h(),targetX:x(),targetY:b(),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 x()},set targetX(m){x(m),y()},get targetY(){return b()},set targetY(m){b(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:x}=be([]);let b=e,C={},m=!0;const _=S=>{const A=qc(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)),b=S,v(b),b},p=S=>_(S(b)),E=S=>{C=S},N=S=>{m=S.elevateNodesOnSelect??m};return _(b),{subscribe:h,set:_,update:p,setDefaultOptions:E,setOptions:N}},P2=(e,t,n,r)=>{const{subscribe:o,set:i,update:s}=be([]);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;qc(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=be(!1),x=be(void 0),b=be(null),C=be(null),m=be(500),_=be(500),p=be(.5),E=be(2);return{flowId:be(null),nodes:S2(e,a,l,g,f,v,x,b,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:be(g),nodeDragThreshold:be(1),nodeExtent:be(f),translateExtent:be(os),autoPanOnNodeDrag:be(!0),autoPanOnConnect:be(!0),fitViewQueued:v,fitViewOptions:x,fitViewResolver:b,panZoom:C,snapGrid:be(null),dragging:be(!1),selectionRect:be(null),selectionKeyPressed:be(!1),multiselectionKeyPressed:be(!1),deleteKeyPressed:be(!1),panActivationKeyPressed:be(!1),zoomActivationKeyPressed:be(!1),selectionRectMode:be(null),selectionMode:be(is.Partial),nodeTypes:be(vd),edgeTypes:be(pd),viewport:be(h),connectionMode:be(Vr.Strict),domNode:be(null),connection:fn(Ia),connectionLineType:be(ao.Bezier),connectionRadius:be(20),isValidConnection:be(()=>!0),nodesDraggable:be(!0),nodesConnectable:be(!0),elementsSelectable:be(!0),selectNodesOnDrag:be(!0),markers:fn([]),defaultMarkerColor:be("#b1b1b7"),lib:fn("svelte"),onlyRenderVisibleElements:be(!1),onerror:be(kp),ondelete:be(void 0),onedgecreate:be(void 0),onconnect:be(void 0),onconnectstart:be(void 0),onconnectend:be(void 0),onbeforedelete:be(void 0),nodesInitialized:be(!1),edgesInitialized:be(!1),viewportInitialized:be(!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 q=(M=T.get(H))==null?void 0:M.internals.userNode;q&&(q.position=I.position,q.dragging=P)}a.nodes.update(H=>H)};function f($){var I,q,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){qp(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=((q=J.dimensions)==null?void 0:q.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 x($){return v(1.2,$)}function b($){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:q,edges:j}=await Nc({nodesToRemove:H,edgesToRemove:I,nodes:T,edges:M,onBeforeDelete:Q(a.onbeforedelete)});(q.length||j.length)&&(a.nodes.update(J=>J.filter(ne=>!q.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:q,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=be(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:x,zoomOut:b,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=br(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 qr(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),x=w(t,"onMoveStart",12,void 0),b=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(),q=ee=>V.set({x:ee[0],y:ee[1],zoom:ee[2]});tn(()=>{Oi(I,!0)}),ve(()=>X(v()),()=>{te(g,v()||{x:0,y:0,zoom:1})}),ve(()=>(o(),X(S())),()=>{te(f,o()||S())}),ve(()=>(o(),X(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:x(),onPanZoom:b(),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:q})),D(e,j);var ne=ge({get initialViewport(){return v()},set initialViewport(ee){v(ee),y()},get onMoveStart(){return x()},set onMoveStart(ee){x(ee),y()},get onMove(){return b()},set onMove(ee){b(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 xd(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),x=le(),b=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=[],q=!1;function j(de){if(q||c().inProgress){q=!1;return}p("paneclick",{event:de}),P(),z.set(null)}function J(de){var W,ae;if(H=d(M).getBoundingClientRect(),!V||!d(b)||de.button!==0||de.target!==d(M)||!H)return;(ae=(W=de.target)==null?void 0:W.setPointerCapture)==null||ae.call(W,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(b)||!H||!s())return;q=!0;const U=jn(de,H),se=s().startX??0,W=s().startY??0,ae={...s(),x:U.x<se?U.x:se,y:U.y<W?U.y:W,width:Math.abs(U.x-se),height:Math.abs(U.y-W)},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(b)&&l()==="user"&&de.target===d(M)&&(j==null||j(de)),O.set(null),I.length>0&&Oi(z,"nodes"),i()&&(q=!1))}const ce=de=>{var U;if(Array.isArray(d(x))&&((U=d(x))!=null&&U.includes(2))){de.preventDefault();return}p("panecontextmenu",{event:de})};ve(()=>(o(),X(m())),()=>{te(x,o()||m())}),ve(()=>(i(),s(),X(_()),d(x)),()=>{te(b,i()||s()||_()&&d(x)!==!0)}),ve(()=>(a(),d(b),l()),()=>{te(C,a()&&(d(b)||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(b)})]),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 xe=ge({get panOnDrag(){return m()},set panOnDrag(de){m(de),y()},get selectionOnDrag(){return _()},set selectionOnDrag(de){_(de),y()}});return r(),xe}ue(xd,{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 bd(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(bd,{},["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(xe,"$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,()=>({})),x=w(t,"selected",13,!1),b=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),q=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:xe,nodesDraggable:de}=ce;let U=le(void 0,!0),se=le(null,!0);const W=Di(),ae=be(m());let Me=le(void 0,!0),Ee=le(void 0,!0),Fe=le(void 0,!0);qr("svelteflow__node_id",h()),qr("svelteflow__node_connectable",ae),ca(()=>{var K;d(se)&&((K=N())==null||K.unobserve(d(se)))});function Oe(K){C()&&(!Q(Ne)||!b()||Q(we)>0)&&Ae(h()),W("nodeclick",{node:f().internals.userNode,event:K})}ve(()=>X(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),X(A())),()=>{d(c)||console.warn("003",so.error003(A()))}),ve(()=>(X(H()),X(I()),X(T()),X(M()),X($()),X(P())),()=>{te(g,z2({width:H(),height:I(),initialWidth:T(),initialHeight:M(),measuredWidth:$(),measuredHeight:P()}))}),ve(()=>X(m()),()=>{ae.set(!!m())}),ve(()=>(d(Me),d(l),d(Ee),X(z()),d(Fe),X(B()),X(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(()=>(X(N()),d(U),d(se),X(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=Xe(),ze=he(me);{var Ue=K=>{var Ge=R2();let Qe,gt;var sn=Y(Ge);{let nt=De(()=>x()??!1),$e=De(()=>C()??i()??!0),We=De(()=>_()??!0),Le=De(()=>b()??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(We)},get sourcePosition(){return z()},get targetPosition(){return B()},get zIndex(){return k()},get dragging(){return E()},get draggable(){return d(Le)},get dragHandle(){return q()},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:q(),noDragClass:"nodrag",nodeClickDistance:ne(),onNodeMouseDown:Ae,onDrag:(nt,$e,We,Le)=>{W("nodedrag",{event:nt,targetNode:We,nodes:Le})},onDragStart:(nt,$e,We,Le)=>{W("nodedragstart",{event:nt,targetNode:We,nodes:Le})},onDragStop:(nt,$e,We,Le)=>{W("nodedragstop",{event:nt,targetNode:We,nodes:Le})},store:ce})),_n(Ge,nt=>te(U,nt),()=>d(U)),Qt(()=>dt("click",Ge,Oe)),Qt(()=>dt("mouseenter",Ge,nt=>W("nodemouseenter",{node:f(),event:nt}))),Qt(()=>dt("mouseleave",Ge,nt=>W("nodemouseleave",{node:f(),event:nt}))),Qt(()=>dt("mousemove",Ge,nt=>W("nodemousemove",{node:f(),event:nt}))),Qt(()=>dt("contextmenu",Ge,nt=>W("nodecontextmenu",{node:f(),event:nt}))),Ve((nt,$e,We)=>{_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,We)},[()=>wn((X(ut),d(l),X(ee()),G(()=>ut(["svelte-flow__node",`svelte-flow__node-${d(l)}`,ee()])))),()=>({dragging:E(),selected:x(),draggable:b(),connectable:m(),selectable:C(),nopan:b(),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 x()},set selected(K){x(K),y()},get draggable(){return b()},set draggable(K){b(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 q()},set dragHandle(K){q(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(x,"$parentLookup",n);let c=w(t,"nodeClickDistance",12,0);const{visibleNodes:u,nodesDraggable:g,nodesConnectable:f,elementsSelectable:h,updateNodeInternals:v,parentLookup:x}=tt(),b=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(()=>{b==null||b.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(()=>(X(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 b},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"),x=w(t,"source",13,""),b=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),q=w(t,"ariaLabel",13,void 0),j=w(t,"interactionWidth",13,void 0),J=w(t,"class",13,"");qr("svelteflow__edge_id",h());const{edgeLookup:ne,edgeTypes:ee,flowId:ce,elementsSelectable:re}=tt(),we=Di(),Ne=cd();function Ae(W){const ae=a().get(h());ae&&(Ne(h()),we("edgeclick",{event:W,edge:ae}))}function ye(W,ae){const Me=a().get(h());Me&&we(ae,{event:W,edge:Me})}ve(()=>X(v()),()=>{te(l,v()||"default")}),ve(()=>(o(),d(l),ps),()=>{te(c,o()[d(l)]||ps)}),ve(()=>(X(O()),i()),()=>{te(u,O()?`url('#${qa(O(),i())}')`:void 0)}),ve(()=>(X(z()),i()),()=>{te(g,z()?`url('#${qa(z(),i())}')`:void 0)}),ve(()=>(X(N()),s()),()=>{te(f,N()??s())}),Pt(),Be(!0);var xe=Xe(),de=he(xe);{var U=W=>{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 x()},get target(){return b()},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",q()===null?void 0:q()?q():`Edge from ${x()} to ${b()}`)},[()=>({"z-index":_()}),()=>wn((X(ut),X(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(W,ae)};pe(de,W=>{A()||W(U)})}D(e,xe);var se=ge({get id(){return h()},set id(W){h(W),y()},get type(){return v()},set type(W){v(W),y()},get source(){return x()},set source(W){x(W),y()},get target(){return b()},set target(W){b(W),y()},get data(){return C()},set data(W){C(W),y()},get style(){return m()},set style(W){m(W),y()},get zIndex(){return _()},set zIndex(W){_(W),y()},get animated(){return p()},set animated(W){p(W),y()},get selected(){return E()},set selected(W){E(W),y()},get selectable(){return N()},set selectable(W){N(W),y()},get deletable(){return S()},set deletable(W){S(W),y()},get hidden(){return A()},set hidden(W){A(W),y()},get label(){return L()},set label(W){L(W),y()},get labelStyle(){return V()},set labelStyle(W){V(W),y()},get markerStart(){return O()},set markerStart(W){O(W),y()},get markerEnd(){return z()},set markerEnd(W){z(W),y()},get sourceHandle(){return B()},set sourceHandle(W){B(W),y()},get targetHandle(){return k()},set targetHandle(W){k(W),y()},get sourceX(){return $()},set sourceX(W){$(W),y()},get sourceY(){return P()},set sourceY(W){P(W),y()},get targetX(){return T()},set targetX(W){T(W),y()},get targetY(){return M()},set targetY(W){M(W),y()},get sourcePosition(){return H()},set sourcePosition(W){H(W),y()},get targetPosition(){return I()},set targetPosition(W){I(W),y()},get ariaLabel(){return q()},set ariaLabel(W){q(W),y()},get interactionWidth(){return j()},set interactionWidth(W){j(W),y()},get class(){return J()},set class(W){J(W),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 X2=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=X2();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 W2=Ce('<polyline stroke-linecap="round" stroke-linejoin="round" fill="none" points="-5,-4 0,0 -5,4"></polyline>'),q2=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 x=W2();Ve(()=>{_e(x,"stroke",l()),_e(x,"stroke-width",c())}),D(v,x)},h=v=>{var x=Xe(),b=he(x);{var C=m=>{var _=q2();Ve(()=>{_e(_,"stroke",l()),_e(_,"stroke-width",c()),_e(_,"fill",l())}),D(m,_)};pe(b,m=>{X(r()),X(Ar),G(()=>r()===Ar.ArrowClosed)&&m(C)},!0)}D(v,x)};pe(g,v=>{X(r()),X(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 x=R(v,2);{var b=m=>{Ed(m,{onMount:()=>{Oi(l,!0)},onDestroy:()=>{Oi(l,!1)}})};pe(x,m=>{o(),G(()=>o().length>0)&&m(b)})}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=Xe(),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 x=Xe(),b=he(x);{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(b,m=>{o(),d(f),X(Ln),G(()=>o()==="nodes"&&d(f)&&Ln(d(f).x)&&Ln(d(f).y))&&m(C)})}D(e,x),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:x}=u;if(x){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 b={node:e,trigger:u,originalEvent:s};e.dispatchEvent(new CustomEvent("shortcut",{detail:b})),h==null||h(b)}}}}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 x(m){return m==null?"":h(m)?m.key:m}function b(m,_){return(Array.isArray(m)?m:[m]).map(E=>{const N=x(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",qt,C),dt("contextmenu",qt,C),Lt(qt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:b(n(),()=>a.set(!0)),type:"keydown"})),Lt(qt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:b(n(),()=>a.set(!1)),type:"keyup"})),Lt(qt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:b(r(),()=>l.set(!0)),type:"keydown"})),Lt(qt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:b(r(),()=>l.set(!1)),type:"keyup"})),Lt(qt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:b(o(),m=>{!(m.originalEvent.ctrlKey||m.originalEvent.metaKey||m.originalEvent.shiftKey)&&!Hp(m.originalEvent)&&c.set(!0)}),type:"keydown"})),Lt(qt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:b(o(),()=>c.set(!1)),type:"keyup"})),Lt(qt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:b(i(),()=>u.set(!0)),type:"keydown"})),Lt(qt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:b(i(),()=>u.set(!1)),type:"keyup"})),Lt(qt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:b(s(),()=>g.set(!0)),type:"keydown"})),Lt(qt,(m,_)=>it==null?void 0:it(m,_),()=>({trigger:b(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 x=le(null);ve(()=>(o(),X(u()),i(),d(x),Wa),()=>{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(x,V[0])})(zc(A));break;case ao.Step:(L=>{var V=er(L,1);te(x,V[0])})(gs({...A,borderRadius:0}));break;case ao.SmoothStep:(L=>{var V=er(L,1);te(x,V[0])})(gs(A));break;default:(L=>{var V=er(L,1);te(x,V[0])})(Wa(A))}}}),Pt(),Be();var b=Xe(),C=he(b);{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(x)),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((X(ut),X(Sc),o(),G(()=>ut(["svelte-flow__connection",Sc(o().isValid)]))))]),D(p,E)};pe(C,p=>{o(),G(()=>o().inProgress)&&p(m)})}D(e,b);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(()=>X(l()),()=>{te(a,`${l()}`.split("-"))}),Pt(),Be();var f=tm();nn(f,(x,b)=>({class:x,style:c(),...r,[Nr]:b}),[()=>(X(ut),X(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(x){l(x),y()},get style(){return c()},set style(x){c(x),y()},get class(){return u()},set class(x){u(x),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=Xe(),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=>{X(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=xg(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),x=w(t,"fitViewOptions",12,void 0),b=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,""),q=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),xe=w(t,"zoomOnDoubleClick",12,!0),de=w(t,"zoomOnPinch",12,!0),U=w(t,"panOnScroll",12,!1),se=w(t,"panOnDrag",12,!0),W=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),We=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(),Xt=le();const ko=a()||m(),et=V1(ms)?tt():H2({nodes:Q(f()),edges:Q(h()),width:at(),height:K(),fitView:v(),nodeOrigin:We(),nodeExtent:re()});tn(()=>(et.width.set(d(Dt)),et.height.set(d(Xt)),et.domNode.set(d(mi)),et.syncNodeStores(f()),et.syncEdgeStores(h()),et.syncViewport(_()),v()!==void 0&&et.fitViewQueued.set(v()),x()&&et.fitViewOptions.set(x()),Ad(et,{nodeTypes:p(),edgeTypes:E(),minZoom:b(),maxZoom:C(),translateExtent:ce(),paneClickDistance:Le()}),()=>{et.reset()}));const{initialized:pl}=et;let yi=le(!1);ve(()=>(d(Dt),d(Xt)),()=>{d(Dt)!==void 0&&d(Xt)!==void 0&&(et.width.set(d(Dt)),et.height.set(d(Xt)))}),ve(()=>(d(yi),l(),X($e())),()=>{var Z;!d(yi)&&l()&&((Z=$e())==null||Z(),te(yi,!0))}),ve(()=>(X(g()),X(M()),X(T()),X(S()),X($()),X(kt()),X(O()),X(z()),X(k()),X(we()),X(ee()),X(ae()),X(Me()),X(Ee()),X(Fe()),X(Oe()),X(H()),X(B()),X(Qe()),X(gt()),X(sn()),X(nt()),X(We()),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:We()};Od(et,Z)}),ve(()=>(X(p()),X(E()),X(b()),X(C()),X(ce()),X(Le())),()=>{Ad(et,{nodeTypes:p(),edgeTypes:E(),minZoom:b(),maxZoom:C(),translateExtent:ce(),paneClickDistance:Le()})}),ve(()=>X(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"}),[()=>(X(ut),X(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(()=>(X(Ne()),X(Zn),G(()=>Ne()===void 0?Zn.Free:Ne()))),ux=De(()=>Ae()===void 0?!0:Ae()),cx=De(()=>ye()===void 0?!0:ye()),dx=De(()=>xe()===void 0?!0:xe()),fx=De(()=>de()===void 0?!0:de()),gx=De(()=>U()===void 0?!1:U()),hx=De(()=>se()===void 0?!0:se()),vx=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(ux)},get zoomOnScroll(){return d(cx)},get zoomOnDoubleClick(){return d(dx)},get zoomOnPinch(){return d(fx)},get panOnScroll(){return d(gx)},get panOnDrag(){return d(hx)},get paneClickDistance(){return d(vx)},children:(px,kx)=>{{let mx=De(()=>se()===void 0?!0:se());xd(px,{get panOnDrag(){return d(mx)},get selectionOnDrag(){return W()},$$events:{paneclick(wi){je.call(this,t,wi)},panecontextmenu(wi){je.call(this,t,wi)}},children:(wi,Ex)=>{var Wf=am(),qf=he(Wf);bd(qf,{children:(wx,Sx)=>{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 q()},get style(){return I()},isCustomComponent:G(()=>n.connectionLine),$$slots:{connectionLine:(Ke,Px)=>{var Gf=Xe(),xx=he(Gf);Ot(xx,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 _x=R(Uf,2);Md(_x,{$$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(wx,Zf)},$$slots:{default:!0}});var yx=R(qf,2);Td(yx,{}),D(wi,Wf)},$$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(Xt,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 lx=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 x()},set fitViewOptions(Z){x(Z),y()},get minZoom(){return b()},set minZoom(Z){b(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 q()},set connectionLineContainerStyle(Z){q(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 xe()},set zoomOnDoubleClick(Z){xe(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 W()},set selectionOnDrag(Z){W(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 We()},set nodeOrigin(Z){We(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(),lx}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()});qr(ms,{getStore:()=>l}),ca(()=>{l.reset()}),Be();var c=Xe(),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}),[()=>(X(ut),X(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 Xd(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"),x=w(t,"showZoom",12,!0),b=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(),q={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(()=>X(L()),()=>{te(h,L()==="horizontal"?"horizontal":"vertical")}),Pt(),Be();{let re=De(()=>(X(ut),d(h),X(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(),xe=he(ye);Ot(xe,t,"before",{});var de=R(xe,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)}},()=>q,{$$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)}},()=>q,{$$events:{click:J},children:(at,K)=>{Rd(at)},$$slots:{default:!0}})),D(Oe,me)};pe(de,Oe=>{x()&&Oe(U)})}var se=R(de,2);{var W=Oe=>{si(Oe,vt({class:"svelte-flow__controls-fitview",title:"fit view","aria-label":"fit view"},()=>q,{$$events:{click:ne},children:(me,ze)=>{Bd(me)},$$slots:{default:!0}}))};pe(se,Oe=>{b()&&Oe(W)})}var ae=R(se,2);{var Me=Oe=>{si(Oe,vt({class:"svelte-flow__controls-interactive",title:"toggle interactivity","aria-label":"toggle interactivity"},()=>q,{$$events:{click:ee},children:(me,ze)=>{var Ue=Xe(),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 x()},set showZoom(re){x(re),y()},get showFitView(){return b()},set showFitView(re){b(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(Xd,{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 Wd(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((X(ut),X(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(Wd,{radius:{},class:{}},[],[],!0);var wm=Ce("<path></path>");function qd(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",(X(r()),G(()=>`M${r()[0]/2} 0 V${r()[1]} M0 ${r()[1]/2} H${r()[0]}`))),Nt(s,0,a)},[()=>wn((X(ut),X(o()),X(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(qd,{lineWidth:{},dimensions:{},variant:{},class:{}},[],[],!0);const _m={[lr.Dots]:1,[lr.Lines]:1,[lr.Cross]:6};var xm=Ce('<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>');const bm={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,bm);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),x=w(t,"lineWidth",12,1),b=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(),X(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=xm();let O;var z=Y(V),B=Y(z);{var k=M=>{{let H=De(()=>d(l)/2);Wd(M,{get radius(){return d(H)},get class(){return m()}})}},$=M=>{qd(M,{get dimensions(){return d(c)},get variant(){return f()},get lineWidth(){return x()},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((X(ut),X(_()),G(()=>ut(["svelte-flow__background",_()])))),()=>({"--xy-background-color-props":b(),"--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 x()},set lineWidth(M){x(M),y()},get bgColor(){return b()},set bgColor(M){b(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((x,b)=>{v=Nt(h,0,x,null,v,b),_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((X(ut),X(f()),G(()=>ut(["svelte-flow__minimap-node",f()])))),()=>({selected:g()})]),D(e,h),ge({get x(){return n()},set x(x){n(x),y()},get y(){return r()},set y(x){r(x),y()},get width(){return o()},set width(x){o(x),y()},get height(){return i()},set height(x){i(x),y()},get borderRadius(){return s()},set borderRadius(x){s(x),y()},get color(){return a()},set color(x){a(x),y()},get shapeRendering(){return l()},set shapeRendering(x){l(x),y()},get strokeColor(){return c()},set strokeColor(x){c(x),y()},get strokeWidth(){return u()},set strokeWidth(x){u(x),y()},get selected(){return g()},set selected(x){g(x),y()},get class(){return f()},set class(x){f(x),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(xe,"$viewport",n),s=()=>oe(de,"$containerWidth",n),a=()=>oe(U,"$containerHeight",n),l=()=>oe(ye,"$nodeLookup",n),c=()=>oe(Ae,"$nodes",n),u=()=>oe(W,"$panZoom",n),g=()=>oe(ae,"$translateExtent",n),f=le(),h=le(),v=le(),x=le(),b=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),q=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:xe,width:de,height:U,flowId:se,panZoom:W,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(()=>X(I()),()=>{te(h,I()??we)}),ve(()=>X(q()),()=>{te(v,q()??Ne)}),ve(()=>(d(ze),d(h)),()=>{te(x,d(ze).width/d(h))}),ve(()=>(d(ze),d(v)),()=>{te(b,d(ze).height/d(v))}),ve(()=>(d(x),d(b)),()=>{te(C,Math.max(d(x),d(b)))}),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(()=>(X(ut),X(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=Xe(),nt=he(sn);{var $e=We=>{var Le=km();let Ht;var kt=Y(Le);{var pi=Dt=>{var Xt=$m(),ko=Y(Xt,!0);F(Xt),Ve(()=>{_e(Xt,"id",me),ft(ko,V())}),D(Dt,Xt)};pe(kt,Dt=>{V()&&Dt(pi)})}var Fr=R(kt);At(Fr,1,c,Dt=>Dt.id,(Dt,Xt)=>{var ko=Xe();const et=De(()=>(l(),d(Xt),G(()=>l().get(d(Xt).id))));var pl=he(ko);{var yi=an=>{const Hs=De(()=>(X(Kn),X(d(et)),G(()=>Kn(d(et)))));{let Ds=De(()=>(X(d(et)),G(()=>Me==null?void 0:Me(d(et))))),Vs=De(()=>(X(d(et)),G(()=>Ee(d(et))))),ml=De(()=>(X(d(et)),G(()=>Fe(d(et)))));Kd(an,vt({get x(){return X(d(et)),G(()=>d(et).internals.positionAbsolute.x)},get y(){return X(d(et)),G(()=>d(et).internals.positionAbsolute.y)}},()=>d(Hs),{get selected(){return X(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=>{X(d(et)),X(ds),G(()=>d(et)&&ds(d(et)))&&an(yi)})}D(Dt,ko)});var mi=R(Fr);F(Le),Lt(Le,(Dt,Xt)=>tl==null?void 0:tl(Dt,Xt),()=>({panZoom:u(),viewport:xe,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(We,Le)};pe(nt,We=>{u()&&We($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 q()},set height(K){q(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:x,edgeLookup:b,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(x)):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(b).get(E),getEdges:E=>E===void 0?Q(f):Gd(Q(b),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(x);return xp(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(b,"$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),x=w(t,"isVisible",12,void 0);const{domNode:b,viewport:C,nodeLookup:m,nodes:_}=tt(),{getNodesBounds:p}=jt(),E=br("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(),X(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,Xp($,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(()=>(X(x()),d(S),d(c)),()=>{te(u,typeof x()=="boolean"?x():d(S).length===1&&d(S)[0].selected&&d(c)===1)}),Pt(),Be();var O=Xe(),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 x()},set isVisible($){x($),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=be([]),t=be([]),n=be({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 ${X(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=b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),a(d(u),g))};var h=Y(f);{var v=b=>{var C=Re();Ve(()=>ft(C,(d(u),G(()=>d(u).label)))),D(b,C)},x=b=>{var C=Xe(),m=he(C);Pr(m,()=>(d(u),G(()=>d(u).label)??_t)),D(b,C)};pe(h,b=>{d(u),G(()=>typeof d(u).label=="string")?b(v):b(x,!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 x=R(v,2);F(g);var b=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(b,p=>{d(l).description&&p(C)})}var m=R(b,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(x,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=Xe(),o=he(r);{var i=a=>{var l=Xe(),c=he(l);Pr(c,()=>n()??_t),D(a,l)},s=a=>{var l=Xe(),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 Xm=(e,t,n)=>t(d(n)),Wm=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 14L8 10H16L12 14Z"></path></svg>'),qm=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 _=Xe(),p=he(_);At(p,19,m,(E,N)=>`${N}_${E.value}`,(E,N)=>{var S=Zm(),A=he(S);A.__click=[Xm,v,N];var L=Y(A),V=Y(L);{var O=$=>{var P=Wm();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=qm(),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 x=Jm();nn(x,()=>({...g,class:`tf-select ${g.class??""}`}));var b=Y(x);return _n(_o(b,{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=Xe(),V=he(L);{var O=B=>{var k=Xe(),$=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(x),D(e,x),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 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 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 x=0;x<a.length;x++){const{name:b,fn:C}=a[x],{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,[b]:{...h[b],...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)),x=-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),b=a[f?g==="floating"?"reference":"floating":g],C=xs(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.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=xs(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),x=await s.getDimensions(c),b=h==="y",C=b?"top":"left",m=b?"bottom":"right",_=b?"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-x[v]/2-1,V=ai(g[C],L),O=ai(g[m],L),z=V,B=S-x[v]-O,k=S/2-x[v]/2+A,$=ol(z,k,B),P=!l.arrow&&ui(o)!=null&&k!==$&&i.reference[v]/2-(k<z?V:O)-x[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:x=!0,...b}=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||(_||!x?[_s(a)]:ry(a)),N=v!=="none";!f&&N&&E.push(...ay(a,x,v,p));const S=[a,...E],A=await uf(t,b),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:b=>{let{x:C,y:m}=b;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 b=f==="y"?"top":"left",C=f==="y"?"bottom":"right",m=h+u[b],_=h-u[C];h=ol(m,h,_)}if(s){const b=g==="y"?"top":"left",C=g==="y"?"bottom":"right",m=v+u[b],_=v-u[C];v=ol(m,v,_)}const x=a.fn({...t,[f]:h,[g]:v});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[f]:i,[g]:s}}}}}};function bs(){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 bs()?e instanceof Node||e instanceof on(e).Node:!1}function $n(e){return bs()?e instanceof Element||e instanceof on(e).Element:!1}function zn(e){return bs()?e instanceof HTMLElement||e instanceof on(e).HTMLElement:!1}function df(e){return!bs()||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"],xy=["transform","translate","scale","rotate","perspective","filter"],by=["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)||xy.some(r=>(n.willChange||"").includes(r))||by.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,x=cl(v);for(;x&&r&&h!==v;){const b=wo(x),C=x.getBoundingClientRect(),m=kn(x),_=C.left+(x.clientLeft+parseFloat(m.paddingLeft))*b.x,p=C.top+(x.clientTop+parseFloat(m.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,g*=b.y,l+=_,c+=p,v=on(x),x=cl(v)}}return xs({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 xs(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 xf(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||xf,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:xf,getElementRects:Ly,getClientRects:Py,getDimensions:Ay,getScale:wo,isElement:$n,isRTL:Iy},Ry=hy,By=vy,Fy=dy,Yy=cy,Xy=(e,t,n)=>{const r=new Map,o={platform:zy,...n},i={...o.platform,_c:r};return uy(e,t,{...o,platform:i})},Wy=({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(){Xy(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 x(C){C.stopPropagation(),f?v():h()}function b(C){c.contains(C.target)||v()}return(!t||t.length==0)&&(t=["click"]),t.forEach(C=>{e.addEventListener(C,x)}),document.addEventListener("click",b),{destroy(){t.forEach(C=>{e.removeEventListener(C,x)}),document.removeEventListener("click",b)},hide(){v()},isVisible(){return f}}};var qy=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=Wy({trigger:i,floatContent:s,interactive:!0,placement:o()}),()=>{a.destroy()}));function l(){a.hide()}var c=qy(),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=Xe(),a=he(s);return bg(a,()=>`h${r()}`,!1,(l,c)=>{nn(l,()=>({class:"tf-heading",style:`margin-top:${o()||"0"};margin-bottom:${i()||"0"}`}));var u=Xe(),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
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;}
|
|
6
6
|
|
|
7
7
|
@keyframes svelte-us4e73-slideIn {
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
|
|
18
18
|
/* 响应式设计 */
|
|
19
19
|
@media (max-width: 640px) {.toast.svelte-us4e73 {left:20px;right:20px;min-width:auto;max-width:none;}
|
|
20
|
-
}`};function
|
|
20
|
+
}`};function bf(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=Xe(),f=he(g);{var h=v=>{var x=jy(),b=Y(x),C=Y(b),m=Y(C,!0);F(C);var _=R(C,2),p=Y(_,!0);F(_);var E=R(_,2);E.__click=c,F(b),F(x),_n(x,N=>te(a,N),()=>d(a)),Ve(N=>{Nt(x,1,`toast toast-${r()??""}`,"svelte-us4e73"),ft(m,N),ft(p,n())},[u]),D(v,x)};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(bf,{message:{},type:{},duration:{},visible:{},onClose:{}},[],[],!0);const gl=be([]);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
21
|
|
|
22
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,
|
|
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
|
|
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=(
|
|
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)=>{bf(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=()=>br("tinyflow_options");function $t(){return br("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 x=n().expand?["key"]:[];const{updateNodeData:b,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,q)=>{var j=dw(),J=Y(j);{var ne=ye=>{Je(ye,{class:"tf-node-toolbar-item",onclick:()=>{_(r())},children:(xe,de)=>{var U=rw();D(xe,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:(xe,de)=>{var U=ow();D(xe,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:(xe,de)=>{var U=iw();D(xe,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),W=R(Y(se));pt(W,{style:"width: 100%;",onchange:Ue=>{const at=Ue.target.value;b(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;b(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;b(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,b,S];var ze=R(me,4);Tr(ze),ze.__change=[lw,b,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,W)=>{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 x},onChange:(H,I)=>{var q;b(r(),{expand:I==null?void 0:I.includes("key")}),(q=v())==null||q(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 x;const b=()=>{u(a,L=>{let V=L.data.parameters;return V.splice(s(),1),{parameters:[...V]}}),x==null||x.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 q=I.target.value;g("defaultValue",q)}}),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 q=I.target.value;g("description",q)}}),F(P);var M=R(P,2),H=Y(M);Je(H,{onclick:b,children:(I,q)=>{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=>x=V,()=>x),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>'),xw=ie('<div class="input-container svelte-3n0wca"><!> <!></div>');const bw={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,bw);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=xw(),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,x)=>{Te();var b=Re("输入参数");D(v,b)},$$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,x)=>{var b=$w();D(v,b)},$$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,x=Tf(h,v,u);x&&g.push(x)}}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}})},x=($,P)=>{const T=P.target.value;v($,T)},b=$=>{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=>x("name",P)})}F(N);var A=R(N,2),L=Y(A);{var V=$=>{pt($,{get value(){return d(f).value},placeholder:"请输入参数值",oninput:P=>x("value",P)})},O=$=>{var P=Xe(),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:b})}};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),q=R(Y(I));Mt(q,{rows:1,style:"width: 100%;",onchange:ce=>{x("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=>{x("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 b;return[...((b=o())==null?void 0:b.data[s()])||[]]});var g=Dw(),f=Y(g);{var h=b=>{var C=Mw();Te(4),D(b,C)};pe(f,b=>{d(u).length!==0&&b(h)})}var v=R(f,2);At(v,19,()=>d(u),b=>b.id,(b,C,m)=>{Mf(b,{get parameter(){return d(C)},get index(){return d(m)},get dataKeyName(){return s()},get useChildrenOnly(){return a()}})},b=>{var C=Hw(),m=Y(C,!0);F(C),Ve(()=>ft(m,i())),D(b,C)}),F(g),D(e,g);var x=ge({get noneParameterText(){return i()},set noneParameterText(b="无输入参数"){i(b),y()},get dataKeyName(){return s()},set dataKeyName(b="parameters"){s(b),y()},get useChildrenOnly(){return a()},set useChildrenOnly(b){a(b),y()}});return r(),x}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,x)=>{Te();var b=Re("输出参数");D(v,b)},$$slots:{default:!0}});var f=R(g,2);Je(f,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(v,x)=>{var b=Ow();D(v,b)},$$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 x;const b=()=>{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($)]}}),x==null||x.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 $=Xe(),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 q=R(H,2);{var j=J=>{var ne=Rw(),ee=Y(ne);Je(ee,{onclick:b,children:(ce,re)=>{Te();var we=Re("删除");D(ce,we)},$$slots:{default:!0}}),F(ne),D(J,ne)};pe(q,J=>{d(u).deleteDisabled!==!0&&J(j)})}F(P),D($,P)},children:($,P)=>{ks($,{})},$$slots:{floating:!0,default:!0}}),$=>x=$,()=>x),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 Xw=ie("<!> <!>",1),Ww=ie('<div class="none-params svelte-1sm1mgi"> </div>'),qw=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=(b,C=_t,m=_t)=>{var _=Xe(),p=he(_);At(p,19,C,E=>`${E.id}_${E.children?E.children.length:0}`,(E,N,S)=>{var A=Xw(),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=Xe(),S=he(N);{var A=L=>{var V=Ww(),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(b,_)},s=w(t,"noneParameterText",7,"无输出参数"),a=w(t,"dataKeyName",7,"outputDefs");let l=$t(),c=ke(()=>Lr(l)),u=ke(()=>{var b;return[...((b=o())==null?void 0:b.data[a()])||[]]});var g=Zw(),f=Y(g);{var h=b=>{var C=qw();Te(4),D(b,C)};pe(f,b=>{d(u).length!==0&&b(h)})}var v=R(f,2);i(v,()=>d(u)||[],()=>[]),F(g),D(e,g);var x=ge({get noneParameterText(){return s()},set noneParameterText(b="无输出参数"){s(b),y()},get dataKeyName(){return a()},set dataKeyName(b="outputDefs"){a(b),y()}});return r(),x}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
27
|
|
|
28
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
29
|
|
|
@@ -32,7 +32,7 @@
|
|
|
32
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
33
|
.input-with-unit.svelte-9hg0j2 input::-webkit-inner-spin-button {-webkit-appearance:none;margin:0;}
|
|
34
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;}
|
|
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(),x=he(v),b=Y(x),C=Y(b),m=Y(C);F(C);var _=R(C,2),p=Y(_);pt(p,{get value(){return n().temperature},type:"number",placeholder:"请输入Temperature",onchange:W=>{const ae=W.target.value;ae>=0&&ae<2?l(o,{temperature:ae}):Ss.warning("Temperature的范围是[0,2)")}}),F(_),F(b),F(x);var E=R(x,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:W=>{const ae=W.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:W=>{const ae=W.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 q=R(H,2),j=Y(q);pt(j,{get value(){return n().presencePenalty},type:"number",placeholder:"请输入Presence Penalty",onchange:W=>{const ae=W.target.value;ae>=-2&&ae<=2?l(o,{presencePenalty:ae}):Ss.warning("Presence Penalty的范围是[-2.0, 2.0]")}}),F(q),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:W=>{const ae=W.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),xe=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(xe,`Enable Thinking: ${n().enableThinking??""}`)}),Mg(se,()=>n().enableThinking,W=>n().enableThinking=W),D(h,v)};En(e,vt({get data(){return n()}},()=>r,{icon:g,advancedContent:f,children:(h,v)=>{var x=e_(),b=he(x),C=Y(b);st(C,{level:3,children:(H,I)=>{Te();var q=Re("输入参数");D(H,q)},$$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 q=Jw();D(H,q)},$$slots:{default:!0}}),F(b);var _=R(b,2);Ut(_,{});var p=R(_,2);st(p,{level:3,mt:"10px",children:(H,I)=>{Te();var q=Re("模型设置");D(H,q)},$$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 q=I.value;l(o,()=>({llmId:q}))},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,q)=>{const j=q==null?void 0:q.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 q=Re("输出参数");D(H,q)},$$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,q)=>{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,x)},$$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 x=R(f,2);Ut(x,{});var b=R(x,2);st(b,{level:3,mt:"10px",children:(L,V)=>{Te();var O=Re("代码");D(L,O)},$$slots:{default:!0}});var C=R(b,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 x=R(v,2);st(x,{level:3,mt:"10px",mb:"10px",children:(E,N)=>{Te();var S=Re("模板内容");D(E,S)},$$slots:{default:!0}});var b=R(x,2),C=Y(b);{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(b);var m=R(b,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-4xu4ng" 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-4xu4ng" 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>'),x_=ie('<div class="heading svelte-4xu4ng"><!> <!></div> <!> <!> <div style="display: flex;gap: 2px;width: 100%;padding: 10px 0"><div><!></div> <div style="width: 100%"><!></div></div> <div class="heading svelte-4xu4ng"><!> <!></div> <!> <!> <div class="radio-group svelte-4xu4ng"><label class="radio-item svelte-4xu4ng"><!>none</label> <label class="svelte-4xu4ng"><!>form-data</label> <label class="svelte-4xu4ng"><!>x-www-form-urlencoded</label> <label class="svelte-4xu4ng"><!>json</label> <label class="svelte-4xu4ng"><!>raw</label></div> <!> <!> <!> <!> <div class="heading svelte-4xu4ng"><!> <!></div> <!>',1);const b_={hash:"svelte-4xu4ng",code:".heading.svelte-4xu4ng {display:flex;margin-bottom:10px;}.radio-group.svelte-4xu4ng {display:flex;margin:10px 0;}.radio-group.svelte-4xu4ng label:where(.svelte-4xu4ng) {display:flex;font-size:14px;margin-right:12px;}.radio-group.svelte-4xu4ng label:where(.svelte-4xu4ng) .radio-input {margin-right:4px;}"};function Lf(e,t){fe(t,!0),ot(e,b_);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=x_(),f=he(g),h=Y(f);st(h,{level:3,children:(U,se)=>{Te();var W=Re("输入参数");D(U,W)},$$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 W=f_();D(U,W)},$$slots:{default:!0}}),F(f);var x=R(f,2);Ut(x,{});var b=R(x,2);st(b,{level:3,mt:"10px",children:(U,se)=>{Te();var W=Re("URL 地址");D(U,W)},$$slots:{default:!0}});var C=R(b,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 W=se.value;a(i,()=>({method:W}))},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 W=Re("Http 头信息");D(U,W)},$$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 W=g_();D(U,W)},$$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 W=Re("Body");D(U,W)},$$slots:{default:!0}});var O=R(V,2),z=Y(O),B=Y(z);{let U=ke(()=>!n().bodyType);pt(B,{class:"radio-input",type:"radio",name:"bodyType",value:"",get checked(){return d(U)},onchange:se=>{var W;(W=se.target)!=null&&W.checked&&a(i,{bodyType:""})}})}Te(),F(z);var k=R(z,2),$=Y(k);{let U=ke(()=>n().bodyType==="form-data");pt($,{class:"radio-input",type:"radio",name:"bodyType",value:"form-data",get checked(){return d(U)},onchange:se=>{var W;(W=se.target)!=null&&W.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,{class:"radio-input",type:"radio",name:"bodyType",value:"x-www-form-urlencoded",get checked(){return d(U)},onchange:se=>{var W;(W=se.target)!=null&&W.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,{class:"radio-input",type:"radio",name:"bodyType",value:"json",get checked(){return d(U)},onchange:se=>{var W;(W=se.target)!=null&&W.checked&&a(i,{bodyType:"json"})}})}Te(),F(M);var I=R(M,2),q=Y(I);{let U=ke(()=>n().bodyType==="raw");pt(q,{class:"radio-input",type:"radio",name:"bodyType",value:"raw",get checked(){return d(U)},onchange:se=>{var W;(W=se.target)!=null&&W.checked&&a(i,{bodyType:"raw"})}})}Te(),F(I),F(O);var j=R(O,2);{var J=U=>{var se=v_(),W=he(se),ae=Y(W);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(W);var Ee=R(W,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_(),W=he(se),ae=Y(W);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(W);var Ee=R(W,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_(),W=Y(se);Mt(W,{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_(),W=Y(se);Mt(W,{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 W=Re("输出参数");D(U,W)},$$slots:{default:!0}});var xe=R(ye,2);Je(xe,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"outputDefs")},children:(U,se)=>{var W=__();D(U,W)},$$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 x=R(v,2);Je(x,{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 b=R(h,2);Ut(b,{});var C=R(b,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 x=R(v,2);Je(x,{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 b=R(h,2);Ut(b,{});var C=R(b,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),x=Y(v);st(x,{level:3,children:(m,_)=>{Te();var p=Re("输出参数");D(m,p)},$$slots:{default:!0}});var b=R(x,2);Je(b,{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 x=R(v,2);At(x,21,()=>s,eo,(C,m)=>{vl(C,vt(()=>d(m)))}),F(x),F(h),F(u);var b=R(u,2);Je(b,{onclick:()=>{te(r,d(r)?"":"show",!0)},children:(C,m)=>{var _=Xe(),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(x,`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>'),X_=ie('<div class="heading svelte-q0cqsa"><!> <!></div> <!>',1),W_=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),q_=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
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"})});
|
|
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 b;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];(b=h.render)==null||b.call(h,g,u,s);const v=h.forms;let x;cn(()=>{n().expand&&x&&x.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=Xe(),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=X_(),$=he(k),P=Y($);st(P,{level:3,children:(I,q)=>{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:(q,j)=>{var J=Y_();D(q,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=Xe(),$=he(k);At($,17,()=>v,eo,(P,T)=>{var M=Xe(),H=he(M);{var I=j=>{var J=W_(),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)},q=j=>{var J=Xe(),ne=he(J);{var ee=re=>{var we=q_(),Ne=he(we),Ae=Y(Ne,!0);F(Ne);var ye=R(Ne,2),xe=Y(ye);{let de=ke(()=>n()[d(T).name]||d(T).defaultValue);Mt(xe,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=Xe(),Ne=he(we);{var Ae=xe=>{var de=Z_(),U=he(de),se=Y(U,!0);F(U);var W=R(U,2),ae=Y(W),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(W),Ve(()=>{ft(se,d(T).label),ft(Ee,`${d(T).description??""}: ${n()[d(T).name]??d(T).defaultValue??""}`)}),D(xe,de)},ye=xe=>{var de=Xe(),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)},W=ae=>{var Me=Xe(),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,We;(We=($e=d(T).chosen)==null?void 0:$e.onChosen)==null||We.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=Xe(),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(W,!1)},!0)}D(xe,de)};pe(Ne,xe=>{d(T).type==="slider"?xe(Ae):xe(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(q,!1)})}D(P,M)}),D(B,k)};pe(A,B=>{v&&B(L)})}var V=R(A,2);_n(V,B=>x=B,()=>x);var O=R(V,2);{var z=B=>{var k=G_(),$=he(k),P=Y($);st(P,{level:3,mt:"10px",children:(I,q)=>{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:(q,j)=>{var J=U_();D(q,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 ex=()=>{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))}}},tx=()=>{const{edges:e}=tt();return{deleteEdge:n=>{e.update(r=>r.filter(o=>o.id!==n))}}};var nx=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>'),rx=ie("<!> <!> <!> <!>",1),ox=ie('<div style="position: relative; height: 100%; width: 100%;overflow: hidden"><!> <!> <!></div>');const ix={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,ix);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}=ex(),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"),q=I?JSON.parse(I):{};if(Object.keys(q).length===0)return;const j={id:`node_${zr()}`,position:H,data:{},...q};ys.addNode(j),ys.selectNodeOnly(j.id)},{getNode:v}=R_(),x=M=>{const H=v(M.source),I=v(M.target);if(M.sourceHandle==="loop_handle"||H.parentId){const q=l.getEdges();for(let j of q)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:b}=B_(),C=(M,H)=>{if(!H.isValid)return;const I=H.toNode;if(I.parentId)return;const q=H.fromNode,j=H.fromHandle,J={position:{...I.position}};if(j.id==="loop_handle"?J.parentId=q.id:q.parentId&&(J.parentId=q.parentId),J.parentId){const ne=v(J.parentId);J.position={x:I.position.x-ne.position.x,y:I.position.y-ne.position.y},b(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 q=v(I.target);if(q&&q.parentId){const J=m(I.target),ne=v(q.parentId);if(J.length===0)l.updateNode(q.id,{parentId:void 0,position:{x:q.position.x+ne.position.x,y:q.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(q.id,{parentId:void 0,position:{x:q.position.x+ne.position.x,y:q.position.y+ne.position.y}})}}})},{deleteEdge:p}=tx(),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=ox(),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:x,onconnectend:C,onconnectstart:E,onconnect:N,connectionRadius:50,onedgecreate:I=>({...I,id:zr()}),ondelete:_,onclick:I=>{const q=I.target;q.classList.contains("svelte-flow__edge-interaction")||q.classList.contains("panel-content")||q.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,q)=>{var j=rx(),J=he(j);Zd(J,{});var ne=R(J,2);Xd(ne,{});var ee=R(ne,2);jd(ee,{});var ce=R(ee,2);{var re=we=>{ii(we,{children:(Ne,Ae)=>{var ye=nx(),xe=R(Y(ye),4),de=Y(xe);{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(xe);var U=R(xe,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 W=R(se,2);Je(W,{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 sx(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)||[]),qr("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(sx,{options:{},onInit:{}},[],[],!1));const ax=qe.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=qe.ref(null);let o=null;return qe.onMounted(()=>{r.value&&(o=new Sm({...n,element:r.value}))}),qe.onUnmounted(()=>{o&&(o.destroy(),o=null)}),t({getData:()=>o?o.getData():(console.warn("Tinyflow instance is not initialized"),null)}),(s,a)=>(qe.openBlock(),qe.createElementBlock("div",{ref_key:"divRef",ref:r,class:qe.normalizeClass(["tinyflow",s.className]),style:qe.normalizeStyle(s.style)},null,6))}});rt.Tinyflow=ax,Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"})});
|
|
38
38
|
//# sourceMappingURL=index.umd.js.map
|