@ecodrix/erix-api 4.3.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var fn=Object.create;var Pe=Object.defineProperty,bn=Object.defineProperties,hn=Object.getOwnPropertyDescriptor,xn=Object.getOwnPropertyDescriptors,kn=Object.getOwnPropertyNames,We=Object.getOwnPropertySymbols,Cn=Object.getPrototypeOf,It=Object.prototype.hasOwnProperty,nn=Object.prototype.propertyIsEnumerable;var wn=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n);var Rt=(n,e,t)=>e in n?Pe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,p=(n,e)=>{for(var t in e||(e={}))It.call(e,t)&&Rt(n,t,e[t]);if(We)for(var t of We(e))nn.call(e,t)&&Rt(n,t,e[t]);return n},E=(n,e)=>bn(n,xn(e));var R=(n,e)=>{var t={};for(var r in n)It.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&We)for(var r of We(n))e.indexOf(r)<0&&nn.call(n,r)&&(t[r]=n[r]);return t};var vn=(n,e)=>{for(var t in e)Pe(n,t,{get:e[t],enumerable:!0})},rn=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of kn(e))!It.call(n,o)&&o!==t&&Pe(n,o,{get:()=>e[o],enumerable:!(r=hn(e,o))||r.enumerable});return n};var Le=(n,e,t)=>(t=n!=null?fn(Cn(n)):{},rn(e||!n||!n.__esModule?Pe(t,"default",{value:n,enumerable:!0}):t,n)),Tn=n=>rn(Pe({},"__esModule",{value:!0}),n);var i=(n,e,t)=>Rt(n,typeof e!="symbol"?e+"":e,t);var Pt=function(n,e){this[0]=n,this[1]=e},sn=(n,e,t)=>{var r=(d,g,k,b)=>{try{var T=t[d](g),S=(g=T.value)instanceof Pt,V=T.done;Promise.resolve(S?g[0]:g).then(h=>S?r(d==="return"?d:"next",g[1]?{done:h.done,value:h.value}:h,k,b):k({value:h,done:V})).catch(h=>r("throw",h,k,b))}catch(h){b(h)}},o=(d,g,k,b)=>u[d]=T=>(g=new Promise((S,V,h)=>(h=()=>r(d,T,S,V),a?a.then(h):h())),b=()=>a===k&&(a=0),a=k=g.then(b,b),g),a,u={};return t=t.apply(n,e),u[wn("asyncIterator")]=()=>u,o("next"),o("throw"),o("return"),u};var Vn={};vn(Vn,{APIError:()=>y,APIResource:()=>s,AiAgent:()=>F,AuthenticationError:()=>v,Campaigns:()=>P,Catalog:()=>ce,ChannelSettingsResource:()=>U,Collector:()=>we,ConnectAccounts:()=>M,ConnectInfra:()=>_e,ECODrIx:()=>O,ECODrIxAPI:()=>O,ERROR_RETRY_CONFIG:()=>zt,EcodrixError:()=>je,EmailConnect:()=>Ue,ErixChat:()=>$e,ErixProduct:()=>Oe,FlowAudiences:()=>j,FlowAutomations:()=>_,FlowConversations:()=>B,FlowDrafts:()=>K,FlowFirstRunResource:()=>W,FlowHome:()=>q,FlowProduct:()=>Ve,HTTP_STATUS_ERROR_MAP:()=>In,InfraDomain:()=>Ae,KNOWLEDGE_FILE_TYPES:()=>un,Knowledge:()=>ue,LAIE_EVENTS:()=>cn,LEAD_STATUS_VALUES:()=>Vt,LaieAudits:()=>ie,LaieCampaigns:()=>z,LaieCompliance:()=>ee,LaieFreshness:()=>se,LaieImport:()=>X,LaieLeads:()=>J,LaieLearning:()=>ne,LaieLists:()=>Z,LaieLookalikes:()=>re,LaieMarket:()=>te,LaiePacks:()=>G,LaieProduct:()=>Fe,LaieRuns:()=>Y,LaieSignals:()=>H,LaieTools:()=>Q,Onboarding:()=>oe,PermissionError:()=>D,Persona:()=>ae,PlatformDomain:()=>Re,PlatformTenants:()=>Be,PlatformUsers:()=>qe,ProductDomain:()=>Se,RateLimitError:()=>I,SeoAudits:()=>ge,SeoBacklinks:()=>xe,SeoBriefs:()=>Ce,SeoInsights:()=>de,SeoLocal:()=>fe,SeoPerformance:()=>ke,SeoProduct:()=>De,SeoProjects:()=>pe,SeoRanks:()=>ye,SeoReports:()=>be,SeoResearch:()=>he,SeoSearchConsole:()=>me,StorageInfra:()=>Ne,VOICE_EVENTS:()=>pn,VOICE_REFUSAL_REASONS:()=>Kt,Voice:()=>Te,VoiceCampaigns:()=>Ee,WebhookSignatureError:()=>L,Webhooks:()=>Ie,WhatsAppConnect:()=>Me,default:()=>On,getErrorDetails:()=>En,getRetryConfig:()=>$n,handleAPIError:()=>Pn,isAPIError:()=>Ln,laieStageQueued:()=>an,toAPIError:()=>$,voiceErrorCode:()=>gn,voiceRefusalReason:()=>dn});module.exports=Tn(Vn);var yn=Le(require("axios"),1),Qt=Le(require("axios-retry"),1);var Lt="https://api.ecodrix.com";function on(n="v1",e=Lt){return`${e.replace(/\/+$/,"")}/${n}/api`}var je=class extends Error{constructor(e){super(e),this.name="EcodrixError"}},y=class extends je{constructor(t,r,o){super(t);i(this,"status");i(this,"code");i(this,"issues");i(this,"field");this.name="APIError",this.status=r,this.code=o}},v=class extends y{constructor(e="Invalid API Key or Client Code",t="AUTH_FAILED",r=401){super(e,r,t),this.name="AuthenticationError"}},D=class extends v{constructor(e="You don't have permission to do this.",t="FORBIDDEN"){super(e,t,403),this.name="PermissionError"}},I=class extends y{constructor(e="Too many requests. Please slow down."){super(e,429,"RATE_LIMIT_EXCEEDED"),this.name="RateLimitError"}};function $(n){var a;if(!(n!=null&&n.response))return new y((n==null?void 0:n.message)||"Network Error");let{status:e,data:t}=n.response,r=(t==null?void 0:t.message)||(t==null?void 0:t.error)||"API Request Failed",o=(a=t==null?void 0:t.code)!=null?a:typeof(t==null?void 0:t.error)=="string"&&/^[A-Z][A-Z0-9_]*$/.test(t.error)?t.error:void 0;switch(e){case 401:return new v(r,o);case 403:return new D(r,o);case 429:return new I(r);default:{let u=new y(r,e,o);return Array.isArray(t==null?void 0:t.issues)&&(u.issues=t.issues),typeof(t==null?void 0:t.field)=="string"&&(u.field=t.field),u}}}var s=class{constructor(e){i(this,"client",e)}async post(e,t,r){try{let o=this.buildConfig(r);return(await this.client.post(e,t,o)).data}catch(o){this.handleError(o)}}async get(e,t){try{let r=this.buildConfig(t);return(await this.client.get(e,r)).data}catch(r){this.handleError(r)}}async patch(e,t,r){try{let o=this.buildConfig(r);return(await this.client.patch(e,t,o)).data}catch(o){this.handleError(o)}}async put(e,t,r){try{let o=this.buildConfig(r);return(await this.client.put(e,t,o)).data}catch(o){this.handleError(o)}}async deleteRequest(e,t){try{let r=this.buildConfig(t);return(await this.client.delete(e,r)).data}catch(r){this.handleError(r)}}buildConfig(e){if(!e)return;let t=p({},e);return e.idempotencyKey&&(t.headers=E(p({},t.headers),{"Idempotency-Key":e.idempotencyKey})),t}handleError(e){throw $(e)}};var F=class extends s{async settings(){return this.get("/product/erix/ai/settings")}async updateSettings(e){return this.patch("/product/erix/ai/settings",e)}async outcomes(e={}){return this.get("/product/erix/ai/outcomes",{params:e})}async reviews(e){return this.get(`/product/erix/ai/reviews${e?`?status=${e}`:""}`)}async review(e,t,r){return this.post(`/product/erix/ai/reviews/${encodeURIComponent(e)}`,p({verdict:t},r?{note:r}:{}))}async suggestion(e){return this.get(`/product/erix/ai/suggestion/${e}`)}async approveAction(e){return this.post(`/product/erix/ai/suggestion/${e}/approve-action`,{})}async markSent(e,t,r){return this.post(`/product/erix/ai/suggestion/${e}/send`,{text:t,confidence:r})}async dismiss(e){return this.post(`/product/erix/ai/suggestion/${e}/dismiss`,{})}async approvals(){return this.get("/product/flow/approvals")}async agents(){return this.get("/product/flow/agents")}async agent(e){return this.get(`/product/flow/agents/${encodeURIComponent(e)}`)}async tryAgent(e,t){return this.post(`/product/flow/agents/${encodeURIComponent(e)}/try`,t)}async proposeAgentChange(e,t){return this.post(`/product/flow/agents/${encodeURIComponent(e)}/propose`,t)}async buildAgent(e){return this.post("/product/flow/agents/build",e)}async unansweredQuestions(){return this.get("/product/flow/agents/unanswered")}async markQuestionHandled(e){return this.post("/product/flow/agents/unanswered/handled",{question:e})}async agentTemplates(){return this.get("/product/flow/agents/templates")}async createAgent(e){return this.post("/product/flow/agents",e)}async updateAgent(e,t){return this.patch(`/product/flow/agents/${encodeURIComponent(e)}`,t)}async deleteAgent(e){return this.deleteRequest(`/product/flow/agents/${encodeURIComponent(e)}`)}async agentAutomation(e,t){return this.post(`/product/flow/agents/${encodeURIComponent(e)}/automation`,{trigger:t})}async decideRun(e,t,r){return this.post(`/product/flow/runs/${encodeURIComponent(e)}/approve`,p({decision:t},r&&{nodeId:r}))}};var x="/product/erix/commerce/checkout",A="/product/erix/public/checkout",C=encodeURIComponent,Et=class extends s{async getProduct(e,t){return this.get(`${A}/products/${C(t)}`,{params:{c:e}})}async viewSession(e,t){return this.get(`${A}/sessions/view`,{params:{c:e,t}})}async updateItems(e){let o=e,{sessionId:t}=o,r=R(o,["sessionId"]);return this.post(`${A}/sessions/${C(t)}/items`,r)}async startSession(e){return this.post(`${A}/sessions`,e)}async applyCoupon(e){let o=e,{sessionId:t}=o,r=R(o,["sessionId"]);return this.post(`${A}/sessions/${C(t)}/coupon`,r)}async verify(e){let o=e,{sessionId:t}=o,r=R(o,["sessionId"]);return this.post(`${A}/sessions/${C(t)}/verify`,r)}async placeOrder(e){let o=e,{sessionId:t}=o,r=R(o,["sessionId"]);return this.post(`${A}/sessions/${C(t)}/order`,r)}async verifyRazorpay(e){let a=e,{sessionId:t,orderId:r}=a,o=R(a,["sessionId","orderId"]);return this.post(`${A}/sessions/${C(t)}/order/${C(r)}/razorpay`,o)}async orderStatus(e,t){return this.get(`${A}/orders/status`,{params:{c:e,t}})}async confirmCod(e,t){return this.post(`${A}/cod/confirm`,{clientCode:e,token:t})}},$t=class extends s{async create(e){return this.post(`${x}/sessions`,e)}},Ge=class extends s{constructor(t){super(t);i(this,"buyer");i(this,"sessions");this.buyer=new Et(t),this.sessions=new $t(t)}async listProducts(){return this.get(`${x}/products`)}async createProduct(t){return this.post(`${x}/products`,t)}async updateProduct(t,r){return this.patch(`${x}/products/${C(t)}`,r)}async deleteProduct(t){return this.deleteRequest(`${x}/products/${C(t)}`)}async listCoupons(){return this.get(`${x}/coupons`)}async createCoupon(t){return this.post(`${x}/coupons`,t)}async updateCoupon(t,r){return this.patch(`${x}/coupons/${C(t)}`,r)}async deleteCoupon(t){return this.deleteRequest(`${x}/coupons/${C(t)}`)}async listOrders(t){return this.get(`${x}/orders`,{params:t})}async getOrder(t){return this.get(`${x}/orders/${C(t)}`)}async updateOrderStatus(t,r){return this.patch(`${x}/orders/${C(t)}/status`,r)}async getSettings(){return this.get(`${x}/settings`)}async updateSettings(t){return this.put(`${x}/settings`,t)}async createProductLink(t){return this.post(`${x}/links`,t)}};var He=class extends s{async providers(){return this.get("/infra/connect/providers")}async list(){return this.get("/infra/connect/connections")}async get_(e){return this.get(`/infra/connect/connections/${e}`)}async connect(e,t){return this.post(`/infra/connect/connections/${e}/connect`,t)}async configure(e,t){return this.put(`/infra/connect/connections/${e}/configure`,t)}async configureWebchat(e){return this.configure("webchat",{method:"domain",config:e})}async webchatSettings(){return this.get("/infra/connect/connections/webchat/settings")}async removeWebchatDomain(e){return this.deleteRequest(`/infra/connect/connections/webchat/domains/${encodeURIComponent(e)}`)}async disconnect(e){return this.post(`/infra/connect/connections/${e}/disconnect`,{})}async reveal(e){return this.post(`/infra/connect/connections/${e}/reveal`,{})}async test(e){return this.post(`/infra/connect/connections/${e}/test`,{})}async checkNow(e){return this.post(`/infra/connect/connections/${e}/health/check`,{})}async googleConnectUrl(){return this.post("/infra/connect/google/connect-url",{})}async moveChannel(e,t){return this.post(`/infra/connect/${e}/move`,{ticket:t})}async requestChannelRelease(e,t){return this.post(`/infra/connect/${e}/release-request`,{ticket:t})}async channelReleaseRequest(e){return this.get(`/infra/connect/${e}/release-request`)}async cancelChannelRelease(e){return this.deleteRequest(`/infra/connect/${e}/release-request`)}async createPaymentLink(e){return this.post("/infra/connect/connections/payments/payment-link",e)}};var U=class extends s{async retrieve(e){return this.get(`/infra/connect/channel-settings/${e}`)}async save(e,t){return this.put(`/infra/connect/channel-settings/${e}`,t)}async resumeEmail(){return this.post("/infra/connect/channel-settings/email/resume",{})}};var M=class extends s{async list(e){return this.get("/infra/connect/accounts",e?{params:{providerId:e}}:void 0)}async retrieve(e){return this.get(`/infra/connect/accounts/${encodeURIComponent(e)}`)}async update(e,t){return this.patch(`/infra/connect/accounts/${encodeURIComponent(e)}`,t)}async remove(e,t={}){return this.deleteRequest(`/infra/connect/accounts/${encodeURIComponent(e)}`,t.newDefaultId?{params:{newDefaultId:t.newDefaultId}}:void 0)}};var Ot=class extends s{async list(e){return this.get(`/product/erix/crm/leads/${e}/notes`)}async create(e,t){return this.post(`/product/erix/crm/leads/${e}/notes`,t)}async update(e,t){return this.patch(`/product/erix/crm/notes/${e}`,{content:t})}async pin(e,t=!0){return this.patch(`/product/erix/crm/notes/${e}/pin`,{isPinned:t})}async delete(e){return this.deleteRequest(`/product/erix/crm/notes/${e}`)}},Qe=class extends s{constructor(t){super(t);i(this,"notes");this.notes=new Ot(t)}async timeline(t,r){return this.get(`/product/erix/crm/leads/${t}/timeline`,{params:r})}async list(t,r){return this.get(`/product/erix/crm/leads/${t}/activities`,{params:p({},r)})}async log(t){return this.post(`/product/erix/crm/leads/${t.leadId}/activities`,t)}async logCall(t,r){return this.post(`/product/erix/crm/leads/${t}/calls`,r)}};var ze=class extends s{async overview(e){return this.get("/product/erix/crm/analytics/overview",{params:e})}async funnel(e){return this.get("/product/erix/crm/analytics/funnel",{params:{pipelineId:e}})}async forecast(e){return this.get("/product/erix/crm/analytics/forecast",{params:{pipelineId:e}})}async sources(e){return this.get("/product/erix/crm/analytics/sources",{params:e})}async team(e){return this.get("/product/erix/crm/analytics/team",{params:e})}async heatmap(e){return this.get("/product/erix/crm/analytics/heatmap",{params:e})}async scores(){return this.get("/product/erix/crm/analytics/scores")}async stageTime(e){return this.get("/product/erix/crm/analytics/stage-time",{params:{pipelineId:e}})}async tiered(e){return this.get("/product/erix/crm/analytics/tiered",{params:e})}async summary(e){return this.get("/product/erix/crm/analytics/summary",{params:e})}async whatsapp(e){return this.get("/product/erix/crm/analytics/whatsapp",{params:e})}async revenue(){return this.get("/product/erix/crm/analytics/revenue")}async health(){return this.get("/product/erix/crm/analytics/health")}async payments(){return this.get("/product/erix/crm/analytics/payments")}async reviews(){return this.get("/product/erix/crm/analytics/reviews")}async retention(){return this.get("/product/erix/crm/analytics/retention")}};var Ye=class extends s{async getChecklist(e){return this.get(`/product/erix/crm/documents/checklist/${e}`)}async createChecklist(e,t){return this.post(`/product/erix/crm/documents/checklist/${e}`,{templateNiche:t})}async markReceived(e,t,r){return this.patch(`/product/erix/crm/documents/checklist/${e}/${t}`,r?{fileUrl:r}:{})}async sendReminder(e){return this.post(`/product/erix/crm/documents/checklist/${e}/remind`)}async listIncomplete(){return this.get("/product/erix/crm/documents/checklist/incomplete")}async listTemplates(){return this.get("/product/erix/crm/documents/templates")}};var Je=class extends s{async csv(e){return this.get("/product/erix/commerce/invoices/export/csv",{params:e})}async tally(e){return this.get("/product/erix/commerce/invoices/export/tally",{params:e})}async zoho(e){return this.get("/product/erix/commerce/invoices/export/zoho",{params:e})}};var Vt=["open","won","lost","archived"],Xe=class extends s{async create(e){return this.post("/product/erix/crm/leads",e)}async describe(){let e=await this.fields(),t=Array.isArray(e.data)?e.data:[],r=[{key:"firstName",label:"First Name",type:"string",required:!0,group:"Basic Info"},{key:"lastName",label:"Last Name",type:"string",required:!1,group:"Basic Info"},{key:"phone",label:"Phone Number",type:"phone",required:!0,group:"Contact"},{key:"email",label:"Email Address",type:"email",required:!1,group:"Contact"},{key:"status",label:"Status",type:"select",required:!0,options:Vt.map(a=>({label:`${a.charAt(0).toUpperCase()}${a.slice(1)}`,value:a}))},{key:"value",label:"Lead Value",type:"currency",required:!1},{key:"source",label:"Source",type:"string",required:!1}],o=t.map(a=>({key:`metadata.extra.${a.name}`,label:a.label||a.name,type:a.type||"string",required:!!a.required,options:a.options,group:"Custom Fields"}));return{name:"Lead",fields:[...r,...o],uiHints:{icon:"User",primaryColor:"#3b82f6",defaultSort:{field:"createdAt",direction:"desc"},summaryFields:["firstName","lastName","phone","status"]}}}async upsert(e){return this.post("/product/erix/crm/leads/upsert",e)}async createMany(e,t=50){let r=[];for(let o=0;o<e.length;o+=t){let u=e.slice(o,o+t).map(g=>this.create(g)),d=await Promise.allSettled(u);for(let g of d)if(g.status==="fulfilled")r.push(g.value);else throw g.reason}return r}async import(e,t={}){return this.post("/product/erix/crm/leads/import",p({leads:e},t))}async bulkUpsert(e){return this.import(e)}async list(e){let t=p({},e);return Array.isArray(t.tags)&&(t.tags=t.tags.join(",")),this.get("/product/erix/crm/leads",{params:t})}listAutoPaging(e){return sn(this,null,function*(){let t=(e==null?void 0:e.page)||1,r=!0;for(;r;){let o=yield new Pt(this.list(E(p({},e),{page:t}))),a=Array.isArray(o.data)?o.data:o||[];if(a.length===0){r=!1;break}for(let u of a)yield u;o.pagination&&t<o.pagination.pages||!o.pagination&&a.length>0?t++:r=!1}})}async retrieve(e){return this.get(`/product/erix/crm/leads/${e}`)}async retrieveByPhone(e){return this.get(`/product/erix/crm/leads/phone/${encodeURIComponent(e)}`)}async byStage(e,t,r={}){return this.get(`/product/erix/crm/pipelines/${e}/stages/${t}/leads`,{params:r})}async retrieveByRef(e,t){return this.get(`/product/erix/crm/leads/ref/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)}async update(e,t){return this.patch(`/product/erix/crm/leads/${e}`,t)}async setFollowUp(e,t,r){return this.patch(`/product/erix/crm/leads/${e}`,{nextFollowUpAt:t,nextFollowUpNote:t&&r!=null?r:null})}async move(e,t){return this.patch(`/product/erix/crm/leads/${e}/move`,{stageId:t})}async convert(e,t,r){return this.post(`/product/erix/crm/leads/${e}/convert`,{outcome:t,reason:r})}async tags(e,t){return this.patch(`/product/erix/crm/leads/${e}/tags`,t)}async recalculateScore(e){return this.post(`/product/erix/crm/leads/${e}/score`,{})}async updateMetadata(e,t){return this.patch(`/product/erix/crm/leads/${e}/metadata`,t)}async fields(){return this.get("/product/erix/crm/fields")}async notes(e){return this.get(`/product/erix/crm/leads/${e}/notes`)}async activities(e,t){return this.get(`/product/erix/crm/leads/${e}/timeline`,{params:t})}async createNote(e,t){return this.post(`/product/erix/crm/leads/${e}/notes`,t)}async updateNote(e,t,r){return this.patch(`/product/erix/crm/notes/${t}`,r)}async deleteNote(e,t){return this.deleteRequest(`/product/erix/crm/notes/${t}`)}async delete(e){return this.deleteRequest(`/product/erix/crm/leads/${e}`)}async export(e){return this.get(`/product/erix/crm/leads/${encodeURIComponent(e)}/export`)}async erase(e){return this.post(`/product/erix/crm/leads/${encodeURIComponent(e)}/erase`,{confirm:"ERASE"})}async bulkArchive(e){return this.patch("/product/erix/crm/leads/bulk-archive",{ids:e})}async bulkDelete(e){return this.deleteRequest("/product/erix/crm/leads",{data:{ids:e}})}async archive(e){return this.deleteRequest(`/product/erix/crm/leads/${e}`)}async profile(e){return this.get(`/product/erix/crm/leads/${e}/profile`)}async invoices(e){return this.get(`/product/erix/crm/leads/${e}/invoices`)}async projects(e){return this.get(`/product/erix/crm/leads/${e}/projects`)}async conversations(e){return this.get(`/product/erix/crm/leads/${e}/conversations`)}async meetings(e){return this.get(`/product/erix/crm/leads/${e}/meetings`)}async flowRuns(e){return this.get(`/product/erix/crm/leads/${e}/flow-runs`)}async merge(e,t){return this.post("/product/erix/crm/leads/merge",{primaryId:e,secondaryId:t})}async duplicates(e){return this.get(`/product/erix/crm/leads/${encodeURIComponent(e)}/duplicates`)}};var Ze=class extends s{async capture(e){return this.post("/product/erix/crm/payments/capture",e)}};var et=class extends s{async list(){return this.get("/product/erix/crm/pipelines")}async getStageManifest(e){var o,a;let t=await this.retrieve(e),r=Array.isArray((o=t.data)==null?void 0:o.stages)?t.data.stages:[];return{name:`Pipeline: ${((a=t.data)==null?void 0:a.name)||e}`,fields:r.map(u=>({key:u._id,label:u.name,type:"string",required:!0,options:[{label:u.name,value:u._id}],group:"Stages",uiHints:{color:u.color||"#cbd5e1",probability:u.probability}})),uiHints:{icon:"Columns",primaryColor:"#6366f1"}}}async create(e){return this.post("/product/erix/crm/pipelines",e)}async retrieve(e){return this.get(`/product/erix/crm/pipelines/${e}`)}async update(e,t){return this.patch(`/product/erix/crm/pipelines/${e}`,t)}async setDefault(e){return this.patch(`/product/erix/crm/pipelines/${e}/default`,{})}async duplicate(e,t){return this.post(`/product/erix/crm/pipelines/${e}/duplicate`,{name:t})}async archive(e){return this.patch(`/product/erix/crm/pipelines/${e}/archive`,{})}async delete(e){return this.deleteRequest(`/product/erix/crm/pipelines/${e}`)}async checkInUse(e){return this.get(`/product/erix/crm/pipelines/${e}/in-use`)}async board(e){return this.get(`/product/erix/crm/pipelines/${e}/board`)}async forecast(e){return this.get(`/product/erix/crm/pipelines/${e}/forecast`)}async addStage(e,t){return this.post(`/product/erix/crm/pipelines/${e}/stages`,t)}async reorderStages(e,t){return this.patch(`/product/erix/crm/pipelines/${e}/stages/reorder`,{order:t})}async updateStage(e,t){return this.patch(`/product/erix/crm/stages/${e}`,t)}async deleteStage(e,t){return this.deleteRequest(`/product/erix/crm/stages/${e}`,{data:t?{moveLeadsToStageId:t}:void 0})}};var tt=class extends s{async getConfig(){return this.get("/product/erix/crm/scoring")}async updateConfig(e){return this.patch("/product/erix/crm/scoring",e)}async recalculate(e){return this.post(`/product/erix/crm/scoring/${e}/recalculate`,{})}async preview(e){return this.get(`/product/erix/crm/scoring/preview/${e}`)}};var nt=class extends s{async sendTest(e){return this.post("/infra/connect/email/test",{to:e})}async listTemplates(e){return this.get("/infra/connect/email/templates",{params:e})}async getTemplate(e){return this.get(`/infra/connect/email/templates/${e}`)}async createTemplate(e){return this.post("/infra/connect/email/templates",e)}async updateTemplate(e,t){return this.put(`/infra/connect/email/templates/${e}`,t)}async deleteTemplate(e,t=!1){return this.deleteRequest(`/infra/connect/email/templates/${e}`,{params:{force:t}})}async previewTemplate(e,t){return this.post(`/infra/connect/email/templates/${e}/preview`,t)}};var rt=class extends s{async trigger(e){return this.post("/product/erix/events/trigger",e)}async listCustomEvents(){return this.get("/product/flow/config/triggers")}async createCustomEvent(e){return this.post("/product/flow/config/triggers",e)}async deleteCustomEvent(e){return this.deleteRequest(`/product/flow/config/triggers/${e}`)}};var st=class extends s{async list(){return this.get("/infra/connect/facebook/lead-forms")}async subscribe(){return this.post("/infra/connect/facebook/lead-forms/subscribe",{})}async setEnabled(e,t){return this.put(`/infra/connect/facebook/lead-forms/${encodeURIComponent(e)}`,{enabled:t})}async importLast24Hours(e){return this.post(`/infra/connect/facebook/lead-forms/${encodeURIComponent(e)}/import-last-24h`,{})}};var _=class extends s{path(e,t=""){return`/product/flow/workflows/${encodeURIComponent(e)}${t}`}async versions(e){return this.get(this.path(e,"/versions"))}async version(e,t){return this.get(this.path(e,`/versions/${encodeURIComponent(t)}`))}async restoreVersion(e,t){return this.post(this.path(e,`/versions/${encodeURIComponent(t)}/restore`))}async testData(e){return this.get(this.path(e,"/test-data"))}async pinTestData(e,t){return this.put(this.path(e,"/test-data"),{runId:t})}async unpinTestData(e){return this.deleteRequest(this.path(e,"/test-data"))}async testRun(e,t={}){return this.post(this.path(e,"/test-run"),t)}async testRunProgress(e,t){return this.get(this.path(e,"/test-run"),{params:{runIds:t.join(",")}})}async copilot(e,t){return this.post(this.path(e,"/copilot"),t)}async live(e){return this.get(this.path(e,"/live"))}async week(e){return this.get(this.path(e,"/week"))}async deleteImpact(e){return this.get(this.path(e,"/delete-impact"))}async remove(e,t={}){return this.deleteRequest(this.path(e,t.stop?"?stop=true":""))}async duplicate(e){return this.post(this.path(e,"/duplicate"))}async retryFailed(e,t={}){return this.post(this.path(e,"/retry-failed"),t)}};var P=class extends s{async list(e={}){return this.get("/product/flow/campaigns",{params:e})}async create(e){return this.post("/product/flow/campaigns",e)}async launch(e,t={}){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/launch`,t)}async retrieve(e){return this.get(`/product/flow/campaigns/${encodeURIComponent(e)}`)}async update(e,t){return this.patch(`/product/flow/campaigns/${encodeURIComponent(e)}`,t)}async test(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/test`,{})}async start(e,t={}){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/start`,t)}async pause(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/pause`,{})}async resume(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/resume`,{})}async stop(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/stop`,{})}async remove(e){return this.deleteRequest(`/product/flow/campaigns/${encodeURIComponent(e)}`)}async duplicate(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/duplicate`,{})}async followUp(e,t={}){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/follow-up`,t)}async checks(e){return this.get(`/product/flow/campaigns/${encodeURIComponent(e)}/checks`)}async results(e){return this.get(`/product/flow/campaigns/${encodeURIComponent(e)}/results`)}async people(e,t={}){return this.get(`/product/flow/campaigns/${encodeURIComponent(e)}/people`,{params:t})}};var N="/product/flow/conversations",f=(n,e="")=>`${N}/${encodeURIComponent(n)}${e}`,B=class extends s{async list(e={}){return this.get(N,{params:e})}async create(e){return this.post(N,e)}async retrieve(e){return this.get(f(e))}async update(e,t){return this.patch(f(e),t)}async duplicate(e){return this.post(f(e,"/duplicate"),{})}async archive(e){return this.deleteRequest(f(e))}async publish(e,t={}){return this.post(f(e,"/publish"),t)}async versions(e){return this.get(f(e,"/versions"))}async version(e,t){return this.get(f(e,`/versions/${t}`))}async rollback(e,t){return this.post(f(e,"/rollback"),{version:t})}async try(e,t){return this.post(f(e,"/try"),t)}async tests(e){return this.get(f(e,"/tests"))}async addTest(e,t){return this.post(f(e,"/tests"),t)}async deleteTest(e,t){return this.deleteRequest(f(e,`/tests/${encodeURIComponent(t)}`))}async runTests(e,t={}){return this.post(f(e,"/tests/run"),t)}async deployments(e){return this.get(f(e,"/deployments"))}async allDeployments(){return this.get(`${N}/deployments`)}async deploy(e,t){return this.post(f(e,"/deployments"),t)}async updateDeployment(e,t){return this.patch(`${N}/deployments/${encodeURIComponent(e)}`,t)}async removeDeployment(e){return this.deleteRequest(`${N}/deployments/${encodeURIComponent(e)}`)}async checks(e){return this.get(f(e,"/checks"))}async moveToAgent(e){return this.post(f(e,"/move-to-agent"),{})}};var q=class extends s{async get(){return super.get("/product/flow/home")}async nav(){return super.get("/product/flow/home/nav")}},K=class extends s{async create(e){return this.post("/product/flow/drafts",e)}async plan(e){return this.post("/product/flow/drafts/plan",e)}},W=class extends s{async status(){return this.get("/product/flow/first-run")}async installPack(e){return this.post(`/product/flow/first-run/packs/${e}`)}},j=class extends s{async list(){return this.get("/product/flow/audiences")}async byId(e){return this.get(`/product/flow/audiences/${encodeURIComponent(e)}`)}async create(e){return this.post("/product/flow/audiences",e)}async update(e,t){return this.patch(`/product/flow/audiences/${encodeURIComponent(e)}`,t)}async remove(e){return this.deleteRequest(`/product/flow/audiences/${encodeURIComponent(e)}`)}async preview(e,t){return this.get(`/product/flow/audiences/${encodeURIComponent(e)}/preview${t?`?channel=${t}`:""}`)}async previewRules(e){return this.post("/product/flow/audiences/preview",e)}};var it=class extends s{async system(){return(await this.get("/health")).data}};var ot=class extends s{async list(e){return this.get("/product/erix/commerce/invoices",{params:e})}async getInvoice(e){return this.get(`/product/erix/commerce/invoices/${e}`)}async create(e){return this.post("/product/erix/commerce/invoices",e)}async update(e,t){return this.patch(`/product/erix/commerce/invoices/${e}`,t)}async void(e){return this.post(`/product/erix/commerce/invoices/${e}/void`,{})}async sendViaWhatsApp(e){return this.post(`/product/erix/commerce/invoices/${e}/send-whatsapp`,{})}async getSettings(){return this.get("/product/erix/commerce/settings")}async updateSettings(e){return this.put("/product/erix/commerce/settings",e)}async paymentLink(e){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/payment-link`,{})}async recordPayment(e,t){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/payments`,t)}async sendWhatsApp(e){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/send-whatsapp`,{})}async sendEmail(e){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/send-email`,{})}};var an=n=>"queued"in n&&n.queued===!0,cn={runProgress:"laie:run:progress",importComplete:"laie:import:complete"},m=encodeURIComponent,l="/product/laie",G=class extends s{async list(){return this.get(`${l}/packs`)}async byId(e){return this.get(`${l}/packs/${m(e)}`)}},H=class extends s{async catalog(e={}){return this.get(`${l}/signals/catalog`,{params:e})}async list(e={}){return this.get(`${l}/signals`,{params:e})}},Q=class extends s{async find(e){return this.post(`${l}/tools/find`,e)}async collect(e){return this.post(`${l}/tools/collect`,e)}async enrich(e){return this.post(`${l}/tools/enrich`,e)}async verify(e){return this.post(`${l}/tools/verify`,e)}async qualify(e){return this.post(`${l}/tools/qualify`,e)}async store(e){return this.post(`${l}/tools/store`,e)}async use(e){return this.post(`${l}/tools/use`,e)}async verifyEmail(e){return this.post(`${l}/tools/verify-email`,{emails:e})}async websiteLookup(e){return this.post(`${l}/tools/website-lookup`,{url:e})}},z=class extends s{async list(){return this.get(`${l}/campaigns`)}async create(e){return this.post(`${l}/campaigns`,e)}async byId(e){return this.get(`${l}/flows/${m(e)}`)}async settings(e){return this.get(`${l}/campaigns/${m(e)}/settings`)}async updateSettings(e,t){return this.patch(`${l}/campaigns/${m(e)}/settings`,t)}async signals(e){return this.get(`${l}/campaigns/${m(e)}/signals`)}async setSignals(e,t){return this.put(`${l}/campaigns/${m(e)}/signals`,t)}},Y=class extends s{async start(e){return this.post(`${l}/campaigns/${m(e)}/runs`)}async list(e,t={}){return this.get(`${l}/campaigns/${m(e)}/runs`,{params:t})}async byId(e,t){return this.get(`${l}/campaigns/${m(e)}/runs/${m(t)}`)}async changes(e,t,r={}){return this.get(`${l}/campaigns/${m(e)}/runs/${m(t)}/changes`,{params:r})}async cancel(e,t){return this.post(`${l}/campaigns/${m(e)}/runs/${m(t)}/cancel`)}async quality(e){return this.get(`${l}/jobs/${m(e)}/quality`)}},J=class extends s{async list(e={}){let o=e,{importedToCrm:t}=o,r=R(o,["importedToCrm"]);return this.get(`${l}/leads`,{params:p(p({},r),t!==void 0&&{importedToCrm:String(t)})})}async byId(e){return this.get(`${l}/leads/${m(e)}`)}async update(e,t){return this.patch(`${l}/leads/${m(e)}`,t)}async notes(e){return this.get(`${l}/leads/${m(e)}/notes`)}async addNote(e,t){return this.post(`${l}/leads/${m(e)}/notes`,t)}async generateKit(e){return this.post(`${l}/leads/${m(e)}/generate-kit`)}async pipelineSummary(){return this.get(`${l}/leads/pipeline-summary`)}async bulkContacted(e,t){return this.post(`${l}/leads/bulk/contacted`,{leadIds:e,channel:t})}async bulkTag(e,t){return this.post(`${l}/leads/bulk/tag`,{leadIds:e,tags:t})}async bulkDelete(e){return this.post(`${l}/leads/bulk/delete`,{leadIds:e})}async bulkExport(e,t="json"){return t==="csv"?this.post(`${l}/leads/bulk/export`,{leadIds:e,format:t},{responseType:"text"}):this.post(`${l}/leads/bulk/export`,{leadIds:e,format:t})}},X=class extends s{async pipelines(){return this.get(`${l}/import/pipelines`)}async crm(e){return this.post(`${l}/import/crm`,e)}},Z=class extends s{async enrich(e){return this.post(`${l}/lists/enrich`,e)}},ee=class extends s{async dsr(e){return this.post(`${l}/compliance/dsr`,e)}async report(e={}){return this.get(`${l}/compliance/report`,{params:e})}},te=class extends s{async map(e={}){return this.get(`${l}/market-map`,{params:e})}async forCampaign(e){return this.get(`${l}/campaigns/${m(e)}/market-map`)}async refresh(e={}){return this.post(`${l}/market-map/refresh`,e)}},ne=class extends s{async weights(e={}){return this.get(`${l}/learning/weights`,{params:e})}async outcomes(e={}){return this.get(`${l}/learning/outcomes`,{params:e})}},re=class extends s{async preview(e){return this.post(`${l}/lookalikes/preview`,e)}async create(e){return this.post(`${l}/lookalikes`,e)}async list(e={}){return this.get(`${l}/lookalikes`,{params:e})}async byId(e){return this.get(`${l}/lookalikes/${m(e)}`)}async rank(e,t={}){return this.get(`${l}/lookalikes/${m(e)}/rank`,{params:t})}},se=class extends s{async status(){return this.get(`${l}/freshness`)}},ie=class extends s{async start(e){return this.post(`${l}/audit`,e)}async byId(e){return this.get(`${l}/audit/${m(e)}`)}};var ln=Le(require("axios"),1);var at=class extends s{async getUsage(){return this.get("/infra/storage/files/usage")}async createFolder(e){return this.post("/infra/storage/files/folders",{name:e})}async list(e,t){return this.get(`/infra/storage/files/files/${e}`,{params:t})}async delete(e){return this.deleteRequest("/infra/storage/files/files",{params:{key:e}})}async getDownloadUrl(e){return this.post("/infra/storage/files/download-url",{key:e})}async aiDescribe(e){return this.post("/infra/storage/files/ai/describe",{key:e})}async upload(e,t){let r=await this.post("/infra/storage/files/upload-url",t),{uploadUrl:o,key:a,headers:u}=r.data;await ln.default.put(o,e,{headers:u!=null?u:{"Content-Type":t.contentType}});let d=e.size||e.byteLength||0;return this.post("/infra/storage/files/confirm-upload",{key:a,sizeBytes:d})}};var ct=class extends s{async create(e){return this.post("/infra/connect/meet",e)}async list(e){return this.get("/infra/connect/meet",{params:e})}async retrieve(e){return this.get(`/infra/connect/meet/${e}`)}async update(e,t){return this.patch(`/infra/connect/meet/${e}`,t)}async reschedule(e,t){return this.patch(`/infra/connect/meet/${e}`,t)}async delete(e){return this.update(e,{status:"cancelled"})}};var lt=class extends s{async workflowPacks(){return this.get("/product/erix/crm/niche/workflow-packs")}async workflowPackDetail(e){return this.get(`/product/erix/crm/niche/workflow-packs/${e}`)}async installWorkflowPack(e){return this.post(`/product/erix/crm/niche/workflow-packs/${e}/install`)}async templateSuggestions(){return this.get("/product/erix/crm/niche/template-suggestions")}};var ut=class extends s{async listAlerts(e){return this.get("/platform/users/notifications",{params:e})}async dismissAlert(e){return this.patch(`/platform/users/notifications/${e}/dismiss`)}async clearAllAlerts(){return this.deleteRequest("/platform/users/notifications/dismiss-all")}};var oe=class extends s{async global(e){return this.post("/platform/tenants/onboarding/global",e)}async complete(e){return this.post("/platform/tenants/onboarding/complete",e)}};var ae=class extends s{async get(e){return super.get(`/platform/tenants/persona/${e}`)}async reinforce(e){return this.post(`/platform/tenants/persona/${e.productId}/reinforce`,e)}async confidence(e){return super.get(`/platform/tenants/persona/${e}/confidence`,{params:{productId:e}})}async timeline(e,t){var o;let r=await super.get(`/platform/tenants/persona/${e}/timeline`,{params:t});return(o=r==null?void 0:r.data)!=null?o:{entries:[],hasMore:!1}}async followups(e){var r,o;let t=await super.get(`/platform/tenants/persona/${e}/followups`);return(o=(r=t==null?void 0:t.data)==null?void 0:r.entries)!=null?o:[]}};var Dt=class extends s{async chatSync(e){return this.post("/platform/ai/copilot/chat/sync",e)}async confirm(e){return this.post("/platform/ai/copilot/confirm",e)}async listSessions(){return this.get("/platform/ai/copilot/sessions")}async getSession(e){return this.get(`/platform/ai/copilot/sessions/${e}`)}async deleteSession(e){return this.deleteRequest(`/platform/ai/copilot/sessions/${e}`)}chatStreamUrl(){return"/platform/ai/copilot/chat"}},pt=class{constructor(e){i(this,"copilot");this.copilot=new Dt(e)}};var gt=class extends s{async list(e){return this.get("/platform/tenants/audit",{params:e})}};var dt=class extends s{async register(e){return this.post("/platform/auth/register",e)}async login(e){return this.post("/platform/auth/login",e)}async logout(e){return this.post("/platform/auth/logout",e)}async logoutAll(e){return this.post("/platform/auth/logout-all",e)}async validateSession(e){return this.post("/platform/auth/session/validate",e)}async listSessions(){return this.get("/platform/auth/sessions")}async revokeSession(e){return this.deleteRequest(`/platform/auth/sessions/${e}`)}async requestPasswordOtp(e){return this.post("/platform/auth/password/request-otp",e)}async setPassword(e){return this.post("/platform/auth/password/set",e)}async changePassword(e){return this.post("/platform/auth/password/change",e)}async forgotPassword(e){return this.post("/platform/auth/forgot",e)}async resetPassword(e){return this.post("/platform/auth/reset",e)}async linkOAuth(e){return this.post("/platform/auth/oauth-link",e)}async getInvitation(e){return this.get(`/platform/auth/invitations/${e}`)}async acceptInvitation(e,t){return this.post(`/platform/auth/invitations/${e}/accept`,t)}};var Ft=class extends s{async get(){return super.get("/platform/billing/entitlements/entitlements")}async usage(){return super.get("/platform/billing/entitlements/usage")}},Ut=class extends s{async upgrade(e){return this.post("/platform/billing/subscriptions/subscriptions/upgrade",e)}async downgrade(e){return this.post("/platform/billing/subscriptions/subscriptions/downgrade",e)}async cancel(e){return this.post("/platform/billing/subscriptions/subscriptions/cancel",e)}},Mt=class extends s{list(){return this.get("/platform/billing/addons")}add(e,t){return this.post(`/platform/billing/addons/${encodeURIComponent(e)}/add`,t===void 0?{}:{quantity:t})}remove(e){return this.post(`/platform/billing/addons/${encodeURIComponent(e)}/remove`)}overage(){return this.get("/platform/billing/overage")}setOverage(e){return this.put("/platform/billing/overage",e)}},_t=class extends s{async listPublic(){return this.get("/platform/billing/plans/public")}},Nt=class extends s{async plans(){return this.get("/platform/billing/checkout/plans")}async proration(e,t){return this.get("/platform/billing/checkout/proration",{params:{planId:e,billingCycle:t}})}async subscribe(e){return this.post("/platform/billing/checkout/subscribe",e)}async verify(e){return this.post("/platform/billing/checkout/verify",e)}async cancel(e){return this.post("/platform/billing/checkout/cancel",e)}async status(){return this.get("/platform/billing/checkout/status")}async syncPlan(e){return this.post("/platform/billing/checkout/sync-plan",e)}},Bt=class extends s{async transactions(){return this.get("/platform/billing/user/transactions")}async transactionInvoice(e){return this.get(`/platform/billing/user/transactions/${encodeURIComponent(e)}/invoice`)}async subscription(){return this.get("/platform/billing/user/subscription")}async raiseDispute(e){return this.post("/platform/billing/user/dispute",e)}async disputes(){return this.get("/platform/billing/user/disputes")}},qt=class extends s{async balance(){return this.get("/platform/billing/credits/balance")}async transactions(){return this.get("/platform/billing/credits/transactions")}async packs(){return this.get("/platform/billing/credits/packs")}async topupOrder(e){return this.post("/platform/billing/credits/topup/order",e)}async verifyTopup(e){return this.post("/platform/billing/credits/topup/verify",e)}async setAutoTopup(e){return this.patch("/platform/billing/credits/auto-topup",e)}async setSpendCap(e){return this.patch("/platform/billing/credits/spend-cap",e)}},mt=class{constructor(e){i(this,"entitlements");i(this,"subscriptions");i(this,"plans");i(this,"checkout");i(this,"user");i(this,"credits");i(this,"addOns");this.entitlements=new Ft(e),this.subscriptions=new Ut(e),this.plans=new _t(e),this.checkout=new Nt(e),this.user=new Bt(e),this.credits=new qt(e),this.addOns=new Mt(e)}};var ce=class extends s{async list(){return this.get("/platform/public/catalog",{ignoreClientCode:!0})}};var le=class extends s{async send(e){if(e.conversationId)return this.post(`/platform/inbox/conversations/${e.conversationId}/messages`,{text:e.text,media:e.media});if(!e.to)throw new Error("send: conversationId or to is required");if(e.media)throw new Error("send: media goes to an inbox thread (conversationId)");return this.post("/infra/connect/send/whatsapp",p({phone:e.to,text:e.text},e.accountId?{accountId:e.accountId}:{}))}async sendTemplate(e){return this.post("/infra/connect/send/whatsapp",p({phone:e.to,templateName:e.templateName,language:e.language,variables:e.variables},e.accountId?{accountId:e.accountId}:{}))}async star(e,t){return this.post(`/platform/inbox/messages/${e}/star`,{starred:t})}async translate(e){return this.post(`/platform/inbox/messages/${encodeURIComponent(e)}/translate`,{})}async markRead(e){return this.post(`/platform/inbox/conversations/${e}/read`,{})}async upload(e,t={}){var b,T,S;let r=(T=(b=t.fileName)!=null?b:e.name)!=null?T:"file",o=e.type||"application/octet-stream",a=await this.post("/infra/storage/files/upload-url",{folder:(S=t.folder)!=null?S:"inbox",filename:r,contentType:o}),{uploadUrl:u,key:d,headers:g}=a.data,k=await fetch(u,{method:"PUT",headers:g!=null?g:{"Content-Type":o},body:e});if(!k.ok)throw new Error(`upload failed (${k.status})`);return await this.post("/infra/storage/files/confirm-upload",{key:d,sizeBytes:e.size}),{key:d,mimeType:o,fileName:r}}};var un=["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/plain","text/markdown","text/csv","text/html","image/png","image/jpeg","image/webp"],ue=class extends s{async list(){return this.get("/platform/knowledge/sources")}async addText(e){return this.post("/platform/knowledge/sources",p({kind:"text"},e))}async addUrl(e){return this.post("/platform/knowledge/sources",p({kind:"url"},e))}async addWebsite(e){return this.post("/platform/knowledge/sources",{type:"website",url:e.url})}async addFile(e,t={}){var o,a;let r=await new le(this.client).upload(e,{folder:"knowledge"});return this.post("/platform/knowledge/sources",{kind:"file",key:r.key,mimeType:r.mimeType,title:(a=(o=t.title)!=null?o:r.fileName)!=null?a:"Document"})}async remove(e){return this.deleteRequest(`/platform/knowledge/sources/${e}`)}async reindex(e){return this.post(`/platform/knowledge/sources/${e}/reindex`,{})}async search(e,t){return this.post("/platform/knowledge/search",p({query:e},t?{limit:t}:{}))}};var yt=class extends s{async categories(){return this.get("/platform/support/categories")}async listTickets(e){return this.get("/platform/support/tickets",{params:e})}async createTicket(e){return this.post("/platform/support/tickets",e)}async getTicket(e){return this.get(`/platform/support/tickets/${e}`)}async reply(e,t){return this.post(`/platform/support/tickets/${e}/reply`,t)}async close(e){return this.patch(`/platform/support/tickets/${e}/close`,{})}async channelSetup(e){return this.get(`/platform/support/channel-requests/${encodeURIComponent(e)}/setup`)}};var ft=class extends s{async get(){return super.get("/platform/users/me")}async update(e){return this.patch("/platform/users/me",e)}async updateOrganization(e){return this.patch("/platform/users/me/organization",e)}async toggleModules(e){return this.post("/platform/users/me/modules",e)}async workspaces(){return super.get("/platform/users/me/workspaces")}async setActiveOrg(e){return this.post("/platform/users/me/active-org",e)}async dismissWorkspaceSetup(){return this.post("/platform/users/me/workspace/dismiss-setup",{})}},bt=class extends s{async list(){return this.get("/platform/users/members")}async access(){return this.get("/platform/users/members/access")}async invite(e){return this.post("/platform/users/members/invite",e)}async updateAccess(e,t){return this.patch(`/platform/users/members/${encodeURIComponent(e)}`,t)}async updateRole(e,t){return this.updateAccess(e,{role:t})}async remove(e){return this.deleteRequest(`/platform/users/members/${encodeURIComponent(e)}`)}async invitations(){return this.get("/platform/users/members/invitations")}async resendInvitation(e){return this.post(`/platform/users/members/invitations/${encodeURIComponent(e)}/resend`,{})}async revokeInvitation(e){return this.deleteRequest(`/platform/users/members/invitations/${encodeURIComponent(e)}`)}},ht=class extends s{async list(){return this.get("/platform/auth/sessions")}async revoke(e){return this.deleteRequest(`/platform/auth/sessions/${e}`)}};var xt=class extends s{async list(e){return this.get(`/product/erix/commerce/projects/${e}/documents`)}async upload(e,t){return this.post(`/product/erix/commerce/projects/${e}/documents`,t)}async toggleSignature(e,t,r){return this.patch(`/product/erix/commerce/projects/${e}/documents/${t}/signature`,{required:r})}async addSigner(e,t,r){return this.post(`/product/erix/commerce/projects/${e}/documents/${t}/signers`,r)}async decline(e,t){return this.post(`/product/erix/commerce/projects/${e}/documents/${t}/decline`,{})}async stampSign(e,t,r){return this.post(`/product/erix/commerce/projects/${e}/documents/${t}/stamp-sign`,r)}};var pe=class extends s{async list(){return this.get("/product/seo/projects")}async create(e){return this.post("/product/seo/projects",e)}async byId(e){return this.get(`/product/seo/projects/${e}`)}async update(e,t){return this.patch(`/product/seo/projects/${e}`,t)}async remove(e){return this.deleteRequest(`/product/seo/projects/${e}`)}async crawl(e){return this.post(`/product/seo/projects/${e}/crawl`)}async crawlCompetitor(e,t){return this.post(`/product/seo/projects/${e}/competitors/crawl`,{domain:t})}},ge=class extends s{async start(e){return this.post("/product/seo/audits",e)}async list(e={}){return this.get("/product/seo/audits",{params:e})}async compare(e){return this.post("/product/seo/audits/compare",e)}async byId(e){return this.get(`/product/seo/audits/${e}`)}async resume(e){return this.post(`/product/seo/audits/${e}/resume`)}async pages(e,t={}){return this.get(`/product/seo/audits/${e}/pages`,{params:t})}async issues(e){return this.get(`/product/seo/audits/${e}/issues`)}async links(e){return this.get(`/product/seo/audits/${e}/links`)}async export(e,t="json"){return this.get(`/product/seo/audits/${e}/export`,{params:{format:t},responseType:"text"})}},de=class extends s{async keywords(e,t={}){return this.get(`/product/seo/audits/${e}/keywords`,{params:t})}async contentGap(e){return this.post("/product/seo/audits/content-gap",e)}async search(e){return this.post("/product/seo/audits/search",e)}async backlinks(e){return this.get("/product/seo/audits/backlinks",{params:e})}async domain(e){return this.get(`/product/seo/audits/domains/${encodeURIComponent(e)}`)}},me=class extends s{async check(e){return this.post(`/product/seo/search-console/${e}/check`)}async importNow(e){return this.post(`/product/seo/search-console/${e}/import`)}async status(e){return this.get(`/product/seo/search-console/${e}/status`)}async queries(e,t={}){return this.get(`/product/seo/search-console/${e}/queries`,{params:t})}async pages(e,t={}){return this.get(`/product/seo/search-console/${e}/pages`,{params:t})}async trend(e,t={}){return this.get(`/product/seo/search-console/${e}/trend`,{params:t})}},ye=class extends s{async keywords(e){return this.get(`/product/seo/ranks/${e}/keywords`)}async add(e,t,r={}){return this.post(`/product/seo/ranks/${e}/keywords`,p({queries:t},r))}async visibility(e,t={}){return this.get(`/product/seo/ranks/${e}/visibility`,{params:t})}async competitors(e){return this.get(`/product/seo/ranks/${e}/competitors`)}async gap(e,t={}){return this.get(`/product/seo/ranks/${e}/gap`,{params:t})}async remove(e,t){return this.deleteRequest(`/product/seo/ranks/${e}/keywords/${t}`)}async checkNow(e,t){return this.post(`/product/seo/ranks/${e}/keywords/${t}/check`)}async history(e,t,r={}){return this.get(`/product/seo/ranks/${e}/keywords/${t}/history`,{params:r})}async changes(e){return this.get(`/product/seo/ranks/${e}/changes`)}},fe=class extends s{async checkNow(e){return this.post(`/product/seo/local/${e}/check`)}async latest(e){return this.get(`/product/seo/local/${e}`)}async history(e,t={}){return this.get(`/product/seo/local/${e}/history`,{params:t})}async startGrid(e,t={}){return this.post(`/product/seo/local/${e}/grid`,t)}async grid(e){return this.get(`/product/seo/local/${e}/grid`)}async grids(e,t={}){return this.get(`/product/seo/local/${e}/grids`,{params:t})}},be=class extends s{async byProject(e){return this.get(`/product/seo/reports/${e}`)}async export(e,t="csv"){return this.get(`/product/seo/reports/${e}/export`,{params:{format:t},responseType:"text"})}async pdf(e,t={}){return this.get(`/product/seo/reports/${e}/pdf`,{params:t,responseType:"arraybuffer"})}async generate(e,t={}){return this.post(`/product/seo/reports/${e}/generate`,t)}async history(e,t={}){return this.get(`/product/seo/reports/${e}/history`,{params:t})}async changes(e){return this.get(`/product/seo/reports/${e}/changes`)}},he=class extends s{async seed(e,t,r="en"){return this.post(`/product/seo/research/${e}/seed`,{seed:t,lang:r})}async fromSearchConsole(e){return this.post(`/product/seo/research/${e}/from-search-console`)}async ideas(e,t={}){return this.get(`/product/seo/research/${e}/ideas`,{params:t})}async analyze(e,t){return this.post(`/product/seo/research/${e}/ideas/${t}/analyze`)}};var xe=class extends s{async releases(){return this.get("/product/seo/backlinks/releases")}async strength(e){return this.get("/product/seo/backlinks/strength",{params:{domains:e.join(",")}})}async overview(e){return this.get(`/product/seo/backlinks/${e}`)}async referring(e,t){return this.get(`/product/seo/backlinks/${e}/referring`,{params:t})}async changes(e,t){return this.get(`/product/seo/backlinks/${e}/changes`,{params:t})}},ke=class extends s{async checkNow(e){return this.post(`/product/seo/performance/${e}/check`)}async latest(e){return this.get(`/product/seo/performance/${e}`)}async history(e,t={}){return this.get(`/product/seo/performance/${e}/history`,{params:t})}},Ce=class extends s{async create(e){return this.post("/product/seo/briefs",e)}async byId(e){return this.get(`/product/seo/briefs/${e}`)}async list(e,t={}){return this.get("/product/seo/briefs",{params:p({projectId:e},t)})}};var Sn=35e3,we=class extends s{async claim(e,t){var o;let r=await this.post("/infra/serp/collector/claim",{collectorId:e,kinds:t},{timeout:Sn});return(o=r&&typeof r=="object"?r.data:null)!=null?o:null}async result(e){return this.post("/infra/serp/collector/result",e)}async heartbeat(e,t){return this.post("/infra/serp/collector/heartbeat",p({collectorId:e},t))}};var kt=class extends s{async getConfig(){return this.get("/infra/connect/email/config")}async initDomainVerification(e){return this.post("/infra/connect/email/config/ses/domain",{domain:e})}async saveEmailConfig(e){return this.post("/infra/connect/email/config/ses/config",e)}async checkSesVerification(){return this.get("/infra/connect/email/config/ses/verify")}async removeSesIdentity(){return this.deleteRequest("/infra/connect/email/config/ses/domain")}async sendTest(e){return this.post("/infra/connect/email/config/test",{toEmail:e})}async saveAdvancedConfig(e){return this.post("/infra/connect/email/config/advanced",e)}async getHealth(){return this.get("/infra/connect/email/config/health")}async fixDmarc(){return this.post("/infra/connect/email/config/ses/fix-dmarc",{})}async listProviders(){return this.get("/infra/connect/email/config/providers")}};var Ct=class extends s{async create(e){return this.post("/infra/storage/files/folders",{name:e})}},wt=class extends s{async list(e,t){return this.get(`/infra/storage/files/files/${e}`,{params:t})}async getUploadUrl(e){return this.post("/infra/storage/files/upload-url",e)}async confirmUpload(e){return this.post("/infra/storage/files/confirm-upload",e)}async getDownloadUrl(e){return this.post("/infra/storage/files/download-url",{key:e})}async delete(e){return this.deleteRequest("/infra/storage/files/files",{params:{key:e}})}},vt=class extends s{async list(e={}){return this.get("/infra/storage/library",{params:e})}async folders(){return this.get("/infra/storage/library/folders")}async remove(e){return this.deleteRequest(`/infra/storage/library/${encodeURIComponent(e)}`)}};var pn={callChanged:"voice_call_changed"},An=["NOT_FOUND","VOICE_CALL_REFUSED","VOICE_NOT_SET_UP","VOICE_CAMPAIGN_NOT_APPROVED","VOICE_NOT_ENABLED","VOICE_AGENT_UNAVAILABLE","VOICE_RUNTIME_UNAVAILABLE","VOICE_PREVIEW_FAILED","VOICE_NOT_CONFIGURED","LEAD_NOT_FOUND","INSUFFICIENT_CREDITS"];function gn(n){let e=n instanceof y?n.code:void 0;return e&&An.includes(e)?e:void 0}var Kt={gate:"Voice calling isn't switched on for this workspace.",bad_number:"That phone number isn't a number we can call.",do_not_call:"They asked not to be called again.",dnd:"Their number is on the Do Not Disturb register.",hours:"No calling hours are open for this step.",recently_called:"They were called recently.",promotional:"Promotional calls aren't offered. Calls are for service, reminders, callbacks and demo follow-ups.",no_consent:"No record that they agreed to a phone call, or asked for one. They are not called.",campaign_stopped:"This campaign was stopped.",test_limit:"You can ring your own phone 3 times a day. Try again tomorrow.",not_on_plan:"Voice isn't on your plan. Upgrade your plan to use voice calls.",minutes_used_up:"You've used this month's included voice minutes. Your plan has no extra minutes.",low_balance:"Your balance is below \u20B910. Add credits to place voice calls."};function dn(n){var e;return(e=Kt[n])!=null?e:n}var ve=encodeURIComponent,Ee=class extends s{get flow(){return new P(this.client)}list(e={}){return this.flow.list(e)}retrieve(e){return this.flow.retrieve(e)}create(e){return this.flow.create(e)}launch(e,t={}){return this.flow.launch(e,t)}start(e,t={}){return this.flow.start(e,t)}pause(e){return this.flow.pause(e)}resume(e){return this.flow.resume(e)}stop(e){return this.flow.stop(e)}costPreview(e){return this.get(`/product/flow/campaigns/${ve(e)}/voice-preview`)}counters(e){return this.get(`/infra/connect/voice/campaigns/${ve(e)}/counters`)}approval(e){return this.get(`/infra/connect/voice/campaigns/${ve(e)}/approval`)}requestApproval(e){return this.post(`/infra/connect/voice/campaigns/${ve(e)}/approval/request`,{})}},Te=class extends s{constructor(t){super(t);i(this,"campaigns");this.campaigns=new Ee(t)}status(){return this.get("/infra/connect/voice/status")}setup(){return this.get("/infra/connect/voice/setup")}connect(){return this.post("/infra/connect/voice/setup/connect",{})}setupNumbers(t={}){return this.get("/infra/connect/voice/setup/numbers",{params:p(p(p({},t.city?{city:t.city}:{}),t.pattern?{pattern:t.pattern}:{}),t.offset?{offset:String(t.offset)}:{})})}kycRequirements(){return this.get("/infra/connect/voice/setup/kyc/requirements")}kycUploadUrl(t){return this.post("/infra/connect/voice/setup/kyc/upload-url",t)}submitKyc(t){return this.post("/infra/connect/voice/setup/kyc",t)}pickNumber(t){return this.post("/infra/connect/voice/setup/number",{number:t})}releaseNumber(t){return this.deleteRequest(`/infra/connect/voice/setup/numbers/${ve(t)}`)}goLive(){return this.post("/infra/connect/voice/setup/go-live",{})}pause(){return this.post("/infra/connect/voice/setup/pause",{})}agent(){return this.get("/infra/connect/voice/agent")}skills(){return this.get("/infra/connect/voice/skills")}voices(t){return this.get(`/infra/connect/voice/voices?language=${encodeURIComponent(t)}`)}saveAgent(t){return this.put("/infra/connect/voice/agent",t)}agents(){return this.get("/infra/connect/voice/agents")}createAgent(t){return this.post("/infra/connect/voice/agents",t)}getAgent(t){return this.get(`/infra/connect/voice/agents/${encodeURIComponent(t)}`)}updateAgent(t,r){return this.put(`/infra/connect/voice/agents/${encodeURIComponent(t)}`,r)}setAgentLead(t,r){return this.put(`/infra/connect/voice/agents/${encodeURIComponent(t)}/lead`,{customAgentId:r})}deleteAgent(t){return this.deleteRequest(`/infra/connect/voice/agents/${encodeURIComponent(t)}`)}numbers(){return this.get("/infra/connect/voice/numbers")}updateNumber(t,r){return this.patch(`/infra/connect/voice/numbers/${encodeURIComponent(t)}`,r)}async preview(t={}){var r;try{return(await this.client.post("/infra/connect/voice/preview",t,{responseType:"arraybuffer"})).data}catch(o){let a=(r=o==null?void 0:o.response)==null?void 0:r.data;if(a instanceof ArrayBuffer||ArrayBuffer.isView(a))try{o.response.data=JSON.parse(new TextDecoder().decode(a))}catch(u){o.response.data=void 0}throw $(o)}}lines(){return this.get("/infra/connect/voice/lines")}activity(){return this.get("/infra/connect/voice/activity")}calls(t={}){return this.get("/infra/connect/voice/calls",{params:t})}call(t){return this.get(`/infra/connect/voice/calls/${ve(t)}`)}callWithAI(t){return this.post("/infra/connect/voice/calls",t)}checkCallWithAI(t){return this.post("/infra/connect/voice/calls/check",t)}callMyPhone(t={}){return this.post("/infra/connect/voice/calls/my-phone",t)}testCall(t={}){return this.post("/infra/connect/voice/test-call",t)}};var Tt=class extends s{async list(e){return this.get("/platform/inbox/conversations",{params:e})}async create(e){var t;return this.post("/platform/inbox/conversations",{address:e.phone,channel:(t=e.channel)!=null?t:"whatsapp",userName:e.name})}async linkLead(e,t){return this.patch(`/platform/inbox/conversations/${e}/lead`,{leadId:t})}async retrieve(e){return this.get(`/platform/inbox/conversations/${e}`)}async messages(e,t){return this.get(`/platform/inbox/conversations/${e}/messages`,{params:t})}async setStatus(e,t){return this.patch(`/platform/inbox/conversations/${e}/status`,{status:t})}async markRead(e){return this.post(`/platform/inbox/conversations/${e}/read`,{})}async delete(e){return this.deleteRequest(`/platform/inbox/conversations/${e}`)}async bulkDelete(e){return this.post("/platform/inbox/conversations/bulk-delete",{ids:e})}};var St=class extends s{async list(e){return this.get("/infra/connect/whatsapp/templates",{params:e})}async sync(e={}){return this.post("/infra/connect/whatsapp/templates/sync",e.accountId?{accountId:e.accountId}:{})}async retrieve(e){return this.get(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}`)}async create(e){return this.post("/infra/connect/whatsapp/templates",e)}async update(e,t){return this.put(`/infra/connect/whatsapp/templates/${e}`,t)}async fix(e){return this.post(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/fix`,{})}async resubmit(e,t){return this.post(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/resubmit`,t)}async deleteTemplate(e,t,r){let o=new URLSearchParams;t&&o.set("force","true"),r&&o.set("accountId",r);let a=o.toString();return this.deleteRequest(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}${a?`?${a}`:""}`)}async mappingConfig(){return this.get("/infra/connect/whatsapp/templates/mapping/config")}async mappingSources(){return this.get("/infra/connect/whatsapp/templates/mapping/sources")}async collections(){return this.get("/infra/connect/whatsapp/templates/collections")}async collectionFields(e){return this.get(`/infra/connect/whatsapp/templates/collections/${encodeURIComponent(e)}/fields`)}async updateMapping(e,t){return this.put(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/mapping`,t)}async validate(e,t){let r=`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/validate`;return t?this.post(r,t):this.get(r)}async preview(e,t,r,o){return this.post(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/preview`,{context:t,mappings:r,onEmptyVariable:o})}async getVariableManifest(e){var a,u;let t=await this.retrieve(e),r=Array.isArray((a=t.data)==null?void 0:a.components)?t.data.components:[],o=[];for(let d of r)if(d.text){let g=d.text.match(/{{(\d+)}}/g);if(g)for(let k of g){let b=k.replace(/{{|}}/g,"");o.push({key:`var_${b}`,label:`${d.type} Var {{${b}}}`,type:"string",required:!0,group:d.type,description:`Variable placeholder in template ${d.type}`})}}return{name:`Template variables: ${((u=t.data)==null?void 0:u.name)||e}`,fields:o,uiHints:{icon:"Variables",primaryColor:"#059669"}}}};var At=class extends s{async retrieve(e){return this.get("/infra/connect/whatsapp/setup",e?{params:{accountId:e}}:void 0)}async saveProfile(e){return this.put("/infra/connect/whatsapp/setup/profile",e)}async sendTest(e){return this.post("/infra/connect/whatsapp/setup/test",e)}async uploadPhoto(e){return this.post("/infra/connect/whatsapp/setup/profile/photo",e)}async move(e){return this.post("/infra/connect/whatsapp/setup/move",e)}async uploadMedia(e){return this.post("/infra/connect/whatsapp/setup/media",e)}};var $e=class{constructor(e){i(this,"messages");i(this,"conversations");this.messages=new le(e),this.conversations=new Tt(e)}},Oe=class{constructor(e){i(this,"leads");i(this,"pipelines");i(this,"activities");i(this,"analytics");i(this,"scoring");i(this,"payments");i(this,"chat");i(this,"events");i(this,"invoices");i(this,"checkout");i(this,"projects");i(this,"niche");i(this,"documents");i(this,"invoiceExport");i(this,"ai");this.leads=new Xe(e),this.pipelines=new et(e),this.activities=new Qe(e),this.analytics=new ze(e),this.scoring=new tt(e),this.payments=new Ze(e),this.chat=new $e(e),this.events=new rt(e),this.invoices=new ot(e),this.checkout=new Ge(e),this.projects=new xt(e),this.niche=new lt(e),this.documents=new Ye(e),this.invoiceExport=new Je(e),this.ai=new F(e)}},Ve=class{constructor(e){i(this,"automations");i(this,"campaigns");i(this,"conversations");i(this,"home");i(this,"drafts");i(this,"firstRun");i(this,"audiences");this.automations=new _(e),this.campaigns=new P(e),this.conversations=new B(e),this.home=new q(e),this.drafts=new K(e),this.firstRun=new W(e),this.audiences=new j(e)}},De=class{constructor(e){i(this,"projects");i(this,"audits");i(this,"insights");i(this,"searchConsole");i(this,"ranks");i(this,"local");i(this,"reports");i(this,"backlinks");i(this,"performance");i(this,"briefs");i(this,"research");this.projects=new pe(e),this.audits=new ge(e),this.insights=new de(e),this.searchConsole=new me(e),this.ranks=new ye(e),this.local=new fe(e),this.reports=new be(e),this.backlinks=new xe(e),this.performance=new ke(e),this.briefs=new Ce(e),this.research=new he(e)}},Fe=class{constructor(e){i(this,"packs");i(this,"signals");i(this,"tools");i(this,"campaigns");i(this,"runs");i(this,"leads");i(this,"import");i(this,"lists");i(this,"compliance");i(this,"market");i(this,"learning");i(this,"lookalikes");i(this,"freshness");i(this,"audit");this.packs=new G(e),this.signals=new H(e),this.tools=new Q(e),this.campaigns=new z(e),this.runs=new Y(e),this.leads=new J(e),this.import=new X(e),this.lists=new Z(e),this.compliance=new ee(e),this.market=new te(e),this.learning=new ne(e),this.lookalikes=new re(e),this.freshness=new se(e),this.audit=new ie(e)}},Se=class{constructor(e){i(this,"erix");i(this,"flow");i(this,"seo");i(this,"laie");this.erix=new Oe(e),this.flow=new Ve(e),this.seo=new De(e),this.laie=new Fe(e)}},Ue=class{constructor(e){i(this,"config");i(this,"templates");this.config=new kt(e),this.templates=new nt(e)}},Me=class{constructor(e){i(this,"templates");i(this,"setup");this.templates=new St(e),this.setup=new At(e)}},Wt=class{constructor(e){i(this,"leadForms");this.leadForms=new st(e)}},_e=class{constructor(e){i(this,"email");i(this,"whatsapp");i(this,"facebook");i(this,"meet");i(this,"connections");i(this,"accounts");i(this,"channelSettings");i(this,"voice");this.email=new Ue(e),this.whatsapp=new Me(e),this.facebook=new Wt(e),this.meet=new ct(e),this.connections=new He(e),this.accounts=new M(e),this.channelSettings=new U(e),this.voice=new Te(e)}},Ne=class{constructor(e){i(this,"files");i(this,"folders");i(this,"media");i(this,"library");this.files=new wt(e),this.folders=new Ct(e),this.media=new at(e),this.library=new vt(e)}},jt=class{constructor(e){i(this,"collector");this.collector=new we(e)}},Ae=class{constructor(e){i(this,"connect");i(this,"storage");i(this,"serp");this.connect=new _e(e),this.storage=new Ne(e),this.serp=new jt(e)}},Be=class{constructor(e){i(this,"onboarding");i(this,"persona");i(this,"audit");this.onboarding=new oe(e),this.persona=new ae(e),this.audit=new gt(e)}},qe=class{constructor(e){i(this,"me");i(this,"members");i(this,"sessions");i(this,"notifications");this.me=new ft(e),this.members=new bt(e),this.sessions=new ht(e),this.notifications=new ut(e)}},Re=class{constructor(e){i(this,"auth");i(this,"users");i(this,"tenants");i(this,"billing");i(this,"support");i(this,"ai");i(this,"knowledge");i(this,"health");i(this,"catalog");this.auth=new dt(e),this.users=new qe(e),this.tenants=new Be(e),this.billing=new mt(e),this.support=new yt(e),this.ai=new pt(e),this.knowledge=new ue(e),this.health=new it(e),this.catalog=new ce(e)}};var L=class extends y{constructor(e){super(e,400,"invalid_signature"),this.name="WebhookSignatureError"}},Ie=class{async constructEvent(e,t,r){if(!t)throw new L("No webhook signature provided");let o=Array.isArray(t)?t[0]:t;o.startsWith("sha256=")&&(o=o.slice(7));try{let a=await import("crypto"),d=a.createHmac("sha256",r).update(e).digest("hex");if(!a.timingSafeEqual(Buffer.from(d),Buffer.from(o)))throw new L("Invalid webhook signature provided");return JSON.parse(e.toString("utf8"))}catch(a){throw a instanceof L?a:new L(`Webhook payload parsing failed: ${a.message}`)}}};var Gt=typeof process!="undefined"&&"4.3.0"||"3.1.1";var mn,Ht=(mn=Qt.default.default)!=null?mn:Qt.default,O=class{constructor(e){i(this,"client");i(this,"socket",null);i(this,"startSocket",null);i(this,"socketPromise",null);i(this,"socketQueue",[]);i(this,"clientCode");i(this,"apiVersion");i(this,"platform");i(this,"product");i(this,"infra");i(this,"webhooks");i(this,"lastSeq");i(this,"closed",!1);var b,T,S,V,h,Yt,Jt,Xt;let t=e.proxy;if(!e.apiKey&&!t)throw new v("API Key is required");this.clientCode=(b=e.clientCode)==null?void 0:b.toUpperCase(),this.apiVersion=(T=e.version)!=null?T:"v1";let r=(S=e.baseUrl)!=null?S:Lt,o=on(this.apiVersion,(V=t==null?void 0:t.url)!=null?V:r),a=e.socketUrl||r,u=typeof window!="undefined"&&typeof window.document!="undefined",d=u?"browser":typeof process!="undefined"?`node ${process.version}`:"unknown",g=u?((h=globalThis.navigator)==null?void 0:h.userAgent)||"browser":typeof process!="undefined"?process.platform:"unknown",k=E(p({},t?{}:{"x-api-key":e.apiKey,"x-client-code":((Yt=e.clientCode)==null?void 0:Yt.toUpperCase())||""}),{"Content-Type":"application/json","x-ecodrix-client-agent":JSON.stringify({sdk_version:Gt,runtime:d,os:g})});if(this.client=yn.default.create({baseURL:o,headers:k,timeout:(Jt=e.timeout)!=null?Jt:3e4}),Ht(this.client,{retries:3,retryDelay:Ht.exponentialDelay,retryCondition:w=>{var Ke;return Ht.isNetworkOrIdempotentRequestError(w)||((Ke=w.response)==null?void 0:Ke.status)===429},onRetry:(w,Ke,Zt)=>{var en,tn;typeof process!="undefined"&&((en=process.env)==null?void 0:en.NODE_ENV)==="development"&&console.warn(`[ECODrIx SDK] Retrying request (${w}/3): ${(tn=Zt.method)==null?void 0:tn.toUpperCase()} ${Zt.url}. Reason: ${Ke.message}`)}}),this.platform=new Re(this.client),this.product=new Se(this.client),this.infra=new Ae(this.client),this.webhooks=new Ie,t){if(t.ticket){let w=t.ticket;this.startSocket=()=>this.initSocket(a,async()=>({ticket:await w()}))}}else{let w={apiKey:e.apiKey,clientCode:((Xt=e.clientCode)==null?void 0:Xt.toUpperCase())||""};this.startSocket=()=>this.initSocket(a,async()=>w,{"x-api-key":w.apiKey,"x-client-code":w.clientCode})}if(u){let w={version:Gt,clientCode:e.clientCode,initializedAt:new Date().toISOString()};window.__ECODRIX_SDK__=w}}initSocket(e,t,r){return this.socketPromise?this.socketPromise:(this.socketPromise=import("socket.io-client").then(({io:o})=>{this.socket=o(e,{auth:a=>{t().then(u=>a(E(p({},u),{lastSeq:this.lastSeq})),()=>a({lastSeq:this.lastSeq}))},extraHeaders:r,transports:["websocket","polling"],tryAllTransports:!0}),this.setupSocket();for(let{type:a,args:u}of this.socketQueue)a==="joinRoom"?this.socket.emit("join-room",u[0]):a==="leaveRoom"?this.socket.emit("leave-room",u[0]):a==="on"?this.socket.on(u[0],u[1]):a==="off"?this.socket.off(u[0],u[1]):a==="disconnect"&&this.socket.disconnect();this.socketQueue=[]}),this.socketPromise)}joinRoom(e){var t;this.closed||(t=this.startSocket)==null||t.call(this),this.socket?this.socket.emit("join-room",e):this.socketQueue.push({type:"joinRoom",args:[e]})}leaveRoom(e){this.socket?this.socket.emit("leave-room",e):this.socketQueue.push({type:"leaveRoom",args:[e]})}setupSocket(){this.socket&&(this.socket.on("connect_error",()=>{var e;(e=this.socket)!=null&&e.active||setTimeout(()=>{var t;this.closed||(t=this.socket)==null||t.connect()},5e3)}),this.socket.onAny((...e)=>{var r,o;let t=(r=e.at(-1))==null?void 0:r.seq;typeof t=="number"&&t>((o=this.lastSeq)!=null?o:0)&&(this.lastSeq=t)}))}on(e,t){var r;return this.closed||(r=this.startSocket)==null||r.call(this),this.socket?this.socket.on(e,t):this.socketQueue.push({type:"on",args:[e,t]}),this}disconnect(){this.closed=!0,this.socket?this.socket.disconnect():this.socketPromise&&this.socketQueue.push({type:"disconnect",args:[]})}off(e,t){return this.socket?this.socket.off(e,t):this.socketQueue.push({type:"off",args:[e,t]}),this}async request(e,t,r,o){var a,u,d;try{return(await this.client.request({method:e,url:t,data:r,params:o})).data}catch(g){throw g.response?new y(((a=g.response.data)==null?void 0:a.message)||((u=g.response.data)==null?void 0:u.error)||"Raw Execution Failed",g.response.status,(d=g.response.data)==null?void 0:d.code):new y(g.message||"Network Error")}}};var In={401:v,403:D,429:I};function Pn(n){throw $(n)}function Ln(n,e){return n instanceof e}function En(n){return n instanceof v?{message:n.message,status:n.status,code:n.code,type:"AuthenticationError"}:n instanceof I?{message:n.message,status:n.status,code:n.code,type:"RateLimitError"}:n instanceof y?{message:n.message,status:n.status,code:n.code,type:"APIError"}:{message:n.message||"Unknown error",type:"UnknownError"}}var zt={[v.name]:{shouldRetry:!1,reason:"Authentication errors require fixing credentials, not retrying"},[I.name]:{shouldRetry:!0,maxRetries:3,baseDelay:1e3,backoffMultiplier:2,reason:"Rate limit errors can be retried with exponential backoff"},[y.name]:{shouldRetry:!0,maxRetries:2,baseDelay:500,backoffMultiplier:1.5,reason:"Generic API errors may be transient and worth retrying"}};function $n(n){let e=n.constructor.name;return zt[e]||zt[y.name]}var On=O;0&&(module.exports={APIError,APIResource,AiAgent,AuthenticationError,Campaigns,Catalog,ChannelSettingsResource,Collector,ConnectAccounts,ConnectInfra,ECODrIx,ECODrIxAPI,ERROR_RETRY_CONFIG,EcodrixError,EmailConnect,ErixChat,ErixProduct,FlowAudiences,FlowAutomations,FlowConversations,FlowDrafts,FlowFirstRunResource,FlowHome,FlowProduct,HTTP_STATUS_ERROR_MAP,InfraDomain,KNOWLEDGE_FILE_TYPES,Knowledge,LAIE_EVENTS,LEAD_STATUS_VALUES,LaieAudits,LaieCampaigns,LaieCompliance,LaieFreshness,LaieImport,LaieLeads,LaieLearning,LaieLists,LaieLookalikes,LaieMarket,LaiePacks,LaieProduct,LaieRuns,LaieSignals,LaieTools,Onboarding,PermissionError,Persona,PlatformDomain,PlatformTenants,PlatformUsers,ProductDomain,RateLimitError,SeoAudits,SeoBacklinks,SeoBriefs,SeoInsights,SeoLocal,SeoPerformance,SeoProduct,SeoProjects,SeoRanks,SeoReports,SeoResearch,SeoSearchConsole,StorageInfra,VOICE_EVENTS,VOICE_REFUSAL_REASONS,Voice,VoiceCampaigns,WebhookSignatureError,Webhooks,WhatsAppConnect,getErrorDetails,getRetryConfig,handleAPIError,isAPIError,laieStageQueued,toAPIError,voiceErrorCode,voiceRefusalReason});
1
+ "use strict";var fn=Object.create;var Pe=Object.defineProperty,bn=Object.defineProperties,hn=Object.getOwnPropertyDescriptor,xn=Object.getOwnPropertyDescriptors,kn=Object.getOwnPropertyNames,We=Object.getOwnPropertySymbols,Cn=Object.getPrototypeOf,It=Object.prototype.hasOwnProperty,nn=Object.prototype.propertyIsEnumerable;var wn=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n);var Rt=(n,e,t)=>e in n?Pe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,p=(n,e)=>{for(var t in e||(e={}))It.call(e,t)&&Rt(n,t,e[t]);if(We)for(var t of We(e))nn.call(e,t)&&Rt(n,t,e[t]);return n},E=(n,e)=>bn(n,xn(e));var R=(n,e)=>{var t={};for(var r in n)It.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&We)for(var r of We(n))e.indexOf(r)<0&&nn.call(n,r)&&(t[r]=n[r]);return t};var vn=(n,e)=>{for(var t in e)Pe(n,t,{get:e[t],enumerable:!0})},rn=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of kn(e))!It.call(n,o)&&o!==t&&Pe(n,o,{get:()=>e[o],enumerable:!(r=hn(e,o))||r.enumerable});return n};var Le=(n,e,t)=>(t=n!=null?fn(Cn(n)):{},rn(e||!n||!n.__esModule?Pe(t,"default",{value:n,enumerable:!0}):t,n)),Tn=n=>rn(Pe({},"__esModule",{value:!0}),n);var i=(n,e,t)=>Rt(n,typeof e!="symbol"?e+"":e,t);var Pt=function(n,e){this[0]=n,this[1]=e},sn=(n,e,t)=>{var r=(d,g,k,b)=>{try{var T=t[d](g),S=(g=T.value)instanceof Pt,V=T.done;Promise.resolve(S?g[0]:g).then(h=>S?r(d==="return"?d:"next",g[1]?{done:h.done,value:h.value}:h,k,b):k({value:h,done:V})).catch(h=>r("throw",h,k,b))}catch(h){b(h)}},o=(d,g,k,b)=>u[d]=T=>(g=new Promise((S,V,h)=>(h=()=>r(d,T,S,V),a?a.then(h):h())),b=()=>a===k&&(a=0),a=k=g.then(b,b),g),a,u={};return t=t.apply(n,e),u[wn("asyncIterator")]=()=>u,o("next"),o("throw"),o("return"),u};var Vn={};vn(Vn,{APIError:()=>y,APIResource:()=>s,AiAgent:()=>F,AuthenticationError:()=>v,Campaigns:()=>P,Catalog:()=>ce,ChannelSettingsResource:()=>U,Collector:()=>we,ConnectAccounts:()=>M,ConnectInfra:()=>_e,ECODrIx:()=>O,ECODrIxAPI:()=>O,ERROR_RETRY_CONFIG:()=>zt,EcodrixError:()=>je,EmailConnect:()=>Ue,ErixChat:()=>$e,ErixProduct:()=>Oe,FlowAudiences:()=>j,FlowAutomations:()=>_,FlowConversations:()=>B,FlowDrafts:()=>K,FlowFirstRunResource:()=>W,FlowHome:()=>q,FlowProduct:()=>Ve,HTTP_STATUS_ERROR_MAP:()=>In,InfraDomain:()=>Ae,KNOWLEDGE_FILE_TYPES:()=>un,Knowledge:()=>ue,LAIE_EVENTS:()=>cn,LEAD_STATUS_VALUES:()=>Vt,LaieAudits:()=>ie,LaieCampaigns:()=>z,LaieCompliance:()=>ee,LaieFreshness:()=>se,LaieImport:()=>X,LaieLeads:()=>J,LaieLearning:()=>ne,LaieLists:()=>Z,LaieLookalikes:()=>re,LaieMarket:()=>te,LaiePacks:()=>G,LaieProduct:()=>Fe,LaieRuns:()=>Y,LaieSignals:()=>H,LaieTools:()=>Q,Onboarding:()=>oe,PermissionError:()=>D,Persona:()=>ae,PlatformDomain:()=>Re,PlatformTenants:()=>Be,PlatformUsers:()=>qe,ProductDomain:()=>Se,RateLimitError:()=>I,SeoAudits:()=>ge,SeoBacklinks:()=>xe,SeoBriefs:()=>Ce,SeoInsights:()=>de,SeoLocal:()=>fe,SeoPerformance:()=>ke,SeoProduct:()=>De,SeoProjects:()=>pe,SeoRanks:()=>ye,SeoReports:()=>be,SeoResearch:()=>he,SeoSearchConsole:()=>me,StorageInfra:()=>Ne,VOICE_EVENTS:()=>pn,VOICE_REFUSAL_REASONS:()=>Kt,Voice:()=>Te,VoiceCampaigns:()=>Ee,WebhookSignatureError:()=>L,Webhooks:()=>Ie,WhatsAppConnect:()=>Me,default:()=>On,getErrorDetails:()=>En,getRetryConfig:()=>$n,handleAPIError:()=>Pn,isAPIError:()=>Ln,laieStageQueued:()=>an,toAPIError:()=>$,voiceErrorCode:()=>gn,voiceRefusalReason:()=>dn});module.exports=Tn(Vn);var yn=Le(require("axios"),1),Qt=Le(require("axios-retry"),1);var Lt="https://api.ecodrix.com";function on(n="v1",e=Lt){return`${e.replace(/\/+$/,"")}/${n}/api`}var je=class extends Error{constructor(e){super(e),this.name="EcodrixError"}},y=class extends je{constructor(t,r,o){super(t);i(this,"status");i(this,"code");i(this,"issues");i(this,"field");this.name="APIError",this.status=r,this.code=o}},v=class extends y{constructor(e="Invalid API Key or Client Code",t="AUTH_FAILED",r=401){super(e,r,t),this.name="AuthenticationError"}},D=class extends v{constructor(e="You don't have permission to do this.",t="FORBIDDEN"){super(e,t,403),this.name="PermissionError"}},I=class extends y{constructor(e="Too many requests. Please slow down."){super(e,429,"RATE_LIMIT_EXCEEDED"),this.name="RateLimitError"}};function $(n){var a;if(!(n!=null&&n.response))return new y((n==null?void 0:n.message)||"Network Error");let{status:e,data:t}=n.response,r=(t==null?void 0:t.message)||(t==null?void 0:t.error)||"API Request Failed",o=(a=t==null?void 0:t.code)!=null?a:typeof(t==null?void 0:t.error)=="string"&&/^[A-Z][A-Z0-9_]*$/.test(t.error)?t.error:void 0;switch(e){case 401:return new v(r,o);case 403:return new D(r,o);case 429:return new I(r);default:{let u=new y(r,e,o);return Array.isArray(t==null?void 0:t.issues)&&(u.issues=t.issues),typeof(t==null?void 0:t.field)=="string"&&(u.field=t.field),u}}}var s=class{constructor(e){i(this,"client",e)}async post(e,t,r){try{let o=this.buildConfig(r);return(await this.client.post(e,t,o)).data}catch(o){this.handleError(o)}}async get(e,t){try{let r=this.buildConfig(t);return(await this.client.get(e,r)).data}catch(r){this.handleError(r)}}async patch(e,t,r){try{let o=this.buildConfig(r);return(await this.client.patch(e,t,o)).data}catch(o){this.handleError(o)}}async put(e,t,r){try{let o=this.buildConfig(r);return(await this.client.put(e,t,o)).data}catch(o){this.handleError(o)}}async deleteRequest(e,t){try{let r=this.buildConfig(t);return(await this.client.delete(e,r)).data}catch(r){this.handleError(r)}}buildConfig(e){if(!e)return;let t=p({},e);return e.idempotencyKey&&(t.headers=E(p({},t.headers),{"Idempotency-Key":e.idempotencyKey})),t}handleError(e){throw $(e)}};var F=class extends s{async settings(){return this.get("/product/erix/ai/settings")}async updateSettings(e){return this.patch("/product/erix/ai/settings",e)}async outcomes(e={}){return this.get("/product/erix/ai/outcomes",{params:e})}async reviews(e){return this.get(`/product/erix/ai/reviews${e?`?status=${e}`:""}`)}async review(e,t,r){return this.post(`/product/erix/ai/reviews/${encodeURIComponent(e)}`,p({verdict:t},r?{note:r}:{}))}async suggestion(e){return this.get(`/product/erix/ai/suggestion/${e}`)}async approveAction(e){return this.post(`/product/erix/ai/suggestion/${e}/approve-action`,{})}async markSent(e,t,r){return this.post(`/product/erix/ai/suggestion/${e}/send`,{text:t,confidence:r})}async dismiss(e){return this.post(`/product/erix/ai/suggestion/${e}/dismiss`,{})}async approvals(){return this.get("/product/flow/approvals")}async agents(){return this.get("/product/flow/agents")}async agent(e){return this.get(`/product/flow/agents/${encodeURIComponent(e)}`)}async tryAgent(e,t){return this.post(`/product/flow/agents/${encodeURIComponent(e)}/try`,t)}async proposeAgentChange(e,t){return this.post(`/product/flow/agents/${encodeURIComponent(e)}/propose`,t)}async buildAgent(e){return this.post("/product/flow/agents/build",e)}async unansweredQuestions(){return this.get("/product/flow/agents/unanswered")}async markQuestionHandled(e){return this.post("/product/flow/agents/unanswered/handled",{question:e})}async agentTemplates(){return this.get("/product/flow/agents/templates")}async createAgent(e){return this.post("/product/flow/agents",e)}async updateAgent(e,t){return this.patch(`/product/flow/agents/${encodeURIComponent(e)}`,t)}async deleteAgent(e){return this.deleteRequest(`/product/flow/agents/${encodeURIComponent(e)}`)}async agentAutomation(e,t){return this.post(`/product/flow/agents/${encodeURIComponent(e)}/automation`,{trigger:t})}async decideRun(e,t,r){return this.post(`/product/flow/runs/${encodeURIComponent(e)}/approve`,p({decision:t},r&&{nodeId:r}))}};var x="/product/erix/commerce/checkout",A="/product/erix/public/checkout",C=encodeURIComponent,Et=class extends s{async getProduct(e,t){return this.get(`${A}/products/${C(t)}`,{params:{c:e}})}async viewSession(e,t){return this.get(`${A}/sessions/view`,{params:{c:e,t}})}async updateItems(e){let o=e,{sessionId:t}=o,r=R(o,["sessionId"]);return this.post(`${A}/sessions/${C(t)}/items`,r)}async startSession(e){return this.post(`${A}/sessions`,e)}async applyCoupon(e){let o=e,{sessionId:t}=o,r=R(o,["sessionId"]);return this.post(`${A}/sessions/${C(t)}/coupon`,r)}async verify(e){let o=e,{sessionId:t}=o,r=R(o,["sessionId"]);return this.post(`${A}/sessions/${C(t)}/verify`,r)}async placeOrder(e){let o=e,{sessionId:t}=o,r=R(o,["sessionId"]);return this.post(`${A}/sessions/${C(t)}/order`,r)}async verifyRazorpay(e){let a=e,{sessionId:t,orderId:r}=a,o=R(a,["sessionId","orderId"]);return this.post(`${A}/sessions/${C(t)}/order/${C(r)}/razorpay`,o)}async orderStatus(e,t){return this.get(`${A}/orders/status`,{params:{c:e,t}})}async confirmCod(e,t){return this.post(`${A}/cod/confirm`,{clientCode:e,token:t})}},$t=class extends s{async create(e){return this.post(`${x}/sessions`,e)}},Ge=class extends s{constructor(t){super(t);i(this,"buyer");i(this,"sessions");this.buyer=new Et(t),this.sessions=new $t(t)}async listProducts(){return this.get(`${x}/products`)}async createProduct(t){return this.post(`${x}/products`,t)}async updateProduct(t,r){return this.patch(`${x}/products/${C(t)}`,r)}async deleteProduct(t){return this.deleteRequest(`${x}/products/${C(t)}`)}async listCoupons(){return this.get(`${x}/coupons`)}async createCoupon(t){return this.post(`${x}/coupons`,t)}async updateCoupon(t,r){return this.patch(`${x}/coupons/${C(t)}`,r)}async deleteCoupon(t){return this.deleteRequest(`${x}/coupons/${C(t)}`)}async listOrders(t){return this.get(`${x}/orders`,{params:t})}async getOrder(t){return this.get(`${x}/orders/${C(t)}`)}async updateOrderStatus(t,r){return this.patch(`${x}/orders/${C(t)}/status`,r)}async getSettings(){return this.get(`${x}/settings`)}async updateSettings(t){return this.put(`${x}/settings`,t)}async createProductLink(t){return this.post(`${x}/links`,t)}};var He=class extends s{async providers(){return this.get("/infra/connect/providers")}async list(){return this.get("/infra/connect/connections")}async get_(e){return this.get(`/infra/connect/connections/${e}`)}async connect(e,t){return this.post(`/infra/connect/connections/${e}/connect`,t)}async configure(e,t){return this.put(`/infra/connect/connections/${e}/configure`,t)}async configureWebchat(e){return this.configure("webchat",{method:"domain",config:e})}async webchatSettings(){return this.get("/infra/connect/connections/webchat/settings")}async removeWebchatDomain(e){return this.deleteRequest(`/infra/connect/connections/webchat/domains/${encodeURIComponent(e)}`)}async disconnect(e){return this.post(`/infra/connect/connections/${e}/disconnect`,{})}async reveal(e){return this.post(`/infra/connect/connections/${e}/reveal`,{})}async test(e){return this.post(`/infra/connect/connections/${e}/test`,{})}async checkNow(e){return this.post(`/infra/connect/connections/${e}/health/check`,{})}async googleConnectUrl(){return this.post("/infra/connect/google/connect-url",{})}async moveChannel(e,t){return this.post(`/infra/connect/${e}/move`,{ticket:t})}async requestChannelRelease(e,t){return this.post(`/infra/connect/${e}/release-request`,{ticket:t})}async channelReleaseRequest(e){return this.get(`/infra/connect/${e}/release-request`)}async cancelChannelRelease(e){return this.deleteRequest(`/infra/connect/${e}/release-request`)}async createPaymentLink(e){return this.post("/infra/connect/connections/payments/payment-link",e)}};var U=class extends s{async retrieve(e){return this.get(`/infra/connect/channel-settings/${e}`)}async save(e,t){return this.put(`/infra/connect/channel-settings/${e}`,t)}async resumeEmail(){return this.post("/infra/connect/channel-settings/email/resume",{})}};var M=class extends s{async list(e){return this.get("/infra/connect/accounts",e?{params:{providerId:e}}:void 0)}async retrieve(e){return this.get(`/infra/connect/accounts/${encodeURIComponent(e)}`)}async update(e,t){return this.patch(`/infra/connect/accounts/${encodeURIComponent(e)}`,t)}async remove(e,t={}){return this.deleteRequest(`/infra/connect/accounts/${encodeURIComponent(e)}`,t.newDefaultId?{params:{newDefaultId:t.newDefaultId}}:void 0)}};var Ot=class extends s{async list(e){return this.get(`/product/erix/crm/leads/${e}/notes`)}async create(e,t){return this.post(`/product/erix/crm/leads/${e}/notes`,t)}async update(e,t){return this.patch(`/product/erix/crm/notes/${e}`,{content:t})}async pin(e,t=!0){return this.patch(`/product/erix/crm/notes/${e}/pin`,{isPinned:t})}async delete(e){return this.deleteRequest(`/product/erix/crm/notes/${e}`)}},Qe=class extends s{constructor(t){super(t);i(this,"notes");this.notes=new Ot(t)}async timeline(t,r){return this.get(`/product/erix/crm/leads/${t}/timeline`,{params:r})}async list(t,r){return this.get(`/product/erix/crm/leads/${t}/activities`,{params:p({},r)})}async log(t){return this.post(`/product/erix/crm/leads/${t.leadId}/activities`,t)}async logCall(t,r){return this.post(`/product/erix/crm/leads/${t}/calls`,r)}};var ze=class extends s{async overview(e){return this.get("/product/erix/crm/analytics/overview",{params:e})}async funnel(e){return this.get("/product/erix/crm/analytics/funnel",{params:{pipelineId:e}})}async forecast(e){return this.get("/product/erix/crm/analytics/forecast",{params:{pipelineId:e}})}async sources(e){return this.get("/product/erix/crm/analytics/sources",{params:e})}async team(e){return this.get("/product/erix/crm/analytics/team",{params:e})}async heatmap(e){return this.get("/product/erix/crm/analytics/heatmap",{params:e})}async scores(){return this.get("/product/erix/crm/analytics/scores")}async stageTime(e){return this.get("/product/erix/crm/analytics/stage-time",{params:{pipelineId:e}})}async tiered(e){return this.get("/product/erix/crm/analytics/tiered",{params:e})}async summary(e){return this.get("/product/erix/crm/analytics/summary",{params:e})}async whatsapp(e){return this.get("/product/erix/crm/analytics/whatsapp",{params:e})}async revenue(){return this.get("/product/erix/crm/analytics/revenue")}async health(){return this.get("/product/erix/crm/analytics/health")}async payments(){return this.get("/product/erix/crm/analytics/payments")}async reviews(){return this.get("/product/erix/crm/analytics/reviews")}async retention(){return this.get("/product/erix/crm/analytics/retention")}};var Ye=class extends s{async getChecklist(e){return this.get(`/product/erix/crm/documents/checklist/${e}`)}async createChecklist(e,t){return this.post(`/product/erix/crm/documents/checklist/${e}`,{templateNiche:t})}async markReceived(e,t,r){return this.patch(`/product/erix/crm/documents/checklist/${e}/${t}`,r?{fileUrl:r}:{})}async sendReminder(e){return this.post(`/product/erix/crm/documents/checklist/${e}/remind`)}async listIncomplete(){return this.get("/product/erix/crm/documents/checklist/incomplete")}async listTemplates(){return this.get("/product/erix/crm/documents/templates")}};var Je=class extends s{async csv(e){return this.get("/product/erix/commerce/invoices/export/csv",{params:e})}async tally(e){return this.get("/product/erix/commerce/invoices/export/tally",{params:e})}async zoho(e){return this.get("/product/erix/commerce/invoices/export/zoho",{params:e})}};var Vt=["open","won","lost","archived"],Xe=class extends s{async create(e){return this.post("/product/erix/crm/leads",e)}async describe(){let e=await this.fields(),t=Array.isArray(e.data)?e.data:[],r=[{key:"firstName",label:"First Name",type:"string",required:!0,group:"Basic Info"},{key:"lastName",label:"Last Name",type:"string",required:!1,group:"Basic Info"},{key:"phone",label:"Phone Number",type:"phone",required:!0,group:"Contact"},{key:"email",label:"Email Address",type:"email",required:!1,group:"Contact"},{key:"status",label:"Status",type:"select",required:!0,options:Vt.map(a=>({label:`${a.charAt(0).toUpperCase()}${a.slice(1)}`,value:a}))},{key:"value",label:"Lead Value",type:"currency",required:!1},{key:"source",label:"Source",type:"string",required:!1}],o=t.map(a=>({key:`metadata.extra.${a.name}`,label:a.label||a.name,type:a.type||"string",required:!!a.required,options:a.options,group:"Custom Fields"}));return{name:"Lead",fields:[...r,...o],uiHints:{icon:"User",primaryColor:"#3b82f6",defaultSort:{field:"createdAt",direction:"desc"},summaryFields:["firstName","lastName","phone","status"]}}}async upsert(e){return this.post("/product/erix/crm/leads/upsert",e)}async createMany(e,t=50){let r=[];for(let o=0;o<e.length;o+=t){let u=e.slice(o,o+t).map(g=>this.create(g)),d=await Promise.allSettled(u);for(let g of d)if(g.status==="fulfilled")r.push(g.value);else throw g.reason}return r}async import(e,t={}){return this.post("/product/erix/crm/leads/import",p({leads:e},t))}async bulkUpsert(e){return this.import(e)}async list(e){let t=p({},e);return Array.isArray(t.tags)&&(t.tags=t.tags.join(",")),this.get("/product/erix/crm/leads",{params:t})}listAutoPaging(e){return sn(this,null,function*(){let t=(e==null?void 0:e.page)||1,r=!0;for(;r;){let o=yield new Pt(this.list(E(p({},e),{page:t}))),a=Array.isArray(o.data)?o.data:o||[];if(a.length===0){r=!1;break}for(let u of a)yield u;o.pagination&&t<o.pagination.pages||!o.pagination&&a.length>0?t++:r=!1}})}async retrieve(e){return this.get(`/product/erix/crm/leads/${e}`)}async retrieveByPhone(e){return this.get(`/product/erix/crm/leads/phone/${encodeURIComponent(e)}`)}async byStage(e,t,r={}){return this.get(`/product/erix/crm/pipelines/${e}/stages/${t}/leads`,{params:r})}async retrieveByRef(e,t){return this.get(`/product/erix/crm/leads/ref/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)}async update(e,t){return this.patch(`/product/erix/crm/leads/${e}`,t)}async setFollowUp(e,t,r){return this.patch(`/product/erix/crm/leads/${e}`,{nextFollowUpAt:t,nextFollowUpNote:t&&r!=null?r:null})}async move(e,t){return this.patch(`/product/erix/crm/leads/${e}/move`,{stageId:t})}async convert(e,t,r){return this.post(`/product/erix/crm/leads/${e}/convert`,{outcome:t,reason:r})}async tags(e,t){return this.patch(`/product/erix/crm/leads/${e}/tags`,t)}async recalculateScore(e){return this.post(`/product/erix/crm/leads/${e}/score`,{})}async updateMetadata(e,t){return this.patch(`/product/erix/crm/leads/${e}/metadata`,t)}async fields(){return this.get("/product/erix/crm/fields")}async notes(e){return this.get(`/product/erix/crm/leads/${e}/notes`)}async activities(e,t){return this.get(`/product/erix/crm/leads/${e}/timeline`,{params:t})}async createNote(e,t){return this.post(`/product/erix/crm/leads/${e}/notes`,t)}async updateNote(e,t,r){return this.patch(`/product/erix/crm/notes/${t}`,r)}async deleteNote(e,t){return this.deleteRequest(`/product/erix/crm/notes/${t}`)}async delete(e){return this.deleteRequest(`/product/erix/crm/leads/${e}`)}async export(e){return this.get(`/product/erix/crm/leads/${encodeURIComponent(e)}/export`)}async erase(e){return this.post(`/product/erix/crm/leads/${encodeURIComponent(e)}/erase`,{confirm:"ERASE"})}async bulkArchive(e){return this.patch("/product/erix/crm/leads/bulk-archive",{ids:e})}async bulkDelete(e){return this.deleteRequest("/product/erix/crm/leads",{data:{ids:e}})}async archive(e){return this.deleteRequest(`/product/erix/crm/leads/${e}`)}async profile(e){return this.get(`/product/erix/crm/leads/${e}/profile`)}async invoices(e){return this.get(`/product/erix/crm/leads/${e}/invoices`)}async projects(e){return this.get(`/product/erix/crm/leads/${e}/projects`)}async conversations(e){return this.get(`/product/erix/crm/leads/${e}/conversations`)}async meetings(e){return this.get(`/product/erix/crm/leads/${e}/meetings`)}async flowRuns(e){return this.get(`/product/erix/crm/leads/${e}/flow-runs`)}async merge(e,t){return this.post("/product/erix/crm/leads/merge",{primaryId:e,secondaryId:t})}async duplicates(e){return this.get(`/product/erix/crm/leads/${encodeURIComponent(e)}/duplicates`)}};var Ze=class extends s{async capture(e){return this.post("/product/erix/crm/payments/capture",e)}};var et=class extends s{async list(){return this.get("/product/erix/crm/pipelines")}async getStageManifest(e){var o,a;let t=await this.retrieve(e),r=Array.isArray((o=t.data)==null?void 0:o.stages)?t.data.stages:[];return{name:`Pipeline: ${((a=t.data)==null?void 0:a.name)||e}`,fields:r.map(u=>({key:u._id,label:u.name,type:"string",required:!0,options:[{label:u.name,value:u._id}],group:"Stages",uiHints:{color:u.color||"#cbd5e1",probability:u.probability}})),uiHints:{icon:"Columns",primaryColor:"#6366f1"}}}async create(e){return this.post("/product/erix/crm/pipelines",e)}async retrieve(e){return this.get(`/product/erix/crm/pipelines/${e}`)}async update(e,t){return this.patch(`/product/erix/crm/pipelines/${e}`,t)}async setDefault(e){return this.patch(`/product/erix/crm/pipelines/${e}/default`,{})}async duplicate(e,t){return this.post(`/product/erix/crm/pipelines/${e}/duplicate`,{name:t})}async archive(e){return this.patch(`/product/erix/crm/pipelines/${e}/archive`,{})}async delete(e){return this.deleteRequest(`/product/erix/crm/pipelines/${e}`)}async checkInUse(e){return this.get(`/product/erix/crm/pipelines/${e}/in-use`)}async board(e){return this.get(`/product/erix/crm/pipelines/${e}/board`)}async forecast(e){return this.get(`/product/erix/crm/pipelines/${e}/forecast`)}async addStage(e,t){return this.post(`/product/erix/crm/pipelines/${e}/stages`,t)}async reorderStages(e,t){return this.patch(`/product/erix/crm/pipelines/${e}/stages/reorder`,{order:t})}async updateStage(e,t){return this.patch(`/product/erix/crm/stages/${e}`,t)}async deleteStage(e,t){return this.deleteRequest(`/product/erix/crm/stages/${e}`,{data:t?{moveLeadsToStageId:t}:void 0})}};var tt=class extends s{async getConfig(){return this.get("/product/erix/crm/scoring")}async updateConfig(e){return this.patch("/product/erix/crm/scoring",e)}async recalculate(e){return this.post(`/product/erix/crm/scoring/${e}/recalculate`,{})}async preview(e){return this.get(`/product/erix/crm/scoring/preview/${e}`)}};var nt=class extends s{async sendTest(e){return this.post("/infra/connect/email/test",{to:e})}async listTemplates(e){return this.get("/infra/connect/email/templates",{params:e})}async getTemplate(e){return this.get(`/infra/connect/email/templates/${e}`)}async createTemplate(e){return this.post("/infra/connect/email/templates",e)}async updateTemplate(e,t){return this.put(`/infra/connect/email/templates/${e}`,t)}async deleteTemplate(e,t=!1){return this.deleteRequest(`/infra/connect/email/templates/${e}`,{params:{force:t}})}async previewTemplate(e,t){return this.post(`/infra/connect/email/templates/${e}/preview`,t)}};var rt=class extends s{async trigger(e){return this.post("/product/erix/events/trigger",e)}async listCustomEvents(){return this.get("/product/flow/config/triggers")}async createCustomEvent(e){return this.post("/product/flow/config/triggers",e)}async deleteCustomEvent(e){return this.deleteRequest(`/product/flow/config/triggers/${e}`)}};var st=class extends s{async list(){return this.get("/infra/connect/facebook/lead-forms")}async subscribe(){return this.post("/infra/connect/facebook/lead-forms/subscribe",{})}async setEnabled(e,t){return this.put(`/infra/connect/facebook/lead-forms/${encodeURIComponent(e)}`,{enabled:t})}async importLast24Hours(e){return this.post(`/infra/connect/facebook/lead-forms/${encodeURIComponent(e)}/import-last-24h`,{})}};var _=class extends s{path(e,t=""){return`/product/flow/workflows/${encodeURIComponent(e)}${t}`}async versions(e){return this.get(this.path(e,"/versions"))}async version(e,t){return this.get(this.path(e,`/versions/${encodeURIComponent(t)}`))}async restoreVersion(e,t){return this.post(this.path(e,`/versions/${encodeURIComponent(t)}/restore`))}async testData(e){return this.get(this.path(e,"/test-data"))}async pinTestData(e,t){return this.put(this.path(e,"/test-data"),{runId:t})}async unpinTestData(e){return this.deleteRequest(this.path(e,"/test-data"))}async testRun(e,t={}){return this.post(this.path(e,"/test-run"),t)}async testRunProgress(e,t){return this.get(this.path(e,"/test-run"),{params:{runIds:t.join(",")}})}async copilot(e,t){return this.post(this.path(e,"/copilot"),t)}async live(e){return this.get(this.path(e,"/live"))}async week(e){return this.get(this.path(e,"/week"))}async deleteImpact(e){return this.get(this.path(e,"/delete-impact"))}async remove(e,t={}){return this.deleteRequest(this.path(e,t.stop?"?stop=true":""))}async duplicate(e){return this.post(this.path(e,"/duplicate"))}async retryFailed(e,t={}){return this.post(this.path(e,"/retry-failed"),t)}};var P=class extends s{async list(e={}){return this.get("/product/flow/campaigns",{params:e})}async create(e){return this.post("/product/flow/campaigns",e)}async launch(e,t={}){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/launch`,t)}async retrieve(e){return this.get(`/product/flow/campaigns/${encodeURIComponent(e)}`)}async update(e,t){return this.patch(`/product/flow/campaigns/${encodeURIComponent(e)}`,t)}async test(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/test`,{})}async start(e,t={}){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/start`,t)}async pause(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/pause`,{})}async resume(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/resume`,{})}async stop(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/stop`,{})}async remove(e){return this.deleteRequest(`/product/flow/campaigns/${encodeURIComponent(e)}`)}async duplicate(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/duplicate`,{})}async followUp(e,t={}){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/follow-up`,t)}async checks(e){return this.get(`/product/flow/campaigns/${encodeURIComponent(e)}/checks`)}async results(e){return this.get(`/product/flow/campaigns/${encodeURIComponent(e)}/results`)}async people(e,t={}){return this.get(`/product/flow/campaigns/${encodeURIComponent(e)}/people`,{params:t})}};var N="/product/flow/conversations",f=(n,e="")=>`${N}/${encodeURIComponent(n)}${e}`,B=class extends s{async list(e={}){return this.get(N,{params:e})}async create(e){return this.post(N,e)}async retrieve(e){return this.get(f(e))}async update(e,t){return this.patch(f(e),t)}async duplicate(e){return this.post(f(e,"/duplicate"),{})}async archive(e){return this.deleteRequest(f(e))}async publish(e,t={}){return this.post(f(e,"/publish"),t)}async versions(e){return this.get(f(e,"/versions"))}async version(e,t){return this.get(f(e,`/versions/${t}`))}async rollback(e,t){return this.post(f(e,"/rollback"),{version:t})}async try(e,t){return this.post(f(e,"/try"),t)}async tests(e){return this.get(f(e,"/tests"))}async addTest(e,t){return this.post(f(e,"/tests"),t)}async deleteTest(e,t){return this.deleteRequest(f(e,`/tests/${encodeURIComponent(t)}`))}async runTests(e,t={}){return this.post(f(e,"/tests/run"),t)}async deployments(e){return this.get(f(e,"/deployments"))}async allDeployments(){return this.get(`${N}/deployments`)}async deploy(e,t){return this.post(f(e,"/deployments"),t)}async updateDeployment(e,t){return this.patch(`${N}/deployments/${encodeURIComponent(e)}`,t)}async removeDeployment(e){return this.deleteRequest(`${N}/deployments/${encodeURIComponent(e)}`)}async checks(e){return this.get(f(e,"/checks"))}async moveToAgent(e){return this.post(f(e,"/move-to-agent"),{})}};var q=class extends s{async get(){return super.get("/product/flow/home")}async nav(){return super.get("/product/flow/home/nav")}},K=class extends s{async create(e){return this.post("/product/flow/drafts",e)}async plan(e){return this.post("/product/flow/drafts/plan",e)}},W=class extends s{async status(){return this.get("/product/flow/first-run")}async installPack(e){return this.post(`/product/flow/first-run/packs/${e}`)}},j=class extends s{async list(){return this.get("/product/flow/audiences")}async byId(e){return this.get(`/product/flow/audiences/${encodeURIComponent(e)}`)}async create(e){return this.post("/product/flow/audiences",e)}async update(e,t){return this.patch(`/product/flow/audiences/${encodeURIComponent(e)}`,t)}async remove(e){return this.deleteRequest(`/product/flow/audiences/${encodeURIComponent(e)}`)}async preview(e,t){return this.get(`/product/flow/audiences/${encodeURIComponent(e)}/preview${t?`?channel=${t}`:""}`)}async previewRules(e){return this.post("/product/flow/audiences/preview",e)}};var it=class extends s{async system(){return(await this.get("/health")).data}};var ot=class extends s{async list(e){return this.get("/product/erix/commerce/invoices",{params:e})}async getInvoice(e){return this.get(`/product/erix/commerce/invoices/${e}`)}async create(e){return this.post("/product/erix/commerce/invoices",e)}async update(e,t){return this.patch(`/product/erix/commerce/invoices/${e}`,t)}async void(e){return this.post(`/product/erix/commerce/invoices/${e}/void`,{})}async sendViaWhatsApp(e){return this.post(`/product/erix/commerce/invoices/${e}/send-whatsapp`,{})}async getSettings(){return this.get("/product/erix/commerce/settings")}async updateSettings(e){return this.put("/product/erix/commerce/settings",e)}async paymentLink(e){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/payment-link`,{})}async recordPayment(e,t){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/payments`,t)}async sendWhatsApp(e){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/send-whatsapp`,{})}async sendEmail(e){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/send-email`,{})}};var an=n=>"queued"in n&&n.queued===!0,cn={runProgress:"laie:run:progress",importComplete:"laie:import:complete"},m=encodeURIComponent,l="/product/laie",G=class extends s{async list(){return this.get(`${l}/packs`)}async byId(e){return this.get(`${l}/packs/${m(e)}`)}},H=class extends s{async catalog(e={}){return this.get(`${l}/signals/catalog`,{params:e})}async list(e={}){return this.get(`${l}/signals`,{params:e})}},Q=class extends s{async find(e){return this.post(`${l}/tools/find`,e)}async collect(e){return this.post(`${l}/tools/collect`,e)}async enrich(e){return this.post(`${l}/tools/enrich`,e)}async verify(e){return this.post(`${l}/tools/verify`,e)}async qualify(e){return this.post(`${l}/tools/qualify`,e)}async store(e){return this.post(`${l}/tools/store`,e)}async use(e){return this.post(`${l}/tools/use`,e)}async verifyEmail(e){return this.post(`${l}/tools/verify-email`,{emails:e})}async websiteLookup(e){return this.post(`${l}/tools/website-lookup`,{url:e})}},z=class extends s{async list(){return this.get(`${l}/campaigns`)}async create(e){return this.post(`${l}/campaigns`,e)}async byId(e){return this.get(`${l}/flows/${m(e)}`)}async settings(e){return this.get(`${l}/campaigns/${m(e)}/settings`)}async updateSettings(e,t){return this.patch(`${l}/campaigns/${m(e)}/settings`,t)}async signals(e){return this.get(`${l}/campaigns/${m(e)}/signals`)}async setSignals(e,t){return this.put(`${l}/campaigns/${m(e)}/signals`,t)}},Y=class extends s{async start(e){return this.post(`${l}/campaigns/${m(e)}/runs`)}async list(e,t={}){return this.get(`${l}/campaigns/${m(e)}/runs`,{params:t})}async byId(e,t){return this.get(`${l}/campaigns/${m(e)}/runs/${m(t)}`)}async changes(e,t,r={}){return this.get(`${l}/campaigns/${m(e)}/runs/${m(t)}/changes`,{params:r})}async cancel(e,t){return this.post(`${l}/campaigns/${m(e)}/runs/${m(t)}/cancel`)}async quality(e){return this.get(`${l}/jobs/${m(e)}/quality`)}},J=class extends s{async list(e={}){let o=e,{importedToCrm:t}=o,r=R(o,["importedToCrm"]);return this.get(`${l}/leads`,{params:p(p({},r),t!==void 0&&{importedToCrm:String(t)})})}async byId(e){return this.get(`${l}/leads/${m(e)}`)}async update(e,t){return this.patch(`${l}/leads/${m(e)}`,t)}async notes(e){return this.get(`${l}/leads/${m(e)}/notes`)}async addNote(e,t){return this.post(`${l}/leads/${m(e)}/notes`,t)}async generateKit(e){return this.post(`${l}/leads/${m(e)}/generate-kit`)}async pipelineSummary(){return this.get(`${l}/leads/pipeline-summary`)}async bulkContacted(e,t){return this.post(`${l}/leads/bulk/contacted`,{leadIds:e,channel:t})}async bulkTag(e,t){return this.post(`${l}/leads/bulk/tag`,{leadIds:e,tags:t})}async bulkDelete(e){return this.post(`${l}/leads/bulk/delete`,{leadIds:e})}async bulkExport(e,t="json"){return t==="csv"?this.post(`${l}/leads/bulk/export`,{leadIds:e,format:t},{responseType:"text"}):this.post(`${l}/leads/bulk/export`,{leadIds:e,format:t})}},X=class extends s{async pipelines(){return this.get(`${l}/import/pipelines`)}async crm(e){return this.post(`${l}/import/crm`,e)}},Z=class extends s{async enrich(e){return this.post(`${l}/lists/enrich`,e)}},ee=class extends s{async dsr(e){return this.post(`${l}/compliance/dsr`,e)}async report(e={}){return this.get(`${l}/compliance/report`,{params:e})}},te=class extends s{async map(e={}){return this.get(`${l}/market-map`,{params:e})}async forCampaign(e){return this.get(`${l}/campaigns/${m(e)}/market-map`)}async refresh(e={}){return this.post(`${l}/market-map/refresh`,e)}},ne=class extends s{async weights(e={}){return this.get(`${l}/learning/weights`,{params:e})}async outcomes(e={}){return this.get(`${l}/learning/outcomes`,{params:e})}},re=class extends s{async preview(e){return this.post(`${l}/lookalikes/preview`,e)}async create(e){return this.post(`${l}/lookalikes`,e)}async list(e={}){return this.get(`${l}/lookalikes`,{params:e})}async byId(e){return this.get(`${l}/lookalikes/${m(e)}`)}async rank(e,t={}){return this.get(`${l}/lookalikes/${m(e)}/rank`,{params:t})}},se=class extends s{async status(){return this.get(`${l}/freshness`)}},ie=class extends s{async start(e){return this.post(`${l}/audit`,e)}async byId(e){return this.get(`${l}/audit/${m(e)}`)}};var ln=Le(require("axios"),1);var at=class extends s{async getUsage(){return this.get("/infra/storage/files/usage")}async createFolder(e){return this.post("/infra/storage/files/folders",{name:e})}async list(e,t){return this.get(`/infra/storage/files/files/${e}`,{params:t})}async delete(e){return this.deleteRequest("/infra/storage/files/files",{params:{key:e}})}async getDownloadUrl(e){return this.post("/infra/storage/files/download-url",{key:e})}async aiDescribe(e){return this.post("/infra/storage/files/ai/describe",{key:e})}async upload(e,t){let r=await this.post("/infra/storage/files/upload-url",t),{uploadUrl:o,key:a,headers:u}=r.data;await ln.default.put(o,e,{headers:u!=null?u:{"Content-Type":t.contentType}});let d=e.size||e.byteLength||0;return this.post("/infra/storage/files/confirm-upload",{key:a,sizeBytes:d})}};var ct=class extends s{async create(e){return this.post("/infra/connect/meet",e)}async list(e){return this.get("/infra/connect/meet",{params:e})}async retrieve(e){return this.get(`/infra/connect/meet/${e}`)}async update(e,t){return this.patch(`/infra/connect/meet/${e}`,t)}async reschedule(e,t){return this.patch(`/infra/connect/meet/${e}`,t)}async delete(e){return this.update(e,{status:"cancelled"})}};var lt=class extends s{async workflowPacks(){return this.get("/product/erix/crm/niche/workflow-packs")}async workflowPackDetail(e){return this.get(`/product/erix/crm/niche/workflow-packs/${e}`)}async installWorkflowPack(e){return this.post(`/product/erix/crm/niche/workflow-packs/${e}/install`)}async templateSuggestions(){return this.get("/product/erix/crm/niche/template-suggestions")}};var ut=class extends s{async listAlerts(e){return this.get("/platform/users/notifications",{params:e})}async dismissAlert(e){return this.patch(`/platform/users/notifications/${e}/dismiss`)}async clearAllAlerts(){return this.deleteRequest("/platform/users/notifications/dismiss-all")}};var oe=class extends s{async global(e){return this.post("/platform/tenants/onboarding/global",e)}async complete(e){return this.post("/platform/tenants/onboarding/complete",e)}};var ae=class extends s{async get(e){return super.get(`/platform/tenants/persona/${e}`)}async reinforce(e){return this.post(`/platform/tenants/persona/${e.productId}/reinforce`,e)}async confidence(e){return super.get(`/platform/tenants/persona/${e}/confidence`,{params:{productId:e}})}async timeline(e,t){var o;let r=await super.get(`/platform/tenants/persona/${e}/timeline`,{params:t});return(o=r==null?void 0:r.data)!=null?o:{entries:[],hasMore:!1}}async followups(e){var r,o;let t=await super.get(`/platform/tenants/persona/${e}/followups`);return(o=(r=t==null?void 0:t.data)==null?void 0:r.entries)!=null?o:[]}};var Dt=class extends s{async chatSync(e){return this.post("/platform/ai/copilot/chat/sync",e)}async confirm(e){return this.post("/platform/ai/copilot/confirm",e)}async listSessions(){return this.get("/platform/ai/copilot/sessions")}async getSession(e){return this.get(`/platform/ai/copilot/sessions/${e}`)}async deleteSession(e){return this.deleteRequest(`/platform/ai/copilot/sessions/${e}`)}chatStreamUrl(){return"/platform/ai/copilot/chat"}},pt=class{constructor(e){i(this,"copilot");this.copilot=new Dt(e)}};var gt=class extends s{async list(e){return this.get("/platform/tenants/audit",{params:e})}};var dt=class extends s{async register(e){return this.post("/platform/auth/register",e)}async login(e){return this.post("/platform/auth/login",e)}async logout(e){return this.post("/platform/auth/logout",e)}async logoutAll(e){return this.post("/platform/auth/logout-all",e)}async validateSession(e){return this.post("/platform/auth/session/validate",e)}async listSessions(){return this.get("/platform/auth/sessions")}async revokeSession(e){return this.deleteRequest(`/platform/auth/sessions/${e}`)}async requestPasswordOtp(e){return this.post("/platform/auth/password/request-otp",e)}async setPassword(e){return this.post("/platform/auth/password/set",e)}async changePassword(e){return this.post("/platform/auth/password/change",e)}async forgotPassword(e){return this.post("/platform/auth/forgot",e)}async resetPassword(e){return this.post("/platform/auth/reset",e)}async linkOAuth(e){return this.post("/platform/auth/oauth-link",e)}async getInvitation(e){return this.get(`/platform/auth/invitations/${e}`)}async acceptInvitation(e,t){return this.post(`/platform/auth/invitations/${e}/accept`,t)}};var Ft=class extends s{async get(){return super.get("/platform/billing/entitlements/entitlements")}async usage(){return super.get("/platform/billing/entitlements/usage")}},Ut=class extends s{async upgrade(e){return this.post("/platform/billing/subscriptions/subscriptions/upgrade",e)}async downgrade(e){return this.post("/platform/billing/subscriptions/subscriptions/downgrade",e)}async cancel(e){return this.post("/platform/billing/subscriptions/subscriptions/cancel",e)}},Mt=class extends s{list(){return this.get("/platform/billing/addons")}add(e,t){return this.post(`/platform/billing/addons/${encodeURIComponent(e)}/add`,t===void 0?{}:{quantity:t})}remove(e){return this.post(`/platform/billing/addons/${encodeURIComponent(e)}/remove`)}overage(){return this.get("/platform/billing/overage")}setOverage(e){return this.put("/platform/billing/overage",e)}},_t=class extends s{async listPublic(){return this.get("/platform/billing/plans/public")}},Nt=class extends s{async plans(){return this.get("/platform/billing/checkout/plans")}async proration(e,t){return this.get("/platform/billing/checkout/proration",{params:{planId:e,billingCycle:t}})}async subscribe(e){return this.post("/platform/billing/checkout/subscribe",e)}async verify(e){return this.post("/platform/billing/checkout/verify",e)}async cancel(e){return this.post("/platform/billing/checkout/cancel",e)}async status(){return this.get("/platform/billing/checkout/status")}async syncPlan(e){return this.post("/platform/billing/checkout/sync-plan",e)}},Bt=class extends s{async transactions(){return this.get("/platform/billing/user/transactions")}async transactionInvoice(e){return this.get(`/platform/billing/user/transactions/${encodeURIComponent(e)}/invoice`)}async subscription(){return this.get("/platform/billing/user/subscription")}async raiseDispute(e){return this.post("/platform/billing/user/dispute",e)}async disputes(){return this.get("/platform/billing/user/disputes")}},qt=class extends s{async balance(){return this.get("/platform/billing/credits/balance")}async transactions(){return this.get("/platform/billing/credits/transactions")}async packs(){return this.get("/platform/billing/credits/packs")}async topupOrder(e){return this.post("/platform/billing/credits/topup/order",e)}async verifyTopup(e){return this.post("/platform/billing/credits/topup/verify",e)}async setAutoTopup(e){return this.patch("/platform/billing/credits/auto-topup",e)}async setSpendCap(e){return this.patch("/platform/billing/credits/spend-cap",e)}},mt=class{constructor(e){i(this,"entitlements");i(this,"subscriptions");i(this,"plans");i(this,"checkout");i(this,"user");i(this,"credits");i(this,"addOns");this.entitlements=new Ft(e),this.subscriptions=new Ut(e),this.plans=new _t(e),this.checkout=new Nt(e),this.user=new Bt(e),this.credits=new qt(e),this.addOns=new Mt(e)}};var ce=class extends s{async list(){return this.get("/platform/public/catalog",{ignoreClientCode:!0})}};var le=class extends s{async send(e){if(e.conversationId)return this.post(`/platform/inbox/conversations/${e.conversationId}/messages`,{text:e.text,media:e.media});if(!e.to)throw new Error("send: conversationId or to is required");if(e.media)throw new Error("send: media goes to an inbox thread (conversationId)");return this.post("/infra/connect/send/whatsapp",p({phone:e.to,text:e.text},e.accountId?{accountId:e.accountId}:{}))}async sendTemplate(e){return this.post("/infra/connect/send/whatsapp",p({phone:e.to,templateName:e.templateName,language:e.language,variables:e.variables},e.accountId?{accountId:e.accountId}:{}))}async star(e,t){return this.post(`/platform/inbox/messages/${e}/star`,{starred:t})}async translate(e){return this.post(`/platform/inbox/messages/${encodeURIComponent(e)}/translate`,{})}async markRead(e){return this.post(`/platform/inbox/conversations/${e}/read`,{})}async upload(e,t={}){var b,T,S;let r=(T=(b=t.fileName)!=null?b:e.name)!=null?T:"file",o=e.type||"application/octet-stream",a=await this.post("/infra/storage/files/upload-url",{folder:(S=t.folder)!=null?S:"inbox",filename:r,contentType:o}),{uploadUrl:u,key:d,headers:g}=a.data,k=await fetch(u,{method:"PUT",headers:g!=null?g:{"Content-Type":o},body:e});if(!k.ok)throw new Error(`upload failed (${k.status})`);return await this.post("/infra/storage/files/confirm-upload",{key:d,sizeBytes:e.size}),{key:d,mimeType:o,fileName:r}}};var un=["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/plain","text/markdown","text/csv","text/html","image/png","image/jpeg","image/webp"],ue=class extends s{async list(){return this.get("/platform/knowledge/sources")}async addText(e){return this.post("/platform/knowledge/sources",p({kind:"text"},e))}async addUrl(e){return this.post("/platform/knowledge/sources",p({kind:"url"},e))}async addWebsite(e){return this.post("/platform/knowledge/sources",{type:"website",url:e.url})}async addFile(e,t={}){var o,a;let r=await new le(this.client).upload(e,{folder:"knowledge"});return this.post("/platform/knowledge/sources",{kind:"file",key:r.key,mimeType:r.mimeType,title:(a=(o=t.title)!=null?o:r.fileName)!=null?a:"Document"})}async remove(e){return this.deleteRequest(`/platform/knowledge/sources/${e}`)}async reindex(e){return this.post(`/platform/knowledge/sources/${e}/reindex`,{})}async search(e,t){return this.post("/platform/knowledge/search",p({query:e},t?{limit:t}:{}))}};var yt=class extends s{async categories(){return this.get("/platform/support/categories")}async listTickets(e){return this.get("/platform/support/tickets",{params:e})}async createTicket(e){return this.post("/platform/support/tickets",e)}async getTicket(e){return this.get(`/platform/support/tickets/${e}`)}async reply(e,t){return this.post(`/platform/support/tickets/${e}/reply`,t)}async close(e){return this.patch(`/platform/support/tickets/${e}/close`,{})}async channelSetup(e){return this.get(`/platform/support/channel-requests/${encodeURIComponent(e)}/setup`)}};var ft=class extends s{async get(){return super.get("/platform/users/me")}async update(e){return this.patch("/platform/users/me",e)}async updateOrganization(e){return this.patch("/platform/users/me/organization",e)}async toggleModules(e){return this.post("/platform/users/me/modules",e)}async workspaces(){return super.get("/platform/users/me/workspaces")}async setActiveOrg(e){return this.post("/platform/users/me/active-org",e)}async dismissWorkspaceSetup(){return this.post("/platform/users/me/workspace/dismiss-setup",{})}},bt=class extends s{async list(){return this.get("/platform/users/members")}async access(){return this.get("/platform/users/members/access")}async invite(e){return this.post("/platform/users/members/invite",e)}async updateAccess(e,t){return this.patch(`/platform/users/members/${encodeURIComponent(e)}`,t)}async updateRole(e,t){return this.updateAccess(e,{role:t})}async remove(e){return this.deleteRequest(`/platform/users/members/${encodeURIComponent(e)}`)}async invitations(){return this.get("/platform/users/members/invitations")}async resendInvitation(e){return this.post(`/platform/users/members/invitations/${encodeURIComponent(e)}/resend`,{})}async revokeInvitation(e){return this.deleteRequest(`/platform/users/members/invitations/${encodeURIComponent(e)}`)}},ht=class extends s{async list(){return this.get("/platform/auth/sessions")}async revoke(e){return this.deleteRequest(`/platform/auth/sessions/${e}`)}};var xt=class extends s{async list(e){return this.get(`/product/erix/commerce/projects/${e}/documents`)}async upload(e,t){return this.post(`/product/erix/commerce/projects/${e}/documents`,t)}async toggleSignature(e,t,r){return this.patch(`/product/erix/commerce/projects/${e}/documents/${t}/signature`,{required:r})}async addSigner(e,t,r){return this.post(`/product/erix/commerce/projects/${e}/documents/${t}/signers`,r)}async decline(e,t){return this.post(`/product/erix/commerce/projects/${e}/documents/${t}/decline`,{})}async stampSign(e,t,r){return this.post(`/product/erix/commerce/projects/${e}/documents/${t}/stamp-sign`,r)}};var pe=class extends s{async list(){return this.get("/product/seo/projects")}async create(e){return this.post("/product/seo/projects",e)}async byId(e){return this.get(`/product/seo/projects/${e}`)}async update(e,t){return this.patch(`/product/seo/projects/${e}`,t)}async remove(e){return this.deleteRequest(`/product/seo/projects/${e}`)}async crawl(e){return this.post(`/product/seo/projects/${e}/crawl`)}async crawlCompetitor(e,t){return this.post(`/product/seo/projects/${e}/competitors/crawl`,{domain:t})}},ge=class extends s{async start(e){return this.post("/product/seo/audits",e)}async list(e={}){return this.get("/product/seo/audits",{params:e})}async compare(e){return this.post("/product/seo/audits/compare",e)}async byId(e){return this.get(`/product/seo/audits/${e}`)}async resume(e){return this.post(`/product/seo/audits/${e}/resume`)}async pages(e,t={}){return this.get(`/product/seo/audits/${e}/pages`,{params:t})}async issues(e){return this.get(`/product/seo/audits/${e}/issues`)}async links(e){return this.get(`/product/seo/audits/${e}/links`)}async export(e,t="json"){return this.get(`/product/seo/audits/${e}/export`,{params:{format:t},responseType:"text"})}},de=class extends s{async keywords(e,t={}){return this.get(`/product/seo/audits/${e}/keywords`,{params:t})}async contentGap(e){return this.post("/product/seo/audits/content-gap",e)}async search(e){return this.post("/product/seo/audits/search",e)}async backlinks(e){return this.get("/product/seo/audits/backlinks",{params:e})}async domain(e){return this.get(`/product/seo/audits/domains/${encodeURIComponent(e)}`)}},me=class extends s{async check(e){return this.post(`/product/seo/search-console/${e}/check`)}async importNow(e){return this.post(`/product/seo/search-console/${e}/import`)}async status(e){return this.get(`/product/seo/search-console/${e}/status`)}async queries(e,t={}){return this.get(`/product/seo/search-console/${e}/queries`,{params:t})}async pages(e,t={}){return this.get(`/product/seo/search-console/${e}/pages`,{params:t})}async trend(e,t={}){return this.get(`/product/seo/search-console/${e}/trend`,{params:t})}},ye=class extends s{async keywords(e){return this.get(`/product/seo/ranks/${e}/keywords`)}async add(e,t,r={}){return this.post(`/product/seo/ranks/${e}/keywords`,p({queries:t},r))}async visibility(e,t={}){return this.get(`/product/seo/ranks/${e}/visibility`,{params:t})}async competitors(e){return this.get(`/product/seo/ranks/${e}/competitors`)}async gap(e,t={}){return this.get(`/product/seo/ranks/${e}/gap`,{params:t})}async remove(e,t){return this.deleteRequest(`/product/seo/ranks/${e}/keywords/${t}`)}async checkNow(e,t){return this.post(`/product/seo/ranks/${e}/keywords/${t}/check`)}async history(e,t,r={}){return this.get(`/product/seo/ranks/${e}/keywords/${t}/history`,{params:r})}async changes(e){return this.get(`/product/seo/ranks/${e}/changes`)}},fe=class extends s{async checkNow(e){return this.post(`/product/seo/local/${e}/check`)}async latest(e){return this.get(`/product/seo/local/${e}`)}async history(e,t={}){return this.get(`/product/seo/local/${e}/history`,{params:t})}async startGrid(e,t={}){return this.post(`/product/seo/local/${e}/grid`,t)}async grid(e){return this.get(`/product/seo/local/${e}/grid`)}async grids(e,t={}){return this.get(`/product/seo/local/${e}/grids`,{params:t})}},be=class extends s{async byProject(e){return this.get(`/product/seo/reports/${e}`)}async export(e,t="csv"){return this.get(`/product/seo/reports/${e}/export`,{params:{format:t},responseType:"text"})}async pdf(e,t={}){return this.get(`/product/seo/reports/${e}/pdf`,{params:t,responseType:"arraybuffer"})}async generate(e,t={}){return this.post(`/product/seo/reports/${e}/generate`,t)}async history(e,t={}){return this.get(`/product/seo/reports/${e}/history`,{params:t})}async changes(e){return this.get(`/product/seo/reports/${e}/changes`)}},he=class extends s{async seed(e,t,r="en"){return this.post(`/product/seo/research/${e}/seed`,{seed:t,lang:r})}async fromSearchConsole(e){return this.post(`/product/seo/research/${e}/from-search-console`)}async ideas(e,t={}){return this.get(`/product/seo/research/${e}/ideas`,{params:t})}async analyze(e,t){return this.post(`/product/seo/research/${e}/ideas/${t}/analyze`)}};var xe=class extends s{async releases(){return this.get("/product/seo/backlinks/releases")}async strength(e){return this.get("/product/seo/backlinks/strength",{params:{domains:e.join(",")}})}async overview(e){return this.get(`/product/seo/backlinks/${e}`)}async referring(e,t){return this.get(`/product/seo/backlinks/${e}/referring`,{params:t})}async changes(e,t){return this.get(`/product/seo/backlinks/${e}/changes`,{params:t})}},ke=class extends s{async checkNow(e){return this.post(`/product/seo/performance/${e}/check`)}async latest(e){return this.get(`/product/seo/performance/${e}`)}async history(e,t={}){return this.get(`/product/seo/performance/${e}/history`,{params:t})}},Ce=class extends s{async create(e){return this.post("/product/seo/briefs",e)}async byId(e){return this.get(`/product/seo/briefs/${e}`)}async list(e,t={}){return this.get("/product/seo/briefs",{params:p({projectId:e},t)})}};var Sn=35e3,we=class extends s{async claim(e,t){var o;let r=await this.post("/infra/serp/collector/claim",{collectorId:e,kinds:t},{timeout:Sn});return(o=r&&typeof r=="object"?r.data:null)!=null?o:null}async result(e){return this.post("/infra/serp/collector/result",e)}async heartbeat(e,t){return this.post("/infra/serp/collector/heartbeat",p({collectorId:e},t))}};var kt=class extends s{async getConfig(){return this.get("/infra/connect/email/config")}async initDomainVerification(e){return this.post("/infra/connect/email/config/ses/domain",{domain:e})}async saveEmailConfig(e){return this.post("/infra/connect/email/config/ses/config",e)}async checkSesVerification(){return this.get("/infra/connect/email/config/ses/verify")}async removeSesIdentity(){return this.deleteRequest("/infra/connect/email/config/ses/domain")}async sendTest(e){return this.post("/infra/connect/email/config/test",{toEmail:e})}async saveAdvancedConfig(e){return this.post("/infra/connect/email/config/advanced",e)}async getHealth(){return this.get("/infra/connect/email/config/health")}async fixDmarc(){return this.post("/infra/connect/email/config/ses/fix-dmarc",{})}async listProviders(){return this.get("/infra/connect/email/config/providers")}};var Ct=class extends s{async create(e){return this.post("/infra/storage/files/folders",{name:e})}},wt=class extends s{async list(e,t){return this.get(`/infra/storage/files/files/${e}`,{params:t})}async getUploadUrl(e){return this.post("/infra/storage/files/upload-url",e)}async confirmUpload(e){return this.post("/infra/storage/files/confirm-upload",e)}async getDownloadUrl(e){return this.post("/infra/storage/files/download-url",{key:e})}async delete(e){return this.deleteRequest("/infra/storage/files/files",{params:{key:e}})}},vt=class extends s{async list(e={}){return this.get("/infra/storage/library",{params:e})}async folders(){return this.get("/infra/storage/library/folders")}async remove(e){return this.deleteRequest(`/infra/storage/library/${encodeURIComponent(e)}`)}};var pn={callChanged:"voice_call_changed"},An=["NOT_FOUND","VOICE_CALL_REFUSED","VOICE_NOT_SET_UP","VOICE_CAMPAIGN_NOT_APPROVED","VOICE_NOT_ENABLED","VOICE_AGENT_UNAVAILABLE","VOICE_RUNTIME_UNAVAILABLE","VOICE_PREVIEW_FAILED","VOICE_NOT_CONFIGURED","LEAD_NOT_FOUND","INSUFFICIENT_CREDITS"];function gn(n){let e=n instanceof y?n.code:void 0;return e&&An.includes(e)?e:void 0}var Kt={gate:"Voice calling isn't switched on for this workspace.",bad_number:"That phone number isn't a number we can call.",do_not_call:"They asked not to be called again.",dnd:"Their number is on the Do Not Disturb register.",hours:"No calling hours are open for this step.",recently_called:"They were called recently.",promotional:"Promotional calls aren't offered. Calls are for service, reminders, callbacks and demo follow-ups.",no_consent:"No record that they agreed to a phone call, or asked for one. They are not called.",campaign_stopped:"This campaign was stopped.",test_limit:"You can ring your own phone 3 times a day. Try again tomorrow.",not_on_plan:"Voice isn't on your plan. Upgrade your plan to use voice calls.",minutes_used_up:"You've used this month's included voice minutes. Your plan has no extra minutes.",low_balance:"Your balance is below \u20B910. Add credits to place voice calls."};function dn(n){var e;return(e=Kt[n])!=null?e:n}var ve=encodeURIComponent,Ee=class extends s{get flow(){return new P(this.client)}list(e={}){return this.flow.list(e)}retrieve(e){return this.flow.retrieve(e)}create(e){return this.flow.create(e)}launch(e,t={}){return this.flow.launch(e,t)}start(e,t={}){return this.flow.start(e,t)}pause(e){return this.flow.pause(e)}resume(e){return this.flow.resume(e)}stop(e){return this.flow.stop(e)}costPreview(e){return this.get(`/product/flow/campaigns/${ve(e)}/voice-preview`)}counters(e){return this.get(`/infra/connect/voice/campaigns/${ve(e)}/counters`)}approval(e){return this.get(`/infra/connect/voice/campaigns/${ve(e)}/approval`)}requestApproval(e){return this.post(`/infra/connect/voice/campaigns/${ve(e)}/approval/request`,{})}},Te=class extends s{constructor(t){super(t);i(this,"campaigns");this.campaigns=new Ee(t)}status(){return this.get("/infra/connect/voice/status")}setup(){return this.get("/infra/connect/voice/setup")}connect(){return this.post("/infra/connect/voice/setup/connect",{})}setupNumbers(t={}){return this.get("/infra/connect/voice/setup/numbers",{params:p(p(p({},t.city?{city:t.city}:{}),t.pattern?{pattern:t.pattern}:{}),t.offset?{offset:String(t.offset)}:{})})}kycRequirements(){return this.get("/infra/connect/voice/setup/kyc/requirements")}kycUploadUrl(t){return this.post("/infra/connect/voice/setup/kyc/upload-url",t)}submitKyc(t){return this.post("/infra/connect/voice/setup/kyc",t)}pickNumber(t){return this.post("/infra/connect/voice/setup/number",{number:t})}releaseNumber(t){return this.deleteRequest(`/infra/connect/voice/setup/numbers/${ve(t)}`)}goLive(){return this.post("/infra/connect/voice/setup/go-live",{})}pause(){return this.post("/infra/connect/voice/setup/pause",{})}disconnect(){return this.post("/infra/connect/voice/setup/disconnect",{})}agent(){return this.get("/infra/connect/voice/agent")}skills(){return this.get("/infra/connect/voice/skills")}voices(t){return this.get(`/infra/connect/voice/voices?language=${encodeURIComponent(t)}`)}saveAgent(t){return this.put("/infra/connect/voice/agent",t)}agents(){return this.get("/infra/connect/voice/agents")}createAgent(t){return this.post("/infra/connect/voice/agents",t)}getAgent(t){return this.get(`/infra/connect/voice/agents/${encodeURIComponent(t)}`)}updateAgent(t,r){return this.put(`/infra/connect/voice/agents/${encodeURIComponent(t)}`,r)}setAgentLead(t,r){return this.put(`/infra/connect/voice/agents/${encodeURIComponent(t)}/lead`,{customAgentId:r})}deleteAgent(t){return this.deleteRequest(`/infra/connect/voice/agents/${encodeURIComponent(t)}`)}numbers(){return this.get("/infra/connect/voice/numbers")}updateNumber(t,r){return this.patch(`/infra/connect/voice/numbers/${encodeURIComponent(t)}`,r)}async preview(t={}){var r;try{return(await this.client.post("/infra/connect/voice/preview",t,{responseType:"arraybuffer"})).data}catch(o){let a=(r=o==null?void 0:o.response)==null?void 0:r.data;if(a instanceof ArrayBuffer||ArrayBuffer.isView(a))try{o.response.data=JSON.parse(new TextDecoder().decode(a))}catch(u){o.response.data=void 0}throw $(o)}}lines(){return this.get("/infra/connect/voice/lines")}activity(){return this.get("/infra/connect/voice/activity")}calls(t={}){return this.get("/infra/connect/voice/calls",{params:t})}call(t){return this.get(`/infra/connect/voice/calls/${ve(t)}`)}callWithAI(t){return this.post("/infra/connect/voice/calls",t)}checkCallWithAI(t){return this.post("/infra/connect/voice/calls/check",t)}callMyPhone(t={}){return this.post("/infra/connect/voice/calls/my-phone",t)}testCall(t={}){return this.post("/infra/connect/voice/test-call",t)}};var Tt=class extends s{async list(e){return this.get("/platform/inbox/conversations",{params:e})}async create(e){var t;return this.post("/platform/inbox/conversations",{address:e.phone,channel:(t=e.channel)!=null?t:"whatsapp",userName:e.name})}async linkLead(e,t){return this.patch(`/platform/inbox/conversations/${e}/lead`,{leadId:t})}async retrieve(e){return this.get(`/platform/inbox/conversations/${e}`)}async messages(e,t){return this.get(`/platform/inbox/conversations/${e}/messages`,{params:t})}async setStatus(e,t){return this.patch(`/platform/inbox/conversations/${e}/status`,{status:t})}async markRead(e){return this.post(`/platform/inbox/conversations/${e}/read`,{})}async delete(e){return this.deleteRequest(`/platform/inbox/conversations/${e}`)}async bulkDelete(e){return this.post("/platform/inbox/conversations/bulk-delete",{ids:e})}};var St=class extends s{async list(e){return this.get("/infra/connect/whatsapp/templates",{params:e})}async sync(e={}){return this.post("/infra/connect/whatsapp/templates/sync",e.accountId?{accountId:e.accountId}:{})}async retrieve(e){return this.get(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}`)}async create(e){return this.post("/infra/connect/whatsapp/templates",e)}async update(e,t){return this.put(`/infra/connect/whatsapp/templates/${e}`,t)}async fix(e){return this.post(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/fix`,{})}async resubmit(e,t){return this.post(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/resubmit`,t)}async deleteTemplate(e,t,r){let o=new URLSearchParams;t&&o.set("force","true"),r&&o.set("accountId",r);let a=o.toString();return this.deleteRequest(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}${a?`?${a}`:""}`)}async mappingConfig(){return this.get("/infra/connect/whatsapp/templates/mapping/config")}async mappingSources(){return this.get("/infra/connect/whatsapp/templates/mapping/sources")}async collections(){return this.get("/infra/connect/whatsapp/templates/collections")}async collectionFields(e){return this.get(`/infra/connect/whatsapp/templates/collections/${encodeURIComponent(e)}/fields`)}async updateMapping(e,t){return this.put(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/mapping`,t)}async validate(e,t){let r=`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/validate`;return t?this.post(r,t):this.get(r)}async preview(e,t,r,o){return this.post(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/preview`,{context:t,mappings:r,onEmptyVariable:o})}async getVariableManifest(e){var a,u;let t=await this.retrieve(e),r=Array.isArray((a=t.data)==null?void 0:a.components)?t.data.components:[],o=[];for(let d of r)if(d.text){let g=d.text.match(/{{(\d+)}}/g);if(g)for(let k of g){let b=k.replace(/{{|}}/g,"");o.push({key:`var_${b}`,label:`${d.type} Var {{${b}}}`,type:"string",required:!0,group:d.type,description:`Variable placeholder in template ${d.type}`})}}return{name:`Template variables: ${((u=t.data)==null?void 0:u.name)||e}`,fields:o,uiHints:{icon:"Variables",primaryColor:"#059669"}}}};var At=class extends s{async retrieve(e){return this.get("/infra/connect/whatsapp/setup",e?{params:{accountId:e}}:void 0)}async saveProfile(e){return this.put("/infra/connect/whatsapp/setup/profile",e)}async sendTest(e){return this.post("/infra/connect/whatsapp/setup/test",e)}async uploadPhoto(e){return this.post("/infra/connect/whatsapp/setup/profile/photo",e)}async move(e){return this.post("/infra/connect/whatsapp/setup/move",e)}async uploadMedia(e){return this.post("/infra/connect/whatsapp/setup/media",e)}};var $e=class{constructor(e){i(this,"messages");i(this,"conversations");this.messages=new le(e),this.conversations=new Tt(e)}},Oe=class{constructor(e){i(this,"leads");i(this,"pipelines");i(this,"activities");i(this,"analytics");i(this,"scoring");i(this,"payments");i(this,"chat");i(this,"events");i(this,"invoices");i(this,"checkout");i(this,"projects");i(this,"niche");i(this,"documents");i(this,"invoiceExport");i(this,"ai");this.leads=new Xe(e),this.pipelines=new et(e),this.activities=new Qe(e),this.analytics=new ze(e),this.scoring=new tt(e),this.payments=new Ze(e),this.chat=new $e(e),this.events=new rt(e),this.invoices=new ot(e),this.checkout=new Ge(e),this.projects=new xt(e),this.niche=new lt(e),this.documents=new Ye(e),this.invoiceExport=new Je(e),this.ai=new F(e)}},Ve=class{constructor(e){i(this,"automations");i(this,"campaigns");i(this,"conversations");i(this,"home");i(this,"drafts");i(this,"firstRun");i(this,"audiences");this.automations=new _(e),this.campaigns=new P(e),this.conversations=new B(e),this.home=new q(e),this.drafts=new K(e),this.firstRun=new W(e),this.audiences=new j(e)}},De=class{constructor(e){i(this,"projects");i(this,"audits");i(this,"insights");i(this,"searchConsole");i(this,"ranks");i(this,"local");i(this,"reports");i(this,"backlinks");i(this,"performance");i(this,"briefs");i(this,"research");this.projects=new pe(e),this.audits=new ge(e),this.insights=new de(e),this.searchConsole=new me(e),this.ranks=new ye(e),this.local=new fe(e),this.reports=new be(e),this.backlinks=new xe(e),this.performance=new ke(e),this.briefs=new Ce(e),this.research=new he(e)}},Fe=class{constructor(e){i(this,"packs");i(this,"signals");i(this,"tools");i(this,"campaigns");i(this,"runs");i(this,"leads");i(this,"import");i(this,"lists");i(this,"compliance");i(this,"market");i(this,"learning");i(this,"lookalikes");i(this,"freshness");i(this,"audit");this.packs=new G(e),this.signals=new H(e),this.tools=new Q(e),this.campaigns=new z(e),this.runs=new Y(e),this.leads=new J(e),this.import=new X(e),this.lists=new Z(e),this.compliance=new ee(e),this.market=new te(e),this.learning=new ne(e),this.lookalikes=new re(e),this.freshness=new se(e),this.audit=new ie(e)}},Se=class{constructor(e){i(this,"erix");i(this,"flow");i(this,"seo");i(this,"laie");this.erix=new Oe(e),this.flow=new Ve(e),this.seo=new De(e),this.laie=new Fe(e)}},Ue=class{constructor(e){i(this,"config");i(this,"templates");this.config=new kt(e),this.templates=new nt(e)}},Me=class{constructor(e){i(this,"templates");i(this,"setup");this.templates=new St(e),this.setup=new At(e)}},Wt=class{constructor(e){i(this,"leadForms");this.leadForms=new st(e)}},_e=class{constructor(e){i(this,"email");i(this,"whatsapp");i(this,"facebook");i(this,"meet");i(this,"connections");i(this,"accounts");i(this,"channelSettings");i(this,"voice");this.email=new Ue(e),this.whatsapp=new Me(e),this.facebook=new Wt(e),this.meet=new ct(e),this.connections=new He(e),this.accounts=new M(e),this.channelSettings=new U(e),this.voice=new Te(e)}},Ne=class{constructor(e){i(this,"files");i(this,"folders");i(this,"media");i(this,"library");this.files=new wt(e),this.folders=new Ct(e),this.media=new at(e),this.library=new vt(e)}},jt=class{constructor(e){i(this,"collector");this.collector=new we(e)}},Ae=class{constructor(e){i(this,"connect");i(this,"storage");i(this,"serp");this.connect=new _e(e),this.storage=new Ne(e),this.serp=new jt(e)}},Be=class{constructor(e){i(this,"onboarding");i(this,"persona");i(this,"audit");this.onboarding=new oe(e),this.persona=new ae(e),this.audit=new gt(e)}},qe=class{constructor(e){i(this,"me");i(this,"members");i(this,"sessions");i(this,"notifications");this.me=new ft(e),this.members=new bt(e),this.sessions=new ht(e),this.notifications=new ut(e)}},Re=class{constructor(e){i(this,"auth");i(this,"users");i(this,"tenants");i(this,"billing");i(this,"support");i(this,"ai");i(this,"knowledge");i(this,"health");i(this,"catalog");this.auth=new dt(e),this.users=new qe(e),this.tenants=new Be(e),this.billing=new mt(e),this.support=new yt(e),this.ai=new pt(e),this.knowledge=new ue(e),this.health=new it(e),this.catalog=new ce(e)}};var L=class extends y{constructor(e){super(e,400,"invalid_signature"),this.name="WebhookSignatureError"}},Ie=class{async constructEvent(e,t,r){if(!t)throw new L("No webhook signature provided");let o=Array.isArray(t)?t[0]:t;o.startsWith("sha256=")&&(o=o.slice(7));try{let a=await import("crypto"),d=a.createHmac("sha256",r).update(e).digest("hex");if(!a.timingSafeEqual(Buffer.from(d),Buffer.from(o)))throw new L("Invalid webhook signature provided");return JSON.parse(e.toString("utf8"))}catch(a){throw a instanceof L?a:new L(`Webhook payload parsing failed: ${a.message}`)}}};var Gt=typeof process!="undefined"&&"4.3.1"||"3.1.1";var mn,Ht=(mn=Qt.default.default)!=null?mn:Qt.default,O=class{constructor(e){i(this,"client");i(this,"socket",null);i(this,"startSocket",null);i(this,"socketPromise",null);i(this,"socketQueue",[]);i(this,"clientCode");i(this,"apiVersion");i(this,"platform");i(this,"product");i(this,"infra");i(this,"webhooks");i(this,"lastSeq");i(this,"closed",!1);var b,T,S,V,h,Yt,Jt,Xt;let t=e.proxy;if(!e.apiKey&&!t)throw new v("API Key is required");this.clientCode=(b=e.clientCode)==null?void 0:b.toUpperCase(),this.apiVersion=(T=e.version)!=null?T:"v1";let r=(S=e.baseUrl)!=null?S:Lt,o=on(this.apiVersion,(V=t==null?void 0:t.url)!=null?V:r),a=e.socketUrl||r,u=typeof window!="undefined"&&typeof window.document!="undefined",d=u?"browser":typeof process!="undefined"?`node ${process.version}`:"unknown",g=u?((h=globalThis.navigator)==null?void 0:h.userAgent)||"browser":typeof process!="undefined"?process.platform:"unknown",k=E(p({},t?{}:{"x-api-key":e.apiKey,"x-client-code":((Yt=e.clientCode)==null?void 0:Yt.toUpperCase())||""}),{"Content-Type":"application/json","x-ecodrix-client-agent":JSON.stringify({sdk_version:Gt,runtime:d,os:g})});if(this.client=yn.default.create({baseURL:o,headers:k,timeout:(Jt=e.timeout)!=null?Jt:3e4}),Ht(this.client,{retries:3,retryDelay:Ht.exponentialDelay,retryCondition:w=>{var Ke;return Ht.isNetworkOrIdempotentRequestError(w)||((Ke=w.response)==null?void 0:Ke.status)===429},onRetry:(w,Ke,Zt)=>{var en,tn;typeof process!="undefined"&&((en=process.env)==null?void 0:en.NODE_ENV)==="development"&&console.warn(`[ECODrIx SDK] Retrying request (${w}/3): ${(tn=Zt.method)==null?void 0:tn.toUpperCase()} ${Zt.url}. Reason: ${Ke.message}`)}}),this.platform=new Re(this.client),this.product=new Se(this.client),this.infra=new Ae(this.client),this.webhooks=new Ie,t){if(t.ticket){let w=t.ticket;this.startSocket=()=>this.initSocket(a,async()=>({ticket:await w()}))}}else{let w={apiKey:e.apiKey,clientCode:((Xt=e.clientCode)==null?void 0:Xt.toUpperCase())||""};this.startSocket=()=>this.initSocket(a,async()=>w,{"x-api-key":w.apiKey,"x-client-code":w.clientCode})}if(u){let w={version:Gt,clientCode:e.clientCode,initializedAt:new Date().toISOString()};window.__ECODRIX_SDK__=w}}initSocket(e,t,r){return this.socketPromise?this.socketPromise:(this.socketPromise=import("socket.io-client").then(({io:o})=>{this.socket=o(e,{auth:a=>{t().then(u=>a(E(p({},u),{lastSeq:this.lastSeq})),()=>a({lastSeq:this.lastSeq}))},extraHeaders:r,transports:["websocket","polling"],tryAllTransports:!0}),this.setupSocket();for(let{type:a,args:u}of this.socketQueue)a==="joinRoom"?this.socket.emit("join-room",u[0]):a==="leaveRoom"?this.socket.emit("leave-room",u[0]):a==="on"?this.socket.on(u[0],u[1]):a==="off"?this.socket.off(u[0],u[1]):a==="disconnect"&&this.socket.disconnect();this.socketQueue=[]}),this.socketPromise)}joinRoom(e){var t;this.closed||(t=this.startSocket)==null||t.call(this),this.socket?this.socket.emit("join-room",e):this.socketQueue.push({type:"joinRoom",args:[e]})}leaveRoom(e){this.socket?this.socket.emit("leave-room",e):this.socketQueue.push({type:"leaveRoom",args:[e]})}setupSocket(){this.socket&&(this.socket.on("connect_error",()=>{var e;(e=this.socket)!=null&&e.active||setTimeout(()=>{var t;this.closed||(t=this.socket)==null||t.connect()},5e3)}),this.socket.onAny((...e)=>{var r,o;let t=(r=e.at(-1))==null?void 0:r.seq;typeof t=="number"&&t>((o=this.lastSeq)!=null?o:0)&&(this.lastSeq=t)}))}on(e,t){var r;return this.closed||(r=this.startSocket)==null||r.call(this),this.socket?this.socket.on(e,t):this.socketQueue.push({type:"on",args:[e,t]}),this}disconnect(){this.closed=!0,this.socket?this.socket.disconnect():this.socketPromise&&this.socketQueue.push({type:"disconnect",args:[]})}off(e,t){return this.socket?this.socket.off(e,t):this.socketQueue.push({type:"off",args:[e,t]}),this}async request(e,t,r,o){var a,u,d;try{return(await this.client.request(p({method:e,url:t,data:r,params:o},typeof FormData!="undefined"&&r instanceof FormData?{headers:{"Content-Type":!1}}:{}))).data}catch(g){throw g.response?new y(((a=g.response.data)==null?void 0:a.message)||((u=g.response.data)==null?void 0:u.error)||"Raw Execution Failed",g.response.status,(d=g.response.data)==null?void 0:d.code):new y(g.message||"Network Error")}}};var In={401:v,403:D,429:I};function Pn(n){throw $(n)}function Ln(n,e){return n instanceof e}function En(n){return n instanceof v?{message:n.message,status:n.status,code:n.code,type:"AuthenticationError"}:n instanceof I?{message:n.message,status:n.status,code:n.code,type:"RateLimitError"}:n instanceof y?{message:n.message,status:n.status,code:n.code,type:"APIError"}:{message:n.message||"Unknown error",type:"UnknownError"}}var zt={[v.name]:{shouldRetry:!1,reason:"Authentication errors require fixing credentials, not retrying"},[I.name]:{shouldRetry:!0,maxRetries:3,baseDelay:1e3,backoffMultiplier:2,reason:"Rate limit errors can be retried with exponential backoff"},[y.name]:{shouldRetry:!0,maxRetries:2,baseDelay:500,backoffMultiplier:1.5,reason:"Generic API errors may be transient and worth retrying"}};function $n(n){let e=n.constructor.name;return zt[e]||zt[y.name]}var On=O;0&&(module.exports={APIError,APIResource,AiAgent,AuthenticationError,Campaigns,Catalog,ChannelSettingsResource,Collector,ConnectAccounts,ConnectInfra,ECODrIx,ECODrIxAPI,ERROR_RETRY_CONFIG,EcodrixError,EmailConnect,ErixChat,ErixProduct,FlowAudiences,FlowAutomations,FlowConversations,FlowDrafts,FlowFirstRunResource,FlowHome,FlowProduct,HTTP_STATUS_ERROR_MAP,InfraDomain,KNOWLEDGE_FILE_TYPES,Knowledge,LAIE_EVENTS,LEAD_STATUS_VALUES,LaieAudits,LaieCampaigns,LaieCompliance,LaieFreshness,LaieImport,LaieLeads,LaieLearning,LaieLists,LaieLookalikes,LaieMarket,LaiePacks,LaieProduct,LaieRuns,LaieSignals,LaieTools,Onboarding,PermissionError,Persona,PlatformDomain,PlatformTenants,PlatformUsers,ProductDomain,RateLimitError,SeoAudits,SeoBacklinks,SeoBriefs,SeoInsights,SeoLocal,SeoPerformance,SeoProduct,SeoProjects,SeoRanks,SeoReports,SeoResearch,SeoSearchConsole,StorageInfra,VOICE_EVENTS,VOICE_REFUSAL_REASONS,Voice,VoiceCampaigns,WebhookSignatureError,Webhooks,WhatsAppConnect,getErrorDetails,getRetryConfig,handleAPIError,isAPIError,laieStageQueued,toAPIError,voiceErrorCode,voiceRefusalReason});
@@ -9578,6 +9578,17 @@ interface VoiceKycView {
9578
9578
  submittedAt: string | null;
9579
9579
  /** Why it was not accepted, in plain words (the phone partner's, or ECODrIx's); set only while `status` is rejected, suspended or expired. */
9580
9580
  rejectReason: string | null;
9581
+ /** The business details last sent, so "Send again" starts filled in; null before any. Never the document number. */
9582
+ details?: VoiceKycDetails | null;
9583
+ }
9584
+ /** The business details of a verification as typed (no document number). */
9585
+ interface VoiceKycDetails {
9586
+ legalName: string;
9587
+ email: string;
9588
+ addressLine1: string;
9589
+ city: string;
9590
+ state: string;
9591
+ postalCode: string;
9581
9592
  }
