2 lines
32 KiB
JavaScript
2 lines
32 KiB
JavaScript
|
|
import{i as ve,m as ue,h as je,k as He,l as Y,c as z,n as Ce}from"./index-BTglIPU2.js?v=1773287522785";import{c as Ae,g as Je}from"./data-BVsViUMm.js?v=1773287522785";import{e as Qe,g as Xe,a as et,b as tt,c as nt}from"./campaign-CYIboXPk.js?v=1773287522785";import{r as y,a0 as r,j as M,F as O,N as ot,k as j,al as G,c as N,$ as _,a8 as U,a9 as g,_ as c,Z as b,P as te,S as s,aa as F,ak as R,ad as Te,L as Ke,aj as Ie,ab as at,e as ae,l as Be,v as Fe,a5 as st,am as lt,K as rt}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a3 as Pe,a4 as ce,a as it,p as V,a5 as ut,a1 as Q,a6 as se,b as ye,a7 as X,a8 as ct,_ as dt,B as xe,a0 as pt,a9 as _t}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{c as ft}from"./check-CNel7fTH.js?v=1773287522785";import{_ as mt}from"./index.vue_vue_type_script_setup_true_lang-DOnYQQHp.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./useLoading-CZ2gSAW7.js?v=1773287522785";import"./mail-COTHIXbY.js?v=1773287522785";const De=y(0),le=y([]),B=y([]),ge=y(Date.now()),h=y("root"),ne=y("trigger"),de=y({root:{nodeKey:"root",parentNodeKey:"",type:"trigger",id:0,parent_id:0,broken:!1,complete:!0,config:{type:"subscriber_added",group_ids:[]}}}),oe=y({}),pe=y({}),_e=y({}),fe=y({}),vt=y({}),x=y({}),E=y({trigger:de,email:oe,delay:pe,webhook:_e,action:fe,abTest:vt,condition:x}),q=y({nodeKey:"",parentNodeKey:"",type:"trigger",next:null,id:0,parent_id:0,broken:!1,complete:!1}),yt=y({...q.value,config:{type:"subscriber_added",group_ids:[]}}),gt=y({...q.value,email_id:0,name:"",subject:"",from:"",from_name:"",track_opens:!0,track_clicks:!0,track_unsubscribe:!0}),bt=y({...q.value,value:0,unit:"days",description:""}),kt=y({...q.value,url:"",secret:""}),ht=y({...q.value,action:"add_to_subscribers",group_ids:[],description:""}),wt=y({...q.value,name:"",branches:[]}),Nt=y({...q.value,rules:[{type:null}],logic_type:"or",yes:[],no:[],description:""}),$t=y({trigger:yt,email:gt,delay:bt,webhook:kt,action:ht,abTest:wt,condition:Nt}),Z={events:{},$on(n,o){this.events[n]?this.events[n].push(o):this.events[n]=[o]},$emit(n,o){this.events[n].forEach(t=>{t(o)})},$unsubscribe(n){this.events[n]=[]}};function re(n,o){const t=n==="trigger"?"root":He(),e=V($t.value[n]);return e.nodeKey=t,e.parentNodeKey=o,e.type=n,E.value[n][t]=e,e}function Ct(n,o){const t=re(n,"root");if(o==="")B.value.unshift({type:n,key:t.nodeKey});else{const e=B.value.findIndex(l=>l.key==o);B.value.splice(e+1,0,{type:n,key:t.nodeKey})}return t}function xt(n,o){const t=re(n,o);return x.value[o].yes.unshift({type:n,key:t.nodeKey}),n=="condition"&&Z.$on(t.nodeKey,()=>{We(t.nodeKey,o)}),t}function Dt(n,o){const t=re(n,o);return x.value[o].yes.push({type:n,key:t.nodeKey}),t}function Rt(n,o){const t=re(n,o);return x.value[o].no.unshift({type:n,key:t.nodeKey}),n=="condition"&&Z.$on(t.nodeKey,()=>{At(t.nodeKey,o)}),t}function St(n,o){const t=re(n,o);return x.value[o].no.push({type:n,key:t.nodeKey}),t}function Ue(n,o){const t=x.value[n],{parentNodeKey:e}=t;t[o].forEach(l=>{if(l.type!=="trigger"){const d=E.value[l.type];d[l.key].parentNodeKey=t.parentNodeKey}if(e==="root")B.value.push({type:l.type,key:l.key});else{const d=x.value[e],u=Ut(n);d[u].push({type:l.type,key:l.key})}})}function Ut(n){const t=x.value[n].parentNodeKey;return x.value[t].yes.some(l=>l.key===n)?"yes":"no"}function Le(n,o){const t=B.value.findIndex(e=>e.key==o);B.value.splice(t,1),delete E.value[n][o]}function ze(n){const o=y(1),t=E.value.condition[n],e=t.yes.length>0||t.no.length>0;je({title:"Please choose one of the following",width:400,content:()=>r(O,null,[e&&r(Pe,{value:o.value,onUpdateValue:l=>o.value=l},{default:()=>[r("div",null,[r(ce,{value:1},{default:()=>[M("Delete both branches including all steps below.")]})]),r("div",{class:"mt-6px"},[r(ce,{value:2},{default:()=>[M("Delete only YES branch including steps below.")]})]),r("div",{class:"mt-6px"},[r(ce,{value:3},{default:()=>[M("Delete only NO branch including steps below.")]})])]}),!e&&r("div",null,[M("Do you really want to delete this step?")])]),onConfirm:async()=>{switch(o.value){case 1:ke(n),he(n),be(n);break;cas
|