@owox/web 0.24.0-next-20260429160913 → 0.24.0
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/assets/RelationshipCanvas-DHD_684J.js +243 -0
- package/dist/assets/index-D5aLo6qw.js +1123 -0
- package/dist/assets/{index-DQL60ST7.css → index-DqBGUog9.css} +1 -1
- package/dist/index.html +2 -2
- package/package.json +3 -12
- package/dist/assets/RelationshipCanvas-DYPx0ewW.js +0 -243
- package/dist/assets/index-D_EZhPkz.js +0 -1123
package/dist/index.html
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<link rel="icon" type="image/png" href="/favicon.png" />
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
8
|
<title>OWOX</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-D5aLo6qw.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DqBGUog9.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body translate="no" class="notranslate">
|
|
13
13
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owox/web",
|
|
3
|
-
"version": "0.24.0
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "Web interface for OWOX Data Marts - an open-source solution for Data Analysts",
|
|
5
5
|
"author": "OWOX",
|
|
6
6
|
"license": "ELv2",
|
|
@@ -11,14 +11,7 @@
|
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=22.16.0"
|
|
13
13
|
},
|
|
14
|
-
"keywords": [
|
|
15
|
-
"owox",
|
|
16
|
-
"data-marts",
|
|
17
|
-
"web-app",
|
|
18
|
-
"react",
|
|
19
|
-
"typescript",
|
|
20
|
-
"tailwind"
|
|
21
|
-
],
|
|
14
|
+
"keywords": ["owox", "data-marts", "web-app", "react", "typescript", "tailwind"],
|
|
22
15
|
"homepage": "https://github.com/OWOX/owox-data-marts",
|
|
23
16
|
"repository": {
|
|
24
17
|
"type": "git",
|
|
@@ -29,9 +22,7 @@
|
|
|
29
22
|
"url": "https://github.com/OWOX/owox-data-marts/issues"
|
|
30
23
|
},
|
|
31
24
|
"main": "./dist/index.html",
|
|
32
|
-
"files": [
|
|
33
|
-
"dist"
|
|
34
|
-
],
|
|
25
|
+
"files": ["dist"],
|
|
35
26
|
"scripts": {
|
|
36
27
|
"build": "tsc -b && vite build",
|
|
37
28
|
"dev": "vite --config vite.config.ts",
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
var Qi=Object.defineProperty;var eo=(e,t,n)=>t in e?Qi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var J=(e,t,n)=>eo(e,typeof t!="symbol"?t+"":t,n);import{c as dn,g as to,_ as vt,a as oe,o as ze,r as w,b as He,R as Cn,j as D,B as rt,M as no,d as ro,h as io,e as oo,C as ao,I as so,E as uo,f as co,i as lo}from"./index-D_EZhPkz.js";/**
|
|
2
|
-
* @license lucide-react v0.475.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const fo=[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}]],po=dn("Locate",fo);/**
|
|
7
|
-
* @license lucide-react v0.475.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const ho=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],vo=dn("ZoomIn",ho);/**
|
|
12
|
-
* @license lucide-react v0.475.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const mo=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],yo=dn("ZoomOut",mo);function Pn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,i)}function M(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(u){Pn(o,r,i,a,s,"next",u)}function s(u){Pn(o,r,i,a,s,"throw",u)}a(void 0)})}}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function te(e){"@babel/helpers - typeof";return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},te(e)}function go(e,t){if(te(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(te(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Br(e){var t=go(e,"string");return te(t)=="symbol"?t:t+""}function bo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Br(r.key),r)}}function L(e,t,n){return t&&bo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ge(e,t){if(t&&(te(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wo(e)}function q(e){return q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},q(e)}function qt(e,t){return qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},qt(e,t)}function ie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qt(e,t)}function j(e,t,n){return(t=Br(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pt={exports:{}},$t={exports:{}},$n;function Fr(){return $n||($n=1,(function(e){function t(n,r){this.v=n,this.k=r}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})($t)),$t.exports}var _t={exports:{}},Et={exports:{}},_n;function Hr(){return _n||(_n=1,(function(e){function t(n,r,i,o){var a=Object.defineProperty;try{a({},"",{})}catch{a=0}e.exports=t=function(u,c,l,f){function d(p,v){t(u,p,function(m){return this._invoke(p,v,m)})}c?a?a(u,c,{value:l,enumerable:!f,configurable:!f,writable:!f}):u[c]=l:(d("next",0),d("throw",1),d("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,i,o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Et)),Et.exports}var En;function Gr(){return En||(En=1,(function(e){var t=Hr();function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var r,i,o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",s=o.toStringTag||"@@toStringTag";function u(h,O,k,g){var y=O&&O.prototype instanceof l?O:l,C=Object.create(y.prototype);return t(C,"_invoke",(function(P,b,$){var E,A,R,G=0,V=$||[],I=!1,_={p:0,n:0,v:r,a:N,f:N.bind(r,4),d:function(F,B){return E=F,A=0,R=r,_.n=B,c}};function N(S,F){for(A=S,R=F,i=0;!I&&G&&!B&&i<V.length;i++){var B,W=V[i],ne=_.p,X=W[2];S>3?(B=X===F)&&(R=W[(A=W[4])?5:(A=3,3)],W[4]=W[5]=r):W[0]<=ne&&((B=S<2&&ne<W[1])?(A=0,_.v=F,_.n=W[1]):ne<X&&(B=S<3||W[0]>F||F>X)&&(W[4]=S,W[5]=F,_.n=X,A=0))}if(B||S>1)return c;throw I=!0,F}return function(S,F,B){if(G>1)throw TypeError("Generator is already running");for(I&&F===1&&N(F,B),A=F,R=B;(i=A<2?r:R)||!I;){E||(A?A<3?(A>1&&(_.n=-1),N(A,R)):_.n=R:_.v=R);try{if(G=2,E){if(A||(S="next"),i=E[S]){if(!(i=i.call(E,R)))throw TypeError("iterator result is not an object");if(!i.done)return i;R=i.value,A<2&&(A=0)}else A===1&&(i=E.return)&&i.call(E),A<2&&(R=TypeError("The iterator does not provide a '"+S+"' method"),A=1);E=r}else if((i=(I=_.n<0)?R:P.call(b,_))!==c)break}catch(W){E=r,A=1,R=W}finally{G=1}}return{value:i,done:I}}})(h,k,g),!0),C}var c={};function l(){}function f(){}function d(){}i=Object.getPrototypeOf;var p=[][a]?i(i([][a]())):(t(i={},a,function(){return this}),i),v=d.prototype=l.prototype=Object.create(p);function m(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,d):(h.__proto__=d,t(h,s,"GeneratorFunction")),h.prototype=Object.create(v),h}return f.prototype=d,t(v,"constructor",d),t(d,"constructor",f),f.displayName="GeneratorFunction",t(d,s,"GeneratorFunction"),t(v),t(v,s,"Generator"),t(v,a,function(){return this}),t(v,"toString",function(){return"[object Generator]"}),(e.exports=n=function(){return{w:u,m}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(_t)),_t.exports}var jt={exports:{}},Rt={exports:{}},At={exports:{}},jn;function Vr(){return jn||(jn=1,(function(e){var t=Fr(),n=Hr();function r(i,o){function a(u,c,l,f){try{var d=i[u](c),p=d.value;return p instanceof t?o.resolve(p.v).then(function(v){a("next",v,l,f)},function(v){a("throw",v,l,f)}):o.resolve(p).then(function(v){d.value=v,l(d)},function(v){return a("throw",v,l,f)})}catch(v){f(v)}}var s;this.next||(n(r.prototype),n(r.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(u,c,l){function f(){return new o(function(d,p){a(u,l,d,p)})}return s=s?s.then(f,f):f()},!0)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(At)),At.exports}var Rn;function Wr(){return Rn||(Rn=1,(function(e){var t=Gr(),n=Vr();function r(i,o,a,s,u){return new n(t().w(i,o,a,s),u||Promise)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Rt)),Rt.exports}var An;function ko(){return An||(An=1,(function(e){var t=Wr();function n(r,i,o,a,s){var u=t(r,i,o,a,s);return u.next().then(function(c){return c.done?c.value:u.next()})}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(jt)),jt.exports}var It={exports:{}},In;function xo(){return In||(In=1,(function(e){function t(n){var r=Object(n),i=[];for(var o in r)i.unshift(o);return function a(){for(;i.length;)if((o=i.pop())in r)return a.value=o,a.done=!1,a;return a.done=!0,a}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(It)),It.exports}var Nt={exports:{}},zt={exports:{}},Nn;function So(){return Nn||(Nn=1,(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(zt)),zt.exports}var zn;function Oo(){return zn||(zn=1,(function(e){var t=So().default;function n(r){if(r!=null){var i=r[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],o=0;if(i)return i.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length))return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}}}throw new TypeError(t(r)+" is not iterable")}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Nt)),Nt.exports}var Dn;function Co(){return Dn||(Dn=1,(function(e){var t=Fr(),n=Gr(),r=ko(),i=Wr(),o=Vr(),a=xo(),s=Oo();function u(){var c=n(),l=c.m(u),f=(Object.getPrototypeOf?Object.getPrototypeOf(l):l.__proto__).constructor;function d(m){var h=typeof m=="function"&&m.constructor;return!!h&&(h===f||(h.displayName||h.name)==="GeneratorFunction")}var p={throw:1,return:2,break:3,continue:3};function v(m){var h,O;return function(k){h||(h={stop:function(){return O(k.a,2)},catch:function(){return k.v},abrupt:function(y,C){return O(k.a,p[y],C)},delegateYield:function(y,C,P){return h.resultName=C,O(k.d,s(y),P)},finish:function(y){return O(k.f,y)}},O=function(y,C,P){k.p=h.prev,k.n=h.next;try{return y(C,P)}finally{h.next=k.n}}),h.resultName&&(h[h.resultName]=k.v,h.resultName=void 0),h.sent=k.v,h.next=k.n;try{return m.call(this,h)}finally{k.p=h.prev,k.n=h.next}}}return(e.exports=u=function(){return{wrap:function(O,k,g,y){return c.w(v(O),k,g,y&&y.reverse())},isGeneratorFunction:d,mark:c.m,awrap:function(O,k){return new t(O,k)},AsyncIterator:o,async:function(O,k,g,y,C){return(d(k)?i:r)(v(O),k,g,y,C)},keys:a,values:s}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports})(Pt)),Pt.exports}var Dt,Mn;function Po(){if(Mn)return Dt;Mn=1;var e=Co()();Dt=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return Dt}var $o=Po();const x=to($o);/*!
|
|
17
|
-
* rete v2.0.5
|
|
18
|
-
* (c) 2025 Vitaliy Stoliarov
|
|
19
|
-
* Released under the MIT license.
|
|
20
|
-
* */function _o(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Eo(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
21
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function Eo(e,t){if(e){if(typeof e=="string")return Tn(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tn(e,t):void 0}}function Tn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jo(){return{debug:function(t){}}}var Ro=(function(){function e(){T(this,e),j(this,"pipes",[])}return L(e,[{key:"addPipe",value:function(n){this.pipes.push(n)}},{key:"emit",value:(function(){var t=M(x.mark(function r(i){var o,a,s,u;return x.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:o=i,a=_o(this.pipes),l.prev=2,a.s();case 4:if((s=a.n()).done){l.next=13;break}return u=s.value,l.next=8,u(o);case 8:if(o=l.sent,!(typeof o>"u")){l.next=11;break}return l.abrupt("return");case 11:l.next=4;break;case 13:l.next=18;break;case 15:l.prev=15,l.t0=l.catch(2),a.e(l.t0);case 18:return l.prev=18,a.f(),l.finish(18);case 21:return l.abrupt("return",o);case 22:case"end":return l.stop()}},r,this,[[2,15,18,21]])}));function n(r){return t.apply(this,arguments)}return n})()}])})(),Je=(function(){function e(t){T(this,e),j(this,"signal",new Ro),this.name=t}return L(e,[{key:"addPipe",value:function(n){this.signal.addPipe(n)}},{key:"use",value:function(n){if(!(n instanceof e))throw new Error("cannot use non-Scope instance");return n.setParent(this),this.addPipe(function(r){return n.signal.emit(r)}),jo()}},{key:"setParent",value:function(n){this.parent=n}},{key:"emit",value:function(n){return this.signal.emit(n)}},{key:"hasParent",value:function(){return!!this.parent}},{key:"parentScope",value:function(n){if(!this.parent)throw new Error("cannot find parent");if(n&&this.parent instanceof n)return this.parent;if(n)throw new Error("actual parent is not instance of type");return this.parent}}])})();function Ln(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ao(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
22
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function Ao(e,t){if(e){if(typeof e=="string")return Bn(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bn(e,t):void 0}}function Bn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Io(e,t,n){return t=q(t),ge(e,Yr()?Reflect.construct(t,n||[],q(e).constructor):t.apply(e,n))}function Yr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Yr=function(){return!!e})()}var Ee=(function(e){function t(){var n;return T(this,t),n=Io(this,t,["NodeEditor"]),j(n,"nodes",[]),j(n,"connections",[]),n}return ie(t,e),L(t,[{key:"getNode",value:function(r){return this.nodes.find(function(i){return i.id===r})}},{key:"getNodes",value:function(){return this.nodes.slice()}},{key:"getConnections",value:function(){return this.connections.slice()}},{key:"getConnection",value:function(r){return this.connections.find(function(i){return i.id===r})}},{key:"addNode",value:(function(){var n=M(x.mark(function i(o){return x.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.getNode(o.id)){s.next=2;break}throw new Error("node has already been added");case 2:return s.next=4,this.emit({type:"nodecreate",data:o});case 4:if(s.sent){s.next=6;break}return s.abrupt("return",!1);case 6:return this.nodes.push(o),s.next=9,this.emit({type:"nodecreated",data:o});case 9:return s.abrupt("return",!0);case 10:case"end":return s.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"addConnection",value:(function(){var n=M(x.mark(function i(o){return x.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.getConnection(o.id)){s.next=2;break}throw new Error("connection has already been added");case 2:return s.next=4,this.emit({type:"connectioncreate",data:o});case 4:if(s.sent){s.next=6;break}return s.abrupt("return",!1);case 6:return this.connections.push(o),s.next=9,this.emit({type:"connectioncreated",data:o});case 9:return s.abrupt("return",!0);case 10:case"end":return s.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"removeNode",value:(function(){var n=M(x.mark(function i(o){var a,s;return x.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(a=this.nodes.find(function(l){return l.id===o}),a){c.next=3;break}throw new Error("cannot find node");case 3:return c.next=5,this.emit({type:"noderemove",data:a});case 5:if(c.sent){c.next=7;break}return c.abrupt("return",!1);case 7:return s=this.nodes.indexOf(a),this.nodes.splice(s,1),c.next=11,this.emit({type:"noderemoved",data:a});case 11:return c.abrupt("return",!0);case 12:case"end":return c.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"removeConnection",value:(function(){var n=M(x.mark(function i(o){var a,s;return x.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(a=this.connections.find(function(l){return l.id===o}),a){c.next=3;break}throw new Error("cannot find connection");case 3:return c.next=5,this.emit({type:"connectionremove",data:a});case 5:if(c.sent){c.next=7;break}return c.abrupt("return",!1);case 7:return s=this.connections.indexOf(a),this.connections.splice(s,1),c.next=11,this.emit({type:"connectionremoved",data:a});case 11:return c.abrupt("return",!0);case 12:case"end":return c.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"clear",value:(function(){var n=M(x.mark(function i(){var o,a,s,u,c,l;return x.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,this.emit({type:"clear"});case 2:if(d.sent){d.next=6;break}return d.next=5,this.emit({type:"clearcancelled"});case 5:return d.abrupt("return",!1);case 6:o=Ln(this.connections.slice()),d.prev=7,o.s();case 9:if((a=o.n()).done){d.next=15;break}return s=a.value,d.next=13,this.removeConnection(s.id);case 13:d.next=9;break;case 15:d.next=20;break;case 17:d.prev=17,d.t0=d.catch(7),o.e(d.t0);case 20:return d.prev=20,o.f(),d.finish(20);case 23:u=Ln(this.nodes.slice()),d.prev=24,u.s();case 26:if((c=u.n()).done){d.next=32;break}return l=c.value,d.next=30,this.removeNode(l.id);case 30:d.next=26;break;case 32:d.next=37;break;case 34:d.prev=34,d.t1=d.catch(24),u.e(d.t1);case 37:return d.prev=37,u.f(),d.finish(37);case 40:return d.next=42,this.emit({type:"cleared"});case 42:return d.abrupt("return",!0);case 43:case"end":return d.stop()}},i,this,[[7,17,20,23],[24,34,37,40]])}));function r(){return n.apply(this,arguments)}return r})()}])})(Je),Mt=globalThis.crypto;function je(){if("randomBytes"in Mt)return Mt.randomBytes(8).toString("hex");var e=Mt.getRandomValues(new Uint8Array(8)),t=Array.from(e),n=t.map(function(r){return r.toString(16).padStart(2,"0")});return n.join("")}function fn(e,t,n){return t=q(t),ge(e,qr()?Reflect.construct(t,n||[],q(e).constructor):t.apply(e,n))}function qr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qr=function(){return!!e})()}var No=L(function e(t){T(this,e),this.name=t}),pn=L(function e(t,n,r){T(this,e),this.socket=t,this.label=n,this.multipleConnections=r,this.id=je()}),zo=(function(e){function t(n,r,i){var o;return T(this,t),o=fn(this,t,[n,r,i]),j(o,"control",null),j(o,"showControl",!0),o.socket=n,o.label=r,o.multipleConnections=i,o}return ie(t,e),L(t,[{key:"addControl",value:function(r){if(this.control)throw new Error("control already added for this input");this.control=r}},{key:"removeControl",value:function(){this.control=null}}])})(pn),Do=(function(e){function t(n,r,i){return T(this,t),fn(this,t,[n,r,i!==!1])}return ie(t,e),L(t)})(pn),Kr=L(function e(){T(this,e),this.id=je()}),Mo=(function(e){function t(n,r){var i,o;return T(this,t),o=fn(this,t),o.type=n,o.options=r,o.id=je(),o.readonly=(i=r==null?void 0:r.readonly)!==null&&i!==void 0?i:!1,typeof(r==null?void 0:r.initial)<"u"&&(o.value=r.initial),o}return ie(t,e),L(t,[{key:"setValue",value:function(r){var i;this.value=r,(i=this.options)!==null&&i!==void 0&&i.change&&this.options.change(r)}}])})(Kr),To=(function(){function e(t){T(this,e),j(this,"inputs",{}),j(this,"outputs",{}),j(this,"controls",{}),this.label=t,this.id=je()}return L(e,[{key:"hasInput",value:function(n){return Object.prototype.hasOwnProperty.call(this.inputs,n)}},{key:"addInput",value:function(n,r){if(this.hasInput(n))throw new Error("input with key '".concat(String(n),"' already added"));Object.defineProperty(this.inputs,n,{value:r,enumerable:!0,configurable:!0})}},{key:"removeInput",value:function(n){delete this.inputs[n]}},{key:"hasOutput",value:function(n){return Object.prototype.hasOwnProperty.call(this.outputs,n)}},{key:"addOutput",value:function(n,r){if(this.hasOutput(n))throw new Error("output with key '".concat(String(n),"' already added"));Object.defineProperty(this.outputs,n,{value:r,enumerable:!0,configurable:!0})}},{key:"removeOutput",value:function(n){delete this.outputs[n]}},{key:"hasControl",value:function(n){return Object.prototype.hasOwnProperty.call(this.controls,n)}},{key:"addControl",value:function(n,r){if(this.hasControl(n))throw new Error("control with key '".concat(String(n),"' already added"));Object.defineProperty(this.controls,n,{value:r,enumerable:!0,configurable:!0})}},{key:"removeControl",value:function(n){delete this.controls[n]}}])})(),Lo=L(function e(t,n,r,i){if(T(this,e),this.sourceOutput=n,this.targetInput=i,!t.outputs[n])throw new Error("source node doesn't have output with a key ".concat(String(n)));if(!r.inputs[i])throw new Error("target node doesn't have input with a key ".concat(String(i)));this.id=je(),this.source=t.id,this.target=r.id}),Ne=Object.freeze({__proto__:null,Socket:No,Port:pn,Input:zo,Output:Do,Control:Kr,InputControl:Mo,Node:To,Connection:Lo});function Kt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Bo(e){if(Array.isArray(e))return Kt(e)}function Fo(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Zr(e,t){if(e){if(typeof e=="string")return Kt(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kt(e,t):void 0}}function Ho(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
23
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function de(e){return Bo(e)||Fo(e)||Zr(e)||Ho()}/*!
|
|
24
|
-
* rete-area-plugin v2.1.4
|
|
25
|
-
* (c) 2025 Vitaliy Stoliarov
|
|
26
|
-
* Released under the MIT license.
|
|
27
|
-
* */var Go=(function(){function e(t){T(this,e),this.reordered=t,this.holder=document.createElement("div"),this.holder.style.transformOrigin="0 0"}return L(e,[{key:"getPointerFrom",value:function(n){var r=this.holder.getBoundingClientRect(),i=r.left,o=r.top,a=n.clientX-i,s=n.clientY-o;return{x:a,y:s}}},{key:"add",value:function(n){this.holder.appendChild(n)}},{key:"reorder",value:(function(){var t=M(x.mark(function r(i,o){return x.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(this.holder.contains(i)){s.next=2;break}throw new Error("content doesn't have 'target' for reordering");case 2:if(!(o!==null&&!this.holder.contains(o))){s.next=4;break}throw new Error("content doesn't have 'next' for reordering");case 4:return this.holder.insertBefore(i,o),s.next=7,this.reordered(i);case 7:case"end":return s.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"remove",value:function(n){this.holder.contains(n)&&this.holder.removeChild(n)}}])})();function Vo(e,t){var n=function(a){t.move(a)},r=function(a){window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",r),window.removeEventListener("pointercancel",r),t.up(a)},i=function(a){window.addEventListener("pointermove",n),window.addEventListener("pointerup",r),window.addEventListener("pointercancel",r),t.down(a)};return e.addEventListener("pointerdown",i),{destroy:function(){e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",r),window.removeEventListener("pointercancel",r)}}}var Fn=function(t){return t.length===0?0:Math.min.apply(Math,de(t))},Hn=function(t){return t.length===0?0:Math.max.apply(Math,de(t))};function Ur(e){var t=Fn(e.map(function(o){return o.position.x})),n=Fn(e.map(function(o){return o.position.y})),r=Hn(e.map(function(o){return o.position.x+o.width})),i=Hn(e.map(function(o){return o.position.y+o.height}));return{left:t,right:r,top:n,bottom:i,width:Math.abs(t-r),height:Math.abs(n-i),center:{x:(t+r)/2,y:(n+i)/2}}}function Gn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gn(Object(n),!0).forEach(function(r){j(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Xr=(function(){function e(t){var n=this;T(this,e),j(this,"down",function(r){n.guards.down(r)&&(r.stopPropagation(),n.pointerStart={x:r.pageX,y:r.pageY},n.startPosition=Wo({},n.config.getCurrentPosition()),n.events.start(r))}),j(this,"move",function(r){if(!(!n.pointerStart||!n.startPosition)&&n.guards.move(r)){r.preventDefault();var i={x:r.pageX-n.pointerStart.x,y:r.pageY-n.pointerStart.y},o=n.config.getZoom(),a=n.startPosition.x+i.x/o,s=n.startPosition.y+i.y/o;n.events.translate(a,s,r)}}),j(this,"up",function(r){n.pointerStart&&(delete n.pointerStart,n.events.drag(r))}),this.guards=t||{down:function(i){return!(i.pointerType==="mouse"&&i.button!==0)},move:function(){return!0}}}return L(e,[{key:"initialize",value:function(n,r,i){this.config=r,this.events=i,n.style.touchAction="none",this.pointerListener=Vo(n,{down:this.down,move:this.move,up:this.up})}},{key:"destroy",value:function(){this.pointerListener.destroy()}}])})(),Yo=(function(){function e(t){var n=this;T(this,e),j(this,"previous",null),j(this,"pointers",[]),j(this,"wheel",function(r){r.preventDefault();var i=n.element.getBoundingClientRect(),o=i.left,a=i.top,s=r.deltaY<0,u=s?n.intensity:-n.intensity,c=(o-r.clientX)*u,l=(a-r.clientY)*u;n.onzoom(u,c,l,"wheel")}),j(this,"down",function(r){n.pointers.push(r)}),j(this,"move",function(r){if(n.pointers=n.pointers.map(function(v){return v.pointerId===r.pointerId?r:v}),!!n.isTranslating()){var i=n.element.getBoundingClientRect(),o=i.left,a=i.top,s=n.getTouches(),u=s.cx,c=s.cy,l=s.distance;if(n.previous!==null&&n.previous.distance>0){var f=l/n.previous.distance-1,d=(o-u)*f,p=(a-c)*f;n.onzoom(f,d-(n.previous.cx-u),p-(n.previous.cy-c),"touch")}n.previous={cx:u,cy:c,distance:l}}}),j(this,"contextmenu",function(){n.pointers=[]}),j(this,"up",function(r){n.previous=null,n.pointers=n.pointers.filter(function(i){return i.pointerId!==r.pointerId})}),j(this,"dblclick",function(r){r.preventDefault();var i=n.element.getBoundingClientRect(),o=i.left,a=i.top,s=4*n.intensity,u=(o-r.clientX)*s,c=(a-r.clientY)*s;n.onzoom(s,u,c,"dblclick")}),this.intensity=t}return L(e,[{key:"initialize",value:function(n,r,i){this.container=n,this.element=r,this.onzoom=i,this.container.addEventListener("wheel",this.wheel),this.container.addEventListener("pointerdown",this.down),this.container.addEventListener("dblclick",this.dblclick),window.addEventListener("pointermove",this.move),window.addEventListener("pointerup",this.up),window.addEventListener("pointercancel",this.up),window.addEventListener("contextmenu",this.contextmenu)}},{key:"getTouches",value:function(){var n={touches:this.pointers},r=[n.touches[0].clientX,n.touches[0].clientY],i=r[0],o=r[1],a=[n.touches[1].clientX,n.touches[1].clientY],s=a[0],u=a[1],c=Math.sqrt(Math.pow(i-s,2)+Math.pow(o-u,2));return{cx:(i+s)/2,cy:(o+u)/2,distance:c}}},{key:"isTranslating",value:function(){return this.pointers.length>=2}},{key:"destroy",value:function(){this.container.removeEventListener("wheel",this.wheel),this.container.removeEventListener("pointerdown",this.down),this.container.removeEventListener("dblclick",this.dblclick),window.removeEventListener("pointermove",this.move),window.removeEventListener("pointerup",this.up),window.removeEventListener("pointercancel",this.up),window.removeEventListener("contextmenu",this.contextmenu)}}])})(),qo=(function(){function e(t,n,r){var i=this;T(this,e),j(this,"transform",{k:1,x:0,y:0}),j(this,"pointer",{x:0,y:0}),j(this,"zoomHandler",null),j(this,"dragHandler",null),j(this,"pointerdown",function(o){i.setPointerFrom(o),i.events.pointerDown(i.pointer,o)}),j(this,"pointermove",function(o){i.setPointerFrom(o),i.events.pointerMove(i.pointer,o)}),j(this,"pointerup",function(o){i.setPointerFrom(o),i.events.pointerUp(i.pointer,o)}),j(this,"resize",function(o){i.events.resize(o)}),j(this,"onTranslate",function(o,a){var s;(s=i.zoomHandler)!==null&&s!==void 0&&s.isTranslating()||i.translate(o,a)}),j(this,"onZoom",function(o,a,s,u){i.zoom(i.transform.k*(1+o),a,s,u),i.update()}),this.container=t,this.events=n,this.guards=r,this.content=new Go(function(o){return i.events.reordered(o)}),this.content.holder.style.transformOrigin="0 0",this.setZoomHandler(new Yo(.1)),this.setDragHandler(new Xr),this.container.addEventListener("pointerdown",this.pointerdown),this.container.addEventListener("pointermove",this.pointermove),window.addEventListener("pointerup",this.pointerup),window.addEventListener("resize",this.resize),t.appendChild(this.content.holder),this.update()}return L(e,[{key:"update",value:function(){var n=this.transform,r=n.x,i=n.y,o=n.k;this.content.holder.style.transform="translate(".concat(r,"px, ").concat(i,"px) scale(").concat(o,")")}},{key:"setDragHandler",value:function(n){var r=this;this.dragHandler&&this.dragHandler.destroy(),this.dragHandler=n,this.dragHandler&&this.dragHandler.initialize(this.container,{getCurrentPosition:function(){return r.transform},getZoom:function(){return 1}},{start:function(){return null},translate:this.onTranslate,drag:function(){return null}})}},{key:"setZoomHandler",value:function(n){this.zoomHandler&&this.zoomHandler.destroy(),this.zoomHandler=n,this.zoomHandler&&this.zoomHandler.initialize(this.container,this.content.holder,this.onZoom)}},{key:"setPointerFrom",value:function(n){var r=this.content.getPointerFrom(n),i=r.x,o=r.y,a=this.transform.k;this.pointer={x:i/a,y:o/a}}},{key:"translate",value:(function(){var t=M(x.mark(function r(i,o){var a,s;return x.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return a={x:i,y:o},c.next=3,this.guards.translate({previous:this.transform,position:a});case 3:if(s=c.sent,s){c.next=6;break}return c.abrupt("return",!1);case 6:return this.transform.x=s.data.position.x,this.transform.y=s.data.position.y,this.update(),c.next=11,this.events.translated(s.data);case 11:return c.abrupt("return",!0);case 12:case"end":return c.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"zoom",value:(function(){var t=M(x.mark(function r(i){var o,a,s,u,c,l,f=arguments;return x.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return o=f.length>1&&f[1]!==void 0?f[1]:0,a=f.length>2&&f[2]!==void 0?f[2]:0,s=f.length>3?f[3]:void 0,u=this.transform.k,p.next=6,this.guards.zoom({previous:this.transform,zoom:i,source:s});case 6:if(c=p.sent,c){p.next=9;break}return p.abrupt("return",!0);case 9:return l=(u-c.data.zoom)/(u-i||1),this.transform.k=c.data.zoom||1,this.transform.x+=o*l,this.transform.y+=a*l,this.update(),p.next=16,this.events.zoomed(c.data);case 16:return p.abrupt("return",!1);case 17:case"end":return p.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n})()},{key:"destroy",value:function(){this.container.removeEventListener("pointerdown",this.pointerdown),this.container.removeEventListener("pointermove",this.pointermove),window.removeEventListener("pointerup",this.pointerup),window.removeEventListener("resize",this.resize),this.dragHandler&&this.dragHandler.destroy(),this.zoomHandler&&this.zoomHandler.destroy(),this.content.holder.innerHTML=""}}])})();function Ko(e,t,n){return t=q(t),ge(e,Jr()?Reflect.construct(t,n||[],q(e).constructor):t.apply(e,n))}function Jr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Jr=function(){return!!e})()}var gt=(function(e){function t(){return T(this,t),Ko(this,t,arguments)}return ie(t,e),L(t)})(Je),Zo=L(function e(t){T(this,e),this.element=document.createElement("div"),this.element.style.position="absolute",this.element.style.left="0",this.element.style.top="0",this.element.addEventListener("contextmenu",function(n){return t.contextmenu(n)})}),Uo=(function(){function e(){T(this,e),j(this,"views",new WeakMap),j(this,"viewsElements",new Map)}return L(e,[{key:"set",value:function(n){var r=n.element,i=n.type,o=n.payload;o!=null&&o.id&&(this.views.set(r,n),this.viewsElements.set("".concat(i,"_").concat(o.id),r))}},{key:"get",value:function(n,r){var i=this.viewsElements.get("".concat(n,"_").concat(r));return i&&this.views.get(i)}},{key:"delete",value:function(n){var r,i=this.views.get(n);i&&(r=i.payload)!==null&&r!==void 0&&r.id&&(this.views.delete(n),this.viewsElements.delete("".concat(i.type,"_").concat(i.payload.id)))}}])})();function Vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vn(Object(n),!0).forEach(function(r){j(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Xo=(function(){function e(t,n,r){var i=this;T(this,e),j(this,"translate",(function(){var o=M(x.mark(function a(s,u){var c,l;return x.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return c=Wn({},i.position),d.next=3,i.guards.translate({previous:c,position:{x:s,y:u}});case 3:if(l=d.sent,l){d.next=6;break}return d.abrupt("return",!1);case 6:return i.position=Wn({},l.data.position),i.element.style.transform="translate(".concat(i.position.x,"px, ").concat(i.position.y,"px)"),d.next=10,i.events.translated({position:i.position,previous:c});case 10:return d.abrupt("return",!0);case 11:case"end":return d.stop()}},a)}));return function(a,s){return o.apply(this,arguments)}})()),j(this,"resize",(function(){var o=M(x.mark(function a(s,u){var c,l;return x.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return c={width:s,height:u},d.next=3,i.guards.resize({size:c});case 3:if(d.sent){d.next=5;break}return d.abrupt("return",!1);case 5:if(l=i.element.querySelector("*:not(span):not([fragment])"),!(!l||!(l instanceof HTMLElement))){d.next=8;break}return d.abrupt("return",!1);case 8:return l.style.width="".concat(s,"px"),l.style.height="".concat(u,"px"),d.next=12,i.events.resized({size:c});case 12:return d.abrupt("return",!0);case 13:case"end":return d.stop()}},a)}));return function(a,s){return o.apply(this,arguments)}})()),this.getZoom=t,this.events=n,this.guards=r,this.element=document.createElement("div"),this.element.style.position="absolute",this.position={x:0,y:0},this.translate(0,0),this.element.addEventListener("contextmenu",function(o){return i.events.contextmenu(o)}),this.dragHandler=new Xr,this.dragHandler.initialize(this.element,{getCurrentPosition:function(){return i.position},getZoom:function(){return i.getZoom()}},{start:this.events.picked,translate:this.translate,drag:this.events.dragged})}return L(e,[{key:"destroy",value:function(){this.dragHandler.destroy()}}])})();function Qr(e,t){return e.map(function(n){return{view:t.get(n.id),node:n}}).filter(function(n){return n.view}).map(function(n){var r=n.view,i=n.node,o=i.width,a=i.height;return typeof o<"u"&&typeof a<"u"?{position:r.position,width:o,height:a}:{position:r.position,width:r.element.clientWidth,height:r.element.clientHeight}})}function Jo(e,t){var n=e.parentScope(Ee),r=t.map(function(o){return te(o)==="object"?o:n.getNode(o)}),i=Qr(r,e.nodeViews);return Ur(i)}function Qo(e){var t=e;t.addPipe(function(n){if(!n||te(n)!=="object"||!("type"in n))return n;if(n.type==="nodepicked"){var r=t.nodeViews.get(n.data.id),i=t.area.content;r&&i.reorder(r.element,null)}if(n.type==="connectioncreated"){var o=t.connectionViews.get(n.data.id),a=t.area.content;o&&a.reorder(o.element,a.holder.firstChild)}return n})}function Yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function he(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yn(Object(n),!0).forEach(function(r){j(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ea(e,t){var n=t!=null&&t.scaling?t.scaling===!0?{min:.1,max:1}:t.scaling:!1,r=t!=null&&t.translation?t.translation===!0?{left:0,top:0,right:1e3,bottom:1e3}:t.translation:!1;function i(a){if(!n)throw new Error("scaling param isnt defined");var s=typeof n=="function"?n():n,u=s.min,c=s.max;return a<u?u:a>c?c:a}function o(a){if(!r)throw new Error("translation param isnt defined");var s=he({},a),u=typeof r=="function"?r():r,c=u.left,l=u.top,f=u.right,d=u.bottom;return s.x<c&&(s.x=c),s.x>f&&(s.x=f),s.y<l&&(s.y=l),s.y>d&&(s.y=d),s}e.addPipe(function(a){if(!a||te(a)!=="object"||!("type"in a))return a;if(n&&a.type==="zoom")return he(he({},a),{},{data:he(he({},a.data),{},{zoom:i(a.data.zoom)})});if(r&&a.type==="zoomed"){var s=o(e.area.transform);e.area.translate(s.x,s.y)}return r&&a.type==="translate"?he(he({},a),{},{data:he(he({},a.data),{},{position:o(a.data.position)})}):a})}function ta(){var e=!1;function t(r){(r.key==="Control"||r.key==="Meta")&&(e=!0)}function n(r){(r.key==="Control"||r.key==="Meta")&&(e=!1)}return document.addEventListener("keydown",t),document.addEventListener("keyup",n),{active:function(){return e},destroy:function(){document.removeEventListener("keydown",t),document.removeEventListener("keyup",n)}}}var ei=(function(){function e(){T(this,e),j(this,"entities",new Map),j(this,"pickId",null)}return L(e,[{key:"isSelected",value:function(n){return this.entities.has("".concat(n.label,"_").concat(n.id))}},{key:"add",value:(function(){var t=M(x.mark(function r(i,o){return x.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(o){s.next=3;break}return s.next=3,this.unselectAll();case 3:this.entities.set("".concat(i.label,"_").concat(i.id),i);case 4:case"end":return s.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"remove",value:(function(){var t=M(x.mark(function r(i){var o,a;return x.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(o="".concat(i.label,"_").concat(i.id),a=this.entities.get(o),!a){u.next=6;break}return this.entities.delete(o),u.next=6,a.unselect();case 6:case"end":return u.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n})()},{key:"unselectAll",value:(function(){var t=M(x.mark(function r(){var i=this;return x.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,Promise.all(de(Array.from(this.entities.values())).map(function(s){return i.remove(s)}));case 2:case"end":return a.stop()}},r,this)}));function n(){return t.apply(this,arguments)}return n})()},{key:"translate",value:(function(){var t=M(x.mark(function r(i,o){var a=this;return x.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Promise.all(Array.from(this.entities.values()).map(function(c){return!a.isPicked(c)&&c.translate(i,o)}));case 2:case"end":return u.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"pick",value:function(n){this.pickId="".concat(n.label,"_").concat(n.id)}},{key:"release",value:function(){this.pickId=null}},{key:"isPicked",value:function(n){return this.pickId==="".concat(n.label,"_").concat(n.id)}}])})();function na(){return new ei}function ra(e,t,n){var r=null,i=e,o=function(){return r||(r=i.parentScope(Ee))},a=0;function s(p){p.selected||(p.selected=!0,i.update("node",p.id))}function u(p){p.selected&&(p.selected=!1,i.update("node",p.id))}function c(p,v){return l.apply(this,arguments)}function l(){return l=M(x.mark(function p(v,m){var h;return x.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(h=o().getNode(v),h){k.next=3;break}return k.abrupt("return");case 3:return k.next=5,t.add({label:"node",id:h.id,translate:function(y,C){return M(x.mark(function P(){var b,$;return x.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(b=i.nodeViews.get(h.id),$=b==null?void 0:b.position,!$){A.next=5;break}return A.next=5,b.translate($.x+y,$.y+C);case 5:case"end":return A.stop()}},P)}))()},unselect:function(){u(h)}},m);case 5:s(h);case 6:case"end":return k.stop()}},p)})),l.apply(this,arguments)}function f(p){return d.apply(this,arguments)}function d(){return d=M(x.mark(function p(v){return x.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,t.remove({id:v,label:"node"});case 2:case"end":return h.stop()}},p)})),d.apply(this,arguments)}return i.addPipe((function(){var p=M(x.mark(function v(m){var h,O,k,g,y,C,P,b;return x.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(!(!m||te(m)!=="object"||!("type"in m))){E.next=2;break}return E.abrupt("return",m);case 2:if(m.type!=="nodepicked"){E.next=11;break}return h=m.data.id,O=n.accumulating.active(),t.pick({id:h,label:"node"}),a=null,E.next=9,c(h,O);case 9:E.next=33;break;case 11:if(m.type!=="nodetranslated"){E.next=20;break}if(k=m.data,g=k.id,y=k.position,C=k.previous,P=y.x-C.x,b=y.y-C.y,!t.isPicked({id:g,label:"node"})){E.next=18;break}return E.next=18,t.translate(P,b);case 18:E.next=33;break;case 20:if(m.type!=="pointerdown"){E.next=24;break}a=0,E.next=33;break;case 24:if(m.type!=="pointermove"){E.next=28;break}a!==null&&a++,E.next=33;break;case 28:if(m.type!=="pointerup"){E.next=33;break}if(!(a!==null&&a<4)){E.next=32;break}return E.next=32,t.unselectAll();case 32:a=null;case 33:return E.abrupt("return",m);case 34:case"end":return E.stop()}},v)}));return function(v){return p.apply(this,arguments)}})()),{select:c,unselect:f}}function ia(e,t){var n=null,r=function(){return n||(n=e.parentScope(Ee))};function i(o,a){var s=r().getNode(o);if(s){var u=s.inputs[a];if(!u)throw new Error("cannot find input");var c=u.showControl,l=r().getConnections(),f=!!l.find(function(d){return d.target===o&&d.targetInput===a});u.showControl=t?t({hasAnyConnection:f,input:u}):!f,u.showControl!==c&&e.update("node",s.id)}}e.addPipe(function(o){return(o.type==="connectioncreated"||o.type==="connectionremoved")&&i(o.data.target,o.data.targetInput),o})}function qn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function it(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qn(Object(n),!0).forEach(function(r){j(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oa(e,t){var n=e,r=typeof(t==null?void 0:t.size)>"u"?16:t.size,i=typeof(t==null?void 0:t.dynamic)>"u"?!0:t.dynamic;function o(a){return Math.round(a/r)*r}n.addPipe(function(a){if(!a||te(a)!=="object"||!("type"in a))return a;if(i&&a.type==="nodetranslate"){var s=a.data.position,u=o(s.x),c=o(s.y);return it(it({},a),{},{data:it(it({},a.data),{},{position:{x:u,y:c}})})}if(!i&&a.type==="nodedragged"){var l=n.nodeViews.get(a.data.id);if(l){var f=l.position,d=f.x,p=f.y;l.translate(o(d),o(p))}}return a})}function aa(e,t,n){return Zt.apply(this,arguments)}function Zt(){return Zt=M(x.mark(function e(t,n,r){var i,o,a,s,u,c,l,f,d,p,v,m,h;return x.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return i=r||{},o=i.scale,a=o===void 0?.9:o,s=t.parentScope(Ee),u=n.map(function(g){return te(g)==="object"?g:s.getNode(g)}),c=Qr(u,t.nodeViews),l=Ur(c),f=[t.container.clientWidth,t.container.clientHeight],d=f[0],p=f[1],v=d/l.width,m=p/l.height,h=Math.min(m*a,v*a,1),t.area.transform.x=d/2-l.center.x*h,t.area.transform.y=p/2-l.center.y*h,k.next=12,t.area.zoom(h,0,0);case 12:case"end":return k.stop()}},e)})),Zt.apply(this,arguments)}var ot=Object.freeze({__proto__:null,getBoundingBox:Jo,simpleNodesOrder:Qo,restrictor:ea,accumulateOnCtrl:ta,selectableNodes:ra,Selector:ei,selector:na,showInputControl:ia,snapGrid:oa,zoomAt:aa});function Kn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kn(Object(n),!0).forEach(function(r){j(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sa(e,t,n){return t=q(t),ge(e,ti()?Reflect.construct(t,n||[],q(e).constructor):t.apply(e,n))}function ti(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ti=function(){return!!e})()}var ni=(function(e){function t(n){var r;return T(this,t),r=sa(this,t,["area"]),j(r,"nodeViews",new Map),j(r,"connectionViews",new Map),j(r,"elements",new Uo),j(r,"onContextMenu",function(i){r.emit({type:"contextmenu",data:{event:i,context:"root"}})}),r.container=n,n.style.overflow="hidden",n.addEventListener("contextmenu",r.onContextMenu),r.addPipe(function(i){return!i||!(te(i)==="object"&&"type"in i)||(i.type==="nodecreated"&&r.addNodeView(i.data),i.type==="noderemoved"&&r.removeNodeView(i.data.id),i.type==="connectioncreated"&&r.addConnectionView(i.data),i.type==="connectionremoved"&&r.removeConnectionView(i.data.id),i.type==="render"&&r.elements.set(i.data),i.type==="unmount"&&r.elements.delete(i.data.element)),i}),r.area=new qo(n,{zoomed:function(o){return r.emit({type:"zoomed",data:o})},pointerDown:function(o,a){return void r.emit({type:"pointerdown",data:{position:o,event:a}})},pointerMove:function(o,a){return void r.emit({type:"pointermove",data:{position:o,event:a}})},pointerUp:function(o,a){return void r.emit({type:"pointerup",data:{position:o,event:a}})},resize:function(o){return void r.emit({type:"resized",data:{event:o}})},translated:function(o){return r.emit({type:"translated",data:o})},reordered:function(o){return r.emit({type:"reordered",data:{element:o}})}},{translate:function(o){return r.emit({type:"translate",data:o})},zoom:function(o){return r.emit({type:"zoom",data:o})}}),r}return ie(t,e),L(t,[{key:"addNodeView",value:function(r){var i=this,o=r.id,a=new Xo(function(){return i.area.transform.k},{picked:function(){return void i.emit({type:"nodepicked",data:{id:o}})},translated:function(u){return i.emit({type:"nodetranslated",data:Zn({id:o},u)})},dragged:function(){return void i.emit({type:"nodedragged",data:r})},contextmenu:function(u){return void i.emit({type:"contextmenu",data:{event:u,context:r}})},resized:function(u){var c=u.size;return i.emit({type:"noderesized",data:{id:r.id,size:c}})}},{translate:function(u){return i.emit({type:"nodetranslate",data:Zn({id:o},u)})},resize:function(u){var c=u.size;return i.emit({type:"noderesize",data:{id:r.id,size:c}})}});return this.nodeViews.set(o,a),this.area.content.add(a.element),this.emit({type:"render",data:{element:a.element,type:"node",payload:r}}),a}},{key:"removeNodeView",value:function(r){var i=this.nodeViews.get(r);i&&(this.emit({type:"unmount",data:{element:i.element}}),this.nodeViews.delete(r),this.area.content.remove(i.element))}},{key:"addConnectionView",value:function(r){var i=this,o=new Zo({contextmenu:function(s){return void i.emit({type:"contextmenu",data:{event:s,context:r}})}});return this.connectionViews.set(r.id,o),this.area.content.add(o.element),this.emit({type:"render",data:{element:o.element,type:"connection",payload:r}}),o}},{key:"removeConnectionView",value:function(r){var i=this.connectionViews.get(r);i&&(this.emit({type:"unmount",data:{element:i.element}}),this.connectionViews.delete(r),this.area.content.remove(i.element))}},{key:"update",value:(function(){var n=M(x.mark(function i(o,a){var s;return x.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=this.elements.get(o,a),!s){c.next=4;break}return c.next=4,this.emit({type:"render",data:s});case 4:case"end":return c.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"resize",value:(function(){var n=M(x.mark(function i(o,a,s){var u;return x.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(u=this.nodeViews.get(o),!u){l.next=5;break}return l.next=4,u.resize(a,s);case 4:return l.abrupt("return",l.sent);case 5:case"end":return l.stop()}},i,this)}));function r(i,o,a){return n.apply(this,arguments)}return r})()},{key:"translate",value:(function(){var n=M(x.mark(function i(o,a){var s,u,c;return x.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(s=a.x,u=a.y,c=this.nodeViews.get(o),!c){f.next=6;break}return f.next=5,c.translate(s,u);case 5:return f.abrupt("return",f.sent);case 6:case"end":return f.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"destroy",value:function(){var r=this;this.container.removeEventListener("contextmenu",this.onContextMenu),Array.from(this.connectionViews.keys()).forEach(function(i){return r.removeConnectionView(i)}),Array.from(this.nodeViews.keys()).forEach(function(i){return r.removeNodeView(i)}),this.area.destroy()}}])})(gt);function ua(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=q(e))!==null;);return e}function Ze(){return Ze=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=ua(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Ze.apply(null,arguments)}function ca(e){if(Array.isArray(e))return e}function la(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function da(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
28
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ee(e,t){return ca(e)||la(e,t)||Zr(e,t)||da()}/*!
|
|
29
|
-
* rete-connection-plugin v2.0.4
|
|
30
|
-
* (c) 2024 Vitaliy Stoliarov
|
|
31
|
-
* Released under the MIT license.
|
|
32
|
-
* */function Un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Un(Object(n),!0).forEach(function(r){j(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Un(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fa(e){var t=null,n=null;function r(o){n&&o.removeConnectionView(n),t=null,n=null}function i(o){r(o),n="pseudo_".concat(je())}return{isMounted:function(){return!!n},mount:i,render:function(a,s,u){var c=s.x,l=s.y,f=u.side==="output",d={x:c+(f?-3:3),y:l};if(!n)throw new Error("pseudo connection id wasn't generated");var p=f?Tt({id:n,source:u.nodeId,sourceOutput:u.key,target:"",targetInput:""},e??{}):Tt({id:n,target:u.nodeId,targetInput:u.key,source:"",sourceOutput:""},e??{});if(!t){var v=a.addConnectionView(p);t=v.element}t&&a.emit({type:"render",data:Tt({element:t,type:"connection",payload:p},f?{end:d}:{start:d})})},unmount:r}}function pa(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ha(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
33
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function ha(e,t){if(e){if(typeof e=="string")return Xn(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xn(e,t):void 0}}function Xn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function va(e,t){var n=pa(t),r;try{for(n.s();!(r=n.n()).done;){var i=r.value,o=e.get(i);if(o)return o}}catch(a){n.e(a)}finally{n.f()}}function ri(e,t){var n,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document,i=r.elementsFromPoint(e,t),o=(n=i[0])===null||n===void 0?void 0:n.shadowRoot;return o&&o!==r&&i.unshift.apply(i,de(ri(e,t,o))),i}var hn=(function(){function e(){T(this,e)}return L(e,[{key:"setContext",value:function(n){this.context=n}}])})();function ii(e,t){var n=e.side==="output"&&t.side==="input",r=e.side==="input"&&t.side==="output",i=n?[e,t]:r?[t,e]:[],o=ee(i,2),a=o[0],s=o[1];if(a&&s)return[a,s]}function ma(e,t){return!!ii(e,t)}function ya(e,t,n){var r=ii(e,t)||[null,null],i=ee(r,2),o=i[0],a=i[1];if(o&&a)return n.editor.addConnection({id:je(),source:o.nodeId,sourceOutput:o.key,target:a.nodeId,targetInput:a.key}),!0}function ga(e,t){var n=t.getNode(e.nodeId);if(!n)throw new Error("cannot find node");var r=e.side==="input"?n.inputs:n.outputs;return r[e.key]}function ba(e,t){var n=e.nodeId,r=e.side,i=e.key;return t.getConnections().filter(function(o){if(r==="input")return o.target===n&&o.targetInput===i;if(r==="output")return o.source===n&&o.sourceOutput===i})}function Ut(e,t){var n=e.map(function(r){var i=ga(r,t),o=i==null?void 0:i.multipleConnections;return o?[]:ba(r,t)}).flat();return{commit:function(){var i=Array.from(new Set(n.map(function(o){var a=o.id;return a})));i.forEach(function(o){return void t.removeConnection(o)})}}}function vn(e,t,n){return t=q(t),ge(e,oi()?Reflect.construct(t,[],q(e).constructor):t.apply(e,n))}function oi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oi=function(){return!!e})()}var wa=(function(e){function t(n,r){var i;return T(this,t),i=vn(this,t),i.initial=n,i.params=r,i}return ie(t,e),L(t,[{key:"pick",value:(function(){var n=M(x.mark(function i(o,a){var s,u;return x.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:s=o.socket,this.params.canMakeConnection(this.initial,s)&&(Ut([this.initial,s],a.editor).commit(),u=this.params.makeConnection(this.initial,s,a),this.drop(a,u?s:null,u));case 2:case"end":return l.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"drop",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.initial&&r.scope.emit({type:"connectiondrop",data:{initial:this.initial,socket:i,created:o}}),this.context.switchTo(new mn(this.params))}}])})(hn),ka=(function(e){function t(n,r,i){var o;T(this,t),o=vn(this,t),o.connection=n,o.params=r;var a=Array.from(i.socketsCache.values()).find(function(s){return s.nodeId===o.connection.source&&s.side==="output"&&s.key===o.connection.sourceOutput});if(!a)throw new Error("cannot find output socket");return o.outputSocket=a,o}return ie(t,e),L(t,[{key:"init",value:(function(){var n=M(x.mark(function i(o){var a=this;return x.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:o.scope.emit({type:"connectionpick",data:{socket:this.outputSocket}}).then(function(c){c?(o.editor.removeConnection(a.connection.id),a.initial=a.outputSocket):a.drop(o)});case 1:case"end":return u.stop()}},i,this)}));function r(i){return n.apply(this,arguments)}return r})()},{key:"pick",value:(function(){var n=M(x.mark(function i(o,a){var s,u,c,l,f,d;return x.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:s=o.socket,u=o.event,this.initial&&!(s.side==="input"&&this.connection.target===s.nodeId&&this.connection.targetInput===s.key)?this.params.canMakeConnection(this.initial,s)&&(Ut([this.initial,s],a.editor).commit(),c=this.params.makeConnection(this.initial,s,a),l=c?s:null,this.drop(a,l,c)):u==="down"&&this.initial&&(Ut([this.initial,s],a.editor).commit(),f=this.params.makeConnection(this.initial,s,a),d=f?null:s,this.drop(a,d,f));case 2:case"end":return v.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"drop",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.initial&&r.scope.emit({type:"connectiondrop",data:{initial:this.initial,socket:i,created:o}}),this.context.switchTo(new mn(this.params))}}])})(hn),mn=(function(e){function t(n){var r;return T(this,t),r=vn(this,t),r.params=n,r}return ie(t,e),L(t,[{key:"pick",value:(function(){var n=M(x.mark(function i(o,a){var s,u,c,l;return x.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(s=o.socket,u=o.event,u==="down"){d.next=3;break}return d.abrupt("return");case 3:if(s.side!=="input"){d.next=11;break}if(c=a.editor.getConnections().find(function(p){return p.target===s.nodeId&&p.targetInput===s.key}),!c){d.next=11;break}return l=new ka(c,this.params,a),d.next=9,l.init(a);case 9:return this.context.switchTo(l),d.abrupt("return");case 11:return d.next=13,a.scope.emit({type:"connectionpick",data:{socket:s}});case 13:if(!d.sent){d.next=17;break}this.context.switchTo(new wa(s,this.params)),d.next=18;break;case 17:this.drop(a);case 18:case"end":return d.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"drop",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.initial&&r.scope.emit({type:"connectiondrop",data:{initial:this.initial,socket:i,created:o}}),delete this.initial}}])})(hn),xa=(function(){function e(t){T(this,e);var n=(t==null?void 0:t.canMakeConnection)||ma,r=(t==null?void 0:t.makeConnection)||ya;this.switchTo(new mn({canMakeConnection:n,makeConnection:r}))}return L(e,[{key:"pick",value:(function(){var t=M(x.mark(function r(i,o){return x.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,this.currentState.pick(i,o);case 2:case"end":return s.stop()}},r,this)}));function n(r,i){return t.apply(this,arguments)}return n})()},{key:"getPickedSocket",value:function(){return this.currentState.initial}},{key:"switchTo",value:function(n){n.setContext(this),this.currentState=n}},{key:"drop",value:function(n){this.currentState.drop(n)}}])})();function Sa(){return function(){return new xa}}var Oa=Object.freeze({__proto__:null,setup:Sa}),Ca=Object.freeze({__proto__:null,classic:Oa});function Pa(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=$a(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
34
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function $a(e,t){if(e){if(typeof e=="string")return Jn(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jn(e,t):void 0}}function Jn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _a(e,t,n){return t=q(t),ge(e,ai()?Reflect.construct(t,n||[],q(e).constructor):t.apply(e,n))}function ai(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ai=function(){return!!e})()}function Ea(e,t,n,r){var i=Ze(q(e.prototype),t,n);return typeof i=="function"?function(o){return i.apply(n,o)}:i}var ja=(function(e){function t(){var n;return T(this,t),n=_a(this,t,["connection"]),j(n,"presets",[]),j(n,"currentFlow",null),j(n,"preudoconnection",fa({isPseudo:!0})),j(n,"socketsCache",new Map),n}return ie(t,e),L(t,[{key:"addPreset",value:function(r){this.presets.push(r)}},{key:"findPreset",value:function(r){var i=Pa(this.presets),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,s=a(r);if(s)return s}}catch(u){i.e(u)}finally{i.f()}return null}},{key:"update",value:function(){if(this.currentFlow){var r=this.currentFlow.getPickedSocket();r&&this.preudoconnection.render(this.areaPlugin,this.areaPlugin.area.pointer,r)}}},{key:"drop",value:function(){var r={editor:this.editor,scope:this,socketsCache:this.socketsCache};this.currentFlow&&(this.currentFlow.drop(r),this.preudoconnection.unmount(this.areaPlugin),this.currentFlow=null)}},{key:"pick",value:(function(){var n=M(x.mark(function i(o,a){var s,u,c;return x.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(s={editor:this.editor,scope:this,socketsCache:this.socketsCache},u=ri(o.clientX,o.clientY),c=va(this.socketsCache,u),!c){f.next=13;break}if(o.preventDefault(),o.stopPropagation(),this.currentFlow=this.currentFlow||this.findPreset(c),!this.currentFlow){f.next=11;break}return f.next=10,this.currentFlow.pick({socket:c,event:a},s);case 10:this.preudoconnection.mount(this.areaPlugin);case 11:f.next=14;break;case 13:this.currentFlow&&this.currentFlow.drop(s);case 14:this.currentFlow&&!this.currentFlow.getPickedSocket()&&(this.preudoconnection.unmount(this.areaPlugin),this.currentFlow=null),this.update();case 16:case"end":return f.stop()}},i,this)}));function r(i,o){return n.apply(this,arguments)}return r})()},{key:"setParent",value:function(r){var i=this;Ea(t,"setParent",this)([r]),this.areaPlugin=this.parentScope(gt),this.editor=this.areaPlugin.parentScope(Ee);var o=function(s){i.pick(s,"down")};this.addPipe(function(a){if(!a||te(a)!=="object"||!("type"in a))return a;if(a.type==="pointermove")i.update();else if(a.type==="pointerup")i.pick(a.data.event,"up");else if(a.type==="render"){if(a.data.type==="socket"){var s=a.data.element;s.addEventListener("pointerdown",o),i.socketsCache.set(s,a.data)}}else if(a.type==="unmount"){var u=a.data.element;u.removeEventListener("pointerdown",o),i.socketsCache.delete(u)}return a})}}])})(Je);/*!
|
|
35
|
-
* rete-minimap-plugin v2.0.2
|
|
36
|
-
* (c) 2024 Vitaliy Stoliarov
|
|
37
|
-
* Released under the MIT license.
|
|
38
|
-
* */function Ra(e){var t=e.map(function(c){return c.left}),n=e.map(function(c){return c.left+c.width}),r=e.map(function(c){return c.top}),i=e.map(function(c){return c.top+c.height}),o=Math.min.apply(Math,de(t)),a=Math.max.apply(Math,de(n)),s=Math.min.apply(Math,de(r)),u=Math.max.apply(Math,de(i));return{left:o,right:a,top:s,bottom:u,width:a-o,height:u-s}}function Aa(e,t,n){var r=Ra(e),i=Math.max(t,Math.max(r.width,r.height*n)),o=(i-r.width)/2-r.left,a=(i/n-r.height)/2-r.top,s=function(l){return l/i},u=function(l){return l*i};return{origin:{x:o,y:a},scale:s,invert:u}}function Ia(e,t,n){return t=q(t),ge(e,si()?Reflect.construct(t,n||[],q(e).constructor):t.apply(e,n))}function si(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(si=function(){return!!e})()}function Na(e,t,n,r){var i=Ze(q(e.prototype),t,n);return typeof i=="function"?function(o){return i.apply(n,o)}:i}var za=(function(e){function t(n){var r,i,o,a,s,u;return T(this,t),u=Ia(this,t,["minimap"]),u.props=n,u.ratio=(r=(i=u.props)===null||i===void 0?void 0:i.ratio)!==null&&r!==void 0?r:1,u.minDistance=(o=(a=u.props)===null||a===void 0?void 0:a.minDistance)!==null&&o!==void 0?o:2e3,u.boundViewport=!!(!((s=u.props)===null||s===void 0)&&s.boundViewport),u}return ie(t,e),L(t,[{key:"setParent",value:function(r){var i=this;Na(t,"setParent",this)([r]),this.area=this.parentScope(ni),this.editor=this.area.parentScope(Ee),this.element=document.createElement("div"),this.area.container.appendChild(this.element),this.addPipe(function(o){return"type"in o&&(o.type==="render"&&o.data.type==="node"||o.type==="nodetranslated"||o.type==="nodecreated"||o.type==="noderemoved"||o.type==="translated"||o.type==="resized"||o.type==="noderesized"||o.type==="zoomed")&&i.render(),o})}},{key:"getNodesRect",value:function(){var r=this;return this.editor.getNodes().map(function(i){var o=r.area.nodeViews.get(i.id);return o?{width:i.width,height:i.height,left:o.position.x,top:o.position.y}:null}).filter(Boolean)}},{key:"render",value:function(){var r=this,i=this.parentScope(),o=this.getNodesRect(),a=this.area.area.transform,s=this.area.container,u=s.clientWidth,c=s.clientHeight,l=this.minDistance,f=this.ratio,d={left:-a.x/a.k,top:-a.y/a.k,width:u/a.k,height:c/a.k},p=this.boundViewport?[].concat(de(o),[d]):o,v=Aa(p,l,f),m=v.origin,h=v.scale,O=v.invert;i.emit({type:"render",data:{type:"minimap",element:this.element,ratio:f,start:function(){return a},nodes:o.map(function(k){return{left:h(k.left+m.x),top:h(k.top+m.y),width:h(k.width),height:h(k.height)}}),viewport:{left:h(d.left+m.x),top:h(d.top+m.y),width:h(d.width),height:h(d.height)},translate:function(g,y){var C=a.x,P=a.y,b=a.k;r.area.area.translate(C+O(g)*b,P+O(y)*b)},point:function(g,y){var C={x:(m.x-O(g))*a.k,y:(m.y-O(y))*a.k},P={x:C.x+u/2,y:C.y+c/2};r.area.area.translate(P.x,P.y)}}})}}])})(Je);/*!
|
|
39
|
-
* rete-render-utils v2.0.2
|
|
40
|
-
* (c) 2024 Vitaliy Stoliarov
|
|
41
|
-
* Released under the MIT license.
|
|
42
|
-
* */function Da(e,t){var n=ee(e,2),r=n[0],i=r.x,o=r.y,a=n[1],s=a.x,u=a.y,c=Math.abs(o-u),l=i+Math.max(c/2,Math.abs(s-i))*t,f=s-Math.max(c/2,Math.abs(s-i))*t;return"M ".concat(i," ").concat(o," C ").concat(l," ").concat(o," ").concat(f," ").concat(u," ").concat(s," ").concat(u)}function Ma(e,t,n){var r=ee(e,2),i=r[0],o=i.x,a=i.y,s=r[1],u=s.x,c=s.y,l=c>a?1:-1,f=n+Math.abs(o-u)/(n/2),d=(o+u)/2,p=a-l*f,v=(c-a)*t;return`
|
|
43
|
-
M `.concat(o," ").concat(a,`
|
|
44
|
-
C `).concat(o+f," ").concat(a,`
|
|
45
|
-
`).concat(o+f," ").concat(p-v,`
|
|
46
|
-
`).concat(d," ").concat(p,`
|
|
47
|
-
C `).concat(u-f," ").concat(p+v,`
|
|
48
|
-
`).concat(u-f," ").concat(c,`
|
|
49
|
-
`).concat(u," ").concat(c,`
|
|
50
|
-
`)}function Ta(e,t){return Xt.apply(this,arguments)}function Xt(){return Xt=M(x.mark(function e(t,n){var r,i,o,a,s;return x.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(t.offsetParent){c.next=5;break}return c.next=3,new Promise(function(l){return setTimeout(l,0)});case 3:c.next=0;break;case 5:if(r=t.offsetLeft,i=t.offsetTop,o=t.offsetParent,o){c.next=10;break}throw new Error("child has null offsetParent");case 10:for(;o!==null&&o!==n;)r+=o.offsetLeft+o.clientLeft,i+=o.offsetTop+o.clientTop,o=o.offsetParent;return a=t.offsetWidth,s=t.offsetHeight,c.abrupt("return",{x:r+a/2,y:i+s/2});case 14:case"end":return c.stop()}},e)})),Xt.apply(this,arguments)}var La=(function(){function e(){T(this,e),j(this,"listeners",new Set)}return L(e,[{key:"emit",value:function(n){this.listeners.forEach(function(r){r(n)})}},{key:"listen",value:function(n){var r=this;return this.listeners.add(n),function(){r.listeners.delete(n)}}}])})(),Ba=(function(){function e(){T(this,e),j(this,"elements",new Map)}return L(e,[{key:"getPosition",value:function(n){var r,i,o=Array.from(this.elements.values()).flat(),a=o.filter(function(s){return s.side===n.side&&s.nodeId===n.nodeId&&s.key===n.key});return a.length>1&&console.warn(["Found more than one element for socket with same key and side.","Probably it was not unmounted correctly"].join(" "),n),(r=(i=a.pop())===null||i===void 0?void 0:i.position)!==null&&r!==void 0?r:null}},{key:"add",value:function(n){var r=this.elements.get(n.element);this.elements.set(n.element,r?[].concat(de(r.filter(function(i){return!(i.nodeId===n.nodeId&&i.key===n.key&&i.side===n.side)})),[n]):[n])}},{key:"remove",value:function(n){this.elements.delete(n)}},{key:"snapshot",value:function(){return Array.from(this.elements.values()).flat()}}])})(),Fa=(function(){function e(){T(this,e),j(this,"sockets",new Ba),j(this,"emitter",new La),j(this,"area",null)}return L(e,[{key:"attach",value:function(n){var r=this;this.area||n.hasParent()&&(this.area=n.parentScope(gt),this.area.addPipe((function(){var i=M(x.mark(function o(a){var s,u,c,l,f,d,p,v,m,h,O;return x.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(!(a.type==="rendered"&&a.data.type==="socket")){g.next=8;break}return s=a.data,u=s.nodeId,c=s.key,l=s.side,f=s.element,g.next=4,r.calculatePosition(u,l,c,f);case 4:d=g.sent,d&&(r.sockets.add({nodeId:u,key:c,side:l,element:f,position:d}),r.emitter.emit({nodeId:u,key:c,side:l})),g.next=24;break;case 8:if(a.type!=="unmount"){g.next=12;break}r.sockets.remove(a.data.element),g.next=24;break;case 12:if(a.type!=="nodetranslated"){g.next=16;break}r.emitter.emit({nodeId:a.data.id}),g.next=24;break;case 16:if(a.type!=="noderesized"){g.next=23;break}return p=a.data.id,g.next=20,Promise.all(r.sockets.snapshot().filter(function(y){return y.nodeId===a.data.id&&y.side==="output"}).map((function(){var y=M(x.mark(function C(P){var b,$,E,A;return x.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return b=P.side,$=P.key,E=P.element,G.next=3,r.calculatePosition(p,b,$,E);case 3:A=G.sent,A&&(P.position=A);case 5:case"end":return G.stop()}},C)}));return function(C){return y.apply(this,arguments)}})()));case 20:r.emitter.emit({nodeId:p}),g.next=24;break;case 23:a.type==="render"&&a.data.type==="connection"&&(v=a.data.payload,m=v.source,h=v.target,O=m||h,r.emitter.emit({nodeId:O}));case 24:return g.abrupt("return",a);case 25:case"end":return g.stop()}},o)}));return function(o){return i.apply(this,arguments)}})()))}},{key:"listen",value:function(n,r,i,o){var a=this,s=this.emitter.listen(function(u){if(u.nodeId===n&&(!u.key||u.side===r)&&(!u.side||u.key===i)){var c,l=a.sockets.getPosition({side:r,nodeId:n,key:i});if(!l)return;var f=l.x,d=l.y,p=(c=a.area)===null||c===void 0?void 0:c.nodeViews.get(n);p&&o({x:f+p.position.x,y:d+p.position.y})}});return this.sockets.snapshot().forEach(function(u){u.nodeId===n&&a.emitter.emit(u)}),s}}])})();function Ha(e,t,n){return t=q(t),ge(e,ui()?Reflect.construct(t,[],q(e).constructor):t.apply(e,n))}function ui(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ui=function(){return!!e})()}var Ga=(function(e){function t(n){var r;return T(this,t),r=Ha(this,t),r.props=n,r}return ie(t,e),L(t,[{key:"calculatePosition",value:(function(){var n=M(x.mark(function i(o,a,s,u){var c,l,f,d;return x.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(f=(c=this.area)===null||c===void 0?void 0:c.nodeViews.get(o),f!=null&&f.element){v.next=3;break}return v.abrupt("return",null);case 3:return v.next=5,Ta(u,f.element);case 5:if(d=v.sent,!((l=this.props)!==null&&l!==void 0&&l.offset)){v.next=8;break}return v.abrupt("return",this.props.offset(d,o,a,s));case 8:return v.abrupt("return",{x:d.x+12*(a==="input"?-1:1),y:d.y});case 9:case"end":return v.stop()}},i,this)}));function r(i,o,a,s){return n.apply(this,arguments)}return r})()}])})(Fa);function Va(e){return new Ga(e)}function U(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Wa={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Y="-ms-",Ye="-moz-",H="-webkit-",ci="comm",bt="rule",yn="decl",Ya="@import",qa="@namespace",li="@keyframes",Ka="@layer",di=Math.abs,gn=String.fromCharCode,Jt=Object.assign;function Za(e,t){return Z(e,0)^45?(((t<<2^Z(e,0))<<2^Z(e,1))<<2^Z(e,2))<<2^Z(e,3):0}function fi(e){return e.trim()}function ve(e,t){return(e=t.exec(e))?e[0]:e}function z(e,t,n){return e.replace(t,n)}function ct(e,t,n){return e.indexOf(t,n)}function Z(e,t){return e.charCodeAt(t)|0}function $e(e,t,n){return e.slice(t,n)}function ue(e){return e.length}function pi(e){return e.length}function Ge(e,t){return t.push(e),e}function Ua(e,t){return e.map(t).join("")}function Qn(e,t){return e.filter(function(n){return!ve(n,t)})}var wt=1,De=1,hi=0,ae=0,K=0,Be="";function kt(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:wt,column:De,length:a,return:"",siblings:s}}function we(e,t){return Jt(kt("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Ae(e){for(;e.root;)e=we(e.root,{children:[e]});Ge(e,e.siblings)}function Xa(){return K}function Ja(){return K=ae>0?Z(Be,--ae):0,De--,K===10&&(De=1,wt--),K}function ce(){return K=ae<hi?Z(Be,ae++):0,De++,K===10&&(De=1,wt++),K}function ke(){return Z(Be,ae)}function lt(){return ae}function xt(e,t){return $e(Be,e,t)}function Ue(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Qa(e){return wt=De=1,hi=ue(Be=e),ae=0,[]}function es(e){return Be="",e}function Lt(e){return fi(xt(ae-1,Qt(e===91?e+2:e===40?e+1:e)))}function ts(e){for(;(K=ke())&&K<33;)ce();return Ue(e)>2||Ue(K)>3?"":" "}function ns(e,t){for(;--t&&ce()&&!(K<48||K>102||K>57&&K<65||K>70&&K<97););return xt(e,lt()+(t<6&&ke()==32&&ce()==32))}function Qt(e){for(;ce();)switch(K){case e:return ae;case 34:case 39:e!==34&&e!==39&&Qt(K);break;case 40:e===41&&Qt(e);break;case 92:ce();break}return ae}function rs(e,t){for(;ce()&&e+K!==57;)if(e+K===84&&ke()===47)break;return"/*"+xt(t,ae-1)+"*"+gn(e===47?e:ce())}function is(e){for(;!Ue(ke());)ce();return xt(e,ae)}function os(e){return es(dt("",null,null,null,[""],e=Qa(e),0,[0],e))}function dt(e,t,n,r,i,o,a,s,u){for(var c=0,l=0,f=a,d=0,p=0,v=0,m=1,h=1,O=1,k=0,g="",y=i,C=o,P=r,b=g;h;)switch(v=k,k=ce()){case 40:if(v!=108&&Z(b,f-1)==58){ct(b+=z(Lt(k),"&","&\f"),"&\f",di(c?s[c-1]:0))!=-1&&(O=-1);break}case 34:case 39:case 91:b+=Lt(k);break;case 9:case 10:case 13:case 32:b+=ts(v);break;case 92:b+=ns(lt()-1,7);continue;case 47:switch(ke()){case 42:case 47:Ge(as(rs(ce(),lt()),t,n,u),u),(Ue(v||1)==5||Ue(ke()||1)==5)&&ue(b)&&$e(b,-1,void 0)!==" "&&(b+=" ");break;default:b+="/"}break;case 123*m:s[c++]=ue(b)*O;case 125*m:case 59:case 0:switch(k){case 0:case 125:h=0;case 59+l:O==-1&&(b=z(b,/\f/g,"")),p>0&&(ue(b)-f||m===0&&v===47)&&Ge(p>32?tr(b+";",r,n,f-1,u):tr(z(b," ","")+";",r,n,f-2,u),u);break;case 59:b+=";";default:if(Ge(P=er(b,t,n,c,l,i,s,g,y=[],C=[],f,o),o),k===123)if(l===0)dt(b,t,P,P,y,o,f,s,C);else{switch(d){case 99:if(Z(b,3)===110)break;case 108:if(Z(b,2)===97)break;default:l=0;case 100:case 109:case 115:}l?dt(e,P,P,r&&Ge(er(e,P,P,0,0,i,s,g,i,y=[],f,C),C),i,C,f,s,r?y:C):dt(b,P,P,P,[""],C,0,s,C)}}c=l=p=0,m=O=1,g=b="",f=a;break;case 58:f=1+ue(b),p=v;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&Ja()==125)continue}switch(b+=gn(k),k*m){case 38:O=l>0?1:(b+="\f",-1);break;case 44:s[c++]=(ue(b)-1)*O,O=1;break;case 64:ke()===45&&(b+=Lt(ce())),d=ke(),l=f=ue(g=b+=is(lt())),k++;break;case 45:v===45&&ue(b)==2&&(m=0)}}return o}function er(e,t,n,r,i,o,a,s,u,c,l,f){for(var d=i-1,p=i===0?o:[""],v=pi(p),m=0,h=0,O=0;m<r;++m)for(var k=0,g=$e(e,d+1,d=di(h=a[m])),y=e;k<v;++k)(y=fi(h>0?p[k]+" "+g:z(g,/&\f/g,p[k])))&&(u[O++]=y);return kt(e,t,n,i===0?bt:s,u,c,l,f)}function as(e,t,n,r){return kt(e,t,n,ci,gn(Xa()),$e(e,2,-2),0,r)}function tr(e,t,n,r,i){return kt(e,t,n,yn,$e(e,0,r),$e(e,r+1,-1),r,i)}function vi(e,t,n){switch(Za(e,t)){case 5103:return H+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return H+e+e;case 4855:return H+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return Ye+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return H+e+Ye+e+Y+e+e;case 5936:switch(Z(e,t+11)){case 114:return H+e+Y+z(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return H+e+Y+z(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return H+e+Y+z(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return H+e+Y+e+e;case 6165:return H+e+Y+"flex-"+e+e;case 5187:return H+e+z(e,/(\w+).+(:[^]+)/,H+"box-$1$2"+Y+"flex-$1$2")+e;case 5443:return H+e+Y+"flex-item-"+z(e,/flex-|-self/g,"")+(ve(e,/flex-|baseline/)?"":Y+"grid-row-"+z(e,/flex-|-self/g,""))+e;case 4675:return H+e+Y+"flex-line-pack"+z(e,/align-content|flex-|-self/g,"")+e;case 5548:return H+e+Y+z(e,"shrink","negative")+e;case 5292:return H+e+Y+z(e,"basis","preferred-size")+e;case 6060:return H+"box-"+z(e,"-grow","")+H+e+Y+z(e,"grow","positive")+e;case 4554:return H+z(e,/([^-])(transform)/g,"$1"+H+"$2")+e;case 6187:return z(z(z(e,/(zoom-|grab)/,H+"$1"),/(image-set)/,H+"$1"),e,"")+e;case 5495:case 3959:return z(e,/(image-set\([^]*)/,H+"$1$`$1");case 4968:return z(z(e,/(.+:)(flex-)?(.*)/,H+"box-pack:$3"+Y+"flex-pack:$3"),/space-between/,"justify")+H+e+e;case 4200:if(!ve(e,/flex-|baseline/))return Y+"grid-column-align"+$e(e,t)+e;break;case 2592:case 3360:return Y+z(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,ve(r.props,/grid-\w+-end/)})?~ct(e+(n=n[t].value),"span",0)?e:Y+z(e,"-start","")+e+Y+"grid-row-span:"+(~ct(n,"span",0)?ve(n,/\d+/):+ve(n,/\d+/)-+ve(e,/\d+/))+";":Y+z(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return ve(r.props,/grid-\w+-start/)})?e:Y+z(z(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return z(e,/(.+)-inline(.+)/,H+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ue(e)-1-t>6)switch(Z(e,t+1)){case 109:if(Z(e,t+4)!==45)break;case 102:return z(e,/(.+:)(.+)-([^]+)/,"$1"+H+"$2-$3$1"+Ye+(Z(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ct(e,"stretch",0)?vi(z(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return z(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,u,c){return Y+i+":"+o+c+(a?Y+i+"-span:"+(s?u:+u-+o)+c:"")+e});case 4949:if(Z(e,t+6)===121)return z(e,":",":"+H)+e;break;case 6444:switch(Z(e,Z(e,14)===45?18:11)){case 120:return z(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+H+(Z(e,14)===45?"inline-":"")+"box$3$1"+H+"$2$3$1"+Y+"$2box$3")+e;case 100:return z(e,":",":"+Y)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return z(e,"scroll-","scroll-snap-")+e}return e}function mt(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function ss(e,t,n,r){switch(e.type){case Ka:if(e.children.length)break;case Ya:case qa:case yn:return e.return=e.return||e.value;case ci:return"";case li:return e.return=e.value+"{"+mt(e.children,r)+"}";case bt:if(!ue(e.value=e.props.join(",")))return""}return ue(n=mt(e.children,r))?e.return=e.value+"{"+n+"}":""}function us(e){var t=pi(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}function cs(e){return function(t){t.root||(t=t.return)&&e(t)}}function ls(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case yn:e.return=vi(e.value,e.length,n);return;case li:return mt([we(e,{value:z(e.value,"@","@"+H)})],r);case bt:if(e.length)return Ua(n=e.props,function(i){switch(ve(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Ae(we(e,{props:[z(i,/:(read-\w+)/,":"+Ye+"$1")]})),Ae(we(e,{props:[i]})),Jt(e,{props:Qn(n,r)});break;case"::placeholder":Ae(we(e,{props:[z(i,/:(plac\w+)/,":"+H+"input-$1")]})),Ae(we(e,{props:[z(i,/:(plac\w+)/,":"+Ye+"$1")]})),Ae(we(e,{props:[z(i,/:(plac\w+)/,Y+"input-$1")]})),Ae(we(e,{props:[i]})),Jt(e,{props:Qn(n,r)});break}return""})}}var re={},Me=typeof process<"u"&&re!==void 0&&(re.REACT_APP_SC_ATTR||re.SC_ATTR)||"data-styled",mi="active",yi="data-styled-version",St="6.3.12",bn=`/*!sc*/
|
|
51
|
-
`,qe=typeof window<"u"&&typeof document<"u",ds=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&re!==void 0&&re.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&re.REACT_APP_SC_DISABLE_SPEEDY!==""?re.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&re.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&re!==void 0&&re.SC_DISABLE_SPEEDY!==void 0&&re.SC_DISABLE_SPEEDY!==""&&re.SC_DISABLE_SPEEDY!=="false"&&re.SC_DISABLE_SPEEDY);function Ot(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var ft=new Map,yt=new Map,pt=1,Ve=function(e){if(ft.has(e))return ft.get(e);for(;yt.has(pt);)pt++;var t=pt++;return ft.set(e,t),yt.set(t,e),t},fs=function(e,t){pt=t+1,ft.set(e,t),yt.set(t,e)},wn=Object.freeze([]),Te=Object.freeze({});function ps(e,t,n){return n===void 0&&(n=Te),e.theme!==n.theme&&e.theme||t||n.theme}var gi=new Set(["a","abbr","address","area","article","aside","audio","b","bdi","bdo","blockquote","body","button","br","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","slot","small","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use"]),hs=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,vs=/(^-|-$)/g;function nr(e){return e.replace(hs,"-").replace(vs,"")}var ms=/(a)(d)/gi,rr=function(e){return String.fromCharCode(e+(e>25?39:97))};function en(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=rr(t%52)+n;return(rr(t%52)+n).replace(ms,"$1-$2")}var Bt,Se=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},bi=function(e){return Se(5381,e)};function ys(e){return en(bi(e)>>>0)}function gs(e){return e.displayName||e.name||"Component"}function Ft(e){return typeof e=="string"&&!0}var wi=typeof Symbol=="function"&&Symbol.for,ki=wi?Symbol.for("react.memo"):60115,bs=wi?Symbol.for("react.forward_ref"):60112,ws={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ks={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},xi={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},xs=((Bt={})[bs]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Bt[ki]=xi,Bt);function ir(e){return("type"in(t=e)&&t.type.$$typeof)===ki?xi:"$$typeof"in e?xs[e.$$typeof]:ws;var t}var Ss=Object.defineProperty,Os=Object.getOwnPropertyNames,or=Object.getOwnPropertySymbols,Cs=Object.getOwnPropertyDescriptor,Ps=Object.getPrototypeOf,ar=Object.prototype;function Si(e,t,n){if(typeof t!="string"){if(ar){var r=Ps(t);r&&r!==ar&&Si(e,r,n)}var i=Os(t);or&&(i=i.concat(or(t)));for(var o=ir(e),a=ir(t),s=0;s<i.length;++s){var u=i[s];if(!(u in ks||n&&n[u]||a&&u in a||o&&u in o)){var c=Cs(t,u);try{Ss(e,u,c)}catch{}}}}return e}function Le(e){return typeof e=="function"}function kn(e){return typeof e=="object"&&"styledComponentId"in e}function Ce(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function sr(e,t){return e.join("")}function Xe(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function tn(e,t,n){if(n===void 0&&(n=!1),!n&&!Xe(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=tn(e[r],t[r]);else if(Xe(t))for(var r in t)e[r]=tn(e[r],t[r]);return e}function Oi(e,t){Object.defineProperty(e,"toString",{value:t})}var $s=(function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t,this._cGroup=0,this._cIndex=0}return e.prototype.indexOfGroup=function(t){if(t===this._cGroup)return this._cIndex;var n=this._cIndex;if(t>this._cGroup)for(var r=this._cGroup;r<t;r++)n+=this.groupSizes[r];else for(r=this._cGroup-1;r>=t;r--)n-=this.groupSizes[r];return this._cGroup=t,this._cIndex=n,n},e.prototype.insertRules=function(t,n){if(t>=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,o=i;t>=o;)if((o<<=1)<0)throw Ot(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=i;a<o;a++)this.groupSizes[a]=0}for(var s=this.indexOfGroup(t+1),u=0,c=(a=0,n.length);a<c;a++)this.tag.insertRule(s,n[a])&&(this.groupSizes[t]++,s++,u++);u>0&&this._cGroup>t&&(this._cIndex+=u)},e.prototype.clearGroup=function(t){if(t<this.length){var n=this.groupSizes[t],r=this.indexOfGroup(t),i=r+n;this.groupSizes[t]=0;for(var o=r;o<i;o++)this.tag.deleteRule(r);n>0&&this._cGroup>t&&(this._cIndex-=n)}},e.prototype.getGroup=function(t){var n="";if(t>=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),o=i+r,a=i;a<o;a++)n+=this.tag.getRule(a)+bn;return n},e})(),_s="style[".concat(Me,"][").concat(yi,'="').concat(St,'"]'),Es=new RegExp("^".concat(Me,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ur=function(e){return typeof ShadowRoot<"u"&&e instanceof ShadowRoot||"host"in e&&e.nodeType===11},nn=function(e){if(!e)return document;if(ur(e))return e;if("getRootNode"in e){var t=e.getRootNode();if(ur(t))return t}return document},js=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o<a;o++)(r=i[o])&&e.registerName(t,r)},Rs=function(e,t){for(var n,r=((n=t.textContent)!==null&&n!==void 0?n:"").split(bn),i=[],o=0,a=r.length;o<a;o++){var s=r[o].trim();if(s){var u=s.match(Es);if(u){var c=0|parseInt(u[1],10),l=u[2];c!==0&&(fs(l,c),js(e,l,u[3]),e.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}},Ht=function(e){for(var t=nn(e.options.target).querySelectorAll(_s),n=0,r=t.length;n<r;n++){var i=t[n];i&&i.getAttribute(Me)!==mi&&(Rs(e,i),i.parentNode&&i.parentNode.removeChild(i))}};function As(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var Ci=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=(function(s){var u=Array.from(s.querySelectorAll("style[".concat(Me,"]")));return u[u.length-1]})(n),o=i!==void 0?i.nextSibling:null;r.setAttribute(Me,mi),r.setAttribute(yi,St);var a=As();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},Is=(function(){function e(t){this.element=Ci(t),this.element.appendChild(document.createTextNode("")),this.sheet=(function(n){var r;if(n.sheet)return n.sheet;for(var i=(r=n.getRootNode().styleSheets)!==null&&r!==void 0?r:document.styleSheets,o=0,a=i.length;o<a;o++){var s=i[o];if(s.ownerNode===n)return s}throw Ot(17)})(this.element),this.length=0}return e.prototype.insertRule=function(t,n){try{return this.sheet.insertRule(n,t),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.prototype.getRule=function(t){var n=this.sheet.cssRules[t];return n&&n.cssText?n.cssText:""},e})(),Ns=(function(){function e(t){this.element=Ci(t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(t,n){if(t<=this.length&&t>=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e})(),zs=(function(){function e(t){this.rules=[],this.length=0}return e.prototype.insertRule=function(t,n){return t<=this.length&&(t===this.length?this.rules.push(n):this.rules.splice(t,0,n),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e})(),cr=qe,Ds={isServer:!qe,useCSSOMInjection:!ds},Pi=(function(){function e(t,n,r){t===void 0&&(t=Te),n===void 0&&(n={});var i=this;this.options=oe(oe({},Ds),t),this.gs=n,this.names=new Map(r),this.server=!!t.isServer,!this.server&&qe&&cr&&(cr=!1,Ht(this)),Oi(this,function(){return(function(o){for(var a=o.getTag(),s=a.length,u="",c=function(f){var d=(function(O){return yt.get(O)})(f);if(d===void 0)return"continue";var p=o.names.get(d);if(p===void 0||!p.size)return"continue";var v=a.getGroup(f);if(v.length===0)return"continue";var m=Me+".g"+f+'[id="'+d+'"]',h="";p.forEach(function(O){O.length>0&&(h+=O+",")}),u+=v+m+'{content:"'+h+'"}'+bn},l=0;l<s;l++)c(l);return u})(i)})}return e.registerId=function(t){return Ve(t)},e.prototype.rehydrate=function(){!this.server&&qe&&Ht(this)},e.prototype.reconstructWithOptions=function(t,n){n===void 0&&(n=!0);var r=new e(oe(oe({},this.options),t),this.gs,n&&this.names||void 0);return!this.server&&qe&&t.target!==this.options.target&&nn(this.options.target)!==nn(t.target)&&Ht(r),r},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=(function(n){var r=n.useCSSOMInjection,i=n.target;return n.isServer?new zs(i):r?new Is(i):new Ns(i)})(this.options),new $s(t)));var t},e.prototype.hasNameForId=function(t,n){var r,i;return(i=(r=this.names.get(t))===null||r===void 0?void 0:r.has(n))!==null&&i!==void 0&&i},e.prototype.registerName=function(t,n){Ve(t);var r=this.names.get(t);r?r.add(n):this.names.set(t,new Set([n]))},e.prototype.insertRules=function(t,n,r){this.registerName(t,n),this.getTag().insertRules(Ve(t),r)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(Ve(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e})();function Ms(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t!="number"||t===0||e in Wa||e.startsWith("--")?String(t).trim():"".concat(t,"px")}var Ts=function(e){return e>="A"&&e<="Z"};function lr(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(n===1&&r==="-"&&e[0]==="-")return e;Ts(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Ls=Symbol.for("sc-keyframes");function Bs(e){return typeof e=="object"&&e!==null&&Ls in e}var $i=function(e){return e==null||e===!1||e===""},_i=function(e){var t=[];for(var n in e){var r=e[n];e.hasOwnProperty(n)&&!$i(r)&&(Array.isArray(r)&&r.isCss||Le(r)?t.push("".concat(lr(n),":"),r,";"):Xe(r)?t.push.apply(t,vt(vt(["".concat(n," {")],_i(r),!1),["}"],!1)):t.push("".concat(lr(n),": ").concat(Ms(n,r),";")))}return t};function Pe(e,t,n,r,i){if(i===void 0&&(i=[]),typeof e=="string")return e&&i.push(e),i;if($i(e))return i;if(kn(e))return i.push(".".concat(e.styledComponentId)),i;if(Le(e)){if(!Le(a=e)||a.prototype&&a.prototype.isReactComponent||!t)return i.push(e),i;var o=e(t);return Pe(o,t,n,r,i)}var a;if(Bs(e))return n?(e.inject(n,r),i.push(e.getName(r))):i.push(e),i;if(Xe(e)){for(var s=_i(e),u=0;u<s.length;u++)i.push(s[u]);return i}if(!Array.isArray(e))return i.push(e.toString()),i;for(u=0;u<e.length;u++)Pe(e[u],t,n,r,i);return i}function Fs(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Le(n)&&!kn(n))return!1}return!0}var Hs=bi(St),Gs=(function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&Fs(t),this.componentId=n,this.baseHash=Se(Hs,n),this.baseStyle=r,Pi.registerId(n)}return e.prototype.generateAndInjectStyles=function(t,n,r){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,n,r).className:"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(this.componentId,this.staticRulesId))i=Ce(i,this.staticRulesId);else{var o=sr(Pe(this.rules,t,n,r)),a=en(Se(this.baseHash,o)>>>0);if(!n.hasNameForId(this.componentId,a)){var s=r(o,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,s)}i=Ce(i,a),this.staticRulesId=a}else{for(var u=Se(this.baseHash,r.hash),c="",l=0;l<this.rules.length;l++){var f=this.rules[l];if(typeof f=="string")c+=f;else if(f){var d=sr(Pe(f,t,n,r));u=Se(Se(u,String(l)),d),c+=d}}if(c){var p=en(u>>>0);if(!n.hasNameForId(this.componentId,p)){var v=r(c,".".concat(p),void 0,this.componentId);n.insertRules(this.componentId,p,v)}i=Ce(i,p)}}return{className:i,css:typeof window>"u"?n.getTag().getGroup(Ve(this.componentId)):""}},e})(),Vs=/&/g,me=47,Oe=42;function dr(e){if(e.indexOf("}")===-1)return!1;for(var t=e.length,n=0,r=0,i=!1,o=0;o<t;o++){var a=e.charCodeAt(o);if(r!==0||i||a!==me||e.charCodeAt(o+1)!==Oe)if(i)a===Oe&&e.charCodeAt(o+1)===me&&(i=!1,o++);else if(a!==34&&a!==39||o!==0&&e.charCodeAt(o-1)===92){if(r===0){if(a===123)n++;else if(a===125&&--n<0)return!0}}else r===0?r=a:r===a&&(r=0);else i=!0,o++}return n!==0||r!==0}function Ei(e,t){return e.map(function(n){return n.type==="rule"&&(n.value="".concat(t," ").concat(n.value),n.value=n.value.replaceAll(",",",".concat(t," ")),n.props=n.props.map(function(r){return"".concat(t," ").concat(r)})),Array.isArray(n.children)&&n.type!=="@keyframes"&&(n.children=Ei(n.children,t)),n})}function Ws(e){var t,n,r,i=Te,o=i.options,a=o===void 0?Te:o,s=i.plugins,u=s===void 0?wn:s,c=function(v,m,h){return h.startsWith(n)&&h.endsWith(n)&&h.replaceAll(n,"").length>0?".".concat(t):v},l=u.slice();l.push(function(v){v.type===bt&&v.value.includes("&")&&(r||(r=new RegExp("\\".concat(n,"\\b"),"g")),v.props[0]=v.props[0].replace(Vs,n).replace(r,c))}),a.prefix&&l.push(ls),l.push(ss);var f=[],d=us(l.concat(cs(function(v){return f.push(v)}))),p=function(v,m,h,O){m===void 0&&(m=""),h===void 0&&(h=""),O===void 0&&(O="&"),t=O,n=m,r=void 0;var k=(function(y){if(!dr(y))return y;for(var C=y.length,P="",b=0,$=0,E=0,A=!1,R=0;R<C;R++){var G=y.charCodeAt(R);if(E!==0||A||G!==me||y.charCodeAt(R+1)!==Oe)if(A)G===Oe&&y.charCodeAt(R+1)===me&&(A=!1,R++);else if(G!==34&&G!==39||R!==0&&y.charCodeAt(R-1)===92){if(E===0)if(G===123)$++;else if(G===125){if(--$<0){for(var V=R+1;V<C;){var I=y.charCodeAt(V);if(I===59||I===10)break;V++}V<C&&y.charCodeAt(V)===59&&V++,$=0,R=V-1,b=V;continue}$===0&&(P+=y.substring(b,R+1),b=R+1)}else G===59&&$===0&&(P+=y.substring(b,R+1),b=R+1)}else E===0?E=G:E===G&&(E=0);else A=!0,R++}if(b<C){var _=y.substring(b);dr(_)||(P+=_)}return P})((function(y){if(y.indexOf("//")===-1)return y;for(var C=y.length,P=[],b=0,$=0,E=0,A=0;$<C;){var R=y.charCodeAt($);if(R!==34&&R!==39||$!==0&&y.charCodeAt($-1)===92)if(E===0)if(R===me&&$+1<C&&y.charCodeAt($+1)===Oe){for($+=2;$+1<C&&(y.charCodeAt($)!==Oe||y.charCodeAt($+1)!==me);)$++;$+=2}else if(R===40&&$>=3&&(32|y.charCodeAt($-1))==108&&(32|y.charCodeAt($-2))==114&&(32|y.charCodeAt($-3))==117)A=1,$++;else if(A>0)R===41?A--:R===40&&A++,$++;else if(R===Oe&&$+1<C&&y.charCodeAt($+1)===me)$>b&&P.push(y.substring(b,$)),b=$+=2;else if(R===me&&$+1<C&&y.charCodeAt($+1)===me){for($>b&&P.push(y.substring(b,$));$<C&&y.charCodeAt($)!==10;)$++;b=$}else $++;else $++;else E===0?E=R:E===R&&(E=0),$++}return b===0?y:(b<C&&P.push(y.substring(b)),P.join(""))})(v)),g=os(h||m?"".concat(h," ").concat(m," { ").concat(k," }"):k);return a.namespace&&(g=Ei(g,a.namespace)),f=[],mt(g,d),f};return p.hash=u.length?u.reduce(function(v,m){return m.name||Ot(15),Se(v,m.name)},5381).toString():"",p}var Ys=new Pi,qs=Ws(),ji=ze.createContext({shouldForwardProp:void 0,styleSheet:Ys,stylis:qs});ji.Consumer;ze.createContext(void 0);function fr(){return ze.useContext(ji)}var Ri=ze.createContext(void 0);Ri.Consumer;var Gt={};function Ks(e,t,n){var r=kn(e),i=e,o=!Ft(e),a=t.attrs,s=a===void 0?wn:a,u=t.componentId,c=u===void 0?(function(y,C){var P=typeof y!="string"?"sc":nr(y);Gt[P]=(Gt[P]||0)+1;var b="".concat(P,"-").concat(ys(St+P+Gt[P]));return C?"".concat(C,"-").concat(b):b})(t.displayName,t.parentComponentId):u,l=t.displayName,f=l===void 0?(function(y){return Ft(y)?"styled.".concat(y):"Styled(".concat(gs(y),")")})(e):l,d=t.displayName&&t.componentId?"".concat(nr(t.displayName),"-").concat(t.componentId):t.componentId||c,p=r&&i.attrs?i.attrs.concat(s).filter(Boolean):s,v=t.shouldForwardProp;if(r&&i.shouldForwardProp){var m=i.shouldForwardProp;if(t.shouldForwardProp){var h=t.shouldForwardProp;v=function(y,C){return m(y,C)&&h(y,C)}}else v=m}var O=new Gs(n,d,r?i.componentStyle:void 0);function k(y,C){return(function(P,b,$){var E=P.attrs,A=P.componentStyle,R=P.defaultProps,G=P.foldedComponentIds,V=P.styledComponentId,I=P.target,_=ze.useContext(Ri),N=fr(),S=P.shouldForwardProp||N.shouldForwardProp,F=ps(b,_,R)||Te,B=(function(xe,se,tt){for(var Fe,pe=oe(oe({},se),{className:void 0,theme:tt}),Ct=0;Ct<xe.length;Ct+=1){var nt=Le(Fe=xe[Ct])?Fe(pe):Fe;for(var be in nt)be==="className"?pe.className=Ce(pe.className,nt[be]):be==="style"?pe.style=oe(oe({},pe.style),nt[be]):be in se&&se[be]===void 0||(pe[be]=nt[be])}return"className"in se&&typeof se.className=="string"&&(pe.className=Ce(pe.className,se.className)),pe})(E,b,F),W=B.as||I,ne={};for(var X in B)B[X]===void 0||X[0]==="$"||X==="as"||X==="theme"&&B.theme===F||(X==="forwardedAs"?ne.as=B.forwardedAs:S&&!S(X,W)||(ne[X]=B[X]));var Qe=(function(xe,se){var tt=fr(),Fe=xe.generateAndInjectStyles(se,tt.styleSheet,tt.stylis);return Fe})(A,B),et=Qe.className,Re=Ce(G,V);return et&&(Re+=" "+et),B.className&&(Re+=" "+B.className),ne[Ft(W)&&!gi.has(W)?"class":"className"]=Re,$&&(ne.ref=$),w.createElement(W,ne)})(g,y,C)}k.displayName=f;var g=ze.forwardRef(k);return g.attrs=p,g.componentStyle=O,g.displayName=f,g.shouldForwardProp=v,g.foldedComponentIds=r?Ce(i.foldedComponentIds,i.styledComponentId):"",g.styledComponentId=d,g.target=r?i.target:e,Object.defineProperty(g,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(y){this._foldedDefaultProps=r?(function(C){for(var P=[],b=1;b<arguments.length;b++)P[b-1]=arguments[b];for(var $=0,E=P;$<E.length;$++)tn(C,E[$],!0);return C})({},i.defaultProps,y):y}}),Oi(g,function(){return".".concat(g.styledComponentId)}),o&&Si(g,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),g}function pr(e,t){for(var n=[e[0]],r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}var hr=function(e){return Object.assign(e,{isCss:!0})};function xn(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Le(e)||Xe(e))return hr(Pe(pr(wn,vt([e],t,!0))));var r=e;return t.length===0&&r.length===1&&typeof r[0]=="string"?Pe(r):hr(Pe(pr(r,t)))}function rn(e,t,n){if(n===void 0&&(n=Te),!t)throw Ot(1,t);var r=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return e(t,n,xn.apply(void 0,vt([i],o,!1)))};return r.attrs=function(i){return rn(e,t,oe(oe({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},r.withConfig=function(i){return rn(e,t,oe(oe({},n),i))},r}var Ai=function(e){return rn(Ks,e)},Q=Ai;gi.forEach(function(e){Q[e]=Ai(e)});function _e(){return _e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_e.apply(null,arguments)}function Zs(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Sn(e,t){if(e==null)return{};var n,r,i=Zs(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}/*!
|
|
52
|
-
* rete-react-plugin v2.0.7
|
|
53
|
-
* (c) 2025 Vitaliy Stoliarov
|
|
54
|
-
* Released under the MIT license.
|
|
55
|
-
* */function Us(e){var t=e==null?void 0:e.createRoot,n=new WeakMap;function r(a){var s=n.get(a);if(s)return s;var u=document.createElement("span");return a.appendChild(u),n.set(a,u),u}function i(a){var s=n.get(a);s&&(s.remove(),n.delete(a))}if(t){var o=new WeakMap;return{mount:function(s,u){var c,l=r(u),f=o.get(l);return f||(f=t(l),o.set(l,f)),f.render(s),(c=l.firstElementChild)!==null&&c!==void 0?c:l},unmount:function(s){var u=r(s),c=o.get(u);c&&(c.unmount(),o.delete(u)),i(s)}}}return{mount:function(s,u){var c=r(u);if("render"in Cn&&typeof He.render=="function"){var l=He.render(s,c);return l||c}throw new Error("ReactDOM.render is not available")},unmount:function(s){var u=r(s);if("unmountComponentAtNode"in Cn&&typeof He.unmountComponentAtNode=="function")He.unmountComponentAtNode(u);else throw new Error("ReactDOM.unmountComponentAtNode is not available");i(s)}}}function Xs(e){var t=e.children,n=e.rendered;return w.useEffect(function(){n()}),t}function Js(){var e=w.useRef(!1);return w.useEffect(function(){e.current=!0},[]),{apply:function(n){e.current?queueMicrotask(function(){He.flushSync(n)}):n()}}}var Ii=w.createContext({start:null,end:null,path:null});function Qs(e){var t=e.children,n=w.useState(null),r=ee(n,2),i=r[0],o=r[1],a=w.useState(null),s=ee(a,2),u=s[0],c=s[1],l=w.useState(null),f=ee(l,2),d=f[0],p=f[1],v="x"in e.start?e.start:i,m="x"in e.end?e.end:u,h=Js();return w.useEffect(function(){var O=typeof e.start=="function"&&e.start(function(g){h.apply(function(){o(g)})}),k=typeof e.end=="function"&&e.end(function(g){h.apply(function(){c(g)})});return function(){O&&O(),k&&k()}},[]),w.useEffect(function(){v&&m&&e.path(v,m).then(function(O){h.apply(function(){p(O)})})},[v,m]),w.createElement(Ii.Provider,{value:{start:v,end:m,path:d}},t)}function Ni(){return w.useContext(Ii)}var vr,mr,eu=Q.svg(vr||(vr=U([`
|
|
56
|
-
overflow: visible !important;
|
|
57
|
-
position: absolute;
|
|
58
|
-
pointer-events: none;
|
|
59
|
-
width: 9999px;
|
|
60
|
-
height: 9999px;
|
|
61
|
-
`]))),tu=Q.path(mr||(mr=U([`
|
|
62
|
-
fill: none;
|
|
63
|
-
stroke-width: 5px;
|
|
64
|
-
stroke: steelblue;
|
|
65
|
-
pointer-events: auto;
|
|
66
|
-
`,`
|
|
67
|
-
`])),function(e){var t;return(t=e.styles)===null||t===void 0?void 0:t.call(e,e)});function zi(e){var t=Ni(),n=t.path;return n?w.createElement(eu,{"data-testid":"connection"},w.createElement(tu,{styles:e.styles,d:n})):null}function nu(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ru(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
68
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function ru(e,t){if(e){if(typeof e=="string")return yr(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yr(e,t):void 0}}function yr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iu(e){for(var t=new e.constructor(e.type),n=t;n=Object.getPrototypeOf(n);){var r=Object.getOwnPropertyNames(n),i=nu(r),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,s=t[a];typeof s!="function"&&Object.defineProperty(t,a,{value:e[a]})}}catch(u){i.e(u)}finally{i.f()}}return t}var ou="__reactContainer$";function au(e){for(var t=e;t;){if(t._reactRootContainer||Object.keys(t).some(function(n){return n.startsWith(ou)}))return t;t=t.parentElement}}function gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gr(Object(n),!0).forEach(function(r){j(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Di(e,t){return{start:function(r){var i=br({},t(r));function o(s){var u=br({},t(s)),c=u.x-i.x,l=u.y-i.y;i=u,e(c,l)}function a(){window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a)}window.addEventListener("pointermove",o),window.addEventListener("pointerup",a),window.addEventListener("pointercancel",a)}}}function su(e,t){w.useEffect(function(){var n=function(o){if(!t){var a=au(o.target),s=w.version.startsWith("16")?document:a;s&&(o.stopPropagation(),s.dispatchEvent(iu(o)))}},r=e.current;return r==null||r.addEventListener("pointerdown",n),function(){r==null||r.removeEventListener("pointerdown",n)}},[e,t])}var wr,uu=Q.input(wr||(wr=U([`
|
|
69
|
-
width: 100%;
|
|
70
|
-
border-radius: 30px;
|
|
71
|
-
background-color: white;
|
|
72
|
-
padding: 2px 6px;
|
|
73
|
-
border: 1px solid #999;
|
|
74
|
-
font-size: 110%;
|
|
75
|
-
box-sizing: border-box;
|
|
76
|
-
`,`
|
|
77
|
-
`])),function(e){var t;return(t=e.styles)===null||t===void 0?void 0:t.call(e,e)});function on(e){var t=w.useState(e.data.value),n=ee(t,2),r=n[0],i=n[1],o=w.useRef(null);return su(o),w.useEffect(function(){i(e.data.value)},[e.data.value]),w.createElement(uu,{value:r,type:e.data.type,ref:o,readOnly:e.data.readonly,onChange:function(s){var u=e.data.type==="number"?+s.target.value:s.target.value;i(u),e.data.setValue(u)},styles:e.styles})}var an="rgba(110,136,255,0.8)",Mi="#ffd92c",le=24,ye=6,Ti="#96b38a",Li=180,cu=Object.freeze({__proto__:null,$nodecolor:an,$nodecolorselected:Mi,$socketsize:le,$socketmargin:ye,$socketcolor:Ti,$nodewidth:Li}),lu=["init","unmount"];function Bi(e){var t=e.init,n=e.unmount,r=Sn(e,lu),i=w.useRef(null);return w.useEffect(function(){var o=i.current;return function(){o&&n(o)}},[]),w.useEffect(function(){i.current&&t(i.current)}),w.createElement("span",_e({},r,{ref:i}))}var du=["name","emit","payload"];function sn(e){var t=e.name,n=e.emit,r=e.payload,i=Sn(e,du);return w.createElement(Bi,_e({},i,{className:t,init:function(a){n({type:"render",data:{type:"control",element:a,payload:r}})},unmount:function(a){n({type:"unmount",data:{element:a}})}}))}var fu=["name","emit","nodeId","side","socketKey","payload"];function un(e){var t=e.name,n=e.emit,r=e.nodeId,i=e.side,o=e.socketKey,a=e.payload,s=Sn(e,fu);return w.createElement(Bi,_e({},s,{className:t,init:function(c){n({type:"render",data:{type:"socket",side:i,key:o,nodeId:r,element:c,payload:a}})},unmount:function(c){n({type:"unmount",data:{element:c}})}}))}var kr,xr,Fi=Q.div(kr||(kr=U([`
|
|
78
|
-
background: `,`;
|
|
79
|
-
border: 2px solid #4e58bf;
|
|
80
|
-
border-radius: 10px;
|
|
81
|
-
cursor: pointer;
|
|
82
|
-
box-sizing: border-box;
|
|
83
|
-
width: `,`;
|
|
84
|
-
height: `,`;
|
|
85
|
-
padding-bottom: 6px;
|
|
86
|
-
position: relative;
|
|
87
|
-
user-select: none;
|
|
88
|
-
line-height: initial;
|
|
89
|
-
font-family: Arial;
|
|
90
|
-
|
|
91
|
-
&:hover {
|
|
92
|
-
background: lighten(`,`,4%);
|
|
93
|
-
}
|
|
94
|
-
`,`
|
|
95
|
-
.title {
|
|
96
|
-
color: white;
|
|
97
|
-
font-family: sans-serif;
|
|
98
|
-
font-size: 18px;
|
|
99
|
-
padding: 8px;
|
|
100
|
-
}
|
|
101
|
-
.output {
|
|
102
|
-
text-align: right;
|
|
103
|
-
}
|
|
104
|
-
.input {
|
|
105
|
-
text-align: left;
|
|
106
|
-
}
|
|
107
|
-
.output-socket {
|
|
108
|
-
text-align: right;
|
|
109
|
-
margin-right: -`,`px;
|
|
110
|
-
display: inline-block;
|
|
111
|
-
}
|
|
112
|
-
.input-socket {
|
|
113
|
-
text-align: left;
|
|
114
|
-
margin-left: -`,`px;
|
|
115
|
-
display: inline-block;
|
|
116
|
-
}
|
|
117
|
-
.input-title,.output-title {
|
|
118
|
-
vertical-align: middle;
|
|
119
|
-
color: white;
|
|
120
|
-
display: inline-block;
|
|
121
|
-
font-family: sans-serif;
|
|
122
|
-
font-size: 14px;
|
|
123
|
-
margin: `,`px;
|
|
124
|
-
line-height: `,`px;
|
|
125
|
-
}
|
|
126
|
-
.input-control {
|
|
127
|
-
z-index: 1;
|
|
128
|
-
width: calc(100% - `,`px);
|
|
129
|
-
vertical-align: middle;
|
|
130
|
-
display: inline-block;
|
|
131
|
-
}
|
|
132
|
-
.control {
|
|
133
|
-
display: block;
|
|
134
|
-
padding: `,"px ",`px;
|
|
135
|
-
}
|
|
136
|
-
`,`
|
|
137
|
-
`])),an,function(e){return Number.isFinite(e.width)?"".concat(e.width,"px"):"".concat(Li,"px")},function(e){return Number.isFinite(e.height)?"".concat(e.height,"px"):"auto"},an,function(e){return e.selected&&xn(xr||(xr=U([`
|
|
138
|
-
background: `,`;
|
|
139
|
-
border-color: #e3c000;
|
|
140
|
-
`])),Mi)},le/2+ye,le/2+ye,ye,le,le+2*ye,ye,le/2+ye,function(e){var t;return(t=e.styles)===null||t===void 0?void 0:t.call(e,e)});function Vt(e){e.sort(function(t,n){var r,i,o=((r=t[1])===null||r===void 0?void 0:r.index)||0,a=((i=n[1])===null||i===void 0?void 0:i.index)||0;return o-a})}function Hi(e){var t=Object.entries(e.data.inputs),n=Object.entries(e.data.outputs),r=Object.entries(e.data.controls),i=e.data.selected||!1,o=e.data,a=o.id,s=o.label,u=o.width,c=o.height;return Vt(t),Vt(n),Vt(r),w.createElement(Fi,{selected:i,width:u,height:c,styles:e.styles,"data-testid":"node"},w.createElement("div",{className:"title","data-testid":"title"},s),n.map(function(l){var f=ee(l,2),d=f[0],p=f[1];return p&&w.createElement("div",{className:"output",key:d,"data-testid":"output-".concat(d)},w.createElement("div",{className:"output-title","data-testid":"output-title"},p.label),w.createElement(un,{name:"output-socket",side:"output",socketKey:d,nodeId:a,emit:e.emit,payload:p.socket,"data-testid":"output-socket"}))}),r.map(function(l){var f=ee(l,2),d=f[0],p=f[1];return p?w.createElement(sn,{key:d,name:"control",emit:e.emit,payload:p,"data-testid":"control-".concat(d)}):null}),t.map(function(l){var f=ee(l,2),d=f[0],p=f[1];return p&&w.createElement("div",{className:"input",key:d,"data-testid":"input-".concat(d)},w.createElement(un,{name:"input-socket",side:"input",socketKey:d,nodeId:a,emit:e.emit,payload:p.socket,"data-testid":"input-socket"}),p&&(!p.control||!p.showControl)&&w.createElement("div",{className:"input-title","data-testid":"input-title"},p.label),p.control&&p.showControl&&w.createElement(sn,{key:d,name:"input-control",emit:e.emit,payload:p.control,"data-testid":"input-control"}))}))}var Sr,Or,Gi=Q.div(Sr||(Sr=U([`
|
|
141
|
-
display: inline-block;
|
|
142
|
-
cursor: pointer;
|
|
143
|
-
border: 1px solid white;
|
|
144
|
-
border-radius: `,`px;
|
|
145
|
-
width: `,`px;
|
|
146
|
-
height: `,`px;
|
|
147
|
-
vertical-align: middle;
|
|
148
|
-
background: `,`;
|
|
149
|
-
z-index: 2;
|
|
150
|
-
box-sizing: border-box;
|
|
151
|
-
&:hover {
|
|
152
|
-
border-width: 4px;
|
|
153
|
-
}
|
|
154
|
-
&.multiple {
|
|
155
|
-
border-color: yellow;
|
|
156
|
-
}
|
|
157
|
-
`])),le/2,le,le,Ti),pu=Q.div(Or||(Or=U([`
|
|
158
|
-
border-radius: `,`px;
|
|
159
|
-
padding: `,`px;
|
|
160
|
-
&:hover `,` {
|
|
161
|
-
border-width: 4px;
|
|
162
|
-
}
|
|
163
|
-
`])),(le+ye*2)/2,ye,Gi);function Vi(e){return w.createElement(pu,null,w.createElement(Gi,{title:e.data.name}))}function hu(e){var t=typeof(e==null?void 0:e.socketPositionWatcher)>"u"?Va():e.socketPositionWatcher,n=(e==null?void 0:e.customize)||{},r=n.node,i=n.connection,o=n.socket,a=n.control;return{attach:function(u){t.attach(u)},render:function(u,c){if(u.data.type==="node"){var l=c.parentScope(),f=r?r(u.data):Hi;return f&&w.createElement(f,{data:u.data.payload,emit:function(C){return void l.emit(C)}})}else if(u.data.type==="connection"){var d=i?i(u.data):zi,p=u.data.payload,v=p.sourceOutput,m=p.targetInput,h=p.source,O=p.target;return d&&w.createElement(Qs,{start:u.data.start||function(y){return t.listen(h,"output",v,y)},end:u.data.end||function(y){return t.listen(O,"input",m,y)},path:(function(){var y=M(x.mark(function C(P,b){var $,E,A,R,G;return x.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=1,c.emit({type:"connectionpath",data:{payload:p,points:[P,b]}});case 1:if($=V.sent,$){V.next=2;break}return V.abrupt("return","");case 2:if(E=$.data,A=E.path,R=E.points,G=.3,!(!A&&R.length!==2)){V.next=3;break}throw new Error("cannot render connection with a custom number of points");case 3:if(A){V.next=4;break}return V.abrupt("return",p.isLoop?Ma(R,G,120):Da(R,G));case 4:return V.abrupt("return",A);case 5:case"end":return V.stop()}},C)}));return function(C,P){return y.apply(this,arguments)}})()},w.createElement(d,{data:u.data.payload}))}else if(u.data.type==="socket"){var k=o?o(u.data):Vi;return k&&u.data.payload&&w.createElement(k,{data:u.data.payload})}else if(u.data.type==="control"){var g=a&&u.data.payload?a(u.data):u.data.payload instanceof Ne.InputControl?on:null;return g&&w.createElement(g,{data:u.data.payload})}}}}var vu=Object.freeze({__proto__:null,vars:cu,setup:hu,Connection:zi,useConnection:Ni,Control:on,InputControl:on,Node:Hi,NodeStyles:Fi,RefControl:sn,RefSocket:un,Socket:Vi});function Wi(e,t){var n=w.useRef(void 0);function r(){n.current&&clearTimeout(n.current)}var i=function(){r(),n.current=setTimeout(function(){e()},t)};return w.useEffect(function(){return r},[]),[i,r]}var mu="rgba(110,136,255,0.8)",yu="rgba(130, 153, 255, 0.8)",gu="rgba(69, 103, 255, 0.8)",at="5px",cn=120,Cr,On=Q.div(Cr||(Cr=U([`
|
|
164
|
-
color: #fff;
|
|
165
|
-
padding: 4px;
|
|
166
|
-
border-bottom: 1px solid `,`;
|
|
167
|
-
background-color: `,`;
|
|
168
|
-
cursor: pointer;
|
|
169
|
-
width: 100%;
|
|
170
|
-
position: relative;
|
|
171
|
-
&:first-child {
|
|
172
|
-
border-top-left-radius: `,`;
|
|
173
|
-
border-top-right-radius: `,`;
|
|
174
|
-
}
|
|
175
|
-
&:last-child {
|
|
176
|
-
border-bottom-left-radius: `,`;
|
|
177
|
-
border-bottom-right-radius: `,`;
|
|
178
|
-
}
|
|
179
|
-
&:hover {
|
|
180
|
-
background-color: `,`;
|
|
181
|
-
}
|
|
182
|
-
`])),gu,mu,at,at,at,at,yu),Pr,$r,_r,Yi=Q(On)(Pr||(Pr=U([`
|
|
183
|
-
`,`
|
|
184
|
-
`])),function(e){return e.hasSubitems&&xn($r||($r=U([`&:after {
|
|
185
|
-
content: '►';
|
|
186
|
-
position: absolute;
|
|
187
|
-
opacity: 0.6;
|
|
188
|
-
right: 5px;
|
|
189
|
-
top: 5px;
|
|
190
|
-
}`])))}),qi=Q.div(_r||(_r=U([`
|
|
191
|
-
position: absolute;
|
|
192
|
-
top: 0;
|
|
193
|
-
left: 100%;
|
|
194
|
-
width: `,`px;
|
|
195
|
-
`])),cn);function Ki(e){var t,n,r,i,o=w.useState(!1),a=ee(o,2),s=a[0],u=a[1],c=w.useCallback(function(){u(!1)},[u]),l=Wi(c,e.delay),f=ee(l,2),d=f[0],p=f[1],v=((t=e.components)===null||t===void 0||(n=t.item)===null||n===void 0?void 0:n.call(t,e.data))||Yi,m=((r=e.components)===null||r===void 0||(i=r.subitems)===null||i===void 0?void 0:i.call(r,e.data))||qi;return w.createElement(v,{onClick:function(O){O.stopPropagation(),e.data.handler(),e.hide()},hasSubitems:!!e.data.subitems,onPointerDown:function(O){O.stopPropagation()},onPointerOver:function(){p(),u(!0)},onPointerLeave:function(){d&&d()},"data-testid":"context-menu-item"},e.children,e.data.subitems&&s&&w.createElement(m,null,e.data.subitems.map(function(h){return w.createElement(Ki,{key:h.key,data:h,delay:e.delay,hide:e.hide,components:e.components},h.label)})))}var Er,Zi=Q.input(Er||(Er=U([`
|
|
196
|
-
color: white;
|
|
197
|
-
padding: 1px 8px;
|
|
198
|
-
border: 1px solid white;
|
|
199
|
-
border-radius: 10px;
|
|
200
|
-
font-size: 16px;
|
|
201
|
-
font-family: serif;
|
|
202
|
-
width: 100%;
|
|
203
|
-
box-sizing: border-box;
|
|
204
|
-
background: transparent;
|
|
205
|
-
`])));function bu(e){var t=e.component||Zi;return w.createElement(t,{value:e.value,onInput:function(r){e.onChange(r.target.value)},onPointerDown:function(r){r.stopPropagation()},"data-testid":"context-menu-search-input"})}var jr,Ui=Q.div(jr||(jr=U([`
|
|
206
|
-
padding: 10px;
|
|
207
|
-
width: `,`px;
|
|
208
|
-
margin-top: -20px;
|
|
209
|
-
margin-left: -`,`px;
|
|
210
|
-
`])),cn,cn/2);function wu(e){var t,n,r,i,o,a,s=Wi(e.onHide,e.delay),u=ee(s,2),c=u[0],l=u[1],f=w.useState(""),d=ee(f,2),p=d[0],v=d[1],m=new RegExp(p,"i"),h=e.items.filter(function(g){return g.label.match(m)}),O=((t=e.components)===null||t===void 0||(n=t.main)===null||n===void 0?void 0:n.call(t))||Ui,k=((r=e.components)===null||r===void 0||(i=r.common)===null||i===void 0?void 0:i.call(r))||On;return w.createElement(O,{onMouseOver:function(){l()},onMouseLeave:function(){c==null||c()},onWheel:function(y){y.stopPropagation()},"data-testid":"context-menu"},e.searchBar&&w.createElement(k,null,w.createElement(bu,{value:p,onChange:v,component:(o=e.components)===null||o===void 0||(a=o.search)===null||a===void 0?void 0:a.call(o)})),h.map(function(g){return w.createElement(Ki,{key:g.key,data:g,delay:e.delay,hide:e.onHide,components:e.components},g.label)}))}function ku(e){var t=typeof(e==null?void 0:e.delay)>"u"?1e3:e.delay;return{render:function(r){if(r.data.type==="contextmenu")return w.createElement(wu,{items:r.data.items,delay:t,searchBar:r.data.searchBar,onHide:r.data.onHide,components:e==null?void 0:e.customize})}}}var xu=Object.freeze({__proto__:null,setup:ku,Item:Yi,Subitems:qi,Menu:Ui,Search:Zi,Common:On}),st=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Su=typeof st=="object"&&st&&st.Object===Object&&st,Ou=typeof self=="object"&&self&&self.Object===Object&&self;Su||Ou||Function("return this")();function Cu(){const e=w.useRef(!1);return w.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),w.useCallback(()=>e.current,[])}var Rr={width:void 0,height:void 0};function Pu(e){const{ref:t,box:n="content-box"}=e,[{width:r,height:i},o]=w.useState(Rr),a=Cu(),s=w.useRef({...Rr}),u=w.useRef(void 0);return u.current=e.onResize,w.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const c=new ResizeObserver(([l])=>{const f=n==="border-box"?"borderBoxSize":n==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",d=Ar(l,f,"inlineSize"),p=Ar(l,f,"blockSize");if(s.current.width!==d||s.current.height!==p){const m={width:d,height:p};s.current.width=d,s.current.height=p,u.current?u.current(m):a()&&o(m)}});return c.observe(t.current,{box:n}),()=>{c.disconnect()}},[n,t,a]),{width:r,height:i}}function Ar(e,t,n){return e[t]?Array.isArray(e[t])?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function fe(e){return"".concat(e,"px")}var Ir,$u=Q.div(Ir||(Ir=U([`
|
|
211
|
-
position: absolute;
|
|
212
|
-
background: rgba(110, 136, 255, 0.8);
|
|
213
|
-
border: 1px solid rgb(192 206 212 / 60%);
|
|
214
|
-
`])));function _u(e){return w.createElement($u,{style:{left:fe(e.left),top:fe(e.top),width:fe(e.width),height:fe(e.height)},"data-testid":"minimap-node"})}var Nr,Eu=Q.div(Nr||(Nr=U([`
|
|
215
|
-
position: absolute;
|
|
216
|
-
background: rgba(255, 251, 128, 0.32);
|
|
217
|
-
border: 1px solid #ffe52b;
|
|
218
|
-
`])));function ju(e){var t=function(o){return o*e.containerWidth},n=function(o){return o/e.containerWidth},r=Di(function(i,o){e.translate(n(-i),n(-o))},function(i){return{x:i.pageX,y:i.pageY}});return w.createElement(Eu,{onPointerDown:r.start,style:{left:fe(t(e.left)),top:fe(t(e.top)),width:fe(t(e.width)),height:fe(t(e.height))},"data-testid":"minimap-viewport"})}var zr,Ru=Q.div(zr||(zr=U([`
|
|
219
|
-
position: absolute;
|
|
220
|
-
right: 24px;
|
|
221
|
-
bottom: 24px;
|
|
222
|
-
background: rgba(229, 234, 239, 0.65);
|
|
223
|
-
padding: 20px;
|
|
224
|
-
overflow: hidden;
|
|
225
|
-
border: 1px solid #b1b7ff;
|
|
226
|
-
border-radius: 8px;
|
|
227
|
-
box-sizing: border-box;
|
|
228
|
-
`])));function Au(e){var t,n=w.useRef(null),r=Pu({ref:n}),i=r.width,o=i===void 0?0:i,a=((t=n.current)===null||t===void 0?void 0:t.clientWidth)||o,s=w.useCallback(function(u){return u*a},[a]);return w.createElement(Ru,{size:e.size,style:{width:fe(e.size*e.ratio),height:fe(e.size)},onPointerDown:function(c){c.stopPropagation(),c.preventDefault()},onDoubleClick:function(c){if(c.stopPropagation(),c.preventDefault(),!!n.current){var l=n.current.getBoundingClientRect(),f=(c.clientX-l.left)/(e.size*e.ratio),d=(c.clientY-l.top)/(e.size*e.ratio);e.point(f,d)}},ref:n,"data-testid":"minimap"},a?e.nodes.map(function(u,c){return w.createElement(_u,{key:c,left:s(u.left),top:s(u.top),width:s(u.width),height:s(u.height)})}):null,w.createElement(ju,_e({},e.viewport,{start:e.start,containerWidth:a,translate:e.translate})))}function Iu(e){return{render:function(n){if(n.data.type==="minimap")return w.createElement(Au,{nodes:n.data.nodes,size:(e==null?void 0:e.size)||200,ratio:n.data.ratio,viewport:n.data.viewport,start:n.data.start,translate:n.data.translate,point:n.data.point})}}}var Nu=Object.freeze({__proto__:null,setup:Iu}),Dr,Ke=20,zu=Q.div(Dr||(Dr=U([`
|
|
229
|
-
width: `,`px;
|
|
230
|
-
height: `,`px;
|
|
231
|
-
box-sizing: border-box;
|
|
232
|
-
background: `,`;
|
|
233
|
-
border: 2px solid white;
|
|
234
|
-
border-radius: `,`px;
|
|
235
|
-
`])),Ke,Ke,function(e){return e.selected?"#ffd92c":"steelblue"},Ke);function Du(e){var t=Di(function(o,a){e.translate(o,a)},e.pointer),n=e.position,r=n.x,i=n.y;return w.createElement(zu,{onPointerDown:function(a){a.stopPropagation(),a.preventDefault(),t.start(a),e.pointerdown()},onContextMenu:function(a){a.stopPropagation(),a.preventDefault(),e.contextMenu()},selected:e.selected,style:{position:"absolute",top:"".concat(i-Ke/2,"px"),left:"".concat(r-Ke/2,"px")},"data-testid":"pin"})}function Mu(e){function t(n,r){return w.createElement(w.Fragment,null,n.pins.map(function(i){return w.createElement(Du,_e({},i,{key:i.id,contextMenu:function(){var a;e==null||(a=e.contextMenu)===null||a===void 0||a.call(e,i.id)},translate:function(a,s){var u;e==null||(u=e.translate)===null||u===void 0||u.call(e,i.id,a,s)},pointerdown:function(){var a;e==null||(a=e.pointerdown)===null||a===void 0||a.call(e,i.id)},pointer:r}))}))}return{render:function(r,i){var o=r.data,a=i.parentScope(gt);if(o.type==="reroute-pins")return t(o.data,function(){return a.area.pointer})}}}var Tu=Object.freeze({__proto__:null,setup:Mu}),ht=Object.freeze({__proto__:null,classic:vu,contextMenu:xu,minimap:Nu,reroute:Tu});function Lu(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Bu(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
236
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function Bu(e,t){if(e){if(typeof e=="string")return Mr(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mr(e,t):void 0}}function Mr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Tr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ut(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tr(Object(n),!0).forEach(function(r){j(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fu(e,t,n){return t=q(t),ge(e,Xi()?Reflect.construct(t,n||[],q(e).constructor):t.apply(e,n))}function Xi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Xi=function(){return!!e})()}function Hu(e,t,n,r){var i=Ze(q(e.prototype),t,n);return typeof i=="function"?function(o){return i.apply(n,o)}:i}var Gu=(function(e){function t(){for(var n,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=i[0];return T(this,t),n=Fu(this,t,["react-render"]),j(n,"presets",[]),n.renderer=Us({createRoot:a==null?void 0:a.createRoot}),n.addPipe(function(s){if(!s||te(s)!=="object"||!("type"in s))return s;if(s.type==="unmount")n.unmount(s.data.element);else if(s.type==="render"){if("filled"in s.data&&s.data.filled)return s;if(n.mount(s.data.element,s))return ut(ut({},s),{},{data:ut(ut({},s.data),{},{filled:!0})})}return s}),n}return ie(t,e),L(t,[{key:"setParent",value:function(r){var i=this;Hu(t,"setParent",this)([r]),this.presets.forEach(function(o){o.attach&&o.attach(i)})}},{key:"mount",value:function(r,i){var o=this.parentScope(),a=Lu(this.presets),s;try{for(a.s();!(s=a.n()).done;){var u=s.value,c=u.render(i,this);if(c){var l=w.createElement(Xs,{rendered:function(){return void o.emit({type:"rendered",data:i.data})}},c);return this.renderer.mount(l,r),!0}}}catch(f){a.e(f)}finally{a.f()}}},{key:"unmount",value:function(r){this.renderer.unmount(r)}},{key:"addPreset",value:function(r){var i=r;i.attach&&i.attach(this),this.presets.push(i)}}])})(Je);const Lr=new Ne.Socket("rel"),Ji=240,Vu=48,Wu=74,Yu=280,Wt=24,ln="#9ca3af",Ie="#3b82f6",We="#f97316";class qu extends Ne.Node{constructor(n,r,i,o,a){super(n);J(this,"width",Ji);J(this,"height",Vu);J(this,"isSource");J(this,"dmId");J(this,"depth");J(this,"targetAlias");J(this,"fieldCount");J(this,"description");J(this,"onOpenExternal");J(this,"isDraft");J(this,"isBlocked");J(this,"isJoinNotConfigured");J(this,"isCycleStub");J(this,"highlighted",!1);J(this,"dimmed",!1);this.dmId=r,this.isSource=i,this.depth=o,this.targetAlias=a==null?void 0:a.targetAlias,this.fieldCount=a==null?void 0:a.fieldCount,this.description=a==null?void 0:a.description,this.onOpenExternal=a==null?void 0:a.onOpenExternal,this.isDraft=(a==null?void 0:a.isDraft)??!1,this.isBlocked=(a==null?void 0:a.isBlocked)??!1,this.isJoinNotConfigured=(a==null?void 0:a.isJoinNotConfigured)??!1,this.isCycleStub=(a==null?void 0:a.isCycleStub)??!1,i||(this.height=Wu)}}const{RefSocket:Yt}=ht.classic;function Ku(e){const t=e.data;function n(s){var u;s.stopPropagation(),s.preventDefault(),(u=t.onOpenExternal)==null||u.call(t)}const r=Object.entries(t.outputs),i=Object.entries(t.inputs);if(t.isSource)return D.jsxs("div",{className:"text-primary flex items-center",style:{width:t.width,height:t.height,borderRadius:8,border:`2px solid ${t.highlighted?Ie:t.isDraft?We:ln}`,boxShadow:t.highlighted?`0 0 0 3px ${Ie}40, 0 0 12px ${Ie}60`:"0 1px 4px 0 rgba(0,0,0,0.12)",background:"#eff6ff",fontSize:13,fontWeight:600,position:"relative",opacity:t.dimmed?.15:1,filter:t.dimmed?"grayscale(0.8)":void 0,animation:t.highlighted?"node-pulse 1.5s ease-in-out infinite":void 0,transition:"opacity 0.2s, filter 0.2s"},children:[t.isDraft&&D.jsx("span",{style:{position:"absolute",top:-18,right:4,fontSize:10,fontWeight:600,color:We,lineHeight:1},children:"Draft"}),D.jsx("div",{className:"truncate",style:{flex:1,padding:"0 14px"},title:t.label,children:t.label}),r.map(([s,u])=>u&&D.jsx("div",{style:{position:"absolute",right:-5,top:"50%",marginTop:-5},children:D.jsx(Yt,{name:"output-socket",side:"output",socketKey:s,nodeId:t.id,emit:e.emit,payload:u.socket})},s))]});const o=io(t)?We:ln,a=oo(t);return D.jsxs("div",{title:t.isCycleStub?ao:void 0,style:{width:t.width,height:t.height,borderRadius:8,border:`2px solid ${t.highlighted?Ie:o}`,background:"var(--background)",boxShadow:t.highlighted?`0 0 0 3px ${Ie}40, 0 0 12px ${Ie}60`:"0 1px 4px 0 rgba(0,0,0,0.12)",cursor:"default",position:"relative",opacity:t.dimmed?.15:1,filter:t.dimmed?"grayscale(0.8)":void 0,animation:t.highlighted?"node-pulse 1.5s ease-in-out infinite":void 0,transition:"opacity 0.2s, filter 0.2s"},children:[a&&D.jsx("span",{style:{position:"absolute",top:-18,right:4,fontSize:10,fontWeight:600,color:We,lineHeight:1,whiteSpace:"nowrap"},children:a}),i.map(([s,u])=>u&&D.jsx("div",{style:{position:"absolute",left:-5,top:"50%",marginTop:-5,zIndex:1},children:D.jsx(Yt,{name:"input-socket",side:"input",socketKey:s,nodeId:t.id,emit:e.emit,payload:u.socket})},s)),D.jsxs("div",{className:"bg-muted flex items-center justify-between",style:{padding:"8px 10px 8px 14px",fontSize:13,fontWeight:600,borderRadius:"6px 6px 0 0"},children:[D.jsx("span",{className:"truncate",title:t.label,children:t.label}),D.jsxs("div",{className:"ml-2 flex shrink-0 items-center gap-0.5",children:[t.description&&D.jsx("span",{className:"text-muted-foreground hover:text-foreground inline-flex cursor-default rounded p-0.5 transition-colors",title:t.description,children:D.jsx(so,{style:{width:14,height:14}})}),D.jsx("button",{className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-0.5 transition-colors",onPointerDown:s=>{s.stopPropagation()},onClick:n,title:"Open in new tab","aria-label":"Open in new tab",children:D.jsx(uo,{style:{width:14,height:14}})})]})]}),D.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",style:{padding:"6px 14px 8px",fontSize:11,minWidth:0},children:[t.targetAlias&&D.jsx(co,{variant:"secondary",className:"inline-block max-w-[120px] truncate px-1.5 py-0 text-[10px]",title:t.targetAlias,children:t.targetAlias}),D.jsxs("span",{className:"ml-auto shrink-0",children:[t.fieldCount??0," field",t.fieldCount!==1?"s":""]})]}),r.map(([s,u])=>u&&D.jsx("div",{style:{position:"absolute",right:-5,top:"50%",marginTop:-5,zIndex:1},children:D.jsx(Yt,{name:"output-socket",side:"output",socketKey:s,nodeId:t.id,emit:e.emit,payload:u.socket})},s))]})}function Zu(){return D.jsx("div",{style:{width:10,height:10,borderRadius:"50%",background:ln,border:"2px solid var(--background)"}})}async function Uu(e,t,n,r,i,o,a,s,u){const c=new Ee,l=new ni(e),f=new ja,d=new Gu({createRoot:ro.createRoot}),p=new za,{useConnection:v}=ht.classic;function m(I){const{path:_}=v();if(!_)return null;const N=c.getNode(I.data.source),S=c.getNode(I.data.target),F=(N==null?void 0:N.isDraft)===!0||(N==null?void 0:N.isBlocked)===!0||(N==null?void 0:N.isJoinNotConfigured)===!0||(N==null?void 0:N.isCycleStub)===!0||(S==null?void 0:S.isDraft)===!0||(S==null?void 0:S.isBlocked)===!0||(S==null?void 0:S.isJoinNotConfigured)===!0||(S==null?void 0:S.isCycleStub)===!0,B=((N==null?void 0:N.dimmed)===!0||N===void 0)&&((S==null?void 0:S.dimmed)===!0||S===void 0);return D.jsx("svg",{"data-testid":"connection",style:{overflow:"visible",position:"absolute",pointerEvents:"none",width:9999,height:9999},children:D.jsx("path",{d:_,fill:"none",strokeWidth:"5px",stroke:F?We:"steelblue",strokeDasharray:F?"8 4":void 0,opacity:B?.15:1,style:{pointerEvents:"auto",transition:"opacity 0.2s"}})})}d.addPreset(ht.classic.setup({customize:{node(){return Ku},socket(){return Zu},connection(){return m}}})),d.addPreset(ht.minimap.setup()),f.addPreset(Ca.classic.setup()),c.use(l),l.use(f),l.use(d),l.use(p);const h=new Map,O=[],k=new Set,g=i==="DRAFT";h.set(t,{id:t,dmId:t,title:n,description:r,depth:0,isSource:!0,isDraft:g});let y=0;async function C(I,_,N,S,F){_.length>0&&k.add(I);for(const B of _){const W=B.targetDataMart.id,ne=`${W}-${y++}`,X=B.targetDataMart.status==="DRAFT",Qe=B.joinConditions.length===0,et=F,Re=S.has(W);if(O.push({sourceId:I,targetId:ne}),h.set(ne,{id:ne,dmId:W,title:B.targetDataMart.title,description:B.targetDataMart.description,depth:N,isSource:!1,targetAlias:B.targetAlias,fieldCount:(a==null?void 0:a.get(B.id))??0,isDraft:X,isBlocked:et,isJoinNotConfigured:Qe,isCycleStub:Re}),u&&!Re)try{const xe=await lo.getRelationships(W,{skipLoadingIndicator:!0});if(xe.length>0){const se=new Set(S);se.add(W),await C(ne,xe,N+1,se,F||X||Qe)}}catch{}}}await C(t,o,1,new Set([t]),g);const P=new Map,b=new Map;for(const[I,_]of h){const N=new qu(_.title,_.dmId,_.isSource,_.depth,{targetAlias:_.targetAlias,fieldCount:_.fieldCount,description:_.description,isDraft:_.isDraft,isBlocked:_.isBlocked,isJoinNotConfigured:_.isJoinNotConfigured,isCycleStub:_.isCycleStub,onOpenExternal:()=>{s(_.dmId)}});k.has(I)&&!_.isCycleStub&&N.addOutput("out",new Ne.Output(Lr)),_.isSource||N.addInput("in",new Ne.Input(Lr)),await c.addNode(N),P.set(I,N);const S=b.get(_.depth)??[];b.has(_.depth)||b.set(_.depth,S),S.push(N)}for(const I of O){const _=P.get(I.sourceId),N=P.get(I.targetId);_&&N&&await c.addConnection(new Ne.Connection(_,"out",N,"in"))}const $=Math.max(...Array.from(b.keys()));for(let I=0;I<=$;I++){const _=b.get(I)??[];let N=0;for(const S of _)await l.translate(S.id,{x:I*(Ji+Yu),y:N}),N+=S.height+Wt;if(I===0&&_.length===1){const F=(b.get(1)??[]).reduce((B,W)=>B+W.height+Wt,-Wt);await l.translate(_[0].id,{x:0,y:Math.max(0,F/2-_[0].height/2)})}}const E=16,A=()=>{const{x:I,y:_,k:N}=l.area.transform,S=E*N;e.style.backgroundSize=`${S}px ${S}px`,e.style.backgroundPosition=`${I}px ${_}px`},R=async()=>{await ot.zoomAt(l,c.getNodes(),{scale:.85}),A()};await R();const G=async I=>{const _=e.clientWidth/2,N=e.clientHeight/2,{k:S}=l.area.transform,F=S*(1+I);F<.33||F>3||(await l.area.zoom(F,_*I,N*I),A())};return ot.restrictor(l,{translation:()=>{const{k:I}=l.area.transform,_=ot.getBoundingBox(l,c.getNodes()),N=e.getBoundingClientRect(),S=150;return{left:S-_.right*I,right:N.width-S-_.left*I,top:S-_.bottom*I,bottom:N.height-S-_.top*I}}}),l.addPipe(I=>{if(I.type==="zoom"){if(I.data.source==="dblclick")return;const _=I.data.zoom;if(_<.33||_>3)return}if(I.type!=="nodetranslate")return(I.type==="translated"||I.type==="zoomed")&&A(),I}),{destroy:()=>{l.destroy()},fitView:R,zoomBy:G,highlightNodes:I=>{const _=I.toLowerCase(),N=[];for(const S of c.getNodes()){const F={h:S.highlighted,d:S.dimmed};S.highlighted=_!==""&&S.label.toLowerCase().includes(_),S.dimmed=_!==""&&!S.highlighted,S.highlighted&&N.push(S),(F.h!==S.highlighted||F.d!==S.dimmed)&&l.update("node",S.id)}for(const S of c.getConnections())l.update("connection",S.id);N.length>0&&ot.zoomAt(l,N,{scale:.85})}}}function Qu({dataMartId:e,dataMartTitle:t,dataMartDescription:n,dataMartStatus:r,relationships:i,connectedFieldCounts:o,searchQuery:a,showTransient:s,onRequestFullscreen:u,className:c,style:l}){const f=w.useRef(null),d=w.useRef(null),p=w.useRef(a);p.current=a;const v=w.useCallback(m=>{const h=window.location.pathname.replace(/\/data-marts\/.*/,"");window.open(`${h}/data-marts/${m}/data-setup`,"_blank")},[]);return w.useEffect(()=>{const m=f.current;if(!(!m||i.length===0))return Uu(m,e,t,n,r,i,o,v,s).then(h=>{d.current=h,p.current&&h.highlightNodes(p.current)}),()=>{var h;(h=d.current)==null||h.destroy(),d.current=null,m.replaceChildren()}},[e,t,n,r,i,o,v,s]),w.useEffect(()=>{var m;(m=d.current)==null||m.highlightNodes(a)},[a]),i.length===0?null:D.jsxs("div",{className:`rel-canvas relative overflow-hidden rounded-lg border ${c??""}`,style:l??{height:480},children:[D.jsx("style",{children:`
|
|
237
|
-
.rel-canvas svg path { stroke-width: 1.5px !important; }
|
|
238
|
-
.rel-canvas [data-testid="minimap"] { transform: scale(0.5); transform-origin: bottom right; }
|
|
239
|
-
@keyframes node-pulse {
|
|
240
|
-
0%, 100% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 0 12px rgba(59, 130, 246, 0.4); }
|
|
241
|
-
50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.15), 0 0 20px rgba(59, 130, 246, 0.5); }
|
|
242
|
-
}
|
|
243
|
-
`}),D.jsx("div",{className:"absolute top-3 right-3 z-10 flex items-start gap-2",children:D.jsxs("div",{className:"flex flex-col gap-1.5",children:[D.jsx(rt,{variant:"outline",size:"icon",className:"h-12 w-12",onClick:()=>{var m;(m=d.current)==null||m.fitView()},"aria-label":"Fit to view",children:D.jsx(po,{className:"h-6 w-6"})}),D.jsx(rt,{variant:"outline",size:"icon",className:"h-12 w-12",onClick:()=>{var m;(m=d.current)==null||m.zoomBy(.25)},"aria-label":"Zoom in",children:D.jsx(vo,{className:"h-6 w-6"})}),D.jsx(rt,{variant:"outline",size:"icon",className:"h-12 w-12",onClick:()=>{var m;(m=d.current)==null||m.zoomBy(-.25)},"aria-label":"Zoom out",children:D.jsx(yo,{className:"h-6 w-6"})}),u&&D.jsx(rt,{variant:"outline",size:"icon",className:"h-12 w-12",onClick:u,"aria-label":"Expand diagram",children:D.jsx(no,{className:"h-6 w-6"})})]})}),D.jsx("div",{ref:f,style:{width:"100%",height:"100%",backgroundImage:"linear-gradient(rgba(0,0,0,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.06) 1px, transparent 1px)",backgroundSize:"16px 16px"}})]})}export{Qu as RelationshipCanvas};
|