9582
9593
  /** The number count and money a workspace sees before renting a number (`voice.setup().numbers`). */
9583
9594
  interface VoiceNumbersQuote {
@@ -9610,6 +9621,8 @@ interface VoiceSetup {
9610
9621
  /** "Connect" done (the workspace's own phone account) or already live: the Phone calls page is open. */
9611
9622
  connected: boolean;
9612
9623
  numbers: VoiceNumbersQuote;
9624
+ /** Connected minutes the plan includes a month; null = no limit or not read. Server from 12 Nov 2026. */
9625
+ minutesIncluded?: number | null;
9613
9626
  }
9614
9627
  /** Indian numbers for sale (`setupNumbers()`), one page; `nextOffset` null/absent = the last page. */
9615
9628
  interface VoiceFreeNumbers {
@@ -9649,6 +9662,8 @@ interface VoiceKycInput {
9649
9662
  postalCode: string;
9650
9663
  /** GSTIN, CIN or Udyam number. */
9651
9664
  registrationNumber: string;
9665
+ /** The sender confirms the details are true and they may act for the business. Required from the server of 12 Nov 2026. */
9666
+ consent: true;
9652
9667
  /** One per document in `kycRequirements()`; `fileKey` / `fileName` from `kycUploadUrl()` after the PUT. */
9653
9668
  documents: {
9654
9669
  typeId: string;
@@ -9809,6 +9824,13 @@ declare class Voice extends APIResource {
9809
9824
  pause(): Promise<Ok<{
9810
9825
  live: false;
9811
9826
  }>>;
9827
+ /**
9828
+ * "Disconnect": calls stop and `setup().connected` reads false, so the Channels card offers Connect again.
9829
+ * Reversible with `connect()`; numbers, verification and rent stay (releasing a number is separate).
9830
+ */
9831
+ disconnect(): Promise<Ok<{
9832
+ connected: false;
9833
+ }>>;
9812
9834
  /** This workspace's assistant, or `data: null` before one is saved. */
9813
9835
  agent(): Promise<Ok<VoiceAgent | null>>;
9814
9836
  /** The phone skills an assistant can have, with their params. Render the switches from this. */
@@ -11315,4 +11337,4 @@ interface CustomFieldFilter {
11315
11337
  value?: unknown;
11316
11338
  }
11317
11339
 
11318
- export { type AIPersona, APIError, APIResource, type AddOnStatus, type AddOnView, type AgentAutomationTrigger, type AgentAutonomy, type AgentBudget, type AgentChannel, type AgentChatTurn, type AgentDraft, type AgentProposal, type AgentResults, type AgentTemplate, type AgentVersion, AiAgent, type AiAgentSettings, type AiAgentTool, type AiHumanTopics, type AiOutcomeChannel, type AiOutcomeCounts, type AiOutcomes, type AiReviewItem, type AiReviewStats, type AiReviewVerdict, type AiSuggestion, type AnswerFollowupBody, type AnswerOnboardingPayload, type AnswerOnboardingResponse, type AppSetup, type AppSetupStep, type AssignEventPayload, type AudienceChannel, type AudienceFieldRule, type AudienceInput, type AudienceLeftOut, type AudiencePerson, type AudiencePlainRule, type AudiencePreview, type AudienceRule, AuthenticationError, type AutomationCopilotChange, type AutomationCopilotDraft, type AutomationCopilotReach, type AutomationGraph, type AutomationLive, type AutomationLivePerson, type AutomationLiveStep, type AutomationStep, type AutomationTestData, type AutomationTestRunProgress, type AutomationTestRunStart, type AutomationTestRunState, type AutomationTestRunStep, type AutomationVersion, type AutomationVersionDetail, type AutomationVersions, type AutomationWeek, type BehaviorRules, type BuildAnswer, type BuildInput, type CampaignCheck, type CampaignChecks, type CampaignDetail, type CampaignGraph, type CampaignLaunchResult, type CampaignLaunchSummary, type CampaignListItem, type CampaignMode, type CampaignSettingsEdit, type CampaignState, type CampaignWaves, Campaigns, Catalog, type CatalogItem, type ChannelSettings, ChannelSettingsResource, type ChannelSettingsView, type CheckboxConfig, type CheckoutAddress, type CheckoutAmounts, type CheckoutCartEditInput, type CheckoutCoupon, type CheckoutCouponInput, type CheckoutCouponPatch, type CheckoutItem, type CheckoutOrder, type CheckoutOrderAction, type CheckoutOrderList, type CheckoutOrderStatus, type CheckoutProduct, type CheckoutProductInput, type CheckoutProductLink, type CheckoutRazorpayVerifyInput, type CheckoutResponse, type CheckoutSession, type CheckoutSettings, type CheckoutVerifyInput, type CheckoutVerifyResult, Collector, type CollectorKind, type CollectorResult, type CollectorTask, type ColorRule, type ColumnConfig, type CompleteOnboardingPayload, type CompleteOnboardingResponse, type ConfidenceResponse, type ConnectAccount, type ConnectAccountPatch, type ConnectAccountRouting, ConnectAccounts, type ConnectAppAccess, ConnectInfra, type ConnectionHealth, type ConnectionView, type Conversation, type ConversationButton, type ConversationButtonTarget, type ConversationCheck, type ConversationCompare, type ConversationConfig, type ConversationDeployment, type ConversationDeploymentKind, type ConversationDeploymentStats, type ConversationField, type ListParams as ConversationListParams, type ConversationMode, type ConversationMovedToAgent, type ConversationReplyMessage, type ConversationReplySource, type ConversationRollout, type ConversationSaved, type ConversationStep, type ConversationTest, type ConversationTestRun, type ConversationTopic, type ConversationTopicKind, type ConversationTryReply, type ConversationTurn, type ConversationUsage, type ConversationVersion, type ConversationVersionDetail, type Correction, type CreateAgentInput, type CreateCampaignParams, type CreateConversationDeploymentParams, type CreateConversationParams, type CreateLeadParams, type CreatePipelineParams, type CrmView, type CurrencyConfig, type CurrencyValue, type CustomAgent, type CustomAgentPatch, type CustomAgentView, type CustomFieldFilter, type DateConfig, type DateTimeConfig, type DropdownConfig, type DuplicateLead, ECODrIxAPI as ECODrIx, ECODrIxAPI, type ECODrIxAPIOptions, ERROR_RETRY_CONFIG, type EditOnboardingPayload, type EditOnboardingResponse, type EmailConfig, EmailConnect, type EmailPause, ErixChat, ErixProduct, type EventDefinition, type FieldConfig, type FieldDefinition, type FieldManifest, type FieldType, type FileConfig, type FilterOperator, type FilterRule, type FlowAudience, FlowAudiences, FlowAutomations, type FlowBuildPlan, type FlowBuildTarget, type FlowConversation, FlowConversations, type FlowDraftKind, FlowDrafts, type FlowFirstRun, type FlowFirstRunInstall, FlowFirstRunResource, FlowHome, type FlowHomeCounts, type FlowHomeData, type FlowHomeNeed, type FlowHomeUsage, FlowProduct, type FormulaConfig, type GlobalOnboardingPayload, type GrievanceContact, HTTP_STATUS_ERROR_MAP, type ICP, type InboxChannel, InfraDomain, type InviteMemberInput, type InviteResult, KNOWLEDGE_FILE_TYPES, Knowledge, type KnowledgePassage, type KnowledgeSource, LAIE_EVENTS, LEAD_STATUS_VALUES, type LaieAsk, type LaieAssessment, LaieAudits, type LaieBulkResult, type LaieCampaign, type LaieCampaignInput, type LaieCampaignSettings, type LaieCampaignSettingsInput, type LaieCampaignSource, LaieCampaigns, type LaieCell, type LaieCollectInput, LaieCompliance, type LaieConfidence, type LaieCostClass, type LaieCrmImportResult, type LaieEmailCheck, type LaieEnvelope, type LaieFieldEvidence, type LaieFilters, type LaieFindResult, LaieFreshness, type LaieFreshnessStatus, LaieImport, type LaieImportComplete, type LaieLead, type LaieLeadDetail, type LaieLeadListQuery, type LaieLeadUpdate, LaieLeads, LaieLearning, type LaieListEnrichInput, type LaieListEnrichResult, type LaieListRow, LaieLists, type LaieLocality, LaieLookalikes, LaieMarket, type LaieNote, type LaiePack, type LaiePackCategory, type LaiePackId, LaiePacks, type LaiePage, type LaiePipeline, type LaiePipelineSummary, LaieProduct, type LaieRefusal, type LaieRun, type LaieRunChange, type LaieRunQuality, type LaieRunSummary, LaieRuns, type LaieSignalDef, type LaieSignalRow, LaieSignals, type LaieStageInput, type LaieStageName, type LaieStageResult, LaieTools, type LaieUseInput, type LaieUseResult, type LaieWebsiteLookup, type LaunchCampaignParams, type LayoutType, type Lead, type LeadFormView, type LeadFormsView, type LeadPattern, type LeadSource, type LeadStatus, type LearningMemory, type LibraryFile, type LibraryFolder, type ListLeadsParams, type ManagementMode, type ManifestFieldType, type MappingField, type MappingPreviewResult, type MappingSources, type MappingValidationResult, type MerchantCheckoutSession, type MerchantCheckoutSessionInput, type Message, type ModuleAgent, type ModuleAgentPatch, type ModuleAgentSettings, type ModuleAgentTool, type NichePack, type NichePackResearchConfig, type NichePackStatus, type NormalizedFieldValue, type NumberConfig, Onboarding, type OnboardingCohortRange, type OnboardingConfig, type OnboardingExperiment, type OnboardingExperimentStatus, type OnboardingExperimentVariant, type OnboardingMemoryMapping, type OnboardingOption, type OnboardingSession, type OnboardingSessionStatus, type OnboardingStateResponse, type OnboardingStep, type OnboardingStepType, type OrganizationUpdateInput, type OutboundMedia, type OutreachEdit, type OverageSetting, type PaginatedResponse, type PausedRun, type PermissionKey, type PermissionModuleInfo, type PermissionQuickStart, Persona, type PersonaFollowupQuestion, type PersonaFollowupsResponse, type PersonaIdentity, type PersonaTimelineEntry, type PersonaTimelineOptions, type PersonaTimelineResponse, type PhoneConfig, type Pipeline, type PipelineStage, type PipelineStageParams, type PlaceCheckoutOrderInput, type PlacedCheckoutOrder, PlatformDomain, PlatformTenants, PlatformUsers, ProductDomain, type ProgressConfig, type ProposeAgentChangeInput, type PublicCheckoutOrder, type PublicCheckoutProduct, type PublicCheckoutProductResponse, type PublicMerchantCart, type PublicMerchantSession, type PublicMerchantSessionResponse, RateLimitError, type RatingConfig, type RazorpayCheckoutOptions, type ReinforceResponse, type ReinforcementEvent, type RelationConfig, type RelationValue, type RequestOptions, type ResourceManifest, type SendMessageParams, type SendTemplateParams, SeoAudits, type SeoBacklinkOverview, type SeoBacklinkSite, SeoBacklinks, type SeoBrief, type SeoBriefPage, type SeoBriefResult, SeoBriefs, type SeoCcRelease, type SeoCcReleaseRow, type SeoCompetitor, type SeoDifficulty, type SeoDirectory, type SeoDirectoryListing, type SeoDomainStrength, type SeoEnvelope, type SeoFormat, type SeoGap, type SeoGoogleFeatures, type SeoGridPoint, type SeoGscAccess, type SeoGscDenied, type SeoGscImportResult, type SeoGscRow, type SeoGscSummary, type SeoGscTop, SeoInsights, type SeoKeywordIdea, type SeoLabel, SeoLocal, type SeoLocalCheck, type SeoLocalGrid, type SeoLocalGridRow, type SeoLocalHistoryRow, type SeoMapsProfile, type SeoOwnerVerificationMethod, SeoPerformance, SeoProduct, type SeoProject, type SeoProjectInput, SeoProjects, type SeoRankAddResult, type SeoRankChange, type SeoRankCheckRow, type SeoRankDevice, type SeoRankKeyword, type SeoRankLang, type SeoRankMove, type SeoRankPosition, type SeoRankTargetOptions, SeoRanks, type SeoReferringChanges, type SeoReferringDomain, type SeoReferringDomains, type SeoReport, SeoReports, SeoResearch, type SeoRun, type SeoSchedule, type SeoScoreRule, SeoSearchConsole, type SeoSourced, type SeoTopThree, type SeoVisibility, type SeoVisibilityNow, type SeoVitalsCheck, type SeoVitalsField, type SeoVitalsLab, type SeoVitalsStrategy, type ServiceConfig, type ServiceConfigGlobal, type ServiceConfigPerProduct, type SettingsChannel, type SortRule, type StartOnboardingPayload, type StartOnboardingResponse, type StarterKind, type StarterPack, StorageInfra, type StoredFieldValue, type SuggestionEvent, type TagsConfig, type TeamAccessCatalog, type TeamInvitation, type TeamMember, type Template, type TemplateApiResponse, type TemplateBinding, type TemplateBindingSource, type TemplateButton, type TemplateCheck, type TemplateComponent, type TemplateDraft, type TemplateEmptyPolicy, type TemplateFix, type TemplateMapping, type TemplateResubmitInput, type TemplateResubmitResult, type TextConfig, type TriggerPayload, type TriggerResponse, type TryAgentInput, type TryAgentResult, type TryAgentToolCall, type UnansweredQuestion, type UpdateCampaignParams, type UpdateConversationDeploymentParams, type UpdateConversationParams, type UpdateMemberAccessInput, type UpsertLeadParams, type UrlConfig, VOICE_EVENTS, VOICE_REFUSAL_REASONS, type ViewConfig, type Vocabulary, Voice, type VoiceActivity, type VoiceAfterHours, type VoiceAgent, type VoiceAgentInput, type VoiceAgentSummary, type VoiceAudiencePreview, type VoiceBusinessHours, type VoiceBusinessType, type VoiceCall, type VoiceCallAction, type VoiceCallChanged, type VoiceCallCheck, type VoiceCallDetail, type VoiceCallFilters, type VoiceCallQueued, type VoiceCampaignApproval, type VoiceCampaignCounters, VoiceCampaigns, type VoiceDay, type VoiceDirection, type VoiceDisposition, type VoiceErrorCode, type VoiceForwardSlot, type VoiceFreeNumbers, type VoiceKycDocumentType, type VoiceKycInput, type VoiceKycRequirement, type VoiceKycStatus, type VoiceKycUpload, type VoiceKycView, type VoiceLines, type VoiceLiveStatus, type VoiceNumber, type VoiceNumberPatch, type VoiceNumbersQuote, type VoiceOption, type VoicePreviewInput, type VoicePronunciation, type VoicePurpose, type VoiceRefusalCode, type VoiceSetup, type VoiceSetupCurrent, type VoiceSetupStep, type VoiceSkill, type VoiceSkillMap, type VoiceSkillParam, type VoiceSpeakingStyle, type VoiceStatus, type VoiceStyle, type VoiceTool, type VoiceTranscriptTurn, WebchatOwnerSettings, WebchatSettingsPatch, WebhookSignatureError, Webhooks, WhatsAppConnect, type WhatsAppProfile, type WhatsAppProfileInput, type WhatsAppSetup, type WhatsAppTestInput, type WorkspaceAuditItem, type WorkspaceAuditPage, type WorkspaceAuditParams, type WorkspaceDashboardLayout, type WorkspaceDefaultAutomation, type WorkspaceDefaultField, type WorkspaceDefaultPipeline, type WorkspaceModuleConfig, type WorkspaceProfile, ECODrIxAPI as default, getErrorDetails, getRetryConfig, handleAPIError, isAPIError, laieStageQueued, voiceErrorCode, voiceRefusalReason };
11340
+ export { type AIPersona, APIError, APIResource, type AddOnStatus, type AddOnView, type AgentAutomationTrigger, type AgentAutonomy, type AgentBudget, type AgentChannel, type AgentChatTurn, type AgentDraft, type AgentProposal, type AgentResults, type AgentTemplate, type AgentVersion, AiAgent, type AiAgentSettings, type AiAgentTool, type AiHumanTopics, type AiOutcomeChannel, type AiOutcomeCounts, type AiOutcomes, type AiReviewItem, type AiReviewStats, type AiReviewVerdict, type AiSuggestion, type AnswerFollowupBody, type AnswerOnboardingPayload, type AnswerOnboardingResponse, type AppSetup, type AppSetupStep, type AssignEventPayload, type AudienceChannel, type AudienceFieldRule, type AudienceInput, type AudienceLeftOut, type AudiencePerson, type AudiencePlainRule, type AudiencePreview, type AudienceRule, AuthenticationError, type AutomationCopilotChange, type AutomationCopilotDraft, type AutomationCopilotReach, type AutomationGraph, type AutomationLive, type AutomationLivePerson, type AutomationLiveStep, type AutomationStep, type AutomationTestData, type AutomationTestRunProgress, type AutomationTestRunStart, type AutomationTestRunState, type AutomationTestRunStep, type AutomationVersion, type AutomationVersionDetail, type AutomationVersions, type AutomationWeek, type BehaviorRules, type BuildAnswer, type BuildInput, type CampaignCheck, type CampaignChecks, type CampaignDetail, type CampaignGraph, type CampaignLaunchResult, type CampaignLaunchSummary, type CampaignListItem, type CampaignMode, type CampaignSettingsEdit, type CampaignState, type CampaignWaves, Campaigns, Catalog, type CatalogItem, type ChannelSettings, ChannelSettingsResource, type ChannelSettingsView, type CheckboxConfig, type CheckoutAddress, type CheckoutAmounts, type CheckoutCartEditInput, type CheckoutCoupon, type CheckoutCouponInput, type CheckoutCouponPatch, type CheckoutItem, type CheckoutOrder, type CheckoutOrderAction, type CheckoutOrderList, type CheckoutOrderStatus, type CheckoutProduct, type CheckoutProductInput, type CheckoutProductLink, type CheckoutRazorpayVerifyInput, type CheckoutResponse, type CheckoutSession, type CheckoutSettings, type CheckoutVerifyInput, type CheckoutVerifyResult, Collector, type CollectorKind, type CollectorResult, type CollectorTask, type ColorRule, type ColumnConfig, type CompleteOnboardingPayload, type CompleteOnboardingResponse, type ConfidenceResponse, type ConnectAccount, type ConnectAccountPatch, type ConnectAccountRouting, ConnectAccounts, type ConnectAppAccess, ConnectInfra, type ConnectionHealth, type ConnectionView, type Conversation, type ConversationButton, type ConversationButtonTarget, type ConversationCheck, type ConversationCompare, type ConversationConfig, type ConversationDeployment, type ConversationDeploymentKind, type ConversationDeploymentStats, type ConversationField, type ListParams as ConversationListParams, type ConversationMode, type ConversationMovedToAgent, type ConversationReplyMessage, type ConversationReplySource, type ConversationRollout, type ConversationSaved, type ConversationStep, type ConversationTest, type ConversationTestRun, type ConversationTopic, type ConversationTopicKind, type ConversationTryReply, type ConversationTurn, type ConversationUsage, type ConversationVersion, type ConversationVersionDetail, type Correction, type CreateAgentInput, type CreateCampaignParams, type CreateConversationDeploymentParams, type CreateConversationParams, type CreateLeadParams, type CreatePipelineParams, type CrmView, type CurrencyConfig, type CurrencyValue, type CustomAgent, type CustomAgentPatch, type CustomAgentView, type CustomFieldFilter, type DateConfig, type DateTimeConfig, type DropdownConfig, type DuplicateLead, ECODrIxAPI as ECODrIx, ECODrIxAPI, type ECODrIxAPIOptions, ERROR_RETRY_CONFIG, type EditOnboardingPayload, type EditOnboardingResponse, type EmailConfig, EmailConnect, type EmailPause, ErixChat, ErixProduct, type EventDefinition, type FieldConfig, type FieldDefinition, type FieldManifest, type FieldType, type FileConfig, type FilterOperator, type FilterRule, type FlowAudience, FlowAudiences, FlowAutomations, type FlowBuildPlan, type FlowBuildTarget, type FlowConversation, FlowConversations, type FlowDraftKind, FlowDrafts, type FlowFirstRun, type FlowFirstRunInstall, FlowFirstRunResource, FlowHome, type FlowHomeCounts, type FlowHomeData, type FlowHomeNeed, type FlowHomeUsage, FlowProduct, type FormulaConfig, type GlobalOnboardingPayload, type GrievanceContact, HTTP_STATUS_ERROR_MAP, type ICP, type InboxChannel, InfraDomain, type InviteMemberInput, type InviteResult, KNOWLEDGE_FILE_TYPES, Knowledge, type KnowledgePassage, type KnowledgeSource, LAIE_EVENTS, LEAD_STATUS_VALUES, type LaieAsk, type LaieAssessment, LaieAudits, type LaieBulkResult, type LaieCampaign, type LaieCampaignInput, type LaieCampaignSettings, type LaieCampaignSettingsInput, type LaieCampaignSource, LaieCampaigns, type LaieCell, type LaieCollectInput, LaieCompliance, type LaieConfidence, type LaieCostClass, type LaieCrmImportResult, type LaieEmailCheck, type LaieEnvelope, type LaieFieldEvidence, type LaieFilters, type LaieFindResult, LaieFreshness, type LaieFreshnessStatus, LaieImport, type LaieImportComplete, type LaieLead, type LaieLeadDetail, type LaieLeadListQuery, type LaieLeadUpdate, LaieLeads, LaieLearning, type LaieListEnrichInput, type LaieListEnrichResult, type LaieListRow, LaieLists, type LaieLocality, LaieLookalikes, LaieMarket, type LaieNote, type LaiePack, type LaiePackCategory, type LaiePackId, LaiePacks, type LaiePage, type LaiePipeline, type LaiePipelineSummary, LaieProduct, type LaieRefusal, type LaieRun, type LaieRunChange, type LaieRunQuality, type LaieRunSummary, LaieRuns, type LaieSignalDef, type LaieSignalRow, LaieSignals, type LaieStageInput, type LaieStageName, type LaieStageResult, LaieTools, type LaieUseInput, type LaieUseResult, type LaieWebsiteLookup, type LaunchCampaignParams, type LayoutType, type Lead, type LeadFormView, type LeadFormsView, type LeadPattern, type LeadSource, type LeadStatus, type LearningMemory, type LibraryFile, type LibraryFolder, type ListLeadsParams, type ManagementMode, type ManifestFieldType, type MappingField, type MappingPreviewResult, type MappingSources, type MappingValidationResult, type MerchantCheckoutSession, type MerchantCheckoutSessionInput, type Message, type ModuleAgent, type ModuleAgentPatch, type ModuleAgentSettings, type ModuleAgentTool, type NichePack, type NichePackResearchConfig, type NichePackStatus, type NormalizedFieldValue, type NumberConfig, Onboarding, type OnboardingCohortRange, type OnboardingConfig, type OnboardingExperiment, type OnboardingExperimentStatus, type OnboardingExperimentVariant, type OnboardingMemoryMapping, type OnboardingOption, type OnboardingSession, type OnboardingSessionStatus, type OnboardingStateResponse, type OnboardingStep, type OnboardingStepType, type OrganizationUpdateInput, type OutboundMedia, type OutreachEdit, type OverageSetting, type PaginatedResponse, type PausedRun, type PermissionKey, type PermissionModuleInfo, type PermissionQuickStart, Persona, type PersonaFollowupQuestion, type PersonaFollowupsResponse, type PersonaIdentity, type PersonaTimelineEntry, type PersonaTimelineOptions, type PersonaTimelineResponse, type PhoneConfig, type Pipeline, type PipelineStage, type PipelineStageParams, type PlaceCheckoutOrderInput, type PlacedCheckoutOrder, PlatformDomain, PlatformTenants, PlatformUsers, ProductDomain, type ProgressConfig, type ProposeAgentChangeInput, type PublicCheckoutOrder, type PublicCheckoutProduct, type PublicCheckoutProductResponse, type PublicMerchantCart, type PublicMerchantSession, type PublicMerchantSessionResponse, RateLimitError, type RatingConfig, type RazorpayCheckoutOptions, type ReinforceResponse, type ReinforcementEvent, type RelationConfig, type RelationValue, type RequestOptions, type ResourceManifest, type SendMessageParams, type SendTemplateParams, SeoAudits, type SeoBacklinkOverview, type SeoBacklinkSite, SeoBacklinks, type SeoBrief, type SeoBriefPage, type SeoBriefResult, SeoBriefs, type SeoCcRelease, type SeoCcReleaseRow, type SeoCompetitor, type SeoDifficulty, type SeoDirectory, type SeoDirectoryListing, type SeoDomainStrength, type SeoEnvelope, type SeoFormat, type SeoGap, type SeoGoogleFeatures, type SeoGridPoint, type SeoGscAccess, type SeoGscDenied, type SeoGscImportResult, type SeoGscRow, type SeoGscSummary, type SeoGscTop, SeoInsights, type SeoKeywordIdea, type SeoLabel, SeoLocal, type SeoLocalCheck, type SeoLocalGrid, type SeoLocalGridRow, type SeoLocalHistoryRow, type SeoMapsProfile, type SeoOwnerVerificationMethod, SeoPerformance, SeoProduct, type SeoProject, type SeoProjectInput, SeoProjects, type SeoRankAddResult, type SeoRankChange, type SeoRankCheckRow, type SeoRankDevice, type SeoRankKeyword, type SeoRankLang, type SeoRankMove, type SeoRankPosition, type SeoRankTargetOptions, SeoRanks, type SeoReferringChanges, type SeoReferringDomain, type SeoReferringDomains, type SeoReport, SeoReports, SeoResearch, type SeoRun, type SeoSchedule, type SeoScoreRule, SeoSearchConsole, type SeoSourced, type SeoTopThree, type SeoVisibility, type SeoVisibilityNow, type SeoVitalsCheck, type SeoVitalsField, type SeoVitalsLab, type SeoVitalsStrategy, type ServiceConfig, type ServiceConfigGlobal, type ServiceConfigPerProduct, type SettingsChannel, type SortRule, type StartOnboardingPayload, type StartOnboardingResponse, type StarterKind, type StarterPack, StorageInfra, type StoredFieldValue, type SuggestionEvent, type TagsConfig, type TeamAccessCatalog, type TeamInvitation, type TeamMember, type Template, type TemplateApiResponse, type TemplateBinding, type TemplateBindingSource, type TemplateButton, type TemplateCheck, type TemplateComponent, type TemplateDraft, type TemplateEmptyPolicy, type TemplateFix, type TemplateMapping, type TemplateResubmitInput, type TemplateResubmitResult, type TextConfig, type TriggerPayload, type TriggerResponse, type TryAgentInput, type TryAgentResult, type TryAgentToolCall, type UnansweredQuestion, type UpdateCampaignParams, type UpdateConversationDeploymentParams, type UpdateConversationParams, type UpdateMemberAccessInput, type UpsertLeadParams, type UrlConfig, VOICE_EVENTS, VOICE_REFUSAL_REASONS, type ViewConfig, type Vocabulary, Voice, type VoiceActivity, type VoiceAfterHours, type VoiceAgent, type VoiceAgentInput, type VoiceAgentSummary, type VoiceAudiencePreview, type VoiceBusinessHours, type VoiceBusinessType, type VoiceCall, type VoiceCallAction, type VoiceCallChanged, type VoiceCallCheck, type VoiceCallDetail, type VoiceCallFilters, type VoiceCallQueued, type VoiceCampaignApproval, type VoiceCampaignCounters, VoiceCampaigns, type VoiceDay, type VoiceDirection, type VoiceDisposition, type VoiceErrorCode, type VoiceForwardSlot, type VoiceFreeNumbers, type VoiceKycDetails, type VoiceKycDocumentType, type VoiceKycInput, type VoiceKycRequirement, type VoiceKycStatus, type VoiceKycUpload, type VoiceKycView, type VoiceLines, type VoiceLiveStatus, type VoiceNumber, type VoiceNumberPatch, type VoiceNumbersQuote, type VoiceOption, type VoicePreviewInput, type VoicePronunciation, type VoicePurpose, type VoiceRefusalCode, type VoiceSetup, type VoiceSetupCurrent, type VoiceSetupStep, type VoiceSkill, type VoiceSkillMap, type VoiceSkillParam, type VoiceSpeakingStyle, type VoiceStatus, type VoiceStyle, type VoiceTool, type VoiceTranscriptTurn, WebchatOwnerSettings, WebchatSettingsPatch, WebhookSignatureError, Webhooks, WhatsAppConnect, type WhatsAppProfile, type WhatsAppProfileInput, type WhatsAppSetup, type WhatsAppTestInput, type WorkspaceAuditItem, type WorkspaceAuditPage, type WorkspaceAuditParams, type WorkspaceDashboardLayout, type WorkspaceDefaultAutomation, type WorkspaceDefaultField, type WorkspaceDefaultPipeline, type WorkspaceModuleConfig, type WorkspaceProfile, ECODrIxAPI as default, getErrorDetails, getRetryConfig, handleAPIError, isAPIError, laieStageQueued, voiceErrorCode, voiceRefusalReason };