PageSourceSearch

https://app.churnkey.co/assets/settings-BY5Hntc_.js

js churnkey.co collected 2026-09-24 20:14:38 UTC 7,450 bytes, 2 lines download raw bytes

1import{h as U,d as P,f as z,s as v,a as b,o as r,G as A,i as h,e as w,b as a,aI as $,l,j as t,w as c,E,m as x,aa as Y,gl as q,fZ as N,gm as D,B as R,A as F,eT as J,b$ as M,aV as Q,F as W,r as X,aU as ee,t as O,k as y,a4 as V,ca as se}from"./index-V_hZsPnK.js";import{E as te}from"./index-C9ZX8JW5.js";import{E as I}from"./index-CkdYP7CD.js";import{_ as ae}from"./CampaignPreview.vue_vue_type_script_setup_true_lang-BoJDyVi2.js";import"./_baseClone-CAO548u6.js";import"./_initCloneObject-D0TEPcJk.js";import"./HeaderLoader.vue_vue_type_script_setup_true_lang-Cd386vNl.js";import"./index-BjvsloZK.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};n.SENTRY_RELEASE={id:"[email protected]"}}catch{}})();try{(function(){var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new n.Error().stack;d&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[d]="f2d357d5-9be1-4408-9727-ed08016fa47d",n._sentryDebugIdIdentifier="sentry-dbid-f2d357d5-9be1-4408-9727-ed08016fa47d")})()}catch{}const T="/api/unsubscribe",le={singleUnsubscribe(n){return U.post(`${T}/`,{email:n})},bulkUnsubscribe(n){return U.post(`${T}/bulk`,{emails:n})},getOrgUnsubscribes(n=1,d=10){return U.get(`${T}/page`,{params:{page:n,limit:d}})}},ne={class:"mt-3"},ie={key:1,class:"flex space-x-2"},oe={key:2,class:"flex space-x-3 mt-3"},re={class:"mt-3",style:{width:"300px"}},ue=5e3,ce=P({__name:"UnsubscribeUploader",setup(n){const d=z(),e=v(null),i=v(0),o=v(!1),k=v(null),g=v(0),m=v(0),_=v(null);function p(u){return o.value?(I.error("Please wait until the current process is finished."),!1):(C(),e.value=u,!1)}function C(){_.value&&_.value.clearFiles(),e.value=null,i.value=0,m.value=0,g.value=0}function L(u){const s=u.raw;s&&e.value!==s&&(e.value=s,i.value=0,m.value=0,g.value=0)}function Z(){if(!e.value){I.error("Please select a CSV file first.");return}o.value=!0,D.parse(e.value,{skipEmptyLines:!0,step:()=>{m.value+=1},complete:()=>{j(e.value)}})}function j(u){u&&(k.value=D.parse(u,{header:!1,chunk:(s,f)=>{f.pause(),G(s.data).then(()=>{o.value&&f.resume()}).catch(S=>{R.error("Error processing chunk",F.fromUnknown(S)),f.abort(),o.value=!1})},complete:()=>{i.value=100,o.value=!1,R.success("All emails processed and unsubscribed successfully.")},error:s=>{i.value=0,o.value=!1,R.error("Error parsing CSV file",s.message)},chunkSize:ue}))}async function G(u){g.value+=u.length;const{emails:s}=H(u);return s.length===0?Promise.resolve():(i.value=Math.round(Math.min(100,g.value/m.value*100)),le.bulkUnsubscribe(s))}function H(u){const s=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,f=[];return u.forEach(S=>{S.forEach(B=>{s.test(B)&&f.push(B)})}),{emails:f}}function K(){k.value&&k.value.abort(),o.value=!1,i.value=0,I.info("Processing aborted by the user.")}return(u,s)=>(r(),b("div",ne,[A(l(t(te),{ref_key:"upload",ref:_,action:"","before-upload":p,"on-change":L,"auto-upload":!1,"show-file-list":!1,disabled:!t(d).permissions.reactivation.write||o.value,accept:".csv"},{trigger:c(()=>[l(t(E),{plain:""},{default:c(()=>[...s[1]||(s[1]=[x(" Select CSV File ",-1)])]),_:1})]),_:1},8,["disabled"]),[[$,!e.value]]),e.value&&i.value!==100?(r(),h(t(Y),{key:0,modelValue:e.value.name,"onUpdate:modelValue":s[0]||(s[0]=f=>e.value.name=f),disabled:!0,size:"small",style:{width:"300px"}},null,8,["modelValue"])):w("",!0),e.value&&i.value===100?(r(),b("div",ie,[a("div",null,[l(t(q),{type:"success"},{default:c(()=>[...s[2]||(s[2]=[x("Emails successfully added to unsubscribe list",-1)])]),_:1})]),e.value&&!o.value?(r(),h(t(E),{key:0,size:"small",link:"",onClick:C},{default:c(()=>[...s[3]||(s[3]=[x(" Add More ",-1)])]),_:1})):w("",!0)])):(r(),b("div",oe,[e.value&&!o.value?(r(),h(t(E),{key:0,size:"small",type:"primary",onClick:Z},{default:c(()=>[...s[4]||(s[4]=[x(" Add Emails ",-1)])]),_:1})):w("",!0),e.value&&!o.value?(r(),h(t(E),{key:1,size:"small",link:"",onClick:C},{default:c(()=>[...s[5]||(s[5]=[x(" Cancel ",-1)])]),_:1})):w("",!0),o.value?(r(),h(t(E),{key:2,size:"small",link:"",onClick:K},{default:c(()=>[...s[6]||(s[6]=[x(" Cancel ",-1)])]),_:1})):w("",!0)])),a("div",re,[A(l(t(N),{percentage:i.value,status:"success"},null,8,["percentage"]),[[$,i.value===100]]),A(l(t(N),{percentage:i.value},null,8,["percentage"]),[[$,i.value>0&&i.value<100]])])]))}}),de={class:"mt-4"},pe={class:"font-medium"},fe={key:0,class:"text-brand-brown text-sm ml-2"},ve=P({__name:"ReactivationBcc",setup(n){const d=v([]),e=z(),i=J();g();async function o(){if(!e.org)throw new F("Org not found");await M.updateReactivationSettings(e.org._id,{bcc:e.org.reactivation?.bcc})}async function k(m){i.storeSettings({bcc:m}),await o()}async function g(){if(!e.org)throw new F("Org not found");d.value=await M.getMembers(e.org._id)}return(m,_)=>(r(),b("div",de,[l(t(Q),{disabled:!t(e).permissions.reactivation.write,"model-value":t(e).org?.reactivation?.bcc,multiple:"",filterable:"",placeholder:"Add Email Address","allow-create":"","no-data-text":"Enter New Value",class:"w-full",onCh
1ange:_[0]||(_[0]=p=>k(p))},{default:c(()=>[(r(!0),b(W,null,X(d.value,p=>(r(),h(t(ee),{key:p._id,value:p.email,label:p.email},{default:c(()=>[a("span",pe,O(p.email),1),p.name?(r(),b("span",fe,"("+O(p.name)+")",1)):w("",!0)]),_:2},1032,["value","label"]))),128))]),_:1},8,["disabled","model-value"])]))}}),me={class:"space-y-2"},be={class:"brand-card-lg"},ge={class:"flex items-center space-x-4"},_e={class:"pl-16"},xe={class:"relative divide-brand-sand border-t border-brand-sand pt-6 mt-6"},ye={class:"brand-card-lg"},he={class:"flex items-center space-x-4"},we={class:"pl-16"},ke={class:"brand-card-lg"},Ee={class:"flex items-center space-x-4"},Ce={class:"pl-16"},Fe=P({__name:"settings",setup(n){return(d,e)=>(r(),b("div",me,[a("div",be,[a("div",ge,[l(t(V),{class:"text-5xl"},{default:c(()=>[l(t(y),{icon:["fas","circle"],class:"text-red-200"}),l(t(y),{icon:["fas","cog"],class:"text-red-600 opacity-50 text-xl"})]),_:1}),e[0]||(e[0]=a("span",{class:"title -mt-2"},"Reactivation Testing",-1))]),e[1]||(e[1]=a("div",{class:"mt-0 pl-16"},[a("p",{class:"font-semibold text-brand-brown text-md"}," Using a Stripe canceled subscription ID, simulate the customer-facing Reactivation experience. Applies to live, testing, or sandbox mode. ")],-1)),a("div",_e,[a("div",xe,[l(ae,{"campaign-type":t(se).Type.REACTIVATION},null,8,["campaign-type"])])])]),a("div",ye,[a("div",he,[l(t(V),{class:"text-5xl"},{default:c(()=>[l(t(y),{icon:["fas","circle"],class:"text-purple-200"}),l(t(y),{icon:["fas","share"],class:"text-purple-600 opacity-50 text-xl"})]),_:1}),e[2]||(e[2]=a("span",{class:"title -mt-2"},"BCC Reactivation Emails",-1))]),e[3]||(e[3]=a("div",{class:"mt-0 pb-2 pl-16"},[a("p",{class:"font-semibold text-brand-brown text-md"}," Send reactivation emails to internal addresses or your CRM. ")],-1)),a("div",we,[l(ve)])]),a("div",ke,[a("div",Ee,[l(t(V),{class:"text-5xl"},{default:c(()=>[l(t(y),{icon:["fas","circle"],class:"text-fuchsia-200"}),l(t(y),{icon:["fas","envelope-open"],class:"text-fuchsia-600 opacity-50 text-xl"})]),_:1}),e[4]||(e[4]=a("span",{class:"title -mt-2"},"Unsubscribe List",-1))]),e[5]||(e[5]=a("div",{class:"mt-0 pb-2 pl-16"},[a("p",{class:"font-semibold text-brand-brown text-md"}," Upload a list of emails to exclude them from reactivation campaigns. ")],-1)),a("div",Ce,[l(ce)])])]))}});export{Fe as default};
2//# sourceMappingURL=settings-BY5Hntc_.js.map

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.