1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`release-202609300849`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`9999eaf3-f355-4911-bc9f-14e27c4e626f`,e._sentryDebugIdIdentifier=`sentry-dbid-9999eaf3-f355-4911-bc9f-14e27c4e626f`)}catch{}})();import{u as e}from"./vendor-vue-core-DI5wj9bP.js";import{Ct as t,m as n}from"./utils-CL0hl12X.js";import{v as r}from"./user-TQfZ8_Hw.js";import{t as i}from"./toast-Bw7mV9qC.js";import{t as a}from"./tags-BvNf8SFB.js";var o=e({id:`contact`,state:()=>({allContacts:[],contactsMeta:{total:0,count:0,page:0,per_page:0,current_page:0,total_pages:0},uiFlags:{isContactsLoading:!1,isContactsDeleting:!1,isExportingContacts:!1}}),actions:{async getAllContacts({page:e,limit:t,search:n,segment:i}){this.uiFlags.isContactsLoading=!0;try{let{data:o,meta:s,included:c}=await new r().getContacts({page:e,limit:t,search:n,segment:i}),l=this.allContacts,u=o;if(e!==1&&(u=o.filter(e=>!l.some(t=>t.id===e.id))),c&&c.length){let e=c.filter(e=>e.type===`tag`);u.forEach(t=>{let n=[],r=a().tags;e.forEach(e=>{r.findIndex(t=>t.id===e.id),n!==-1&&n.push(e)});let i=[];t&&t.relationships.tags.data.length&&n.length&&t.relationships.tags.data.forEach(e=>{let t=n.find(t=>t.id===e.id);t&&i.push({id:t.id,name:t.attributes.name,color:t.attributes.color})}),t.attributes.tags=i})}e===1?this.allContacts=u:this.allContacts.push(...u),this.contactsMeta=s.pagination,this.uiFlags.isContactsLoading=!1}catch(e){console.error(e),this.uiFlags.isContactsLoading=!1}},async clearContactsMeta(){this.allContacts=[],this.contactsMeta={total:0,count:0,page:0,per_page:0,current_page:0,total_pages:0}},async deleteContacts(e){this.uiFlags.isContactsDeleting=!0;try{await new r().deleteContacts(e),this.allContacts=this.allContacts.filter(t=>!e.some(e=>e===t.id)),this.uiFlags.isContactsDeleting=!0}catch(e){this.uiFlags.isContactsDeleting=!0,t(e)}},async exportContacts(e){this.uiFlags.isExportingContacts=!0;try{n(await new r().exportContacts(e),`contacts.csv`),this.uiFlags.isExportingContacts=!1}catch(e){t(e),this.uiFlags.isExportingContacts=!1}},async deleteContactsPermanently(e){try{await new r().deleteContactsPermanently(e),i().set({message:e.length>1?`Contacts deleted permanently.`:`Contact deleted permanently.`}),this.allContacts=this.allContacts.filter(t=>!e.some(e=>e===t.id))}catch(e){t(e),i().set({message:`An error occurred`,type:`error`})}}}});export{o as t}; 2//# sourceMappingURL=contact-DTcsubHx.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.