PageSourceSearch

https://app.paa.ge/static/js/7372.b7e58f1e.chunk.js

js paa.ge collected 2026-09-24 17:11:32 UTC 15,926 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunklamaco=self.webpackChunklamaco||[]).push([[7372],{9492:(e,t,n)=>{n.d(t,{Y:()=>d});var s=n(95920),l=n(13382),i=n(98734),a=n(26399),c=n(73216),o=n(70579);function d(e){let{title:t,description:n,button:d,backButton:r,backButtonUrl:m,withTabs:u,marginTop:p,noWrap:x,customPadding:y,direction:h,overTitle:g}=e;const v=(0,a.al)(),j=(0,c.Zp)();return(0,o.jsxs)(i.A,{flexDirection:"column",className:"w-100",children:[g&&!v&&(0,o.jsx)("div",{className:" d-flex mb-1",children:g}),(0,o.jsxs)("div",{className:"w-100 d-flex ".concat("column"===h?"flex-column":"justify-content-between align-items-center","  "),style:{paddingTop:v?16:0,paddingLeft:v?16:0,paddingRight:v?16:0,paddingBottom:null!==y&&void 0!==y?y:16},children:[(0,o.jsxs)("div",{children:[g&&v&&(0,o.jsx)("div",{className:"d-flex mb-1",children:g}),(0,o.jsxs)(i.A,{children:[r&&(0,o.jsx)(l.Ay,{onClick:()=>{j(m||-1)},className:"mr-2",type:"text",icon:(0,o.jsx)(s.A,{})}),(0,o.jsx)("div",{className:"text-lg-semibold",children:t})]}),n&&(0,o.jsx)("p",{className:"mt-0 d-block",children:n})]}),d&&(0,o.jsx)("div",{className:"d-flex flex-column",children:d})]})]})}},17372:(e,t,n)=>{n.r(t),n.d(t,{default:()=>E});var s=n(9492),l=n(74117),i=n(65043),a=n(26399),c=n(95406),o=n(33079),d=n(98734),r=n(4686),m=n(26449),u=n(91035),p=n(87393),x=n(67351),y=n(67263),h=n(70579);const g=e=>{let{setPage:t}=e;const n=(0,a.al)(),{t:s}=(0,l.Bd)(["contacts/general"]),o=(0,c.Iz)(),{q:u,type:p}=(0,c.IT)();(0,i.useMemo)(()=>[{label:s("list_type_static"),value:"static"},{label:s("list_type_dynamic"),value:"dynamic"}],[s]);return(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)(d.A,{style:{paddingBottom:20},gap:"xs",alignItems:"center",justifyContent:"between",className:"w-100 ".concat(n?"px-3":""),children:[!n&&(0,h.jsxs)(d.A,{alignItems:"center",gap:"xs",children:[(0,h.jsx)(x.Ay,{type:"binary",selected:"static"===p,onChange:e=>{o(["type","page"],e?["static","1"]:["","1"])},label:s("list_type_static")}),(0,h.jsx)(x.Ay,{type:"binary",selected:"dynamic"===p,onChange:e=>{o(["type","page"],e?["dynamic","1"]:["","1"])},label:s("list_type_dynamic")})]}),(0,h.jsxs)(d.A,{alignItems:"center",justifyContent:"end",gap:n?"sm":"xs",className:"w-100",children:[(0,h.jsx)(y.A,{placeholder:s("search_lists_placeholder"),value:u,className:"w-100",onChange:e=>{o(["q","page"],[e.target.value,"1"])},style:{maxWidth:n?"":280}}),n&&u&&(0,h.jsx)(r.Ay,{type:"ghost",onClick:()=>{o(["q","page"],["","1"])},children:s("cancel")}),n&&!u&&(0,h.jsx)(r.Ay,{type:"ghost",icon:m.FilterHorizontalIcon,onClick:()=>{}})]})]})})};var v=n(91646),j=n(47522),f=n(37537),_=n(22602);var A=n(63444),b=n(99139);const C=e=>{let{onSelectStatic:t,onSelectDynamic:n}=e;const{t:s}=(0,l.Bd)("contacts/general"),a=(0,i.useMemo)(()=>[{title:s("list_type_static"),description:s("static_list_description"),icon:m.UserMultiple02Icon,value:"static",onClick:t},{title:s("list_type_dynamic"),description:s("dynamic_list_description"),icon:m.FilterIcon,value:"dynamic",onClick:n}],[s,t,n]);return(0,h.jsx)(d.A,{flexDirection:"column",style:{gap:16},children:a.map(e=>(0,h.jsx)(b.A,{title:e.title,description:e.description,icon:e.icon,action:(0,h.jsx)(r.Ay,{type:"secondary",size:"small",children:s("select")}),onClick:e.onClick},e.value))})};var w=n(43801),k=n(87790),N=n(62704);const S=e=>{let{form:t,onSubmit:n}=e;const{t:s}=(0,l.Bd)("contacts/general");return(0,h.jsx)(w.A,{form:t,layout:"vertical",onFinish:n,children:(0,h.jsx)(d.A,{flexDirection:"column",gap:"lg",children:(0,h.jsx)(N.A,{label:s("list_name"),name:"name",rules:[{required:!0,message:s("list_name_required")}],children:(0,h.jsx)(k.A,{placeholder:s("list_name_placeholder")})})})})};var D=n(18371),L=n(7539);const I=e=>{let{availableLists:t=[],form:n,onSubmit:s}=e;const{t:i}=(0,l.Bd)("contacts/general"),{conditions:a,backendConditions:c,contactCount:o,countLoading:r,handleAddCondition:m,handleUpdateCondition:u,handleChangeConditionType:p,handleDeleteCondition:x,handleUpdateOperator:y}=(0,D.j)();return(0,h.jsx)(w.A,{form:n,layout:"vertical",onFinish:e=>s(e,c),children:(0,h.jsxs)(d.A,{flexDirection:"column",gap:"lg",children:[(0,h.jsx)(N.A,{label:i("list_name"),name:"name",rules:[{required:!0,message:i("list_name_required")}],children:(0,h.jsx)(k.A,{placeholder:i("list_name_placeholder")})}),(0,h.jsx)(L.A,{conditions:a,backendConditions:c,contactCount:o,countLoading:r,handleAddCondition:m,handleUpdate
1Condition:u,handleChangeConditionType:p,handleDeleteCondition:x,handleUpdateOperator:y,availableLists:t})]})})};var B=n(26361);const M=e=>{let{setStep:t,onCancel:n,onListCreated:s}=e;const{t:c}=(0,l.Bd)("contacts/general"),[o,d]=(0,i.useState)(null),m=(0,a.al)(),[u]=w.A.useForm(),[p]=w.A.useForm(),{data:x}=(0,B.M$)({limit:100,type:"static"},{keepPreviousData:!1}),y=(0,i.useMemo)(()=>null!==x&&void 0!==x&&x.data&&Array.isArray(x.data)?x.data.map(e=>({id:e.id,name:e.name})):[],[x]),g=()=>{d("static"),t(1)},v=()=>{d("dynamic"),t(2)},{mutateAsync:j,isLoading:f}=(0,B.gh)(),{mutateAsync:_,isLoading:A}=(0,B.gh)(),b=async e=>{try{var t;const i=null===(t=(await _({name:e.name,type:"static"})).data)||void 0===t?void 0:t.id;i?(l=i,console.log("Static list created successfully with ID:",l),null===s||void 0===s||s(l)):n()}catch(i){console.error("Failed to create static list:",i)}var l},k=async(e,t)=>{try{var l;if(!t)return void console.error("No valid conditions");const a=null===(l=(await j({name:e.name,type:"dynamic",segment_rules:t})).data)||void 0===l?void 0:l.id;a?(i=a,console.log("Dynamic list created successfully with ID:",i),null===s||void 0===s||s(i)):n()}catch(a){console.error("Failed to create email list:",a)}var i};return(0,i.useMemo)(()=>[{key:"select-list-type",index:0,title:c("new_list"),content:(0,h.jsx)("div",{className:"p-3",children:(0,h.jsx)(C,{onSelectStatic:g,onSelectDynamic:v})})},{key:"create-static-list",goBack:()=>t(0),index:1,title:c("create_static_list"),footer:(0,h.jsxs)(h.Fragment,{children:[!m&&(0,h.jsx)(r.Ay,{type:"secondary",onClick:n,disabled:A,children:c("cancel")}),(0,h.jsx)(r.Ay,{onClick:()=>u.submit(),size:m?"large":void 0,loading:A,children:c("create_list")})]}),content:(0,h.jsx)("div",{className:"p-3",children:(0,h.jsx)(S,{form:u,onSubmit:b})})},{key:"create-dynamic-list",goBack:()=>t(0),index:2,title:c("create_dynamic_list"),footer:(0,h.jsxs)(h.Fragment,{children:[!m&&(0,h.jsx)(r.Ay,{type:"secondary",onClick:n,disabled:f,children:c("cancel")}),(0,h.jsx)(r.Ay,{onClick:()=>p.submit(),size:m?"large":void 0,loading:f,children:c("create_list")})]}),content:(0,h.jsx)("div",{className:"p-3",children:(0,h.jsx)(I,{form:p,availableLists:y,onSubmit:k})})}],[c,n,s,y,f])};var T=n(73216),z=n(59781),F=n(89379),P=n(16569),q=n(94171),R=n(55983);const H=e=>{let{selectedRows:t,visible:n,onSuccess:s,selectAll:a}=e;const{t:c}=(0,l.Bd)("contacts/general"),[o,d]=(0,i.useState)(!1),{mutateAsync:r,isLoading:m}=(0,B.j7)(),u=t.length,p=1===u,x=c(p?"delete_lists.singular":"delete_lists.plural");return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(q.A,{danger:!0,open:o,onCancel:()=>d(!1),cancelText:c("cancel"),title:x,bodyText:c(p?"delete_lists_confirmation.singular":"delete_lists_confirmation.plural",{count:u}),confirmText:c("delete"),onConfirm:async()=>{try{await Promise.all(t.map(e=>r(e))),P.Ay.success(c(p?"lists_deleted_success.singular":"lists_deleted_success.plural",{count:u})),d(!1),s()}catch(e){console.error("Error deleting lists:",e),P.Ay.error(c(p?"error_deleting_lists.singular":"error_deleting_lists.plural"))}},loading:m}),(0,h.jsx)(R.Ay,{selectedCount:u,visible:n,selectAll:a?(0,F.A)((0,F.A)({},a),{},{selectAllLabel:c("select_all"),unselectAllLabel:c("unselect_all")}):void 0,selectedLabel:c("selected_lists",{count:u}),deleteLabel:x,deleteButtonLabel:c("delete"),actionsLabel:c("actions"),onDeleteClick:()=>d(!0)})]})},E=()=>{const{t:e}=(0,l.Bd)(["contacts/general"]),t=(0,z.jE)(),n=(0,a.al)(),x=(0,T.Zp)(),y=(0,c.Iz)(),{page:b,q:C,type:w,newList:k}=(0,c.IT)(),[N,S]=(0,i.useState)(15),[D,L]=(0,i.useState)(0),[I,F]=(0,i.useState)([]),P=Number(b)||1,q=(P-1)*N,{data:R,isLoading:E,refetch:U}=(0,B.M$)({limit:N,offset:q,q:C||void 0},{}),Y=null===R||void 0===R?void 0:R.data,O=Array.isArray(Y)?Y:(null===Y||void 0===Y?void 0:Y.data)||[],W=Array.isArray(Y)?Y.length:(null===Y||void 0===Y?void 0:Y.count)||0,J=(0,i.useMemo)(()=>w?O.filter(e=>e.type===w):O,[O,w]),Z=(0,i.useMemo)(()=>J.map(e=>({id:e.id,name:e.name,type:e.type,members:e.total_subscribers||0,last_processed:e.last_sync_at||e.updated_at})),[J]),$=w?J.length:W;(0,i.useEffect)(()=>{F(e=>e.filter(e=>Z.some(t=>t.id===e)))},[Z]),(0,i.useEffect)(()=>
1{if(n&&null!==I&&void 0!==I&&I.length)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="auto"}},[I,n]);const K=()=>{y(["newList"],["true"])},Q=()=>{y(["newList"],[""]),L(0)},G=M({setStep:L,onCancel:Q,onListCreated:e=>{U(),Q(),x("/audience/lists/".concat(e))}}),{listColumns:V,listColumnHeaders:X}=function(){let{selectedRows:e=[],setSelectedRows:t,lists:n=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{t:s}=(0,l.Bd)("contacts/general"),c=(0,a.al)(),o=(0,i.useMemo)(()=>[n=>t?{className:"hello",style:{width:"50px"},onClick:s=>{s.stopPropagation(),s.preventDefault(),e.includes(n.id)?t(e.filter(e=>e!==n.id)):t([...e,n.id])},hidden:!1,index:0,content:(0,h.jsx)(f.A,{className:c?"mr-2 mt-1":"mr-2 ml-2",onClick:s=>{s.stopPropagation(),s.preventDefault(),e.includes(n.id)?t(e.filter(e=>e!==n.id)):t([...e,n.id])},checked:e.includes(n.id),onChange:s=>{s.stopPropagation(),s.preventDefault(),e.includes(n.id)?t(e.filter(e=>e!==n.id)):t([...e,n.id])}})}:{className:"",hidden:!0,index:0,content:null},e=>({className:"w-100 cut-text-w-100",hidden:!1,index:1,content:(0,h.jsx)("div",{className:"font-weight-semibold cut-text-w-100",children:e.name})}),e=>({className:"w-100 cut-text-w-100",hidden:c,index:2,content:(0,h.jsx)(d.A,{className:"cut-text-w-100",children:(0,h.jsx)(j.A,{type:"dynamic"===e.type?"info":"default",size:"small",children:"dynamic"===e.type?s("list_type_dynamic"):s("list_type_static")})})}),e=>({className:"w-100 cut-text-w-100",hidden:c,index:3,content:(0,h.jsx)("div",{className:"cut-text-w-100",children:(0,v.Ft)(e.members)})}),e=>({className:"w-100 cut-text-w-100",hidden:c,index:4,content:(0,h.jsx)("div",{className:"cut-text-w-100 text-grey",children:(0,v.Yq)(new Date(e.last_processed))})}),e=>({className:"h-100",hidden:!c,index:5,content:(0,h.jsx)(d.A,{alignItems:"start",justifyContent:"end",className:"text-right font-size-sm cut-text-w-100 h-100",children:(0,h.jsxs)(d.A,{flexDirection:"column",gap:"xs",alignItems:"end",children:[(0,h.jsx)(j.A,{type:"dynamic"===e.type?"info":"default",size:"small",children:"dynamic"===e.type?s("list_type_dynamic"):s("list_type_static")}),(0,h.jsxs)("div",{className:"text-grey",children:[(0,v.Ft)(e.members)," ",s("list_members")]})]})})})],[s,c,e,t]),r=(0,i.useMemo)(()=>n.map(e=>e.id).filter(Boolean),[n]),m=r.length>0&&r.every(t=>e.includes(t)),u=r.some(t=>e.includes(t));return{listColumns:o,listColumnHeaders:(0,i.useMemo)(()=>{const e=s(m?"unselect_all":"select_all");return[{label:t?(0,h.jsx)(_.A,{title:e,children:(0,h.jsx)("div",{onClick:e=>{e.stopPropagation()},className:"pr-2 pl-2",children:(0,h.jsx)(f.A,{onClick:e=>{e.stopPropagation(),e.preventDefault(),t(m?[]:r)},checked:m,indeterminate:u&&!m,onChange:e=>{e.stopPropagation(),e.preventDefault(),t(m?[]:r)}})})}):"",key:"select",hidden:!t,className:"hello",index:0},{label:s("list_name"),key:"name",className:"w-100 cut-text-w-100",hidden:!1,index:1,sorter:(e,t,n)=>"asc"===n?e.name.localeCompare(t.name):t.name.localeCompare(e.name)},{label:s("list_type"),key:"type",hidden:c,index:2,sorter:(e,t,n)=>"asc"===n?e.type.localeCompare(t.type):t.type.localeCompare(e.type)},{label:s("list_members"),key:"members",hidden:c,index:3,sorter:(e,t,n)=>"asc"===n?e.members-t.members:t.members-e.members},{label:s("list_last_processed"),key:"last_processed",hidden:c,index:4,sorter:(e,t,n)=>"asc"===n?new Date(e.last_processed).getTime()-new Date(t.last_processed).getTime():new Date(t.last_processed).getTime()-new Date(e.last_processed).getTime()}]},[m,c,n,r,e,t,u,s])}}({selectedRows:I,setSelectedRows:F,lists:Z}),ee=(0,i.useMemo)(()=>Z.map(e=>e.id).filter(Boolean),[Z]),te=ee.length>0&&ee.every(e=>I.includes(e));return(0,h.jsxs)(o.A,{children:[(0,h.jsx)(A.A,{removePadding:!0,open:!!k,onCancel:Q,items:G,currentSlide:D,maxBodyHeight:n?void 0:"70vh"}),(0,h.jsxs)("div",{className:"d-flex justify-content-between align-items-center flex-column",children:[(0,h.jsx)(s.Y,{title:e("lists"),button:(0,h.jsx)(d.A,{alignItems:"center",gap:"md",children:(0,h.jsx)(r.Ay,{onClick:K,icon:m.PlusSignIcon,children:e("new_list")})})}),(0,h.jsxs)("div",{className:"w-100 mt-3",children:[(0,h.jsx)(g,{setPage:e=>y(["page"],[e.toString()],!0)}),(0,h.jsxs)("div",{children:[(0,h.jsx)(u.Ay,{type:"compact",loading:E,columnHeaders:n?[]:X,values:Z,getId:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.id)&&void 0!==t?t:""}
1,columns:V,preventRowClick:()=>I.length>0,onRowClick:e=>{x("/audience/lists/".concat(e.id))},empty:(0,h.jsxs)(d.A,{alignItems:"center",justifyContent:"center",className:"p-5 text-center text-grey",flexDirection:"column",gap:"md",children:[(0,h.jsx)("div",{children:e("lists_empty_state")}),(0,h.jsx)(r.Ay,{onClick:K,icon:m.PlusSignIcon,children:e("new_list")})]})}),!!$&&(0,h.jsx)(d.A,{alignItems:"center",justifyContent:"end",className:"w-100 mt-3",children:(0,h.jsx)(p.A,{pageSizeOptions:["15","25","50","100"],showSizeChanger:!0,onShowSizeChange:(e,t)=>{S(t)},current:P,pageSize:N,total:$,onChange:e=>y(["page"],[e.toString()],!0)})})]})]})]}),(0,h.jsx)(H,{selectedRows:I,visible:!!I.length,selectAll:{isAllSelected:te,onToggle:()=>{F(te?I.filter(e=>!ee.includes(e)):[...new Set([...I,...ee])])}},onSuccess:()=>{F([]),t.invalidateQueries({queryKey:["admin-lists"]})}})]})}},95920:(e,t,n)=>{n.d(t,{A:()=>o});var s=n(58168),l=n(65043);const i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"};var a=n(6127),c=function(e,t){return l.createElement(a.A,(0,s.A)({},e,{ref:t,icon:i}))};const o=l.forwardRef(c)},99139:(e,t,n)=>{n.d(t,{A:()=>g});var s,l,i=n(57528),a=n(67298),c=n(98734),o=n(63935),d=n(26399),r=n(65043),m=n(2826),u=n(91646),p=n(79229),x=n(70579);const y=m.Ay.div(s||(s=(0,i.A)(["\n  cursor: ",";\n  pointer-events: ",";\n  border-radius: 8px;\n  padding: 12px;\n  border: 1px solid ",";\n  background: ",";\n  transition: all 0.2s ease;\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  justify-content: space-between;\n  &:hover {\n    background: ",";\n  }\n"])),e=>{let{disabled:t}=e;return t?"not-allowed":"pointer"},e=>{let{disabled:t}=e;return t?"none":"auto"},o.Y2,e=>{let{disabled:t}=e;return t?o.mP:o.dh},o.aj),h=m.Ay.div(l||(l=(0,i.A)(["\n  opacity: ",";\n  transition: all 0.2s ease;\n"])),e=>{let{isHovered:t}=e;return t?1:0}),g=e=>{let{image:t,title:n,description:s,icon:l,onClick:i,action:m,disabled:g,className:v,style:j}=e;const[f,_]=(0,r.useState)(!1),A=(0,d.al)();return(0,x.jsxs)(y,{className:v,style:j,disabled:g,onClick:i,onMouseEnter:A?void 0:()=>_(!0),onMouseLeave:A?void 0:()=>_(!1),children:[(0,x.jsxs)(c.A,{flexDirection:"column",gap:"xs",children:[l&&(0,x.jsx)(x.Fragment,{children:(0,u.JJ)(l)?(0,x.jsx)(a.n,{strokeWidth:2,icon:l,size:16}):l}),(0,x.jsxs)(c.A,{alignItems:"center",gap:"sm",children:[t&&(0,x.jsx)(p.A,{format:"standard",src:t,alt:"string"===typeof n?n:""}),(0,x.jsxs)(c.A,{flexDirection:"column",gap:"xxs",children:[(0,x.jsx)("div",{className:"text-sm-medium",children:n}),s&&(0,x.jsx)("div",{className:"text-xs",style:{color:o.f},children:s})]})]})]}),m&&!A&&(0,x.jsx)(h,{isHovered:f,children:m})]})}}}]);

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.