1import{r as e,s as t}from"./chunk-BMzQdc6P.js";t();var n=e(`customer-support`),r=async e=>{try{let t=new FormData,r={email:e.email,description:e.description,summary:e.summary,tags:e.tags,assignedTo:e.assignedTo};return t.append(`submit_ticket`,JSON.stringify(r)),e.files&&e.files.length>0&&(Array.isArray(e.files)?e.files.forEach((e,n)=>{t.append(`files[${n}]`,e)}):t.append(`files`,e.files)),await n(t,{headers:{"Content-Type":`multipart/form-data`}})}catch(e){throw console.error(`Failed to submit ticket:`,e),e}},i=async(e={})=>{try{return await n({get_tickets:{page:e.page||1,itemsPerPage:e.itemsPerPage||10,search:e.search,match:e.match,sort:e.sort||{timestamp:-1}}})}catch(e){throw console.error(`Failed to fetch tickets:`,e),e}},a=async e=>{try{return await n({get_ticket_details:{ticketId:e}})}catch(e){throw console.error(`Failed to fetch ticket details:`,e),e}},o=async({ticketId:e,body:t,author:r,messageType:i=`message`,files:a})=>{try{let o=new FormData;return o.append(`send_message`,JSON.stringify({ticketId:e,body:t,author:r,messageType:i})),a&&(Array.isArray(a)?a.forEach((e,t)=>o.append(`files[${t}]`,e)):o.append(`files`,a)),await n(o,{headers:{"Content-Type":`multipart/form-data`}})}catch(e){throw console.error(`Failed to send message:`,e),e}},s=async({ticketId:e,after:t})=>{try{if(!e)throw Error(`Ticket ID is required`);return await n({get_messages:{ticketId:e,after:t?new Date(t).toISOString():null}})}catch(e){throw console.error(`Failed to fetch messages:`,e),e}},c=async e=>{try{return await n({update_ticket:e})}catch(e){throw console.error(`Failed to update ticket:`,e),e}},l=async(e,t)=>{try{return await n({assign_ticket:{ticketId:e,assignee:t}})}catch(e){throw console.error(`Failed to assign ticket:`,e),e}},u=async()=>{try{return await n({get_tags:{}})}catch(e){throw console.error(`Failed to fetch tags:`,e),e}},d=async(e,t=`soft`)=>{try{return await n({delete_tickets:{ids:e,mode:t}})}catch(e){throw console.error(`Failed to delete tickets:`,e),e}},f=async e=>{try{return await n({restore_tickets:{ids:e}})}catch(e){throw console.error(`Failed to restore tickets:`,e),e}},p=async(e={})=>{try{let t=e.page!==void 0||e.itemsPerPage!==void 0;return await n({get_agents:{page:e.page||1,itemsPerPage:t?e.itemsPerPage||10:1e3,search:e.search,match:e.match,sort:e.sort||{name:1}}})}catch(e){throw console.error(`Failed to fetch agents:`,e),e}},m=async e=>{try{return await n({add_agent:{email:e.email,name:e.name}})}catch(e){throw console.error(`Failed to add agent:`,e),e}},h=async e=>{try{return await n({edit_agent:{userId:e.userId,email:e.email,name:e.name,isAgent:e.isAgent,permissions:e.permissions,revokePermissions:e.revokePermissions}})}catch(e){throw console.error(`Failed to edit agent:`,e),e}},g=async()=>{try{return await n({get_statistics:{}})}catch(e){throw console.error(`Failed to fetch support statistics:`,e),e}},_=async e=>{try{return await n({merge_tickets:{primaryTicketId:e.primaryTicketId,secondaryTicketIds:e.secondaryTicketIds,notes:{primary:e.notes?.primary||``,secondary:e.notes?.secondary||``}}})}catch(e){throw console.error(`Failed to merge tickets:`,e),e}},v=async()=>await n({relay_status:{}}),y=async()=>await n({relay_setup:{}});export{l as _,s as a,u as c,_ as d,f,c as g,y as h,p as i,a as l,r as m,d as n,v as o,o as p,h as r,g as s,m as t,i as u}; 2//# sourceMappingURL=chunk-CFWGpInD2.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.