PageSourceSearch

https://panel.segmentify.com/assets/index-lerrvqSu.js

js segmentify.com collected 2026-09-26 03:42:36 UTC 42,370 bytes, 1 lines download raw bytes

1import{i as T}from"./_virtual___federation_fn_import-Dg9Cpk8k.js";import{j as e}from"./jsx-runtime-BTzVT9qC.js";import{u as B}from"./index-B63gSKPZ.js";import{P as C}from"./index-CHP9YPde.js";import{m as Oe}from"./modal-CBl9as1u.js";import{fA as x,dO as V,fH as me,fL as Y,dP as D,cx as Fe,cb as De,cc as Ee,fC as F,ca as G,t as P,fF as fe,fD as E,fM as Re,fN as Pe,fO as qe,fB as ve,fP as Me,fQ as Ae,fR as Ge,fS as ye,fT as Ie,fU as Le,fV as Be,fW as Ye,fX as Ue,eS as ze,bN as A,fw as We,fY as He,fZ as Qe,cO as _e}from"./index-C7FClqNY.js";import{u as Te}from"./useHover-By9burZd.js";import{S as y}from"./react-select.es-MMP3gQfH.js";import{I as Q}from"./index-DeWlLIuT.js";import{E as q,c as Ke,a as Xe,b as Ze,d as Je}from"./criteriaFilterTotalRevenue-DXKxUaSp.js";import{T as $}from"./field.textfield-CZF4a1Wd.js";import{o as k,c as O}from"./utils-CPDJkpha.js";import{r as he}from"./index-BX8YnhG8.js";import{h as ea}from"./pure-utils-DczfjUPN.js";import{j as J}from"./date-9H2xkoQz.js";import{c as aa,e as ta,d as ra}from"./ajax-C9yg2YFD.js";import{h as sa}from"./ajax-mhcD5f2E.js";import{S as ke}from"./field.select-hLiDLoyr.js";import{u as K}from"./useDispatch-BXOiFV1m.js";import{T as Ve}from"./tooltip-C8SwCzdU.js";import{b as ge}from"./hashHistory-y7JnZW5F.js";import{C as oa}from"./index-C7VlQBsC.js";import{I as la}from"./InputCardWrapper-lJ-jJjQw.js";const na=await T("react"),{useState:ee,useEffect:ia}=na,ca=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:x.equals.value,value:""},[o,s]=ee(),[m,g]=ee(),[n,c]=ee("");ia(()=>{const a=u?.[l];a?.length>1?(a.forEach(r=>{r.operator===x.gte.value?s(r.value):r.operator===x.lte.value&&g(r.value)}),c(x.between.value)):a?.length===1?(s(a[0].value),c(a[0].operator)):(c(d.operator),s(d.value))},[u]);const t=(a,r)=>{const f=V.transactionOperator,h=r==="operator"?a.value:n,S=r==="transactionValue"?O(a.target.value,0):o;let b=r==="transactionValueMax"?O(a.target.value,0):m;r==="operator"&&a.value!==x.between.value&&(b=null);const j=[{dataType:i?.dataType,column:f,operator:h===x.between.value?x.gte.value:h,value:S}];h===x.between.value&&j.push({dataType:i?.dataType,column:f,operator:x.lte.value,value:b}),v(l,j)},p=(a,r)=>{switch(r){case"transactionValue":s(O(a.target.value,0));break;case"transactionValueMax":g(O(a.target.value,0));break;case"operator":c(a?.value);break}t(a,r)};return e.jsxs("div",{className:`rbs-filter-field ${n===x.between.value?"three-row":""}`,children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Operator*"}),e.jsx(y,{value:n,options:k(x),name:"operator",clearable:!1,searchable:!1,onChange:a=>p(a,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Transaction Value*"}),e.jsx($,{value:o,onChange:a=>p(a,"transactionValue"),type:"number",required:!0,placeholder:n===x.between.value?"min":""}),n===x.between.value&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filter-multi-connector"}),e.jsx($,{value:m,onChange:a=>p(a,"transactionValueMax"),type:"number",required:!0,placeholder:"max",validation:o?{minNumber:o}:{}})]})]})]})},ua=await T("react"),{useState:xe,useEffect:pa}=ua,da=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:me.gte.value},[o,s]=xe(),[m,g]=xe("");pa(()=>{const t=u?.[l]?.[0];g(t?.operator||d.operator),s(t?.value)},[u]);const n=(t,p)=>{const a=V.quantityOperator,r=p==="operator"?t.value:m,f=p==="quantity"?O(t.target.value,0):o,h=[{dataType:i?.dataType,column:a,operator:r,value:f}];v(l,h)},c=(t,p)=>{switch(p){case"quantity":s(O(t.target.value,0));break;case"operator":g(t?.value);break}n(t,p)};return e.jsxs("div",{className:"rbs-filter-field",children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Quantity Operator"}),e.jsx(y,{value:m,options:k(me),name:"operator",clearable:!1,searchable:!1,onChange:t=>c(t,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Quantity"}),e.jsx($,{name:"quantity",value:o,onChange:t=>c(t,"quantity"),type:"number"})]})]})},ma=await T("react"),{useState:ae,useEffect:fa}=ma,va=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:x.equals.value,value:""},[o,s]=ae(),[m,g]=ae(),[n,c]=ae("");fa(()=>{const a=u?.[l];a?.length>
11?(a.forEach(r=>{r.operator===x.gte.value?s(r.value):r.operator===x.lte.value&&g(r.value)}),c(x.between.value)):a?.length===1?(s(a[0].value),c(a[0].operator)):(c(d.operator),s(d.value))},[u]);const t=(a,r)=>{const f=V.amountOperator,h=r==="operator"?a.value:n,S=r==="amount"?O(a.target.value,0):o;let b=r==="amountMax"?O(a.target.value,0):m;r==="operator"&&a.value!==x.between.value&&(b=null);const j=[{dataType:i?.dataType,column:f,operator:h===x.between.value?x.gte.value:h,value:S}];h===x.between.value&&j.push({dataType:i?.dataType,column:f,operator:x.lte.value,value:b}),v(l,j)},p=(a,r)=>{switch(r){case"amount":s(O(a.target.value,0));break;case"amountMax":g(O(a.target.value,0));break;case"operator":c(a?.value);break}t(a,r)};return e.jsxs("div",{className:`rbs-filter-field ${n===x.between.value?"three-row":""}`,children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Amount Operator"}),e.jsx(y,{value:n,options:k(x),name:"operator",clearable:!1,searchable:!1,onChange:a=>p(a,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Amount"}),e.jsx($,{value:o,onChange:a=>p(a,"amount"),type:"number",placeholder:n===x.between.value?"min":""}),n===x.between.value&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filter-multi-connector"}),e.jsx($,{value:m,onChange:a=>p(a,"amountMax"),type:"number",placeholder:"max",validation:o?{minNumber:o}:{}})]})]})]})},ha=await T("react"),{useState:M,useEffect:ga}=ha,te={[Y.days.value]:30,[Y.weeks.value]:4,[Y.months.value]:1},xa=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,column:V.dateOperator,operator:D.last.value,unit:Y.days.value,value:te[Y.days.value]},[o,s]=M(null),[m,g]=M(null),[n,c]=M(""),[t,p]=M(""),[a,r]=M(""),[f,h]=M(null),[S,b]=M(null);u?.[l].length===0&&v(l,[d]),ga(()=>{const N=u?.[l];
1if(N?.length>1)N.forEach(w=>{if(w.operator==="gte"){const I=w.value?J(w.value):null;s(I)}else if(w.operator==="lte"){const I=w.value?J(w.value):null;g(I)}}),p(D.between.value);else if(N?.length===1&&N[0].operator){if(N[0].operator===D.last.value)c(N[0].value),r(N[0].unit||"days");else{const w=N[0].value?J(N[0].value):null;s(w)}p(N[0].operator)}else p(d.operator),r(d.unit),c(d.value)},[u]);const j=(N,w)=>{const I=V.dateOperator,W=w==="operator"?N.value:t;let X=w==="operatorUnit"?N.value:a,L=w==="date"?N:o;w==="dateRange"&&(L=N.startDate);let z=w==="dateRange"?N.endDate:m,Z=w==="dateNumber"?O(N.target.value,1):n;w==="operatorUnit"&&(Z=te[X]),w==="operator"&&(L=null,z=null,Z=null,X=""),L&&(L=L.format("YYYY-MM-DD")),z&&(z=z.format("YYYY-MM-DD"));const de=[{dataType:i?.dataType,column:I,operator:W===D.between.value?"gte":W,unit:X,value:W===D.last.value?Z:L}];W===D.between.value&&de.push({dataType:i?.dataType,column:I,operator:"lte",value:z}),v(l,de)},R=(N,w)=>{switch(w){case"date":s(N);break;case"dateRange":s(N.startDate),g(N.endDate);break;case"dateNumber":c(O(N.target.value,1));break;case"operator":p(N?.value),s(null),g(null),c(d.value),N?.value!==D.last.value&&r("");break;case"operatorUnit":r(N?.value),c(te[N?.value]);break}w!=="dateRange"&&j(N,w)};let U="double-row";return t===D.between.value?U="multi-date-row double-row":t===D.last.value&&(U="three-row date-row"),e.jsxs("div",{className:`rbs-filter-field ${U}`,children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Time Range*"}),e.jsx(y,{value:t,options:k(D),name:"operator",clearable:!1,searchable:!1,onChange:N=>R(N,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),t===D.equals.value&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filter-connector"}),e.jsx("div",{className:"filter-multi-connector"}),e.jsxs("div",{className:`filter-operator ${o?"":"has-error"}`,children:[e.jsx("span",{className:"filter-operator-title",children:"Date*"}),e.jsx(he.SingleDatePicker,{date:o,placeholder:"dd/mm/yy",onDateChange:N=>R(N,"date"),focused:f,onFocusChange:({focused:N})=>h(N),isOutsideRange:()=>!1,required:!0,showDefaultInputIcon:!0,inputIconPosition:"after",displayFormat:"DD/MM/YYYY"}),!o&&e.jsx(q,{})]})]}),t===D.between.value&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:`filter-operator ${!o||!m?"has-error":""}`,children:[e.jsx("span",{className:"filter-operator-title",children:"Date*"}),e.jsx(he.DateRangePicker,{startDate:o,endDate:m,startDateId:`start_date_${l}`,endDateId:`end_date_${l}`,startDatePlaceholderText:"dd/mm/yy",endDatePlaceholderText:"dd/mm/yy",customArrowIcon:e.jsx("span",{name:"calendar-separator",children:"-"}),onDatesChange:({startDate:N,endDate:w})=>{R({startDate:N,endDate:w},"dateRange")},onClose:({startDate:N,endDate:w})=>{j({startDate:N,endDate:w},"dateRange")},focusedInput:S,onFocusChange:N=>b(N),required:!0,showDefaultInputIcon:!0,inputIconPosition:"after",displayFormat:"DD/MM/YYYY",isOutsideRange:N=>N.isAfter(ea().startOf("day"))}),(!o||!m)&&e.jsx(q,{})]})]}),t===D.last.value&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filter-multi-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Value Date*"}),e.jsx($,{value:n,onChange:N=>R(N,"dateNumber"),type:"number",required:!0})]}),e.jsx("div",{className:"filter-multi-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Unit*"}),e.jsx(y,{value:a,options:k(Y),name:"operatorUnit",clearable:!1,searchable:!1,onChange:N=>R(N,"operatorUnit"),className:"criteria-field one-whole",openOnClick:!0})]})]})]})},ba=i=>{const l=`${Fe("rest/search/rbs/page")}/?apiKey=${De()}`;return Ee(l).get({},{preventAbort:!1}).then(i)},ja=await T("react"),{useState:H,useEffect:Na}=ja,wa={value:"any",label:"any page",title:"any page"},Ca=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,column:V.pageOperator,operator:F.equals.value,value:"any"},[o,s]=H(""),[m,g]=H([]),[n,c]=H(""),[t,p]=H();u?.[l].length===0&&v(l,[d]),Na(()=>{const f=u?.[l]?.[0];c(f?.operator||d.operator);const h=f?f?.value:d.value;s(h),(!m.some(b=>b.value===h)&&h!=="any"||m.length===0)&&ba().then(b=>{const N=(![d.value,...b].includes(h)&&h?[...b,h]:b).sort().map(w=>({value:w,label:G(w),title:G(w)}));g([wa,...N])})},[u]);const a=(f,h)=>{const S=V.pageOperator,b=h==="operator"?f?.value:n;let j=h==="page"?f?.value:o;[F.equals.value,F.equalsNot.value].includes(b)&&t&&(j="");const R=[{dataType:i?.dataType,column:S,operator:b,value:j}];v(l,R)},r=(f,h)=>{switch(h){case"page":s(f?.value||""),p(!f?.hasOwnProperty("title"));break;case"operator":c(f?.value);break}a(f,h)};return e.jsxs("div",{className:"rbs-filter-field",children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Operator*"}),e.jsx(y,{value:n,options:k(F),name:"operator",clearable:!1,searchable:!1,onChange:f=>r(f,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Page*"}),e.jsx(y,{value:o,options:m,name:"page",clearable:!1,searchable:!0,onChange:f=>r(f,"page"),className:`criteria-field one-whole ${o?"":"has-error"}`,openOnClick:!0,placeholder:P("Select or text")}),!o&&e.jsx(q,{})]})]})},Sa=await T("react"),{useState:be,useEffect:Oa}=Sa,ya=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:fe.equals.value,value:""},[o,s]=be(),[m,g]=be("");Oa(()=>{const t=u?.[l];t?.length===1?(s(t[0].value),g(t[0].operator)):(g(d.operator),s(d.value))},[u]);const n=(t,p)=>{const a=V.urlOperator,r=p==="operator"?t.value:m,f=p==="url"?t.target.value:o,h=[{dataType:i?.dataType,column:a,operator:r,value:f}];v(l,h)},c=(t,p)=>{switch(p){case"url":s(t.target.value);break;case"operator":g(t?.value);break}n(t,p)};return e.jsxs("div",{className:"rbs-filter-field",children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Operator*"}),e.jsx(y,{value:m,options:k(fe),name:"operator",clearable:!1,searchable:!1,onChange:t=>c(t,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"URL*"}),e.jsx($,{value:o,onChange:t=>c(t,"url"),type:"text",required:!0})]})]})},Ta=await T("react"),{useState:re,useEffect:ka}=Ta,Va=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:x.equals.value,value:""},[o,s]=re(),[m,g]=re(),[n,c]=re("");ka(()=>{const a=u?.[l];a?.length>
11?(a.forEach(r=>{r.operator===x.gte.value?s(r.value):r.operator===x.lte.value&&g(r.value)}),c(x.between.value)):a?.length===1?(s(a[0].value),c(a[0].operator)):(c(d.operator),s(d.value))},[u]);const t=(a,r)=>{const f=V.productViewCountOperator,h=r==="operator"?a.value:n,S=r==="productViewCount"?O(a.target.value,0):o;let b=r==="productViewCountMax"?O(a.target.value,0):m;r==="operator"&&a.value!==x.between.value&&(b=null);const j=[{dataType:i?.dataType,column:f,operator:h===x.between.value?x.gte.value:h,value:S}];h===x.between.value&&j.push({dataType:i?.dataType,column:f,operator:x.lte.value,value:b}),v(l,j)},p=(a,r)=>{switch(r){case"productViewCount":s(O(a.target.value,0));break;case"productViewCountMax":g(O(a.target.value,0));break;case"operator":c(a?.value);break}t(a,r)};return e.jsxs("div",{className:`rbs-filter-field ${n===x.between.value?"three-row":""}`,children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"View Operator"}),e.jsx(y,{value:n,options:k(x),name:"operator",clearable:!1,searchable:!1,onChange:a=>p(a,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"View Count"}),e.jsx($,{value:o,onChange:a=>p(a,"productViewCount"),type:"number",placeholder:n===x.between.value?"min":""}),n===x.between.value&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filter-multi-connector"}),e.jsx($,{value:m,onChange:a=>p(a,"productViewCountMax"),type:"number",placeholder:"max",validation:o?{minNumber:o}:{}})]})]})]})},$a=await T("react"),{useState:se,useEffect:Fa}=$a,Da=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:x.equals.value,value:""},[o,s]=se(),[m,g]=se(),[n,c]=se("");Fa(()=>{const a=u?.[l];a?.length>1?(a.forEach(r=>{r.operator===x.gte.value?s(r.value):r.operator===x.lte.value&&g(r.value)}),c(x.between.value)):a?.length===1?(s(a[0].value),c(a[0].operator)):(c(d.operator),s(d.value))},[u]);const t=(a,r)=>{const f=V.pageViewCountOperator,h=r==="operator"?a.value:n,S=r==="pageViewCount"?O(a.target.value,0):o;let b=r==="pageViewCountMax"?O(a.target.value,0):m;r==="operator"&&a.value!==x.between.value&&(b=null);const j=[{dataType:i?.dataType,column:f,operator:h===x.between.value?x.gte.value:h,value:S}];h===x.between.value&&j.push({dataType:i?.dataType,column:f,operator:x.lte.value,value:b}),v(l,j)},p=(a,r)=>{switch(r){case"pageViewCount":s(O(a.target.value,0));break;case"pageViewCountMax":g(O(a.target.value,0));break;case"operator":c(a?.value);break}t(a,r)};return e.jsxs("div",{className:`rbs-filter-field ${n===x.between.value?"three-row":""}`,children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"View Operator"}),e.jsx(y,{value:n,options:k(x),name:"operator",clearable:!1,searchable:!1,onChange:a=>p(a,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"View Count"}),e.jsx($,{value:o,onChange:a=>p(a,"pageViewCount"),type:"number",placeholder:n===x.between.value?"min":""}),n===x.between.value&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filter-multi-connector"}),e.jsx($,{value:m,onChange:a=>p(a,"pageViewCountMax"),type:"number",placeholder:"max",validation:o?{minNumber:o}:{}})]})]})]})},Ea=await T("react"),{useState:oe,useEffect:Ra}=Ea,Pa=i=>{const l=[];
1return Object.keys(i).forEach(u=>{l.push({value:G(i[u].value),title:G(i[u].name),label:G(i[u].name)})}),l},qa=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:E.gte.value,value:""},[o,s]=oe(),[m,g]=oe(),[n,c]=oe("");Ra(()=>{const a=u?.[l];a?.length>1?(a.forEach(r=>{r.operator===E.gte.value?s(r.value):r.operator===E.lte.value&&g(r.value)}),c(E.between.value)):a?.length===1?(s(a[0].value),c(a[0].operator)):(c(d.operator),s(d.value))},[u]);const t=(a,r)=>{const f=V.ageOperator,h=r==="operator"?a.value:n,S=r==="age"?O(a.target.value,0):o;let b=r==="ageMax"?O(a.target.value,0):m;r==="operator"&&a.value!==E.between.value&&(b=null);const j=[{dataType:i?.dataType,column:f,operator:h===E.between.value?E.gte.value:h,value:S}];h===E.between.value&&j.push({dataType:i?.dataType,column:f,operator:E.lte.value,value:b}),v(l,j)},p=(a,r)=>{switch(r){case"age":s(O(a.target.value,0));break;case"ageMax":g(O(a.target.value,0));break;case"operator":c(a?.value);break}t(a,r)};return e.jsxs("div",{className:`rbs-filter-field ${n===E.between.value?"three-row":""}`,children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"*Operator"}),e.jsx(y,{value:n,options:Pa(E),name:"operator",clearable:!1,searchable:!1,onChange:a=>p(a,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"*Age"}),e.jsx($,{value:o,onChange:a=>p(a,"age"),type:"number",dontShow:"false",placeholder:n===E.between.value?"e.g. 24":"Ex: 25",required:!0}),n===E.between.value&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filter-multi-connector"}),e.jsx($,{value:m,onChange:a=>p(a,"ageMax"),type:"number",placeholder:"e.g. 34",dontShow:"false",validation:o?{minNumber:o}:{},required:!0})]})]})]})},Ma=await T("react"),{useState:le,useEffect:Aa}=Ma,Ga=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:F.equals.value},[o,s]=le({}),[m,g]=le(null),[n,c]=le("");Aa(()=>{aa(a=>{const r=a?.map(h=>({value:h,name:h})),f=u?.[l];f?.length===1?(g(f[0].value),c(f[0].operator)):c(d.operator),s(r)})},[u]);const t=(a,r)=>{const f=V.genderOperator,h=r==="operator"?a.value:n,S=r==="gender"?a.value:m,b=[{dataType:i?.dataType,column:f,operator:h,value:S}];v(l,b)},p=(a,r)=>{switch(r){case"gender":g(a?.value);break;case"operator":c(a?.value);break}t(a,r)};return e.jsxs("div",{className:"rbs-filter-field",children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Operator*"}),e.jsx(y,{value:n,options:k(F),name:"operator",clearable:!1,searchable:!1,onChange:a=>p(a,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Gender*"}),e.jsx(y,{value:m,placeholder:m||"Select a Gender",options:k(o),name:"operator",clearable:!1,searchable:!1,className:`criteria-field one-whole ${!m&&"has-error"}`,onChange:a=>p(a,"gender"),openOnClick:!0}),!m&&e.jsx(q,{el:"block"})]})]})},Ia=await T("react"),{useState:je,useEffect:La}=Ia,Ba=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:F.equals.value,value:""},[o,s]=je(null),[m,g]=je("");La(()=>{const t=u?.[l];t?.length===1?(s(t[0].value),g(t[0].operator)):(g(d.operator),s(d.value))},[u]);const n=(t,p)=>{const a=V.browserOperator,r=p==="operator"?t.value:m,f=p==="browser"?t.value:o,h=[{dataType:i?.dataType,column:a,operator:r,value:f}];v(l,h)},c=(t,p)=>{switch(p){case"browser":s(t?.value);break;case"operator":g(t?.value);break}n(t,p)};return e.jsxs("div",{className:"rbs-filter-field",children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Operator*"}),e.jsx(y,{value:m,options:k(F),name:"operator",clearable:!1,searchable:!1,onChange:t=>c(t,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Browser*"}),e.jsx(y,{value:o,placeholder:o||"Select a browser",options:k(Re),name:"operator",clearable:!1,searchable:!1,className:`criteria-field one-whole ${!o&&"has-error"}`,onChange:t=>c(t,"browser"),openOnClick:!0}),!o&&e.jsx(q,{el:"block"})]})]})},Ya=await T("react"),{useState:Ne,useEffect:Ua}=Ya,za=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:F.equals.value,value:""},[o,s]=Ne(null),[m,g]=Ne("");Ua(()=>{const t=u?.[l];t?.length===1?(s(t[0].value),g(t[0].operator)):(g(d.operator),s(d.value))},[u]);const n=(t,p)=>{const a=V.deviceOperator,r=p==="operator"?t.value:m,f=p==="device"?t.value:o,h=[{dataType:i?.dataType,column:a,operator:r,value:f}];v(l,h)},c=(t,p)=>{switch(p){case"device":s(t?.value);break;case"operator":g(t?.value);break}n(t,p)};return e.jsxs("div",{className:"rbs-filter-field",children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Operator*"}),e.jsx(y,{value:m,options:k(F),name:"operator",clearable:!1,searchable:!1,onChange:t=>c(t,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Device*"}),e.jsx(y,{value:o,placeholder:o||"Select a Device",options:k(Pe),name:"operator",clearable:!1,searchable:!1,className:`criteria-field one-whole ${!o&&"has-error"}`,onChange:t=>c(t,"device"),openOnClick:!0}),!o&&e.jsx(q,{el:"block"})]})]})},Wa=await T("react"),{useState:we,useEffect:Ha}=Wa,Qa=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:F.equals.value,value:""},[o,s]=we(null),[m,g]=we("");Ha(()=>{const t=u?.[l];t?.length===1?(s(t[0].value),g(t[0].operator)):(g(d.operator),s(d.value))},[u]);const n=(t,p)=>{const a=V.operatingSystemOperator,r=p==="operator"?t.value:m,f=p==="operatingSystem"?t.value:o,h=[{dataType:i?.dataType,column:a,operator:r,value:f}];v(l,h)},c=(t,p)=>{switch(p){case"operatingSystem":s(t?.value);break;case"operator":g(t?.value);break}n(t,p)};return e.jsxs("div",{className:"rbs-filter-field",children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Operator*"}),e.jsx(y,{value:m,options:k(F),name:"operator",clearable:!1,searchable:!1,onChange:t=>c(t,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Operating System*"}),e.jsx(y,{value:o,placeholder:o||"Select an Operator",options:k(qe),name:"operator",clearable:!1,searchable:!1,className:`criteria-field one-whole ${!o&&"has-error"}`,onChange:t=>c(t,"operatingSystem"),openOnClick:!0}),!o&&e.jsx(q,{el:"block"})]})]})},_a=await T("react"),{useState:Ka,useEffect:Xa}=_a,Za=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const[d,o]=Ka(""),s={dataType:i?.dataType,operator:F.equals.value,value:"true"},m=(n,c)=>{const t=V.emailSubscription,p=c==="operator"?n?.value:d.value,a=c==="initial"?s.operator:"",f=[{dataType:i?.dataType,column:t,operator:c==="operator"?p:a,value:"true"}];v(l,f)},g=(n,c)=>{c==="operator"&&o(n?.value),m(n,c)};return Xa(()=>{const n=u?.[l];n?.length===0?(o(s.operator),m(s,"initial")):n?.length===1?o(n[0].operator):o(s.operator)},[u]),e.jsxs("div",{className:"rbs-filter-field",children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Operator*"}),e.jsx(y,{value:d,options:k(F),name:"operator",clearable:!1,searchable:!1,onChange:n=>g(n,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Email"}),e.jsx($,{disabled:!0,type:"text",placeholder:"Email Subscription",inputClassName:"borderContour",className:"lightGrey"})]})]})},Ja=await T("react"),{useState:et,useEffect:at}=Ja,tt=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:F.equals.value,value:"true"},[o,s]=et(""),m=(n,c)=>{const t=V.pushSubscriptionOperator,p=c==="operator"?n.value:o,a=c==="initial"?d.operator:"",r=[{dataType:i?.dataType,column:t,operator:c==="operator"?p:a,value:"true"}];v(l,r)},g=(n,c)=>{c==="operator"&&s(n?.value),m(n,c)};return at(()=>{const n=u?.[l];n?.length===0?(s(d.operator),m(d,"initial")):n?.length===1?s(n[0].operator):s(d.operator)},[u]),e.jsxs("div",{className:"rbs-filter-field",children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Operator*"}),e.jsx(y,{value:o,options:k(F),name:"operator",clearable:!1,searchable:!1,onChange:n=>g(n,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Push"}),e.jsx($,{disabled:!0,type:"text",placeholder:"Push Subscription",inputClassName:"borderContour",className:"lightGrey"})]})]})},rt=await T("react"),{useState:ne,useEffect:st}=rt,ot={value:"any",label:"any segment",title:"any segment"},lt=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,column:V.customSegmentOperator,operator:F.equals.value,value:"any"},[o,s]=ne(""),[m,g]=ne([]),[n,c]=ne("");u?.[l].length===0&&v(l,[d]),st(()=>{const a=u?.[l]?.[0];c(a?.operator||d.operator);const r=a?a?.value:d.value;s(r),(!m.some(h=>h.value===r)&&r!=="any"||m.length===0)&&sa(h=>{const b=h.filter(w=>w.status==="ACTIVE").map(w=>w.name),N=(![d.value,b].includes(r)&&r?[...b,r]:b).sort().map(w=>({value:w,label:G(w),title:G(w)}));g([ot,...N])},["EVENT_BASED"])},[u]);const t=(a,r)=>{const f=V.customSegmentOperator,h=r==="operator"?a?.value:n,S=r==="segment"?a?.value:o,b=[{dataType:i?.dataType,column:f,operator:h,value:S}];v(l,b)},p=(a,r)=>
1{switch(r){case"segment":s(a?.value||"");break;case"operator":c(a?.value);break}t(a,r)};return e.jsxs("div",{className:"rbs-filter-field",children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Operator*"}),e.jsx(y,{value:n,options:k(F),name:"operator",clearable:!1,searchable:!1,onChange:a=>p(a,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Segment*"}),e.jsx(y,{value:o,options:m,name:"segment",clearable:!1,searchable:!0,onChange:a=>p(a,"segment"),className:`criteria-field one-whole ${o?"":"has-error"}`,openOnClick:!0,placeholder:P("Select or text")}),!o&&e.jsx(q,{})]})]})},nt=await T("react"),{useEffect:it,useState:Ce}=nt,ct=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:ve.equals.value,value:""},[o,s]=Ce(),[m,g]=Ce("");it(()=>{const t=u?.[l];t?.length===1?(s(t[0].value),g(t[0].operator)):(g(d.operator),s(d.value))},[u]);const n=(t,p)=>{const a=V.segmentParameterAlphanumericOperator,r=p==="operator"?t.value:m,f=p==="value"?t.target.value:o,h=[{dataType:i?.dataType,column:a,operator:r,value:f}];v(l,h)},c=(t,p)=>{switch(p){case"value":s(t.target.value);break;case"operator":g(t?.value);break}n(t,p)};return e.jsxs("div",{className:"rbs-filter-field",children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Operator*"}),e.jsx(ke,{value:m,options:k(ve),name:"operator",clearable:!1,searchable:!1,onChange:t=>c(t,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Value*"}),e.jsx($,{value:o,onChange:t=>c(t,"value"),type:"text",required:!0})]})]})},ut=await T("react"),{useEffect:pt,useState:ie}=ut,dt=({criteriaData:i,filterType:l,statements:u,callbackFunc:v})=>{const d={dataType:i?.dataType,operator:x.equals.value,value:""},[o,s]=ie(),[m,g]=ie(),[n,c]=ie("");pt(()=>{const a=u?.[l];a?.length>1?(a.forEach(r=>{r.operator===x.gte.value?s(r.value):r.operator===x.lte.value&&g(r.value)}),c(x.between.value)):a?.length===1?(s(a[0].value),c(a[0].operator)):(c(d.operator),s(d.value))},[u]);const t=(a,r)=>{const f=V.segmentParameterNumericOperator,h=r==="operator"?a.value:n,S=r==="value"?O(a.target.value,0):o;let b=r==="valueMax"?O(a.target.value,0):m;r==="operator"&&a.value!==x.between.value&&(b=null);const j=[{dataType:i?.dataType,column:f,operator:h===x.between.value?x.gte.value:h,value:S}];h===x.between.value&&j.push({dataType:i?.dataType,column:f,operator:x.lte.value,value:b}),v(l,j)},p=(a,r)=>{switch(r){case"value":s(O(a.target.value,0));break;case"valueMax":g(O(a.target.value,0));break;case"operator":c(a?.value);break}t(a,r)};return e.jsxs("div",{className:`rbs-filter-field ${n===x.between.value?"three-row":""}`,children:[e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Operator*"}),e.jsx(ke,{value:n,options:k(x),name:"operator",clearable:!1,searchable:!1,onChange:a=>p(a,"operator"),className:"criteria-field one-whole",openOnClick:!0})]}),e.jsx("div",{className:"filter-connector"}),e.jsxs("div",{className:"filter-operator",children:[e.jsx("span",{className:"filter-operator-title",children:"Value*"}),e.jsx($,{value:o,onChange:a=>p(a,"value"),type:"number",required:!0,placeholder:n===x.between.value?"min":""}),n===x.between.value&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filter-multi-connector"}),e.jsx($,{value:m,onChange:a=>p(a,"valueMax"),type:"number",required:!0,placeholder:"max",validation:o?{minNumber:o}:{}})]})]})]})},mt=await T("react"),{useEffect:ft,useState:vt}=mt,ht=i=>{const l=[];
1return Object.keys(i).forEach(u=>{const v=i[u];if(v?.type==="title"){if(v?.name==="Segment Parameter")return;const d=Object.keys(v?.criteriaList).map(o=>{const s=v?.criteriaList[o];return{value:s?.id,label:s?.name,disabled:!s?.isActive,criteriaFilters:s?.criteriaFilters,dataType:s?.dataType,parent:u}});l.push(...d)}else l.push({value:v?.id,label:v?.name,disabled:!v?.isActive,criteriaFilters:v?.criteriaFilters,dataType:v?.dataType,parent:""})}),l},ce=({criteriaType:i,statements:l,position:u,isLast:v,isAloneCriteria:d,isAloneGroup:o})=>{const s=K(),[m,g]=Te(),n=B(b=>b.rbs.segmentParameters),c=ht(Ae),[t,p]=vt(c);ft(()=>{Object.keys(n.adapted).length>0&&(p(b=>[...b,...n.adapted]),s(Me(n.adapted)))},[n.adapted]);const a=t.find(b=>b.value===i),r=b=>{s(Ge({position:u,criteriaType:b.value}))},f=(b,j)=>{const R={...l};R[b]=j,s(Le({position:u,statements:R}))},h=()=>{s(Be({position:u}))},S=()=>{s(d&&!o?ye({position:u}):Ie({position:u}))};return e.jsxs("div",{className:`rbs-criteria-field ${g?"hovered":""}`,children:[e.jsx("h5",{className:"rbs-criteria-title",style:{marginBottom:"10px"},children:"Criteria"}),e.jsx(y,{className:"select-criteria-type",options:t,value:i,clearable:!1,placeholder:"Select a criteria",onChange:b=>r(b)}),i&&e.jsxs("div",{className:"delete-criteria-button",ref:m,onClick:()=>S(),children:[e.jsx("span",{children:"Remove Criteria"}),e.jsx("div",{className:"icon-delete",children:e.jsx(Q,{name:"trashBin",color:"#CC4230",width:12,height:12})})]}),i&&Object.keys(l).length>0&&e.jsx("div",{className:"rbs-criteria-filters",children:Object.keys(l).map(b=>{const j={criteriaData:a,filterType:b,statements:l,callbackFunc:f};switch(b){case"categoryOperator":return e.jsx(Je,{...j});case"productOperator":return e.jsx(Ze,{...j});case"brandOperator":return e.jsx(Xe,{...j});case"totalRevenueOperator":return e.jsx(Ke,{...j});case"transactionOperator":return e.jsx(ca,{...j});case"quantityOperator":return e.jsx(da,{...j});case"amountOperator":return e.jsx(va,{...j});case"dateOperator":return e.jsx(xa,{...j});case"pageOperator":return e.jsx(Ca,{...j});case"urlOperator":return e.jsx(ya,{...j});case"productViewCountOperator":return e.jsx(Va,{...j});case"pageViewCountOperator":return e.jsx(Da,{...j});case"ageOperator":return e.jsx(qa,{...j});case"genderOperator":return e.jsx(Ga,{...j});case"browserOperator":return e.jsx(Ba,{...j});case"deviceOperator":return e.jsx(za,{...j});case"operatingSystemOperator":return e.jsx(Qa,{...j});case"emailSubscription":return e.jsx(Za,{...j});case"pushSubscriptionOperator":return e.jsx(tt,{...j});case"customSegmentOperator":return e.jsx(lt,{...j});case"segmentParameterAlphanumericOperator":return e.jsx(ct,{...j});case"segmentParameterNumericOperator":return e.jsx(dt,{...j});default:return null}})}),v&&i&&e.jsx("div",{className:"rbs-criteria-add-button-field",children:e.jsx("div",{className:"rbs-criteria-add-button",onClick:()=>h(),children:e.jsx("span",{children:"+ Add Criteria"})})})]})};
1ce.propTypes={criteriaType:C.string,statements:C.shape({}),position:C.shape([]),isLast:C.bool.isRequired,isAloneCriteria:C.bool.isRequired,isAloneGroup:C.bool.isRequired};ce.defaultProps={criteriaType:"",statements:{},position:[0,0]};await T("react");const _=({operatorType:i,position:l,type:u,tooltip:v})=>{const d=K(),o=g=>{d(Ye({position:l,operator:g,type:u}))},s=()=>u==="group"?"When you make this change all group conditions will be changing":"When you make this change all criteria conditions will be changing",m=()=>e.jsxs("div",{className:"rbs-and-or-operator-select",children:[e.jsx("div",{className:`rbs-operators ${i==="and"?"selected":""}`,onClick:()=>o("and"),children:"AND"}),e.jsx("div",{className:`rbs-operators ${i==="or"?"selected":""}`,onClick:()=>o("or"),children:"OR"})]});return e.jsxs("div",{className:"rbs-and-or-operator",children:[e.jsx("div",{className:"rbs-and-or-operator-line"}),v?e.jsx(Ve,{overlayClassName:"rbs-and-or-operator-tooltip-overlay",className:"rbs-and-or-operator-tooltip",content:s(),alignment:u==="group"?"left":"right",newTooltip:!0,children:m()}):m()]})};_.propTypes={operatorType:C.string.isRequired,position:C.shape([]).isRequired,type:C.string.isRequired,tooltip:C.bool};_.defaultProps={tooltip:!1};await T("react");const ue=({position:i,isAloneCriteria:l,hoverRef:u})=>{const v=K(),d=()=>{v(Ue({position:i}))},o=()=>{ze({title:"Remove the Criteria Group?",content:"Are you sure you want to remove the criteria group you added?",onConfirm:()=>{v(ye({position:i}))}})};return e.jsxs("div",{className:"rbs-group-add-remove-button-field",children:[e.jsxs("div",{className:"rbs-group-add-button",onClick:()=>d(),children:[e.jsx(Q,{name:"plus",size:"2x"}),e.jsx("span",{children:"New Criteria Group"})]}),!l&&e.jsx(Ve,{overlayClassName:"rbs-group-remove-button-tooltip-overlay",className:"rbs-group-remove-button-tooltip",content:"Remove Criteria Group",alignment:"left",newTooltip:!0,children:e.jsx("div",{ref:u,className:"rbs-group-remove-button",onClick:()=>o(),children:e.jsx(Q,{name:"trashBin",color:"#CC4230",width:16,height:16})})})]})};ue.propTypes={position:C.shape([]),isAloneCriteria:C.bool.isRequired,hoverRef:C.shape({}).isRequired};ue.defaultProps={position:[0,0]};const gt=await T("react"),{useState:Se}=gt,pe=({segmentName:i,description:l,criteriaData:u,status:v,mode:d})=>{const o=B(f=>f.rbs.wizardFilter.campaignDetails),[s,m]=Se(!1),[g,n]=Se(`${i}${d==="duplicate"?" copy":""}`),c=f=>{m(!1),A.isLoaded();let h=()=>e.jsx("div",{children:"Segmentation is successfully updated in Draft mode."});f==="ACTIVE"&&(h=()=>e.jsx("div",{children:"Segmentation is successfully updated in Live mode."})),A.showNotification({content:h})},t=()=>{ra({segmentName:g,description:l,segmentStatus:v==="Live"?"ACTIVE":"TEST",segmentFilters:u}).then(S=>{c(S.status);const{instanceId:b}=S;ge.push(`/audience/rule-based-segmentation/edit/${b}`)}).catch(()=>{m(!1),A.isLoaded()})},p=()=>{ta({segmentName:g,description:l,segmentStatus:v==="Live"?"ACTIVE":"TEST",segmentFilters:u,campaignDetails:o}).then(S=>{c(S.status);const{instanceId:b}=S;ge.push(`/audience/rule-based-segmentation/edit/${b}`)}).catch(()=>{m(!1),A.isLoaded()})},a=()=>{m(!1),Oe.closeModal()},r=()=>{document.querySelectorAll(".has-error").length===0?(m(!0),A.isLoading(),d==="edit"?p():t()):A.isValidating()};return e.jsxs("div",{className:"rbs-wizard-save-preview",children:[e.jsxs("div",{className:`save-preview-segmentName-field ${d==="edit"?"readonly":""}`,children:[e.jsx("span",{className:"save-preview-title",children:P(d==="edit"?"Segment Name":"Segment Name*")}),e.jsx($,{className:"save-preview-segmentName",name:"segmentName",value:g,onChange:f=>n(f.target.value),required:!0,readOnly:d==="edit"})]}),e.jsx(oa,{criteriaData:u}),e.jsxs("div",{className:"rbs-wizard-save-preview-modal-buttons",children:[e.jsxs("a",{className:`button goback-action one-whole ${s?"goback-action--disabled":""}`,onClick:()=>a(),children:[e.jsx(Q,{name:"leftLongArrow"}),P("Back"),s&&e.jsx("span",{className:"page-progress page-progress--button"})]}),e.jsxs("a",{className:`button tertiary-action one-whole gosave-action ${s?"gosave-action--disabled":""}`,onClick:()=>r(),children:[P(`Confirm and ${v==="Test"?"Save as Draft":"Live"}`),s&&e.jsx("span",{className:"page-progress page-progress--button"})]})]})]})};pe.propTypes={segmentName:C.string,description:C.string,criteriaData:C.shape({operator:C.string,criterias:C.shape([])}).isRequired,status:C.string.isRequired,mode:C.string.isRequired};pe.defaultProps={segmentName:"",description:""};const xt=await T("react"),{useEffect:bt}=xt,$e=({rbsFilterState:i,groupItem:l,groupIndex:u})=>{const[v,d]=Te(),o=i?.operator,s=i?.criteriaGroups.length===1,m=l?.criterias?.length,g=!!l?.criterias?.[m-1]?.criteriaType;return e.jsxs(e.Fragment,{children:[u>0&&e.jsx(_,{operatorType:o,position:[u],type:"group",tooltip:i?.criteriaGroups.length>2}),e.jsxs("div",{className:`rbs-wizard-group ${d?"hovered":""}`,children:[l?.criterias.map((n,c)=>{const t=l?.operator,p=c===l?.criterias.length-1,a=l?.criterias.length===1;return e.jsxs(e.Fragment,{children:[c>0&&e.jsx(_,{operatorType:t,position:[u,c],type:"criteria",tooltip:m>2}),e.jsx(ce,{criteriaType:n.criteriaType,statements:n.statements,position:[u,c],isLast:p,isAloneCriteria:a,isAloneGroup:s})]})}),m>=1&&g&&e.jsx(ue,{position:[u,0],isAloneCriteria:m===1,hoverRef:v})]})]})};$e.propTypes={rbsFilterState:C.shape({operator:C.string,criteriaGroups:C.shape([])}).isRequired,groupItem:C.shape({operator:C.string,criterias:C.shape([])}).isRequired,groupIndex:C.number.isRequired};const jt=({params:i})=>{const l=K(),u=B(t=>t.rbs.wizardFilter.segmentName),v=B(t=>t.rbs.wizardFilter.data),d=B(t=>t.rbs.segmentParameters),o=B(t=>t.rbs.wizardFilter.description),{mode:s,segmentId:m}=i,{showBreadcrumb:g}=A;bt(()=>{l(s==="edit"||s==="duplicate"?We({segmentId:m,data:d.raw}):He()),g({home:{name:"Customer Management",icon:"audienceIcon",iconSvg:!0,slug:"/audience/segmentation/view-all"},before:{name:"Rule Based Segmentation",slug:"/audience/rule-based-segmentation"},current:{name:s==="add"?"Add Rule Based Segmentation":"Edit Rule Based Segmentation"}})},[s,m,d.raw]);const n=t=>{const p=s!=="add"?u:"";function a(){return e.jsx(pe,{segmentName:p,description:o,criteriaData:v,status:t,mode:s})}
1Oe.openModal({content:a,className:"rbs-wizard-save-preview-modal save-preview"})},c=t=>{const p=document.querySelectorAll(".has-error");let a="";p.length>0?a="Please fill in all required fields.":v?.criteriaGroups.length===1&&v?.criteriaGroups[0]?.criterias.length===1&&v?.criteriaGroups[0]?.criterias[0]?.criteriaType===""&&(a="Please add at least one criteria."),a?_e({content:()=>e.jsx("p",{children:a}),className:"notification-fail"}):n(t)};return e.jsxs("div",{className:"rbs-wizard",children:[e.jsx("h2",{className:"page-title",style:{marginBottom:"30px"},children:P(s==="edit"?u:"Create a new Segment")}),e.jsx(la,{type:"block--bottom",cardTitle:P("Description (Optional)"),labelFor:"description",leftCharacter:100-o.length,children:e.jsx($,{id:"description",type:"text",name:"description",className:"item-stacked one-whole",placeholder:P("Type here..."),value:o,onChange:t=>l(Qe(t.target.value)),maxLength:100})}),v?.criteriaGroups?.map((t,p)=>e.jsx($e,{rbsFilterState:v,groupItem:t,groupIndex:p})),e.jsxs("div",{className:"rbs-wizard-buttons",children:[e.jsx("a",{className:"button gotest-action one-whole",onClick:()=>c("Test"),children:P("Save as Draft")}),e.jsx("a",{className:"button tertiary-action one-whole golive-action",onClick:()=>c("Live"),children:P(s==="edit"?"Update Segment":"Create Segment")})]})]})};jt.propTypes={params:C.shape({mode:C.string.isRequired,segmentId:C.string}).isRequired};export{jt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.