@emporix/process-diagram 2.0.0-beta.2 → 2.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/iterator/Iterator.d.ts +1 -1
- package/dist/components/iterator/Iterator.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +596 -587
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import type { Iterator as IteratorType } from '../../types';
|
|
|
2
2
|
import type { AddStepOperation, AddStepType } from '../../helpers/add-process.helpers';
|
|
3
3
|
export interface IteratorProps {
|
|
4
4
|
/** Iterator data: must include localId; limit is optional. */
|
|
5
|
-
value: Pick<IteratorType, 'localId'> & Partial<Pick<IteratorType, 'limit' | 'steps'>>;
|
|
5
|
+
value: Pick<IteratorType, 'localId'> & Partial<Pick<IteratorType, 'limit' | 'steps' | 'condition'>>;
|
|
6
6
|
onAddStep?: (id?: string, pathId?: string, operation?: AddStepOperation) => void;
|
|
7
7
|
onAddTrigger?: (id?: string, pathId?: string, operation?: AddStepType) => void;
|
|
8
8
|
onAddCondition?: (stepId?: string, pathId?: string, operation?: AddStepOperation) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Iterator.d.ts","sourceRoot":"","sources":["../../../src/components/iterator/Iterator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Iterator.d.ts","sourceRoot":"","sources":["../../../src/components/iterator/Iterator.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,mCAAmC,CAAA;AAG1C,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,GAClC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,OAAO,GAAG,WAAW,CAAC,CAAC,CAAA;IAC9D,SAAS,CAAC,EAAE,CACV,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC9E,cAAc,CAAC,EAAE,CACf,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,SAAS,CAAC,EAAE,CACV,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,gBAAgB,KACzB,IAAI,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,QAAA,MAAM,iBAAiB,GAAI,sHAUxB,QAAQ,CAAC,aAAa,CAAC,4CAkGzB,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),_1=require("react-dom"),j1="_container_8wfnz_1",w1="_step_8wfnz_7",y1="_selected_8wfnz_23",I1="_selectedInvalid_8wfnz_29",b1="_isSet_8wfnz_35",N1="_invalid_8wfnz_39",k1="_filterFlag_8wfnz_45",M1="_title_8wfnz_73",B1="_icon_8wfnz_90",P1="_content_8wfnz_108",L1="_dotsButton_8wfnz_114",b={container:j1,step:w1,selected:y1,selectedInvalid:I1,isSet:b1,invalid:N1,filterFlag:k1,title:M1,icon:B1,content:P1,dotsButton:L1};var a1={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},o1=l.createContext&&l.createContext(a1),S1=["attr","size","title"];function E1(e,n){if(e==null)return{};var s=T1(e,n),o,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)o=a[i],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function T1(e,n){if(e==null)return{};var s={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(n.indexOf(o)>=0)continue;s[o]=e[o]}return s}function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o])}return e},Z.apply(this,arguments)}function i1(e,n){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),s.push.apply(s,o)}return s}function V(e){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?i1(Object(s),!0).forEach(function(o){$1(e,o,s[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):i1(Object(s)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(s,o))})}return e}function $1(e,n,s){return n=O1(n),n in e?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s,e}function O1(e){var n=H1(e,"string");return typeof n=="symbol"?n:n+""}function H1(e,n){if(typeof e!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var o=s.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function d1(e){return e&&e.map((n,s)=>l.createElement(n.tag,V({key:s},n.attr),d1(n.child)))}function R(e){return n=>l.createElement(R1,Z({attr:V({},e.attr)},n),d1(e.child))}function R1(e){var n=s=>{var{attr:o,size:i,title:a}=e,d=E1(e,S1),u=i||s.size||"1em",r;return s.className&&(r=s.className),e.className&&(r=(r?r+" ":"")+e.className),l.createElement("svg",Z({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,o,d,{className:r,style:V(V({color:e.color||s.color},s.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&l.createElement("title",null,a),e.children)};return o1!==void 0?l.createElement(o1.Consumer,null,s=>n(s)):n(a1)}function W1(e){return R({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.52.359A.5.5 0 0 1 6 0h4a.5.5 0 0 1 .474.658L8.694 6H12.5a.5.5 0 0 1 .395.807l-7 9a.5.5 0 0 1-.873-.454L6.823 9.5H3.5a.5.5 0 0 1-.48-.641zM6.374 1 4.168 8.5H7.5a.5.5 0 0 1 .478.647L6.78 13.04 11.478 7H8a.5.5 0 0 1-.474-.658L9.306 1z"},child:[]}]})(e)}function z1(e){return R({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325"},child:[]}]})(e)}function q(e){return R({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(e)}function A(e){return R({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"},child:[]},{tag:"path",attr:{d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"},child:[]}]})(e)}const D1="_panel_19663_1",F1="_panelExiting_19663_13",Z1="_menuItem_19663_37",V1="_disabled_19663_52",q1="_menuItemIcon_19663_57",A1="_menuItemText_19663_63",Y1="_overlay_19663_69",L={panel:D1,panelExiting:F1,menuItem:Z1,disabled:V1,menuItemIcon:q1,menuItemText:A1,overlay:Y1},X1=e=>{const s=e.currentTarget??e.target;if(s?.getBoundingClientRect){const i=s.getBoundingClientRect();return{top:i.bottom+2,left:i.left}}const o=e;return{top:(o.clientY??0)+2,left:o.clientX??0}},z=l.forwardRef(function({model:n,popup:s=!0,onHide:o,onClick:i},a){const[d,u]=l.useState(!1),[r,c]=l.useState(!1),[x,I]=l.useState({top:0,left:0}),_=l.useRef(null),g=l.useCallback(()=>{r||c(!0)},[r]),m=l.useCallback(h=>{r&&h.animationName.includes("menuOut")&&(u(!1),c(!1),o?.())},[r,o]),p=l.useCallback(h=>{I(X1(h)),c(!1),u(!0)},[]),j=l.useCallback(h=>{d?g():p(h)},[d,g,p]);l.useImperativeHandle(a,()=>({show:p,hide:g,toggle:j}),[p,g,j]),l.useEffect(()=>{if(!d)return;const h=P=>{P.key==="Escape"&&g()},y=P=>{const C=_.current;C&&!C.contains(P.target)&&(P.stopPropagation(),g())};return document.addEventListener("keydown",h),document.addEventListener("mousedown",y),()=>{document.removeEventListener("keydown",h),document.removeEventListener("mousedown",y)}},[d,g]);const w=(h,y)=>{y.stopPropagation(),h.command?.({originalEvent:y,item:h}),g()},v=(h,y)=>{const P=C=>w(h,C);return h.template?t.jsx(l.Fragment,{children:h.template(h,{onClick:P})},y):t.jsxs("button",{type:"button",className:`${L.menuItem} ${h.disabled&&L.disabled}`,onClick:C=>{h.disabled||P(C)},children:[h.icon&&t.jsx("span",{className:L.menuItemIcon,children:h.icon}),t.jsx("span",{className:L.menuItemText,children:h.label})]},y)};return!d||!s?null:_1.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:L.overlay,"aria-hidden":!0,onClick:()=>g(),onMouseDown:h=>h.stopPropagation()}),t.jsx("div",{ref:_,className:`${L.panel} ${r?L.panelExiting:""}`,role:"menu",style:{top:x.top,left:x.left},onAnimationEnd:m,onClick:h=>{h.stopPropagation(),i?.(h)},children:n.map(v)})]}),document.body)}),U=()=>(e,n)=>t.jsxs("button",{className:L.menuItem,onClick:s=>n.onClick(s),children:[t.jsx("span",{className:L.menuItemIcon,children:e.icon}),t.jsx("span",{className:L.menuItemText,children:e.label})]}),G1=({width:e=16,height:n=16,color:s="#3B64A0"})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("rect",{x:"7.99219",y:"0.222732",width:"11",height:"11",rx:"1.5",transform:"rotate(45 7.99219 0.222732)",stroke:s}),t.jsx("path",{d:"M10.4693 5.52599L5.52513 10.4813M5.52513 5.53151L10.4749 10.4813",stroke:s,strokeLinecap:"round"})]}),K1=({width:e=16,height:n=16,color:s="#3B64A0"})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M11.5341 7.00002H15.4661C15.5136 7.00004 15.5601 7.01359 15.6002 7.03909C15.6403 7.06459 15.6722 7.10098 15.6924 7.144C15.7125 7.18702 15.72 7.23489 15.7139 7.282C15.7079 7.32912 15.6885 7.37352 15.6581 7.41002L13.6921 9.77002C13.6686 9.79816 13.6393 9.82079 13.6061 9.83633C13.5729 9.85186 13.5367 9.85991 13.5001 9.85991C13.4635 9.85991 13.4273 9.85186 13.3941 9.83633C13.3609 9.82079 13.3315 9.79816 13.3081 9.77002L11.3421 7.41002C11.3117 7.37352 11.2923 7.32912 11.2862 7.282C11.2802 7.23489 11.2876 7.18702 11.3078 7.144C11.3279 7.10098 11.3599 7.06459 11.4 7.03909C11.4401 7.01359 11.4866 7.00004 11.5341 7.00002ZM0.534086 9.00002H4.46609C4.51359 9.00001 4.56011 8.98645 4.60019 8.96096C4.64027 8.93546 4.67225 8.89907 4.6924 8.85605C4.71254 8.81303 4.72002 8.76516 4.71394 8.71804C4.70786 8.67093 4.68849 8.62652 4.65809 8.59002L2.69209 6.23002C2.66862 6.20189 2.63926 6.17925 2.60609 6.16372C2.57291 6.14819 2.53672 6.14014 2.50009 6.14014C2.46345 6.14014 2.42726 6.14819 2.39409 6.16372C2.36091 6.17925 2.33155 6.20189 2.30809 6.23002L0.342086 8.59002C0.311684 8.62652 0.29231 8.67093 0.286234 8.71804C0.280157 8.76516 0.287629 8.81303 0.307775 8.85605C0.327921 8.89907 0.359907 8.93546 0.399987 8.96096C0.440067 8.98645 0.486583 9.00001 0.534086 9.00002Z",fill:s}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00001 3.00023C6.44801 3.00023 5.06001 3.70723 4.14301 4.81823C4.10206 4.87131 4.05086 4.9156 3.99245 4.94849C3.93404 4.98138 3.86961 5.00219 3.803 5.00968C3.73638 5.01717 3.66895 5.01119 3.60469 4.99209C3.54043 4.97299 3.48068 4.94117 3.42897 4.89851C3.37726 4.85586 3.33465 4.80324 3.30368 4.74379C3.27272 4.68434 3.25402 4.61926 3.24871 4.55244C3.24339 4.48562 3.25157 4.41841 3.27275 4.35481C3.29394 4.29121 3.32769 4.23252 3.37201 4.18223C4.1042 3.29576 5.0756 2.63824 6.17067 2.28789C7.26575 1.93753 8.43841 1.90908 9.54918 2.20592C10.66 2.50276 11.6621 3.1124 12.4364 3.96232C13.2107 4.81224 13.7246 5.86668 13.917 7.00023H12.9C12.6691 5.87104 12.0554 4.85623 11.1625 4.12738C10.2697 3.39853 9.15256 3.00037 8.00001 3.00023ZM3.10001 9.00023C3.28932 9.92486 3.73636 10.7771 4.38949 11.4584C5.04261 12.1397 5.87517 12.6223 6.79097 12.8505C7.70677 13.0787 8.66845 13.0431 9.5649 12.7479C10.4613 12.4527 11.256 11.9099 11.857 11.1822C11.898 11.1292 11.9492 11.0849 12.0076 11.052C12.066 11.0191 12.1304 10.9983 12.197 10.9908C12.2636 10.9833 12.3311 10.9893 12.3953 11.0084C12.4596 11.0275 12.5193 11.0593 12.5711 11.102C12.6228 11.1446 12.6654 11.1972 12.6963 11.2567C12.7273 11.3161 12.746 11.3812 12.7513 11.448C12.7566 11.5148 12.7484 11.5821 12.7273 11.6457C12.7061 11.7093 12.6723 11.7679 12.628 11.8182C11.8958 12.7047 10.9244 13.3622 9.82934 13.7126C8.73427 14.0629 7.56161 14.0914 6.45083 13.7945C5.34006 13.4977 4.33791 12.8881 3.5636 12.0381C2.78928 11.1882 2.27538 10.1338 2.08301 9.00023H3.10001Z",fill:s})]}),r1=({width:e=16,height:n=16,color:s="#3B64A0"})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M8 15C6.14348 15 4.36301 14.2625 3.05025 12.9497C1.7375 11.637 1 9.85652 1 8C1 6.14348 1.7375 4.36301 3.05025 3.05025C4.36301 1.7375 6.14348 1 8 1C9.85652 1 11.637 1.7375 12.9497 3.05025C14.2625 4.36301 15 6.14348 15 8C15 9.85652 14.2625 11.637 12.9497 12.9497C11.637 14.2625 9.85652 15 8 15ZM8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.84344 15.1571 5.87827 16 8 16Z",fill:s}),t.jsx("path",{d:"M7 11.5C7 11.3674 7.05268 11.2402 7.14645 11.1464C7.24021 11.0527 7.36739 11 7.5 11H8.5C8.63261 11 8.75979 11.0527 8.85355 11.1464C8.94732 11.2402 9 11.3674 9 11.5C9 11.6326 8.94732 11.7598 8.85355 11.8536C8.75979 11.9473 8.63261 12 8.5 12H7.5C7.36739 12 7.24021 11.9473 7.14645 11.8536C7.05268 11.7598 7 11.6326 7 11.5ZM5 8.5C5 8.36739 5.05268 8.24021 5.14645 8.14645C5.24021 8.05268 5.36739 8 5.5 8H10.5C10.6326 8 10.7598 8.05268 10.8536 8.14645C10.9473 8.24021 11 8.36739 11 8.5C11 8.63261 10.9473 8.75979 10.8536 8.85355C10.7598 8.94732 10.6326 9 10.5 9H5.5C5.36739 9 5.24021 8.94732 5.14645 8.85355C5.05268 8.75979 5 8.63261 5 8.5ZM3 5.5C3 5.36739 3.05268 5.24021 3.14645 5.14645C3.24021 5.05268 3.36739 5 3.5 5H12.5C12.6326 5 12.7598 5.05268 12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5C13 5.63261 12.9473 5.75979 12.8536 5.85355C12.7598 5.94732 12.6326 6 12.5 6H3.5C3.36739 6 3.24021 5.94732 3.14645 5.85355C3.05268 5.75979 3 5.63261 3 5.5Z",fill:s})]}),u1=l.createContext(void 0),J1=({children:e})=>{const[n,s]=l.useState([]),o=l.useCallback((d,u)=>{s(r=>(r.forEach(c=>{c.current&&c!==d&&c.current.hide(u)}),[])),d.current?.toggle(u),s([d])},[]),i=l.useCallback(d=>{s(u=>u.filter(r=>r!==d))},[]),a=l.useMemo(()=>({openMenus:n,openMenu:o,closeMenu:i}),[n,o,i]);return t.jsx(u1.Provider,{value:a,children:e})},Y=()=>{const e=l.useContext(u1);if(e===void 0)throw new Error("useMenuProvider must be used within a MenuProvider");return e},Q1=({color:e="#E32012"})=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[t.jsx("g",{clipPath:"url(#clip0_3105_5367)",children:t.jsx("path",{d:"M16 8C16 10.1217 15.1571 12.1566 13.6569 13.6569C12.1566 15.1571 10.1217 16 8 16C5.87827 16 3.84344 15.1571 2.34315 13.6569C0.842855 12.1566 0 10.1217 0 8C0 5.87827 0.842855 3.84344 2.34315 2.34315C3.84344 0.842855 5.87827 0 8 0C10.1217 0 12.1566 0.842855 13.6569 2.34315C15.1571 3.84344 16 5.87827 16 8ZM8 4C7.87361 4.00007 7.74863 4.02662 7.63312 4.07793C7.51761 4.12924 7.41413 4.20418 7.32934 4.29791C7.24456 4.39165 7.18035 4.5021 7.14084 4.62217C7.10134 4.74223 7.08743 4.86923 7.1 4.995L7.45 8.502C7.46176 8.63977 7.5248 8.76811 7.62664 8.86164C7.72849 8.95516 7.86173 9.00705 8 9.00705C8.13827 9.00705 8.27151 8.95516 8.37336 8.86164C8.4752 8.76811 8.53824 8.63977 8.55 8.502L8.9 4.995C8.91257 4.86923 8.89866 4.74223 8.85915 4.62217C8.81965 4.5021 8.75544 4.39165 8.67066 4.29791C8.58587 4.20418 8.48239 4.12924 8.36688 4.07793C8.25137 4.02662 8.12639 4.00007 8 4ZM8.002 10C7.73678 10 7.48243 10.1054 7.29489 10.2929C7.10736 10.4804 7.002 10.7348 7.002 11C7.002 11.2652 7.10736 11.5196 7.29489 11.7071C7.48243 11.8946 7.73678 12 8.002 12C8.26722 12 8.52157 11.8946 8.70911 11.7071C8.89664 11.5196 9.002 11.2652 9.002 11C9.002 10.7348 8.89664 10.4804 8.70911 10.2929C8.52157 10.1054 8.26722 10 8.002 10Z",fill:e})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_3105_5367",children:t.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),X=e=>{const{isSet:n,isSelected:s,isFilter:o,className:i,title:a,icon:d,contextMenuItems:u=void 0,onDeleteStep:r,onUpdateFilter:c,onSelectStep:x,subtitle:I,isInvalid:_,localId:g}=e,m=l.useRef(null),{openMenu:p,closeMenu:j}=Y(),w=U(),v=l.useMemo(()=>[{label:"Add Step Filter",icon:t.jsx("div",{className:"mr-2 flex items-center justify-center",children:t.jsx(r1,{})}),command:f=>{f?.originalEvent?.stopPropagation(),c&&c(g)},template:w},{label:"Remove",icon:t.jsx(A,{color:"#3B64A0",size:18}),command:f=>{f?.originalEvent?.stopPropagation(),r&&r(g)},template:w}],[c,r,g,w]),h=l.useMemo(()=>u!==void 0?u:v,[u,v]),y=f=>{f.stopPropagation(),p(m,f)},P=l.useMemo(()=>s&&_?b.step+" "+b.selectedInvalid:s?b.step+" "+b.selected:n?b.step+" "+b.isSet:_?b.step+" "+b.invalid:b.step,[n,s,_]),C=l.useMemo(()=>_?t.jsx(Q1,{color:"#E32012"}):d,[d,_]);return t.jsx("div",{className:b.container+" "+i,children:t.jsxs("div",{children:[t.jsxs("div",{className:P,onClick:()=>x(g),children:[t.jsxs("div",{className:b.content,children:[t.jsx("div",{className:`${b.icon} ${_&&b.invalid}`,children:C}),t.jsx("div",{className:b.title,children:a})]}),t.jsx("button",{className:b.dotsButton,onClick:y,"aria-haspopup":!0,"aria-label":"Step options",children:t.jsx(q,{className:b.dots,color:_?"#E32012":"#3B64A0"})}),t.jsx(z,{model:h,popup:!0,ref:m,onClick:f=>f.stopPropagation(),onHide:()=>j(m)})]}),o&&t.jsxs("div",{className:b.filterFlag,role:"button",tabIndex:0,onClick:()=>{c&&c(g)},onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&c&&(f.preventDefault(),c(g))},children:[t.jsx(r1,{color:"#3B64A0"}),t.jsx("span",{children:"Filter"}),t.jsx(q,{className:b.dots,color:_?"#E32012":"#3B64A0",style:{height:"10px"}})]}),I&&t.jsx("div",{className:b.subtitle,children:I})]})})},U1=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[t.jsxs("g",{clipPath:"url(#clip0_6551_9169)",children:[t.jsx("rect",{width:"24",height:"24",rx:"12",fill:"#0C971F"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V11H18C18.5523 11 19 11.4477 19 12C19 12.5523 18.5523 13 18 13H13V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H6C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11H11V6Z",fill:"white"})]}),t.jsx("rect",{x:"0.75",y:"0.75",width:"22.5",height:"22.5",rx:"11.25",stroke:"#14BC2B",strokeWidth:"1.5"}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_6551_9169",children:t.jsx("rect",{width:"24",height:"24",rx:"12",fill:"white"})})})]}),ee="_multipleTriggersIcon_oxhdi_1",te={multipleTriggersIcon:ee},ne=()=>t.jsx("div",{className:te.multipleTriggersIcon,children:t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 3.75C1.5 3.15326 1.73705 2.58097 2.15901 2.15901C2.58097 1.73705 3.15326 1.5 3.75 1.5H5.25C5.84674 1.5 6.41903 1.73705 6.84099 2.15901C7.26295 2.58097 7.5 3.15326 7.5 3.75L13.701 3.75C13.8661 3.46404 14.1209 3.24054 14.426 3.11418C14.7311 2.98782 15.0693 2.96565 15.3883 3.05111C15.7072 3.13657 15.9891 3.32489 16.1901 3.58686C16.3911 3.84882 16.5 4.1698 16.5 4.5C16.5 4.8302 16.3911 5.15118 16.1901 5.41314C15.9891 5.67511 15.7072 5.86343 15.3883 5.94889C15.0693 6.03435 14.7311 6.01218 14.426 5.88582C14.1209 5.75946 13.8661 5.53596 13.701 5.25H10.686C10.956 5.52 11.196 5.8215 11.412 6.1575C12.369 7.6455 12.75 9.6885 12.75 12C12.75 14.9895 13.1355 16.638 13.8195 17.55C14.3535 18.264 15.162 18.6315 16.5 18.726C16.5063 18.1334 16.7462 17.5673 17.1674 17.1505C17.5887 16.7337 18.1574 16.5 18.75 16.5H20.25C20.8467 16.5 21.419 16.7371 21.841 17.159C22.2629 17.581 22.5 18.1533 22.5 18.75V20.25C22.5 20.8467 22.2629 21.419 21.841 21.841C21.419 22.2629 20.8467 22.5 20.25 22.5H18.75C18.1533 22.5 17.581 22.2629 17.159 21.841C16.7371 21.419 16.5 20.8467 16.5 20.25H10.299C10.1339 20.536 9.87905 20.7595 9.57399 20.8858C9.26892 21.0122 8.93068 21.0344 8.61173 20.9489C8.29278 20.8634 8.01095 20.6751 7.80993 20.4131C7.60892 20.1512 7.49996 19.8302 7.49996 19.5C7.49996 19.1698 7.60892 18.8488 7.80993 18.5869C8.01095 18.3249 8.29278 18.1366 8.61173 18.0511C8.93068 17.9656 9.26892 17.9878 9.57399 18.1142C9.87905 18.2405 10.1339 18.464 10.299 18.75H12.8655C12.7785 18.6538 12.6959 18.5537 12.618 18.45C11.6145 17.1105 11.25 15.0105 11.25 12C11.25 9.81 10.881 8.1045 10.1505 6.9675C9.5655 6.06 8.7225 5.4675 7.5 5.2995C7.48706 5.88762 7.2443 6.44728 6.82374 6.85859C6.40318 7.2699 5.83826 7.50014 5.25 7.5H3.75C3.15326 7.5 2.58097 7.26295 2.15901 6.84099C1.73705 6.41903 1.5 5.84674 1.5 5.25V3.75ZM3.75 3C3.55109 3 3.36032 3.07902 3.21967 3.21967C3.07902 3.36032 3 3.55109 3 3.75V5.25C3 5.44891 3.07902 5.63968 3.21967 5.78033C3.36032 5.92098 3.55109 6 3.75 6H5.25C5.44891 6 5.63968 5.92098 5.78033 5.78033C5.92098 5.63968 6 5.44891 6 5.25V3.75C6 3.55109 5.92098 3.36032 5.78033 3.21967C5.63968 3.07902 5.44891 3 5.25 3H3.75ZM18.75 18C18.5511 18 18.3603 18.079 18.2197 18.2197C18.079 18.3603 18 18.5511 18 18.75V20.25C18 20.4489 18.079 20.6397 18.2197 20.7803C18.3603 20.921 18.5511 21 18.75 21H20.25C20.4489 21 20.6397 20.921 20.7803 20.7803C20.921 20.6397 21 20.4489 21 20.25V18.75C21 18.5511 20.921 18.3603 20.7803 18.2197C20.6397 18.079 20.4489 18 20.25 18H18.75Z",fill:"white"})})}),se="_trigger_kfg1y_1",oe="_title_kfg1y_7",ie="_empty_kfg1y_15",re="_triggerContainer_kfg1y_21",le="_stepsContainer_kfg1y_25",ce="_stepItem_kfg1y_51",ae="_curvesSvg_kfg1y_70",de="_centralNode_kfg1y_78",ue="_iconWrapper_kfg1y_104",pe="_fadeIn_kfg1y_127",he="_fadeOut_kfg1y_130",Ce="_operationContainer_kfg1y_134",B={trigger:se,title:oe,empty:ie,triggerContainer:re,stepsContainer:le,stepItem:ce,curvesSvg:ae,centralNode:de,iconWrapper:ue,fadeIn:pe,fadeOut:he,operationContainer:Ce},me=()=>t.jsx("div",{style:{height:"1px",marginLeft:"4px",marginRight:"4px",borderTop:"1px solid #a1bbdc"}}),xe=80,D=34,p1=({steps:e,title:n,className:s,onDeleteTrigger:o,onAddTrigger:i,onSelectStep:a,onUpdateFilter:d,onCenterYUpdate:u})=>{const r=l.useRef(null),c=l.useRef([]),[x,I]=l.useState([]),[_,g]=l.useState({width:0,height:0}),[m,p]=l.useState(!1),[j,w]=l.useState(!1),v=l.useRef(null);l.useEffect(()=>{const C=()=>{if(!r.current)return;const f=[];if(c.current.forEach((M,N)=>{if(M&&r.current){const S=r.current.getBoundingClientRect(),E=M.getBoundingClientRect();f.push({localId:e[N]?.localId??`step-${N}`,top:E.top-S.top,right:E.right-S.left,centerY:E.top-S.top+E.height/2})}}),I(f),r.current&&f.length>0){const M=r.current.getBoundingClientRect(),N=Math.min(...f.map(T=>T.top)),S=c.current.filter(Boolean).map(T=>T?.offsetHeight||68),E=Math.max(...f.map((T,v1)=>T.top+(S[v1]||68))),G=Math.max(...f.map(T=>T.right))+0,K=Math.max(M.height,E-N+100);g({width:G,height:K})}};return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[e]),l.useEffect(()=>{let C=!0;if(m){v.current&&(clearTimeout(v.current),v.current=null);const f=setTimeout(()=>{C&&w(!0)},0);return()=>{C=!1,clearTimeout(f)}}return v.current=setTimeout(()=>{C&&w(!1)},140),()=>{C=!1,v.current&&(clearTimeout(v.current),v.current=null)}},[m]);const h=x.length>0?xe:0,y=l.useMemo(()=>x.length>1?x.reduce((C,f)=>C+f.top+D,0)/x.length:x.length===1?x[0].top+D:0,[x]);if(l.useEffect(()=>{u?.(y)},[y,u]),e.length===0)return t.jsxs("div",{className:`${B.trigger} ${s||""}`,children:[n&&t.jsx("h3",{className:B.title,children:n}),t.jsx("div",{className:B.empty,children:"No steps"})]});const P=(C,f,M,N)=>{const S=M-C,E=Math.min(S*.6,60),s1=C+E,G=f,K=M-E;return`M ${C} ${f} C ${s1} ${G}, ${K} ${N}, ${M} ${N}`};return t.jsxs("div",{className:`${B.trigger} ${s||""}`,ref:r,children:[n&&t.jsx("h3",{className:B.title,children:n}),t.jsxs("div",{className:B.triggerContainer,children:[t.jsx("div",{className:B.stepsContainer,children:e.map((C,f)=>t.jsx("div",{ref:M=>{c.current[f]=M},children:t.jsx(X,{title:C.title,className:B.stepItem,localId:C.localId,idx:f,isSet:C.isSet,isSelected:C.isSelected,isInvalid:C.isInvalid,isFilter:C.isFilter,icon:C.icon,onSelectStep:a,onUpdateFilter:d,contextMenuItems:[{label:"Delete",icon:t.jsx(A,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{o?.(C.localId)},disabled:e.length===1},{label:"",template:()=>t.jsx(me,{})},{label:"Add More Triggers",icon:t.jsx(W1,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{i?.()}}]})},C.localId))}),t.jsx("div",{style:{position:"relative"},children:x.length>1&&t.jsx("svg",{className:B.curvesSvg,width:_.width,height:_.height,children:x.map(C=>{const M=x.length===1?x[0].top+D:C.top+D,N=h,S=y;return t.jsx("path",{d:P(0,M,N,S),stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"},C.localId)})})}),x.length>1?t.jsxs("div",{style:{position:"relative",marginRight:"140px"},children:[t.jsx("div",{className:B.centralNode,style:{"--node-x":`${h}px`,"--node-y":`${y}px`},onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:j?t.jsx("div",{className:`${B.iconWrapper} ${m?B.fadeIn:B.fadeOut}`,onClick:i,children:t.jsx(U1,{})}):null}),t.jsx("div",{className:B.operationContainer,style:{"--op-x":`${h+16}px`,"--op-y":`${y}px`},children:t.jsx(ne,{})})]}):null]})]})};function fe(e){return R({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"4"},child:[]},{tag:"line",attr:{x1:"1.05",y1:"12",x2:"7",y2:"12"},child:[]},{tag:"line",attr:{x1:"17.01",y1:"12",x2:"22.96",y2:"12"},child:[]}]})(e)}function ge(e){return R({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"},child:[]}]})(e)}const ve=()=>t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M6 12L18 12",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"}),t.jsx("path",{d:"M12 6V18",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"})]}),_e="_stepLinkIcon_18u2g_1",je="_stepLinkLine_18u2g_15",we="_stepLinkContainer_18u2g_39",F={stepLinkIcon:_e,stepLinkLine:je,stepLinkContainer:we},H=({onAddStep:e,onAddTrigger:n,onAddCondition:s,onAddLoop:o,stepId:i,index:a=0,style:d,pathId:u})=>{const r=U(),c=l.useRef(null),x=[...a>0?[{label:"Trigger",icon:t.jsx(ge,{color:"#3B64A0",size:18}),command:()=>{n?.(i,u,"trigger")},template:r}]:[],{label:"Step",icon:t.jsx(fe,{color:"#3B64A0",size:18}),command:()=>e?.(i,u,"append"),template:r},...i?[{label:"Condition",icon:t.jsx(G1,{width:18,height:18}),command:()=>s?.(i,u,"append"),template:r},{label:"Loop",icon:t.jsx(K1,{width:18,height:18}),command:()=>o?.(i,u,"append"),template:r}]:[]],I=_=>{c.current?.show(_)};return t.jsxs("div",{className:F.stepLinkContainer,style:{...d},"data-plus-index":a,children:[t.jsx("div",{className:F.stepLinkLine}),t.jsx("div",{className:F.stepLinkIcon,onClick:I,"aria-haspopup":!0,children:t.jsx(ve,{})}),t.jsx(z,{model:x,popup:!0,ref:c}),t.jsx("div",{className:F.stepLinkLine})]})},ye="_steps_yug55_1",Ie="_stepContainer_yug55_8",be="_stepContainerWithPaths_yug55_14",J={steps:ye,stepContainer:Ie,stepContainerWithPaths:be},Ne=(e,n,s,o)=>{const i=s-e,a=Math.min(i*.66,66),d=e+a,u=n,r=s-a;return`M ${e} ${n} C ${d} ${u}, ${r} ${o}, ${s} ${o}`},ke=({width:e,height:n})=>{const d=Ne(0,1,e,n);return t.jsx("div",{style:{position:"absolute"},children:t.jsx("svg",{width:e,height:n+1,viewBox:`0 0 ${e} ${n+1}`,xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d,stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"})})})},Me="_column_1uiy3_1",Be="_row_1uiy3_19",Pe="_stepsContainer_1uiy3_24",W={column:Me,row:Be,stepsContainer:Pe},Le="_wrapper_1nl2d_1",Se="_tooltip_1nl2d_5",l1={wrapper:Le,tooltip:Se},Ee=({content:e,children:n,maxWidth:s=500,className:o})=>t.jsxs("div",{className:`${l1.wrapper} ${o??""}`.trim(),style:{"--tooltip-max-width":`${s}px`},children:[n,e?t.jsx("div",{className:l1.tooltip,role:"tooltip",children:e}):null]}),Te="_conditionContainer_5kl8s_1",$e="_connectorLine_5kl8s_6",Oe="_conditionWrapper_5kl8s_12",He="_condition_5kl8s_1",Re="_connectorDot_5kl8s_43",O={conditionContainer:Te,connectorLine:$e,conditionWrapper:Oe,condition:He,connectorDot:Re},We=({expression:e,style:n})=>{const s=l.useRef(null),[o,i]=l.useState(!1);l.useLayoutEffect(()=>{const d=s.current;d&&i(d.scrollHeight>d.clientHeight)},[e]);const a=e&&o?e:"";return t.jsxs("div",{className:O.conditionContainer,style:n,children:[t.jsx("div",{className:O.connectorLine}),t.jsx(Ee,{content:a,className:O.conditionWrapper,children:t.jsx("div",{ref:s,className:O.condition,children:e})}),t.jsx("div",{className:O.connectorLine}),t.jsx("div",{className:O.connectorDot})]})},ze="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='21.8125'%20y='-2.52539'%20width='34.4207'%20height='34.4207'%20rx='6.09524'%20transform='rotate(45%2021.8125%20-2.52539)'%20fill='%236B90C0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M31.3947%2013.0355C31.4679%2013.1085%2031.526%2013.1952%2031.5656%2013.2907C31.6052%2013.3861%2031.6256%2013.4885%2031.6256%2013.5918C31.6256%2013.6952%2031.6052%2013.7975%2031.5656%2013.8929C31.526%2013.9884%2031.4679%2014.0751%2031.3947%2014.1481L14.109%2031.4338C13.9615%2031.5813%2013.7614%2031.6642%2013.5527%2031.6642C13.3441%2031.6642%2013.144%2031.5813%2012.9965%2031.4338C12.8489%2031.2863%2012.766%2031.0862%2012.766%2030.8775C12.766%2030.6689%2012.8489%2030.4688%2012.9965%2030.3212L30.2822%2013.0355C30.3552%2012.9623%2030.4419%2012.9043%2030.5373%2012.8647C30.6328%2012.8251%2030.7351%2012.8047%2030.8385%2012.8047C30.9418%2012.8047%2031.0441%2012.8251%2031.1396%2012.8647C31.2351%2012.9043%2031.3218%2012.9623%2031.3947%2013.0355Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.9965%2013.0355C12.9233%2013.1085%2012.8652%2013.1952%2012.8256%2013.2907C12.786%2013.3861%2012.7656%2013.4885%2012.7656%2013.5918C12.7656%2013.6952%2012.786%2013.7975%2012.8256%2013.8929C12.8652%2013.9884%2012.9233%2014.0751%2012.9965%2014.1481L30.2822%2031.4338C30.4297%2031.5813%2030.6298%2031.6642%2030.8385%2031.6642C31.0471%2031.6642%2031.2472%2031.5813%2031.3947%2031.4338C31.5423%2031.2863%2031.6252%2031.0862%2031.6252%2030.8775C31.6252%2030.6689%2031.5423%2030.4688%2031.3947%2030.3212L14.109%2013.0355C14.036%2012.9623%2013.9493%2012.9043%2013.8539%2012.8647C13.7584%2012.8251%2013.6561%2012.8047%2013.5527%2012.8047C13.4494%2012.8047%2013.3471%2012.8251%2013.2516%2012.8647C13.1561%2012.9043%2013.0694%2012.9623%2012.9965%2013.0355Z'%20fill='white'/%3e%3c/svg%3e",De="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20fill='white'/%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20stroke='%236B90C0'%20stroke-width='2'/%3e%3ccircle%20cx='14'%20cy='14'%20r='6'%20fill='%236B90C0'/%3e%3c/svg%3e",Fe="_ifStatement_1xsn9_1",Ze="_conditionIcon_1xsn9_7",Ve="_ifStatementContainer_1xsn9_21",qe="_menuButton_1xsn9_27",Ae="_menuIcon_1xsn9_52",Ye="_ifdotIcon_1xsn9_59",$={ifStatement:Fe,conditionIcon:Ze,ifStatementContainer:Ve,menuButton:qe,menuIcon:Ae,ifdotIcon:Ye},Xe=({style:e})=>t.jsx("div",{style:{width:"100%",height:"2px",borderTop:"2px solid #3B64A0",...e}}),Ge=({onEdit:e,onDelete:n,onSelect:s})=>{const o=l.useRef(null),{openMenu:i,closeMenu:a}=Y(),d=l.useMemo(()=>[{label:"Edit",icon:t.jsx(z1,{color:"#3B64A0",size:18}),command:()=>e?.()},{label:"Delete",icon:t.jsx(A,{color:"#3B64A0",size:18}),command:()=>n?.()}],[e,n]),u=c=>{c.stopPropagation(),i(o,c)},r=c=>{c.target.closest(`.${$.menuButton}`)||s?.()};return t.jsxs("div",{className:$.ifStatementContainer,children:[t.jsx(Xe,{style:{position:"absolute",top:"22.5px",left:0,zIndex:1}}),t.jsx("div",{className:$.ifStatement,children:t.jsx("img",{src:ze,alt:"condition",onClick:c=>r(c),className:$.conditionIcon})}),t.jsx("button",{type:"button",className:$.menuButton,onClick:u,"aria-label":"Open menu","aria-haspopup":"menu",children:t.jsx(q,{className:$.menuIcon})}),t.jsx(z,{ref:o,model:d,popup:!0,onHide:()=>a(o)}),t.jsx("img",{src:De,alt:"ifdot",className:$.ifdotIcon})]})},Ke=34.5,h1=({items:e,pathId:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,onDeleteStep:d,onUpdateFilter:u,onSelectStep:r,onResize:c})=>{const x=l.useRef(null),I=l.useRef([]),[_,g]=l.useState([]);l.useEffect(()=>{const p=()=>{if(!x.current||e.length===0){g([]);return}const j=x.current.getBoundingClientRect(),w=[];for(let v=0;v<e.length;v++){const h=I.current[v];if(h){const y=h.getBoundingClientRect();w.push(y.top-j.top+Ke)}}w.length===e.length&&g(w)};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[e]);const m=l.useMemo(()=>_.length!==e.length||e.length<=1?null:e.map((p,j)=>j).filter(p=>p>0).map(p=>{const j=_[p];return j===void 0?null:t.jsx(ke,{width:100,height:j},p)}),[e,_]);return t.jsxs("div",{className:W.row,children:[t.jsx(Ge,{onDelete:()=>n!=null&&d?.(n),onSelect:n!=null&&r?()=>r(n):void 0}),t.jsxs("div",{ref:x,className:W.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100px",height:"2px",borderTop:"2px solid #3B64A0"}}),m]}),t.jsx("div",{className:W.column,children:e.map((p,j)=>{let w;if(p.paths)w=t.jsx(h1,{items:p.paths,pathId:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,onDeleteStep:d,onUpdateFilter:u,onSelectStep:r,onResize:c},p.localId);else if(p.steps){const v=p;w=t.jsxs("div",{className:W.stepsContainer,children:[t.jsx(We,{expression:v.condition,style:{marginTop:"25px"}}),t.jsx(e1,{steps:p.steps,pathId:p.localId,onSelectStep:r??(()=>{}),onAddStep:s??(()=>{}),onAddTrigger:o,onAddCondition:i??(()=>{}),onAddLoop:a,onDeleteStep:d,onUpdateFilter:u,onResize:c},p.localId)]})}else w=t.jsx(X,{localId:p.localId,title:"title"in p?p.title:"",idx:1,icon:"icon"in p?p.icon:void 0,onSelectStep:r,onDeleteStep:d,onUpdateFilter:u},p.localId);return t.jsx("div",{ref:v=>{I.current[j]=v},style:{width:"100%"},children:w},p.localId)})}),t.jsxs("div",{className:W.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:.5,left:0,flex:1,width:"100%",height:"2px",borderTop:"2px solid #3B64A0"}}),m]}),t.jsx(H,{onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,stepId:n,pathId:n,index:1,style:{marginTop:"34px",height:0}}),t.jsx("div",{style:{flex:1,width:"100%",height:"2px",borderTop:"2px solid #3B64A0",marginTop:"34px"}})]})},Q=68,e1=({pathId:e,steps:n,centerY:s,className:o,onAddStep:i,onDeleteStep:a,onUpdateFilter:d,onAddTrigger:u,onAddCondition:r,onAddLoop:c,onSelectStep:x,onResize:I,isDescendent:_=!0})=>{const g=s===void 0?void 0:{marginTop:Math.max(0,s-Q/2)};return n.length===0?t.jsxs("div",{style:{width:"100%",marginTop:"20px",display:"flex",flexDirection:"row",flex:1,minWidth:0,...g},children:[t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}}),t.jsx(H,{onAddStep:()=>{i?.(void 0,e)},onAddTrigger:u,onAddCondition:r,onAddLoop:c,stepId:e,index:0,style:{height:"auto"}}),t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}})]}):t.jsx("div",{className:J.steps+(o?" "+o:""),style:g,children:t.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%",alignItems:"flex-start"},children:[t.jsx(H,{onAddStep:()=>{i?.(n[0].localId,e,"prepend")},onAddTrigger:u,onAddCondition:r,onAddLoop:c,stepId:n[0].localId,pathId:e,index:0,style:{marginTop:"20px"}}),n.map((m,p)=>{const j=!!m.paths,w="condition"in m&&typeof m.condition=="string";let v;return j&&m.paths?v=t.jsx(h1,{items:m.paths,pathId:m.localId,onAddStep:i,onAddCondition:r,onAddLoop:c,onDeleteStep:a,onAddTrigger:u,onSelectStep:x,onUpdateFilter:d,onResize:I},m.title):w?v=t.jsxs(t.Fragment,{children:[t.jsx(C1,{value:m,onAddStep:i,onAddTrigger:u,onAddCondition:r,onAddLoop:c,onDeleteStep:a,onUpdateFilter:d,onSelectStep:x,onResize:I},m.localId),t.jsx(H,{onAddStep:i,onAddTrigger:u,onAddCondition:r,onAddLoop:c,stepId:m.localId,pathId:e,index:p+1,style:{marginTop:"34px",height:0}})]}):v=t.jsxs(t.Fragment,{children:[t.jsx(X,{localId:m.localId,title:m.title,idx:1,icon:m.icon,isSet:m.isSet,isInvalid:m.isInvalid,isFilter:m.isFilter,onSelectStep:x,onDeleteStep:a,onUpdateFilter:d},m.title),t.jsx(H,{onAddStep:i,onAddTrigger:u,onAddCondition:r,onAddLoop:c,stepId:m.localId,pathId:e,index:p+1})]}),t.jsx("div",{className:J.stepContainer+(j||w?" "+J.stepContainerWithPaths:""),children:v},m.localId)}),_&&t.jsx("div",{style:{flexGrow:1,minWidth:0,borderTop:"2px solid #3B64A0",marginTop:"33.5px"}})]})})},Je=()=>t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M17.3006 10.5H23.1986C23.2699 10.5001 23.3397 10.5204 23.3998 10.5586C23.4599 10.5969 23.5079 10.6515 23.5381 10.716C23.5683 10.7805 23.5795 10.8523 23.5704 10.923C23.5613 10.9937 23.5322 11.0603 23.4866 11.115L20.5376 14.655C20.5024 14.6972 20.4584 14.7312 20.4086 14.7545C20.3589 14.7778 20.3046 14.7899 20.2496 14.7899C20.1947 14.7899 20.1404 14.7778 20.0906 14.7545C20.0409 14.7312 19.9968 14.6972 19.9616 14.655L17.0126 11.115C16.967 11.0603 16.938 10.9937 16.9289 10.923C16.9197 10.8523 16.931 10.7805 16.9612 10.716C16.9914 10.6515 17.0394 10.5969 17.0995 10.5586C17.1596 10.5204 17.2294 10.5001 17.3006 10.5ZM0.800641 13.5H6.69864C6.7699 13.5 6.83967 13.4797 6.89979 13.4414C6.95991 13.4032 7.00789 13.3486 7.03811 13.2841C7.06833 13.2195 7.07953 13.1477 7.07042 13.0771C7.06131 13.0064 7.03224 12.9398 6.98664 12.885L4.03764 9.34504C4.00245 9.30283 3.95841 9.26888 3.90864 9.24558C3.85887 9.22228 3.80459 9.21021 3.74964 9.21021C3.69469 9.21021 3.64041 9.22228 3.59064 9.24558C3.54087 9.26888 3.49683 9.30283 3.46164 9.34504L0.512641 12.885C0.467037 12.9398 0.437977 13.0064 0.428862 13.0771C0.419747 13.1477 0.430956 13.2195 0.461175 13.2841C0.491394 13.3486 0.539372 13.4032 0.599493 13.4414C0.659613 13.4797 0.729386 13.5 0.800641 13.5Z",fill:"#41B0AC"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9995 4.50011C9.67152 4.50011 7.58952 5.5606 6.21402 7.2271C6.1526 7.30671 6.0758 7.37316 5.98819 7.42249C5.90057 7.47183 5.80393 7.50304 5.70401 7.51427C5.60409 7.52551 5.50293 7.51653 5.40655 7.48789C5.31016 7.45924 5.22052 7.41151 5.14296 7.34753C5.06539 7.28354 5.00149 7.20462 4.95504 7.11544C4.90859 7.02626 4.88054 6.92865 4.87257 6.82842C4.8646 6.72819 4.87687 6.62737 4.90864 6.53198C4.94041 6.43658 4.99104 6.34854 5.05752 6.27311C6.15581 4.9434 7.61291 3.95712 9.25552 3.43159C10.8981 2.90606 12.6571 2.86338 14.3233 3.30864C15.9895 3.7539 17.4927 4.66835 18.6541 5.94324C19.8156 7.21812 20.5865 8.79978 20.875 10.5001L19.3495 10.5001C19.0032 8.80632 18.0826 7.28409 16.7433 6.19082C15.4041 5.09755 13.7284 4.50032 11.9995 4.50011ZM4.64952 13.5001C4.93349 14.887 5.60405 16.1653 6.58374 17.1873C7.56343 18.2093 8.81226 18.9332 10.186 19.2755C11.5597 19.6178 13.0022 19.5645 14.3469 19.1217C15.6915 18.6789 16.8835 17.8646 17.785 16.7731C17.8464 16.6935 17.9232 16.627 18.0109 16.5777C18.0985 16.5284 18.1951 16.4972 18.295 16.4859C18.395 16.4747 18.4961 16.4837 18.5925 16.5123C18.6889 16.541 18.7785 16.5887 18.8561 16.6527C18.9337 16.7167 18.9976 16.7956 19.044 16.8848C19.0905 16.974 19.1185 17.0716 19.1265 17.1718C19.1344 17.272 19.1222 17.3728 19.0904 17.4682C19.0586 17.5636 19.008 17.6517 18.9415 17.7271C17.8432 19.0568 16.3861 20.0431 14.7435 20.5686C13.1009 21.0942 11.3419 21.1368 9.67576 20.6916C8.0096 20.2463 6.50638 19.3319 5.34491 18.057C4.18343 16.7821 3.41258 15.2004 3.12402 13.5001H4.64952Z",fill:"#41B0AC"})]}),Qe="_container_3aqee_1",Ue="_collapsed_3aqee_16",et="_loopNodeWrapper_3aqee_20",tt="_loopIconWrapper_3aqee_30",nt="_loopBox_3aqee_39",st="_dotsButton_3aqee_56",ot="_label_3aqee_76",it="_limit_3aqee_83",rt="_expandable_3aqee_89",lt="_expandableCollapsed_3aqee_98",ct="_connector_3aqee_104",at="_line_3aqee_112",dt="_circleDot_3aqee_120",ut="_innerDot_3aqee_135",pt="_stepsWrapper_3aqee_142",k={container:Qe,collapsed:Ue,loopNodeWrapper:et,loopIconWrapper:tt,loopBox:nt,dotsButton:st,label:ot,limit:it,expandable:rt,expandableCollapsed:lt,connector:ct,line:at,circleDot:dt,innerDot:ut,stepsWrapper:pt},C1=({value:e,onAddStep:n,onAddTrigger:s,onAddCondition:o,onAddLoop:i,onDeleteStep:a,onUpdateFilter:d,onSelectStep:u,onResize:r})=>{const{localId:c,limit:x,steps:I}=e,_=I??[],g=()=>{},[m,p]=l.useState(!1),j=l.useRef(null),{openMenu:w,closeMenu:v}=Y(),h=U(),y=l.useMemo(()=>[{label:"Remove",icon:t.jsx(A,{color:"#3B64A0",size:18}),command:N=>{N?.originalEvent?.stopPropagation(),a&&a(c)},template:h}],[a,c,h]),P=N=>{N.stopPropagation(),w(j,N)},C=()=>{p(N=>!N),r?.()},f=k.container+(m?"":" "+k.collapsed),M=k.expandable+(m?"":" "+k.expandableCollapsed);return t.jsxs("div",{className:f,children:[t.jsxs("div",{className:k.loopNodeWrapper,children:[t.jsxs("div",{className:k.loopBox,children:[t.jsx("div",{onClick:C,className:k.loopIconWrapper,children:t.jsx(Je,{})}),t.jsx("button",{className:k.dotsButton,onClick:P,children:t.jsx(q,{size:16})}),t.jsx(z,{model:y,popup:!0,ref:j,onHide:()=>v(j)})]}),t.jsx("div",{className:k.label,children:"Loop"}),x!=null&&t.jsxs("div",{className:k.limit,children:[x,"x"]})]}),t.jsxs("div",{className:M,children:[t.jsxs("div",{className:k.connector,children:[t.jsx("div",{className:k.line,style:{width:"12px"}}),t.jsx("div",{className:k.circleDot,children:t.jsx("div",{className:k.innerDot})}),t.jsx("div",{className:k.line})]}),t.jsx("div",{className:k.stepsWrapper,children:t.jsx(e1,{steps:_,pathId:c,onAddStep:n??g,onAddTrigger:s,onAddCondition:o??g,onAddLoop:i,onDeleteStep:a,onUpdateFilter:d??g,onSelectStep:u??g,isDescendent:!0})})]})]})},ht="_container_kielx_1",Ct={container:ht},mt=({process:e,addMultipleTriggers:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,onResize:d,onDeleteTrigger:u,onDeleteStep:r,onUpdateFilter:c,onSelectStep:x})=>{const[I,_]=l.useState(0);return t.jsxs("div",{className:Ct.container,children:[t.jsx(p1,{steps:e.triggers,onAddTrigger:n,onUpdateFilter:c,onDeleteTrigger:u,onSelectStep:x,onCenterYUpdate:_}),e.steps.length>0?t.jsx(e1,{steps:e.steps,centerY:I,onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,onResize:d,onDeleteStep:r,onUpdateFilter:c,onSelectStep:x,isDescendent:!1,pathId:void 0}):t.jsx(H,{onAddStep:()=>s(),onAddTrigger:o,onAddCondition:i,onAddLoop:a,index:0,style:{height:Q,marginTop:Math.max(0,I-Q/2)}})]})};class m1 extends Error{constructor(n){super(n),this.name="AddStepError"}}const c1=e=>"condition"in e&&typeof e.condition=="string",x1=(e,n,s,o)=>{const i=o==="prepend"?n:n+1;return[...e.slice(0,i),s,...e.slice(i)]},t1=(e,n,s,o)=>{for(let i=0;i<e.length;i++){if(e[i].localId===n)return x1(e,i,o,s);const a=e[i],d=a.steps?.length&&t1(a.steps,n,s,o);if(d)return e.map((r,c)=>c===i?{...r,steps:d}:r);const u=a.paths?.length&&f1(a.paths,n,s,o);if(u)return e.map((r,c)=>c===i?{...r,paths:u}:r)}return null},xt=(e,n,s)=>{const o=e.steps??[],i=n==="prepend"?[s,...o]:[...o,s];return{...e,steps:i}},f1=(e,n,s,o)=>{for(let i=0;i<e.length;i++){const a=e[i];if(a.localId===n)return c1(a)?e.map((d,u)=>u===i?xt(a,s,o):d):x1(e,i,o,s);if(c1(a)){const d=a.steps?.length&&t1(a.steps,n,s,o);if(d)return e.map((r,c)=>c===i?{...r,steps:d}:r);const u=a.paths?.length&&f1(a.paths,n,s,o);if(u)return e.map((r,c)=>c===i?{...r,paths:u}:r)}}return null},ft=(e,n,s,o)=>{const i=t1(e.steps,n,s,o);if(i)return{...e,steps:i};throw new m1(`Step or path with id "${n}" not found`)},g1=(e,n)=>({...e,...e.steps!=null&&{steps:n1(e.steps,n)},...e.paths!=null&&{paths:e.paths.map(s=>g1(s,n))}}),n1=(e,n)=>e.filter(s=>s.localId!==n).map(s=>({...s,...s.steps!=null&&{steps:n1(s.steps,n)},...s.paths!=null&&{paths:s.paths.map(o=>g1(o,n))}})),gt=(e,n)=>{const s=n1(e.steps,n);return{...e,steps:s}};exports.AddStepError=m1;exports.Iterator=C1;exports.Menu=z;exports.MenuProvider=J1;exports.ProcessDiagram=mt;exports.ProcessStep=X;exports.Trigger=p1;exports.addStep=ft;exports.deleteStep=gt;exports.useMenuProvider=Y;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("react"),w1=require("react-dom"),y1="_container_8wfnz_1",I1="_step_8wfnz_7",b1="_selected_8wfnz_23",N1="_selectedInvalid_8wfnz_29",k1="_isSet_8wfnz_35",M1="_invalid_8wfnz_39",B1="_filterFlag_8wfnz_45",P1="_title_8wfnz_73",L1="_icon_8wfnz_90",E1="_content_8wfnz_108",S1="_dotsButton_8wfnz_114",b={container:y1,step:I1,selected:b1,selectedInvalid:N1,isSet:k1,invalid:M1,filterFlag:B1,title:P1,icon:L1,content:E1,dotsButton:S1};var a1={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},o1=c.createContext&&c.createContext(a1),T1=["attr","size","title"];function $1(e,n){if(e==null)return{};var s=O1(e,n),o,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)o=a[i],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function O1(e,n){if(e==null)return{};var s={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(n.indexOf(o)>=0)continue;s[o]=e[o]}return s}function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o])}return e},Z.apply(this,arguments)}function i1(e,n){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),s.push.apply(s,o)}return s}function V(e){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?i1(Object(s),!0).forEach(function(o){H1(e,o,s[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):i1(Object(s)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(s,o))})}return e}function H1(e,n,s){return n=R1(n),n in e?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s,e}function R1(e){var n=W1(e,"string");return typeof n=="symbol"?n:n+""}function W1(e,n){if(typeof e!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var o=s.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function d1(e){return e&&e.map((n,s)=>c.createElement(n.tag,V({key:s},n.attr),d1(n.child)))}function R(e){return n=>c.createElement(z1,Z({attr:V({},e.attr)},n),d1(e.child))}function z1(e){var n=s=>{var{attr:o,size:i,title:a}=e,d=$1(e,T1),u=i||s.size||"1em",r;return s.className&&(r=s.className),e.className&&(r=(r?r+" ":"")+e.className),c.createElement("svg",Z({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,o,d,{className:r,style:V(V({color:e.color||s.color},s.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&c.createElement("title",null,a),e.children)};return o1!==void 0?c.createElement(o1.Consumer,null,s=>n(s)):n(a1)}function D1(e){return R({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.52.359A.5.5 0 0 1 6 0h4a.5.5 0 0 1 .474.658L8.694 6H12.5a.5.5 0 0 1 .395.807l-7 9a.5.5 0 0 1-.873-.454L6.823 9.5H3.5a.5.5 0 0 1-.48-.641zM6.374 1 4.168 8.5H7.5a.5.5 0 0 1 .478.647L6.78 13.04 11.478 7H8a.5.5 0 0 1-.474-.658L9.306 1z"},child:[]}]})(e)}function u1(e){return R({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325"},child:[]}]})(e)}function q(e){return R({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(e)}function A(e){return R({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"},child:[]},{tag:"path",attr:{d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"},child:[]}]})(e)}const F1="_panel_19663_1",Z1="_panelExiting_19663_13",V1="_menuItem_19663_37",q1="_disabled_19663_52",A1="_menuItemIcon_19663_57",Y1="_menuItemText_19663_63",X1="_overlay_19663_69",E={panel:F1,panelExiting:Z1,menuItem:V1,disabled:q1,menuItemIcon:A1,menuItemText:Y1,overlay:X1},G1=e=>{const s=e.currentTarget??e.target;if(s?.getBoundingClientRect){const i=s.getBoundingClientRect();return{top:i.bottom+2,left:i.left}}const o=e;return{top:(o.clientY??0)+2,left:o.clientX??0}},z=c.forwardRef(function({model:n,popup:s=!0,onHide:o,onClick:i},a){const[d,u]=c.useState(!1),[r,l]=c.useState(!1),[x,I]=c.useState({top:0,left:0}),v=c.useRef(null),_=c.useCallback(()=>{r||l(!0)},[r]),C=c.useCallback(m=>{r&&m.animationName.includes("menuOut")&&(u(!1),l(!1),o?.())},[r,o]),p=c.useCallback(m=>{I(G1(m)),l(!1),u(!0)},[]),y=c.useCallback(m=>{d?_():p(m)},[d,_,p]);c.useImperativeHandle(a,()=>({show:p,hide:_,toggle:y}),[p,_,y]),c.useEffect(()=>{if(!d)return;const m=P=>{P.key==="Escape"&&_()},w=P=>{const h=v.current;h&&!h.contains(P.target)&&(P.stopPropagation(),_())};return document.addEventListener("keydown",m),document.addEventListener("mousedown",w),()=>{document.removeEventListener("keydown",m),document.removeEventListener("mousedown",w)}},[d,_]);const j=(m,w)=>{w.stopPropagation(),m.command?.({originalEvent:w,item:m}),_()},g=(m,w)=>{const P=h=>j(m,h);return m.template?t.jsx(c.Fragment,{children:m.template(m,{onClick:P})},w):t.jsxs("button",{type:"button",className:`${E.menuItem} ${m.disabled&&E.disabled}`,onClick:h=>{m.disabled||P(h)},children:[m.icon&&t.jsx("span",{className:E.menuItemIcon,children:m.icon}),t.jsx("span",{className:E.menuItemText,children:m.label})]},w)};return!d||!s?null:w1.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:E.overlay,"aria-hidden":!0,onClick:()=>_(),onMouseDown:m=>m.stopPropagation()}),t.jsx("div",{ref:v,className:`${E.panel} ${r?E.panelExiting:""}`,role:"menu",style:{top:x.top,left:x.left},onAnimationEnd:C,onClick:m=>{m.stopPropagation(),i?.(m)},children:n.map(g)})]}),document.body)}),U=()=>(e,n)=>t.jsxs("button",{className:E.menuItem,onClick:s=>n.onClick(s),children:[t.jsx("span",{className:E.menuItemIcon,children:e.icon}),t.jsx("span",{className:E.menuItemText,children:e.label})]}),K1=({width:e=16,height:n=16,color:s="#3B64A0"})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("rect",{x:"7.99219",y:"0.222732",width:"11",height:"11",rx:"1.5",transform:"rotate(45 7.99219 0.222732)",stroke:s}),t.jsx("path",{d:"M10.4693 5.52599L5.52513 10.4813M5.52513 5.53151L10.4749 10.4813",stroke:s,strokeLinecap:"round"})]}),J1=({width:e=16,height:n=16,color:s="#3B64A0"})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M11.5341 7.00002H15.4661C15.5136 7.00004 15.5601 7.01359 15.6002 7.03909C15.6403 7.06459 15.6722 7.10098 15.6924 7.144C15.7125 7.18702 15.72 7.23489 15.7139 7.282C15.7079 7.32912 15.6885 7.37352 15.6581 7.41002L13.6921 9.77002C13.6686 9.79816 13.6393 9.82079 13.6061 9.83633C13.5729 9.85186 13.5367 9.85991 13.5001 9.85991C13.4635 9.85991 13.4273 9.85186 13.3941 9.83633C13.3609 9.82079 13.3315 9.79816 13.3081 9.77002L11.3421 7.41002C11.3117 7.37352 11.2923 7.32912 11.2862 7.282C11.2802 7.23489 11.2876 7.18702 11.3078 7.144C11.3279 7.10098 11.3599 7.06459 11.4 7.03909C11.4401 7.01359 11.4866 7.00004 11.5341 7.00002ZM0.534086 9.00002H4.46609C4.51359 9.00001 4.56011 8.98645 4.60019 8.96096C4.64027 8.93546 4.67225 8.89907 4.6924 8.85605C4.71254 8.81303 4.72002 8.76516 4.71394 8.71804C4.70786 8.67093 4.68849 8.62652 4.65809 8.59002L2.69209 6.23002C2.66862 6.20189 2.63926 6.17925 2.60609 6.16372C2.57291 6.14819 2.53672 6.14014 2.50009 6.14014C2.46345 6.14014 2.42726 6.14819 2.39409 6.16372C2.36091 6.17925 2.33155 6.20189 2.30809 6.23002L0.342086 8.59002C0.311684 8.62652 0.29231 8.67093 0.286234 8.71804C0.280157 8.76516 0.287629 8.81303 0.307775 8.85605C0.327921 8.89907 0.359907 8.93546 0.399987 8.96096C0.440067 8.98645 0.486583 9.00001 0.534086 9.00002Z",fill:s}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00001 3.00023C6.44801 3.00023 5.06001 3.70723 4.14301 4.81823C4.10206 4.87131 4.05086 4.9156 3.99245 4.94849C3.93404 4.98138 3.86961 5.00219 3.803 5.00968C3.73638 5.01717 3.66895 5.01119 3.60469 4.99209C3.54043 4.97299 3.48068 4.94117 3.42897 4.89851C3.37726 4.85586 3.33465 4.80324 3.30368 4.74379C3.27272 4.68434 3.25402 4.61926 3.24871 4.55244C3.24339 4.48562 3.25157 4.41841 3.27275 4.35481C3.29394 4.29121 3.32769 4.23252 3.37201 4.18223C4.1042 3.29576 5.0756 2.63824 6.17067 2.28789C7.26575 1.93753 8.43841 1.90908 9.54918 2.20592C10.66 2.50276 11.6621 3.1124 12.4364 3.96232C13.2107 4.81224 13.7246 5.86668 13.917 7.00023H12.9C12.6691 5.87104 12.0554 4.85623 11.1625 4.12738C10.2697 3.39853 9.15256 3.00037 8.00001 3.00023ZM3.10001 9.00023C3.28932 9.92486 3.73636 10.7771 4.38949 11.4584C5.04261 12.1397 5.87517 12.6223 6.79097 12.8505C7.70677 13.0787 8.66845 13.0431 9.5649 12.7479C10.4613 12.4527 11.256 11.9099 11.857 11.1822C11.898 11.1292 11.9492 11.0849 12.0076 11.052C12.066 11.0191 12.1304 10.9983 12.197 10.9908C12.2636 10.9833 12.3311 10.9893 12.3953 11.0084C12.4596 11.0275 12.5193 11.0593 12.5711 11.102C12.6228 11.1446 12.6654 11.1972 12.6963 11.2567C12.7273 11.3161 12.746 11.3812 12.7513 11.448C12.7566 11.5148 12.7484 11.5821 12.7273 11.6457C12.7061 11.7093 12.6723 11.7679 12.628 11.8182C11.8958 12.7047 10.9244 13.3622 9.82934 13.7126C8.73427 14.0629 7.56161 14.0914 6.45083 13.7945C5.34006 13.4977 4.33791 12.8881 3.5636 12.0381C2.78928 11.1882 2.27538 10.1338 2.08301 9.00023H3.10001Z",fill:s})]}),r1=({width:e=16,height:n=16,color:s="#3B64A0"})=>t.jsxs("svg",{width:e,height:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M8 15C6.14348 15 4.36301 14.2625 3.05025 12.9497C1.7375 11.637 1 9.85652 1 8C1 6.14348 1.7375 4.36301 3.05025 3.05025C4.36301 1.7375 6.14348 1 8 1C9.85652 1 11.637 1.7375 12.9497 3.05025C14.2625 4.36301 15 6.14348 15 8C15 9.85652 14.2625 11.637 12.9497 12.9497C11.637 14.2625 9.85652 15 8 15ZM8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.84344 15.1571 5.87827 16 8 16Z",fill:s}),t.jsx("path",{d:"M7 11.5C7 11.3674 7.05268 11.2402 7.14645 11.1464C7.24021 11.0527 7.36739 11 7.5 11H8.5C8.63261 11 8.75979 11.0527 8.85355 11.1464C8.94732 11.2402 9 11.3674 9 11.5C9 11.6326 8.94732 11.7598 8.85355 11.8536C8.75979 11.9473 8.63261 12 8.5 12H7.5C7.36739 12 7.24021 11.9473 7.14645 11.8536C7.05268 11.7598 7 11.6326 7 11.5ZM5 8.5C5 8.36739 5.05268 8.24021 5.14645 8.14645C5.24021 8.05268 5.36739 8 5.5 8H10.5C10.6326 8 10.7598 8.05268 10.8536 8.14645C10.9473 8.24021 11 8.36739 11 8.5C11 8.63261 10.9473 8.75979 10.8536 8.85355C10.7598 8.94732 10.6326 9 10.5 9H5.5C5.36739 9 5.24021 8.94732 5.14645 8.85355C5.05268 8.75979 5 8.63261 5 8.5ZM3 5.5C3 5.36739 3.05268 5.24021 3.14645 5.14645C3.24021 5.05268 3.36739 5 3.5 5H12.5C12.6326 5 12.7598 5.05268 12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5C13 5.63261 12.9473 5.75979 12.8536 5.85355C12.7598 5.94732 12.6326 6 12.5 6H3.5C3.36739 6 3.24021 5.94732 3.14645 5.85355C3.05268 5.75979 3 5.63261 3 5.5Z",fill:s})]}),p1=c.createContext(void 0),Q1=({children:e})=>{const[n,s]=c.useState([]),o=c.useCallback((d,u)=>{s(r=>(r.forEach(l=>{l.current&&l!==d&&l.current.hide(u)}),[])),d.current?.toggle(u),s([d])},[]),i=c.useCallback(d=>{s(u=>u.filter(r=>r!==d))},[]),a=c.useMemo(()=>({openMenus:n,openMenu:o,closeMenu:i}),[n,o,i]);return t.jsx(p1.Provider,{value:a,children:e})},Y=()=>{const e=c.useContext(p1);if(e===void 0)throw new Error("useMenuProvider must be used within a MenuProvider");return e},U1=({color:e="#E32012"})=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[t.jsx("g",{clipPath:"url(#clip0_3105_5367)",children:t.jsx("path",{d:"M16 8C16 10.1217 15.1571 12.1566 13.6569 13.6569C12.1566 15.1571 10.1217 16 8 16C5.87827 16 3.84344 15.1571 2.34315 13.6569C0.842855 12.1566 0 10.1217 0 8C0 5.87827 0.842855 3.84344 2.34315 2.34315C3.84344 0.842855 5.87827 0 8 0C10.1217 0 12.1566 0.842855 13.6569 2.34315C15.1571 3.84344 16 5.87827 16 8ZM8 4C7.87361 4.00007 7.74863 4.02662 7.63312 4.07793C7.51761 4.12924 7.41413 4.20418 7.32934 4.29791C7.24456 4.39165 7.18035 4.5021 7.14084 4.62217C7.10134 4.74223 7.08743 4.86923 7.1 4.995L7.45 8.502C7.46176 8.63977 7.5248 8.76811 7.62664 8.86164C7.72849 8.95516 7.86173 9.00705 8 9.00705C8.13827 9.00705 8.27151 8.95516 8.37336 8.86164C8.4752 8.76811 8.53824 8.63977 8.55 8.502L8.9 4.995C8.91257 4.86923 8.89866 4.74223 8.85915 4.62217C8.81965 4.5021 8.75544 4.39165 8.67066 4.29791C8.58587 4.20418 8.48239 4.12924 8.36688 4.07793C8.25137 4.02662 8.12639 4.00007 8 4ZM8.002 10C7.73678 10 7.48243 10.1054 7.29489 10.2929C7.10736 10.4804 7.002 10.7348 7.002 11C7.002 11.2652 7.10736 11.5196 7.29489 11.7071C7.48243 11.8946 7.73678 12 8.002 12C8.26722 12 8.52157 11.8946 8.70911 11.7071C8.89664 11.5196 9.002 11.2652 9.002 11C9.002 10.7348 8.89664 10.4804 8.70911 10.2929C8.52157 10.1054 8.26722 10 8.002 10Z",fill:e})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_3105_5367",children:t.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),X=e=>{const{isSet:n,isSelected:s,isFilter:o,className:i,title:a,icon:d,contextMenuItems:u=void 0,onDeleteStep:r,onUpdateFilter:l,onSelectStep:x,subtitle:I,isInvalid:v,localId:_}=e,C=c.useRef(null),{openMenu:p,closeMenu:y}=Y(),j=U(),g=c.useMemo(()=>[{label:"Add Step Filter",icon:t.jsx("div",{className:"mr-2 flex items-center justify-center",children:t.jsx(r1,{})}),command:f=>{f?.originalEvent?.stopPropagation(),l&&l(_)},template:j},{label:"Remove",icon:t.jsx(A,{color:"#3B64A0",size:18}),command:f=>{f?.originalEvent?.stopPropagation(),r&&r(_)},template:j}],[l,r,_,j]),m=c.useMemo(()=>u!==void 0?u:g,[u,g]),w=f=>{f.stopPropagation(),p(C,f)},P=c.useMemo(()=>s&&v?b.step+" "+b.selectedInvalid:s?b.step+" "+b.selected:n?b.step+" "+b.isSet:v?b.step+" "+b.invalid:b.step,[n,s,v]),h=c.useMemo(()=>v?t.jsx(U1,{color:"#E32012"}):d,[d,v]);return t.jsx("div",{className:b.container+" "+i,children:t.jsxs("div",{children:[t.jsxs("div",{className:P,onClick:()=>x(_),children:[t.jsxs("div",{className:b.content,children:[t.jsx("div",{className:`${b.icon} ${v&&b.invalid}`,children:h}),t.jsx("div",{className:b.title,children:a})]}),t.jsx("button",{className:b.dotsButton,onClick:w,"aria-haspopup":!0,"aria-label":"Step options",children:t.jsx(q,{className:b.dots,color:v?"#E32012":"#3B64A0"})}),t.jsx(z,{model:m,popup:!0,ref:C,onClick:f=>f.stopPropagation(),onHide:()=>y(C)})]}),o&&t.jsxs("div",{className:b.filterFlag,role:"button",tabIndex:0,onClick:()=>{l&&l(_)},onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&l&&(f.preventDefault(),l(_))},children:[t.jsx(r1,{color:"#3B64A0"}),t.jsx("span",{children:"Filter"}),t.jsx(q,{className:b.dots,color:v?"#E32012":"#3B64A0",style:{height:"10px"}})]}),I&&t.jsx("div",{className:b.subtitle,children:I})]})})},ee=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[t.jsxs("g",{clipPath:"url(#clip0_6551_9169)",children:[t.jsx("rect",{width:"24",height:"24",rx:"12",fill:"#0C971F"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V11H18C18.5523 11 19 11.4477 19 12C19 12.5523 18.5523 13 18 13H13V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H6C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11H11V6Z",fill:"white"})]}),t.jsx("rect",{x:"0.75",y:"0.75",width:"22.5",height:"22.5",rx:"11.25",stroke:"#14BC2B",strokeWidth:"1.5"}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_6551_9169",children:t.jsx("rect",{width:"24",height:"24",rx:"12",fill:"white"})})})]}),te="_multipleTriggersIcon_oxhdi_1",ne={multipleTriggersIcon:te},se=()=>t.jsx("div",{className:ne.multipleTriggersIcon,children:t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 3.75C1.5 3.15326 1.73705 2.58097 2.15901 2.15901C2.58097 1.73705 3.15326 1.5 3.75 1.5H5.25C5.84674 1.5 6.41903 1.73705 6.84099 2.15901C7.26295 2.58097 7.5 3.15326 7.5 3.75L13.701 3.75C13.8661 3.46404 14.1209 3.24054 14.426 3.11418C14.7311 2.98782 15.0693 2.96565 15.3883 3.05111C15.7072 3.13657 15.9891 3.32489 16.1901 3.58686C16.3911 3.84882 16.5 4.1698 16.5 4.5C16.5 4.8302 16.3911 5.15118 16.1901 5.41314C15.9891 5.67511 15.7072 5.86343 15.3883 5.94889C15.0693 6.03435 14.7311 6.01218 14.426 5.88582C14.1209 5.75946 13.8661 5.53596 13.701 5.25H10.686C10.956 5.52 11.196 5.8215 11.412 6.1575C12.369 7.6455 12.75 9.6885 12.75 12C12.75 14.9895 13.1355 16.638 13.8195 17.55C14.3535 18.264 15.162 18.6315 16.5 18.726C16.5063 18.1334 16.7462 17.5673 17.1674 17.1505C17.5887 16.7337 18.1574 16.5 18.75 16.5H20.25C20.8467 16.5 21.419 16.7371 21.841 17.159C22.2629 17.581 22.5 18.1533 22.5 18.75V20.25C22.5 20.8467 22.2629 21.419 21.841 21.841C21.419 22.2629 20.8467 22.5 20.25 22.5H18.75C18.1533 22.5 17.581 22.2629 17.159 21.841C16.7371 21.419 16.5 20.8467 16.5 20.25H10.299C10.1339 20.536 9.87905 20.7595 9.57399 20.8858C9.26892 21.0122 8.93068 21.0344 8.61173 20.9489C8.29278 20.8634 8.01095 20.6751 7.80993 20.4131C7.60892 20.1512 7.49996 19.8302 7.49996 19.5C7.49996 19.1698 7.60892 18.8488 7.80993 18.5869C8.01095 18.3249 8.29278 18.1366 8.61173 18.0511C8.93068 17.9656 9.26892 17.9878 9.57399 18.1142C9.87905 18.2405 10.1339 18.464 10.299 18.75H12.8655C12.7785 18.6538 12.6959 18.5537 12.618 18.45C11.6145 17.1105 11.25 15.0105 11.25 12C11.25 9.81 10.881 8.1045 10.1505 6.9675C9.5655 6.06 8.7225 5.4675 7.5 5.2995C7.48706 5.88762 7.2443 6.44728 6.82374 6.85859C6.40318 7.2699 5.83826 7.50014 5.25 7.5H3.75C3.15326 7.5 2.58097 7.26295 2.15901 6.84099C1.73705 6.41903 1.5 5.84674 1.5 5.25V3.75ZM3.75 3C3.55109 3 3.36032 3.07902 3.21967 3.21967C3.07902 3.36032 3 3.55109 3 3.75V5.25C3 5.44891 3.07902 5.63968 3.21967 5.78033C3.36032 5.92098 3.55109 6 3.75 6H5.25C5.44891 6 5.63968 5.92098 5.78033 5.78033C5.92098 5.63968 6 5.44891 6 5.25V3.75C6 3.55109 5.92098 3.36032 5.78033 3.21967C5.63968 3.07902 5.44891 3 5.25 3H3.75ZM18.75 18C18.5511 18 18.3603 18.079 18.2197 18.2197C18.079 18.3603 18 18.5511 18 18.75V20.25C18 20.4489 18.079 20.6397 18.2197 20.7803C18.3603 20.921 18.5511 21 18.75 21H20.25C20.4489 21 20.6397 20.921 20.7803 20.7803C20.921 20.6397 21 20.4489 21 20.25V18.75C21 18.5511 20.921 18.3603 20.7803 18.2197C20.6397 18.079 20.4489 18 20.25 18H18.75Z",fill:"white"})})}),oe="_trigger_kfg1y_1",ie="_title_kfg1y_7",re="_empty_kfg1y_15",le="_triggerContainer_kfg1y_21",ce="_stepsContainer_kfg1y_25",ae="_stepItem_kfg1y_51",de="_curvesSvg_kfg1y_70",ue="_centralNode_kfg1y_78",pe="_iconWrapper_kfg1y_104",he="_fadeIn_kfg1y_127",Ce="_fadeOut_kfg1y_130",me="_operationContainer_kfg1y_134",B={trigger:oe,title:ie,empty:re,triggerContainer:le,stepsContainer:ce,stepItem:ae,curvesSvg:de,centralNode:ue,iconWrapper:pe,fadeIn:he,fadeOut:Ce,operationContainer:me},xe=()=>t.jsx("div",{style:{height:"1px",marginLeft:"4px",marginRight:"4px",borderTop:"1px solid #a1bbdc"}}),fe=80,D=34,h1=({steps:e,title:n,className:s,onDeleteTrigger:o,onAddTrigger:i,onSelectStep:a,onUpdateFilter:d,onCenterYUpdate:u})=>{const r=c.useRef(null),l=c.useRef([]),[x,I]=c.useState([]),[v,_]=c.useState({width:0,height:0}),[C,p]=c.useState(!1),[y,j]=c.useState(!1),g=c.useRef(null);c.useEffect(()=>{const h=()=>{if(!r.current)return;const f=[];if(l.current.forEach((M,L)=>{if(M&&r.current){const N=r.current.getBoundingClientRect(),S=M.getBoundingClientRect();f.push({localId:e[L]?.localId??`step-${L}`,top:S.top-N.top,right:S.right-N.left,centerY:S.top-N.top+S.height/2})}}),I(f),r.current&&f.length>0){const M=r.current.getBoundingClientRect(),L=Math.min(...f.map(T=>T.top)),N=l.current.filter(Boolean).map(T=>T?.offsetHeight||68),S=Math.max(...f.map((T,j1)=>T.top+(N[j1]||68))),G=Math.max(...f.map(T=>T.right))+0,K=Math.max(M.height,S-L+100);_({width:G,height:K})}};return h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[e]),c.useEffect(()=>{let h=!0;if(C){g.current&&(clearTimeout(g.current),g.current=null);const f=setTimeout(()=>{h&&j(!0)},0);return()=>{h=!1,clearTimeout(f)}}return g.current=setTimeout(()=>{h&&j(!1)},140),()=>{h=!1,g.current&&(clearTimeout(g.current),g.current=null)}},[C]);const m=x.length>0?fe:0,w=c.useMemo(()=>x.length>1?x.reduce((h,f)=>h+f.top+D,0)/x.length:x.length===1?x[0].top+D:0,[x]);if(c.useEffect(()=>{u?.(w)},[w,u]),e.length===0)return t.jsxs("div",{className:`${B.trigger} ${s||""}`,children:[n&&t.jsx("h3",{className:B.title,children:n}),t.jsx("div",{className:B.empty,children:"No steps"})]});const P=(h,f,M,L)=>{const N=M-h,S=Math.min(N*.6,60),s1=h+S,G=f,K=M-S;return`M ${h} ${f} C ${s1} ${G}, ${K} ${L}, ${M} ${L}`};return t.jsxs("div",{className:`${B.trigger} ${s||""}`,ref:r,children:[n&&t.jsx("h3",{className:B.title,children:n}),t.jsxs("div",{className:B.triggerContainer,children:[t.jsx("div",{className:B.stepsContainer,children:e.map((h,f)=>t.jsx("div",{ref:M=>{l.current[f]=M},children:t.jsx(X,{title:h.title,className:B.stepItem,localId:h.localId,idx:f,isSet:h.isSet,isSelected:h.isSelected,isInvalid:h.isInvalid,isFilter:h.isFilter,icon:h.icon,onSelectStep:a,onUpdateFilter:d,contextMenuItems:[{label:"Delete",icon:t.jsx(A,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{o?.(h.localId)},disabled:e.length===1},{label:"",template:()=>t.jsx(xe,{})},{label:"Add More Triggers",icon:t.jsx(D1,{className:"mr-2",color:"#3B64A0",size:18}),command:()=>{i?.()}}]})},h.localId))}),t.jsx("div",{style:{position:"relative"},children:x.length>1&&t.jsx("svg",{className:B.curvesSvg,width:v.width,height:v.height,children:x.map(h=>{const M=x.length===1?x[0].top+D:h.top+D,L=m,N=w;return t.jsx("path",{d:P(0,M,L,N),stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"},h.localId)})})}),x.length>1?t.jsxs("div",{style:{position:"relative",marginRight:"140px"},children:[t.jsx("div",{className:B.centralNode,style:{"--node-x":`${m}px`,"--node-y":`${w}px`},onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:y?t.jsx("div",{className:`${B.iconWrapper} ${C?B.fadeIn:B.fadeOut}`,onClick:i,children:t.jsx(ee,{})}):null}),t.jsx("div",{className:B.operationContainer,style:{"--op-x":`${m+16}px`,"--op-y":`${w}px`},children:t.jsx(se,{})})]}):null]})]})};function ge(e){return R({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"4"},child:[]},{tag:"line",attr:{x1:"1.05",y1:"12",x2:"7",y2:"12"},child:[]},{tag:"line",attr:{x1:"17.01",y1:"12",x2:"22.96",y2:"12"},child:[]}]})(e)}function ve(e){return R({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"},child:[]}]})(e)}const _e=()=>t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M6 12L18 12",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"}),t.jsx("path",{d:"M12 6V18",stroke:"#3B64A0",strokeWidth:"2",strokeLinecap:"round"})]}),je="_stepLinkIcon_18u2g_1",we="_stepLinkLine_18u2g_15",ye="_stepLinkContainer_18u2g_39",F={stepLinkIcon:je,stepLinkLine:we,stepLinkContainer:ye},H=({onAddStep:e,onAddTrigger:n,onAddCondition:s,onAddLoop:o,stepId:i,index:a=0,style:d,pathId:u})=>{const r=U(),l=c.useRef(null),x=[...a>0?[{label:"Trigger",icon:t.jsx(ve,{color:"#3B64A0",size:18}),command:()=>{n?.(i,u,"trigger")},template:r}]:[],{label:"Step",icon:t.jsx(ge,{color:"#3B64A0",size:18}),command:()=>e?.(i,u,"append"),template:r},...i?[{label:"Condition",icon:t.jsx(K1,{width:18,height:18}),command:()=>s?.(i,u,"append"),template:r},{label:"Loop",icon:t.jsx(J1,{width:18,height:18}),command:()=>o?.(i,u,"append"),template:r}]:[]],I=v=>{l.current?.show(v)};return t.jsxs("div",{className:F.stepLinkContainer,style:{...d},"data-plus-index":a,children:[t.jsx("div",{className:F.stepLinkLine}),t.jsx("div",{className:F.stepLinkIcon,onClick:I,"aria-haspopup":!0,children:t.jsx(_e,{})}),t.jsx(z,{model:x,popup:!0,ref:l}),t.jsx("div",{className:F.stepLinkLine})]})},Ie="_steps_yug55_1",be="_stepContainer_yug55_8",Ne="_stepContainerWithPaths_yug55_14",J={steps:Ie,stepContainer:be,stepContainerWithPaths:Ne},ke=(e,n,s,o)=>{const i=s-e,a=Math.min(i*.66,66),d=e+a,u=n,r=s-a;return`M ${e} ${n} C ${d} ${u}, ${r} ${o}, ${s} ${o}`},Me=({width:e,height:n})=>{const d=ke(0,1,e,n);return t.jsx("div",{style:{position:"absolute"},children:t.jsx("svg",{width:e,height:n+1,viewBox:`0 0 ${e} ${n+1}`,xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d,stroke:"#3b64a0",strokeWidth:"2",fill:"none",strokeLinecap:"round"})})})},Be="_column_1uiy3_1",Pe="_row_1uiy3_19",Le="_stepsContainer_1uiy3_24",W={column:Be,row:Pe,stepsContainer:Le},Ee="_wrapper_1nl2d_1",Se="_tooltip_1nl2d_5",l1={wrapper:Ee,tooltip:Se},Te=({content:e,children:n,maxWidth:s=500,className:o})=>t.jsxs("div",{className:`${l1.wrapper} ${o??""}`.trim(),style:{"--tooltip-max-width":`${s}px`},children:[n,e?t.jsx("div",{className:l1.tooltip,role:"tooltip",children:e}):null]}),$e="_conditionContainer_5kl8s_1",Oe="_connectorLine_5kl8s_6",He="_conditionWrapper_5kl8s_12",Re="_condition_5kl8s_1",We="_connectorDot_5kl8s_43",O={conditionContainer:$e,connectorLine:Oe,conditionWrapper:He,condition:Re,connectorDot:We},C1=({expression:e,style:n})=>{const s=c.useRef(null),[o,i]=c.useState(!1);c.useLayoutEffect(()=>{const d=s.current;d&&i(d.scrollHeight>d.clientHeight)},[e]);const a=e&&o?e:"";return t.jsxs("div",{className:O.conditionContainer,style:n,children:[t.jsx("div",{className:O.connectorLine}),t.jsx(Te,{content:a,className:O.conditionWrapper,children:t.jsx("div",{ref:s,className:O.condition,children:e})}),t.jsx("div",{className:O.connectorLine}),t.jsx("div",{className:O.connectorDot})]})},ze="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='21.8125'%20y='-2.52539'%20width='34.4207'%20height='34.4207'%20rx='6.09524'%20transform='rotate(45%2021.8125%20-2.52539)'%20fill='%236B90C0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M31.3947%2013.0355C31.4679%2013.1085%2031.526%2013.1952%2031.5656%2013.2907C31.6052%2013.3861%2031.6256%2013.4885%2031.6256%2013.5918C31.6256%2013.6952%2031.6052%2013.7975%2031.5656%2013.8929C31.526%2013.9884%2031.4679%2014.0751%2031.3947%2014.1481L14.109%2031.4338C13.9615%2031.5813%2013.7614%2031.6642%2013.5527%2031.6642C13.3441%2031.6642%2013.144%2031.5813%2012.9965%2031.4338C12.8489%2031.2863%2012.766%2031.0862%2012.766%2030.8775C12.766%2030.6689%2012.8489%2030.4688%2012.9965%2030.3212L30.2822%2013.0355C30.3552%2012.9623%2030.4419%2012.9043%2030.5373%2012.8647C30.6328%2012.8251%2030.7351%2012.8047%2030.8385%2012.8047C30.9418%2012.8047%2031.0441%2012.8251%2031.1396%2012.8647C31.2351%2012.9043%2031.3218%2012.9623%2031.3947%2013.0355Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.9965%2013.0355C12.9233%2013.1085%2012.8652%2013.1952%2012.8256%2013.2907C12.786%2013.3861%2012.7656%2013.4885%2012.7656%2013.5918C12.7656%2013.6952%2012.786%2013.7975%2012.8256%2013.8929C12.8652%2013.9884%2012.9233%2014.0751%2012.9965%2014.1481L30.2822%2031.4338C30.4297%2031.5813%2030.6298%2031.6642%2030.8385%2031.6642C31.0471%2031.6642%2031.2472%2031.5813%2031.3947%2031.4338C31.5423%2031.2863%2031.6252%2031.0862%2031.6252%2030.8775C31.6252%2030.6689%2031.5423%2030.4688%2031.3947%2030.3212L14.109%2013.0355C14.036%2012.9623%2013.9493%2012.9043%2013.8539%2012.8647C13.7584%2012.8251%2013.6561%2012.8047%2013.5527%2012.8047C13.4494%2012.8047%2013.3471%2012.8251%2013.2516%2012.8647C13.1561%2012.9043%2013.0694%2012.9623%2012.9965%2013.0355Z'%20fill='white'/%3e%3c/svg%3e",De="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20fill='white'/%3e%3crect%20x='1'%20y='1'%20width='26'%20height='26'%20rx='13'%20stroke='%236B90C0'%20stroke-width='2'/%3e%3ccircle%20cx='14'%20cy='14'%20r='6'%20fill='%236B90C0'/%3e%3c/svg%3e",Fe="_ifStatement_1xsn9_1",Ze="_conditionIcon_1xsn9_7",Ve="_ifStatementContainer_1xsn9_21",qe="_menuButton_1xsn9_27",Ae="_menuIcon_1xsn9_52",Ye="_ifdotIcon_1xsn9_59",$={ifStatement:Fe,conditionIcon:Ze,ifStatementContainer:Ve,menuButton:qe,menuIcon:Ae,ifdotIcon:Ye},Xe=({style:e})=>t.jsx("div",{style:{width:"100%",height:"2px",borderTop:"2px solid #3B64A0",...e}}),Ge=({onEdit:e,onDelete:n,onSelect:s})=>{const o=c.useRef(null),{openMenu:i,closeMenu:a}=Y(),d=c.useMemo(()=>[{label:"Edit",icon:t.jsx(u1,{color:"#3B64A0",size:18}),command:()=>e?.()},{label:"Delete",icon:t.jsx(A,{color:"#3B64A0",size:18}),command:()=>n?.()}],[e,n]),u=l=>{l.stopPropagation(),i(o,l)},r=l=>{l.target.closest(`.${$.menuButton}`)||s?.()};return t.jsxs("div",{className:$.ifStatementContainer,children:[t.jsx(Xe,{style:{position:"absolute",top:"22.5px",left:0,zIndex:1}}),t.jsx("div",{className:$.ifStatement,children:t.jsx("img",{src:ze,alt:"condition",onClick:l=>r(l),className:$.conditionIcon})}),t.jsx("button",{type:"button",className:$.menuButton,onClick:u,"aria-label":"Open menu","aria-haspopup":"menu",children:t.jsx(q,{className:$.menuIcon})}),t.jsx(z,{ref:o,model:d,popup:!0,onHide:()=>a(o)}),t.jsx("img",{src:De,alt:"ifdot",className:$.ifdotIcon})]})},Ke=34.5,m1=({items:e,pathId:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,onDeleteStep:d,onUpdateFilter:u,onSelectStep:r,onResize:l})=>{const x=c.useRef(null),I=c.useRef([]),[v,_]=c.useState([]);c.useEffect(()=>{const p=()=>{if(!x.current||e.length===0){_([]);return}const y=x.current.getBoundingClientRect(),j=[];for(let g=0;g<e.length;g++){const m=I.current[g];if(m){const w=m.getBoundingClientRect();j.push(w.top-y.top+Ke)}}j.length===e.length&&_(j)};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[e]);const C=c.useMemo(()=>v.length!==e.length||e.length<=1?null:e.map((p,y)=>y).filter(p=>p>0).map(p=>{const y=v[p];return y===void 0?null:t.jsx(Me,{width:100,height:y},p)}),[e,v]);return t.jsxs("div",{className:W.row,children:[t.jsx(Ge,{onDelete:()=>n!=null&&d?.(n),onSelect:n!=null&&r?()=>r(n):void 0}),t.jsxs("div",{ref:x,className:W.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100px",height:"2px",borderTop:"2px solid #3B64A0"}}),C]}),t.jsx("div",{className:W.column,children:e.map((p,y)=>{let j;if(p.paths)j=t.jsx(m1,{items:p.paths,pathId:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,onDeleteStep:d,onUpdateFilter:u,onSelectStep:r,onResize:l},p.localId);else if(p.steps){const g=p;j=t.jsxs("div",{className:W.stepsContainer,children:[t.jsx(C1,{expression:g.condition,style:{marginTop:"25px"}}),t.jsx(e1,{steps:p.steps,pathId:p.localId,onSelectStep:r??(()=>{}),onAddStep:s??(()=>{}),onAddTrigger:o,onAddCondition:i??(()=>{}),onAddLoop:a,onDeleteStep:d,onUpdateFilter:u,onResize:l},p.localId)]})}else j=t.jsx(X,{localId:p.localId,title:"title"in p?p.title:"",idx:1,icon:"icon"in p?p.icon:void 0,onSelectStep:r,onDeleteStep:d,onUpdateFilter:u},p.localId);return t.jsx("div",{ref:g=>{I.current[y]=g},style:{width:"100%"},children:j},p.localId)})}),t.jsxs("div",{className:W.column,style:{marginTop:"33px"},children:[t.jsx("div",{style:{position:"absolute",top:.5,left:0,flex:1,width:"100%",height:"2px",borderTop:"2px solid #3B64A0"}}),C]}),t.jsx(H,{onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,stepId:n,pathId:n,index:1,style:{marginTop:"34px",height:0}}),t.jsx("div",{style:{flex:1,width:"100%",height:"2px",borderTop:"2px solid #3B64A0",marginTop:"34px"}})]})},Q=68,e1=({pathId:e,steps:n,centerY:s,className:o,onAddStep:i,onDeleteStep:a,onUpdateFilter:d,onAddTrigger:u,onAddCondition:r,onAddLoop:l,onSelectStep:x,onResize:I,isDescendent:v=!0})=>{const _=s===void 0?void 0:{marginTop:Math.max(0,s-Q/2)};return n.length===0?t.jsxs("div",{style:{width:"100%",marginTop:"20px",display:"flex",flexDirection:"row",flex:1,minWidth:0,..._},children:[t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}}),t.jsx(H,{onAddStep:()=>{i?.(void 0,e)},onAddTrigger:u,onAddCondition:r,onAddLoop:l,stepId:e,index:0,style:{height:"auto"}}),t.jsx("div",{style:{flexGrow:1,flexShrink:0,flexBasis:"auto",minWidth:0,height:"2px",marginTop:"13.5px",borderTop:"2px solid #3B64A0"}})]}):t.jsx("div",{className:J.steps+(o?" "+o:""),style:_,children:t.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:1,minWidth:0,width:"100%",alignItems:"flex-start"},children:[t.jsx(H,{onAddStep:()=>{i?.(n[0].localId,e,"prepend")},onAddTrigger:u,onAddCondition:r,onAddLoop:l,stepId:n[0].localId,pathId:e,index:0,style:{marginTop:"20px"}}),n.map((C,p)=>{const y=!!C.paths,j="condition"in C&&typeof C.condition=="string";let g;return y&&C.paths?g=t.jsx(m1,{items:C.paths,pathId:C.localId,onAddStep:i,onAddCondition:r,onAddLoop:l,onDeleteStep:a,onAddTrigger:u,onSelectStep:x,onUpdateFilter:d,onResize:I},C.title):j?g=t.jsxs(t.Fragment,{children:[t.jsx(x1,{value:C,onAddStep:i,onAddTrigger:u,onAddCondition:r,onAddLoop:l,onDeleteStep:a,onUpdateFilter:d,onSelectStep:x,onResize:I},C.localId),t.jsx(H,{onAddStep:i,onAddTrigger:u,onAddCondition:r,onAddLoop:l,stepId:C.localId,pathId:e,index:p+1,style:{marginTop:"34px",height:0}})]}):g=t.jsxs(t.Fragment,{children:[t.jsx(X,{localId:C.localId,title:C.title,idx:1,icon:C.icon,isSet:C.isSet,isInvalid:C.isInvalid,isFilter:C.isFilter,onSelectStep:x,onDeleteStep:a,onUpdateFilter:d},C.title),t.jsx(H,{onAddStep:i,onAddTrigger:u,onAddCondition:r,onAddLoop:l,stepId:C.localId,pathId:e,index:p+1})]}),t.jsx("div",{className:J.stepContainer+(y||j?" "+J.stepContainerWithPaths:""),children:g},C.localId)}),v&&t.jsx("div",{style:{flexGrow:1,minWidth:0,borderTop:"2px solid #3B64A0",marginTop:"33.5px"}})]})})},Je=()=>t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M17.3006 10.5H23.1986C23.2699 10.5001 23.3397 10.5204 23.3998 10.5586C23.4599 10.5969 23.5079 10.6515 23.5381 10.716C23.5683 10.7805 23.5795 10.8523 23.5704 10.923C23.5613 10.9937 23.5322 11.0603 23.4866 11.115L20.5376 14.655C20.5024 14.6972 20.4584 14.7312 20.4086 14.7545C20.3589 14.7778 20.3046 14.7899 20.2496 14.7899C20.1947 14.7899 20.1404 14.7778 20.0906 14.7545C20.0409 14.7312 19.9968 14.6972 19.9616 14.655L17.0126 11.115C16.967 11.0603 16.938 10.9937 16.9289 10.923C16.9197 10.8523 16.931 10.7805 16.9612 10.716C16.9914 10.6515 17.0394 10.5969 17.0995 10.5586C17.1596 10.5204 17.2294 10.5001 17.3006 10.5ZM0.800641 13.5H6.69864C6.7699 13.5 6.83967 13.4797 6.89979 13.4414C6.95991 13.4032 7.00789 13.3486 7.03811 13.2841C7.06833 13.2195 7.07953 13.1477 7.07042 13.0771C7.06131 13.0064 7.03224 12.9398 6.98664 12.885L4.03764 9.34504C4.00245 9.30283 3.95841 9.26888 3.90864 9.24558C3.85887 9.22228 3.80459 9.21021 3.74964 9.21021C3.69469 9.21021 3.64041 9.22228 3.59064 9.24558C3.54087 9.26888 3.49683 9.30283 3.46164 9.34504L0.512641 12.885C0.467037 12.9398 0.437977 13.0064 0.428862 13.0771C0.419747 13.1477 0.430956 13.2195 0.461175 13.2841C0.491394 13.3486 0.539372 13.4032 0.599493 13.4414C0.659613 13.4797 0.729386 13.5 0.800641 13.5Z",fill:"#41B0AC"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9995 4.50011C9.67152 4.50011 7.58952 5.5606 6.21402 7.2271C6.1526 7.30671 6.0758 7.37316 5.98819 7.42249C5.90057 7.47183 5.80393 7.50304 5.70401 7.51427C5.60409 7.52551 5.50293 7.51653 5.40655 7.48789C5.31016 7.45924 5.22052 7.41151 5.14296 7.34753C5.06539 7.28354 5.00149 7.20462 4.95504 7.11544C4.90859 7.02626 4.88054 6.92865 4.87257 6.82842C4.8646 6.72819 4.87687 6.62737 4.90864 6.53198C4.94041 6.43658 4.99104 6.34854 5.05752 6.27311C6.15581 4.9434 7.61291 3.95712 9.25552 3.43159C10.8981 2.90606 12.6571 2.86338 14.3233 3.30864C15.9895 3.7539 17.4927 4.66835 18.6541 5.94324C19.8156 7.21812 20.5865 8.79978 20.875 10.5001L19.3495 10.5001C19.0032 8.80632 18.0826 7.28409 16.7433 6.19082C15.4041 5.09755 13.7284 4.50032 11.9995 4.50011ZM4.64952 13.5001C4.93349 14.887 5.60405 16.1653 6.58374 17.1873C7.56343 18.2093 8.81226 18.9332 10.186 19.2755C11.5597 19.6178 13.0022 19.5645 14.3469 19.1217C15.6915 18.6789 16.8835 17.8646 17.785 16.7731C17.8464 16.6935 17.9232 16.627 18.0109 16.5777C18.0985 16.5284 18.1951 16.4972 18.295 16.4859C18.395 16.4747 18.4961 16.4837 18.5925 16.5123C18.6889 16.541 18.7785 16.5887 18.8561 16.6527C18.9337 16.7167 18.9976 16.7956 19.044 16.8848C19.0905 16.974 19.1185 17.0716 19.1265 17.1718C19.1344 17.272 19.1222 17.3728 19.0904 17.4682C19.0586 17.5636 19.008 17.6517 18.9415 17.7271C17.8432 19.0568 16.3861 20.0431 14.7435 20.5686C13.1009 21.0942 11.3419 21.1368 9.67576 20.6916C8.0096 20.2463 6.50638 19.3319 5.34491 18.057C4.18343 16.7821 3.41258 15.2004 3.12402 13.5001H4.64952Z",fill:"#41B0AC"})]}),Qe="_container_131qr_1",Ue="_collapsed_131qr_16",et="_loopNodeWrapper_131qr_21",tt="_loopIconWrapper_131qr_31",nt="_loopBox_131qr_40",st="_dotsButton_131qr_57",ot="_label_131qr_77",it="_limit_131qr_84",rt="_expandable_131qr_90",lt="_expandableCollapsed_131qr_100",ct="_connector_131qr_107",at="_line_131qr_115",dt="_circleDot_131qr_123",ut="_innerDot_131qr_138",pt="_stepsWrapper_131qr_145",k={container:Qe,collapsed:Ue,loopNodeWrapper:et,loopIconWrapper:tt,loopBox:nt,dotsButton:st,label:ot,limit:it,expandable:rt,expandableCollapsed:lt,connector:ct,line:at,circleDot:dt,innerDot:ut,stepsWrapper:pt},x1=({value:e,onAddStep:n,onAddTrigger:s,onAddCondition:o,onAddLoop:i,onDeleteStep:a,onUpdateFilter:d,onSelectStep:u,onResize:r})=>{const{localId:l,limit:x,steps:I,condition:v}=e,_=I??[],C=()=>{},[p,y]=c.useState(!1),j=c.useRef(null),{openMenu:g,closeMenu:m}=Y(),w=U(),P=c.useMemo(()=>[{label:"Edit",icon:t.jsx(u1,{color:"#3B64A0",size:18}),command:N=>{N?.originalEvent?.stopPropagation(),u?.(l)},template:w},{label:"Remove",icon:t.jsx(A,{color:"#3B64A0",size:18}),command:N=>{N?.originalEvent?.stopPropagation(),a&&a(l)},template:w}],[u,a,l,w]),h=N=>{N.stopPropagation(),g(j,N)},f=()=>{y(N=>!N),r?.()},M=k.container+(p?"":" "+k.collapsed),L=k.expandable+(p?"":" "+k.expandableCollapsed);return t.jsxs("div",{className:M,children:[t.jsxs("div",{className:k.loopNodeWrapper,children:[t.jsxs("div",{className:k.loopBox,children:[t.jsx("div",{onClick:f,className:k.loopIconWrapper,children:t.jsx(Je,{})}),t.jsx("button",{className:k.dotsButton,onClick:h,children:t.jsx(q,{size:16})}),t.jsx(z,{model:P,popup:!0,ref:j,onHide:()=>m(j)})]}),t.jsx("div",{className:k.label,children:"Loop"}),x!=null&&t.jsxs("div",{className:k.limit,children:[x,"x"]})]}),t.jsxs("div",{className:L,children:[t.jsxs("div",{className:k.connector,children:[t.jsx("div",{className:k.line,style:{width:"12px"}}),t.jsx("div",{className:k.circleDot,children:t.jsx("div",{className:k.innerDot})}),t.jsx("div",{className:k.line})]}),t.jsx(C1,{expression:v??"",style:{marginTop:"25.5px"}}),t.jsx("div",{className:k.stepsWrapper,children:t.jsx(e1,{steps:_,pathId:l,onAddStep:n??C,onAddTrigger:s,onAddCondition:o??C,onAddLoop:i,onDeleteStep:a,onUpdateFilter:d??C,onSelectStep:u??C,isDescendent:!0})})]})]})},ht="_container_kielx_1",Ct={container:ht},mt=({process:e,addMultipleTriggers:n,onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,onResize:d,onDeleteTrigger:u,onDeleteStep:r,onUpdateFilter:l,onSelectStep:x})=>{const[I,v]=c.useState(0);return t.jsxs("div",{className:Ct.container,children:[t.jsx(h1,{steps:e.triggers,onAddTrigger:n,onUpdateFilter:l,onDeleteTrigger:u,onSelectStep:x,onCenterYUpdate:v}),e.steps.length>0?t.jsx(e1,{steps:e.steps,centerY:I,onAddStep:s,onAddTrigger:o,onAddCondition:i,onAddLoop:a,onResize:d,onDeleteStep:r,onUpdateFilter:l,onSelectStep:x,isDescendent:!1,pathId:void 0}):t.jsx(H,{onAddStep:()=>s(),onAddTrigger:o,onAddCondition:i,onAddLoop:a,index:0,style:{height:Q,marginTop:Math.max(0,I-Q/2)}})]})};class f1 extends Error{constructor(n){super(n),this.name="AddStepError"}}const c1=e=>"condition"in e&&typeof e.condition=="string",g1=(e,n,s,o)=>{const i=o==="prepend"?n:n+1;return[...e.slice(0,i),s,...e.slice(i)]},t1=(e,n,s,o)=>{for(let i=0;i<e.length;i++){if(e[i].localId===n)return g1(e,i,o,s);const a=e[i],d=a.steps?.length&&t1(a.steps,n,s,o);if(d)return e.map((r,l)=>l===i?{...r,steps:d}:r);const u=a.paths?.length&&v1(a.paths,n,s,o);if(u)return e.map((r,l)=>l===i?{...r,paths:u}:r)}return null},xt=(e,n,s)=>{const o=e.steps??[],i=n==="prepend"?[s,...o]:[...o,s];return{...e,steps:i}},v1=(e,n,s,o)=>{for(let i=0;i<e.length;i++){const a=e[i];if(a.localId===n)return c1(a)?e.map((d,u)=>u===i?xt(a,s,o):d):g1(e,i,o,s);if(c1(a)){const d=a.steps?.length&&t1(a.steps,n,s,o);if(d)return e.map((r,l)=>l===i?{...r,steps:d}:r);const u=a.paths?.length&&v1(a.paths,n,s,o);if(u)return e.map((r,l)=>l===i?{...r,paths:u}:r)}}return null},ft=(e,n,s,o)=>{const i=t1(e.steps,n,s,o);if(i)return{...e,steps:i};throw new f1(`Step or path with id "${n}" not found`)},_1=(e,n)=>({...e,...e.steps!=null&&{steps:n1(e.steps,n)},...e.paths!=null&&{paths:e.paths.map(s=>_1(s,n))}}),n1=(e,n)=>e.filter(s=>s.localId!==n).map(s=>({...s,...s.steps!=null&&{steps:n1(s.steps,n)},...s.paths!=null&&{paths:s.paths.map(o=>_1(o,n))}})),gt=(e,n)=>{const s=n1(e.steps,n);return{...e,steps:s}};exports.AddStepError=f1;exports.Iterator=x1;exports.Menu=z;exports.MenuProvider=Q1;exports.ProcessDiagram=mt;exports.ProcessStep=X;exports.Trigger=h1;exports.addStep=ft;exports.deleteStep=gt;exports.useMenuProvider=Y;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|