@iterms/tinyflow-ai-vue 0.2.4
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.css +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +19150 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +24 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
(function(nt,lt){typeof exports=="object"&&typeof module<"u"?lt(exports):typeof define=="function"&&define.amd?define(["exports"],lt):(nt=typeof globalThis<"u"?globalThis:nt||self,lt(nt.Tinyflow={}))})(this,function(nt){"use strict";var C5=Object.defineProperty;var oh=nt=>{throw TypeError(nt)};var $5=(nt,lt,mt)=>lt in nt?C5(nt,lt,{enumerable:!0,configurable:!0,writable:!0,value:mt}):nt[lt]=mt;var kt=(nt,lt,mt)=>$5(nt,typeof lt!="symbol"?lt+"":lt,mt),ou=(nt,lt,mt)=>lt.has(nt)||oh("Cannot "+mt);var Se=(nt,lt,mt)=>(ou(nt,lt,"read from private field"),mt?mt.call(nt):lt.get(nt)),wt=(nt,lt,mt)=>lt.has(nt)?oh("Cannot add the same private member more than once"):lt instanceof WeakSet?lt.add(nt):lt.set(nt,mt),It=(nt,lt,mt,Di)=>(ou(nt,lt,"write to private field"),Di?Di.call(nt,mt):lt.set(nt,mt),mt),Lo=(nt,lt,mt)=>(ou(nt,lt,"access private method"),mt);/**
|
|
2
|
+
* @vue/shared v3.5.18
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**//*! #__NO_SIDE_EFFECTS__ */var U1,ki,Ho,Ao,$r,Pi,Ni,jr,Do,Er,rr,Ur,or,ih,sh,iu,Sr,Vo,Ti,ta,ah,ir,yn;function lt(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const mt={},Di=[],lh=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Vi=Object.assign,uh=Object.prototype.hasOwnProperty,sa=(e,t)=>uh.call(e,t),un=Array.isArray,Ii=e=>su(e)==="[object Map]",Wn=e=>typeof e=="function",sr=e=>typeof e=="string",zo=e=>typeof e=="symbol",Kn=e=>e!==null&&typeof e=="object",ch=e=>(Kn(e)||Wn(e))&&Wn(e.then)&&Wn(e.catch),dh=Object.prototype.toString,su=e=>dh.call(e),fh=e=>su(e).slice(8,-1),aa=e=>sr(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,la=(e,t)=>!Object.is(e,t);let au;const ua=()=>au||(au=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Li(e){if(un(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=sr(r)?ph(r):Li(r);if(o)for(const i in o)t[i]=o[i]}return t}else if(sr(e)||Kn(e))return e}const hh=/;(?![^(]*\))/g,gh=/:([^]+)/,vh=/\/\*[^]*?\*\//g;function ph(e){const t={};return e.replace(vh,"").split(hh).forEach(n=>{if(n){const r=n.split(gh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function zi(e){let t="";if(sr(e))t=e;else if(un(e))for(let n=0;n<e.length;n++){const r=zi(e[n]);r&&(t+=r+" ")}else if(Kn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}/**
|
|
6
|
+
* @vue/reactivity v3.5.18
|
|
7
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
+
* @license MIT
|
|
9
|
+
**/let lu=0,ca;function da(){lu++}function fa(){if(--lu>0)return;let e;for(;ca;){let t=ca;for(ca=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}class mh{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){}trigger(t){this.version++,this.notify(t)}notify(t){da();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{fa()}}}const yh=new WeakMap,ha=Symbol(""),uu=Symbol(""),cu=Symbol("");function E5(e,t,n){}function ar(e,t,n,r,o,i){const s=yh.get(e);if(!s)return;const a=l=>{l&&l.trigger()};if(da(),t==="clear")s.forEach(a);else{const l=un(e),c=l&&aa(n);if(l&&n==="length"){const u=Number(r);s.forEach((h,f)=>{(f==="length"||f===cu||!zo(f)&&f>=u)&&a(h)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),c&&a(s.get(cu)),t){case"add":l?c&&a(s.get("length")):(a(s.get(ha)),Ii(e)&&a(s.get(uu)));break;case"delete":l||(a(s.get(ha)),Ii(e)&&a(s.get(uu)));break;case"set":Ii(e)&&a(s.get(ha));break}}fa()}function Jr(e){const t=ut(e);return t===e||lr(e)?t:t.map(Lt)}function ga(e){return e=ut(e),e}const wh={__proto__:null,[Symbol.iterator](){return va(this,Symbol.iterator,Lt)},concat(...e){return Jr(this).concat(...e.map(t=>un(t)?Jr(t):t))},entries(){return va(this,"entries",e=>(e[1]=Lt(e[1]),e))},every(e,t){return Xn(this,"every",e,t,void 0,arguments)},filter(e,t){return Xn(this,"filter",e,t,n=>n.map(Lt),arguments)},find(e,t){return Xn(this,"find",e,t,Lt,arguments)},findIndex(e,t){return Xn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Xn(this,"findLast",e,t,Lt,arguments)},findLastIndex(e,t){return Xn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Xn(this,"forEach",e,t,void 0,arguments)},includes(...e){return pa(this,"includes",e)},indexOf(...e){return pa(this,"indexOf",e)},join(e){return Jr(this).join(e)},lastIndexOf(...e){return pa(this,"lastIndexOf",e)},map(e,t){return Xn(this,"map",e,t,void 0,arguments)},pop(){return Ro(this,"pop")},push(...e){return Ro(this,"push",e)},reduce(e,...t){return du(this,"reduce",e,t)},reduceRight(e,...t){return du(this,"reduceRight",e,t)},shift(){return Ro(this,"shift")},some(e,t){return Xn(this,"some",e,t,void 0,arguments)},splice(...e){return Ro(this,"splice",e)},toReversed(){return Jr(this).toReversed()},toSorted(e){return Jr(this).toSorted(e)},toSpliced(...e){return Jr(this).toSpliced(...e)},unshift(...e){return Ro(this,"unshift",e)},values(){return va(this,"values",Lt)}};function va(e,t,n){const r=ga(e),o=r[t]();return r!==e&&!lr(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.value&&(i.value=n(i.value)),i}),o}const _h=Array.prototype;function Xn(e,t,n,r,o,i){const s=ga(e),a=s!==e&&!lr(e),l=s[t];if(l!==_h[t]){const h=l.apply(e,i);return a?Lt(h):h}let c=n;s!==e&&(a?c=function(h,f){return n.call(this,Lt(h),f,e)}:n.length>2&&(c=function(h,f){return n.call(this,h,f,e)}));const u=l.call(s,c,r);return a&&o?o(u):u}function du(e,t,n,r){const o=ga(e);let i=n;return o!==e&&(lr(e)?n.length>3&&(i=function(s,a,l){return n.call(this,s,a,l,e)}):i=function(s,a,l){return n.call(this,s,Lt(a),l,e)}),o[t](i,...r)}function pa(e,t,n){const r=ut(e),o=r[t](...n);return(o===-1||o===!1)&&ya(n[0])?(n[0]=ut(n[0]),r[t](...n)):o}function Ro(e,t,n=[]){da();const r=ut(e)[t].apply(e,n);return fa(),r}const bh=lt("__proto__,__v_isRef,__isVue"),fu=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(zo));function xh(e){return zo(e)||(e=String(e)),ut(this).hasOwnProperty(e)}class hu{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return r===(o?i?Oh:pu:i?Mh:vu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const s=un(t);if(!o){let l;if(s&&(l=wh[n]))return l;if(n==="hasOwnProperty")return xh}const a=Reflect.get(t,n,kr(t)?t:r);return(zo(n)?fu.has(n):bh(n))||i?a:kr(a)?s&&aa(n)?a:a.value:Kn(a)?o?yu(a):mu(a):a}}class Ch extends hu{constructor(t=!1){super(!1,t)}set(t,n,r,o){let i=t[n];if(!this._isShallow){const l=Qr(i);if(!lr(r)&&!Qr(r)&&(i=ut(i),r=ut(r)),!un(t)&&kr(i)&&!kr(r))return l?!1:(i.value=r,!0)}const s=un(t)&&aa(n)?Number(n)<t.length:sa(t,n),a=Reflect.set(t,n,r,kr(t)?t:o);return t===ut(o)&&(s?la(r,i)&&ar(t,"set",n,r):ar(t,"add",n,r)),a}deleteProperty(t,n){const r=sa(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&r&&ar(t,"delete",n,void 0),o}has(t,n){const r=Reflect.has(t,n);return!zo(n)||fu.has(n),r}ownKeys(t){return Reflect.ownKeys(t)}}class $h extends hu{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Eh=new Ch,Sh=new $h,ma=e=>e,Ri=e=>Reflect.getPrototypeOf(e);function kh(e,t,n){return function(...r){const o=this.__v_raw,i=ut(o),s=Ii(i),a=e==="entries"||e===Symbol.iterator&&s,l=o[e](...r),c=n?ma:t?wa:Lt;return{next(){const{value:u,done:h}=l.next();return h?{value:u,done:h}:{value:a?[c(u[0]),c(u[1])]:c(u),done:h}},[Symbol.iterator](){return this}}}}function Bi(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ph(e,t){const n={get(o){const i=this.__v_raw,s=ut(i),a=ut(o),{has:l}=Ri(s),c=t?ma:e?wa:Lt;if(l.call(s,o))return c(i.get(o));if(l.call(s,a))return c(i.get(a));i!==s&&i.get(o)},get size(){const o=this.__v_raw;return!e&&(ut(o),void 0),Reflect.get(o,"size",o)},has(o){const i=this.__v_raw;ut(i);const s=ut(o);return o===s?i.has(o):i.has(o)||i.has(s)},forEach(o,i){const s=this,a=s.__v_raw;ut(a);const l=t?ma:e?wa:Lt;return a.forEach((c,u)=>o.call(i,l(c),l(u),s))}};return Vi(n,e?{add:Bi("add"),set:Bi("set"),delete:Bi("delete"),clear:Bi("clear")}:{add(o){!t&&!lr(o)&&!Qr(o)&&(o=ut(o));const i=ut(this);return Ri(i).has.call(i,o)||(i.add(o),ar(i,"add",o,o)),this},set(o,i){!t&&!lr(i)&&!Qr(i)&&(i=ut(i));const s=ut(this),{has:a,get:l}=Ri(s);let c=a.call(s,o);c||(o=ut(o),c=a.call(s,o));const u=l.call(s,o);return s.set(o,i),c?la(i,u)&&ar(s,"set",o,i):ar(s,"add",o,i),this},delete(o){const i=ut(this),{has:s,get:a}=Ri(i);let l=s.call(i,o);l||(o=ut(o),l=s.call(i,o)),a&&a.call(i,o);const c=i.delete(o);return l&&ar(i,"delete",o,void 0),c},clear(){const o=ut(this),i=o.size!==0,s=o.clear();return i&&ar(o,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=kh(o,e,t)}),n}function gu(e,t){const n=Ph(e,t);return(r,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(sa(n,o)&&o in r?n:r,o,i)}const Nh={get:gu(!1,!1)},Th={get:gu(!0,!1)},vu=new WeakMap,Mh=new WeakMap,pu=new WeakMap,Oh=new WeakMap;function Hh(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ah(e){return e.__v_skip||!Object.isExtensible(e)?0:Hh(fh(e))}function mu(e){return Qr(e)?e:wu(e,!1,Eh,Nh,vu)}function yu(e){return wu(e,!0,Sh,Th,pu)}function wu(e,t,n,r,o){if(!Kn(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=Ah(e);if(i===0)return e;const s=o.get(e);if(s)return s;const a=new Proxy(e,i===2?r:n);return o.set(e,a),a}function Qr(e){return!!(e&&e.__v_isReadonly)}function lr(e){return!!(e&&e.__v_isShallow)}function ya(e){return e?!!e.__v_raw:!1}function ut(e){const t=e&&e.__v_raw;return t?ut(t):e}const Lt=e=>Kn(e)?mu(e):e,wa=e=>Kn(e)?yu(e):e;function kr(e){return e?e.__v_isRef===!0:!1}function Dh(e){return Vh(e,!1)}function Vh(e,t){return kr(e)?e:new Ih(e,t)}class Ih{constructor(t,n){this.dep=new mh,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ut(t),this._value=n?t:Lt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||lr(t)||Qr(t);t=r?t:ut(t),la(t,n)&&(this._rawValue=t,this._value=r?t:Lt(t),this.dep.trigger())}}/**
|
|
10
|
+
* @vue/runtime-core v3.5.18
|
|
11
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
+
* @license MIT
|
|
13
|
+
**/function _u(e,t,n,r){try{return r?e(...r):e()}catch(o){xu(o,t,n)}}function bu(e,t,n,r){if(Wn(e)){const o=_u(e,t,n,r);return o&&ch(o)&&o.catch(i=>{xu(i,t,n)}),o}if(un(e)){const o=[];for(let i=0;i<e.length;i++)o.push(bu(e[i],t,n,r));return o}}function xu(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||mt;if(t){let a=t.parent;const l=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let h=0;h<u.length;h++)if(u[h](e,l,c)===!1)return}a=a.parent}if(i){_u(i,null,10,[e,l,c]);return}}Lh(e,n,o,r,s)}function Lh(e,t,n,r=!0,o=!1){if(o)throw e;console.error(e)}let qi=null,zh=null;const Rh=e=>e.__isTeleport;function Cu(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Cu(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}/*! #__NO_SIDE_EFFECTS__ */function Bh(e,t){return Wn(e)?Vi({name:e.name},t,{setup:e}):e}ua().requestIdleCallback,ua().cancelIdleCallback;function qh(e,t,n=Wi,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...s)=>{const a=sg(n),l=bu(t,n,e,s);return a(),l});return r?o.unshift(i):o.push(i),i}}const $u=e=>(t,n=Wi)=>{(!Nu||e==="sp")&&qh(e,(...r)=>t(...r),n)},Fh=$u("m"),Yh=$u("um"),Wh=Symbol.for("v-ndc"),Kh={},Eu=e=>Object.getPrototypeOf(e)===Kh,Xh=e=>e.__isSuspense,Su=Symbol.for("v-fgt"),Zh=Symbol.for("v-txt"),jh=Symbol.for("v-cmt"),Fi=[];let wn=null;function Uh(e=!1){Fi.push(wn=e?null:[])}function Gh(){Fi.pop(),wn=Fi[Fi.length-1]||null}function Jh(e){return e.dynamicChildren=wn||Di,Gh(),wn&&wn.push(e),e}function Qh(e,t,n,r,o,i){return Jh(Pu(e,t,n,r,o,i,!0))}function eg(e){return e?e.__v_isVNode===!0:!1}const ku=({key:e})=>e??null,Yi=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?sr(e)||kr(e)||Wn(e)?{i:qi,r:e,k:t,f:!!n}:e:null);function Pu(e,t=null,n=null,r=0,o=null,i=e===Su?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ku(t),ref:t&&Yi(t),scopeId:zh,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:qi};return a?(ba(l,n),i&128&&e.normalize(l)):n&&(l.shapeFlag|=sr(n)?8:16),!s&&wn&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&wn.push(l),l}const tg=ng;function ng(e,t=null,n=null,r=0,o=null,i=!1){if((!e||e===Wh)&&(e=jh),eg(e)){const a=_a(e,t,!0);return n&&ba(a,n),!i&&wn&&(a.shapeFlag&6?wn[wn.indexOf(e)]=a:wn.push(a)),a.patchFlag=-2,a}if(ag(e)&&(e=e.__vccOpts),t){t=rg(t);let{class:a,style:l}=t;a&&!sr(a)&&(t.class=zi(a)),Kn(l)&&(ya(l)&&!un(l)&&(l=Vi({},l)),t.style=Li(l))}const s=sr(e)?1:Xh(e)?128:Rh(e)?64:Kn(e)?4:Wn(e)?2:0;return Pu(e,t,n,r,o,s,i,!0)}function rg(e){return e?ya(e)||Eu(e)?Vi({},e):e:null}function _a(e,t,n=!1,r=!1){const{props:o,ref:i,patchFlag:s,children:a,transition:l}=e,c=t?ig(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&ku(c),ref:t&&t.ref?n&&i?un(i)?i.concat(Yi(t)):[i,Yi(t)]:Yi(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Su?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&_a(e.ssContent),ssFallback:e.ssFallback&&_a(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Cu(u,l.clone(u)),u}function og(e=" ",t=0){return tg(Zh,null,e,t)}function ba(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(un(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),ba(e,o()),o._c&&(o._d=!0));return}else n=32,!t._&&!Eu(t)&&(t._ctx=qi);else Wn(t)?(t={default:t,_ctx:qi},n=32):(t=String(t),r&64?(n=16,t=[og(t)]):n=8);e.children=t,e.shapeFlag|=n}function ig(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=zi([t.class,r.class]));else if(o==="style")t.style=Li([t.style,r.style]);else if(lh(o)){const i=t[o],s=r[o];s&&i!==s&&!(un(i)&&i.includes(s))&&(t[o]=i?[].concat(i,s):s)}else o!==""&&(t[o]=r[o])}return t}let Wi=null,xa;{const e=ua(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),i=>{o.length>1?o.forEach(s=>s(i)):o[0](i)}};xa=t("__VUE_INSTANCE_SETTERS__",n=>Wi=n),t("__VUE_SSR_SETTERS__",n=>Nu=n)}const sg=e=>{const t=Wi;return xa(e),e.scope.on(),()=>{e.scope.off(),xa(t)}};let Nu=!1;function ag(e){return Wn(e)&&"__vccOpts"in e}const lg="5";typeof window<"u"&&((U1=window.__svelte??(window.__svelte={})).v??(U1.v=new Set)).add(lg);let eo=!1,ug=!1;function cg(){eo=!0}cg();const Ki=1,Xi=2,Tu=4,dg=8,fg=16,hg=1,gg=2,Mu=4,vg=8,pg=16,Ou=1,mg=2,Hu="[",Ca="[!",$a="]",Pr={},Pt=Symbol(),yg="http://www.w3.org/1999/xhtml",wg="http://www.w3.org/2000/svg",_g="@attach",Au=!1;var to=Array.isArray,bg=Array.prototype.indexOf,Ea=Array.from,Zi=Object.keys,Nr=Object.defineProperty,Zn=Object.getOwnPropertyDescriptor,Du=Object.getOwnPropertyDescriptors,xg=Object.prototype,Cg=Array.prototype,Sa=Object.getPrototypeOf,Vu=Object.isExtensible;function Bo(e){return typeof e=="function"}const _t=()=>{};function $g(e){return e()}function qo(e){for(var t=0;t<e.length;t++)e[t]()}function Eg(){var e,t,n=new Promise((r,o)=>{e=r,t=o});return{promise:n,resolve:e,reject:t}}function ur(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 Qt=2,ka=4,ji=8,Fo=16,jn=32,Tr=64,Iu=128,cn=256,Ui=512,bt=1024,Xt=2048,cr=4096,_n=8192,Mr=16384,Pa=32768,no=65536,Lu=1<<17,Sg=1<<18,Na=1<<19,Ta=1<<20,Ma=1<<21,Oa=1<<22,Or=1<<23,Tn=Symbol("$state"),Ha=Symbol("legacy props"),kg=Symbol(""),Aa=new class extends Error{constructor(){super(...arguments);kt(this,"name","StaleReactionError");kt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},Pg=1,Da=3,ro=8;function Ng(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Gi(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Tg(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Mg(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Og(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Hg(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Ag(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Dg(){throw new Error("https://svelte.dev/e/hydration_failed")}function Vg(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ig(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Lg(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function zg(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Yo(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Rg(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}let Oe=!1;function en(e){Oe=e}let Fe;function zt(e){if(e===null)throw Yo(),Pr;return Fe=e}function Mn(){return zt(Hn(Fe))}function F(e){if(Oe){if(Hn(Fe)!==null)throw Yo(),Pr;Fe=e}}function Te(e=1){if(Oe){for(var t=e,n=Fe;t--;)n=Hn(n);Fe=n}}function Va(){for(var e=0,t=Fe;;){if(t.nodeType===ro){var n=t.data;if(n===$a){if(e===0)return t;e-=1}else(n===Hu||n===Ca)&&(e+=1)}var r=Hn(t);t.remove(),t=r}}function zu(e){if(!e||e.nodeType!==ro)throw Yo(),Pr;return e.data}function Ru(e){return e===this.v}function Ia(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Bu(e){return!Ia(e,this.v)}let it=null;function Ji(e){it=e}function Hr(e){return La().get(e)}function oo(e,t){return La().set(e,t),t}function Bg(e){return La().has(e)}function fe(e,t=!1,n){it={p:it,c:null,e:null,s:e,x:null,l:eo&&!t?{s:null,u:null,$:[]}:null}}function he(e){var t=it,n=t.e;if(n!==null){t.e=null;for(var r of n)ic(r)}return e!==void 0&&(t.x=e),it=t.p,e??{}}function Wo(){return!eo||it!==null&&it.l===null}function La(e){return it===null&&Gi(),it.c??(it.c=new Map(qg(it)||void 0))}function qg(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}const Fg=new WeakMap;function Yg(e){var t=ze;if(t===null)return We.f|=Or,e;if((t.f&Pa)===0){if((t.f&Iu)===0)throw!t.parent&&e instanceof Error&&qu(e),e;t.b.error(e)}else za(e,t)}function za(e,t){for(;t!==null;){if((t.f&Iu)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw e instanceof Error&&qu(e),e}function qu(e){const t=Fg.get(e);t&&(Nr(e,"message",{value:t.message}),Nr(e,"stack",{value:t.stack}))}const Wg=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let Ko=[],Xo=[];function Fu(){var e=Ko;Ko=[],qo(e)}function Yu(){var e=Xo;Xo=[],qo(e)}function Zo(e){Ko.length===0&&queueMicrotask(Fu),Ko.push(e)}function Kg(e){Xo.length===0&&Wg(Yu),Xo.push(e)}function Xg(){Ko.length>0&&Fu(),Xo.length>0&&Yu()}function Zg(){for(var e=ze.b;e!==null&&!e.has_pending_snippet();)e=e.parent;return e===null&&Ng(),e}function jo(e){var t=Qt|Xt,n=We!==null&&(We.f&Qt)!==0?We:null;return ze===null||n!==null&&(n.f&cn)!==0?t|=cn:ze.f|=Na,{ctx:it,deps:null,effects:null,equals:Ru,f:t,fn:e,reactions:null,rv:0,v:Pt,wv:0,parent:n??ze,ac:null}}function jg(e,t){let n=ze;n===null&&Tg();var r=n.b,o=void 0,i=ao(Pt),s=null,a=!We;return ov(()=>{try{var l=e()}catch(g){l=Promise.reject(g)}var c=()=>l;o=(s==null?void 0:s.then(c,c))??Promise.resolve(l),s=o;var u=Rt,h=r.pending;a&&(r.update_pending_count(1),h||u.increment());const f=(g,v=void 0)=>{s=null,h||u.activate(),v?v!==Aa&&(i.f|=Or,Uo(i,v)):((i.f&Or)!==0&&(i.f^=Or),Uo(i,g)),a&&(r.update_pending_count(-1),h||u.decrement()),Zu()};if(o.then(f,g=>f(null,g||"unknown")),u)return()=>{queueMicrotask(()=>u.neuter())}}),new Promise(l=>{function c(u){function h(){u===o?l(i):c(o)}u.then(h,h)}c(o)})}function Ee(e){const t=jo(e);return gc(t),t}function Me(e){const t=jo(e);return t.equals=Bu,t}function Wu(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)qt(t[n])}}function Ug(e){for(var t=e.parent;t!==null;){if((t.f&Qt)===0)return t;t=t.parent}return null}function Ra(e){var t,n=ze;Vn(Ug(e));try{Wu(e),t=yc(e)}finally{Vn(n)}return t}function Ku(e){var t=Ra(e);if(e.equals(t)||(e.v=t,e.wv=pc()),!Vr)if(dr!==null)dr.set(e,e.v);else{var n=(hr||(e.f&cn)!==0)&&e.deps!==null?cr:bt;Ct(e,n)}}function Xu(e,t,n){const r=Wo()?jo:Me;if(t.length===0){n(e.map(r));return}var o=Rt,i=ze,s=Gg(),a=Zg();Promise.all(t.map(l=>jg(l))).then(l=>{o==null||o.activate(),s();try{n([...e.map(r),...l])}catch(c){(i.f&Mr)===0&&za(c,i)}o==null||o.deactivate(),Zu()}).catch(l=>{a.error(l)})}function Gg(){var e=ze,t=We,n=it;return function(){Vn(e),Dn(t),Ji(n)}}function Zu(){Vn(null),Dn(null),Ji(null)}const Qi=new Set;let Rt=null,dr=null,ju=new Set,es=[];function Uu(){const e=es.shift();es.length>0&&queueMicrotask(Uu),e()}let io=[],ts=null,Ba=!1;const ea=class ea{constructor(){wt(this,or);wt(this,ki,new Map);wt(this,Ho,new Map);wt(this,Ao,new Set);wt(this,$r,0);wt(this,Pi,null);wt(this,Ni,!1);wt(this,jr,[]);wt(this,Do,[]);wt(this,Er,[]);wt(this,rr,[]);wt(this,Ur,[]);kt(this,"skipped_effects",new Set)}capture(t,n){Se(this,Ho).has(t)||Se(this,Ho).set(t,n),Se(this,ki).set(t,t.v)}activate(){Rt=this}deactivate(){Rt=null;for(const t of ju)if(ju.delete(t),t(),Rt!==null)break}neuter(){It(this,Ni,!0)}flush(){io.length>0?this.flush_effects():Lo(this,or,iu).call(this),Rt===this&&(Se(this,$r)===0&&Qi.delete(this),this.deactivate())}flush_effects(){var t=lo;Ba=!0;try{var n=0;for(fc(!0);io.length>0;){if(n++>1e3){var r,o;Jg()}Lo(this,or,ih).call(this,io),Ar.clear()}}finally{Ba=!1,fc(t),ts=null}}increment(){It(this,$r,Se(this,$r)+1)}decrement(){if(It(this,$r,Se(this,$r)-1),Se(this,$r)===0){for(const t of Se(this,Er))Ct(t,Xt),fr(t);for(const t of Se(this,rr))Ct(t,Xt),fr(t);for(const t of Se(this,Ur))Ct(t,Xt),fr(t);It(this,Er,[]),It(this,rr,[]),this.flush()}else this.deactivate()}add_callback(t){Se(this,Ao).add(t)}settled(){return(Se(this,Pi)??It(this,Pi,Eg())).promise}static ensure(t=!0){if(Rt===null){const n=Rt=new ea;Qi.add(Rt),t&&ea.enqueue(()=>{Rt===n&&n.flush()})}return Rt}static enqueue(t){es.length===0&&queueMicrotask(Uu),es.unshift(t)}};ki=new WeakMap,Ho=new WeakMap,Ao=new WeakMap,$r=new WeakMap,Pi=new WeakMap,Ni=new WeakMap,jr=new WeakMap,Do=new WeakMap,Er=new WeakMap,rr=new WeakMap,Ur=new WeakMap,or=new WeakSet,ih=function(t){var i;io=[];var n=null;if(Qi.size>1){n=new Map,dr=new Map;for(const[s,a]of Se(this,ki))n.set(s,{v:s.v,wv:s.wv}),s.v=a;for(const s of Qi)if(s!==this)for(const[a,l]of Se(s,Ho))n.has(a)||(n.set(a,{v:a.v,wv:a.wv}),a.v=l)}for(const s of t)Lo(this,or,sh).call(this,s);if(Se(this,jr).length===0&&Se(this,$r)===0){var r=Se(this,Er),o=Se(this,rr);It(this,Er,[]),It(this,rr,[]),It(this,Ur,[]),Lo(this,or,iu).call(this),Gu(r),Gu(o),(i=Se(this,Pi))==null||i.resolve()}else{for(const s of Se(this,Er))Ct(s,bt);for(const s of Se(this,rr))Ct(s,bt);for(const s of Se(this,Ur))Ct(s,bt)}if(n){for(const[s,{v:a,wv:l}]of n)s.wv<=l&&(s.v=a);dr=null}for(const s of Se(this,jr))uo(s);for(const s of Se(this,Do))uo(s);It(this,jr,[]),It(this,Do,[])},sh=function(t){var u;t.f^=bt;for(var n=t.first;n!==null;){var r=n.f,o=(r&(jn|Tr))!==0,i=o&&(r&bt)!==0,s=i||(r&_n)!==0||this.skipped_effects.has(n);if(!s&&n.fn!==null){if(o)n.f^=bt;else if((r&ka)!==0)Se(this,rr).push(n);else if(ei(n))if((r&Oa)!==0){var a=(u=n.b)!=null&&u.pending?Se(this,Do):Se(this,jr);a.push(n)}else(n.f&Fo)!==0&&Se(this,Ur).push(n),uo(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}},iu=function(){if(!Se(this,Ni))for(const t of Se(this,Ao))t();Se(this,Ao).clear()};let so=ea;function y(e){var t;const n=so.ensure(!1);for(;;){if(Xg(),io.length===0)return n===Rt&&n.flush(),ts=null,t;n.flush_effects()}}function Jg(){try{Ag()}catch(e){za(e,ts)}}function Gu(e){var t=e.length;if(t!==0){for(var n=0;n<t;n++){var r=e[n];if((r.f&(Mr|_n))===0&&ei(r)){var o=rs;if(uo(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null&&r.ac===null?uc(r):r.fn=null),rs>o&&(r.f&Ta)!==0)break}}for(;n<t;n+=1)fr(e[n])}}function fr(e){for(var t=ts=e;t.parent!==null;){t=t.parent;var n=t.f;if(Ba&&t===ze&&(n&Fo)!==0)return;if((n&(Tr|jn))!==0){if((n&bt)===0)return;t.f^=bt}}io.push(t)}const Ar=new Map;function ao(e,t){var n={f:0,v:e,reactions:null,equals:Ru,rv:0,wv:0};return n}function Bt(e,t){const n=ao(e);return gc(n),n}function ae(e,t=!1,n=!0){var o;const r=ao(e);return t||(r.equals=Bu),eo&&n&&it!==null&&it.l!==null&&((o=it.l).s??(o.s=[])).push(r),r}function te(e,t,n=!1){We!==null&&(!An||(We.f&Lu)!==0)&&Wo()&&(We.f&(Qt|Fo|Oa|Lu))!==0&&!(Ft!=null&&Ft.includes(e))&&zg();let r=n?On(t):t;return Uo(e,r)}function Uo(e,t){if(!e.equals(t)){var n=e.v;Vr?Ar.set(e,t):Ar.set(e,n),e.v=t,so.ensure().capture(e,n),(e.f&Qt)!==0&&((e.f&Xt)!==0&&Ra(e),Ct(e,(e.f&cn)===0?bt:cr)),e.wv=pc(),Qu(e,Xt),Wo()&&ze!==null&&(ze.f&bt)!==0&&(ze.f&(jn|Tr))===0&&(hn===null?sv([e]):hn.push(e))}return t}function Ju(e,t=1){var n=d(e),r=t===1?n++:n--;return te(e,n),r}function qa(e){te(e,e.v+1)}function Qu(e,t){var n=e.reactions;if(n!==null)for(var r=Wo(),o=n.length,i=0;i<o;i++){var s=n[i],a=s.f;!r&&s===ze||((a&Xt)===0&&Ct(s,t),(a&Qt)!==0?Qu(s,cr):(a&Xt)===0&&fr(s))}}function On(e){if(typeof e!="object"||e===null||Tn in e)return e;const t=Sa(e);if(t!==xg&&t!==Cg)return e;var n=new Map,r=to(e),o=Bt(0),i=Ir,s=a=>{if(Ir===i)return a();var l=We,c=Ir;Dn(null),vc(i);var u=a();return Dn(l),vc(c),u};return r&&n.set("length",Bt(e.length)),new Proxy(e,{defineProperty(a,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Ig();var u=n.get(l);return u===void 0?u=s(()=>{var h=Bt(c.value);return n.set(l,h),h}):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(()=>Bt(Pt));n.set(l,u),qa(o)}}else te(c,Pt),qa(o);return!0},get(a,l,c){var g;if(l===Tn)return e;var u=n.get(l),h=l in a;if(u===void 0&&(!h||(g=Zn(a,l))!=null&&g.writable)&&(u=s(()=>{var v=On(h?a[l]:Pt),b=Bt(v);return b}),n.set(l,u)),u!==void 0){var f=d(u);return f===Pt?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 h=n.get(l),f=h==null?void 0:h.v;if(h!==void 0&&f!==Pt)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return c},has(a,l){var f;if(l===Tn)return!0;var c=n.get(l),u=c!==void 0&&c.v!==Pt||Reflect.has(a,l);if(c!==void 0||ze!==null&&(!u||(f=Zn(a,l))!=null&&f.writable)){c===void 0&&(c=s(()=>{var g=u?On(a[l]):Pt,v=Bt(g);return v}),n.set(l,c));var h=d(c);if(h===Pt)return!1}return u},set(a,l,c,u){var _;var h=n.get(l),f=l in a;if(r&&l==="length")for(var g=c;g<h.v;g+=1){var v=n.get(g+"");v!==void 0?te(v,Pt):g in a&&(v=s(()=>Bt(Pt)),n.set(g+"",v))}if(h===void 0)(!f||(_=Zn(a,l))!=null&&_.writable)&&(h=s(()=>Bt(void 0)),te(h,On(c)),n.set(l,h));else{f=h.v!==Pt;var b=s(()=>On(c));te(h,b)}var C=Reflect.getOwnPropertyDescriptor(a,l);if(C!=null&&C.set&&C.set.call(u,c),!f){if(r&&typeof l=="string"){var x=n.get("length"),p=Number(l);Number.isInteger(p)&&p>=x.v&&te(x,p+1)}qa(o)}return!0},ownKeys(a){d(o);var l=Reflect.ownKeys(a).filter(h=>{var f=n.get(h);return f===void 0||f.v!==Pt});for(var[c,u]of n)u.v!==Pt&&!(c in a)&&l.push(c);return l},setPrototypeOf(){Lg()}})}function ec(e){try{if(e!==null&&typeof e=="object"&&Tn in e)return e[Tn]}catch{}return e}function Qg(e,t){return Object.is(ec(e),ec(t))}var Zt,tc,nc,rc;function Fa(){if(Zt===void 0){Zt=window,tc=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;nc=Zn(t,"firstChild").get,rc=Zn(t,"nextSibling").get,Vu(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Vu(n)&&(n.__t=void 0)}}function dn(e=""){return document.createTextNode(e)}function xt(e){return nc.call(e)}function Hn(e){return rc.call(e)}function W(e,t){if(!Oe)return xt(e);var n=xt(Fe);if(n===null)n=Fe.appendChild(dn());else if(t&&n.nodeType!==Da){var r=dn();return n==null||n.before(r),zt(r),r}return zt(n),n}function ge(e,t){if(!Oe){var n=xt(e);return n instanceof Comment&&n.data===""?Hn(n):n}return Fe}function B(e,t=1,n=!1){let r=Oe?Fe:e;for(var o;t--;)o=r,r=Hn(r);if(!Oe)return r;if(n&&(r==null?void 0:r.nodeType)!==Da){var i=dn();return r===null?o==null||o.after(i):r.before(i),zt(i),i}return zt(r),r}function Ya(e){e.textContent=""}function Wa(){return!1}function oc(e){ze===null&&We===null&&Hg(),We!==null&&(We.f&cn)!==0&&ze===null&&Og(),Vr&&Mg()}function ev(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function bn(e,t,n,r=!0){var o=ze;o!==null&&(o.f&_n)!==0&&(e|=_n);var i={ctx:it,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{uo(i),i.f|=Pa}catch(l){throw qt(i),l}else t!==null&&fr(i);var s=n&&i.deps===null&&i.first===null&&i.nodes_start===null&&i.teardown===null&&(i.f&Na)===0;if(!s&&r&&(o!==null&&ev(i,o),We!==null&&(We.f&Qt)!==0)){var a=We;(a.effects??(a.effects=[])).push(i)}return i}function Ka(e){const t=bn(ji,null,!1);return Ct(t,bt),t.teardown=e,t}function fn(e){oc();var t=ze.f,n=!We&&(t&jn)!==0&&(t&Pa)===0;if(n){var r=it;(r.e??(r.e=[])).push(e)}else return ic(e)}function ic(e){return bn(ka|Ta,e,!1)}function tv(e){return oc(),bn(ji|Ta,e,!0)}function nv(e){so.ensure();const t=bn(Tr,e,!0);return()=>{qt(t)}}function rv(e){so.ensure();const t=bn(Tr,e,!0);return(n={})=>new Promise(r=>{n.outro?Jo(t,()=>{qt(t),r(void 0)}):(qt(t),r(void 0))})}function tn(e){return bn(ka,e,!1)}function ve(e,t){var n=it,r={effect:null,ran:!1,deps:e};n.l.$.push(r),r.effect=Go(()=>{e(),!r.ran&&(r.ran=!0,G(t))})}function Nt(){var e=it;Go(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&bt)!==0&&Ct(n,cr),ei(n)&&uo(n),t.ran=!1}})}function ov(e){return bn(Oa|Na,e,!0)}function Go(e,t=0){return bn(ji|t,e,!0)}function He(e,t=[],n=[]){Xu(t,n,r=>{bn(ji,()=>e(...r.map(d)),!0)})}function Dr(e,t=0){var n=bn(Fo|t,e,!0);return n}function xn(e,t=!0){return bn(jn,e,!0,t)}function sc(e){var t=e.teardown;if(t!==null){const n=Vr,r=We;hc(!0),Dn(null);try{t.call(null)}finally{hc(n),Dn(r)}}}function ac(e,t=!1){var o;var n=e.first;for(e.first=e.last=null;n!==null;){(o=n.ac)==null||o.abort(Aa);var r=n.next;(n.f&Tr)!==0?n.parent=null:qt(n,t),n=r}}function iv(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&jn)===0&&qt(t),t=n}}function qt(e,t=!0){var n=!1;(t||(e.f&Sg)!==0)&&e.nodes_start!==null&&e.nodes_end!==null&&(lc(e.nodes_start,e.nodes_end),n=!0),ac(e,t&&!n),os(e,0),Ct(e,Mr);var r=e.transitions;if(r!==null)for(const i of r)i.stop();sc(e);var o=e.parent;o!==null&&o.first!==null&&uc(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=e.ac=null}function lc(e,t){for(;e!==null;){var n=e===t?null:Hn(e);e.remove(),e=n}}function uc(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 Jo(e,t){var n=[];Xa(e,n,!0),cc(n,()=>{qt(e),t&&t()})}function cc(e,t){var n=e.length;if(n>0){var r=()=>--n||t();for(var o of e)o.out(r)}else t()}function Xa(e,t,n){if((e.f&_n)===0){if(e.f^=_n,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&no)!==0||(r.f&jn)!==0;Xa(r,t,i?n:!1),r=o}}}function ns(e){dc(e,!0)}function dc(e,t){if((e.f&_n)!==0){e.f^=_n,(e.f&bt)===0&&(Ct(e,Xt),fr(e));for(var n=e.first;n!==null;){var r=n.next,o=(n.f&no)!==0||(n.f&jn)!==0;dc(n,o?t:!1),n=r}if(e.transitions!==null)for(const i of e.transitions)(i.is_global||t)&&i.in()}}let lo=!1;function fc(e){lo=e}let Vr=!1;function hc(e){Vr=e}let We=null,An=!1;function Dn(e){We=e}let ze=null;function Vn(e){ze=e}let Ft=null;function gc(e){We!==null&&(Ft===null?Ft=[e]:Ft.push(e))}let Yt=null,nn=0,hn=null;function sv(e){hn=e}let rs=1,Qo=0,Ir=Qo;function vc(e){Ir=e}let hr=!1;function pc(){return++rs}function ei(e){var h;var t=e.f;if((t&Xt)!==0)return!0;if((t&cr)!==0){var n=e.deps,r=(t&cn)!==0;if(n!==null){var o,i,s=(t&Ui)!==0,a=r&&ze!==null&&!hr,l=n.length;if((s||a)&&(ze===null||(ze.f&Mr)===0)){var c=e,u=c.parent;for(o=0;o<l;o++)i=n[o],(s||!((h=i==null?void 0:i.reactions)!=null&&h.includes(c)))&&(i.reactions??(i.reactions=[])).push(c);s&&(c.f^=Ui),a&&u!==null&&(u.f&cn)===0&&(c.f^=cn)}for(o=0;o<l;o++)if(i=n[o],ei(i)&&Ku(i),i.wv>e.wv)return!0}(!r||ze!==null&&!hr)&&Ct(e,bt)}return!1}function mc(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&Qt)!==0?mc(i,t,!1):t===i&&(n?Ct(i,Xt):(i.f&bt)!==0&&Ct(i,cr),fr(i))}}function yc(e){var v;var t=Yt,n=nn,r=hn,o=We,i=hr,s=Ft,a=it,l=An,c=Ir,u=e.f;Yt=null,nn=0,hn=null,hr=(u&cn)!==0&&(An||!lo||We===null),We=(u&(jn|Tr))===0?e:null,Ft=null,Ji(e.ctx),An=!1,Ir=++Qo,e.ac!==null&&(e.ac.abort(Aa),e.ac=null);try{e.f|=Ma;var h=(0,e.fn)(),f=e.deps;if(Yt!==null){var g;if(os(e,nn),f!==null&&nn>0)for(f.length=nn+Yt.length,g=0;g<Yt.length;g++)f[nn+g]=Yt[g];else e.deps=f=Yt;if(!hr||(u&Qt)!==0&&e.reactions!==null)for(g=nn;g<f.length;g++)((v=f[g]).reactions??(v.reactions=[])).push(e)}else f!==null&&nn<f.length&&(os(e,nn),f.length=nn);if(Wo()&&hn!==null&&!An&&f!==null&&(e.f&(Qt|cr|Xt))===0)for(g=0;g<hn.length;g++)mc(hn[g],e);return o!==null&&o!==e&&(Qo++,hn!==null&&(r===null?r=hn:r.push(...hn))),(e.f&Or)!==0&&(e.f^=Or),h}catch(b){return Yg(b)}finally{e.f^=Ma,Yt=t,nn=n,hn=r,We=o,hr=i,Ft=s,Ji(a),An=l,Ir=c}}function av(e,t){let n=t.reactions;if(n!==null){var r=bg.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&Qt)!==0&&(Yt===null||!Yt.includes(t))&&(Ct(t,cr),(t.f&(cn|Ui))===0&&(t.f^=Ui),Wu(t),os(t,0))}function os(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)av(e,n[r])}function uo(e){var t=e.f;if((t&Mr)===0){Ct(e,bt);var n=ze,r=lo;ze=e,lo=!0;try{(t&Fo)!==0?iv(e):ac(e),sc(e);var o=yc(e);e.teardown=typeof o=="function"?o:null,e.wv=rs;var i;Au&&ug&&(e.f&Xt)!==0&&e.deps}finally{lo=r,ze=n}}}function d(e){var t=e.f,n=(t&Qt)!==0;if(We!==null&&!An){var r=ze!==null&&(ze.f&Mr)!==0;if(!r&&!(Ft!=null&&Ft.includes(e))){var o=We.deps;if((We.f&Ma)!==0)e.rv<Qo&&(e.rv=Qo,Yt===null&&o!==null&&o[nn]===e?nn++:Yt===null?Yt=[e]:(!hr||!Yt.includes(e))&&Yt.push(e));else{(We.deps??(We.deps=[])).push(e);var i=e.reactions;i===null?e.reactions=[We]:i.includes(We)||i.push(We)}}}else if(n&&e.deps===null&&e.effects===null){var s=e,a=s.parent;a!==null&&(a.f&cn)===0&&(s.f^=cn)}if(Vr){if(Ar.has(e))return Ar.get(e);if(n){s=e;var l=s.v;return((s.f&bt)===0&&s.reactions!==null||wc(s))&&(l=Ra(s)),Ar.set(s,l),l}}else if(n){if(s=e,dr!=null&&dr.has(s))return dr.get(s);ei(s)&&Ku(s)}if((e.f&Or)!==0)throw e.v;return e.v}function wc(e){if(e.v===Pt)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(Ar.has(t)||(t.f&Qt)!==0&&wc(t))return!0;return!1}function G(e){var t=An;try{return An=!0,e()}finally{An=t}}const lv=-7169;function Ct(e,t){e.f=e.f&lv|t}function q(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(Tn in e)Za(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&Tn in n&&Za(n)}}}function Za(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{Za(e[r],t)}catch{}const n=Sa(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=Du(n);for(let o in r){const i=r[o].get;if(i)try{i.call(e)}catch{}}}}}function uv(e,t){if(t){const n=document.body;e.autofocus=!0,Zo(()=>{document.activeElement===n&&e.focus()})}}function cv(e){Oe&&xt(e)!==null&&Ya(e)}let _c=!1;function dv(){_c||(_c=!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 fv(e){var t=We,n=ze;Dn(null),Vn(null);try{return e()}finally{Dn(t),Vn(n)}}const bc=new Set,ja=new Set;function xc(e,t,n,r={}){function o(i){if(r.capture||ti.call(t,i),!i.cancelBubble)return fv(()=>n==null?void 0:n.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Zo(()=>{t.addEventListener(e,o,r)}):t.addEventListener(e,o,r),o}function ct(e,t,n,r,o){var i={capture:r,passive:o},s=xc(e,t,n,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Ka(()=>{t.removeEventListener(e,s,i)})}function co(e){for(var t=0;t<e.length;t++)bc.add(e[t]);for(var n of ja)n(e)}function ti(e){var p;var t=this,n=t.ownerDocument,r=e.type,o=((p=e.composedPath)==null?void 0:p.call(e))||[],i=o[0]||e.target,s=0,a=e.__root;if(a){var l=o.indexOf(a);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var c=o.indexOf(t);if(c===-1)return;l<=c&&(s=l)}if(i=o[s]||e.target,i!==t){Nr(e,"currentTarget",{configurable:!0,get(){return i||n}});var u=We,h=ze;Dn(null),Vn(null);try{for(var f,g=[];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(to(b)){var[C,...x]=b;C.apply(i,[e,...x])}else b.call(i,e)}catch(_){f?g.push(_):f=_}if(e.cancelBubble||v===t||v===null)break;i=v}if(f){for(let _ of g)queueMicrotask(()=>{throw _});throw f}}finally{e.__root=t,delete e.currentTarget,Dn(u),Vn(h)}}}function Ua(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function jt(e,t){var n=ze;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function ie(e,t){var n=(t&Ou)!==0,r=(t&mg)!==0,o,i=!e.startsWith("<!>");return()=>{if(Oe)return jt(Fe,null),Fe;o===void 0&&(o=Ua(i?e:"<!>"+e),n||(o=xt(o)));var s=r||tc?document.importNode(o,!0):o.cloneNode(!0);if(n){var a=xt(s),l=s.lastChild;jt(a,l)}else jt(s,s);return s}}function hv(e,t,n="svg"){var r=!e.startsWith("<!>"),o=(t&Ou)!==0,i=`<${n}>${r?e:"<!>"+e}</${n}>`,s;return()=>{if(Oe)return jt(Fe,null),Fe;if(!s){var a=Ua(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),h=c.lastChild;jt(u,h)}else jt(c,c);return c}}function Ce(e,t){return hv(e,t,"svg")}function Re(e=""){if(!Oe){var t=dn(e+"");return jt(t,t),t}var n=Fe;return n.nodeType!==Da&&(n.before(n=dn()),zt(n)),jt(n,n),n}function Ke(){if(Oe)return jt(Fe,null),Fe;var e=document.createDocumentFragment(),t=document.createComment(""),n=dn();return e.append(t,n),jt(t,n),e}function H(e,t){if(Oe){ze.nodes_end=Fe,Mn();return}e!==null&&e.before(t)}function gv(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const vv=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function pv(e){return vv.includes(e)}const mv={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 yv(e){return e=e.toLowerCase(),mv[e]??e}const wv=["touchstart","touchmove"];function _v(e){return wv.includes(e)}const bv=["textarea","script","style","title"];function xv(e){return bv.includes(e)}function pt(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 Cc(e,t){return $c(e,t)}function Cv(e,t){Fa(),t.intro=t.intro??!1;const n=t.target,r=Oe,o=Fe;try{for(var i=xt(n);i&&(i.nodeType!==ro||i.data!==Hu);)i=Hn(i);if(!i)throw Pr;en(!0),zt(i),Mn();const s=$c(e,{...t,anchor:i});if(Fe===null||Fe.nodeType!==ro||Fe.data!==$a)throw Yo(),Pr;return en(!1),s}catch(s){if(s===Pr)return t.recover===!1&&Dg(),Fa(),Ya(n),en(!1),Cc(e,t);throw s}finally{en(r),zt(o)}}const fo=new Map;function $c(e,{target:t,anchor:n,props:r={},events:o,context:i,intro:s=!0}){Fa();var a=new Set,l=h=>{for(var f=0;f<h.length;f++){var g=h[f];if(!a.has(g)){a.add(g);var v=_v(g);t.addEventListener(g,ti,{passive:v});var b=fo.get(g);b===void 0?(document.addEventListener(g,ti,{passive:v}),fo.set(g,1)):fo.set(g,b+1)}}};l(Ea(bc)),ja.add(l);var c=void 0,u=rv(()=>{var h=n??t.appendChild(dn());return xn(()=>{if(i){fe({});var f=it;f.c=i}o&&(r.$$events=o),Oe&&jt(h,null),c=e(h,r)||{},Oe&&(ze.nodes_end=Fe),i&&he()}),()=>{var v;for(var f of a){t.removeEventListener(f,ti);var g=fo.get(f);--g===0?(document.removeEventListener(f,ti),fo.delete(f)):fo.set(f,g)}ja.delete(l),h!==n&&((v=h.parentNode)==null||v.removeChild(h))}});return Ga.set(c,u),c}let Ga=new WeakMap;function $v(e,t){const n=Ga.get(e);return n?(Ga.delete(e),n(t)):Promise.resolve()}function Lr(e,t,...n){var r=e,o=_t,i;Dr(()=>{o!==(o=t())&&(i&&(qt(i),i=null),i=xn(()=>o(r,...n)))},no),Oe&&(r=Fe)}function gn(e){it===null&&Gi(),eo&&it.l!==null?Sv(it).m.push(e):fn(()=>{const t=G(e);if(typeof t=="function")return t})}function Ja(e){it===null&&Gi(),gn(()=>()=>G(e))}function Ev(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function is(){const e=it;return e===null&&Gi(),(t,n,r)=>{var i;const o=(i=e.s.$$events)==null?void 0:i[t];if(o){const s=to(o)?o.slice():[o],a=Ev(t,n,r);for(const l of s)l.call(e.x,a);return!a.defaultPrevented}return!0}}function Sv(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}function me(e,t,n=!1){Oe&&Mn();var r=e,o=null,i=null,s=Pt,a=n?no:0,l=!1;const c=(g,v=!0)=>{l=!0,f(v,g)};var u=null;function h(){u!==null&&(u.lastChild.remove(),r.before(u),u=null);var g=s?o:i,v=s?i:o;g&&ns(g),v&&Jo(v,()=>{s?i=null:o=null})}const f=(g,v)=>{if(s===(s=g))return;let b=!1;if(Oe){const S=zu(r)===Ca;!!s===S&&(r=Va(),zt(r),en(!1),b=!0)}var C=Wa(),x=r;if(C&&(u=document.createDocumentFragment(),u.append(x=dn())),s?o??(o=v&&xn(()=>v(x))):i??(i=v&&xn(()=>v(x))),C){var p=Rt,_=s?o:i,m=s?i:o;_&&p.skipped_effects.delete(_),m&&p.skipped_effects.add(m),p.add_callback(h)}else h();b&&en(!0)};Dr(()=>{l=!1,t(c),l||f(null,null)},a),Oe&&(r=Fe)}function ho(e,t){return t}function kv(e,t,n){for(var r=e.items,o=[],i=t.length,s=0;s<i;s++)Xa(t[s].e,o,!0);var a=i>0&&o.length===0&&n!==null;if(a){var l=n.parentNode;Ya(l),l.append(n),r.clear(),In(e,t[0].prev,t[i-1].next)}cc(o,()=>{for(var c=0;c<i;c++){var u=t[c];a||(r.delete(u.k),In(e,u.prev,u.next)),qt(u.e,!a)}})}function Wt(e,t,n,r,o,i=null){var s=e,a={flags:t,items:new Map,first:null},l=(t&Tu)!==0;if(l){var c=e;s=Oe?zt(xt(c)):c.appendChild(dn())}Oe&&Mn();var u=null,h=!1,f=new Map,g=Me(()=>{var x=n();return to(x)?x:x==null?[]:Ea(x)}),v,b;function C(){Pv(b,v,a,f,s,o,t,r,n),i!==null&&(v.length===0?u?ns(u):u=xn(()=>i(s)):u!==null&&Jo(u,()=>{u=null}))}Dr(()=>{b??(b=ze),v=d(g);var x=v.length;if(h&&x===0)return;h=x===0;let p=!1;if(Oe){var _=zu(s)===Ca;_!==(x===0)&&(s=Va(),zt(s),en(!1),p=!0)}if(Oe){for(var m=null,S,N=0;N<x;N++){if(Fe.nodeType===ro&&Fe.data===$a){s=Fe,p=!0,en(!1);break}var P=v[N],D=r(P,N);S=Qa(Fe,a,m,null,P,D,N,o,t,n),a.items.set(D,S),m=S}x>0&&zt(Va())}if(Oe)x===0&&i&&(u=xn(()=>i(s)));else if(Wa()){var I=new Set,A=Rt;for(N=0;N<x;N+=1){P=v[N],D=r(P,N);var V=a.items.get(D)??f.get(D);V?(t&(Ki|Xi))!==0&&Ec(V,P,N,t):(S=Qa(null,a,null,null,P,D,N,o,t,n,!0),f.set(D,S)),I.add(D)}for(const[L,R]of a.items)I.has(L)||A.skipped_effects.add(R.e);A.add_callback(C)}else C();p&&en(!0),d(g)}),Oe&&(s=Fe)}function Pv(e,t,n,r,o,i,s,a,l){var O,z,j,X;var c=(s&dg)!==0,u=(s&(Ki|Xi))!==0,h=t.length,f=n.items,g=n.first,v=g,b,C=null,x,p=[],_=[],m,S,N,P;if(c)for(P=0;P<h;P+=1)m=t[P],S=a(m,P),N=f.get(S),N!==void 0&&((O=N.a)==null||O.measure(),(x??(x=new Set)).add(N));for(P=0;P<h;P+=1){if(m=t[P],S=a(m,P),N=f.get(S),N===void 0){var D=r.get(S);if(D!==void 0){r.delete(S),f.set(S,D);var I=C?C.next:v;In(n,C,D),In(n,D,I),el(D,I,o),C=D}else{var A=v?v.e.nodes_start:o;C=Qa(A,n,C,C===null?n.first:C.next,m,S,P,i,s,l)}f.set(S,C),p=[],_=[],v=C.next;continue}if(u&&Ec(N,m,P,s),(N.e.f&_n)!==0&&(ns(N.e),c&&((z=N.a)==null||z.unfix(),(x??(x=new Set)).delete(N))),N!==v){if(b!==void 0&&b.has(N)){if(p.length<_.length){var V=_[0],L;C=V.prev;var R=p[0],E=p[p.length-1];for(L=0;L<p.length;L+=1)el(p[L],V,o);for(L=0;L<_.length;L+=1)b.delete(_[L]);In(n,R.prev,E.next),In(n,C,R),In(n,E,V),v=V,C=E,P-=1,p=[],_=[]}else b.delete(N),el(N,v,o),In(n,N.prev,N.next),In(n,N,C===null?n.first:C.next),In(n,C,N),C=N;continue}for(p=[],_=[];v!==null&&v.k!==S;)(v.e.f&_n)===0&&(b??(b=new Set)).add(v),_.push(v),v=v.next;if(v===null)continue;N=v}p.push(N),C=N,v=N.next}if(v!==null||b!==void 0){for(var $=b===void 0?[]:Ea(b);v!==null;)(v.e.f&_n)===0&&$.push(v),v=v.next;var k=$.length;if(k>0){var T=(s&Tu)!==0&&h===0?o:null;if(c){for(P=0;P<k;P+=1)(j=$[P].a)==null||j.measure();for(P=0;P<k;P+=1)(X=$[P].a)==null||X.fix()}kv(n,$,T)}}c&&Zo(()=>{var ee;if(x!==void 0)for(N of x)(ee=N.a)==null||ee.apply()}),e.first=n.first&&n.first.e,e.last=C&&C.e;for(var M of r.values())qt(M.e);r.clear()}function Ec(e,t,n,r){(r&Ki)!==0&&Uo(e.v,t),(r&Xi)!==0?Uo(e.i,n):e.i=n}function Qa(e,t,n,r,o,i,s,a,l,c,u){var h=(l&Ki)!==0,f=(l&fg)===0,g=h?f?ae(o,!1,!1):ao(o):o,v=(l&Xi)===0?s:ao(s),b={i:v,v:g,k:i,a:null,e:null,prev:n,next:r};try{if(e===null){var C=document.createDocumentFragment();C.append(e=dn())}return b.e=xn(()=>a(e,g,v,c),Oe),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 el(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=Hn(i);o.before(i),i=s}}function In(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 tl(e,t,n=!1,r=!1,o=!1){var i=e,s="";He(()=>{var a=ze;if(s===(s=t()??"")){Oe&&Mn();return}if(a.nodes_start!==null&&(lc(a.nodes_start,a.nodes_end),a.nodes_start=a.nodes_end=null),s!==""){if(Oe){Fe.data;for(var l=Mn(),c=l;l!==null&&(l.nodeType!==ro||l.data!=="");)c=l,l=Hn(l);if(l===null)throw Yo(),Pr;jt(Fe,c),i=zt(l);return}var u=s+"";n?u=`<svg>${u}</svg>`:r&&(u=`<math>${u}</math>`);var h=Ua(u);if((n||r)&&(h=xt(h)),jt(xt(h),h.lastChild),n||r)for(;xt(h);)i.before(xt(h));else i.before(h)}})}function At(e,t,n,r,o){var a;Oe&&Mn();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 Nv(e){const t={};e.children&&(t.default=!0);for(const n in e.$$slots)t[n]=!0;return t}function Sc(e,t,n){Oe&&Mn();var r=e,o,i,s=null,a=null;function l(){i&&(Jo(i),i=null),s&&(s.lastChild.remove(),r.before(s),s=null),i=a,a=null}Dr(()=>{if(o!==(o=t())){var c=Wa();if(o){var u=r;c&&(s=document.createDocumentFragment(),s.append(u=dn())),a=xn(()=>n(u,o))}c?Rt.add_callback(l):l()}},no),Oe&&(r=Fe)}function Tv(e,t,n,r,o,i){let s=Oe;Oe&&Mn();var a,l,c=null;Oe&&Fe.nodeType===Pg&&(c=Fe,Mn());var u=Oe?Fe:e,h;Dr(()=>{const f=t()||null;var g=f==="svg"?wg:null;f!==a&&(h&&(f===null?Jo(h,()=>{h=null,l=null}):f===l?ns(h):qt(h)),f&&f!==l&&(h=xn(()=>{if(c=Oe?c:g?document.createElementNS(g,f):document.createElement(f),jt(c,c),r){Oe&&xv(f)&&c.append(document.createComment(""));var v=Oe?xt(c):c.appendChild(dn());Oe&&(v===null?en(!1):zt(v)),r(c,v)}ze.nodes_end=c,u.before(c)})),a=f,a&&(l=a))},no),s&&(en(!0),zt(u))}function st(e,t){Zo(()=>{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 Dt(e,t,n){tn(()=>{var r=G(()=>t(e,n==null?void 0:n())||{});if(n&&(r!=null&&r.update)){var o=!1,i={};Go(()=>{var s=n();q(s),o&&Ia(i,s)&&(i=s,r.update(s))}),o=!0}if(r!=null&&r.destroy)return()=>r.destroy()})}function Mv(e,t){var n=void 0,r;Dr(()=>{n!==(n=t())&&(r&&(qt(r),r=null),n&&(r=xn(()=>{tn(()=>n(e))})))})}function kc(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=kc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ov(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=kc(e))&&(r&&(r+=" "),r+=t);return r}function Cn(e){return typeof e=="object"?Ov(e):e??""}const Pc=[...`
|
|
14
|
+
\r\f \v\uFEFF`];function Hv(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||Pc.includes(r[s-1]))&&(a===r.length||Pc.includes(r[a]))?r=(s===0?"":r.substring(0,s))+r.substring(a+1):s=a}}return r===""?null:r}function Nc(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 nl(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Av(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(nl)),o&&l.push(...Object.keys(o).map(nl));var c=0,u=-1;const b=e.length;for(var h=0;h<b;h++){var f=e[h];if(a?f==="/"&&e[h-1]==="*"&&(a=!1):i?i===f&&(i=!1):f==="/"&&e[h+1]==="*"?a=!0:f==='"'||f==="'"?i=f:f==="("?s++:f===")"&&s--,!a&&i===!1&&s===0){if(f===":"&&u===-1)u=h;else if(f===";"||h===b-1){if(u!==-1){var g=nl(e.substring(c,u).trim());if(!l.includes(g)){f!==";"&&h++;var v=e.substring(c,h).trim();n+=" "+v+";"}}c=h+1,u=-1}}}}return r&&(n+=Nc(r)),o&&(n+=Nc(o,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function Vt(e,t,n,r,o,i){var s=e.__className;if(Oe||s!==n||s===void 0){var a=Hv(n,r,i);(!Oe||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 rl(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 yt(e,t,n,r){var o=e.__style;if(Oe||o!==t){var i=Av(t,r);(!Oe||i!==e.getAttribute("style"))&&(i==null?e.removeAttribute("style"):e.style.cssText=i),e.__style=t}else r&&(Array.isArray(r)?(rl(e,n==null?void 0:n[0],r[0]),rl(e,n==null?void 0:n[1],r[1],"important")):rl(e,n,r));return r}function ol(e,t,n=!1){if(e.multiple){if(t==null)return;if(!to(t))return Rg();for(var r of e.options)r.selected=t.includes(Tc(r));return}for(r of e.options){var o=Tc(r);if(Qg(o,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Dv(e){var t=new MutationObserver(()=>{ol(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Ka(()=>{t.disconnect()})}function Tc(e){return"__value"in e?e.__value:e.value}const ni=Symbol("class"),zr=Symbol("style"),Mc=Symbol("is custom element"),Oc=Symbol("is html");function gr(e){if(Oe){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;be(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var o=e.checked;be(e,"checked",null),e.checked=o}}};e.__on_r=n,Kg(n),dv()}}function ss(e,t){var n=as(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function Vv(e,t){var n=as(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function Iv(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function be(e,t,n,r){var o=as(e);Oe&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=n)&&(t==="loading"&&(e[kg]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Ac(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Lv(e,t,n,r,o=!1){var i=as(e),s=i[Mc],a=!i[Oc];let l=Oe&&s;l&&en(!1);var c=t||{},u=e.tagName==="OPTION";for(var h in t)h in n||(n[h]=null);n.class?n.class=Cn(n.class):(r||n[ni])&&(n.class=null),n[zr]&&(n.style??(n.style=null));var f=Ac(e);for(const _ in n){let m=n[_];if(u&&_==="value"&&m==null){e.value=e.__value="",c[_]=m;continue}if(_==="class"){var g=e.namespaceURI==="http://www.w3.org/1999/xhtml";Vt(e,g,m,r,t==null?void 0:t[ni],n[ni]),c[_]=m,c[ni]=n[ni];continue}if(_==="style"){yt(e,m,t==null?void 0:t[zr],n[zr]),c[_]=m,c[zr]=n[zr];continue}var v=c[_];if(!(m===v&&!(m===void 0&&e.hasAttribute(_)))){c[_]=m;var b=_[0]+_[1];if(b!=="$$")if(b==="on"){const S={},N="$$"+_;let P=_.slice(2);var C=pv(P);if(gv(P)&&(P=P.slice(0,-7),S.capture=!0),!C&&v){if(m!=null)continue;e.removeEventListener(P,c[N],S),c[N]=null}if(m!=null)if(C)e[`__${P}`]=m,co([P]);else{let D=function(I){c[_].call(this,I)};c[N]=xc(P,e,D,S)}else C&&(e[`__${P}`]=void 0)}else if(_==="style")be(e,_,m);else if(_==="autofocus")uv(e,!!m);else if(!s&&(_==="__value"||_==="value"&&m!=null))e.value=e.__value=m;else if(_==="selected"&&u)Iv(e,m);else{var x=_;a||(x=yv(x));var p=x==="defaultValue"||x==="defaultChecked";if(m==null&&!s&&!p)if(i[_]=null,x==="value"||x==="checked"){let S=e;const N=t===void 0;if(x==="value"){let P=S.defaultValue;S.removeAttribute(x),S.defaultValue=P,S.value=S.__value=N?P:null}else{let P=S.defaultChecked;S.removeAttribute(x),S.defaultChecked=P,S.checked=N?P:!1}}else e.removeAttribute(_);else p||f.includes(x)&&(s||typeof m!="string")?e[x]=m:typeof m!="function"&&be(e,x,m)}}}return l&&en(!0),c}function rn(e,t,n=[],r=[],o,i=!1){Xu(n,r,s=>{var a=void 0,l={},c=e.nodeName==="SELECT",u=!1;if(Dr(()=>{var f=t(...s.map(d)),g=Lv(e,a,f,o,i);u&&c&&"value"in f&&ol(e,f.value);for(let b of Object.getOwnPropertySymbols(l))f[b]||qt(l[b]);for(let b of Object.getOwnPropertySymbols(f)){var v=f[b];b.description===_g&&(!a||v!==a[b])&&(l[b]&&qt(l[b]),l[b]=xn(()=>Mv(e,()=>v))),g[b]=v}a=g}),c){var h=e;tn(()=>{ol(h,a.value,!0),Dv(h)})}u=!0})}function as(e){return e.__attributes??(e.__attributes={[Mc]:e.nodeName.includes("-"),[Oc]:e.namespaceURI===yg})}var Hc=new Map;function Ac(e){var t=Hc.get(e.nodeName);if(t)return t;Hc.set(e.nodeName,t=[]);for(var n,r=e,o=Element.prototype;o!==r;){n=Du(r);for(var i in n)n[i].set&&t.push(i);r=Sa(r)}return t}const na=class na{constructor(t){wt(this,ta);wt(this,Sr,new WeakMap);wt(this,Vo);wt(this,Ti);It(this,Ti,t)}observe(t,n){var r=Se(this,Sr).get(t)||new Set;return r.add(n),Se(this,Sr).set(t,r),Lo(this,ta,ah).call(this).observe(t,Se(this,Ti)),()=>{var o=Se(this,Sr).get(t);o.delete(n),o.size===0&&(Se(this,Sr).delete(t),Se(this,Vo).unobserve(t))}}};Sr=new WeakMap,Vo=new WeakMap,Ti=new WeakMap,ta=new WeakSet,ah=function(){return Se(this,Vo)??It(this,Vo,new ResizeObserver(t=>{for(var n of t){na.entries.set(n.target,n);for(var r of Se(this,Sr).get(n.target)||[])r(n)}}))},kt(na,"entries",new WeakMap);let il=na;var zv=new il({box:"border-box"});function Dc(e,t,n){var r=zv.observe(e,()=>n(e[t]));tn(()=>(G(()=>n(e[t])),r))}function Vc(e,t){return e===t||(e==null?void 0:e[Tn])===t}function Ln(e={},t,n,r){return tn(()=>{var o,i;return Go(()=>{o=i,i=[],G(()=>{e!==n(...i)&&(t(e,...i),o&&Vc(n(...o),e)&&t(null,...o))})}),()=>{Zo(()=>{i&&Vc(n(...i),e)&&t(null,...i)})}}),e}function qe(e=!1){const t=it,n=t.l.u;if(!n)return;let r=()=>q(t.s);if(e){let o=0,i={};const s=jo(()=>{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&&tv(()=>{Ic(t,r),qo(n.b)}),fn(()=>{const o=G(()=>n.m.map($g));return()=>{for(const i of o)typeof i=="function"&&i()}}),n.a.length&&fn(()=>{Ic(t,r),qo(n.a)})}function Ic(e,t){if(e.l.s)for(const n of e.l.s)d(n);t()}function Ze(e,t){var i;var n=(i=e.$$events)==null?void 0:i[t.type],r=to(n)?n.slice():n==null?[]:[n];for(var o of r)o.call(this,t)}function sl(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 go=[];function vn(e,t){return{subscribe:xe(e,t).subscribe}}function xe(e,t=_t){let n=null;const r=new Set;function o(a){if(Ia(e,a)&&(e=a,n)){const l=!go.length;for(const c of r)c[1](),go.push(c,e);if(l){for(let c=0;c<go.length;c+=2)go[c][0](go[c+1]);go.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 vr(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 vn(n,(s,a)=>{let l=!1;const c=[];let u=0,h=_t;const f=()=>{if(u)return;h();const v=t(r?c[0]:c,s,a);i?s(v):h=typeof v=="function"?v:_t},g=o.map((v,b)=>sl(v,C=>{c[b]=C,u&=~(1<<b),l&&f()},()=>{u|=1<<b}));return l=!0,f(),function(){qo(g),h(),l=!1}})}function J(e){let t;return sl(e,n=>t=n)(),t}let ls=!1,al=Symbol();function oe(e,t,n){const r=n[t]??(n[t]={store:null,source:ae(void 0),unsubscribe:_t});if(r.store!==e&&!(al 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=sl(e,i=>{o?r.source.v=i:te(r.source,i)}),o=!1}return e&&al in n?J(e):d(r.source)}function Rv(e,t,n){let r=n[t];return r&&r.store!==e&&(r.unsubscribe(),r.unsubscribe=_t),e}function us(e,t){return e.set(t),t}function dt(){const e={};function t(){Ka(()=>{for(var n in e)e[n].unsubscribe();Nr(e,al,{enumerable:!1,value:!0})})}return[e,t]}function Bv(e){var t=ls;try{return ls=!1,[e(),ls]}finally{ls=t}}const qv={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},qv)}const Fv={get(e,t){if(!e.exclude.includes(t))return d(e.version),t in e.special?e.special[t]():e.props[t]},set(e,t,n){if(!(t in e.special)){var r=ze;try{Vn(e.parent_effect),e.special[t]=w({get[t](){return e.props[t]}},t,Mu)}finally{Vn(r)}}return e.special[t](n),Ju(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),Ju(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:ao(0),parent_effect:ze},Fv)}const Yv={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Bo(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];Bo(o)&&(o=o());const i=Zn(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(Bo(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r){const o=Zn(r,t);return o&&!o.configurable&&(o.configurable=!0),o}}},has(e,t){if(t===Tn||t===Ha)return!1;for(let n of e.props)if(Bo(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props)if(Bo(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},Yv)}function w(e,t,n,r){var _;var o=!eo||(n&gg)!==0,i=(n&vg)!==0,s=(n&pg)!==0,a=r,l=!0,c=()=>(l&&(l=!1,a=s?G(r):r),a),u;if(i){var h=Tn in e||Ha in e;u=((_=Zn(e,t))==null?void 0:_.set)??(h&&t in e?m=>e[t]=m:void 0)}var f,g=!1;i?[f,g]=Bv(()=>e[t]):f=e[t],f===void 0&&r!==void 0&&(f=c(),u&&(o&&Vg(),u(f)));var v;if(o?v=()=>{var m=e[t];return m===void 0?c():(l=!0,m)}:v=()=>{var m=e[t];return m!==void 0&&(a=void 0),m===void 0?a:m},o&&(n&Mu)===0)return v;if(u){var b=e.$$legacy;return function(m,S){return arguments.length>0?((!o||!S||b||g)&&u(S?v():m),m):v()}}var C=!1,x=((n&hg)!==0?jo:Me)(()=>(C=!1,v()));i&&d(x);var p=ze;return function(m,S){if(arguments.length>0){const N=S?d(x):o&&i?On(m):m;return te(x,N),C=!0,a!==void 0&&(a=N),m}return Vr&&C||(p.f&Mr)!==0?x.v:d(x)}}function Wv(e){return new Kv(e)}class Kv{constructor(t){wt(this,ir);wt(this,yn);var i;var n=new Map,r=(s,a)=>{var l=ae(a,!1,!1);return n.set(s,l),l};const o=new Proxy({...t.props||{},$$events:{}},{get(s,a){return d(n.get(a)??r(a,Reflect.get(s,a)))},has(s,a){return a===Ha?!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,yn,(t.hydrate?Cv:Cc)(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,ir,o.$$events);for(const s of Object.keys(Se(this,yn)))s==="$set"||s==="$destroy"||s==="$on"||Nr(this,s,{get(){return Se(this,yn)[s]},set(a){Se(this,yn)[s]=a},enumerable:!0});Se(this,yn).$set=s=>{Object.assign(o,s)},Se(this,yn).$destroy=()=>{$v(Se(this,yn))}}$set(t){Se(this,yn).$set(t)}$on(t,n){Se(this,ir)[t]=Se(this,ir)[t]||[];const r=(...o)=>n.call(this,...o);return Se(this,ir)[t].push(r),()=>{Se(this,ir)[t]=Se(this,ir)[t].filter(o=>o!==r)}}$destroy(){Se(this,yn).$destroy()}}ir=new WeakMap,yn=new WeakMap;let Lc;typeof HTMLElement=="function"&&(Lc=class extends HTMLElement{constructor(t,n,r){super();kt(this,"$$ctor");kt(this,"$$s");kt(this,"$$c");kt(this,"$$cn",!1);kt(this,"$$d",{});kt(this,"$$r",!1);kt(this,"$$p_d",{});kt(this,"$$l",{});kt(this,"$$l_u",new Map);kt(this,"$$me");this.$$ctor=t,this.$$s=n,r&&this.attachShadow({mode:"open"})}addEventListener(t,n,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){const o=this.$$c.$on(t,n);this.$$l_u.set(n,o)}super.addEventListener(t,n,r)}removeEventListener(t,n,r){if(super.removeEventListener(t,n,r),this.$$c){const o=this.$$l_u.get(n);o&&(o(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(o){return i=>{const s=document.createElement("slot");o!=="default"&&(s.name=o),H(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=Xv(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]=cs(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=Wv({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=nv(()=>{Go(()=>{var o;this.$$r=!0;for(const i of Zi(this.$$c)){if(!((o=this.$$p_d[i])!=null&&o.reflect))continue;this.$$d[i]=this.$$c[i];const s=cs(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]=cs(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 Zi(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function cs(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 Xv(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function ce(e,t,n,r,o,i){let s=class extends Lc{constructor(){super(e,n,o),this.$$p_d=t}static get observedAttributes(){return Zi(t).map(a=>(t[a].attribute||a).toLowerCase())}};return Zi(t).forEach(a=>{Nr(s.prototype,a,{get(){return this.$$c&&a in this.$$c?this.$$c[a]:this.$$d[a]},set(l){var h;l=cs(a,l,t),this.$$d[a]=l;var c=this.$$c;if(c){var u=(h=Zn(c,a))==null?void 0:h.get;u?c[a]=l:c.$set({[a]:l})}}})}),r.forEach(a=>{Nr(s.prototype,a,{get(){var l;return(l=this.$$c)==null?void 0:l[a]}})}),e.element=s,s}function at(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=at(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Zv={value:()=>{}};function ds(){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 fs(n)}function fs(e){this._=e}function jv(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}})}fs.prototype=ds.prototype={constructor:fs,on:function(e,t){var n=this._,r=jv(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Uv(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]=zc(n[o],e.name,t);else if(t==null)for(o in n)n[o]=zc(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 fs(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 Uv(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function zc(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Zv,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ll="http://www.w3.org/1999/xhtml";const Rc={svg:"http://www.w3.org/2000/svg",xhtml:ll,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function hs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Rc.hasOwnProperty(t)?{space:Rc[t],local:e}:e}function Gv(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ll&&t.documentElement.namespaceURI===ll?t.createElement(e):t.createElementNS(n,e)}}function Jv(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Bc(e){var t=hs(e);return(t.local?Jv:Gv)(t)}function Qv(){}function ul(e){return e==null?Qv:function(){return this.querySelector(e)}}function e0(e){typeof e!="function"&&(e=ul(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 on(r,this._parents)}function t0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function n0(){return[]}function qc(e){return e==null?n0:function(){return this.querySelectorAll(e)}}function r0(e){return function(){return t0(e.apply(this,arguments))}}function o0(e){typeof e=="function"?e=r0(e):e=qc(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 on(r,o)}function Fc(e){return function(){return this.matches(e)}}function Yc(e){return function(t){return t.matches(e)}}var i0=Array.prototype.find;function s0(e){return function(){return i0.call(this.children,e)}}function a0(){return this.firstElementChild}function l0(e){return this.select(e==null?a0:s0(typeof e=="function"?e:Yc(e)))}var u0=Array.prototype.filter;function c0(){return Array.from(this.children)}function d0(e){return function(){return u0.call(this.children,e)}}function f0(e){return this.selectAll(e==null?c0:d0(typeof e=="function"?e:Yc(e)))}function h0(e){typeof e!="function"&&(e=Fc(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 on(r,this._parents)}function Wc(e){return new Array(e.length)}function g0(){return new on(this._enter||this._groups.map(Wc),this._parents)}function gs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}gs.prototype={constructor:gs,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 v0(e){return function(){return e}}function p0(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 gs(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function m0(e,t,n,r,o,i,s){var a,l,c=new Map,u=t.length,h=i.length,f=new Array(u),g;for(a=0;a<u;++a)(l=t[a])&&(f[a]=g=s.call(l,l.__data__,a,t)+"",c.has(g)?o[a]=l:c.set(g,l));for(a=0;a<h;++a)g=s.call(e,i[a],a,i)+"",(l=c.get(g))?(r[a]=l,l.__data__=i[a],c.delete(g)):n[a]=new gs(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(f[a])===l&&(o[a]=l)}function y0(e){return e.__data__}function w0(e,t){if(!arguments.length)return Array.from(this,y0);var n=t?m0:p0,r=this._parents,o=this._groups;typeof e!="function"&&(e=v0(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],h=o[c],f=h.length,g=_0(e.call(u,u&&u.__data__,c,r)),v=g.length,b=a[c]=new Array(v),C=s[c]=new Array(v),x=l[c]=new Array(f);n(u,h,b,C,x,g,t);for(var p=0,_=0,m,S;p<v;++p)if(m=b[p]){for(p>=_&&(_=p+1);!(S=C[_])&&++_<v;);m._next=S||null}}return s=new on(s,r),s._enter=a,s._exit=l,s}function _0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function b0(){return new on(this._exit||this._groups.map(Wc),this._parents)}function x0(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 C0(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],h=c.length,f=a[l]=new Array(h),g,v=0;v<h;++v)(g=c[v]||u[v])&&(f[v]=g);for(;l<o;++l)a[l]=n[l];return new on(a,this._parents)}function $0(){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 E0(e){e||(e=S0);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!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 on(o,this._parents).order()}function S0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function k0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function P0(){return Array.from(this)}function N0(){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 T0(){let e=0;for(const t of this)++e;return e}function M0(){return!this.node()}function O0(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 H0(e){return function(){this.removeAttribute(e)}}function A0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function D0(e,t){return function(){this.setAttribute(e,t)}}function V0(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function I0(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function L0(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 z0(e,t){var n=hs(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?A0:H0:typeof t=="function"?n.local?L0:I0:n.local?V0:D0)(n,t))}function Kc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function R0(e){return function(){this.style.removeProperty(e)}}function B0(e,t,n){return function(){this.style.setProperty(e,t,n)}}function q0(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function F0(e,t,n){return arguments.length>1?this.each((t==null?R0:typeof t=="function"?q0:B0)(e,t,n??"")):vo(this.node(),e)}function vo(e,t){return e.style.getPropertyValue(t)||Kc(e).getComputedStyle(e,null).getPropertyValue(t)}function Y0(e){return function(){delete this[e]}}function W0(e,t){return function(){this[e]=t}}function K0(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function X0(e,t){return arguments.length>1?this.each((t==null?Y0:typeof t=="function"?K0:W0)(e,t)):this.node()[e]}function Xc(e){return e.trim().split(/^|\s+/)}function cl(e){return e.classList||new Zc(e)}function Zc(e){this._node=e,this._names=Xc(e.getAttribute("class")||"")}Zc.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 jc(e,t){for(var n=cl(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Uc(e,t){for(var n=cl(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Z0(e){return function(){jc(this,e)}}function j0(e){return function(){Uc(this,e)}}function U0(e,t){return function(){(t.apply(this,arguments)?jc:Uc)(this,e)}}function G0(e,t){var n=Xc(e+"");if(arguments.length<2){for(var r=cl(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?U0:t?Z0:j0)(n,t))}function J0(){this.textContent=""}function Q0(e){return function(){this.textContent=e}}function ep(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function tp(e){return arguments.length?this.each(e==null?J0:(typeof e=="function"?ep:Q0)(e)):this.node().textContent}function np(){this.innerHTML=""}function rp(e){return function(){this.innerHTML=e}}function op(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function ip(e){return arguments.length?this.each(e==null?np:(typeof e=="function"?op:rp)(e)):this.node().innerHTML}function sp(){this.nextSibling&&this.parentNode.appendChild(this)}function ap(){return this.each(sp)}function lp(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function up(){return this.each(lp)}function cp(e){var t=typeof e=="function"?e:Bc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function dp(){return null}function fp(e,t){var n=typeof e=="function"?e:Bc(e),r=t==null?dp:typeof t=="function"?t:ul(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function hp(){var e=this.parentNode;e&&e.removeChild(this)}function gp(){return this.each(hp)}function vp(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function pp(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function mp(e){return this.select(e?pp:vp)}function yp(e){return arguments.length?this.property("__data__",e):this.node().__data__}function wp(e){return function(t){e.call(this,t,this.__data__)}}function _p(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 bp(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 xp(e,t,n){return function(){var r=this.__on,o,i=wp(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 Cp(e,t,n){var r=_p(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?xp:bp,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function Gc(e,t,n){var r=Kc(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 $p(e,t){return function(){return Gc(this,e,t)}}function Ep(e,t){return function(){return Gc(this,e,t.apply(this,arguments))}}function Sp(e,t){return this.each((typeof t=="function"?Ep:$p)(e,t))}function*kp(){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 Jc=[null];function on(e,t){this._groups=e,this._parents=t}function ri(){return new on([[document.documentElement]],Jc)}function Pp(){return this}on.prototype=ri.prototype={constructor:on,select:e0,selectAll:o0,selectChild:l0,selectChildren:f0,filter:h0,data:w0,enter:g0,exit:b0,join:x0,merge:C0,selection:Pp,order:$0,sort:E0,call:k0,nodes:P0,node:N0,size:T0,empty:M0,each:O0,attr:z0,style:F0,property:X0,classed:G0,text:tp,html:ip,raise:ap,lower:up,append:cp,insert:fp,remove:gp,clone:mp,datum:yp,on:Cp,dispatch:Sp,[Symbol.iterator]:kp};function pn(e){return typeof e=="string"?new on([[document.querySelector(e)]],[document.documentElement]):new on([[e]],Jc)}function Np(e){let t;for(;t=e.sourceEvent;)e=t;return e}function $n(e,t){if(e=Np(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 Tp={passive:!1},oi={capture:!0,passive:!1};function dl(e){e.stopImmediatePropagation()}function po(e){e.preventDefault(),e.stopImmediatePropagation()}function Qc(e){var t=e.document.documentElement,n=pn(e).on("dragstart.drag",po,oi);"onselectstart"in t?n.on("selectstart.drag",po,oi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ed(e,t){var n=e.document.documentElement,r=pn(e).on("dragstart.drag",null);t&&(r.on("click.drag",po,oi),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 vs=e=>()=>e;function fl(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}})}fl.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Mp(e){return!e.ctrlKey&&!e.button}function Op(){return this.parentNode}function Hp(e,t){return t??{x:e.x,y:e.y}}function Ap(){return navigator.maxTouchPoints||"ontouchstart"in this}function Dp(){var e=Mp,t=Op,n=Hp,r=Ap,o={},i=ds("start","drag","end"),s=0,a,l,c,u,h=0;function f(m){m.on("mousedown.drag",g).filter(r).on("touchstart.drag",C).on("touchmove.drag",x,Tp).on("touchend.drag touchcancel.drag",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(m,S){if(!(u||!e.call(this,m,S))){var N=_(this,t.call(this,m,S),m,S,"mouse");N&&(pn(m.view).on("mousemove.drag",v,oi).on("mouseup.drag",b,oi),Qc(m.view),dl(m),c=!1,a=m.clientX,l=m.clientY,N("start",m))}}function v(m){if(po(m),!c){var S=m.clientX-a,N=m.clientY-l;c=S*S+N*N>h}o.mouse("drag",m)}function b(m){pn(m.view).on("mousemove.drag mouseup.drag",null),ed(m.view,c),po(m),o.mouse("end",m)}function C(m,S){if(e.call(this,m,S)){var N=m.changedTouches,P=t.call(this,m,S),D=N.length,I,A;for(I=0;I<D;++I)(A=_(this,P,m,S,N[I].identifier,N[I]))&&(dl(m),A("start",m,N[I]))}}function x(m){var S=m.changedTouches,N=S.length,P,D;for(P=0;P<N;++P)(D=o[S[P].identifier])&&(po(m),D("drag",m,S[P]))}function p(m){var S=m.changedTouches,N=S.length,P,D;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),P=0;P<N;++P)(D=o[S[P].identifier])&&(dl(m),D("end",m,S[P]))}function _(m,S,N,P,D,I){var A=i.copy(),V=$n(I||N,S),L,R,E;if((E=n.call(m,new fl("beforestart",{sourceEvent:N,target:f,identifier:D,active:s,x:V[0],y:V[1],dx:0,dy:0,dispatch:A}),P))!=null)return L=E.x-V[0]||0,R=E.y-V[1]||0,function $(k,T,M){var O=V,z;switch(k){case"start":o[D]=$,z=s++;break;case"end":delete o[D],--s;case"drag":V=$n(M||T,S),z=s;break}A.call(k,m,new fl(k,{sourceEvent:T,subject:E,target:f,identifier:D,active:z,x:V[0]+L,y:V[1]+R,dx:V[0]-O[0],dy:V[1]-O[1],dispatch:A}),P)}}return f.filter=function(m){return arguments.length?(e=typeof m=="function"?m:vs(!!m),f):e},f.container=function(m){return arguments.length?(t=typeof m=="function"?m:vs(m),f):t},f.subject=function(m){return arguments.length?(n=typeof m=="function"?m:vs(m),f):n},f.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:vs(!!m),f):r},f.on=function(){var m=i.on.apply(i,arguments);return m===i?f:m},f.clickDistance=function(m){return arguments.length?(h=(m=+m)*m,f):Math.sqrt(h)},f}function hl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function td(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ii(){}var si=.7,ps=1/si,mo="\\s*([+-]?\\d+)\\s*",ai="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Vp=/^#([0-9a-f]{3,8})$/,Ip=new RegExp(`^rgb\\(${mo},${mo},${mo}\\)$`),Lp=new RegExp(`^rgb\\(${zn},${zn},${zn}\\)$`),zp=new RegExp(`^rgba\\(${mo},${mo},${mo},${ai}\\)$`),Rp=new RegExp(`^rgba\\(${zn},${zn},${zn},${ai}\\)$`),Bp=new RegExp(`^hsl\\(${ai},${zn},${zn}\\)$`),qp=new RegExp(`^hsla\\(${ai},${zn},${zn},${ai}\\)$`),nd={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};hl(ii,li,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:rd,formatHex:rd,formatHex8:Fp,formatHsl:Yp,formatRgb:od,toString:od});function rd(){return this.rgb().formatHex()}function Fp(){return this.rgb().formatHex8()}function Yp(){return ud(this).formatHsl()}function od(){return this.rgb().formatRgb()}function li(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Vp.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?id(t):n===3?new Ut(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ms(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ms(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=Ip.exec(e))?new Ut(t[1],t[2],t[3],1):(t=Lp.exec(e))?new Ut(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=zp.exec(e))?ms(t[1],t[2],t[3],t[4]):(t=Rp.exec(e))?ms(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Bp.exec(e))?ld(t[1],t[2]/100,t[3]/100,1):(t=qp.exec(e))?ld(t[1],t[2]/100,t[3]/100,t[4]):nd.hasOwnProperty(e)?id(nd[e]):e==="transparent"?new Ut(NaN,NaN,NaN,0):null}function id(e){return new Ut(e>>16&255,e>>8&255,e&255,1)}function ms(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ut(e,t,n,r)}function Wp(e){return e instanceof ii||(e=li(e)),e?(e=e.rgb(),new Ut(e.r,e.g,e.b,e.opacity)):new Ut}function gl(e,t,n,r){return arguments.length===1?Wp(e):new Ut(e,t,n,r??1)}function Ut(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}hl(Ut,gl,td(ii,{brighter(e){return e=e==null?ps:Math.pow(ps,e),new Ut(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?si:Math.pow(si,e),new Ut(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ut(Rr(this.r),Rr(this.g),Rr(this.b),ys(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:sd,formatHex:sd,formatHex8:Kp,formatRgb:ad,toString:ad}));function sd(){return`#${Br(this.r)}${Br(this.g)}${Br(this.b)}`}function Kp(){return`#${Br(this.r)}${Br(this.g)}${Br(this.b)}${Br((isNaN(this.opacity)?1:this.opacity)*255)}`}function ad(){const e=ys(this.opacity);return`${e===1?"rgb(":"rgba("}${Rr(this.r)}, ${Rr(this.g)}, ${Rr(this.b)}${e===1?")":`, ${e})`}`}function ys(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Br(e){return e=Rr(e),(e<16?"0":"")+e.toString(16)}function ld(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new En(e,t,n,r)}function ud(e){if(e instanceof En)return new En(e.h,e.s,e.l,e.opacity);if(e instanceof ii||(e=li(e)),!e)return new En;if(e instanceof En)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 En(s,a,l,e.opacity)}function Xp(e,t,n,r){return arguments.length===1?ud(e):new En(e,t,n,r??1)}function En(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}hl(En,Xp,td(ii,{brighter(e){return e=e==null?ps:Math.pow(ps,e),new En(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?si:Math.pow(si,e),new En(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 Ut(vl(e>=240?e-240:e+120,o,r),vl(e,o,r),vl(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new En(cd(this.h),ws(this.s),ws(this.l),ys(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=ys(this.opacity);return`${e===1?"hsl(":"hsla("}${cd(this.h)}, ${ws(this.s)*100}%, ${ws(this.l)*100}%${e===1?")":`, ${e})`}`}}));function cd(e){return e=(e||0)%360,e<0?e+360:e}function ws(e){return Math.max(0,Math.min(1,e||0))}function vl(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 dd=e=>()=>e;function Zp(e,t){return function(n){return e+n*t}}function jp(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 Up(e){return(e=+e)==1?fd:function(t,n){return n-t?jp(t,n,e):dd(isNaN(t)?n:t)}}function fd(e,t){var n=t-e;return n?Zp(e,n):dd(isNaN(e)?t:e)}const hd=function e(t){var n=Up(t);function r(o,i){var s=n((o=gl(o)).r,(i=gl(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),c=fd(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 pr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var pl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ml=new RegExp(pl.source,"g");function Gp(e){return function(){return e}}function Jp(e){return function(t){return e(t)+""}}function Qp(e,t){var n=pl.lastIndex=ml.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=pl.exec(e))&&(o=ml.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:pr(r,o)})),n=ml.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?Jp(l[0].x):Gp(t):(t=l.length,function(c){for(var u=0,h;u<t;++u)a[(h=l[u]).i]=h.x(c);return a.join("")})}var gd=180/Math.PI,yl={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vd(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)*gd,skewX:Math.atan(l)*gd,scaleX:s,scaleY:a}}var _s;function e2(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?yl:vd(t.a,t.b,t.c,t.d,t.e,t.f)}function t2(e){return e==null||(_s||(_s=document.createElementNS("http://www.w3.org/2000/svg","g")),_s.setAttribute("transform",e),!(e=_s.transform.baseVal.consolidate()))?yl:(e=e.matrix,vd(e.a,e.b,e.c,e.d,e.e,e.f))}function pd(e,t,n,r){function o(c){return c.length?c.pop()+" ":""}function i(c,u,h,f,g,v){if(c!==h||u!==f){var b=g.push("translate(",null,t,null,n);v.push({i:b-4,x:pr(c,h)},{i:b-2,x:pr(u,f)})}else(h||f)&&g.push("translate("+h+t+f+n)}function s(c,u,h,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:h.push(o(h)+"rotate(",null,r)-2,x:pr(c,u)})):u&&h.push(o(h)+"rotate("+u+r)}function a(c,u,h,f){c!==u?f.push({i:h.push(o(h)+"skewX(",null,r)-2,x:pr(c,u)}):u&&h.push(o(h)+"skewX("+u+r)}function l(c,u,h,f,g,v){if(c!==h||u!==f){var b=g.push(o(g)+"scale(",null,",",null,")");v.push({i:b-4,x:pr(c,h)},{i:b-2,x:pr(u,f)})}else(h!==1||f!==1)&&g.push(o(g)+"scale("+h+","+f+")")}return function(c,u){var h=[],f=[];return c=e(c),u=e(u),i(c.translateX,c.translateY,u.translateX,u.translateY,h,f),s(c.rotate,u.rotate,h,f),a(c.skewX,u.skewX,h,f),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,h,f),c=u=null,function(g){for(var v=-1,b=f.length,C;++v<b;)h[(C=f[v]).i]=C.x(g);return h.join("")}}}var n2=pd(e2,"px, ","px)","deg)"),r2=pd(t2,", ",")",")"),o2=1e-12;function md(e){return((e=Math.exp(e))+1/e)/2}function i2(e){return((e=Math.exp(e))-1/e)/2}function s2(e){return((e=Math.exp(2*e))-1)/(e+1)}const a2=function e(t,n,r){function o(i,s){var a=i[0],l=i[1],c=i[2],u=s[0],h=s[1],f=s[2],g=u-a,v=h-l,b=g*g+v*v,C,x;if(b<o2)x=Math.log(f/c)/t,C=function(P){return[a+P*g,l+P*v,c*Math.exp(t*P*x)]};else{var p=Math.sqrt(b),_=(f*f-c*c+r*b)/(2*c*n*p),m=(f*f-c*c-r*b)/(2*f*n*p),S=Math.log(Math.sqrt(_*_+1)-_),N=Math.log(Math.sqrt(m*m+1)-m);x=(N-S)/t,C=function(P){var D=P*x,I=md(S),A=c/(n*p)*(I*s2(t*D+S)-i2(S));return[a+A*g,l+A*v,c*I/md(t*D+S)]}}return C.duration=x*1e3*t/Math.SQRT2,C}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},o}(Math.SQRT2,2,4);var yo=0,ui=0,ci=0,yd=1e3,bs,di,xs=0,qr=0,Cs=0,fi=typeof performance=="object"&&performance.now?performance:Date,wd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function wl(){return qr||(wd(l2),qr=fi.now()+Cs)}function l2(){qr=0}function $s(){this._call=this._time=this._next=null}$s.prototype=_d.prototype={constructor:$s,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?wl():+n)+(t==null?0:+t),!this._next&&di!==this&&(di?di._next=this:bs=this,di=this),this._call=e,this._time=n,_l()},stop:function(){this._call&&(this._call=null,this._time=1/0,_l())}};function _d(e,t,n){var r=new $s;return r.restart(e,t,n),r}function u2(){wl(),++yo;for(var e=bs,t;e;)(t=qr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--yo}function bd(){qr=(xs=fi.now())+Cs,yo=ui=0;try{u2()}finally{yo=0,d2(),qr=0}}function c2(){var e=fi.now(),t=e-xs;t>yd&&(Cs-=t,xs=e)}function d2(){for(var e,t=bs,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:bs=n);di=e,_l(r)}function _l(e){if(!yo){ui&&(ui=clearTimeout(ui));var t=e-qr;t>24?(e<1/0&&(ui=setTimeout(bd,e-fi.now()-Cs)),ci&&(ci=clearInterval(ci))):(ci||(xs=fi.now(),ci=setInterval(c2,yd)),yo=1,wd(bd))}}function xd(e,t,n){var r=new $s;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var f2=ds("start","end","cancel","interrupt"),h2=[],Cd=0,$d=1,bl=2,Es=3,Ed=4,xl=5,Ss=6;function ks(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;g2(e,n,{name:t,index:r,group:o,on:f2,tween:h2,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Cd})}function Cl(e,t){var n=Sn(e,t);if(n.state>Cd)throw new Error("too late; already scheduled");return n}function Rn(e,t){var n=Sn(e,t);if(n.state>Es)throw new Error("too late; already running");return n}function Sn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function g2(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=_d(i,0,n.time);function i(c){n.state=$d,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,h,f,g;if(n.state!==$d)return l();for(u in r)if(g=r[u],g.name===n.name){if(g.state===Es)return xd(s);g.state===Ed?(g.state=Ss,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[u]):+u<t&&(g.state=Ss,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[u])}if(xd(function(){n.state===Es&&(n.state=Ed,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=bl,n.on.call("start",e,e.__data__,n.index,n.group),n.state===bl){for(n.state=Es,o=new Array(f=n.tween.length),u=0,h=-1;u<f;++u)(g=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(o[++h]=g);o.length=h+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=xl,1),h=-1,f=o.length;++h<f;)o[h].call(e,u);n.state===xl&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Ss,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Ps(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>bl&&r.state<xl,r.state=Ss,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function v2(e){return this.each(function(){Ps(this,e)})}function p2(e,t){var n,r;return function(){var o=Rn(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 m2(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Rn(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 y2(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Sn(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?p2:m2)(n,e,t))}function $l(e,t,n){var r=e._id;return e.each(function(){var o=Rn(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Sn(o,r).value[t]}}function Sd(e,t){var n;return(typeof t=="number"?pr:t instanceof li?hd:(n=li(t))?(t=n,hd):Qp)(e,t)}function w2(e){return function(){this.removeAttribute(e)}}function _2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function b2(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 x2(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 C2(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 $2(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 E2(e,t){var n=hs(e),r=n==="transform"?r2:Sd;return this.attrTween(e,typeof t=="function"?(n.local?$2:C2)(n,r,$l(this,"attr."+e,t)):t==null?(n.local?_2:w2)(n):(n.local?x2:b2)(n,r,t))}function S2(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function k2(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function P2(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&k2(e,i)),n}return o._value=t,o}function N2(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&S2(e,i)),n}return o._value=t,o}function T2(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=hs(e);return this.tween(n,(r.local?P2:N2)(r,t))}function M2(e,t){return function(){Cl(this,e).delay=+t.apply(this,arguments)}}function O2(e,t){return t=+t,function(){Cl(this,e).delay=t}}function H2(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?M2:O2)(t,e)):Sn(this.node(),t).delay}function A2(e,t){return function(){Rn(this,e).duration=+t.apply(this,arguments)}}function D2(e,t){return t=+t,function(){Rn(this,e).duration=t}}function V2(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?A2:D2)(t,e)):Sn(this.node(),t).duration}function I2(e,t){if(typeof t!="function")throw new Error;return function(){Rn(this,e).ease=t}}function L2(e){var t=this._id;return arguments.length?this.each(I2(t,e)):Sn(this.node(),t).ease}function z2(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Rn(this,e).ease=n}}function R2(e){if(typeof e!="function")throw new Error;return this.each(z2(this._id,e))}function B2(e){typeof e!="function"&&(e=Fc(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 Un(r,this._parents,this._name,this._id)}function q2(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,h=s[a]=new Array(u),f,g=0;g<u;++g)(f=l[g]||c[g])&&(h[g]=f);for(;a<r;++a)s[a]=t[a];return new Un(s,this._parents,this._name,this._id)}function F2(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 Y2(e,t,n){var r,o,i=F2(t)?Cl:Rn;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function W2(e,t){var n=this._id;return arguments.length<2?Sn(this.node(),n).on.on(e):this.each(Y2(n,e,t))}function K2(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function X2(){return this.on("end.remove",K2(this._id))}function Z2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ul(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,h,f=0;f<l;++f)(u=a[f])&&(h=e.call(u,u.__data__,f,a))&&("__data__"in u&&(h.__data__=u.__data__),c[f]=h,ks(c[f],t,n,f,c,Sn(u,n)));return new Un(i,this._parents,t,n)}function j2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qc(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,h=0;h<c;++h)if(u=l[h]){for(var f=e.call(u,u.__data__,h,l),g,v=Sn(u,n),b=0,C=f.length;b<C;++b)(g=f[b])&&ks(g,t,n,b,f,v);i.push(f),s.push(u)}return new Un(i,s,t,n)}var U2=ri.prototype.constructor;function G2(){return new U2(this._groups,this._parents)}function J2(e,t){var n,r,o;return function(){var i=vo(this,e),s=(this.style.removeProperty(e),vo(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function kd(e){return function(){this.style.removeProperty(e)}}function Q2(e,t,n){var r,o=n+"",i;return function(){var s=vo(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function em(e,t,n){var r,o,i;return function(){var s=vo(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),vo(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function tm(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=Rn(this,e),c=l.on,u=l.value[i]==null?a||(a=kd(t)):void 0;(c!==n||o!==u)&&(r=(n=c).copy()).on(s,o=u),l.on=r}}function nm(e,t,n){var r=(e+="")=="transform"?n2:Sd;return t==null?this.styleTween(e,J2(e,r)).on("end.style."+e,kd(e)):typeof t=="function"?this.styleTween(e,em(e,r,$l(this,"style."+e,t))).each(tm(this._id,e)):this.styleTween(e,Q2(e,r,t),n).on("end.style."+e,null)}function rm(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function om(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&rm(e,s,n)),r}return i._value=t,i}function im(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,om(e,t,n??""))}function sm(e){return function(){this.textContent=e}}function am(e){return function(){var t=e(this);this.textContent=t??""}}function lm(e){return this.tween("text",typeof e=="function"?am($l(this,"text",e)):sm(e==null?"":e+""))}function um(e){return function(t){this.textContent=e.call(this,t)}}function cm(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&um(o)),t}return r._value=e,r}function dm(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,cm(e))}function fm(){for(var e=this._name,t=this._id,n=Pd(),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=Sn(l,t);ks(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Un(r,this._parents,e,n)}function hm(){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=Rn(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 gm=0;function Un(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Pd(){return++gm}var Gn=ri.prototype;Un.prototype={constructor:Un,select:Z2,selectAll:j2,selectChild:Gn.selectChild,selectChildren:Gn.selectChildren,filter:B2,merge:q2,selection:G2,transition:fm,call:Gn.call,nodes:Gn.nodes,node:Gn.node,size:Gn.size,empty:Gn.empty,each:Gn.each,on:W2,attr:E2,attrTween:T2,style:nm,styleTween:im,text:lm,textTween:dm,remove:X2,tween:y2,delay:H2,duration:V2,ease:L2,easeVarying:R2,end:hm,[Symbol.iterator]:Gn[Symbol.iterator]};function vm(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var pm={time:null,delay:0,duration:250,ease:vm};function mm(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 ym(e){var t,n;e instanceof Un?(t=e._id,e=e._name):(t=Pd(),(n=pm).time=wl(),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])&&ks(l,e,t,c,s,n||mm(l,t));return new Un(r,this._parents,e,t)}ri.prototype.interrupt=v2,ri.prototype.transition=ym;const Ns=e=>()=>e;function wm(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 Jn(e,t,n){this.k=e,this.x=t,this.y=n}Jn.prototype={constructor:Jn,scale:function(e){return e===1?this:new Jn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Jn(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 Ts=new Jn(1,0,0);Nd.prototype=Jn.prototype;function Nd(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ts;return e.__zoom}function El(e){e.stopImmediatePropagation()}function hi(e){e.preventDefault(),e.stopImmediatePropagation()}function _m(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function bm(){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 Td(){return this.__zoom||Ts}function xm(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Cm(){return navigator.maxTouchPoints||"ontouchstart"in this}function $m(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 Md(){var e=_m,t=bm,n=$m,r=xm,o=Cm,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=a2,c=ds("start","zoom","end"),u,h,f,g=500,v=150,b=0,C=10;function x(E){E.property("__zoom",Td).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",A).filter(o).on("touchstart.zoom",V).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",R).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(E,$,k,T){var M=E.selection?E.selection():E;M.property("__zoom",Td),E!==M?S(E,$,k,T):M.interrupt().each(function(){N(this,arguments).event(T).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},x.scaleBy=function(E,$,k,T){x.scaleTo(E,function(){var M=this.__zoom.k,O=typeof $=="function"?$.apply(this,arguments):$;return M*O},k,T)},x.scaleTo=function(E,$,k,T){x.transform(E,function(){var M=t.apply(this,arguments),O=this.__zoom,z=k==null?m(M):typeof k=="function"?k.apply(this,arguments):k,j=O.invert(z),X=typeof $=="function"?$.apply(this,arguments):$;return n(_(p(O,X),z,j),M,s)},k,T)},x.translateBy=function(E,$,k,T){x.transform(E,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),s)},null,T)},x.translateTo=function(E,$,k,T,M){x.transform(E,function(){var O=t.apply(this,arguments),z=this.__zoom,j=T==null?m(O):typeof T=="function"?T.apply(this,arguments):T;return n(Ts.translate(j[0],j[1]).scale(z.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof k=="function"?-k.apply(this,arguments):-k),O,s)},T,M)};function p(E,$){return $=Math.max(i[0],Math.min(i[1],$)),$===E.k?E:new Jn($,E.x,E.y)}function _(E,$,k){var T=$[0]-k[0]*E.k,M=$[1]-k[1]*E.k;return T===E.x&&M===E.y?E:new Jn(E.k,T,M)}function m(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function S(E,$,k,T){E.on("start.zoom",function(){N(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(T).end()}).tween("zoom",function(){var M=this,O=arguments,z=N(M,O).event(T),j=t.apply(M,O),X=k==null?m(j):typeof k=="function"?k.apply(M,O):k,ee=Math.max(j[1][0]-j[0][0],j[1][1]-j[0][1]),re=M.__zoom,Q=typeof $=="function"?$.apply(M,O):$,de=l(re.invert(X).concat(ee/re.k),Q.invert(X).concat(ee/Q.k));return function(ne){if(ne===1)ne=Q;else{var _e=de(ne),Ne=ee/_e[2];ne=new Jn(Ne,X[0]-_e[0]*Ne,X[1]-_e[1]*Ne)}z.zoom(null,ne)}})}function N(E,$,k){return!k&&E.__zooming||new P(E,$)}function P(E,$){this.that=E,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,$),this.taps=0}P.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,$){return this.mouse&&E!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var $=pn(this.that).datum();c.call(E,this.that,new wm(E,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:c}),$)}};function D(E,...$){if(!e.apply(this,arguments))return;var k=N(this,$).event(E),T=this.__zoom,M=Math.max(i[0],Math.min(i[1],T.k*Math.pow(2,r.apply(this,arguments)))),O=$n(E);if(k.wheel)(k.mouse[0][0]!==O[0]||k.mouse[0][1]!==O[1])&&(k.mouse[1]=T.invert(k.mouse[0]=O)),clearTimeout(k.wheel);else{if(T.k===M)return;k.mouse=[O,T.invert(O)],Ps(this),k.start()}hi(E),k.wheel=setTimeout(z,v),k.zoom("mouse",n(_(p(T,M),k.mouse[0],k.mouse[1]),k.extent,s));function z(){k.wheel=null,k.end()}}function I(E,...$){if(f||!e.apply(this,arguments))return;var k=E.currentTarget,T=N(this,$,!0).event(E),M=pn(E.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",ee,!0),O=$n(E,k),z=E.clientX,j=E.clientY;Qc(E.view),El(E),T.mouse=[O,this.__zoom.invert(O)],Ps(this),T.start();function X(re){if(hi(re),!T.moved){var Q=re.clientX-z,de=re.clientY-j;T.moved=Q*Q+de*de>b}T.event(re).zoom("mouse",n(_(T.that.__zoom,T.mouse[0]=$n(re,k),T.mouse[1]),T.extent,s))}function ee(re){M.on("mousemove.zoom mouseup.zoom",null),ed(re.view,T.moved),hi(re),T.event(re).end()}}function A(E,...$){if(e.apply(this,arguments)){var k=this.__zoom,T=$n(E.changedTouches?E.changedTouches[0]:E,this),M=k.invert(T),O=k.k*(E.shiftKey?.5:2),z=n(_(p(k,O),T,M),t.apply(this,$),s);hi(E),a>0?pn(this).transition().duration(a).call(S,z,T,E):pn(this).call(x.transform,z,T,E)}}function V(E,...$){if(e.apply(this,arguments)){var k=E.touches,T=k.length,M=N(this,$,E.changedTouches.length===T).event(E),O,z,j,X;for(El(E),z=0;z<T;++z)j=k[z],X=$n(j,this),X=[X,this.__zoom.invert(X),j.identifier],M.touch0?!M.touch1&&M.touch0[2]!==X[2]&&(M.touch1=X,M.taps=0):(M.touch0=X,O=!0,M.taps=1+!!u);u&&(u=clearTimeout(u)),O&&(M.taps<2&&(h=X[0],u=setTimeout(function(){u=null},g)),Ps(this),M.start())}}function L(E,...$){if(this.__zooming){var k=N(this,$).event(E),T=E.changedTouches,M=T.length,O,z,j,X;for(hi(E),O=0;O<M;++O)z=T[O],j=$n(z,this),k.touch0&&k.touch0[2]===z.identifier?k.touch0[0]=j:k.touch1&&k.touch1[2]===z.identifier&&(k.touch1[0]=j);if(z=k.that.__zoom,k.touch1){var ee=k.touch0[0],re=k.touch0[1],Q=k.touch1[0],de=k.touch1[1],ne=(ne=Q[0]-ee[0])*ne+(ne=Q[1]-ee[1])*ne,_e=(_e=de[0]-re[0])*_e+(_e=de[1]-re[1])*_e;z=p(z,Math.sqrt(ne/_e)),j=[(ee[0]+Q[0])/2,(ee[1]+Q[1])/2],X=[(re[0]+de[0])/2,(re[1]+de[1])/2]}else if(k.touch0)j=k.touch0[0],X=k.touch0[1];else return;k.zoom("touch",n(_(z,j,X),k.extent,s))}}function R(E,...$){if(this.__zooming){var k=N(this,$).event(E),T=E.changedTouches,M=T.length,O,z;for(El(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),O=0;O<M;++O)z=T[O],k.touch0&&k.touch0[2]===z.identifier?delete k.touch0:k.touch1&&k.touch1[2]===z.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(z=$n(z,this),Math.hypot(h[0]-z[0],h[1]-z[1])<C)){var j=pn(this).on("dblclick.zoom");j&&j.apply(this,arguments)}}}return x.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Ns(+E),x):r},x.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Ns(!!E),x):e},x.touchable=function(E){return arguments.length?(o=typeof E=="function"?E:Ns(!!E),x):o},x.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Ns([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),x):t},x.scaleExtent=function(E){return arguments.length?(i[0]=+E[0],i[1]=+E[1],x):[i[0],i[1]]},x.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],x):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},x.constrain=function(E){return arguments.length?(n=E,x):n},x.duration=function(E){return arguments.length?(a=+E,x):a},x.interpolate=function(E){return arguments.length?(l=E,x):l},x.on=function(){var E=c.on.apply(c,arguments);return E===c?x:E},x.clickDistance=function(E){return arguments.length?(b=(E=+E)*E,x):Math.sqrt(b)},x.tapDistance=function(E){return arguments.length?(C=+E,x):C},x}const wo={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."},Ms=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]];var Fr;(function(e){e.Strict="strict",e.Loose="loose"})(Fr||(Fr={}));var Qn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Qn||(Qn={}));var Os;(function(e){e.Partial="partial",e.Full="full"})(Os||(Os={}));const Sl={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var _o;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(_o||(_o={}));var Yr;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Yr||(Yr={}));var ke;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ke||(ke={}));const Od={[ke.Left]:ke.Right,[ke.Right]:ke.Left,[ke.Top]:ke.Bottom,[ke.Bottom]:ke.Top};function Em(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 Hd(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 Ad(e){return e===null?null:e?"valid":"invalid"}const Sm=e=>"id"in e&&"source"in e&&"target"in e,km=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),kl=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),gi=(e,t=[0,0])=>{const{width:n,height:r}=er(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},Pm=(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):kl(o)?o:t.nodeLookup.get(o.id));const a=s?Ds(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Hs(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return As(n)},vi=(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=Ds(r);n=Hs(n,o)}}),As(n)},Dd=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const a={...mi(t,[n,r,o]),width:t.width/o,height:t.height/o},l=[];for(const c of e.values()){const{measured:u,selectable:h=!0,hidden:f=!1}=c;if(s&&!h||f)continue;const g=u.width??c.width??c.initialWidth??null,v=u.height??c.height??c.initialHeight??null,b=pi(a,xo(c)),C=(g??0)*(v??0),x=i&&b>0;(!c.internals.handleBounds||x||b>=C||c.dragging)&&l.push(c)}return l},Pl=(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 Nm(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 Tm({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=Nm(e,s),l=vi(a),c=Ml(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 Mm({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 h=o;if(s.extent==="parent"&&!s.expandParent)if(!a)i==null||i("005",wo.error005());else{const g=a.measured.width,v=a.measured.height;g&&v&&(h=[[l,c],[l+g,c+v]])}else a&&$o(s.extent)&&(h=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);const f=$o(h)?Wr(t,h,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",wo.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 Vd({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 g=i.has(f.id),v=!g&&f.parentId&&s.find(b=>b.id===f.parentId);(g||v)&&s.push(f)}const a=new Set(t.map(f=>f.id)),l=r.filter(f=>f.deletable!==!1),u=Pl(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 h=await o({nodes:s,edges:u});return typeof h=="boolean"?h?{edges:u,nodes:s}:{edges:[],nodes:[]}:h}const bo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Wr=(e={x:0,y:0},t,n)=>({x:bo(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:bo(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Id(e,t,n){const{width:r,height:o}=er(n),{x:i,y:s}=n.internals.positionAbsolute;return Wr(e,[[i,s],[i+r,s+o]],t)}const Ld=(e,t,n)=>e<t?bo(Math.abs(e-t),1,t)/t:e>n?-bo(Math.abs(e-n),1,t)/t:0,zd=(e,t,n=15,r=40)=>{const o=Ld(e.x,r,t.width-r)*n,i=Ld(e.y,r,t.height-r)*n;return[o,i]},Hs=(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)}),Nl=({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}),xo=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=kl(e)?e.internals.positionAbsolute:gi(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}},Ds=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=kl(e)?e.internals.positionAbsolute:gi(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)}},Rd=(e,t)=>As(Hs(Nl(e),Nl(t))),pi=(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)},Bd=e=>Bn(e.width)&&Bn(e.height)&&Bn(e.x)&&Bn(e.y),Bn=e=>!isNaN(e)&&isFinite(e),Om=(e,t)=>{},Tl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),mi=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const a={x:(e-n)/o,y:(t-r)/o};return i?Tl(a,s):a},Vs=({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 Hm(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 Am(e,t,n,r,o,i){const{x:s,y:a}=Vs(e,[t,n,r]),{x:l,y:c}=Vs({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=o-l,h=i-c;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(h)}}const Ml=(e,t,n,r,o,i)=>{const s=Hm(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),u=bo(c,r,o),h=e.x+e.width/2,f=e.y+e.height/2,g=t/2-h*u,v=n/2-f*u,b=Am(e,g,v,u,t,n),C={left:Math.min(b.left-s.left,0),top:Math.min(b.top-s.top,0),right:Math.min(b.right-s.right,0),bottom:Math.min(b.bottom-s.bottom,0)};return{x:g-C.left+C.right,y:v-C.top+C.bottom,zoom:u}},Is=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function $o(e){return e!==void 0&&e!=="parent"}function er(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 Ls(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 Dm(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 Vm(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function Ol(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=tr(e),a=mi({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:l,y:c}=n?Tl(a,t):a;return{xSnapped:l,ySnapped:c,...a}}const qd=e=>({width:e.offsetWidth,height:e.offsetHeight}),Im=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Lm=["INPUT","SELECT","TEXTAREA"];function zm(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:Lm.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Fd=e=>"clientX"in e,tr=(e,t)=>{var i,s;const n=Fd(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)}},Yd=(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,...qd(s)}})};function Rm({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),h=Math.abs(c-t);return[l,c,u,h]}function zs(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Wd({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case ke.Left:return[t-zs(t-r,i),n];case ke.Right:return[t+zs(r-t,i),n];case ke.Top:return[t,n-zs(n-o,i)];case ke.Bottom:return[t,n+zs(o-n,i)]}}function Kd({sourceX:e,sourceY:t,sourcePosition:n=ke.Bottom,targetX:r,targetY:o,targetPosition:i=ke.Top,curvature:s=.25}){const[a,l]=Wd({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[c,u]=Wd({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[h,f,g,v]=Rm({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}`,h,f,g,v]}function Xd({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 Bm({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 qm({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=Hs(Ds(e),Ds(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 pi(s,As(i))>0}const Fm=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Ym=(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)),Wm=(e,t)=>{if(!e.source||!e.target)return t;let n;return Sm(e)?n={...e}:n={...e,id:Fm(e)},Ym(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Hl({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=Xd({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const Zd={[ke.Left]:{x:-1,y:0},[ke.Right]:{x:1,y:0},[ke.Top]:{x:0,y:-1},[ke.Bottom]:{x:0,y:1}},Km=({source:e,sourcePosition:t=ke.Bottom,target:n})=>t===ke.Left||t===ke.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},jd=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Xm({source:e,sourcePosition:t=ke.Bottom,target:n,targetPosition:r=ke.Top,center:o,offset:i}){const s=Zd[t],a=Zd[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=Km({source:l,sourcePosition:t,target:c}),h=u.x!==0?"x":"y",f=u[h];let g=[],v,b;const C={x:0,y:0},x={x:0,y:0},[p,_,m,S]=Xd({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[h]*a[h]===-1){v=o.x??p,b=o.y??_;const P=[{x:v,y:l.y},{x:v,y:c.y}],D=[{x:l.x,y:b},{x:c.x,y:b}];s[h]===f?g=h==="x"?P:D:g=h==="x"?D:P}else{const P=[{x:l.x,y:c.y}],D=[{x:c.x,y:l.y}];if(h==="x"?g=s.x===f?D:P:g=s.y===f?P:D,t===r){const R=Math.abs(e[h]-n[h]);if(R<=i){const E=Math.min(i-1,i-R);s[h]===f?C[h]=(l[h]>e[h]?-1:1)*E:x[h]=(c[h]>n[h]?-1:1)*E}}if(t!==r){const R=h==="x"?"y":"x",E=s[h]===a[R],$=l[R]>c[R],k=l[R]<c[R];(s[h]===1&&(!E&&$||E&&k)||s[h]!==1&&(!E&&k||E&&$))&&(g=h==="x"?P:D)}const I={x:l.x+C.x,y:l.y+C.y},A={x:c.x+x.x,y:c.y+x.y},V=Math.max(Math.abs(I.x-g[0].x),Math.abs(A.x-g[0].x)),L=Math.max(Math.abs(I.y-g[0].y),Math.abs(A.y-g[0].y));V>=L?(v=(I.x+A.x)/2,b=g[0].y):(v=g[0].x,b=(I.y+A.y)/2)}return[[e,{x:l.x+C.x,y:l.y+C.y},...g,{x:c.x+x.x,y:c.y+x.y},n],v,b,m,S]}function Zm(e,t,n,r){const o=Math.min(jd(e,t)/2,jd(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 Rs({sourceX:e,sourceY:t,sourcePosition:n=ke.Bottom,targetX:r,targetY:o,targetPosition:i=ke.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20}){const[u,h,f,g,v]=Xm({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:c});return[u.reduce((C,x,p)=>{let _="";return p>0&&p<u.length-1?_=Zm(u[p-1],x,u[p+1],s):_=`${p===0?"M":"L"}${x.x} ${x.y}`,C+=_,C},""),h,f,g,v]}function Ud(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function jm(e){var h;const{sourceNode:t,targetNode:n}=e;if(!Ud(t)||!Ud(n))return null;const r=t.internals.handleBounds||Gd(t.handles),o=n.internals.handleBounds||Gd(n.handles),i=Jd((r==null?void 0:r.source)??[],e.sourceHandle),s=Jd(e.connectionMode===Fr.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(h=e.onError)==null||h.call(e,"008",wo.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(i==null?void 0:i.position)||ke.Bottom,l=(s==null?void 0:s.position)||ke.Top,c=yi(t,i,a),u=yi(n,s,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:l}}function Gd(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 yi(e,t,n=ke.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??er(e);if(r)return{x:o+s/2,y:i+a/2};switch((t==null?void 0:t.position)??n){case ke.Top:return{x:o+s/2,y:i};case ke.Right:return{x:o+s,y:i+a/2};case ke.Bottom:return{x:o+s/2,y:i+a};case ke.Left:return{x:o,y:i+a/2}}}function Jd(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Al(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Um(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=Al(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 Gm(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 ke.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 ke.Bottom:s[1]=(e.y+e.height)*t.zoom+t.y+r,a[1]=0;break;case ke.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 Dl={nodeOrigin:[0,0],nodeExtent:Ms,elevateNodesOnSelect:!0,defaults:{}},Jm={...Dl,checkEquality:!0};function Vl(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Qm(e,t,n){const r=Vl(Dl,n);for(const o of e.values())if(o.parentId)Il(o,e,t,r);else{const i=gi(o,r.nodeOrigin),s=$o(o.extent)?o.extent:r.nodeExtent,a=Wr(i,s,er(o));o.internals.positionAbsolute=a}}function Qd(e,t,n,r){var l,c;const o=Vl(Jm,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 h=s.get(u.id);if(o.checkEquality&&u===(h==null?void 0:h.internals.userNode))t.set(u.id,h);else{const f=gi(u,o.nodeOrigin),g=$o(u.extent)?u.extent:o.nodeExtent,v=Wr(f,g,er(u));h={...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?h==null?void 0:h.internals.handleBounds:void 0,z:ef(u,a),userNode:u}},t.set(u.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(i=!1),u.parentId&&Il(h,t,n,r)}return i}function ey(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 Il(e,t,n,r){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:s}=Vl(Dl,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}ey(e,n);const c=o?1e3:0,{x:u,y:h,z:f}=ty(e,l,i,s,c),{positionAbsolute:g}=e.internals,v=u!==g.x||h!==g.y;(v||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:u,y:h}:g,z:f}})}function ef(e,t){return(Bn(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function ty(e,t,n,r,o){const{x:i,y:s}=t.internals.positionAbsolute,a=er(e),l=gi(e,n),c=$o(e.extent)?Wr(l,e.extent,a):l;let u=Wr({x:i+c.x,y:s+c.y},r,a);e.extent==="parent"&&(u=Id(u,a,t));const h=ef(e,o),f=t.internals.z??0;return{x:u.x,y:u.y,z:f>h?f:h}}function ny(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)??xo(l),u=Rd(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,h=er(l),f=l.origin??r,g=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(h.width,Math.round(a.width)),C=Math.max(h.height,Math.round(a.height)),x=(b-h.width)*f[0],p=(C-h.height)*f[1];(g>0||v>0||x||p)&&(o.push({id:c,type:"position",position:{x:l.position.x-g+x,y:l.position.y-v+p}}),(_=n.get(c))==null||_.forEach(m=>{e.some(S=>S.id===m.id)||o.push({id:m.id,type:"position",position:{x:m.position.x+g,y:m.position.y+v}})})),(h.width<a.width||h.height<a.height||g||v)&&o.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:b+(g?f[0]*g-x:0),height:C+(v?f[1]*v-p:0)}})}),o}function ry(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),h=[];for(const f of e.values()){const g=t.get(f.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),a=!0;continue}const v=qd(f.nodeElement),b=g.measured.width!==v.width||g.measured.height!==v.height;if(!!(v.width&&v.height&&(b||!g.internals.handleBounds||f.force))){const x=f.nodeElement.getBoundingClientRect(),p=$o(g.extent)?g.extent:i;let{positionAbsolute:_}=g.internals;g.parentId&&g.extent==="parent"?_=Id(_,v,t.get(g.parentId)):p&&(_=Wr(_,p,v));const m={...g,measured:v,internals:{...g.internals,positionAbsolute:_,handleBounds:{source:Yd("source",f.nodeElement,x,u,g.id),target:Yd("target",f.nodeElement,x,u,g.id)}}};t.set(g.id,m),g.parentId&&Il(m,t,n,{nodeOrigin:o}),a=!0,b&&(l.push({id:g.id,type:"dimensions",dimensions:v}),g.expandParent&&g.parentId&&h.push({id:g.id,parentId:g.parentId,rect:xo(m,o)}))}}if(h.length>0){const f=ny(h,t,n,o);l.push(...f)}return{changes:l,updatedInternals:a}}async function oy({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 tf(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 nf(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}`;tf("source",l,u,e,o,s),tf("target",l,c,e,i,a),t.set(r.id,r)}}function iy(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 rf(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:rf(n,t):!1}function of(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 sy(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!rf(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 Ll({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,a,l;const o=[];for(const[c,u]of t){const h=(s=n.get(c))==null?void 0:s.internals.userNode;h&&o.push({...h,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 ay({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,h=!1,f=null,g=!1;function v({noDragClassName:C,handleSelector:x,domNode:p,isSelectable:_,nodeId:m,nodeClickDistance:S=0}){f=pn(p);function N({x:A,y:V},L){const{nodeLookup:R,nodeExtent:E,snapGrid:$,snapToGrid:k,nodeOrigin:T,onNodeDrag:M,onSelectionDrag:O,onError:z,updateNodePositions:j}=t();i={x:A,y:V};let X=!1,ee={x:0,y:0,x2:0,y2:0};if(a.size>1&&E){const re=vi(a);ee=Nl(re)}for(const[re,Q]of a){if(!R.has(re))continue;let de={x:A-Q.distance.x,y:V-Q.distance.y};k&&(de=Tl(de,$));let ne=[[E[0][0],E[0][1]],[E[1][0],E[1][1]]];if(a.size>1&&E&&!Q.extent){const{positionAbsolute:Ae}=Q.internals,le=Ae.x-ee.x+E[0][0],pe=Ae.x+Q.measured.width-ee.x2+E[1][0],se=Ae.y-ee.y+E[0][1],U=Ae.y+Q.measured.height-ee.y2+E[1][1];ne=[[le,se],[pe,U]]}const{position:_e,positionAbsolute:Ne}=Mm({nodeId:re,nextPosition:de,nodeLookup:R,nodeExtent:ne,nodeOrigin:T,onError:z});X=X||Q.position.x!==_e.x||Q.position.y!==_e.y,Q.position=_e,Q.internals.positionAbsolute=Ne}if(X&&(j(a,!0),L&&(r||M||!m&&O))){const[re,Q]=Ll({nodeId:m,dragItems:a,nodeLookup:R});r==null||r(L,a,re,Q),M==null||M(L,re,Q),m||O==null||O(L,Q)}}async function P(){if(!u)return;const{transform:A,panBy:V,autoPanSpeed:L,autoPanOnNodeDrag:R}=t();if(!R){l=!1,cancelAnimationFrame(s);return}const[E,$]=zd(c,u,L);(E!==0||$!==0)&&(i.x=(i.x??0)-E/A[2],i.y=(i.y??0)-$/A[2],await V({x:E,y:$})&&N(i,null)),s=requestAnimationFrame(P)}function D(A){var X;const{nodeLookup:V,multiSelectionActive:L,nodesDraggable:R,transform:E,snapGrid:$,snapToGrid:k,selectNodesOnDrag:T,onNodeDragStart:M,onSelectionDragStart:O,unselectNodesAndEdges:z}=t();h=!0,(!T||!_)&&!L&&m&&((X=V.get(m))!=null&&X.selected||z()),_&&T&&m&&(e==null||e(m));const j=Ol(A.sourceEvent,{transform:E,snapGrid:$,snapToGrid:k,containerBounds:u});if(i=j,a=sy(V,R,j,m),a.size>0&&(n||M||!m&&O)){const[ee,re]=Ll({nodeId:m,dragItems:a,nodeLookup:V});n==null||n(A.sourceEvent,a,ee,re),M==null||M(A.sourceEvent,ee,re),m||O==null||O(A.sourceEvent,re)}}const I=Dp().clickDistance(S).on("start",A=>{const{domNode:V,nodeDragThreshold:L,transform:R,snapGrid:E,snapToGrid:$}=t();u=(V==null?void 0:V.getBoundingClientRect())||null,g=!1,L===0&&D(A),i=Ol(A.sourceEvent,{transform:R,snapGrid:E,snapToGrid:$,containerBounds:u}),c=tr(A.sourceEvent,u)}).on("drag",A=>{const{autoPanOnNodeDrag:V,transform:L,snapGrid:R,snapToGrid:E,nodeDragThreshold:$,nodeLookup:k}=t(),T=Ol(A.sourceEvent,{transform:L,snapGrid:R,snapToGrid:E,containerBounds:u});if((A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||m&&!k.has(m))&&(g=!0),!g){if(!l&&V&&h&&(l=!0,P()),!h){const M=T.xSnapped-(i.x??0),O=T.ySnapped-(i.y??0);Math.sqrt(M*M+O*O)>$&&D(A)}(i.x!==T.xSnapped||i.y!==T.ySnapped)&&a&&h&&(c=tr(A.sourceEvent,u),N(T,A.sourceEvent))}}).on("end",A=>{if(!(!h||g)&&(l=!1,h=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:V,updateNodePositions:L,onNodeDragStop:R,onSelectionDragStop:E}=t();if(L(a,!1),o||R||!m&&E){const[$,k]=Ll({nodeId:m,dragItems:a,nodeLookup:V,dragging:!1});o==null||o(A.sourceEvent,a,$,k),R==null||R(A.sourceEvent,$,k),m||E==null||E(A.sourceEvent,k)}}}).filter(A=>{const V=A.target;return!A.button&&(!C||!of(V,`.${C}`,p))&&(!x||of(V,x,p))});f.call(I)}function b(){f==null||f.on(".drag",null)}return{update:v,destroy:b}}function ly(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())pi(o,xo(i))>0&&r.push(i);return r}const uy=250;function cy(e,t,n,r){var a,l;let o=[],i=1/0;const s=ly(e,n,t+uy);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 h of u){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;const{x:f,y:g}=yi(c,h,h.position,!0),v=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(g-e.y,2));v>t||(v<i?(o=[{...h,x:f,y:g}],i=v):v===i&&o.push({...h,x:f,y:g}))}}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 sf(e,t,n,r,o,i=!1){var c,u,h;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)??[],...((h=s.internals.handleBounds)==null?void 0:h.target)??[]],l=(n?a==null?void 0:a.find(f=>f.id===n):a==null?void 0:a[0])??null;return l&&i?{...l,...yi(s,l,l.position,!0)}:l}function af(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function dy(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const lf=()=>!0;function fy(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:h,panBy:f,cancelConnection:g,onConnectStart:v,onConnect:b,onConnectEnd:C,isValidConnection:x=lf,onReconnectEnd:p,updateConnection:_,getTransform:m,getFromHandle:S,autoPanSpeed:N}){const P=Im(e.target);let D=0,I;const{x:A,y:V}=tr(e),L=P==null?void 0:P.elementFromPoint(A,V),R=af(i,L),E=a==null?void 0:a.getBoundingClientRect();if(!E||!R)return;const $=sf(o,R,r,l,t);if(!$)return;let k=tr(e,E),T=!1,M=null,O=!1,z=null;function j(){if(!u||!E)return;const[Ne,Ae]=zd(k,E,N);f({x:Ne,y:Ae}),D=requestAnimationFrame(j)}const X={...$,nodeId:o,type:R,position:$.position},ee=l.get(o),Q={inProgress:!0,isValid:null,from:yi(ee,X,ke.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:ee,to:k,toHandle:null,toPosition:Od[X.position],toNode:null};_(Q);let de=Q;v==null||v(e,{nodeId:o,handleId:r,handleType:R});function ne(Ne){if(!S()||!X){_e(Ne);return}const Ae=m();k=tr(Ne,E),I=cy(mi(k,Ae,!1,[1,1]),n,l,X),T||(j(),T=!0);const le=uf(Ne,{handle:I,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:x,doc:P,lib:c,flowId:h,nodeLookup:l});z=le.handleDomNode,M=le.connection,O=dy(!!I,le.isValid);const pe={...de,isValid:O,to:I&&O?Vs({x:I.x,y:I.y},Ae):k,toHandle:le.toHandle,toPosition:O&&le.toHandle?le.toHandle.position:Od[X.position],toNode:le.toHandle?l.get(le.toHandle.nodeId):null};O&&I&&de.toHandle&&pe.toHandle&&de.toHandle.type===pe.toHandle.type&&de.toHandle.nodeId===pe.toHandle.nodeId&&de.toHandle.id===pe.toHandle.id&&de.to.x===pe.to.x&&de.to.y===pe.to.y||(_(pe),de=pe)}function _e(Ne){(I||z)&&M&&O&&(b==null||b(M));const{inProgress:Ae,...le}=de,pe={...le,toPosition:de.toHandle?de.toPosition:null};C==null||C(Ne,pe),i&&(p==null||p(Ne,pe)),g(),cancelAnimationFrame(D),T=!1,O=!1,M=null,z=null,P.removeEventListener("mousemove",ne),P.removeEventListener("mouseup",_e),P.removeEventListener("touchmove",ne),P.removeEventListener("touchend",_e)}P.addEventListener("mousemove",ne),P.addEventListener("mouseup",_e),P.addEventListener("touchmove",ne),P.addEventListener("touchend",_e)}function uf(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=lf,nodeLookup:u}){const h=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:g,y:v}=tr(e),b=s.elementFromPoint(g,v),C=b!=null&&b.classList.contains(`${a}-flow__handle`)?b:f,x={handleDomNode:C,isValid:!1,connection:null,toHandle:null};if(C){const p=af(void 0,C),_=C.getAttribute("data-nodeid"),m=C.getAttribute("data-handleid"),S=C.classList.contains("connectable"),N=C.classList.contains("connectableend");if(!_||!p)return x;const P={source:h?_:r,sourceHandle:h?m:o,target:h?r:_,targetHandle:h?o:m};x.connection=P;const I=S&&N&&(n===Fr.Strict?h&&p==="source"||!h&&p==="target":_!==r||m!==o);x.isValid=I&&c(P),x.toHandle=sf(_,p,m,u,n,!1)}return x}const hy={onPointerDown:fy,isValid:uf};function gy({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=pn(e);function i({translateExtent:a,width:l,height:c,zoomStep:u=10,pannable:h=!0,zoomable:f=!0,inversePan:g=!1}){const v=_=>{const m=n();if(_.sourceEvent.type!=="wheel"||!t)return;const S=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*u,N=m[2]*Math.pow(2,S);t.scaleTo(N)};let b=[0,0];const C=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(b=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},x=_=>{const m=n();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!t)return;const S=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],N=[S[0]-b[0],S[1]-b[1]];b=S;const P=r()*Math.max(m[2],Math.log(m[2]))*(g?-1:1),D={x:m[0]-N[0]*P,y:m[1]-N[1]*P},I=[[0,0],[l,c]];t.setViewportConstrained({x:D.x,y:D.y,zoom:m[2]},I,a)},p=Md().on("start",C).on("zoom",h?x:null).on("zoom.wheel",f?v:null);o.call(p,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:$n}}const vy=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Bs=e=>({x:e.x,y:e.y,zoom:e.k}),zl=({x:e,y:t,zoom:n})=>Ts.translate(e,t).scale(n),Eo=(e,t)=>e.target.closest(`.${t}`),cf=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Rl=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},df=e=>{const t=e.ctrlKey&&Is()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function py({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(Eo(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(u.ctrlKey&&s){const C=$n(u),x=df(u),p=h*Math.pow(2,x);r.scaleTo(n,p,C,u);return}const f=u.deltaMode===1?20:1;let g=o===Qn.Vertical?0:u.deltaX*f,v=o===Qn.Horizontal?0:u.deltaY*f;!Is()&&u.shiftKey&&o!==Qn.Vertical&&(g=u.deltaY*f,v=0),r.translateBy(n,-(g/h)*i,-(v/h)*i,{internal:!0});const b=Bs(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 my({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,a=Eo(r,e);if(r.ctrlKey&&i&&a&&r.preventDefault(),s||a)return null;r.preventDefault(),n.call(this,r,o)}}function yy({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,a;if((i=r.sourceEvent)!=null&&i.internal)return;const o=Bs(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 wy({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,a;e.usedRightMouseButton=!!(n&&cf(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,Bs(i.transform)))}}function _y({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&&cf(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o&&vy(e.prevViewport,s.transform))){const l=Bs(s.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,l)},n?150:0)}}}function by({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 h=e||t,f=n&&u.ctrlKey;if(u.button===1&&u.type==="mousedown"&&(Eo(u,`${c}-flow__node`)||Eo(u,`${c}-flow__edge`)))return!0;if(!r&&!h&&!o&&!i&&!n||s||Eo(u,a)&&u.type==="wheel"||Eo(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(!h&&!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 g=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||u.type==="wheel")&&g}}function xy({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},h=e.getBoundingClientRect(),f=Md().clickDistance(!Bn(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(o),g=pn(e).call(f);_({x:i.x,y:i.y,zoom:bo(i.zoom,t,n)},[[0,0],[h.width,h.height]],o);const v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");f.wheelDelta(df);function C(L,R){return g?new Promise(E=>{f==null||f.transform(Rl(g,R==null?void 0:R.duration,()=>E(!0)),L)}):Promise.resolve(!1)}function x({noWheelClassName:L,noPanClassName:R,onPaneContextMenu:E,userSelectionActive:$,panOnScroll:k,panOnDrag:T,panOnScrollMode:M,panOnScrollSpeed:O,preventScrolling:z,zoomOnPinch:j,zoomOnScroll:X,zoomOnDoubleClick:ee,zoomActivationKeyPressed:re,lib:Q,onTransformChange:de}){$&&!u.isZoomingOrPanning&&p();const _e=k&&!re&&!$?py({zoomPanValues:u,noWheelClassName:L,d3Selection:g,d3Zoom:f,panOnScrollMode:M,panOnScrollSpeed:O,zoomOnPinch:j,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):my({noWheelClassName:L,preventScrolling:z,d3ZoomHandler:v});if(g.on("wheel.zoom",_e,{passive:!1}),!$){const Ae=yy({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",Ae);const le=wy({zoomPanValues:u,panOnDrag:T,onPaneContextMenu:!!E,onPanZoom:s,onTransformChange:de});f.on("zoom",le);const pe=_y({zoomPanValues:u,panOnDrag:T,panOnScroll:k,onPaneContextMenu:E,onPanZoomEnd:l,onDraggingChange:c});f.on("end",pe)}const Ne=by({zoomActivationKeyPressed:re,panOnDrag:T,zoomOnScroll:X,panOnScroll:k,zoomOnDoubleClick:ee,zoomOnPinch:j,userSelectionActive:$,noPanClassName:R,noWheelClassName:L,lib:Q});f.filter(Ne),ee?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function p(){f.on("zoom",null)}async function _(L,R,E){const $=zl(L),k=f==null?void 0:f.constrain()($,R,E);return k&&await C(k),new Promise(T=>T(k))}async function m(L,R){const E=zl(L);return await C(E,R),new Promise($=>$(E))}function S(L){if(g){const R=zl(L),E=g.property("__zoom");(E.k!==L.zoom||E.x!==L.x||E.y!==L.y)&&(f==null||f.transform(g,R,null,{sync:!0}))}}function N(){const L=g?Nd(g.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}function P(L,R){return g?new Promise(E=>{f==null||f.scaleTo(Rl(g,R==null?void 0:R.duration,()=>E(!0)),L)}):Promise.resolve(!1)}function D(L,R){return g?new Promise(E=>{f==null||f.scaleBy(Rl(g,R==null?void 0:R.duration,()=>E(!0)),L)}):Promise.resolve(!1)}function I(L){f==null||f.scaleExtent(L)}function A(L){f==null||f.translateExtent(L)}function V(L){const R=!Bn(L)||L<0?0:L;f==null||f.clickDistance(R)}return{update:x,destroy:p,setViewport:m,setViewportConstrained:_,getViewport:N,scaleTo:P,scaleBy:D,setScaleExtent:I,setTranslateExtent:A,syncViewport:S,setClickDistance:V}}var ff;(function(e){e.Line="line",e.Handle="handle"})(ff||(ff={}));var Cy=ie('<div role="button" tabindex="-1"><!></div>');function mr(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(ee,"$connectable",n),i=()=>oe(_e,"$connectionRadius",n),s=()=>oe(de,"$domNode",n),a=()=>oe(ne,"$nodeLookup",n),l=()=>oe(Q,"$connectionMode",n),c=()=>oe(le,"$lib",n),u=()=>oe(we,"$autoPanOnConnect",n),h=()=>oe(Ve,"$flowId",n),f=()=>oe(Ae,"$isValidConnectionStore",n),g=()=>oe(se,"$onedgecreate",n),v=()=>oe(Be,"$onConnectAction",n),b=()=>oe(Ie,"$onConnectStartAction",n),C=()=>oe(ye,"$onConnectEndAction",n),x=()=>oe(Ne,"$viewport",n),p=()=>oe(je,"$connection",n),_=()=>oe(Pe,"$edges",n),m=()=>oe(De,"$connectionLookup",n),S=ae(),N=ae(),P=ae(),D=ae(),I=ae(),A=ae(),V=ae(),L=ae();let R=w(t,"id",12,void 0),E=w(t,"type",12,"source"),$=w(t,"position",28,()=>ke.Top),k=w(t,"style",12,void 0),T=w(t,"isValidConnection",12,void 0),M=w(t,"onconnect",12,void 0),O=w(t,"ondisconnect",12,void 0),z=w(t,"isConnectable",12,void 0),j=w(t,"class",12,void 0);const X=Hr("svelteflow__node_id"),ee=Hr("svelteflow__node_connectable"),re=Qe(),{connectionMode:Q,domNode:de,nodeLookup:ne,connectionRadius:_e,viewport:Ne,isValidConnection:Ae,lib:le,addEdge:pe,onedgecreate:se,panBy:U,cancelConnection:ue,updateConnection:Y,autoPanOnConnect:we,edges:Pe,connectionLookup:De,onconnect:Be,onconnectstart:Ie,onconnectend:ye,flowId:Ve,connection:je}=re;function gt($e){const Ye=Fd($e);(Ye&&$e.button===0||!Ye)&&hy.onPointerDown($e,{handleId:d(P),nodeId:X,isTarget:d(S),connectionRadius:i(),domNode:s(),nodeLookup:a(),connectionMode:l(),lib:c(),autoPanOnConnect:u(),flowId:h(),isValidConnection:T()??f(),updateConnection:Y,cancelConnection:ue,panBy:U,onConnect:Le=>{var St;const Ot=g()?g()(Le):Le;Ot&&(pe(Ot),(St=v())==null||St(Le))},onConnectStart:(Le,Ot)=>{var St;(St=b())==null||St(Le,{nodeId:Ot.nodeId,handleId:Ot.handleId,handleType:Ot.handleType})},onConnectEnd:(Le,Ot)=>{var St;(St=C())==null||St(Le,Ot)},getTransform:()=>[x().x,x().y,x().zoom],getFromHandle:()=>p().fromHandle})}let Z=ae(null),Ue=ae();ve(()=>q(E()),()=>{te(S,E()==="target")}),ve(()=>(q(z()),o()),()=>{te(N,z()!==void 0?z():o())}),ve(()=>q(R()),()=>{te(P,R()||null)}),ve(()=>(q(M()),q(O()),_(),m(),q(E()),q(R())),()=>{(M()||O())&&(_(),te(Ue,m().get(`${X}-${E()}${R()?`-${R()}`:""}`)))}),ve(()=>(d(Z),d(Ue),q(O()),q(M())),()=>{if(d(Z)&&!Em(d(Ue),d(Z))){const $e=d(Ue)??new Map;Hd(d(Z),$e,O()),Hd($e,d(Z),M())}te(Z,d(Ue)??new Map)}),ve(()=>p(),()=>{te(D,!!p().fromHandle)}),ve(()=>(p(),q(E()),d(P)),()=>{var $e,Ye,Le;te(I,(($e=p().fromHandle)==null?void 0:$e.nodeId)===X&&((Ye=p().fromHandle)==null?void 0:Ye.type)===E()&&((Le=p().fromHandle)==null?void 0:Le.id)===d(P))}),ve(()=>(p(),q(E()),d(P)),()=>{var $e,Ye,Le;te(A,(($e=p().toHandle)==null?void 0:$e.nodeId)===X&&((Ye=p().toHandle)==null?void 0:Ye.type)===E()&&((Le=p().toHandle)==null?void 0:Le.id)===d(P))}),ve(()=>(l(),p(),q(E()),d(P)),()=>{var $e,Ye,Le;te(V,l()===Fr.Strict?(($e=p().fromHandle)==null?void 0:$e.type)!==E():X!==((Ye=p().fromHandle)==null?void 0:Ye.nodeId)||d(P)!==((Le=p().fromHandle)==null?void 0:Le.id))}),ve(()=>(d(A),p()),()=>{te(L,d(A)&&p().isValid)}),Nt(),qe();var tt=Cy();let ft;var an=W(tt);At(an,t,"default",{}),F(tt),He(($e,Ye)=>{be(tt,"data-handleid",d(P)),be(tt,"data-nodeid",X),be(tt,"data-handlepos",$()),be(tt,"data-id",`${h()??""}-${X??""}-${(R()||"")??""}-${E()??""}`),ft=Vt(tt,1,$e,null,ft,Ye),yt(tt,k())},[()=>Cn((q(at),q($()),q(j()),G(()=>at(["svelte-flow__handle",`svelte-flow__handle-${$()}`,"nodrag","nopan",$(),j()])))),()=>({valid:d(L),connectingto:d(A),connectingfrom:d(I),source:!d(S),target:d(S),connectablestart:d(N),connectableend:d(N),connectable:d(N),connectionindicator:d(N)&&(!d(D)||d(V))})]),ct("mousedown",tt,gt),ct("touchstart",tt,gt),H(e,tt);var et=he({get id(){return R()},set id($e){R($e),y()},get type(){return E()},set type($e){E($e),y()},get position(){return $()},set position($e){$($e),y()},get style(){return k()},set style($e){k($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 O()},set ondisconnect($e){O($e),y()},get isConnectable(){return z()},set isConnectable($e){z($e),y()},get class(){return j()},set class($e){j($e),y()}});return r(),et}ce(mr,{id:{},type:{},position:{},style:{},isValidConnection:{},onconnect:{},ondisconnect:{},isConnectable:{},class:{}},["default"],[],!0);var $y=ie("<!> <!>",1);function qs(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);qe();var s=$y(),a=ge(s);{let u=Me(()=>(q(o()),q(ke),G(()=>o()??ke.Top)));mr(a,{type:"target",get position(){return d(u)}})}var l=B(a),c=B(l);{let u=Me(()=>(q(i()),q(ke),G(()=>i()??ke.Bottom)));mr(c,{type:"source",get position(){return d(u)}})}return He(()=>pt(l,` ${q(r()),G(()=>{var u;return(u=r())==null?void 0:u.label})??""} `)),H(e,s),he({get data(){return r()},set data(u){r(u),y()},get targetPosition(){return o()},set targetPosition(u){o(u),y()},get sourcePosition(){return i()},set sourcePosition(u){i(u),y()}})}ce(qs,{data:{},targetPosition:{},sourcePosition:{}},[],[],!0);var Ey=ie(" <!>",1);function hf(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);qe(),Te();var i=Ey(),s=ge(i),a=B(s);{let l=Me(()=>(q(o()),q(ke),G(()=>o()??ke.Bottom)));mr(a,{type:"source",get position(){return d(l)}})}return He(()=>pt(s,`${q(r()),G(()=>{var l;return(l=r())==null?void 0:l.label})??""} `)),H(e,i),he({get data(){return r()},set data(l){r(l),y()},get sourcePosition(){return o()},set sourcePosition(l){o(l),y()}})}ce(hf,{data:{},sourcePosition:{}},[],[],!0);var Sy=ie(" <!>",1);function gf(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);qe(),Te();var i=Sy(),s=ge(i),a=B(s);{let l=Me(()=>(q(o()),q(ke),G(()=>o()??ke.Top)));mr(a,{type:"target",get position(){return d(l)}})}return He(()=>pt(s,`${q(r()),G(()=>{var l;return(l=r())==null?void 0:l.label})??""} `)),H(e,i),he({get data(){return r()},set data(l){r(l),y()},get targetPosition(){return o()},set targetPosition(l){o(l),y()}})}ce(gf,{data:{},targetPosition:{}},[],[],!0);function vf(e,t){const n=ht(t,["children","$$slots","$$events","$$legacy","$$host"]);ht(n,[])}ce(vf,{},[],[],!0);function pf(e,t,n){if(!t)return;const r=n?t.querySelector(n):t;r&&r.appendChild(e)}function So(e,{target:t,domNode:n}){return pf(e,n,t),{async update({target:r,domNode:o}){pf(e,o,r)},destroy(){e.parentNode&&e.parentNode.removeChild(e)}}}var ky=ie("<div><!></div>");function mf(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(i,"$domNode",n),{domNode:i}=Qe();qe();var s=ky(),a=W(s);At(a,t,"default",{}),F(s),Dt(s,(l,c)=>So==null?void 0:So(l,c),()=>({target:".svelte-flow__edgelabel-renderer",domNode:o()})),H(e,s),he(),r()}ce(mf,{},["default"],[],!0);function yf(){const{edgeLookup:e,selectionRect:t,selectionRectMode:n,multiselectionKeyPressed:r,addSelectedEdges:o,unselectNodesAndEdges:i,elementsSelectable:s}=Qe();return a=>{const l=J(e).get(a);if(!l){console.warn("012",wo.error012(a));return}(l.selectable||J(s)&&typeof l.selectable>"u")&&(t.set(null),n.set(null),l.selected?l.selected&&J(r)&&i({nodes:[],edges:[l]}):o([a]))}}var Py=ie('<div class="svelte-flow__edge-label" role="button" tabindex="-1"><!></div>');function wf(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=yf(),s=Hr("svelteflow__edge_id");return qe(),mf(e,{children:(a,l)=>{var c=Py();let u;var h=W(c);At(h,t,"default",{}),F(c),He(f=>u=yt(c,"pointer-events: all;"+n(),u,f),[()=>({transform:`translate(-50%, -50%) translate(${r()??""}px,${o()??""}px)`})]),ct("keyup",c,()=>{}),ct("click",c,()=>{s&&i(s)}),H(a,c)},$$slots:{default:!0}}),he({get style(){return n()},set style(a){n(a),y()},get x(){return r()},set x(a){r(a),y()},get y(){return o()},set y(a){o(a),y()}})}ce(wf,{style:{},x:{},y:{}},["default"],[],!0);var Ny=Ce('<path fill="none" class="svelte-flow__edge-interaction"></path>'),Ty=Ce('<path fill="none"></path><!><!>',1);function wi(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),h=w(t,"interactionWidth",12,20),f=w(t,"class",12,void 0),g=h()===void 0?20:h();qe();var v=Ty(),b=ge(v),C=B(b);{var x=m=>{var S=Ny();be(S,"stroke-opacity",0),He(()=>{be(S,"d",r()),be(S,"stroke-width",g)}),H(m,S)};me(C,m=>{g&&m(x)})}var p=B(C);{var _=m=>{wf(m,{get x(){return i()},get y(){return s()},get style(){return a()},children:(S,N)=>{Te();var P=Re();He(()=>pt(P,o())),H(S,P)},$$slots:{default:!0}})};me(p,m=>{o()&&m(_)})}return He(m=>{be(b,"id",n()),be(b,"d",r()),Vt(b,0,m),be(b,"marker-start",l()),be(b,"marker-end",c()),yt(b,u())},[()=>Cn((q(at),q(f()),G(()=>at(["svelte-flow__edge-path",f()]))))]),H(e,v),he({get id(){return n()},set id(m){n(m),y()},get path(){return r()},set path(m){r(m),y()},get label(){return o()},set label(m){o(m),y()},get labelX(){return i()},set labelX(m){i(m),y()},get labelY(){return s()},set labelY(m){s(m),y()},get labelStyle(){return a()},set labelStyle(m){a(m),y()},get markerStart(){return l()},set markerStart(m){l(m),y()},get markerEnd(){return c()},set markerEnd(m){c(m),y()},get style(){return u()},set style(m){u(m),y()},get interactionWidth(){return h()},set interactionWidth(m){h(m),y()},get class(){return f()},set class(m){f(m),y()}})}ce(wi,{id:{},path:{},label:{},labelX:{},labelY:{},labelStyle:{},markerStart:{},markerEnd:{},style:{},interactionWidth:{},class:{}},[],[],!0);function Fs(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=ae(),o=ae(),i=ae();let s=w(t,"label",12,void 0),a=w(t,"labelStyle",12,void 0),l=w(t,"style",12,void 0),c=w(t,"markerStart",12,void 0),u=w(t,"markerEnd",12,void 0),h=w(t,"interactionWidth",12,void 0),f=w(t,"sourceX",12),g=w(t,"sourceY",12),v=w(t,"sourcePosition",12),b=w(t,"targetX",12),C=w(t,"targetY",12),x=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),q(f()),q(g()),q(b()),q(C()),q(v()),q(x())),()=>{(p=>{var _=ur(p,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(Kd({sourceX:f(),sourceY:g(),targetX:b(),targetY:C(),sourcePosition:v(),targetPosition:x()}))}),Nt(),qe(),wi(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 h()},get style(){return l()}}),he({get label(){return s()},set label(p){s(p),y()},get labelStyle(){return a()},set labelStyle(p){a(p),y()},get style(){return l()},set style(p){l(p),y()},get markerStart(){return c()},set markerStart(p){c(p),y()},get markerEnd(){return u()},set markerEnd(p){u(p),y()},get interactionWidth(){return h()},set interactionWidth(p){h(p),y()},get sourceX(){return f()},set sourceX(p){f(p),y()},get sourceY(){return g()},set sourceY(p){g(p),y()},get sourcePosition(){return v()},set sourcePosition(p){v(p),y()},get targetX(){return b()},set targetX(p){b(p),y()},get targetY(){return C()},set targetY(p){C(p),y()},get targetPosition(){return x()},set targetPosition(p){x(p),y()}})}ce(Fs,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function _f(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=ae(),o=ae(),i=ae();let s=w(t,"label",12,void 0),a=w(t,"labelStyle",12,void 0),l=w(t,"style",12,void 0),c=w(t,"markerStart",12,void 0),u=w(t,"markerEnd",12,void 0),h=w(t,"interactionWidth",12,void 0),f=w(t,"sourceX",12),g=w(t,"sourceY",12),v=w(t,"sourcePosition",12),b=w(t,"targetX",12),C=w(t,"targetY",12),x=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),q(f()),q(g()),q(b()),q(C()),q(v()),q(x())),()=>{(p=>{var _=ur(p,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(Rs({sourceX:f(),sourceY:g(),targetX:b(),targetY:C(),sourcePosition:v(),targetPosition:x()}))}),Nt(),qe(),wi(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 h()},get style(){return l()}}),he({get label(){return s()},set label(p){s(p),y()},get labelStyle(){return a()},set labelStyle(p){a(p),y()},get style(){return l()},set style(p){l(p),y()},get markerStart(){return c()},set markerStart(p){c(p),y()},get markerEnd(){return u()},set markerEnd(p){u(p),y()},get interactionWidth(){return h()},set interactionWidth(p){h(p),y()},get sourceX(){return f()},set sourceX(p){f(p),y()},get sourceY(){return g()},set sourceY(p){g(p),y()},get sourcePosition(){return v()},set sourcePosition(p){v(p),y()},get targetX(){return b()},set targetX(p){b(p),y()},get targetY(){return C()},set targetY(p){C(p),y()},get targetPosition(){return x()},set targetPosition(p){x(p),y()}})}ce(_f,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function bf(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=ae(),o=ae(),i=ae();let s=w(t,"label",12,void 0),a=w(t,"labelStyle",12,void 0),l=w(t,"style",12,void 0),c=w(t,"markerStart",12,void 0),u=w(t,"markerEnd",12,void 0),h=w(t,"interactionWidth",12,void 0),f=w(t,"sourceX",12),g=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(g()),q(v()),q(b())),()=>{(C=>{var x=ur(C,3);te(r,x[0]),te(o,x[1]),te(i,x[2])})(Hl({sourceX:f(),sourceY:g(),targetX:v(),targetY:b()}))}),Nt(),qe(),wi(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 h()},get style(){return l()}}),he({get label(){return s()},set label(C){s(C),y()},get labelStyle(){return a()},set labelStyle(C){a(C),y()},get style(){return l()},set style(C){l(C),y()},get markerStart(){return c()},set markerStart(C){c(C),y()},get markerEnd(){return u()},set markerEnd(C){u(C),y()},get interactionWidth(){return h()},set interactionWidth(C){h(C),y()},get sourceX(){return f()},set sourceX(C){f(C),y()},get sourceY(){return g()},set sourceY(C){g(C),y()},get targetX(){return v()},set targetX(C){v(C),y()},get targetY(){return b()},set targetY(C){b(C),y()}})}ce(bf,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},targetX:{},targetY:{}},[],[],!0);function xf(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=ae(),o=ae(),i=ae();let s=w(t,"label",12,void 0),a=w(t,"labelStyle",12,void 0),l=w(t,"style",12,void 0),c=w(t,"markerStart",12,void 0),u=w(t,"markerEnd",12,void 0),h=w(t,"interactionWidth",12,void 0),f=w(t,"sourceX",12),g=w(t,"sourceY",12),v=w(t,"sourcePosition",12),b=w(t,"targetX",12),C=w(t,"targetY",12),x=w(t,"targetPosition",12);return ve(()=>(d(r),d(o),d(i),q(f()),q(g()),q(b()),q(C()),q(v()),q(x())),()=>{(p=>{var _=ur(p,3);te(r,_[0]),te(o,_[1]),te(i,_[2])})(Rs({sourceX:f(),sourceY:g(),targetX:b(),targetY:C(),sourcePosition:v(),targetPosition:x(),borderRadius:0}))}),Nt(),qe(),wi(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 h()},get style(){return l()}}),he({get label(){return s()},set label(p){s(p),y()},get labelStyle(){return a()},set labelStyle(p){a(p),y()},get style(){return l()},set style(p){l(p),y()},get markerStart(){return c()},set markerStart(p){c(p),y()},get markerEnd(){return u()},set markerEnd(p){u(p),y()},get interactionWidth(){return h()},set interactionWidth(p){h(p),y()},get sourceX(){return f()},set sourceX(p){f(p),y()},get sourceY(){return g()},set sourceY(p){g(p),y()},get sourcePosition(){return v()},set sourcePosition(p){v(p),y()},get targetX(){return b()},set targetX(p){b(p),y()},get targetY(){return C()},set targetY(p){C(p),y()},get targetPosition(){return x()},set targetPosition(p){x(p),y()}})}ce(xf,{label:{},labelStyle:{},style:{},markerStart:{},markerEnd:{},interactionWidth:{},sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{}},[],[],!0);function My(e,t){const n=e.set,r=t.set,o=J(e),i=J(t);let a=o.length===0&&i.length>0?i:o;e.set(a);const l=c=>{const u=n(c);return a=u,r(a),u};e.set=t.set=l,e.update=t.update=c=>l(c(a))}function Oy(e,t){const n=e.set,r=t.set;let o=J(t);e.set(o);const i=s=>{n(s),r(s),o=s};e.set=t.set=i,e.update=t.update=s=>i(s(o))}const Hy=(e,t,n)=>{if(!n)return;const r=J(e),o=t.set,i=n.set;let s=n?J(n):{x:0,y:0,zoom:1};t.set(s),t.set=a=>(o(a),i(a),s=a,a),n.set=a=>(r==null||r.syncViewport(a),o(a),i(a),s=a,a),t.update=a=>{t.set(a(s))},n.update=a=>{n.set(a(s))}},Ay=(e,t,n,r=[0,0],o=Ms,i,s,a,l,c,u,h,f)=>{const{subscribe:g,set:v,update:b}=xe([]);let C=e,x={},p=!0;const _=P=>{const D=Qd(P,t,n,{elevateNodesOnSelect:p,nodeOrigin:r,nodeExtent:o,defaults:x,checkEquality:!1});return J(i)&&D&&J(l)&&(Tm({nodes:t,width:J(c),height:J(u),panZoom:J(l),minZoom:J(h),maxZoom:J(f)},J(s)).then(A=>{var V;(V=J(a))==null||V.resolve(A),a.set(null)}),i.set(!1),s.set(void 0)),C=P,v(C),C},m=P=>_(P(C)),S=P=>{x=P},N=P=>{p=P.elevateNodesOnSelect??p};return _(C),{subscribe:g,set:_,update:m,setDefaultOptions:S,setOptions:N}},Dy=(e,t,n,r)=>{const{subscribe:o,set:i,update:s}=xe([]);let a=e,l={};const c=f=>{const g=l?f.map(v=>({...l,...v})):f;nf(t,n,g),a=g,i(a)},u=f=>c(f(a)),h=f=>{l=f};return c(a),{subscribe:o,set:c,update:u,setDefaultOptions:h}},Cf={input:hf,output:gf,default:qs,group:vf},$f={straight:bf,smoothstep:_f,default:Fs,step:xf},Vy=({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,h=i??[0,0],f=s??Ms;Qd(e,a,l,{nodeExtent:f,nodeOrigin:h,elevateNodesOnSelect:!1,checkEquality:!1}),nf(c,u,t);let g={x:0,y:0,zoom:1};if(o&&n&&r){const N=vi(a,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))});g=Ml(N,n,r,.5,2,.1)}const v=xe(!1),b=xe(void 0),C=xe(null),x=xe(null),p=xe(500),_=xe(500),m=xe(.5),S=xe(2);return{flowId:xe(null),nodes:Ay(e,a,l,h,f,v,b,C,x,p,_,m,S),nodeLookup:vn(a),parentLookup:vn(l),edgeLookup:vn(u),visibleNodes:vn([]),edges:Dy(t,c,u),visibleEdges:vn([]),connectionLookup:vn(c),width:p,height:_,minZoom:m,maxZoom:S,nodeOrigin:xe(h),nodeDragThreshold:xe(1),nodeExtent:xe(f),translateExtent:xe(Ms),autoPanOnNodeDrag:xe(!0),autoPanOnConnect:xe(!0),fitViewQueued:v,fitViewOptions:b,fitViewResolver:C,panZoom:x,snapGrid:xe(null),dragging:xe(!1),selectionRect:xe(null),selectionKeyPressed:xe(!1),multiselectionKeyPressed:xe(!1),deleteKeyPressed:xe(!1),panActivationKeyPressed:xe(!1),zoomActivationKeyPressed:xe(!1),selectionRectMode:xe(null),selectionMode:xe(Os.Partial),nodeTypes:xe(Cf),edgeTypes:xe($f),viewport:xe(g),connectionMode:xe(Fr.Strict),domNode:xe(null),connection:vn(Sl),connectionLineType:xe(_o.Bezier),connectionRadius:xe(20),isValidConnection:xe(()=>!0),nodesDraggable:xe(!0),nodesConnectable:xe(!0),elementsSelectable:xe(!0),selectNodesOnDrag:xe(!0),markers:vn([]),defaultMarkerColor:xe("#b1b1b7"),lib:vn("svelte"),onlyRenderVisibleElements:xe(!1),onerror:xe(Om),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:vn(!1)}};function Iy(e){const t=vr([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),h=r.get(c.target);return u&&h&&qm({sourceNode:u,targetNode:h,width:s,height:a,transform:[i.x,i.y,i.zoom]})}):n);return vr([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 h=jm({id:l.id,sourceNode:c,targetNode:u,sourceHandle:l.sourceHandle||null,targetHandle:l.targetHandle||null,connectionMode:o,onError:i});return h&&a.push({...l,zIndex:Bm({selected:l.selected,zIndex:l.zIndex,sourceNode:c,targetNode:u,elevateOnSelect:!1}),...h}),a},[]))}function Ly(e){return vr([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?Dd(t,{x:0,y:0,width:r,height:o},s,!0):Array.from(t.values())})}const Ys=Symbol();function Ef({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s}){const a=Vy({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s});function l($){a.nodeTypes.set({...Cf,...$})}function c($){a.edgeTypes.set({...$f,...$})}function u($){const k=J(a.edges);a.edges.set(Wm($,k))}const h=($,k=!1)=>{var M;const T=J(a.nodeLookup);for(const[O,z]of $){const j=(M=T.get(O))==null?void 0:M.internals.userNode;j&&(j.position=z.position,j.dragging=k)}a.nodes.update(O=>O)};function f($){var z,j,X;const k=J(a.nodeLookup),T=J(a.parentLookup),{changes:M,updatedInternals:O}=ry($,k,J(a.parentLookup),J(a.domNode),J(a.nodeOrigin));if(O){Qm(k,T,{nodeOrigin:i,nodeExtent:s});for(const ee of M){const re=(z=k.get(ee.id))==null?void 0:z.internals.userNode;if(re)switch(ee.type){case"dimensions":{const Q={...re.measured,...ee.dimensions};ee.setAttributes&&(re.width=((j=ee.dimensions)==null?void 0:j.width)??re.width,re.height=((X=ee.dimensions)==null?void 0:X.height)??re.height),re.measured=Q;break}case"position":re.position=ee.position??re.position;break}}a.nodes.update(ee=>ee),J(a.nodesInitialized)||a.nodesInitialized.set(!0)}}function g($){const k=J(a.fitViewResolver)??Vm();return a.fitViewQueued.set(!0),a.fitViewOptions.set($),a.fitViewResolver.set(k),a.nodes.set(J(a.nodes)),k.promise}function v($,k){const T=J(a.panZoom);return T?T.scaleBy($,k):Promise.resolve(!1)}function b($){return v(1.2,$)}function C($){return v(1/1.2,$)}function x($){const k=J(a.panZoom);k&&(k.setScaleExtent([$,J(a.maxZoom)]),a.minZoom.set($))}function p($){const k=J(a.panZoom);k&&(k.setScaleExtent([J(a.minZoom),$]),a.maxZoom.set($))}function _($){const k=J(a.panZoom);k&&(k.setTranslateExtent($),a.translateExtent.set($))}function m($){let k=!1;return $.forEach(T=>{T.selected&&(T.selected=!1,k=!0)}),k}function S($){var k;(k=J(a.panZoom))==null||k.setClickDistance($)}function N($){m(($==null?void 0:$.nodes)||J(a.nodes))&&a.nodes.set(J(a.nodes)),m(($==null?void 0:$.edges)||J(a.edges))&&a.edges.set(J(a.edges))}a.deleteKeyPressed.subscribe(async $=>{var k;if($){const T=J(a.nodes),M=J(a.edges),O=T.filter(ee=>ee.selected),z=M.filter(ee=>ee.selected),{nodes:j,edges:X}=await Vd({nodesToRemove:O,edgesToRemove:z,nodes:T,edges:M,onBeforeDelete:J(a.onbeforedelete)});(j.length||X.length)&&(a.nodes.update(ee=>ee.filter(re=>!j.some(Q=>Q.id===re.id))),a.edges.update(ee=>ee.filter(re=>!X.some(Q=>Q.id===re.id))),(k=J(a.ondelete))==null||k({nodes:j,edges:X}))}});function P($){const k=J(a.multiselectionKeyPressed);a.nodes.update(T=>T.map(M=>{const O=$.includes(M.id),z=k&&M.selected||O;return M.selected=z,M})),k||a.edges.update(T=>T.map(M=>(M.selected=!1,M)))}function D($){const k=J(a.multiselectionKeyPressed);a.edges.update(T=>T.map(M=>{const O=$.includes(M.id),z=k&&M.selected||O;return M.selected=z,M})),k||a.nodes.update(T=>T.map(M=>(M.selected=!1,M)))}function I($){var T;const k=(T=J(a.nodes))==null?void 0:T.find(M=>M.id===$);if(!k){console.warn("012",wo.error012($));return}a.selectionRect.set(null),a.selectionRectMode.set(null),k.selected?k.selected&&J(a.multiselectionKeyPressed)&&N({nodes:[k],edges:[]}):P([$])}function A($){const k=J(a.viewport);return oy({delta:$,panZoom:J(a.panZoom),transform:[k.x,k.y,k.zoom],translateExtent:J(a.translateExtent),width:J(a.width),height:J(a.height)})}const V=xe(Sl),L=$=>{V.set({...$})};function R(){V.set(Sl)}function E(){a.selectionRect.set(null),a.selectionRectMode.set(null),a.snapGrid.set(null),a.isValidConnection.set(()=>!0),N(),R()}return{...a,visibleEdges:Iy(a),visibleNodes:Ly(a),connection:vr([V,a.viewport],([$,k])=>$.inProgress?{...$,to:mi($.to,[k.x,k.y,k.zoom])}:{...$}),markers:vr([a.edges,a.defaultMarkerColor,a.flowId],([$,k,T])=>Um($,{defaultColor:k,id:T})),initialized:(()=>{let $=!1;const k=J(a.nodes).length,T=J(a.edges).length;return vr([a.nodesInitialized,a.edgesInitialized,a.viewportInitialized],([M,O,z])=>$||(k===0?$=z:T===0?$=z&&M:$=z&&M&&O,$))})(),syncNodeStores:$=>My(a.nodes,$),syncEdgeStores:$=>Oy(a.edges,$),syncViewport:$=>Hy(a.panZoom,a.viewport,$),setNodeTypes:l,setEdgeTypes:c,addEdge:u,updateNodePositions:h,updateNodeInternals:f,zoomIn:b,zoomOut:C,fitView:$=>g($),setMinZoom:x,setMaxZoom:p,setTranslateExtent:_,setPaneClickDistance:S,unselectNodesAndEdges:N,addSelectedNodes:P,addSelectedEdges:D,handleNodeSelection:I,panBy:A,updateConnection:L,cancelConnection:R,reset:E}}function Qe(){const e=Hr(Ys);if(!e)throw new Error("In order to use useStore you need to wrap your component in a <SvelteFlowProvider />");return e.getStore()}function zy({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s}){const a=Ef({nodes:e,edges:t,width:n,height:r,fitView:o,nodeOrigin:i,nodeExtent:s});return oo(Ys,{getStore:()=>a}),a}function Bl(e,t){const{panZoom:n,minZoom:r,maxZoom:o,initialViewport:i,viewport:s,dragging:a,translateExtent:l,paneClickDistance:c}=t,u=xy({domNode:e,minZoom:r,maxZoom:o,translateExtent:l,viewport:i,paneClickDistance:c,onDraggingChange:a.set}),h=u.getViewport();return s.set(h),n.set(u),u.update(t),{update(f){u.update(f)}}}var Ry=ie('<div class="svelte-flow__zoom svelte-4xkw84"><!></div>');const By={hash:"svelte-4xkw84",code:".svelte-flow__zoom.svelte-4xkw84 {width:100%;height:100%;position:absolute;top:0;left:0;z-index:4;}"};function Sf(e,t){fe(t,!1),st(e,By);const[n,r]=dt(),o=()=>oe(M,"$panActivationKeyPressed",n),i=()=>oe(R,"$minZoom",n),s=()=>oe(E,"$maxZoom",n),a=()=>oe(O,"$zoomActivationKeyPressed",n),l=()=>oe(L,"$selectionRect",n),c=()=>oe(k,"$translateExtent",n),u=()=>oe(T,"$lib",n),h=ae(),f=ae(),g=ae();let v=w(t,"initialViewport",12,void 0),b=w(t,"onMoveStart",12,void 0),C=w(t,"onMove",12,void 0),x=w(t,"onMoveEnd",12,void 0),p=w(t,"panOnScrollMode",12),_=w(t,"preventScrolling",12),m=w(t,"zoomOnScroll",12),S=w(t,"zoomOnDoubleClick",12),N=w(t,"zoomOnPinch",12),P=w(t,"panOnDrag",12),D=w(t,"panOnScroll",12),I=w(t,"paneClickDistance",12);const{viewport:A,panZoom:V,selectionRect:L,minZoom:R,maxZoom:E,dragging:$,translateExtent:k,lib:T,panActivationKeyPressed:M,zoomActivationKeyPressed:O,viewportInitialized:z}=Qe(),j=Q=>A.set({x:Q[0],y:Q[1],zoom:Q[2]});gn(()=>{us(z,!0)}),ve(()=>q(v()),()=>{te(h,v()||{x:0,y:0,zoom:1})}),ve(()=>(o(),q(P())),()=>{te(f,o()||P())}),ve(()=>(o(),q(D())),()=>{te(g,o()||D())}),Nt(),qe();var X=Ry(),ee=W(X);At(ee,t,"default",{}),F(X),Dt(X,(Q,de)=>Bl==null?void 0:Bl(Q,de),()=>({viewport:A,minZoom:i(),maxZoom:s(),initialViewport:d(h),dragging:$,panZoom:V,onPanZoomStart:b(),onPanZoom:C(),onPanZoomEnd:x(),zoomOnScroll:m(),zoomOnDoubleClick:S(),zoomOnPinch:N(),panOnScroll:d(g),panOnDrag:d(f),panOnScrollSpeed:.5,panOnScrollMode:p()||Qn.Free,zoomActivationKeyPressed:a(),preventScrolling:typeof _()=="boolean"?_():!0,noPanClassName:"nopan",noWheelClassName:"nowheel",userSelectionActive:!!l(),translateExtent:c(),lib:u(),paneClickDistance:I(),onTransformChange:j})),H(e,X);var re=he({get initialViewport(){return v()},set initialViewport(Q){v(Q),y()},get onMoveStart(){return b()},set onMoveStart(Q){b(Q),y()},get onMove(){return C()},set onMove(Q){C(Q),y()},get onMoveEnd(){return x()},set onMoveEnd(Q){x(Q),y()},get panOnScrollMode(){return p()},set panOnScrollMode(Q){p(Q),y()},get preventScrolling(){return _()},set preventScrolling(Q){_(Q),y()},get zoomOnScroll(){return m()},set zoomOnScroll(Q){m(Q),y()},get zoomOnDoubleClick(){return S()},set zoomOnDoubleClick(Q){S(Q),y()},get zoomOnPinch(){return N()},set zoomOnPinch(Q){N(Q),y()},get panOnDrag(){return P()},set panOnDrag(Q){P(Q),y()},get panOnScroll(){return D()},set panOnScroll(Q){D(Q),y()},get paneClickDistance(){return I()},set paneClickDistance(Q){I(Q),y()}});return r(),re}ce(Sf,{initialViewport:{},onMoveStart:{},onMove:{},onMoveEnd:{},panOnScrollMode:{},preventScrolling:{},zoomOnScroll:{},zoomOnDoubleClick:{},zoomOnPinch:{},panOnDrag:{},panOnScroll:{},paneClickDistance:{}},["default"],[],!0);function kf(e,t){return n=>{n.target===t&&(e==null||e(n))}}function Pf(e){return t=>{const n=e.includes(t.id);return t.selected!==n&&(t.selected=n),t}}var qy=ie("<div><!></div>");const Fy={hash:"svelte-1esy7hx",code:".svelte-flow__pane.svelte-1esy7hx {position:absolute;top:0;left:0;width:100%;height:100%;}"};function Nf(e,t){fe(t,!1),st(e,Fy);const[n,r]=dt(),o=()=>oe($,"$panActivationKeyPressed",n),i=()=>oe(R,"$selectionKeyPressed",n),s=()=>oe(V,"$selectionRect",n),a=()=>oe(A,"$elementsSelectable",n),l=()=>oe(L,"$selectionRectMode",n),c=()=>oe(T,"$connection",n),u=()=>oe(P,"$edges",n),h=()=>oe(N,"$nodeLookup",n),f=()=>oe(D,"$viewport",n),g=()=>oe(E,"$selectionMode",n),v=()=>oe(I,"$dragging",n),b=ae(),C=ae(),x=ae();let p=w(t,"panOnDrag",12,void 0),_=w(t,"selectionOnDrag",12,void 0);const m=is(),{nodes:S,nodeLookup:N,edges:P,viewport:D,dragging:I,elementsSelectable:A,selectionRect:V,selectionRectMode:L,selectionKeyPressed:R,selectionMode:E,panActivationKeyPressed:$,unselectNodesAndEdges:k,connection:T}=Qe();let M=ae(),O=null,z=[],j=!1;function X(se){if(j||c().inProgress){j=!1;return}m("paneclick",{event:se}),k(),L.set(null)}function ee(se){var Y,we;if(O=d(M).getBoundingClientRect(),!A||!d(C)||se.button!==0||se.target!==d(M)||!O)return;(we=(Y=se.target)==null?void 0:Y.setPointerCapture)==null||we.call(Y,se.pointerId);const{x:U,y:ue}=tr(se,O);k(),V.set({width:0,height:0,startX:U,startY:ue,x:U,y:ue})}function re(se){if(!d(C)||!O||!s())return;j=!0;const U=tr(se,O),ue=s().startX??0,Y=s().startY??0,we={...s(),x:U.x<ue?U.x:ue,y:U.y<Y?U.y:Y,width:Math.abs(U.x-ue),height:Math.abs(U.y-Y)},Pe=z.map(ye=>ye.id),De=Pl(z,u()).map(ye=>ye.id);z=Dd(h(),we,[f().x,f().y,f().zoom],g()===Os.Partial,!0);const Be=Pl(z,u()).map(ye=>ye.id),Ie=z.map(ye=>ye.id);(Pe.length!==Ie.length||Ie.some(ye=>!Pe.includes(ye)))&&S.update(ye=>ye.map(Pf(Ie))),(De.length!==Be.length||Be.some(ye=>!De.includes(ye)))&&P.update(ye=>ye.map(Pf(Be))),L.set("user"),V.set(we)}function Q(se){var U,ue;se.button===0&&((ue=(U=se.target)==null?void 0:U.releasePointerCapture)==null||ue.call(U,se.pointerId),!d(C)&&l()==="user"&&se.target===d(M)&&(X==null||X(se)),V.set(null),z.length>0&&us(L,"nodes"),i()&&(j=!1))}const de=se=>{var U;if(Array.isArray(d(b))&&((U=d(b))!=null&&U.includes(2))){se.preventDefault();return}m("panecontextmenu",{event:se})};ve(()=>(o(),q(p())),()=>{te(b,o()||p())}),ve(()=>(i(),s(),q(_()),d(b)),()=>{te(C,i()||s()||_()&&d(b)!==!0)}),ve(()=>(a(),d(C),l()),()=>{te(x,a()&&(d(C)||l()==="user"))}),Nt(),qe();var ne=qy(),_e=Ee(()=>d(x)?void 0:kf(X,d(M))),Ne=Ee(()=>kf(de,d(M)));let Ae;var le=W(ne);At(le,t,"default",{}),F(ne),Ln(ne,se=>te(M,se),()=>d(M)),He(se=>Ae=Vt(ne,1,"svelte-flow__pane svelte-1esy7hx",null,Ae,se),[()=>({draggable:p()===!0||Array.isArray(p())&&p().includes(0),dragging:v(),selection:d(C)})]),ct("click",ne,function(...se){var U;(U=d(_e))==null||U.apply(this,se)}),ct("pointerdown",ne,function(...se){var U;(U=d(x)?ee:void 0)==null||U.apply(this,se)}),ct("pointermove",ne,function(...se){var U;(U=d(x)?re:void 0)==null||U.apply(this,se)}),ct("pointerup",ne,function(...se){var U;(U=d(x)?Q:void 0)==null||U.apply(this,se)}),ct("contextmenu",ne,function(...se){var U;(U=d(Ne))==null||U.apply(this,se)}),H(e,ne);var pe=he({get panOnDrag(){return p()},set panOnDrag(se){p(se),y()},get selectionOnDrag(){return _()},set selectionOnDrag(se){_(se),y()}});return r(),pe}ce(Nf,{panOnDrag:{},selectionOnDrag:{}},["default"],[],!0);var Yy=ie('<div class="svelte-flow__viewport xyflow__viewport svelte-1floaup"><!></div>');const Wy={hash:"svelte-1floaup",code:".svelte-flow__viewport.svelte-1floaup {width:100%;height:100%;position:absolute;top:0;left:0;}"};function Tf(e,t){fe(t,!1),st(e,Wy);const[n,r]=dt(),o=()=>oe(i,"$viewport",n),{viewport:i}=Qe();qe();var s=Yy(),a=W(s);At(a,t,"default",{}),F(s),He(()=>yt(s,`transform: translate(${o().x??""}px, ${o().y??""}px) scale(${o().zoom??""})`)),H(e,s),he(),r()}ce(Tf,{},["default"],[],!0);function ko(e,t){const{store:n,onDrag:r,onDragStart:o,onDragStop:i,onNodeMouseDown:s}=t,a=ay({onDrag:r,onDragStart:o,onDragStop:i,onNodeMouseDown:s,getStoreItems:()=>{const c=J(n.snapGrid),u=J(n.viewport);return{nodes:J(n.nodes),nodeLookup:J(n.nodeLookup),edges:J(n.edges),nodeExtent:J(n.nodeExtent),snapGrid:c||[0,0],snapToGrid:!!c,nodeOrigin:J(n.nodeOrigin),multiSelectionActive:J(n.multiselectionKeyPressed),domNode:J(n.domNode),transform:[u.x,u.y,u.zoom],autoPanOnNodeDrag:J(n.autoPanOnNodeDrag),nodesDraggable:J(n.nodesDraggable),selectNodesOnDrag:J(n.selectNodesOnDrag),nodeDragThreshold:J(n.nodeDragThreshold),unselectNodesAndEdges:n.unselectNodesAndEdges,updateNodePositions:n.updateNodePositions,panBy:n.panBy}}});function l(c,u){if(u.disabled){a.destroy();return}a.update({domNode:c,noDragClassName:u.noDragClass,handleSelector:u.handleSelector,nodeId:u.nodeId,isSelectable:u.isSelectable,nodeClickDistance:u.nodeClickDistance})}return l(e,t),{update(c){l(e,c)},destroy(){a.destroy()}}}function Ky({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 Xy=ie("<div><!></div>");function Mf(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(ne,"$nodeTypes",n),i=()=>oe(pe,"$elementsSelectable",n),s=()=>oe(se,"$nodesDraggable",n),a=()=>oe(we,"$connectableStore",n),l=ae(void 0,!0),c=ae(void 0,!0),u=ae(void 0,!0),h=ae(void 0,!0);let f=w(t,"node",13),g=w(t,"id",13),v=w(t,"data",29,()=>({})),b=w(t,"selected",13,!1),C=w(t,"draggable",13,void 0),x=w(t,"selectable",13,void 0),p=w(t,"connectable",13,!0),_=w(t,"deletable",13,!0),m=w(t,"hidden",13,!1),S=w(t,"dragging",13,!1),N=w(t,"resizeObserver",13,null),P=w(t,"style",13,void 0),D=w(t,"type",13,"default"),I=w(t,"isParent",13,!1),A=w(t,"positionX",13),V=w(t,"positionY",13),L=w(t,"sourcePosition",13,void 0),R=w(t,"targetPosition",13,void 0),E=w(t,"zIndex",13),$=w(t,"measuredWidth",13,void 0),k=w(t,"measuredHeight",13,void 0),T=w(t,"initialWidth",13,void 0),M=w(t,"initialHeight",13,void 0),O=w(t,"width",13,void 0),z=w(t,"height",13,void 0),j=w(t,"dragHandle",13,void 0),X=w(t,"initialized",13,!1),ee=w(t,"parentId",13,void 0),re=w(t,"nodeClickDistance",13,void 0),Q=w(t,"class",13,"");const de=Qe(),{nodeTypes:ne,nodeDragThreshold:_e,selectNodesOnDrag:Ne,handleNodeSelection:Ae,updateNodeInternals:le,elementsSelectable:pe,nodesDraggable:se}=de;let U=ae(void 0,!0),ue=ae(null,!0);const Y=is(),we=xe(p());let Pe=ae(void 0,!0),De=ae(void 0,!0),Be=ae(void 0,!0);oo("svelteflow__node_id",g()),oo("svelteflow__node_connectable",we),Ja(()=>{var Z;d(ue)&&((Z=N())==null||Z.unobserve(d(ue)))});function Ie(Z){x()&&(!J(Ne)||!C()||J(_e)>0)&&Ae(g()),Y("nodeclick",{node:f().internals.userNode,event:Z})}ve(()=>q(D()),()=>{te(l,D()||"default")}),ve(()=>(o(),d(l)),()=>{te(c,!!o()[d(l)])}),ve(()=>(o(),d(l),qs),()=>{te(u,o()[d(l)]||qs)}),ve(()=>(d(c),q(D())),()=>{d(c)||console.warn("003",wo.error003(D()))}),ve(()=>(q(O()),q(z()),q(T()),q(M()),q($()),q(k())),()=>{te(h,Ky({width:O(),height:z(),initialWidth:T(),initialHeight:M(),measuredWidth:$(),measuredHeight:k()}))}),ve(()=>q(p()),()=>{we.set(!!p())}),ve(()=>(d(Pe),d(l),d(De),q(L()),d(Be),q(R()),q(g()),d(U)),()=>{(d(Pe)&&d(l)!==d(Pe)||d(De)&&L()!==d(De)||d(Be)&&R()!==d(Be))&&requestAnimationFrame(()=>le(new Map([[g(),{id:g(),nodeElement:d(U),force:!0}]]))),te(Pe,d(l)),te(De,L()),te(Be,R())}),ve(()=>(q(N()),d(U),d(ue),q(X())),()=>{N()&&(d(U)!==d(ue)||!X())&&(d(ue)&&N().unobserve(d(ue)),d(U)&&N().observe(d(U)),te(ue,d(U)))}),Nt(),qe(!0);var ye=Ke(),Ve=ge(ye);{var je=Z=>{var Ue=Xy();let tt,ft;var an=W(Ue);{let et=Me(()=>b()??!1),$e=Me(()=>x()??i()??!0),Ye=Me(()=>_()??!0),Le=Me(()=>C()??s()??!0);Sc(an,()=>d(u),(Ot,St)=>{St(Ot,{get data(){return v()},get id(){return g()},get selected(){return d(et)},get selectable(){return d($e)},get deletable(){return d(Ye)},get sourcePosition(){return L()},get targetPosition(){return R()},get zIndex(){return E()},get dragging(){return S()},get draggable(){return d(Le)},get dragHandle(){return j()},get parentId(){return ee()},get type(){return d(l)},get isConnectable(){return a()},get positionAbsoluteX(){return A()},get positionAbsoluteY(){return V()},get width(){return O()},get height(){return z()}})})}F(Ue),Dt(Ue,(et,$e)=>ko==null?void 0:ko(et,$e),()=>({nodeId:g(),isSelectable:x(),disabled:!1,handleSelector:j(),noDragClass:"nodrag",nodeClickDistance:re(),onNodeMouseDown:Ae,onDrag:(et,$e,Ye,Le)=>{Y("nodedrag",{event:et,targetNode:Ye,nodes:Le})},onDragStart:(et,$e,Ye,Le)=>{Y("nodedragstart",{event:et,targetNode:Ye,nodes:Le})},onDragStop:(et,$e,Ye,Le)=>{Y("nodedragstop",{event:et,targetNode:Ye,nodes:Le})},store:de})),Ln(Ue,et=>te(U,et),()=>d(U)),tn(()=>ct("click",Ue,Ie)),tn(()=>ct("mouseenter",Ue,et=>Y("nodemouseenter",{node:f(),event:et}))),tn(()=>ct("mouseleave",Ue,et=>Y("nodemouseleave",{node:f(),event:et}))),tn(()=>ct("mousemove",Ue,et=>Y("nodemousemove",{node:f(),event:et}))),tn(()=>ct("contextmenu",Ue,et=>Y("nodecontextmenu",{node:f(),event:et}))),He((et,$e,Ye)=>{be(Ue,"data-id",g()),tt=Vt(Ue,1,et,null,tt,$e),ft=yt(Ue,`${P()??""??""};${d(h),G(()=>d(h).width)??""}${d(h),G(()=>d(h).height)??""}`,ft,Ye)},[()=>Cn((q(at),d(l),q(Q()),G(()=>at(["svelte-flow__node",`svelte-flow__node-${d(l)}`,Q()])))),()=>({dragging:S(),selected:b(),draggable:C(),connectable:p(),selectable:x(),nopan:C(),parent:I()}),()=>({"z-index":E(),transform:`translate(${A()??""}px, ${V()??""}px)`,visibility:X()?"visible":"hidden"})]),H(Z,Ue)};me(Ve,Z=>{m()||Z(je)})}H(e,ye);var gt=he({get node(){return f()},set node(Z){f(Z),y()},get id(){return g()},set id(Z){g(Z),y()},get data(){return v()},set data(Z){v(Z),y()},get selected(){return b()},set selected(Z){b(Z),y()},get draggable(){return C()},set draggable(Z){C(Z),y()},get selectable(){return x()},set selectable(Z){x(Z),y()},get connectable(){return p()},set connectable(Z){p(Z),y()},get deletable(){return _()},set deletable(Z){_(Z),y()},get hidden(){return m()},set hidden(Z){m(Z),y()},get dragging(){return S()},set dragging(Z){S(Z),y()},get resizeObserver(){return N()},set resizeObserver(Z){N(Z),y()},get style(){return P()},set style(Z){P(Z),y()},get type(){return D()},set type(Z){D(Z),y()},get isParent(){return I()},set isParent(Z){I(Z),y()},get positionX(){return A()},set positionX(Z){A(Z),y()},get positionY(){return V()},set positionY(Z){V(Z),y()},get sourcePosition(){return L()},set sourcePosition(Z){L(Z),y()},get targetPosition(){return R()},set targetPosition(Z){R(Z),y()},get zIndex(){return E()},set zIndex(Z){E(Z),y()},get measuredWidth(){return $()},set measuredWidth(Z){$(Z),y()},get measuredHeight(){return k()},set measuredHeight(Z){k(Z),y()},get initialWidth(){return T()},set initialWidth(Z){T(Z),y()},get initialHeight(){return M()},set initialHeight(Z){M(Z),y()},get width(){return O()},set width(Z){O(Z),y()},get height(){return z()},set height(Z){z(Z),y()},get dragHandle(){return j()},set dragHandle(Z){j(Z),y()},get initialized(){return X()},set initialized(Z){X(Z),y()},get parentId(){return ee()},set parentId(Z){ee(Z),y()},get nodeClickDistance(){return re()},set nodeClickDistance(Z){re(Z),y()},get class(){return Q()},set class(Z){Q(Z),y()}});return r(),gt}ce(Mf,{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 Zy=ie('<div class="svelte-flow__nodes svelte-tf4uy4"></div>');const jy={hash:"svelte-tf4uy4",code:".svelte-flow__nodes.svelte-tf4uy4 {width:100%;height:100%;position:absolute;left:0;top:0;}"};function Of(e,t){fe(t,!1),st(e,jy);const[n,r]=dt(),o=()=>oe(u,"$visibleNodes",n),i=()=>oe(h,"$nodesDraggable",n),s=()=>oe(g,"$elementsSelectable",n),a=()=>oe(f,"$nodesConnectable",n),l=()=>oe(b,"$parentLookup",n);let c=w(t,"nodeClickDistance",12,0);const{visibleNodes:u,nodesDraggable:h,nodesConnectable:f,elementsSelectable:g,updateNodeInternals:v,parentLookup:b}=Qe(),C=typeof ResizeObserver>"u"?null:new ResizeObserver(_=>{const m=new Map;_.forEach(S=>{const N=S.target.getAttribute("data-id");m.set(N,{id:N,nodeElement:S.target,force:!0})}),v(m)});Ja(()=>{C==null||C.disconnect()}),qe();var x=Zy();Wt(x,5,o,_=>_.id,(_,m)=>{{let S=Me(()=>(d(m),G(()=>!!d(m).selected))),N=Me(()=>(d(m),G(()=>!!d(m).hidden))),P=Me(()=>(d(m),i(),G(()=>!!(d(m).draggable||i()&&typeof d(m).draggable>"u")))),D=Me(()=>(d(m),s(),G(()=>!!(d(m).selectable||s()&&typeof d(m).selectable>"u")))),I=Me(()=>(d(m),a(),G(()=>!!(d(m).connectable||a()&&typeof d(m).connectable>"u")))),A=Me(()=>(d(m),G(()=>d(m).deletable??!0))),V=Me(()=>(l(),d(m),G(()=>l().has(d(m).id)))),L=Me(()=>(d(m),G(()=>d(m).type??"default"))),R=Me(()=>(d(m),G(()=>d(m).internals.z??0))),E=Me(()=>(q(Ls),d(m),G(()=>Ls(d(m)))));Mf(_,{get node(){return d(m)},get id(){return d(m),G(()=>d(m).id)},get data(){return d(m),G(()=>d(m).data)},get selected(){return d(S)},get hidden(){return d(N)},get draggable(){return d(P)},get selectable(){return d(D)},get connectable(){return d(I)},get deletable(){return d(A)},get positionX(){return d(m),G(()=>d(m).internals.positionAbsolute.x)},get positionY(){return d(m),G(()=>d(m).internals.positionAbsolute.y)},get isParent(){return d(V)},get style(){return d(m),G(()=>d(m).style)},get class(){return d(m),G(()=>d(m).class)},get type(){return d(L)},get sourcePosition(){return d(m),G(()=>d(m).sourcePosition)},get targetPosition(){return d(m),G(()=>d(m).targetPosition)},get dragging(){return d(m),G(()=>d(m).dragging)},get zIndex(){return d(R)},get dragHandle(){return d(m),G(()=>d(m).dragHandle)},get initialized(){return d(E)},get width(){return d(m),G(()=>d(m).width)},get height(){return d(m),G(()=>d(m).height)},get initialWidth(){return d(m),G(()=>d(m).initialWidth)},get initialHeight(){return d(m),G(()=>d(m).initialHeight)},get measuredWidth(){return d(m),G(()=>d(m).measured.width)},get measuredHeight(){return d(m),G(()=>d(m).measured.height)},get parentId(){return d(m),G(()=>d(m).parentId)},get resizeObserver(){return C},get nodeClickDistance(){return c()},$$events:{nodeclick($){Ze.call(this,t,$)},nodemouseenter($){Ze.call(this,t,$)},nodemousemove($){Ze.call(this,t,$)},nodemouseleave($){Ze.call(this,t,$)},nodedrag($){Ze.call(this,t,$)},nodedragstart($){Ze.call(this,t,$)},nodedragstop($){Ze.call(this,t,$)},nodecontextmenu($){Ze.call(this,t,$)}}})}}),F(x),H(e,x);var p=he({get nodeClickDistance(){return c()},set nodeClickDistance(_){c(_),y()}});return r(),p}ce(Of,{nodeClickDistance:{}},[],[],!0);var Uy=Ce('<svg><g role="img"><!></g></svg>');function Hf(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(Q,"$edgeTypes",n),i=()=>oe(de,"$flowId",n),s=()=>oe(ne,"$elementsSelectable",n),a=()=>oe(re,"$edgeLookup",n),l=ae(void 0,!0),c=ae(void 0,!0),u=ae(void 0,!0),h=ae(void 0,!0),f=ae(void 0,!0);let g=w(t,"id",13),v=w(t,"type",13,"default"),b=w(t,"source",13,""),C=w(t,"target",13,""),x=w(t,"data",29,()=>({})),p=w(t,"style",13,void 0),_=w(t,"zIndex",13,void 0),m=w(t,"animated",13,!1),S=w(t,"selected",13,!1),N=w(t,"selectable",13,void 0),P=w(t,"deletable",13,void 0),D=w(t,"hidden",13,!1),I=w(t,"label",13,void 0),A=w(t,"labelStyle",13,void 0),V=w(t,"markerStart",13,void 0),L=w(t,"markerEnd",13,void 0),R=w(t,"sourceHandle",13,void 0),E=w(t,"targetHandle",13,void 0),$=w(t,"sourceX",13),k=w(t,"sourceY",13),T=w(t,"targetX",13),M=w(t,"targetY",13),O=w(t,"sourcePosition",13),z=w(t,"targetPosition",13),j=w(t,"ariaLabel",13,void 0),X=w(t,"interactionWidth",13,void 0),ee=w(t,"class",13,"");oo("svelteflow__edge_id",g());const{edgeLookup:re,edgeTypes:Q,flowId:de,elementsSelectable:ne}=Qe(),_e=is(),Ne=yf();function Ae(Y){const we=a().get(g());we&&(Ne(g()),_e("edgeclick",{event:Y,edge:we}))}function le(Y,we){const Pe=a().get(g());Pe&&_e(we,{event:Y,edge:Pe})}ve(()=>q(v()),()=>{te(l,v()||"default")}),ve(()=>(o(),d(l),Fs),()=>{te(c,o()[d(l)]||Fs)}),ve(()=>(q(V()),i()),()=>{te(u,V()?`url('#${Al(V(),i())}')`:void 0)}),ve(()=>(q(L()),i()),()=>{te(h,L()?`url('#${Al(L(),i())}')`:void 0)}),ve(()=>(q(N()),s()),()=>{te(f,N()??s())}),Nt(),qe(!0);var pe=Ke(),se=ge(pe);{var U=Y=>{var we=Uy();let Pe;var De=W(we);let Be;var Ie=W(De);{let ye=Me(()=>P()??!0);Sc(Ie,()=>d(c),(Ve,je)=>{je(Ve,{get id(){return g()},get source(){return b()},get target(){return C()},get sourceX(){return $()},get sourceY(){return k()},get targetX(){return T()},get targetY(){return M()},get sourcePosition(){return O()},get targetPosition(){return z()},get animated(){return m()},get selected(){return S()},get label(){return I()},get labelStyle(){return A()},get data(){return x()},get style(){return p()},get interactionWidth(){return X()},get selectable(){return d(f)},get deletable(){return d(ye)},get type(){return d(l)},get sourceHandleId(){return R()},get targetHandleId(){return E()},get markerStart(){return d(u)},get markerEnd(){return d(h)}})})}F(De),F(we),He((ye,Ve,je)=>{Pe=yt(we,"",Pe,ye),Be=Vt(De,0,Ve,null,Be,je),be(De,"data-id",g()),be(De,"aria-label",j()===null?void 0:j()?j():`Edge from ${b()} to ${C()}`)},[()=>({"z-index":_()}),()=>Cn((q(at),q(ee()),G(()=>at(["svelte-flow__edge",ee()])))),()=>({animated:m(),selected:S(),selectable:d(f)})]),ct("click",De,Ae),ct("contextmenu",De,ye=>{le(ye,"edgecontextmenu")}),ct("mouseenter",De,ye=>{le(ye,"edgemouseenter")}),ct("mouseleave",De,ye=>{le(ye,"edgemouseleave")}),H(Y,we)};me(se,Y=>{D()||Y(U)})}H(e,pe);var ue=he({get id(){return g()},set id(Y){g(Y),y()},get type(){return v()},set type(Y){v(Y),y()},get source(){return b()},set source(Y){b(Y),y()},get target(){return C()},set target(Y){C(Y),y()},get data(){return x()},set data(Y){x(Y),y()},get style(){return p()},set style(Y){p(Y),y()},get zIndex(){return _()},set zIndex(Y){_(Y),y()},get animated(){return m()},set animated(Y){m(Y),y()},get selected(){return S()},set selected(Y){S(Y),y()},get selectable(){return N()},set selectable(Y){N(Y),y()},get deletable(){return P()},set deletable(Y){P(Y),y()},get hidden(){return D()},set hidden(Y){D(Y),y()},get label(){return I()},set label(Y){I(Y),y()},get labelStyle(){return A()},set labelStyle(Y){A(Y),y()},get markerStart(){return V()},set markerStart(Y){V(Y),y()},get markerEnd(){return L()},set markerEnd(Y){L(Y),y()},get sourceHandle(){return R()},set sourceHandle(Y){R(Y),y()},get targetHandle(){return E()},set targetHandle(Y){E(Y),y()},get sourceX(){return $()},set sourceX(Y){$(Y),y()},get sourceY(){return k()},set sourceY(Y){k(Y),y()},get targetX(){return T()},set targetX(Y){T(Y),y()},get targetY(){return M()},set targetY(Y){M(Y),y()},get sourcePosition(){return O()},set sourcePosition(Y){O(Y),y()},get targetPosition(){return z()},set targetPosition(Y){z(Y),y()},get ariaLabel(){return j()},set ariaLabel(Y){j(Y),y()},get interactionWidth(){return X()},set interactionWidth(Y){X(Y),y()},get class(){return ee()},set class(Y){ee(Y),y()}});return r(),ue}ce(Hf,{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 Af(e,t){fe(t,!1);let n=w(t,"onMount",12,void 0),r=w(t,"onDestroy",12,void 0);return gn(()=>{var o;return(o=n())==null||o(),r()}),qe(),he({get onMount(){return n()},set onMount(o){n(o),y()},get onDestroy(){return r()},set onDestroy(o){r(o),y()}})}ce(Af,{onMount:{},onDestroy:{}},[],[],!0);var Gy=Ce("<defs></defs>");function Df(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(i,"$markers",n),{markers:i}=Qe();qe();var s=Gy();Wt(s,5,o,a=>a.id,(a,l)=>{Vf(a,vt(()=>d(l)))}),F(s),H(e,s),he(),r()}ce(Df,{},[],[],!0);var Jy=Ce('<polyline stroke-linecap="round" stroke-linejoin="round" fill="none" points="-5,-4 0,0 -5,4"></polyline>'),Qy=Ce('<polyline stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>'),ew=Ce('<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>');function Vf(e,t){fe(t,!1);let n=w(t,"id",12),r=w(t,"type",12),o=w(t,"width",12,12.5),i=w(t,"height",12,12.5),s=w(t,"markerUnits",12,"strokeWidth"),a=w(t,"orient",12,"auto-start-reverse"),l=w(t,"color",12,void 0),c=w(t,"strokeWidth",12,void 0);qe();var u=ew(),h=W(u);{var f=v=>{var b=Jy();He(()=>{be(b,"stroke",l()),be(b,"stroke-width",c())}),H(v,b)},g=v=>{var b=Ke(),C=ge(b);{var x=p=>{var _=Qy();He(()=>{be(_,"stroke",l()),be(_,"stroke-width",c()),be(_,"fill",l())}),H(p,_)};me(C,p=>{q(r()),q(Yr),G(()=>r()===Yr.ArrowClosed)&&p(x)},!0)}H(v,b)};me(h,v=>{q(r()),q(Yr),G(()=>r()===Yr.Arrow)?v(f):v(g,!1)})}return F(u),He(()=>{be(u,"id",n()),be(u,"markerWidth",`${o()}`),be(u,"markerHeight",`${i()}`),be(u,"markerUnits",s()),be(u,"orient",a())}),H(e,u),he({get id(){return n()},set id(v){n(v),y()},get type(){return r()},set type(v){r(v),y()},get width(){return o()},set width(v){o(v),y()},get height(){return i()},set height(v){i(v),y()},get markerUnits(){return s()},set markerUnits(v){s(v),y()},get orient(){return a()},set orient(v){a(v),y()},get color(){return l()},set color(v){l(v),y()},get strokeWidth(){return c()},set strokeWidth(v){c(v),y()}})}ce(Vf,{id:{},type:{},width:{},height:{},markerUnits:{},orient:{},color:{},strokeWidth:{}},[],[],!0);var tw=ie('<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!> <!></div>');function If(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(a,"$visibleEdges",n),i=()=>oe(u,"$elementsSelectable",n);let s=w(t,"defaultEdgeOptions",12);const{visibleEdges:a,edgesInitialized:l,edges:{setDefaultOptions:c},elementsSelectable:u}=Qe();gn(()=>{s()&&c(s())}),qe();var h=tw(),f=W(h),g=W(f);Df(g,{}),F(f);var v=B(f,2);Wt(v,1,o,p=>p.id,(p,_)=>{{let m=Me(()=>(d(_),i(),G(()=>d(_).selectable??i()))),S=Me(()=>(d(_),G(()=>d(_).type||"default")));Hf(p,{get id(){return d(_),G(()=>d(_).id)},get source(){return d(_),G(()=>d(_).source)},get target(){return d(_),G(()=>d(_).target)},get data(){return d(_),G(()=>d(_).data)},get style(){return d(_),G(()=>d(_).style)},get animated(){return d(_),G(()=>d(_).animated)},get selected(){return d(_),G(()=>d(_).selected)},get selectable(){return d(m)},get deletable(){return d(_),G(()=>d(_).deletable)},get hidden(){return d(_),G(()=>d(_).hidden)},get label(){return d(_),G(()=>d(_).label)},get labelStyle(){return d(_),G(()=>d(_).labelStyle)},get markerStart(){return d(_),G(()=>d(_).markerStart)},get markerEnd(){return d(_),G(()=>d(_).markerEnd)},get sourceHandle(){return d(_),G(()=>d(_).sourceHandle)},get targetHandle(){return d(_),G(()=>d(_).targetHandle)},get sourceX(){return d(_),G(()=>d(_).sourceX)},get sourceY(){return d(_),G(()=>d(_).sourceY)},get targetX(){return d(_),G(()=>d(_).targetX)},get targetY(){return d(_),G(()=>d(_).targetY)},get sourcePosition(){return d(_),G(()=>d(_).sourcePosition)},get targetPosition(){return d(_),G(()=>d(_).targetPosition)},get ariaLabel(){return d(_),G(()=>d(_).ariaLabel)},get interactionWidth(){return d(_),G(()=>d(_).interactionWidth)},get class(){return d(_),G(()=>d(_).class)},get type(){return d(S)},get zIndex(){return d(_),G(()=>d(_).zIndex)},$$events:{edgeclick(N){Ze.call(this,t,N)},edgecontextmenu(N){Ze.call(this,t,N)},edgemouseenter(N){Ze.call(this,t,N)},edgemouseleave(N){Ze.call(this,t,N)}}})}});var b=B(v,2);{var C=p=>{Af(p,{onMount:()=>{us(l,!0)},onDestroy:()=>{us(l,!1)}})};me(b,p=>{o(),G(()=>o().length>0)&&p(C)})}F(h),H(e,h);var x=he({get defaultEdgeOptions(){return s()},set defaultEdgeOptions(p){s(p),y()}});return r(),x}ce(If,{defaultEdgeOptions:{}},[],[],!0);var nw=ie('<div class="svelte-flow__selection svelte-1iugwpu"></div>');const rw={hash:"svelte-1iugwpu",code:".svelte-flow__selection.svelte-1iugwpu {position:absolute;top:0;left:0;}"};function ql(e,t){fe(t,!1),st(e,rw);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=Ke(),l=ge(a);{var c=u=>{var h=nw();let f;He(g=>f=yt(h,"",f,g),[()=>({width:typeof o()=="string"?o():`${o()}px`,height:typeof i()=="string"?i():`${i()}px`,transform:`translate(${n()}px, ${r()}px)`})]),H(u,h)};me(l,u=>{s()&&u(c)})}return H(e,a),he({get x(){return n()},set x(u){n(u),y()},get y(){return r()},set y(u){r(u),y()},get width(){return o()},set width(u){o(u),y()},get height(){return i()},set height(u){i(u),y()},get isVisible(){return s()},set isVisible(u){s(u),y()}})}ce(ql,{x:{},y:{},width:{},height:{},isVisible:{}},[],[],!0);function Lf(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(s,"$selectionRect",n),i=()=>oe(a,"$selectionRectMode",n),{selectionRect:s,selectionRectMode:a}=Qe();qe();{let l=Me(()=>!!(o()&&i()==="user")),c=Me(()=>{var g;return(g=o())==null?void 0:g.width}),u=Me(()=>{var g;return(g=o())==null?void 0:g.height}),h=Me(()=>{var g;return(g=o())==null?void 0:g.x}),f=Me(()=>{var g;return(g=o())==null?void 0:g.y});ql(e,{get isVisible(){return d(l)},get width(){return d(c)},get height(){return d(u)},get x(){return d(h)},get y(){return d(f)}})}he(),r()}ce(Lf,{},[],[],!0);var ow=ie('<div class="selection-wrapper nopan svelte-5pxri" role="button" tabindex="-1"><!></div>');const iw={hash:"svelte-5pxri",code:".selection-wrapper.svelte-5pxri {position:absolute;top:0;left:0;z-index:7;pointer-events:all;}"};function zf(e,t){fe(t,!1),st(e,iw);const[n,r]=dt(),o=()=>oe(l,"$selectionRectMode",n),i=()=>oe(u,"$nodeLookup",n),s=()=>oe(c,"$nodes",n),a=Qe(),{selectionRectMode:l,nodes:c,nodeLookup:u}=a,h=is();let f=ae(null);function g(p){const _=s().filter(m=>m.selected);h("selectioncontextmenu",{nodes:_,event:p})}function v(p){const _=s().filter(m=>m.selected);h("selectionclick",{nodes:_,event:p})}ve(()=>(o(),i(),s()),()=>{o()==="nodes"&&(te(f,vi(i(),{filter:p=>!!p.selected})),s())}),Nt(),qe();var b=Ke(),C=ge(b);{var x=p=>{var _=ow(),m=W(_);ql(m,{width:"100%",height:"100%",x:0,y:0}),F(_),Dt(_,(S,N)=>ko==null?void 0:ko(S,N),()=>({disabled:!1,store:a,onDrag:(S,N,P,D)=>{h("nodedrag",{event:S,targetNode:null,nodes:D})},onDragStart:(S,N,P,D)=>{h("nodedragstart",{event:S,targetNode:null,nodes:D})},onDragStop:(S,N,P,D)=>{h("nodedragstop",{event:S,targetNode:null,nodes:D})}})),tn(()=>ct("contextmenu",_,g)),tn(()=>ct("click",_,v)),tn(()=>ct("keyup",_,()=>{})),He(()=>yt(_,`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)`)),H(p,_)};me(C,p=>{o(),d(f),q(Bn),G(()=>o()==="nodes"&&d(f)&&Bn(d(f).x)&&Bn(d(f).y))&&p(x)})}H(e,b),he(),r()}ce(zf,{},[],[],!0);function rt(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:h,key:f,callback:g,preventDefault:v,enabled:b}=u;if(b){if(h.length&&!(Array.isArray(h)?h:[h]).map(p=>typeof p=="string"?[p]:p).some(p=>p.every(_=>l[_])))continue;if(s.key===f){v&&s.preventDefault();const C={node:e,trigger:u,originalEvent:s};e.dispatchEvent(new CustomEvent("shortcut",{detail:C})),g==null||g(C)}}}}return n&&e.addEventListener(o,i),{update:s=>{const{enabled:a=!0,type:l="keydown"}=s;n&&(!a||o!==l)?e.removeEventListener(o,i):!n&&a&&e.addEventListener(l,i),n=a,o=l,r=s.trigger},destroy:()=>{e.removeEventListener(o,i)}}}function Rf(e,t){fe(t,!1);let n=w(t,"selectionKey",12,"Shift"),r=w(t,"multiSelectionKey",28,()=>Is()?"Meta":"Control"),o=w(t,"deleteKey",12,"Backspace"),i=w(t,"panActivationKey",12," "),s=w(t,"zoomActivationKey",28,()=>Is()?"Meta":"Control");const{selectionKeyPressed:a,multiselectionKeyPressed:l,deleteKeyPressed:c,panActivationKeyPressed:u,zoomActivationKeyPressed:h,selectionRect:f}=Qe();function g(p){return p!==null&&typeof p=="object"}function v(p){return g(p)?p.modifier||[]:[]}function b(p){return p==null?"":g(p)?p.key:p}function C(p,_){return(Array.isArray(p)?p:[p]).map(S=>{const N=b(S);return{key:N,modifier:v(S),enabled:N!==null,callback:_}})}function x(){f.set(null),a.set(!1),l.set(!1),c.set(!1),u.set(!1),h.set(!1)}return qe(),ct("blur",Zt,x),ct("contextmenu",Zt,x),Dt(Zt,(p,_)=>rt==null?void 0:rt(p,_),()=>({trigger:C(n(),()=>a.set(!0)),type:"keydown"})),Dt(Zt,(p,_)=>rt==null?void 0:rt(p,_),()=>({trigger:C(n(),()=>a.set(!1)),type:"keyup"})),Dt(Zt,(p,_)=>rt==null?void 0:rt(p,_),()=>({trigger:C(r(),()=>l.set(!0)),type:"keydown"})),Dt(Zt,(p,_)=>rt==null?void 0:rt(p,_),()=>({trigger:C(r(),()=>l.set(!1)),type:"keyup"})),Dt(Zt,(p,_)=>rt==null?void 0:rt(p,_),()=>({trigger:C(o(),p=>{!(p.originalEvent.ctrlKey||p.originalEvent.metaKey||p.originalEvent.shiftKey)&&!zm(p.originalEvent)&&c.set(!0)}),type:"keydown"})),Dt(Zt,(p,_)=>rt==null?void 0:rt(p,_),()=>({trigger:C(o(),()=>c.set(!1)),type:"keyup"})),Dt(Zt,(p,_)=>rt==null?void 0:rt(p,_),()=>({trigger:C(i(),()=>u.set(!0)),type:"keydown"})),Dt(Zt,(p,_)=>rt==null?void 0:rt(p,_),()=>({trigger:C(i(),()=>u.set(!1)),type:"keyup"})),Dt(Zt,(p,_)=>rt==null?void 0:rt(p,_),()=>({trigger:C(s(),()=>h.set(!0)),type:"keydown"})),Dt(Zt,(p,_)=>rt==null?void 0:rt(p,_),()=>({trigger:C(s(),()=>h.set(!1)),type:"keyup"})),he({get selectionKey(){return n()},set selectionKey(p){n(p),y()},get multiSelectionKey(){return r()},set multiSelectionKey(p){r(p),y()},get deleteKey(){return o()},set deleteKey(p){o(p),y()},get panActivationKey(){return i()},set panActivationKey(p){i(p),y()},get zoomActivationKey(){return s()},set zoomActivationKey(p){s(p),y()}})}ce(Rf,{selectionKey:{},multiSelectionKey:{},deleteKey:{},panActivationKey:{},zoomActivationKey:{}},[],[],!0);var sw=Ce('<path fill="none" class="svelte-flow__connection-path"></path>'),aw=Ce('<svg class="svelte-flow__connectionline"><g><!><!></g></svg>');function Bf(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(g,"$connection",n),i=()=>oe(v,"$connectionLineType",n),s=()=>oe(h,"$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:h,height:f,connection:g,connectionLineType:v}=Qe();let b=ae(null);ve(()=>(o(),q(u()),i(),d(b),Hl),()=>{if(o().inProgress&&!u()){const{from:m,to:S,fromPosition:N,toPosition:P}=o(),D={sourceX:m.x,sourceY:m.y,sourcePosition:N,targetX:S.x,targetY:S.y,targetPosition:P};switch(i()){case _o.Bezier:(I=>{var A=ur(I,1);te(b,A[0])})(Kd(D));break;case _o.Step:(I=>{var A=ur(I,1);te(b,A[0])})(Rs({...D,borderRadius:0}));break;case _o.SmoothStep:(I=>{var A=ur(I,1);te(b,A[0])})(Rs(D));break;default:(I=>{var A=ur(I,1);te(b,A[0])})(Hl(D))}}}),Nt(),qe();var C=Ke(),x=ge(C);{var p=m=>{var S=aw(),N=W(S),P=W(N);At(P,t,"connectionLine",{});var D=B(P);{var I=A=>{var V=sw();He(()=>{be(V,"d",d(b)),yt(V,c())}),H(A,V)};me(D,A=>{u()||A(I)})}F(N),F(S),He(A=>{be(S,"width",s()),be(S,"height",a()),yt(S,l()),Vt(N,0,A)},[()=>Cn((q(at),q(Ad),o(),G(()=>at(["svelte-flow__connection",Ad(o().isValid)]))))]),H(m,S)};me(x,m=>{o(),G(()=>o().inProgress)&&m(p)})}H(e,C);var _=he({get containerStyle(){return l()},set containerStyle(m){l(m),y()},get style(){return c()},set style(m){c(m),y()},get isCustomComponent(){return u()},set isCustomComponent(m){u(m),y()}});return r(),_}ce(Bf,{containerStyle:{},style:{},isCustomComponent:{}},["connectionLine"],[],!0);var lw=ie("<div><!></div>");function _i(e,t){const n=ht(t,["children","$$slots","$$events","$$legacy","$$host"]),r=ht(n,["position","style","class"]);fe(t,!1);const[o,i]=dt(),s=()=>oe(h,"$selectionRectMode",o),a=ae();let l=w(t,"position",12,"top-right"),c=w(t,"style",12,void 0),u=w(t,"class",12,void 0);const{selectionRectMode:h}=Qe();ve(()=>q(l()),()=>{te(a,`${l()}`.split("-"))}),Nt(),qe();var f=lw();rn(f,(b,C)=>({class:b,style:c(),...r,[zr]:C}),[()=>(q(at),q(u()),d(a),G(()=>at(["svelte-flow__panel",u(),...d(a)]))),()=>({"pointer-events":s()?"none":""})]);var g=W(f);At(g,t,"default",{}),F(f),H(e,f);var v=he({get position(){return l()},set position(b){l(b),y()},get style(){return c()},set style(b){c(b),y()},get class(){return u()},set class(b){u(b),y()}});return i(),v}ce(_i,{position:{},style:{},class:{}},["default"],[],!0);var uw=ie('<a href="https://svelteflow.dev" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>');function qf(e,t){fe(t,!1);let n=w(t,"proOptions",12,void 0),r=w(t,"position",12,"bottom-right");qe();var o=Ke(),i=ge(o);{var s=a=>{_i(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=uw();H(l,u)},$$slots:{default:!0}})};me(i,a=>{q(n()),G(()=>{var l;return!((l=n())!=null&&l.hideAttribution)})&&a(s)})}return H(e,o),he({get proOptions(){return n()},set proOptions(a){n(a),y()},get position(){return r()},set position(a){r(a),y()}})}ce(qf,{proOptions:{},position:{}},[],[],!0);function Ff(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 cw=e=>Object.keys(e);function Yf(e,t){cw(t).forEach(n=>{const r=t[n];r!==void 0&&e[n].set(r)})}function dw(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function fw(e="light"){return vn("light",n=>{if(e!=="system"){n(e);return}const r=dw(),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 hw=ie('<!> <!> <div class="svelte-flow__edgelabel-renderer"></div> <div class="svelte-flow__viewport-portal"></div> <!> <!>',1),gw=ie("<!> <!>",1),vw=ie("<div><!> <!> <!> <!></div>");const pw={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 Wf(e,t){const n=Nv(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),st(e,pw);const[i,s]=dt(),a=()=>oe(_(),"$viewport",i),l=()=>oe(nu,"$initialized",i),c=()=>oe(d(u),"$colorModeClass",i),u=ae();let h=w(t,"id",12,"1"),f=w(t,"nodes",12),g=w(t,"edges",12),v=w(t,"fitView",12,void 0),b=w(t,"fitViewOptions",12,void 0),C=w(t,"minZoom",12,void 0),x=w(t,"maxZoom",12,void 0),p=w(t,"initialViewport",12,void 0),_=w(t,"viewport",12,void 0),m=w(t,"nodeTypes",12,void 0),S=w(t,"edgeTypes",12,void 0),N=w(t,"selectionKey",12,void 0),P=w(t,"selectionMode",12,void 0),D=w(t,"panActivationKey",12,void 0),I=w(t,"multiSelectionKey",12,void 0),A=w(t,"zoomActivationKey",12,void 0),V=w(t,"nodesDraggable",12,void 0),L=w(t,"nodesConnectable",12,void 0),R=w(t,"nodeDragThreshold",12,void 0),E=w(t,"elementsSelectable",12,void 0),$=w(t,"snapGrid",12,void 0),k=w(t,"deleteKey",12,void 0),T=w(t,"connectionRadius",12,void 0),M=w(t,"connectionLineType",12,void 0),O=w(t,"connectionMode",28,()=>Fr.Strict),z=w(t,"connectionLineStyle",12,""),j=w(t,"connectionLineContainerStyle",12,""),X=w(t,"onMoveStart",12,void 0),ee=w(t,"onMove",12,void 0),re=w(t,"onMoveEnd",12,void 0),Q=w(t,"isValidConnection",12,void 0),de=w(t,"translateExtent",12,void 0),ne=w(t,"nodeExtent",12,void 0),_e=w(t,"onlyRenderVisibleElements",12,void 0),Ne=w(t,"panOnScrollMode",28,()=>Qn.Free),Ae=w(t,"preventScrolling",12,!0),le=w(t,"zoomOnScroll",12,!0),pe=w(t,"zoomOnDoubleClick",12,!0),se=w(t,"zoomOnPinch",12,!0),U=w(t,"panOnScroll",12,!1),ue=w(t,"panOnDrag",12,!0),Y=w(t,"selectionOnDrag",12,void 0),we=w(t,"autoPanOnConnect",12,!0),Pe=w(t,"autoPanOnNodeDrag",12,!0),De=w(t,"onerror",12,void 0),Be=w(t,"ondelete",12,void 0),Ie=w(t,"onedgecreate",12,void 0),ye=w(t,"attributionPosition",12,void 0),Ve=w(t,"proOptions",12,void 0),je=w(t,"defaultEdgeOptions",12,void 0),gt=w(t,"width",12,void 0),Z=w(t,"height",12,void 0),Ue=w(t,"colorMode",12,"light"),tt=w(t,"onconnect",12,void 0),ft=w(t,"onconnectstart",12,void 0),an=w(t,"onconnectend",12,void 0),et=w(t,"onbeforedelete",12,void 0),$e=w(t,"oninit",12,void 0),Ye=w(t,"nodeOrigin",12,void 0),Le=w(t,"paneClickDistance",12,0),Ot=w(t,"nodeClickDistance",12,0),St=w(t,"defaultMarkerColor",12,"#b1b1b7"),Mi=w(t,"style",12,void 0),Gr=w(t,"class",12,void 0),Oi=ae(),Ht=ae(),Kt=ae();const Io=a()||p(),Je=Bg(Ys)?Qe():zy({nodes:J(f()),edges:J(g()),width:gt(),height:Z(),fitView:v(),nodeOrigin:Ye(),nodeExtent:ne()});gn(()=>(Je.width.set(d(Ht)),Je.height.set(d(Kt)),Je.domNode.set(d(Oi)),Je.syncNodeStores(f()),Je.syncEdgeStores(g()),Je.syncViewport(_()),v()!==void 0&&Je.fitViewQueued.set(v()),b()&&Je.fitViewOptions.set(b()),Ff(Je,{nodeTypes:m(),edgeTypes:S(),minZoom:C(),maxZoom:x(),translateExtent:de(),paneClickDistance:Le()}),()=>{Je.reset()}));const{initialized:nu}=Je;let Hi=ae(!1);ve(()=>(d(Ht),d(Kt)),()=>{d(Ht)!==void 0&&d(Kt)!==void 0&&(Je.width.set(d(Ht)),Je.height.set(d(Kt)))}),ve(()=>(d(Hi),l(),q($e())),()=>{var K;!d(Hi)&&l()&&((K=$e())==null||K(),te(Hi,!0))}),ve(()=>(q(h()),q(M()),q(T()),q(P()),q($()),q(St()),q(V()),q(L()),q(E()),q(_e()),q(Q()),q(we()),q(Pe()),q(De()),q(Be()),q(Ie()),q(O()),q(R()),q(tt()),q(ft()),q(an()),q(et()),q(Ye()),Yf),()=>{const K={flowId:h(),connectionLineType:M(),connectionRadius:T(),selectionMode:P(),snapGrid:$(),defaultMarkerColor:St(),nodesDraggable:V(),nodesConnectable:L(),elementsSelectable:E(),onlyRenderVisibleElements:_e(),isValidConnection:Q(),autoPanOnConnect:we(),autoPanOnNodeDrag:Pe(),onerror:De(),ondelete:Be(),onedgecreate:Ie(),connectionMode:O(),nodeDragThreshold:R(),onconnect:tt(),onconnectstart:ft(),onconnectend:an(),onbeforedelete:et(),nodeOrigin:Ye()};Yf(Je,K)}),ve(()=>(q(m()),q(S()),q(C()),q(x()),q(de()),q(Le())),()=>{Ff(Je,{nodeTypes:m(),edgeTypes:S(),minZoom:C(),maxZoom:x(),translateExtent:de(),paneClickDistance:Le()})}),ve(()=>q(Ue()),()=>{Rv(te(u,fw(Ue())),"$colorModeClass",i)}),Nt(),qe();var ln=vw();rn(ln,K=>({style:Mi(),class:K,"data-testid":"svelte-flow__wrapper",...o,role:"application"}),[()=>(q(at),q(Gr()),c(),G(()=>at(["svelte-flow",Gr(),c()])))],void 0,"svelte-18e9ir1");var ra=W(ln);Rf(ra,{get selectionKey(){return N()},get deleteKey(){return k()},get panActivationKey(){return D()},get multiSelectionKey(){return I()},get zoomActivationKey(){return A()}});var oa=B(ra,2);{let K=Me(()=>(q(Ne()),q(Qn),G(()=>Ne()===void 0?Qn.Free:Ne()))),c5=Me(()=>Ae()===void 0?!0:Ae()),d5=Me(()=>le()===void 0?!0:le()),f5=Me(()=>pe()===void 0?!0:pe()),h5=Me(()=>se()===void 0?!0:se()),g5=Me(()=>U()===void 0?!1:U()),v5=Me(()=>ue()===void 0?!0:ue()),p5=Me(()=>Le()===void 0?0:Le());Sf(oa,{get initialViewport(){return Io},get onMoveStart(){return X()},get onMove(){return ee()},get onMoveEnd(){return re()},get panOnScrollMode(){return d(K)},get preventScrolling(){return d(c5)},get zoomOnScroll(){return d(d5)},get zoomOnDoubleClick(){return d(f5)},get zoomOnPinch(){return d(h5)},get panOnScroll(){return d(g5)},get panOnDrag(){return d(v5)},get paneClickDistance(){return d(p5)},children:(m5,k5)=>{{let y5=Me(()=>ue()===void 0?!0:ue());Nf(m5,{get panOnDrag(){return d(y5)},get selectionOnDrag(){return Y()},$$events:{paneclick(Ai){Ze.call(this,t,Ai)},panecontextmenu(Ai){Ze.call(this,t,Ai)}},children:(Ai,P5)=>{var G1=gw(),J1=ge(G1);Tf(J1,{children:(_5,N5)=>{var Q1=hw(),eh=ge(Q1);If(eh,{get defaultEdgeOptions(){return je()},$$events:{edgeclick(Xe){Ze.call(this,t,Xe)},edgecontextmenu(Xe){Ze.call(this,t,Xe)},edgemouseenter(Xe){Ze.call(this,t,Xe)},edgemouseleave(Xe){Ze.call(this,t,Xe)}}});var th=B(eh,2);Bf(th,{get containerStyle(){return j()},get style(){return z()},isCustomComponent:G(()=>n.connectionLine),$$slots:{connectionLine:(Xe,T5)=>{var rh=Ke(),x5=ge(rh);At(x5,t,"connectionLine",{}),H(Xe,rh)}}});var nh=B(th,6);Of(nh,{get nodeClickDistance(){return Ot()},$$events:{nodeclick(Xe){Ze.call(this,t,Xe)},nodemouseenter(Xe){Ze.call(this,t,Xe)},nodemousemove(Xe){Ze.call(this,t,Xe)},nodemouseleave(Xe){Ze.call(this,t,Xe)},nodedragstart(Xe){Ze.call(this,t,Xe)},nodedrag(Xe){Ze.call(this,t,Xe)},nodedragstop(Xe){Ze.call(this,t,Xe)},nodecontextmenu(Xe){Ze.call(this,t,Xe)}}});var b5=B(nh,2);zf(b5,{$$events:{selectionclick(Xe){Ze.call(this,t,Xe)},selectioncontextmenu(Xe){Ze.call(this,t,Xe)},nodedragstart(Xe){Ze.call(this,t,Xe)},nodedrag(Xe){Ze.call(this,t,Xe)},nodedragstop(Xe){Ze.call(this,t,Xe)}}}),H(_5,Q1)},$$slots:{default:!0}});var w5=B(J1,2);Lf(w5,{}),H(Ai,G1)},$$slots:{default:!0}})}},$$slots:{default:!0}})}var ia=B(oa,2);qf(ia,{get proOptions(){return Ve()},get position(){return ye()}});var ru=B(ia,2);At(ru,t,"default",{}),F(ln),Ln(ln,K=>te(Oi,K),()=>d(Oi)),Dc(ln,"clientWidth",K=>te(Ht,K)),Dc(ln,"clientHeight",K=>te(Kt,K)),ct("dragover",ln,function(K){Ze.call(this,t,K)}),ct("drop",ln,function(K){Ze.call(this,t,K)}),H(e,ln);var u5=he({get id(){return h()},set id(K){h(K),y()},get nodes(){return f()},set nodes(K){f(K),y()},get edges(){return g()},set edges(K){g(K),y()},get fitView(){return v()},set fitView(K){v(K),y()},get fitViewOptions(){return b()},set fitViewOptions(K){b(K),y()},get minZoom(){return C()},set minZoom(K){C(K),y()},get maxZoom(){return x()},set maxZoom(K){x(K),y()},get initialViewport(){return p()},set initialViewport(K){p(K),y()},get viewport(){return _()},set viewport(K){_(K),y()},get nodeTypes(){return m()},set nodeTypes(K){m(K),y()},get edgeTypes(){return S()},set edgeTypes(K){S(K),y()},get selectionKey(){return N()},set selectionKey(K){N(K),y()},get selectionMode(){return P()},set selectionMode(K){P(K),y()},get panActivationKey(){return D()},set panActivationKey(K){D(K),y()},get multiSelectionKey(){return I()},set multiSelectionKey(K){I(K),y()},get zoomActivationKey(){return A()},set zoomActivationKey(K){A(K),y()},get nodesDraggable(){return V()},set nodesDraggable(K){V(K),y()},get nodesConnectable(){return L()},set nodesConnectable(K){L(K),y()},get nodeDragThreshold(){return R()},set nodeDragThreshold(K){R(K),y()},get elementsSelectable(){return E()},set elementsSelectable(K){E(K),y()},get snapGrid(){return $()},set snapGrid(K){$(K),y()},get deleteKey(){return k()},set deleteKey(K){k(K),y()},get connectionRadius(){return T()},set connectionRadius(K){T(K),y()},get connectionLineType(){return M()},set connectionLineType(K){M(K),y()},get connectionMode(){return O()},set connectionMode(K){O(K),y()},get connectionLineStyle(){return z()},set connectionLineStyle(K){z(K),y()},get connectionLineContainerStyle(){return j()},set connectionLineContainerStyle(K){j(K),y()},get onMoveStart(){return X()},set onMoveStart(K){X(K),y()},get onMove(){return ee()},set onMove(K){ee(K),y()},get onMoveEnd(){return re()},set onMoveEnd(K){re(K),y()},get isValidConnection(){return Q()},set isValidConnection(K){Q(K),y()},get translateExtent(){return de()},set translateExtent(K){de(K),y()},get nodeExtent(){return ne()},set nodeExtent(K){ne(K),y()},get onlyRenderVisibleElements(){return _e()},set onlyRenderVisibleElements(K){_e(K),y()},get panOnScrollMode(){return Ne()},set panOnScrollMode(K){Ne(K),y()},get preventScrolling(){return Ae()},set preventScrolling(K){Ae(K),y()},get zoomOnScroll(){return le()},set zoomOnScroll(K){le(K),y()},get zoomOnDoubleClick(){return pe()},set zoomOnDoubleClick(K){pe(K),y()},get zoomOnPinch(){return se()},set zoomOnPinch(K){se(K),y()},get panOnScroll(){return U()},set panOnScroll(K){U(K),y()},get panOnDrag(){return ue()},set panOnDrag(K){ue(K),y()},get selectionOnDrag(){return Y()},set selectionOnDrag(K){Y(K),y()},get autoPanOnConnect(){return we()},set autoPanOnConnect(K){we(K),y()},get autoPanOnNodeDrag(){return Pe()},set autoPanOnNodeDrag(K){Pe(K),y()},get onerror(){return De()},set onerror(K){De(K),y()},get ondelete(){return Be()},set ondelete(K){Be(K),y()},get onedgecreate(){return Ie()},set onedgecreate(K){Ie(K),y()},get attributionPosition(){return ye()},set attributionPosition(K){ye(K),y()},get proOptions(){return Ve()},set proOptions(K){Ve(K),y()},get defaultEdgeOptions(){return je()},set defaultEdgeOptions(K){je(K),y()},get width(){return gt()},set width(K){gt(K),y()},get height(){return Z()},set height(K){Z(K),y()},get colorMode(){return Ue()},set colorMode(K){Ue(K),y()},get onconnect(){return tt()},set onconnect(K){tt(K),y()},get onconnectstart(){return ft()},set onconnectstart(K){ft(K),y()},get onconnectend(){return an()},set onconnectend(K){an(K),y()},get onbeforedelete(){return et()},set onbeforedelete(K){et(K),y()},get oninit(){return $e()},set oninit(K){$e(K),y()},get nodeOrigin(){return Ye()},set nodeOrigin(K){Ye(K),y()},get paneClickDistance(){return Le()},set paneClickDistance(K){Le(K),y()},get nodeClickDistance(){return Ot()},set nodeClickDistance(K){Ot(K),y()},get defaultMarkerColor(){return St()},set defaultMarkerColor(K){St(K),y()},get style(){return Mi()},set style(K){Mi(K),y()},get class(){return Gr()},set class(K){Gr(K),y()}});return s(),u5}ce(Wf,{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 Kf(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=Ef({nodes:n(),edges:r(),width:o(),height:i(),nodeOrigin:a(),fitView:s()});oo(Ys,{getStore:()=>l}),Ja(()=>{l.reset()}),qe();var c=Ke(),u=ge(c);return At(u,t,"default",{}),H(e,c),he({get initialNodes(){return n()},set initialNodes(h){n(h),y()},get initialEdges(){return r()},set initialEdges(h){r(h),y()},get initialWidth(){return o()},set initialWidth(h){o(h),y()},get initialHeight(){return i()},set initialHeight(h){i(h),y()},get fitView(){return s()},set fitView(h){s(h),y()},get nodeOrigin(){return a()},set nodeOrigin(h){a(h),y()}})}ce(Kf,{initialNodes:{},initialEdges:{},initialWidth:{},initialHeight:{},fitView:{},nodeOrigin:{}},["default"],[],!0);var mw=ie("<button><!></button>");function bi(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);qe();var u=mw();rn(u,(f,g)=>({type:"button",class:f,...r,[zr]:g}),[()=>(q(at),q(o()),G(()=>at(["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 h=W(u);return At(h,t,"default",{class:"button-svg"}),F(u),ct("click",u,function(f){Ze.call(this,t,f)}),H(e,u),he({get class(){return o()},set class(f){o(f),y()},get bgColor(){return i()},set bgColor(f){i(f),y()},get bgColorHover(){return s()},set bgColorHover(f){s(f),y()},get color(){return a()},set color(f){a(f),y()},get colorHover(){return l()},set colorHover(f){l(f),y()},get borderColor(){return c()},set borderColor(f){c(f),y()}})}ce(bi,{class:{},bgColor:{},bgColorHover:{},color:{},colorHover:{},borderColor:{}},["default"],[],!0);var yw=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 Xf(e){var t=yw();H(e,t)}ce(Xf,{},[],[],!0);var ww=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg>');function Zf(e){var t=ww();H(e,t)}ce(Zf,{},[],[],!0);var _w=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 jf(e){var t=_w();H(e,t)}ce(jf,{},[],[],!0);var bw=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 Uf(e){var t=bw();H(e,t)}ce(Uf,{},[],[],!0);var xw=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 Gf(e){var t=xw();H(e,t)}ce(Gf,{},[],[],!0);var Cw=ie("<!> <!>",1),$w=ie("<!> <!> <!> <!> <!> <!>",1);function Jf(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(M,"$nodesDraggable",n),i=()=>oe(O,"$nodesConnectable",n),s=()=>oe(z,"$elementsSelectable",n),a=()=>oe($,"$viewport",n),l=()=>oe(k,"$minZoom",n),c=()=>oe(T,"$maxZoom",n),u=ae(),h=ae(),f=ae(),g=ae();let v=w(t,"position",12,"bottom-left"),b=w(t,"showZoom",12,!0),C=w(t,"showFitView",12,!0),x=w(t,"showLock",12,!0),p=w(t,"buttonBgColor",12,void 0),_=w(t,"buttonBgColorHover",12,void 0),m=w(t,"buttonColor",12,void 0),S=w(t,"buttonColorHover",12,void 0),N=w(t,"buttonBorderColor",12,void 0),P=w(t,"ariaLabel",12,void 0),D=w(t,"style",12,void 0),I=w(t,"orientation",12,"vertical"),A=w(t,"fitViewOptions",12,void 0),V=w(t,"class",12,"");const{zoomIn:L,zoomOut:R,fitView:E,viewport:$,minZoom:k,maxZoom:T,nodesDraggable:M,nodesConnectable:O,elementsSelectable:z}=Qe(),j={bgColor:p(),bgColorHover:_(),color:m(),colorHover:S(),borderColor:N()},X=()=>{L()},ee=()=>{R()},re=()=>{E(A())},Q=()=>{te(u,!d(u)),M.set(d(u)),O.set(d(u)),z.set(d(u))};ve(()=>(o(),i(),s()),()=>{te(u,o()||i()||s())}),ve(()=>(a(),l()),()=>{te(h,a().zoom<=l())}),ve(()=>(a(),c()),()=>{te(f,a().zoom>=c())}),ve(()=>q(I()),()=>{te(g,I()==="horizontal"?"horizontal":"vertical")}),Nt(),qe();{let ne=Me(()=>(q(at),d(g),q(V()),G(()=>at(["svelte-flow__controls",d(g),V()])))),_e=Me(()=>P()??"Svelte Flow controls");_i(e,{get class(){return d(ne)},get position(){return v()},"data-testid":"svelte-flow__controls",get"aria-label"(){return d(_e)},get style(){return D()},children:(Ne,Ae)=>{var le=$w(),pe=ge(le);At(pe,t,"before",{});var se=B(pe,2);{var U=Ie=>{var ye=Cw(),Ve=ge(ye);bi(Ve,vt({class:"svelte-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",get disabled(){return d(f)}},()=>j,{$$events:{click:X},children:(gt,Z)=>{Xf(gt)},$$slots:{default:!0}}));var je=B(Ve,2);bi(je,vt({class:"svelte-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",get disabled(){return d(h)}},()=>j,{$$events:{click:ee},children:(gt,Z)=>{Zf(gt)},$$slots:{default:!0}})),H(Ie,ye)};me(se,Ie=>{b()&&Ie(U)})}var ue=B(se,2);{var Y=Ie=>{bi(Ie,vt({class:"svelte-flow__controls-fitview",title:"fit view","aria-label":"fit view"},()=>j,{$$events:{click:re},children:(ye,Ve)=>{jf(ye)},$$slots:{default:!0}}))};me(ue,Ie=>{C()&&Ie(Y)})}var we=B(ue,2);{var Pe=Ie=>{bi(Ie,vt({class:"svelte-flow__controls-interactive",title:"toggle interactivity","aria-label":"toggle interactivity"},()=>j,{$$events:{click:Q},children:(ye,Ve)=>{var je=Ke(),gt=ge(je);{var Z=tt=>{Gf(tt)},Ue=tt=>{Uf(tt)};me(gt,tt=>{d(u)?tt(Z):tt(Ue,!1)})}H(ye,je)},$$slots:{default:!0}}))};me(we,Ie=>{x()&&Ie(Pe)})}var De=B(we,2);At(De,t,"default",{});var Be=B(De,2);At(Be,t,"after",{}),H(Ne,le)},$$slots:{default:!0}})}var de=he({get position(){return v()},set position(ne){v(ne),y()},get showZoom(){return b()},set showZoom(ne){b(ne),y()},get showFitView(){return C()},set showFitView(ne){C(ne),y()},get showLock(){return x()},set showLock(ne){x(ne),y()},get buttonBgColor(){return p()},set buttonBgColor(ne){p(ne),y()},get buttonBgColorHover(){return _()},set buttonBgColorHover(ne){_(ne),y()},get buttonColor(){return m()},set buttonColor(ne){m(ne),y()},get buttonColorHover(){return S()},set buttonColorHover(ne){S(ne),y()},get buttonBorderColor(){return N()},set buttonBorderColor(ne){N(ne),y()},get ariaLabel(){return P()},set ariaLabel(ne){P(ne),y()},get style(){return D()},set style(ne){D(ne),y()},get orientation(){return I()},set orientation(ne){I(ne),y()},get fitViewOptions(){return A()},set fitViewOptions(ne){A(ne),y()},get class(){return V()},set class(ne){V(ne),y()}});return r(),de}ce(Jf,{position:{},showZoom:{},showFitView:{},showLock:{},buttonBgColor:{},buttonBgColorHover:{},buttonColor:{},buttonColorHover:{},buttonBorderColor:{},ariaLabel:{},style:{},orientation:{},fitViewOptions:{},class:{}},["before","default","after"],[],!0);var yr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(yr||(yr={}));var Ew=Ce("<circle></circle>");function Qf(e,t){fe(t,!1);let n=w(t,"radius",12,5),r=w(t,"class",12,"");qe();var o=Ew();return He(i=>{be(o,"cx",n()),be(o,"cy",n()),be(o,"r",n()),Vt(o,0,i)},[()=>Cn((q(at),q(r()),G(()=>at(["svelte-flow__background-pattern","dots",r()]))))]),H(e,o),he({get radius(){return n()},set radius(i){n(i),y()},get class(){return r()},set class(i){r(i),y()}})}ce(Qf,{radius:{},class:{}},[],[],!0);var Sw=Ce("<path></path>");function e1(e,t){fe(t,!1);let n=w(t,"lineWidth",12,1),r=w(t,"dimensions",12),o=w(t,"variant",12,void 0),i=w(t,"class",12,"");qe();var s=Sw();return He(a=>{be(s,"stroke-width",n()),be(s,"d",(q(r()),G(()=>`M${r()[0]/2} 0 V${r()[1]} M0 ${r()[1]/2} H${r()[0]}`))),Vt(s,0,a)},[()=>Cn((q(at),q(o()),q(i()),G(()=>at(["svelte-flow__background-pattern",o(),i()]))))]),H(e,s),he({get lineWidth(){return n()},set lineWidth(a){n(a),y()},get dimensions(){return r()},set dimensions(a){r(a),y()},get variant(){return o()},set variant(a){o(a),y()},get class(){return i()},set class(a){i(a),y()}})}ce(e1,{lineWidth:{},dimensions:{},variant:{},class:{}},[],[],!0);const kw={[yr.Dots]:1,[yr.Lines]:1,[yr.Cross]:6};var Pw=Ce('<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>');const Nw={hash:"svelte-1r7pe8d",code:".svelte-flow__background.svelte-1r7pe8d {position:absolute;width:100%;height:100%;top:0;left:0;}"};function t1(e,t){fe(t,!1),st(e,Nw);const[n,r]=dt(),o=()=>oe(S,"$flowId",n),i=()=>oe(m,"$viewport",n),s=ae(),a=ae(),l=ae(),c=ae(),u=ae();let h=w(t,"id",12,void 0),f=w(t,"variant",28,()=>yr.Dots),g=w(t,"gap",12,20),v=w(t,"size",12,1),b=w(t,"lineWidth",12,1),C=w(t,"bgColor",12,void 0),x=w(t,"patternColor",12,void 0),p=w(t,"patternClass",12,void 0),_=w(t,"class",12,"");const{viewport:m,flowId:S}=Qe(),N=v()||kw[f()],P=f()===yr.Dots,D=f()===yr.Cross,I=Array.isArray(g())?g():[g(),g()];ve(()=>(o(),q(h())),()=>{te(s,`background-pattern-${o()}-${h()?h():""}`)}),ve(()=>i(),()=>{te(a,[I[0]*i().zoom||1,I[1]*i().zoom||1])}),ve(()=>i(),()=>{te(l,N*i().zoom)}),ve(()=>(d(l),d(a)),()=>{te(c,D?[d(l),d(l)]:d(a))}),ve(()=>(d(l),d(c)),()=>{te(u,P?[d(l)/2,d(l)/2]:[d(c)[0]/2,d(c)[1]/2])}),Nt(),qe();var A=Pw();let V;var L=W(A),R=W(L);{var E=M=>{{let O=Me(()=>d(l)/2);Qf(M,{get radius(){return d(O)},get class(){return p()}})}},$=M=>{e1(M,{get dimensions(){return d(c)},get variant(){return f()},get lineWidth(){return b()},get class(){return p()}})};me(R,M=>{P?M(E):M($,!1)})}F(L);var k=B(L);F(A),He((M,O)=>{Vt(A,0,M,"svelte-1r7pe8d"),V=yt(A,"",V,O),be(L,"id",d(s)),be(L,"x",(i(),d(a),G(()=>i().x%d(a)[0]))),be(L,"y",(i(),d(a),G(()=>i().y%d(a)[1]))),be(L,"width",(d(a),G(()=>d(a)[0]))),be(L,"height",(d(a),G(()=>d(a)[1]))),be(L,"patternTransform",(d(u),G(()=>`translate(-${d(u)[0]},-${d(u)[1]})`))),be(k,"fill",`url(#${d(s)})`)},[()=>Cn((q(at),q(_()),G(()=>at(["svelte-flow__background",_()])))),()=>({"--xy-background-color-props":C(),"--xy-background-pattern-color-props":x()})]),H(e,A);var T=he({get id(){return h()},set id(M){h(M),y()},get variant(){return f()},set variant(M){f(M),y()},get gap(){return g()},set gap(M){g(M),y()},get size(){return v()},set size(M){v(M),y()},get lineWidth(){return b()},set lineWidth(M){b(M),y()},get bgColor(){return C()},set bgColor(M){C(M),y()},get patternColor(){return x()},set patternColor(M){x(M),y()},get patternClass(){return p()},set patternClass(M){p(M),y()},get class(){return _()},set class(M){_(M),y()}});return r(),T}ce(t1,{id:{},variant:{},gap:{},size:{},lineWidth:{},bgColor:{},patternColor:{},patternClass:{},class:{}},[],[],!0);var Tw=Ce("<rect></rect>");function n1(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),h=w(t,"selected",12,!1),f=w(t,"class",12,"");qe();var g=Tw();let v;return He((b,C)=>{v=Vt(g,0,b,null,v,C),be(g,"x",n()),be(g,"y",r()),be(g,"rx",s()),be(g,"ry",s()),be(g,"width",o()),be(g,"height",i()),yt(g,`${a()?`fill: ${a()};`:""}${c()?`stroke: ${c()};`:""}${u()?`stroke-width: ${u()};`:""}`),be(g,"shape-rendering",l())},[()=>Cn((q(at),q(f()),G(()=>at(["svelte-flow__minimap-node",f()])))),()=>({selected:h()})]),H(e,g),he({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 h()},set selected(b){h(b),y()},get class(){return f()},set class(b){f(b),y()}})}ce(n1,{x:{},y:{},width:{},height:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},selected:{},class:{}},[],[],!0);function Fl(e,t){const n=gy({domNode:e,panZoom:t.panZoom,getTransform:()=>{const o=J(t.viewport);return[o.x,o.y,o.zoom]},getViewScale:t.getViewScale});function r(o){n.update({translateExtent:o.translateExtent,width:o.width,height:o.height,inversePan:o.inversePan,zoomStep:o.zoomStep,pannable:o.pannable,zoomable:o.zoomable})}return{update:r,destroy(){n.destroy()}}}const Yl=e=>e instanceof Function?e:()=>e;var Mw=Ce("<title> </title>"),Ow=Ce('<svg class="svelte-flow__minimap-svg" role="img"><!><!><path class="svelte-flow__minimap-mask" fill-rule="evenodd" pointer-events="none"></path></svg>');function r1(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(ue,"$flowId",n),i=()=>oe(pe,"$viewport",n),s=()=>oe(se,"$containerWidth",n),a=()=>oe(U,"$containerHeight",n),l=()=>oe(le,"$nodeLookup",n),c=()=>oe(Ae,"$nodes",n),u=()=>oe(Y,"$panZoom",n),h=()=>oe(we,"$translateExtent",n),f=ae(),g=ae(),v=ae(),b=ae(),C=ae(),x=ae(),p=ae(),_=ae(),m=ae(),S=ae(),N=ae(),P=ae(),D=ae();let I=w(t,"position",12,"bottom-right"),A=w(t,"ariaLabel",12,"Mini map"),V=w(t,"nodeStrokeColor",12,"transparent"),L=w(t,"nodeColor",12,void 0),R=w(t,"nodeClass",12,""),E=w(t,"nodeBorderRadius",12,5),$=w(t,"nodeStrokeWidth",12,2),k=w(t,"bgColor",12,void 0),T=w(t,"maskColor",12,void 0),M=w(t,"maskStrokeColor",12,void 0),O=w(t,"maskStrokeWidth",12,void 0),z=w(t,"width",12,void 0),j=w(t,"height",12,void 0),X=w(t,"pannable",12,!0),ee=w(t,"zoomable",12,!0),re=w(t,"inversePan",12,void 0),Q=w(t,"zoomStep",12,void 0),de=w(t,"style",12,""),ne=w(t,"class",12,"");const _e=200,Ne=150,{nodes:Ae,nodeLookup:le,viewport:pe,width:se,height:U,flowId:ue,panZoom:Y,translateExtent:we}=Qe(),Pe=L()===void 0?void 0:Yl(L()),De=Yl(V()),Be=Yl(R()),Ie=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",ye=`svelte-flow__minimap-desc-${o()}`;let Ve=ae(d(f));const je=()=>d(x);ve(()=>(i(),s(),a()),()=>{te(f,{x:-i().x/i().zoom,y:-i().y/i().zoom,width:s()/i().zoom,height:a()/i().zoom})}),ve(()=>(l(),d(f),c()),()=>{te(Ve,l().size>0?Rd(vi(l(),{filter:Z=>!Z.hidden}),d(f)):d(f)),c()}),ve(()=>q(z()),()=>{te(g,z()??_e)}),ve(()=>q(j()),()=>{te(v,j()??Ne)}),ve(()=>(d(Ve),d(g)),()=>{te(b,d(Ve).width/d(g))}),ve(()=>(d(Ve),d(v)),()=>{te(C,d(Ve).height/d(v))}),ve(()=>(d(b),d(C)),()=>{te(x,Math.max(d(b),d(C)))}),ve(()=>(d(x),d(g)),()=>{te(p,d(x)*d(g))}),ve(()=>(d(x),d(v)),()=>{te(_,d(x)*d(v))}),ve(()=>d(x),()=>{te(m,5*d(x))}),ve(()=>(d(Ve),d(p),d(m)),()=>{te(S,d(Ve).x-(d(p)-d(Ve).width)/2-d(m))}),ve(()=>(d(Ve),d(_),d(m)),()=>{te(N,d(Ve).y-(d(_)-d(Ve).height)/2-d(m))}),ve(()=>(d(p),d(m)),()=>{te(P,d(p)+d(m)*2)}),ve(()=>(d(_),d(m)),()=>{te(D,d(_)+d(m)*2)}),Nt(),qe();{let Z=Me(()=>de()+(k()?`;--xy-minimap-background-color-props:${k()}`:"")),Ue=Me(()=>(q(at),q(ne()),G(()=>at(["svelte-flow__minimap",ne()]))));_i(e,{get position(){return I()},get style(){return d(Z)},get class(){return d(Ue)},"data-testid":"svelte-flow__minimap",children:(tt,ft)=>{var an=Ke(),et=ge(an);{var $e=Ye=>{var Le=Ow();let Ot;var St=W(Le);{var Mi=Ht=>{var Kt=Mw(),Io=W(Kt,!0);F(Kt),He(()=>{be(Kt,"id",ye),pt(Io,A())}),H(Ht,Kt)};me(St,Ht=>{A()&&Ht(Mi)})}var Gr=B(St);Wt(Gr,1,c,Ht=>Ht.id,(Ht,Kt)=>{var Io=Ke();const Je=Me(()=>(l(),d(Kt),G(()=>l().get(d(Kt).id))));var nu=ge(Io);{var Hi=ln=>{const ra=Me(()=>(q(er),q(d(Je)),G(()=>er(d(Je)))));{let oa=Me(()=>(q(d(Je)),G(()=>Pe==null?void 0:Pe(d(Je))))),ia=Me(()=>(q(d(Je)),G(()=>De(d(Je))))),ru=Me(()=>(q(d(Je)),G(()=>Be(d(Je)))));n1(ln,vt({get x(){return q(d(Je)),G(()=>d(Je).internals.positionAbsolute.x)},get y(){return q(d(Je)),G(()=>d(Je).internals.positionAbsolute.y)}},()=>d(ra),{get selected(){return q(d(Je)),G(()=>d(Je).selected)},get color(){return d(oa)},get borderRadius(){return E()},get strokeColor(){return d(ia)},get strokeWidth(){return $()},get shapeRendering(){return Ie},get class(){return d(ru)}}))}};me(nu,ln=>{q(d(Je)),q(Ls),G(()=>d(Je)&&Ls(d(Je)))&&ln(Hi)})}H(Ht,Io)});var Oi=B(Gr);F(Le),Dt(Le,(Ht,Kt)=>Fl==null?void 0:Fl(Ht,Kt),()=>({panZoom:u(),viewport:pe,getViewScale:je,translateExtent:h(),width:s(),height:a(),inversePan:re(),zoomStep:Q(),pannable:X(),zoomable:ee()})),He(Ht=>{be(Le,"width",d(g)),be(Le,"height",d(v)),be(Le,"viewBox",`${d(S)??""} ${d(N)??""} ${d(P)??""} ${d(D)??""}`),be(Le,"aria-labelledby",ye),Ot=yt(Le,"",Ot,Ht),be(Oi,"d",`M${d(S)-d(m)},${d(N)-d(m)}h${d(P)+d(m)*2}v${d(D)+d(m)*2}h${-d(P)-d(m)*2}z
|
|
15
|
+
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":O()?O()*d(x):void 0})]),H(Ye,Le)};me(et,Ye=>{u()&&Ye($e)})}H(tt,an)},$$slots:{default:!0}})}var gt=he({get position(){return I()},set position(Z){I(Z),y()},get ariaLabel(){return A()},set ariaLabel(Z){A(Z),y()},get nodeStrokeColor(){return V()},set nodeStrokeColor(Z){V(Z),y()},get nodeColor(){return L()},set nodeColor(Z){L(Z),y()},get nodeClass(){return R()},set nodeClass(Z){R(Z),y()},get nodeBorderRadius(){return E()},set nodeBorderRadius(Z){E(Z),y()},get nodeStrokeWidth(){return $()},set nodeStrokeWidth(Z){$(Z),y()},get bgColor(){return k()},set bgColor(Z){k(Z),y()},get maskColor(){return T()},set maskColor(Z){T(Z),y()},get maskStrokeColor(){return M()},set maskStrokeColor(Z){M(Z),y()},get maskStrokeWidth(){return O()},set maskStrokeWidth(Z){O(Z),y()},get width(){return z()},set width(Z){z(Z),y()},get height(){return j()},set height(Z){j(Z),y()},get pannable(){return X()},set pannable(Z){X(Z),y()},get zoomable(){return ee()},set zoomable(Z){ee(Z),y()},get inversePan(){return re()},set inversePan(Z){re(Z),y()},get zoomStep(){return Q()},set zoomStep(Z){Q(Z),y()},get style(){return de()},set style(Z){de(Z),y()},get class(){return ne()},set class(Z){ne(Z),y()}});return r(),gt}ce(r1,{position:{},ariaLabel:{},nodeStrokeColor:{},nodeColor:{},nodeClass:{},nodeBorderRadius:{},nodeStrokeWidth:{},bgColor:{},maskColor:{},maskStrokeColor:{},maskStrokeWidth:{},width:{},height:{},pannable:{},zoomable:{},inversePan:{},zoomStep:{},style:{},class:{}},[],[],!0);const o1=e=>km(e);function Gt(){const{zoomIn:e,zoomOut:t,fitView:n,onbeforedelete:r,snapGrid:o,viewport:i,width:s,height:a,minZoom:l,maxZoom:c,panZoom:u,nodes:h,edges:f,domNode:g,nodeLookup:v,nodeOrigin:b,edgeLookup:C,connectionLookup:x}=Qe(),p=S=>{var A,V;const N=J(v),P=o1(S)?S:N.get(S.id),D=P.parentId?Dm(P.position,P.measured,P.parentId,N,J(b)):P.position,I={...P,position:D,width:((A=P.measured)==null?void 0:A.width)??P.width,height:((V=P.measured)==null?void 0:V.height)??P.height};return xo(I)},_=(S,N,P={replace:!1})=>{var A;const D=(A=J(v).get(S))==null?void 0:A.internals.userNode;if(!D)return;const I=typeof N=="function"?N(D):N;P.replace?h.update(V=>V.map(L=>L.id===S?o1(I)?I:{...L,...I}:L)):(Object.assign(D,I),h.update(V=>V))},m=S=>J(v).get(S);return{zoomIn:e,zoomOut:t,getInternalNode:m,getNode:S=>{var N;return(N=m(S))==null?void 0:N.internals.userNode},getNodes:S=>S===void 0?J(h):i1(J(v),S),getEdge:S=>J(C).get(S),getEdges:S=>S===void 0?J(f):i1(J(C),S),setZoom:(S,N)=>{const P=J(u);return P?P.scaleTo(S,{duration:N==null?void 0:N.duration}):Promise.resolve(!1)},getZoom:()=>J(i).zoom,setViewport:async(S,N)=>{const P=J(i),D=J(u);return D?(await D.setViewport({x:S.x??P.x,y:S.y??P.y,zoom:S.zoom??P.zoom},{duration:N==null?void 0:N.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>J(i),setCenter:async(S,N,P)=>{const D=typeof(P==null?void 0:P.zoom)<"u"?P.zoom:J(c),I=J(u);return I?(await I.setViewport({x:J(s)/2-S*D,y:J(a)/2-N*D,zoom:D},{duration:P==null?void 0:P.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitView:n,fitBounds:async(S,N)=>{const P=J(u);if(!P)return Promise.resolve(!1);const D=Ml(S,J(s),J(a),J(l),J(c),(N==null?void 0:N.padding)??.1);return await P.setViewport(D,{duration:N==null?void 0:N.duration}),Promise.resolve(!0)},getIntersectingNodes:(S,N=!0,P)=>{const D=Bd(S),I=D?S:p(S);return I?(P||J(h)).filter(A=>{const V=J(v).get(A.id);if(!V||!D&&A.id===S.id)return!1;const L=xo(V),R=pi(L,I);return N&&R>0||R>=I.width*I.height}):[]},isNodeIntersecting:(S,N,P=!0)=>{const I=Bd(S)?S:p(S);if(!I)return!1;const A=pi(I,N);return P&&A>0||A>=I.width*I.height},deleteElements:async({nodes:S=[],edges:N=[]})=>{const{nodes:P,edges:D}=await Vd({nodesToRemove:S,edgesToRemove:N,nodes:J(h),edges:J(f),onBeforeDelete:J(r)});return P&&h.update(I=>I.filter(A=>!P.some(({id:V})=>V===A.id))),D&&f.update(I=>I.filter(A=>!D.some(({id:V})=>V===A.id))),{deletedNodes:P,deletedEdges:D}},screenToFlowPosition:(S,N={snapToGrid:!0})=>{const P=J(g);if(!P)return S;const D=N.snapToGrid?J(o):!1,{x:I,y:A,zoom:V}=J(i),{x:L,y:R}=P.getBoundingClientRect(),E={x:S.x-L,y:S.y-R};return mi(E,[I,A,V],D!==null,D||[1,1])},flowToScreenPosition:S=>{const N=J(g);if(!N)return S;const{x:P,y:D,zoom:I}=J(i),{x:A,y:V}=N.getBoundingClientRect(),L=Vs(S,[P,D,I]);return{x:L.x+A,y:L.y+V}},toObject:()=>({nodes:J(h).map(S=>({...S,position:{...S.position},data:{...S.data}})),edges:J(f).map(S=>({...S})),viewport:{...J(i)}}),updateNode:_,updateNodeData:(S,N,P)=>{var A;const D=(A=J(v).get(S))==null?void 0:A.internals.userNode;if(!D)return;const I=typeof N=="function"?N(D):N;D.data=P!=null&&P.replace?I:{...D.data,...I},h.update(V=>V)},getNodesBounds:S=>{const N=J(v),P=J(b);return Pm(S,{nodeLookup:N,nodeOrigin:P})},getHandleConnections:({type:S,id:N,nodeId:P})=>{var D;return Array.from(((D=J(x).get(`${P}-${S}-${N??null}`))==null?void 0:D.values())??[])},viewport:i}}function i1(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 Hw=ie('<div class="svelte-flow__node-toolbar"><!></div>');function s1(e,t){fe(t,!1);const[n,r]=dt(),o=()=>oe(_,"$nodes",n),i=()=>oe(p,"$nodeLookup",n),s=()=>oe(x,"$viewport",n),a=()=>oe(C,"$domNode",n),l=ae(),c=ae(),u=ae();let h=w(t,"nodeId",12,void 0),f=w(t,"position",12,void 0),g=w(t,"align",12,void 0),v=w(t,"offset",12,void 0),b=w(t,"isVisible",12,void 0);const{domNode:C,viewport:x,nodeLookup:p,nodes:_}=Qe(),{getNodesBounds:m}=Gt(),S=Hr("svelteflow__node_id");let N=ae(),P=ae([]),D=v()!==void 0?v():10,I=f()!==void 0?f():ke.Top,A=g()!==void 0?g():"center";ve(()=>(o(),q(h()),i()),()=>{o();const $=Array.isArray(h())?h():[h()||S];te(P,$.reduce((k,T)=>{const M=i().get(T);return M&&k.push(M),k},[]))}),ve(()=>(d(P),s()),()=>{const $=m(d(P));$&&te(N,Gm($,s(),I,D,A))}),ve(()=>d(P),()=>{te(l,d(P).length===0?1:Math.max(...d(P).map($=>($.internals.z||5)+1)))}),ve(()=>o(),()=>{te(c,o().filter($=>$.selected).length)}),ve(()=>(q(b()),d(P),d(c)),()=>{te(u,typeof b()=="boolean"?b():d(P).length===1&&d(P)[0].selected&&d(c)===1)}),Nt(),qe();var V=Ke(),L=ge(V);{var R=$=>{var k=Hw();let T;var M=W(k);At(M,t,"default",{}),F(k),Dt(k,(O,z)=>So==null?void 0:So(O,z),()=>({domNode:a()})),He((O,z)=>{be(k,"data-id",O),T=yt(k,"",T,z)},[()=>(d(P),G(()=>d(P).reduce((O,z)=>`${O}${z.id} `,"").trim())),()=>({position:"absolute",transform:d(N),"z-index":d(l)})]),H($,k)};me(L,$=>{a()&&d(u)&&d(P)&&$(R)})}H(e,V);var E=he({get nodeId(){return h()},set nodeId($){h($),y()},get position(){return f()},set position($){f($),y()},get align(){return g()},set align($){g($),y()},get offset(){return v()},set offset($){v($),y()},get isVisible(){return b()},set isVisible($){b($),y()}});return r(),E}ce(s1,{nodeId:{},position:{},align:{},offset:{},isVisible:{}},["default"],[],!0);function Kr(e){const{nodes:t,nodeLookup:n}=Qe();let r=[],o=!0;return vr([t,n],([,i],s)=>{var u;const a=[],l=Array.isArray(e),c=l?e:[e];for(const h of c){const f=(u=i.get(h))==null?void 0:u.internals.userNode;f&&a.push({id:f.id,type:f.type,data:f.data})}(!iy(a,r)||o)&&(r=a,s(l?a:a[0]??null),o=!1)})}const a1="tinyflow-component";class Aw{constructor(t){kt(this,"options");kt(this,"rootEl");kt(this,"svelteFlowInstance");if(typeof t.element!="string"&&!(t.element instanceof Element))throw new Error("element must be a string or Element");this._setOptions(t),this._init()}_init(){if(typeof this.options.element=="string"){if(this.rootEl=document.querySelector(this.options.element),!this.rootEl)throw new Error(`element not found by document.querySelector('${this.options.element}')`)}else if(this.options.element instanceof Element)this.rootEl=this.options.element;else throw new Error("element must be a string or Element");const t=document.createElement(a1);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(a1);n.style.display="block",n.style.width="100%",n.style.height="100%",n.classList.add("tf-theme-light"),n.options=this.options,n.onInit=r=>{this.svelteFlowInstance=r},this.destroy(),this.rootEl.appendChild(n)}destroy(){for(;this.rootEl.firstChild;)this.rootEl.removeChild(this.rootEl.firstChild)}}const Ws=(()=>{const e=xe([]),t=xe([]),n=xe({x:250,y:100,zoom:1});return{nodes:e,edges:t,viewport:n,init:(r,o)=>{e.set(r),t.set(o)},addNode:r=>{e.update(o=>[...o,r])},removeNode:r=>{e.update(o=>o.filter(i=>i.id!==r))},updateNode:(r,o)=>{e.update(i=>i.map(s=>s.id===r?o:s))},updateNodeData:(r,o)=>{e.update(i=>i.map(s=>s.id===r?{...s,data:{...s.data,...o}}:s))},selectNodeOnly:r=>{e.update(o=>o.map(i=>i.id===r?{...i,selected:!0}:{...i,selected:!1}))},addEdge:r=>{t.update(o=>[...o,r])},removeEdge:r=>{t.update(o=>o.filter(i=>i.id!==r))},updateEdge:(r,o)=>{t.update(i=>i.map(s=>s.id===r?o:s))},updateEdgeData:(r,o)=>{t.update(i=>i.map(s=>s.id===r?{...s,data:o}:s))}}})();var Dw=ie("<button><!></button>");function Ge(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=Dw();rn(i,()=>({type:"button",...o,class:`tf-btn ${r()?"tf-btn-primary":""} nopan nodrag ${t.class??""}`}));var s=W(i);return Lr(s,()=>n()??_t),F(i),H(e,i),he({get children(){return n()},set children(a){n(a),y()},get primary(){return r()},set primary(a){r(a),y()}})}ce(Ge,{children:{},primary:{}},[],[],!0);var Vw=ie("<input/>");function l1(e,t){fe(t,!0);const n=Tt(t,["$$slots","$$events","$$legacy","$$host"]);var r=Vw();gr(r),rn(r,()=>({type:"checkbox",...n,class:`tf-checkbox nopan nodrag ${t.class??""}`})),H(e,r),he()}ce(l1,{},[],[],!0);var Iw=ie('<div><input type="hidden"/> <!> <!></div>');const Lw={hash:"svelte-1swt2gg",code:".tf-chosen.svelte-1swt2gg {display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:5px;}"};function u1(e,t){fe(t,!0),st(e,Lw);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=Iw();rn(l,()=>({...a,class:`tf-chosen nopan nodrag ${t.class??""}`}),void 0,void 0,"svelte-1swt2gg");var c=W(l);gr(c);var u=B(c,2);$t(u,{get value(){return r()},get placeholder(){return n()},style:"flex-grow: 1;",disabled:!0});var h=B(u,2);return Ge(h,{onclick:f=>{var g;(g=s())==null||g(o(),r(),f)},style:"padding: 3px",children:(f,g)=>{Te();var v=Re();He(()=>pt(v,i())),H(f,v)},$$slots:{default:!0}}),F(l),He(()=>ss(c,o())),H(e,l),he({get placeholder(){return n()},set placeholder(f){n(f),y()},get label(){return r()},set label(f){r(f),y()},get value(){return o()},set value(f){o(f),y()},get buttonText(){return i()},set buttonText(f="选择..."){i(f),y()},get onChosen(){return s()},set onChosen(f){s(f),y()}})}ce(u1,{placeholder:{},label:{},value:{},buttonText:{},onChosen:{}},[],[],!0);var zw=ie("<input/>");function $t(e,t){fe(t,!0);const n=Tt(t,["$$slots","$$events","$$legacy","$$host"]);var r=zw();gr(r),rn(r,()=>({type:"text",spellcheck:"false",...n,class:`tf-input nopan nodrag ${t.class??""}`})),H(e,r),he()}ce($t,{},[],[],!0);var Rw=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=Rw();return cv(o),rn(o,()=>({spellcheck:"false",...r,class:`tf-textarea nodrag nowheel ${t.class??""}`,value:n()||""})),H(e,o),he({get value(){return n()},set value(i){n(i),y()}})}ce(Mt,{value:{}},[],[],!0);var Bw=ie('<div role="button"><!></div>'),qw=ie("<div></div>");function c1(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 h;s(u),(h=i())==null||h(c,u)}qe();var l=qw();return rn(l,()=>({...r,class:`tf-tabs ${q(r),G(()=>r.class)??""}`})),Wt(l,5,o,ho,(c,u,h)=>{var f=Bw();be(f,"tabindex",h),f.__click=()=>a(d(u),h),f.__keydown=C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),a(d(u),h))};var g=W(f);{var v=C=>{var x=Re();He(()=>pt(x,(d(u),G(()=>d(u).label)))),H(C,x)},b=C=>{var x=Ke(),p=ge(x);Lr(p,()=>(d(u),G(()=>d(u).label)??_t)),H(C,x)};me(g,C=>{d(u),G(()=>typeof d(u).label=="string")?C(v):C(b,!1)})}F(f),He(()=>Vt(f,1,`tf-tabs-item ${h===s()?"active":""}`)),H(c,f)}),F(l),H(e,l),he({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()}})}co(["click","keydown"]),ce(c1,{items:{},onChange:{},activeIndex:{}},[],[],!0);var Fw=(e,t,n)=>t(d(n)),Yw=(e,t,n)=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),t(d(n)))},Ww=ie('<span class="tf-collapse-item-title-icon"><!></span>'),Kw=ie('<div class="tf-collapse-item-description"><!></div>'),Xw=ie('<div class="tf-collapse-item-content"><!></div>'),Zw=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>'),jw=ie("<div></div>");const Uw={hash:"svelte-1jfktzw",code:`
|
|
16
|
+
/* 定义旋转的 CSS 类 */.rotate-90.svelte-1jfktzw {transform:rotate(90deg);transition:transform 0.3s ease;}`};function d1(e,t){fe(t,!0),st(e,Uw);let n=w(t,"items",7),r=w(t,"onChange",7),o=w(t,"activeKeys",31,()=>On([]));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=jw();return Wt(s,21,n,ho,(a,l,c)=>{var u=Zw(),h=W(u);be(h,"tabindex",c),h.__click=[Fw,i,l],h.__keydown=[Yw,i,l];var f=W(h);{var g=m=>{var S=Ww(),N=W(S);wr(N,{get target(){return d(l).icon}}),F(S),H(m,S)};me(f,m=>{d(l).icon&&m(g)})}var v=B(f,2);wr(v,{get target(){return d(l).title}});var b=B(v,2);F(h);var C=B(h,2);{var x=m=>{var S=Kw(),N=W(S);wr(N,{get target(){return d(l).description}}),F(S),H(m,S)};me(C,m=>{d(l).description&&m(x)})}var p=B(C,2);{var _=m=>{var S=Xw(),N=W(S);wr(N,{get target(){return d(l).content}}),F(S),H(m,S)};me(p,m=>{o().includes(d(l).key)&&m(_)})}F(u),He(m=>Vt(b,1,`tf-collapse-item-title-arrow ${m??""}`,"svelte-1jfktzw"),[()=>o().includes(d(l).key)?"rotate-90":""]),H(a,u)}),F(s),He(()=>{yt(s,t.style),Vt(s,1,`tf-collapse ${t.class??""}`,"svelte-1jfktzw")}),H(e,s),he({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()}})}co(["click","keydown"]),ce(d1,{items:{},onChange:{},activeKeys:{}},[],[],!0);function wr(e,t){fe(t,!0);let n=w(t,"target",7);typeof n()>"u"&&n("undefined");var r=Ke(),o=ge(r);{var i=a=>{var l=Ke(),c=ge(l);Lr(c,()=>n()??_t),H(a,l)},s=a=>{var l=Ke(),c=ge(l);tl(c,n),H(a,l)};me(o,a=>{typeof n()=="function"?a(i):a(s,!1)})}return H(e,r),he({get target(){return n()},set target(a){n(a),y()}})}ce(wr,{target:{}},[],[],!0);var Gw=(e,t,n)=>t(d(n)),Jw=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 14L8 10H16L12 14Z"></path></svg>'),Qw=ie('<div class="tf-select-content-children"><!></div>'),e_=ie('<button class="tf-select-content-item"><span><!></span> <!></button> <!>',1),t_=ie('<div class="tf-select-content nopan nodrag"><!></div>'),n_=ie("<!> <!>",1),r_=ie('<div class="tf-select-input-placeholder"> </div>'),o_=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>'),i_=ie("<div><!></div>");function mn(e,t){fe(t,!0);const n=(x,p=_t)=>{var _=Ke(),m=ge(_);Wt(m,19,p,(S,N)=>`${N}_${S.value}`,(S,N)=>{var P=e_(),D=ge(P);D.__click=[Gw,v,N];var I=W(D),A=W(I);{var V=$=>{var k=Jw();H($,k)};me(A,$=>{d(N).children&&d(N).children.length>0&&$(V)})}F(I);var L=B(I,2);wr(L,{get target(){return d(N).label}}),F(D);var R=B(D,2);{var E=$=>{var k=Qw(),T=W(k);n(T,()=>d(N).children),F(k),H($,k)};me(R,$=>{d(N).children&&d(N).children.length>0&&(a()||c().includes(d(N).value))&&$(E)})}H(S,P)}),H(x,_)};let r=w(t,"items",7),o=w(t,"onSelect",7),i=w(t,"value",23,()=>[]),s=w(t,"defaultValue",23,()=>[]),a=w(t,"expandAll",7,!0),l=w(t,"multiple",7,!1),c=w(t,"expandValue",23,()=>[]),u=w(t,"placeholder",7),h=Tt(t,["$$slots","$$events","$$legacy","$$host","items","onSelect","value","defaultValue","expandAll","multiple","expandValue","placeholder"]),f=Ee(()=>{const x=[],p=_=>{for(let m of _)i().length>0?i().includes(m.value)&&x.push(m):s().includes(m.value)&&x.push(m),m.children&&m.children.length>0&&p(m.children)};return p(r()),x}),g;function v(x){var p;g==null||g.hide(),(p=o())==null||p(x)}var b=i_();rn(b,()=>({...h,class:`tf-select ${h.class??""}`}));var C=W(b);return Ln(Oo(C,{floating:p=>{var _=t_(),m=W(_);n(m,r),F(_),H(p,_)},children:(p,_)=>{var m=o_();rn(m,()=>({class:"tf-select-input nopan nodrag",...h}));var S=W(m);Wt(S,23,()=>d(f),(N,P)=>`${P}_${N.value}`,(N,P,D)=>{var I=Ke(),A=ge(I);{var V=R=>{var E=Ke(),$=ge(E);{var k=T=>{wr(T,{get target(){return d(P).label}})};me($,T=>{d(D)===0&&T(k)})}H(R,E)},L=R=>{var E=n_(),$=ge(E);wr($,{get target(){return d(P).label}});var k=B($,2);{var T=M=>{var O=Re(",");H(M,O)};me(k,M=>{d(D)<d(f).length-1&&M(T)})}H(R,E)};me(A,R=>{l()?R(L,!1):R(V)})}H(N,I)},N=>{var P=r_(),D=W(P,!0);F(P),He(()=>pt(D,u())),H(N,P)}),F(S),Te(2),F(m),H(p,m)},$$slots:{floating:!0,default:!0}}),p=>g=p,()=>g),F(b),H(e,b),he({get items(){return r()},set items(x){r(x),y()},get onSelect(){return o()},set onSelect(x){o(x),y()},get value(){return i()},set value(x=[]){i(x),y()},get defaultValue(){return s()},set defaultValue(x=[]){s(x),y()},get expandAll(){return a()},set expandAll(x=!0){a(x),y()},get multiple(){return l()},set multiple(x=!1){l(x),y()},get expandValue(){return c()},set expandValue(x=[]){c(x),y()},get placeholder(){return u()},set placeholder(x){u(x),y()}})}co(["click"]),ce(mn,{items:{},onSelect:{},value:{},defaultValue:{},expandAll:{},multiple:{},expandValue:{},placeholder:{}},[],[],!0);const xi=Math.min,Po=Math.max,Ks=Math.round,qn=e=>({x:e,y:e}),s_={left:"right",right:"left",bottom:"top",top:"bottom"},a_={start:"end",end:"start"};function Wl(e,t,n){return Po(e,xi(t,n))}function Ci(e,t){return typeof e=="function"?e(t):e}function Xr(e){return e.split("-")[0]}function $i(e){return e.split("-")[1]}function f1(e){return e==="x"?"y":"x"}function Kl(e){return e==="y"?"height":"width"}const l_=new Set(["top","bottom"]);function _r(e){return l_.has(Xr(e))?"y":"x"}function Xl(e){return f1(_r(e))}function u_(e,t,n){n===void 0&&(n=!1);const r=$i(e),o=Xl(e),i=Kl(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Xs(s)),[s,Xs(s)]}function c_(e){const t=Xs(e);return[Zl(e),t,Zl(t)]}function Zl(e){return e.replace(/start|end/g,t=>a_[t])}const h1=["left","right"],g1=["right","left"],d_=["top","bottom"],f_=["bottom","top"];function h_(e,t,n){switch(e){case"top":case"bottom":return n?t?g1:h1:t?h1:g1;case"left":case"right":return t?d_:f_;default:return[]}}function g_(e,t,n,r){const o=$i(e);let i=h_(Xr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Zl)))),i}function Xs(e){return e.replace(/left|right|bottom|top/g,t=>s_[t])}function v_(e){return{top:0,right:0,bottom:0,left:0,...e}}function v1(e){return typeof e!="number"?v_(e):{top:e,right:e,bottom:e,left:e}}function Zs(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 p1(e,t,n){let{reference:r,floating:o}=e;const i=_r(t),s=Xl(t),a=Kl(s),l=Xr(t),c=i==="y",u=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-o.width,y:h};break;default:g={x:r.x,y:r.y}}switch($i(t)){case"start":g[s]-=f*(n&&c?-1:1);break;case"end":g[s]+=f*(n&&c?-1:1);break}return g}const p_=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:h}=p1(c,r,l),f=r,g={},v=0;for(let b=0;b<a.length;b++){const{name:C,fn:x}=a[b],{x:p,y:_,data:m,reset:S}=await x({x:u,y:h,initialPlacement:r,placement:f,strategy:o,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});u=p??u,h=_??h,g={...g,[C]:{...g[C],...m}},S&&v<=50&&(v++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(c=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:u,y:h}=p1(c,f,l)),b=-1)}return{x:u,y:h,placement:f,strategy:o,middlewareData:g}};async function m1(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:h="floating",altBoundary:f=!1,padding:g=0}=Ci(t,e),v=v1(g),C=a[f?h==="floating"?"reference":"floating":h],x=Zs(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(C)))==null||n?C:C.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),p=h==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),m=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},S=Zs(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:_,strategy:l}):p);return{top:(x.top-S.top+v.top)/m.y,bottom:(S.bottom-x.bottom+v.bottom)/m.y,left:(x.left-S.left+v.left)/m.x,right:(S.right-x.right+v.right)/m.x}}const m_=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}=Ci(e,t)||{};if(c==null)return{};const h=v1(u),f={x:n,y:r},g=Xl(o),v=Kl(g),b=await s.getDimensions(c),C=g==="y",x=C?"top":"left",p=C?"bottom":"right",_=C?"clientHeight":"clientWidth",m=i.reference[v]+i.reference[g]-f[g]-i.floating[v],S=f[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let P=N?N[_]:0;(!P||!await(s.isElement==null?void 0:s.isElement(N)))&&(P=a.floating[_]||i.floating[v]);const D=m/2-S/2,I=P/2-b[v]/2-1,A=xi(h[x],I),V=xi(h[p],I),L=A,R=P-b[v]-V,E=P/2-b[v]/2+D,$=Wl(L,E,R),k=!l.arrow&&$i(o)!=null&&E!==$&&i.reference[v]/2-(E<L?A:V)-b[v]/2<0,T=k?E<L?E-L:E-R:0;return{[g]:f[g]+T,data:{[g]:$,centerOffset:E-$-T,...k&&{alignmentOffset:T}},reset:k}}}),y_=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:h=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...C}=Ci(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Xr(o),p=_r(a),_=Xr(a)===a,m=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(_||!b?[Xs(a)]:c_(a)),N=v!=="none";!f&&N&&S.push(...g_(a,b,v,m));const P=[a,...S],D=await m1(t,C),I=[];let A=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&I.push(D[x]),h){const E=u_(o,s,m);I.push(D[E[0]],D[E[1]])}if(A=[...A,{placement:o,overflows:I}],!I.every(E=>E<=0)){var V,L;const E=(((V=i.flip)==null?void 0:V.index)||0)+1,$=P[E];if($&&(!(h==="alignment"?p!==_r($):!1)||A.every(M=>M.overflows[0]>0&&_r(M.placement)===p)))return{data:{index:E,overflows:A},reset:{placement:$}};let k=(L=A.filter(T=>T.overflows[0]<=0).sort((T,M)=>T.overflows[1]-M.overflows[1])[0])==null?void 0:L.placement;if(!k)switch(g){case"bestFit":{var R;const T=(R=A.filter(M=>{if(N){const O=_r(M.placement);return O===p||O==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(O=>O>0).reduce((O,z)=>O+z,0)]).sort((M,O)=>M[1]-O[1])[0])==null?void 0:R[0];T&&(k=T);break}case"initialPlacement":k=a;break}if(o!==k)return{reset:{placement:k}}}return{}}}},w_=new Set(["left","top"]);async function __(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Xr(n),a=$i(n),l=_r(n)==="y",c=w_.has(s)?-1:1,u=i&&l?-1:1,h=Ci(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*u,y:f*c}:{x:f*c,y:g*u}}const b_=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 __(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}}}}},x_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:C=>{let{x,y:p}=C;return{x,y:p}}},...l}=Ci(e,t),c={x:n,y:r},u=await m1(t,l),h=_r(Xr(o)),f=f1(h);let g=c[f],v=c[h];if(i){const C=f==="y"?"top":"left",x=f==="y"?"bottom":"right",p=g+u[C],_=g-u[x];g=Wl(p,g,_)}if(s){const C=h==="y"?"top":"left",x=h==="y"?"bottom":"right",p=v+u[C],_=v-u[x];v=Wl(p,v,_)}const b=a.fn({...t,[f]:g,[h]:v});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[f]:i,[h]:s}}}}}};function js(){return typeof window<"u"}function No(e){return y1(e)?(e.nodeName||"").toLowerCase():"#document"}function sn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nr(e){var t;return(t=(y1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function y1(e){return js()?e instanceof Node||e instanceof sn(e).Node:!1}function kn(e){return js()?e instanceof Element||e instanceof sn(e).Element:!1}function Fn(e){return js()?e instanceof HTMLElement||e instanceof sn(e).HTMLElement:!1}function w1(e){return!js()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof sn(e).ShadowRoot}const C_=new Set(["inline","contents"]);function Ei(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Pn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!C_.has(o)}const $_=new Set(["table","td","th"]);function E_(e){return $_.has(No(e))}const S_=[":popover-open",":modal"];function Us(e){return S_.some(t=>{try{return e.matches(t)}catch{return!1}})}const k_=["transform","translate","scale","rotate","perspective"],P_=["transform","translate","scale","rotate","perspective","filter"],N_=["paint","layout","strict","content"];function jl(e){const t=Ul(),n=kn(e)?Pn(e):e;return k_.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)||P_.some(r=>(n.willChange||"").includes(r))||N_.some(r=>(n.contain||"").includes(r))}function T_(e){let t=br(e);for(;Fn(t)&&!To(t);){if(jl(t))return t;if(Us(t))return null;t=br(t)}return null}function Ul(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const M_=new Set(["html","body","#document"]);function To(e){return M_.has(No(e))}function Pn(e){return sn(e).getComputedStyle(e)}function Gs(e){return kn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function br(e){if(No(e)==="html")return e;const t=e.assignedSlot||e.parentNode||w1(e)&&e.host||nr(e);return w1(t)?t.host:t}function _1(e){const t=br(e);return To(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fn(t)&&Ei(t)?t:_1(t)}function b1(e,t,n){var r;t===void 0&&(t=[]);const o=_1(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=sn(o);return i?(Gl(s),t.concat(s,s.visualViewport||[],Ei(o)?o:[],[])):t.concat(o,b1(o,[]))}function Gl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function x1(e){const t=Pn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Fn(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ks(n)!==i||Ks(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function C1(e){return kn(e)?e:e.contextElement}function Mo(e){const t=C1(e);if(!Fn(t))return qn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=x1(t);let s=(i?Ks(n.width):n.width)/r,a=(i?Ks(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const O_=qn(0);function $1(e){const t=sn(e);return!Ul()||!t.visualViewport?O_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function H_(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==sn(e)?!1:t}function Si(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=C1(e);let s=qn(1);t&&(r?kn(r)&&(s=Mo(r)):s=Mo(e));const a=H_(i,n,r)?$1(i):qn(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,h=o.height/s.y;if(i){const f=sn(i),g=r&&kn(r)?sn(r):r;let v=f,b=Gl(v);for(;b&&r&&g!==v;){const C=Mo(b),x=b.getBoundingClientRect(),p=Pn(b),_=x.left+(b.clientLeft+parseFloat(p.paddingLeft))*C.x,m=x.top+(b.clientTop+parseFloat(p.paddingTop))*C.y;l*=C.x,c*=C.y,u*=C.x,h*=C.y,l+=_,c+=m,v=sn(b),b=Gl(v)}}return Zs({width:u,height:h,x:l,y:c})}function Jl(e,t){const n=Gs(e).scrollLeft;return t?t.left+n:Si(nr(e)).left+n}function E1(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Jl(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function A_(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=nr(r),a=t?Us(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=qn(1);const u=qn(0),h=Fn(r);if((h||!h&&!i)&&((No(r)!=="body"||Ei(s))&&(l=Gs(r)),Fn(r))){const g=Si(r);c=Mo(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const f=s&&!h&&!i?E1(s,l,!0):qn(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 D_(e){return Array.from(e.getClientRects())}function V_(e){const t=nr(e),n=Gs(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+Jl(e);const a=-n.scrollTop;return Pn(r).direction==="rtl"&&(s+=Po(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function I_(e,t){const n=sn(e),r=nr(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 L_=new Set(["absolute","fixed"]);function z_(e,t){const n=Si(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Fn(e)?Mo(e):qn(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 S1(e,t,n){let r;if(t==="viewport")r=I_(e,n);else if(t==="document")r=V_(nr(e));else if(kn(t))r=z_(t,n);else{const o=$1(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zs(r)}function k1(e,t){const n=br(e);return n===t||!kn(n)||To(n)?!1:Pn(n).position==="fixed"||k1(n,t)}function R_(e,t){const n=t.get(e);if(n)return n;let r=b1(e,[]).filter(a=>kn(a)&&No(a)!=="body"),o=null;const i=Pn(e).position==="fixed";let s=i?br(e):e;for(;kn(s)&&!To(s);){const a=Pn(s),l=jl(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&L_.has(o.position)||Ei(s)&&!l&&k1(e,s))?r=r.filter(u=>u!==s):o=a,s=br(s)}return t.set(e,r),r}function B_(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Us(t)?[]:R_(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const h=S1(t,u,o);return c.top=Po(h.top,c.top),c.right=xi(h.right,c.right),c.bottom=xi(h.bottom,c.bottom),c.left=Po(h.left,c.left),c},S1(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function q_(e){const{width:t,height:n}=x1(e);return{width:t,height:n}}function F_(e,t,n){const r=Fn(t),o=nr(t),i=n==="fixed",s=Si(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=qn(0);function c(){l.x=Jl(o)}if(r||!r&&!i)if((No(t)!=="body"||Ei(o))&&(a=Gs(t)),r){const g=Si(t,!0,i,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?E1(o,a):qn(0),h=s.left+a.scrollLeft-l.x-u.x,f=s.top+a.scrollTop-l.y-u.y;return{x:h,y:f,width:s.width,height:s.height}}function Ql(e){return Pn(e).position==="static"}function P1(e,t){if(!Fn(e)||Pn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return nr(e)===n&&(n=n.ownerDocument.body),n}function N1(e,t){const n=sn(e);if(Us(e))return n;if(!Fn(e)){let o=br(e);for(;o&&!To(o);){if(kn(o)&&!Ql(o))return o;o=br(o)}return n}let r=P1(e,t);for(;r&&E_(r)&&Ql(r);)r=P1(r,t);return r&&To(r)&&Ql(r)&&!jl(r)?n:r||T_(e)||n}const Y_=async function(e){const t=this.getOffsetParent||N1,n=this.getDimensions,r=await n(e.floating);return{reference:F_(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function W_(e){return Pn(e).direction==="rtl"}const K_={convertOffsetParentRelativeRectToViewportRelativeRect:A_,getDocumentElement:nr,getClippingRect:B_,getOffsetParent:N1,getElementRects:Y_,getClientRects:D_,getDimensions:q_,getScale:Mo,isElement:kn,isRTL:W_},X_=b_,Z_=x_,j_=y_,U_=m_,G_=(e,t,n)=>{const r=new Map,o={platform:K_,...n},i={...o.platform,_c:r};return p_(e,t,{...o,platform:i})},J_=({trigger:e,triggerEvent:t,floatContent:n,placement:r="bottom",offsetOptions:o,flipOptions:i,shiftOptions:s,interactive:a,showArrow:l})=>{if(typeof e=="string"){const x=document.querySelector(e);if(x)e=x;else throw new Error("element not found by document.querySelector('"+e+"')")}let c;if(typeof n=="string"){const x=document.querySelector(n);if(x)c=x;else throw new Error("element not found by document.querySelector('"+n+"')")}else c=n;let u;l&&(u=document.createElement("div"),u.style.position="absolute",u.style.backgroundColor="#222",u.style.width="8px",u.style.height="8px",u.style.transform="rotate(45deg)",u.style.display="none",c.firstElementChild.before(u));function h(){G_(e,c,{placement:r,middleware:[X_(o),j_(i),Z_(s),...l?[U_({element:u})]:[]]}).then(({x,y:p,placement:_,middlewareData:m})=>{if(Object.assign(c.style,{left:`${x}px`,top:`${p}px`}),l){const{x:S,y:N}=m.arrow,P={top:"bottom",right:"left",bottom:"top",left:"right"}[_.split("-")[0]];Object.assign(u.style,{zIndex:-1,left:S!=null?`${S}px`:"",top:N!=null?`${N}px`:"",right:"",bottom:"",[P]:"2px"})}})}let f=!1;function g(){c.style.display="block",c.style.visibility="block",c.style.position="absolute",l&&(u.style.display="block"),f=!0,h()}function v(){c.style.display="none",l&&(u.style.display="none"),f=!1}function b(x){x.stopPropagation(),f?v():g()}function C(x){c.contains(x.target)||v()}return(!t||t.length==0)&&(t=["click"]),t.forEach(x=>{e.addEventListener(x,b)}),document.addEventListener("click",C),{destroy(){t.forEach(x=>{e.removeEventListener(x,b)}),document.removeEventListener("click",C)},hide(){v()},isVisible(){return f}}};var Q_=ie('<div style="position: relative"><div><!></div> <div style="display: none; width: 100%;z-index: 9999"><!></div></div>');function Oo(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;gn(()=>(a=J_({trigger:i,floatContent:s,interactive:!0,placement:o()}),()=>{a.destroy()}));function l(){a.hide()}var c=Q_(),u=W(c),h=W(u);Lr(h,n),F(u),Ln(u,v=>i=v,()=>i);var f=B(u,2),g=W(f);return Lr(g,r),F(f),Ln(f,v=>s=v,()=>s),F(c),H(e,c),he({hide:l,get children(){return n()},set children(v){n(v),y()},get floating(){return r()},set floating(v){r(v),y()},get placement(){return o()},set placement(v="bottom"){o(v),y()}})}ce(Oo,{children:{},floating:{},placement:{}},[],["hide"],!0);function ot(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=Ke(),a=ge(s);return Tv(a,()=>`h${r()}`,!1,(l,c)=>{rn(l,()=>({class:"tf-heading",style:`margin-top:${o()||"0"};margin-bottom:${i()||"0"}`}));var u=Ke(),h=ge(u);Lr(h,()=>n()??_t),H(c,u)}),H(e,s),he({get children(){return n()},set children(l){n(l),y()},get level(){return r()},set level(l=1){r(l),y()},get mt(){return o()},set mt(l){o(l),y()},get mb(){return i()},set mb(l){i(l),y()}})}ce(ot,{children:{},level:{},mt:{},mb:{}},[],[],!0);var eb=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 tb={hash:"svelte-1rvn4a8",code:".input-btn-more {border:1px solid transparent;padding:3px;&:hover {background:#eee;border:1px solid transparent;}}"};function Js(e,t){fe(t,!0),st(e,tb);const n=Tt(t,["$$slots","$$events","$$legacy","$$host"]);Ge(e,vt(()=>n,{get class(){return`input-btn-more ${t.class??""}`},children:(r,o)=>{var i=eb();H(r,i)},$$slots:{default:!0}})),he()}ce(Js,{},[],[],!0);const nb=()=>{const e=Qe();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("")},rb=()=>{const{nodes:e,nodeLookup:t}=Qe();return{copyNode:r=>{var s;const i=(s=J(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}))}}}},xr=()=>Hr("tinyflow_options");function Et(){return Hr("svelteflow__node_id")}var ob=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>'),ib=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>'),sb=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>'),ab=ie('<div class="input-item svelte-1jesvb7">执行条件: <!></div>'),lb=(e,t,n)=>{const r=e.target.checked;t(n,{async:r})},ub=ie('<div class="settings svelte-1jesvb7"><div class="input-item svelte-1jesvb7">节点名称: <!></div> <div class="input-item svelte-1jesvb7">参数描述: <!></div> <!> <label class="input-item-inline svelte-1jesvb7"><span>异步执行:</span> <input type="checkbox"/></label></div>'),cb=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>'),db=ie('<div class="tf-node-toolbar svelte-1jesvb7"><!> <!> <!> <!></div>'),fb=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 hb={hash:"svelte-1jesvb7",code:".tf-node-toolbar.svelte-1jesvb7 {display:flex;gap:5px;padding:5px;border-radius:5px;background:#fff;border:1px solid #eee;box-shadow:0 0 5px rgba(0, 0, 0, 0.1);}.tf-node-toolbar-item {border:1px solid transparent;}.settings.svelte-1jesvb7 {display:flex;flex-direction:column;gap:10px;padding:10px;background:#fff;border:1px solid #ddd;border-radius:5px;width:200px;box-shadow:0 0 10px 2px rgba(0, 0, 0, 0.1);}.settings.svelte-1jesvb7 .input-item:where(.svelte-1jesvb7) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:#666;}.settings.svelte-1jesvb7 .input-item-inline:where(.svelte-1jesvb7) {display:flex;align-items:center;font-size:12px;color:#666;}"};function Nn(e,t){fe(t,!0),st(e,hb);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),h=w(t,"allowSettingOfCondition",7,!0),f=w(t,"showSourceHandle",7,!0),g=w(t,"showTargetHandle",7,!0),v=w(t,"onCollapse",7);let b=n().expand?["key"]:[];const{updateNodeData:C,getNode:x}=Gt(),p=Ee(()=>[{key:"key",icon:o(),title:n().title,description:n().description,content:s()}]),{deleteNode:_}=nb(),{copyNode:m}=rb(),S=xr(),N=()=>{var O;(O=S.onNodeExecute)==null||O.call(S,x(r()))};let P=Et();var D=fb(),I=ge(D);{var A=O=>{s1(O,{get position(){return ke.Top},align:"end",children:(z,j)=>{var X=db(),ee=W(X);{var re=le=>{Ge(le,{class:"tf-node-toolbar-item",onclick:()=>{_(r())},children:(pe,se)=>{var U=ob();H(pe,U)},$$slots:{default:!0}})};me(ee,le=>{c()&&le(re)})}var Q=B(ee,2);{var de=le=>{Ge(le,{class:"tf-node-toolbar-item",onclick:()=>{m(r())},children:(pe,se)=>{var U=ib();H(pe,U)},$$slots:{default:!0}})};me(Q,le=>{l()&&le(de)})}var ne=B(Q,2);{var _e=le=>{Ge(le,{class:"tf-node-toolbar-item",onclick:N,children:(pe,se)=>{var U=sb();H(pe,U)},$$slots:{default:!0}})};me(ne,le=>{a()&&le(_e)})}var Ne=B(ne,2);{var Ae=le=>{Oo(le,{placement:"bottom",floating:se=>{var U=ub(),ue=W(U),Y=B(W(ue));$t(Y,{style:"width: 100%;",onchange:Ve=>{const je=Ve.target.value;C(P,{title:je})},get value(){return n().title}}),F(ue);var we=B(ue,2),Pe=B(W(we));Mt(Pe,{rows:3,style:"width: 100%;",onchange:Ve=>{const je=Ve.target.value;C(P,{description:je})},get value(){return n().description}}),F(we);var De=B(we,2);{var Be=Ve=>{var je=ab(),gt=B(W(je));Mt(gt,{rows:2,style:"width: 100%;",onchange:Z=>{const Ue=Z.target.value;C(P,{condition:Ue})},get value(){return n().condition}}),F(je),H(Ve,je)};me(De,Ve=>{h()&&Ve(Be)})}var Ie=B(De,2),ye=B(W(Ie),2);gr(ye),ye.__change=[lb,C,P],F(Ie),F(U),He(()=>Vv(ye,!!n().async)),H(se,U)},children:(se,U)=>{Ge(se,{class:"tf-node-toolbar-item",children:(ue,Y)=>{var we=cb();H(ue,we)},$$slots:{default:!0}})},$$slots:{floating:!0,default:!0}})};me(Ne,le=>{u()&&le(Ae)})}F(X),H(z,X)},$$slots:{default:!0}})};me(I,O=>{(a()||l()||c())&&O(A)})}var V=B(I,2),L=B(W(V),2),R=W(L);d1(R,{get items(){return d(p)},get activeKeys(){return b},onChange:(O,z)=>{var j;C(r(),{expand:z==null?void 0:z.includes("key")}),(j=v())==null||j(z!=null&&z.includes("key")?"key":"")}}),F(L),F(V);var E=B(V,2);{var $=O=>{mr(O,{type:"target",get position(){return ke.Left},style:" left: -12px;top: 20px"})};me(E,O=>{g()&&O($)})}var k=B(E,2);{var T=O=>{mr(O,{type:"source",get position(){return ke.Right},style:"right: -12px;top: 20px"})};me(k,O=>{f()&&O(T)})}var M=B(k,2);return Lr(M,()=>i()??_t),H(e,D),he({get data(){return n()},set data(O){n(O),y()},get id(){return r()},set id(O=""){r(O),y()},get icon(){return o()},set icon(O){o(O),y()},get handle(){return i()},set handle(O){i(O),y()},get children(){return s()},set children(O){s(O),y()},get allowExecute(){return a()},set allowExecute(O=!0){a(O),y()},get allowCopy(){return l()},set allowCopy(O=!0){l(O),y()},get allowDelete(){return c()},set allowDelete(O=!0){c(O),y()},get allowSetting(){return u()},set allowSetting(O=!0){u(O),y()},get allowSettingOfCondition(){return h()},set allowSettingOfCondition(O=!0){h(O),y()},get showSourceHandle(){return f()},set showSourceHandle(O=!0){f(O),y()},get showTargetHandle(){return g()},set showTargetHandle(O=!0){g(O),y()},get onCollapse(){return v()},set onCollapse(O){v(O),y()}})}co(["change"]),ce(Nn,{data:{},id:{},icon:{},handle:{},children:{},allowExecute:{},allowCopy:{},allowDelete:{},allowSetting:{},allowSettingOfCondition:{},showSourceHandle:{},showTargetHandle:{},onCollapse:{}},[],[],!0);const T1=[{value:"String",label:"String"},{value:"Number",label:"Number"},{value:"Boolean",label:"Boolean"},{value:"File",label:"File"},{value:"Object",label:"Object"},{value:"Array",label:"Array"}],gb=[{value:"ref",label:"引用"},{value:"fixed",label:"固定值"}];var vb=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>'),pb=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>'),mb=ie('<div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div>',1);const yb={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 M1(e,t){fe(t,!0),st(e,yb);const[n,r]=dt(),o=()=>oe(d(l),"$node",n),i=w(t,"parameter",7),s=w(t,"index",7);let a=Et(),l=Ee(()=>Kr(a)),c=Ee(()=>{var I,A;return{...i(),...(A=(I=o())==null?void 0:I.data)==null?void 0:A.parameters[s()]}});const{updateNodeData:u}=Gt(),h=(I,A)=>{u(a,V=>{let L=V.data.parameters;return L[s()][I]=A,{parameters:L}})},f=I=>{const A=I.target.value;h("name",A)},g=I=>{const A=I.target.checked;h("required",A)},v=I=>{const A=I.value;A&&h("dataType",A)};let b;const C=()=>{u(a,I=>{let A=I.data.parameters;return A.splice(s(),1),{parameters:[...A]}}),b==null||b.hide()};var x=mb(),p=ge(x),_=W(p);$t(_,{style:"width: 100%;",get value(){return d(c).name},placeholder:"请输入参数名称",oninput:f}),F(p);var m=B(p,2),S=W(m);l1(S,{get checked(){return d(c).required},onchange:g}),F(m);var N=B(m,2),P=W(N);Ln(Oo(P,{placement:"bottom",floating:A=>{var V=vb(),L=W(V),R=B(W(L));{let z=Ee(()=>d(c).dataType?[d(c).dataType]:["String"]);mn(R,{get items(){return T1},style:"width: 100%",onSelect:v,get value(){return d(z)}})}F(L);var E=B(L,2),$=B(W(E));Mt($,{rows:1,style:"width: 100%;",get value(){return d(c).defaultValue},onchange:z=>{const j=z.target.value;h("defaultValue",j)}}),F(E);var k=B(E,2),T=B(W(k));Mt(T,{rows:3,style:"width: 100%;",get value(){return d(c).description},onchange:z=>{const j=z.target.value;h("description",j)}}),F(k);var M=B(k,2),O=W(M);Ge(O,{onclick:C,children:(z,j)=>{Te();var X=Re("删除");H(z,X)},$$slots:{default:!0}}),F(M),F(V),H(A,V)},children:(A,V)=>{Ge(A,{class:"input-btn-more",children:(L,R)=>{var E=pb();H(L,E)},$$slots:{default:!0}})},$$slots:{floating:!0,default:!0}}),A=>b=A,()=>b),F(N),H(e,x);var D=he({get parameter(){return i()},set parameter(I){i(I),y()},get index(){return s()},set index(I){s(I),y()}});return r(),D}ce(M1,{parameter:{},index:{}},[],[],!0);var wb=ie('<div class="input-header svelte-3n0wca">参数名称</div> <div class="input-header svelte-3n0wca">必填</div> <div class="input-header svelte-3n0wca"></div>',1),_b=ie('<div class="none-params svelte-3n0wca">无输入参数</div>'),bb=ie('<div class="input-container svelte-3n0wca"><!> <!></div>');const xb={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;
|
|
17
|
+
/* 从第一列开始到最后一列结束 */}.input-container.svelte-3n0wca .input-header:where(.svelte-3n0wca) {font-size:12px;color:#666;}`};function O1(e,t){fe(t,!0),st(e,xb);const[n,r]=dt(),o=()=>oe(d(s),"$node",n);let i=Et(),s=Ee(()=>Kr(i)),a=Ee(()=>{var f,g;return[...((g=(f=o())==null?void 0:f.data)==null?void 0:g.parameters)||[]]});var l=bb(),c=W(l);{var u=f=>{var g=wb();Te(4),H(f,g)};me(c,f=>{d(a).length!==0&&f(u)})}var h=B(c,2);Wt(h,19,()=>d(a),f=>f.id,(f,g,v)=>{M1(f,{get parameter(){return d(g)},get index(){return d(v)}})},f=>{var g=_b();H(f,g)}),F(l),H(e,l),he(),r()}ce(O1,{},[],[],!0);const Qs=e=>(!e||e.length==0||e.forEach(t=>{t.id||(t.id=Zr()),Qs(t.children)}),e),Yn=()=>{const{updateNodeData:e}=Gt();return{addParameter:(t,n="parameters",r)=>{Qs(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 Cb=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>'),$b=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Eb=ie('<div class="heading svelte-r5g35l"><!> <!></div> <!>',1);const Sb={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 H1(e,t){fe(t,!0),st(e,Sb);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=Et(),{addParameter:i}=Yn();return Nn(e,vt(()=>r,{get data(){return n()},allowExecute:!1,showTargetHandle:!1,allowSettingOfCondition:!1,icon:a=>{var l=Cb();H(a,l)},children:(a,l)=>{var c=Eb(),u=ge(c),h=W(u);ot(h,{level:3,children:(v,b)=>{Te();var C=Re("输入参数");H(v,C)},$$slots:{default:!0}});var f=B(h,2);Ge(f,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"parameters",{refType:"input"})},children:(v,b)=>{var C=$b();H(v,C)},$$slots:{default:!0}}),F(u);var g=B(u,2);O1(g,{}),H(a,c)},$$slots:{icon:!0,default:!0}})),he({get data(){return n()},set data(s){n(s),y()}})}ce(H1,{data:{}},[],[],!0);const A1=(e,t,n)=>{for(const r of n)r.target===t&&r.source&&(e.push(r.source),A1(e,r.source,n))},D1=(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:D1(r.children,t+"."+r.name,n)})),V1=(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:D1(r,e.id,t)}}}},kb=(e=!1)=>{const t=Et(),n=Kr(t),{nodes:r,edges:o,nodeLookup:i}=Qe();return vr([n,r,o,i],([s,a,l,c])=>{if(!s)return[];const u=c.get(t),h=[];if(e)for(const f of a){const g=f.parentId===s.id;if(g){const v=V1(f,g,u);v&&h.push(v)}}else{const f=[];A1(f,t,l);for(const g of a)if(f.includes(g.id)){const v=g.parentId===s.id,b=V1(g,v,u);b&&h.push(b)}}return h})};var Pb=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>'),Nb=ie('<div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div> <div class="input-item svelte-laou7w"><!></div>',1);const Tb={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 I1(e,t){fe(t,!0),st(e,Tb);const[n,r]=dt(),o=()=>oe(d(h),"$node",n),i=()=>oe(m,"$selectItems",n);gn(()=>{d(f).refType||x({value:"ref"})});const s=w(t,"parameter",7),a=w(t,"index",7),l=w(t,"dataKeyName",7),c=w(t,"useChildrenOnly",7);let u=Et(),h=Ee(()=>Kr(u)),f=Ee(()=>{var $;return{...s(),...($=o())==null?void 0:$.data[l()][a()]}});const{updateNodeData:g}=Gt(),v=($,k)=>{g(u,T=>{let M=T.data[l()];return M[a()]={...M[a()],[$]:k},{[l()]:M}})},b=($,k)=>{const T=k.target.value;v($,T)},C=$=>{const k=$.value;v("ref",k)},x=$=>{const k=$.value;v("refType",k)};let p;const _=()=>{g(u,$=>{let k=$.data[l()];return k.splice(a(),1),{[l()]:[...k]}}),p==null||p.hide()},m=kb(c());var S=Nb(),N=ge(S),P=W(N);{let $=Ee(()=>d(f).nameDisabled===!0);$t(P,{style:"width: 100%;",get value(){return d(f).name},placeholder:"请输入参数名称",get disabled(){return d($)},oninput:k=>b("name",k)})}F(N);var D=B(N,2),I=W(D);{var A=$=>{$t($,{get value(){return d(f).value},placeholder:"请输入参数值",oninput:k=>b("value",k)})},V=$=>{var k=Ke(),T=ge(k);{var M=O=>{{let z=Ee(()=>[d(f).ref]);mn(O,{get items(){return i()},style:"width: 100%",defaultValue:["ref"],get value(){return d(z)},expandAll:!0,onSelect:C})}};me(T,O=>{d(f).refType!=="input"&&O(M)},!0)}H($,k)};me(I,$=>{d(f).refType==="fixed"?$(A):$(V,!1)})}F(D);var L=B(D,2),R=W(L);Ln(Oo(R,{placement:"bottom",floating:k=>{var T=Pb(),M=W(T),O=B(W(M));{let de=Ee(()=>d(f).refType?[d(f).refType]:[]);mn(O,{get items(){return gb},style:"width: 100%",defaultValue:["ref"],get value(){return d(de)},onSelect:x})}F(M);var z=B(M,2),j=B(W(z));Mt(j,{rows:1,style:"width: 100%;",onchange:de=>{b("defaultValue",de)},get value(){return d(f).defaultValue}}),F(z);var X=B(z,2),ee=B(W(X));Mt(ee,{rows:3,style:"width: 100%;",onchange:de=>{b("description",de)},get value(){return d(f).description}}),F(X);var re=B(X,2),Q=W(re);Ge(Q,{onclick:_,children:(de,ne)=>{Te();var _e=Re("删除");H(de,_e)},$$slots:{default:!0}}),F(re),F(T),H(k,T)},children:(k,T)=>{Js(k,{})},$$slots:{floating:!0,default:!0}}),k=>p=k,()=>p),F(L),H(e,S);var E=he({get parameter(){return s()},set parameter($){s($),y()},get index(){return a()},set index($){a($),y()},get dataKeyName(){return l()},set dataKeyName($){l($),y()},get useChildrenOnly(){return c()},set useChildrenOnly($){c($),y()}});return r(),E}ce(I1,{parameter:{},index:{},dataKeyName:{},useChildrenOnly:{}},[],[],!0);var Mb=ie('<div class="input-header svelte-1sm1mgi">参数名称</div> <div class="input-header svelte-1sm1mgi">参数值</div> <div class="input-header svelte-1sm1mgi"></div>',1),Ob=ie('<div class="none-params svelte-1sm1mgi"> </div>'),Hb=ie('<div class="input-container svelte-1sm1mgi"><!> <!></div>');const Ab={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;
|
|
18
|
+
/* 从第一列开始到最后一列结束 */}.input-container.svelte-1sm1mgi .input-header:where(.svelte-1sm1mgi) {font-size:12px;color:#666;}`};function Jt(e,t){fe(t,!0),st(e,Ab);const[n,r]=dt(),o=()=>oe(d(c),"$node",n),i=w(t,"noneParameterText",7,"无输入参数"),s=w(t,"dataKeyName",7,"parameters"),a=w(t,"useChildrenOnly",7);let l=Et(),c=Ee(()=>Kr(l)),u=Ee(()=>{var C;return[...((C=o())==null?void 0:C.data[s()])||[]]});var h=Hb(),f=W(h);{var g=C=>{var x=Mb();Te(4),H(C,x)};me(f,C=>{d(u).length!==0&&C(g)})}var v=B(f,2);Wt(v,19,()=>d(u),C=>C.id,(C,x,p)=>{I1(C,{get parameter(){return d(x)},get index(){return d(p)},get dataKeyName(){return s()},get useChildrenOnly(){return a()}})},C=>{var x=Ob(),p=W(x,!0);F(x),He(()=>pt(p,i())),H(C,x)}),F(h),H(e,h);var b=he({get noneParameterText(){return i()},set noneParameterText(C="无输入参数"){i(C),y()},get dataKeyName(){return s()},set dataKeyName(C="parameters"){s(C),y()},get useChildrenOnly(){return a()},set useChildrenOnly(C){a(C),y()}});return r(),b}ce(Jt,{noneParameterText:{},dataKeyName:{},useChildrenOnly:{}},[],[],!0);var Db=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>'),Vb=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Ib=ie('<div class="heading svelte-11h445j"><!> <!></div> <!>',1);const Lb={hash:"svelte-11h445j",code:".heading.svelte-11h445j {display:flex;margin-bottom:10px;}"};function L1(e,t){fe(t,!0),st(e,Lb);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=Et(),{addParameter:i}=Yn();return Nn(e,vt({get data(){return n()}},()=>r,{allowExecute:!1,showSourceHandle:!1,icon:a=>{var l=Db();H(a,l)},children:(a,l)=>{var c=Ib(),u=ge(c),h=W(u);ot(h,{level:3,children:(v,b)=>{Te();var C=Re("输出参数");H(v,C)},$$slots:{default:!0}});var f=B(h,2);Ge(f,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(v,b)=>{var C=Vb();H(v,C)},$$slots:{default:!0}}),F(u);var g=B(u,2);Jt(g,{noneParameterText:"无输出参数",dataKeyName:"outputDefs"}),H(a,c)},$$slots:{icon:!0,default:!0}})),he({get data(){return n()},set data(s){n(s),y()}})}ce(L1,{data:{}},[],[],!0);const eu=e=>JSON.parse(JSON.stringify(e));var zb=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>'),Rb=ie('<div class="input-more-item svelte-1cfeest"><!></div>'),Bb=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>'),qb=ie('<div class="input-item svelte-1cfeest"><!> <!></div> <div class="input-item svelte-1cfeest"><!> <!></div> <div class="input-item svelte-1cfeest"><!></div>',1);const Fb={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 z1(e,t){fe(t,!0),st(e,Fb);const[n,r]=dt(),o=()=>oe(d(c),"$node",n),i=w(t,"parameter",7),s=w(t,"position",7),a=w(t,"dataKeyName",7);let l=Et(),c=Ee(()=>Kr(l)),u=Ee(()=>{var k;let E=(k=o())==null?void 0:k.data[a()],$;if(E&&s().length>0){let T=E;for(let M=0;M<s().length;M++){const O=s()[M];M==s().length-1?$=T[O]:T=T[O].children}}return{...i(),...$}});const{updateNodeData:h}=Gt(),f=(E,$)=>{h(l,k=>{const T=k.data[a()];if(T&&s().length>0){let M=T;for(let O=0;O<s().length;O++){const z=s()[O];O==s().length-1?M[z]={...M[z],[E]:$}:M=M[z].children}}return{[a()]:[...eu(T)]}})},g=(E,$)=>{const k=$.target.value;f(E,k)},v=E=>{const $=E.value;f("dataType",$)};let b;const C=()=>{h(l,E=>{let $=E.data[a()];if($&&s().length>0){let k=$;for(let T=0;T<s().length;T++){const M=s()[T];T==s().length-1?k.splice(M,1):k=k[M].children}}return{[a()]:[...eu($)]}}),b==null||b.hide()},x=()=>{h(l,E=>{let $=E.data[a()];if($&&s().length>0){let k=$;for(let T=0;T<s().length;T++){const M=s()[T];T==s().length-1?k[M].children?k[M].children.push({id:Zr(),name:"newParam",dataType:"String"}):k[M].children=[{id:Zr(),name:"newParam",dataType:"String"}]:k=k[M].children}}return{[a()]:[...eu($)]}})};var p=qb(),_=ge(p),m=W(_);{var S=E=>{var $=Ke(),k=ge($);Wt(k,17,s,ho,(T,M)=>{Te();var O=Re(" ");H(T,O)}),H(E,$)};me(m,E=>{s().length>1&&E(S)})}var N=B(m,2);{let E=Ee(()=>d(u).nameDisabled===!0);$t(N,{style:"width: 100%;",get value(){return d(u).name},placeholder:"请输入参数名称",oninput:$=>{g("name",$)},get disabled(){return d(E)}})}F(_);var P=B(_,2),D=W(P);{let E=Ee(()=>d(u).dataType?[d(u).dataType]:[]),$=Ee(()=>d(u).dataTypeDisabled===!0);mn(D,{get items(){return T1},style:"width: 100%",defaultValue:["String"],get value(){return d(E)},get disabled(){return d($)},onSelect:v})}var I=B(D,2);{var A=E=>{Ge(E,{class:"input-btn-more",style:"margin-left: auto",onclick:x,children:($,k)=>{var T=zb();H($,T)},$$slots:{default:!0}})};me(I,E=>{(d(u).dataType==="Object"||d(u).dataType==="Array")&&d(u).addChildDisabled!==!0&&E(A)})}F(P);var V=B(P,2),L=W(V);Ln(Oo(L,{placement:"bottom",floating:$=>{var k=Bb(),T=W(k),M=B(W(T));{let ee=Ee(()=>d(u).defaultValue||"");Mt(M,{rows:1,style:"width: 100%;",get value(){return d(ee)},onchange:re=>{g("defaultValue",re)}})}F(T);var O=B(T,2),z=B(W(O));{let ee=Ee(()=>d(u).description||"");Mt(z,{rows:3,style:"width: 100%;",get value(){return d(ee)},onchange:re=>{g("description",re)}})}F(O);var j=B(O,2);{var X=ee=>{var re=Rb(),Q=W(re);Ge(Q,{onclick:C,children:(de,ne)=>{Te();var _e=Re("删除");H(de,_e)},$$slots:{default:!0}}),F(re),H(ee,re)};me(j,ee=>{d(u).deleteDisabled!==!0&&ee(X)})}F(k),H($,k)},children:($,k)=>{Js($,{})},$$slots:{floating:!0,default:!0}}),$=>b=$,()=>b),F(V),H(e,p);var R=he({get parameter(){return i()},set parameter(E){i(E),y()},get position(){return s()},set position(E){s(E),y()},get dataKeyName(){return a()},set dataKeyName(E){a(E),y()}});return r(),R}ce(z1,{parameter:{},position:{},dataKeyName:{}},[],[],!0);var Yb=ie("<!> <!>",1),Wb=ie('<div class="none-params svelte-1sm1mgi"> </div>'),Kb=ie('<div class="input-header svelte-1sm1mgi">参数名称</div> <div class="input-header svelte-1sm1mgi">参数类型</div> <div class="input-header svelte-1sm1mgi"></div>',1),Xb=ie('<div class="input-container svelte-1sm1mgi"><!> <!></div>');const Zb={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;
|
|
19
|
+
/* 从第一列开始到最后一列结束 */}.input-container.svelte-1sm1mgi .input-header:where(.svelte-1sm1mgi) {font-size:12px;color:#666;}`};function Cr(e,t){fe(t,!0),st(e,Zb);const[n,r]=dt(),o=()=>oe(d(c),"$node",n),i=(C,x=_t,p=_t)=>{var _=Ke(),m=ge(_);Wt(m,19,x,S=>`${S.id}_${S.children?S.children.length:0}`,(S,N,P)=>{var D=Yb(),I=ge(D);{let L=Ee(()=>[...p(),d(P)]);z1(I,{get parameter(){return d(N)},get position(){return d(L)},get dataKeyName(){return a()}})}var A=B(I,2);{var V=L=>{{let R=Ee(()=>[...p(),d(P)]);i(L,()=>d(N).children,()=>d(R))}};me(A,L=>{d(N).children&&L(V)})}H(S,D)},S=>{var N=Ke(),P=ge(N);{var D=I=>{var A=Wb(),V=W(A,!0);F(A),He(()=>pt(V,s())),H(I,A)};me(P,I=>{p().length===0&&I(D)})}H(S,N)}),H(C,_)},s=w(t,"noneParameterText",7,"无输出参数"),a=w(t,"dataKeyName",7,"outputDefs");let l=Et(),c=Ee(()=>Kr(l)),u=Ee(()=>{var C;return[...((C=o())==null?void 0:C.data[a()])||[]]});var h=Xb(),f=W(h);{var g=C=>{var x=Kb();Te(4),H(C,x)};me(f,C=>{d(u).length!==0&&C(g)})}var v=B(f,2);i(v,()=>d(u)||[],()=>[]),F(h),H(e,h);var b=he({get noneParameterText(){return s()},set noneParameterText(C="无输出参数"){s(C),y()},get dataKeyName(){return a()},set dataKeyName(C="outputDefs"){a(C),y()}});return r(),b}ce(Cr,{noneParameterText:{},dataKeyName:{}},[],[],!0);var jb=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>'),Ub=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Gb=(e,t,n)=>t(n,{temperature:parseFloat(e.target.value)}),Jb=(e,t,n)=>t(n,{topP:parseFloat(e.target.value)}),Qb=(e,t,n)=>t(n,{topK:parseInt(e.target.value)}),ex=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),tx=ie('<div class="heading svelte-q0cqsa"><!> <!></div> <!> <!> <div class="setting-title svelte-q0cqsa">模型</div> <div class="setting-item svelte-q0cqsa"><!> <!></div> <div class="setting-title svelte-q0cqsa">采样参数</div> <div class="setting-item svelte-q0cqsa"><div class="slider-container svelte-q0cqsa"><span class="svelte-q0cqsa"> </span> <input class="nodrag svelte-q0cqsa" type="range" min="0" max="1" step="0.1"/></div></div> <div class="setting-item svelte-q0cqsa"><div class="slider-container svelte-q0cqsa"><span class="svelte-q0cqsa"> </span> <input class="nodrag svelte-q0cqsa" type="range" min="0" max="1" step="0.1"/></div></div> <div class="setting-item svelte-q0cqsa"><div class="slider-container svelte-q0cqsa"><span class="svelte-q0cqsa"> </span> <input class="nodrag svelte-q0cqsa" type="range" min="0" max="100" step="1"/></div></div> <div class="setting-title svelte-q0cqsa">系统提示词</div> <div class="setting-item svelte-q0cqsa"><!></div> <div class="setting-title svelte-q0cqsa">用户提示词</div> <div class="setting-item svelte-q0cqsa"><!></div> <div class="heading svelte-q0cqsa"><!> <!> <!></div> <!>',1);const nx={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;}
|
|
20
|
+
|
|
21
|
+
/* 新增样式 */.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 R1(e,t){fe(t,!0),st(e,nx);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=Et(),{addParameter:i}=Yn(),s=xr();let a=Bt(On([]));gn(async()=>{var h,f;const u=await((f=(h=s.provider)==null?void 0:h.llm)==null?void 0:f.call(h));d(a).push(...u||[])});const{updateNodeData:l}=Gt(),c=u=>{l(o,()=>({outType:u})),u==="text"?l(o,{outputDefs:[{name:"output",dataType:"String",dataTypeDisabled:!0,deleteDisabled:!0}]}):l(o,{outputDefs:[]})};return fn(()=>{n().outType||c("text")}),Nn(e,vt({get data(){return n()}},()=>r,{icon:h=>{var f=jb();H(h,f)},children:(h,f)=>{var g=tx(),v=ge(g),b=W(v);ot(b,{level:3,children:(le,pe)=>{Te();var se=Re("输入参数");H(le,se)},$$slots:{default:!0}});var C=B(b,2);Ge(C,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(le,pe)=>{var se=Ub();H(le,se)},$$slots:{default:!0}}),F(v);var x=B(v,2);Jt(x,{});var p=B(x,2);ot(p,{level:3,mt:"10px",children:(le,pe)=>{Te();var se=Re("模型设置");H(le,se)},$$slots:{default:!0}});var _=B(p,4),m=W(_);{let le=Ee(()=>n().llmId?[n().llmId]:[]);mn(m,{get items(){return d(a)},style:"width: 100%",placeholder:"请选择模型",onSelect:pe=>{const se=pe.value;l(o,()=>({llmId:se}))},get value(){return d(le)}})}var S=B(m,2);Js(S,{}),F(_);var N=B(_,4),P=W(N),D=W(P),I=W(D);F(D);var A=B(D,2);gr(A),A.__input=[Gb,l,o],F(P),F(N);var V=B(N,2),L=W(V),R=W(L),E=W(R);F(R);var $=B(R,2);gr($),$.__input=[Jb,l,o],F(L),F(V);var k=B(V,2),T=W(k),M=W(T),O=W(M);F(M);var z=B(M,2);gr(z),z.__input=[Qb,l,o],F(T),F(k);var j=B(k,4),X=W(j);{let le=Ee(()=>n().systemPrompt||"");Mt(X,{rows:5,placeholder:"请输入系统提示词",style:"width: 100%",get value(){return d(le)},oninput:pe=>{l(o,{systemPrompt:pe.target.value})}})}F(j);var ee=B(j,4),re=W(ee);{let le=Ee(()=>n().userPrompt||"");Mt(re,{rows:5,placeholder:"请输入用户提示词",style:"width: 100%",get value(){return d(le)},oninput:pe=>{l(o,{userPrompt:pe.target.value})}})}F(ee);var Q=B(ee,2),de=W(Q);ot(de,{level:3,mt:"10px",children:(le,pe)=>{Te();var se=Re("输出参数");H(le,se)},$$slots:{default:!0}});var ne=B(de,2);{let le=Ee(()=>n().outType?[n().outType]:[]);mn(ne,{items:[{label:"文本",value:"text"},{label:"JSON",value:"json"}],style:"width: 100px;margin-left: auto",defaultValue:"text",onSelect:pe=>{c(pe.value)},get value(){return d(le)}})}var _e=B(ne,2);{var Ne=le=>{Ge(le,{class:"input-btn-more",style:"margin-left: 10px",onclick:()=>{i(o,"outputDefs")},children:(pe,se)=>{var U=ex();H(pe,U)},$$slots:{default:!0}})};me(_e,le=>{n().outType==="json"&&le(Ne)})}F(Q);var Ae=B(Q,2);Cr(Ae,{}),He(()=>{pt(I,`Temperature: ${n().temperature??.5??""}`),ss(A,n().temperature??.5),pt(E,`Top P: ${n().topP??.9??""}`),ss($,n().topP??.9),pt(O,`Top K: ${n().topK??50??""}`),ss(z,n().topK??50)}),H(h,g)},$$slots:{icon:!0,default:!0}})),he({get data(){return n()},set data(u){n(u),y()}})}co(["input"]),ce(R1,{data:{}},[],[],!0);var rx=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>'),ox=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),ix=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),sx=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 ax={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 B1(e,t){fe(t,!0),st(e,ax);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]);gn(()=>{n().engine||s(o,()=>({engine:"qlexpress"}))});const o=Et(),{addParameter:i}=Yn(),{updateNodeData:s}=Gt(),a=[{label:"QLExpress",value:"qlexpress"},{label:"Groovy",value:"groovy"},{label:"JavaScript",value:"js"}];return Nn(e,vt({get data(){return n()}},()=>r,{icon:c=>{var u=rx();H(c,u)},children:(c,u)=>{var h=sx(),f=ge(h),g=W(f);ot(g,{level:3,children:(I,A)=>{Te();var V=Re("输入参数");H(I,V)},$$slots:{default:!0}});var v=B(g,2);Ge(v,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(I,A)=>{var V=ox();H(I,V)},$$slots:{default:!0}}),F(f);var b=B(f,2);Jt(b,{});var C=B(b,2);ot(C,{level:3,mt:"10px",children:(I,A)=>{Te();var V=Re("代码");H(I,V)},$$slots:{default:!0}});var x=B(C,4),p=W(x);{let I=Ee(()=>n().engine?[n().engine]:["qlexpress"]);mn(p,{get items(){return a},style:"width: 100%",placeholder:"请选择执行引擎",onSelect:A=>{const V=A.value;s(o,()=>({engine:V}))},get value(){return d(I)}})}F(x);var _=B(x,4),m=W(_);{let I=Ee(()=>n().code||"");Mt(m,{rows:10,placeholder:"请输入执行代码,注:输出内容需添加到_result中,如:_result.put(key, value)",style:"width: 100%",onchange:A=>{s(o,()=>({code:A.target.value}))},get value(){return d(I)}})}F(_);var S=B(_,2),N=W(S);ot(N,{level:3,mt:"10px",children:(I,A)=>{Te();var V=Re("输出参数");H(I,V)},$$slots:{default:!0}});var P=B(N,2);Ge(P,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(I,A)=>{var V=ix();H(I,V)},$$slots:{default:!0}}),F(S);var D=B(S,2);Cr(D,{}),H(c,h)},$$slots:{icon:!0,default:!0}})),he({get data(){return n()},set data(l){n(l),y()}})}ce(B1,{data:{}},[],[],!0);var lx=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>'),ux=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),cx=ie('<div class="heading svelte-15t2v24"><!> <!></div> <!> <!> <div class="setting-item svelte-15t2v24"><!></div> <div class="heading svelte-15t2v24"><!></div> <!>',1);const dx={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 q1(e,t){fe(t,!0),st(e,dx);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=Et(),{addParameter:i}=Yn(),{updateNodeData:s}=Gt();return fn(()=>{(!n().outputDefs||n().outputDefs.length===0)&&i(o,"outputDefs",{name:"output",dataType:"String",dataTypeDisabled:!0,deleteDisabled:!0})}),Nn(e,vt({get data(){return n()}},()=>r,{icon:l=>{var c=lx();H(l,c)},children:(l,c)=>{var u=cx(),h=ge(u),f=W(h);ot(f,{level:3,children:(S,N)=>{Te();var P=Re("输入参数");H(S,P)},$$slots:{default:!0}});var g=B(f,2);Ge(g,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(S,N)=>{var P=ux();H(S,P)},$$slots:{default:!0}}),F(h);var v=B(h,2);Jt(v,{});var b=B(v,2);ot(b,{level:3,mt:"10px",mb:"10px",children:(S,N)=>{Te();var P=Re("模板内容");H(S,P)},$$slots:{default:!0}});var C=B(b,2),x=W(C);{let S=Ee(()=>n().template||"");Mt(x,{rows:10,placeholder:"请输入模板内容",style:"width: 100%",onchange:N=>{s(o,()=>({template:N.target.value}))},get value(){return d(S)}})}F(C);var p=B(C,2),_=W(p);ot(_,{level:3,mt:"10px",children:(S,N)=>{Te();var P=Re("输出参数");H(S,P)},$$slots:{default:!0}}),F(p);var m=B(p,2);Cr(m,{}),H(l,u)},$$slots:{icon:!0,default:!0}})),he({get data(){return n()},set data(a){n(a),y()}})}ce(q1,{data:{}},[],[],!0);var fx=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>'),hx=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),gx=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),vx=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),px=ie('<div class="heading svelte-1mo2w1q" style="padding-top: 10px"><!> <!></div> <!>',1),mx=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),yx=ie('<div class="heading svelte-1mo2w1q" style="padding-top: 10px"><!> <!></div> <!>',1),wx=ie('<div style="width: 100%"><!></div>'),_x=ie('<div style="width: 100%"><!></div>'),bx=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),xx=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 Cx={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 F1(e,t){fe(t,!0),st(e,Cx);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]);gn(()=>{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=Et(),{addParameter:s}=Yn(),{updateNodeData:a}=Gt();return Nn(e,vt({get data(){return n()}},()=>r,{icon:c=>{var u=fx();H(c,u)},children:(c,u)=>{var h=xx(),f=ge(h),g=W(f);ot(g,{level:3,children:(U,ue)=>{Te();var Y=Re("输入参数");H(U,Y)},$$slots:{default:!0}});var v=B(g,2);Ge(v,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i)},children:(U,ue)=>{var Y=hx();H(U,Y)},$$slots:{default:!0}}),F(f);var b=B(f,2);Jt(b,{});var C=B(b,2);ot(C,{level:3,mt:"10px",children:(U,ue)=>{Te();var Y=Re("URL 地址");H(U,Y)},$$slots:{default:!0}});var x=B(C,2),p=W(x),_=W(p);{let U=Ee(()=>n().method?[n().method]:["get"]);mn(_,{get items(){return o},style:"width: 100%",placeholder:"请选择请求方式",onSelect:ue=>{const Y=ue.value;a(i,()=>({method:Y}))},get value(){return d(U)}})}F(p);var m=B(p,2),S=W(m);{let U=Ee(()=>n().url||"");$t(S,{placeholder:"请输入url",style:"width: 100%",onchange:ue=>{a(i,()=>({url:ue.target.value}))},get value(){return d(U)}})}F(m),F(x);var N=B(x,2),P=W(N);ot(P,{level:3,children:(U,ue)=>{Te();var Y=Re("Http 头信息");H(U,Y)},$$slots:{default:!0}});var D=B(P,2);Ge(D,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"headers")},children:(U,ue)=>{var Y=gx();H(U,Y)},$$slots:{default:!0}}),F(N);var I=B(N,2);Jt(I,{dataKeyName:"headers"});var A=B(I,2);ot(A,{level:3,mt:"10px",children:(U,ue)=>{Te();var Y=Re("Body");H(U,Y)},$$slots:{default:!0}});var V=B(A,2),L=W(V),R=W(L);{let U=Ee(()=>!n().bodyType);$t(R,{type:"radio",name:"bodyType",value:"",get checked(){return d(U)},onchange:ue=>{var Y;(Y=ue.target)!=null&&Y.checked&&a(i,{bodyType:""})}})}Te(),F(L);var E=B(L,2),$=W(E);{let U=Ee(()=>n().bodyType==="form-data");$t($,{type:"radio",name:"bodyType",value:"form-data",get checked(){return d(U)},onchange:ue=>{var Y;(Y=ue.target)!=null&&Y.checked&&a(i,{bodyType:"form-data"})}})}Te(),F(E);var k=B(E,2),T=W(k);{let U=Ee(()=>n().bodyType==="x-www-form-urlencoded");$t(T,{type:"radio",name:"bodyType",value:"x-www-form-urlencoded",get checked(){return d(U)},onchange:ue=>{var Y;(Y=ue.target)!=null&&Y.checked&&a(i,{bodyType:"x-www-form-urlencoded"})}})}Te(),F(k);var M=B(k,2),O=W(M);{let U=Ee(()=>n().bodyType==="json");$t(O,{type:"radio",name:"bodyType",value:"json",get checked(){return d(U)},onchange:ue=>{var Y;(Y=ue.target)!=null&&Y.checked&&a(i,{bodyType:"json"})}})}Te(),F(M);var z=B(M,2),j=W(z);{let U=Ee(()=>n().bodyType==="raw");$t(j,{type:"radio",name:"bodyType",value:"raw",get checked(){return d(U)},onchange:ue=>{var Y;(Y=ue.target)!=null&&Y.checked&&a(i,{bodyType:"raw"})}})}Te(),F(z),F(V);var X=B(V,2);{var ee=U=>{var ue=px(),Y=ge(ue),we=W(Y);ot(we,{level:3,children:(Be,Ie)=>{Te();var ye=Re("参数");H(Be,ye)},$$slots:{default:!0}});var Pe=B(we,2);Ge(Pe,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"formData")},children:(Be,Ie)=>{var ye=vx();H(Be,ye)},$$slots:{default:!0}}),F(Y);var De=B(Y,2);Jt(De,{dataKeyName:"formData"}),H(U,ue)};me(X,U=>{n().bodyType==="form-data"&&U(ee)})}var re=B(X,2);{var Q=U=>{var ue=yx(),Y=ge(ue),we=W(Y);ot(we,{level:3,children:(Be,Ie)=>{Te();var ye=Re("Body 参数");H(Be,ye)},$$slots:{default:!0}});var Pe=B(we,2);Ge(Pe,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"formUrlencoded")},children:(Be,Ie)=>{var ye=mx();H(Be,ye)},$$slots:{default:!0}}),F(Y);var De=B(Y,2);Jt(De,{dataKeyName:"formUrlencoded"}),H(U,ue)};me(re,U=>{n().bodyType==="x-www-form-urlencoded"&&U(Q)})}var de=B(re,2);{var ne=U=>{var ue=wx(),Y=W(ue);Mt(Y,{rows:5,style:"width: 100%",placeholder:"请输入 json 信息",get value(){return n().bodyJson},oninput:we=>{a(i,{bodyJson:we.target.value})}}),F(ue),H(U,ue)};me(de,U=>{n().bodyType==="json"&&U(ne)})}var _e=B(de,2);{var Ne=U=>{var ue=_x(),Y=W(ue);Mt(Y,{rows:5,style:"width: 100%",placeholder:"请输入请求信息",get value(){return n().bodyRaw},oninput:we=>{a(i,{bodyRaw:we.target.value})}}),F(ue),H(U,ue)};me(_e,U=>{n().bodyType==="raw"&&U(Ne)})}var Ae=B(_e,2),le=W(Ae);ot(le,{level:3,mt:"10px",children:(U,ue)=>{Te();var Y=Re("输出参数");H(U,Y)},$$slots:{default:!0}});var pe=B(le,2);Ge(pe,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{s(i,"outputDefs")},children:(U,ue)=>{var Y=bx();H(U,Y)},$$slots:{default:!0}}),F(Ae);var se=B(Ae,2);Cr(se,{}),H(c,h)},$$slots:{icon:!0,default:!0}})),he({get data(){return n()},set data(l){n(l),y()}})}ce(F1,{data:{}},[],[],!0);var $x=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>'),Ex=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Sx=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 kx={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 Y1(e,t){fe(t,!0),st(e,kx);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=Et(),{addParameter:i}=Yn(),s=xr();let a=Bt(On([]));gn(async()=>{var u,h;const c=await((h=(u=s.provider)==null?void 0:u.knowledge)==null?void 0:h.call(u));d(a).push(...c||[])});const{updateNodeData:l}=Gt();return fn(()=>{(!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}]})}),Nn(e,vt({get data(){return n()}},()=>r,{icon:u=>{var h=$x();H(u,h)},children:(u,h)=>{var f=Sx(),g=ge(f),v=W(g);ot(v,{level:3,children:(V,L)=>{Te();var R=Re("输入参数");H(V,R)},$$slots:{default:!0}});var b=B(v,2);Ge(b,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(V,L)=>{var R=Ex();H(V,R)},$$slots:{default:!0}}),F(g);var C=B(g,2);Jt(C,{});var x=B(C,2);ot(x,{level:3,mt:"10px",children:(V,L)=>{Te();var R=Re("知识库设置");H(V,R)},$$slots:{default:!0}});var p=B(x,4),_=W(p);{let V=Ee(()=>n().knowledgeId?[n().knowledgeId]:[]);mn(_,{get items(){return d(a)},style:"width: 100%",placeholder:"请选择知识库",onSelect:L=>{const R=L.value;l(o,()=>({knowledgeId:R}))},get value(){return d(V)}})}F(p);var m=B(p,4),S=W(m);$t(S,{placeholder:"请输入关键字",style:"width: 100%",get value(){return n().keyword},onchange:V=>{const L=V.target.value;l(o,()=>({keyword:L}))}}),F(m);var N=B(m,4),P=W(N);{let V=Ee(()=>n().limit||"");$t(P,{placeholder:"搜索的数据条数",style:"width: 100%",onchange:L=>{const R=L.target.value;l(o,()=>({limit:R}))},get value(){return d(V)}})}F(N);var D=B(N,2),I=W(D);ot(I,{level:3,mt:"10px",children:(V,L)=>{Te();var R=Re("输出参数");H(V,R)},$$slots:{default:!0}}),F(D);var A=B(D,2);Cr(A,{}),H(u,f)},$$slots:{icon:!0,default:!0}})),he({get data(){return n()},set data(c){n(c),y()}})}ce(Y1,{data:{}},[],[],!0);var Px=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>'),Nx=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Tx=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 Mx={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 W1(e,t){fe(t,!0),st(e,Mx);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=Et(),{addParameter:i}=Yn(),s=xr();let a=Bt(On([]));gn(async()=>{var u,h;const c=await((h=(u=s.provider)==null?void 0:u.searchEngine)==null?void 0:h.call(u));d(a).push(...c||[])});const{updateNodeData:l}=Gt();return fn(()=>{(!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}]})}),Nn(e,vt({get data(){return n()}},()=>r,{icon:u=>{var h=Px();H(u,h)},children:(u,h)=>{var f=Tx(),g=ge(f),v=W(g);ot(v,{level:3,children:(V,L)=>{Te();var R=Re("输入参数");H(V,R)},$$slots:{default:!0}});var b=B(v,2);Ge(b,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(V,L)=>{var R=Nx();H(V,R)},$$slots:{default:!0}}),F(g);var C=B(g,2);Jt(C,{});var x=B(C,2);ot(x,{level:3,mt:"10px",children:(V,L)=>{Te();var R=Re("搜索引擎设置");H(V,R)},$$slots:{default:!0}});var p=B(x,4),_=W(p);{let V=Ee(()=>n().engine?[n().engine]:[]);mn(_,{get items(){return d(a)},style:"width: 100%",placeholder:"请选择搜索引擎",onSelect:L=>{const R=L.value;l(o,()=>({engine:R}))},get value(){return d(V)}})}F(p);var m=B(p,4),S=W(m);$t(S,{placeholder:"请输入关键字",style:"width: 100%",get value(){return n().keyword},onchange:V=>{const L=V.target.value;l(o,()=>({keyword:L}))}}),F(m);var N=B(m,4),P=W(N);$t(P,{placeholder:"搜索的数据条数",style:"width: 100%",get value(){return n().limit},onchange:V=>{const L=V.target.value;l(o,()=>({limit:L}))}}),F(N);var D=B(N,2),I=W(D);ot(I,{level:3,mt:"10px",children:(V,L)=>{Te();var R=Re("输出参数");H(V,R)},$$slots:{default:!0}}),F(D);var A=B(D,2);Cr(A,{}),H(u,f)},$$slots:{icon:!0,default:!0}})),he({get data(){return n()},set data(c){n(c),y()}})}ce(W1,{data:{}},[],[],!0);var Ox=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>'),Hx=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Ax=ie('<div class="heading svelte-1eqcy61"><!></div> <!> <div class="heading svelte-1eqcy61"><!> <!></div> <!>',1);const Dx={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 K1(e,t){fe(t,!0),st(e,Dx);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=Et(),{addParameter:i}=Yn();return fn(()=>{(!n().loopVars||n().loopVars.length===0)&&i(o,"loopVars",{name:"loopVar",nameDisabled:!0,deleteDisabled:!0})}),Nn(e,vt({get data(){return n()}},()=>r,{icon:l=>{var c=Ox();H(l,c)},handle:l=>{mr(l,{type:"source",get position(){return ke.Bottom},id:"loop_handle",style:"bottom: -12px;width: 100px",class:"loop_handle_wrapper"})},children:(l,c)=>{var u=Ax(),h=ge(u),f=W(h);ot(f,{level:3,children:(p,_)=>{Te();var m=Re("循环变量");H(p,m)},$$slots:{default:!0}}),F(h);var g=B(h,2);Jt(g,{dataKeyName:"loopVars"});var v=B(g,2),b=W(v);ot(b,{level:3,children:(p,_)=>{Te();var m=Re("输出参数");H(p,m)},$$slots:{default:!0}});var C=B(b,2);Ge(C,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(p,_)=>{var m=Hx();H(p,m)},$$slots:{default:!0}}),F(v);var x=B(v,2);Jt(x,{noneParameterText:"无输出参数",dataKeyName:"outputDefs",useChildrenOnly:!0}),H(l,u)},$$slots:{icon:!0,handle:!0,default:!0}})),he({get data(){return n()},set data(s){n(s),y()}})}ce(K1,{data:{}},[],[],!0);const Vx={startNode:H1,codeNode:B1,llmNode:R1,templateNode:q1,httpNode:F1,knowledgeNode:Y1,searchEngineNode:W1,loopNode:K1,endNode:L1};var Ix=ie("<!> ",1);function tu(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 Ge(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=Ix(),h=ge(u);tl(h,n);var f=B(h);He(()=>pt(f,` ${r()??""}`)),H(l,u)},$$slots:{default:!0}}),he({get icon(){return n()},set icon(l){n(l),y()},get title(){return r()},set title(l){r(l),y()},get type(){return o()},set type(l){o(l),y()},get description(){return i()},set description(l){i(l),y()},get extra(){return s()},set extra(l){s(l),y()}})}ce(tu,{icon:{},title:{},type:{},description:{},extra:{}},[],[],!0);var Lx=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>'),zx=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>'),Rx=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 X1(e,t){fe(t,!0);let n=Bt("base"),r=Bt("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=xr(),l=a.customNodes;if(l){const x=Object.keys(l).sort((p,_)=>(l[p].sortNo||0)-(l[_].sortNo||0));for(let p of x)l[p].group==="base"?o.push({type:p,...l[p]}):s.push({icon:l[p].icon,title:l[p].title,type:p});o.sort((p,_)=>(p.sortNo||0)-(_.sortNo||0))}if(a.hiddenNodes){const x=typeof a.hiddenNodes=="function"?a.hiddenNodes():a.hiddenNodes;if(Array.isArray(x)){for(let p of x)for(let _=0;_<o.length;_++)if(o[_].type===p){o.splice(_,1);break}}}var c=Rx(),u=W(c),h=W(u),f=W(h);c1(f,{style:"width: 100%",get items(){return i},onChange:x=>{te(n,x.value.toString(),!0)}}),F(h);var g=B(h,2),v=W(g);Wt(v,21,()=>o,ho,(x,p)=>{tu(x,vt(()=>d(p)))}),F(v);var b=B(v,2);Wt(b,21,()=>s,ho,(x,p)=>{tu(x,vt(()=>d(p)))}),F(b),F(g),F(u);var C=B(u,2);Ge(C,{onclick:()=>{te(r,d(r)?"":"show",!0)},children:(x,p)=>{var _=Ke(),m=ge(_);{var S=P=>{var D=Lx();H(P,D)},N=P=>{var D=zx();H(P,D)};me(m,P=>{d(r)==="show"?P(S):P(N,!1)})}H(x,_)},$$slots:{default:!0}}),F(c),He(()=>{Vt(c,1,`tf-toolbar ${d(r)??""}`),yt(v,`display: ${d(n)==="base"?"flex":"none"}`),yt(b,`display: ${d(n)!=="base"?"flex":"none"}`)}),H(e,c),he()}ce(X1,{},[],[],!0);const Bx=()=>{const{nodeLookup:e}=Qe();return{getNode:n=>{var o;return(o=J(e).get(n))==null?void 0:o.internals.userNode}}},qx=()=>{const{nodes:e}=Qe();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})}}},Fx=()=>{const{edges:e}=Qe();return{getEdgesByTarget:n=>J(e).filter(o=>o.target===n)}};var Yx=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Wx=ie('<div class="heading svelte-q0cqsa"><!> <!></div> <!>',1),Kx=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),Xx=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),Zx=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),jx=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),Ux=ie('<div class="setting-title svelte-q0cqsa"> </div> <div class="setting-item svelte-q0cqsa"><!></div>',1),Gx=Ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>'),Jx=ie('<div class="heading svelte-q0cqsa"><!> <!></div> <!>',1),Qx=ie("<!> <!> <div></div> <!>",1);const e5={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;}
|
|
22
|
+
|
|
23
|
+
/* 新增样式 */.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 Z1(e,t){var C;fe(t,!0),st(e,e5);const n=w(t,"data",7),r=Tt(t,["$$slots","$$events","$$legacy","$$host","data"]),o=Et(),{addParameter:i}=Yn(),s=Gt(),{updateNodeData:a}=s,l=x=>{a(o,x)},c=(x,p)=>{var _;l({[x]:(_=p.target)==null?void 0:_.value})},u={...r,id:o,data:n()},h=document.createElement("div"),g=xr().customNodes[t.type];(C=g.render)==null||C.call(g,h,u,s);const v=g.forms;let b;fn(()=>{n().expand&&b&&b.append(h)}),fn(()=>{var x;n()&&((x=g.onUpdate)==null||x.call(g,h,{...u,data:n()}))}),fn(()=>{!n().parameters&&g.parameters&&l({parameters:Qs(JSON.parse(JSON.stringify(g.parameters)))})}),fn(()=>{!n().outputDefs&&g.outputDefs&&l({outputDefs:Qs(JSON.parse(JSON.stringify(g.outputDefs)))})});{const x=_=>{var m=Ke(),S=ge(m);tl(S,()=>g.icon),H(_,m)};let p=Ee(()=>({...n(),description:g.description}));Nn(e,vt({get data(){return d(p)}},()=>r,{icon:x,children:(_,m)=>{var S=Qx(),N=ge(S);{var P=R=>{var E=Wx(),$=ge(E),k=W($);ot(k,{level:3,children:(z,j)=>{Te();var X=Re("输入参数");H(z,X)},$$slots:{default:!0}});var T=B(k,2);{var M=z=>{Ge(z,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o)},children:(j,X)=>{var ee=Yx();H(j,ee)},$$slots:{default:!0}})};me(T,z=>{g.parametersAddEnable!==!1&&z(M)})}F($);var O=B($,2);Jt(O,{}),H(R,E)};me(N,R=>{g.parametersEnable!==!1&&R(P)})}var D=B(N,2);{var I=R=>{var E=Ke(),$=ge(E);Wt($,17,()=>v,ho,(k,T)=>{var M=Ke(),O=ge(M);{var z=X=>{var ee=Kx(),re=ge(ee),Q=W(re,!0);F(re);var de=B(re,2),ne=W(de);{let _e=Ee(()=>n()[d(T).name]||d(T).defaultValue);$t(ne,vt({get placeholder(){return d(T).placeholder},style:"width: 100%",get value(){return d(_e)}},()=>d(T).attrs,{onchange:Ne=>{c(d(T).name,Ne)}}))}F(de),He(()=>pt(Q,d(T).label)),H(X,ee)},j=X=>{var ee=Ke(),re=ge(ee);{var Q=ne=>{var _e=Xx(),Ne=ge(_e),Ae=W(Ne,!0);F(Ne);var le=B(Ne,2),pe=W(le);{let se=Ee(()=>n()[d(T).name]||d(T).defaultValue);Mt(pe,vt({rows:3,get placeholder(){return d(T).placeholder},style:"width: 100%",get value(){return d(se)}},()=>d(T).attrs,{onchange:U=>{c(d(T).name,U)}}))}F(le),He(()=>pt(Ae,d(T).label)),H(ne,_e)},de=ne=>{var _e=Ke(),Ne=ge(_e);{var Ae=pe=>{var se=Zx(),U=ge(se),ue=W(U,!0);F(U);var Y=B(U,2),we=W(Y),Pe=W(we),De=W(Pe);F(Pe);var Be=B(Pe,2);gr(Be);var Ie=ye=>l({[d(T).name]:parseFloat(ye.target.value)});rn(Be,()=>({class:"nodrag",type:"range",...d(T).attrs,value:n()[d(T).name]??d(T).defaultValue,oninput:Ie}),void 0,void 0,"svelte-q0cqsa"),F(we),F(Y),He(()=>{pt(ue,d(T).label),pt(De,`${d(T).description??""}: ${n()[d(T).name]??d(T).defaultValue??""}`)}),H(pe,se)},le=pe=>{var se=Ke(),U=ge(se);{var ue=we=>{var Pe=jx(),De=ge(Pe),Be=W(De,!0);F(De);var Ie=B(De,2),ye=W(Ie);{let Ve=Ee(()=>d(T).options||[]),je=Ee(()=>n()[d(T).name]?[n()[d(T).name]]:[d(T).defaultValue]);mn(ye,{get items(){return d(Ve)},style:"width: 100%",get placeholder(){return d(T).placeholder},onSelect:gt=>{const Z=gt.value;l({[d(T).name]:Z})},get value(){return d(je)}})}F(Ie),He(()=>pt(Be,d(T).label)),H(we,Pe)},Y=we=>{var Pe=Ke(),De=ge(Pe);{var Be=ye=>{var Ve=Ux(),je=ge(Ve),gt=W(je,!0);F(je);var Z=B(je,2),Ue=W(Z);{let tt=Ee(()=>{var ft;return(ft=d(T).chosen)==null?void 0:ft.buttonText});u1(Ue,{style:"width: 100%",get placeholder(){return d(T).placeholder},get buttonText(){return d(tt)},onChosen:(ft,an,et)=>{var $e,Ye;(Ye=($e=d(T).chosen)==null?void 0:$e.onChosen)==null||Ye.call($e,l,ft,an,et)},get value(){var ft;return n()[((ft=d(T).chosen)==null?void 0:ft.valueDataKey)||""]},get label(){var ft;return n()[((ft=d(T).chosen)==null?void 0:ft.labelDataKey)||""]}})}F(Z),He(()=>pt(gt,d(T).label)),H(ye,Ve)},Ie=ye=>{var Ve=Ke(),je=ge(Ve);{var gt=Z=>{ot(Z,vt({level:3,mt:"10px"},()=>d(T).attrs,{children:(Ue,tt)=>{Te();var ft=Re();He(()=>pt(ft,d(T).label)),H(Ue,ft)},$$slots:{default:!0}}))};me(je,Z=>{d(T).type==="heading"&&Z(gt)},!0)}H(ye,Ve)};me(De,ye=>{d(T).type==="chosen"?ye(Be):ye(Ie,!1)},!0)}H(we,Pe)};me(U,we=>{d(T).type==="select"?we(ue):we(Y,!1)},!0)}H(pe,se)};me(Ne,pe=>{d(T).type==="slider"?pe(Ae):pe(le,!1)},!0)}H(ne,_e)};me(re,ne=>{d(T).type==="textarea"?ne(Q):ne(de,!1)},!0)}H(X,ee)};me(O,X=>{d(T).type==="input"?X(z):X(j,!1)})}H(k,M)}),H(R,E)};me(D,R=>{v&&R(I)})}var A=B(D,2);Ln(A,R=>b=R,()=>b);var V=B(A,2);{var L=R=>{var E=Jx(),$=ge(E),k=W($);ot(k,{level:3,mt:"10px",children:(z,j)=>{Te();var X=Re("输出参数");H(z,X)},$$slots:{default:!0}});var T=B(k,2);{var M=z=>{Ge(z,{class:"input-btn-more",style:"margin-left: auto",onclick:()=>{i(o,"outputDefs")},children:(j,X)=>{var ee=Gx();H(j,ee)},$$slots:{default:!0}})};me(T,z=>{g.outputDefsAddEnable!==!1&&z(M)})}F($);var O=B($,2);Cr(O,{}),H(R,E)};me(V,R=>{g.outputDefsEnable!==!1&&R(L)})}He(()=>{yt(A,g.rootStyle||""),Vt(A,1,Cn(g.rootClass),"svelte-q0cqsa")}),H(_,S)},$$slots:{icon:!0,default:!0}}))}return he({get data(){return n()},set data(x){n(x),y()}})}ce(Z1,{data:{}},[],[],!0);const t5=()=>{const e=Qe();return{updateEdgeData:(n,r,o)=>{const i=J(e.edgeLookup).get(n);if(!i)return;const s=typeof r=="function"?r(i):r;i.data=o!=null&&o.replace?s:{...i.data,...s},e.edges.update(a=>a.map(l=>l.id===n?i:l))}}},n5=()=>{const{edges:e}=Qe();return{deleteEdge:n=>{e.update(r=>r.filter(o=>o.id!==n))}}};var r5=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>'),o5=ie("<!> <!> <!> <!>",1),i5=ie('<div style="position: relative; height: 100%; width: 100%;overflow: hidden"><!> <!></div>');const s5={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 j1(e,t){fe(t,!0),st(e,s5);const[n,r]=dt(),o=()=>oe(I,"$nodes",n),i=()=>oe(A,"$edges",n),s=()=>oe(V,"$viewport",n),a=w(t,"onInit",7),l=Gt();a()(l);let c=Bt(!1),u=Bt(void 0);const{updateEdgeData:h}=t5(),f=T=>{T.preventDefault(),T.dataTransfer&&(T.dataTransfer.dropEffect="move")},g=T=>{var X;T.preventDefault();const M=l.screenToFlowPosition({x:T.clientX-250,y:T.clientY-100}),O=(X=T.dataTransfer)==null?void 0:X.getData("application/tinyflow"),z=O?JSON.parse(O):{},j={id:`node_${Zr()}`,position:M,data:{},...z};Ws.addNode(j),Ws.selectNodeOnly(j.id)},{getNode:v}=Bx(),b=T=>{const M=v(T.source),O=v(T.target);if(T.sourceHandle==="loop_handle"||M.parentId){const z=l.getEdges();for(let j of z)if(j.target===T.target){const X=v(j.source);if(T.sourceHandle==="loop_handle"&&X.parentId!==M.id||M.parentId&&X.parentId!==M.parentId)return!1}}return!(!M.parentId&&O.parentId&&O.parentId!==M.id)},{ensureParentInNodesBefore:C}=qx(),x=(T,M)=>{if(!M.isValid)return;const O=M.toNode;if(O.parentId)return;const z=M.fromNode,j=M.fromHandle,X={position:{...O.position}};if(j.id==="loop_handle"?X.parentId=z.id:z.parentId&&(X.parentId=z.parentId),X.parentId){const ee=v(X.parentId);X.position={x:O.position.x-ee.position.x,y:O.position.y-ee.position.y},C(X.parentId,O.id),l.updateNode(O.id,X)}},{getEdgesByTarget:p}=Fx(),_=T=>{T.edges.forEach(O=>{var j;O.id===((j=d(u))==null?void 0:j.id)&&(te(u,null),te(c,!1));const z=v(O.target);if(z&&z.parentId){const X=p(O.target),ee=v(z.parentId);if(X.length===0)l.updateNode(z.id,{parentId:void 0,position:{x:z.position.x+ee.position.x,y:z.position.y+ee.position.y}});else{let re=!1;for(let Q=0;Q<X.length;Q++){const de=X[Q],ne=v(de.source);if(ne.parentId||ne.type==="loopNode"){re=!0;break}}re||l.updateNode(z.id,{parentId:void 0,position:{x:z.position.x+ee.position.x,y:z.position.y+ee.position.y}})}}})},{deleteEdge:m}=n5(),S=(T,M)=>{},N=T=>{},P={},D=xr().customNodes;if(D)for(let T of Object.keys(D))P[T]=Z1;const{nodes:I,edges:A,viewport:V}=Qe(),L=xr().onDataChange;L&&(I.subscribe(()=>{L({nodes:o(),edges:i(),viewport:s()},{eventType:"nodesChange"})}),A.subscribe(()=>{L({nodes:o(),edges:i(),viewport:s()},{eventType:"edgesChange"})}),V.subscribe(()=>{L({nodes:o(),edges:i(),viewport:s()},{eventType:"viewportChange"})}));var R=i5(),E=W(R);{let T=Ee(()=>({...Vx,...P})),M=Ee(()=>({markerEnd:{type:Yr.ArrowClosed,width:20,height:20}}));Wf(E,vt({get nodeTypes(){return d(T)}},()=>Ws,{class:"tinyflow-logo",isValidConnection:b,onconnectend:x,onconnectstart:S,onconnect:N,connectionRadius:50,onedgecreate:O=>({...O,id:Zr()}),ondelete:_,onclick:O=>{const z=O.target;z.classList.contains("svelte-flow__edge-interaction")||z.classList.contains("panel-content")||z.closest(".panel-content")||(te(c,!1),te(u,null))},get defaultEdgeOptions(){return d(M)},$$events:{drop:g,dragover:f,edgeclick:O=>{te(c,!0),te(u,O.detail.edge,!0)}},children:(O,z)=>{var j=o5(),X=ge(j);t1(X,{});var ee=B(X,2);Jf(ee,{});var re=B(ee,2);r1(re,{});var Q=B(re,2);{var de=ne=>{_i(ne,{children:(_e,Ne)=>{var Ae=r5(),le=B(W(Ae),4),pe=W(le);{let Y=Ee(()=>{var we,Pe;return(Pe=(we=d(u))==null?void 0:we.data)==null?void 0:Pe.condition});Mt(pe,{rows:3,placeholder:"请输入边条件",style:"width: 100%",get value(){return d(Y)},onchange:we=>{var Pe;d(u)&&h(d(u).id,{condition:(Pe=we.target)==null?void 0:Pe.value})}})}F(le);var se=B(le,2),U=W(se);Ge(U,{onclick:()=>{var Y;m((Y=d(u))==null?void 0:Y.id),te(c,!1)},children:(Y,we)=>{Te();var Pe=Re("删除");H(Y,Pe)},$$slots:{default:!0}});var ue=B(U,2);Ge(ue,{primary:!0,onclick:()=>{te(c,!1)},children:(Y,we)=>{Te();var Pe=Re("保存");H(Y,Pe)},$$slots:{default:!0}}),F(se),F(Ae),H(_e,Ae)},$$slots:{default:!0}})};me(Q,ne=>{d(c)&&ne(de)})}H(O,j)},$$slots:{default:!0}}))}var $=B(E,2);X1($,{}),F(R),H(e,R);var k=he({get onInit(){return a()},set onInit(T){a(T),y()}});return r(),k}ce(j1,{onInit:{}},[],[],!0);function a5(e,t){fe(t,!0);const n=w(t,"options",7),r=w(t,"onInit",7);let{data:o}=n();if(typeof o=="string")try{o=JSON.parse(o.trim())}catch{console.error("Invalid JSON data:",o)}return Ws.init((o==null?void 0:o.nodes)||[],(o==null?void 0:o.edges)||[]),oo("tinyflow_options",n()),Kf(e,{fitView:!0,children:(i,s)=>{j1(i,{get onInit(){return r()}})},$$slots:{default:!0}}),he({get options(){return n()},set options(i){n(i),y()},get onInit(){return r()},set onInit(i){r(i),y()}})}customElements.define("tinyflow-component",ce(a5,{options:{},onInit:{}},[],[],!1));const l5=Bh({__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=Dh(null);let o=null;return Fh(()=>{r.value&&(o=new Aw({...n,element:r.value}))}),Yh(()=>{o&&(o.destroy(),o=null)}),t({getData:()=>o?o.getData():(console.warn("Tinyflow instance is not initialized"),null)}),(s,a)=>(Uh(),Qh("div",{ref_key:"divRef",ref:r,class:zi(["tinyflow",s.className]),style:Li(s.style)},null,6))}});nt.Tinyflow=l5,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"})});
|
|
24
|
+
//# sourceMappingURL=index.umd.js.map
|